|
|
|
@ -129,7 +129,7 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<Appeal> getAppealList() { |
|
|
|
public List<Appeal> getAppealList(LocalDateTime start, LocalDateTime end) { |
|
|
|
// 化解成功状态数组
|
|
|
|
// 化解成功状态数组
|
|
|
|
List<Integer> state = new ArrayList<>(); |
|
|
|
List<Integer> state = new ArrayList<>(); |
|
|
|
state.add(0); |
|
|
|
state.add(0); |
|
|
|
@ -138,6 +138,7 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
LambdaQueryWrapper<Appeal> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<Appeal> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
// 待处理、正在处理
|
|
|
|
// 待处理、正在处理
|
|
|
|
wrapper.in(Appeal::getStatus, state); |
|
|
|
wrapper.in(Appeal::getStatus, state); |
|
|
|
|
|
|
|
wrapper.between(Appeal::getFirstRegTime, start, end); |
|
|
|
// 根据登记时间倒序
|
|
|
|
// 根据登记时间倒序
|
|
|
|
wrapper.orderByDesc(Appeal::getFirstRegTime); |
|
|
|
wrapper.orderByDesc(Appeal::getFirstRegTime); |
|
|
|
List<Appeal> appeals = appealService.list(wrapper); |
|
|
|
List<Appeal> appeals = appealService.list(wrapper); |
|
|
|
@ -160,7 +161,7 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String, List<Object>> getAppealByMon() { |
|
|
|
public Map<String, List<Object>> getAppealByMon(LocalDateTime start, LocalDateTime end) { |
|
|
|
Map<String, List<Object>> map = new HashMap<>(); |
|
|
|
Map<String, List<Object>> map = new HashMap<>(); |
|
|
|
List<Object> dateList = new ArrayList<>(); |
|
|
|
List<Object> dateList = new ArrayList<>(); |
|
|
|
List<Object> handlerCountList = new ArrayList<>(); |
|
|
|
List<Object> handlerCountList = new ArrayList<>(); |
|
|
|
@ -193,9 +194,11 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public List<Map<String, Object>> getAppealTypePercent() { |
|
|
|
public List<Map<String, Object>> getAppealTypePercent(LocalDateTime start, LocalDateTime end) { |
|
|
|
// 先查所有
|
|
|
|
// 先查所有
|
|
|
|
List<Appeal> appeals = appealService.list(); |
|
|
|
LambdaQueryWrapper<Appeal> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
wrapper.between(Appeal::getFirstRegTime, start, end); |
|
|
|
|
|
|
|
List<Appeal> appeals = appealService.list(wrapper); |
|
|
|
appeals.forEach(appeal -> { |
|
|
|
appeals.forEach(appeal -> { |
|
|
|
String disputeName = Func.isEmpty(appeal.getDisputeName()) ? DictBizCache.getById(appeal.getDisputeId()).getDictValue() : appeal.getDisputeName(); |
|
|
|
String disputeName = Func.isEmpty(appeal.getDisputeName()) ? DictBizCache.getById(appeal.getDisputeId()).getDictValue() : appeal.getDisputeName(); |
|
|
|
appeal.setDisputeName(disputeName); |
|
|
|
appeal.setDisputeName(disputeName); |
|
|
|
@ -294,7 +297,7 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String, Object> getAppealFinishCountByLoc(Integer timeFrame, String startTime, String endTime) throws ParseException { |
|
|
|
public List<DataEntity> getAppealFinishCountByLoc(Integer timeFrame, String startTime, String endTime) throws ParseException { |
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
|
|
|
|
|
|
|
|
|
|
|
// 化解成功状态数组
|
|
|
|
// 化解成功状态数组
|
|
|
|
@ -303,7 +306,6 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
state.add(3); |
|
|
|
state.add(3); |
|
|
|
|
|
|
|
|
|
|
|
LambdaQueryWrapper<Appeal> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<Appeal> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.in(Appeal::getStatus, state); |
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) { |
|
|
|
if (StringUtils.isNotBlank(startTime) && StringUtils.isNotBlank(endTime)) { |
|
|
|
wrapper.between(Appeal::getFirstRegTime, dateFormat.parse(startTime), dateFormat.parse(endTime)); |
|
|
|
wrapper.between(Appeal::getFirstRegTime, dateFormat.parse(startTime), dateFormat.parse(endTime)); |
|
|
|
} else if (timeFrame == 1) { |
|
|
|
} else if (timeFrame == 1) { |
|
|
|
@ -313,21 +315,35 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
} else if (timeFrame == 3) { |
|
|
|
} else if (timeFrame == 3) { |
|
|
|
wrapper.between(Appeal::getFirstRegTime, LocalDateTimeUtils.yearStartTime(), LocalDateTimeUtils.yearEndTime()); |
|
|
|
wrapper.between(Appeal::getFirstRegTime, LocalDateTimeUtils.yearStartTime(), LocalDateTimeUtils.yearEndTime()); |
|
|
|
} |
|
|
|
} |
|
|
|
List<Appeal> appeals = appealService.list(wrapper); |
|
|
|
List<Appeal> appealList = appealService.list(wrapper); |
|
|
|
// 过滤掉无街道的, 防止异常
|
|
|
|
// 过滤掉无街道的, 防止异常
|
|
|
|
appeals = appeals.stream().filter(appeal -> Func.isNotEmpty(appeal.getStreetId())).collect(Collectors.toList()); |
|
|
|
appealList = appealList.stream().filter(appeal -> Func.isNotEmpty(appeal.getStreetId())).collect(Collectors.toList()); |
|
|
|
appeals.forEach(appeal -> appeal.setStreet(DictBizCache.getById(appeal.getStreetId()).getDictValue())); |
|
|
|
appealList.forEach(appeal -> appeal.setStreet(DictBizCache.getById(appeal.getStreetId()).getDictValue())); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<Appeal> resolveList = appealList.stream().filter(appeal -> state.contains(appeal.getStatus())).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
// 根据街道分组
|
|
|
|
// 根据街道分组
|
|
|
|
Map<String, List<Appeal>> collect = appeals.stream().collect(Collectors.groupingBy(Appeal::getStreet)); |
|
|
|
Map<String, List<Appeal>> reportList = appealList.stream().collect(Collectors.groupingBy(Appeal::getStreet)); |
|
|
|
|
|
|
|
Map<String, List<Appeal>> collect = resolveList.stream().collect(Collectors.groupingBy(Appeal::getStreet)); |
|
|
|
Set<String> names = collect.keySet(); |
|
|
|
Set<String> names = collect.keySet(); |
|
|
|
|
|
|
|
|
|
|
|
// 街道对应的数量
|
|
|
|
// 街道对应的数量
|
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
List<DataEntity> result = new ArrayList<>(); |
|
|
|
|
|
|
|
Map<String, Object> map; |
|
|
|
for (String name : names) { |
|
|
|
for (String name : names) { |
|
|
|
map.put(name, collect.get(name).size()); |
|
|
|
DataEntity entity = new DataEntity(); |
|
|
|
|
|
|
|
entity.setName(name); |
|
|
|
|
|
|
|
entity.setValue(collect.get(name).size()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String resolveRate = "0"; |
|
|
|
|
|
|
|
if (entity.getValue() > 0) { |
|
|
|
|
|
|
|
double rate = (entity.getValue() / reportList.get(name).size()) * 100; |
|
|
|
|
|
|
|
resolveRate = calRate(rate); |
|
|
|
} |
|
|
|
} |
|
|
|
return map; |
|
|
|
entity.setResolveRate(resolveRate); |
|
|
|
|
|
|
|
result.add(entity); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
@ -362,11 +378,12 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public IPage<Appeal> getImmediateList(String streetId, IPage<Appeal> page) { |
|
|
|
public IPage<Appeal> getImmediateList(String streetId, LocalDateTime start, LocalDateTime end, IPage<Appeal> page) { |
|
|
|
LambdaQueryWrapper<Appeal> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<Appeal> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.select(Appeal::getId, Appeal::getFirstRegTime, Appeal::getDisputeId, Appeal::getDisputeName); |
|
|
|
wrapper.select(Appeal::getId, Appeal::getFirstRegTime, Appeal::getDisputeId, Appeal::getDisputeName); |
|
|
|
wrapper.eq(Appeal::getStreetId, streetId); |
|
|
|
wrapper.eq(Appeal::getStreetId, streetId); |
|
|
|
wrapper.eq(Appeal::getSkipGrant, BusinessConstant.CODE_TRUE); |
|
|
|
wrapper.eq(Appeal::getSkipGrant, BusinessConstant.CODE_TRUE); |
|
|
|
|
|
|
|
wrapper.between(Appeal::getFirstRegTime, start, end); |
|
|
|
wrapper.orderByDesc(Appeal::getCreateTime); |
|
|
|
wrapper.orderByDesc(Appeal::getCreateTime); |
|
|
|
IPage<Appeal> iPage = appealService.page(page, wrapper); |
|
|
|
IPage<Appeal> iPage = appealService.page(page, wrapper); |
|
|
|
|
|
|
|
|
|
|
|
@ -388,25 +405,31 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Map<String, List<DataEntity>> getAppealHot() { |
|
|
|
public Map<String, List<DataEntity>> getAppealHot(LocalDateTime start, LocalDateTime end) { |
|
|
|
Map<String, List<DataEntity>> map = new HashMap(); |
|
|
|
Map<String, List<DataEntity>> map = new HashMap(); |
|
|
|
// 化解成功状态数组
|
|
|
|
// 化解成功状态数组
|
|
|
|
List<Integer> state = Arrays.asList(BusinessConstant.APPEAL_STATUS_AGREEMENT, BusinessConstant.APPEAL_STATUS_FINISH); |
|
|
|
List<Integer> state = Arrays.asList(BusinessConstant.APPEAL_STATUS_AGREEMENT, BusinessConstant.APPEAL_STATUS_FINISH); |
|
|
|
|
|
|
|
|
|
|
|
// 获取所有化解成功的诉求记录
|
|
|
|
// 获取所有化解成功的诉求记录
|
|
|
|
LambdaQueryWrapper<Appeal> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<Appeal> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
wrapper.in(Appeal::getStatus, state); |
|
|
|
wrapper.between(Appeal::getFirstRegTime, start, end); |
|
|
|
List<Appeal> appeals = appealService.list(wrapper); |
|
|
|
List<Appeal> appealList = appealService.list(wrapper); |
|
|
|
|
|
|
|
|
|
|
|
// 过滤掉无街道和处理部门的, 防止异常
|
|
|
|
// 过滤掉无街道和处理部门的, 防止异常
|
|
|
|
appeals = appeals.stream().filter( |
|
|
|
appealList = appealList.stream().filter( |
|
|
|
appeal -> Func.isNotEmpty(appeal.getStreetId()) && Func.isNotEmpty(appeal.getHandleDept()) |
|
|
|
appeal -> Func.isNotEmpty(appeal.getStreetId()) && Func.isNotEmpty(appeal.getHandleDept()) |
|
|
|
).collect(Collectors.toList()); |
|
|
|
).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取所有化解成功的诉求记录
|
|
|
|
|
|
|
|
List<Appeal> appealFinishList = appealList.stream().filter( |
|
|
|
|
|
|
|
appeal -> state.contains(appeal.getStatus()) |
|
|
|
|
|
|
|
).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>> reportStreetList = appealList.stream().collect(Collectors.groupingBy(Appeal::getStreetId)); |
|
|
|
|
|
|
|
Map<Long, List<Appeal>> street = appealFinishList.stream().collect(Collectors.groupingBy(Appeal::getStreetId)); |
|
|
|
|
|
|
|
|
|
|
|
// 封装到数据对象
|
|
|
|
// 封装到数据对象
|
|
|
|
List<DataEntity> strees = new ArrayList<>(); |
|
|
|
List<DataEntity> strees = new ArrayList<>(); |
|
|
|
@ -415,6 +438,12 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
DataEntity entity = new DataEntity(); |
|
|
|
DataEntity entity = new DataEntity(); |
|
|
|
entity.setName(dictBiz.getDictValue()); |
|
|
|
entity.setName(dictBiz.getDictValue()); |
|
|
|
entity.setValue(street.containsKey(dictBizId) ? street.get(dictBizId).size() : 0); |
|
|
|
entity.setValue(street.containsKey(dictBizId) ? street.get(dictBizId).size() : 0); |
|
|
|
|
|
|
|
String resolveRate = "0"; |
|
|
|
|
|
|
|
if (entity.getValue() > 0) { |
|
|
|
|
|
|
|
double rate = (entity.getValue() / reportStreetList.get(dictBizId).size()) * 100; |
|
|
|
|
|
|
|
resolveRate = calRate(rate); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
entity.setResolveRate(resolveRate); |
|
|
|
strees.add(entity); |
|
|
|
strees.add(entity); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
@ -425,7 +454,8 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
// 获取所有部门
|
|
|
|
// 获取所有部门
|
|
|
|
List<User> userList = UserCache.getServerWindowList(); |
|
|
|
List<User> userList = UserCache.getServerWindowList(); |
|
|
|
// 根据部门分组
|
|
|
|
// 根据部门分组
|
|
|
|
Map<Long, List<Appeal>> town = appeals.stream().collect(Collectors.groupingBy(Appeal::getHandleDept)); |
|
|
|
Map<Long, List<Appeal>> reportTownList = appealList.stream().collect(Collectors.groupingBy(Appeal::getHandleDept)); |
|
|
|
|
|
|
|
Map<Long, List<Appeal>> town = appealFinishList.stream().collect(Collectors.groupingBy(Appeal::getHandleDept)); |
|
|
|
|
|
|
|
|
|
|
|
// 封装到数据对象
|
|
|
|
// 封装到数据对象
|
|
|
|
List<DataEntity> towns = new ArrayList<>(); |
|
|
|
List<DataEntity> towns = new ArrayList<>(); |
|
|
|
@ -434,6 +464,16 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
DataEntity entity = new DataEntity(); |
|
|
|
DataEntity entity = new DataEntity(); |
|
|
|
entity.setName(user.getName()); |
|
|
|
entity.setName(user.getName()); |
|
|
|
entity.setValue(town.containsKey(id) ? town.get(id).size() : 0); |
|
|
|
entity.setValue(town.containsKey(id) ? town.get(id).size() : 0); |
|
|
|
|
|
|
|
String resolveRate = "0"; |
|
|
|
|
|
|
|
if (entity.getValue() > 0) { |
|
|
|
|
|
|
|
if (reportTownList.containsKey(id)) { |
|
|
|
|
|
|
|
double rate = (entity.getValue() / reportTownList.get(id).size()) * 100; |
|
|
|
|
|
|
|
resolveRate = calRate(rate); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
resolveRate = "100%"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
entity.setResolveRate(resolveRate); |
|
|
|
towns.add(entity); |
|
|
|
towns.add(entity); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
@ -444,6 +484,42 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
return map; |
|
|
|
return map; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Map<String, List<DataEntity>> getReportSort(LocalDateTime start, LocalDateTime end) { |
|
|
|
|
|
|
|
Map<String, List<DataEntity>> map = new HashMap(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取所有上报的诉求记录
|
|
|
|
|
|
|
|
LambdaQueryWrapper<Appeal> wrapper = new LambdaQueryWrapper<>(); |
|
|
|
|
|
|
|
wrapper.between(Appeal::getFirstRegTime, start, end); |
|
|
|
|
|
|
|
List<Appeal> appeals = appealService.list(wrapper); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 过滤掉无街道的, 防止异常
|
|
|
|
|
|
|
|
appeals = appeals.stream().filter( |
|
|
|
|
|
|
|
appeal -> Func.isNotEmpty(appeal.getStreetId()) |
|
|
|
|
|
|
|
).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 获取所有街道
|
|
|
|
|
|
|
|
List<DictBiz> dataList = dictService.getList(BusinessConstant.DICT_KEY_STREET); |
|
|
|
|
|
|
|
// 根据街道分组
|
|
|
|
|
|
|
|
Map<Long, List<Appeal>> street = appeals.stream().collect(Collectors.groupingBy(Appeal::getStreetId)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 封装到数据对象
|
|
|
|
|
|
|
|
List<DataEntity> strees = new ArrayList<>(); |
|
|
|
|
|
|
|
dataList.forEach(dictBiz -> { |
|
|
|
|
|
|
|
Long dictBizId = dictBiz.getId(); |
|
|
|
|
|
|
|
DataEntity entity = new DataEntity(); |
|
|
|
|
|
|
|
entity.setName(dictBiz.getDictValue()); |
|
|
|
|
|
|
|
entity.setValue(street.containsKey(dictBizId) ? street.get(dictBizId).size() : 0); |
|
|
|
|
|
|
|
strees.add(entity); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 倒序
|
|
|
|
|
|
|
|
List<DataEntity> streeList = strees.stream().sorted(Comparator.comparing(DataEntity::getValue).reversed()).collect(Collectors.toList()); |
|
|
|
|
|
|
|
map.put("street", streeList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return map; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Map<String, List<Object>> getStartAndEndTime(Map<String, List<Object>> map, List<Integer> state, Integer month) { |
|
|
|
private Map<String, List<Object>> getStartAndEndTime(Map<String, List<Object>> map, List<Integer> state, Integer month) { |
|
|
|
List<Object> dateList = map.get("dateList"); |
|
|
|
List<Object> dateList = map.get("dateList"); |
|
|
|
List<Object> handlerCountList = map.get("handlerCountList"); |
|
|
|
List<Object> handlerCountList = map.get("handlerCountList"); |
|
|
|
@ -474,6 +550,18 @@ public class LargeScreenServiceImpl implements ILargeScreenService { |
|
|
|
map.put("handlerCountList", handlerCountList); |
|
|
|
map.put("handlerCountList", handlerCountList); |
|
|
|
map.put("finishContList", finishContList); |
|
|
|
map.put("finishContList", finishContList); |
|
|
|
return map; |
|
|
|
return map; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private String calRate(double rate) { |
|
|
|
|
|
|
|
String resolveRate = String.format("%.2f", rate); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ("100.00".equalsIgnoreCase(resolveRate)) { |
|
|
|
|
|
|
|
resolveRate = "100"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ("0.00".equalsIgnoreCase(resolveRate)) { |
|
|
|
|
|
|
|
resolveRate = "0"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return resolveRate + "%"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|