Prechádzať zdrojové kódy

稽核统计添加集合类型

sunyize 2 rokov pred
rodič
commit
93375b64ac

+ 16 - 0
tnc-sms/src/main/java/org/jeecg/modules/smscheck/controller/SmsCheckStatisticsController.java

@@ -218,6 +218,22 @@ public class SmsCheckStatisticsController extends JeecgController<SmsStatisticsC
         return Result.OK(stringObjectMap);
     }
 
+    /**
+     * 根据稽核点 查 稽核统计数
+     *
+     * @return 数据
+     */
+    @ApiOperation(value = "根据稽核状态   查 任务状稽核类型统计数", notes = "根据 稽核状态 查 任务状稽核类型统计数")
+    @GetMapping(value = "/checkStatusToCount")
+    @PermissionData(pageComponent = "statistics/SmsCheckStatistics")
+    public Result< Map<String, Object> > checkStatusToCount(   HttpServletRequest request) {
+        String infoId = request.getParameterMap().get("infoId")==null?"": Arrays.toString(request.getParameterMap().get("infoId")).replace("[", "").replace("]", "").replace("*", "");
+        String endDate = request.getParameterMap().get("endDate")==null?"": Arrays.toString(request.getParameterMap().get("endDate")).replace("[", "").replace("]", "").replace("*", "");
+        String startDate = request.getParameterMap().get("startDate")==null?"": Arrays.toString(request.getParameterMap().get("startDate")).replace("[", "").replace("]", "").replace("*", "");
+        SmsStatisticsCheckVo smsStatisticsCheckVo =getSmsStatisticsCheckVo(request);
+        Map<String, Object>  stringObjectMap = smsCheckStatisticsService.checkStatusToCount(smsStatisticsCheckVo.getType(),  startDate,  endDate,infoId,smsStatisticsCheckVo);
 
+        return Result.OK(stringObjectMap);
+    }
 
 }

+ 10 - 0
tnc-sms/src/main/java/org/jeecg/modules/smscheck/mapper/SmsCheckStaticsMapper.java

@@ -57,4 +57,14 @@ public interface SmsCheckStaticsMapper  extends BaseMapper<SmsStatisticsCheckVo>
                                                     @Param("customerName") String customerName,@Param("customerNo") String customerNo,
                                                     @Param("taskName") String taskName,@Param("taskState")String taskState,@Param("checkState") String checkState);
 
+
+    /**
+     *  根据任务状态 查 任务状稽核类型统计数
+     * @return
+     */
+    List<Map<String,Object>> getCheckStatusToCount(@Param("type") String type,@Param("startDate")String startDate,
+                                                     @Param("endDate")String endDate,@Param("taskId") String taskId,
+                                                     @Param("customerName") String customerName,@Param("customerNo") String customerNo,
+                                                     @Param("taskName") String taskName,@Param("taskState")String taskState,@Param("checkState") String checkState);
+
 }

+ 9 - 2
tnc-sms/src/main/java/org/jeecg/modules/smscheck/mapper/xml/SmsCheckStaticsMapper.xml

@@ -38,7 +38,14 @@
         GROUP BY b.task_state
     </select>
 
-
+    <select id="getCheckStatusToCount" resultType="java.util.HashMap">
+        select    a.check_state,count(*) num
+        from sms_check_customer_info a
+        LEFT JOIN sms_check_task b   on a.task_id =b.id
+        where 1=1 and b.type in (1,2,3,4)  and a.del_flag =0
+        <include refid="ifTest"/>
+        GROUP BY a.check_state
+    </select>
 
     <select id="statisticsWorkLogById" resultType="java.util.HashMap">
         select  <include refid="field"/>
@@ -86,6 +93,6 @@
         <if test="customerNo != null   and customerNo!='' "> and  a.customer_no = #{customerNo} </if>
         <if test="taskName != null   and taskName!='' "> and  b.task_name = #{taskName} </if>
         <if test="taskState != null   and taskState!='' "> and  b.task_state = #{taskState} </if>
-        <if test="checkState != null   and checkState!='' "> and  a.check_state = #{checkState} </if>
+        <if test="checkState != null   and checkState!='' "> and  a.check_state in (#{checkState}) </if>
     </sql>
 </mapper>

+ 3 - 0
tnc-sms/src/main/java/org/jeecg/modules/smscheck/service/SmsCheckStatisticsService.java

@@ -24,6 +24,9 @@ public interface SmsCheckStatisticsService extends IService<SmsStatisticsCheckVo
 
    Map<String, Object>   statisticsStatusToCount(String type,String startDate,String endDate,String infoId,SmsStatisticsCheckVo smsStatisticsCheckVo);
 
+    Map<String, Object>   checkStatusToCount(String type,String startDate,String endDate,String infoId,SmsStatisticsCheckVo smsStatisticsCheckVo);
+
+
     List<Map<String,Object>>  statisticsWorkLogById(String Id);
 
 }

+ 29 - 1
tnc-sms/src/main/java/org/jeecg/modules/smscheck/service/impl/SmsCheckStatisticsServiceImpl.java

@@ -140,12 +140,40 @@ public class SmsCheckStatisticsServiceImpl extends ServiceImpl<SmsCheckStaticsMa
         int num = 0;
         for (Map<String, Object> map : maps ) {
             mapCount.put(map.get("task_state").toString(),map.get("num").toString());
-            num+=Integer.valueOf(map.get("num").toString());
+            num+=Integer.parseInt(map.get("num").toString());
         }
         mapCount.put("num",num);
         return mapCount;
     }
 
+    @Override
+    public Map<String, Object> checkStatusToCount(String type, String startDate, String endDate, String infoId, SmsStatisticsCheckVo smsStatisticsCheckVo) {
+        Map<String,Object>mapCount = new HashMap<>();
+        String customerName = smsStatisticsCheckVo.getCustomerName();
+        String customerNo = smsStatisticsCheckVo.getCustomerNo();
+        String taskName = smsStatisticsCheckVo.getTaskName();
+        String taskState = smsStatisticsCheckVo.getTaskState();
+        String checkState = smsStatisticsCheckVo.getCheckState();
+        List<Map<String, Object>> maps = smsCheckStaticsMapper.getCheckStatusToCount(type, startDate, endDate, infoId, customerName, customerNo, taskName, taskState,checkState);
+
+        int num = 0;
+        for (Map<String, Object> map : maps ) {
+            mapCount.put(map.get("check_state").toString(),map.get("num").toString());
+            num+=Integer.parseInt(map.get("num").toString());
+        }
+        // 0 1 为一组
+        if (mapCount.get("1")!=null && mapCount.get("1")!="" && mapCount.get("0")!=null && mapCount.get("0")!="" ){
+            mapCount.put("0",Integer.parseInt(mapCount.get("0").toString())  +Integer.parseInt(mapCount.get("1").toString()));
+        }
+        if (mapCount.get("2")!=null && mapCount.get("2")!="" && mapCount.get("3")!=null && mapCount.get("3")!="" ){
+            mapCount.put("2",Integer.parseInt(mapCount.get("2").toString())  +Integer.parseInt(mapCount.get("3").toString()));
+        }
+
+        mapCount.put("num",num);
+
+        return mapCount;
+    }
+
     @Override
     public List<Map<String,Object>> statisticsWorkLogById(String Id) {
         return  smsCheckStaticsMapper.statisticsWorkLogById(Id);