소스 검색

稽核统计 xiangqing

sunyize 2 년 전
부모
커밋
20434fda32

+ 37 - 13
tnc-sms/src/main/java/org/jeecg/modules/smscheck/controller/SmsCheckStatisticsController.java

@@ -9,21 +9,20 @@ import org.apache.commons.beanutils.PropertyUtils;
 import org.apache.poi.ss.formula.functions.T;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.aspect.annotation.PermissionData;
 
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.vo.LoginUser;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.smscheck.entity.SmsCheckTask;
 import org.jeecg.modules.smscheck.entity.SmsStatisticsCheckVo;
 import org.jeecg.modules.smscheck.service.SmsCheckStatisticsService;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
 import org.jeecgframework.poi.excel.entity.ExportParams;
 import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
 import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import org.springframework.web.servlet.ModelAndView;
 
 import javax.annotation.Resource;
@@ -74,12 +73,14 @@ public class SmsCheckStatisticsController extends JeecgController<SmsStatisticsC
         String customerNo = request.getParameterMap().get("customerNo")==null?"": Arrays.toString(request.getParameterMap().get("customerNo")).replace("[", "").replace("]", "").replace("*", "");
         String customerName = request.getParameterMap().get("customerName")==null?"": Arrays.toString(request.getParameterMap().get("customerName")).replace("[", "").replace("]", "").replace("*", "");
         String taskName = request.getParameterMap().get("taskName")==null?"": Arrays.toString(request.getParameterMap().get("taskName")).replace("[", "").replace("]", "").replace("*", "");
+        String taskState = request.getParameterMap().get("taskState")==null?"": Arrays.toString(request.getParameterMap().get("taskState")).replace("[", "").replace("]", "").replace("*", "");
 
         SmsStatisticsCheckVo smsStatisticsCheckVo=new SmsStatisticsCheckVo();
         smsStatisticsCheckVo.setType(taskType);
         smsStatisticsCheckVo.setCustomerName(customerName);
         smsStatisticsCheckVo.setCustomerNo(customerNo);
         smsStatisticsCheckVo.setTaskName(taskName);
+        smsStatisticsCheckVo.setTaskState(taskState);
         Map<String, Object> stringObjectMap = smsCheckStatisticsService.smsCheckStatisticsList(smsStatisticsCheckVo, page,startDate,endDate,infoId);
         return Result.OK(stringObjectMap);
     }
@@ -101,12 +102,13 @@ public class SmsCheckStatisticsController extends JeecgController<SmsStatisticsC
         String customerNo = request.getParameterMap().get("customerNo")==null?"": Arrays.toString(request.getParameterMap().get("customerNo")).replace("[", "").replace("]", "").replace("*", "");
         String customerName = request.getParameterMap().get("customerName")==null?"": Arrays.toString(request.getParameterMap().get("customerName")).replace("[", "").replace("]", "").replace("*", "");
         String taskName = request.getParameterMap().get("taskName")==null?"": Arrays.toString(request.getParameterMap().get("taskName")).replace("[", "").replace("]", "").replace("*", "");
+        String taskState = request.getParameterMap().get("taskState")==null?"": Arrays.toString(request.getParameterMap().get("taskState")).replace("[", "").replace("]", "").replace("*", "");
 
         SmsStatisticsCheckVo smsStatisticsCheckVo=new SmsStatisticsCheckVo();
         smsStatisticsCheckVo.setCustomerName(customerName);
         smsStatisticsCheckVo.setCustomerNo(customerNo);
         smsStatisticsCheckVo.setTaskName(taskName);
-
+        smsStatisticsCheckVo.setTaskState(taskState);
         Map<String, Object> stringObjectMap = smsCheckStatisticsService.statisticsCountListByType(taskType,  startDate,  endDate,infoId,smsStatisticsCheckVo);
 
         return Result.OK(stringObjectMap);
@@ -129,12 +131,14 @@ public class SmsCheckStatisticsController extends JeecgController<SmsStatisticsC
         String customerNo = request.getParameterMap().get("customerNo")==null?"": Arrays.toString(request.getParameterMap().get("customerNo")).replace("[", "").replace("]", "").replace("*", "");
         String customerName = request.getParameterMap().get("customerName")==null?"": Arrays.toString(request.getParameterMap().get("customerName")).replace("[", "").replace("]", "").replace("*", "");
         String taskName = request.getParameterMap().get("taskName")==null?"": Arrays.toString(request.getParameterMap().get("taskName")).replace("[", "").replace("]", "").replace("*", "");
+        String taskState = request.getParameterMap().get("taskState")==null?"": Arrays.toString(request.getParameterMap().get("taskState")).replace("[", "").replace("]", "").replace("*", "");
 
         SmsStatisticsCheckVo smsStatisticsCheckVo=new SmsStatisticsCheckVo();
         smsStatisticsCheckVo.setCustomerName(customerName);
         smsStatisticsCheckVo.setCustomerNo(customerNo);
         smsStatisticsCheckVo.setTaskName(taskName);
         smsStatisticsCheckVo.setType(taskType);
+        smsStatisticsCheckVo.setTaskState(taskState);
         LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
 
         long totalNum = (long) smsCheckStatisticsService.statisticsCountListByType(null,endDate,startDate,infoId,smsStatisticsCheckVo).get("totalNum");
@@ -175,17 +179,37 @@ public class SmsCheckStatisticsController extends JeecgController<SmsStatisticsC
         return mv;
 
     }
+
+
+    /**
+     * 批量删除
+     *
+     * @param ids 主键
+     * @return 结果
+     */
+    @AutoLog(value = "稽核统计-批量删除")
+    @ApiOperation(value = "稽核统计-批量删除", notes = "稽核统计-批量删除")
+    @DeleteMapping(value = "/deleteBatch")
+    public Result<String> deleteBatch(@RequestParam(name = "ids") String ids) {
+        this.smsCheckStatisticsService.removeByIds(Arrays.asList(ids.split(",")));
+        return Result.OK("批量删除成功!");
+    }
     /**
-     * 获取对象ID
+     * 通过id查询
      *
-     * @return
+     * @param id 主键
+     * @return 数据
      */
-    private String getId(T item) {
-        try {
-            return PropertyUtils.getProperty(item, "id").toString();
-        } catch (Exception e) {
-            e.printStackTrace();
-            return null;
+    //@AutoLog(value = "稽核统计-通过id查询")
+    @ApiOperation(value = "物联网稽核记录-通过id查询", notes = "物联网稽核记录-通过id查询")
+    @GetMapping(value = "/queryById")
+    public Result< List<Map<String,Object>>> queryById(@RequestParam(name = "id") String id) {
+        List<Map<String,Object>> byId = smsCheckStatisticsService.statisticsWorkLogById(id);
+
+        if (byId == null) {
+            return Result.error("未找到对应数据");
         }
+        return Result.OK(byId);
     }
+
 }

+ 4 - 2
tnc-sms/src/main/java/org/jeecg/modules/smscheck/entity/SmsStatisticsCheckVo.java

@@ -24,6 +24,7 @@ import java.util.Date;
 @Accessors(chain = true)
 @EqualsAndHashCode(callSuper = false)
 @ApiModel(value="sms_check_customer_info对象", description="客户信息")
+@TableName("sms_check_customer_info")
 public class SmsStatisticsCheckVo {
     private static final long serialVersionUID = 1L;
 
@@ -208,11 +209,12 @@ public class SmsStatisticsCheckVo {
 
     //**********************
     /** 稽核类型 */
-    @Excel(name = "稽核类型", width = 15)
+    @Excel(name = "稽核类型", width = 15, dicCode = "sms_check_task_type")
+    @Dict(dicCode = "sms_check_task_type")
     @ApiModelProperty(value = "稽核类型")
     private String type;
 
-    /** 稽核类型 */
+
     @Excel(name = "任务名称", width = 15)
     @ApiModelProperty(value = "任务名称")
     private String taskName;

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

@@ -27,7 +27,7 @@ public interface SmsCheckStaticsMapper  extends BaseMapper<SmsStatisticsCheckVo>
                                                     @Param("size") Long size, @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("taskName") String taskName,@Param("taskState")String taskState);
 
     /**
      * 获取总记录条数
@@ -36,6 +36,16 @@ public interface SmsCheckStaticsMapper  extends BaseMapper<SmsStatisticsCheckVo>
     Long selectTotal(@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("taskName") String taskName,@Param("taskState")String taskState);
+
+
+
+
+    /**
+     *  稽核统计-通过id查询
+     * @param id
+     * @return
+     */
+     List<Map<String,Object>>  statisticsWorkLogById(@Param("Id") String id );
 
 }

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

@@ -9,11 +9,45 @@
 
     <select id="selectCheckStaticsList"   parameterType="org.jeecg.modules.smscheck.entity.SmsStatisticsCheckVo" resultType ="org.jeecg.modules.smscheck.entity.SmsStatisticsCheckVo">
         select
-        a.id,task_id   taskId,customer_no  customerNo,customer_name  customerName,sms_number  smsNumber,user_no  userNo,
+        <include refid="field"/>
+        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"/>
+        order BY a.create_time  desc
+        <if test="start != null and size != null">
+            LIMIT #{start},#{size}
+        </if>
+    </select>
+
+
+    <select id="selectTotal" resultType="java.lang.Long">
+        select  count(*)
+        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"/>
+    </select>
+
+
+
+
+
+    <select id="statisticsWorkLogById" resultType="java.util.HashMap">
+        select  <include refid="field"/>
+        from sms_check_customer_info a
+        left join sms_check_work_log c on a.id = c.info_id
+        left join sms_check_task b on b.id = a.task_id
+        where 1= 1
+        <if test="Id != null   and Id!='' "> and  a.id = #{Id} </if>
+    </select>
+
+    <sql id="field" >
+        a.id,a.task_id   taskId,a.customer_no  customerNo,a.customer_name  customerName,a.sms_number  smsNumber,user_no  userNo,
         network_access_time
-        networkAccessTime,user_state  userState,staff_info  staffInfo,staff_id  staffId,
+        networkAccessTime,user_state  userState,staff_info  staffInfo,a.staff_id  staffId,
         staff_username
-        staffUsername,staff_name  staffName,staff_no  staffNo,staff_dept_level2  staffDeptLevel2,
+        staffUsername,a.staff_name  staffName,a.staff_no  staffNo,staff_dept_level2  staffDeptLevel2,
         staff_dept_level2_name
         staffDeptLevel2Name,staff_dept_level2_no  staffDeptLevel2No,staff_dept_level3  staffDeptLevel3,
         staff_dept_level3_name
@@ -33,39 +67,17 @@
         b.task_state  taskState,b.task_start_time  taskStartTime,b.task_end_time taskEndTime,
         b.customer_count  customerCount,b.uncheck_count uncheckCount,b.check_count checkCount,
         b.file_url  fileUrl,b.sys_org_code  sysOrgCode
-        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
-        <if test="type != null and type != '' "> and  b.type= #{type} </if>
-        <if test="startDate != null and startDate!='' "> and  a.create_time >= #{startDate} </if>
-        <if test="endDate != null   and endDate!='' "> and a.create_time <![CDATA[<=]]> #{endDate} </if>
-        <if test="taskId != null   and taskId!='' "> and  a.task_id = #{taskId} </if>
-
-        <if test="customerName != null   and customerName!='' "> and  a.customer_name = #{customerName} </if>
-        <if test="customerNo != null   and customerNo!='' "> and  a.customer_no = #{customerNo} </if>
-        <if test="taskName != null   and taskName!='' "> and  b.task_name = #{taskId} </if>
-
-
-
-        order BY a.create_time  desc
-        <if test="start != null and size != null">
-            LIMIT #{start},#{size}
-        </if>
-    </select>
+    </sql>
 
 
-    <select id="selectTotal" resultType="java.lang.Long">
-        select  count(*)
-        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
+    <sql id="ifTest">
         <if test="type != null and type != '' "> and  b.type= #{type} </if>
         <if test="startDate != null and startDate!='' "> and  a.create_time >= #{startDate} </if>
         <if test="endDate != null   and endDate!='' "> and a.create_time <![CDATA[<=]]> #{endDate} </if>
         <if test="taskId != null   and taskId!='' "> and  a.task_id = #{taskId} </if>
         <if test="customerName != null   and customerName!='' "> and  a.customer_name = #{customerName} </if>
         <if test="customerNo != null   and customerNo!='' "> and  a.customer_no = #{customerNo} </if>
-        <if test="taskName != null   and taskName!='' "> and  b.task_name = #{taskId} </if>
-    </select>
-
+        <if test="taskName != null   and taskName!='' "> and  b.task_name = #{taskName} </if>
+        <if test="taskState != null   and taskState!='' "> and  b.task_state = #{taskState} </if>
+    </sql>
 </mapper>

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

@@ -21,4 +21,8 @@ public interface SmsCheckStatisticsService extends IService<SmsStatisticsCheckVo
     Map<String,Object>  smsCheckStatisticsList(SmsStatisticsCheckVo smsStatisticsCheckVo, Page page,String startDate,String endDate,String infoId);
 
     Map<String,Object>  statisticsCountListByType(String type,String startDate,String endDate,String infoId,SmsStatisticsCheckVo smsStatisticsCheckVo);
+
+
+    List<Map<String,Object>>  statisticsWorkLogById(String Id);
+
 }

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

@@ -44,10 +44,10 @@ public class SmsCheckStatisticsServiceImpl extends ServiceImpl<SmsCheckStaticsMa
         String customerName = smsStatisticsCheckVo.getCustomerName();
         String customerNo = smsStatisticsCheckVo.getCustomerNo();
         String taskName = smsStatisticsCheckVo.getTaskName();
+        String taskState = smsStatisticsCheckVo.getTaskState();
+        List<Map<String, Object>> maps = smsCheckStaticsMapper.selectCheckStaticsList(smsStatisticsCheckVo.getType(), start,size,startDate,endDate,taskId,customerName,customerNo,taskName,taskState);
 
-        List<Map<String, Object>> maps = smsCheckStaticsMapper.selectCheckStaticsList(smsStatisticsCheckVo.getType(), start,size,startDate,endDate,taskId,customerName,customerNo,taskName);
-
-        Long total = smsCheckStaticsMapper.selectTotal(smsStatisticsCheckVo.getType(),startDate,endDate,taskId,customerName,customerNo,taskName);
+        Long total = smsCheckStaticsMapper.selectTotal(smsStatisticsCheckVo.getType(),startDate,endDate,taskId,customerName,customerNo,taskName,taskState);
 
         //构建返回对象内容
         mapResult.put("current",current);
@@ -74,24 +74,25 @@ public class SmsCheckStatisticsServiceImpl extends ServiceImpl<SmsCheckStaticsMa
         String customerName = smsStatisticsCheckVo.getCustomerName();
         String customerNo = smsStatisticsCheckVo.getCustomerNo();
         String taskName = smsStatisticsCheckVo.getTaskName();
+        String taskState = smsStatisticsCheckVo.getTaskState();
         //总数
-        Long totalNum = smsCheckStaticsMapper.selectTotal(null,startDate,endDate,infoId,customerName,customerNo,taskName);
+        Long totalNum = smsCheckStaticsMapper.selectTotal(null,startDate,endDate,infoId,customerName,customerNo,taskName,taskState);
 
         //1:行短稽核
         String line = CheckTaskTypeEnum.Line.getCode();
-        Long lineNum = smsCheckStaticsMapper.selectTotal(line,startDate,endDate,infoId,customerName,customerNo,taskName);
+        Long lineNum = smsCheckStaticsMapper.selectTotal(line,startDate,endDate,infoId,customerName,customerNo,taskName,taskState);
 
         //2:物联网业务稽核
         String business = CheckTaskTypeEnum.Business.getCode();
-        Long businessNum = smsCheckStaticsMapper.selectTotal(business,startDate,endDate,infoId,customerName,customerNo,taskName);
+        Long businessNum = smsCheckStaticsMapper.selectTotal(business,startDate,endDate,infoId,customerName,customerNo,taskName,taskState);
 
         //3.复开审批
         String reopening = CheckTaskTypeEnum.Reopening.getCode();
-        Long reopeningNum = smsCheckStaticsMapper.selectTotal(reopening,startDate,endDate,infoId,customerName,customerNo,taskName);
+        Long reopeningNum = smsCheckStaticsMapper.selectTotal(reopening,startDate,endDate,infoId,customerName,customerNo,taskName,taskState);
 
         //4.中继线稽核
         String trunkLineAudit = CheckTaskTypeEnum.TrunkLineAudit.getCode();
-        Long trunkLineAuditNum = smsCheckStaticsMapper.selectTotal(trunkLineAudit,startDate,endDate,infoId,customerName,customerNo,taskName);
+        Long trunkLineAuditNum = smsCheckStaticsMapper.selectTotal(trunkLineAudit,startDate,endDate,infoId,customerName,customerNo,taskName,taskState);
 
         Map<String,Object> mapNums = new HashMap<>();
 
@@ -107,5 +108,11 @@ public class SmsCheckStatisticsServiceImpl extends ServiceImpl<SmsCheckStaticsMa
         return mapNums;
     }
 
+    @Override
+    public List<Map<String,Object>> statisticsWorkLogById(String Id) {
+        return  smsCheckStaticsMapper.statisticsWorkLogById(Id);
+
+    }
+
 
 }