设备管理-检查项维护(修改BUG修复)

highway
wws 1 year ago
parent 48debb98d3
commit 8b3acc99b7

@ -189,9 +189,27 @@ public class EquCheckItemServiceImpl implements IEquCheckItemService {
equCheckItemMapper.updateEquCheckItem(equCheckItem);
for (EquCheckItemDetail detail : equCheckItemDTO.getFormStandard()) {
detail.setUpdatedBy(SecurityContextHolder.getUserName());
detail.setUpdatedTime(DateUtils.getNowDate());
equCheckItemDetailMapper.updateEquCheckItemDetail(detail);
// 标准不存在则新增
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.setUpdatedTime(DateUtils.getNowDate());
equCheckItemDetailMapper.updateEquCheckItemDetail(detail);
}
}
return success("修改成功");
}

Loading…
Cancel
Save