From d99a56e37cf9109b46ee68d34a06594ef5615ed3 Mon Sep 17 00:00:00 2001 From: 张天森 <1292933220@qq.com> Date: 星期四, 10 十一月 2022 16:06:05 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/huacheng_test' into huacheng_test --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoEventApi.java | 25 +++++++++++++++++++++---- 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoEventApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoEventApi.java index 95c5daa..b8e6fed 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoEventApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoEventApi.java @@ -6,11 +6,14 @@ import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.dtos.community.sanshuo.ComMediateTypeDTO; import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoEventDTO; +import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO; import com.panzhihua.common.model.vos.R; +import com.panzhihua.service_community.entity.ComEvent; import com.panzhihua.service_community.entity.ComMediateType; import com.panzhihua.service_community.entity.ComSanshuoEvent; import com.panzhihua.service_community.service.ComSanShuoEventService; import com.panzhihua.service_community.service.CommediateTypeService; +import com.panzhihua.service_community.service.IComEventService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; @@ -32,6 +35,9 @@ @Resource private CommediateTypeService commediateTypeService; + @Resource + private IComEventService comEventService; + @GetMapping ("/list") public R list(@RequestParam(value = "keyWord",required = false)String keyWord, @RequestParam(value = "page",required = false)Integer page, @@ -46,15 +52,17 @@ @GetMapping("/appletsList") public R appletList(){ - return R.ok(commediateTypeService.list(new QueryWrapper<ComMediateType>().eq("enabled",1))); + return R.ok(commediateTypeService.list(new QueryWrapper<ComMediateType>().eq("enabled",1).eq("delete_flag", 0))); } + + /** * 新增事件类型 * */ @PostMapping public R add(@RequestBody ComMediateTypeDTO comMediateTypeDTO){ - //comMediateTypeDTO.setCreateUser(this.getLoginUserInfo().getUserId()); + comMediateTypeDTO.setCreateUser(this.getLoginUserInfo().getUserId()); return commediateTypeService.addOrUpdate(comMediateTypeDTO); } @@ -63,9 +71,10 @@ * */ @PutMapping public R update(@RequestBody ComMediateTypeDTO comMediateTypeDTO){ - //comMediateTypeDTO.setModifyUser(this.getLoginUserInfo().getUserId()); + comMediateTypeDTO.setModifyUser(this.getLoginUserInfo().getUserId()); return commediateTypeService.addOrUpdate(comMediateTypeDTO); } + /** * 删除事件 @@ -75,7 +84,15 @@ ComMediateType comMediateType = commediateTypeService.getById(id); comMediateType.setDeleteFlag(true); comMediateType.setEnabled(false); - //comMediateType.setModifyUser(this.getLoginUserInfo().getUserId()); + comMediateType.setModifyUser(this.getLoginUserInfo().getUserId()); + //该分类是否有未调解完成事件 + List<ComEvent> list = comEventService.list(new QueryWrapper<ComEvent>().lambda().eq(ComEvent::getEventCategory, id).in(ComEvent::getEventProcessStatus, (1), (2), (5))); + if (list.size() != 0){ + return R.fail("有未处理完成事件,无法删除"); + } return R.ok(commediateTypeService.updateById(comMediateType)); } + + + } -- Gitblit v1.7.1