Browse Source

Merge remote-tracking branch 'origin/master'

main
parent
commit
efe692cf76
  1. 6
      src/main/java/com/biutag/supervision/controller/sensitivePerception/ModelClueTaskController.java
  2. 21
      src/main/java/com/biutag/supervision/controller/system/PoliceController.java
  3. 5
      src/main/java/com/biutag/supervision/flow/action/SaveAction.java
  4. 9
      src/main/java/com/biutag/supervision/pojo/model/ModelClueTaskModel.java
  5. 23
      src/main/java/com/biutag/supervision/pojo/param/ModelClueTaskQueryParam.java
  6. 14
      src/main/java/com/biutag/supervision/service/ModelClueService.java
  7. 41
      src/main/java/com/biutag/supervision/service/ModelClueTaskService.java
  8. 2
      src/main/resources/mapper/ModelClueTaskMapper.xml

6
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<ModelClueTaskModel>> page(ModelClueQueryParam param) {
public Result<Page<ModelClueTaskModel>> page(ModelClueTaskQueryParam param) {
return Result.success(modelClueTaskService.page(param));
}

21
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<SupDepart>().eq(SupDepart::getShortName, police.getSecondDepartName()).eq(SupDepart::getLevel, 2));
} else {
SupDepart secondDepart = departService.getOne(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getShortName, police.getSecondDepartName()).eq(SupDepart::getLevel, 2));
depart = departService.getOne(new LambdaQueryWrapper<SupDepart>().eq(SupDepart::getPid, secondDepart.getId())
SupDepart depart = departService.getOne(new LambdaQueryWrapper<SupDepart>().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<SupDepart>().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());

5
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<Negative> updateWrapper = new LambdaUpdateWrapper<Negative>()
.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())

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

23
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<Integer> modelIds;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private List<Date> distributionTime = new ArrayList<>();
private String taskName;
}

14
src/main/java/com/biutag/supervision/service/ModelClueService.java

@ -171,11 +171,6 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
for (ModelClue modelClue : modelClues) {
modelClue.setModelId(modelId);
modelClue.setCreateTime(LocalDateTime.now());
SupExternalDepart supExternalDepart = supExternalDepartMapper.selectOne(new LambdaQueryWrapper<SupExternalDepart>().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<ModelClueMapper, ModelClue> {
if (Objects.equals(keyColumn, modelClue.getUniqueKey())) {
modelClue.setData(JSONObject.toJSONString(data));
modelClue.setStatus(0);
SupExternalDepart supExternalDepart = supExternalDepartMapper.selectOne(new LambdaQueryWrapper<SupExternalDepart>().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<ModelClueMapper, ModelClue> {
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号模型:案件受理不及时的异常数据

41
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<ModelClueTaskMapper, ModelClueTask> {
private final ModelMapper modelMapper;
public Page<ModelClueTaskModel> page(ModelClueQueryParam param) {
LambdaQueryWrapper<ModelClueTask> queryWrapper = new LambdaQueryWrapper<ModelClueTask>()
.orderByDesc(ModelClueTask::getDistributionTime);
Page<ModelClueTask> page = page(Page.of(param.getCurrent(), param.getSize()), queryWrapper);
if (page.getRecords().isEmpty()) {
return new Page<ModelClueTaskModel>().setRecords(new ArrayList<>()).setTotal(0);
public Page<ModelClueTaskModel> page(ModelClueTaskQueryParam param) {
if (Objects.nonNull(param.getModelIds()) && param.getModelIds().isEmpty()) {
return new Page<ModelClueTaskModel>().setTotal(0).setRecords(new ArrayList<>());
}
QueryWrapper<ModelClueTask> 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<Integer> modelIds = page.getRecords().stream().map(ModelClueTask::getModelId).collect(Collectors.toSet());
List<Model> models = modelMapper.selectBatchIds(modelIds);
List<ModelClueTaskModel> 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<ModelClueTaskModel>().setRecords(list).setTotal(page.getTotal());
Page<ModelClueTaskModel> page = baseMapper.queryPage(Page.of(param.getCurrent(), param.getSize()), queryWrapper);
return page;
}
}

2
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,

Loading…
Cancel
Save