| | |
| | | import com.jcdm.common.utils.DateUtils; |
| | | import com.jcdm.common.utils.StringUtils; |
| | | import com.jcdm.main.bs.orderScheduling.Query.PrepareOnlineQuery; |
| | | import com.jcdm.main.bs.orderScheduling.common.Constants; |
| | | import com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling; |
| | | import com.jcdm.main.bs.orderScheduling.mapper.BsOrderSchedulingMapper; |
| | | import com.jcdm.main.bs.orderScheduling.service.IBsOrderSchedulingService; |
| | | import com.jcdm.main.bs.orderScheduling.vo.FollowReportVO; |
| | | import com.jcdm.main.bs.orderScheduling.vo.LineChartVO; |
| | | import com.jcdm.main.da.paramCollection.domain.DaParamCollection; |
| | | import com.jcdm.main.da.paramCollection.mapper.DaParamCollectionMapper; |
| | | import com.jcdm.main.da.paramCollection.service.impl.DaParamCollectionServiceImpl; |
| | | import com.jcdm.main.da.passingStationCollection.domain.DaPassingStationCollection; |
| | | import com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | |
| | | @Autowired |
| | | private BsOrderSchedulingMapper bsOrderSchedulingMapper; |
| | | |
| | | @Resource |
| | | private DaParamCollectionMapper daParamCollectionMapper; |
| | | |
| | | @Resource |
| | | private DaPassingStationCollectionMapper daPassingStationCollectionMapper; |
| | | |
| | | /** |
| | | * 查询订单排产 |
| | | * |
| | |
| | | { |
| | | return bsOrderSchedulingMapper.selectBsOrderSchedulingById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询订单排产 |
| | | * |
| | | * @param sncode 订单排产发动机号 |
| | | * @return 订单排产 |
| | | */ |
| | | @Override |
| | | public BsOrderScheduling selectBsOrderSchedulingSNCode(String sncode) |
| | | { |
| | | return bsOrderSchedulingMapper.selectBsOrderSchedulingSNCode(sncode); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询订单排产列表 |
| | |
| | | } |
| | | |
| | | @Override |
| | | public FollowReportVO getFollowReportList(BsOrderScheduling bsOrderScheduling) |
| | | { |
| | | FollowReportVO vo = new FollowReportVO(); |
| | | if(bsOrderScheduling.getDateConditions()!=null){ |
| | | String[] conditions = bsOrderScheduling.getDateConditions(); |
| | | bsOrderScheduling.setStartTime(conditions[0]); |
| | | bsOrderScheduling.setEndTime(conditions[1]); |
| | | } |
| | | //主表数据 |
| | | List<BsOrderScheduling> mainList = bsOrderSchedulingMapper.selectBsOrderSchedulingList(bsOrderScheduling); |
| | | vo.setMainList(mainList); |
| | | List<String> engineNoList = mainList.stream().map(BsOrderScheduling::getEngineNo).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)){ |
| | | //拿到所有子数据 |
| | | 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); |
| | | } |
| | | vo.setList5(collect5); |
| | | return vo; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<LineChartVO> getOffLineNum() |
| | | { |
| | | List<LineChartVO> result = new ArrayList<>(); |
| | |
| | | bsOrderScheduling.setStartTime(s1); |
| | | bsOrderScheduling.setEndTime(s2); |
| | | List<BsOrderScheduling> todayList = bsOrderSchedulingMapper.selectBsOrderSchedulingList(bsOrderScheduling); |
| | | todayList = todayList.stream().filter(x -> ObjectUtil.isNotEmpty(x.getCvtOfflineTime())).collect(Collectors.toList()); |
| | | todayList = todayList.stream().filter(x -> ObjectUtil.isNotEmpty(x.getFinalAssemblyOfflineTime())).collect(Collectors.toList()); |
| | | if (CollUtil.isNotEmpty(todayList)){ |
| | | List<String> allModel = todayList.stream().map(BsOrderScheduling::getModel).distinct().collect(Collectors.toList()); |
| | | Map<String, List<BsOrderScheduling>> collect = new HashMap<>(); |
| | |
| | | List<Integer> arr = new ArrayList<>(); |
| | | vo.setName(s); |
| | | collect = todayList.stream().filter(x -> s.equals(x.getModel())).collect(Collectors.groupingBy(item -> new SimpleDateFormat("yyyy-MM-dd HH").format(item |
| | | .getCvtOfflineTime()))); |
| | | .getFinalAssemblyOfflineTime()))); |
| | | Map<Integer,Integer> temp = new HashMap<>(); |
| | | if (CollUtil.isNotEmpty(collect)){ |
| | | for (String string : collect.keySet()) { |