* 消息读取标识 0:未读 1已读 | * 消息读取标识 0:未读 1已读 | ||||
*/ | */ | ||||
private Integer messageRead; | private Integer messageRead; | ||||
/** | |||||
* 对应任务的应急类型: 0:巡检任务应急记录 1:应急任务应急记录 | |||||
*/ | |||||
private Integer flag; | |||||
} | } |
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; | |||||
} |
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); | ||||
} | } | ||||
} | } |
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(); |
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)); |