Browse Source

缺陷记录重复,折中解决方案

zhongwei
ty 7 months ago
parent
commit
bfe8e83a2b
  1. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/defect/service/impl/DefectCheckServiceImpl.java

@ -166,7 +166,15 @@ public class DefectCheckServiceImpl extends BaseServiceImpl<OperPhenomenonMapper
);
String suffix = String.format(String.format("%03d", ticketList.size() + 1));
String result = stationR.getData().getSignage() + yearMonth + suffix;
OperPhenomenonEntity operPhenomenonEntity = this.getOne(
Wrappers.<OperPhenomenonEntity>lambdaQuery().eq(OperPhenomenonEntity::getDefectCode, result)
.last("limit 1;")
);
if (ObjectUtil.isNotEmpty(operPhenomenonEntity)){
suffix= String.format(String.format("%03d", ticketList.size() + 10));
result= stationR.getData().getSignage() + yearMonth + suffix;
}
// 缺陷编码 : 按项目+年+月+序号
if (Func.isNotEmpty(result)) {
entity.setDefectCode(result);

Loading…
Cancel
Save