فهرست منبع

维修工单、工单评分

ouyj 5 ماه پیش
والد
کامیت
e1b4b69394

+ 12 - 0
ygtx-gxt/src/main/java/com/ygtx/gxt/domain/GxtRepairOrder.java

@@ -191,6 +191,9 @@ public class GxtRepairOrder extends BaseEntity
     /** 工单类型 */
     private Long orderType;
 
+    /** 维修方式 */
+    private String repairMethod;
+
     private List<GxtRepairOrderPerson> repairOrderPersonList;
 
     private List<GxtRepairOrderFlow> repairOrderFlowList;
@@ -684,6 +687,14 @@ public class GxtRepairOrder extends BaseEntity
         this.orderType = orderType;
     }
 
+    public String getRepairMethod() {
+        return repairMethod;
+    }
+
+    public void setRepairMethod(String repairMethod) {
+        this.repairMethod = repairMethod;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@@ -728,6 +739,7 @@ public class GxtRepairOrder extends BaseEntity
             .append("rejectionReason", getRejectionReason())
             .append("finalizationRemark", getFinalizationRemark())
             .append("orderType", getOrderType())
+            .append("repairMethod", getRepairMethod())
             .toString();
     }
 }

+ 37 - 4
ygtx-gxt/src/main/java/com/ygtx/gxt/service/impl/GxtOrderScoreServiceImpl.java

@@ -1,13 +1,12 @@
 package com.ygtx.gxt.service.impl;
 
 import com.ygtx.common.constant.Constants;
+import com.ygtx.common.utils.DateUtils;
 import com.ygtx.common.utils.SecurityUtils;
 import com.ygtx.common.utils.StringUtils;
 import com.ygtx.gxt.domain.*;
 import com.ygtx.gxt.mapper.GxtOrderScoreMapper;
-import com.ygtx.gxt.service.IGxtOrderScoreService;
-import com.ygtx.gxt.service.IGxtRepairOrderService;
-import com.ygtx.gxt.service.IGxtWorkOrderService;
+import com.ygtx.gxt.service.*;
 import com.ygtx.system.service.ISysConfigService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -48,6 +47,12 @@ public class GxtOrderScoreServiceImpl implements IGxtOrderScoreService {
     @Autowired
     private ISysConfigService configService;
 
+    @Autowired
+    private IGxtRepairOrderFlowService repairOrderFlowService;
+
+    @Autowired
+    private IGxtWorkOrderFlowService gxtWorkOrderFlowService;
+
     /**
      * 查询合并的工单列表(维修工单和维保工单)
      *
@@ -646,6 +651,21 @@ public class GxtOrderScoreServiceImpl implements IGxtOrderScoreService {
                 }
                 
                 gxtRepairOrderService.updateGxtRepairOrderForScore(order);
+
+                if("archived".equals(order.getWorkOrderStatus())){
+                    // 添加归档流程记录
+                    GxtRepairOrderFlow flow = new GxtRepairOrderFlow();
+                    flow.setOrderId(order.getId());
+                    flow.setOrderCode(order.getWorkOrderProjectNo());
+                    flow.setActionType("archive");
+                    flow.setFromStatus("to_archive");
+                    flow.setToStatus("archived");
+                    flow.setOperatorId(1L); // 系统自动操作,使用系统用户ID
+                    flow.setOperatorName("系统自动");
+                    flow.setActionTime(DateUtils.getNowDate());
+                    flow.setActionRemark("系统自动归档工单");
+                    repairOrderFlowService.insertGxtRepairOrderFlow(flow);
+                }
                 
                 return 1;
             } else if (orderScoreInfo.getOrderType() == 2) {
@@ -682,7 +702,20 @@ public class GxtOrderScoreServiceImpl implements IGxtOrderScoreService {
                 }
                 
                 gxtWorkOrderService.updateGxtWorkOrderForScore(order);
-                
+                if("archived".equals(order.getWorkOrderStatus())){
+                    // 添加归档流程记录
+                    GxtWorkOrderFlow flow = new GxtWorkOrderFlow();
+                    flow.setOrderId(order.getId());
+                    flow.setOrderCode(order.getWorkOrderProjectNo());
+                    flow.setActionType("archive");
+                    flow.setFromStatus("to_archive");
+                    flow.setToStatus("archived");
+                    flow.setOperatorId(1L); // 系统自动操作,使用系统用户ID
+                    flow.setOperatorName("系统自动");
+                    flow.setActionTime(DateUtils.getNowDate());
+                    flow.setActionRemark("系统自动归档工单");
+                    gxtWorkOrderFlowService.insertGxtWorkOrderFlow(flow);
+                }
                 return 1;
             }
             return 0;

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

@@ -59,6 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="reviewScoreNum"    column="review_score_num"    />
         <result property="finalCoefficient"    column="final_coefficient"    />
         <result property="orderType"    column="order_type"    />
+        <result property="repairMethod"    column="repair_method"    />
     </resultMap>
 
     <resultMap type="GxtRepairOrder" id="GxtRepairOrderWithPersonResult" extends="GxtRepairOrderResult">
@@ -94,7 +95,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                accept_user_id, accept_user_name, real_start_time, real_end_time, team_leader_id, team_leader_name, work_group_member_id,
                work_group_member_name, t.create_by, t.create_time, t.update_by, t.update_time, t.remark, content, plan_hour, priority_type, score,
                review_content, maintenance_type, occur_time, fault_barcode, suspend_reason, suspend_description, approval_status,
-               rejection_reason, modify_reason, finalization_remark, related_order_code, related_order_content, mis_order_no, restart_time, scoring_status, pcs_station_pid, attachment_urls, review_score_num, final_coefficient, order_type
+               rejection_reason, modify_reason, finalization_remark, related_order_code, related_order_content, mis_order_no, restart_time, scoring_status, pcs_station_pid, attachment_urls, review_score_num, final_coefficient, order_type, repair_method
         from gxt_repair_order t
         left join sys_user u on u.user_name = t.create_by
         left join sys_dept d on u.dept_id = d.dept_id
@@ -151,6 +152,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="reviewScoreNum != null "> and review_score_num = #{reviewScoreNum}</if>
             <if test="finalCoefficient != null "> and final_coefficient = #{finalCoefficient}</if>
             <if test="orderType != null "> and order_type = #{orderType}</if>
+            <if test="repairMethod != null  and repairMethod != ''"> and repair_method = #{repairMethod}</if>
 
             <!-- 业务特定数据权限过滤条件 -->
             <if test="params.businessDataScope != null and params.businessDataScope != ''">
@@ -226,6 +228,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="reviewScoreNum != null">review_score_num,</if>
             <if test="finalCoefficient != null">final_coefficient,</if>
             <if test="orderType != null">order_type,</if>
+            <if test="repairMethod != null and repairMethod != ''">repair_method,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="workOrderProjectNo != null and workOrderProjectNo != ''">#{workOrderProjectNo},</if>
@@ -281,6 +284,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="reviewScoreNum != null">#{reviewScoreNum},</if>
             <if test="finalCoefficient != null">#{finalCoefficient},</if>
             <if test="orderType != null">#{orderType},</if>
+            <if test="repairMethod != null and repairMethod != ''">#{repairMethod},</if>
          </trim>
     </insert>
 
@@ -340,6 +344,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="reviewScoreNum != null">review_score_num = #{reviewScoreNum},</if>
             <if test="finalCoefficient != null">final_coefficient = #{finalCoefficient},</if>
             <if test="orderType != null">order_type = #{orderType},</if>
+            <if test="repairMethod != null and repairMethod != ''">repair_method = #{repairMethod},</if>
         </trim>
         where id = #{id}
     </update>
@@ -409,6 +414,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="pcsStationPid != null "> and pcs_station_pid = #{pcsStationPid}</if>
             <if test="attachmentUrls != null  and attachmentUrls != ''"> and attachment_urls = #{attachmentUrls}</if>
             <if test="reviewScoreNum != null "> and review_score_num = #{reviewScoreNum}</if>
+            <if test="repairMethod != null  and repairMethod != ''"> and repair_method = #{repairMethod}</if>
         </where>
         order by id desc
     </select>