Browse Source

fit:测酒督察(督察单位)

master
pengwei 5 months ago
parent
commit
c927acf7fb
  1. 3
      src/main/java/com/biutag/supervision/pojo/dto/TemperancePoliceDto.java
  2. 3
      src/main/java/com/biutag/supervision/pojo/entity/SupTaskTestingAlcoholPeople.java
  3. 2
      src/main/java/com/biutag/supervision/pojo/vo/TemperancePoliceVo.java
  4. 16
      src/main/java/com/biutag/supervision/service/TaskManagementService.java
  5. BIN
      src/main/resources/static/templates/测酒任务被测人员模板.xlsx

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

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

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

16
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<String> departIds = dto.getUserList().stream().map(SupTaskTestingAlcoholPeople::getDepartId).collect(Collectors.toSet());
List<SupDepart> departs = departService.listByIds(departIds);
task.setSupDepartName(departs.stream().map(SupDepart::getShortName).collect(Collectors.joining("、")));
}
if(CollectionUtil.isNotEmpty(dto.getUserList())){
Set<String> 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());
});

BIN
src/main/resources/static/templates/测酒任务被测人员模板.xlsx

Binary file not shown.
Loading…
Cancel
Save