forked from kidgrow-microservices-platform

zhaoxiaohao
2021-03-01 7ea2a2cfe922c9b2d5c09c737d10a7f1ab5b50d1
kidgrow-business/kidgrow-usercenter/kidgrow-usercenter-biz/src/main/java/com/kidgrow/usercenter/service/impl/SysOrganizationServiceImpl.java
@@ -6,6 +6,7 @@
import com.kidgrow.common.model.ResultBody;
import com.kidgrow.common.model.SysOrganization;
import com.kidgrow.common.service.impl.SuperServiceImpl;
import com.kidgrow.common.utils.StringUtils;
import com.kidgrow.redis.util.RedisConstant;
import com.kidgrow.redis.util.RedisUtils;
import com.kidgrow.usercenter.mapper.SysOrganizationMapper;
@@ -151,7 +152,7 @@
    @Override
    public int deleteByUserId(Long userId) {
        Map<String, Object> params = new HashMap<>();
        params.put("userId", userId);
        params.put("user_id", userId);
        return sysUserOrgMapper.deleteByMap(params);
    }
@@ -241,16 +242,19 @@
                SysOrganization sysOrganizationLast = list.get(list.size() - 1);
                if (sysOrganizationLast.getOrgLevel() >= 2) {
                    String orgCodeLast = sysOrganizationLast.getOrgCode();
                    //取前部分
                    String orgCodeLastQianZhui = orgCodeLast.substring(0, orgCodeLast.length() - 3);
                    //取后部分
                    Integer codenum = Integer.valueOf(orgCodeLast.substring(orgCodeLast.length() - 3));
                    String str = "00";
                    str += (codenum + 1);
                    String substring = str.substring(str.length() - 3);
                    return orgCodeLastQianZhui + substring;
                    if (StringUtils.isNotBlank(orgCodeLast)) {
                        //取前部分
                        String orgCodeLastQianZhui = orgCodeLast.substring(0, orgCodeLast.length() - 3);
                        //取后部分
                        Integer codenum = Integer.valueOf(orgCodeLast.substring(orgCodeLast.length() - 3));
                        String str = "00";
                        str += (codenum + 1);
                        String substring = str.substring(str.length() - 3);
                        return orgCodeLastQianZhui + substring;
                    }
                } else {
                    String orgCodeLast = sysOrganizationLast.getOrgCode();
                    if (StringUtils.isNotBlank(orgCodeLast)) {
                    //取前部分
                    String orgCodeLastQianZhui = orgCodeLast.substring(0, orgCodeLast.length() - 7);
                    //取后部分
@@ -259,6 +263,7 @@
                    str += (codenum + 1);
                    String substring = str.substring(str.length() - 7);
                    return orgCodeLastQianZhui + substring;
                    }
                }
            } else {
                String fucode = sysOrg.getOrgCode();