新增示例(主子表提交)
This commit is contained in:
@@ -21,6 +21,7 @@ import com.ruoyi.common.core.text.Convert;
|
||||
import com.ruoyi.common.exception.BusinessException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.web.controller.demo.domain.CustomerModel;
|
||||
import com.ruoyi.web.controller.demo.domain.UserOperateModel;
|
||||
|
||||
/**
|
||||
@@ -153,6 +154,17 @@ public class DemoOperateController extends BaseController
|
||||
return AjaxResult.success(users.put(userId, user));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存主子表信息
|
||||
*/
|
||||
@PostMapping("/customer/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(CustomerModel customerModel)
|
||||
{
|
||||
System.out.println(customerModel.toString());
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改用户
|
||||
*/
|
||||
|
@@ -223,6 +223,15 @@ public class DemoTableController extends BaseController
|
||||
return prefix + "/editable";
|
||||
}
|
||||
|
||||
/**
|
||||
* 主子表提交
|
||||
*/
|
||||
@GetMapping("/subdata")
|
||||
public String subdata()
|
||||
{
|
||||
return prefix + "/subdata";
|
||||
}
|
||||
|
||||
/**
|
||||
* 表格其他操作
|
||||
*/
|
||||
|
@@ -0,0 +1,116 @@
|
||||
package com.ruoyi.web.controller.demo.domain;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 客户测试信息
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class CustomerModel
|
||||
{
|
||||
/**
|
||||
* 客户姓名
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 客户手机
|
||||
*/
|
||||
private String phonenumber;
|
||||
|
||||
/**
|
||||
* 客户性别
|
||||
*/
|
||||
private String sex;
|
||||
|
||||
/**
|
||||
* 客户生日
|
||||
*/
|
||||
private String birthday;
|
||||
|
||||
/**
|
||||
* 客户描述
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 商品信息
|
||||
*/
|
||||
private List<GoodsModel> goods;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPhonenumber()
|
||||
{
|
||||
return phonenumber;
|
||||
}
|
||||
|
||||
public void setPhonenumber(String phonenumber)
|
||||
{
|
||||
this.phonenumber = phonenumber;
|
||||
}
|
||||
|
||||
|
||||
public String getSex()
|
||||
{
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex)
|
||||
{
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getBirthday()
|
||||
{
|
||||
return birthday;
|
||||
}
|
||||
|
||||
public void setBirthday(String birthday)
|
||||
{
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public String getRemark()
|
||||
{
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark)
|
||||
{
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public List<GoodsModel> getGoods()
|
||||
{
|
||||
return goods;
|
||||
}
|
||||
|
||||
public void setGoods(List<GoodsModel> goods)
|
||||
{
|
||||
this.goods = goods;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("name", getName())
|
||||
.append("phonenumber", getPhonenumber())
|
||||
.append("sex", getSex())
|
||||
.append("birthday", getBirthday())
|
||||
.append("goods", getGoods())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@@ -0,0 +1,82 @@
|
||||
package com.ruoyi.web.controller.demo.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
/**
|
||||
* 商品测试信息
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class GoodsModel
|
||||
{
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品重量
|
||||
*/
|
||||
private Integer weight;
|
||||
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private Double price;
|
||||
|
||||
/**
|
||||
* 商品种类
|
||||
*/
|
||||
private String type;
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getWeight()
|
||||
{
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeight(Integer weight)
|
||||
{
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public Double getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(Double price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public String getType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type)
|
||||
{
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("name", getName())
|
||||
.append("weight", getWeight())
|
||||
.append("price", getPrice())
|
||||
.append("type", getType())
|
||||
.toString();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user