|
|
|
|
@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
import org.springblade.common.cache.DictBizCache; |
|
|
|
|
import org.springblade.common.cache.UserCache; |
|
|
|
|
import org.springblade.common.constant.BusinessConstant; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.modules.business.entity.Appeal; |
|
|
|
|
@ -38,6 +39,7 @@ import org.springblade.modules.system.service.IDictBizService; |
|
|
|
|
import org.springblade.modules.system.service.IUserService; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import javax.swing.text.html.parser.Entity; |
|
|
|
|
import java.text.DecimalFormat; |
|
|
|
|
import java.text.ParseException; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
@ -61,8 +63,6 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
|
|
|
|
|
|
private final IAppealVisitorService appealVisitorService; |
|
|
|
|
|
|
|
|
|
private final IUserService userService; |
|
|
|
|
|
|
|
|
|
private final IDictBizService dictService; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
@ -82,19 +82,19 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
|
|
|
|
|
|
// 本年度化解数
|
|
|
|
|
wrapper.in(Appeal::getStatus, state); |
|
|
|
|
wrapper.between(Appeal::getFinishTime, LocalDateTimeUtils.yearStartTime(), LocalDateTimeUtils.yearEndTime()); |
|
|
|
|
wrapper.between(Appeal::getFirstRegTime, LocalDateTimeUtils.yearStartTime(), LocalDateTimeUtils.yearEndTime()); |
|
|
|
|
map.put("year", appealService.count(wrapper)); |
|
|
|
|
wrapper.clear(); |
|
|
|
|
|
|
|
|
|
// 本季度化解数
|
|
|
|
|
wrapper.in(Appeal::getStatus, state); |
|
|
|
|
wrapper.between(Appeal::getFinishTime, LocalDateTimeUtils.quarterStartTime(), LocalDateTimeUtils.quarterEndTime()); |
|
|
|
|
wrapper.between(Appeal::getFirstRegTime, LocalDateTimeUtils.quarterStartTime(), LocalDateTimeUtils.quarterEndTime()); |
|
|
|
|
map.put("quarterly", appealService.count(wrapper)); |
|
|
|
|
wrapper.clear(); |
|
|
|
|
|
|
|
|
|
// 本月化解数
|
|
|
|
|
wrapper.in(Appeal::getStatus, state); |
|
|
|
|
wrapper.between(Appeal::getFinishTime, LocalDateTimeUtils.monthStartTime(), LocalDateTimeUtils.monthEndTime()); |
|
|
|
|
wrapper.between(Appeal::getFirstRegTime, LocalDateTimeUtils.monthStartTime(), LocalDateTimeUtils.monthEndTime()); |
|
|
|
|
map.put("mon", appealService.count(wrapper)); |
|
|
|
|
|
|
|
|
|
return map; |
|
|
|
|
@ -142,6 +142,11 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
|
wrapper.orderByDesc(Appeal::getFirstRegTime); |
|
|
|
|
List<Appeal> appeals = appealService.list(wrapper); |
|
|
|
|
|
|
|
|
|
// 过滤掉无街道和处理部门的, 防止异常
|
|
|
|
|
appeals = appeals.stream().filter( |
|
|
|
|
appeal -> Func.isNotEmpty(appeal.getStreetId()) && Func.isNotEmpty(appeal.getHandleDept()) |
|
|
|
|
).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
// 获取前50条
|
|
|
|
|
List<Appeal> appealList = appeals.stream().limit(50).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
@ -206,13 +211,19 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
|
map.put(name, collect.get(name).size()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int otherDisputeNum = 0; |
|
|
|
|
// 先将map中纠纷类型包含其他的统计出数量
|
|
|
|
|
for (Map.Entry<String, Integer> e : map.entrySet()) { |
|
|
|
|
if (e.getKey().contains("其他")) |
|
|
|
|
otherDisputeNum += e.getValue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 根据数量排序
|
|
|
|
|
List<Map.Entry<String, Integer>> list = new ArrayList<>(map.entrySet()); |
|
|
|
|
list.sort((o1, o2) -> o2.getValue() - o1.getValue()); |
|
|
|
|
|
|
|
|
|
List result = new ArrayList(); |
|
|
|
|
Map<String, Object> hashMap = new HashMap<>(); |
|
|
|
|
DecimalFormat df = new DecimalFormat("#0.0"); |
|
|
|
|
Map<String, Object> hashMap; |
|
|
|
|
|
|
|
|
|
if (list.size() <= 5) { |
|
|
|
|
// 如果类型小于5,正常计算
|
|
|
|
|
@ -224,23 +235,34 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
// 如果类型大于5,前五正常计算,其余全部按照其他纠纷计算
|
|
|
|
|
for (int i = 0; i < 5; i++) { |
|
|
|
|
Map.Entry<String, Integer> entry = list.get(i); |
|
|
|
|
int idx = 0; |
|
|
|
|
|
|
|
|
|
int subNum = 0; |
|
|
|
|
while (subNum < 4) { |
|
|
|
|
Map.Entry<String, Integer> entry = list.get(idx); |
|
|
|
|
if (entry.getKey().contains("其他")) { |
|
|
|
|
idx++; |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
hashMap = new HashMap<>(); |
|
|
|
|
hashMap.put("name", entry.getKey()); |
|
|
|
|
hashMap.put("value", entry.getValue()); |
|
|
|
|
result.add(hashMap); |
|
|
|
|
|
|
|
|
|
idx++; |
|
|
|
|
subNum++; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int size = 0; |
|
|
|
|
for (int i = 5; i < list.size(); i++) { |
|
|
|
|
Map.Entry<String, Integer> entry = list.get(i); |
|
|
|
|
for (; idx < list.size(); idx++) { |
|
|
|
|
Map.Entry<String, Integer> entry = list.get(idx); |
|
|
|
|
size += entry.getValue(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
hashMap = new HashMap<>(); |
|
|
|
|
hashMap.put("name", "其他纠纷"); |
|
|
|
|
hashMap.put("value", size); |
|
|
|
|
hashMap.put("value", size + otherDisputeNum); |
|
|
|
|
result.add(hashMap); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -261,6 +283,8 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
|
wrapper.between(Appeal::getFirstRegTime, LocalDateTimeUtils.yearStartTime(), LocalDateTimeUtils.yearEndTime()); |
|
|
|
|
} |
|
|
|
|
List<Appeal> appeals = appealService.list(wrapper); |
|
|
|
|
// 过滤掉无街道的, 防止异常
|
|
|
|
|
appeals = appeals.stream().filter(appeal -> Func.isNotEmpty(appeal.getStreetId())).collect(Collectors.toList()); |
|
|
|
|
appeals.forEach(appeal -> appeal.setStreet(DictBizCache.getById(appeal.getStreetId()).getDictValue())); |
|
|
|
|
|
|
|
|
|
// 根据街道分组
|
|
|
|
|
@ -296,6 +320,8 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
|
wrapper.between(Appeal::getFirstRegTime, LocalDateTimeUtils.yearStartTime(), LocalDateTimeUtils.yearEndTime()); |
|
|
|
|
} |
|
|
|
|
List<Appeal> appeals = appealService.list(wrapper); |
|
|
|
|
// 过滤掉无街道的, 防止异常
|
|
|
|
|
appeals = appeals.stream().filter(appeal -> Func.isNotEmpty(appeal.getStreetId())).collect(Collectors.toList()); |
|
|
|
|
appeals.forEach(appeal -> appeal.setStreet(DictBizCache.getById(appeal.getStreetId()).getDictValue())); |
|
|
|
|
|
|
|
|
|
// 根据街道分组
|
|
|
|
|
@ -325,6 +351,8 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
|
wrapper.between(Appeal::getFirstRegTime, LocalDateTimeUtils.yearStartTime(), LocalDateTimeUtils.yearEndTime()); |
|
|
|
|
} |
|
|
|
|
List<Appeal> appeals = appealService.list(wrapper); |
|
|
|
|
// 过滤掉无街道的, 防止异常
|
|
|
|
|
appeals = appeals.stream().filter(appeal -> Func.isNotEmpty(appeal.getStreetId())).collect(Collectors.toList()); |
|
|
|
|
appeals.forEach(appeal -> appeal.setStreet(DictBizCache.getById(appeal.getStreetId()).getDictValue())); |
|
|
|
|
|
|
|
|
|
// 根据街道分组
|
|
|
|
|
@ -380,15 +408,8 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
|
appeal -> Func.isNotEmpty(appeal.getStreetId()) && Func.isNotEmpty(appeal.getHandleDept()) |
|
|
|
|
).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
// 给街道和用户赋值
|
|
|
|
|
// appeals.forEach(appeal -> {
|
|
|
|
|
// appeal.setStreet(DictBizCache.getById(appeal.getStreetId()).getDictValue());
|
|
|
|
|
// appeal.setName(userService.getById(appeal.getHandleDept()).getName());
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
// 获取所有街道
|
|
|
|
|
String code = "street"; |
|
|
|
|
List<DictBiz> dataList = dictService.getList(code); |
|
|
|
|
List<DictBiz> dataList = dictService.getList(BusinessConstant.DICT_KEY_STREET); |
|
|
|
|
// 根据街道分组
|
|
|
|
|
Map<Long, List<Appeal>> street = appeals.stream().collect(Collectors.groupingBy(Appeal::getStreetId)); |
|
|
|
|
|
|
|
|
|
@ -407,8 +428,7 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
|
map.put("street", streeList); |
|
|
|
|
|
|
|
|
|
// 获取所有部门
|
|
|
|
|
String deptId = "1666621912872280065"; |
|
|
|
|
List<User> userList = userService.list(Wrappers.<User>lambdaQuery().eq(User::getDeptId, deptId)); |
|
|
|
|
List<User> userList = UserCache.getServerWindowList(); |
|
|
|
|
// 根据部门分组
|
|
|
|
|
Map<Long, List<Appeal>> town = appeals.stream().collect(Collectors.groupingBy(Appeal::getHandleDept)); |
|
|
|
|
|
|
|
|
|
|