feat(wms): 添加业务员相关代码
- 在WmsCoilContractRelMapper中新增selectSalesmanByOrderId方法 - 在WmsCoilContractRelMapper.xml中添加对应的SQL查询语句 - 在WmsMaterialCoilServiceImpl中新增setSaleNameFromContract私有方法 - 在多个钢卷创建场景中调用setSaleNameFromContract方法设置销售员姓名 - 实现了根据合同ID自动获取并设置业务员信息的功能
This commit is contained in:
@@ -1020,10 +1020,10 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
// }
|
||||
// }
|
||||
|
||||
// // 销售人员姓名模糊查询
|
||||
// if (bo.getSaleName() != null && !bo.getSaleName().isEmpty()) {
|
||||
// qw.like("su.nick_name", bo.getSaleName());
|
||||
// }
|
||||
// 销售人员姓名模糊查询
|
||||
if (bo.getSaleName() != null && !bo.getSaleName().isEmpty()) {
|
||||
qw.like("su.nick_name", bo.getSaleName());
|
||||
}
|
||||
|
||||
// 仅查询废品:质量状态为 D+、D、D-
|
||||
if (Boolean.TRUE.equals(bo.getOnlyScrap())) {
|
||||
@@ -2104,6 +2104,8 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
|
||||
// 把老记录的coilId赋值给新纪录的parentCoilId
|
||||
newCoil.setParentCoilId(String.valueOf(oldCoil.getCoilId()));
|
||||
// 根据合同ID获取业务员信息
|
||||
setSaleNameFromContract(newCoil, bo.getContractId());
|
||||
// 插入新记录
|
||||
boolean flag = baseMapper.insert(newCoil) > 0;
|
||||
|
||||
@@ -2416,6 +2418,8 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
validEntityBeforeSave(newCoil);
|
||||
// 把老记录的coilId赋值给新纪录的parentCoilId
|
||||
newCoil.setParentCoilId(String.valueOf(oldCoil.getCoilId()));
|
||||
// 根据合同ID获取业务员信息
|
||||
setSaleNameFromContract(newCoil, newCoilBo.getContractId());
|
||||
baseMapper.insert(newCoil);
|
||||
|
||||
// 插入合同关联记录
|
||||
@@ -2575,6 +2579,8 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
.collect(Collectors.joining(","));
|
||||
newCoil.setParentCoilId(parentCoilIdsStr);
|
||||
|
||||
// 根据合同ID获取业务员信息
|
||||
setSaleNameFromContract(newCoil, bo.getContractId());
|
||||
baseMapper.insert(newCoil);
|
||||
|
||||
// 插入合同关联记录
|
||||
@@ -3068,6 +3074,18 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据合同ID从订单中获取业务员姓名并设置到钢卷实体
|
||||
*/
|
||||
private void setSaleNameFromContract(WmsMaterialCoil coil, Long contractId) {
|
||||
if (contractId != null) {
|
||||
String saleName = coilContractRelMapper.selectSalesmanByOrderId(contractId);
|
||||
if (StringUtils.isNotBlank(saleName)) {
|
||||
coil.setSaleName(saleName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
@@ -5464,6 +5482,8 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
validateCoilWeight(childCoil.getGrossWeight(), childCoil.getNetWeight());
|
||||
validEntityBeforeSave(childCoil);
|
||||
childCoil.setParentCoilId(String.valueOf(parentCoilId));
|
||||
// 根据合同ID获取业务员信息
|
||||
setSaleNameFromContract(childCoil, childCoilBo.getContractId());
|
||||
baseMapper.insert(childCoil);
|
||||
|
||||
// 插入合同关联记录
|
||||
|
||||
Reference in New Issue
Block a user