From 6e72545fc4ff922354192b16eb14e92c1e1f75c1 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期二, 16 七月 2024 09:49:47 +0800
Subject: [PATCH] 登录空指针异常
---
src/main/java/com/mindskip/xzs/controller/admin/DepartmentExamineController.java | 24 +++++++++++++++++++++---
1 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/mindskip/xzs/controller/admin/DepartmentExamineController.java b/src/main/java/com/mindskip/xzs/controller/admin/DepartmentExamineController.java
index 8205e50..c005913 100644
--- a/src/main/java/com/mindskip/xzs/controller/admin/DepartmentExamineController.java
+++ b/src/main/java/com/mindskip/xzs/controller/admin/DepartmentExamineController.java
@@ -5,13 +5,18 @@
import com.mindskip.xzs.base.BaseApiController;
import com.mindskip.xzs.base.RestResponse;
import com.mindskip.xzs.domain.DepartmentExamine;
+import com.mindskip.xzs.domain.Notify;
+import com.mindskip.xzs.domain.enums.NotifyRefType;
import com.mindskip.xzs.domain.vo.DepartmentExamineVO;
-import com.mindskip.xzs.service.IDepartmentExamineService;
+import com.mindskip.xzs.service.DepartmentExamineService;
+import com.mindskip.xzs.service.NotifyService;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDateTime;
+import java.util.Date;
/**
* <p>
@@ -26,7 +31,8 @@
@RequiredArgsConstructor
public class DepartmentExamineController extends BaseApiController {
- private final IDepartmentExamineService departmentExamineService;
+ private final DepartmentExamineService departmentExamineService;
+ private final NotifyService notifyService;
@RequestMapping(value = "list", method = RequestMethod.POST)
public RestResponse<PageInfo<DepartmentExamineVO>> list(@RequestBody DepartmentExamineVO departmentExamineVO) {
@@ -34,11 +40,23 @@
return RestResponse.ok(departmentExamineService.pageInfo(departmentExamineVO));
}
+ @Transactional(rollbackFor = Exception.class)
@RequestMapping(value = "save", method = RequestMethod.POST)
public RestResponse<Boolean> save(@RequestBody DepartmentExamine departmentExamine) {
departmentExamine.setCreateTime(LocalDateTime.now());
departmentExamine.setCreateUser(getCurrentUser().getId());
- return RestResponse.ok(departmentExamineService.save(departmentExamine));
+
+ departmentExamineService.save(departmentExamine);
+
+ // 娣诲姞閫氱煡
+ Notify notify = new Notify();
+ notify.setCreateTime(new Date());
+ notify.setReadStatus(2);
+ notify.setRefId(departmentExamine.getId());
+ notify.setRefType(NotifyRefType.FEEDBACK.getValue());
+ notify.setCreateUserId(webContext.getCurrentUser().getId());
+ notifyService.add(notify);
+ return RestResponse.ok();
}
@RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
--
Gitblit v1.8.0