|
|
|
@ -40,6 +40,7 @@ import org.springblade.modules.system.service.IDictBizService; |
|
|
|
import org.springblade.modules.system.service.IUserService; |
|
|
|
import org.springblade.modules.system.service.IUserService; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import software.amazon.ion.Decimal; |
|
|
|
import software.amazon.ion.Decimal; |
|
|
|
|
|
|
|
import sun.security.pkcs11.wrapper.Functions; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.text.html.parser.Entity; |
|
|
|
import javax.swing.text.html.parser.Entity; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.math.BigDecimal; |
|
|
|
@ -164,10 +165,36 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
DateTimeFormatter fmt = DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME); |
|
|
|
DateTimeFormatter fmt = DateTimeFormatter.ofPattern(DateUtil.PATTERN_DATETIME); |
|
|
|
List<Map<String, Object>> result = appealService.getAppealByMon(start.format(fmt), end.format(fmt)); |
|
|
|
List<Map<String, Object>> result = appealService.getAppealByMon(start.format(fmt), end.format(fmt)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> monList = LocalDateTimeUtils.getMonList(start, end); |
|
|
|
|
|
|
|
List<Object> dateList = new ArrayList<>(); |
|
|
|
|
|
|
|
List<Object> handlerCountList = new ArrayList<>(); |
|
|
|
|
|
|
|
List<Object> finishContList = new ArrayList<>(); |
|
|
|
|
|
|
|
monList.forEach(mon -> { |
|
|
|
|
|
|
|
dateList.add(mon); |
|
|
|
|
|
|
|
boolean has = false; |
|
|
|
|
|
|
|
for (Map<String, Object> entry : result) { |
|
|
|
|
|
|
|
String em = (String) entry.get("mon"); |
|
|
|
|
|
|
|
Object submit = entry.get("submit"); |
|
|
|
|
|
|
|
Object mediation = entry.get("mediation"); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mon.equalsIgnoreCase(em)) { |
|
|
|
|
|
|
|
handlerCountList.add(submit); |
|
|
|
|
|
|
|
finishContList.add(mediation); |
|
|
|
|
|
|
|
has = true; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!has) { |
|
|
|
|
|
|
|
handlerCountList.add("0"); |
|
|
|
|
|
|
|
finishContList.add("0"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
Map<String, List<Object>> map = new HashMap<>(); |
|
|
|
Map<String, List<Object>> map = new HashMap<>(); |
|
|
|
map.put("dateList", result.stream().map(e -> e.get("mon")).collect(Collectors.toList())); |
|
|
|
map.put("dateList", dateList); |
|
|
|
map.put("handlerCountList", result.stream().map(e -> e.get("submit")).collect(Collectors.toList())); |
|
|
|
map.put("handlerCountList", handlerCountList); |
|
|
|
map.put("finishContList", result.stream().map(e -> e.get("mediation")).collect(Collectors.toList())); |
|
|
|
map.put("finishContList", finishContList); |
|
|
|
return map; |
|
|
|
return map; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -393,20 +420,20 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
wrapper.between(Appeal::getFirstRegTime, start, end); |
|
|
|
wrapper.between(Appeal::getFirstRegTime, start, end); |
|
|
|
List<Appeal> appealList = appealService.list(wrapper); |
|
|
|
List<Appeal> appealList = appealService.list(wrapper); |
|
|
|
|
|
|
|
|
|
|
|
// 过滤掉无街道和处理部门的, 防止异常
|
|
|
|
// 过滤掉无街道的, 防止异常
|
|
|
|
appealList = appealList.stream().filter( |
|
|
|
List<Appeal> streetDataList = appealList.stream().filter( |
|
|
|
appeal -> Func.isNotEmpty(appeal.getStreetId()) && Func.isNotEmpty(appeal.getHandleDept()) |
|
|
|
appeal -> Func.isNotEmpty(appeal.getStreetId()) |
|
|
|
).collect(Collectors.toList()); |
|
|
|
).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
// 获取所有化解成功的诉求记录
|
|
|
|
// 获取所有化解成功的诉求记录
|
|
|
|
List<Appeal> appealFinishList = appealList.stream().filter( |
|
|
|
List<Appeal> appealFinishList = streetDataList.stream().filter( |
|
|
|
appeal -> state.contains(appeal.getStatus()) |
|
|
|
appeal -> state.contains(appeal.getStatus()) |
|
|
|
).collect(Collectors.toList()); |
|
|
|
).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
// 获取所有街道
|
|
|
|
// 获取所有街道
|
|
|
|
List<DictBiz> dataList = dictService.getList(BusinessConstant.DICT_KEY_STREET); |
|
|
|
List<DictBiz> dataList = dictService.getList(BusinessConstant.DICT_KEY_STREET); |
|
|
|
// 根据街道分组
|
|
|
|
// 根据街道分组
|
|
|
|
Map<Long, List<Appeal>> reportStreetList = appealList.stream().collect(Collectors.groupingBy(Appeal::getStreetId)); |
|
|
|
Map<Long, List<Appeal>> reportStreetList = streetDataList.stream().collect(Collectors.groupingBy(Appeal::getStreetId)); |
|
|
|
Map<Long, List<Appeal>> street = appealFinishList.stream().collect(Collectors.groupingBy(Appeal::getStreetId)); |
|
|
|
Map<Long, List<Appeal>> street = appealFinishList.stream().collect(Collectors.groupingBy(Appeal::getStreetId)); |
|
|
|
|
|
|
|
|
|
|
|
// 封装到数据对象
|
|
|
|
// 封装到数据对象
|
|
|
|
@ -428,13 +455,23 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
// 倒序
|
|
|
|
// 倒序
|
|
|
|
List<DataEntity> streeList = strees.stream().sorted(Comparator.comparing(DataEntity::getValue).reversed()).collect(Collectors.toList()); |
|
|
|
List<DataEntity> streetList = strees.stream().sorted(Comparator.comparing(DataEntity::getValue).reversed()).collect(Collectors.toList()); |
|
|
|
map.put("street", streeList); |
|
|
|
map.put("street", streetList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 过滤掉处理部门的, 防止异常
|
|
|
|
|
|
|
|
List<Appeal> deptDataList = appealList.stream().filter( |
|
|
|
|
|
|
|
appeal -> Func.isNotEmpty(appeal.getHandleDept()) |
|
|
|
|
|
|
|
).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取所有化解成功的诉求记录
|
|
|
|
|
|
|
|
appealFinishList = deptDataList.stream().filter( |
|
|
|
|
|
|
|
appeal -> state.contains(appeal.getStatus()) |
|
|
|
|
|
|
|
).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
// 获取所有部门
|
|
|
|
// 获取所有部门
|
|
|
|
List<User> userList = UserCache.getServerWindowList(); |
|
|
|
List<User> userList = UserCache.getServerWindowList(); |
|
|
|
// 根据部门分组
|
|
|
|
// 根据部门分组
|
|
|
|
Map<Long, List<Appeal>> reportTownList = appealList.stream().collect(Collectors.groupingBy(Appeal::getHandleDept)); |
|
|
|
Map<Long, List<Appeal>> reportTownList = deptDataList.stream().collect(Collectors.groupingBy(Appeal::getHandleDept)); |
|
|
|
Map<Long, List<Appeal>> town = appealFinishList.stream().collect(Collectors.groupingBy(Appeal::getHandleDept)); |
|
|
|
Map<Long, List<Appeal>> town = appealFinishList.stream().collect(Collectors.groupingBy(Appeal::getHandleDept)); |
|
|
|
|
|
|
|
|
|
|
|
// 封装到数据对象
|
|
|
|
// 封装到数据对象
|
|
|
|
@ -473,17 +510,17 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
// 获取所有上报的诉求记录
|
|
|
|
// 获取所有上报的诉求记录
|
|
|
|
LambdaQueryWrapper<Appeal> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<Appeal> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.between(Appeal::getFirstRegTime, start, end); |
|
|
|
wrapper.between(Appeal::getFirstRegTime, start, end); |
|
|
|
List<Appeal> appeals = appealService.list(wrapper); |
|
|
|
List<Appeal> appealList = appealService.list(wrapper); |
|
|
|
|
|
|
|
|
|
|
|
// 过滤掉无街道的, 防止异常
|
|
|
|
// 过滤掉无街道的, 防止异常
|
|
|
|
appeals = appeals.stream().filter( |
|
|
|
List<Appeal> streetDataList = appealList.stream().filter( |
|
|
|
appeal -> Func.isNotEmpty(appeal.getStreetId()) |
|
|
|
appeal -> Func.isNotEmpty(appeal.getStreetId()) |
|
|
|
).collect(Collectors.toList()); |
|
|
|
).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
// 获取所有街道
|
|
|
|
// 获取所有街道
|
|
|
|
List<DictBiz> dataList = dictService.getList(BusinessConstant.DICT_KEY_STREET); |
|
|
|
List<DictBiz> dataList = dictService.getList(BusinessConstant.DICT_KEY_STREET); |
|
|
|
// 根据街道分组
|
|
|
|
// 根据街道分组
|
|
|
|
Map<Long, List<Appeal>> street = appeals.stream().collect(Collectors.groupingBy(Appeal::getStreetId)); |
|
|
|
Map<Long, List<Appeal>> street = streetDataList.stream().collect(Collectors.groupingBy(Appeal::getStreetId)); |
|
|
|
|
|
|
|
|
|
|
|
// 封装到数据对象
|
|
|
|
// 封装到数据对象
|
|
|
|
List<DataEntity> strees = new ArrayList<>(); |
|
|
|
List<DataEntity> strees = new ArrayList<>(); |
|
|
|
@ -499,6 +536,30 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
List<DataEntity> streeList = strees.stream().sorted(Comparator.comparing(DataEntity::getValue).reversed()).collect(Collectors.toList()); |
|
|
|
List<DataEntity> streeList = strees.stream().sorted(Comparator.comparing(DataEntity::getValue).reversed()).collect(Collectors.toList()); |
|
|
|
map.put("street", streeList); |
|
|
|
map.put("street", streeList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 过滤掉处理部门的, 防止异常
|
|
|
|
|
|
|
|
List<Appeal> deptDataList = appealList.stream().filter( |
|
|
|
|
|
|
|
appeal -> Func.isNotEmpty(appeal.getHandleDept()) |
|
|
|
|
|
|
|
).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取所有部门
|
|
|
|
|
|
|
|
List<User> userList = UserCache.getServerWindowList(); |
|
|
|
|
|
|
|
// 根据部门分组
|
|
|
|
|
|
|
|
Map<Long, List<Appeal>> town = deptDataList.stream().collect(Collectors.groupingBy(Appeal::getHandleDept)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 封装到数据对象
|
|
|
|
|
|
|
|
List<DataEntity> towns = new ArrayList<>(); |
|
|
|
|
|
|
|
userList.forEach(user -> { |
|
|
|
|
|
|
|
Long id = user.getId(); |
|
|
|
|
|
|
|
DataEntity entity = new DataEntity(); |
|
|
|
|
|
|
|
entity.setName(user.getName()); |
|
|
|
|
|
|
|
entity.setValue(town.containsKey(id) ? town.get(id).size() : 0); |
|
|
|
|
|
|
|
towns.add(entity); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 倒序
|
|
|
|
|
|
|
|
List<DataEntity> townList = towns.stream().sorted(Comparator.comparing(DataEntity::getValue).reversed()).collect(Collectors.toList()); |
|
|
|
|
|
|
|
map.put("town", townList); |
|
|
|
return map; |
|
|
|
return map; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|