Browse Source

Merge branch 'develop' of gitadmin/tuoheng_lc into release

tags/v1.2.0^2
chengwang 1 year ago
parent
commit
7a911cd629
5 changed files with 46 additions and 5 deletions
  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 View File

* 消息读取标识 0:未读 1已读 * 消息读取标识 0:未读 1已读
*/ */
private Integer messageRead; private Integer messageRead;

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

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

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 View File



import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; 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.domain.*;
import com.tuoheng.admin.entity.request.CallbackRequest; import com.tuoheng.admin.entity.request.CallbackRequest;
import com.tuoheng.admin.enums.*; import com.tuoheng.admin.enums.*;
String gaodeAddress = GaodeUtil.getGaodeAddress(question.getLng(), question.getLat()); String gaodeAddress = GaodeUtil.getGaodeAddress(question.getLng(), question.getLat());
warning.setLocation(gaodeAddress); 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); warningList.add(warning);
} }
} }

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

import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.tuoheng.admin.entity.domain.Warning; import com.tuoheng.admin.entity.domain.Warning;
import com.tuoheng.admin.enums.FlagEnum;
import com.tuoheng.admin.enums.MarkTypeEnum; import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.MessageReadEnum; import com.tuoheng.admin.enums.MessageReadEnum;
import com.tuoheng.admin.enums.WarningStatusEnum; import com.tuoheng.admin.enums.WarningStatusEnum;
.eq(Warning::getTenantId, tenantId) .eq(Warning::getTenantId, tenantId)
.eq(Warning::getStatus, WarningStatusEnum.WAIT_CONFIRM.getCode()) .eq(Warning::getStatus, WarningStatusEnum.WAIT_CONFIRM.getCode())
.eq(Warning::getMessageRead, MessageReadEnum.MESSAGE_IS_NO_READ.getCode()) .eq(Warning::getMessageRead, MessageReadEnum.MESSAGE_IS_NO_READ.getCode())
.eq(Warning::getFlag, FlagEnum.INSPECTION_ACCIDENT.getCode())
.eq(Warning::getMark, MarkTypeEnum.VALID.getCode())); .eq(Warning::getMark, MarkTypeEnum.VALID.getCode()));
if(CollectionUtils.isEmpty(warningList) || warningList.size() == 0){ if(CollectionUtils.isEmpty(warningList) || warningList.size() == 0){
return JsonResult.success(); return JsonResult.success();

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

import com.tuoheng.admin.entity.domain.Warning; import com.tuoheng.admin.entity.domain.Warning;
import com.tuoheng.admin.entity.query.WarningQuery; import com.tuoheng.admin.entity.query.WarningQuery;
import com.tuoheng.admin.entity.vo.WarningVO; 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.admin.mapper.WarningMapper;
import com.tuoheng.common.exception.ServiceException; import com.tuoheng.common.exception.ServiceException;
import com.tuoheng.common.utils.DateUtils; import com.tuoheng.common.utils.DateUtils;
.eq(null != query.getDiscoveryWay(), Warning::getDiscoveryWay, query.getDiscoveryWay()) .eq(null != query.getDiscoveryWay(), Warning::getDiscoveryWay, query.getDiscoveryWay())
.eq(null != query.getStatus(), Warning::getStatus, query.getStatus()) .eq(null != query.getStatus(), Warning::getStatus, query.getStatus())
.eq(Warning::getTenantId,tenantId) .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()) .between(null != query.getWaringStartTime() && null != query.getWaringEndTime(), Warning::getCreateTime, query.getWaringStartTime(), query.getWaringEndTime())
.eq(Warning::getMark, MarkTypeEnum.VALID.getCode()) .eq(Warning::getMark, MarkTypeEnum.VALID.getCode())
.orderByDesc(Warning::getCreateTime)); .orderByDesc(Warning::getCreateTime));

Loading…
Cancel
Save