From 70d2a5d0f9c6951b2d4cac954041ed73582ff7eb Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期一, 09 六月 2025 11:54:00 +0800 Subject: [PATCH] 6.9新增登录失败冻结逻辑 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoIndustryCenterApi.java | 60 +++++++++++++++++++++++++++++++++++++++++------------------- 1 files changed, 41 insertions(+), 19 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoIndustryCenterApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoIndustryCenterApi.java index f0e2ca0..72fd105 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoIndustryCenterApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoIndustryCenterApi.java @@ -1,53 +1,75 @@ package com.panzhihua.service_community.api; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.dtos.community.sanshuo.ComSanShuoIndustryCenterDTO; import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.service.user.UserService; +import com.panzhihua.service_community.entity.ComEvent; import com.panzhihua.service_community.entity.ComSanshuoIndustryCenter; import com.panzhihua.service_community.service.ComSanShuoIndustryCenterService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import com.panzhihua.service_community.service.IComEventService; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import java.util.List; + /** * 三说会堂业务中心管理控制器 - * */ + */ @RestController @RequestMapping("/sanshuo/industryCenter") public class ComSanShuoIndustryCenterApi extends BaseController { @Resource private ComSanShuoIndustryCenterService comSanShuoIndustryCenterService; + @Resource + private UserService userService; + @Resource + private IComEventService comEventService; @GetMapping("/list") - public R list(@RequestParam(value = "keyWord",required = false)String keyWord, - @RequestParam(value = "page",required = false)Integer page, - @RequestParam(value = "size",required = false)Integer size){ - return R.ok(comSanShuoIndustryCenterService.pageIndustryCenter(keyWord,page,size)); + public R list(@RequestParam(value = "keyWord", required = false) String keyWord, + @RequestParam(value = "page", required = false) Integer page, + @RequestParam(value = "size", required = false) Integer size) { + return R.ok(comSanShuoIndustryCenterService.pageIndustryCenter(keyWord, page, size)); + } + + @GetMapping("/appletsList") + public R appletsList() { + return R.ok(comSanShuoIndustryCenterService.list(new QueryWrapper<ComSanshuoIndustryCenter>().eq("status", 1).eq("del_flag", 1))); + } + + @GetMapping("/detail") + public R detail(@RequestParam Long id) { + return R.ok(comSanShuoIndustryCenterService.getById(id)); } /** * 添加业务中心 - * */ + */ @PostMapping - public R add(@RequestBody ComSanShuoIndustryCenterDTO comSanShuoIndustryCenterDTO){ + public R add(@RequestBody ComSanShuoIndustryCenterDTO comSanShuoIndustryCenterDTO) { comSanShuoIndustryCenterDTO.setCreateBy(this.getLoginUserInfo().getName()); - return R.ok(comSanShuoIndustryCenterService.addOrUpdate(comSanShuoIndustryCenterDTO)); + return comSanShuoIndustryCenterService.addOrUpdate(comSanShuoIndustryCenterDTO); } /** * 修改业务中心 - * */ + */ @PutMapping - public R update(@RequestBody ComSanShuoIndustryCenterDTO comSanShuoIndustryCenterDTO){ - return R.ok(comSanShuoIndustryCenterService.addOrUpdate(comSanShuoIndustryCenterDTO)); + public R update(@RequestBody ComSanShuoIndustryCenterDTO comSanShuoIndustryCenterDTO) { + return comSanShuoIndustryCenterService.addOrUpdate(comSanShuoIndustryCenterDTO); } /** * 删除业务中心 - * */ - @DeleteMapping("/remove/{id}") - public R remove(@PathVariable("id") Long id){ + */ + @DeleteMapping("/remove") + public R remove(@RequestParam("id") Long id) { + List<ComEvent> list = comEventService.list(new QueryWrapper<ComEvent>().lambda().eq(ComEvent::getSpecialistId, id).in(ComEvent::getEventProcessStatus, (1), (2), (5))); + if (list.size()!=0){ + return R.fail("有未调解完成事件,无法删除!"); + } ComSanshuoIndustryCenter center = comSanShuoIndustryCenterService.getById(id); center.setDelFlag(0); center.setStatus(0); @@ -56,12 +78,12 @@ /** * 重置密码 - * */ + */ @PostMapping("/resetPass") - public R resetPassword(@RequestBody ComSanShuoIndustryCenterDTO comSanShuoIndustryCenterDTO){ + public R resetPassword(@RequestBody ComSanShuoIndustryCenterDTO comSanShuoIndustryCenterDTO) { ComSanshuoIndustryCenter center = comSanShuoIndustryCenterService.getById(comSanShuoIndustryCenterDTO.getId()); center.setPassword(comSanShuoIndustryCenterDTO.getPassword()); - return R.ok(comSanShuoIndustryCenterService.updateById(center)); + return R.ok(comSanShuoIndustryCenterService.resetPassword(center)); } } -- Gitblit v1.7.1