|
|
@@ -124,6 +124,18 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
|
|
|
@Autowired
|
|
|
private MesProductDhbService mesProductDhbService;
|
|
|
|
|
|
+ /**
|
|
|
+ * 首次完工判定:只处理 craft=100000 主结果,且 pieceworkDate 无值、content 是 OK/NG 时设置
|
|
|
+ * public 供跨 Service 调用(如 MesProductGp12Service)
|
|
|
+ */
|
|
|
+ public void setPieceworkDateIfNeeded(MesProductRecord r) {
|
|
|
+ if (!"100000".equals(r.getCraft())) return;
|
|
|
+ if (r.getPieceworkDate() != null) return;
|
|
|
+ String c = r.getContent();
|
|
|
+ if (StringUtils.isEmpty(c) || "UDF".equals(c)) return;
|
|
|
+ r.setPieceworkDate(new Date());
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public void save(MesProductRecord mesProductRecord) {
|
|
|
if (StringUtils.isEmpty(mesProductRecord.getSource())) {
|
|
|
@@ -712,6 +724,7 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
|
|
|
|
|
|
mesProductRecord.setMaterielSn(materielSn);
|
|
|
mesProductRecord.setContent(content);
|
|
|
+ setPieceworkDateIfNeeded(mesProductRecord);
|
|
|
super.update(mesProductRecord);
|
|
|
|
|
|
FileUploadUtils.saveFileUpload(mesProductRecord, mesProductRecord.getId(), "mesProductRecord_image");
|
|
|
@@ -1171,8 +1184,8 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
|
|
|
.and("a.oprno",QueryType.RIGHT_LIKE,oprno)
|
|
|
.and("craft",QueryType.EQ,"100000")
|
|
|
.and("content",QueryType.NE,"UDF")
|
|
|
- .and("update_date", QueryType.GTE,sdate)
|
|
|
- .and("update_date",QueryType.LT,edate);
|
|
|
+ .and("piecework_date", QueryType.GTE,sdate)
|
|
|
+ .and("piecework_date",QueryType.LT,edate);
|
|
|
Long jpp1 = super.findCount(mesProductRecord);
|
|
|
return String.valueOf(jpp1);
|
|
|
}
|
|
|
@@ -1184,8 +1197,8 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
|
|
|
mesProductRecord.getSqlMap().getWhere()
|
|
|
.and("a.oprno",QueryType.RIGHT_LIKE,oprno)
|
|
|
.and("craft",QueryType.EQ,"100000")
|
|
|
- .and("update_date", QueryType.GTE,sdate)
|
|
|
- .and("update_date",QueryType.LT,edate);
|
|
|
+ .and("piecework_date", QueryType.GTE,sdate)
|
|
|
+ .and("piecework_date",QueryType.LT,edate);
|
|
|
Long jpp1 = super.findCount(mesProductRecord);
|
|
|
return String.valueOf(jpp1);
|
|
|
}
|
|
|
@@ -1198,8 +1211,8 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
|
|
|
.and("a.sn",QueryType.RIGHT_LIKE,type)
|
|
|
.and("a.oprno",QueryType.RIGHT_LIKE,oprno)
|
|
|
.and("craft",QueryType.EQ,"100000")
|
|
|
- .and("update_date", QueryType.GTE,sdate)
|
|
|
- .and("update_date",QueryType.LT,edate);
|
|
|
+ .and("piecework_date", QueryType.GTE,sdate)
|
|
|
+ .and("piecework_date",QueryType.LT,edate);
|
|
|
Long jpp1 = super.findCount(mesProductRecord);
|
|
|
return String.valueOf(jpp1);
|
|
|
}
|