|
|
@ -189,10 +189,28 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
|
|
|
|
equCheckItemMapper.updateEquCheckItem(equCheckItem);
|
|
|
|
equCheckItemMapper.updateEquCheckItem(equCheckItem);
|
|
|
|
|
|
|
|
|
|
|
|
for (EquCheckItemDetail detail : equCheckItemDTO.getFormStandard()) {
|
|
|
|
for (EquCheckItemDetail detail : equCheckItemDTO.getFormStandard()) {
|
|
|
|
|
|
|
|
// 标准不存在则新增
|
|
|
|
|
|
|
|
if (detail.getDetailCode() == null) {
|
|
|
|
|
|
|
|
// 获取标准流水号
|
|
|
|
|
|
|
|
String detailSerialNum = String.format("%03d", equCheckItemDetailMapper.selectSerialNumber(equCheckItem.getItemCode()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
detail.setDetailId(IdUtils.fastSimpleUUID());
|
|
|
|
|
|
|
|
detail.setParentCode(equCheckItem.getItemCode());
|
|
|
|
|
|
|
|
detail.setFactoryCode(equCheckItem.getFactoryCode());
|
|
|
|
|
|
|
|
detail.setDetailCode(equCheckItem.getItemCode()+detailSerialNum);
|
|
|
|
|
|
|
|
detail.setCreatedBy(SecurityContextHolder.getUserName());
|
|
|
|
|
|
|
|
detail.setCreatedTime(DateUtils.getNowDate());
|
|
|
|
|
|
|
|
detail.setUpdatedBy(SecurityContextHolder.getUserName());
|
|
|
|
|
|
|
|
detail.setUpdatedTime(DateUtils.getNowDate());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 插入到数据库
|
|
|
|
|
|
|
|
equCheckItemDetailMapper.insertEquCheckItemDetail(detail);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
detail.setUpdatedBy(SecurityContextHolder.getUserName());
|
|
|
|
detail.setUpdatedBy(SecurityContextHolder.getUserName());
|
|
|
|
detail.setUpdatedTime(DateUtils.getNowDate());
|
|
|
|
detail.setUpdatedTime(DateUtils.getNowDate());
|
|
|
|
equCheckItemDetailMapper.updateEquCheckItemDetail(detail);
|
|
|
|
equCheckItemDetailMapper.updateEquCheckItemDetail(detail);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
return success("修改成功");
|
|
|
|
return success("修改成功");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|