springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/ComSanShuoApi.java
@@ -32,7 +32,7 @@ } @ApiOperation(value = "小程序获取可选择行专家列表",response = ComSanShuoEventVO.class ) @GetMapping("/industryCenter/appletsList") @GetMapping("/expert/appletsList") public R expertAppList(){ return communityService.expertAppList(); } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/sanshuo/ComSanshuoExpertDTO.java
@@ -1,5 +1,6 @@ package com.panzhihua.common.model.dtos.community.sanshuo; import com.panzhihua.common.model.vos.LoginUserInfoVO; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -129,4 +130,6 @@ @ApiModelProperty("所属单位") private String unit; } 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/model/vos/sanshuo/ExpertShowVO.java
@@ -10,6 +10,9 @@ @ApiModel("专家风采列表") public class ExpertShowVO { @ApiModelProperty("级别1三说会堂2行业分中心3街道4社区") private Integer level; @ApiModelProperty("名称") private String name; 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/common/src/main/java/com/panzhihua/common/service/user/UserService.java
@@ -1285,5 +1285,5 @@ * 三说会堂重置密码 * */ @GetMapping("/sanshuoResetPassword") R sanShuoResetPassword(@RequestParam("id") Long userId,@RequestParam("pass")String password); R sanShuoResetPassword(@RequestParam("account") String account,@RequestParam("pass")String password); } 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/ComSanShuoEventApi.java
@@ -54,7 +54,7 @@ * */ @PostMapping public R add(@RequestBody ComMediateTypeDTO comMediateTypeDTO){ comMediateTypeDTO.setCreateUser(this.getLoginUserInfo().getUserId()); //comMediateTypeDTO.setCreateUser(this.getLoginUserInfo().getUserId()); return commediateTypeService.addOrUpdate(comMediateTypeDTO); } @@ -63,7 +63,7 @@ * */ @PutMapping public R update(@RequestBody ComMediateTypeDTO comMediateTypeDTO){ comMediateTypeDTO.setModifyUser(this.getLoginUserInfo().getUserId()); //comMediateTypeDTO.setModifyUser(this.getLoginUserInfo().getUserId()); return commediateTypeService.addOrUpdate(comMediateTypeDTO); } @@ -75,7 +75,7 @@ ComMediateType comMediateType = commediateTypeService.getById(id); comMediateType.setDeleteFlag(true); comMediateType.setEnabled(false); comMediateType.setModifyUser(this.getLoginUserInfo().getUserId()); //comMediateType.setModifyUser(this.getLoginUserInfo().getUserId()); return R.ok(commediateTypeService.updateById(comMediateType)); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java
@@ -69,7 +69,7 @@ * 后台获取列表 * */ @GetMapping("/backstageList") public R backList(@RequestParam(value = "keyWord",required = false)@ApiParam("搜索关键字") String keyWord, public R backList(@RequestParam(value = "keyWord",required = false) String keyWord, @RequestParam(value = "page",required = false)Integer page, @RequestParam(value = "size",required = false)Integer size){ //TODO 获取当前账号级别确定范围 @@ -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
@@ -74,7 +74,7 @@ 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)); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComSanshuoExpertDao.java
@@ -39,6 +39,17 @@ * */ List<ExpertShowVO> selectExpertIndustry(); /** * 街道分组专家 * */ List<ExpertShowVO> selectExpertStreet(); /** * 社区分组专家 * */ List<ExpertShowVO> selectExpertCommunity(); /** * 获取范围内的 * */ springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComSanshuoIndustryCenterDao.java
@@ -1,12 +1,15 @@ package com.panzhihua.service_community.dao; import cn.hutool.db.Page; import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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/ComSanShuoIndustryCenterService.java
@@ -22,4 +22,6 @@ * @return 处理结果 * */ R addOrUpdate(ComSanShuoIndustryCenterDTO comSanShuoIndustryCenterDTO); R resetPassword(ComSanshuoIndustryCenter center); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java
@@ -7,21 +7,28 @@ 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; import static java.util.Objects.nonNull; @Service public class ComSanShuoExpertServiceImpl extends ServiceImpl<ComSanshuoExpertDao, ComSanshuoExpert> implements ComSanShuoExpertService { @@ -30,6 +37,13 @@ private ComSanshuoExpertDao comSanshuoExpertDao; @Resource private UserService userService; @Resource private ComSanshuoIndustryCenterDao comSanshuoIndustryCenterDao; @Resource private ComStreetDAO comStreetDAO; @Resource private ComActDAO comActDAO; /** * 添加专家 @@ -77,23 +91,116 @@ //账号级别 Long id=null; Integer range=null; if (nonNull(loginUserInfo)){ if (nonNull(loginUserInfo.getUserType()) || nonNull(loginUserInfo.getType())){ if (loginUserInfo.getUserType().equals(1)){ range=3; id=loginUserInfo.getStreetId(); }else if (loginUserInfo.getUserType().equals(2)){ range=4; id=loginUserInfo.getCommunityId(); }else if (loginUserInfo.getType().equals(11)){ range=2; id=loginUserInfo.getCommunityId(); } } } return R.ok(comSanshuoExpertDao.expertPage(new Page(page,size),keyWord,range,id)); } /** * 专家风采 * */ @Override public R expertShow() { List<ExpertShowVO> expertShowVOS = comSanshuoExpertDao.expertShow(); for (ExpertShowVO expertShowVO : expertShowVOS) { comSanshuoExpertDao.selectExpertIndustry(); if (nonNull(expertShowVO.getLevel())){ if (1==expertShowVO.getLevel()) { expertShowVO.setName("区三说会堂调解专家"); }else if (2==expertShowVO.getLevel()){ expertShowVO.setName("行业分中心调解专家"); List<ExpertShowVO> expertShowVOS1 = comSanshuoExpertDao.selectExpertIndustry(); expertShowVO.setChildList(expertShowVOS1); }else if (3==expertShowVO.getLevel()){ expertShowVO.setName("镇/街道调解站调解专家"); List<ExpertShowVO> expertShowVOS1 = comSanshuoExpertDao.selectExpertStreet(); expertShowVO.setChildList(expertShowVOS1); }else { expertShowVO.setName("村/社区调解站调解专家"); List<ExpertShowVO> expertShowVOS1 = comSanshuoExpertDao.selectExpertCommunity(); expertShowVO.setChildList(expertShowVOS1); } } } return R.ok(); } /** * 数据范围 * 专家级别与单位范围 * */ public void getRange(LoginUserInfoVO loginUserInfo){ @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
@@ -1,8 +1,9 @@ package com.panzhihua.service_community.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.db.Page; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.model.dtos.community.sanshuo.ComSanShuoIndustryCenterDTO; import com.panzhihua.common.model.vos.R; @@ -13,8 +14,8 @@ import com.panzhihua.service_community.dao.SysUserDao; import com.panzhihua.service_community.entity.ComSanshuoIndustryCenter; import com.panzhihua.service_community.entity.SysUser; import com.panzhihua.service_community.util.MyAESUtil; import com.panzhihua.service_community.service.ComSanShuoIndustryCenterService; import com.panzhihua.service_community.util.MyAESUtil; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -53,6 +54,9 @@ public R addOrUpdate(ComSanShuoIndustryCenterDTO comSanShuoIndustryCenterDTO) { ComSanshuoIndustryCenter comSanshuoIndustryCenter = comSanshuoIndustryCenterDao.selectOne(new QueryWrapper<ComSanshuoIndustryCenter>().eq("name", comSanShuoIndustryCenterDTO.getName())); if (isNull(comSanShuoIndustryCenterDTO.getId())){ if (nonNull(comSanshuoIndustryCenter)){ return R.fail("业务中心已存在"); } ComSanshuoIndustryCenter center=new ComSanshuoIndustryCenter(); BeanUtil.copyProperties(comSanShuoIndustryCenterDTO,center); //添加 @@ -64,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) { @@ -74,9 +78,6 @@ return userService.sanShuoAddUser(user); } }else { if (nonNull(comSanshuoIndustryCenter)){ return R.fail("业务中心已存在"); } ComSanshuoIndustryCenter center=new ComSanshuoIndustryCenter(); BeanUtil.copyProperties(comSanShuoIndustryCenterDTO,center); center.setUpdateTime(new Date()); @@ -87,4 +88,15 @@ } return R.fail("操作失败"); } @Override public R resetPassword(ComSanshuoIndustryCenter center) { try { String pass=MyAESUtil.Encrypt(center.getPassword(), "Ryo7M3n8loC5Abcd"); return userService.sanShuoResetPassword(center.getAccount(), pass); } catch (Exception e) { e.printStackTrace(); } return R.fail(); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMediaTypeMapper.xml
New file @@ -0,0 +1,10 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.panzhihua.service_community.dao.ComMediateTypeDao"> <select id="eventList" resultType="com.panzhihua.service_community.entity.ComMediateType"> select * from com_mediate_type <if test="keyWord != null and keyWord != ''"> where name like concat('%',#{keyWord},'%') </if> </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComSanshuoExpertDao.xml
@@ -71,10 +71,16 @@ where t.level=2 group by t1.name </select> <select id="selectExpertIndustryThree" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO"> <select id="selectExpertStreet" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO"> select count(t.id) as 'count',t1.name from com_sanshuo_expert t left join com_street t1 on t.street_id=t1.street_id where t.level=3 group by t1.name </select> <select id="selectExpertCommunity" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO"> select count(t.id) as 'count',t1.name from com_sanshuo_expert t left join com_act t1 on t.community_id=t1.community_id where t.level=4 group by t1.name </select> </mapper> 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/api/UserApi.java
@@ -1463,7 +1463,7 @@ * 三说会堂后台重置密码 * */ @GetMapping("/sanshuoResetPassword") public R sanshuoAddUser(@RequestParam("id") Long userId,@RequestParam("pass")String password){ return userService.resetPassExpertOrIndustryCenter(userId,password); public R sanshuoAddUser(@RequestParam("account") String account,@RequestParam("pass")String password){ return userService.resetPassExpertOrIndustryCenter(account,password); } } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/UserService.java
@@ -929,5 +929,5 @@ /** * 三说会堂后台重置密码 * */ R resetPassExpertOrIndustryCenter(Long userId,String password); R resetPassExpertOrIndustryCenter(String account,String password); } 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(); } @@ -3690,8 +3692,8 @@ * 三说会堂后台重置密码 * */ @Override public R resetPassExpertOrIndustryCenter(Long userId,String password) { SysUserDO sysUserDO = userDao.selectById(userId); public R resetPassExpertOrIndustryCenter(String account,String password) { SysUserDO sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().eq("account", account)); if (nonNull(sysUserDO)){ sysUserDO.setPassword(password); userDao.updateById(sysUserDO);