Browse Source

fit: 移动督察APP 新增问题处置

fit: 线索数据-国家信访、公安部信访 问题下发新增下发流程、指定办理单位字段
master
wxc 9 months ago
parent
commit
877741d32f
  1. 4
      src/main/java/com/biutag/supervision/controller/work/NegativeController.java
  2. 3
      src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java
  3. 12
      src/main/java/com/biutag/supervision/flow/action/SecondDistributeAction.java
  4. 9
      src/main/java/com/biutag/supervision/mapper/SupTaskMapper.java
  5. 5
      src/main/java/com/biutag/supervision/pojo/dto/DataDataPetitionComplainDistribute.java
  6. 10
      src/main/java/com/biutag/supervision/pojo/vo/TaskVo.java
  7. 32
      src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java
  8. 2
      src/main/java/com/biutag/supervision/service/NegativeService.java
  9. 44
      src/main/java/com/biutag/supervision/service/SupTaskService.java
  10. 64
      src/main/resources/mapper/SupTaskMapper.xml

4
src/main/java/com/biutag/supervision/controller/work/NegativeController.java

@ -132,7 +132,9 @@ public class NegativeController {
.set(Negative::getSpecialSupervision, negativeDto.getSpecialSupervision())
.set(Negative::getReportNumber, negativeDto.getReportNumber())
.set(Negative::getInvolveDepartId, negativeDto.getInvolveDepartId())
.set(Negative::getInvolveDepartName, negativeDto.getInvolveDepartName())
.set(Negative::getInvolveDepartName, depart.getShortName())
// 涉嫌问题
.set(Negative::getInvolveProblem, CollectionUtil.isNotEmpty(negativeDto.getInvolveProblem()) ? String.join(",", negativeDto.getInvolveProblem()) : null)
.set(Negative::getUpdUser, UserContextHolder.getCurrentUser().getNickName())
.set(Negative::getUpdTime, LocalDateTime.now());
if (CollectionUtil.isNotEmpty(negativeDto.getInvolveProblem())) {

3
src/main/java/com/biutag/supervision/flow/action/FirstDistributeAction.java

@ -1,6 +1,7 @@
package com.biutag.supervision.flow.action;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.constants.enums.*;
@ -66,11 +67,13 @@ public class FirstDistributeAction implements Action {
.set(Negative::getMaxHandleDuration, distributeData.getMaxHandleDuration())
.set(Negative::getMaxExtensionDuration, distributeData.getMaxExtensionDuration());
} else {
if (StrUtil.isNotBlank(distributeData.getTimeLimit())) {
TimeLimitEnum timeLimitEnum = TimeLimitEnum.get(distributeData.getTimeLimit());
updateWrapper.set(Negative::getMaxSignDuration, timeLimitEnum.getMaxSignDuration())
.set(Negative::getMaxHandleDuration, timeLimitEnum.getMaxHandleDuration())
.set(Negative::getMaxExtensionDuration, timeLimitEnum.getMaxExtensionDuration());
}
}
if (thirdHandling) {
SupDepart parentDepart = departService.getParentDepart(distributeData.getDepartId());
updateWrapper.set(Negative::getFlowKey, FlowNodeEnum.THREE_SIGN.getKey())

12
src/main/java/com/biutag/supervision/flow/action/SecondDistributeAction.java

@ -6,12 +6,13 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.biutag.supervision.constants.enums.RoleCodeEnum;
import com.biutag.supervision.constants.enums.WorkStatusEnum;
import com.biutag.supervision.pojo.dto.ActionDto;
import com.biutag.supervision.pojo.dto.flow.FirstDistributeData;
import com.biutag.supervision.pojo.dto.flow.SecondDistributeData;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeWork;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.service.NegativeService;
import com.biutag.supervision.service.NegativeWorkService;
import com.biutag.supervision.service.SupDepartService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;
@ -28,12 +29,14 @@ public class SecondDistributeAction implements Action {
private final NegativeWorkService workService;
private final SupDepartService departService;
@Override
public void next(ActionDto actionDto) {
SecondDistributeData secondDistributeData = BeanUtil.toBean(actionDto.getData(), SecondDistributeData.class);
updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), secondDistributeData);
doneWork(actionDto.getWorkId());
addWork(actionDto.getNegativeId(), RoleCodeEnum.THREE_ADMIN.getCode(), secondDistributeData.getDepartId(), secondDistributeData.getDepartName());
addWork(actionDto.getNegativeId(), RoleCodeEnum.THREE_ADMIN.getCode(), secondDistributeData.getDepartId());
}
public void updateNegative(String negativeId, String nextFlowKey, SecondDistributeData secondDistributeData) {
@ -55,7 +58,8 @@ public class SecondDistributeAction implements Action {
.eq(NegativeWork::getId, workId));
}
public void addWork(String negativeId, String roleCode, String departId, String departName) {
public void addWork(String negativeId, String roleCode, String departId) {
SupDepart depart = departService.getById(departId);
workService.remove(new LambdaQueryWrapper<NegativeWork>()
.eq(NegativeWork::getNegativeId, negativeId)
.eq(NegativeWork::getRoleCode, roleCode)
@ -65,7 +69,7 @@ public class SecondDistributeAction implements Action {
.setNegativeId(negativeId)
.setRoleCode(roleCode)
.setDepartId(departId)
.setDepartName(departName)
.setDepartName(depart.getShortName())
.setProblemSourcesCode(negative.getProblemSourcesCode())
.setCreateTime(LocalDateTime.now())
.setUpdateTime(LocalDateTime.now())

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

@ -4,6 +4,7 @@ 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.model.NegativeWorkModel;
import com.biutag.supervision.pojo.vo.TaskCountVo;
import com.biutag.supervision.pojo.vo.TaskVo;
import com.biutag.supervision.pojo.entity.SupTask;
@ -11,8 +12,12 @@ import org.apache.ibatis.annotations.Param;
public interface SupTaskMapper extends BaseMapper<SupTask> {
Page<TaskVo> queryTask(@Param("page") Page<SupTask> page, @Param(Constants.WRAPPER) QueryWrapper<SupTask> queryWrapper);
Page<TaskVo> queryTask(@Param("page") Page<SupTask> page,
@Param("ew1") QueryWrapper<SupTask> taskQueryWrapper,
@Param("ew2") QueryWrapper<SupTask> nQueryWrapper,
@Param(Constants.WRAPPER) QueryWrapper<SupTask> queryWrapper);
TaskCountVo queryTaskCount(@Param(Constants.WRAPPER) QueryWrapper<SupTask> queryWrapper);
TaskCountVo queryTaskCount(@Param("ew1") QueryWrapper<SupTask> taskQueryWrapper,
@Param("ew2") QueryWrapper<SupTask> nQueryWrapper);
}

5
src/main/java/com/biutag/supervision/pojo/dto/DataDataPetitionComplainDistribute.java

@ -31,6 +31,11 @@ public class DataDataPetitionComplainDistribute {
// 最大延期时长(天)
private Integer maxExtensionDuration;
private String handleDepartId;
@NotBlank
private String distributionFlow;
// 审批流程
@NotBlank
private String approvalFlow;

10
src/main/java/com/biutag/supervision/pojo/vo/TaskVo.java

@ -53,4 +53,14 @@ public class TaskVo {
private String type;
private String negativeId;
// 业务类型
private String businessTypeName;
// 涉嫌问题
private String involveProblem;
private String flowKey;
}

32
src/main/java/com/biutag/supervision/service/DataPetitionComplaintService.java

@ -120,6 +120,34 @@ public class DataPetitionComplaintService extends ServiceImpl<DataPetitionCompla
negativeDto.setResponderName(item.getResponderName());
negativeDto.setContactPhone(item.getResponderPhone());
negativeDto.setThingDesc(item.getThingDesc());
if (StrUtil.isNotBlank(dataDistribute.getHandleDepartId())) {
SupDepart depart = departService.getById(dataDistribute.getHandleDepartId());
if (DepartLevelEnum.SECOND.getValue().equals(depart.getLevel())) {
negativeDto.setDepartId(dataDistribute.getHandleDepartId());
} else if (DepartLevelEnum.THREE.getValue().equals(depart.getLevel())) {
if (DistributionFlowEnum.SECOND.getValue().equals(dataDistribute.getDistributionFlow())) {
negativeDto.setDepartId(depart.getPid());
} else {
negativeDto.setDepartId(depart.getId());
}
} else {
throw new RuntimeException("指定办理单位 请选择二级或三级单位");
}
if (StrUtil.isBlank(item.getThirdDepartId()) && StrUtil.isBlank(item.getSecondDepartId())) {
negativeDto.setInvolveDepartId(depart.getId());
negativeDto.setInvolveDepartName(depart.getShortName());
}
} else {
if (StrUtil.isBlank(item.getThirdDepartId()) && StrUtil.isBlank(item.getSecondDepartId())) {
throw new RuntimeException("被投诉机构为空 请选择指定办理单位");
}
if (DistributionFlowEnum.SECOND.getValue().equals(dataDistribute.getDistributionFlow())) {
negativeDto.setDepartId(item.getSecondDepartId());
} else {
negativeDto.setDepartId(item.getThirdDepartId());
}
}
if (StrUtil.isNotBlank(item.getThirdDepartId()) || StrUtil.isNotBlank(item.getSecondDepartId())) {
String departId;
String departName;
if (StrUtil.isBlank(item.getThirdDepartId())) {
@ -131,10 +159,12 @@ public class DataPetitionComplaintService extends ServiceImpl<DataPetitionCompla
}
negativeDto.setInvolveDepartId(departId);
negativeDto.setInvolveDepartName(departName);
}
negativeDto.setHostLevel(HostLevelEnums.SECOND.getValue());
negativeDto.setApprovalFlow(dataDistribute.getApprovalFlow());
negativeDto.setDepartId(departId);
negativeDto.setTimeLimit(dataDistribute.getTimeLimit());
negativeDto.setMaxSignDuration(dataDistribute.getMaxSignDuration());
negativeDto.setMaxHandleDuration(dataDistribute.getMaxHandleDuration());

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

@ -216,6 +216,8 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
if (CollectionUtil.isNotEmpty(negativeDto.getInvolveProblem())) {
negative.setInvolveProblem(String.join(",", negativeDto.getInvolveProblem()));
} else {
negative.setInvolveProblem(null);
}
if (CollectionUtil.isNotEmpty(negativeDto.getProblems())) {
negative.setProblems(JSON.toJSONString(negativeDto.getProblems()));

44
src/main/java/com/biutag/supervision/service/SupTaskService.java

@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.common.UserContextHolder;
import com.biutag.supervision.constants.enums.TaskTypeEnum;
import com.biutag.supervision.mapper.SupTaskMapper;
import com.biutag.supervision.pojo.model.NegativeWorkModel;
import com.biutag.supervision.pojo.vo.TaskCountVo;
import com.biutag.supervision.pojo.vo.TaskVo;
import com.biutag.supervision.pojo.entity.SupTask;
@ -14,35 +15,62 @@ import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.pojo.param.TaskQueryParam;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@Service
public class SupTaskService extends ServiceImpl<SupTaskMapper, SupTask> {
public Page<TaskVo> pageTask(TaskQueryParam queryParam) {
UserAuth user = UserContextHolder.getCurrentUser();
QueryWrapper<SupTask> queryWrapper = new QueryWrapper<>();
queryWrapper.and(q -> {
QueryWrapper<SupTask> taskQueryWrapper = new QueryWrapper<>();
taskQueryWrapper
// 设置参数别名
.setParamAlias("ew1")
.and(q -> {
q.eq("p.id_code", user.getUserName());
if (StrUtil.isNotBlank(user.getPosition())) {
q.or().eq("t.sup_depart_id", user.getDepartId()).eq("t.task_type", TaskTypeEnum.selfexamination.name());
}
})
.eq("t.task_status", queryParam.getTaskStatus())
});
QueryWrapper<SupTask> nQueryWrapper = new QueryWrapper<>();
nQueryWrapper.setParamAlias("ew2");
if (user.getRoleCodes().isEmpty() || user.getAuthDepartIds().isEmpty() || user.getAuthSources().isEmpty()) {
nQueryWrapper.apply("1 = 0");
} else {
nQueryWrapper.in("w.role_code", user.getRoleCodes())
.in("w.depart_id", user.getAuthDepartIds())
.in("w.problem_sources_code", user.getAuthSources());
}
QueryWrapper<SupTask> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("t.task_status", queryParam.getTaskStatus())
.like(StrUtil.isNotBlank(queryParam.getTaskName()), "t.task_name", queryParam.getTaskName())
.eq(StrUtil.isNotBlank(queryParam.getTaskType()),"t.task_type", queryParam.getTaskType())
.orderByDesc("t.create_time");
return baseMapper.queryTask(Page.of(queryParam.getCurrent(), queryParam.getSize()), queryWrapper);
return baseMapper.queryTask(Page.of(queryParam.getCurrent(), queryParam.getSize()), taskQueryWrapper, nQueryWrapper, queryWrapper);
}
public TaskCountVo getTaskCount() {
UserAuth user = UserContextHolder.getCurrentUser();
QueryWrapper<SupTask> queryWrapper = new QueryWrapper<>();
queryWrapper.and(q -> {
QueryWrapper<SupTask> taskQueryWrapper = new QueryWrapper<>();
taskQueryWrapper
// 设置参数别名
.setParamAlias("ew1")
.and(q -> {
q.eq("p.id_code", user.getUserName());
if (StrUtil.isNotBlank(user.getPosition())) {
q.or().eq("t.sup_depart_id", user.getDepartId()).eq("t.task_type", TaskTypeEnum.selfexamination.name());
}
});
return baseMapper.queryTaskCount(queryWrapper);
QueryWrapper<SupTask> nQueryWrapper = new QueryWrapper<>();
nQueryWrapper.setParamAlias("ew2");
if (user.getRoleCodes().isEmpty() || user.getAuthDepartIds().isEmpty() || user.getAuthSources().isEmpty()) {
nQueryWrapper.apply("1 = 0");
} else {
nQueryWrapper.in("w.role_code", user.getRoleCodes())
.in("w.depart_id", user.getAuthDepartIds())
.in("w.problem_sources_code", user.getAuthSources());
}
return baseMapper.queryTaskCount(taskQueryWrapper, nQueryWrapper);
}
}

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

@ -5,25 +5,81 @@
<mapper namespace="com.biutag.supervision.mapper.SupTaskMapper">
<select id="queryTask" 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
select * from
(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,
'' businessTypeName,
'' involveProblem,
'' negative_id,
'' flow_key
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
${ew.getCustomSqlSegment}
${ew1.getCustomSqlSegment}
UNION
SELECT DISTINCT
w.id, n.problemSources task_name, n.involveDepartName sup_depart_name, null, null, n.crtTime create_time, 'negative' task_type, w.`status` task_status, 0, n.special_supervision, n.thingDesc, '', '', '',
n.businessTypeName, n.involveProblem, w.negative_id, n.flow_key
FROM
negative_work w
LEFT JOIN negative n
ON w.negative_id = n.id
${ew2.getCustomSqlSegment}
) t ${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
from
(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,
'' businessTypeName,
'' involveProblem,
'' negative_id,
'' flow_key
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
${ew.getCustomSqlSegment}
${ew1.getCustomSqlSegment}
UNION
SELECT DISTINCT
w.id, n.problemSources task_name, n.involveDepartName sup_depart_name, null, null, n.crtTime create_time, 'negative' task_type, w.`status` task_status, 0, n.special_supervision, n.thingDesc, '', '', '',
n.businessTypeName, n.involveProblem, w.negative_id, n.flow_key
FROM
negative_work w
LEFT JOIN negative n
ON w.negative_id = n.id
${ew2.getCustomSqlSegment}
) t
</select>
</mapper>

Loading…
Cancel
Save