|
@@ -2,21 +2,23 @@ package com.zfjg.manage.controller.enforce.job;
|
|
|
|
|
|
|
|
|
import com.zfjg.common.core.domain.R;
|
|
|
+import com.zfjg.common.core.utils.StringUtils;
|
|
|
+import com.zfjg.common.core.utils.poi.ExcelUtil;
|
|
|
import com.zfjg.common.core.web.page.TableInfo;
|
|
|
+import com.zfjg.manage.api.dto.enforce.job.EnforceDeductRecordDTO;
|
|
|
+import com.zfjg.manage.api.dto.enforce.job.EnforceDeductRecordQuery;
|
|
|
import com.zfjg.manage.api.dto.enforce.job.EnforceEvaluateDTO;
|
|
|
import com.zfjg.manage.api.dto.enforce.job.EnforceEvaluateQuery;
|
|
|
-import com.zfjg.manage.api.dto.other.WReportQuery;
|
|
|
import com.zfjg.manage.api.vo.enforce.job.WReportDeductVo;
|
|
|
-import com.zfjg.manage.api.vo.other.WReportVo;
|
|
|
import com.zfjg.manage.service.enforce.job.IEnforceDeductRecordService;
|
|
|
-import com.zfjg.manage.service.other.WReportBizService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
-import java.util.ArrayList;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.time.LocalDateTime;
|
|
|
+import java.time.format.DateTimeFormatter;
|
|
|
import java.util.List;
|
|
|
|
|
|
import static com.zfjg.common.core.utils.PageUtils.startPage;
|
|
@@ -32,11 +34,12 @@ import static com.zfjg.common.core.utils.PageUtils.startPage;
|
|
|
class EnforceEvaluateController {
|
|
|
@Autowired
|
|
|
private IEnforceDeductRecordService enforceDeductRecordService;
|
|
|
- @ApiOperation(value="查询执法考评列表(不分页)")
|
|
|
+
|
|
|
+ @ApiOperation(value = "查询执法考评列表(不分页)")
|
|
|
@GetMapping("/evaluate/list")
|
|
|
public R<List<EnforceEvaluateDTO>> getList(EnforceEvaluateQuery query) {
|
|
|
-// List<EnforceEvaluateDTO> list = enforceDeductRecordService.selectEvaluateList(query);
|
|
|
- List<EnforceEvaluateDTO> list = new ArrayList<>();
|
|
|
+ getTime(query);
|
|
|
+ List<EnforceEvaluateDTO> list = enforceDeductRecordService.selectEvaluateList(query);
|
|
|
return R.ok(list);
|
|
|
}
|
|
|
|
|
@@ -50,6 +53,73 @@ class EnforceEvaluateController {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ @ApiOperation(value="执法过错扣分列表导出")
|
|
|
+ @GetMapping("/wreport/list/export")
|
|
|
+ public void export(HttpServletResponse response, EnforceEvaluateQuery query) {
|
|
|
+ List<WReportDeductVo> list = enforceDeductRecordService.selectWreportList(query);
|
|
|
+ ExcelUtil<WReportDeductVo> util = new ExcelUtil<WReportDeductVo>(WReportDeductVo.class);
|
|
|
+ util.exportExcel(response, list, "执法过错扣分列表", "执法过错扣分列表");
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void main(String[] args) {
|
|
|
+ EnforceEvaluateQuery query = new EnforceEvaluateQuery();
|
|
|
+ query.setStartDate("2024-10-01 00:00:00");
|
|
|
+ query.setEndDate("2025-12-02 23:59:59");
|
|
|
+ getTime(query);
|
|
|
+ }
|
|
|
+ public static void getTime(EnforceEvaluateQuery query) {
|
|
|
+ // 定义时间格式
|
|
|
+ DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ // 传递过来的两个时间段
|
|
|
+ LocalDateTime start = LocalDateTime.parse(query.getStartDate(), formatter);
|
|
|
+ LocalDateTime end = LocalDateTime.parse(query.getEndDate(), formatter);
|
|
|
+
|
|
|
+ LocalDateTime start1 = LocalDateTime.parse("2024-10-10 00:00:00",formatter);
|
|
|
+ LocalDateTime end1 = LocalDateTime.parse("2024-10-31 23:59:59", formatter);
|
|
|
+
|
|
|
+ //时间段早于2024-10-10,无过程记录
|
|
|
+ if (end.isBefore(start1)) {
|
|
|
+ query.setProcess(false);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ query.setProcess(true);
|
|
|
+
|
|
|
+ LocalDateTime start2 = LocalDateTime.parse("2024-11-01 23:59:59", formatter);
|
|
|
+ LocalDateTime end2 = LocalDateTime.parse("2024-12-17 00:00:00",formatter);
|
|
|
+
|
|
|
+ //时间段大于2024-11-01
|
|
|
+ if (start.isAfter(end2)) {
|
|
|
+ query.setStartDate2(query.getStartDate());
|
|
|
+ query.setEndDate2(query.getEndDate());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (end.isAfter(end2)) {
|
|
|
+ query.setEndDate3(query.getEndDate());
|
|
|
+ }
|
|
|
+
|
|
|
+ // 计算交集
|
|
|
+ LocalDateTime intersectionStart1 = start.isAfter(start1) ? start : start1;
|
|
|
+ LocalDateTime intersectionEnd1 = end.isBefore(end1) ? end : end1;
|
|
|
+
|
|
|
+ LocalDateTime intersectionStart2 = start.isAfter(start2) ? start : start2;
|
|
|
+ LocalDateTime intersectionEnd2 = end.isBefore(end2) ? end : end2;
|
|
|
+
|
|
|
+ // 检查是否有交集
|
|
|
+ if (!intersectionStart1.isAfter(intersectionEnd1)) {
|
|
|
+ query.setStartDate1(intersectionStart1.format(formatter));
|
|
|
+ query.setEndDate1(intersectionEnd1.format(formatter));
|
|
|
+ }
|
|
|
+ if (!intersectionStart2.isAfter(intersectionEnd2)) {
|
|
|
+ query.setStartDate2(intersectionStart2.format(formatter));
|
|
|
+ query.setEndDate2(intersectionEnd2.format(formatter));
|
|
|
+ }
|
|
|
+
|
|
|
+ return;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|