@@ -67,5 +67,15 @@ public class AccidentController { | |||
return accidentService.notice(); | |||
} | |||
/** | |||
* 事故告警提示 | |||
* @param accidentId | |||
* @return | |||
*/ | |||
@GetMapping("/tips/{accidentId}") | |||
public JsonResult getTips(@PathVariable("accidentId") String accidentId){ | |||
return accidentService.getTips(accidentId); | |||
} | |||
} |
@@ -0,0 +1,31 @@ | |||
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; | |||
} | |||
} |
@@ -47,7 +47,7 @@ public class AccidentNoticeService { | |||
throw new ServiceException("当前用户id为空"); | |||
} | |||
if(StringUtils.isEmpty(tenantId)){ | |||
throw new ServiceException("当前用户租户id为空"); | |||
throw new ServiceException("当前用户的租户id为空"); | |||
} | |||
//查询应急表是否有应急数据 | |||
List<Accident> accidentList = accidentMapper.selectList(new LambdaQueryWrapper<Accident>() | |||
@@ -62,7 +62,8 @@ public class AccidentNoticeService { | |||
List<Accident> list = new ArrayList<>(); | |||
//获取当前用户下对应的应急已读数据 | |||
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){ | |||
return JsonResult.success(accidentList); | |||
} |
@@ -4,6 +4,7 @@ import com.tuoheng.admin.entity.Accident; | |||
import com.tuoheng.admin.mapper.AccidentMapper; | |||
import com.tuoheng.admin.query.AccidentQuery; | |||
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.QueryAccidentDetailsService; | |||
import com.tuoheng.admin.service.accident.query.QueryAccidentPageListService; | |||
@@ -33,6 +34,9 @@ public class AccidentServiceImpl extends BaseServiceImpl<AccidentMapper, Acciden | |||
@Autowired | |||
private AccidentNoticeService accidentNoticeService; | |||
@Autowired | |||
private AccidentTipsService accidentTipsService; | |||
@Override | |||
public JsonResult getPageList(QueryAccidentPageListRequest request) { | |||
return queryAccidentPageListService.getPageList(request); | |||
@@ -57,4 +61,9 @@ public class AccidentServiceImpl extends BaseServiceImpl<AccidentMapper, Acciden | |||
public JsonResult notice() { | |||
return accidentNoticeService.notice(); | |||
} | |||
@Override | |||
public JsonResult getTips(String accidentId) { | |||
return accidentTipsService.getTips(accidentId); | |||
} | |||
} |
@@ -47,4 +47,12 @@ public interface IAccidentService extends IBaseService<Accident> { | |||
* @return | |||
*/ | |||
JsonResult notice(); | |||
/** | |||
* 事故告警提示 | |||
* @param accidentId | |||
* @return | |||
*/ | |||
JsonResult getTips(String accidentId); | |||
} |