63 changed files with 1424 additions and 48 deletions
@ -0,0 +1,5 @@ |
|||||||
|
ALTER TABLE `negative`.`negative` |
||||||
|
ADD COLUMN `verify_time` datetime NULL COMMENT '核查时间', |
||||||
|
ADD COLUMN `project_name` varchar(255) NULL COMMENT '项目名称', |
||||||
|
ADD COLUMN `involve_money` decimal(10, 2) NULL COMMENT '问题涉及金额', |
||||||
|
; |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
ALTER TABLE `negative`.`negative` |
||||||
|
ADD COLUMN `resolve_situation` varchar(255) NULL COMMENT '化解情况' AFTER `involve_money`; |
||||||
|
|
||||||
|
ALTER TABLE `negative`.`data_petition_complaint` |
||||||
|
ADD COLUMN `petition_processing_status` varchar(255) NULL COMMENT '信访办理情况'; |
||||||
|
|
||||||
|
INSERT INTO `negative`.`sup_dict_type`(`dict_name`, `dict_type`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ('化解情况', 'resolveSituation', '0', '', '2025-04-10 16:09:19', '', '2025-04-10 16:09:19', ''); |
||||||
|
|
||||||
|
INSERT INTO `negative`.`sup_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 0, '已化解', '已化解', 'resolveSituation', '', '', '0', '0', '', '2025-04-10 16:09:43', '', '2025-04-10 16:09:43', ''); |
||||||
|
INSERT INTO `negative`.`sup_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 0, '已化解再次信访', '已化解再次信访', 'resolveSituation', '', '', '0', '0', '', '2025-04-10 16:09:53', '', '2025-04-10 16:09:53', ''); |
||||||
|
INSERT INTO `negative`.`sup_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 0, '未化解', '未化解', 'resolveSituation', '', '', '0', '0', '', '2025-04-10 16:10:02', '', '2025-04-10 16:10:02', ''); |
||||||
|
INSERT INTO `negative`.`sup_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 0, '未化解再次信访', '未化解再次信访', 'resolveSituation', '', '', '0', '0', '', '2025-04-10 16:10:11', '', '2025-04-10 16:10:11', ''); |
||||||
|
INSERT INTO `negative`.`sup_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 0, '已终结', '已终结', 'resolveSituation', '', '', '0', '0', '', '2025-04-10 16:10:19', '', '2025-04-10 16:10:19', ''); |
||||||
|
INSERT INTO `negative`.`sup_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 0, '已终结再次信访', '已终结再次信访', 'resolveSituation', '', '', '0', '0', '', '2025-04-10 16:10:28', '', '2025-04-10 16:10:28', ''); |
||||||
|
INSERT INTO `negative`.`sup_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 0, '停访息访', '停访息访', 'resolveSituation', '', '', '0', '0', '', '2025-04-10 16:10:36', '', '2025-04-10 16:10:36', ''); |
||||||
|
INSERT INTO `negative`.`sup_dict_data`(`dict_sort`, `dict_label`, `dict_value`, `dict_type`, `css_class`, `list_class`, `is_default`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) VALUES ( 0, '停访息访后再次信访', '停访息访后再次信访', 'resolveSituation', '', '', '0', '0', '', '2025-04-10 16:10:45', '', '2025-04-10 16:10:45', ''); |
||||||
@ -0,0 +1,10 @@ |
|||||||
|
package com.biutag.supervision.constants.enums; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2025/4/7 |
||||||
|
*/ |
||||||
|
public enum TaskStatusEnum { |
||||||
|
todo, |
||||||
|
done; |
||||||
|
} |
||||||
@ -0,0 +1,14 @@ |
|||||||
|
package com.biutag.supervision.constants.enums; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2025/4/7 |
||||||
|
*/ |
||||||
|
public enum TaskTypeEnum { |
||||||
|
|
||||||
|
// 测酒
|
||||||
|
testing_alcohol, |
||||||
|
|
||||||
|
// 督察任务
|
||||||
|
inspection; |
||||||
|
} |
||||||
@ -0,0 +1,19 @@ |
|||||||
|
package com.biutag.supervision.constants.enums; |
||||||
|
|
||||||
|
/** |
||||||
|
* 测酒状态 |
||||||
|
* @author wxc |
||||||
|
* @date 2025/4/7 |
||||||
|
*/ |
||||||
|
public enum TestingAlcoholStateEnum { |
||||||
|
|
||||||
|
// 未检测
|
||||||
|
not_detected, |
||||||
|
|
||||||
|
// 未饮酒
|
||||||
|
not_drinking, |
||||||
|
|
||||||
|
// 已饮酒
|
||||||
|
drink; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,34 @@ |
|||||||
|
package com.biutag.supervision.controller.mobileSupervision; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.biutag.supervision.pojo.Result; |
||||||
|
import com.biutag.supervision.pojo.dto.TaskInspectionDto; |
||||||
|
import com.biutag.supervision.pojo.param.TaskInspectionQueryParam; |
||||||
|
import com.biutag.supervision.pojo.vo.TaskInspectionVo; |
||||||
|
import com.biutag.supervision.service.SupTaskInspectionService; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2025/4/9 |
||||||
|
*/ |
||||||
|
@RequiredArgsConstructor |
||||||
|
@RestController |
||||||
|
@RequestMapping("task/inspection") |
||||||
|
public class InspectionController { |
||||||
|
|
||||||
|
private final SupTaskInspectionService taskInspectionService; |
||||||
|
|
||||||
|
@GetMapping |
||||||
|
public Result<Page<TaskInspectionVo>> page(TaskInspectionQueryParam queryParam) { |
||||||
|
return Result.success(taskInspectionService.page(queryParam)); |
||||||
|
} |
||||||
|
|
||||||
|
@PostMapping |
||||||
|
public Result<Boolean> add(@RequestBody TaskInspectionDto dto) { |
||||||
|
return Result.success(taskInspectionService.save(dto)); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,68 @@ |
|||||||
|
package com.biutag.supervision.controller.mobileSupervision; |
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.biutag.supervision.pojo.Result; |
||||||
|
import com.biutag.supervision.pojo.dto.TaskTestingAlcoholDto; |
||||||
|
import com.biutag.supervision.pojo.dto.TestingAlcoholFilter; |
||||||
|
import com.biutag.supervision.pojo.entity.SupPolice; |
||||||
|
import com.biutag.supervision.pojo.entity.SupTaskTestingAlcoholPeople; |
||||||
|
import com.biutag.supervision.pojo.param.TaskTestingAlcoholQueryParam; |
||||||
|
import com.biutag.supervision.pojo.vo.TaskTestingAlcoholVo; |
||||||
|
import com.biutag.supervision.service.SupDepartService; |
||||||
|
import com.biutag.supervision.service.SupPoliceService; |
||||||
|
import com.biutag.supervision.service.SupTaskTestingAlcoholService; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2025/3/31 |
||||||
|
*/ |
||||||
|
@RequiredArgsConstructor |
||||||
|
@RestController |
||||||
|
@RequestMapping("task/testingAlcohol") |
||||||
|
public class TestingAlcoholController { |
||||||
|
|
||||||
|
private final SupTaskTestingAlcoholService taskTestingAlcoholService; |
||||||
|
|
||||||
|
private final SupPoliceService policeService; |
||||||
|
|
||||||
|
private final SupDepartService departService; |
||||||
|
|
||||||
|
@GetMapping |
||||||
|
public Result<Page<TaskTestingAlcoholVo>> page(TaskTestingAlcoholQueryParam queryParam) { |
||||||
|
return Result.success(taskTestingAlcoholService.page(queryParam)); |
||||||
|
} |
||||||
|
|
||||||
|
@GetMapping("getPersonNumber") |
||||||
|
public Result<List<SupTaskTestingAlcoholPeople>> getPersonNumber(TestingAlcoholFilter condition) { |
||||||
|
List<String> departIds = departService.getAllNodeIds(condition.getDepartId()); |
||||||
|
List<SupTaskTestingAlcoholPeople> polices = policeService.list(new LambdaQueryWrapper<SupPolice>().in(SupPolice::getOrgId, departIds) |
||||||
|
.in(CollectionUtil.isNotEmpty(condition.getPersonType()), SupPolice::getPersonType, condition.getPersonType()) |
||||||
|
.in(CollectionUtil.isNotEmpty(condition.getPosition()), SupPolice::getPosition, condition.getPosition())) |
||||||
|
.stream().map(item -> { |
||||||
|
SupTaskTestingAlcoholPeople people = new SupTaskTestingAlcoholPeople(); |
||||||
|
people.setName(item.getName()); |
||||||
|
people.setEmpNo(item.getEmpNo()); |
||||||
|
people.setIdCode(item.getIdCode()); |
||||||
|
people.setDepartId(item.getOrgId()); |
||||||
|
return people; |
||||||
|
}).toList(); |
||||||
|
return Result.success(polices); |
||||||
|
} |
||||||
|
|
||||||
|
@PostMapping |
||||||
|
public Result<Boolean> add(@RequestBody TaskTestingAlcoholDto dto) { |
||||||
|
return Result.success(taskTestingAlcoholService.save(dto)); |
||||||
|
} |
||||||
|
|
||||||
|
@PostMapping("genPeople") |
||||||
|
public Result<List<SupTaskTestingAlcoholPeople>> genPeople(@RequestBody TaskTestingAlcoholDto dto) { |
||||||
|
return Result.success(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
package com.biutag.supervision.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.biutag.supervision.pojo.entity.SupTaskInspection; |
||||||
|
import com.biutag.supervision.pojo.vo.TaskInspectionVo; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
|
||||||
|
public interface SupTaskInspectionMapper extends BaseMapper<SupTaskInspection> { |
||||||
|
|
||||||
|
Page<TaskInspectionVo> queryPage(@Param("page") Page<SupTaskInspection> page, @Param(Constants.WRAPPER) QueryWrapper<SupTaskInspection> queryWrapper); |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
package com.biutag.supervision.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.biutag.supervision.pojo.entity.SupTask; |
||||||
|
|
||||||
|
public interface SupTaskMapper extends BaseMapper<SupTask> { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
package com.biutag.supervision.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.biutag.supervision.pojo.entity.SupTaskPerson; |
||||||
|
|
||||||
|
public interface SupTaskPersonMapper extends BaseMapper<SupTaskPerson> { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,15 @@ |
|||||||
|
package com.biutag.supervision.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.biutag.supervision.pojo.entity.SupTaskTestingAlcohol; |
||||||
|
import com.biutag.supervision.pojo.vo.TaskTestingAlcoholVo; |
||||||
|
import org.apache.ibatis.annotations.Param; |
||||||
|
|
||||||
|
public interface SupTaskTestingAlcoholMapper extends BaseMapper<SupTaskTestingAlcohol> { |
||||||
|
|
||||||
|
Page<TaskTestingAlcoholVo> queryPage(@Param("page") Page<SupTaskTestingAlcohol> page, @Param(Constants.WRAPPER) QueryWrapper<SupTaskTestingAlcohol> queryWrapper); |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,8 @@ |
|||||||
|
package com.biutag.supervision.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import com.biutag.supervision.pojo.entity.SupTaskTestingAlcoholPeople; |
||||||
|
|
||||||
|
public interface SupTaskTestingAlcoholPeopleMapper extends BaseMapper<SupTaskTestingAlcoholPeople> { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,110 @@ |
|||||||
|
package com.biutag.supervision.pojo.dto; |
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnore; |
||||||
|
import com.alibaba.excel.annotation.ExcelProperty; |
||||||
|
import com.biutag.supervision.pojo.dto.flow.VerifyData; |
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import jakarta.validation.constraints.NotBlank; |
||||||
|
import jakarta.validation.constraints.NotNull; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class NegativeImportAuditDto { |
||||||
|
|
||||||
|
@NotNull(message = "问题发现时间不能为空") |
||||||
|
@ExcelProperty("问题发现时间") |
||||||
|
private String discoveryTimeStr; |
||||||
|
|
||||||
|
// 问题发现时间
|
||||||
|
@ExcelIgnore |
||||||
|
private LocalDateTime discoveryTime; |
||||||
|
|
||||||
|
|
||||||
|
@ExcelProperty("问题发生时间") |
||||||
|
private String happenTimeStr; |
||||||
|
|
||||||
|
// 问题发生时间
|
||||||
|
@ExcelIgnore |
||||||
|
private LocalDateTime happenTime; |
||||||
|
|
||||||
|
// 问题来源
|
||||||
|
@ExcelProperty("问题来源") |
||||||
|
@NotBlank(message = "问题来源不能为空") |
||||||
|
private String problemSources; |
||||||
|
|
||||||
|
@ExcelIgnore |
||||||
|
private String problemSourcesCode; |
||||||
|
|
||||||
|
// 业务类别
|
||||||
|
@NotBlank(message = "业务类别不能为空") |
||||||
|
@ExcelProperty("业务类别") |
||||||
|
private String businessTypeName; |
||||||
|
|
||||||
|
@ExcelIgnore |
||||||
|
private String businessTypeCode; |
||||||
|
|
||||||
|
@ExcelProperty("涉及警种") |
||||||
|
private String policeTypeName; |
||||||
|
|
||||||
|
@ExcelIgnore |
||||||
|
private String policeType; |
||||||
|
|
||||||
|
// 问题种类
|
||||||
|
@ExcelProperty("问题种类") |
||||||
|
@NotBlank(message = "问题种类不能为空") |
||||||
|
private String problemsStr; |
||||||
|
|
||||||
|
@ExcelIgnore |
||||||
|
private List<VerifyData.Problem> problems; |
||||||
|
|
||||||
|
// 反映人姓名
|
||||||
|
@ExcelProperty("投诉人") |
||||||
|
private String responderName; |
||||||
|
|
||||||
|
// 联系电话
|
||||||
|
@ExcelProperty("投诉人联系电话") |
||||||
|
private String contactPhone; |
||||||
|
|
||||||
|
// 简要描述
|
||||||
|
@ExcelProperty("具体问题内容") |
||||||
|
@NotBlank(message = "具体问题内容不能为空") |
||||||
|
private String thingDesc; |
||||||
|
|
||||||
|
@ExcelProperty("涉及单位") |
||||||
|
private String involveDepartName; |
||||||
|
|
||||||
|
@ExcelIgnore |
||||||
|
private String involveDepartId; |
||||||
|
|
||||||
|
// 涉及案件/警情编号
|
||||||
|
@ExcelProperty("案件/警情编号") |
||||||
|
private String caseNumber; |
||||||
|
|
||||||
|
@ExcelIgnore |
||||||
|
private String SpecialSupervision; |
||||||
|
|
||||||
|
// 项目名称
|
||||||
|
@ExcelProperty("项目名称") |
||||||
|
private String projectName; |
||||||
|
|
||||||
|
// 案件名称
|
||||||
|
@ExcelProperty("案件名称") |
||||||
|
private String caseName; |
||||||
|
|
||||||
|
// 涉及问题金额
|
||||||
|
@ExcelProperty("问题金额(万元)") |
||||||
|
private String involveMoneyStr; |
||||||
|
|
||||||
|
@ExcelIgnore |
||||||
|
private Double involveMoney; |
||||||
|
|
||||||
|
@ExcelProperty("责任人员") |
||||||
|
private String blames; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,45 @@ |
|||||||
|
package com.biutag.supervision.pojo.dto; |
||||||
|
|
||||||
|
import com.biutag.supervision.pojo.vo.FileVo; |
||||||
|
import jakarta.validation.constraints.NotBlank; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2024/12/27 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class NegativeImportDistributeAuditDto { |
||||||
|
|
||||||
|
private List<NegativeImportAuditDto> data = new ArrayList<>(); |
||||||
|
|
||||||
|
private String taskName; |
||||||
|
|
||||||
|
// 办理时限
|
||||||
|
@NotBlank |
||||||
|
private String timeLimit; |
||||||
|
|
||||||
|
// 最大签收时长(天)
|
||||||
|
private Integer maxSignDuration; |
||||||
|
|
||||||
|
// 最大办理时长(天)
|
||||||
|
private Integer maxHandleDuration; |
||||||
|
|
||||||
|
// 最大延期时长(天)
|
||||||
|
private Integer maxExtensionDuration; |
||||||
|
|
||||||
|
// 审批流程
|
||||||
|
@NotBlank |
||||||
|
private String approvalFlow; |
||||||
|
|
||||||
|
// 下发流程
|
||||||
|
@NotBlank |
||||||
|
private String distributionFlow; |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,35 @@ |
|||||||
|
package com.biutag.supervision.pojo.dto; |
||||||
|
|
||||||
|
import com.biutag.supervision.pojo.entity.SupTaskPerson; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2025/3/31 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class TaskInspectionDto { |
||||||
|
|
||||||
|
private String taskName; |
||||||
|
|
||||||
|
// 督察单位
|
||||||
|
private Integer supDepartId; |
||||||
|
|
||||||
|
// 督察类型
|
||||||
|
private String supervisionType; |
||||||
|
|
||||||
|
// 督察内容
|
||||||
|
private String taskContent; |
||||||
|
|
||||||
|
private List<LocalDateTime> times = new ArrayList<>(); |
||||||
|
|
||||||
|
|
||||||
|
private List<SupTaskPerson> persons = new ArrayList<>(); |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,51 @@ |
|||||||
|
package com.biutag.supervision.pojo.dto; |
||||||
|
|
||||||
|
import com.biutag.supervision.pojo.entity.SupTaskTestingAlcoholPeople; |
||||||
|
import com.biutag.supervision.pojo.entity.SupTaskPerson; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
import java.util.ArrayList; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2025/3/31 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class TaskTestingAlcoholDto { |
||||||
|
|
||||||
|
private String taskName; |
||||||
|
|
||||||
|
// 督察单位
|
||||||
|
private Integer supDepartId; |
||||||
|
|
||||||
|
// 数据生成方式
|
||||||
|
private String dataGenerationMethod; |
||||||
|
|
||||||
|
// 被抽检次数少于
|
||||||
|
private Integer filterMinSupNumber; |
||||||
|
|
||||||
|
// 距最后一次检测时间(天)
|
||||||
|
private String filterLastDays; |
||||||
|
|
||||||
|
// 有无饮酒历史
|
||||||
|
private Boolean filterAlcoholHistory; |
||||||
|
|
||||||
|
// 筛选条件 抽检人数
|
||||||
|
private Integer filterPeopleNumber; |
||||||
|
|
||||||
|
|
||||||
|
private List<TestingAlcoholFilter> filterPeopleConditions = new ArrayList<>(); |
||||||
|
|
||||||
|
|
||||||
|
private List<LocalDateTime> times = new ArrayList<>(); |
||||||
|
|
||||||
|
|
||||||
|
private List<SupTaskPerson> persons = new ArrayList<>(); |
||||||
|
|
||||||
|
private List<SupTaskTestingAlcoholPeople> peoples = new ArrayList<>(); |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,37 @@ |
|||||||
|
package com.biutag.supervision.pojo.dto; |
||||||
|
|
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2025/4/2 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class TestingAlcoholFilter { |
||||||
|
|
||||||
|
// 被抽检次数少于
|
||||||
|
private Integer filterMinSupNumber; |
||||||
|
|
||||||
|
// 距最后一次检测时间(天)
|
||||||
|
private String filterLastDays; |
||||||
|
|
||||||
|
// 有无饮酒历史
|
||||||
|
private Boolean filterAlcoholHistory; |
||||||
|
|
||||||
|
// 筛选条件 抽检人数
|
||||||
|
private Integer filterPeopleNumber; |
||||||
|
|
||||||
|
// 单位
|
||||||
|
private String departId; |
||||||
|
|
||||||
|
private List<String> personType; |
||||||
|
|
||||||
|
private List<String> position; |
||||||
|
|
||||||
|
private Integer count; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,50 @@ |
|||||||
|
package com.biutag.supervision.pojo.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
|
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class SupTask { |
||||||
|
|
||||||
|
//
|
||||||
|
@TableId(type = IdType.AUTO) |
||||||
|
private Integer id; |
||||||
|
|
||||||
|
// 任务名称
|
||||||
|
@TableField("task_name") |
||||||
|
private String taskName; |
||||||
|
|
||||||
|
// 督察单位
|
||||||
|
@TableField("sup_depart_id") |
||||||
|
private Integer supDepartId; |
||||||
|
|
||||||
|
// 督察单位
|
||||||
|
@TableField("sup_depart_name") |
||||||
|
private String supDepartName; |
||||||
|
|
||||||
|
// 任务类型
|
||||||
|
@TableField("task_type") |
||||||
|
private String taskType; |
||||||
|
|
||||||
|
// 开始时间
|
||||||
|
@TableField("begin_time") |
||||||
|
private LocalDateTime beginTime; |
||||||
|
|
||||||
|
// 结束时间
|
||||||
|
@TableField("end_time") |
||||||
|
private LocalDateTime endTime; |
||||||
|
|
||||||
|
// 创建时间
|
||||||
|
@TableField("create_time") |
||||||
|
private LocalDateTime createTime; |
||||||
|
|
||||||
|
// 任务状态
|
||||||
|
private String taskStatus; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,24 @@ |
|||||||
|
package com.biutag.supervision.pojo.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class SupTaskInspection { |
||||||
|
|
||||||
|
//
|
||||||
|
@TableId(value = "task_id") |
||||||
|
private Integer taskId; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("supervision_type") |
||||||
|
private String supervisionType; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("task_content") |
||||||
|
private String taskContent; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,39 @@ |
|||||||
|
package com.biutag.supervision.pojo.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
|
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class SupTaskPerson { |
||||||
|
|
||||||
|
//
|
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Integer id; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("task_id") |
||||||
|
private Integer taskId; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("name") |
||||||
|
private String name; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("emp_no") |
||||||
|
private Integer empNo; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("id_code") |
||||||
|
private String idCode; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("create_time") |
||||||
|
private LocalDateTime createTime; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,39 @@ |
|||||||
|
package com.biutag.supervision.pojo.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class SupTaskTestingAlcohol { |
||||||
|
|
||||||
|
@TableId(value = "task_id") |
||||||
|
private Integer taskId; |
||||||
|
|
||||||
|
// 数据生成方式
|
||||||
|
@TableField("data_generation_method") |
||||||
|
private String dataGenerationMethod; |
||||||
|
|
||||||
|
// 被抽检次数少于
|
||||||
|
@TableField("filter_min_sup_number") |
||||||
|
private Integer filterMinSupNumber; |
||||||
|
|
||||||
|
// 距最后一次检测时间(天)
|
||||||
|
@TableField("filter_last_days") |
||||||
|
private String filterLastDays; |
||||||
|
|
||||||
|
// 有无饮酒历史
|
||||||
|
@TableField("filter_alcohol_history") |
||||||
|
private Boolean filterAlcoholHistory; |
||||||
|
|
||||||
|
// 筛选条件 抽检人数
|
||||||
|
@TableField("filter_people_number") |
||||||
|
private Integer filterPeopleNumber; |
||||||
|
|
||||||
|
// 抽检对象
|
||||||
|
@TableField("filter_object") |
||||||
|
private String filterObject; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,46 @@ |
|||||||
|
package com.biutag.supervision.pojo.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||||
|
import com.baomidou.mybatisplus.annotation.TableId; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
|
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class SupTaskTestingAlcoholPeople { |
||||||
|
|
||||||
|
//
|
||||||
|
@TableId(value = "id", type = IdType.AUTO) |
||||||
|
private Integer id; |
||||||
|
|
||||||
|
//
|
||||||
|
@TableField("task_id") |
||||||
|
private Integer taskId; |
||||||
|
|
||||||
|
// 姓名
|
||||||
|
@TableField("name") |
||||||
|
private String name; |
||||||
|
|
||||||
|
// 警号
|
||||||
|
@TableField("emp_no") |
||||||
|
private String empNo; |
||||||
|
|
||||||
|
// 身份证
|
||||||
|
@TableField("id_code") |
||||||
|
private String idCode; |
||||||
|
|
||||||
|
// 单位ID
|
||||||
|
@TableField("depart_id") |
||||||
|
private String departId; |
||||||
|
|
||||||
|
// 状态
|
||||||
|
@TableField("status") |
||||||
|
private String status; |
||||||
|
|
||||||
|
// 测酒时间
|
||||||
|
private LocalDateTime testingTime; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,18 @@ |
|||||||
|
package com.biutag.supervision.pojo.param; |
||||||
|
|
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2025/4/7 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class TaskInspectionQueryParam extends BasePage { |
||||||
|
|
||||||
|
private String taskName; |
||||||
|
|
||||||
|
private String supDepartId; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,18 @@ |
|||||||
|
package com.biutag.supervision.pojo.param; |
||||||
|
|
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2025/4/7 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class TaskTestingAlcoholQueryParam extends BasePage { |
||||||
|
|
||||||
|
private String taskName; |
||||||
|
|
||||||
|
private String supDepartId; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,48 @@ |
|||||||
|
package com.biutag.supervision.pojo.vo; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2025/3/31 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class TaskInspectionVo { |
||||||
|
|
||||||
|
private Integer id; |
||||||
|
|
||||||
|
// 任务名称
|
||||||
|
private String taskName; |
||||||
|
|
||||||
|
// 督察单位
|
||||||
|
private String supDepartName; |
||||||
|
|
||||||
|
// 开始时间
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
||||||
|
private LocalDateTime beginTime; |
||||||
|
|
||||||
|
// 结束时间
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
||||||
|
private LocalDateTime endTime; |
||||||
|
|
||||||
|
private String supervisionType; |
||||||
|
|
||||||
|
private String taskContent; |
||||||
|
|
||||||
|
// 检测人员
|
||||||
|
private String persons; |
||||||
|
|
||||||
|
private Integer totalNumber; |
||||||
|
|
||||||
|
private Integer notDetectedNumber; |
||||||
|
|
||||||
|
private Integer notDrinkingNumber; |
||||||
|
|
||||||
|
private Integer drinkNumber; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,44 @@ |
|||||||
|
package com.biutag.supervision.pojo.vo; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||||
|
import lombok.Getter; |
||||||
|
import lombok.Setter; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
|
||||||
|
/** |
||||||
|
* @author wxc |
||||||
|
* @date 2025/3/31 |
||||||
|
*/ |
||||||
|
@Setter |
||||||
|
@Getter |
||||||
|
public class TaskTestingAlcoholVo { |
||||||
|
|
||||||
|
private Integer id; |
||||||
|
|
||||||
|
// 任务名称
|
||||||
|
private String taskName; |
||||||
|
|
||||||
|
// 督察单位
|
||||||
|
private String supDepartName; |
||||||
|
|
||||||
|
// 开始时间
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
||||||
|
private LocalDateTime beginTime; |
||||||
|
|
||||||
|
// 结束时间
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm") |
||||||
|
private LocalDateTime endTime; |
||||||
|
|
||||||
|
// 检测人员
|
||||||
|
private String persons; |
||||||
|
|
||||||
|
private Integer totalNumber; |
||||||
|
|
||||||
|
private Integer notDetectedNumber; |
||||||
|
|
||||||
|
private Integer notDrinkingNumber; |
||||||
|
|
||||||
|
private Integer drinkNumber; |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,64 @@ |
|||||||
|
package com.biutag.supervision.service; |
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import com.biutag.supervision.constants.enums.TaskStatusEnum; |
||||||
|
import com.biutag.supervision.constants.enums.TaskTypeEnum; |
||||||
|
import com.biutag.supervision.mapper.SupTaskInspectionMapper; |
||||||
|
import com.biutag.supervision.pojo.dto.TaskInspectionDto; |
||||||
|
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.param.TaskInspectionQueryParam; |
||||||
|
import com.biutag.supervision.pojo.vo.TaskInspectionVo; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.beans.BeanUtils; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
import org.springframework.transaction.annotation.Transactional; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
|
||||||
|
@RequiredArgsConstructor |
||||||
|
@Service |
||||||
|
public class SupTaskInspectionService extends ServiceImpl<SupTaskInspectionMapper, SupTaskInspection> { |
||||||
|
|
||||||
|
private final SupDepartService departService; |
||||||
|
|
||||||
|
private final SupTaskService taskService; |
||||||
|
|
||||||
|
private final SupTaskPersonService taskPersonService; |
||||||
|
|
||||||
|
public Page<TaskInspectionVo> page(TaskInspectionQueryParam queryParam) { |
||||||
|
QueryWrapper<SupTaskInspection> queryWrapper = new QueryWrapper<>(); |
||||||
|
queryWrapper.eq("t.task_type", TaskTypeEnum.inspection.name()) |
||||||
|
.like(StrUtil.isNotBlank(queryParam.getTaskName()), "t.task_name", queryParam.getTaskName()) |
||||||
|
.eq(StrUtil.isNotBlank(queryParam.getSupDepartId()), "t.sup_depart_id", queryParam.getSupDepartId()); |
||||||
|
return baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); |
||||||
|
} |
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class) |
||||||
|
public boolean save(TaskInspectionDto dto) { |
||||||
|
SupTask task = new SupTask(); |
||||||
|
BeanUtils.copyProperties(dto, task); |
||||||
|
task.setCreateTime(LocalDateTime.now()); |
||||||
|
task.setTaskType(TaskTypeEnum.inspection.name()); |
||||||
|
task.setTaskStatus(TaskStatusEnum.todo.name()); |
||||||
|
SupDepart depart = departService.getById(dto.getSupDepartId()); |
||||||
|
task.setSupDepartName(depart.getShortName()); |
||||||
|
task.setBeginTime(dto.getTimes().get(0)); |
||||||
|
task.setEndTime(dto.getTimes().get(1)); |
||||||
|
taskService.save(task); |
||||||
|
SupTaskInspection testingAlcohol = new SupTaskInspection(); |
||||||
|
BeanUtils.copyProperties(dto, testingAlcohol); |
||||||
|
testingAlcohol.setTaskId(task.getId()); |
||||||
|
save(testingAlcohol); |
||||||
|
dto.getPersons().forEach(item -> { |
||||||
|
item.setTaskId(task.getId()); |
||||||
|
}); |
||||||
|
taskPersonService.saveBatch(dto.getPersons()); |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,11 @@ |
|||||||
|
package com.biutag.supervision.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import com.biutag.supervision.pojo.entity.SupTaskPerson; |
||||||
|
import com.biutag.supervision.mapper.SupTaskPersonMapper; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
@Service |
||||||
|
public class SupTaskPersonService extends ServiceImpl<SupTaskPersonMapper, SupTaskPerson> { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,11 @@ |
|||||||
|
package com.biutag.supervision.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import com.biutag.supervision.pojo.entity.SupTask; |
||||||
|
import com.biutag.supervision.mapper.SupTaskMapper; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
@Service |
||||||
|
public class SupTaskService extends ServiceImpl<SupTaskMapper, SupTask> { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,11 @@ |
|||||||
|
package com.biutag.supervision.service; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import com.biutag.supervision.pojo.entity.SupTaskTestingAlcoholPeople; |
||||||
|
import com.biutag.supervision.mapper.SupTaskTestingAlcoholPeopleMapper; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
@Service |
||||||
|
public class SupTaskTestingAlcoholPeopleService extends ServiceImpl<SupTaskTestingAlcoholPeopleMapper, SupTaskTestingAlcoholPeople> { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,72 @@ |
|||||||
|
package com.biutag.supervision.service; |
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil; |
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||||
|
import com.biutag.supervision.constants.enums.TaskStatusEnum; |
||||||
|
import com.biutag.supervision.constants.enums.TaskTypeEnum; |
||||||
|
import com.biutag.supervision.constants.enums.TestingAlcoholStateEnum; |
||||||
|
import com.biutag.supervision.mapper.SupTaskTestingAlcoholMapper; |
||||||
|
import com.biutag.supervision.pojo.dto.TaskTestingAlcoholDto; |
||||||
|
import com.biutag.supervision.pojo.entity.SupDepart; |
||||||
|
import com.biutag.supervision.pojo.entity.SupTask; |
||||||
|
import com.biutag.supervision.pojo.entity.SupTaskTestingAlcohol; |
||||||
|
import com.biutag.supervision.pojo.param.TaskTestingAlcoholQueryParam; |
||||||
|
import com.biutag.supervision.pojo.vo.TaskTestingAlcoholVo; |
||||||
|
import lombok.RequiredArgsConstructor; |
||||||
|
import org.springframework.beans.BeanUtils; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
import org.springframework.transaction.annotation.Transactional; |
||||||
|
|
||||||
|
import java.time.LocalDateTime; |
||||||
|
|
||||||
|
@RequiredArgsConstructor |
||||||
|
@Service |
||||||
|
public class SupTaskTestingAlcoholService extends ServiceImpl<SupTaskTestingAlcoholMapper, SupTaskTestingAlcohol> { |
||||||
|
|
||||||
|
private final SupTaskService taskService; |
||||||
|
|
||||||
|
private final SupTaskPersonService taskPersonService; |
||||||
|
|
||||||
|
private final SupTaskTestingAlcoholPeopleService testingAlcoholPeopleService; |
||||||
|
|
||||||
|
private final SupDepartService departService; |
||||||
|
|
||||||
|
public Page<TaskTestingAlcoholVo> page(TaskTestingAlcoholQueryParam queryParam) { |
||||||
|
QueryWrapper<SupTaskTestingAlcohol> queryWrapper = new QueryWrapper<>(); |
||||||
|
queryWrapper.eq("t.task_type", TaskTypeEnum.testing_alcohol.name()) |
||||||
|
.like(StrUtil.isNotBlank(queryParam.getTaskName()), "t.task_name", queryParam.getTaskName()) |
||||||
|
.eq(StrUtil.isNotBlank(queryParam.getSupDepartId()), "t.sup_depart_id", queryParam.getSupDepartId()); |
||||||
|
return baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); |
||||||
|
} |
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class) |
||||||
|
public boolean save(TaskTestingAlcoholDto dto) { |
||||||
|
SupTask task = new SupTask(); |
||||||
|
BeanUtils.copyProperties(dto, task); |
||||||
|
task.setCreateTime(LocalDateTime.now()); |
||||||
|
task.setTaskType(TaskTypeEnum.testing_alcohol.name()); |
||||||
|
task.setTaskStatus(TaskStatusEnum.todo.name()); |
||||||
|
SupDepart depart = departService.getById(dto.getSupDepartId()); |
||||||
|
task.setSupDepartName(depart.getShortName()); |
||||||
|
task.setBeginTime(dto.getTimes().get(0)); |
||||||
|
task.setEndTime(dto.getTimes().get(1)); |
||||||
|
taskService.save(task); |
||||||
|
SupTaskTestingAlcohol testingAlcohol = new SupTaskTestingAlcohol(); |
||||||
|
BeanUtils.copyProperties(dto, testingAlcohol); |
||||||
|
testingAlcohol.setTaskId(task.getId()); |
||||||
|
save(testingAlcohol); |
||||||
|
dto.getPersons().forEach(item -> { |
||||||
|
item.setTaskId(task.getId()); |
||||||
|
}); |
||||||
|
taskPersonService.saveBatch(dto.getPersons()); |
||||||
|
dto.getPeoples().forEach(item -> { |
||||||
|
item.setTaskId(task.getId()); |
||||||
|
item.setStatus(TestingAlcoholStateEnum.not_detected.name()); |
||||||
|
}); |
||||||
|
testingAlcoholPeopleService.saveBatch(dto.getPeoples()); |
||||||
|
return true; |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,34 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||||
|
<!DOCTYPE mapper |
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.biutag.supervision.mapper.SupTaskInspectionMapper"> |
||||||
|
|
||||||
|
<select id="queryPage" resultType="com.biutag.supervision.pojo.vo.TaskInspectionVo"> |
||||||
|
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, |
||||||
|
i.supervision_type, |
||||||
|
i.task_content |
||||||
|
FROM |
||||||
|
sup_task t |
||||||
|
LEFT JOIN sup_task_inspection i ON t.id = i.task_id |
||||||
|
LEFT JOIN sup_task_person per ON t.id = per.task_id |
||||||
|
${ew.getCustomSqlSegment} |
||||||
|
GROUP BY |
||||||
|
t.id, |
||||||
|
t.task_name, |
||||||
|
t.sup_depart_name, |
||||||
|
t.begin_time, |
||||||
|
t.end_time, |
||||||
|
t.task_status |
||||||
|
|
||||||
|
</select> |
||||||
|
|
||||||
|
|
||||||
|
</mapper> |
||||||
@ -0,0 +1,50 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?> |
||||||
|
<!DOCTYPE mapper |
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||||
|
<mapper namespace="com.biutag.supervision.mapper.SupTaskTestingAlcoholMapper"> |
||||||
|
|
||||||
|
<select id="queryPage" 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 `status` = 'not_detected' THEN 1 ELSE 0 END ) not_detected_number, |
||||||
|
SUM( CASE WHEN `status` = 'not_drinking' THEN 1 ELSE 0 END ) not_drinking_number, |
||||||
|
SUM( CASE WHEN `status` = 'drink' THEN 1 ELSE 0 END ) drink_number |
||||||
|
FROM |
||||||
|
sup_task_testing_alcohol_people |
||||||
|
GROUP BY |
||||||
|
task_id) p ON t.id = p.task_id |
||||||
|
${ew.getCustomSqlSegment} |
||||||
|
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> |
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue