فهرست منبع

简易维修模式-获取维修单统计

guarantee-lsq 1 سال پیش
والد
کامیت
0953044a1a

+ 2 - 0
platform-dao/src/main/java/com/platform/dao/mapper/repair/RepairApplicationFormMapper.java

@@ -105,4 +105,6 @@ public interface RepairApplicationFormMapper extends MyMapper<RepairApplicationF
      * @return
      */
     List<RepairApplicationFormVO> selectRepairList(RepairApplicationFormDTO model);
+
+    List<RepairApplicationFormVO> staticsNumByStatus(RepairApplicationFormDTO model);
 }

+ 4 - 0
platform-dao/src/main/java/com/platform/dao/vo/repair/RepairApplicationFormVO.java

@@ -492,4 +492,8 @@ public class RepairApplicationFormVO extends BaseVO implements Serializable {
      */
     private String verifyRepairUserId;
 
+    private Integer verifyNum; // 审核中单数
+
+    private Integer refusedNum; // 拒绝单数
+
 }

+ 11 - 0
platform-dao/src/main/resources/mapper/repair/RepairApplicationFormMapper.xml

@@ -555,4 +555,15 @@
         order by count(1) desc
         limit 50
     </select>
+
+    <select id="staticsNumByStatus" parameterType="com.platform.dao.dto.repair.RepairApplicationFormDTO"
+            resultType="com.platform.dao.vo.repair.RepairApplicationFormVO">
+        select status,count(id) as repairNum from t_repair_application_form
+        <where>
+            <if test="repairUserId != null and repairUserId != ''">
+                and repair_user_id = #{repairUserId}
+            </if>
+        </where>
+        group by status
+    </select>
 </mapper>

+ 6 - 0
platform-rest/src/main/java/com/platform/rest/controller/repair/RepairApplicationFormController.java

@@ -720,4 +720,10 @@ public class RepairApplicationFormController {
         RepairStrategyFactory.getStrategy(repairFormDTO.getCategory()).handleCallRepair(repairFormDTO);
         return new R<>();
     }
+
+    @SysLog("获取维修人工单状态统计")
+    @GetMapping("/statics/repair/num")
+    public R staticsRepairNum() {
+        return new R<>(repairApplicationFormService.staticsNumByStatus());
+    }
 }

+ 2 - 0
platform-service/src/main/java/com/platform/service/repair/RepairApplicationFormService.java

@@ -210,4 +210,6 @@ public interface RepairApplicationFormService extends IBaseService<RepairApplica
      * @return
      */
     Map<Integer,RepairApplicationFormVO> countNumByDept(RepairApplicationFormDTO model);
+
+    RepairApplicationFormVO staticsNumByStatus();
 }

+ 24 - 0
platform-service/src/main/java/com/platform/service/repair/impl/RepairApplicationFormServiceImpl.java

@@ -799,6 +799,30 @@ public class RepairApplicationFormServiceImpl extends BaseServiceImpl<RepairAppl
         return result;
     }
 
+    @Override
+    public RepairApplicationFormVO staticsNumByStatus() {
+        RepairApplicationFormVO vo = new RepairApplicationFormVO();
+        RepairApplicationFormDTO queryDTO = new RepairApplicationFormDTO();
+        queryDTO.setRepairUserId(SecurityUtils.getUserInfo().getUserId());
+        List<RepairApplicationFormVO> voList = mapper.staticsNumByStatus(queryDTO);
+        if(voList != null && voList.size() > 0){
+            for(RepairApplicationFormVO item : voList){
+                switch (item.getStatus()){
+                    case 2:
+                        vo.setRepairNum(item.getRepairNum());
+                        break;
+                    case 3:
+                        vo.setVerifyNum(item.getRepairNum());
+                        break;
+                    case 25:
+                        vo.setRefusedNum(item.getRepairNum());
+                        break;
+                }
+            }
+        }
+        return vo;
+    }
+
     @Override
     public List<FiftyFailSbReportVO> getFiftyFailSbReport(RepairApplicationFormDTO dto) {
 

+ 0 - 2
platform-service/src/main/java/com/platform/service/sb/impl/SbInfoServiceImpl.java

@@ -3,7 +3,6 @@ package com.platform.service.sb.impl;
 import cn.hutool.core.collection.CollectionUtil;
 import cn.hutool.core.date.DateUtil;
 import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.platform.activiti.bean.ActObj;
 import com.platform.activiti.enums.ActApplyEnum;
@@ -80,7 +79,6 @@ import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections.map.HashedMap;
 import org.apache.ibatis.exceptions.TooManyResultsException;
-import org.apache.poi.ss.formula.functions.T;
 import org.springframework.core.env.Environment;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Isolation;