Browse Source

fit:1、督察任务发布后端v1

master
pengwei 7 months ago
parent
commit
4dd0448031
  1. 1
      src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java
  2. 32
      src/main/java/com/biutag/supervision/controller/mobileSupervision/InspectionController.java
  3. 44
      src/main/java/com/biutag/supervision/controller/mobileSupervision/SelfexaminationController.java
  4. 96
      src/main/java/com/biutag/supervision/controller/mobileSupervision/TaskManagementController.java
  5. 11
      src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java
  6. 6
      src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java
  7. 6
      src/main/java/com/biutag/supervision/controller/system/DepartController.java
  8. 84
      src/main/java/com/biutag/supervision/mapper/NegativeMapper.java
  9. 4
      src/main/java/com/biutag/supervision/mapper/SupTaskMapper.java
  10. 11
      src/main/java/com/biutag/supervision/mapper/SupTaskSelfexaminationDepartMapper.java
  11. 2
      src/main/java/com/biutag/supervision/mapper/SupTaskTestingAlcoholMapper.java
  12. 10
      src/main/java/com/biutag/supervision/mapper/SupTaskTestingAlcoholSamplingMapper.java
  13. 3
      src/main/java/com/biutag/supervision/pojo/dto/TaskInspectionDto.java
  14. 49
      src/main/java/com/biutag/supervision/pojo/dto/TaskManagementDto.java
  15. 18
      src/main/java/com/biutag/supervision/pojo/dto/TemperancePoliceDto.java
  16. 3
      src/main/java/com/biutag/supervision/pojo/entity/SamplingPolice.java
  17. 25
      src/main/java/com/biutag/supervision/pojo/entity/SupTaskSelfexaminationDepart.java
  18. 2
      src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholPeople.java
  19. 19
      src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholSampling.java
  20. 4
      src/main/java/com/biutag/supervision/pojo/param/DepartQueryParam.java
  21. 1
      src/main/java/com/biutag/supervision/pojo/param/SamplingQueryParam.java
  22. 2
      src/main/java/com/biutag/supervision/pojo/vo/PoliceVo.java
  23. 24
      src/main/java/com/biutag/supervision/pojo/vo/SamplingVo.java
  24. 2
      src/main/java/com/biutag/supervision/pojo/vo/TaskInspectionVo.java
  25. 42
      src/main/java/com/biutag/supervision/pojo/vo/TaskSelfexaminationProblemVo.java
  26. 6
      src/main/java/com/biutag/supervision/pojo/vo/TaskVo.java
  27. 18
      src/main/java/com/biutag/supervision/pojo/vo/TemperancePoliceVo.java
  28. 2
      src/main/java/com/biutag/supervision/service/DataMailService.java
  29. 8
      src/main/java/com/biutag/supervision/service/SamplingService.java
  30. 10
      src/main/java/com/biutag/supervision/service/SupTaskSelfexaminationDepartService.java
  31. 28
      src/main/java/com/biutag/supervision/service/SupTaskService.java
  32. 12
      src/main/java/com/biutag/supervision/service/SupTaskTestingAlcoholSamplingService.java
  33. 6
      src/main/java/com/biutag/supervision/service/SupTaskTestingAlcoholService.java
  34. 230
      src/main/java/com/biutag/supervision/service/TaskManagementService.java
  35. 2
      src/main/resources/mapper/SamplingMapper.xml
  36. 28
      src/main/resources/mapper/SupTaskMapper.xml
  37. 41
      src/main/resources/mapper/SupTaskTestingAlcoholMapper.xml
  38. BIN
      src/main/resources/static/templates/重点人员管控导入模板.xlsx

1
src/main/java/com/biutag/supervision/controller/datav/DataVSupervisionNotifyController.java

@ -149,6 +149,7 @@ public class DataVSupervisionNotifyController {
endTime = DateUtil.endOfDay(endTime);
//地图数据
List<SuperviseMapIconVo> superviseTempMapVoList = negativeMapper.getSupervisionMapIconInfo(beginTime, endTime);
//todo 有问题
JSONObject data = new JSONObject().fluentPut("superviseTempMapVoList", superviseTempMapVoList);
return Result.success(data);
}

32
src/main/java/com/biutag/supervision/controller/mobileSupervision/InspectionController.java

@ -1,32 +1,55 @@
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")
@ -36,6 +59,7 @@ public class InspectionController {
private final SupTaskProblemService taskProblemService;
@GetMapping
public Result<Page<TaskInspectionVo>> 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<SupTaskInspection> get(@PathVariable Integer taskId) {
return Result.success(taskInspectionService.getById(taskId));

44
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<TaskSelfexaminationVo>> 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<Boolean> 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<Page<TaskSelfexaminationProblemVo>> listProblem(@PathVariable Integer taskId, TaskInspectionProblemQueryParam queryParam) {
LambdaQueryWrapper<SupTaskProblem> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SupTaskProblem::getTaskId, taskId)
.orderByDesc(SupTaskProblem::getCreateTime);
Page<SupTaskProblem> page = taskProblemService.page(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
List<TaskSelfexaminationProblemVo> 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<TaskSelfexaminationProblemVo>().setRecords(records).setTotal(page.getTotal()));
}
}

96
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<Page<TaskVo>> 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<TaskManagementDto> 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<List<TemperancePoliceDto>> 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<TemperancePoliceDto> list = new ArrayList<>();
ExcelReader excelReader = EasyExcel.read(file.getInputStream(), TemperancePoliceDto.class, new ReadListener<TemperancePoliceDto>() {
@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);
}
}

11
src/main/java/com/biutag/supervision/controller/mobileSupervision/TestingAlcoholController.java

@ -59,6 +59,17 @@ public class TestingAlcoholController {
public Result<Page<TaskTestingAlcoholVo>> page(TaskTestingAlcoholQueryParam queryParam) {
return Result.success(taskTestingAlcoholService.page(queryParam));
}
/**
* 获取详情
* todo
* */
@GetMapping("/getDetail/{taskId}")
public Result<TaskTestingAlcoholVo> getDetail(@PathVariable Integer taskId){
return Result.success(taskTestingAlcoholService.getDetailFun(taskId));
}
@GetMapping("getPersonNumber")
public Result<List<SupTaskTestingAlcoholPeople>> getPersonNumber(TestingAlcoholFilter condition) {

6
src/main/java/com/biutag/supervision/controller/subdatav/SubOneSupervisionNotifyController.java

@ -187,10 +187,10 @@ public class SubOneSupervisionNotifyController {
if(!negatives.isEmpty()){
List<String> 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());
//问责人数 、问责单位数

6
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<List<SupDepart>> getDepartByIds(DepartQueryParam departQueryParam){
return Result.success(departService.list(new LambdaQueryWrapper<SupDepart>().in(SupDepart::getId,departQueryParam.getIds())));
}
@PostMapping
public Result<Boolean> add(@RequestBody SupDepart supDepart) {
if (departService.existsByName(supDepart.getName())) {

84
src/main/java/com/biutag/supervision/mapper/NegativeMapper.java

@ -143,7 +143,7 @@ public interface NegativeMapper extends BaseMapper<Negative> {
"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<Negative> {
"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<Negative> {
@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<Negative> {
"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<Negative> {
"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<Negative> {
"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,16 +299,17 @@ public interface NegativeMapper extends BaseMapper<Negative> {
@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 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 " +
"GROUP BY sd.short_name; ")
@ -561,12 +577,12 @@ public interface NegativeMapper extends BaseMapper<Negative> {
@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<Negative> {
@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<Negative> {
@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<Negative> {
"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<Negative> {
"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<Negative> {
@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<Negative> {
@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<Negative> {
@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) " +

4
src/main/java/com/biutag/supervision/mapper/SupTaskMapper.java

@ -14,6 +14,10 @@ public interface SupTaskMapper extends BaseMapper<SupTask> {
Page<TaskVo> queryTask(@Param("page") Page<SupTask> page,
@Param(Constants.WRAPPER) QueryWrapper<SupTask> queryWrapper);
Page<TaskVo> queryTaskList(@Param("page") Page<SupTask> page,
@Param(Constants.WRAPPER) QueryWrapper<SupTask> queryWrapper);
TaskCountVo queryTaskCount(@Param(Constants.WRAPPER) QueryWrapper<SupTask> queryWrapper);
}

11
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<SupTaskSelfexaminationDepart> {
}

2
src/main/java/com/biutag/supervision/mapper/SupTaskTestingAlcoholMapper.java

@ -12,4 +12,6 @@ public interface SupTaskTestingAlcoholMapper extends BaseMapper<SupTaskTestingAl
Page<TaskTestingAlcoholVo> queryPage(@Param("page") Page<SupTaskTestingAlcohol> page, @Param(Constants.WRAPPER) QueryWrapper<SupTaskTestingAlcohol> queryWrapper);
TaskTestingAlcoholVo getDetail(Integer id);
}

10
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<SupTaskTestingAlcoholSampling> {
}

3
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;

49
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<LocalDateTime> times = new ArrayList<>();
//督察人员
private List<SupTaskPerson> persons = new ArrayList<>();
//督察对象方式(禁酒督察)
private String samplingTarget;
//excel 导入的数据
private List<TemperancePoliceVo> policeVos;
//选择的禁闭规则
private List<String> samplingIds;
// 选择的数据
private List<SupTaskTestingAlcoholPeople> userList;
// 任务要求
private String taskContent;
//任务要求
private String taskContentHtml;
//自选单位
private List<String> selfOrgs;
//任务内容
private List<SupTaskSelfexaminationContent> selfContents;
}

18
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;
}

3
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;
}

25
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;
}

2
src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholPeople.java

@ -32,6 +32,8 @@ public class SupTaskTestingAlcoholPeople {
@TableField("id_code")
private String idCode;
// private String mobile;
// 单位ID
@TableField("depart_id")
private String departId;

19
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;
}

4
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<String> ids;
}

1
src/main/java/com/biutag/supervision/pojo/param/SamplingQueryParam.java

@ -43,6 +43,7 @@ public class SamplingQueryParam extends BasePage{
//是否值班人员
private String beDuty;
private List<String> ids;
}

2
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;
//在规定时间中 抽检次数

24
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;
}
}

2
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")

42
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<FileVo> files = new ArrayList<>();
private List<TaskProblemDto.People> peoples = new ArrayList<>();
}

6
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;
}

18
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;
}

2
src/main/java/com/biutag/supervision/service/DataMailService.java

@ -141,8 +141,6 @@ public class DataMailService extends ServiceImpl<DataPetitionComplaintMapper, Da
// 局长信箱
Long commissionerTotal = negativeService.count(new LambdaQueryWrapper<Negative>().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());

8
src/main/java/com/biutag/supervision/service/SamplingService.java

@ -140,7 +140,9 @@ public class SamplingService extends ServiceImpl<SamplingMapper, Sampling> {
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<Sampling> page= baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
List<SamplingVo> listData = new ArrayList<>();
@ -156,9 +158,9 @@ public class SamplingService extends ServiceImpl<SamplingMapper, Sampling> {
s.setPersonnelTypeArray(List.of(s.getPersonnelType().split(",")));
}
if(StrUtil.isNotBlank(s.getSamplingObj())){
s.setSamplingObjectList((List<SamplingVo.SamplingObject>) 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<SamplingMapper, Sampling> {
List<PoliceVo> 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();
}

10
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<SupTaskSelfexaminationDepartMapper, SupTaskSelfexaminationDepart> {
}

28
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<SupTaskMapper, SupTask> {
private final NegativeWorkService negativeWorkService;
private final SupTaskPersonService personService;
public Page<TaskVo> pageTask(TaskQueryParam queryParam) {
UserAuth user = UserContextHolder.getCurrentUser();
QueryWrapper<SupTask> queryWrapper = new QueryWrapper<>();
@ -43,6 +52,25 @@ public class SupTaskService extends ServiceImpl<SupTaskMapper, SupTask> {
return baseMapper.queryTask(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
}
public Page<TaskVo> pageTaskData(TaskQueryParam queryParam){
QueryWrapper<SupTask> 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<TaskVo> page= baseMapper.queryTaskList(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
page.getRecords().forEach(s->{
List<SupTaskPerson> problems =personService.list(new LambdaQueryWrapper<SupTaskPerson>().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<SupTask> queryWrapper = new QueryWrapper<>();

12
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<SupTaskTestingAlcoholSamplingMapper, SupTaskTestingAlcoholSampling> {
}

6
src/main/java/com/biutag/supervision/service/SupTaskTestingAlcoholService.java

@ -40,6 +40,12 @@ public class SupTaskTestingAlcoholService extends ServiceImpl<SupTaskTestingAlco
return baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
}
public TaskTestingAlcoholVo getDetailFun(Integer id){
return baseMapper.getDetail(id);
}
@Transactional(rollbackFor = Exception.class)
public boolean save(TaskTestingAlcoholDto dto) {
SupTask task = new SupTask();

230
src/main/java/com/biutag/supervision/service/TaskManagementService.java

@ -0,0 +1,230 @@
package com.biutag.supervision.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.constants.enums.TaskStatusEnum;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.dto.TaskInspectionDto;
import com.biutag.supervision.pojo.dto.TaskManagementDto;
import com.biutag.supervision.pojo.entity.*;
import com.biutag.supervision.pojo.param.TaskQueryParam;
import com.biutag.supervision.pojo.vo.TaskVo;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@RequiredArgsConstructor
@Service
public class TaskManagementService {
private final SupDepartService departService;
private final SupTaskService taskService;
private final SupTaskPersonService taskPersonService;
private final SupTaskInspectionService supTaskInspectionService;
private final SupTaskSelfexaminationService selfexaminationService;
private final SupTaskSelfexaminationContentService selfexaminationContentService;
private final SupTaskTestingAlcoholService testingAlcoholService;
private final SupTaskTestingAlcoholPeopleService testingAlcoholPeopleService;
private final SupTaskTestingAlcoholSamplingService alcoholSamplingService;
private final SupTaskSelfexaminationDepartService supTaskSelfexaminationDepartService;
@Transactional(rollbackFor = Exception.class)
public boolean save(TaskManagementDto dto) {
SupTask task = new SupTask();
BeanUtils.copyProperties(dto, task);
task.setCreateTime(LocalDateTime.now());
//specialType 所队自查(selfexamination) 禁酒督察(testing_alcohol)
//supervisionType 日常督察(inspection)
task.setTaskStatus(TaskStatusEnum.todo.name());
task.setBeginTime(dto.getTimes().get(0));
task.setEndTime(dto.getTimes().get(1));
if("日常督察".equals(dto.getSupervisionType())){
task.setTaskType("inspection");
}else{
if("所队自查".equals(dto.getSpecialType())){
task.setTaskType("selfexamination");
}
if("禁酒督察".equals(dto.getSpecialType())){
task.setTaskType("testing_alcohol");
}
}
taskService.save(task);
if("日常督察".equals(dto.getSupervisionType())){
SupTaskInspection testingAlcohol = new SupTaskInspection();
BeanUtils.copyProperties(dto, testingAlcohol);
testingAlcohol.setTaskId(task.getId());
supTaskInspectionService.save(testingAlcohol);
dto.getPersons().forEach(item -> {
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<SupTaskSelfexaminationDepart> 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<SupTaskTestingAlcoholSampling> 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<LocalDateTime> 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<SupTaskInspection>().eq(SupTaskInspection::getTaskId,id));
BeanUtils.copyProperties(testInspection,taskManagementDto );
List<SupTaskPerson> personList = taskPersonService.list(new LambdaQueryWrapper<SupTaskPerson>().eq(SupTaskPerson::getTaskId,id));
taskManagementDto.setPersons(personList);
break;
case "selfexamination":
taskManagementDto.setSpecialType("所队自查");
taskManagementDto.setSupervisionType("专项督察");
SupTaskSelfexamination selfexamination = selfexaminationService.getOne(new LambdaQueryWrapper<SupTaskSelfexamination>().eq(SupTaskSelfexamination::getTaskId,id));
taskManagementDto.setTaskContent(selfexamination.getRequirement());
taskManagementDto.setTaskContentHtml(selfexamination.getRequirementHtml());
//自选单位
List<SupTaskSelfexaminationDepart> list =supTaskSelfexaminationDepartService.list(new LambdaQueryWrapper<SupTaskSelfexaminationDepart>().eq(SupTaskSelfexaminationDepart::getTaskId,id));
if(CollectionUtil.isNotEmpty(list)){
taskManagementDto.setSelfOrgs(list.stream().map(SupTaskSelfexaminationDepart::getDepartId).toList());
}
//任务内容
List<SupTaskSelfexaminationContent> contents = selfexaminationContentService.list(new LambdaQueryWrapper<SupTaskSelfexaminationContent>().eq(SupTaskSelfexaminationContent::getTaskId,id));
taskManagementDto.setSelfContents(contents);
break;
case "testing_alcohol":
taskManagementDto.setSpecialType("禁酒督察");
taskManagementDto.setSupervisionType("专项督察");
SupTaskTestingAlcohol testingAlcohol = testingAlcoholService.getOne(new LambdaQueryWrapper<SupTaskTestingAlcohol>().eq(SupTaskTestingAlcohol::getTaskId,id));
BeanUtils.copyProperties(testingAlcohol, taskManagementDto);
taskManagementDto.setSamplingTarget(testingAlcohol.getDataGenerationMethod());
List<SupTaskTestingAlcoholSampling> sampling= alcoholSamplingService.list(new LambdaQueryWrapper<SupTaskTestingAlcoholSampling>().eq(SupTaskTestingAlcoholSampling::getTaskId,id));
if(CollectionUtil.isNotEmpty(sampling)){
taskManagementDto.setSamplingIds(sampling.stream().map(SupTaskTestingAlcoholSampling::getSamplingId).toList());
}
//督察人员
List<SupTaskPerson> taskPersonList = taskPersonService.list(new LambdaQueryWrapper<SupTaskPerson>().eq(SupTaskPerson::getTaskId,id));
taskManagementDto.setPersons(taskPersonList);
//选择的数据
List<SupTaskTestingAlcoholPeople> taskTestingAlcoholPeople= testingAlcoholPeopleService.list(new LambdaQueryWrapper<SupTaskTestingAlcoholPeople>().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<SupTaskInspection>().eq(SupTaskInspection::getTaskId,id));
taskPersonService.remove(new LambdaQueryWrapper<SupTaskPerson>().eq(SupTaskPerson::getTaskId,id));
break;
case "selfexamination":
selfexaminationService.remove(new LambdaQueryWrapper<SupTaskSelfexamination>().eq(SupTaskSelfexamination::getTaskId,id));
supTaskSelfexaminationDepartService.remove(new LambdaQueryWrapper<SupTaskSelfexaminationDepart>().eq(SupTaskSelfexaminationDepart::getTaskId,id));
selfexaminationContentService.remove(new LambdaQueryWrapper<SupTaskSelfexaminationContent>().eq(SupTaskSelfexaminationContent::getTaskId,id));
break;
case "testing_alcohol":
testingAlcoholService.remove(new LambdaQueryWrapper<SupTaskTestingAlcohol>().eq(SupTaskTestingAlcohol::getTaskId,id));
alcoholSamplingService.remove(new LambdaQueryWrapper<SupTaskTestingAlcoholSampling>().eq(SupTaskTestingAlcoholSampling::getTaskId,id));
taskPersonService.remove(new LambdaQueryWrapper<SupTaskPerson>().eq(SupTaskPerson::getTaskId,id));
testingAlcoholPeopleService.remove(new LambdaQueryWrapper<SupTaskTestingAlcoholPeople>().eq(SupTaskTestingAlcoholPeople::getTaskId,id));
break;
}
return true;
}
}

2
src/main/resources/mapper/SamplingMapper.xml

@ -15,6 +15,7 @@
<select id="selectPoliceData" resultType="com.biutag.supervision.pojo.vo.PoliceVo" parameterType="com.biutag.supervision.pojo.vo.SamplingVo">
SELECT
sup.name,
sup.id_code as idCode,
sdp.short_name as shortName,
sup.emp_no as empNo,
stp.isdrink,
@ -81,6 +82,7 @@
SELECT
sup.`name`,
sup.emp_no as empNo,
sup.id_code as idCode,
sdp.short_name as shortName,
sup.person_type as personnelType,
sap.time as crtTime,

28
src/main/resources/mapper/SupTaskMapper.xml

@ -27,6 +27,34 @@
${ew.getCustomSqlSegment}
</select>
<select id="queryTaskList" resultType="com.biutag.supervision.pojo.vo.TaskVo">
select t.id,
t.task_name,
t.sup_depart_name,
t.begin_time,
t.end_time,
t.create_time,
t.task_type,
t.task_status,
a.filter_people_number total_number,
i.supervision_type,
i.task_content,
i.has_sign,
s.requirement,
s.type,
count(DISTINCT tp.depart_id) depart_number,
count(tp.id) problem_number
from sup_task t
left join sup_task_person p on p.task_id = t.id
left join sup_task_inspection i on t.id = i.task_id
left join sup_task_testing_alcohol a on t.id = a.task_id
left join sup_task_selfexamination s on t.id = s.task_id
LEFT JOIN sup_task_problem tp on t.id = tp.task_id
${ew.getCustomSqlSegment}
</select>
<select id="queryTaskCount" resultType="com.biutag.supervision.pojo.vo.TaskCountVo">
select sum(CASE WHEN t.task_status = 'todo' THEN 1 ELSE 0 END ) todo_count,
sum(CASE WHEN t.task_status = 'done' THEN 1 ELSE 0 END ) done_count

41
src/main/resources/mapper/SupTaskTestingAlcoholMapper.xml

@ -46,5 +46,44 @@
</select>
<select id="getDetail" resultType="com.biutag.supervision.pojo.vo.TaskTestingAlcoholVo">
SELECT
t.id,
t.task_name,
t.sup_depart_name,
t.begin_time,
t.end_time,
t.task_status,
GROUP_CONCAT( DISTINCT per.NAME, ' ') persons,
p.total_number,
p.not_detected_number,
p.not_drinking_number,
p.drink_number
FROM
sup_task t
LEFT JOIN sup_task_testing_alcohol a ON t.id = a.task_id
LEFT JOIN sup_task_person per ON t.id = per.task_id
LEFT JOIN (SELECT
task_id,
count( id ) total_number,
SUM( CASE WHEN `testing_result` = '未检测' THEN 1 ELSE 0 END ) not_detected_number,
SUM( CASE WHEN `drink_result` = '未饮酒' THEN 1 ELSE 0 END ) not_drinking_number,
SUM( CASE WHEN `drink_result` = '已饮酒' THEN 1 ELSE 0 END ) drink_number
FROM
sup_task_testing_alcohol_people
GROUP BY
task_id) p ON t.id = p.task_id
where t.id = #{id}
GROUP BY
t.id,
t.task_name,
t.sup_depart_name,
t.begin_time,
t.end_time,
t.task_status,
p.total_number,
p.not_detected_number,
p.not_drinking_number,
p.drink_number
</select>
</mapper>

BIN
src/main/resources/static/templates/重点人员管控导入模板.xlsx

Binary file not shown.
Loading…
Cancel
Save