|
|
@@ -4,11 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import io.swagger.models.auth.In;
|
|
|
+import org.apache.commons.collections.CollectionUtils;
|
|
|
import org.checkerframework.checker.units.qual.A;
|
|
|
import org.jeecg.common.constant.CommonConstant;
|
|
|
import org.jeecg.common.system.vo.SysDepartModel;
|
|
|
import org.jeecg.common.system.vo.SysPermissionDataRuleModel;
|
|
|
import org.jeecg.modules.smscheck.entity.*;
|
|
|
+import org.jeecg.modules.smscheck.mapper.SmsCheckCustomerInfoBecomeDueMapper;
|
|
|
+import org.jeecg.modules.smscheck.mapper.SmsWarningCustomerDataMapper;
|
|
|
import org.jeecg.modules.smscheck.service.ISysUserService;
|
|
|
import org.jeecg.modules.smscheck.vo.SmsCheckCustomerInfoTaskVo;
|
|
|
import org.jeecg.modules.smscheck.vo.SmsCheckTaskVo;
|
|
|
@@ -23,6 +26,8 @@ import java.util.*;
|
|
|
import java.util.function.Function;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
+import static java.util.stream.Collectors.toList;
|
|
|
+
|
|
|
/**
|
|
|
* @description 客户信息
|
|
|
* @author jeecg-boot
|
|
|
@@ -36,6 +41,8 @@ public class SmsCheckCustomerInfoServiceImpl extends ServiceImpl<SmsCheckCustome
|
|
|
@Autowired
|
|
|
private SysSmsUserServiceImpl service;
|
|
|
@Autowired
|
|
|
+ private SmsCheckCustomerInfoBecomeDueMapper smsCheckCustomerInfoBecomeDueMapper;
|
|
|
+ @Autowired
|
|
|
private ISysUserService iSysUserService;
|
|
|
@Override
|
|
|
public Integer checkInfoWarningCount(SmsCheckCustomerInfo smsCheckCustomerInfo) {
|
|
|
@@ -67,7 +74,23 @@ public class SmsCheckCustomerInfoServiceImpl extends ServiceImpl<SmsCheckCustome
|
|
|
|
|
|
@Override
|
|
|
public List<SmsCustomerInfoGroupByCheckState> groupCheckStateWarning(String startDate, String endDate,String id,String taskType) {
|
|
|
- return smsCheckCustomerInfoMapper.groupCheckStateWarning( startDate, endDate,id,taskType);
|
|
|
+
|
|
|
+
|
|
|
+ List<SmsCustomerInfoGroupByCheckState> smsCustomerInfoGroupByCheckStates = smsCheckCustomerInfoMapper.groupCheckStateWarning(startDate, endDate, id, taskType);
|
|
|
+ Map<Integer, SmsCustomerInfoGroupByCheckState> meterStationDateByDateMap
|
|
|
+ = smsCustomerInfoGroupByCheckStates.stream().collect(Collectors.toMap(v->v.getCheckState(),Function.identity(), (o, n) -> o));
|
|
|
+ List<SmsCustomerInfoGroupByCheckState> smsCustomerInfoGroupByCheckStateList =new ArrayList<>();
|
|
|
+
|
|
|
+ for (int i = 0; i < 6; i++) {
|
|
|
+ if (meterStationDateByDateMap.get(i)==null){
|
|
|
+ SmsCustomerInfoGroupByCheckState smsCustomerInfoGroupByCheckState = new SmsCustomerInfoGroupByCheckState();
|
|
|
+ smsCustomerInfoGroupByCheckState.setCheckState(i);
|
|
|
+ smsCustomerInfoGroupByCheckState.setCount(0);
|
|
|
+ smsCustomerInfoGroupByCheckStateList.add(smsCustomerInfoGroupByCheckState);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ smsCustomerInfoGroupByCheckStateList.addAll(smsCustomerInfoGroupByCheckStates);
|
|
|
+ return smsCustomerInfoGroupByCheckStateList;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -285,11 +308,47 @@ public class SmsCheckCustomerInfoServiceImpl extends ServiceImpl<SmsCheckCustome
|
|
|
|
|
|
Map<String, Integer> map =new HashMap<>();
|
|
|
|
|
|
- List<Map<String, String>> maps = smsCheckCustomerInfoMapper.warningCountGroup(parameterMap);
|
|
|
|
|
|
- map.put("his",Integer.parseInt(String.valueOf(maps.get(1).get("count(*)"))));
|
|
|
- map.put("sum",Integer.parseInt(String.valueOf(maps.get(0).get("count(*)")))-Integer.parseInt(String.valueOf((maps.get(1).get("count(*)")))));
|
|
|
+ //1、稽核通过率:稽核通过客户数量(包括一次稽核通过、多次稽核通过)/客户总数*100% 前段计算
|
|
|
+ //2、一次稽核通过率:一次稽核通过客户数量/客户总数*100%
|
|
|
+ //3、整改完成率:整改通过的客户数量(多次稽核通过的)/全部需要整改的客户数量(一次稽核不通过的)*100%
|
|
|
+
|
|
|
+ //稽核客户通过总数 稽核通过客户数量
|
|
|
+ List<String> listSum = smsCheckCustomerInfoMapper.warningCountGroupSum(parameterMap);
|
|
|
+ //稽核整改历史 包含多次稽核的
|
|
|
+ List<String> list = smsCheckCustomerInfoMapper.warningCountGroup(parameterMap);
|
|
|
+
|
|
|
+ //全部需要整改的客户数量
|
|
|
+ Set zg =new HashSet<>();
|
|
|
+ for (String s : list) {
|
|
|
+ zg.add(s);
|
|
|
+ }
|
|
|
+ //未整改过数 一次稽核通过客户数量
|
|
|
+ List<String> difference = new ArrayList<>();
|
|
|
+
|
|
|
+ Map<String, String> listMap
|
|
|
+ = list.stream().collect(Collectors.toMap(v->v,Function.identity(), (o, n) -> o));
|
|
|
+ for (String s : listSum) {
|
|
|
+ if (listMap.get(s)==null){
|
|
|
+ difference.add(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ Set set = new HashSet();
|
|
|
+ for (String s : difference) {
|
|
|
+ set.add(s);
|
|
|
+ }
|
|
|
+ //整改完成数
|
|
|
+ Set<String> intersection = listSum.stream().filter(item -> list.contains(item)).collect(Collectors.toSet());
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //未整改过数 一次稽核通过客户数量
|
|
|
+ map.put("sum",set.size());
|
|
|
+ //整改过 整改通过的客户数量(多次稽核通过的)
|
|
|
+ map.put("his",intersection.size());
|
|
|
+ //全部需要整改的客户数量
|
|
|
+ map.put("zgSum",zg.size());
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
@@ -299,12 +358,43 @@ public class SmsCheckCustomerInfoServiceImpl extends ServiceImpl<SmsCheckCustome
|
|
|
|
|
|
Map<String, Integer> map =new HashMap<>();
|
|
|
|
|
|
- List<Map<String, String>> maps = smsCheckCustomerInfoMapper.countGroupCheck(parameterMap);
|
|
|
+ List<String> list = smsCheckCustomerInfoMapper.countGroupCheck(parameterMap);
|
|
|
+
|
|
|
+ List<String> listSum = smsCheckCustomerInfoMapper.countGroupCheckSum(parameterMap);
|
|
|
+ //1、稽核通过率:稽核通过客户数量(包括一次稽核通过、多次稽核通过)/客户总数*100% 前段计算
|
|
|
+ //2、一次稽核通过率:一次稽核通过客户数量/客户总数*100%
|
|
|
+ //3、整改完成率:整改通过的客户数量(多次稽核通过的)/全部需要整改的客户数量(一次稽核不通过的)*100%
|
|
|
+
|
|
|
+ //全部需要整改的客户数量
|
|
|
+ Set zg =new HashSet<>();
|
|
|
+ for (String s : list) {
|
|
|
+ zg.add(s);
|
|
|
+ }
|
|
|
+ //未整改过数 一次稽核通过客户数量
|
|
|
+ List<String> difference = new ArrayList<>();
|
|
|
+
|
|
|
+ Map<String, String> listMap
|
|
|
+ = list.stream().collect(Collectors.toMap(v->v,Function.identity(), (o, n) -> o));
|
|
|
+ for (String s : listSum) {
|
|
|
+ if (listMap.get(s)==null){
|
|
|
+ difference.add(s);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ Set set = new HashSet();
|
|
|
+ for (String s : difference) {
|
|
|
+ set.add(s);
|
|
|
+ }
|
|
|
+ //整改完成数
|
|
|
+ Set<String> intersection = listSum.stream().filter(item -> list.contains(item)).collect(Collectors.toSet());
|
|
|
|
|
|
- map.put("his",Integer.parseInt(String.valueOf(maps.get(1).get("count(*)"))));
|
|
|
- // 完成数 - 整改数
|
|
|
- map.put("sum",Integer.parseInt(String.valueOf(maps.get(0).get("count(*)")))-Integer.parseInt(String.valueOf((maps.get(1).get("count(*)")))));
|
|
|
|
|
|
+ //未整改过数 一次稽核通过客户数量
|
|
|
+ map.put("sum",set.size());
|
|
|
+ //整改过 整改通过的客户数量(多次稽核通过的)
|
|
|
+ map.put("his",intersection.size());
|
|
|
+ //全部需要整改的客户数量
|
|
|
+ map.put("zgSum",zg.size());
|
|
|
return map;
|
|
|
}
|
|
|
|