43326 电子化检验,发送给QMS的数据,按照零件号+责任人类型分组发送

tags/yfai-mes-ext-v2.1
gsz 7 months ago
parent d6a9d33105
commit f1c2f71e87

@ -43,11 +43,11 @@ public class MesQmsScrapService extends BaseMesService<MesQmsScrap> implements I
DdlPreparedPack.getInPackList(idList, "pid", packBean);
List<MesPartInspectionDetail> partInspectionDetails = partInspectionDetailRDao.findByHqlWhere(packBean);
Map<Long, List<MesPartInspectionDetail>> idDetailListMap = partInspectionDetails.stream().collect(Collectors.groupingBy(MesPartInspectionDetail::getPid));
Map<String, List<MesPartInspection>> workOrderPartMap = mesPartInspectionList.stream().collect(Collectors.groupingBy(MesPartInspection::getPartNo));
//43326 电子化检验发送给QMS的数据按照零件号+责任人类型分组发送
Map<String, List<MesPartInspection>> workOrderPartMap = mesPartInspectionList.stream().collect(Collectors.groupingBy(p -> p.getPartNo() +"="+p.getResponsibleParty()));
//根据物料对可疑品分组
for (Map.Entry<String, List<MesPartInspection>> stringListEntry : workOrderPartMap.entrySet()) {
String key = stringListEntry.getKey();
String keyPartNo = stringListEntry.getKey().split("=")[0];
List<MesPartInspection> mesPartInspections = stringListEntry.getValue();
MesPartInspection next = mesPartInspections.iterator().next();
List<MesPartInspectionDetail> mesPartInspectionDetails = new ArrayList<>();
@ -62,7 +62,7 @@ public class MesQmsScrapService extends BaseMesService<MesQmsScrap> implements I
mesQmsScrap.setSource("MES");
double sum = mesPartInspections.stream().mapToDouble(MesPartInspection::getRejectQty).sum();
mesQmsScrap.setRejectQty((int) sum);
mesQmsScrap.setPartNo(key);
mesQmsScrap.setPartNo(keyPartNo);
mesQmsScrap.setPartName(next.getPartName());
String defectTypeName = mesPartInspectionDetails.stream().map(MesPartInspectionDetail::getDefectTypeName).collect(Collectors.joining(";"));
mesQmsScrap.setDefectTypeName(defectTypeName);

Loading…
Cancel
Save