计划新增-parentCode存放上级id(修改查询未完善)

highway
wws 1 year ago
parent 6e236cb58d
commit 5ff08114f2

@ -413,14 +413,10 @@ public class EquPlanServiceImpl implements IEquPlanService {
// 处理计划1-n设备信息 // 处理计划1-n设备信息
List<EquPlanEqu> equipmentItemList = equPlan.getEquipmentItem(); List<EquPlanEqu> equipmentItemList = equPlan.getEquipmentItem();
// 计划-设备流水号
int equipmentCodeTemp = 0;
for (EquPlanEqu equipment : equipmentItemList) { for (EquPlanEqu equipment : equipmentItemList) {
equipment.setId(IdUtils.fastSimpleUUID()); equipment.setId(IdUtils.fastSimpleUUID());
equipment.setPlanCode(equPlan.getPlanCode()); equipment.setPlanCode(equPlan.getPlanCode());
equipment.setCode("E" + equPlan.getPlanCode() + String.format("%02d", ++equipmentCodeTemp)); equipment.setParentCode(equPlan.getPlanId());
equipment.setParentCode(equPlan.getPlanCode());
equipment.setFactoryCode(factory); equipment.setFactoryCode(factory);
equipment.setCreateBy(SecurityContextHolder.getUserName()); equipment.setCreateBy(SecurityContextHolder.getUserName());
equipment.setCreateTime(DateUtils.getNowDate()); equipment.setCreateTime(DateUtils.getNowDate());
@ -430,16 +426,13 @@ public class EquPlanServiceImpl implements IEquPlanService {
// 处理检查项信息 // 处理检查项信息
List<EquPlanDetail> detailList = equipment.getEquPlanDetailList(); List<EquPlanDetail> detailList = equipment.getEquPlanDetailList();
if (detailList != null) { if (detailList != null) {
// 计划检查项流水号
int itemCodeTemp = 0;
for (EquPlanDetail item : detailList) { for (EquPlanDetail item : detailList) {
if (item != null) { if (item != null) {
item.setId(IdUtils.fastSimpleUUID()); item.setId(IdUtils.fastSimpleUUID());
item.setPlanCode(equPlan.getPlanCode()); item.setPlanCode(equPlan.getPlanCode());
item.setCode("C" + equipment.getCode() + String.format("%02d", ++itemCodeTemp)); item.setParentCode(equipment.getId());
item.setParentCode(equipment.getCode());
item.setCreateBy(SecurityContextHolder.getUserName()); item.setCreateBy(SecurityContextHolder.getUserName());
item.setCreateTime(DateUtils.getNowDate()); item.setCreateTime(DateUtils.getNowDate());
item.setUpdateBy(SecurityContextHolder.getUserName()); item.setUpdateBy(SecurityContextHolder.getUserName());
@ -458,7 +451,7 @@ public class EquPlanServiceImpl implements IEquPlanService {
checkInsert = true; checkInsert = true;
standard.setId(IdUtils.fastSimpleUUID()); standard.setId(IdUtils.fastSimpleUUID());
standard.setParentCode(item.getCode()); standard.setParentCode(item.getId());
standard.setPlanCode(equPlan.getPlanCode()); standard.setPlanCode(equPlan.getPlanCode());
standard.setCreateBy(SecurityContextHolder.getUserName()); standard.setCreateBy(SecurityContextHolder.getUserName());
standard.setCreateTime(DateUtils.getNowDate()); standard.setCreateTime(DateUtils.getNowDate());

Loading…
Cancel
Save