springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/sanshuo/ExpertRangeVO.java
New file @@ -0,0 +1,22 @@ package com.panzhihua.common.model.vos.sanshuo; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import org.apache.poi.ss.formula.functions.T; import java.util.List; import java.util.Map; @Data @ApiModel("当前账号可选择添加专家范围") public class ExpertRangeVO { @ApiModelProperty("级别") private Integer level; @ApiModelProperty("单位id") private Long id; @ApiModelProperty("单位名称") private String name; @ApiModelProperty("单位列表") private List<ExpertRangeVO> childList; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -10480,4 +10480,8 @@ * */ @GetMapping("/sanshuo/expert/expertShow") R expertShow(); @GetMapping("/sanshuo/expert/expertRange") R expertRange(); } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComSanShuoApi.java
@@ -7,10 +7,13 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.sanshuo.ComSanShuoIndustryCenterVO; import com.panzhihua.common.model.vos.sanshuo.ComSanshuoExpertVO; import com.panzhihua.common.model.vos.sanshuo.ExpertRangeVO; import com.panzhihua.common.model.vos.sanshuo.ExpertShowVO; import com.panzhihua.common.service.community.CommunityService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import jdk.nashorn.internal.objects.annotations.Getter; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; @@ -123,4 +126,28 @@ public R removeEvent(@PathVariable("id") Long id){ return communityService.removeEvent(id); } @ApiOperation("小程序获取可用专家列表") @GetMapping("/event/appletsList") public R eventAppletsList(){ return communityService.eventAppList(); } @ApiOperation("小程序获取可用业务中心列表") @GetMapping("/industryCenter/appletsList") public R industryAppletsList(){ return communityService.industryCenterAppList(); } @ApiOperation(value = "专家风采",response = ExpertShowVO.class) @GetMapping("/expert/expertShow") public R experShow(){ return communityService.expertShow(); } @GetMapping("/sanshuo/expertRange") @ApiOperation(value = "当前账号可添加专家范围",response = ExpertRangeVO.class) public R expertRange(){ return communityService.expertRange(); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java
@@ -106,4 +106,14 @@ public R expertShow(){ return comSanShuoExpertService.expertShow(); } /** * 专家范围 * */ @GetMapping("/expertRange") public R expertRange(){ LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); return comSanShuoExpertService.expertRange(loginUserInfo); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoIndustryCenterApi.java
@@ -45,7 +45,7 @@ * */ @PostMapping public R add(@RequestBody ComSanShuoIndustryCenterDTO comSanShuoIndustryCenterDTO){ //comSanShuoIndustryCenterDTO.setCreateBy(this.getLoginUserInfo().getName()); comSanShuoIndustryCenterDTO.setCreateBy(this.getLoginUserInfo().getName()); return comSanShuoIndustryCenterService.addOrUpdate(comSanShuoIndustryCenterDTO); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComSanshuoIndustryCenterDao.java
@@ -4,9 +4,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.vos.sanshuo.ComSanShuoIndustryCenterVO; import com.panzhihua.common.model.vos.sanshuo.ExpertRangeVO; import com.panzhihua.service_community.entity.ComSanshuoIndustryCenter; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; /** * @author Frozen @@ -18,6 +21,21 @@ public interface ComSanshuoIndustryCenterDao extends BaseMapper<ComSanshuoIndustryCenter> { IPage<ComSanShuoIndustryCenterVO> pageIndustryCenter(Page page, @Param("keyWord") String keyWord); /** * 获取业务中心id,名称 * */ List<ExpertRangeVO> indstryList(); /** * 街道id,名称 * */ List<ExpertRangeVO> streetList(); /** * 社区id,名称 * */ List<ExpertRangeVO> communityList(); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComSanShuoExpertService.java
@@ -30,4 +30,9 @@ * @return 出列记过 * */ R expertShow(); /** * 专家级别与单位范围 * */ R expertRange(LoginUserInfoVO loginUserInfo); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java
@@ -7,19 +7,24 @@ import com.panzhihua.common.model.dtos.community.sanshuo.ComSanshuoExpertDTO; import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.sanshuo.ExpertRangeVO; import com.panzhihua.common.model.vos.sanshuo.ExpertShowVO; import com.panzhihua.common.model.vos.user.AdministratorsUserVO; import com.panzhihua.common.service.user.UserService; import com.panzhihua.common.utlis.Snowflake; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_community.dao.ComSanshuoEventDao; import com.panzhihua.service_community.dao.ComSanshuoExpertDao; import com.panzhihua.service_community.dao.*; import com.panzhihua.service_community.entity.ComSanshuoExpert; import com.panzhihua.service_community.model.dos.ComActDO; import com.panzhihua.service_community.model.dos.ComStreetDO; import com.panzhihua.service_community.service.ComActService; import com.panzhihua.service_community.service.ComSanShuoExpertService; import com.panzhihua.service_community.service.ComStreetService; import com.panzhihua.service_community.util.MyAESUtil; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -32,6 +37,13 @@ private ComSanshuoExpertDao comSanshuoExpertDao; @Resource private UserService userService; @Resource private ComSanshuoIndustryCenterDao comSanshuoIndustryCenterDao; @Resource private ComStreetDAO comStreetDAO; @Resource private ComActDAO comActDAO; /** * 添加专家 @@ -124,6 +136,72 @@ return R.ok(); } /** * 专家级别与单位范围 * */ @Override public R expertRange(LoginUserInfoVO loginUserInfo) { if (nonNull(loginUserInfo)){ if (loginUserInfo.getAccount().equals("zhengfawei") || loginUserInfo.getAccount().equals("admin")){ List<ExpertRangeVO> list=new ArrayList<>(); for (int i = 1; i < 5; i++) { ExpertRangeVO vo=new ExpertRangeVO(); vo.setLevel(i); if (i==2){ //设置行业分中心为childList vo.setChildList(comSanshuoIndustryCenterDao.indstryList()); }else if (i==3){ vo.setChildList(comSanshuoIndustryCenterDao.streetList()); }else if (i==4){ vo.setChildList(comSanshuoIndustryCenterDao.communityList()); } list.add(vo); } return R.ok(list); }else if (loginUserInfo.getType().equals(11)){ //三说会堂后台 List<ExpertRangeVO> list=new ArrayList<>(); ExpertRangeVO vo=new ExpertRangeVO(); vo.setLevel(1); vo.setName("区三说会堂"); list.add(vo); return R.ok(list); }else if (loginUserInfo.getType().equals(12)){ //行业分中心后台 List<ExpertRangeVO> list=new ArrayList<>(); ExpertRangeVO vo=new ExpertRangeVO(); vo.setLevel(2); vo.setName("行业分中心"); vo.setId(loginUserInfo.getCommunityId()); list.add(vo); return R.ok(list); }else if (nonNull(loginUserInfo.getUserType())){ if (loginUserInfo.getUserType().equals(1)){ //街道账号 ComStreetDO comStreetDO = comStreetDAO.selectById(loginUserInfo.getStreetId()); List<ExpertRangeVO> list=new ArrayList<>(); ExpertRangeVO vo=new ExpertRangeVO(); vo.setLevel(3); vo.setName(comStreetDO.getName()+"调解站"); vo.setId(loginUserInfo.getStreetId()); list.add(vo); return R.ok(list); } if (loginUserInfo.getUserType().equals(2)){ //街道账号 ComActDO comActDO = comActDAO.selectById(loginUserInfo.getCommunityId()); List<ExpertRangeVO> list=new ArrayList<>(); ExpertRangeVO vo=new ExpertRangeVO(); vo.setLevel(4); vo.setName(comActDO.getName()+"调解站"); vo.setId(loginUserInfo.getStreetId()); list.add(vo); return R.ok(list); } } } return R.fail(); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoIndustryCenterServiceImpl.java
@@ -68,8 +68,8 @@ AdministratorsUserVO user=new AdministratorsUserVO(); user.setUserId(Snowflake.getId()); user.setAccount(comSanShuoIndustryCenterDTO.getAccount()); user.setType(11); user.setName(comSanShuoIndustryCenterDTO.getName()); user.setType(12); try { user.setPassword(MyAESUtil.Encrypt(comSanShuoIndustryCenterDTO.getPassword(),"Ryo7M3n8loC5Abcd")); } catch (Exception e) { springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComSanshuoIndustryCenterDao.xml
@@ -35,4 +35,13 @@ </where> </select> <select id="indstryList" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertRangeVO"> select id,name from com_sanshuo_industry_center where status=1 and del_flag=1 </select> <select id="streetList" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertRangeVO"> select street_id as id,name from com_street </select> <select id="communityList" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertRangeVO"> select community_id as id,name from com_act </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -3679,7 +3679,9 @@ if (nonNull(administratorsUserVO.getImageUrl())){ sysUserDO.setImageUrl(administratorsUserVO.getImageUrl()); } sysUserDO.setType(administratorsUserVO.getType()); if (nonNull(administratorsUserVO.getType())){ sysUserDO.setType(administratorsUserVO.getType()); } userDao.insert(sysUserDO); return R.ok(); }