|
|
|
|
@ -96,19 +96,30 @@ public class PlanAssignSteerModifyServiceImpl extends BaseServiceImpl<PlanAssign |
|
|
|
|
if (totalScale.compareTo(new BigDecimal("100")) != 0) { |
|
|
|
|
return R.fail("分派比例总和必须等于100"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Long userId = AuthUtil.getUserId(); |
|
|
|
|
PlanAssignSteerModify entity = new PlanAssignSteerModify(); |
|
|
|
|
BeanUtil.copyProperties(modify, entity); |
|
|
|
|
|
|
|
|
|
if (Objects.isNull(entity.getId())) { |
|
|
|
|
entity.setCreateTime(new Date()); |
|
|
|
|
entity.setUpdateTime(new Date()); |
|
|
|
|
entity.setCreateUser(userId); |
|
|
|
|
entity.setUpdateUser(userId); |
|
|
|
|
|
|
|
|
|
save(entity); |
|
|
|
|
for (PlanAssignSteerModifyDVO detail : modifyLst) { |
|
|
|
|
PlanAssignSteerModifyD d = new PlanAssignSteerModifyD(); |
|
|
|
|
BeanUtil.copyProperties(detail, d); |
|
|
|
|
d.setPasmId(entity.getId()); |
|
|
|
|
detail.setCreateTime(new Date()); |
|
|
|
|
detail.setUpdateTime(new Date()); |
|
|
|
|
d.setCreateUser(userId); |
|
|
|
|
d.setUpdateUser(userId); |
|
|
|
|
planAssignSteerModifyDService.save(d); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
entity.setUpdateTime(new Date()); |
|
|
|
|
entity.setUpdateUser(userId); |
|
|
|
|
updateById(entity); |
|
|
|
|
planAssignSteerModifyDService.remove(Wrappers.lambdaQuery(PlanAssignSteerModifyD.class) |
|
|
|
|
.eq(PlanAssignSteerModifyD::getPasmId,entity.getId())); |
|
|
|
|
@ -117,6 +128,10 @@ public class PlanAssignSteerModifyServiceImpl extends BaseServiceImpl<PlanAssign |
|
|
|
|
BeanUtil.copyProperties(detail, d); |
|
|
|
|
d.setId(null); |
|
|
|
|
d.setPasmId(entity.getId()); |
|
|
|
|
d.setCreateTime(new Date()); |
|
|
|
|
d.setUpdateTime(new Date()); |
|
|
|
|
d.setCreateUser(userId); |
|
|
|
|
d.setUpdateUser(userId); |
|
|
|
|
planAssignSteerModifyDService.save(d); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
@ -367,14 +382,13 @@ public class PlanAssignSteerModifyServiceImpl extends BaseServiceImpl<PlanAssign |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public PlanAssignSteerModifyVO getDetail(Long pasmId, Long caId) { |
|
|
|
|
List<PlanAssignSteerModifyDVO> modifyLst = null; |
|
|
|
|
PlanAssignSteerModifyVO modifyVO = null; |
|
|
|
|
List<PlanAssignSteerModifyDVO> modifyLst = new ArrayList<>(); |
|
|
|
|
PlanAssignSteerModifyVO modifyVO = new PlanAssignSteerModifyVO(); |
|
|
|
|
|
|
|
|
|
Boolean initSteer = false; |
|
|
|
|
if (pasmId != null) { |
|
|
|
|
List<PlanAssignSteerModifyVO> entity = baseMapper.findByPasmId(pasmId); |
|
|
|
|
List<PlanAssignSteerModifyVO> list = baseMapper.findByPasmId(pasmId); |
|
|
|
|
if (list.isEmpty()) { |
|
|
|
|
if (Objects.isNull( list)) { |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -406,7 +420,7 @@ public class PlanAssignSteerModifyServiceImpl extends BaseServiceImpl<PlanAssign |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (initSteer) { |
|
|
|
|
modifyVO = null; |
|
|
|
|
modifyVO = new PlanAssignSteerModifyVO(); |
|
|
|
|
// 根据工艺能力和外协厂商查找现有分派规则
|
|
|
|
|
List<PlanAssignSteer> assignSteers = planAssignSteerService.list(Wrappers.lambdaQuery(PlanAssignSteer.class) |
|
|
|
|
.eq(PlanAssignSteer::getPlatingId, caId)); |
|
|
|
|
|