|
|
|
@ -367,25 +367,20 @@ public class PlanAssignSteerModifyServiceImpl extends BaseServiceImpl<PlanAssign |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public PlanAssignSteerModifyVO getDetail(Long pasmId, Long caId) { |
|
|
|
public PlanAssignSteerModifyVO getDetail(Long pasmId, Long caId) { |
|
|
|
// 参数校验:pasmId为空直接返回null
|
|
|
|
List<PlanAssignSteerModifyDVO> modifyLst = null; |
|
|
|
if (pasmId == null) { |
|
|
|
PlanAssignSteerModifyVO modifyVO = null; |
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询主表信息
|
|
|
|
Boolean initSteer = false; |
|
|
|
|
|
|
|
if (pasmId != null) { |
|
|
|
|
|
|
|
List<PlanAssignSteerModifyVO> entity = baseMapper.findByPasmId(pasmId); |
|
|
|
List<PlanAssignSteerModifyVO> list = baseMapper.findByPasmId(pasmId); |
|
|
|
List<PlanAssignSteerModifyVO> list = baseMapper.findByPasmId(pasmId); |
|
|
|
if (list.isEmpty()) { |
|
|
|
if (list.isEmpty()) { |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PlanAssignSteerModifyVO modifyVO = list.get(0); |
|
|
|
modifyVO = list.get(0); |
|
|
|
|
|
|
|
|
|
|
|
// 判断是否需要查询明细:caId为空 或 caId与主表的platingId匹配
|
|
|
|
|
|
|
|
// // TODO: 2026/5/22 caId根据工艺能力查询计划分派控制
|
|
|
|
|
|
|
|
boolean shouldQueryDetail = caId == null || caId.equals(modifyVO.getPlatingId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<PlanAssignSteerModifyDVO> modifyLst = null; |
|
|
|
if (caId == null || caId.equals(modifyVO.getPlatingId())) { |
|
|
|
if (shouldQueryDetail) { |
|
|
|
|
|
|
|
List<PlanAssignSteerModifyD> detailList = planAssignSteerModifyDService.findByPasmId(pasmId); |
|
|
|
List<PlanAssignSteerModifyD> detailList = planAssignSteerModifyDService.findByPasmId(pasmId); |
|
|
|
if (!detailList.isEmpty()) { |
|
|
|
if (!detailList.isEmpty()) { |
|
|
|
modifyLst = detailList.stream() |
|
|
|
modifyLst = detailList.stream() |
|
|
|
@ -396,9 +391,40 @@ public class PlanAssignSteerModifyServiceImpl extends BaseServiceImpl<PlanAssign |
|
|
|
}) |
|
|
|
}) |
|
|
|
.collect(Collectors.toList()); |
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
initSteer = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (caId == null) { |
|
|
|
|
|
|
|
modifyVO = new PlanAssignSteerModifyVO(); |
|
|
|
|
|
|
|
modifyVO.setPlatingId(null); |
|
|
|
|
|
|
|
modifyVO.setCreateMan(AuthUtil.getUserId()); |
|
|
|
|
|
|
|
modifyVO.setCreateTime(new Date()); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
initSteer = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (initSteer) { |
|
|
|
|
|
|
|
modifyVO = null; |
|
|
|
|
|
|
|
// 根据工艺能力和外协厂商查找现有分派规则
|
|
|
|
|
|
|
|
List<PlanAssignSteer> assignSteers = planAssignSteerService.list(Wrappers.lambdaQuery(PlanAssignSteer.class) |
|
|
|
|
|
|
|
.eq(PlanAssignSteer::getPlatingId, caId)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
modifyLst = assignSteers.stream() |
|
|
|
|
|
|
|
.map(assign -> { |
|
|
|
|
|
|
|
PlanAssignSteerModifyDVO modifyDVO = new PlanAssignSteerModifyDVO(); |
|
|
|
|
|
|
|
modifyDVO.setPlatingId(assign.getPlatingId()); |
|
|
|
|
|
|
|
modifyDVO.setOemId(assign.getOemId()); |
|
|
|
|
|
|
|
modifyDVO.setAssignScale(assign.getAssignScale()); |
|
|
|
|
|
|
|
modifyDVO.setPasId(assign.getId()); |
|
|
|
|
|
|
|
return modifyDVO; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.collect(Collectors.toList()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
modifyVO.setModifyLst(modifyLst); |
|
|
|
modifyVO.setModifyLst(modifyLst); |
|
|
|
|
|
|
|
|
|
|
|
return modifyVO; |
|
|
|
return modifyVO; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|