|
|
@@ -128,6 +128,19 @@ public class MesProductRecordService extends CrudService<MesProductRecordDao, Me
|
|
|
if (StringUtils.isEmpty(mesProductRecord.getSource())) {
|
|
|
mesProductRecord.setSource("0");
|
|
|
}
|
|
|
+
|
|
|
+ // 计件时间逻辑:首次从UDF变为OK或NG时,记录计件时间
|
|
|
+ if (!StringUtils.isEmpty(mesProductRecord.getId())) {
|
|
|
+ MesProductRecord oldRecord = super.get(mesProductRecord);
|
|
|
+ if (oldRecord != null
|
|
|
+ && "UDF".equals(oldRecord.getContent())
|
|
|
+ && !"UDF".equals(mesProductRecord.getContent())
|
|
|
+ && !StringUtils.isEmpty(mesProductRecord.getContent())
|
|
|
+ && mesProductRecord.getPieceworkDate() == null) {
|
|
|
+ mesProductRecord.setPieceworkDate(new Date());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
super.save(mesProductRecord);
|
|
|
}
|
|
|
public Long insertBatch(List<MesProductRecord> mesProductRecordList,int num) {
|
|
|
@@ -1373,8 +1386,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);
|
|
|
}
|
|
|
@@ -1386,8 +1399,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);
|
|
|
}
|
|
|
@@ -1400,8 +1413,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);
|
|
|
}
|