101captain
2022-05-11 433fdf913a6366704ff6485cf2269a23af949770
花城E+ 代码修改
4个文件已修改
40 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginUserInfoVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/LoginUserInfoVO.java
@@ -216,6 +216,9 @@
    @ApiModelProperty("绑定单位")
    private String relationName;
    @ApiModelProperty("区域划分")
    private String areaName;
    public String retrieveRelationName() {
        return this.type == 3 ? relationName : name;
    }
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/dao/UserDao.java
@@ -263,4 +263,11 @@
     * @return
     */
    List<ComAreaTownCommunityVO> selectAreaTownCommunity(@Param("relationName") String relationName);
    /**
     * 根据街道id查询区域名称
     * @param streetId
     * @return
     */
    String selectAreaCodeByStreetId(Long streetId);
}
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/UserServiceImpl.java
@@ -332,6 +332,10 @@
            loginUserInfoVO.setCommunityId(sysUserDO.getCommunityId());
            if(comActVO!=null){
                loginUserInfoVO.setComActVO(comActVO);
                String areaName=userDao.selectAreaCodeByStreetId(comActVO.getStreetId());
                if(StringUtils.isNotEmpty(areaName)){
                    loginUserInfoVO.setAreaName(areaName);
                }
                SysAppConfig sysAppConfig=sysAppConfigDao.selectOne(new QueryWrapper<SysAppConfig>().lambda().eq(SysAppConfig::getAreaCode,comActVO.getAreaCode()));
                if(sysAppConfig!=null){
                    loginUserInfoVO.setAppId(sysAppConfig.getAppId());
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/resources/mapper/UserDao.xml
@@ -104,9 +104,6 @@
        <if test='pageUserAppletsBackstageDTO.communityId != null and pageUserAppletsBackstageDTO.communityId != 0'>and
            u.community_id = #{pageUserAppletsBackstageDTO.communityId}
        </if>
        <if test='pageUserAppletsBackstageDTO.areaCode != null'>and
            a.area_code = #{pageUserAppletsBackstageDTO.areaCode}
        </if>
        <if test='pageUserAppletsBackstageDTO.status != null and pageUserAppletsBackstageDTO.status != 0'>and
            u.status=#{pageUserAppletsBackstageDTO.status}
        </if>
@@ -125,10 +122,10 @@
        COUNT(user_id)allUser,
        COUNT(case WHEN DATE_FORMAT(t.create_at,'%m-%d-%Y')=DATE_FORMAT(SYSDATE(),'%m-%d-%Y') then user_id else null end )addUser,
        COUNT(case WHEN DATE_FORMAT(last_login_time,'%m-%d-%Y')=DATE_FORMAT(SYSDATE(),'%m-%d-%Y') then user_id else null end )activeDayUser,
        (SELECT count(user_id) FROM sys_user t left join com_act t1 on t.community_id = t1.community_id WHERE type = 1 and t1.area_code = #{areaCode} AND last_login_time > date_sub(SYSDATE(), INTERVAL 7 DAY))activeWeekUser
        (SELECT count(user_id) FROM sys_user t left join com_act t1 on t.community_id = t1.community_id WHERE type = 1  AND last_login_time > date_sub(SYSDATE(), INTERVAL 7 DAY))activeWeekUser
        FROM
        sys_user t LEFT JOIN com_act t1 on t.community_id = t1.community_id
        where t.type=1 and t.community_id is not null and t1.area_code = #{areaCode}
        where t.type=1 and t.community_id is not null
            </select>
    <select id="selectCommunityUserOrder" resultType="com.panzhihua.service_user.model.dtos.DataKanbanDTO">
@@ -140,7 +137,7 @@
        AND last_login_time > DATE_FORMAT( date_sub( SYSDATE(), INTERVAL 0 DAY ), '%Y-%m-%d 00:00:00')) as dayNum
        FROM
        com_act a
        LEFT JOIN sys_user u ON a.community_id = u.community_id and u.type=1 and a.state=0 where a.area_code = #{areaCode}
        LEFT JOIN sys_user u ON a.community_id = u.community_id and u.type=1 and a.state=0
        GROUP BY a.community_id)t ORDER BY t.num desc
    </select>
@@ -154,7 +151,7 @@
        FROM
        com_act a
        LEFT JOIN sys_user u ON a.community_id = u.community_id
        and u.type=1 and a.state=0 and u.create_at >= DATE_ADD(curdate(),interval -day(curdate())+1 day) where a.area_code = #{areaCode}
        and u.type=1 and a.state=0 and u.create_at >= DATE_ADD(curdate(),interval -day(curdate())+1 day)
        GROUP BY a.community_id)t ORDER BY t.num desc
    </select>
@@ -189,9 +186,6 @@
            <if test='administratorsUserVO.phone != null and administratorsUserVO.phone.trim() != &quot;&quot;'>AND
                u.phone like concat(#{administratorsUserVO.phone},'%')
            </if>
            <if test='administratorsUserVO.areaCode != null '>
                AND ca.area_code = #{administratorsUserVO.areaCode}
            </if>
            <if test='administratorsUserVO.account != null and administratorsUserVO.account.trim() != &quot;&quot;'>AND
                u.account like concat(#{administratorsUserVO.account},'%')
            </if>
@@ -210,12 +204,12 @@
    <select id="selectCommunityAddUserOrder" resultType="com.panzhihua.service_user.model.dtos.DataKanbanDTO">
        select count(user_id) as num,
        (SELECT count( user_id ) FROM sys_user t LEFT JOIN com_act t1 on t.community_id=t1.community_id WHERE t.type = 1 and t1.area_code = #{areaCode}
        (SELECT count( user_id ) FROM sys_user t LEFT JOIN com_act t1 on t.community_id=t1.community_id WHERE t.type = 1
        AND last_login_time <![CDATA[ >= ]]> DATE_FORMAT( #{date1}, '%Y-%m-%d 00:00:00')
        AND last_login_time <![CDATA[ <= ]]> DATE_FORMAT( #{date1}, '%Y-%m-%d 23:59:59')) as dayNum from sys_user as su LEFT JOIN com_act t1 on su.community_id = t1.community_id
        where su.create_at <![CDATA[ >= ]]> DATE_SUB(DATE_FORMAT(#{date1},'%Y-%m-%d 00:00:00'),INTERVAL 0 DAY)
        and su.create_at <![CDATA[ <= ]]> DATE_SUB(DATE_FORMAT(#{date1},'%Y-%m-%d 23:59:59'),INTERVAL 0 DAY)
        and su.type = 1 and t1.area_code=#{areaCode}
        and su.type = 1
    </select>
    <update id="gridMemberEditStatus">
@@ -480,7 +474,7 @@
                AND ca.street_id = cs.street_id
            ) AS userNum
        FROM
            `com_street` AS cs where area_code=#{areaCode}
            `com_street` AS cs
            order by userNum desc
    </select>
@@ -521,7 +515,7 @@
            LEFT JOIN com_street AS cs ON cs.street_id = ca.street_id
        WHERE
            su.type = 1
            AND su.community_id IS NOT NULL and ca.area_code = #{areaCode}
            AND su.community_id IS NOT NULL
        GROUP BY
            ca.community_id
        ORDER BY
@@ -560,4 +554,8 @@
        SELECT * FROM com_area_town_community WHERE community = #{relationName}
    </select>
    <select id="selectAreaCodeByStreetId" resultType="String">
        select t.name from com_mng_struct_area_district t left join com_street t1 on t.district_adcode  = t1.area_code where t1.street_id =#{streetId}
    </select>
</mapper>