forked from kidgrow-microservices-platform

zhaoxiaohao
2020-08-13 0eb0c43113ed9c4585ba936dcbe87feb4df6ba24
kidgrow-business/kidgrow-usercenter/kidgrow-usercenter-biz/src/main/java/com/kidgrow/usercenter/service/impl/SysUserServiceImpl.java
@@ -740,7 +740,7 @@
        //添加用户数据  如果没有输入密码,将会创建一个默认密码返回
        String defaultPassWord = "";
        SysUser sysUser = new SysUser();
        sysUser.setUsername(userRegVo.getUsername());
        sysUser.setUsername(userRegVo.getMobile());
        sysUser.setMobile(userRegVo.getMobile());
        if (StringUtils.isBlank(userRegVo.getPassword())) {
            defaultPassWord = com.kidgrow.common.utils.RandomValueUtils.getRandom(6);
@@ -802,13 +802,14 @@
                            sysDictionaries.setCreateUserId(createUserId);
                            sysDictionaries.setCreateUserName(createUserName);
                            dicBool = sysDictionariesService.save(sysDictionaries);
                            if (dicBool) {
                                userRegVo.setDoctorRankId(sysDictionaries.getId());
                            }
                        }
                        if (dicBool) {
                            userRegVo.setDoctorRankId(sysDictionaries.getId());
                            //写用户组织关系表
                            List<SysUserOrg> sysUserOrgList = new ArrayList<SysUserOrg>();
                            sysUserOrgH.setUserId(sysUser.getId());
                            sysUserOrgH.setOrgId(organizationHos);
                            sysUserOrgH.setFromLevel(CommonConstant.SYSTEM_ORG_HOS_LEVEL);
@@ -837,11 +838,7 @@
                                sysDoctor.setDoctorType(CommonConstant.H_DOCTOR_TYPE);
                                sysDoctor.setCreateUserId(isReg ? createUserId : sysUserd.getId());
                                sysDoctor.setCreateUserName(isReg ? createUserName : sysUserd.getUsername());
                                if (isReg) {
                                    sysDoctor.setDoctorState(false);
                                } else {
                                    sysDoctor.setDoctorState(true);
                                }
                                sysDoctor.setDoctorState(!isReg);
                                sysDoctor.setDoctorTel(userRegVo.getMobile());
                                sysDoctor.setDoctorName(userRegVo.getNickname());
                                sysDoctor.setServerUserId(isReg ? createUserId : sysUserd.getId());
@@ -987,8 +984,9 @@
                List<HospitalDoctorListVo> hospitalDoctorListVos = baseMapper.hospitalDoctorList(sysHospitalId, depatmentId, CommonConstant.HOSPITAL_DOCTOR_ID, CommonConstant.HOSPITAL_ADMIN_ID);
                if (hospitalDoctorListVos != null) {
                    int doctorCount = hospitalDoctorListVos.size();
                    int accountCount = sysDepartment.getAccountsCount();
                    return (accountCount - doctorCount);
                    int accountCount = sysDepartment.getAccountsCount().intValue();
                    int liveCount=accountCount - doctorCount;
                    return liveCount;
                } else {
                    return 0;
                }