Browse Source

Merge branch 'develop' of gitadmin/tuoheng_lc into release

tags/v1.2.0^2
chengwang 1 year ago
parent
commit
3f6fffce71
10 changed files with 119 additions and 54 deletions
  1. +3
    -3
      tuoheng-admin/src/main/java/com/tuoheng/admin/controller/WarningController.java
  2. +5
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/entity/domain/Warning.java
  3. +25
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/enums/MessageReadEnum.java
  4. +76
    -43
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java
  5. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warehouse/query/QueryWarehouseListService.java
  6. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/IWarningService.java
  7. +2
    -2
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/WarningServiceImpl.java
  8. +3
    -3
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/edit/WarningStatusService.java
  9. +1
    -1
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/ignore/WarningIgnoreService.java
  10. +2
    -0
      tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/notice/WarningNoticeService.java

+ 3
- 3
tuoheng-admin/src/main/java/com/tuoheng/admin/controller/WarningController.java View File

* @param id * @param id
* @return * @return
*/ */
@PutMapping("/status/{id}/{status}")
public JsonResult editStatusById(@PathVariable("id") Integer id,@PathVariable("status") Integer status){
return warningService.editStatusById(id,status);
@PutMapping("/messageRead/{id}")
public JsonResult editStatusById(@PathVariable("id") Integer id){
return warningService.editStatusById(id);
} }
} }

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

* 处理结果 * 处理结果
*/ */
private String checkResult; private String checkResult;

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

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

package com.tuoheng.admin.enums;

import lombok.Getter;

/**
* @Author ChengWang
* @Date 2023/3/3
*/
public enum MessageReadEnum {

MESSAGE_IS_READ(1,"已读"),
MESSAGE_IS_NO_READ(0,"未读");

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

@Getter
private int code;

@Getter
private String description;

}

+ 76
- 43
tuoheng-admin/src/main/java/com/tuoheng/admin/service/impl/ThInspectionServiceImpl.java View File

import com.tuoheng.admin.entity.domain.Tenant; import com.tuoheng.admin.entity.domain.Tenant;
import com.tuoheng.admin.entity.domain.ThInspection; import com.tuoheng.admin.entity.domain.ThInspection;
import com.tuoheng.admin.entity.domain.ThMission; import com.tuoheng.admin.entity.domain.ThMission;
import com.tuoheng.admin.entity.domain.WarningRecord;
import com.tuoheng.admin.entity.request.InspectionRequest; import com.tuoheng.admin.entity.request.InspectionRequest;
import com.tuoheng.admin.entity.request.PushAndPullURLRequest; import com.tuoheng.admin.entity.request.PushAndPullURLRequest;
import com.tuoheng.admin.entity.vo.*;
import com.tuoheng.admin.entity.vo.AirLineVO;
import com.tuoheng.admin.entity.vo.AirPortVO;
import com.tuoheng.admin.entity.vo.AirWeatherVO;
import com.tuoheng.admin.entity.vo.InspectionVO;
import com.tuoheng.admin.enums.AirportFlyTypeEnum;
import com.tuoheng.admin.enums.MarkTypeEnum; import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.TaskStatusEnum; import com.tuoheng.admin.enums.TaskStatusEnum;
import com.tuoheng.admin.enums.UpdateOrCreateEnum; import com.tuoheng.admin.enums.UpdateOrCreateEnum;
import com.tuoheng.admin.mapper.TenantMapper; import com.tuoheng.admin.mapper.TenantMapper;
import com.tuoheng.admin.mapper.ThInspectionMapper; import com.tuoheng.admin.mapper.ThInspectionMapper;
import com.tuoheng.admin.mapper.ThMissionMapper; import com.tuoheng.admin.mapper.ThMissionMapper;
import com.tuoheng.admin.mapper.WarningRecordMapper;
import com.tuoheng.admin.service.IMissionService; import com.tuoheng.admin.service.IMissionService;
import com.tuoheng.admin.service.IThInspectionService; import com.tuoheng.admin.service.IThInspectionService;
import com.tuoheng.common.common.BaseServiceImpl; import com.tuoheng.common.common.BaseServiceImpl;


import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;


@Autowired @Autowired
private IMissionService missionService; private IMissionService missionService;


@Autowired
private WarningRecordMapper warningRecordMapper;

@Override @Override
public List<InspectionVO> track(Integer id) { public List<InspectionVO> track(Integer id) {
ThMission mission = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getId, id)
.eq(ThMission::getMark, 1));


LambdaQueryWrapper<ThInspection> lambdaQueryWrapper=new LambdaQueryWrapper<>();
if (AirportFlyTypeEnum.POINTING_FLIGHT.getCode() == mission.getAirportFlyType()) {
// 定点飞行
WarningRecord warningRecord = warningRecordMapper.selectOne(new LambdaQueryWrapper<WarningRecord>()
.eq(WarningRecord::getEmergencyMissionId, id)
.eq(WarningRecord::getMark, MarkTypeEnum.VALID.getCode()));
if (ObjectUtil.isNull(warningRecord)) {
throw new ServiceException("该应急任务没有对应的预警记录");
}
ThMission oldMission = missionMapper.selectOne(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getId, warningRecord.getMissionId())
.eq(ThMission::getMark, MarkTypeEnum.VALID.getCode()));
if (ObjectUtil.isNull(oldMission)) {
throw new ServiceException("该应急任务没有对应的巡检任务记录");
}
if (mission.getAirportId().equals(oldMission.getAirportId())) {
// 原机场执行的应急任务,在查看应急任务轨迹时,查询的是原巡检任务的轨迹
id = oldMission.getId();
log.info("该任务是应急任务,执行的是原机场,id={}", id);
} else {
log.info("该任务是应急任务,执行的是新机场,id={}", id);
}
}


lambdaQueryWrapper.eq(ThInspection::getMissionId,id)
LambdaQueryWrapper<ThInspection> lambdaQueryWrapper = new LambdaQueryWrapper<>();

lambdaQueryWrapper.eq(ThInspection::getMissionId, id)
.orderByAsc(ThInspection::getCreateTime); .orderByAsc(ThInspection::getCreateTime);
List<InspectionVO> result=new ArrayList<>();
List<InspectionVO> result = new ArrayList<>();
List<ThInspection> thInspections = inspectionMapper.selectList(lambdaQueryWrapper); List<ThInspection> thInspections = inspectionMapper.selectList(lambdaQueryWrapper);


for (ThInspection thInspection : thInspections) { for (ThInspection thInspection : thInspections) {
InspectionVO inspectionVO=new InspectionVO();
BeanUtils.copyProperties(thInspection,inspectionVO);
InspectionVO inspectionVO = new InspectionVO();
BeanUtils.copyProperties(thInspection, inspectionVO);
result.add(inspectionVO); result.add(inspectionVO);
} }
return result; return result;
} }



@Override @Override
public Integer track(InspectionRequest inspectionRequest) throws ServiceException { public Integer track(InspectionRequest inspectionRequest) throws ServiceException {
ThInspection inspection=new ThInspection(UpdateOrCreateEnum.CREATE.getCode());
BeanUtils.copyProperties(inspectionRequest,inspection);
ThInspection inspection = new ThInspection(UpdateOrCreateEnum.CREATE.getCode());
BeanUtils.copyProperties(inspectionRequest, inspection);
//获取当前巡检正在执行的任务 //获取当前巡检正在执行的任务
List<ThMission> thMissions = missionMapper.selectList(new LambdaQueryWrapper<ThMission>() List<ThMission> thMissions = missionMapper.selectList(new LambdaQueryWrapper<ThMission>()
.eq(ThMission::getInspectionLine, inspectionRequest.getInspectionId())
.eq(ThMission::getStatus, TaskStatusEnum.FLIGHT.getCode())
.eq(ThMission::getMark, MarkTypeEnum.VALID.getCode()).orderByAsc(ThMission::getExecutionStartTime));
if(ObjectUtil.isEmpty(thMissions) || thMissions.size()==0){
throw new ServiceException(HttpStatus.BAD_REQUEST.value(),"没有正在飞行的任务!");
.eq(ThMission::getInspectionLine, inspectionRequest.getInspectionId())
.eq(ThMission::getStatus, TaskStatusEnum.FLIGHT.getCode())
.eq(ThMission::getMark, MarkTypeEnum.VALID.getCode()).orderByAsc(ThMission::getExecutionStartTime));
if (ObjectUtil.isEmpty(thMissions) || thMissions.size() == 0) {
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "没有正在飞行的任务!");
} }
ThMission mission = thMissions.get(0); ThMission mission = thMissions.get(0);
inspection.setMissionId(mission.getId()); inspection.setMissionId(mission.getId());
} }


@Override @Override
public List<AirPortVO> airport() throws ServiceException, UnsupportedEncodingException {
public List<AirPortVO> airport() throws ServiceException, UnsupportedEncodingException {
//这边需要配置到yml文件里面 //这边需要配置到yml文件里面
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId());
String url = tenant.getAirportUrl() +"/api/airportInterface/airportList";
String url = tenant.getAirportUrl() + "/api/airportInterface/airportList";
String param = "page=1&limit=1000&tenantCode=" + tenant.getCode(); String param = "page=1&limit=1000&tenantCode=" + tenant.getCode();
log.info("****** airportList param tenantCode:{}", tenant.getCode()); log.info("****** airportList param tenantCode:{}", tenant.getCode());
String airPortStr = HttpUtils.sendGet(url, param); String airPortStr = HttpUtils.sendGet(url, param);
JsonResult jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class); JsonResult jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class);
if(ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(jsonResult.getData()) &&jsonResult.getCode() != 0)) {
if (ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(jsonResult.getData()) && jsonResult.getCode() != 0)) {
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取机场信息失败,请重试"); throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取机场信息失败,请重试");
} }
return JSONObject.parseArray(JSONObject.parseObject(JSONObject.toJSONString(jsonResult.getData())).get("records").toString(), AirPortVO.class); return JSONObject.parseArray(JSONObject.parseObject(JSONObject.toJSONString(jsonResult.getData())).get("records").toString(), AirPortVO.class);
public List<AirLineVO> airLine(Integer droneId) throws ServiceException { public List<AirLineVO> airLine(Integer droneId) throws ServiceException {
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId());
//这边需要配置到yml文件里面 //这边需要配置到yml文件里面
String url = tenant.getAirportUrl() +"/api/airportInterface/taskByDroneId";
String param="page=1&limit=100&droneId="+droneId;
String url = tenant.getAirportUrl() + "/api/airportInterface/taskByDroneId";
String param = "page=1&limit=100&droneId=" + droneId;
String airPortStr = HttpUtils.sendGet(url, param); String airPortStr = HttpUtils.sendGet(url, param);
JsonResult<AirLineVO> jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class); JsonResult<AirLineVO> jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class);
if(ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(Objects.requireNonNull(jsonResult).getData()) && jsonResult.getCode() != 0)) {
if (ObjectUtil.isEmpty(jsonResult) || (!ObjectUtil.isEmpty(Objects.requireNonNull(jsonResult).getData()) && jsonResult.getCode() != 0)) {
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取航线信息失败,请重试"); throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取航线信息失败,请重试");
} }
return JSONObject.parseArray(JSONObject.parseObject(JSONObject.toJSONString(jsonResult.getData())).get("records").toString(), AirLineVO.class); return JSONObject.parseArray(JSONObject.parseObject(JSONObject.toJSONString(jsonResult.getData())).get("records").toString(), AirLineVO.class);
} }


@Override @Override
public JsonResult executeTask(String missionId,PushAndPullURLRequest pushAndPull) throws ServiceException{
public JsonResult executeTask(String missionId, PushAndPullURLRequest pushAndPull) throws ServiceException {
log.info("executeTask准备就绪"); log.info("executeTask准备就绪");
ThMission thMission = missionMapper.selectById(Integer.parseInt(missionId)); ThMission thMission = missionMapper.selectById(Integer.parseInt(missionId));
log.info("mission查询完成"); log.info("mission查询完成");
try { try {
airPortStr = HttpUtils.doSend(url, jsonObject, null, "POST"); airPortStr = HttpUtils.doSend(url, jsonObject, null, "POST");
} catch (Exception e) { } catch (Exception e) {
log.error("调用机场executeTask接口异常:",e);
log.error("调用机场executeTask接口异常:", e);
return JsonResult.error("调用机场executeTask接口异常"); return JsonResult.error("调用机场executeTask接口异常");
} }
if(StringUtils.isEmpty(airPortStr)){
if (StringUtils.isEmpty(airPortStr)) {
return JsonResult.error("机场接口返回数据为空"); return JsonResult.error("机场接口返回数据为空");
} }
JsonResult jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class); JsonResult jsonResult = JacksonUtil.json2pojo(airPortStr, JsonResult.class);
} }


@Override @Override
public AirWeatherVO getWeather(Integer airportId) throws ServiceException{
public AirWeatherVO getWeather(Integer airportId) throws ServiceException {
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId());
//这边需要配置到yml文件里面 //这边需要配置到yml文件里面
String url = tenant.getAirportUrl() + "/api/airportInterface/getWeather"; String url = tenant.getAirportUrl() + "/api/airportInterface/getWeather";
String param="airportId="+airportId;
String param = "airportId=" + airportId;
String weatherStr = HttpUtils.sendGet(url, param); String weatherStr = HttpUtils.sendGet(url, param);
JsonResult jsonResult; JsonResult jsonResult;
try { try {
if (ObjectUtil.isEmpty(jsonResult) || Objects.requireNonNull(jsonResult).getCode() != 0) { if (ObjectUtil.isEmpty(jsonResult) || Objects.requireNonNull(jsonResult).getCode() != 0) {
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取天气信息失败,请重试"); throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取天气信息失败,请重试");
} }
if(ObjectUtil.isEmpty(jsonResult.getData())){
if (ObjectUtil.isEmpty(jsonResult.getData())) {
return new AirWeatherVO(); return new AirWeatherVO();
} }
return JSONObject.parseObject(JSONObject.toJSONString(jsonResult.getData()),AirWeatherVO.class);
}catch (Exception e){
return JSONObject.parseObject(JSONObject.toJSONString(jsonResult.getData()), AirWeatherVO.class);
} catch (Exception e) {
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取天气信息失败,请重试"); throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取天气信息失败,请重试");
} }
} }
public JsonResult lineTrack(Integer missionId) { public JsonResult lineTrack(Integer missionId) {
Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId()); Tenant tenant = tenantMapper.selectById(ShiroUtils.getTenantId());
ThMission thMission = missionMapper.selectById(missionId); ThMission thMission = missionMapper.selectById(missionId);
Assert.notNull(thMission,"任务不能为空!");
Integer taskId= thMission.getInspectionLine();
Assert.notNull(thMission, "任务不能为空!");
Integer taskId = thMission.getInspectionLine();
//解析标准srt文件里面的坐标,调用硬件接口,返回数据 //解析标准srt文件里面的坐标,调用硬件接口,返回数据
String url = tenant.getAirportUrl() + "/api/airportInterface/getLocationById"; String url = tenant.getAirportUrl() + "/api/airportInterface/getLocationById";
String param="id="+taskId;
String param = "id=" + taskId;
String airportLine = HttpUtils.sendGet(url, param); String airportLine = HttpUtils.sendGet(url, param);
JsonResult jsonResult = JacksonUtil.json2pojo(airportLine, JsonResult.class); JsonResult jsonResult = JacksonUtil.json2pojo(airportLine, JsonResult.class);
if(ObjectUtil.isEmpty(jsonResult) || Objects.requireNonNull(jsonResult).getCode() != 0) {
if (ObjectUtil.isEmpty(jsonResult) || Objects.requireNonNull(jsonResult).getCode() != 0) {
throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取标准航线信息失败,请重试"); throw new ServiceException(HttpStatus.BAD_REQUEST.value(), "获取标准航线信息失败,请重试");
} }


JSONArray resultData = JSONArray.parseArray(JSONObject.toJSONString( jsonResult.getData()));
JSONArray resultData = JSONArray.parseArray(JSONObject.toJSONString(jsonResult.getData()));
for (Object o : resultData) { for (Object o : resultData) {
JSONObject jsonObject=(JSONObject)o;
jsonObject.put("lng",jsonObject.getString("lon"));
JSONObject jsonObject = (JSONObject) o;
jsonObject.put("lng", jsonObject.getString("lon"));
jsonObject.remove("lon"); jsonObject.remove("lon");
} }
jsonResult.setData(resultData); jsonResult.setData(resultData);


@Override @Override
public JsonResult fightData(Integer id) { public JsonResult fightData(Integer id) {
//校验
if(null == id){
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//根据任务id查询对应的遥测数据
List<ThInspection> listData = inspectionMapper.selectListByMissionId(id, ShiroUtils.getTenantId());//xz
//校验
if (null == id) {
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL);
}
//根据任务id查询对应的遥测数据
List<ThInspection> listData = inspectionMapper.selectListByMissionId(id, ShiroUtils.getTenantId());//xz


return JsonResult.success(listData);
return JsonResult.success(listData);
} }





+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warehouse/query/QueryWarehouseListService.java View File

} }


List<Warehouse> warehouseList = warehouseMapper.selectList(new LambdaQueryWrapper<Warehouse>() List<Warehouse> warehouseList = warehouseMapper.selectList(new LambdaQueryWrapper<Warehouse>()
.eq(Warehouse::getMark, MarkTypeEnum.VALID)
.eq(Warehouse::getMark, MarkTypeEnum.VALID.getCode())
.eq(Warehouse::getTenantId, request.getTenantId())); .eq(Warehouse::getTenantId, request.getTenantId()));
if (CollectionUtil.isEmpty(warehouseList)) { if (CollectionUtil.isEmpty(warehouseList)) {
log.info("仓库列表数据为空"); log.info("仓库列表数据为空");

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/IWarningService.java View File

* @param id * @param id
* @return * @return
*/ */
JsonResult editStatusById(Integer id,Integer status);
JsonResult editStatusById(Integer id);
} }

+ 2
- 2
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/WarningServiceImpl.java View File

} }


@Override @Override
public JsonResult editStatusById(Integer id,Integer status) {
return warningStatusService.editStatusById(id,status);
public JsonResult editStatusById(Integer id) {
return warningStatusService.editStatusById(id);
} }





+ 3
- 3
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/edit/WarningStatusService.java View File

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.MarkTypeEnum; import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.MessageReadEnum;
import com.tuoheng.admin.mapper.WarningMapper; import com.tuoheng.admin.mapper.WarningMapper;
import com.tuoheng.common.utils.JsonResult; import com.tuoheng.common.utils.JsonResult;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
/** /**
* 通知忽略与处理 * 通知忽略与处理
* @param id * @param id
* @param status
* @return * @return
*/ */
public JsonResult editStatusById(Integer id,Integer status) {
public JsonResult editStatusById(Integer id) {
//根据id查询并更新预警状态 //根据id查询并更新预警状态
Warning warning = warningMapper.selectById(id); Warning warning = warningMapper.selectById(id);
if(ObjectUtils.isNotEmpty(warning)){ if(ObjectUtils.isNotEmpty(warning)){
warning.setStatus(status);
warning.setMessageRead(MessageReadEnum.MESSAGE_IS_READ.getCode());
int result = warningMapper.updateById(warning); int result = warningMapper.updateById(warning);
if(result<=0){ if(result<=0){
return JsonResult.error(); return JsonResult.error();

+ 1
- 1
tuoheng-admin/src/main/java/com/tuoheng/admin/service/warning/ignore/WarningIgnoreService.java View File

private JsonResult updateStatus(User user, Integer id) { private JsonResult updateStatus(User user, Integer id) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("id", id); map.put("id", id);
map.put("status", WarningStatusEnum.CONFIRM.getCode());
map.put("status", WarningStatusEnum.IGNORE.getCode());
map.put("updateUser", user.getId()); map.put("updateUser", user.getId());
map.put("updateTime", DateUtils.now()); map.put("updateTime", DateUtils.now());
map.put("checkUser", user.getId()); map.put("checkUser", user.getId());

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

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.MarkTypeEnum; import com.tuoheng.admin.enums.MarkTypeEnum;
import com.tuoheng.admin.enums.MessageReadEnum;
import com.tuoheng.admin.enums.WarningStatusEnum; import com.tuoheng.admin.enums.WarningStatusEnum;
import com.tuoheng.admin.mapper.WarningMapper; import com.tuoheng.admin.mapper.WarningMapper;
import com.tuoheng.common.utils.JsonResult; import com.tuoheng.common.utils.JsonResult;
List<Warning> warningList = warningMapper.selectList(Wrappers.<Warning>lambdaQuery() List<Warning> warningList = warningMapper.selectList(Wrappers.<Warning>lambdaQuery()
.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::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();

Loading…
Cancel
Save