Browse Source

1. 完善首页预警提醒回复功能。

2. 预警问题 预警问题:区分已处理数据是否签收、办理、已办结等关键流程节点,并支持搜索
main
wxc 12 months ago
parent
commit
717d729870
  1. 4
      src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java
  2. 22
      src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java
  3. 2
      src/main/java/com/biutag/supervision/pojo/entity/AlarmNotification.java
  4. 3
      src/main/java/com/biutag/supervision/pojo/model/ModelClueModel.java
  5. 4
      src/main/java/com/biutag/supervision/pojo/param/ModelClueQueryParam.java
  6. 3
      src/main/java/com/biutag/supervision/service/BaseRoleService.java
  7. 17
      src/main/java/com/biutag/supervision/service/ModelClueService.java
  8. 1
      src/main/java/com/biutag/supervision/service/NegativeService.java
  9. 3
      src/main/resources/mapper/ModelClueMapper.xml

4
src/main/java/com/biutag/supervision/constants/enums/TimeLimitEnum.java

@ -9,8 +9,8 @@ import lombok.Getter;
public enum TimeLimitEnum {
WORK_137("137工作制", "3+7", 1, 3, 7),
WORK_10_10("10+10工作制", "10+10", 1, 10, 10),
WORK_14_7("14+7工作制", "14+7", 1, 14, 7),
WORK_145("145工作制", "4+5", 1, 4, 5),
WORK_30_30("30+30工作制", "30+30", 1, 30, 30),
OTHER("其他", "other", null, null, null);
private String label;

22
src/main/java/com/biutag/supervision/controller/work/AlarmNotificationController.java

@ -1,28 +1,25 @@
package com.biutag.supervision.controller.work;
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.pojo.Result;
import com.biutag.supervision.pojo.entity.AlarmFile;
import com.biutag.supervision.pojo.entity.AlarmNotification;
import com.biutag.supervision.pojo.entity.Negative;
import com.biutag.supervision.pojo.entity.SupDepart;
import com.biutag.supervision.pojo.enums.NotificationType;
import com.biutag.supervision.pojo.param.AlarmParam;
import com.biutag.supervision.service.AlarmNotificationService;
import com.biutag.supervision.service.ProblemSourceService;
import com.biutag.supervision.service.SupDepartService;
import com.biutag.supervision.util.CompletableUtils.CompletableFutureUtil;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
/**
* 预警提醒
@ -66,15 +63,12 @@ public class AlarmNotificationController {
* @return 是否成功
*/
@PostMapping("/reply")
public Result<Void> alarmNotificationReply(@RequestBody AlarmNotification data) {
AlarmNotification notification = new AlarmNotification();
if(data.getId() == null) {
return Result.failed(5000, "未找到对用数据");
}
notification.setId(data.getId());
notification.setReplyResultContent(data.getReplyResultContent());
notification.setReplyState(1);
boolean res = notificationService.updateById(notification);
public Result<Void> alarmNotificationReply(@RequestBody @Valid AlarmNotification data) {
LambdaUpdateWrapper<AlarmNotification> updateWrapper = new LambdaUpdateWrapper<AlarmNotification>().eq(AlarmNotification::getId, data.getId())
.set(AlarmNotification::getReplyState, 1)
.set(AlarmNotification::getReplyResultContent, data.getReplyResultContent())
.set(AlarmNotification::getUpdTime, LocalDateTime.now());
boolean res = notificationService.update(updateWrapper);
if(!res) {
return Result.failed(5000, "回复失败");
}

2
src/main/java/com/biutag/supervision/pojo/entity/AlarmNotification.java

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.io.Serial;
@ -28,6 +29,7 @@ public class AlarmNotification implements Serializable {
/**
* 主键
*/
@NotNull
@TableId(value = "id", type = IdType.AUTO)
private Integer id;

3
src/main/java/com/biutag/supervision/pojo/model/ModelClueModel.java

@ -50,4 +50,7 @@ public class ModelClueModel {
private String status;
// 办理状态
private String processingStatus;
}

4
src/main/java/com/biutag/supervision/pojo/param/ModelClueQueryParam.java

@ -26,4 +26,8 @@ public class ModelClueQueryParam extends BasePage {
private String thingDesc;
private String distributionState;
private String distributionMethod;
// 办理状态
private String processingStatus;
}

3
src/main/java/com/biutag/supervision/service/BaseRoleService.java

@ -21,6 +21,9 @@ public class BaseRoleService extends ServiceImpl<BaseRoleMapper, BaseRole> {
public List<BaseRole> listByUserId(String userId) {
List<BaseRoleUser> baseRoleUsers = roleUserService.listByUserId(userId);
if (baseRoleUsers.isEmpty()) {
throw new RuntimeException("该用户尚未配置角色,请联系系统管理员!");
}
return listByIds(baseRoleUsers.stream().map(BaseRoleUser::getRoleId).toList());
}

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

@ -18,7 +18,6 @@ import com.biutag.supervision.pojo.param.ModelClueQueryParam;
import com.biutag.supervision.pojo.vo.FileVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -61,8 +60,6 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
private final StatisticsDepartMapper statisticsDepartMapper;
private final RedisTemplate<Object, Object> redisTemplate;
private final RiskTestMapper riskTestMapper;
public Page<ModelClueModel> page(ModelClueQueryParam param) {
@ -76,6 +73,9 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
.eq(StrUtil.isNotBlank(param.getDistributionState()), "mc.distribution_state", param.getDistributionState())
.like(StrUtil.isNotBlank(param.getThingDesc()), "mc.thing_desc", param.getThingDesc())
.orderByDesc("mc.create_time");
if (DistributionStateEnum.DISTRIBUTED.getValue().equals(param.getDistributionState())) {
queryWrapper.eq(StrUtil.isNotBlank(param.getProcessingStatus()), "n.processing_status", param.getProcessingStatus());
}
if (Objects.nonNull(param.getCreateTime()) && param.getCreateTime().size() == 2) {
queryWrapper.between("mc.create_time", param.getCreateTime().get(0), param.getCreateTime().get(1));
}
@ -166,7 +166,7 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
negative.setBusinessTypeCode(BusinessTypeEnum.QT.getValue());
negative.setBusinessTypeName(BusinessTypeEnum.QT.getLabel());
}
negative.setBusinessTypeCode(model.getPoliceType());
negative.setPoliceType(model.getPoliceType());
if (StrUtil.isNotBlank(model.getInvolveProblem())) {
negative.setInvolveProblem(Arrays.stream(model.getInvolveProblem().split(",")).toList());
@ -184,13 +184,18 @@ public class ModelClueService extends ServiceImpl<ModelClueMapper, ModelClue> {
negative.setHostLevel(HostLevelEnums.THREE.getValue());
negative.setThingFiles(thingFiles);
// 办理单位
SupDepart depart = departService.getById(item.getInvolveDepartId());
SupDepart depart;
if (Objects.isNull(model.getHandleDepartId())) {
depart = departService.getById(item.getInvolveDepartId());
} else {
depart = departService.getById(model.getHandleDepartId());
}
if (depart.getLevel().equals(DepartLevelEnum.SECOND.getValue())) {
negative.setDepartId(depart.getId());
negative.setDepartName(depart.getShortName());
}
if (depart.getLevel().equals(DepartLevelEnum.THREE.getValue()) && Objects.equals(model.getDistributionFlow(), DistributionFlowEnum.SECOND.getValue())) {
SupDepart parentDepart = departService.getParentDepart(item.getInvolveDepartId());
SupDepart parentDepart = departService.getParentDepart(depart.getId());
negative.setDepartId(parentDepart.getId());
negative.setDepartName(parentDepart.getShortName());
}

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

@ -239,6 +239,7 @@ public class NegativeService extends ServiceImpl<NegativeMapper, Negative> {
FirstDistributeData firstDistributeData = new FirstDistributeData();
BeanUtil.copyProperties(negativeDto, firstDistributeData);
firstDistributeData.setDepartId(negativeDto.getDepartId());
ActionDto actionDto = new ActionDto()
.setActionKey(FlowActionEnum.FIRST_DISTRIBUTE.getKey())
.setActionName(FlowActionEnum.FIRST_DISTRIBUTE.getName())

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

@ -5,10 +5,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.biutag.supervision.mapper.ModelClueMapper">
<select id="queryPage" resultType="com.biutag.supervision.pojo.model.ModelClueModel">
select *, m.model_name, d1.short_name involve_parent_depart_name from model_clue mc
select *, m.model_name, d1.short_name involve_parent_depart_name, n.processing_status from model_clue mc
left join model m on mc.model_id = m.id
left join sup_depart d on mc.involve_depart_id = d.id
left join sup_depart d1 on d.pid = d1.id
left join negative n on mc.negative_id = n.id
${ew.getCustomSqlSegment}
</select>

Loading…
Cancel
Save