From 1305d0aa469fe7330fd2f8e9fbb10d95042571be Mon Sep 17 00:00:00 2001
From: zhangfeng <1603559716@qq.com>
Date: 星期一, 10 十月 2022 12:33:36 +0800
Subject: [PATCH] 应急系统和事故管理统计接口
---
goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/ExamineTemplateController.java | 19 ++++---------------
1 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/ExamineTemplateController.java b/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/ExamineTemplateController.java
index 7e0979c..71d034e 100644
--- a/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/ExamineTemplateController.java
+++ b/goal-manage/goal-manage-service/src/main/java/com/gkhy/safePlatform/targetDuty/controller/ExamineTemplateController.java
@@ -7,6 +7,7 @@
import com.gkhy.safePlatform.commons.utils.PageUtils;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.targetDuty.entity.ExamineItem;
+import com.gkhy.safePlatform.targetDuty.entity.ExamineTemplate;
import com.gkhy.safePlatform.targetDuty.model.dto.req.ExamineTemplateQueryCriteria;
import com.gkhy.safePlatform.targetDuty.model.dto.req.ExamineTemplateSaveOrUpdate;
import com.gkhy.safePlatform.targetDuty.service.ExamineTemplateService;
@@ -17,6 +18,7 @@
import javax.annotation.Resource;
import java.io.Serializable;
+import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@@ -67,16 +69,7 @@
*/
@PostMapping(value = "/addOrUpdate")
public ResultVO update(Authentication authentication, @RequestBody ExamineTemplateSaveOrUpdate examineTemplateSaveOrUpdate) {
- if(!StringUtils.hasText(examineTemplateSaveOrUpdate.getTitle())){
- return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL,"缺少title");
- }
- // 获取当前用户
- ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
-
- //设置设定人ID和设定人部门ID
- examineTemplateSaveOrUpdate.setSetPersonDepartmentId(currentUser.getDepId());
- examineTemplateSaveOrUpdate.setSetPersonId(currentUser.getUid());
- examineTemplateService.addOrUpdate(examineTemplateSaveOrUpdate);
+ examineTemplateService.addOrUpdate(examineTemplateSaveOrUpdate,authentication);
return new ResultVO<>(ResultCodes.OK);
}
@@ -88,11 +81,7 @@
*/
@RequestMapping(value = "/delete",method = RequestMethod.POST)
public ResultVO delete(@RequestBody Long[] ids) {
- if(ids == null){
- return new ResultVO<>(ResultCodes.CLIENT_PARAM_ILLEGAL);
- }
- List<Long> idList = Arrays.asList(ids);
- this.examineTemplateService.removeByIds(idList);
+ this.examineTemplateService.delete(ids);
return new ResultVO<>(ResultCodes.OK);
}
--
Gitblit v1.9.2