diff --git a/op-modules/op-energy/src/main/java/com/op/energy/report/service/impl/DataAnalysisServiceImpl.java b/op-modules/op-energy/src/main/java/com/op/energy/report/service/impl/DataAnalysisServiceImpl.java index d3954431..cd0f3cb2 100644 --- a/op-modules/op-energy/src/main/java/com/op/energy/report/service/impl/DataAnalysisServiceImpl.java +++ b/op-modules/op-energy/src/main/java/com/op/energy/report/service/impl/DataAnalysisServiceImpl.java @@ -1044,6 +1044,7 @@ public class DataAnalysisServiceImpl implements IDataAnalysisService { } } } - return reportOrderEnergyDTOList; + return reportOrderEnergyDTOList.stream().sorted(Comparator.comparing(ReportOrderEnergyDTO::getProductDate) + .thenComparing(ReportOrderEnergyDTO::getWorkorderName)).collect(Collectors.toList()); } } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/controller/WCSInterfaceController.java b/op-modules/op-mes/src/main/java/com/op/mes/controller/WCSInterfaceController.java index 1cfd2499..ac7a5b65 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/controller/WCSInterfaceController.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/controller/WCSInterfaceController.java @@ -16,6 +16,7 @@ import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.concurrent.ExecutorService; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadPoolExecutor; @@ -131,6 +132,13 @@ public class WCSInterfaceController extends BaseController { return success(wCInterfaceService.getWhiteBoardEquPro7Days(boardDTO)); } + @PostMapping("/getWhiteBoardProdDetails") + public AjaxResult getWhiteBoardProdDetails(@RequestBody(required = false) Map paramMap) { + return success(wCInterfaceService.getWhiteBoardProdDetails(paramMap)); + } + + + /************************************************************/ /****************************数据库清理************************/ /************************************************************/ diff --git a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesMapper.java b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesMapper.java index e738e249..12adb234 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesMapper.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/mapper/MesMapper.java @@ -113,4 +113,8 @@ public interface MesMapper { Map getEveryDayMap(BoardDTO boardDTO); @MapKey("ymd") Map getPlanDayMap(BoardDTO boardDTO); + + List getWhiteBoardProdDetails(Map paramMap); + + List whiteBoardProdListDetailss(Map paramMap); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/IWCSInterfaceService.java b/op-modules/op-mes/src/main/java/com/op/mes/service/IWCSInterfaceService.java index eb24a868..dcb6c3a8 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/IWCSInterfaceService.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/IWCSInterfaceService.java @@ -46,4 +46,6 @@ public interface IWCSInterfaceService { R prReportWork(MesReportWork mesReportWork); Map getWhiteBoardEquPro7Days(BoardDTO boardDTO); + + Map getWhiteBoardProdDetails(Map paramMap); } diff --git a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java index 93f40dda..be6c8ca1 100644 --- a/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java +++ b/op-modules/op-mes/src/main/java/com/op/mes/service/impl/IWCInterfaceServiceImpl.java @@ -3,6 +3,7 @@ package com.op.mes.service.impl; import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONObject; +import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder; import com.op.common.core.domain.R; import com.op.common.core.utils.DateUtils; @@ -723,6 +724,42 @@ public class IWCInterfaceServiceImpl implements IWCSInterfaceService { return boardMap; } + @Override + @DS("#header.poolName") + public Map getWhiteBoardProdDetails(Map paramMap) { + List whiteBoardProdListDetails = mesMapper.getWhiteBoardProdDetails(paramMap); + List whiteBoardProdListDetailss = mesMapper.whiteBoardProdListDetailss(paramMap); + if (paramMap.get("equipmentCode").toString().equals("S")) { + // 对第一个列表进行修改 + for (Map map : whiteBoardProdListDetails) { + if (map.containsKey("completed_count")) { + // 获取 completed_count 字段的值并减去 5 + Object completedCountObj = map.get("completed_count"); + if (completedCountObj != null && completedCountObj instanceof Number) { + Number completedCount = (Number) completedCountObj; + map.put("completed_count", completedCount.intValue() - 5); + } + } + } + + // 对第二个列表进行修改 + for (Map map : whiteBoardProdListDetailss) { + if (map.containsKey("completed_count")) { + // 获取 completed_count 字段的值并减去 5 + Object completedCountObj = map.get("completed_count"); + if (completedCountObj != null && completedCountObj instanceof Number) { + Number completedCount = (Number) completedCountObj; + map.put("completed_count", completedCount.intValue() - 5); + } + } + } + } + Map resultMap=new HashMap(); + resultMap.put("leftList",whiteBoardProdListDetails); + resultMap.put("rightlist",whiteBoardProdListDetailss); + return resultMap; + } + protected List get7Days(){ List days = new ArrayList<>(); // 获取当前日期 diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml index 1b23c6a4..d74cfcae 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesMapper.xml @@ -487,5 +487,48 @@ where pow.product_date>=#{ymd} and pow.del_flag = '0' and pow.shift_id = #{shiftId} and pow.parent_order = '0' group by pow.product_date + + diff --git a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml index f229c82e..f1b42848 100644 --- a/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml +++ b/op-modules/op-mes/src/main/resources/mapper/mes/MesReportWorkMapper.xml @@ -706,7 +706,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and CONVERT(varchar(10), #{productDateEnd}, 23) >= CONVERT(varchar(10),pow.product_date, 23) and pow.product_code like concat('%', #{productCode}, '%') - order by be.equipment_code + order by pow.product_date ASC,pow.workorder_name ASC;