refactor(frozen-sale/all): 数据库增加字段支持
为数据库中新增的`user_id` `dept_id` 提供结构支持 [重构依据](https://www.yuque.com/piaobo-igrka/xvqmhp/ofcoxh57lywwubgy?singleDoc#) BREAKING CHANGE: 可能产生隐性数据一致性问题 可能导致某些业务逻辑出现问题
This commit is contained in:
@@ -84,6 +84,9 @@ public class DdSaleController extends BaseController {
|
|||||||
@Log(title = "销售主单", businessType = BusinessType.INSERT)
|
@Log(title = "销售主单", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody DdSale ddSale) {
|
public AjaxResult add(@RequestBody DdSale ddSale) {
|
||||||
|
// 适配数据分离
|
||||||
|
ddSale.setDeptId(getDeptId());
|
||||||
|
ddSale.setUserId(getUserId());
|
||||||
return toAjax(ddSaleService.insertDdSale(ddSale));
|
return toAjax(ddSaleService.insertDdSale(ddSale));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,10 @@ import java.math.BigDecimal;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
import com.zhyc.common.annotation.Excel;
|
import com.zhyc.common.annotation.Excel;
|
||||||
@@ -15,6 +19,8 @@ import com.zhyc.common.core.domain.BaseEntity;
|
|||||||
* @author HashMap
|
* @author HashMap
|
||||||
* @date 2025-12-01
|
* @date 2025-12-01
|
||||||
*/
|
*/
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@Data
|
||||||
public class DdSale extends BaseEntity
|
public class DdSale extends BaseEntity
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
@@ -59,119 +65,11 @@ public class DdSale extends BaseEntity
|
|||||||
@Excel(name = "技术员")
|
@Excel(name = "技术员")
|
||||||
private String tech;
|
private String tech;
|
||||||
|
|
||||||
|
private Long userId;
|
||||||
|
private Long deptId;
|
||||||
|
|
||||||
/** 销售明细信息 */
|
/** 销售明细信息 */
|
||||||
private List<DdSaleItem> ddSaleItemList;
|
private List<DdSaleItem> ddSaleItemList;
|
||||||
|
|
||||||
public void setId(Long id)
|
|
||||||
{
|
|
||||||
this.id = id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getId()
|
|
||||||
{
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSaleDate(Date saleDate)
|
|
||||||
{
|
|
||||||
this.saleDate = saleDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getSaleDate()
|
|
||||||
{
|
|
||||||
return saleDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCustName(String custName)
|
|
||||||
{
|
|
||||||
this.custName = custName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCustName()
|
|
||||||
{
|
|
||||||
return custName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCustPhone(String custPhone)
|
|
||||||
{
|
|
||||||
this.custPhone = custPhone;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCustPhone()
|
|
||||||
{
|
|
||||||
return custPhone;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCustAddr(String custAddr)
|
|
||||||
{
|
|
||||||
this.custAddr = custAddr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCustAddr()
|
|
||||||
{
|
|
||||||
return custAddr;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSalesper(String salesper)
|
|
||||||
{
|
|
||||||
this.salesper = salesper;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSalesper()
|
|
||||||
{
|
|
||||||
return salesper;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setQuaranNo(String quaranNo)
|
|
||||||
{
|
|
||||||
this.quaranNo = quaranNo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getQuaranNo()
|
|
||||||
{
|
|
||||||
return quaranNo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setApprNo(String apprNo)
|
|
||||||
{
|
|
||||||
this.apprNo = apprNo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getApprNo()
|
|
||||||
{
|
|
||||||
return apprNo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPrice(BigDecimal price)
|
|
||||||
{
|
|
||||||
this.price = price;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BigDecimal getPrice()
|
|
||||||
{
|
|
||||||
return price;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTech(String tech)
|
|
||||||
{
|
|
||||||
this.tech = tech;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getTech()
|
|
||||||
{
|
|
||||||
return tech;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<DdSaleItem> getDdSaleItemList()
|
|
||||||
{
|
|
||||||
return ddSaleItemList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDdSaleItemList(List<DdSaleItem> ddSaleItemList)
|
|
||||||
{
|
|
||||||
this.ddSaleItemList = ddSaleItemList;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.zhyc.module.frozen.service.impl;
|
|||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.zhyc.common.annotation.DataScope;
|
||||||
import com.zhyc.common.utils.DateUtils;
|
import com.zhyc.common.utils.DateUtils;
|
||||||
import com.zhyc.module.frozen.domain.DdFe;
|
import com.zhyc.module.frozen.domain.DdFe;
|
||||||
import com.zhyc.module.frozen.domain.DdFs;
|
import com.zhyc.module.frozen.domain.DdFs;
|
||||||
@@ -58,6 +59,7 @@ public class DdSaleServiceImpl implements IDdSaleService {
|
|||||||
* @return 销售主单
|
* @return 销售主单
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@DataScope(deptAlias = "dd_sl_alias" , userAlias = "dd_sl_alias")
|
||||||
public List<DdSale> selectDdSaleList(DdSale ddSale) {
|
public List<DdSale> selectDdSaleList(DdSale ddSale) {
|
||||||
return ddSaleMapper.selectDdSaleList(ddSale);
|
return ddSaleMapper.selectDdSaleList(ddSale);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectDdSaleVo">
|
<sql id="selectDdSaleVo">
|
||||||
select id, sale_date, cust_name, cust_phone, cust_addr, salesper, quaran_no, appr_no, price, tech, remark, create_by, create_time from dd_sl
|
select id, sale_date, cust_name, cust_phone, cust_addr, salesper, quaran_no, appr_no, price, tech, remark, create_by, create_time from dd_sl dd_sl_alias
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectDdSaleList" parameterType="DdSale" resultMap="DdSaleResult">
|
<select id="selectDdSaleList" parameterType="DdSale" resultMap="DdSaleResult">
|
||||||
@@ -53,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="apprNo != null and apprNo != ''"> and appr_no = #{apprNo}</if>
|
<if test="apprNo != null and apprNo != ''"> and appr_no = #{apprNo}</if>
|
||||||
<if test="price != null "> and price = #{price}</if>
|
<if test="price != null "> and price = #{price}</if>
|
||||||
<if test="tech != null and tech != ''"> and tech = #{tech}</if>
|
<if test="tech != null and tech != ''"> and tech = #{tech}</if>
|
||||||
|
${params.dataScope}
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
@@ -83,6 +84,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
<if test="createBy != null">create_by,</if>
|
<if test="createBy != null">create_by,</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="userId != null">user_id,</if>
|
||||||
|
<if test="deptId != null">dept_id,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="saleDate != null">#{saleDate},</if>
|
<if test="saleDate != null">#{saleDate},</if>
|
||||||
@@ -97,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
<if test="remark != null">#{remark},</if>
|
<if test="remark != null">#{remark},</if>
|
||||||
<if test="createBy != null">#{createBy},</if>
|
<if test="createBy != null">#{createBy},</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="userId != null">#{userId},</if>
|
||||||
|
<if test="deptId != null">#{deptId},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user