From ac31436a8da76a5388ff1700a34ea9247b8ec3d4 Mon Sep 17 00:00:00 2001 From: fengjin <1435304038@qq.com> Date: 星期四, 13 十月 2022 16:51:34 +0800 Subject: [PATCH] 1.修改bug 2.修改小程序修改相关代码 --- flower_city/src/main/java/com/dg/core/controller/TransactionEventController.java | 28 +++++++++++++++++++++++++++- 1 files changed, 27 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..a453ff3 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,16 @@ @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 +159,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, -- Gitblit v1.7.1