Browse Source

修改预警弹窗下发通知接口

tags/v1.2.0^2
chengwang 1 year ago
parent
commit
49c6169e11
3 changed files with 18 additions and 3 deletions
  1. +9
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/AccidentNoticeService.java
  2. +2
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/TimeAxisService.java
  3. +7
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/accident/AccidentTimeAxisVo.java

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

*/ */
public JsonResult notice() { public JsonResult notice() {
//当前登录用户 //当前登录用户
String tenantId = CurrentUserUtil.getTenantId();
String userId = CurrentUserUtil.getUserId();
// String tenantId = CurrentUserUtil.getTenantId();
// String userId = CurrentUserUtil.getUserId();
String userId = "e1df76387f28b93a523c97a3e0cf27f9";
String tenantId = "0";
if(StringUtils.isEmpty(userId)){ if(StringUtils.isEmpty(userId)){
throw new ServiceException("当前用户id为空"); throw new ServiceException("当前用户id为空");
} }
} }
List<String> accidentIdList = oldList.stream().map(o -> o.getId()).collect(Collectors.toList()); List<String> accidentIdList = oldList.stream().map(o -> o.getId()).collect(Collectors.toList());
newList = accidentMapper.selectList(Wrappers.<Accident>lambdaQuery() newList = accidentMapper.selectList(Wrappers.<Accident>lambdaQuery()
.notIn(Accident::getId, accidentIdList));
.notIn(Accident::getId, accidentIdList)
.eq(Accident::getTenantId, tenantId)
.eq(Accident::getStatus, AccidentStatusEnum.UNTREATED.getCode())
.eq(Accident::getFlag, FlagEnum.INSPECTION_ACCIDENT.getCode())
.eq(Accident::getMark, MarkEnum.VALID.getCode()));


//对应list集合排序 //对应list集合排序
newList = newList.stream().sorted(Comparator.comparing(Accident::getCreateTime)).collect(Collectors.toList()); newList = newList.stream().sorted(Comparator.comparing(Accident::getCreateTime)).collect(Collectors.toList());

+ 2
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/TimeAxisService.java View File

if(accident.getReportTime() != null){ if(accident.getReportTime() != null){
vo.setReportTime(accident.getReportTime()); vo.setReportTime(accident.getReportTime());
} }
//忽略时间

//无事故时间 //无事故时间
if(accident.getNoAccidentTime() != null){ if(accident.getNoAccidentTime() != null){
vo.setNoAccidentTime(accident.getNoAccidentTime()); vo.setNoAccidentTime(accident.getNoAccidentTime());

+ 7
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/accident/AccidentTimeAxisVo.java View File

@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date verificationTime; private Date verificationTime;


/**
* 忽略时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date ignoreTime;

/** /**
* 上报时间 * 上报时间
*/ */

Loading…
Cancel
Save