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)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody DdSale ddSale) {
|
||||
// 适配数据分离
|
||||
ddSale.setDeptId(getDeptId());
|
||||
ddSale.setUserId(getUserId());
|
||||
return toAjax(ddSaleService.insertDdSale(ddSale));
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,10 @@ import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
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.ToStringStyle;
|
||||
import com.zhyc.common.annotation.Excel;
|
||||
@@ -11,10 +15,12 @@ import com.zhyc.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 销售主单对象 dd_sl
|
||||
*
|
||||
*
|
||||
* @author HashMap
|
||||
* @date 2025-12-01
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class DdSale extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -59,119 +65,11 @@ public class DdSale extends BaseEntity
|
||||
@Excel(name = "技术员")
|
||||
private String tech;
|
||||
|
||||
private Long userId;
|
||||
private Long deptId;
|
||||
|
||||
/** 销售明细信息 */
|
||||
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
|
||||
public String toString() {
|
||||
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.List;
|
||||
|
||||
import com.zhyc.common.annotation.DataScope;
|
||||
import com.zhyc.common.utils.DateUtils;
|
||||
import com.zhyc.module.frozen.domain.DdFe;
|
||||
import com.zhyc.module.frozen.domain.DdFs;
|
||||
@@ -58,6 +59,7 @@ public class DdSaleServiceImpl implements IDdSaleService {
|
||||
* @return 销售主单
|
||||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "dd_sl_alias" , userAlias = "dd_sl_alias")
|
||||
public List<DdSale> selectDdSaleList(DdSale ddSale) {
|
||||
return ddSaleMapper.selectDdSaleList(ddSale);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<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>
|
||||
|
||||
<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="price != null "> and price = #{price}</if>
|
||||
<if test="tech != null and tech != ''"> and tech = #{tech}</if>
|
||||
${params.dataScope}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -83,7 +84,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="deptId != null">dept_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="saleDate != null">#{saleDate},</if>
|
||||
<if test="custName != null and custName != ''">#{custName},</if>
|
||||
@@ -97,7 +100,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="deptId != null">#{deptId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDdSale" parameterType="DdSale">
|
||||
|
||||
Reference in New Issue
Block a user