Pārlūkot izejas kodu

feature 代码提交

xiahan 9 mēneši atpakaļ
vecāks
revīzija
dcf34c292d

+ 7 - 1
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/GanttServiceImpl.java

@@ -125,6 +125,10 @@ public class GanttServiceImpl implements GanttService {
         log.error("甘特图查询用时:{}", stopWatch.getTotalTimeSeconds());
         StopWatch stopWatch1 = new StopWatch();
         stopWatch1.start();
+
+//        apsProcessOperationProcessEquDos
+//                .sort(Comparator.comparing(GanttVos::getPlanstartdate)
+//                .thenComparing(GanttVos::getPlanenddate));
         List<ScheduleGanttVo> scheduleGanttVos = assembleGanttData(apsProcessOperationProcessEquDos);
         stopWatch1.stop();
         log.error("甘特图组装数据用时:{}", stopWatch1.getTotalTimeSeconds());
@@ -365,8 +369,10 @@ public class GanttServiceImpl implements GanttService {
         LinkedHashMap<String, List<GanttVos>> processMap = apsProcessOperationProcessEquDos.stream().collect(Collectors.groupingBy(GanttVos::getProcessdeviceid,
                 LinkedHashMap::new, Collectors.toList()));
         for (Map.Entry<String, List<GanttVos>> deviceEntry : processMap.entrySet()) {
+            List<GanttVos>  values= deviceEntry.getValue();
+            values.sort(Comparator.comparing(GanttVos::getPlanstartdate).thenComparing(GanttVos::getPlanenddate));
             // 对数据按照 计划开始时间 分组
-            LinkedHashMap<String, List<GanttVos>> planDataMap = deviceEntry.getValue().stream().collect(Collectors.groupingBy(info -> {
+            LinkedHashMap<String, List<GanttVos>> planDataMap = values.stream().collect(Collectors.groupingBy(info -> {
                         if (PROCESS_WAY_MERGE.equals(info.getProcessway())) {
                             return info.getPlanstartdate().toString();
                         }

+ 9 - 10
cx-aps/cx-aps-common/src/main/resources/mybatis/ApsProcessOperationProcessEquDao.xml

@@ -178,7 +178,7 @@
         DATE(a3.PROMISEDATESTART) AS PROMISEDATESTART,
         DATE(a3.PROMISEDATEEND) AS PROMISEDATEEND,
         DATE(a3.DELIVERYDATE) AS DELIVERYDATE,
-        a4.PRODUCTNAME,
+        (SELECT GROUP_CONCAT( a4.PRODUCTNAME )  FROM aps_process_output_product a4 WHERE a4.DELETED = '0' and  a3.ID = a4.BLANKID GROUP BY a4.BLANKID) PRODUCTNAME ,
         a6.ID AS productionorderid,
         a6.ORDERNO,
         a6.CUSTOMNAME,
@@ -194,15 +194,14 @@
         a2.SINGLEROLLWEIGHT * a1.PLANPROCESSRALL as totalRollWeight
 
         FROM
-        aps_process_operation_process_equ a1
-        LEFT JOIN aps_process_operation a2 ON a1.PROCESSID = a2.ID
-        LEFT JOIN aps_blank_order a3 ON a3.ID = a2.BLANKID
-        LEFT JOIN (select GROUP_CONCAT(PRODUCTNAME)as PRODUCTNAME,GROUP_CONCAT(PRODUCTID) AS PRODUCTID,BLANKID from
-        aps_process_output_product where DELETED='0' group by BLANKID) a4 ON a3.ID = a4.BLANKID
-        LEFT JOIN aps_production_order a6 ON a6.ID = a3.PRODUCTIONORDERID
-        LEFT JOIN aps_customer_management a7 on a6.CUSTOMID= a7.ID
+        aps_blank_order a3
+        LEFT JOIN aps_production_order a6 ON a3.PRODUCTIONORDERID = a6.ID
+        LEFT JOIN aps_customer_management a7 ON a6.CUSTOMID = a7.ID
+        LEFT JOIN aps_process_operation a2 ON a3.ID= a2.BLANKID
+        LEFT JOIN aps_process_operation_process_equ a1 FORCE INDEX (aps_process_operation_process_equ_idx2) ON a1.PROCESSID = a2.ID
         <where>
-            a1.DELETED ='0'
+            a3.SCHEDULINGSTATUS != '10'
+            and a1.DELETED ='0'
             AND a2.DELETED = '0'
             AND a3.DELETED = '0'
             AND a6.DELETED='0'
@@ -246,7 +245,7 @@
                 and a3.BLANKNUMBER like #{blankNumberPattern}
             </if>
         </where>
-        order by a1.PROCESSWORKSHOP,a1.PROCESSDEVICE,a1.PLANSTARTDATE asc,a1.PLANENDDATE desc
+#         order by a1.PROCESSWORKSHOP,a1.PROCESSDEVICE,a1.PLANSTARTDATE asc,a1.PLANENDDATE desc
     </select>
     <select id="selectNeedUpdate" resultType="com.rongwei.bsentity.vo.CommonUpdateProductionStatusReq">
         SELECT