PDA产品加工记录查询,查询速度优化

tags/yfai-pcn-ext-v1.8
jun 9 months ago
parent 5dc8837436
commit 697d0933ae

@ -106,7 +106,7 @@ public class MesProductionRecordService implements IMesProductionRecordService {
if (!CollectionUtils.isEmpty(productionRecordList)) {
//数据查询
Map<String, MesCraft> craftMap = getStringMesCraftMap(organizeCode, productionRecordList.stream().map(MesProductionRecord::getCraftCode).distinct().collect(Collectors.toList()));
Map<String, MesProduceSn> produceSnMap = getStringMesProduceSnMap(organizeCode, productionRecordList.stream().map(MesProductionRecord::getSerialNumber).distinct().collect(Collectors.toList()));
Map<String, MesProduceSn> produceSnMap = getStringMesProduceSnMap(organizeCode, productSn);
Map<String, MesWorkCenter> mesWorkCenterMap = getStringMesWorkCenterMap(organizeCode, productionRecordList.stream().map(MesProductionRecord::getWorkCenterCode).distinct().collect(Collectors.toList()));
Map<String, MesWorkCell> workCellMap = getStringMesWorkCellMap(organizeCode, productionRecordList.stream().map(MesProductionRecord::getWorkCellCode).distinct().collect(Collectors.toList()));
//数据组装
@ -137,9 +137,9 @@ public class MesProductionRecordService implements IMesProductionRecordService {
return craftMap;
}
private Map<String, MesProduceSn> getStringMesProduceSnMap(String organizeCode, List<String> snList) {
private Map<String, MesProduceSn> getStringMesProduceSnMap(String organizeCode, String productSn) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getInPackList(snList, MesPcnExtConstWords.SERIAL_NUMBER,packBean);
DdlPreparedPack.getStringEqualPack(productSn, MesPcnExtConstWords.PRODUCT_SN,packBean);
List<MesProduceSn> mesProduceSns = mesProduceSnRepository.findByHqlWhere(packBean);
Map<String, MesProduceSn> mesProduceSnMap = new HashMap<>();
if(!CollectionUtils.isEmpty(mesProduceSns)){

Loading…
Cancel
Save