diff --git a/src/main/java/com/biutag/supervision/pojo/dto/TemperancePoliceDto.java b/src/main/java/com/biutag/supervision/pojo/dto/TemperancePoliceDto.java index bd5812b..8006e00 100644 --- a/src/main/java/com/biutag/supervision/pojo/dto/TemperancePoliceDto.java +++ b/src/main/java/com/biutag/supervision/pojo/dto/TemperancePoliceDto.java @@ -15,4 +15,7 @@ public class TemperancePoliceDto { @ExcelProperty({"身份证"}) private String idCode; + + @ExcelProperty({"单位"}) + private String departName; } diff --git a/src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholPeople.java b/src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholPeople.java index b5d701e..090ff0e 100644 --- a/src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholPeople.java +++ b/src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholPeople.java @@ -37,6 +37,9 @@ public class SupTaskTestingAlcoholPeople { // 单位ID @TableField("depart_id") private String departId; + //单位名称 + @TableField(exist = false) + private String departName; // 状态 private String status; diff --git a/src/main/java/com/biutag/supervision/pojo/vo/TemperancePoliceVo.java b/src/main/java/com/biutag/supervision/pojo/vo/TemperancePoliceVo.java index c4e9487..50f7180f 100644 --- a/src/main/java/com/biutag/supervision/pojo/vo/TemperancePoliceVo.java +++ b/src/main/java/com/biutag/supervision/pojo/vo/TemperancePoliceVo.java @@ -15,4 +15,6 @@ public class TemperancePoliceVo { private String empName; private String idCode; + + private String departName; } diff --git a/src/main/java/com/biutag/supervision/service/TaskManagementService.java b/src/main/java/com/biutag/supervision/service/TaskManagementService.java index ec75c81..e9b363d 100644 --- a/src/main/java/com/biutag/supervision/service/TaskManagementService.java +++ b/src/main/java/com/biutag/supervision/service/TaskManagementService.java @@ -13,6 +13,7 @@ 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 com.biutag.supervision.pojo.vo.TemperancePoliceVo; import com.biutag.supervision.util.CommonUtil; import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; @@ -73,8 +74,20 @@ public class TaskManagementService { if("所队自查".equals(dto.getSpecialType())){ task.setTaskType("selfexamination"); } - if("禁酒督察".equals(dto.getSpecialType())){ + if("禁酒督察".equals(dto.getSpecialType())) { task.setTaskType("testing_alcohol"); + if (CollectionUtil.isNotEmpty(dto.getUserList())) { + Set departIds = dto.getUserList().stream().map(SupTaskTestingAlcoholPeople::getDepartId).collect(Collectors.toSet()); + List departs = departService.listByIds(departIds); + task.setSupDepartName(departs.stream().map(SupDepart::getShortName).collect(Collectors.joining("、"))); + } + if(CollectionUtil.isNotEmpty(dto.getUserList())){ + Set departList = dto.getUserList().stream().map(SupTaskTestingAlcoholPeople::getDepartName).collect(Collectors.toSet()); + if(CollectionUtil.isNotEmpty(departList)){ + task.setSupDepartName(departList.stream().collect(Collectors.joining("、"))); + } + } + } if("重点人员管控".equals(dto.getSpecialType())){ task.setTaskType("risk_personal"); @@ -135,7 +148,6 @@ public class TaskManagementService { }); alcoholSamplingService.saveBatch(samplings); } - dto.getPersons().forEach(item -> { item.setTaskId(task.getId()); }); diff --git a/src/main/resources/static/templates/测酒任务被测人员模板.xlsx b/src/main/resources/static/templates/测酒任务被测人员模板.xlsx index 3e50cc3..4da9595 100644 Binary files a/src/main/resources/static/templates/测酒任务被测人员模板.xlsx and b/src/main/resources/static/templates/测酒任务被测人员模板.xlsx differ