springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActPasswordVo.java
New file @@ -0,0 +1,20 @@ package com.panzhihua.common.model.vos.community; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * @author lyq * 社区账号密码返回参数 */ @Data @ApiModel("社区账号密码返回参数") public class ComActPasswordVo { @ApiModelProperty("账号") private String account; @ApiModelProperty("密码") private String password; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -7438,4 +7438,12 @@ @GetMapping("/screen/getComprehensiveStreetList") R getComprehensiveStreetList(); /** * 通过社区id查询社区账号密码 * @param communityId 社区id * @return 查询社区账号密码 */ @GetMapping("/screen/getCommunityPassword") R getCommunityPassword(@RequestParam("communityId") Long communityId); } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/BigScreenStatisticsApi.java
@@ -231,4 +231,13 @@ comActDynVO.setStatus(1); return communityService.pageDynamic(comActDynVO); } @ApiOperation(value = "通过社区id查询社区账号密码") @PostMapping("/get/community/password") public R getCommunityPassword(@RequestParam("communityId") Long communityId) { if(communityId == null){ return R.fail("参数错误"); } return communityService.getCommunityPassword(communityId); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/BigScreenStatisticsApi.java
@@ -2,6 +2,7 @@ import javax.annotation.Resource; import com.panzhihua.service_community.service.ComActService; import org.springframework.web.bind.annotation.*; import com.panzhihua.common.model.dtos.community.bigscreen.BigScreenEventDTO; @@ -18,6 +19,8 @@ @Resource private ComMngPopulationService comMngPopulationService; @Resource private ComActService comActService; /** * 首页大屏统计接口 @@ -97,4 +100,9 @@ return comMngPopulationService.getComprehensiveStreetList(); } @GetMapping("/getCommunityPassword") public R getCommunityPassword(@RequestParam("communityId") Long communityId){ return comActService.getCommunityPassword(communityId); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java
@@ -2,6 +2,7 @@ import java.util.List; import com.panzhihua.common.model.vos.community.ComActPasswordVo; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -93,4 +94,7 @@ @Select("select community_id,name,lng,lat from com_act where state = 0 and area_code = '510423' ") List<EventGridCommunityAdminVO> getWestCommunityLists(); @Select("select account,plaintext_password as password from com_act where community_id = #{communityId}") ComActPasswordVo getCommunityPassword(@Param("communityId") Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComActDO.java
@@ -110,4 +110,9 @@ */ private Long streetId; /** * 明文密码 */ private String plaintextPassword; } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActService.java
@@ -111,4 +111,6 @@ * @return 社区列表 */ R communitySwitchSearchDistanceList(SearchCommunityDTO communityDTO); R getCommunityPassword(Long communityId); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java
@@ -63,6 +63,7 @@ return R.fail("社区已经存在"); } BeanUtils.copyProperties(comActVO, comActDO); comActDO.setPlaintextPassword(password); int insert = comActDAO.insert(comActDO); if (insert > 0) { ComActDO comActDO1 = @@ -91,6 +92,7 @@ if (!ObjectUtils.isEmpty(password)) { String encode = new BCryptPasswordEncoder().encode(password); comActVO.setPassword(encode); comActDO.setPlaintextPassword(password); a = 1; } ComStreetDO comStreetDO = comStreetDAO.selectById(comActVO.getStreetId()); @@ -101,7 +103,6 @@ // a=1; // } BeanUtils.copyProperties(comActVO, comActDO); // ComActDO selectOne = comActDAO.selectOne(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getAccount, account)); // if (null != selectOne && selectOne.getAccount().equals(comActVO.getAccount())) { // return R.fail("该登录账号重复,请重新修改"); @@ -271,4 +272,9 @@ return R.ok(this.comActDAO.getCommunityListByNearby(communityDTO)); } @Override public R getCommunityPassword(Long communityId){ return R.ok(comActDAO.getCommunityPassword(communityId)); } }