Browse Source

事故告警提示接口

tags/v1.2.0^2
chengwang 1 year ago
parent
commit
c1b2d2f2c0
5 changed files with 61 additions and 2 deletions
  1. +10
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/AccidentController.java
  2. +31
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/AccidentTipsService.java
  3. +3
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/AccidentNoticeService.java
  4. +9
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/AccidentServiceImpl.java
  5. +8
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/IAccidentService.java

+ 10
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/controller/AccidentController.java View File

return accidentService.notice(); return accidentService.notice();
} }


/**
* 事故告警提示
* @param accidentId
* @return
*/
@GetMapping("/tips/{accidentId}")
public JsonResult getTips(@PathVariable("accidentId") String accidentId){
return accidentService.getTips(accidentId);
}



} }

+ 31
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/AccidentTipsService.java View File

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;
}
}

+ 3
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/AccidentNoticeService.java View File

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);
} }

+ 9
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/AccidentServiceImpl.java View File

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);
}
} }

+ 8
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/IAccidentService.java View File

* @return * @return
*/ */
JsonResult notice(); JsonResult notice();

/**
* 事故告警提示
* @param accidentId
* @return
*/
JsonResult getTips(String accidentId);

} }

Loading…
Cancel
Save