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/ComSanShuoExpertApi.java | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 51 insertions(+), 6 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java index cdf9908..99d1c5f 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java @@ -1,6 +1,7 @@ package com.panzhihua.service_community.api; import cn.hutool.core.bean.BeanUtil; +import com.alibaba.excel.EasyExcel; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.panzhihua.common.controller.BaseController; import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoExpertDTO; @@ -8,18 +9,22 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.user.AdministratorsUserVO; import com.panzhihua.common.service.user.UserService; +import com.panzhihua.common.utlis.ExcelUtils; import com.panzhihua.common.utlis.Snowflake; import com.panzhihua.service_community.entity.ComEvent; import com.panzhihua.service_community.entity.ComSanshuoExpert; import com.panzhihua.service_community.service.ComSanShuoExpertService; import com.panzhihua.service_community.service.IComEventService; +import com.panzhihua.service_community.util.ExcelListener; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.xml.crypto.Data; +import java.io.IOException; import java.util.Date; import java.util.List; @@ -46,6 +51,8 @@ @PostMapping public R add(@RequestBody ComSanshuoExpertDTO comSanshuoExpertDTO){ comSanshuoExpertDTO.setCreateBy(this.getLoginUserInfo().getName()); +// comSanshuoExpertDTO.setAppId(userService.detailUser(getLoginUserInfo().getUserId()).getData().getAppId()); + comSanshuoExpertDTO.setAppId(getAppId()); return comSanShuoExpertService.addOrUpdateExpert(comSanshuoExpertDTO); } @@ -70,23 +77,27 @@ return R.ok(comSanShuoExpertService.addOrUpdateExpert(comSanshuoExpertDTO)); } + /** * 后台获取列表 * */ @GetMapping("/backstageList") public R backList(@RequestParam(value = "keyWord",required = false) String keyWord, @RequestParam(value = "page",required = false)Integer page, - @RequestParam(value = "size",required = false)Integer size){ + @RequestParam(value = "size",required = false)Integer size, + @RequestParam(value = "level",required = false)Integer level){ LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); - return comSanShuoExpertService.expertPage(keyWord,page,size,loginUserInfo); +// loginUserInfo.setAppId(userService.detailUser(getLoginUserInfo().getUserId()).getData().getAppId()); + loginUserInfo.setAppId(getAppId()); + return comSanShuoExpertService.expertPage(keyWord,page,size,loginUserInfo,level); } + /** * 删除 * */ @DeleteMapping("/remove") public R remove(@RequestParam("id")Long id){ - //TODO 是否有为解决事件 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("有未调解完成事件,无法删除!"); @@ -118,7 +129,7 @@ * */ @GetMapping("/expertShow") public R expertShow(){ - return comSanShuoExpertService.expertShow(); + return comSanShuoExpertService.expertShow(this.getLoginUserInfo().getAppId()); } @@ -127,7 +138,8 @@ * */ @GetMapping("/expertRange") public R expertRange(){ - LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); + LoginUserInfoVO loginUserInfo1=getLoginUserInfo(); + LoginUserInfoVO loginUserInfo = userService.detailUser(loginUserInfo1.getUserId()).getData(); return comSanShuoExpertService.expertRange(loginUserInfo); } @@ -137,7 +149,8 @@ @GetMapping("/expertShowList") public R expertShowList(@RequestParam(value = "level",required = false)Integer level, @RequestParam(value = "id",required = false)Long id){ - return comSanShuoExpertService.expertShowList(level,id); +// return comSanShuoExpertService.expertShowList(level,id,userService.detailUser(this.getUserId()).getData().getAppId()); + return comSanShuoExpertService.expertShowList(level,id,getAppId()); } /** @@ -152,4 +165,36 @@ return R.fail(); } + /** + * 导入专家信息 + * */ + @PostMapping("/importExpert") + public R importExpert(@RequestBody MultipartFile multipartFile){ + try { + ExcelListener listener=new ExcelListener(comSanShuoExpertService); + EasyExcel.read(multipartFile.getInputStream(),ComSanshuoExpert.class,listener).sheet().doRead(); + } catch (IOException e) { + e.printStackTrace(); + } + return R.ok(); + } + + /** + * 后台获取专家列表 + * */ + @GetMapping("/backstageList2") + public R backstageList(@RequestParam(value = "level",required = false)Integer level, + @RequestParam(value = "page",required = false)Integer page, + @RequestParam(value = "size",required = false)Integer size, + @RequestParam(value = "keyWord",required = false)String keyWord){ + LoginUserInfoVO loginUserInfo = getLoginUserInfo(); +// loginUserInfo.setAppId(userService.detailUser(getLoginUserInfo().getUserId()).getData().getAppId()); + loginUserInfo.setAppId(getAppId()); + return comSanShuoExpertService.backstageList(level,loginUserInfo,page,size,keyWord); + } + + + + + } -- Gitblit v1.7.1