Bladeren bron

Merge branch 'develop' of gitadmin/tuoheng_freeway into release

tags/V1.3.3
wanjing 11 maanden geleden
bovenliggende
commit
b33cccec79
1 gewijzigde bestanden met toevoegingen van 11 en 3 verwijderingen
  1. +11
    -3
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accidentread/AccidentReadServiceImpl.java

+ 11
- 3
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accidentread/AccidentReadServiceImpl.java Bestand weergeven

@@ -1,5 +1,7 @@
package com.tuoheng.admin.service.accidentread;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.entity.AccidentRead;
import com.tuoheng.admin.enums.AccidentEnum;
import com.tuoheng.admin.mapper.AccidentReadMapper;
@@ -14,6 +16,8 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @Author ChengWang
* @Date 2023/3/2
@@ -38,8 +42,13 @@ public class AccidentReadServiceImpl implements IAccidentReadService {
}
//当前用户信息
String userId = CurrentUserUtil.getUserId();
if(StringUtils.isEmpty(userId)){
throw new ServiceException("用户id为空");
AccidentRead accidentReadOld = accidentReadMapper.selectOne(new LambdaQueryWrapper<AccidentRead>()
.eq(AccidentRead::getUserId, userId)
.eq(AccidentRead::getAccidentId, accidentId)
.last("limit 1"));
if (ObjectUtil.isNotEmpty(accidentReadOld)) {
log.info("应急记录已读已存在,userId={}, accidentId={}", userId, accidentId);
return JsonResult.success();
}
AccidentRead accidentRead = new AccidentRead();
accidentRead.setAccidentId(accidentId);
@@ -51,7 +60,6 @@ public class AccidentReadServiceImpl implements IAccidentReadService {
if(result<=0){
return JsonResult.error();
}

return JsonResult.success();
}


Laden…
Annuleren
Opslaan