|
|
|
@ -7,17 +7,31 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.biutag.supervision.constants.enums.TaskStatusEnum; |
|
|
|
import com.biutag.supervision.constants.enums.TaskStatusEnum; |
|
|
|
import com.biutag.supervision.mapper.SupTaskTestingAlcoholPeopleMapper; |
|
|
|
import com.biutag.supervision.mapper.SupTaskTestingAlcoholPeopleMapper; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.dto.TaskProblemDto; |
|
|
|
import com.biutag.supervision.pojo.dto.TaskTestingAlcoholPeopleDto; |
|
|
|
import com.biutag.supervision.pojo.dto.TaskTestingAlcoholPeopleDto; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.entity.SupDepart; |
|
|
|
|
|
|
|
import com.biutag.supervision.pojo.entity.SupPolice; |
|
|
|
import com.biutag.supervision.pojo.entity.SupTaskTestingAlcoholPeople; |
|
|
|
import com.biutag.supervision.pojo.entity.SupTaskTestingAlcoholPeople; |
|
|
|
import com.biutag.supervision.pojo.param.TaskTestingAlcoholPeopleQueryParam; |
|
|
|
import com.biutag.supervision.pojo.param.TaskTestingAlcoholPeopleQueryParam; |
|
|
|
import com.biutag.supervision.pojo.vo.FileVo; |
|
|
|
import com.biutag.supervision.pojo.vo.FileVo; |
|
|
|
import com.biutag.supervision.pojo.vo.TaskTestingAlcoholPeopleVo; |
|
|
|
import com.biutag.supervision.pojo.vo.TaskTestingAlcoholPeopleVo; |
|
|
|
import com.biutag.supervision.util.JSON; |
|
|
|
import com.biutag.supervision.util.JSON; |
|
|
|
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Objects; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@RequiredArgsConstructor |
|
|
|
@Service |
|
|
|
@Service |
|
|
|
public class SupTaskTestingAlcoholPeopleService extends ServiceImpl<SupTaskTestingAlcoholPeopleMapper, SupTaskTestingAlcoholPeople> { |
|
|
|
public class SupTaskTestingAlcoholPeopleService extends ServiceImpl<SupTaskTestingAlcoholPeopleMapper, SupTaskTestingAlcoholPeople> { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final SupTaskProblemService taskProblemService; |
|
|
|
|
|
|
|
private final SupPoliceService policeService; |
|
|
|
|
|
|
|
private final SupDepartService departService; |
|
|
|
|
|
|
|
|
|
|
|
public Page<TaskTestingAlcoholPeopleVo> page(String taskId, TaskTestingAlcoholPeopleQueryParam queryParam) { |
|
|
|
public Page<TaskTestingAlcoholPeopleVo> page(String taskId, TaskTestingAlcoholPeopleQueryParam queryParam) { |
|
|
|
QueryWrapper<SupTaskTestingAlcoholPeople> queryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<SupTaskTestingAlcoholPeople> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.eq("peo.task_id", taskId) |
|
|
|
queryWrapper.eq("peo.task_id", taskId) |
|
|
|
@ -26,11 +40,12 @@ public class SupTaskTestingAlcoholPeopleService extends ServiceImpl<SupTaskTesti |
|
|
|
.like(StrUtil.isNotBlank(queryParam.getEmpNo()), "peo.emp_no", queryParam.getEmpNo()) |
|
|
|
.like(StrUtil.isNotBlank(queryParam.getEmpNo()), "peo.emp_no", queryParam.getEmpNo()) |
|
|
|
.eq(StrUtil.isNotBlank(queryParam.getTestingResult()), "peo.testing_result", queryParam.getTestingResult()) |
|
|
|
.eq(StrUtil.isNotBlank(queryParam.getTestingResult()), "peo.testing_result", queryParam.getTestingResult()) |
|
|
|
.eq(StrUtil.isNotBlank(queryParam.getDrinkResult()), "peo.drink_result", queryParam.getDrinkResult()) |
|
|
|
.eq(StrUtil.isNotBlank(queryParam.getDrinkResult()), "peo.drink_result", queryParam.getDrinkResult()) |
|
|
|
|
|
|
|
.eq(StrUtil.isNotBlank(queryParam.getIsIllegalBanquet()), "peo.is_illegal_banquet", queryParam.getIsIllegalBanquet()) |
|
|
|
.eq(StrUtil.isNotBlank(queryParam.getPosition()), "p.position", queryParam.getPosition()) |
|
|
|
.eq(StrUtil.isNotBlank(queryParam.getPosition()), "p.position", queryParam.getPosition()) |
|
|
|
.and(StrUtil.isNotBlank(queryParam.getQueryTxt()), q -> { |
|
|
|
.and(StrUtil.isNotBlank(queryParam.getQueryTxt()), q -> { |
|
|
|
q.like("peo.name", queryParam.getQueryTxt()).or().like("peo.emp_no", queryParam.getQueryTxt()); |
|
|
|
q.like("peo.name", queryParam.getQueryTxt()).or().like("peo.emp_no", queryParam.getQueryTxt()); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.orderByAsc("peo.testing_result"); |
|
|
|
.orderByDesc("peo.testing_time"); |
|
|
|
Page<TaskTestingAlcoholPeopleVo> page = baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); |
|
|
|
Page<TaskTestingAlcoholPeopleVo> page = baseMapper.queryPage(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper); |
|
|
|
page.getRecords().forEach(item -> { |
|
|
|
page.getRecords().forEach(item -> { |
|
|
|
if (StrUtil.isNotBlank(item.getTestingFiles())) { |
|
|
|
if (StrUtil.isNotBlank(item.getTestingFiles())) { |
|
|
|
@ -55,9 +70,69 @@ public class SupTaskTestingAlcoholPeopleService extends ServiceImpl<SupTaskTesti |
|
|
|
updateWrapper.set(SupTaskTestingAlcoholPeople::getAlcoholContent, dto.getAlcoholContent()); |
|
|
|
updateWrapper.set(SupTaskTestingAlcoholPeople::getAlcoholContent, dto.getAlcoholContent()); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
updateWrapper.set(SupTaskTestingAlcoholPeople::getUnTestingDesc, "其他".equals(dto.getUnTestingDesc()) ? dto.getUnTestingDescOther() : dto.getUnTestingDesc()); |
|
|
|
String unTestingDesc = "其他".equals(dto.getUnTestingDesc()) ? dto.getUnTestingDescOther() : dto.getUnTestingDesc(); |
|
|
|
|
|
|
|
updateWrapper.set(SupTaskTestingAlcoholPeople::getUnTestingDesc, unTestingDesc); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
saveProblem(dto); |
|
|
|
return update(updateWrapper); |
|
|
|
return update(updateWrapper); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Async |
|
|
|
|
|
|
|
public void saveProblem(TaskTestingAlcoholPeopleDto dto) { |
|
|
|
|
|
|
|
if ("已检测".equals(dto.getTestingResult())) { |
|
|
|
|
|
|
|
if ("饮酒".equals(dto.getDrinkResult()) || "是".equals(dto.getIsIllegalBanquet())) { |
|
|
|
|
|
|
|
SupPolice police = policeService.getByEmpNo(dto.getEmpNo()); |
|
|
|
|
|
|
|
SupDepart depart = departService.getById(police.getOrgId()); |
|
|
|
|
|
|
|
TaskProblemDto problemDto = new TaskProblemDto(); |
|
|
|
|
|
|
|
TaskProblemDto.People people = new TaskProblemDto.People(); |
|
|
|
|
|
|
|
people.setName(police.getName()); |
|
|
|
|
|
|
|
people.setEmpNo(police.getEmpNo()); |
|
|
|
|
|
|
|
people.setIdCode(police.getIdCode()); |
|
|
|
|
|
|
|
problemDto.setHasProblem(true); |
|
|
|
|
|
|
|
problemDto.setDepartId(police.getOrgId()); |
|
|
|
|
|
|
|
problemDto.setPeoples(List.of(people)); |
|
|
|
|
|
|
|
problemDto.setTaskId(dto.getTaskId()); |
|
|
|
|
|
|
|
problemDto.setFiles(dto.getTestingFiles()); |
|
|
|
|
|
|
|
// XX年X月X日X时X分,在“公安部六项规定”督察中,发现“XX”单位的“X”存在“违规宴请”的问题情况,请立即组织核实其当时情况。
|
|
|
|
|
|
|
|
// XX年X月X日X时X分,在“公安部六项规定”督察中,发现“X”单位的“XX”存在“饮酒”的问题情况,请立即组织核实其当时情况.
|
|
|
|
|
|
|
|
String thingDesc = String.format("%s,在“公安部六项规定”督察中,", dto.getTestingTime().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日HH时mm分"))); |
|
|
|
|
|
|
|
if ("饮酒".equals(dto.getDrinkResult())) { |
|
|
|
|
|
|
|
thingDesc += String.format("发现“%s”单位的“%s”存在“饮酒”%s的问题情况,", |
|
|
|
|
|
|
|
depart.getName(), |
|
|
|
|
|
|
|
police.getName(), |
|
|
|
|
|
|
|
Objects.nonNull(dto.getAlcoholContent()) ? String.format("%s(mg/100ml)", dto.getAlcoholContent()) : ""); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if ("是".equals(dto.getIsIllegalBanquet())) { |
|
|
|
|
|
|
|
thingDesc += String.format("发现“%s”单位的“%s”存在“违规宴请”的问题情况,", |
|
|
|
|
|
|
|
depart.getName(), |
|
|
|
|
|
|
|
police.getName()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
thingDesc += "请立即组织核实其当时情况。"; |
|
|
|
|
|
|
|
problemDto.setThingDesc(thingDesc); |
|
|
|
|
|
|
|
taskProblemService.save(problemDto); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
String unTestingDesc = "其他".equals(dto.getUnTestingDesc()) ? dto.getUnTestingDescOther() : dto.getUnTestingDesc(); |
|
|
|
|
|
|
|
if (!"请假".equals(unTestingDesc)) { |
|
|
|
|
|
|
|
SupPolice police = policeService.getByEmpNo(dto.getEmpNo()); |
|
|
|
|
|
|
|
SupDepart depart = departService.getById(police.getOrgId()); |
|
|
|
|
|
|
|
TaskProblemDto problemDto = new TaskProblemDto(); |
|
|
|
|
|
|
|
TaskProblemDto.People people = new TaskProblemDto.People(); |
|
|
|
|
|
|
|
people.setName(police.getName()); |
|
|
|
|
|
|
|
people.setEmpNo(police.getEmpNo()); |
|
|
|
|
|
|
|
people.setIdCode(police.getIdCode()); |
|
|
|
|
|
|
|
problemDto.setHasProblem(true); |
|
|
|
|
|
|
|
problemDto.setDepartId(police.getOrgId()); |
|
|
|
|
|
|
|
problemDto.setPeoples(List.of(people)); |
|
|
|
|
|
|
|
problemDto.setTaskId(dto.getTaskId()); |
|
|
|
|
|
|
|
// X年X月X日X时X分,在“公安部六项规定”督察中,发现“XX”单位的“XX”存在“联系不上”的问题情况,未参加监测,请立即组织核实其当时情况。
|
|
|
|
|
|
|
|
problemDto.setThingDesc(String.format("%s,在“公安部六项规定”督察中,发现“%s”单位的“%s”存在“%s”的问题情况,未参加监测,请立即组织核实其当时情况。", |
|
|
|
|
|
|
|
dto.getTestingTime().format(DateTimeFormatter.ofPattern("yyyy年MM月dd日HH时mm分")), |
|
|
|
|
|
|
|
depart.getName(), |
|
|
|
|
|
|
|
police.getName(), |
|
|
|
|
|
|
|
unTestingDesc)); |
|
|
|
|
|
|
|
taskProblemService.save(problemDto); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|