瀏覽代碼

维保工单保存计划时间、保存下发时间

HD_wangm 5 月之前
父節點
當前提交
fb19ad8ca3

+ 4 - 9
ygtx-gxt/src/main/java/com/ygtx/gxt/controller/mobile/GxtMobileOrderScoreController.java → ygtx-gxt/src/main/java/com/ygtx/gxt/controller/mobile/GxtMobileOrderController.java

@@ -1,29 +1,24 @@
 package com.ygtx.gxt.controller.mobile;
 
-import com.ygtx.common.annotation.Log;
 import com.ygtx.common.core.controller.BaseController;
-import com.ygtx.common.core.domain.AjaxResult;
 import com.ygtx.common.core.page.TableDataInfo;
-import com.ygtx.common.enums.BusinessType;
 import com.ygtx.gxt.domain.*;
 import com.ygtx.gxt.service.IGxtOrderScoreService;
 import com.ygtx.gxt.service.IGxtRepairOrderService;
 import com.ygtx.gxt.service.IGxtWorkOrderService;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 
-import java.util.ArrayList;
 import java.util.List;
 
 /**
- * 工单评分Controller
+ * 工单Controller
  *
  * @date 2025-11-12
  */
 @RestController
 @RequestMapping("/mobile/order")
-public class GxtMobileOrderScoreController extends BaseController
+public class GxtMobileOrderController extends BaseController
 {
     @Autowired
     private IGxtRepairOrderService gxtRepairOrderService;
@@ -35,7 +30,7 @@ public class GxtMobileOrderScoreController extends BaseController
     private IGxtOrderScoreService gxtOrderScoreService;
 
     /**
-     * 查询工单评分列表(合并维修工单和维保工单)
+     * 查询工单列表(合并维修工单和维保工单)
      */
     @GetMapping("/list")
     public TableDataInfo list(GxtRepairOrder repairOrder, GxtWorkOrder workOrder)
@@ -43,7 +38,7 @@ public class GxtMobileOrderScoreController extends BaseController
         // 开启分页插件自动分页
         startPage();
         // 查询合并的工单列表
-        List<OrderScoreInfo> list = gxtOrderScoreService.selectUnionOrderList(repairOrder, workOrder);
+        List<OrderScoreInfo> list = gxtOrderScoreService.selectMobileUnionOrderList(repairOrder, workOrder);
         return getDataTable(list);
     }
 }

+ 10 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/mapper/GxtOrderScoreMapper.java

@@ -24,4 +24,14 @@ public interface GxtOrderScoreMapper {
      */
     public List<OrderScoreInfo> selectUnionOrderList(@Param("repairOrder") GxtRepairOrder repairOrder,
                                                      @Param("workOrder") GxtWorkOrder workOrder);
+
+    /**
+     * 查询合并的工单列表(维修工单和维保工单)
+     *
+     * @param repairOrder 维修工单查询条件
+     * @param workOrder 维保工单查询条件
+     * @return 合并的工单列表
+     */
+    public List<OrderScoreInfo> selectMobileUnionOrderList(@Param("repairOrder") GxtRepairOrder repairOrder,
+                                                     @Param("workOrder") GxtWorkOrder workOrder);
 }

+ 9 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/service/IGxtOrderScoreService.java

@@ -54,4 +54,13 @@ public interface IGxtOrderScoreService {
      * @return 结果
      */
     public int confirm(OrderScoreInfo orderScoreInfo);
+
+    /**
+     * 查询合并的工单列表(维修工单和维保工单)
+     *
+     * @param repairOrder 维修工单查询条件
+     * @param workOrder 维保工单查询条件
+     * @return 合并的工单列表
+     */
+    public List<OrderScoreInfo> selectMobileUnionOrderList(GxtRepairOrder repairOrder, GxtWorkOrder workOrder);
 }

+ 20 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtOrderScoreServiceImpl.java

@@ -422,6 +422,26 @@ public class GxtOrderScoreServiceImpl implements IGxtOrderScoreService {
         }
     }
 
+    @Override
+    public List<OrderScoreInfo> selectMobileUnionOrderList(GxtRepairOrder repairOrder, GxtWorkOrder workOrder) {
+        // 添加业务特定的数据权限过滤
+        addBusinessDataScopeFilter(repairOrder, workOrder);
+
+        // 设置创建人,用于数据权限过滤
+        if(!Constants.SUPER_ADMIN.equals(SecurityUtils.getUsername())){
+            if (repairOrder.getCreateBy() == null || repairOrder.getCreateBy().isEmpty()) {
+                repairOrder.setCreateBy(SecurityUtils.getUsername());
+            }
+
+            if (workOrder.getCreateBy() == null || workOrder.getCreateBy().isEmpty()) {
+                workOrder.setCreateBy(SecurityUtils.getUsername());
+            }
+        }
+        // 查询工单列表
+        List<OrderScoreInfo> orderList = gxtOrderScoreMapper.selectMobileUnionOrderList(repairOrder, workOrder);
+        return orderList;
+    }
+
     /**
      * 添加业务特定的数据权限过滤条件
      * 基于角色的数据范围进行自定义权限控制

+ 4 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtWorkOrderServiceImpl.java

@@ -124,6 +124,10 @@ public class GxtWorkOrderServiceImpl implements IGxtWorkOrderService
         if (gxtWorkOrder.getWorkOrderStatus() == null || gxtWorkOrder.getWorkOrderStatus().isEmpty())
         {
             gxtWorkOrder.setWorkOrderStatus("draft");
+        } else {
+            gxtWorkOrder.setAssignTime(DateUtils.getNowDate());
+            gxtWorkOrder.setAssignUserId(SecurityUtils.getUserId());
+            gxtWorkOrder.setAssignUserName(SecurityUtils.getLoginUser().getUser().getNickName());
         }
         SysDept dept = deptMapper.selectDeptByDeptName(gxtWorkOrder.getPcsStationName());
         if (dept != null) {

+ 142 - 0
ygtx-gxt/src/main/resources/mapper/gxt/GxtOrderScoreMapper.xml

@@ -202,4 +202,146 @@
         ) t
         ORDER BY create_time DESC
     </select>
+    <select id="selectMobileUnionOrderList" resultMap="OrderScoreInfoResult">
+        SELECT * FROM (
+        SELECT
+        1 as order_type,
+        id as id,
+        work_order_project_no as work_order_project_no,
+        work_order_status as work_order_status,
+        gxt_center_id as gxt_center_id,
+        gxt_center as gxt_center,
+        pcs_station_id as pcs_station_id,
+        pcs_station_pid as pcs_station_pid,
+        pcs_station_name as pcs_station_name,
+        pcs_device_id as pcs_device_id,
+        pcs_device_name as pcs_device_name,
+        brand as brand,
+        model as model,
+        assign_time as assign_time,
+        assign_user_id as assign_user_id,
+        assign_user_name as assign_user_name,
+        accept_time as accept_time,
+        accept_user_id as accept_user_id,
+        accept_user_name as accept_user_name,
+        real_start_time as real_start_time,
+        real_end_time as real_end_time,
+        team_leader_id as team_leader_id,
+        team_leader_name as team_leader_name,
+        work_group_member_id as work_group_member_id,
+        work_group_member_name as work_group_member_name,
+        score as score,
+        review_content as review_content,
+        suspend_reason as suspend_reason,
+        restart_time as restart_time,
+        priority_type as priority_type,
+        real_end_time as work_end_time,
+        scoring_status as scoring_status,
+        content as work_summary,
+        maintenance_type as maintenance_type,
+        null as inspection_type,
+        null as plan_start_time,
+        null as plan_end_time,
+        plan_hour as plan_hour,
+        fault_code as fault_code,
+        fault_desc as fault_desc,
+        occur_time as occur_time,
+        null as suspend_time,
+        null as pause_reason,
+        null as pause_time,
+        null as complete_time,
+        review_score_num as review_score_num,
+        final_coefficient as final_coefficient,
+        create_time as create_time,
+        update_time as update_time
+        FROM gxt_repair_order t
+        <where>
+            <if test="repairOrder.workOrderProjectNo != null and repairOrder.workOrderProjectNo != ''"> and work_order_project_no = #{repairOrder.workOrderProjectNo}</if>
+            <if test="repairOrder.workOrderStatus != null and repairOrder.workOrderStatus != ''"> and work_order_status = #{repairOrder.workOrderStatus}</if>
+            <if test="repairOrder.gxtCenterId != null"> and gxt_center_id = #{repairOrder.gxtCenterId}</if>
+            <if test="repairOrder.gxtCenter != null and repairOrder.gxtCenter != ''"> and gxt_center = #{repairOrder.gxtCenter}</if>
+            <if test="repairOrder.pcsStationId != null"> and pcs_station_id = #{repairOrder.pcsStationId}</if>
+            <if test="repairOrder.pcsStationName != null and repairOrder.pcsStationName != ''"> and pcs_station_name = #{repairOrder.pcsStationName}</if>
+            <if test="repairOrder.pcsDeviceId != null"> and pcs_device_id = #{repairOrder.pcsDeviceId}</if>
+            <if test="repairOrder.pcsDeviceName != null and repairOrder.pcsDeviceName != ''"> and pcs_device_name like concat('%', #{repairOrder.pcsDeviceName}, '%')</if>
+            <if test="repairOrder.teamLeaderName != null and repairOrder.teamLeaderName != ''"> and team_leader_name like concat('%', #{repairOrder.teamLeaderName}, '%')</if>
+            <if test="repairOrder.scoringStatus != null"> and scoring_status = #{repairOrder.scoringStatus}</if>
+            <!-- 业务特定数据权限过滤条件 -->
+            <if test="repairOrder.params.businessDataScope != null and repairOrder.params.businessDataScope != ''">
+                ${repairOrder.params.businessDataScope}
+            </if>
+        </where>
+
+        UNION ALL
+
+        SELECT
+        2 as order_type,
+        id as id,
+        work_order_project_no as work_order_project_no,
+        work_order_status as work_order_status,
+        gxt_center_id as gxt_center_id,
+        gxt_center as gxt_center,
+        pcs_station_id as pcs_station_id,
+        pcs_station_pid as pcs_station_pid,
+        pcs_station_name as pcs_station_name,
+        pcs_device_id as pcs_device_id,
+        pcs_device_name as pcs_device_name,
+        brand as brand,
+        model as model,
+        assign_time as assign_time,
+        assign_user_id as assign_user_id,
+        assign_user_name as assign_user_name,
+        accept_time as accept_time,
+        accept_user_id as accept_user_id,
+        accept_user_name as accept_user_name,
+        real_start_time as real_start_time,
+        real_end_time as real_end_time,
+        team_leader_id as team_leader_id,
+        team_leader_name as team_leader_name,
+        work_group_member_id as work_group_member_id,
+        work_group_member_name as work_group_member_name,
+        score as score,
+        review_content as review_content,
+        suspend_reason as suspend_reason,
+        restart_time as restart_time,
+        priority_type as priority_type,
+        real_end_time as work_end_time,
+        scoring_status as scoring_status,
+        real_content as work_summary,
+        null as maintenance_type,
+        inspection_type as inspection_type,
+        plan_start_time as plan_start_time,
+        plan_end_time as plan_end_time,
+        plan_hour as plan_hour,
+        fault_code as fault_code,
+        fault_desc as fault_desc,
+        null as occur_time,
+        suspend_time as suspend_time,
+        pause_reason as pause_reason,
+        pause_time as pause_time,
+        complete_time as complete_time,
+        review_score_num as review_score_num,
+        final_coefficient as final_coefficient,
+        create_time as create_time,
+        update_time as update_time
+        FROM gxt_work_order t
+        <where>
+            <if test="workOrder.workOrderProjectNo != null and workOrder.workOrderProjectNo != ''"> and work_order_project_no = #{workOrder.workOrderProjectNo}</if>
+            <if test="workOrder.workOrderStatus != null and workOrder.workOrderStatus != ''"> and work_order_status = #{workOrder.workOrderStatus}</if>
+            <if test="workOrder.gxtCenterId != null"> and gxt_center_id = #{workOrder.gxtCenterId}</if>
+            <if test="workOrder.gxtCenter != null and workOrder.gxtCenter != ''"> and gxt_center = #{workOrder.gxtCenter}</if>
+            <if test="workOrder.pcsStationId != null"> and pcs_station_id = #{workOrder.pcsStationId}</if>
+            <if test="workOrder.pcsStationName != null and workOrder.pcsStationName != ''"> and pcs_station_name = #{workOrder.pcsStationName}</if>
+            <if test="workOrder.pcsDeviceId != null"> and pcs_device_id = #{workOrder.pcsDeviceId}</if>
+            <if test="workOrder.pcsDeviceName != null and workOrder.pcsDeviceName != ''"> and pcs_device_name like concat('%', #{workOrder.pcsDeviceName}, '%')</if>
+            <if test="workOrder.teamLeaderName != null and workOrder.teamLeaderName != ''"> and team_leader_name like concat('%', #{workOrder.teamLeaderName}, '%')</if>
+            <if test="workOrder.scoringStatus != null"> and scoring_status = #{workOrder.scoringStatus}</if>
+            <!-- 业务特定数据权限过滤条件 -->
+            <if test="workOrder.params.businessDataScope != null and workOrder.params.businessDataScope != ''">
+                ${workOrder.params.businessDataScope}
+            </if>
+        </where>
+        ) t
+        ORDER BY create_time DESC
+    </select>
 </mapper>

+ 2 - 0
ygtx-ui/src/views/gxt/gxtOrder/index.vue

@@ -2656,6 +2656,8 @@ function onMisInfoSelected(row) {
       form.value.content = row.content
       form.value.realStartTime = row.realStartTime
       form.value.realEndTime = row.realEndTime
+      form.value.planStartTime = row.planStartTime
+      form.value.planEndTime = row.planEndTime
       listEquipment({ station: row.pcsStationName, equipmentCode: row.pcsDeviceName }).then(response => {
         const equipments = response.rows
         if (equipments) {