| | |
| | | @Autowired |
| | | FileManagerService fileManagerService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 租户信息读取和验证 |
| | | * @param fse |
| | |
| | | } |
| | | // 情况2:只存在手机号 -> 手机号已申请 |
| | | if (fseTenantByPhone != null && fseTenantByName == null) { |
| | | throw new BaseException(SaasCode.TENANT_APPLY_VALID_UNIT_HAS_APPLY.getValue(), SaasCode.TENANT_APPLY_VALID_UNIT_HAS_APPLY.getText()); |
| | | throw new BaseException(SaasCode.TENANT_APPLY_VALID_PHONE_HAS_APPLY.getValue(), SaasCode.TENANT_APPLY_VALID_PHONE_HAS_APPLY.getText()); |
| | | } |
| | | // 情况3:只存在单位名 -> 单位已申请 |
| | | if (fseTenantByPhone == null && fseTenantByName != null) { |
| | | throw new BaseException(SaasCode.TENANT_APPLY_VALID_PHONE_HAS_APPLY.getValue(), SaasCode.TENANT_APPLY_VALID_PHONE_HAS_APPLY.getText()); |
| | | throw new BaseException(SaasCode.TENANT_APPLY_VALID_UNIT_HAS_APPLY.getValue(), SaasCode.TENANT_APPLY_VALID_UNIT_HAS_APPLY.getText()); |
| | | } |
| | | // 情况4:都存在 -> 检查是否是同一条记录 |
| | | if (fseTenantByPhone.getUUID().equals(fseTenantByName.getUUID())) { |
| | |
| | | fseClient.setValue("client_address_city_id", fseApply.getString("area_city")); |
| | | fseClient.setValue("client_address_county_id", fseApply.getString("area_county")); |
| | | fseClient.setValue("client_address_line_one", fseApply.getString("address")); |
| | | fseClient.setValue(CmnConst.CREATED_BY, "1"); |
| | | fseClient.setValue(CmnConst.CREATED_BY, 1); |
| | | fseClient.setValue(CmnConst.CREATED_UTC_DATETIME, new Date()); |
| | | baseDao.add(fseClient); |
| | | // 复制license到web模块 |
| | |
| | | fseOrgUnit.setValue("org_level_code", codeService.createCode("product_sys_org_levels", "org_level_code", "001")); |
| | | fseOrgUnit.setValue("org_level_code_parent", "001"); |
| | | fseOrgUnit.setValue("org_level_type", 0); |
| | | fseOrgUnit.setValue("org_level_status", 0); |
| | | fseOrgUnit.setValue("sequence", 1); |
| | | fseOrgUnit.setValue(CmnConst.CREATED_BY, "1"); |
| | | fseOrgUnit.setValue(CmnConst.CREATED_BY, 1); |
| | | fseOrgUnit.setValue(CmnConst.CREATED_UTC_DATETIME, new Date()); |
| | | baseDao.add(fseOrgUnit); |
| | | // 创建租户管理员用户信息 |
| | |
| | | fseUser.setValue(CmnConst.USER_PWD, userService.createPassWord(fseApply.getString("applicant_phone"), fseApply.getString("applicant_pwd"))); |
| | | fseUser.setValue(CmnConst.IS_MANAGER, 1); |
| | | fseUser.setValue(CmnConst.STATUS, 1); |
| | | fseUser.setValue(CmnConst.CREATED_BY, "1"); |
| | | fseUser.setValue(CmnConst.CREATED_BY, 1); |
| | | fseUser.setValue(CmnConst.CREATED_UTC_DATETIME, new Date()); |
| | | baseDao.add(fseUser); |
| | | FieldSetEntity fseUserInfo = baseDao.getFieldSetEntity(CmnConst.PRODUCT_SYS_USERS, fseUser.getUUID(), false); |
| | |
| | | fseManager.setValue(CmnConst.ROLE_UUIDS, "eabb00f3-2118-4165-967b-a7d88f472f67-notchange"); |
| | | fseManager.setValue(CmnConst.IS_USED, 1); |
| | | fseManager.setValue(CmnConst.CLIENT_UUID, fseClient.getUUID()); |
| | | fseManager.setValue(CmnConst.CREATED_BY, "1"); |
| | | fseManager.setValue(CmnConst.CREATED_BY, 1); |
| | | fseManager.setValue(CmnConst.CREATED_UTC_DATETIME, new Date()); |
| | | baseDao.add(fseManager); |
| | | baseDao.executeUpdate("UPDATE product_sys_tenant_apply SET client_uuid = ? WHERE uuid = ?", new Object[] {fseClient.getUUID(), fseApply.getUUID()}); |
| | | |
| | | // 发送信息给租户管理员 |
| | | FieldSetEntity fse = new FieldSetEntity("temp"); |
| | | fse.setValue("applicant_phone", fseApply.getString("applicant_phone")); |
| | | loginAuthService.sendMessage(fse, "租户注册成功", "temp"); |
| | | } |
| | | |
| | | /** |