Sfoglia il codice sorgente

Merge branch 'develop' of gitadmin/tuoheng_lc into release

tags/v1.2.0^2
chengwang 1 anno fa
parent
commit
7a911cd629
5 ha cambiato i file con 46 aggiunte e 5 eliminazioni
  1. +5
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Warning.java
  2. +25
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/enums/FlagEnum.java
  3. +12
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallBackService.java
  4. +2
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/notice/WarningNoticeService.java
  5. +2
    -5
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/query/QueryWarningPageListService.java

+ 5
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Warning.java Vedi File

@@ -77,4 +77,9 @@ public class Warning extends BaseEntity implements Serializable {
* 消息读取标识 0:未读 1已读
*/
private Integer messageRead;

/**
* 对应任务的应急类型: 0:巡检任务应急记录 1:应急任务应急记录
*/
private Integer flag;
}

+ 25
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/enums/FlagEnum.java Vedi File

@@ -0,0 +1,25 @@
package com.tuoheng.admin.enums;

import lombok.Getter;

/**
* @Author ChengWang
* @Date 2023/3/9
*/
public enum FlagEnum {

ACCIDENT(1,"应急任务应急记录"),

INSPECTION_ACCIDENT(0,"巡检任务应急记录");

FlagEnum(int code, String description){
this.code = code;
this.description = description;
}

@Getter
private int code;

@Getter
private String description;
}

+ 12
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/third/dsp/DspCallBackService.java Vedi File

@@ -2,6 +2,7 @@ package com.tuoheng.admin.service.third.dsp;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.tuoheng.admin.entity.domain.*;
import com.tuoheng.admin.entity.request.CallbackRequest;
import com.tuoheng.admin.enums.*;
@@ -197,6 +198,17 @@ public class DspCallBackService {
String gaodeAddress = GaodeUtil.getGaodeAddress(question.getLng(), question.getLat());
warning.setLocation(gaodeAddress);
}
//任务的应急类型根据任务类型进行判断
ThMission thMission = missionMapper.selectById(question.getMissionId());
if(ObjectUtils.isNotEmpty(thMission)){
if(thMission.getAccidentTask() == AccidentTaskEnum.ACCIDENT_TASK.getCode()){
warning.setFlag(FlagEnum.ACCIDENT.getCode());
}else {
warning.setFlag(FlagEnum.INSPECTION_ACCIDENT.getCode());
}
}


warningList.add(warning);
}
}

+ 2
- 0
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/notice/WarningNoticeService.java Vedi File

@@ -3,6 +3,7 @@ package com.tuoheng.admin.service.warning.notice;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.entity.domain.Warning;
import com.tuoheng.admin.enums.FlagEnum;
import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.MessageReadEnum;
import com.tuoheng.admin.enums.WarningStatusEnum;
@@ -42,6 +43,7 @@ public class WarningNoticeService {
.eq(Warning::getTenantId, tenantId)
.eq(Warning::getStatus, WarningStatusEnum.WAIT_CONFIRM.getCode())
.eq(Warning::getMessageRead, MessageReadEnum.MESSAGE_IS_NO_READ.getCode())
.eq(Warning::getFlag, FlagEnum.INSPECTION_ACCIDENT.getCode())
.eq(Warning::getMark, MarkTypeEnum.VALID.getCode()));
if(CollectionUtils.isEmpty(warningList) || warningList.size() == 0){
return JsonResult.success();

+ 2
- 5
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/query/QueryWarningPageListService.java Vedi File

@@ -7,10 +7,7 @@ import com.tuoheng.admin.common.ServiceExceptionEnum;
import com.tuoheng.admin.entity.domain.Warning;
import com.tuoheng.admin.entity.query.WarningQuery;
import com.tuoheng.admin.entity.vo.WarningVO;
import com.tuoheng.admin.enums.DiscoveryWayEnum;
import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.WarningEnum;
import com.tuoheng.admin.enums.WarningStatusEnum;
import com.tuoheng.admin.enums.*;
import com.tuoheng.admin.mapper.WarningMapper;
import com.tuoheng.common.exception.ServiceException;
import com.tuoheng.common.utils.DateUtils;
@@ -73,7 +70,7 @@ public class QueryWarningPageListService {
.eq(null != query.getDiscoveryWay(), Warning::getDiscoveryWay, query.getDiscoveryWay())
.eq(null != query.getStatus(), Warning::getStatus, query.getStatus())
.eq(Warning::getTenantId,tenantId)
.eq(Warning::getMark,MarkTypeEnum.VALID.getCode())
.eq(Warning::getFlag, FlagEnum.INSPECTION_ACCIDENT.getCode())
.between(null != query.getWaringStartTime() && null != query.getWaringEndTime(), Warning::getCreateTime, query.getWaringStartTime(), query.getWaringEndTime())
.eq(Warning::getMark, MarkTypeEnum.VALID.getCode())
.orderByDesc(Warning::getCreateTime));

Loading…
Annulla
Salva