Просмотр исходного кода

工单评分插入工单数量调整

ouyj 4 месяцев назад
Родитель
Сommit
4e49ab093d

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

@@ -928,6 +928,7 @@ public class GxtOrderScoreServiceImpl implements IGxtOrderScoreService {
                         monthScore.setDeptId(deptId);
                         monthScore.setMonthPeriod(monthPeriod);
                         monthScore.setStatus(0); // 初始状态
+                        monthScore.setPersionId(SecurityUtils.getUserId());
                         monthScore.setCreateBy(SecurityUtils.getUsername());
                         monthScore.setCreateTime(new Date());
                         gxtMonthScoreService.insertGxtMonthScore(monthScore);
@@ -973,6 +974,7 @@ public class GxtOrderScoreServiceImpl implements IGxtOrderScoreService {
                         monthScore.setDeptId(deptId);
                         monthScore.setMonthPeriod(monthPeriod);
                         monthScore.setStatus(0); // 初始状态
+                        monthScore.setPersionId(SecurityUtils.getUserId());
                         monthScore.setCreateBy(SecurityUtils.getUsername());
                         monthScore.setCreateTime(new Date());
                         gxtMonthScoreService.insertGxtMonthScore(monthScore);
@@ -1005,9 +1007,9 @@ public class GxtOrderScoreServiceImpl implements IGxtOrderScoreService {
      */
     private void updateMonthFanInspection(GxtMonthScore monthScore, GxtWorkOrder order) {
         try {
-            if (order.getItemCompletionFactorSum().compareTo(BigDecimal.ONE) < 0) {
+            /*if (order.getItemCompletionFactorSum().compareTo(BigDecimal.ONE) < 0) {
                 return;
-            }
+            }*/
             // 创建查询条件,查找与当前工单相关的风机检查类型统计
             GxtMonthFanInspection queryFanInspection = new GxtMonthFanInspection();
             queryFanInspection.setMonthScoreId(monthScore.getId());

+ 69 - 69
ygtx-gxt/src/main/resources/mapper/gxt/GxtMonthFanInspectionMapper.xml

@@ -70,83 +70,83 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             AND ((wo.create_time >= STR_TO_DATE(CONCAT(#{monthPeriod}, '-01 00:00:00'), '%Y-%m-%d %H:%i:%s')
                 AND wo.create_time <![CDATA[<]]> DATE_ADD(STR_TO_DATE(CONCAT(#{monthPeriod}, '-01 00:00:00'), '%Y-%m-%d %H:%i:%s'), INTERVAL 1 MONTH)
             ) OR wo.is_deferred=1)
-            AND wo.item_completion_factor_sum=1
+            <!-- AND wo.item_completion_factor_sum=1 -->
             AND (wo.repair_method IS NULL OR wo.repair_method != '2')
         GROUP BY
             sfi.id
     </select>
 
-    <select id="selectGxtMonthFanInspectionById" parameterType="Long" resultMap="GxtMonthFanInspectionResult">
-        <include refid="selectGxtMonthFanInspectionVo"/>
-        where id = #{id}
-    </select>
+<select id="selectGxtMonthFanInspectionById" parameterType="Long" resultMap="GxtMonthFanInspectionResult">
+    <include refid="selectGxtMonthFanInspectionVo"/>
+    where id = #{id}
+</select>
 
-    <insert id="insertGxtMonthFanInspection" parameterType="GxtMonthFanInspection" useGeneratedKeys="true" keyProperty="id">
-        insert into gxt_month_fan_inspection
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="monthScoreId != null">month_score_id,</if>
-            <if test="deptId != null">dept_id,</if>
-            <if test="deptName != null and deptName != ''">dept_name,</if>
-            <if test="fanInspectionId != null">fan_inspection_id,</if>
-            <if test="deviceCount != null">device_count,</if>
-            <if test="fanInspectionScore != null">fan_inspection_score,</if>
-            <if test="calculatedScore != null">calculated_score,</if>
-            <if test="monthPeriod != null and monthPeriod != ''">month_period,</if>
-            <if test="status != null">status,</if>
-            <if test="createBy != null and createBy != ''">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null and updateBy != ''">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-            <if test="remark != null">remark,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="monthScoreId != null">#{monthScoreId},</if>
-            <if test="deptId != null">#{deptId},</if>
-            <if test="deptName != null and deptName != ''">#{deptName},</if>
-            <if test="fanInspectionId != null">#{fanInspectionId},</if>
-            <if test="deviceCount != null">#{deviceCount},</if>
-            <if test="fanInspectionScore != null">#{fanInspectionScore},</if>
-            <if test="calculatedScore != null">#{calculatedScore},</if>
-            <if test="monthPeriod != null and monthPeriod != ''">#{monthPeriod},</if>
-            <if test="status != null">#{status},</if>
-            <if test="createBy != null and createBy != ''">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-            <if test="remark != null">#{remark},</if>
-         </trim>
-    </insert>
+<insert id="insertGxtMonthFanInspection" parameterType="GxtMonthFanInspection" useGeneratedKeys="true" keyProperty="id">
+    insert into gxt_month_fan_inspection
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+        <if test="monthScoreId != null">month_score_id,</if>
+        <if test="deptId != null">dept_id,</if>
+        <if test="deptName != null and deptName != ''">dept_name,</if>
+        <if test="fanInspectionId != null">fan_inspection_id,</if>
+        <if test="deviceCount != null">device_count,</if>
+        <if test="fanInspectionScore != null">fan_inspection_score,</if>
+        <if test="calculatedScore != null">calculated_score,</if>
+        <if test="monthPeriod != null and monthPeriod != ''">month_period,</if>
+        <if test="status != null">status,</if>
+        <if test="createBy != null and createBy != ''">create_by,</if>
+        <if test="createTime != null">create_time,</if>
+        <if test="updateBy != null and updateBy != ''">update_by,</if>
+        <if test="updateTime != null">update_time,</if>
+        <if test="remark != null">remark,</if>
+     </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+        <if test="monthScoreId != null">#{monthScoreId},</if>
+        <if test="deptId != null">#{deptId},</if>
+        <if test="deptName != null and deptName != ''">#{deptName},</if>
+        <if test="fanInspectionId != null">#{fanInspectionId},</if>
+        <if test="deviceCount != null">#{deviceCount},</if>
+        <if test="fanInspectionScore != null">#{fanInspectionScore},</if>
+        <if test="calculatedScore != null">#{calculatedScore},</if>
+        <if test="monthPeriod != null and monthPeriod != ''">#{monthPeriod},</if>
+        <if test="status != null">#{status},</if>
+        <if test="createBy != null and createBy != ''">#{createBy},</if>
+        <if test="createTime != null">#{createTime},</if>
+        <if test="updateBy != null and updateBy != ''">#{updateBy},</if>
+        <if test="updateTime != null">#{updateTime},</if>
+        <if test="remark != null">#{remark},</if>
+     </trim>
+</insert>
 
-    <update id="updateGxtMonthFanInspection" parameterType="GxtMonthFanInspection">
-        update gxt_month_fan_inspection
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="monthScoreId != null">month_score_id = #{monthScoreId},</if>
-            <if test="deptId != null">dept_id = #{deptId},</if>
-            <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
-            <if test="fanInspectionId != null">fan_inspection_id = #{fanInspectionId},</if>
-            <if test="deviceCount != null">device_count = #{deviceCount},</if>
-            <if test="fanInspectionScore != null">fan_inspection_score = #{fanInspectionScore},</if>
-            <if test="calculatedScore != null">calculated_score = #{calculatedScore},</if>
-            <if test="monthPeriod != null and monthPeriod != ''">month_period = #{monthPeriod},</if>
-            <if test="status != null">status = #{status},</if>
-            <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-            <if test="remark != null">remark = #{remark},</if>
-        </trim>
-        where id = #{id}
-    </update>
+<update id="updateGxtMonthFanInspection" parameterType="GxtMonthFanInspection">
+    update gxt_month_fan_inspection
+    <trim prefix="SET" suffixOverrides=",">
+        <if test="monthScoreId != null">month_score_id = #{monthScoreId},</if>
+        <if test="deptId != null">dept_id = #{deptId},</if>
+        <if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
+        <if test="fanInspectionId != null">fan_inspection_id = #{fanInspectionId},</if>
+        <if test="deviceCount != null">device_count = #{deviceCount},</if>
+        <if test="fanInspectionScore != null">fan_inspection_score = #{fanInspectionScore},</if>
+        <if test="calculatedScore != null">calculated_score = #{calculatedScore},</if>
+        <if test="monthPeriod != null and monthPeriod != ''">month_period = #{monthPeriod},</if>
+        <if test="status != null">status = #{status},</if>
+        <if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
+        <if test="createTime != null">create_time = #{createTime},</if>
+        <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
+        <if test="updateTime != null">update_time = #{updateTime},</if>
+        <if test="remark != null">remark = #{remark},</if>
+    </trim>
+    where id = #{id}
+</update>
 
-    <delete id="deleteGxtMonthFanInspectionById" parameterType="Long">
-        delete from gxt_month_fan_inspection where id = #{id}
-    </delete>
+<delete id="deleteGxtMonthFanInspectionById" parameterType="Long">
+    delete from gxt_month_fan_inspection where id = #{id}
+</delete>
 
-    <delete id="deleteGxtMonthFanInspectionByIds" parameterType="Long">
-        delete from gxt_month_fan_inspection where id in
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
+<delete id="deleteGxtMonthFanInspectionByIds" parameterType="Long">
+    delete from gxt_month_fan_inspection where id in
+    <foreach item="id" collection="array" open="(" separator="," close=")">
+        #{id}
+    </foreach>
+</delete>
 
 </mapper>