Bladeren bron

提交应急事件忽略代码

develop
wanjing 9 maanden geleden
bovenliggende
commit
d59a801e2d
1 gewijzigde bestanden met toevoegingen van 13 en 14 verwijderingen
  1. +13
    -14
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/ignore/AccidentIgnoreService.java

+ 13
- 14
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/ignore/AccidentIgnoreService.java Bestand weergeven

@@ -32,7 +32,7 @@ public class AccidentIgnoreService {
private AccidentMapper accidentMapper;

public JsonResult ignore(List<String> idList) {
// log.info("进入忽略事故业务, id={}", id);
// log.info("进入忽略事故业务, idList={}", idList);
User user = CurrentUserUtil.getUserInfo();
String userId = user.getId();
String tenantId = user.getTenantId();
@@ -41,9 +41,9 @@ public class AccidentIgnoreService {
log.info("忽略事故业务:校验失败:{}", result.getMsg());
return result;
}
Accident accident = (Accident) result.getData();
List<Accident> accidentList = (List<Accident>) result.getData();

this.updateAccident(userId, accident);
this.updateAccident(userId, accidentList);

return JsonResult.success();
}
@@ -66,7 +66,6 @@ public class AccidentIgnoreService {
if (CollectionUtil.isEmpty(accidentList)) {
throw new ServiceException("应急事件不存在");
}

for (Accident accident : accidentList) {
if (AccidentStatusEnum.UNTREATED.getCode() != accident.getStatus()) {
log.info("未处理的应急事件才能忽略, accidentId={}", accident.getId());
@@ -82,16 +81,16 @@ public class AccidentIgnoreService {
* @param userId
* @param userId
*/
private void updateAccident(String userId, Accident accident) {
Accident accidentUpdate = new Accident();
accidentUpdate.setId(accident.getId());
accidentUpdate.setStatus(AccidentStatusEnum.IGNORED.getCode());
accidentUpdate.setUpdateUser(userId);
accidentUpdate.setUpdateTime(DateUtils.now());
accidentUpdate.setIgnoreTime(DateUtils.now());
Integer count = accidentMapper.updateById(accidentUpdate);
if (count <= 0) {
log.info("事故忽略,修改预警信息失败");
private void updateAccident(String userId, List<Accident> accidentList) {
for (Accident accident : accidentList) {
accident.setStatus(AccidentStatusEnum.IGNORED.getCode());
accident.setUpdateUser(userId);
accident.setUpdateTime(DateUtils.now());
accident.setIgnoreTime(DateUtils.now());
Integer count = accidentMapper.updateById(accident);
if (count <= 0) {
log.info("事故忽略,修改预警信息失败, accidentId={}", accident.getId());
}
}
}
}

Laden…
Annuleren
Opslaan