Ver Fonte

驾驶舱-复启操作人

wanglt há 3 meses atrás
pai
commit
a19ea5945b

+ 3 - 3
ygtx-gxt/src/main/resources/mapper/gxt/GxtRepairOrderMapper.xml

@@ -794,15 +794,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN (
             SELECT
                 COUNT(*) AS repair_num,
-                rop.user_id
+                rop.operator_id AS user_id
             FROM
                 gxt_repair_order ro
-                    LEFT JOIN gxt_repair_order_person rop ON ro.id = rop.order_id
+                    LEFT JOIN gxt_repair_order_flow rop ON ro.id = rop.order_id AND rop.action_type='complete'
             WHERE ro.work_order_status IN ('completed','archived') AND ro.repair_method = '2'
         AND ro.occur_time >= STR_TO_DATE( CONCAT( #{monthPeriod}, '-01 00:00:00' ), '%Y-%m-%d %H:%i:%s' )
               AND ro.occur_time <![CDATA[<]]> DATE_ADD( STR_TO_DATE( CONCAT( #{monthPeriod}, '-01 00:00:00' ), '%Y-%m-%d %H:%i:%s' ), INTERVAL 1 MONTH )
             GROUP BY
-                rop.user_id
+                rop.operator_id
         ) cc ON u.user_id = cc.user_id
         LEFT JOIN (
         SELECT

+ 9 - 1
ygtx-gxt/src/main/resources/mapper/gxt/GxtWorkOrderMapper.xml

@@ -101,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="orderType"    column="orderType" />
         <result property="repairPerson"    column="repairPerson" />
         <result property="chargePerson"    column="chargePerson" />
+        <result property="operator"    column="operator" />
         <result property="score"    column="score" />
         <result property="xfsc"    column="xfsc" />
         <result property="xysc"    column="xysc" />
@@ -661,6 +662,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="center != null and center == 'true'">IFNULL(o.center,'未知中心') AS center,</if>
             <if test="repairPerson != null and repairPerson == 'true'">o.repairPerson,</if>
             <if test="chargePerson != null and chargePerson == 'true'">o.chargePerson,</if>
+            <if test="operator != null and operator == 'true'">o.operator,</if>
             <if test="score != null and score == 1">o.score,</if>
             <if test="xfsc != null and xfsc == 'true'">o.xfsc,</if>
             <if test="xysc != null and xysc == 'true'">o.xysc,</if>
@@ -683,6 +685,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 wo.pcs_station_name AS pcs,
                 wo.brand,
                 wo.model,
+                NULL AS operator,
                 IF(wo.repair_method='2', 1, null) AS restart_flag,
                 wo.mis_no AS `system`,
                 wo.gxt_center AS center,
@@ -773,6 +776,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 wo.pcs_station_name AS pcs,
                 wo.brand,
                 wo.model,
+                opflow.operator_name AS operator,
                 IF(wo.repair_method='2', 1, 0) AS restart_flag,
                 NULL AS `system`,
                 wo.gxt_center AS center,
@@ -796,6 +800,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 LEFT JOIN (SELECT order_id,COUNT(*) AS wop_num FROM gxt_repair_order_person GROUP BY order_id) wopp ON wopp.order_id=wo.id
                 LEFT JOIN (SELECT order_id,MAX(action_time) AS finish_time FROM gxt_repair_order_flow WHERE action_type IN ('complete','auto_finalize') GROUP BY order_id) gsflow ON gsflow.order_id=wo.id
                 LEFT JOIN (SELECT order_id,MAX(action_time) AS score_time FROM gxt_repair_order_flow WHERE action_type IN ('reviewRating','finalRating') GROUP BY order_id) gfflow ON gfflow.order_id=wo.id
+                LEFT JOIN gxt_repair_order_flow opflow ON opflow.id=(SELECT MAX(gxt_repair_order_flow.id) FROM gxt_repair_order_flow WHERE gxt_repair_order_flow.action_type='complete' AND gxt_repair_order_flow.order_id=wo.id GROUP BY gxt_repair_order_flow.order_id) AND opflow.order_id=wo.id AND wo.repair_method='2'
             <where>
                 <if test="startTime != null ">
                     <choose>
@@ -857,7 +862,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                         AND wo.work_order_status IN ('completed','archived')
                     </otherwise>
                 </choose>
-                AND wopp.wop_num>0 AND wo.work_order_status IS NOT NULL
+                AND (wopp.wop_num>0 OR wo.repair_method='2') AND wo.work_order_status IS NOT NULL
             </where>
             ) o
         <where>
@@ -875,6 +880,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     o.work_order_project_no,
                     <if test="chargePerson != null and chargePerson == 'true'">o.chargePerson,</if>
                     <if test="repairPerson != null and repairPerson == 'true'">o.repairPerson,</if>
+                    <if test="operator != null and operator == 'true'">o.operator,</if>
                     <if test="brand != null and brand == 'true'">o.brand,</if>
                     <if test="model != null and model == 'true'">o.model,</if>
                     <if test="system != null and system == 'true'">o.`system`,</if>
@@ -892,6 +898,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     <if test="center != null and center == 'true'">o.center,</if>
                     <if test="repairPerson != null and repairPerson == 'true'">o.repairPerson,</if>
                     <if test="chargePerson != null and chargePerson == 'true'">o.chargePerson,</if>
+                    <if test="operator != null and operator == 'true'">o.operator,</if>
                     <if test="score != null and score == 1">o.score,</if>
                     <if test="xfsc != null and xfsc == 'true'">o.xfsc,</if>
                     <if test="xysc != null and xysc == 'true'">o.xysc,</if>
@@ -906,6 +913,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     <if test="pcs != null and pcs == 'true'">o.pcs,</if>
                     <if test="chargePerson != null and chargePerson == 'true'">o.chargePerson,</if>
                     <if test="(workOrder != null and workOrder == true) or (repairOrder != null and repairOrder==true)">o.orderType,</if>
+                    <if test="operator != null and operator == 'true'">o.operator,</if>
                     <if test="repairPerson != null and repairPerson == 'true'">o.repairPerson,</if>
                     <if test="brand != null and brand == 'true'">o.brand,</if>
                     <if test="model != null and model == 'true'">o.model,</if>