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/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/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/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 获取当前账号级别确定范围 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoIndustryCenterApi.java
@@ -6,7 +6,6 @@ import com.panzhihua.common.model.vos.R; import com.panzhihua.common.service.user.UserService; import com.panzhihua.service_community.entity.ComSanshuoIndustryCenter; import com.panzhihua.service_community.schedule.util.MyAESUtil; import com.panzhihua.service_community.service.ComSanShuoIndustryCenterService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -46,7 +45,7 @@ * */ @PostMapping public R add(@RequestBody ComSanShuoIndustryCenterDTO comSanShuoIndustryCenterDTO){ comSanShuoIndustryCenterDTO.setCreateBy(this.getLoginUserInfo().getName()); //comSanShuoIndustryCenterDTO.setCreateBy(this.getLoginUserInfo().getName()); return comSanShuoIndustryCenterService.addOrUpdate(comSanShuoIndustryCenterDTO); } @@ -76,7 +75,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/ComMediateTypeDao.java
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.service_community.entity.ComMediateType; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; /** @@ -12,6 +13,7 @@ * @createDate 2022-09-07 10:31:38 * @Entity generator.entity.ComMediateType */ @Mapper public interface ComMediateTypeDao extends BaseMapper<ComMediateType> { /** 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,8 +1,8 @@ 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.service_community.entity.ComSanshuoIndustryCenter; import org.apache.ibatis.annotations.Mapper; 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
@@ -23,6 +23,8 @@ import java.util.Date; import java.util.List; import static java.util.Objects.nonNull; @Service public class ComSanShuoExpertServiceImpl extends ServiceImpl<ComSanshuoExpertDao, ComSanshuoExpert> implements ComSanShuoExpertService { @@ -77,24 +79,51 @@ //账号级别 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){ } } 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.schedule.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); //添加 @@ -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_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
@@ -3690,8 +3690,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);