|
@@ -1,7 +1,6 @@
|
|
|
package com.qunzhixinxi.hnqz.admin.manager;
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
-import cn.hutool.core.collection.ListUtil;
|
|
|
import cn.hutool.core.lang.tree.Tree;
|
|
|
import cn.hutool.core.lang.tree.TreeNode;
|
|
|
import cn.hutool.core.lang.tree.TreeUtil;
|
|
@@ -13,12 +12,15 @@ import com.qunzhixinxi.hnqz.admin.api.constant.UpmsType;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.dto.SysStatisticDto;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysDept;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.SysImplementPlan;
|
|
|
+import com.qunzhixinxi.hnqz.admin.api.entity.WmQccInfo;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.WmScorePackage;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.WmTask;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskSupervision;
|
|
|
import com.qunzhixinxi.hnqz.admin.api.entity.WmTaskType;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.SysDeptService;
|
|
|
+import com.qunzhixinxi.hnqz.admin.service.SysEnterpriseAreaService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.SysImplementPlanService;
|
|
|
+import com.qunzhixinxi.hnqz.admin.service.WmQccInfoService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmScorePackageService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmTaskService;
|
|
|
import com.qunzhixinxi.hnqz.admin.service.WmTaskSupervisionService;
|
|
@@ -57,7 +59,9 @@ public class SysStatisticManager {
|
|
|
private final WmTaskService taskService;
|
|
|
private final WmTaskTypeService taskTypeService;
|
|
|
private final WmTaskSupervisionService taskSupervisionService;
|
|
|
+ private final SysEnterpriseAreaService enterpriseAreaService;
|
|
|
private final SysImplementPlanService implementPlanService;
|
|
|
+ private final WmQccInfoService qccInfoService;
|
|
|
|
|
|
/**
|
|
|
* 获取积分包统计
|
|
@@ -428,24 +432,64 @@ public class SysStatisticManager {
|
|
|
* @param user 操作人
|
|
|
* @return 统计信息
|
|
|
*/
|
|
|
- public Page<Map<String, Object>> statProviderData(SysStatisticDto.OnProviderQccData query, HnqzUser user) {
|
|
|
- Map<String, Object> records = new HashMap<>();
|
|
|
- records.put("id", 123);
|
|
|
- records.put("providerName", "测试服务提供方1");
|
|
|
- records.put("areaCodes", ListUtil.of(0));
|
|
|
- records.put("products", "123456");
|
|
|
- records.put("qccScore", "90");
|
|
|
- records.put("serviceMark", "120");
|
|
|
- records.put("average", 123);
|
|
|
+ public Page<?> statProviderData(SysStatisticDto.OnProviderQccData query, HnqzUser user) {
|
|
|
|
|
|
+ // 获取服务商分页
|
|
|
+ Page<SysDept> page = new Page<>(query.getCurrent(), query.getSize());
|
|
|
+ deptService.page(page, Wrappers.<SysDept>lambdaQuery().eq(SysDept::getLevel, 4).eq(SysDept::getDelFlag, CommonConstants.STATUS_NORMAL));
|
|
|
|
|
|
- Page<Map<String, Object>> page = new Page<>();
|
|
|
- page.setRecords(Collections.singletonList(records));
|
|
|
- page.setCurrent(1);
|
|
|
- page.setSize(20);
|
|
|
- page.setTotal(1);
|
|
|
+ List<SysDept> depts = page.getRecords();
|
|
|
|
|
|
- return page;
|
|
|
+ if (CollUtil.isEmpty(depts)) {
|
|
|
+ return page;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取企业的服务区域
|
|
|
+ List<Long> deptIds = depts.stream().mapToLong(SysDept::getDeptId).boxed().distinct().sorted().collect(Collectors.toList());
|
|
|
+ Map<Long, List<Long>> detpId2AreaCodesMap = enterpriseAreaService.listEntAreas1(deptIds);
|
|
|
+
|
|
|
+ // 获取企查查信息
|
|
|
+ List<String> regCodes = depts.stream().map(SysDept::getTaxCode).distinct().sorted().collect(Collectors.toList());
|
|
|
+ Map<String, List<WmQccInfo>> qccInfo = qccInfoService.getQccInfo1(regCodes);
|
|
|
+
|
|
|
+
|
|
|
+ // 封装参数
|
|
|
+ List<Map<String, Object>> collect = depts.stream().map(d -> {
|
|
|
+ Map<String, Object> map = new HashMap<>(7);
|
|
|
+
|
|
|
+ map.put("id", d.getDeptId());
|
|
|
+ map.put("providerName", d.getName());
|
|
|
+ map.put("areaCodes", detpId2AreaCodesMap.get((long) d.getDeptId()));
|
|
|
+ map.put("products", "123456");
|
|
|
+
|
|
|
+ Map<String, Object> creditRatingReportGrade;
|
|
|
+ if (StrUtil.isNotBlank(d.getTaxCode())) {
|
|
|
+ List<WmQccInfo> wmQccInfos = qccInfo.get(d.getTaxCode());
|
|
|
+ if (CollUtil.isNotEmpty(wmQccInfos)) {
|
|
|
+ creditRatingReportGrade = wmQccInfos.get(0).getCreditRatingReportGrade();
|
|
|
+ } else {
|
|
|
+ creditRatingReportGrade = Collections.emptyMap();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ creditRatingReportGrade = Collections.emptyMap();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ map.put("qccScore", creditRatingReportGrade);
|
|
|
+
|
|
|
+
|
|
|
+ map.put("serviceMark", "120");
|
|
|
+ map.put("average", 123);
|
|
|
+
|
|
|
+ return map;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+
|
|
|
+
|
|
|
+ Page<Map<String, Object>> builds = new Page<>(query.getCurrent(), query.getSize());
|
|
|
+ builds.setRecords(collect);
|
|
|
+ builds.setTotal(page.getTotal());
|
|
|
+
|
|
|
+ return builds;
|
|
|
|
|
|
}
|
|
|
|