From eb6fc0ebcfe457fc30f65e8dfb15b8b05bebda51 Mon Sep 17 00:00:00 2001 From: 张天森 <1292933220@qq.com> Date: 星期二, 18 十月 2022 10:17:11 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/huacheng_test' into huacheng_test --- flower_city/src/main/java/com/dg/core/controller/TransactionEventController.java | 31 ++++++++++++++++++++++++++++++- 1 files changed, 30 insertions(+), 1 deletions(-) diff --git a/flower_city/src/main/java/com/dg/core/controller/TransactionEventController.java b/flower_city/src/main/java/com/dg/core/controller/TransactionEventController.java index 66b8fda..7b14947 100644 --- a/flower_city/src/main/java/com/dg/core/controller/TransactionEventController.java +++ b/flower_city/src/main/java/com/dg/core/controller/TransactionEventController.java @@ -15,6 +15,7 @@ import com.dg.core.util.TableDataInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.*; @@ -94,6 +95,22 @@ @Authorization public ResultData insertConfig(@RequestBody TransactionEvent entity) { + if(StringUtils.isEmpty(entity.getDepartmentId())) + { + return ResultData.error("部门id不能为空"); + } + + if(StringUtils.isEmpty(entity.getMatterName())) + { + return ResultData.error("事件名称不能为空"); + } + + String id=iTransactionEventService.selectDataIfExist(entity.getDepartmentId(),entity.getMatterName()); + if(!StringUtils.isEmpty(id)) + { + return ResultData.error("事件名称已存在"); + } + return toAjax(iTransactionEventService.insertConfig(entity)); } @@ -107,6 +124,18 @@ @Authorization public ResultData updateConfig(@RequestBody TransactionEvent entity) { + if(StringUtils.isEmpty(entity.getDepartmentId())) + { + return ResultData.error("部门id不能为空"); + } + + if(StringUtils.isEmpty(entity.getMatterName())) + { + return ResultData.error("事件名称不能为空"); + } + + + return toAjax(iTransactionEventService.updateConfig(entity)); } @@ -132,7 +161,6 @@ */ @ApiOperation(value = "导办事务搜索",response = QueryResults.class) @GetMapping("/queryKeyWordList") - @Authorization public QueryResults queryMatterNameList(@RequestParam(value = "pageNum",required = false) Integer pageNum, @RequestParam(value = "pageSize",required = false) Integer pageSize, @RequestParam(value = "recommendSize",required = false) Integer recommendSize, @@ -210,4 +238,5 @@ } + } -- Gitblit v1.7.1