Browse Source

Merge remote-tracking branch 'origin/master'

main
parent
commit
e3bd39085d
  1. 31
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueRecordController.java
  2. 9
      src/main/java/com/biutag/supervision/controller/system/PoliceController.java
  3. 5
      src/main/java/com/biutag/supervision/controller/work/WorkController.java
  4. 2
      src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java
  5. 4
      src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java
  6. 2
      src/main/java/com/biutag/supervision/mapper/BaseAccountMapper.java
  7. 2
      src/main/java/com/biutag/supervision/mapper/PoliceScoreMapper.java
  8. 8
      src/main/java/com/biutag/supervision/mapper/RiskTaskMapper.java
  9. 2
      src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java
  10. 54
      src/main/java/com/biutag/supervision/pojo/entity/RiskTask.java
  11. 9
      src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java
  12. 9
      src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java
  13. 24
      src/main/java/com/biutag/supervision/service/NegativeQueryService.java
  14. 19
      src/main/java/com/biutag/supervision/service/NegativeService.java
  15. 107
      src/main/java/com/biutag/supervision/service/NegativeWorkService.java
  16. 11
      src/main/java/com/biutag/supervision/service/RiskTaskService.java
  17. 4
      src/main/java/com/biutag/supervision/service/SupPoliceService.java
  18. 3
      src/main/resources/mapper/ProfileDepartMapper.xml
  19. 1
      src/main/resources/mapper/ProfilePoliceMapper.xml

31
src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueRecordController.java

@ -1,12 +1,14 @@
package com.biutag.supervision.controller.sensitivePerception;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.entity.Model;
import com.biutag.supervision.pojo.entity.ModelClueRecord;
import com.biutag.supervision.pojo.entity.RiskTask;
import com.biutag.supervision.service.ModelClueRecordService;
import com.biutag.supervision.service.ModelService;
import com.biutag.supervision.service.RiskTaskService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
@ -24,14 +26,29 @@ import java.util.List;
@RestController
public class ModelClueRecordController {
private final ModelService modelService;
private final ModelClueRecordService modelClueRecordService;
private final RiskTaskService riskTaskService;
@GetMapping("/{modelId}/top")
public Result<List<ModelClueRecord>> list(@PathVariable Integer modelId) {
LambdaQueryWrapper<ModelClueRecord> queryWrapper = new LambdaQueryWrapper<ModelClueRecord>()
.eq(ModelClueRecord::getModelId, modelId)
.orderByDesc(ModelClueRecord::getCreateTime);
return Result.success(modelClueRecordService.page(new Page<>(1, 8), queryWrapper).getRecords());
public Result list(@PathVariable Integer modelId) {
Model model = modelService.getById(modelId);
// 个人极端暴力风险 6
if ("6".equals(model.getClassId())) {
LambdaQueryWrapper<RiskTask> queryWrapper = new LambdaQueryWrapper<RiskTask>()
.eq(RiskTask::getModelId, modelId)
.orderByDesc(RiskTask::getStartTime);
List<RiskTask> records = riskTaskService.page(new Page<>(1, 8), queryWrapper).getRecords();
return Result.success(records);
} else {
LambdaQueryWrapper<ModelClueRecord> queryWrapper = new LambdaQueryWrapper<ModelClueRecord>()
.eq(ModelClueRecord::getModelId, modelId)
.orderByDesc(ModelClueRecord::getCreateTime);
return Result.success(modelClueRecordService.page(new Page<>(1, 8), queryWrapper).getRecords());
}
}
}

9
src/main/java/com/biutag/supervision/controller/system/PoliceController.java

@ -10,8 +10,11 @@ import com.alibaba.excel.ExcelReader;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.ReadSheet;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.constants.AppConstants;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.domain.PoliceAuth;
import com.biutag.supervision.pojo.dto.PoliceImport;
@ -85,8 +88,10 @@ public class PoliceController {
}
@DeleteMapping("{id}")
public Result<Boolean> del(@PathVariable String id) {
return Result.success(policeService.removeById(id));
public Result<Void> del(@PathVariable String id, @RequestBody JSONObject body) {
policeService.update(new LambdaUpdateWrapper<SupPolice>().eq(SupPolice::getId, id).set(SupPolice::getDel, AppConstants.DEL)
.set(SupPolice::getDelReason, body.getString("reason")));
return Result.success();
}
@GetMapping("{departId}/all")

5
src/main/java/com/biutag/supervision/controller/work/WorkController.java

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.biutag.supervision.constants.enums.WorkStatusEnum;
import com.biutag.supervision.pojo.Result;
import com.biutag.supervision.pojo.model.NegativeWorkModel;
import com.biutag.supervision.pojo.param.NegativeQueryParam;
import com.biutag.supervision.pojo.param.WorkParam;
import com.biutag.supervision.service.NegativeWorkService;
import lombok.RequiredArgsConstructor;
@ -19,12 +20,12 @@ public class WorkController {
private final NegativeWorkService negativeWorkService;
@GetMapping("todo")
public Result<Page<NegativeWorkModel>> todo(WorkParam workParam) {
public Result<Page<NegativeWorkModel>> todo(NegativeQueryParam workParam) {
return Result.success(negativeWorkService.page(workParam, WorkStatusEnum.todo.name()));
}
@GetMapping("done")
public Result<Page<NegativeWorkModel>> done(WorkParam workParam) {
public Result<Page<NegativeWorkModel>> done(NegativeQueryParam workParam) {
return Result.success(negativeWorkService.page(workParam, WorkStatusEnum.done.name()));
}

2
src/main/java/com/biutag/supervision/flow/action/FirstApproveReturnAction.java

@ -75,9 +75,11 @@ public class FirstApproveReturnAction implements Action {
}
public void addWork(String negativeId, String roleCode) {
Negative negative = negativeService.getById(negativeId);
List<NegativeWork> works = workService.list(new LambdaQueryWrapper<NegativeWork>()
.eq(NegativeWork::getNegativeId, negativeId)
.eq(NegativeWork::getRoleCode, roleCode)
.eq(NegativeWork::getDepartId, negative.getHandleSecondDepartId())
.orderByDesc(NegativeWork::getCreateTime));
if (works.isEmpty()) {
throw new RuntimeException("数据异常,请联系管理员:无二级机构工作流程数据");

4
src/main/java/com/biutag/supervision/flow/action/SecondApproveReturnAction.java

@ -77,9 +77,11 @@ public class SecondApproveReturnAction implements Action {
}
public void addWork(String negativeId, String roleCode) {
Negative negative = negativeService.getById(negativeId);
List<NegativeWork> works = workService.list(new LambdaQueryWrapper<NegativeWork>()
.eq(NegativeWork::getNegativeId, negativeId)
.eq(NegativeWork::getRoleCode, roleCode)
.eq(NegativeWork::getDepartId, negative.getHandleThreeDepartId())
.orderByDesc(NegativeWork::getCreateTime));
if (works.isEmpty()) {
throw new RuntimeException("数据异常,请联系管理员:无三级机构工作流程数据");
@ -89,4 +91,4 @@ public class SecondApproveReturnAction implements Action {
workService.updateById(works.get(0));
}
}
}

2
src/main/java/com/biutag/supervision/mapper/BaseAccountMapper.java

@ -8,7 +8,7 @@ import org.apache.ibatis.annotations.Select;
@DS("slave")
public interface BaseAccountMapper extends BaseMapper<BaseAccount> {
@Select("select a.* from base_account a left join negative.sup_police p on a.account = p.id_code where a.account = #{account} or p.emp_no = #{account}")
@Select("select a.* from base_account a left join negative.sup_police p on a.account = p.id_code and p.del = 0 where a.account = #{account} or p.emp_no = #{account}")
BaseAccount selectByLogin(String account);
}

2
src/main/java/com/biutag/supervision/mapper/PoliceScoreMapper.java

@ -9,7 +9,7 @@ import java.util.List;
public interface PoliceScoreMapper extends BaseMapper<PoliceScore> {
@Select("select p.id_code from sup_police p left join negative_score_police sp on p.id_code = sp.id_code where sp.id_code is not null GROUP BY p.id_code")
@Select("select p.id_code from sup_police p left join negative_score_police sp on p.id_code = sp.id_code where p.del = 0 and sp.id_code is not null GROUP BY p.id_code")
List<SupPolice> listPolice();
}

8
src/main/java/com/biutag/supervision/mapper/RiskTaskMapper.java

@ -0,0 +1,8 @@
package com.biutag.supervision.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.biutag.supervision.pojo.entity.RiskTask;
public interface RiskTaskMapper extends BaseMapper<RiskTask> {
}

2
src/main/java/com/biutag/supervision/mapper/RpcApplyMapper.java

@ -31,7 +31,7 @@ public interface RpcApplyMapper extends BaseMapper<RpcApply> {
@Select("SELECT c.job name, COUNT(c.job) value FROM sup_police c JOIN " +
"(SELECT a.emp_no FROM rpc_apply_person a LEFT JOIN rpc_apply b ON a.rpc_id = b.rpc_id " +
"WHERE b.apply_date BETWEEN #{beginTime} AND #{endTime} AND b.type = 2) d on c.emp_no = d.emp_no " +
"WHERE c.del = 0 and b.apply_date BETWEEN #{beginTime} AND #{endTime} AND b.type = 2) d on c.emp_no = d.emp_no " +
"GROUP BY c.job")
List<PieItem> selectComfortSituation(Date beginTime, Date endTime);

54
src/main/java/com/biutag/supervision/pojo/entity/RiskTask.java

@ -0,0 +1,54 @@
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 com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
@Setter
@Getter
public class RiskTask {
// 主键
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
// 模型id
@TableField("model_id")
private Integer modelId;
// 扫描条数
@TableField("scan_size")
private Integer scanSize;
// 新增条数
@TableField("insert_size")
private Integer insertSize;
// 更新条数
@TableField("update_size")
private Integer updateSize;
// 开始时间
@TableField("start_time")
@JsonFormat(pattern = "YYYY-MM-dd HH:mm")
private LocalDateTime startTime;
// 结束时间
@TableField("end_time")
@JsonFormat(pattern = "YYYY-MM-dd HH:mm")
private LocalDateTime endTime;
// 0 进行中 1 已完成 -1 失败
@TableField("state")
private Integer state;
// 异常详情
@TableField("err_msg")
private String errMsg;
}

9
src/main/java/com/biutag/supervision/pojo/entity/SupPolice.java

@ -2,6 +2,8 @@ package com.biutag.supervision.pojo.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.biutag.supervision.constants.AppConstants;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotBlank;
import lombok.Getter;
@ -149,4 +151,11 @@ public class SupPolice {
private Integer sortId;
// 是否刪除
@TableLogic(value = AppConstants.UN_DEL, delval = AppConstants.DEL)
private String del;
// 刪除原因
private String delReason;
}

9
src/main/java/com/biutag/supervision/pojo/param/NegativeQueryParam.java

@ -42,7 +42,6 @@ public class NegativeQueryParam extends BasePage {
private String checkStatus;
private List<String> checkStatusList = new ArrayList<>();
private String isRectifyCode;
@ -66,4 +65,12 @@ public class NegativeQueryParam extends BasePage {
private Integer crtDepartLevel;
// 涉及人员
private String blameKey;
// 涉及人员
private String blameValue;
private List<String> handleResultCode = new ArrayList<>();
}

24
src/main/java/com/biutag/supervision/service/NegativeQueryService.java

@ -10,6 +10,7 @@ import com.biutag.supervision.constants.enums.OrderEnum;
import com.biutag.supervision.constants.enums.ProcessingStatusEnum;
import com.biutag.supervision.constants.enums.RoleCodeEnum;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeBlame;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.pojo.param.NegativeQueryParam;
import com.biutag.supervision.pojo.vo.DepartTree;
@ -22,6 +23,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@RequiredArgsConstructor
@Service
@ -29,6 +31,8 @@ public class NegativeQueryService {
private final NegativeService negativeService;
private final NegativeBlameService blameService;
private final SupDepartService departService;
public Page<NegativeQueryVo> page(NegativeQueryParam param) {
@ -54,7 +58,6 @@ public class NegativeQueryService {
.eq(StrUtil.isNotBlank(param.getProblemSourcesCode()), Negative::getProblemSourcesCode, param.getProblemSourcesCode())
.eq(StrUtil.isNotBlank(param.getBusinessTypeCode()), Negative::getBusinessTypeCode, param.getBusinessTypeCode())
.eq(StrUtil.isNotBlank(param.getCheckStatus()), Negative::getCheckStatus, param.getCheckStatus())
.in(!param.getCheckStatusList().isEmpty(), Negative::getCheckStatus, param.getCheckStatusList())
.eq(StrUtil.isNotBlank(param.getIsRectifyCode()), Negative::getIsRectifyCode, param.getIsRectifyCode())
.eq(StrUtil.isNotBlank(param.getSpecialSupervision()), Negative::getSpecialSupervision, param.getSpecialSupervision())
.like(StrUtil.isNotBlank(param.getReportNumber()), Negative::getReportNumber, param.getReportNumber())
@ -78,6 +81,25 @@ public class NegativeQueryService {
break;
}
}
if (StrUtil.isNotBlank(param.getBlameKey()) && StrUtil.isNotBlank(param.getBlameValue())) {
LambdaQueryWrapper<NegativeBlame> qw = new LambdaQueryWrapper<>();
switch (param.getResponderKey()) {
case "name":
qw.like(NegativeBlame::getBlameName, param.getBlameValue());
break;
case "empNo":
qw.like(NegativeBlame::getBlameEmpNo, param.getBlameValue());
break;
case "idCode":
qw.like(NegativeBlame::getBlameIdCode, param.getBlameValue());
break;
}
List<NegativeBlame> blames = blameService.list(qw);
if (blames.isEmpty()) {
return new Page<NegativeQueryVo>().setTotal(0).setRecords(new ArrayList<>());
}
queryWrapper.in(Negative::getId, blames.stream().map(NegativeBlame::getNegativeId).collect(Collectors.toSet()));
}
if (Objects.nonNull(param.getTimeoutFlag())) {
if (param.getTimeoutFlag()) {
queryWrapper.eq(Negative::getProcessingStatus, ProcessingStatusEnum.completed.name()).gt(Negative::getHandleTimeout, 0);

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

@ -175,10 +175,11 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
}
LocalDateTime now = LocalDateTime.now();
UserAuth user = UserContextHolder.getCurrentUser();
boolean secondFlag = user.getRoleCodes().contains(RoleCodeEnum.SECOND_ADMIN.getCode());
negative.setId(IdUtil.getSnowflakeNextIdStr()) // negative唯一标识 雪花
.setProcessingStatus(ProcessingStatusEnum.signing.name())
.setFlowKey(FlowNodeEnum.FIRST_DISTRIBUTE.getKey()) // 市局下发
.setCrtDepartLevel(user.getRoleCodes().contains(RoleCodeEnum.SECOND_ADMIN.getCode()) ? DepartLevelEnum.SECOND.getValue() : DepartLevelEnum.FIRST.getValue())
.setCrtDepartLevel(secondFlag ? DepartLevelEnum.SECOND.getValue() : DepartLevelEnum.FIRST.getValue())
.setCrtTime(now)
.setUpdTime(now);
if (Objects.nonNull(negativeDto.getInvolveProblem())) {
@ -196,13 +197,21 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
}).toList();
thingFileService.saveBatch(files);
}
String departId = AppConstants.ROOT_DEPART_ID;
String departName = AppConstants.ROOT_DEPART_NAME;
String roleCode = RoleCodeEnum.FIRST_ADMIN.getCode();
if (secondFlag) {
SupDepart parentDepart = departService.getParentDepart(negativeDto.getDepartId());
departId = parentDepart.getId();
departName = parentDepart.getShortName();
roleCode = RoleCodeEnum.SECOND_ADMIN.getCode();
}
NegativeWork work = new NegativeWork()
.setNegativeId(negative.getId())
.setStatus(WorkStatusEnum.todo.name())
.setDepartId(AppConstants.ROOT_DEPART_ID)
.setDepartName(AppConstants.ROOT_DEPART_NAME)
.setRoleCode(RoleCodeEnum.FIRST_ADMIN.getCode())
.setDepartId(departId)
.setDepartName(departName)
.setRoleCode(roleCode)
.setProblemSourcesCode(negative.getProblemSourcesCode())
.setUpdateTime(now)
.setCreateTime(now);

107
src/main/java/com/biutag/supervision/service/NegativeWorkService.java

@ -6,22 +6,34 @@ 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.common.UserContextHolder;
import com.biutag.supervision.constants.enums.DepartLevelEnum;
import com.biutag.supervision.constants.enums.ProcessingStatusEnum;
import com.biutag.supervision.mapper.NegativeWorkMapper;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.NegativeBlame;
import com.biutag.supervision.pojo.entity.NegativeWork;
import com.biutag.supervision.pojo.model.NegativeWorkModel;
import com.biutag.supervision.pojo.model.UserAuth;
import com.biutag.supervision.pojo.param.NegativeQueryParam;
import com.biutag.supervision.pojo.param.WorkParam;
import com.biutag.supervision.pojo.vo.DepartTree;
import com.biutag.supervision.pojo.vo.NegativeQueryVo;
import com.biutag.supervision.util.TimeUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@RequiredArgsConstructor
@Service
public class NegativeWorkService extends ServiceImpl<NegativeWorkMapper, NegativeWork> {
public Page<NegativeWorkModel> page(WorkParam workParam, String workStatus) {
private final SupDepartService departService;
public Page<NegativeWorkModel> page(NegativeQueryParam param, String workStatus) {
UserAuth user = UserContextHolder.getCurrentUser();
if (user.getRoleCodes().isEmpty() || user.getAuthDepartIds().isEmpty() || user.getAuthSources().isEmpty()) {
return new Page<NegativeWorkModel>().setTotal(0).setRecords(new ArrayList<>());
@ -31,20 +43,89 @@ public class NegativeWorkService extends ServiceImpl<NegativeWorkMapper, Negativ
.in("w.depart_id", user.getAuthDepartIds())
.in("w.problem_sources_code", user.getAuthSources())
.eq("w.status", workStatus)
.eq(StrUtil.isNotBlank(workParam.getProblemSourcesCode()), "n.problemSourcesCode", workParam.getProblemSourcesCode())
.eq(StrUtil.isNotBlank(workParam.getBusinessTypeCode()), "n.businessTypeCode", workParam.getBusinessTypeCode())
.like(StrUtil.isNotBlank(workParam.getInvolveProblem()), "n.involveProblem", workParam.getInvolveProblem())
.like(StrUtil.isNotBlank(workParam.getThingDesc()), "n.thingDesc", workParam.getThingDesc())
.eq(StrUtil.isNotBlank(workParam.getInvolveDepartId()), "n.involveDepartId", workParam.getInvolveDepartId())
.eq(StrUtil.isNotBlank(workParam.getHandleThreeDepartId()), "n.handle_three_depart_id", workParam.getHandleThreeDepartId())
.eq(StrUtil.isNotBlank(workParam.getProcessingStatus()), "n.processing_status", workParam.getProcessingStatus())
.eq(StrUtil.isNotBlank(workParam.getCheckStatus()), "n.checkStatus", workParam.getCheckStatus())
.in(Objects.nonNull(workParam.getHandleResultCode()) && !workParam.getHandleResultCode().isEmpty(), "nb.handleResultCode", workParam.getHandleResultCode())
.and(StrUtil.isNotBlank(param.getOriginId()), (qw) -> {
qw.like("n.originId", param.getOriginId()).or().eq("n.id", param.getOriginId());
})
.eq(StrUtil.isNotBlank(param.getProblemSourcesCode()), "n.problemSourcesCode", param.getProblemSourcesCode())
.eq(StrUtil.isNotBlank(param.getBusinessTypeCode()), "n.businessTypeCode", param.getBusinessTypeCode())
.like(StrUtil.isNotBlank(param.getThingDesc()), "n.thingDesc", param.getThingDesc())
.eq(StrUtil.isNotBlank(param.getInvolveDepartId()), "n.involveDepartId", param.getInvolveDepartId())
.in(Objects.nonNull(param.getProcessingStatus()) && !param.getProcessingStatus().isEmpty(), "n.processing_status", param.getProcessingStatus())
.eq(StrUtil.isNotBlank(param.getCheckStatus()), "n.checkStatus", param.getCheckStatus())
.eq(StrUtil.isNotBlank(param.getIsRectifyCode()), "n.isRectifyCode", param.getIsRectifyCode())
.eq(StrUtil.isNotBlank(param.getSpecialSupervision()), "n.special_supervision", param.getSpecialSupervision())
.eq(StrUtil.isNotBlank(param.getFlowKey()), "n.flow_key", param.getFlowKey())
.eq(StrUtil.isNotBlank(param.getSpecialSupervision()), "n.special_supervision", param.getSpecialSupervision())
.eq(Objects.nonNull(param.getCrtDepartLevel()), "n.crt_depart_level", param.getCrtDepartLevel())
.like(StrUtil.isNotBlank(param.getReportNumber()), "n.report_number", param.getReportNumber())
.in(Objects.nonNull(param.getHandleResultCode()) && !param.getHandleResultCode().isEmpty(), "nb.handleResultCode", param.getHandleResultCode())
.orderByDesc("w.create_time");
if (workParam.getHappenTime().size() == 2) {
queryWrapper.between("n.happenTime", workParam.getHappenTime().get(0), workParam.getHappenTime().get(1));
if (param.getHappenTime().size() == 2) {
queryWrapper.between("n.happenTime", param.getHappenTime().get(0), param.getHappenTime().get(1));
}
if (param.getDiscoveryTime().size() == 2) {
queryWrapper.between("n.discoveryTime", param.getDiscoveryTime().get(0), param.getDiscoveryTime().get(1));
}
if (param.getCrtTime().size() == 2) {
queryWrapper.between("b.crtTime", param.getCrtTime().get(0), param.getCrtTime().get(1));
}
if (StrUtil.isNotBlank(param.getResponderKey()) && StrUtil.isNotBlank(param.getResponderValue())) {
switch (param.getResponderKey()) {
case "name":
queryWrapper.like("n.responderName", param.getResponderValue());
break;
case "phone":
queryWrapper.like("n.contactPhone", param.getResponderValue());
break;
}
}
if (StrUtil.isNotBlank(param.getBlameKey()) && StrUtil.isNotBlank(param.getBlameValue())) {
switch (param.getResponderKey()) {
case "name":
queryWrapper.like("nb.blameName", param.getBlameValue());
break;
case "empNo":
queryWrapper.like("nb.blameEmpNo", param.getBlameValue());
break;
case "idCode":
queryWrapper.like("nb.blameIdCode", param.getBlameValue());
break;
}
}
if (Objects.nonNull(param.getTimeoutFlag())) {
if (param.getTimeoutFlag()) {
queryWrapper.eq("n.processing_status", ProcessingStatusEnum.completed.name()).gt("n.handle_timeout", 0);
} else {
queryWrapper
.and(query -> {
query.ne("n.processing_status", ProcessingStatusEnum.completed.name()).or().gt("n.handle_timeout", 0);
});
}
}
// 办理单位
if (StrUtil.isNotBlank(param.getHandleDepartId())) {
List<DepartTree> nodes = departService.getAllNode(List.of(param.getHandleDepartId()));
List<String> secondIds = nodes.stream().filter(node -> DepartLevelEnum.SECOND.getValue().equals(node.getLevel())).map(DepartTree::getId).toList();
if (!secondIds.isEmpty()) {
queryWrapper.in("n.handle_second_depart_id", secondIds);
} else {
queryWrapper.in("n.handle_three_depart_id", nodes.stream().filter(node -> DepartLevelEnum.THREE.getValue().equals(node.getLevel())).map(DepartTree::getId).toList());
}
}
// 是否延期
if (Objects.nonNull(param.getExtensionFlag())) {
if (param.getExtensionFlag()) {
queryWrapper.and(query -> {
query.eq("n.extension_apply_flag", false).or().gt("n.extension_days", 0);
});
} else {
queryWrapper.eq("n.extension_apply_flag", true).or().isNull("n.extension_days");
}
}
Page<NegativeWorkModel> modelPage = baseMapper.queryPage(Page.of(workParam.getCurrent(), workParam.getSize()), queryWrapper);
Page<NegativeWorkModel> modelPage = baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper);
modelPage.getRecords().forEach(item -> {
item.setRemainingDuration(TimeUtil.getRemainingDuration(item.getFirstDistributeTime(), item.getMaxSignDuration(), item.getMaxHandleDuration(), item.getExtensionDays(), item.getFlowKey()));
});

11
src/main/java/com/biutag/supervision/service/RiskTaskService.java

@ -0,0 +1,11 @@
package com.biutag.supervision.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.biutag.supervision.pojo.entity.RiskTask;
import com.biutag.supervision.mapper.RiskTaskMapper;
import org.springframework.stereotype.Service;
@Service
public class RiskTaskService extends ServiceImpl<RiskTaskMapper, RiskTask> {
}

4
src/main/java/com/biutag/supervision/service/SupPoliceService.java

@ -37,7 +37,9 @@ public class SupPoliceService extends ServiceImpl<SupPoliceMapper, SupPolice> {
List<String> orgIds = departService.getAllNodeIds(user.getAuthDepartIds());
queryWrapper.in("p.org_id", orgIds);
}
queryWrapper.like(StrUtil.isNotBlank(param.getName()), "p.name", StrUtil.trim(param.getName()));
queryWrapper
.eq("p.del", AppConstants.UN_DEL)
.like(StrUtil.isNotBlank(param.getName()), "p.name", StrUtil.trim(param.getName()));
queryWrapper.like(StrUtil.isNotBlank(param.getIdCode()), "p.id_code", StrUtil.trim(param.getIdCode()));
queryWrapper.like(StrUtil.isNotBlank(param.getEmpNo()), "p.emp_no", StrUtil.trim(param.getEmpNo()));
queryWrapper.like(StrUtil.isNotBlank(param.getPhone()), "p.phone", StrUtil.trim(param.getPhone()));

3
src/main/resources/mapper/ProfileDepartMapper.xml

@ -59,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN negative n ON nb.negativeId = n.id
AND n.checkStatus IN ( '1', '2' )
AND n.discoveryTime BETWEEN #{beginTime} AND #{endTime}
WHERE p.org_id = #{departId} and n.id is not null
WHERE p.del = 0 and p.org_id = #{departId} and n.id is not null
GROUP BY
p.name,
p.id_code
@ -114,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
sup_police p
LEFT JOIN negative_blame nb ON p.id_code = nb.blameIdCode
WHERE
p.del = 0 and
nb.negativeId IN
<foreach collection="negativeIds" item="negativeId" open="(" separator="," close=")">
#{negativeId}

1
src/main/resources/mapper/ProfilePoliceMapper.xml

@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN negative_score_police n ON p.id_code = n.id_code
left join police_score pc on p.id_code = pc.id_code
WHERE
p.del = 0 and
n.id_code is not null
AND n.discovery_time BETWEEN #{beginTime} AND #{endTime}
<if test="departGroupId != null and departGroupId != ''">

Loading…
Cancel
Save