diff --git a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueTaskController.java b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueTaskController.java index 7f11f4e..7e2ea23 100644 --- a/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueTaskController.java +++ b/src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueTaskController.java @@ -2,10 +2,8 @@ package com.biutag.supervision.controller.sensitivePerception; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.biutag.supervision.pojo.Result; -import com.biutag.supervision.pojo.model.ModelClueModel; import com.biutag.supervision.pojo.model.ModelClueTaskModel; -import com.biutag.supervision.pojo.param.ModelClueQueryParam; -import com.biutag.supervision.service.ModelClueService; +import com.biutag.supervision.pojo.param.ModelClueTaskQueryParam; import com.biutag.supervision.service.ModelClueTaskService; import lombok.RequiredArgsConstructor; import org.springframework.web.bind.annotation.GetMapping; @@ -24,7 +22,7 @@ public class ModelClueTaskController { private final ModelClueTaskService modelClueTaskService; @GetMapping - public Result> page(ModelClueQueryParam param) { + public Result> page(ModelClueTaskQueryParam param) { return Result.success(modelClueTaskService.page(param)); } diff --git a/src/main/java/com/biutag/supervision/controller/system/PoliceController.java b/src/main/java/com/biutag/supervision/controller/system/PoliceController.java index 5d93851..c54ae56 100644 --- a/src/main/java/com/biutag/supervision/controller/system/PoliceController.java +++ b/src/main/java/com/biutag/supervision/controller/system/PoliceController.java @@ -146,13 +146,16 @@ public class PoliceController { excelReader.close(); for (int i = 0; i < list.size(); i++) { PoliceImport police = list.get(i); - SupDepart depart; - if (StrUtil.isBlank(police.getThirdDepartName())) { - depart = departService.getOne(new LambdaQueryWrapper().eq(SupDepart::getShortName, police.getSecondDepartName()).eq(SupDepart::getLevel, 2)); - } else { - SupDepart secondDepart = departService.getOne(new LambdaQueryWrapper().eq(SupDepart::getShortName, police.getSecondDepartName()).eq(SupDepart::getLevel, 2)); - depart = departService.getOne(new LambdaQueryWrapper().eq(SupDepart::getPid, secondDepart.getId()) + SupDepart depart = departService.getOne(new LambdaQueryWrapper().eq(SupDepart::getShortName, police.getSecondDepartName()).eq(SupDepart::getLevel, 2)); + if (Objects.isNull(depart)) { + throw new RuntimeException(String.format("%s 该单位在系统中未找到,请核实", police.getSecondDepartName())); + } + if (StrUtil.isNotBlank(police.getThirdDepartName())) { + depart = departService.getOne(new LambdaQueryWrapper().eq(SupDepart::getPid, depart.getId()) .eq(SupDepart::getShortName, police.getThirdDepartName()).eq(SupDepart::getLevel, 3)); + if (Objects.isNull(depart)) { + throw new RuntimeException(String.format("%s/%s 该单位在系统中未找到,请核实", police.getSecondDepartName(), police.getThirdDepartName())); + } } SupPolice supPolice = policeService.getByIdCode(list.get(i).getIdCode()); if (supPolice == null) { @@ -161,12 +164,6 @@ public class PoliceController { supPolice.setIdCode(police.getIdCode()); supPolice.setEmpNo(police.getEmpNo()); supPolice.setOrgId(depart.getId()); - if (police.getEmpNo().contains("A")) { - supPolice.setPersonType("3"); - } else { - supPolice.setPersonType("1"); - } - policeService.save(supPolice); } else { supPolice.setName(police.getName()); diff --git a/src/main/java/com/biutag/supervision/flow/action/SaveAction.java b/src/main/java/com/biutag/supervision/flow/action/SaveAction.java index e3f7c1c..bf3ff7e 100644 --- a/src/main/java/com/biutag/supervision/flow/action/SaveAction.java +++ b/src/main/java/com/biutag/supervision/flow/action/SaveAction.java @@ -40,14 +40,13 @@ public class SaveAction implements Action { @Override public void next(ActionDto actionDto) { VerifyData verifyData = BeanUtil.toBean(actionDto.getData(), VerifyData.class); - updateNegative(actionDto.getNegativeId(), actionDto.getNextFlowKey(), verifyData); + updateNegative(actionDto.getNegativeId(), verifyData); } - public void updateNegative(String negativeId, String nextFlowKey, VerifyData verifyData) { + public void updateNegative(String negativeId, VerifyData verifyData) { LambdaUpdateWrapper updateWrapper = new LambdaUpdateWrapper() .eq(Negative::getId, negativeId) .set(Negative::getUpdTime, LocalDateTime.now()) - .set(Negative::getProcessingStatus, ProcessingStatusEnum.approval.name()) .set(Negative::getCheckStatusDesc, verifyData.getCheckStatusDesc()) .set(Negative::getCaseNumber, verifyData.getCaseNumber()) .set(Negative::getCheckStatus, verifyData.getCheckStatus()) diff --git a/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskModel.java b/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskModel.java index 49ac2bf..003bfdf 100644 --- a/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskModel.java +++ b/src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskModel.java @@ -27,7 +27,14 @@ public class ModelClueTaskModel { private LocalDateTime distributionTime; // 条数 - private String size; + private Integer size; + private Integer completedSize; + + private Integer verifySize; + + private Integer departSize; + + private Integer personalSize; } diff --git a/src/main/java/com/biutag/supervision/pojo/param/ModelClueTaskQueryParam.java b/src/main/java/com/biutag/supervision/pojo/param/ModelClueTaskQueryParam.java new file mode 100644 index 0000000..c2a3bc2 --- /dev/null +++ b/src/main/java/com/biutag/supervision/pojo/param/ModelClueTaskQueryParam.java @@ -0,0 +1,23 @@ +package com.biutag.supervision.pojo.param; + +import lombok.Getter; +import lombok.Setter; +import org.springframework.format.annotation.DateTimeFormat; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author wxc + * @date 2024/10/16 + */ +@Setter +@Getter +public class ModelClueTaskQueryParam extends BasePage { + private List modelIds; + + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private List distributionTime = new ArrayList<>(); + private String taskName; +} diff --git a/src/main/java/com/biutag/supervision/service/ModelClueService.java b/src/main/java/com/biutag/supervision/service/ModelClueService.java index f810bc4..68f98dd 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueService.java @@ -171,11 +171,6 @@ public class ModelClueService extends ServiceImpl { for (ModelClue modelClue : modelClues) { modelClue.setModelId(modelId); modelClue.setCreateTime(LocalDateTime.now()); - SupExternalDepart supExternalDepart = supExternalDepartMapper.selectOne(new LambdaQueryWrapper().eq(SupExternalDepart::getExternalId, modelClue.getInvolveDepartId()).last("LIMIT 1")); - if (supExternalDepart != null && supExternalDepart.getInternalShortName() != null && !supExternalDepart.getInternalShortName().isEmpty()) { - modelClue.setInvolveDepartName(supExternalDepart.getInternalShortName()); - modelClue.setInvolveDepartId(supExternalDepart.getInternalId()); - } } modelClueMapper.insert(modelClues); modelClueRecordMapper.insert(new ModelClueRecord().setModelId(modelId).setSize(modelClues.size()).setCreateTime(LocalDateTime.now()).setState("success")); @@ -215,6 +210,11 @@ public class ModelClueService extends ServiceImpl { if (Objects.equals(keyColumn, modelClue.getUniqueKey())) { modelClue.setData(JSONObject.toJSONString(data)); modelClue.setStatus(0); + SupExternalDepart supExternalDepart = supExternalDepartMapper.selectOne(new LambdaQueryWrapper().eq(SupExternalDepart::getExternalId, modelClue.getInvolveDepartId()).last("LIMIT 1")); + if (supExternalDepart != null && supExternalDepart.getInternalShortName() != null && !supExternalDepart.getInternalShortName().isEmpty()) { + modelClue.setInvolveDepartName(supExternalDepart.getInternalShortName()); + modelClue.setInvolveDepartId(supExternalDepart.getInternalId()); + } setPerson(modelId, modelClue, data); generateZFBAThingDesc(modelId, modelClue, data); break; @@ -317,14 +317,14 @@ public class ModelClueService extends ServiceImpl { modelClue.setThingDesc("姓名" + data.get("xm") + ",身份证号" + data.get("zjhm") + ",于" + formatStringDate((String) data.get("djsj")) - + "登记进入" + data.get("csmc") + + "登记进入" + modelClue.getInvolveDepartName() + ",离开时间为" + formatStringDate((String) data.get("lksj")) + ",超过了48小时。"); } else { modelClue.setThingDesc("姓名" + data.get("xm") + ",身份证号" + data.get("zjhm") + ",于" + formatStringDate((String) data.get("djsj")) - + "登记进入" + data.get("csmc") + + "登记进入" + modelClue.getInvolveDepartName() + ",没有离开时间。"); } } else if (modelId == 10) { // 10号模型:案件受理不及时的异常数据 diff --git a/src/main/java/com/biutag/supervision/service/ModelClueTaskService.java b/src/main/java/com/biutag/supervision/service/ModelClueTaskService.java index d5e4119..ed8f6cd 100644 --- a/src/main/java/com/biutag/supervision/service/ModelClueTaskService.java +++ b/src/main/java/com/biutag/supervision/service/ModelClueTaskService.java @@ -1,48 +1,35 @@ package com.biutag.supervision.service; -import cn.hutool.core.bean.BeanUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import cn.hutool.core.util.StrUtil; +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.mapper.ModelClueTaskMapper; -import com.biutag.supervision.mapper.ModelMapper; -import com.biutag.supervision.pojo.entity.Model; import com.biutag.supervision.pojo.entity.ModelClueTask; import com.biutag.supervision.pojo.model.ModelClueTaskModel; -import com.biutag.supervision.pojo.param.ModelClueQueryParam; +import com.biutag.supervision.pojo.param.ModelClueTaskQueryParam; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import java.util.ArrayList; -import java.util.List; import java.util.Objects; -import java.util.Set; -import java.util.stream.Collectors; @RequiredArgsConstructor @Service public class ModelClueTaskService extends ServiceImpl { - private final ModelMapper modelMapper; - - public Page page(ModelClueQueryParam param) { - LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper() - .orderByDesc(ModelClueTask::getDistributionTime); - - Page page = page(Page.of(param.getCurrent(), param.getSize()), queryWrapper); - if (page.getRecords().isEmpty()) { - return new Page().setRecords(new ArrayList<>()).setTotal(0); + public Page page(ModelClueTaskQueryParam param) { + if (Objects.nonNull(param.getModelIds()) && param.getModelIds().isEmpty()) { + return new Page().setTotal(0).setRecords(new ArrayList<>()); + } + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.in(Objects.nonNull(param.getModelIds()), "mt.model_id", param.getModelIds()); + queryWrapper.like(StrUtil.isNotBlank(param.getTaskName()), "mt.task_name", param.getTaskName()); + if (Objects.nonNull(param.getDistributionTime()) && !param.getDistributionTime().isEmpty()) { + queryWrapper.between("mt.distribution_time", param.getDistributionTime().get(0), param.getDistributionTime().get(1)); } - Set modelIds = page.getRecords().stream().map(ModelClueTask::getModelId).collect(Collectors.toSet()); - List models = modelMapper.selectBatchIds(modelIds); - List list = page.getRecords().stream().map(item -> { - ModelClueTaskModel taskModel = new ModelClueTaskModel(); - BeanUtil.copyProperties(item, taskModel); - String modelName = models.stream().filter(model -> model.getId().equals(item.getModelId())).findFirst().map(Model::getModelName).orElse(""); - taskModel.setModelName(modelName); - return taskModel; - }).toList(); - return new Page().setRecords(list).setTotal(page.getTotal()); + Page page = baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper); + return page; } } diff --git a/src/main/resources/mapper/ModelClueTaskMapper.xml b/src/main/resources/mapper/ModelClueTaskMapper.xml index 94100b7..a073799 100644 --- a/src/main/resources/mapper/ModelClueTaskMapper.xml +++ b/src/main/resources/mapper/ModelClueTaskMapper.xml @@ -8,7 +8,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT mt.id, mt.task_name, - mt.create_time, + mt.distribution_time, m.model_name, mt.size, sum( CASE WHEN n.processing_status = 'completed' THEN 1 ELSE 0 END ) completed_size,