@@ -12,11 +12,11 @@ import org.springframework.stereotype.Component; | |||||
public interface UserInfoHelper { | public interface UserInfoHelper { | ||||
/** | /** | ||||
* 根据用户id 获取 用户所属公司id | |||||
* 根据用户id 获取 用户所属公司 organizationCode | |||||
* | * | ||||
* @param userId | * @param userId | ||||
* @return | * @return | ||||
*/ | */ | ||||
Long getCompanyId(Long userId); | |||||
String getOrganizationCode(Long userId); | |||||
} | } |
@@ -1,6 +1,9 @@ | |||||
package com.ningdatech.pmapi.common.helper.impl; | package com.ningdatech.pmapi.common.helper.impl; | ||||
import com.ningdatech.pmapi.common.helper.UserInfoHelper; | import com.ningdatech.pmapi.common.helper.UserInfoHelper; | ||||
import com.ningdatech.pmapi.user.manage.UserAuthLoginManage; | |||||
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; | |||||
import lombok.RequiredArgsConstructor; | |||||
import org.springframework.stereotype.Component; | import org.springframework.stereotype.Component; | ||||
/** | /** | ||||
@@ -8,11 +11,17 @@ import org.springframework.stereotype.Component; | |||||
* @date 2023/2/10 下午4:40 | * @date 2023/2/10 下午4:40 | ||||
*/ | */ | ||||
@Component | @Component | ||||
@RequiredArgsConstructor | |||||
public class UserInfoHelperImpl implements UserInfoHelper { | public class UserInfoHelperImpl implements UserInfoHelper { | ||||
private final UserAuthLoginManage userAuthLoginManage; | |||||
@Override | @Override | ||||
public Long getCompanyId(Long userId) { | |||||
return null; | |||||
public String getOrganizationCode(Long userId) { | |||||
UserFullInfoDTO userFullInfo = userAuthLoginManage.getUserFullInfo(userId); | |||||
return userFullInfo.getOrganizationCode(); | |||||
} | } | ||||
} | } |
@@ -26,7 +26,7 @@ public class CompanyFiscalCode implements Serializable { | |||||
private String fiscalCode; | private String fiscalCode; | ||||
private Long companyId; | |||||
private String organizationCode; | |||||
private LocalDateTime createOn; | private LocalDateTime createOn; | ||||
@@ -28,14 +28,14 @@ public class CompanyFiscalCodeManage { | |||||
public void fiscalCodeConfigure(ReqCompanyFiscalCodeAndSealSnPO reqCompanyFiscalCodeAndSealSnPO) { | public void fiscalCodeConfigure(ReqCompanyFiscalCodeAndSealSnPO reqCompanyFiscalCodeAndSealSnPO) { | ||||
Long userId = LoginUserUtil.getUserId(); | Long userId = LoginUserUtil.getUserId(); | ||||
Long companyId = userInfoHelper.getCompanyId(userId); | |||||
String organizationCode = userInfoHelper.getOrganizationCode(userId); | |||||
// TODO 校验用户权限 | // TODO 校验用户权限 | ||||
// 保存财政编码配置 | // 保存财政编码配置 | ||||
String fiscalCode = reqCompanyFiscalCodeAndSealSnPO.getFiscalCode(); | String fiscalCode = reqCompanyFiscalCodeAndSealSnPO.getFiscalCode(); | ||||
CompanyFiscalCode companyFiscalCodeSaveRecord = new CompanyFiscalCode(); | CompanyFiscalCode companyFiscalCodeSaveRecord = new CompanyFiscalCode(); | ||||
companyFiscalCodeSaveRecord.setFiscalCode(fiscalCode); | companyFiscalCodeSaveRecord.setFiscalCode(fiscalCode); | ||||
companyFiscalCodeSaveRecord.setCompanyId(companyId); | |||||
companyFiscalCodeSaveRecord.setOrganizationCode(organizationCode); | |||||
companyFiscalCodeSaveRecord.setCreateOn(LocalDateTime.now()); | companyFiscalCodeSaveRecord.setCreateOn(LocalDateTime.now()); | ||||
companyFiscalCodeSaveRecord.setUpdateOn(LocalDateTime.now()); | companyFiscalCodeSaveRecord.setUpdateOn(LocalDateTime.now()); | ||||
companyFiscalCodeSaveRecord.setCreateBy(userId); | companyFiscalCodeSaveRecord.setCreateBy(userId); | ||||
@@ -46,7 +46,7 @@ public class CompanyFiscalCodeManage { | |||||
String sealSn = reqCompanyFiscalCodeAndSealSnPO.getSealSn(); | String sealSn = reqCompanyFiscalCodeAndSealSnPO.getSealSn(); | ||||
CompanySignature companySignatureSaveRecord = new CompanySignature(); | CompanySignature companySignatureSaveRecord = new CompanySignature(); | ||||
companySignatureSaveRecord.setSealSn(sealSn); | companySignatureSaveRecord.setSealSn(sealSn); | ||||
companySignatureSaveRecord.setCompanyId(companyId); | |||||
companySignatureSaveRecord.setOrganizationCode(organizationCode); | |||||
companySignatureSaveRecord.setCreateOn(LocalDateTime.now()); | companySignatureSaveRecord.setCreateOn(LocalDateTime.now()); | ||||
companySignatureSaveRecord.setUpdateOn(LocalDateTime.now()); | companySignatureSaveRecord.setUpdateOn(LocalDateTime.now()); | ||||
companySignatureSaveRecord.setCreateBy(userId); | companySignatureSaveRecord.setCreateBy(userId); | ||||
@@ -26,7 +26,7 @@ public class CompanySignature implements Serializable { | |||||
private String sealSn; | private String sealSn; | ||||
private Long companyId; | |||||
private String organizationCode; | |||||
private LocalDateTime createOn; | private LocalDateTime createOn; | ||||
@@ -39,6 +39,24 @@ public class UserAuthLoginManage { | |||||
private final IDingEmployeeInfoService iDingEmployeeInfoService; | private final IDingEmployeeInfoService iDingEmployeeInfoService; | ||||
private final IUserRoleService iUserRoleService; | private final IUserRoleService iUserRoleService; | ||||
/** | |||||
* 根据用户id 获取用户全量信息 | |||||
* | |||||
* @param userId | |||||
* @return | |||||
*/ | |||||
public UserFullInfoDTO getUserFullInfo(Long userId) { | |||||
UserInfo userInfo = iUserInfoService.getById(userId); | |||||
if (Objects.isNull(userInfo)) { | |||||
return null; | |||||
} | |||||
// 返回用户全量信息 | |||||
UserFullInfoDTO userFullInfoDTO = new UserFullInfoDTO(); | |||||
userFullInfoDTOAssembler(userInfo, userFullInfoDTO); | |||||
return userFullInfoDTO; | |||||
} | |||||
/** | /** | ||||
* 根据用户名获取 | * 根据用户名获取 | ||||
* | * | ||||