|
@@ -116,17 +116,25 @@ public class TlInspectionLocationLogController extends BaseController {
|
|
@Log(title = "漏打巡检点导出", businessType = BusinessType.EXPORT)
|
|
@Log(title = "漏打巡检点导出", businessType = BusinessType.EXPORT)
|
|
@PostMapping("/missExport")
|
|
@PostMapping("/missExport")
|
|
public void missExport(HttpServletResponse response, TlInspectionLocationLog tlInspectionLocationLog) {
|
|
public void missExport(HttpServletResponse response, TlInspectionLocationLog tlInspectionLocationLog) {
|
|
|
|
+ // 查询近一个月内所有打卡记录
|
|
|
|
+ TlInspectionLocationLog bean = new TlInspectionLocationLog();
|
|
|
|
+ TlInspectionLocation location = new TlInspectionLocation();
|
|
|
|
+ if (StrUtil.isNotBlank(tlInspectionLocationLog.getAreaId())) {
|
|
|
|
+ Set<String> split = new HashSet<>(StrUtil.split(tlInspectionLocationLog.getAreaId(), ','));
|
|
|
|
+ bean.setAreaIds(split);
|
|
|
|
+ location.setAreaIds(split);
|
|
|
|
+ }
|
|
// 查询每个镇所有的点位
|
|
// 查询每个镇所有的点位
|
|
- List<TlInspectionLocation> locations = locationService.selectLocationList();
|
|
|
|
|
|
+ List<TlInspectionLocation> locations = locationService.selectLocationList(location);
|
|
Set<String> locationsSet = locations.stream().map(TlInspectionLocation::getLocationCode).collect(Collectors.toSet());
|
|
Set<String> locationsSet = locations.stream().map(TlInspectionLocation::getLocationCode).collect(Collectors.toSet());
|
|
Map<String, TlInspectionLocation> locationName = locations.stream().collect(Collectors.toMap(TlInspectionLocation::getLocationCode, a -> a));
|
|
Map<String, TlInspectionLocation> locationName = locations.stream().collect(Collectors.toMap(TlInspectionLocation::getLocationCode, a -> a));
|
|
// Map<Long, List<TlInspectionLocation>> locationCollect = locations.stream().collect(Collectors.groupingBy(TlInspectionLocation::getAreaId));
|
|
// Map<Long, List<TlInspectionLocation>> locationCollect = locations.stream().collect(Collectors.groupingBy(TlInspectionLocation::getAreaId));
|
|
- // 查询近一个月内所有打卡记录
|
|
|
|
- TlInspectionLocationLog bean = new TlInspectionLocationLog();
|
|
|
|
|
|
+
|
|
DateTime endDate = DateUtil.date();
|
|
DateTime endDate = DateUtil.date();
|
|
DateTime startDate = DateUtil.offsetDay(endDate, -30);
|
|
DateTime startDate = DateUtil.offsetDay(endDate, -30);
|
|
bean.setBeginTime(DateUtil.formatDateTime(startDate));
|
|
bean.setBeginTime(DateUtil.formatDateTime(startDate));
|
|
bean.setEndTime(DateUtil.formatDateTime(endDate));
|
|
bean.setEndTime(DateUtil.formatDateTime(endDate));
|
|
|
|
+
|
|
List<TlInspectionLocationLog> locationLogList = tlInspectionLocationLogService.selectTlInspectionLocationLogList(bean);
|
|
List<TlInspectionLocationLog> locationLogList = tlInspectionLocationLogService.selectTlInspectionLocationLogList(bean);
|
|
// 解析根据日期分组
|
|
// 解析根据日期分组
|
|
Map<String, List<TlInspectionLocationLog>> dateCollect = locationLogList.stream().collect(Collectors.groupingBy(a -> DateUtil.formatDate(a.getCreateTime())));
|
|
Map<String, List<TlInspectionLocationLog>> dateCollect = locationLogList.stream().collect(Collectors.groupingBy(a -> DateUtil.formatDate(a.getCreateTime())));
|