springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityApi.java
@@ -64,7 +64,7 @@ administratorsUserVO.setAreaId(null); administratorsUserVO.setCommunityId(communityId); administratorsUserVO.setStatus(comActVO1.getState() + 1); administratorsUserVO.setRoleId(999999999l); administratorsUserVO.setRoleId(999999999L); administratorsUserVO.setUserId(this.getUserId()); R r1 = userService.addUserBackstage(administratorsUserVO); if (!R.isOk(r1)) { springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/DataKanBansDto.java
@@ -16,6 +16,10 @@ private Integer type; private String areaCode; private Integer pageNum; private Integer pageSize; /** * 社区用户量统计类型(1.累计用户 2.本月新增) */ springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginUserInfoVO.java
@@ -215,4 +215,8 @@ @ApiModelProperty("绑定单位") private String relationName; public String retrieveRelationName() { return this.type == 3 ? relationName : name; } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComAreaTownCommunityVO.java
New file @@ -0,0 +1,24 @@ package com.panzhihua.common.model.vos.community; import lombok.Data; /** * @title: ComAreaTownCommunityVO * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: * @author: hans * @date: 2022/05/06 11:13 */ @Data public class ComAreaTownCommunityVO { private Long id; private String area; private String town; private String community; private Long communityId; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/AdministratorsUserVO.java
@@ -101,4 +101,7 @@ @ApiModelProperty("社会组织id") private Long orgId; @ApiModelProperty("绑定单位") private String relationName; } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActAcidDangerMemberApi.java
@@ -43,7 +43,7 @@ @PostMapping("/queryAll") public R pageDangerMember(@RequestBody @Valid ComActAcidDangerMemberDTO pageDangerMemberDTO) { LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); pageDangerMemberDTO.setRelationName(loginUserInfo.getName()); pageDangerMemberDTO.setRelationName(loginUserInfo.retrieveRelationName()); return communityService.pageDangerMemberAdmin(pageDangerMemberDTO); } } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComActAcidMemberApi.java
@@ -43,7 +43,7 @@ @ApiOperation(value = "分页查询列表",response = ComActAcidMemberVO.class) @PostMapping("queryAll") public R selectAll(@RequestBody ComActAcidMemberDTO commonPage) { commonPage.setRelationName(this.getLoginUserInfo().getName()); commonPage.setRelationName(this.getLoginUserInfo().retrieveRelationName()); return this.communityService.selectAllComActAcidMember(commonPage); } @@ -69,7 +69,7 @@ @PostMapping public R insert(@RequestBody ComActAcidMemberVO comActAcidMemberVO) { LoginUserInfoVO loginUserInfo = this.getLoginUserInfo(); comActAcidMemberVO.setRelationName(loginUserInfo.getName()); comActAcidMemberVO.setRelationName(loginUserInfo.retrieveRelationName()); return communityService.insertComActAcidMember(comActAcidMemberVO); } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java
@@ -8,8 +8,6 @@ import com.panzhihua.common.model.vos.community.acid.ComActAcidMemberVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.*; import org.apache.ibatis.annotations.Param; import org.springframework.web.bind.annotation.RequestParam; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -69,9 +67,9 @@ IndexDataKanbanVO selectIndexDataKanban(@Param("areaCode") String areaCode); List<DataKanbanDTO> selectCommunityUserOrder(@Param("areaCode")String areaCode); IPage<DataKanbanDTO> selectCommunityUserOrder(Page page, @Param("areaCode") String areaCode); List<DataKanbanDTO> selectCommunityUserOrderMonth(@Param("areaCode")String areaCode); IPage<DataKanbanDTO> selectCommunityUserOrderMonth(Page page, @Param("areaCode") String areaCode); DataKanbanDTO selectCommunityActiveUserOrder(Date date1); @@ -258,4 +256,11 @@ * @return */ ComActAcidMemberVO selectAcidMemberByPhone(@Param("phone") String phone); /** * 根据社区名称查询区县社区联动关系 * @param relationName * @return */ List<ComAreaTownCommunityVO> selectAreaTownCommunity(@Param("relationName") String relationName); } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/model/dos/SysUserDO.java
@@ -201,4 +201,9 @@ * 街道id */ private Long streetId; /** * 绑定单位 */ private String relationName; } springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -16,10 +16,10 @@ import java.util.stream.Collectors; import javax.annotation.Resource; import javax.validation.constraints.NotBlank; import com.alibaba.fastjson.JSONObject; import com.panzhihua.common.model.dtos.community.microCommercialStreet.BindUserPhoneDTO; import com.panzhihua.common.model.vos.community.ComAreaTownCommunityVO; import com.panzhihua.common.model.vos.community.acid.ComActAcidMemberVO; import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLoginUserInfoVO; import com.panzhihua.service_user.dao.*; @@ -1127,6 +1127,21 @@ @Override @Transactional(rollbackFor = Exception.class) public R addUserBackstage(AdministratorsUserVO administratorsUserVO) { ComActVO comActVO = userDao.selectCommunity(administratorsUserVO.getCommunityId()); if (nonNull(comActVO)) { List<ComAreaTownCommunityVO> areaTownList = userDao.selectAreaTownCommunity(comActVO.getName()); if (!areaTownList.isEmpty()) { administratorsUserVO.setRelationName(comActVO.getName()); String address = comActVO.getAddress(); if (areaTownList.size() > 1 && isNotBlank(address)) { ComAreaTownCommunityVO townCommunityVO = areaTownList.stream() .filter(e -> address.contains(e.getArea()) && address.contains(e.getTown())).findFirst().orElse(null); if (nonNull(townCommunityVO)) { administratorsUserVO.setRelationName(String.join(",", townCommunityVO.getArea(), townCommunityVO.getTown(), townCommunityVO.getCommunity())); } } } } SysUserDO sysUserDO = new SysUserDO(); Long roleId = administratorsUserVO.getRoleId(); if (roleId.intValue() == 999999999 || roleId.intValue() == 888888888) { @@ -1875,7 +1890,7 @@ @Override public R dataKanban(String areaCode) { IndexDataKanbanVO indexDataKanbanVO = userDao.selectIndexDataKanban(areaCode); List<DataKanbanDTO> dataKanbanDTOS = userDao.selectCommunityUserOrder(areaCode); List<DataKanbanDTO> dataKanbanDTOS = userDao.selectCommunityUserOrder(new Page(1L, 9999L), areaCode).getRecords(); List<String> communityUserX = new ArrayList<>(); List<Integer> communityUserY = new ArrayList<>(); @@ -2922,10 +2937,18 @@ List<Integer> communityActiveUserZ = new ArrayList<>(); List<DataKanbanDTO> dataKanbanDTOS = null; if(dataKanBansDto.getType() != null && dataKanBansDto.getType().equals(DataKanBansDto.type.by)){ dataKanbanDTOS = userDao.selectCommunityUserOrderMonth(dataKanBansDto.getAreaCode()); Page page = new Page<>(); if (nonNull(dataKanBansDto.getPageNum()) && nonNull(dataKanBansDto.getPageSize())) { page.setCurrent(dataKanBansDto.getPageNum()); page.setSize(dataKanBansDto.getPageSize()); }else{ dataKanbanDTOS = userDao.selectCommunityUserOrder(dataKanBansDto.getAreaCode()); page.setCurrent(1L); page.setSize(20L); } if(dataKanBansDto.getType() != null && dataKanBansDto.getType().equals(DataKanBansDto.type.by)){ dataKanbanDTOS = userDao.selectCommunityUserOrderMonth(page, dataKanBansDto.getAreaCode()).getRecords(); }else{ dataKanbanDTOS = userDao.selectCommunityUserOrder(page, dataKanBansDto.getAreaCode()).getRecords(); } if (!ObjectUtils.isEmpty(dataKanbanDTOS)) { dataKanbanDTOS.forEach(dataKanbanDTO -> { springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml
@@ -39,6 +39,7 @@ <result property="workEndTime" column="work_end_time"/> <result property="bigAgeTips" column="big_age_tips"/> <result property="plaintextPassword" column="plaintext_password"/> <result property="relationName" column="relation_name"/> </resultMap> <sql id="columns"> @@ -555,4 +556,8 @@ SELECT id, relation_name FROM com_act_acid_member WHERE phone = #{phone} </select> <select id="selectAreaTownCommunity" resultType="com.panzhihua.common.model.vos.community.ComAreaTownCommunityVO"> SELECT * FROM com_area_town_community WHERE community = #{relationName} </select> </mapper>