|
@@ -67,18 +67,51 @@ public class QualityAnalyseServiceImpl extends ServiceImpl<QualityAnalyseMapper,
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> pie(Long serviceUnitId, Long supplierId) {
|
|
|
- return this.baseMapper.pie(serviceUnitId, supplierId);
|
|
|
+ public Map<String, Object> pie(Long serviceUnitId) {
|
|
|
+ return this.baseMapper.pie(serviceUnitId,null);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public Map<String, Object> radar(Long serviceUnitId, Long supplierId) {
|
|
|
- return this.baseMapper.radar(serviceUnitId, supplierId);
|
|
|
+ public Map<String, Map<String, Object>> radar(Long serviceUnitId, QualityAnalyseGroupEnum group) {
|
|
|
+
|
|
|
+
|
|
|
+ List<Map<String, Object>> radar = this.baseMapper.radar(serviceUnitId, null);;
|
|
|
+ Map<String, Map<String, Object>> result = new HashMap<>();
|
|
|
+ radar.stream().collect(Collectors.groupingBy(map -> map.get("reason"))).forEach((k, v) -> {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ map.put("reason",k);
|
|
|
+ map.put("count",v.stream().mapToLong(map1-> (long) map1.get("count")).sum());
|
|
|
+ result.put("all", map);
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ if (group.equals(QualityAnalyseGroupEnum.REASON_REGION)) {
|
|
|
+
|
|
|
+ radar.stream().collect(Collectors.groupingBy(map -> map.get("region_name"))).forEach((k, v) -> {
|
|
|
+ Map<String, Object> z = new HashMap<>();
|
|
|
+ v.stream().collect(Collectors.groupingBy(map2 -> map2.get("reason"))).forEach((k1, v1) -> {
|
|
|
+ z.put("reason",k1);
|
|
|
+ z.put("count",v1.stream().mapToLong(map1-> (long) map1.get("count")).sum());
|
|
|
+ });
|
|
|
+ result.put(k.toString(), z);
|
|
|
+ });
|
|
|
+ } else if (group.equals(QualityAnalyseGroupEnum.REASON_SUPPLIER)) {
|
|
|
+ radar.stream().collect(Collectors.groupingBy(map -> map.get("supplier"))).forEach((k, v) -> {
|
|
|
+ Map<String, Object> z = new HashMap<>();
|
|
|
+ v.stream().collect(Collectors.groupingBy(map2 -> map2.get("reason"))).forEach((k1, v1) -> {
|
|
|
+ z.put("reason",k1);
|
|
|
+ z.put("count",v1.stream().mapToLong(map1-> (long) map1.get("count")).sum());
|
|
|
+ });
|
|
|
+ result.put(k.toString(), z);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IPage<TBQualityProblemApplyResult> detail(Page<Object> objectPage, Long serviceUnitId, Long supplierId) {
|
|
|
- return this.baseMapper.detail(objectPage, serviceUnitId, supplierId);
|
|
|
+ public IPage<TBQualityProblemApplyResult> detail(Page<Object> objectPage, Long serviceUnitId,InfluenceDegreeEnum degree) {
|
|
|
+ return this.baseMapper.detail(objectPage, serviceUnitId, degree);
|
|
|
}
|
|
|
|
|
|
@Override
|