|
|
|
@ -75,14 +75,26 @@ public class MesQmsSuspiciousService extends BaseMesService<MesQmsSuspicious> im
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(partInspection.getSn(), "sn", packBeanNew);
|
|
|
|
|
packBeanNew.setOrderByStr(" order by createDatetime ");
|
|
|
|
|
MesPartInspection partInspectionDao = partInspectionRepository.getByProperty(packBeanNew);
|
|
|
|
|
//检验日期年月日可以根据创建日期截取,批次的不用取最早出现的
|
|
|
|
|
String qmsTime = partInspection.getCreateDatetime().substring(0, 13) + ":00:00";
|
|
|
|
|
if (!StringUtil.isEmpty(partInspectionDao)) {
|
|
|
|
|
if (!StringUtil.isEmpty(partInspectionDao) && partInspection.getSourceType() == MesExtEnumUtil.PART_INSPECTION_SOURCE_TYPE.SINGLE.getValue()) {
|
|
|
|
|
qmsTime = partInspectionDao.getCreateDatetime().substring(0, 13) + ":00:00";
|
|
|
|
|
}
|
|
|
|
|
partInspectionNew.setInspectionDate(qmsTime);
|
|
|
|
|
mesPartInspectionsListTime.add(partInspectionNew);
|
|
|
|
|
}
|
|
|
|
|
//根据时间分组发送
|
|
|
|
|
// 批次的:
|
|
|
|
|
//A 2024-08-21 08:00 10
|
|
|
|
|
//A 2024-08-21 08:00 10
|
|
|
|
|
//B 2024-08-20 08:00 10 检验日期 2024-08-21 08:00
|
|
|
|
|
//B 2024-08-21 08:00 10 检验日期 2024-08-21 08:00
|
|
|
|
|
//单件的:
|
|
|
|
|
//A 2024-08-21 08:00 1 0 0 1
|
|
|
|
|
//
|
|
|
|
|
//qms汇总表=====
|
|
|
|
|
//A 2024-08-21 08:00 21 0 0 1
|
|
|
|
|
//B 2024-08-21 08:00 20
|
|
|
|
|
Map<String, List<MesPartInspection>> mesPartInspectionsMap = mesPartInspectionsListTime.stream().collect(Collectors.groupingBy(MesPartInspection::getInspectionDate));
|
|
|
|
|
for (Map.Entry<String, List<MesPartInspection>> partInspection : mesPartInspectionsMap.entrySet()) {
|
|
|
|
|
List<MesPartInspection> mesPartInspections = partInspection.getValue();
|
|
|
|
@ -143,7 +155,7 @@ public class MesQmsSuspiciousService extends BaseMesService<MesQmsSuspicious> im
|
|
|
|
|
mesQmsSuspicious.setReworkScrapped(0);
|
|
|
|
|
mesQmsSuspicious.setPartNo(key);
|
|
|
|
|
mesQmsSuspicious.setPartName(next.getPartName());
|
|
|
|
|
//缺陷分类,缺陷数量JOSN格式:
|
|
|
|
|
//缺陷分类,缺陷数量JOSN格式:【批次&单件数量汇总时需要根据检验时间段合并】
|
|
|
|
|
//[{"Defect_Name":"缺陷01","Defect_Qty":1},{"Defect_Name":"缺陷02","Defect_Qty":2}]
|
|
|
|
|
Map<String, List<MesPartInspectionDetail>> listDefectMap = mesPartInspectionDetails.stream().collect(Collectors.groupingBy(MesPartInspectionDetail::getDefectTypeName));
|
|
|
|
|
List<Map<String, Object>> defectsList = new ArrayList<>();
|
|
|
|
|