diff --git a/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java b/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java index 5fc9708..bd90c18 100644 --- a/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java @@ -149,6 +149,7 @@ public class DataVSupervisionNotifyController { endTime = DateUtil.endOfDay(endTime); //地图数据 List superviseTempMapVoList = negativeMapper.getSupervisionMapIconInfo(beginTime, endTime); + //todo 有问题 JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList); return Result.success(data); } diff --git a/src/main/java/com/biutag/supervision/controller/mobileSupervision/InspectionController.java b/src/main/java/com/biutag/supervision/controller/mobileSupervision/InspectionController.java index d3dd255..db9079d 100644 --- a/src/main/java/com/biutag/supervision/controller/mobileSupervision/InspectionController.java +++ b/src/main/java/com/biutag/supervision/controller/mobileSupervision/InspectionController.java @@ -1,41 +1,65 @@ package com.biutag.supervision.controller.mobileSupervision; +import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; import com.alibaba.fastjson2.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.constants.enums.DepartLevelEnum; +import com.biutag.supervision.constants.enums.TaskStatusEnum; +import com.biutag.supervision.constants.enums.TaskTypeEnum; import com.biutag.supervision.pojo.Result; -import com.biutag.supervision.pojo.dto.TaskInspectionDto; -import com.biutag.supervision.pojo.dto.TaskProblemDto; -import com.biutag.supervision.pojo.dto.TaskInspectionProblemQueryParam; +import com.biutag.supervision.pojo.domain.Self; +import com.biutag.supervision.pojo.dto.*; +import com.biutag.supervision.pojo.entity.SupDepart; +import com.biutag.supervision.pojo.entity.SupTask; import com.biutag.supervision.pojo.entity.SupTaskInspection; import com.biutag.supervision.pojo.entity.SupTaskProblem; import com.biutag.supervision.pojo.param.TaskInspectionQueryParam; import com.biutag.supervision.pojo.vo.FileVo; import com.biutag.supervision.pojo.vo.TaskInspectionProblemVo; import com.biutag.supervision.pojo.vo.TaskInspectionVo; +import com.biutag.supervision.pojo.vo.TemperancePoliceVo; import com.biutag.supervision.service.SupTaskProblemService; import com.biutag.supervision.service.SupTaskInspectionService; +import jakarta.servlet.http.HttpServletResponse; +import jakarta.validation.ConstraintViolation; +import lombok.Getter; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.ss.formula.functions.T; import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import java.io.IOException; +import java.net.http.HttpRequest; +import java.time.LocalDateTime; +import java.util.ArrayList; import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; /** * @author wxc * @date 2025/4/9 */ +@Slf4j @RequiredArgsConstructor @RestController @RequestMapping("task/inspection") -public class InspectionController { +public class InspectionController { private final SupTaskInspectionService taskInspectionService; private final SupTaskProblemService taskProblemService; + @GetMapping public Result> page(TaskInspectionQueryParam queryParam) { return Result.success(taskInspectionService.page(queryParam)); @@ -46,6 +70,8 @@ public class InspectionController { return Result.success(taskInspectionService.save(dto)); } + + @GetMapping("{taskId}") public Result get(@PathVariable Integer taskId) { return Result.success(taskInspectionService.getById(taskId)); diff --git a/src/main/java/com/biutag/supervision/controller/mobileSupervision/SelfexaminationController.java b/src/main/java/com/biutag/supervision/controller/mobileSupervision/SelfexaminationController.java index f5cee94..d630cd4 100644 --- a/src/main/java/com/biutag/supervision/controller/mobileSupervision/SelfexaminationController.java +++ b/src/main/java/com/biutag/supervision/controller/mobileSupervision/SelfexaminationController.java @@ -1,17 +1,26 @@ package com.biutag.supervision.controller.mobileSupervision; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson2.JSON; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.TaskInspectionProblemQueryParam; +import com.biutag.supervision.pojo.dto.TaskProblemDto; import com.biutag.supervision.pojo.dto.TaskSelfexaminationDto; +import com.biutag.supervision.pojo.entity.SupTaskProblem; import com.biutag.supervision.pojo.entity.SupTaskSelfexamination; import com.biutag.supervision.pojo.param.TaskInspectionQueryParam; -import com.biutag.supervision.pojo.vo.TaskSelfexaminationDetailVo; -import com.biutag.supervision.pojo.vo.TaskSelfexaminationVo; +import com.biutag.supervision.pojo.vo.*; +import com.biutag.supervision.service.SupTaskProblemService; import com.biutag.supervision.service.SupTaskSelfexaminationService; import lombok.RequiredArgsConstructor; +import org.springframework.beans.BeanUtils; import org.springframework.web.bind.annotation.*; +import java.util.List; + /** * @author wxc * @date 2025/4/30 @@ -23,6 +32,8 @@ public class SelfexaminationController { private final SupTaskSelfexaminationService taskSelfexaminationService; + private final SupTaskProblemService taskProblemService; + @GetMapping public Result> page(TaskInspectionQueryParam queryParam) { return Result.success(taskSelfexaminationService.page(queryParam)); @@ -33,6 +44,8 @@ public class SelfexaminationController { return Result.success(taskSelfexaminationService.get(taskId)); } + + @PostMapping public Result add(@RequestBody TaskSelfexaminationDto dto) { return Result.success(taskSelfexaminationService.save(dto)); @@ -44,4 +57,31 @@ public class SelfexaminationController { return Result.success(); } + + + @GetMapping("{taskId}/problem") + public Result> listProblem(@PathVariable Integer taskId, TaskInspectionProblemQueryParam queryParam) { + + LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); + queryWrapper.eq(SupTaskProblem::getTaskId, taskId) + .orderByDesc(SupTaskProblem::getCreateTime); + Page page = taskProblemService.page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); + + List records = page.getRecords().stream().map(item -> { + TaskSelfexaminationProblemVo vo = new TaskSelfexaminationProblemVo(); + BeanUtils.copyProperties(item, vo); + if (StrUtil.isNotBlank(item.getPeoples())) { + vo.setPeoples(JSON.parseArray(item.getPeoples(), TaskProblemDto.People.class)); + } + if (StrUtil.isNotBlank(item.getFiles())) { + vo.setFiles(JSON.parseArray(item.getFiles(), FileVo.class)); + } + return vo; + }).toList(); + return Result.success(new Page().setRecords(records).setTotal(page.getTotal())); + } + + + + } diff --git a/src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskManagementController.java b/src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskManagementController.java new file mode 100644 index 0000000..d3a9e2e --- /dev/null +++ b/src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskManagementController.java @@ -0,0 +1,96 @@ +package com.biutag.supervision.controller.mobileSupervision; + +import cn.hutool.core.io.FileUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.excel.EasyExcel; +import com.alibaba.excel.ExcelReader; +import com.alibaba.excel.context.AnalysisContext; +import com.alibaba.excel.read.listener.ReadListener; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.biutag.supervision.pojo.Result; +import com.biutag.supervision.pojo.dto.DataCaseVerifImportDto; +import com.biutag.supervision.pojo.dto.TaskManagementDto; +import com.biutag.supervision.pojo.dto.TemperancePoliceDto; +import com.biutag.supervision.pojo.param.TaskInspectionQueryParam; +import com.biutag.supervision.pojo.param.TaskQueryParam; +import com.biutag.supervision.pojo.vo.TaskInspectionVo; +import com.biutag.supervision.pojo.vo.TaskVo; +import com.biutag.supervision.service.SupTaskService; +import com.biutag.supervision.service.TaskManagementService; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +@Slf4j +@RequiredArgsConstructor +@RequestMapping("/task/management") +@RestController +public class TaskManagementController { + + private final TaskManagementService taskManagementService; + + private final SupTaskService taskService; + @GetMapping + public Result> pageResult(TaskQueryParam queryParam) { + return Result.success(taskService.pageTaskData(queryParam)); + } + @PostMapping("/addTaskManagement") + public Result addTaskManagement(@RequestBody TaskManagementDto dto){ + if(taskManagementService.save(dto)){ + return Result.success(); + }else{ + return Result.failed("操作失败"); + } + } + + @GetMapping("/{id}") + public Result getDetil(@PathVariable Integer id){ + TaskManagementDto taskManagementDto = taskManagementService.getDetail(id); + if(ObjectUtil.isNotEmpty(taskManagementDto)){ + return Result.success(taskManagementDto); + }else{ + return Result.failed("查询失败"); + } + } + + @DeleteMapping("/{id}") + public Result delTaskById(@PathVariable Integer id){ + if(taskManagementService.delTaskById(id)){ + return Result.success(); + }else{ + return Result.failed("操作失败"); + } + } + + @PostMapping("import") + public Result> importExcel(@RequestPart("file") MultipartFile file) throws IOException { + log.info("文件导入中------------------------------"); + String fileNameType = FileUtil.extName(file.getOriginalFilename()); + if (!"xls".equals(fileNameType) && !"xlsx".equals(fileNameType)) { + throw new RuntimeException("仅支持 xls/xlsx 格式文件的导入"); + } + List list = new ArrayList<>(); + + ExcelReader excelReader = EasyExcel.read(file.getInputStream(), TemperancePoliceDto.class, new ReadListener() { + @Override + public void invoke(TemperancePoliceDto data, AnalysisContext analysisContext) { + list.add(data); + } + + @Override + public void doAfterAllAnalysed(AnalysisContext analysisContext) { + + } + }).build().read(EasyExcel.readSheet(0).build()); + excelReader.close(); + log.info("数据导入完成"); + return Result.success(list); + } + +} diff --git a/src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java b/src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java index 6c446c6..c174d0b 100644 --- a/src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java +++ b/src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java @@ -59,6 +59,17 @@ public class TestingAlcoholController { public Result> page(TaskTestingAlcoholQueryParam queryParam) { return Result.success(taskTestingAlcoholService.page(queryParam)); } + /** + * 获取详情 + * todo + * */ + @GetMapping("/getDetail/{taskId}") + public Result getDetail(@PathVariable Integer taskId){ + return Result.success(taskTestingAlcoholService.getDetailFun(taskId)); + } + + + @GetMapping("getPersonNumber") public Result> getPersonNumber(TestingAlcoholFilter condition) { diff --git a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java index c59833e..b25c895 100644 --- a/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java +++ b/src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java @@ -187,10 +187,10 @@ public class SubOneSupervisionNotifyController { if(!negatives.isEmpty()){ List negativeIds = negatives.stream().filter(item -> InspectCaseEnum.isItTure(item.getCheckStatus())).map(Negative::getId).toList(); superviseMapIconVo.setTotalPro(String.valueOf(negatives.size())); - //已办结的 - superviseMapIconVo.setCompletedNumber(negatives.stream().filter(item ->"1".equals(item.getIsRectifyCode())).count()); + //已办理 + superviseMapIconVo.setCompletedNumber(negatives.stream().filter(item ->ProcessingStatusEnum.completed.name().equals(item.getProcessingStatus())).count()); //办理中 - superviseMapIconVo.setProcessingNumber(negatives.stream().filter(item ->"0".equals(item.getIsRectifyCode())).count()); + superviseMapIconVo.setProcessingNumber(negatives.size() - superviseMapIconVo.getCompletedNumber()); // 办结率 // superviseMapIconVo.setCompletedRate(superviseMapIconVo.getProblemNumber() == 0 ? 0: NumberUtil.roundHalfEven(NumberUtil.mul(NumberUtil.div(superviseMapIconVo.getCompletedNumber(), superviseMapIconVo.getProblemNumber()), 100), 0).doubleValue()); //问责人数 、问责单位数 diff --git a/src/main/java/com/biutag/supervision/controller/system/DepartController.java b/src/main/java/com/biutag/supervision/controller/system/DepartController.java index f7d1966..b406473 100644 --- a/src/main/java/com/biutag/supervision/controller/system/DepartController.java +++ b/src/main/java/com/biutag/supervision/controller/system/DepartController.java @@ -43,6 +43,12 @@ public class DepartController { return Result.success(departService.page(departQueryParam)); } + @GetMapping("getDepartByIds") + public Result> getDepartByIds(DepartQueryParam departQueryParam){ + return Result.success(departService.list(new LambdaQueryWrapper().in(SupDepart::getId,departQueryParam.getIds()))); + } + + @PostMapping public Result add(@RequestBody SupDepart supDepart) { if (departService.existsByName(supDepart.getName())) { diff --git a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java index 0543124..c39bc2f 100644 --- a/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/NegativeMapper.java @@ -143,7 +143,7 @@ public interface NegativeMapper extends BaseMapper { "IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS completedRate " + "FROM negative ng " + "LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " + - "WHERE problemSourcesCode IN (13) " + + "WHERE problemSourcesCode IN (13,14,15) " + "AND sd.statistics_group_id=#{groupId} " + "AND crtTime BETWEEN #{beginTime} AND #{endTime};") DayTimeSuperviseVo getSupervisionRank(Date beginTime, Date endTime, Integer groupId); @@ -159,7 +159,7 @@ public interface NegativeMapper extends BaseMapper { "ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1) AS `value` " + "FROM negative ng " + "LEFT JOIN sup_depart sd ON ng.second_involve_depart_id=sd.id " + - "WHERE problemSourcesCode IN (13) " + + "WHERE problemSourcesCode IN (13,14,15) " + "AND sd.statistics_group_id=#{groupId} " + "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + "GROUP BY sd.short_name " + @@ -169,7 +169,7 @@ public interface NegativeMapper extends BaseMapper { @Select("SELECT npr.oneLevelContent as name, count(*) value FROM negative ng, negative_problem_relation npr " + "WHERE ng.id = npr.negativeId " + - "AND ng.problemSourcesCode in (13, 15) " + + "AND ng.problemSourcesCode in (13,14, 15) " + "and ng.checkStatus<>3 " + "AND ng.crtTime BETWEEN #{beginTime} AND #{endTime} " + "AND oneLevelContent is NOT NULL " + @@ -185,7 +185,7 @@ public interface NegativeMapper extends BaseMapper { "COALESCE(ROUND(COUNT(DISTINCT IF(ng.processing_status='completed', ng.id, NULL)) / COUNT(DISTINCT ng.id) * 100, 1), 0) AS completedRate " + "FROM negative ng " + "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + - "WHERE ng.problemSourcesCode IN (13, 15) " + + "WHERE ng.problemSourcesCode IN (13,14, 15) " + "AND ng.crtTime BETWEEN #{beginTime} AND #{endTime}; ") SupervisionNotifyOverView getAllSupervisionNotifyCount(Date beginTime, Date endTime); @@ -198,8 +198,22 @@ public interface NegativeMapper extends BaseMapper { "COUNT( DISTINCT IF(ng.problemSourcesCode=15, ng.id, NULL) ) AS zx, " + "COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS processingNumber, " + "COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS completedNumber , " + - "COUNT( DISTINCT ng.involveDepartId ) AS relationOrg, " + - "COUNT( DISTINCT nb.blameIdCode ) AS personNum, " + + "SUM(CASE " + + " WHEN nb.type = 'personal' " + + " AND nb.handleResultName != '' " + + " AND nb.handleResultName IS NOT NULL " + + " AND nb.handleResultName != '不予追责' " + + " THEN 1 " + + " ELSE 0 " + + " END) AS personNum, " + + " SUM(CASE " + + " WHEN nb.type = 'department' " + + " AND nb.handleResultName != '' " + + " AND nb.handleResultName IS NOT NULL " + + " AND nb.handleResultName != '不予追责' " + + " THEN 1 " + + " ELSE 0 " + + " END) AS relationOrg, "+ "IFNULL( ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS completedRate " + "FROM sup_depart sd " + "LEFT JOIN negative ng ON ng.second_involve_depart_id=sd.id " + @@ -251,6 +265,7 @@ public interface NegativeMapper extends BaseMapper { "INNER JOIN negative ng ON sd.id = ng.involveDepartId " + "LEFT JOIN negative_blame nb ON ng.id = nb.negativeId " + "WHERE problemSourcesCode = 16 " + + "and ng.checkStatus in (1, 2) "+ "AND ng.crtTime BETWEEN #{beginTime} AND #{endTime}") VideoSuperviseCountVo getAllVideoSuperviseCount(Date beginTime, Date endTime); /** @@ -284,18 +299,19 @@ public interface NegativeMapper extends BaseMapper { @Select("SELECT " + "sd.short_name AS `name`, " + "sd.id AS departId, " + - "COUNT( DISTINCT ng.id) AS discoverProblem, " + + "COUNT(DISTINCT ng.id) as total, "+ + "COUNT( DISTINCT ng.id AND ng.checkStatus <> 3 ) AS discoverProblem, " + "COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS completionProblem, " + "COUNT( DISTINCT ng.involveDepartId) AS relativeOrg, " + "COUNT( DISTINCT nb.blameName ) AS relativePer, " + "IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id)*100, 1 ),0) AS completionRate " + "FROM sup_depart sd " + "LEFT JOIN negative ng ON sd.id=ng.second_involve_depart_id " + - "AND checkStatus <>3 " + - "AND problemSourcesCode =16 " + + "AND problemSourcesCode = 16 " + "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + + "and checkStatus in (1, 2) "+ "LEFT JOIN negative_blame nb ON ng.id=nb.negativeId " + - "WHERE sd.statistics_group_id=3 " + + "WHERE sd.statistics_group_id=3 " + "GROUP BY sd.short_name; ") List getVideoSuperviseMapIconInfo(Date beginTime, Date endTime); @@ -561,12 +577,12 @@ public interface NegativeMapper extends BaseMapper { @Select("SELECT " + "COUNT(DISTINCT ng.id) AS proTotal, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=0, ng.id, NULL) ) AS changing, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) AS changed, " + - "IFNULL( ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS correctionRate " + + "COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS changing, " + + "COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS changed, " + + "IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS correctionRate " + "FROM negative ng " + "LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " + - "WHERE ng.problemSourcesCode IN (13) " + + "WHERE ng.problemSourcesCode IN (13,14,15) " + "AND ng.second_involve_depart_id=#{departId} " + "AND sd.statistics_group_id=10 " + "AND crtTime BETWEEN #{beginTime} AND #{endTime} ") @@ -574,12 +590,12 @@ public interface NegativeMapper extends BaseMapper { @Select("SELECT " + "COUNT(DISTINCT ng.id) AS proTotal, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=0, ng.id, NULL) ) AS changing, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) AS changed, " + - "IFNULL( ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS correctionRate " + + "COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS changing, " + + "COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS changed, " + + "IFNULL(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1), 0) AS correctionRate " + "FROM negative ng " + "LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " + - "WHERE ng.problemSourcesCode IN (13) " + + "WHERE ng.problemSourcesCode IN (13,14,15) " + "AND ng.second_involve_depart_id=#{departId} " + "AND sd.statistics_group_id!=10 " + "AND crtTime BETWEEN #{beginTime} AND #{endTime} ") @@ -588,12 +604,12 @@ public interface NegativeMapper extends BaseMapper { @Select("SELECT " + "sd.short_name AS label, " + "COUNT(DISTINCT ng.id) AS denominator, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) AS numerator, " + - "ifnull(ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1),0) AS rate, " + - "ifnull(ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1),0) AS value " + + "COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS numerator, " + + "ifnull(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1),0) AS rate, " + + "ifnull(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1),0) AS value " + "FROM negative ng " + "LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " + - "WHERE ng.problemSourcesCode IN (13) " + + "WHERE ng.problemSourcesCode IN (13,14,15) " + "AND ng.second_involve_depart_id=#{departId} " + "AND sd.statistics_group_id=10 " + "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + @@ -605,11 +621,11 @@ public interface NegativeMapper extends BaseMapper { "sd.short_name AS label, " + "COUNT(DISTINCT ng.id) AS denominator, " + "COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) AS numerator, " + - "ifnull(ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1),0) AS rate, " + - "ifnull(ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1),0) AS value " + + "ifnull(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1),0) AS rate, " + + "ifnull(ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1),0) AS value " + "FROM negative ng " + "LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " + - "WHERE ng.problemSourcesCode IN (13) " + + "WHERE ng.problemSourcesCode IN (13,14,15) " + "AND ng.second_involve_depart_id=#{departId} " + "AND sd.statistics_group_id!=10 " + "AND crtTime BETWEEN #{beginTime} AND #{endTime} " + @@ -621,8 +637,8 @@ public interface NegativeMapper extends BaseMapper { "sd.id AS departId, " + "count( DISTINCT ng.id) AS denominator, " + "count( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL )) AS numerator, " + - "ROUND( COUNT(DISTINCT if(ng.isRectifyCode=1, ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS rate, " + - "ROUND( COUNT(DISTINCT if(ng.isRectifyCode=1, ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS value " + + "ROUND( COUNT(DISTINCT if(ng.processing_status='completed', ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS rate, " + + "ROUND( COUNT(DISTINCT if(ng.processing_status='completed', ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS value " + "FROM sup_depart sd " + "INNER JOIN negative ng on ng.involveDepartId=sd.id AND sd.statistics_group_id=10 AND sd.pid=#{departId} " + "LEFT JOIN negative_blame nb on ng.id=nb.negativeId " + @@ -636,9 +652,9 @@ public interface NegativeMapper extends BaseMapper { @Select("SELECT sd.short_name as label, " + "sd.id AS departId, " + "count( DISTINCT ng.id) AS denominator, " + - "count( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL )) AS numerator, " + - "ROUND( COUNT(DISTINCT if(ng.isRectifyCode=1, ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS rate, " + - "ROUND( COUNT(DISTINCT if(ng.isRectifyCode=1, ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS value " + + "count( DISTINCT IF(ng.processing_status='completed', ng.id, NULL )) AS numerator, " + + "ROUND( COUNT(DISTINCT if(ng.processing_status='completed', ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS rate, " + + "ROUND( COUNT(DISTINCT if(ng.processing_status='completed', ng.id, NULL)) / count(DISTINCT ng.id)*100, 1 ) AS value " + "FROM sup_depart sd " + "INNER JOIN negative ng on ng.involveDepartId=sd.id AND sd.statistics_group_id!=10 AND sd.pid=#{departId} " + "LEFT JOIN negative_blame nb on ng.id=nb.negativeId " + @@ -689,9 +705,9 @@ public interface NegativeMapper extends BaseMapper { @Select("SELECT " + "COUNT(DISTINCT ng.id) AS proTotal, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=0, ng.id, NULL) ) AS changing, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) AS changed, " + - "ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1) AS correctionRate " + + "COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS changing, " + + "COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS changed, " + + "ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1) AS correctionRate " + "FROM negative ng " + "LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " + "WHERE problemSourcesCode IN (15) " + @@ -703,9 +719,9 @@ public interface NegativeMapper extends BaseMapper { @Select("SELECT " + "COUNT(DISTINCT ng.id) AS proTotal, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=0, ng.id, NULL) ) AS changing, " + - "COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) ) AS changed, " + - "ROUND( COUNT( DISTINCT IF(ng.isRectifyCode=1, ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1) AS correctionRate " + + "COUNT( DISTINCT IF(ng.processing_status in ('signing', 'processing', 'approval'), ng.id, NULL) ) AS changing, " + + "COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) ) AS changed, " + + "ROUND( COUNT( DISTINCT IF(ng.processing_status='completed', ng.id, NULL) )/COUNT( DISTINCT ng.id )*100, 1) AS correctionRate " + "FROM negative ng " + "LEFT JOIN sup_depart sd ON ng.involveDepartId=sd.id " + "WHERE problemSourcesCode IN (15) " + diff --git a/src/main/java/com/biutag/supervision/mapper/SupTaskMapper.java b/src/main/java/com/biutag/supervision/mapper/SupTaskMapper.java index d8c5bc1..8768554 100644 --- a/src/main/java/com/biutag/supervision/mapper/SupTaskMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/SupTaskMapper.java @@ -14,6 +14,10 @@ public interface SupTaskMapper extends BaseMapper { Page queryTask(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + Page queryTaskList(@Param("page") Page page, + @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + + TaskCountVo queryTaskCount(@Param(Constants.WRAPPER) QueryWrapper queryWrapper); } diff --git a/src/main/java/com/biutag/supervision/mapper/SupTaskSelfexaminationDepartMapper.java b/src/main/java/com/biutag/supervision/mapper/SupTaskSelfexaminationDepartMapper.java new file mode 100644 index 0000000..c1fb589 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupTaskSelfexaminationDepartMapper.java @@ -0,0 +1,11 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.SupTaskSelfexaminationDepart; +import org.apache.ibatis.annotations.Mapper; + + +public interface SupTaskSelfexaminationDepartMapper extends BaseMapper { + + +} diff --git a/src/main/java/com/biutag/supervision/mapper/SupTaskTestingAlcoholMapper.java b/src/main/java/com/biutag/supervision/mapper/SupTaskTestingAlcoholMapper.java index ba8c94b..eabcd1e 100644 --- a/src/main/java/com/biutag/supervision/mapper/SupTaskTestingAlcoholMapper.java +++ b/src/main/java/com/biutag/supervision/mapper/SupTaskTestingAlcoholMapper.java @@ -12,4 +12,6 @@ public interface SupTaskTestingAlcoholMapper extends BaseMapper queryPage(@Param("page") Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); + TaskTestingAlcoholVo getDetail(Integer id); + } diff --git a/src/main/java/com/biutag/supervision/mapper/SupTaskTestingAlcoholSamplingMapper.java b/src/main/java/com/biutag/supervision/mapper/SupTaskTestingAlcoholSamplingMapper.java new file mode 100644 index 0000000..4a29310 --- /dev/null +++ b/src/main/java/com/biutag/supervision/mapper/SupTaskTestingAlcoholSamplingMapper.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.biutag.supervision.pojo.entity.BaseUser; +import com.biutag.supervision.pojo.entity.SupTaskTestingAlcoholSampling; +import org.apache.ibatis.annotations.Mapper; + + +public interface SupTaskTestingAlcoholSamplingMapper extends BaseMapper { +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/TaskInspectionDto.java b/src/main/java/com/biutag/supervision/pojo/dto/TaskInspectionDto.java index 27a3228..336d0cf 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/TaskInspectionDto.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/TaskInspectionDto.java @@ -1,6 +1,7 @@ package com.biutag.supervision.pojo.dto; import com.biutag.supervision.pojo.entity.SupTaskPerson; +import com.biutag.supervision.pojo.vo.TemperancePoliceVo; import lombok.Getter; import lombok.Setter; @@ -17,10 +18,8 @@ import java.util.List; public class TaskInspectionDto { private String taskName; - // 督察单位 private Integer supDepartId; - // 督察类型 private String supervisionType; diff --git a/src/main/java/com/biutag/supervision/pojo/dto/TaskManagementDto.java b/src/main/java/com/biutag/supervision/pojo/dto/TaskManagementDto.java new file mode 100644 index 0000000..01e01d1 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/TaskManagementDto.java @@ -0,0 +1,49 @@ +package com.biutag.supervision.pojo.dto; + +import com.biutag.supervision.pojo.entity.SupTaskPerson; +import com.biutag.supervision.pojo.entity.SupTaskSelfexaminationContent; +import com.biutag.supervision.pojo.entity.SupTaskTestingAlcoholPeople; +import com.biutag.supervision.pojo.vo.TemperancePoliceVo; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Setter +@Getter +public class TaskManagementDto { + + //任务名称 + private String taskName; + // 督察单位 + private Integer supDepartId; + // 督察类型 + private String supervisionType; + //专项督察类型 + private String specialType; + //督察时间 + private List times = new ArrayList<>(); + //督察人员 + private List persons = new ArrayList<>(); + //督察对象方式(禁酒督察) + private String samplingTarget; + //excel 导入的数据 + private List policeVos; + //选择的禁闭规则 + private List samplingIds; + // 选择的数据 + private List userList; + // 任务要求 + private String taskContent; + //任务要求 + private String taskContentHtml; + //自选单位 + private List selfOrgs; + //任务内容 + private List selfContents; + + +} diff --git a/src/main/java/com/biutag/supervision/pojo/dto/TemperancePoliceDto.java b/src/main/java/com/biutag/supervision/pojo/dto/TemperancePoliceDto.java new file mode 100644 index 0000000..bd5812b --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/dto/TemperancePoliceDto.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.dto; + +import com.alibaba.excel.annotation.ExcelProperty; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class TemperancePoliceDto { + @ExcelProperty({"警号"}) + private String empNo; + + @ExcelProperty({"姓名"}) + private String name; + + @ExcelProperty({"身份证"}) + private String idCode; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SamplingPolice.java b/src/main/java/com/biutag/supervision/pojo/entity/SamplingPolice.java index 287d709..85c6297 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/SamplingPolice.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/SamplingPolice.java @@ -32,4 +32,7 @@ public class SamplingPolice { @JsonFormat(pattern = "yyyy-MM-dd HH:mm") @TableField("crt_time") private LocalDateTime crtTime; + + @TableField("id_code") + private String idCode; } diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupTaskSelfexaminationDepart.java b/src/main/java/com/biutag/supervision/pojo/entity/SupTaskSelfexaminationDepart.java new file mode 100644 index 0000000..8ca0063 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupTaskSelfexaminationDepart.java @@ -0,0 +1,25 @@ +package com.biutag.supervision.pojo.entity; + +import cn.hutool.core.date.DateTime; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; + +@Getter +@Setter +public class SupTaskSelfexaminationDepart { + @TableId + private String id; + //部门id + @TableField("depart_id") + private String departId; + //任务id + @TableField("task_id") + private Integer taskId; + //创建时间 + @TableField("create_time") + private LocalDateTime createTime; +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholPeople.java b/src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholPeople.java index 947f260..b5d701e 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholPeople.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholPeople.java @@ -12,11 +12,11 @@ import java.time.LocalDateTime; @Getter public class SupTaskTestingAlcoholPeople { - // + // @TableId(value = "id", type = IdType.AUTO) private Integer id; - // + // @TableField("task_id") private Integer taskId; @@ -32,6 +32,8 @@ public class SupTaskTestingAlcoholPeople { @TableField("id_code") private String idCode; +// private String mobile; + // 单位ID @TableField("depart_id") private String departId; @@ -60,4 +62,4 @@ public class SupTaskTestingAlcoholPeople { // 检测照片 private String testingFiles; -} \ No newline at end of file +} diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholSampling.java b/src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholSampling.java new file mode 100644 index 0000000..3f717a7 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholSampling.java @@ -0,0 +1,19 @@ +package com.biutag.supervision.pojo.entity; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +public class SupTaskTestingAlcoholSampling { + @TableId + private String id; + //督察任务id + @TableField("task_id") + private Integer taskId; + //人员抽检规则id + @TableField("sampling_id") + private String samplingId; +} diff --git a/src/main/java/com/biutag/supervision/pojo/param/DepartQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/DepartQueryParam.java index 8f6a092..216fd42 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/DepartQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/DepartQueryParam.java @@ -3,6 +3,8 @@ package com.biutag.supervision.pojo.param; import lombok.Getter; import lombok.Setter; +import java.util.List; + @Setter @Getter public class DepartQueryParam extends BasePage { @@ -13,4 +15,6 @@ public class DepartQueryParam extends BasePage { private String code; + private List ids; + } diff --git a/src/main/java/com/biutag/supervision/pojo/param/SamplingQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/SamplingQueryParam.java index 853f99b..d181371 100644 --- a/src/main/java/com/biutag/supervision/pojo/param/SamplingQueryParam.java +++ b/src/main/java/com/biutag/supervision/pojo/param/SamplingQueryParam.java @@ -43,6 +43,7 @@ public class SamplingQueryParam extends BasePage{ //是否值班人员 private String beDuty; + private List ids; } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/PoliceVo.java b/src/main/java/com/biutag/supervision/pojo/vo/PoliceVo.java index 443be1a..f244ad7 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/PoliceVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/PoliceVo.java @@ -19,6 +19,8 @@ public class PoliceVo { //单位id private String deptId; + private String idCode; + //年龄 private int age; //在规定时间中 抽检次数 diff --git a/src/main/java/com/biutag/supervision/pojo/vo/SamplingVo.java b/src/main/java/com/biutag/supervision/pojo/vo/SamplingVo.java index fa49480..b26ad92 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/SamplingVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/SamplingVo.java @@ -1,4 +1,5 @@ package com.biutag.supervision.pojo.vo; +import cn.hutool.core.util.StrUtil; import com.biutag.supervision.pojo.entity.SamplingPolice; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; @@ -88,6 +89,29 @@ public class SamplingVo { private String value; } + + + public String createSamplingInspection(SamplingVo vo){ + String samplingInspection = ""; + if(StrUtil.isNotBlank(vo.getSamplingName())){ + samplingInspection += "抽检名称:"+vo.getSamplingName()+";"; + } + if(StrUtil.isNotBlank(vo.getInspectorType())){ + samplingInspection +="督察类型:"+vo.getInspectorType()+";"; + } + + if(vo.getAgeMax() > 0){ + samplingInspection +="最大年龄:"+vo.getAgeMax()+";"; + } + if(vo.getAgeMin() >= 0){ + samplingInspection +="最小年龄:"+vo.getSamplingName()+";"; + } + if(StrUtil.isNotBlank(vo.getGender())){ + samplingInspection +="性别:"+ ("1".equals(vo.getGender())?"男":"女")+";"; + } + + return samplingInspection; + } } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/TaskInspectionVo.java b/src/main/java/com/biutag/supervision/pojo/vo/TaskInspectionVo.java index 03f2c13..73a0e17 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/TaskInspectionVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/TaskInspectionVo.java @@ -19,8 +19,6 @@ public class TaskInspectionVo { // 任务名称 private String taskName; - // 督察单位 - private String supDepartName; // 开始时间 @JsonFormat(pattern = "yyyy-MM-dd HH:mm") diff --git a/src/main/java/com/biutag/supervision/pojo/vo/TaskSelfexaminationProblemVo.java b/src/main/java/com/biutag/supervision/pojo/vo/TaskSelfexaminationProblemVo.java new file mode 100644 index 0000000..244b4a5 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/TaskSelfexaminationProblemVo.java @@ -0,0 +1,42 @@ +package com.biutag.supervision.pojo.vo; + +import com.biutag.supervision.pojo.dto.TaskProblemDto; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Getter; +import lombok.Setter; + +import java.time.LocalDateTime; +import java.util.ArrayList; +import java.util.List; + +@Getter +@Setter +public class TaskSelfexaminationProblemVo { + + private Integer id; + //任务列表 + private Integer taskId; + + // 是否存在督察问题 + private Boolean hasProblem; + //督察单位ID + private String departId; + //督察单位 + private String departName; + //问题类型 + private String problemType; + //问题类型编码 + private String problemTypeCode; + + // 具体情况 + private String detail; + + + @JsonFormat(pattern = "yyyy-MM-dd HH:mm") + private LocalDateTime createTime; + + // 附件 + private List files = new ArrayList<>(); + + private List peoples = new ArrayList<>(); +} diff --git a/src/main/java/com/biutag/supervision/pojo/vo/TaskVo.java b/src/main/java/com/biutag/supervision/pojo/vo/TaskVo.java index 97c09a6..3e75cf7 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/TaskVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/TaskVo.java @@ -53,4 +53,10 @@ public class TaskVo { private String type; + private String persons; + // 被督察单位 + private Integer departNumber; + //被督察人员 + private Integer problemNumber; + } diff --git a/src/main/java/com/biutag/supervision/pojo/vo/TemperancePoliceVo.java b/src/main/java/com/biutag/supervision/pojo/vo/TemperancePoliceVo.java new file mode 100644 index 0000000..c4e9487 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/vo/TemperancePoliceVo.java @@ -0,0 +1,18 @@ +package com.biutag.supervision.pojo.vo; + +import lombok.Getter; +import lombok.Setter; + +/** + * 禁酒抽检人员 + * */ +@Getter +@Setter +public class TemperancePoliceVo { + + private String empNo; + + private String empName; + + private String idCode; +} diff --git a/src/main/java/com/biutag/supervision/service/DataMailService.java b/src/main/java/com/biutag/supervision/service/DataMailService.java index 803836c..c576d0a 100644 --- a/src/main/java/com/biutag/supervision/service/DataMailService.java +++ b/src/main/java/com/biutag/supervision/service/DataMailService.java @@ -141,8 +141,6 @@ public class DataMailService extends ServiceImpl().between(Negative::getCrtTime, beginTime, endTime).eq(Negative::getHandleSecondDepartId,departId).eq(Negative::getProblemSourcesCode, ProblemSourcesEnum.JZXX.getValue())); - - Long total = countryTotal + policeTotal + commissionerTotal + numTotal; //国家信访 re.setCountryTotal(countryTotal.toString()); diff --git a/src/main/java/com/biutag/supervision/service/SamplingService.java b/src/main/java/com/biutag/supervision/service/SamplingService.java index 7b97553..65178d0 100644 --- a/src/main/java/com/biutag/supervision/service/SamplingService.java +++ b/src/main/java/com/biutag/supervision/service/SamplingService.java @@ -140,7 +140,9 @@ public class SamplingService extends ServiceImpl { queryWrapper.ge("start_time",queryParam.getSamplingTime().get(0)); queryWrapper.le("end_time",queryParam.getSamplingTime().get(1)); } - + if(CollectionUtil.isNotEmpty(queryParam.getIds())){ + queryWrapper.in("id",queryParam.getIds()); + } Page page= baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); List listData = new ArrayList<>(); @@ -156,9 +158,9 @@ public class SamplingService extends ServiceImpl { s.setPersonnelTypeArray(List.of(s.getPersonnelType().split(","))); } if(StrUtil.isNotBlank(s.getSamplingObj())){ - s.setSamplingObjectList((List) JSONObject.parseObject(s.getSamplingObj()).get("data")); } + s.setSamplingInspection(s.createSamplingInspection(s)); }); voPage.setRecords(listData); return voPage; @@ -205,7 +207,7 @@ public class SamplingService extends ServiceImpl { List leadPoliceVos = baseMapper.selectPoliceDataLead(samplingVo); //时间范围内的抽检次数 - if( samplingVo.getSamplingNum() > 0 ){ + if( samplingVo.getSamplingNumber() > 0 ){ policeVos = policeVos.stream().filter(s->s.getCjnum() == samplingVo.getSamplingNumber()).toList(); leadPoliceVos=leadPoliceVos.stream().filter(s->s.getCjnum()== samplingVo.getSamplingNumber()).toList(); } diff --git a/src/main/java/com/biutag/supervision/service/SupTaskSelfexaminationDepartService.java b/src/main/java/com/biutag/supervision/service/SupTaskSelfexaminationDepartService.java new file mode 100644 index 0000000..2057af0 --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupTaskSelfexaminationDepartService.java @@ -0,0 +1,10 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.SupTaskSelfexaminationDepartMapper; +import com.biutag.supervision.pojo.entity.SupTaskSelfexaminationDepart; +import org.springframework.stereotype.Service; + +@Service +public class SupTaskSelfexaminationDepartService extends ServiceImpl { +} diff --git a/src/main/java/com/biutag/supervision/service/SupTaskService.java b/src/main/java/com/biutag/supervision/service/SupTaskService.java index c0ce6ca..64540ae 100644 --- a/src/main/java/com/biutag/supervision/service/SupTaskService.java +++ b/src/main/java/com/biutag/supervision/service/SupTaskService.java @@ -1,6 +1,8 @@ package com.biutag.supervision.service; +import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -9,6 +11,8 @@ import com.biutag.supervision.constants.enums.TaskTypeEnum; import com.biutag.supervision.constants.enums.WorkStatusEnum; import com.biutag.supervision.mapper.SupTaskMapper; import com.biutag.supervision.pojo.entity.SupTask; +import com.biutag.supervision.pojo.entity.SupTaskPerson; +import com.biutag.supervision.pojo.entity.SupTaskProblem; import com.biutag.supervision.pojo.model.NegativeWorkModel; import com.biutag.supervision.pojo.model.UserAuth; import com.biutag.supervision.pojo.param.NegativeQueryParam; @@ -18,6 +22,9 @@ import com.biutag.supervision.pojo.vo.TaskVo; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.stream.Collectors; + import java.util.Objects; @RequiredArgsConstructor @@ -26,6 +33,8 @@ public class SupTaskService extends ServiceImpl { private final NegativeWorkService negativeWorkService; + private final SupTaskPersonService personService; + public Page pageTask(TaskQueryParam queryParam) { UserAuth user = UserContextHolder.getCurrentUser(); QueryWrapper queryWrapper = new QueryWrapper<>(); @@ -43,6 +52,25 @@ public class SupTaskService extends ServiceImpl { return baseMapper.queryTask(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); } + public Page pageTaskData(TaskQueryParam queryParam){ + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq(StrUtil.isNotEmpty( queryParam.getTaskStatus()), "t.task_status", queryParam.getTaskStatus()) + .like(StrUtil.isNotEmpty(queryParam.getTaskName()), "t.task_name", queryParam.getTaskName()) + .eq(StrUtil.isNotEmpty(queryParam.getTaskType()),"t.task_type", queryParam.getTaskType()) + .groupBy("t.id") + .orderByDesc("t.create_time"); + Page page= baseMapper.queryTaskList(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); + page.getRecords().forEach(s->{ + List problems =personService.list(new LambdaQueryWrapper().eq(SupTaskPerson::getTaskId,s.getId())); + if(CollectionUtil.isNotEmpty(problems)){ + s.setPersons(problems.stream().map(SupTaskPerson::getName).collect(Collectors.joining(","))); + } + }); + + return page; + } + + public TaskCountVo getTaskCount() { UserAuth user = UserContextHolder.getCurrentUser(); QueryWrapper queryWrapper = new QueryWrapper<>(); diff --git a/src/main/java/com/biutag/supervision/service/SupTaskTestingAlcoholSamplingService.java b/src/main/java/com/biutag/supervision/service/SupTaskTestingAlcoholSamplingService.java new file mode 100644 index 0000000..086fa1d --- /dev/null +++ b/src/main/java/com/biutag/supervision/service/SupTaskTestingAlcoholSamplingService.java @@ -0,0 +1,12 @@ +package com.biutag.supervision.service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.biutag.supervision.mapper.SupTaskTestingAlcoholSamplingMapper; +import com.biutag.supervision.pojo.entity.SupTaskTestingAlcoholSampling; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Service; + +@RequiredArgsConstructor +@Service +public class SupTaskTestingAlcoholSamplingService extends ServiceImpl { +} diff --git a/src/main/java/com/biutag/supervision/service/SupTaskTestingAlcoholService.java b/src/main/java/com/biutag/supervision/service/SupTaskTestingAlcoholService.java index 01d8e94..40a41b3 100644 --- a/src/main/java/com/biutag/supervision/service/SupTaskTestingAlcoholService.java +++ b/src/main/java/com/biutag/supervision/service/SupTaskTestingAlcoholService.java @@ -40,6 +40,12 @@ public class SupTaskTestingAlcoholService extends ServiceImpl { + item.setTaskId(task.getId()); + }); + return taskPersonService.saveBatch(dto.getPersons()); + }else{ + if("所队自查".equals(dto.getSpecialType())){ + SupTaskSelfexamination selfexamination = new SupTaskSelfexamination(); + selfexamination.setTaskId(task.getId()); + selfexamination.setType(dto.getSpecialType()); + selfexamination.setRequirement(dto.getTaskContent()); + selfexamination.setRequirementHtml(dto.getTaskContentHtml()); + selfexamination.setHasSign(false); + selfexaminationService.save(selfexamination); + // 自选单位 + List list = new ArrayList<>(); + dto.getSelfOrgs().forEach(s->{ + SupTaskSelfexaminationDepart depart = new SupTaskSelfexaminationDepart(); + depart.setTaskId(task.getId()); + depart.setDepartId(s); + depart.setId(IdUtil.fastSimpleUUID()); + depart.setCreateTime(LocalDateTime.now()); + list.add(depart); + }); + supTaskSelfexaminationDepartService.saveBatch(list); + //任务内容 + dto.getSelfContents().forEach(content -> { + content.setTaskId(task.getId()); + content.setStatus(TaskStatusEnum.todo.name()); + }); + return selfexaminationContentService.saveBatch(dto.getSelfContents()); + + } + if("禁酒督察".equals(dto.getSpecialType())){ + SupTaskTestingAlcohol testingAlcohol = new SupTaskTestingAlcohol(); + BeanUtils.copyProperties(dto, testingAlcohol); + testingAlcohol.setTaskId(task.getId()); + testingAlcohol.setDataGenerationMethod(dto.getSamplingTarget()); + testingAlcoholService.save(testingAlcohol); + //处理关联关系 + List samplings = new ArrayList<>(); + if(CollectionUtil.isNotEmpty(dto.getSamplingIds())){ + dto.getSamplingIds().forEach(s->{ + SupTaskTestingAlcoholSampling sampling=new SupTaskTestingAlcoholSampling(); + sampling.setTaskId(task.getId()); + sampling.setSamplingId(s); + samplings.add(sampling); + }); + alcoholSamplingService.saveBatch(samplings); + } + + dto.getPersons().forEach(item -> { + item.setTaskId(task.getId()); + }); + taskPersonService.saveBatch(dto.getPersons()); + dto.getUserList().forEach(item -> { + item.setTaskId(task.getId()); + item.setStatus(TaskStatusEnum.todo.name()); + }); + return testingAlcoholPeopleService.saveBatch(dto.getUserList()); + }else{ + return true; + } + } + + } + /** + * 查看督察任务详情 + * */ + public TaskManagementDto getDetail(Integer id){ + TaskManagementDto taskManagementDto =new TaskManagementDto(); + SupTask supTask = taskService.getById(id); + BeanUtils.copyProperties(supTask,taskManagementDto); + List times = new ArrayList<>(); + times.add(supTask.getBeginTime()); + times.add(supTask.getEndTime()); + + taskManagementDto.setTimes(times); + + switch (supTask.getTaskType()){ + case "inspection": + taskManagementDto.setSupervisionType("日常督察"); + SupTaskInspection testInspection = supTaskInspectionService.getOne(new LambdaQueryWrapper().eq(SupTaskInspection::getTaskId,id)); + BeanUtils.copyProperties(testInspection,taskManagementDto ); + List personList = taskPersonService.list(new LambdaQueryWrapper().eq(SupTaskPerson::getTaskId,id)); + taskManagementDto.setPersons(personList); + break; + case "selfexamination": + taskManagementDto.setSpecialType("所队自查"); + taskManagementDto.setSupervisionType("专项督察"); + SupTaskSelfexamination selfexamination = selfexaminationService.getOne(new LambdaQueryWrapper().eq(SupTaskSelfexamination::getTaskId,id)); + taskManagementDto.setTaskContent(selfexamination.getRequirement()); + taskManagementDto.setTaskContentHtml(selfexamination.getRequirementHtml()); + //自选单位 + List list =supTaskSelfexaminationDepartService.list(new LambdaQueryWrapper().eq(SupTaskSelfexaminationDepart::getTaskId,id)); + if(CollectionUtil.isNotEmpty(list)){ + taskManagementDto.setSelfOrgs(list.stream().map(SupTaskSelfexaminationDepart::getDepartId).toList()); + } + //任务内容 + List contents = selfexaminationContentService.list(new LambdaQueryWrapper().eq(SupTaskSelfexaminationContent::getTaskId,id)); + taskManagementDto.setSelfContents(contents); + break; + case "testing_alcohol": + taskManagementDto.setSpecialType("禁酒督察"); + taskManagementDto.setSupervisionType("专项督察"); + SupTaskTestingAlcohol testingAlcohol = testingAlcoholService.getOne(new LambdaQueryWrapper().eq(SupTaskTestingAlcohol::getTaskId,id)); + + BeanUtils.copyProperties(testingAlcohol, taskManagementDto); + taskManagementDto.setSamplingTarget(testingAlcohol.getDataGenerationMethod()); + List sampling= alcoholSamplingService.list(new LambdaQueryWrapper().eq(SupTaskTestingAlcoholSampling::getTaskId,id)); + if(CollectionUtil.isNotEmpty(sampling)){ + taskManagementDto.setSamplingIds(sampling.stream().map(SupTaskTestingAlcoholSampling::getSamplingId).toList()); + } + //督察人员 + List taskPersonList = taskPersonService.list(new LambdaQueryWrapper().eq(SupTaskPerson::getTaskId,id)); + taskManagementDto.setPersons(taskPersonList); + //选择的数据 + List taskTestingAlcoholPeople= testingAlcoholPeopleService.list(new LambdaQueryWrapper().eq(SupTaskTestingAlcoholPeople::getTaskId,id)); + if (CollectionUtil.isNotEmpty(taskTestingAlcoholPeople)){ + taskManagementDto.setUserList(taskTestingAlcoholPeople); + } + + break; + } + return taskManagementDto; + } + + /** + * 删除数据 + * */ + public Boolean delTaskById(Integer id){ + //获取信息 + SupTask supTask = taskService.getById(id); + taskService.removeById(id); + switch (supTask.getTaskType()){ + case "inspection": + supTaskInspectionService.remove(new LambdaQueryWrapper().eq(SupTaskInspection::getTaskId,id)); + taskPersonService.remove(new LambdaQueryWrapper().eq(SupTaskPerson::getTaskId,id)); + break; + case "selfexamination": + selfexaminationService.remove(new LambdaQueryWrapper().eq(SupTaskSelfexamination::getTaskId,id)); + supTaskSelfexaminationDepartService.remove(new LambdaQueryWrapper().eq(SupTaskSelfexaminationDepart::getTaskId,id)); + selfexaminationContentService.remove(new LambdaQueryWrapper().eq(SupTaskSelfexaminationContent::getTaskId,id)); + break; + case "testing_alcohol": + testingAlcoholService.remove(new LambdaQueryWrapper().eq(SupTaskTestingAlcohol::getTaskId,id)); + alcoholSamplingService.remove(new LambdaQueryWrapper().eq(SupTaskTestingAlcoholSampling::getTaskId,id)); + taskPersonService.remove(new LambdaQueryWrapper().eq(SupTaskPerson::getTaskId,id)); + testingAlcoholPeopleService.remove(new LambdaQueryWrapper().eq(SupTaskTestingAlcoholPeople::getTaskId,id)); + break; + } + return true; + } + +} diff --git a/src/main/resources/mapper/SamplingMapper.xml b/src/main/resources/mapper/SamplingMapper.xml index d09f0e2..a5bc10a 100644 --- a/src/main/resources/mapper/SamplingMapper.xml +++ b/src/main/resources/mapper/SamplingMapper.xml @@ -15,6 +15,7 @@ + + + - + diff --git a/src/main/resources/static/templates/重点人员管控导入模板.xlsx b/src/main/resources/static/templates/重点人员管控导入模板.xlsx new file mode 100644 index 0000000..5288677 Binary files /dev/null and b/src/main/resources/static/templates/重点人员管控导入模板.xlsx differ