@@ -77,4 +77,9 @@ public class Warning extends BaseEntity implements Serializable { | |||
* 消息读取标识 0:未读 1已读 | |||
*/ | |||
private Integer messageRead; | |||
/** | |||
* 对应任务的应急类型: 0:巡检任务应急记录 1:应急任务应急记录 | |||
*/ | |||
private Integer flag; | |||
} |
@@ -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; | |||
} |
@@ -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); | |||
} | |||
} |
@@ -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(); |
@@ -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)); |