fengjin
2022-10-21 6e6f4887eaeb046ccdc76a79375a8c7ff47daa96
Merge branch 'zigonggao_dev' of http://gitlab.nhys.cdnhxx.com/root/zhihuishequ into zigonggao_dev
48个文件已修改
6个文件已添加
1099 ■■■■ 已修改文件
flower_city/src/main/java/com/dg/core/controller/GuideDoController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/controller/GuideRepairOrderController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/controller/SysSettingsController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/controller/UserController.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/db/gen/entity/AutomessageSysSettings.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/db/gen/entity/AutomessageSysSettingsRecord.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/db/gen/entity/AutomessageSysUserRecord.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/db/gen/entity/HuaChengSysUser.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/db/gen/entity/OrganizationChartEntity.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/db/gen/entity/SysUser.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/db/gen/mapper/SysUserMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/interceptor/AuthorizationInterceptor.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/manager/RedisTokenManager.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/manager/TokenManager.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/resolvers/CurrentUserMethodArgumentResolver.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/service/ISysUserService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/service/impl/SysUserServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/resources/mapper/SysUserMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/UserApi.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/UserApi.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/common/PageComPbCheckUnitDto.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/common/PagePbCheckUnitCommonDto.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/ComActNeighborCircleAdminDTO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/ComActNeighborCircleAppDTO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/SanShuoMessageVO.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PagePartyOrganizationVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComSanShuoApi.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/ComSanShuoApi.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/AutomessageSysUserDao.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComSanshuoExpertDao.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/AutomessageSysUser.java 263 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComEventTransferRecord.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/message/AcidMessage.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/AutomessageSysUserService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComSanShuoExpertService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/AutomessageSysUserServiceImpl.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java 101 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/util/WXMessageUtil.java 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActNeighborCircleDOMapper.xml 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComSanshuoExpertDao.xml 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbCheckUnitMapper.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbMemberDAO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbCheckUnitServiceImpl.java 105 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbCheckUnitMapper.xml 123 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbMemberMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
flower_city/src/main/java/com/dg/core/controller/GuideDoController.java
@@ -95,7 +95,7 @@
        config.setUserType("2");
        SysUser user=IUserService.selectData(null,config.getPhonenumber());
        SysUser user=IUserService.selectData(null,config.getPhonenumber(),null);
        if (user != null)
        {
            user.setPassword(config.getPassword());
@@ -114,7 +114,7 @@
        config.setRoleIds(2+"");
        config.setCreateTime(LocalDateTime.now());
        config.setUpdateTime(LocalDateTime.now());
        config.setUserId(Snowflake.getId());
        config.setUserId(Snowflake.getId()+"");
        return toAjax(IUserService.insertConfig(config));
    }
flower_city/src/main/java/com/dg/core/controller/GuideRepairOrderController.java
@@ -180,7 +180,6 @@
        entity.setFromUserId(sysUser.getUserId()+"");
        entity.setFromDepartmentalId(sysUser.getDepartmentId());
        entity.setGuideId(order.getId().toString());
        order=iGuideRepairOrderService.setTimeoutTim(order);
        iGuideEvolveService.insertConfig(entity);
        iGuideRepairOrderService.updateSysUserOrderNum(entity);
flower_city/src/main/java/com/dg/core/controller/SysSettingsController.java
@@ -45,7 +45,7 @@
    @PostMapping("/update")
    @Authorization
    ResultData update(@RequestBody AutomessageSysSettings automessageSysSettings,@CurrentUser SysUser sysUser){
        automessageSysSettings.setUpdateUserId(sysUser.getUserId().intValue());
        automessageSysSettings.setUpdateUserId(sysUser.getUserId());
        automessageSysSettings.setUpdateTime(LocalDateTime.now());
        return  sysSettingsService.update(automessageSysSettings);
    }
flower_city/src/main/java/com/dg/core/controller/UserController.java
@@ -64,7 +64,7 @@
            }
            //本地表查询用户
            user = IUserService.selectData(huaChengSysUser.getUserId()+"",null);
            user = IUserService.selectData(huaChengSysUser.getUserId()+"",null,null);
            if (user == null) {
                //本地没有此用户  新用户
                SysUser newSysUser=new SysUser();
@@ -81,7 +81,7 @@
                IUserService.insertConfig(newSysUser);
            }
            user = IUserService.selectData(huaChengSysUser.getUserId()+"",null);
            user = IUserService.selectData(huaChengSysUser.getUserId()+"",null,null);
            if (user == null) {
                return ResultData.error("用户不存在!请联系管理员");
@@ -103,6 +103,9 @@
            map.put("userId", user.getUserId());
            map.put("userName", user.getUserName());
            map.put("permission", user.getPermission());
            map.put("userType", user.getUserType());
            map.put("departmentId", user.getDepartmentId());
            map.put("departmentName", user.getDepartmentName());
            return ResultData.success(map);
        }
@@ -129,6 +132,9 @@
            map.put("userId", user.getUserId());
            map.put("userName", user.getUserName());
            map.put("permission", user.getPermission());
            map.put("userType", user.getUserType());
            map.put("departmentId", user.getDepartmentId());
            map.put("departmentName", user.getDepartmentName());
            return ResultData.success(map);
        }
@@ -216,15 +222,21 @@
            return error("手机号不能为空");
        }
        SysUser user = IUserService.selectData("",config.getPhonenumber());
        SysUser user = IUserService.selectData("",config.getPhonenumber(),"");
        SysUser user2 = IUserService.selectData("","",config.getLoginName());
        if (user != null) {
            //提示用户名或密码错误
            return error("该账户已存在!");
            return error("该用户已存在!");
        }
        if(user2 != null)
        {
            //提示用户名或密码错误
            return error("该登录账户已存在!请修改登录账户");
        }
        config.setCreateBy(sysUser.getUserId()+"");
        config.setUserId(Snowflake.getId());
        config.setUserId(Snowflake.getId()+"");
        config.setUserType("3");
        config.setCreateTime(LocalDateTime.now());
@@ -295,7 +307,7 @@
            return error("userId不能为空");
        }
        SysUser sysUser=IUserService.selectData(userId,null);
        SysUser sysUser=IUserService.selectData(userId,null,null);
        //删除标志(0代表存在 2代表删除)
        sysUser.setDelFlag("2");
        return toAjax(IUserService.updateConfig(sysUser));
@@ -323,7 +335,7 @@
            return error("密码不能为空");
        }
        SysUser sysUser=IUserService.selectData(config.getUserId()+"",null);
        SysUser sysUser=IUserService.selectData(config.getUserId()+"",null,null);
        if(sysUser==null)
        {
            return error("用户不存在");
flower_city/src/main/java/com/dg/core/db/gen/entity/AutomessageSysSettings.java
@@ -66,7 +66,7 @@
     * 修改人id
     */
    @ApiModelProperty("修改人id")
    private Integer updateUserId;
    private String updateUserId;
    /**
     * 小程序二维码
flower_city/src/main/java/com/dg/core/db/gen/entity/AutomessageSysSettingsRecord.java
@@ -43,7 +43,7 @@
    /**
     * 创建人id(及修改设置的人员)
     */
    private Integer createUserId;
    private String createUserId;
flower_city/src/main/java/com/dg/core/db/gen/entity/AutomessageSysUserRecord.java
@@ -37,7 +37,7 @@
     * 用户id
     */
    @ApiModelProperty("用户id")
    private Long userId;
    private String userId;
    /**
     * 访问时间
flower_city/src/main/java/com/dg/core/db/gen/entity/HuaChengSysUser.java
@@ -34,7 +34,7 @@
    @ApiModelProperty(name = "userId", value = "主键用户id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "user_id", type = IdType.AUTO)
    private Long userId;
    private String userId;
    /**
     * 登录账户
flower_city/src/main/java/com/dg/core/db/gen/entity/OrganizationChartEntity.java
@@ -114,7 +114,7 @@
     * 修改人
     */
    @ApiModelProperty("修改人")
    private Long updateUserId;
    private String updateUserId;
    /**
     * 修改人
flower_city/src/main/java/com/dg/core/db/gen/entity/SysUser.java
@@ -42,8 +42,7 @@
     */
    @ApiModelProperty("用户id")
    @JsonSerialize(using = ToStringSerializer.class)
    @JsonFormat(shape =JsonFormat.Shape.STRING )
    private Long userId;
    private String userId;
    /**
flower_city/src/main/java/com/dg/core/db/gen/mapper/SysUserMapper.java
@@ -32,7 +32,9 @@
    SysUser selectData(@Param("userId") String userId,@Param("phonenumber") String phonenumber);
    SysUser selectData(@Param("userId") String userId,
                       @Param("phonenumber") String phonenumber,
                       @Param("loginName") String loginName);
    /**
flower_city/src/main/java/com/dg/core/interceptor/AuthorizationInterceptor.java
@@ -66,9 +66,9 @@
                request.setAttribute(Constant.CURRENT_USER_ID, manager.getHCUserId(HCtoken));
                System.out.println("花城用户id:"+manager.getHCUserId(HCtoken));
                HuaChengSysUser huaChengSysUser=iHuaChengSysUserService.selectData(manager.getHCUserId(HCtoken)+"","","");
                if(huaChengSysUser!=null && huaChengSysUser.getUserId()!=0 )
                if(huaChengSysUser!=null && !StringUtils.isEmpty(huaChengSysUser.getUserId()) )
                {
                    SysUser sysUser = IUserService.selectData(null,huaChengSysUser.getPhone());
                    SysUser sysUser = IUserService.selectData(null,huaChengSysUser.getPhone(),null);
                    if(sysUser==null)
                    {
                        //本地没有此用户  新用户
flower_city/src/main/java/com/dg/core/manager/RedisTokenManager.java
@@ -31,7 +31,7 @@
    }
    @Override
    public String createToken(long userId, long userRole) {
    public String createToken(String userId, String userRole) {
        //使用uuid作为源token
        String uuid = UUID.randomUUID().toString().replace("-", "");
        String token = DigestUtils.sha1DigestAsHex(uuid + userId + "e23ktjsdf") + "-" + userRole;
@@ -116,8 +116,8 @@
    }
    @Override
    public String getTokenByUserId(long userId) {
        return redis.boundValueOps(String.valueOf(userId)).get();
    public String getTokenByUserId(String userId) {
        return redis.boundValueOps(userId).get();
    }
}
flower_city/src/main/java/com/dg/core/manager/TokenManager.java
@@ -7,7 +7,7 @@
     * @param userId 指定用户的id
     * @return 生成的token
     */
    public String createToken(long userId, long role);
    public String createToken(String userId, String role);
    /**
     * 检查token是否有效
@@ -29,5 +29,5 @@
    public void deleteToken(String token);
    public String getTokenByUserId(long userId);
    public String getTokenByUserId(String userId);
}
flower_city/src/main/java/com/dg/core/resolvers/CurrentUserMethodArgumentResolver.java
@@ -47,7 +47,7 @@
        Long currentUserId = (Long) webRequest.getAttribute(Constant.CURRENT_USER_ID, RequestAttributes.SCOPE_REQUEST);
        if (currentUserId != null) {
            //从数据库中查询并返回
            SysUser sysUser=userService.selectData(currentUserId+"",null);
            SysUser sysUser=userService.selectData(currentUserId+"",null,null);
            if(sysUser!=null)
            {
                return sysUser;
@@ -56,7 +56,7 @@
            HuaChengSysUser huaChengSysUser=iHuaChengSysUserService.selectData(currentUserId+"","","");
            if(huaChengSysUser!=null)
            {
                sysUser=userService.selectData(null,huaChengSysUser.getPhone());
                sysUser=userService.selectData(null,huaChengSysUser.getPhone(),null);
                if(sysUser!=null)
                {
                    return sysUser;
flower_city/src/main/java/com/dg/core/service/ISysUserService.java
@@ -17,7 +17,7 @@
    public List<SysUser> selectConfigList(IPage<SysUser> page, Integer state,String userType,String userName);
    SysUser selectData(String userId,String phonenumber);
    SysUser selectData(String userId,String phonenumber,String loginName);
    /**
     * 新增聊天记录
flower_city/src/main/java/com/dg/core/service/impl/SysUserServiceImpl.java
@@ -69,7 +69,7 @@
            if(huaChengSysUser==null)
            {
                SysUser newUser = new SysUser();
                newUser.setUserId(Snowflake.getId());
                newUser.setUserId(Snowflake.getId()+"");
                newUser.setLoginName(phonenumber);
                newUser.setUserName(phonenumber.substring(0,3)+"xxxx"+phonenumber.substring(7,11)+"用户");
                newUser.setUserType("3");
@@ -82,7 +82,7 @@
            else
            {
                SysUser newUser = new SysUser();
                newUser.setUserId(huaChengSysUser.getUserId());
                newUser.setUserId(huaChengSysUser.getUserId()+"");
                newUser.setLoginName(huaChengSysUser.getPhone());
                newUser.setUserName(huaChengSysUser.getNickName());
                newUser.setUserType("3");
@@ -158,7 +158,7 @@
            SysUser newUser = new SysUser();
            if(huaChengSysUser==null)
            {
                newUser.setUserId(Snowflake.getId());
                newUser.setUserId(Snowflake.getId()+"");
                newUser.setLoginName(phonenumber);
                newUser.setUserName(phonenumber.substring(0,3)+"xxxx"+phonenumber.substring(7,11)+"用户");
                newUser.setUserType("3");
@@ -245,8 +245,8 @@
    }
    @Override
    public SysUser selectData(String userId,String phonenumber) {
        return baseMapper.selectData(userId,phonenumber);
    public SysUser selectData(String userId,String phonenumber,String loginName) {
        return baseMapper.selectData(userId,phonenumber,loginName);
    }
flower_city/src/main/resources/mapper/SysUserMapper.xml
@@ -143,11 +143,15 @@
        <include refid="selectSysUserVo"/>
        <where>
            <if test="userId!=null and userId!='' ">
                user_id= #{userId}
                AND user_id= #{userId}
            </if>
            <if test="phonenumber!=null and phonenumber!='' ">
                phonenumber= #{phonenumber}
                AND phonenumber= #{phonenumber}
            </if>
            <if test="loginName!=null and loginName!='' ">
                AND login_name= #{loginName}
            </if>
        </where>
springcloud_k8s_panzhihuazhihuishequ/applets/src/main/java/com/panzhihua/applets/api/UserApi.java
@@ -524,4 +524,10 @@
        pageProjectDTO.setUserId(this.getUserId());
        return communityService.pageProjectWhichIsSignedByUser(pageProjectDTO);
    }
    @ApiOperation("获取用户")
    @GetMapping("selectAutomessageSysUserById")
    public R selectAutomessageSysUserById(@RequestParam("id")Long id){
        return communityService.selectAutomessageSysUserById(id);
    }
}
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/UserApi.java
@@ -1,12 +1,5 @@
package com.panzhihua.applets_backstage.api;
import javax.annotation.Resource;
import com.panzhihua.common.utlis.StringUtils;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.interfaces.OperLog;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
@@ -14,9 +7,14 @@
import com.panzhihua.common.model.vos.user.ChangePasswordVO;
import com.panzhihua.common.model.vos.user.SysMenuVO;
import com.panzhihua.common.service.user.UserService;
import com.panzhihua.common.utlis.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -85,4 +83,6 @@
        }
        return R.ok();
    }
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/common/PageComPbCheckUnitDto.java
@@ -1,6 +1,7 @@
package com.panzhihua.common.model.dtos.common;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
@@ -93,5 +94,9 @@
    @ApiModelProperty("单位性质")
    private String natureName;
    @ApiModelProperty(value = "社区id集合")
    private List<Long> communityIds;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/common/PagePbCheckUnitCommonDto.java
@@ -4,6 +4,8 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * @title: PagePbCheckUnitCommonDto
 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目
@@ -29,5 +31,9 @@
    @ApiModelProperty("单位性质")
    private String natureName;
    @ApiModelProperty(value = "社区id集合")
    private List<Long> communityIds;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/ComActNeighborCircleAdminDTO.java
@@ -1,6 +1,7 @@
package com.panzhihua.common.model.dtos.neighbor;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -51,4 +52,7 @@
    private Long topicId;
    private Integer solveStatus;
    @ApiModelProperty(value = "社区id集合", hidden = true)
    private List<Long> communityIds;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/neighbor/ComActNeighborCircleAppDTO.java
@@ -4,6 +4,8 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * @auther lyq
 * @create 2021-04-14 15:02:14
@@ -55,6 +57,9 @@
    @ApiModelProperty(value = "单位id", hidden = true)
    private Long checkUnitId;
    @ApiModelProperty(value = "社区id集合", hidden = true)
    private List<Long> communityIds;
    /**
     * 使用类型(1.邻里圈 2.问题清单 3.需求清单)
     */
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/SanShuoMessageVO.java
New file
@@ -0,0 +1,17 @@
package com.panzhihua.common.model.vos;
import lombok.Data;
import java.util.Date;
@Data
public class SanShuoMessageVO {
    private String touser;
    private String thing5;
    private String thing1;
    private String thing2;
    private String time3;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/partybuilding/PagePartyOrganizationVO.java
@@ -8,6 +8,7 @@
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
 * @program: springcloud_k8s_panzhihuazhihuishequ
@@ -40,6 +41,9 @@
    @ApiModelProperty(value = "社区id", hidden = true)
    private Long communityId;
    @ApiModelProperty(value = "社区id", hidden = true)
    private List<Long> communityIds;
    @ApiModelProperty(value = "关键词")
    private String keyWord;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -10546,5 +10546,22 @@
    R westList();
    @GetMapping("/sanshuo/expert/backstageList2")
    R expertBackStageList(@RequestParam(value = "level",required = false)Integer level);
    R expertBackStageList(@RequestParam(value = "level",required = false)Integer level,@RequestParam(value = "page",required = false)Integer page,
                          @RequestParam(value = "size",required = false)Integer size);
    /**
     * 查询社区id集合
     * @param id
     * @return
     */
    @GetMapping("selectCommunityIds")
    R selectCommunityIds(@RequestParam("id") Long id);
    /**
     * 查询社区id集合
     * @param id
     * @return
     */
    @GetMapping("selectAutomessageSysUserById")
    R selectAutomessageSysUserById(@RequestParam("id") Long id);
}
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComSanShuoApi.java
@@ -173,7 +173,9 @@
        return communityService.westList();
    }
    @GetMapping("/expert/backstageList")
    public R expertBackStageList(@RequestParam(value = "level",required = false)Integer level){
        return communityService.expertBackStageList(level);
    public R expertBackStageList(@RequestParam(value = "level",required = false)Integer level,
                                 @RequestParam(value = "page",required = false)Integer page,
                                 @RequestParam(value = "size",required = false)Integer size){
        return communityService.expertBackStageList(level,page,size);
    }
}
springcloud_k8s_panzhihuazhihuishequ/grid_backstage/src/main/java/com/panzhihua/grid_backstage/api/ComSanShuoApi.java
@@ -163,8 +163,10 @@
    }
    @GetMapping("/expert/backstageList")
    public R expertBackStageList(@RequestParam(value = "level",required = false)Integer level){
        return communityService.expertBackStageList(level);
    public R expertBackStageList(@RequestParam(value = "level",required = false)Integer level,
                                 @RequestParam(value = "page",required = false)Integer page,
                                 @RequestParam(value = "size",required = false)Integer size){
        return communityService.expertBackStageList(level,page,size);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/ComSanShuoExpertApi.java
@@ -177,8 +177,10 @@
     * 后台获取专家列表
     * */
    @GetMapping("/backstageList2")
    public R  backstageList(@RequestParam(value = "level",required = false)Integer level){
        return comSanShuoExpertService.backstageList(level,getLoginUserInfo());
    public R  backstageList(@RequestParam(value = "level",required = false)Integer level,
                            @RequestParam(value = "page",required = false)Integer page,
                            @RequestParam(value = "size",required = false)Integer size){
        return comSanShuoExpertService.backstageList(level,getLoginUserInfo(),page,size);
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java
@@ -155,6 +155,8 @@
    private ComActActivityInviteService comActActivityInviteService;
    @Resource
    private RabbitTemplate rabbitTemplate;
    @Resource
    private AutomessageSysUserService automessageSysUserService;
    /**
     * 新增社区活动
@@ -2686,4 +2688,25 @@
    public R activityInviteDelete(@RequestParam("id") Long id) {
        return comActActivityInviteService.activityInviteDelete(id);
    }
    /**
     * 根据id查询重复的社区id集合
     * @param id
     * @return
     */
    @GetMapping("selectCommunityIds")
    public R selectCommunityIds(@RequestParam("id") Long id){
        return comActService.selectIds(id);
    }
    /**
     * 通过id查询用户
     * @param id
     * @return
     */
    @GetMapping("selectAutomessageSysUserById")
    public R selectAutomessageSysUserById(@RequestParam("id") Long id){
        return automessageSysUserService.selectAutomessageSysUserById(id);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/AutomessageSysUserDao.java
New file
@@ -0,0 +1,29 @@
package com.panzhihua.service_community.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.service_community.entity.AutomessageSysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
/**
 * 用户表 后台用户+小程序用户(SysUser)表数据库访问层
 * projectName 成都呐喊信息技术有限公司-智慧社区项目
 * description: 用户表 后台用户+小程序用户相关功能
 *
 * @author yh
 * @since 2022-10-21 09:36:09
 */
@Mapper
public interface AutomessageSysUserDao extends BaseMapper<AutomessageSysUser> {
    /**
     * 通过id查询
     * @param id
     * @return
     */
    @Select("select * from automessage_sys_user where user_id = #{id}")
    AutomessageSysUser selectAutomessageSysUserById(@Param("id") Long id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActDAO.java
@@ -115,4 +115,7 @@
    @Select("select community_id from com_act where street_id=#{id}")
    List<Long> selectCommunityByStreetId(Long id);
    @Select("SELECT  caa.community_id FROM com_act caa WHERE caa.`name` = ( select ca.`name` FROM com_act ca WHERE ca.community_id =#{id})")
    List<Long> selectIds(@Param("id") Long id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComSanshuoExpertDao.java
@@ -68,7 +68,9 @@
     * */
    Integer selectExpertCount(@Param("dto") IndexDateDTO indexDataDTO);
    List<ExpertShowVO> selectExpertVoList(Integer level);
    Integer selectExpertVoList();
    IPage<ComSanshuoExpertVO> expertList(Page page, @Param("level") Integer level, @Param("id") Long  id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/AutomessageSysUser.java
New file
@@ -0,0 +1,263 @@
package com.panzhihua.service_community.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
 * <p>
 * 用户信息表
 * </p>
 *
 * @author xiang
 * @since 2022-07-05
 */
@ApiModel("用户信息实体类")
@Data
@TableName("automessage_sys_user")
public class AutomessageSysUser implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 主键id
     */
    @ApiModelProperty("主键id")
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 用户id
     */
    @ApiModelProperty("用户id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;
    /**
     * 登录账号
     */
    @ApiModelProperty("登录账号")
    private String loginName;
    /**
     * 用户昵称
     */
    @ApiModelProperty("用户昵称")
    private String userName;
    /**
     * 用户类型(1系统后台用户     2导办人员用户)
     */
    @ApiModelProperty("用户类型(1系统后台用户     2导办人员用户)")
    private String userType;
    /**
     * 手机号码
     */
    @ApiModelProperty("手机号码")
    private String phonenumber;
    /**
     * 性别 1 男 2 女
     */
    @ApiModelProperty("性别 1 男 2 女")
    private String sex;
    /**
     * 头像路径
     */
    @ApiModelProperty("头像路径")
    private String avatar;
    /**
     * 密码
     */
    @ApiModelProperty("密码")
    private String password;
    /**
     * 盐加密
     */
    @ApiModelProperty("加密")
    private String salt;
    /**
     * 帐号状态(0正常 1停用)
     */
    @ApiModelProperty("帐号状态(0正常 1停用)")
    private String status;
    /**
     * 删除标志(0代表存在 2代表删除)
     */
    @ApiModelProperty("删除标志(0代表存在 2代表删除)")
    private String delFlag;
    /**
     * 最后登录IP
     */
    @ApiModelProperty("最后登录IP")
    private String loginIp;
    /**
     * 最后登录时间
     */
    @ApiModelProperty("最后登录时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime loginDate;
    /**
     * 密码最后更新时间
     */
    @ApiModelProperty("密码最后更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime pwdUpdateDate;
    /**
     * 创建者
     */
    @ApiModelProperty("创建者")
    private String createBy;
    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    /**
     * 更新者
     */
    @ApiModelProperty("更新者")
    private String updateBy;
    /**
     * 更新时间
     */
    @ApiModelProperty("更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;
    /**
     * 备注
     */
    @ApiModelProperty("备注")
    private String remark;
    /**
     * 角色ids
     */
    @ApiModelProperty("角色id")
    private String roleIds;
    /**
     * 数据权限
     */
    @ApiModelProperty("数据权限")
    private String dataPermission;
    /**
     * 部门id
     */
    @ApiModelProperty("部门id")
    private String departmentId;
    /**
     * 一级id
     */
    @ApiModelProperty("一级id")
    private String stairId;
    /**
     * 二级id
     */
    @ApiModelProperty("二级id")
    private String secondLevelId;
    /**
     * 所属部门名称
     */
    @ApiModelProperty("所属部门名称")
    private String departmentName;
    /**
     * 部门所属区域
     */
    @ApiModelProperty("部门所属区域")
    private String departmentArea;
    /**
     * 空闲状态(0 空闲    1 忙碌)
     */
    @ApiModelProperty("空闲状态(0 空闲    1 忙碌)")
    private String leisureState;
    /**
     * 擅长办理事务ids
     */
    @ApiModelProperty("擅长办理事务ids")
    private String masterIds;
    /**
     * 擅长事务名称
     */
    @ApiModelProperty("擅长事务名称")
    private String masterNames;
    /**
     * 办结事项ids
     */
    @ApiModelProperty("办结事项ids")
    private String transactionIds;
    /**
     * 办结事项名称
     */
    @ApiModelProperty("办结事项名称")
    private String transactionNames;
    /**
     * 微信小程序id
     */
    @ApiModelProperty("微信小程序id")
    private String openid;
    /**
     * 待处理办事指南数量
     */
    @ApiModelProperty("待处理办事指南数量")
    private Integer transactionNum;
    @TableField(exist = false)
    @ApiModelProperty("权限资格")
    private String permission;
    @TableField(exist = false)
    @ApiModelProperty("角色名称")
    private String roleName;
    @TableField(exist = false)
    @ApiModelProperty("创建人名称")
    private String createName;
    @ApiModelProperty("是否是部门领导(1是  2不是)")
    private String isDivisionHead;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/ComEventTransferRecord.java
@@ -106,4 +106,5 @@
    private List<ComEventRequestImageVO> images;
    @ApiModelProperty("上报等级,4专家上报到社区,3专家到行业分中心2社区上报到街道,1街道上报到三说会堂,5行业分中心上报到区三说会堂")
    private Integer reportLevel;
    private String content;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/message/AcidMessage.java
@@ -118,7 +118,7 @@
        WxXCXTempSend wxXCXTempSend=new WxXCXTempSend();
        for(String openId:openIds){
            try {
                WxUtil.sendLongTimeTemplate(openId,wxXCXTempSend.getAccessToken("wx118de8a734d269f0"),"疫情快讯",comActDynVO.getTitle().length()>10?comActDynVO.getTitle().substring(0,10)+"..":comActDynVO.getTitle(),"/pages/community_child/community/detail?id="+comActDynVO.getId()+"&title=疫情快讯详情");
                WxUtil.sendLongTimeTemplate(openId,wxXCXTempSend.getXQAppAccessToken(),"疫情快讯",comActDynVO.getTitle().length()>10?comActDynVO.getTitle().substring(0,10)+"..":comActDynVO.getTitle(),"/pages/community_child/community/detail?id="+comActDynVO.getId()+"&title=疫情快讯详情");
            } catch (Exception e) {
                e.printStackTrace();
            }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/AutomessageSysUserService.java
New file
@@ -0,0 +1,21 @@
package com.panzhihua.service_community.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.entity.AutomessageSysUser;
/**
 * @ClassName: AutomessageSysUserService
 * @Author: yh
 * @Date: 2022/10/21 9:38
 * @Description: TODO
 */
public interface AutomessageSysUserService extends IService<AutomessageSysUser> {
    /**
     * 通过id查询
     * @param id
     * @return
     */
    R selectAutomessageSysUserById(Long id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActService.java
@@ -113,4 +113,6 @@
    R communitySwitchSearchDistanceList(SearchCommunityDTO communityDTO);
    R getCommunityPassword(Long communityId);
    R selectIds(Long id);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComSanShuoExpertService.java
@@ -54,5 +54,5 @@
    /**
     * 新增专家后台列表
     * */
    R backstageList(Integer level,LoginUserInfoVO loginUserInfoVO);
    R backstageList(Integer level,LoginUserInfoVO loginUserInfoVO,Integer page,Integer size);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/AutomessageSysUserServiceImpl.java
New file
@@ -0,0 +1,27 @@
package com.panzhihua.service_community.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.service_community.dao.AutomessageSysUserDao;
import com.panzhihua.service_community.entity.AutomessageSysUser;
import com.panzhihua.service_community.service.AutomessageSysUserService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
 * @ClassName: AutomessageSysUserServiceImpl
 * @Author: yh
 * @Date: 2022/10/21 9:39
 * @Description:
 */
@Service
public class AutomessageSysUserServiceImpl extends ServiceImpl<AutomessageSysUserDao, AutomessageSysUser>
        implements AutomessageSysUserService {
    @Resource
    private AutomessageSysUserDao automessageSysUserDao;
    @Override
    public R selectAutomessageSysUserById(Long id) {
        return R.ok(automessageSysUserDao.selectAutomessageSysUserById(id));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActNeighborCircleServiceImpl.java
@@ -2,6 +2,9 @@
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.PageUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.ListUtil;
import cn.hutool.core.util.PageUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -98,6 +101,13 @@
//                }
//            }
//        }
        Long communityId = neighborCircleAppDTO.getCommunityId();
        List<Long> communityIds = comActDAO.selectIds(communityId);
        if (CollUtil.isEmpty(communityIds)) {
            communityIds = new ArrayList<>();
            communityIds.add(communityId);
        }
        neighborCircleAppDTO.setCommunityIds(communityIds);
        Page userPage = new Page(neighborCircleAppDTO.getPageNum(), neighborCircleAppDTO.getPageSize());
        IPage<ComActNeighborCircleAppVO> doPager = this.baseMapper.pageNeighborByApp(userPage, neighborCircleAppDTO);
        if (!doPager.getRecords().isEmpty()) {
@@ -332,6 +342,14 @@
    @Override
    public R pageNeighborByAdmin(ComActNeighborCircleAdminDTO neighborCircleAdminDTO) {
        Long communityId = neighborCircleAdminDTO.getCommunityId();
        List<Long> communityIds = comActDAO.selectIds(communityId);
        if (CollUtil.isEmpty(communityIds)) {
            communityIds = new ArrayList<>();
            communityIds.add(communityId);
        }
        neighborCircleAdminDTO.setCommunityIds(communityIds);
        Page page = new Page(neighborCircleAdminDTO.getPageNum(), neighborCircleAdminDTO.getPageSize());
        IPage<ComActNeighborCircleAdminVO> doPager = this.baseMapper.pageNeighborByAdmin(page, neighborCircleAdminDTO);
        doPager.getRecords().forEach(data -> {
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActServiceImpl.java
@@ -292,4 +292,7 @@
        return R.ok(comActPasswordVo);
    }
    public R selectIds(Long id){
        return R.ok(this.comActDAO.selectIds(id));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComEventServiceImpl.java
@@ -18,6 +18,7 @@
import com.panzhihua.common.model.dtos.community.sanshuo.IndexDateDTO;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.SanShuoMessageVO;
import com.panzhihua.common.model.vos.community.switchs.CommunitySwitchAllAppletsVO;
import com.panzhihua.common.model.vos.sanshuo.*;
import com.panzhihua.common.service.user.UserService;
@@ -26,14 +27,12 @@
import com.panzhihua.common.utlis.Snowflake;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_community.api.ComSanShuoEventTransferRecordController;
import com.panzhihua.service_community.dao.ComActDAO;
import com.panzhihua.service_community.dao.ComEventMapper;
import com.panzhihua.service_community.dao.ComSanshuoExpertDao;
import com.panzhihua.service_community.dao.ComStreetDAO;
import com.panzhihua.service_community.dao.*;
import com.panzhihua.service_community.entity.*;
import com.panzhihua.service_community.model.dos.ComActDO;
import com.panzhihua.service_community.model.dos.ComStreetDO;
import com.panzhihua.service_community.service.*;
import com.panzhihua.service_community.util.WXMessageUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.RandomUtils;
import org.checkerframework.checker.units.qual.A;
@@ -87,6 +86,9 @@
    @Resource
    private ComSanshuoExpertDao comSanshuoExpertDao;
    @Resource
    private SysUserDao sysUserDao;
    @Override
@@ -370,7 +372,8 @@
                    comEvent.setEventProcessStatus(2);
                    comEvent.setSolve(0);
                    comEvent.setDistribution(0);
                    comEvent.setChangeExpert(0);
                    //comEvent.setChangeExpert(0);
                    comEvent.setArchive(0);
                }
                else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventSucceed().equals(2)){
                    //调解完成,可以归档,查看
@@ -378,12 +381,51 @@
                    comEvent.setDistribution(0);
                    comEvent.setChangeExpert(0);
                }
            }else{
            }else if (comEvent.getCurrentProcessType().equals(5)){
                //根据事件状态决定权限
                if (comEvent.getEventProcessStatus().equals(1) ){
                    //待受理和待验证状态,可以受理,分配专家
                    //关闭调解和归档
                    comEvent.setArchive(0);
                    comEvent.setConciliation(0);
                    comEvent.setChangeExpert(0);
                } else if(comEvent.getEventProcessStatus().equals(2)){
                    //待分配和待验证状态,可以受理,分配专家
                    //关闭调解和归档
                    comEvent.setArchive(0);
                    //comEvent.setConciliation(0);
                    comEvent.setChangeExpert(0);
                    if (comEvent.getSpecialistName().equals("待分配")){
                        comEvent.setSolve(0);
                    }
                }
                else if (comEvent.getEventProcessStatus().equals(5)){
                    //调解中,可以查看,调解,更换专家,删除
                    comEvent.setDistribution(0);
                    comEvent.setSolve(0);
                    comEvent.setArchive(0);
                }else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventResult().equals(2) && comEvent.getEventSucceed().equals(2)){
                    //调解完成并且成功,可以归档,查看
                    comEvent.setSolve(0);
                    comEvent.setDistribution(0);
                    comEvent.setChangeExpert(0);
                    comEvent.setConciliation(0);
                }
                else if (comEvent.getEventProcessStatus().equals(6) && comEvent.getEventSucceed().equals(2)){
                    //调解完成,可以归档,查看
                    comEvent.setSolve(0);
                    comEvent.setDistribution(0);
                    comEvent.setChangeExpert(0);
                    comEvent.setConciliation(0);
                }
            }
            else{
                //未上上报到行业分中心,或者已上报到区三说会堂,仅查看
                comEvent.setArchive(0);
                comEvent.setSolve(0);
                comEvent.setDistribution(0);
                comEvent.setChangeExpert(0);
                //comEvent.setConciliation(0);
            }
        }else if (userType.equals(5)  || isStreet){
            //街道权限,操作街道下属社区的所有事件
@@ -582,6 +624,9 @@
            comEvent.setCurrentOrgId(center.getId().toString());
            comEvent.setCurrentProcessType(5);
        }
        if (nonNull(comEvent.getCenterId())){
            comEvent.setRequestUserCommunity(null);
        }
        comEvent.setUserEventStatus(2);
        //设置为未上报
        comEvent.setReportLevel(0);
@@ -596,6 +641,8 @@
        comEvent.setUpdateBy(comEvent.getRequestUserId());
        comEvent.setUpdateAt(new Date());
        boolean flag = save(comEvent);
        //推送消息到专家微信
        sendMessage(comEvent.getSpecialistId(),comEvent);
        //添加一条对应记录
        comEventMapper.insertEventAndExpertRecord(comEvent.getId(),expert.getId(),0);
        if (!flag) {
@@ -604,6 +651,26 @@
        //提交不视为一次流转记录,不保存图片
        saveEventImageList(comEvent.getImages(), comEvent.getId(),null,1);
        return R.ok(ReturnMsgConstants.SAVE_SUCCESS);
    }
    public void sendMessage(Long expertId,ComEvent comEvent){
        //获取专家的openId
        ComSanshuoExpert expert = comSanShuoExpertService.getById(expertId);
        SysUser sysUser = sysUserDao.selectOne(new QueryWrapper<SysUser>().lambda().eq(SysUser::getPhone, expert.getPhone()).eq(SysUser::getType, 1));
        SanShuoMessageVO vo=new SanShuoMessageVO();
        if (nonNull(sysUser)){
            if (isNull(sysUser.getOpenid())){
                log.info("专家未登陆APP,无法推送");
                return;
            }
        }
        vo.setTouser(sysUser.getOpenid());
        vo.setThing1(commediateTypeService.getById(comEvent.getEventCategory()).getName());
        vo.setThing5("您有一个新的调解事件需处理");
        vo.setThing2(comEvent.getRequestUserName());
        vo.setTime3(DateUtil.now());
        WXMessageUtil.sendStatusMessage(vo);
    }
    @Transactional(rollbackFor = Exception.class)
@@ -681,7 +748,7 @@
                    ComActDO comActDO = comActDAO.selectById(expert.getCommunityId());
                    comEvent.setCurrentOrgId(comActDO.getStreetId().toString());
                    //生成一次流转记录
                    comEvent.setCurrentEventProcessResult("专家上报到社区");
                    comEvent.setCurrentEventProcessResult("(专家上报到"+comActDO.getName()+")"+comEventConciliationVO.getCurrentEventProcessResult());
                    //更改当前处理部门
                    comEvent.setCurrentOrgName(comActDO.getName()+"调解站");
                    comEventTransferRecord.setFromId(comEvent.getSpecialistId());
@@ -696,7 +763,8 @@
                    comEvent.setSpecialistName("待分配");
                    comEvent.setSpecialistId(99999L);
                    //生成一次流转记录
                    comEvent.setCurrentEventProcessResult("专家上报到行业分中心");
                    ComSanshuoIndustryCenter center = comSanShuoIndustryCenterService.getById(comEvent.getCurrentOrgId());
                    comEvent.setCurrentEventProcessResult("(专家上报到"+center.getName()+")"+comEventConciliationVO.getCurrentEventProcessResult());
                    comEvent.setCurrentOrgName(expert.getUnit());
                    comEventTransferRecord.setFromId(comEvent.getSpecialistId());
                    comEventTransferRecord.setToId(expert.getIndustryCenterId());
@@ -709,7 +777,7 @@
                comEvent.setCurrentOrgId("99999");
                //生成一次流转记录
                comEvent.setReportHall(1);
                comEvent.setCurrentEventProcessResult("行业分中心上报到区三说会堂");
                comEvent.setCurrentEventProcessResult("(行业分中心上报到区三说会堂中心)"+comEventConciliationVO.getCurrentEventProcessResult());
                comEvent.setCurrentOrgName("区三说会堂");
                comEventTransferRecord.setFromId(comEvent.getSpecialistId());
                comEventTransferRecord.setToId(99999L);
@@ -723,7 +791,7 @@
                ComActDO comActDO = comActDAO.selectOne(new QueryWrapper<ComActDO>().lambda().eq(ComActDO::getCommunityId, comEvent.getRequestUserCommunity()).eq(ComActDO::getAppId, "wx0cef797390444b75"));
                comEvent.setCurrentOrgId(comActDO.getStreetId().toString());
                //生成一次流转记录
                comEvent.setCurrentEventProcessResult("社区报到街道");
                comEvent.setCurrentEventProcessResult("(社区上报到"+comStreetDAO.selectById(comActDO.getStreetId()).getName()+")"+comEventConciliationVO.getCurrentEventProcessResult());
                comEvent.setCurrentOrgName(comStreetDAO.selectById(comActDO.getStreetId()).getName()+"调解站");
                comEventTransferRecord.setFromId(comEvent.getRequestUserCommunity());
                comEventTransferRecord.setToId(comActDO.getStreetId());
@@ -736,7 +804,7 @@
                comEvent.setCurrentOrgId("99999");
                comEvent.setCurrentOrgName("区三说会堂");
                //生成一次流转记录
                comEvent.setCurrentEventProcessResult("街道上报到区三说会堂");
                comEvent.setCurrentEventProcessResult("(街道上报到区三说会堂中心)"+comEventConciliationVO.getCurrentEventProcessResult());
                comEventTransferRecord.setFromId(Long.parseLong(comEvent.getCurrentOrgId()));
                comEventTransferRecord.setReportLevel(1);
                comEvent.setReportLevel(1);
@@ -831,7 +899,16 @@
        List<ComEventResource> resource = comEventResourceService.list(new QueryWrapper<ComEventResource>().lambda().eq(ComEventResource::getRefId, id)
                .eq(ComEventResource::getStatus, 5));
        map.put("archiveImage", resource);
        map.put("contact", getPhone(comEvent));
        return map;
    }
    public String getPhone(ComEvent comEvent){
        if (isNull(comEvent.getRequestUserCommunity())){
            return comSanShuoIndustryCenterService.getById(comEvent.getCenterId()).getPhone();
        }else {
            return comActDAO.selectById(comEvent.getRequestUserCommunity()).getContactsPhone();
        }
    }
    @Override
@@ -859,6 +936,8 @@
        comEvent.setSpecialistName(specter.getName());
        comEvent.setEventProcessStatus(SanShuoEventStatusEnum.VALID.getCode());
        int flag = baseMapper.updateById(comEvent);
        ComEvent comEvent1 = comEventMapper.selectById(id);
        sendMessage(specialistId,comEvent1 );
        //添加一条对应记录
        comEventMapper.insertEventAndExpertRecord(id, specialistId,1);
        return flag > 0 ? R.ok() : R.fail(ReturnMsgConstants.UPDATE_FALSE);
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSanShuoExpertServiceImpl.java
@@ -87,13 +87,15 @@
            expert.setCreateTime(new Date());
            if (expert.getLevel()==2){
                expert.setIndustryCenterId(Long.parseLong(expert.getUnitId()));
                expert.setUnit(comSanshuoIndustryCenterDao.selectById(expert.getUnitId()).getName()+"调解站");
                expert.setUnit(comSanshuoIndustryCenterDao.selectById(expert.getUnitId()).getName());
            }else if(expert.getLevel()==3){
                expert.setStreetId(Long.parseLong(expert.getUnitId()));
                expert.setUnit(comStreetDAO.selectById(expert.getUnitId()).getName()+"调解站");
            }else if(expert.getLevel()==4){
                expert.setCommunityId(Long.parseLong(expert.getUnitId()));
                expert.setUnit(comActDAO.selectById(expert.getUnitId()).getName()+"调解站");
                expert.setUnit(comActDAO.selectById(expert.getUnitId()).getName()+"调解室");
            }else{
                expert.setUnit("区三说会堂");
            }
            expert.setStatus(1);
            expert.setDelFlag(1);
@@ -173,6 +175,13 @@
                    //街道后台
                    range=3;
                    id=loginUserInfo.getStreetId();
                }else if (loginUserInfo.getType().equals(12)){
                    range=2;
                    id=comSanshuoIndustryCenterDao.selectOne(new QueryWrapper<ComSanshuoIndustryCenter>().lambda().eq(ComSanshuoIndustryCenter::getAccount,loginUserInfo.getAccount() )).getId();
                }else if (loginUserInfo.getType().equals(3)){
                    //社区后台账号
                    range=4;
                    id=loginUserInfo.getCommunityId();
                }
            }
        }
@@ -181,6 +190,7 @@
            id=null;
            range=1;
        }
        log.info("");
        IPage<ComSanshuoExpertVO> comSanshuoExpertVOIPage = comSanshuoExpertDao.expertPage(new Page(page, size), keyWord, range, id, level);
        for (ComSanshuoExpertVO record : comSanshuoExpertVOIPage.getRecords()) {
            //获取调解次数和成功率
@@ -206,7 +216,7 @@
            if (nonNull(expertShowVO.getLevel())){
                if (1==expertShowVO.getLevel()) {
                    expertShowVO.setName("区三说会堂调解专家");
                    // expertShowVO.setChildList(comSanshuoExpertDao.selectExpertVoList(expertShowVO.getLevel()));
                    expertShowVO.setCount(comSanshuoExpertDao.selectExpertVoList());
                }else if (2==expertShowVO.getLevel()){
                    expertShowVO.setName("行业分中心调解专家");
                    List<ExpertShowVO> expertShowVOS1 = comSanshuoExpertDao.selectExpertIndustry();
@@ -349,17 +359,15 @@
            Integer count = comEventMapper.selectCount(new QueryWrapper<ComEvent>().lambda().eq(ComEvent::getSpecialistId, comSanshuoExpert.getId()).eq(ComEvent::getEventProcessStatus, 6));
            Integer successCount = comEventMapper.selectCount(new QueryWrapper<ComEvent>().lambda().eq(ComEvent::getSpecialistId, comSanshuoExpert.getId()).eq(ComEvent::getEventProcessStatus, 6).eq(ComEvent::getEventResult, 2));
            comSanshuoExpert.setCount(count);
            if (nonNull(count) && !count.equals(0)){
                comSanshuoExpert.setCount(count);
                if (nonNull(successCount) && !count.equals(successCount)){
                    //计算成功率
                    comSanshuoExpert.setRate(NumberUtil.div(successCount, count,2));
                }else {
                    comSanshuoExpert.setRate(new BigDecimal(0));
            if (nonNull(successCount) && nonNull(count)){
                if (!successCount.equals(0) && !count.equals(0)){
                        //计算成功率
                        comSanshuoExpert.setRate(NumberUtil.div(successCount, count,2));
                }
            }else {
                comSanshuoExpert.setCount(0);
                comSanshuoExpert.setRate(new BigDecimal(0));
            }
        }
        return R.ok(comSanshuoExperts);
    }
@@ -414,20 +422,20 @@
    }
    @Override
    public R backstageList(Integer level,LoginUserInfoVO loginUserInfoVO) {
    public R backstageList(Integer level,LoginUserInfoVO loginUserInfoVO,Integer page,Integer size) {
        if (nonNull(level)){
            if (level.equals(1)){
                //三说会堂权限,查看所有
                return R.ok(comSanshuoExpertDao.selectList(null));
                return R.ok(comSanshuoExpertDao.expertList(new Page(page,size),level,null));
            }else if (level.equals(2)){
                //行业分中心
                ComSanshuoIndustryCenter center = comSanshuoIndustryCenterDao.selectOne(new QueryWrapper<ComSanshuoIndustryCenter>().lambda().eq(ComSanshuoIndustryCenter::getAccount, loginUserInfoVO.getAccount()));
                return R.ok(comSanshuoExpertDao.selectList(new QueryWrapper<ComSanshuoExpert>().lambda().eq(ComSanshuoExpert::getIndustryCenterId,center.getId())));
                return R.ok(comSanshuoExpertDao.expertList(new Page(page,size),level,center.getId()));
            }else if (level.equals(3)){
                //街道
                return R.ok(comSanshuoExpertDao.selectList(new QueryWrapper<ComSanshuoExpert>().lambda().eq(ComSanshuoExpert::getStreetId,loginUserInfoVO.getStreetId())));
                return R.ok(comSanshuoExpertDao.expertList(new Page(page,size),level,loginUserInfoVO.getStreetId()));
            }else if(level.equals(4)){
                return R.ok(comSanshuoExpertDao.selectList(new QueryWrapper<ComSanshuoExpert>().lambda().eq(ComSanshuoExpert::getCommunityId,loginUserInfoVO.getCommunityId())));
                return R.ok(comSanshuoExpertDao.expertList(new Page(page,size),level,loginUserInfoVO.getCommunityId()));
            }
        }
        return null;
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/util/WXMessageUtil.java
New file
@@ -0,0 +1,56 @@
package com.panzhihua.service_community.util;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONUtil;
import com.panzhihua.common.model.vos.SanShuoMessageVO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import java.util.HashMap;
import java.util.Map;
@Slf4j
public class WXMessageUtil {
    private static final String APP_ID="wx0cef797390444b75";
    private static final String SEND_MESSAGE_URL="https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token=";
    private static final String TOKEN_URL="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential";
    private static final String SECRET="c7ea9aaa7e391a487e8a5b9ba61045d1";
    private static final String TEMPLATE_ID="iy8r0YbGlvmysbjGcbEj0yx-kftKBjC-HrXlSeNBrE0";
    public static String queryToken(){
        String tokenUrl=TOKEN_URL+"&appid="+APP_ID+"&secret="+SECRET;
        String result= HttpUtil.get(tokenUrl);
        cn.hutool.json.JSONObject obj = JSONUtil.parseObj(result);
        String token = obj.get("access_token").toString();
        return token;
    }
    public static String sendStatusMessage(SanShuoMessageVO vo){
        String token = queryToken();
        if (StringUtils.isNotEmpty(token)){
            //发送消息
            String url=SEND_MESSAGE_URL+token;
            Map<String,Object> param=new HashMap<>();
            param.put("touser", vo.getTouser());
            param.put("template_id", TEMPLATE_ID);
            Map<String,Object> data=new HashMap<>();
            data.put("thing1", formData(vo.getThing1()));
            data.put("thing5", formData(vo.getThing5()));
            data.put("thing2", formData(vo.getThing2()));
            data.put("time3", formData(vo.getTime3()));
            param.put("data", data);
            String paramMap = JSONUtil.toJsonStr(param);
            log.info("===============推送参数:"+paramMap);
            String result = HttpUtil.post(url, paramMap);
            log.info("状态推送结果"+result);
            return result;
        }
        return null;
    }
    public static Map<String,Object> formData(String param){
        Map<String,Object> data=new HashMap<>();
        data.put("value",param );
        return data;
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActNeighborCircleDOMapper.xml
@@ -47,7 +47,11 @@
        left join sys_user as su on su.user_id = canc.release_id
        left join com_act_neighbor_circle_topic as canct on canct.id = canc.topic_id
        left join com_act as ca on ca.community_id = canc.community_id
        where is_del = 2 and canc.status = 2 and canc.community_id = ${neighborCircleAppDTO.communityId}
        where is_del = 2 and canc.status = 2
        and canc.community_id in
        <foreach collection="neighborCircleAppDTO.communityIds" item="item" index="index" open="(" separator="," close=")">
            ${item}
        </foreach>
        <if test='neighborCircleAppDTO.topicId != null '>
            and canc.topic_id = #{neighborCircleAppDTO.topicId}
        </if>
@@ -95,7 +99,11 @@
        LEFT JOIN sys_user u ON nc.release_id = u.user_id
        LEFT JOIN com_act_neighbor_circle_topic as canct ON canct.id = nc.topic_id
        <where>
            nc.community_id = ${neighborCircleAdminDTO.communityId} and is_del = 2
            nc.community_id in
            <foreach collection="neighborCircleAdminDTO.communityIds" item="item" index="index" open="(" separator="," close=")">
                ${item}
            </foreach>
            and is_del = 2
            <if test='neighborCircleAdminDTO.releaseContent != null and neighborCircleAdminDTO.releaseContent != &quot;&quot;'>
                and nc.release_content like concat('%',#{neighborCircleAdminDTO.releaseContent},'%')
            </if>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComSanshuoExpertDao.xml
@@ -89,7 +89,7 @@
           </if>
    </select>
    <select id="selectExpertIndustry" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
        select  count(t.id) as 'count',t1.name,t1.id from com_sanshuo_expert t
        select  count(t.id) as 'count',t1.name,t1.id,t.level from com_sanshuo_expert t
        left join com_sanshuo_industry_center t1 on t.industry_center_id=t1.id
        where t.level=2 and t.status=1 and t.del_flag=1
        group by t1.name
@@ -97,13 +97,13 @@
    <select id="selectExpertStreet" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
        select  count(t.id) as 'count',t1.name,t1.street_id as id from com_sanshuo_expert t
        select  count(t.id) as 'count',t1.name,t1.street_id as id,t.level from com_sanshuo_expert t
        left join com_street t1 on t.street_id=t1.street_id
        where t.level=3 and t.status=1 and t.del_flag=1
        group by t1.name
    </select>
    <select id="selectExpertCommunity" resultType="com.panzhihua.common.model.vos.sanshuo.ExpertShowVO">
        select  count(t.id) as 'count',t1.name,t1.community_id as id from com_sanshuo_expert t
        select  count(t.id) as 'count',t1.name,t1.community_id as id,t.level from com_sanshuo_expert t
        left join com_act t1 on t.community_id=t1.community_id
        where t.level=4 and t.status=1 and t.del_flag=1
        group by t1.name
@@ -145,4 +145,37 @@
            </if>
        </if>
    </select>
    <select id="selectExpertVoList" resultType="Integer">
        select count(id) from com_sanshuo_expert where level=1
    </select>
    <select id="expertList" resultType="com.panzhihua.common.model.vos.sanshuo.ComSanshuoExpertVO">
        select id,level,community_id,
        work_time,good_at,name,
        avatar,phone,account,
        password,status,del_flag,
        create_time,create_by,update_time,
        introduction,street_id,industry_center_id,
        unit_id,unit from com_sanshuo_expert
        where del_flag=1
        <if test="level != null">
            <if test="level == 2">
                AND level = 2
                <if test="id != null">
                    AND industry_center_id=#{id}
                </if>
            </if>
            <if test="level == 3">
                AND level = 3
                <if test="id != null">
                    AND street_id=#{id}
                </if>
            </if>
            <if test="level == 4">
                AND level = 4
                <if test="id != null">
                    AND community_id=#{id}
                </if>
            </if>
        </if>
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbCheckUnitMapper.java
@@ -59,12 +59,12 @@
    /**
     * 报到单位统计-顶部数据
     * @param communityId
     * @param communityIds
     * @param belongTo
     * @param choice
     * @return
     */
    PbCheckUnitStatisticsVo unitStatisticsTop(@Param("communityId") Long communityId, @Param("belongTo") String belongTo, @Param("choice") String choice);
    PbCheckUnitStatisticsVo unitStatisticsTop(@Param("communityIds") List<Long> communityIds, @Param("belongTo") String belongTo, @Param("choice") String choice);
    /**
     * 报到单位统计
@@ -76,13 +76,13 @@
    /**
     * 报到党员统计-顶部数据
     * @param communityId
     * @param communityIds
     * @param belongTo
     * @param choice
     * @param checkUnitId
     * @return
     */
    PbCheckUnitStatisticsVo pbStatisticsTop(@Param("communityId") Long communityId, @Param("belongTo") String belongTo, @Param("choice") String choice, @Param("checkUnitId") Long checkUnitId);
    PbCheckUnitStatisticsVo pbStatisticsTop(@Param("communityIds") List<Long> communityIds, @Param("belongTo") String belongTo, @Param("choice") String choice, @Param("checkUnitId") Long checkUnitId);
    /**
     * 报到党员统计-按单位归属统计
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/dao/ComPbMemberDAO.java
@@ -205,4 +205,7 @@
     * @return
     */
    IPage<PartyBuildingMemberVO> pageRegisterMember(@Param("page") Page page, @Param("dto") PageMemberForInviteDTO dto);
    @Select("SELECT  caa.community_id FROM com_act caa WHERE caa.`name` = ( select ca.`name` FROM com_act ca WHERE ca.community_id =#{id})")
    List<Long> selectIds(@Param("id") Long id);
}
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbCheckUnitServiceImpl.java
@@ -1,5 +1,7 @@
package com.panzhihua.service_dangjian.service.impl;
import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.google.common.collect.Lists;
@@ -7,6 +9,7 @@
import com.panzhihua.common.model.vos.common.ComPbCheckUnitVo;
import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitErrorExcelVO;
import com.panzhihua.common.model.vos.partybuilding.excel.ComPbCheckUnitExcelVO;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.service_dangjian.dao.ComPbMemberDAO;
import com.panzhihua.service_dangjian.dao.ComPbMemberRoleDAO;
@@ -48,6 +51,8 @@
    private ComPbMemberRoleDAO comPbMemberRoleDAO;
    @Resource
    private ComPbMemberService comPbMemberService;
    @Resource
    private CommunityService communityService;
    /**
     * description  queryByPage  分页查询
@@ -59,6 +64,21 @@
     */
    @Override
    public R queryByPage(PageComPbCheckUnitDto comPbCheckUnit) {
        Long communityId = comPbCheckUnit.getCommunityId();
        R r = communityService.selectCommunityIds(communityId);
        List<Long> communityIds = null;
        if(R.isOk(r)){
            communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class);
            if (CollUtil.isEmpty(communityIds)) {
                communityIds = new ArrayList<>();
                communityIds.add(communityId);
            }
        }else {
            communityIds = new ArrayList<>();
            communityIds.add(communityId);
        }
        comPbCheckUnit.setCommunityIds(communityIds);
        IPage<ComPbCheckUnitVo> checkUnitVoPage= this.baseMapper.queryAllByLimit(comPbCheckUnit, new Page(comPbCheckUnit.getPageNum(), comPbCheckUnit.getPageSize()));
        checkUnitVoPage.getRecords().forEach(checkUnit -> {
            if(StringUtils.isEmpty(checkUnit.getOrgName())){
@@ -168,6 +188,20 @@
     */
    @Override
    public R queryByList(PageComPbCheckUnitDto comPbCheckUnit) {
        Long communityId = comPbCheckUnit.getCommunityId();
        R r = communityService.selectCommunityIds(communityId);
        List<Long> communityIds = null;
        if(R.isOk(r)){
            communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class);
            if (CollUtil.isEmpty(communityIds)) {
                communityIds = new ArrayList<>();
                communityIds.add(communityId);
            }
        }else {
            communityIds = new ArrayList<>();
            communityIds.add(communityId);
        }
        comPbCheckUnit.setCommunityIds(communityIds);
        IPage<ComPbCheckUnitVo> checkUnitList = this.baseMapper.queryAllByLimit(comPbCheckUnit,new Page(comPbCheckUnit.getPageNum(),comPbCheckUnit.getPageSize()));
        checkUnitList.getRecords().forEach(checkUnit -> {
            if(StringUtils.isEmpty(checkUnit.getOrgName())){
@@ -246,7 +280,19 @@
     */
    @Override
    public R unitStatisticsTop(Long communityId, String belongTo, String choice) {
        return R.ok(this.baseMapper.unitStatisticsTop(communityId, belongTo, choice));
        R r = communityService.selectCommunityIds(communityId);
        List<Long> communityIds = null;
        if(R.isOk(r)){
            communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class);
            if (CollUtil.isEmpty(communityIds)) {
                communityIds = new ArrayList<>();
                communityIds.add(communityId);
            }
        }else {
            communityIds = new ArrayList<>();
            communityIds.add(communityId);
        }
        return R.ok(this.baseMapper.unitStatisticsTop(communityIds, belongTo, choice));
    }
    /**
@@ -256,6 +302,20 @@
     */
    @Override
    public R unitStatistics(PagePbCheckUnitCommonDto commonDto) {
        Long communityId = commonDto.getCommunityId();
        R r = communityService.selectCommunityIds(communityId);
        List<Long> communityIds = null;
        if(R.isOk(r)){
            communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class);
            if (CollUtil.isEmpty(communityIds)) {
                communityIds = new ArrayList<>();
                communityIds.add(communityId);
            }
        }else {
            communityIds = new ArrayList<>();
            communityIds.add(communityId);
        }
        commonDto.setCommunityIds(communityIds);
        return R.ok(this.baseMapper.unitStatistics(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize())));
    }
@@ -269,7 +329,20 @@
     */
    @Override
    public R pbStatisticsTop(Long communityId, String belongTo, String choice, Long checkUnitId) {
        return R.ok(this.baseMapper.pbStatisticsTop(communityId, belongTo, choice, checkUnitId));
        R r = communityService.selectCommunityIds(communityId);
        List<Long> communityIds = null;
        if(R.isOk(r)){
            communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class);
            if (CollUtil.isEmpty(communityIds)) {
                communityIds = new ArrayList<>();
                communityIds.add(communityId);
            }
        }else {
            communityIds = new ArrayList<>();
            communityIds.add(communityId);
        }
        return R.ok(this.baseMapper.pbStatisticsTop(communityIds, belongTo, choice, checkUnitId));
    }
    /**
@@ -279,6 +352,20 @@
     */
    @Override
    public R pbStatisticsBelong(PagePbCheckUnitCommonDto commonDto) {
        Long communityId = commonDto.getCommunityId();
        R r = communityService.selectCommunityIds(communityId);
        List<Long> communityIds = null;
        if(R.isOk(r)){
            communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class);
            if (CollUtil.isEmpty(communityIds)) {
                communityIds = new ArrayList<>();
                communityIds.add(communityId);
            }
        }else {
            communityIds = new ArrayList<>();
            communityIds.add(communityId);
        }
        commonDto.setCommunityIds(communityIds);
        return R.ok(this.baseMapper.pbStatisticsBelong(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize())));
    }
@@ -289,6 +376,20 @@
     */
    @Override
    public R pbStatisticsUnit(PagePbCheckUnitCommonDto commonDto) {
        Long communityId = commonDto.getCommunityId();
        R r = communityService.selectCommunityIds(communityId);
        List<Long> communityIds = null;
        if(R.isOk(r)){
            communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class);
            if (CollUtil.isEmpty(communityIds)) {
                communityIds = new ArrayList<>();
                communityIds.add(communityId);
            }
        }else {
            communityIds = new ArrayList<>();
            communityIds.add(communityId);
        }
        commonDto.setCommunityIds(communityIds);
        return R.ok(this.baseMapper.pbStatisticsUnit(commonDto, new Page(commonDto.getPageNum(), commonDto.getPageSize())));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/java/com/panzhihua/service_dangjian/service/impl/ComPbMemberServiceImpl.java
@@ -8,7 +8,9 @@
import javax.annotation.Resource;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdcardUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.panzhihua.common.model.dtos.community.PageMemberForInviteDTO;
import com.panzhihua.common.model.dtos.partybuilding.ComDataStatisticsOrgDto;
@@ -202,6 +204,22 @@
     */
    @Override
    public R pagePartyOrganization(PagePartyOrganizationVO pagePartyOrganizationVO) {
        Long communityId = pagePartyOrganizationVO.getCommunityId();
        R r = communityService.selectCommunityIds(communityId);
        List<Long> communityIds = null;
        if(R.isOk(r)){
            communityIds = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), Long.class);
            if (CollUtil.isEmpty(communityIds)) {
                communityIds = new ArrayList<>();
                communityIds.add(communityId);
            }
        }else {
            communityIds = new ArrayList<>();
            communityIds.add(communityId);
        }
        pagePartyOrganizationVO.setCommunityIds(communityIds);
        Page page = new Page<>();
        Long pageNum = pagePartyOrganizationVO.getPageNum();
        Long pageSize = pagePartyOrganizationVO.getPageSize();
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbCheckUnitMapper.xml
@@ -36,8 +36,11 @@
            <if test="dto.type != null">
                and cpcu.`type` = #{dto.type}
            </if>
            <if test="dto.communityId != null and dto.communityId!=0">
                and cpcu.community_id = #{dto.communityId}
            <if test="dto.communityIds != null and dto.communityIds.size()>0">
                AND cpcu.community_id IN
                <foreach collection="dto.communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="dto.keyWord != null and dto.keyWord != ''">
                and (cpcu.contacts like concat(#{dto.keyWord},'%') or cpcu.`name` like concat('%',#{dto.keyWord},'%') or cpcu.phone like concat(#{dto.keyWord},'%'))
@@ -98,9 +101,13 @@
            resultType="com.panzhihua.common.model.vos.common.PbCheckUnitStatisticsVo">
        SELECT
        (SELECT COUNT( id ) FROM com_pb_check_unit WHERE 1=1
            <if test="communityId != null">
                AND community_id = #{communityId}
            <if test="communityIds != null and communityIds.size() >0">
                AND community_id IN
                <foreach collection="communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="belongTo != null and belongTo != ''">
                AND belong_to = #{belongTo}
            </if>
@@ -109,8 +116,11 @@
            </if>
        ) AS unitTotal,
        (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '机关单位'
            <if test="communityId != null">
                AND community_id = #{communityId}
            <if test="communityIds != null and communityIds.size() >0">
                AND community_id IN
                <foreach collection="communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="belongTo != null and belongTo != ''">
                AND belong_to = #{belongTo}
@@ -120,8 +130,11 @@
            </if>
        ) AS organTotal,
        (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '企事业单位'
            <if test="communityId != null">
                AND community_id = #{communityId}
            <if test="communityIds != null and communityIds.size() >0">
                AND community_id IN
                <foreach collection="communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="belongTo != null and belongTo != ''">
                AND belong_to = #{belongTo}
@@ -131,8 +144,11 @@
            </if>
        ) AS businessTotal,
        (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1
            <if test="communityId != null">
                AND m.community_id = #{communityId}
            <if test="communityIds != null and communityIds.size() >0">
                AND m.community_id IN
                <foreach collection="communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="belongTo != null and belongTo != ''">
                AND cpcu.belong_to = #{belongTo}
@@ -145,24 +161,37 @@
    <select id="unitStatistics" resultType="com.panzhihua.common.model.vos.common.PbCheckUnitStatisticsVo">
        SELECT temp.*,
        (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '机关单位'
            <if test="commonDto.communityId != null">
                AND community_id = #{commonDto.communityId}
            <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0">
                AND community_id IN
                <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
         AND belong_to = temp.belong_to) AS organTotal,
        (SELECT COUNT( id ) FROM com_pb_check_unit WHERE nature_name = '企事业单位'
            <if test="commonDto.communityId != null">
                AND community_id = #{commonDto.communityId}
            <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0">
                AND community_id IN
                <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
        AND belong_to = temp.belong_to) AS businessTotal,
        (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1
            <if test="commonDto.communityId != null">
                AND m.community_id = #{commonDto.communityId}
            <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0">
                AND m.community_id IN
                <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
         AND cpcu.belong_to = temp.belong_to) AS partyMemberTotal
        FROM (SELECT belong_to,COUNT( id ) AS unitTotal FROM com_pb_check_unit WHERE 1=1
        <if test="commonDto.communityId != null">
            AND community_id = #{commonDto.communityId}
        </if>
            <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0">
                AND community_id IN
                <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
        <if test="commonDto.belongTo != null and commonDto.belongTo != ''">
            AND belong_to = #{commonDto.belongTo}
        </if>
@@ -172,9 +201,13 @@
        SELECT
        (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1
        AND cpcu.nature_name = '机关单位'
        <if test="communityId != null">
            AND m.community_id = #{communityId}
        <if test="communityIds != null and communityIds.size() >0">
            AND m.community_id IN
            <foreach collection="communityIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="belongTo != null and belongTo != ''">
            AND cpcu.belong_to = #{belongTo}
        </if>
@@ -187,8 +220,11 @@
        ) AS organTotal,
        (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1
        AND cpcu.nature_name = '企事业单位'
        <if test="communityId != null">
            AND m.community_id = #{communityId}
        <if test="communityIds != null and communityIds.size() >0">
            AND m.community_id IN
            <foreach collection="communityIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="belongTo != null and belongTo != ''">
            AND cpcu.belong_to = #{belongTo}
@@ -201,8 +237,11 @@
        </if>
        ) AS businessTotal,
        (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1
        <if test="communityId != null">
            AND m.community_id = #{communityId}
        <if test="communityIds != null and communityIds.size() >0">
            AND m.community_id IN
            <foreach collection="communityIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="belongTo != null and belongTo != ''">
            AND cpcu.belong_to = #{belongTo}
@@ -218,19 +257,28 @@
    <select id="pbStatisticsBelong" resultType="com.panzhihua.common.model.vos.common.PbCheckUnitStatisticsVo">
        SELECT temp.*,
        (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1
            <if test="commonDto.communityId != null">
                AND m.community_id = #{commonDto.communityId}
            <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0">
                AND m.community_id IN
                <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
        AND AND m.check_unit_id is not null AND cpcu.nature_name = '机关单位' AND cpcu.belong_to = temp.belong_to) AS organTotal,
         AND m.check_unit_id is not null AND cpcu.nature_name = '机关单位' AND cpcu.belong_to = temp.belong_to) AS organTotal,
        (SELECT COUNT( m.id ) FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1
            <if test="commonDto.communityId != null">
                AND m.community_id = #{commonDto.communityId}
            </if>
            <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0">
                AND m.community_id IN
                    <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")">
                        #{item}
                    </foreach>
                </if>
        AND cpcu.nature_name = '企事业单位' AND cpcu.belong_to = temp.belong_to) AS businessTotal
        FROM (SELECT cpcu.belong_to,COUNT( m.id ) AS partyMemberTotal FROM com_pb_member m LEFT JOIN com_pb_check_unit as cpcu ON m.check_unit_id = cpcu.id WHERE m.audit_result = 1
        <if test="commonDto.communityId != null">
            AND m.community_id = #{commonDto.communityId}
        </if>
            <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0">
                AND m.community_id IN
                <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
        <if test="commonDto.belongTo != null and commonDto.belongTo != ''">
            AND cpcu.belong_to = #{commonDto.belongTo}
        </if>
@@ -250,8 +298,11 @@
        LEFT JOIN com_pb_check_unit AS cpcu ON m.check_unit_id = cpcu.id
        WHERE
        m.audit_result = 1
        <if test="commonDto.communityId != null">
            AND m.community_id = #{commonDto.communityId}
        <if test="commonDto.communityIds != null and commonDto.communityIds.size() >0">
            AND m.community_id IN
            <foreach collection="commonDto.communityIds" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
        </if>
        <if test="commonDto.belongTo != null and commonDto.belongTo != ''">
            AND cpcu.belong_to = #{commonDto.belongTo}
springcloud_k8s_panzhihuazhihuishequ/service_partybuilding/src/main/resources/mapper/ComPbMemberMapper.xml
@@ -88,9 +88,13 @@
            <if test="dto.orgId != null">
                and m.org_id = #{dto.orgId}
            </if>
            <if test="dto.communityId != null and dto.communityId !=0">
                and m.community_id = ${dto.communityId}
            <if test="dto.communityIds != null and dto.communityIds.size() >0">
                and m.community_id IN
                <foreach collection="dto.communityIds" item="item" open="(" separator="," close=")">
                    #{item}
                </foreach>
            </if>
            <if test="dto.keyWord != null and dto.keyWord != ''">
                and (m.name like concat ('%',#{dto.keyWord},'%') or
                m.phone like concat ('%',#{dto.keyWord},'%') or