return accidentService.notice(); | return accidentService.notice(); | ||||
} | } | ||||
/** | |||||
* 事故告警提示 | |||||
* @param accidentId | |||||
* @return | |||||
*/ | |||||
@GetMapping("/tips/{accidentId}") | |||||
public JsonResult getTips(@PathVariable("accidentId") String accidentId){ | |||||
return accidentService.getTips(accidentId); | |||||
} | |||||
} | } |
package com.tuoheng.admin.service; | |||||
import com.tuoheng.admin.mapper.AccidentMapper; | |||||
import com.tuoheng.common.core.utils.JsonResult; | |||||
import lombok.extern.slf4j.Slf4j; | |||||
import org.springframework.beans.factory.annotation.Autowired; | |||||
import org.springframework.stereotype.Service; | |||||
/** | |||||
* @Author ChengWang | |||||
* @Date 2023/3/14 | |||||
*/ | |||||
@Slf4j | |||||
@Service | |||||
public class AccidentTipsService { | |||||
@Autowired | |||||
private AccidentMapper accidentMapper; | |||||
/** | |||||
* 事故告警提示 | |||||
* @param accidentId | |||||
* @return | |||||
*/ | |||||
public JsonResult getTips(String accidentId) { | |||||
return null; | |||||
} | |||||
} |
throw new ServiceException("当前用户id为空"); | throw new ServiceException("当前用户id为空"); | ||||
} | } | ||||
if(StringUtils.isEmpty(tenantId)){ | if(StringUtils.isEmpty(tenantId)){ | ||||
throw new ServiceException("当前用户租户id为空"); | |||||
throw new ServiceException("当前用户的租户id为空"); | |||||
} | } | ||||
//查询应急表是否有应急数据 | //查询应急表是否有应急数据 | ||||
List<Accident> accidentList = accidentMapper.selectList(new LambdaQueryWrapper<Accident>() | List<Accident> accidentList = accidentMapper.selectList(new LambdaQueryWrapper<Accident>() | ||||
List<Accident> list = new ArrayList<>(); | List<Accident> list = new ArrayList<>(); | ||||
//获取当前用户下对应的应急已读数据 | //获取当前用户下对应的应急已读数据 | ||||
List<AccidentRead> accidentReadList = accidentReadMapper.selectList(new LambdaQueryWrapper<AccidentRead>() | List<AccidentRead> accidentReadList = accidentReadMapper.selectList(new LambdaQueryWrapper<AccidentRead>() | ||||
.eq(AccidentRead::getUserId, userId).eq(AccidentRead::getStatus, 3)); | |||||
.eq(AccidentRead::getUserId, userId) | |||||
.eq(AccidentRead::getStatus, 3)); | |||||
if(CollectionUtils.isEmpty(accidentReadList) || accidentReadList.size()==0){ | if(CollectionUtils.isEmpty(accidentReadList) || accidentReadList.size()==0){ | ||||
return JsonResult.success(accidentList); | return JsonResult.success(accidentList); | ||||
} | } |
import com.tuoheng.admin.mapper.AccidentMapper; | import com.tuoheng.admin.mapper.AccidentMapper; | ||||
import com.tuoheng.admin.query.AccidentQuery; | import com.tuoheng.admin.query.AccidentQuery; | ||||
import com.tuoheng.admin.request.accident.QueryAccidentPageListRequest; | import com.tuoheng.admin.request.accident.QueryAccidentPageListRequest; | ||||
import com.tuoheng.admin.service.AccidentTipsService; | |||||
import com.tuoheng.admin.service.accident.query.QueryAccidentByIdService; | import com.tuoheng.admin.service.accident.query.QueryAccidentByIdService; | ||||
import com.tuoheng.admin.service.accident.query.QueryAccidentDetailsService; | import com.tuoheng.admin.service.accident.query.QueryAccidentDetailsService; | ||||
import com.tuoheng.admin.service.accident.query.QueryAccidentPageListService; | import com.tuoheng.admin.service.accident.query.QueryAccidentPageListService; | ||||
@Autowired | @Autowired | ||||
private AccidentNoticeService accidentNoticeService; | private AccidentNoticeService accidentNoticeService; | ||||
@Autowired | |||||
private AccidentTipsService accidentTipsService; | |||||
@Override | @Override | ||||
public JsonResult getPageList(QueryAccidentPageListRequest request) { | public JsonResult getPageList(QueryAccidentPageListRequest request) { | ||||
return queryAccidentPageListService.getPageList(request); | return queryAccidentPageListService.getPageList(request); | ||||
public JsonResult notice() { | public JsonResult notice() { | ||||
return accidentNoticeService.notice(); | return accidentNoticeService.notice(); | ||||
} | } | ||||
@Override | |||||
public JsonResult getTips(String accidentId) { | |||||
return accidentTipsService.getTips(accidentId); | |||||
} | |||||
} | } |
* @return | * @return | ||||
*/ | */ | ||||
JsonResult notice(); | JsonResult notice(); | ||||
/** | |||||
* 事故告警提示 | |||||
* @param accidentId | |||||
* @return | |||||
*/ | |||||
JsonResult getTips(String accidentId); | |||||
} | } |