Sfoglia il codice sorgente

事故告警提示接口

tags/v1.2.0^2
chengwang 1 anno fa
parent
commit
c1b2d2f2c0
5 ha cambiato i file con 61 aggiunte e 2 eliminazioni
  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 Vedi File

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


}

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

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

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

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

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

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

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

@@ -47,4 +47,12 @@ public interface IAccidentService extends IBaseService<Accident> {
* @return
*/
JsonResult notice();

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

}

Loading…
Annulla
Salva