|
|
|
|
@ -1,10 +1,14 @@
|
|
|
|
|
package com.biutag.lan.service; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DatePattern; |
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
|
import cn.hutool.core.util.NumberUtil; |
|
|
|
|
import com.alibaba.fastjson2.JSON; |
|
|
|
|
import com.alibaba.fastjson2.JSONArray; |
|
|
|
|
import com.alibaba.fastjson2.JSONObject; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
|
import com.biutag.constants.AppConstants; |
|
|
|
|
import com.biutag.entity.system.Duty; |
|
|
|
|
import com.biutag.enums.DeptTypeEnum; |
|
|
|
|
import com.biutag.lan.domain.Mail; |
|
|
|
|
@ -29,6 +33,8 @@ public class DataScreenService extends ServiceImpl<DataScreenMapper, Mail> {
|
|
|
|
|
|
|
|
|
|
private final MailMarkService mailMarkService; |
|
|
|
|
|
|
|
|
|
private final MailSourceService mailSourceService; |
|
|
|
|
|
|
|
|
|
public List<Map<String, Object>> mapData(String deptId) { |
|
|
|
|
return baseMapper.mapData(deptId); |
|
|
|
|
} |
|
|
|
|
@ -117,25 +123,40 @@ public class DataScreenService extends ServiceImpl<DataScreenMapper, Mail> {
|
|
|
|
|
Map<String, Object> mapSatisfied = baseMapper.getAllSatisfiedRate(null);//获取长沙市局 满意率
|
|
|
|
|
Long allSum = mailMarkService.count(); |
|
|
|
|
|
|
|
|
|
Integer toDayCount = baseMapper.getTodayMailCount(null); |
|
|
|
|
mapCompleted.putAll(mapResolved); |
|
|
|
|
mapCompleted.putAll(mapSatisfied); |
|
|
|
|
mapCompleted.put("todaySum", toDayCount); |
|
|
|
|
String today = DateUtil.format(new Date(), DatePattern.NORM_DATE_FORMAT); |
|
|
|
|
mapCompleted.put("todaySum", mailSourceService.count(today)); |
|
|
|
|
mapCompleted.put("allSum", allSum); |
|
|
|
|
return mapCompleted; |
|
|
|
|
} else { |
|
|
|
|
String deptId = params.get("id").toString(); |
|
|
|
|
Map<String, Object> mapCompleted = baseMapper.getAllCompletedRate(deptId);//获取长沙市局 办结率
|
|
|
|
|
Map<String, Object> mapResolved = baseMapper.getAllResolvedRate(deptId);//获取长沙市局 解决率
|
|
|
|
|
Map<String, Object> mapSatisfied = baseMapper.getAllSatisfiedRate(deptId);//获取长沙市局 满意率
|
|
|
|
|
Long allSum = mailMarkService.count(new LambdaQueryWrapper<MailMark>().eq(MailMark::getSecondDeptId, deptId)); |
|
|
|
|
HashMap<String, Object> map = new HashMap<>(); |
|
|
|
|
long completedsum = mailMarkService.count(new LambdaQueryWrapper<MailMark>().eq(MailMark::getSecondDeptId, deptId)); |
|
|
|
|
long completed = mailMarkService.count(new LambdaQueryWrapper<MailMark>().eq(MailMark::getCompleted, AppConstants.TRUE).eq(MailMark::getSecondDeptId, deptId)); |
|
|
|
|
long resolved = mailMarkService.count(new LambdaQueryWrapper<MailMark>().eq(MailMark::getResolved, AppConstants.TRUE).eq(MailMark::getSecondDeptId, deptId)); |
|
|
|
|
long satisfied = mailMarkService.count(new LambdaQueryWrapper<MailMark>().eq(MailMark::getSatisfied, AppConstants.TRUE).eq(MailMark::getSecondDeptId, deptId)); |
|
|
|
|
|
|
|
|
|
map.put("completedsum", completedsum); |
|
|
|
|
map.put("completed", completed); |
|
|
|
|
// 办结率=已办结数/信件总数
|
|
|
|
|
map.put("completedrate", completedsum == 0 ? "0%" : Double.valueOf(NumberUtil.div(completed, completedsum, 2) * 100).intValue() + "%"); |
|
|
|
|
|
|
|
|
|
map.put("resolvedsum", completed); |
|
|
|
|
map.put("resolved", resolved); |
|
|
|
|
// 解决率=解决数/已办结数
|
|
|
|
|
map.put("resolvedrate", completed == 0 ? "0%" : Double.valueOf(NumberUtil.div(resolved, completed, 2) * 100).intValue() + "%"); |
|
|
|
|
|
|
|
|
|
map.put("satisfiedSum", completed); |
|
|
|
|
map.put("satisfied", satisfied); |
|
|
|
|
// 满意率=满意数/已办结数
|
|
|
|
|
map.put("satisfiedrate", completed == 0 ? "0%" : Double.valueOf(NumberUtil.div(satisfied, completed, 2) * 100).intValue() + "%"); |
|
|
|
|
|
|
|
|
|
Long allSum = mailMarkService.count(new LambdaQueryWrapper<MailMark>().eq(MailMark::getSecondDeptId, deptId)); |
|
|
|
|
Integer toDayCount = baseMapper.getTodayMailCount(deptId); |
|
|
|
|
mapCompleted.putAll(mapResolved); |
|
|
|
|
mapCompleted.putAll(mapSatisfied); |
|
|
|
|
mapCompleted.put("todaySum", toDayCount); |
|
|
|
|
mapCompleted.put("allSum", allSum); |
|
|
|
|
return mapCompleted; |
|
|
|
|
map.put("todaySum", toDayCount); |
|
|
|
|
map.put("allSum", allSum); |
|
|
|
|
return map; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|