From 0e3cac8d5d9603cdd5ff8935e4054f0018a35ed9 Mon Sep 17 00:00:00 2001 From: wujian <14790700720@163.com> Date: 星期日, 28 四月 2024 15:08:56 +0800 Subject: [PATCH] change model10 --- jcdm-main/src/main/java/com/jcdm/main/rm/repairRecord/service/impl/RmRepairRecordServiceImpl.java | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 48 insertions(+), 0 deletions(-) diff --git a/jcdm-main/src/main/java/com/jcdm/main/rm/repairRecord/service/impl/RmRepairRecordServiceImpl.java b/jcdm-main/src/main/java/com/jcdm/main/rm/repairRecord/service/impl/RmRepairRecordServiceImpl.java index 55c2979..14d804c 100644 --- a/jcdm-main/src/main/java/com/jcdm/main/rm/repairRecord/service/impl/RmRepairRecordServiceImpl.java +++ b/jcdm-main/src/main/java/com/jcdm/main/rm/repairRecord/service/impl/RmRepairRecordServiceImpl.java @@ -1,12 +1,25 @@ package com.jcdm.main.rm.repairRecord.service.impl; +import java.util.ArrayList; import java.util.List; +import java.util.stream.Collectors; + +import cn.hutool.core.collection.CollUtil; import com.jcdm.common.utils.DateUtils; +import com.jcdm.main.bs.orderScheduling.common.Constants; +import com.jcdm.main.da.paramCollection.domain.DaParamCollection; +import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper; +import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection; +import com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper; +import com.jcdm.main.rm.repairData.domain.RmRepairData; +import com.jcdm.main.rm.repairRecord.vo.RmRepairDataVO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.jcdm.main.rm.repairRecord.mapper.RmRepairRecordMapper; import com.jcdm.main.rm.repairRecord.domain.RmRepairRecord; import com.jcdm.main.rm.repairRecord.service.IRmRepairRecordService; + +import javax.annotation.Resource; /** * 杩斾慨璁板綍Service涓氬姟灞傚鐞� @@ -19,6 +32,11 @@ { @Autowired private RmRepairRecordMapper rmRepairRecordMapper; + + @Resource + private DaParamCollectionMapper daParamCollectionMapper; + @Resource + private DaPassingStationCollectionMapper daPassingStationCollectionMapper; /** * 鏌ヨ杩斾慨璁板綍 @@ -44,6 +62,36 @@ return rmRepairRecordMapper.selectRmRepairRecordList(rmRepairRecord); } + @Override + public RmRepairDataVO getRepairReportList(RmRepairRecord rmRepairRecord) { + RmRepairDataVO vo = new RmRepairDataVO(); + //涓昏〃鏁版嵁 + List<RmRepairRecord> mainList = rmRepairRecordMapper.selectRmRepairRecordList(rmRepairRecord); + vo.setMainList(mainList); + List<String> engineNoList = mainList.stream().map(RmRepairRecord::getBoxCode).distinct().collect(Collectors.toList()); + List<DaParamCollection> allChildList = new ArrayList<>(); + List<DaPassingStationCollection> collect5 = new ArrayList<>(); + if (CollUtil.isNotEmpty(engineNoList)){ + allChildList = daParamCollectionMapper.getListBySfcCode(engineNoList); + collect5 = daPassingStationCollectionMapper.getListBySfcCode(engineNoList); + } + if (CollUtil.isNotEmpty(allChildList)){ + allChildList = allChildList.stream().filter(x -> Constants.IS_REPAIR.equals(x.getRepairFlag())).collect(Collectors.toList()); + //鎷垮埌鎵�鏈夊瓙鏁版嵁 + List<DaParamCollection> collect1 = allChildList.stream().filter(x -> Constants.DATA1.equals(x.getType())).collect(Collectors.toList()); + List<DaParamCollection> collect2 = allChildList.stream().filter(x -> Constants.DATA2.equals(x.getType())).collect(Collectors.toList()); + List<DaParamCollection> collect3 = allChildList.stream().filter(x -> Constants.DATA3.equals(x.getType())).collect(Collectors.toList()); + List<DaParamCollection> collect4 = allChildList.stream().filter(x -> Constants.DATA4.equals(x.getType())).collect(Collectors.toList()); + vo.setList1(collect1); + vo.setList2(collect2); + vo.setList3(collect3); + vo.setList4(collect4); + } + collect5 = collect5.stream().filter(x -> Constants.IS_REPAIR.equals(x.getRepairFlag())).collect(Collectors.toList()); + vo.setList5(collect5); + return vo; + } + /** * 鏂板杩斾慨璁板綍 * -- Gitblit v1.9.3