Browse Source

印章管理和财政编码表调整

tags/24080901
liuxinxin 1 year ago
parent
commit
19542081ff
6 changed files with 36 additions and 9 deletions
  1. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java
  2. +11
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java
  3. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/fiscal/entity/CompanyFiscalCode.java
  4. +3
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/fiscal/manage/CompanyFiscalCodeManage.java
  5. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/signature/entity/CompanySignature.java
  6. +18
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java View File

@@ -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);


} }

+ 11
- 2
pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java View File

@@ -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();
} }
} }

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/fiscal/entity/CompanyFiscalCode.java View File

@@ -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;




+ 3
- 3
pmapi/src/main/java/com/ningdatech/pmapi/fiscal/manage/CompanyFiscalCodeManage.java View File

@@ -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);


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/signature/entity/CompanySignature.java View File

@@ -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;




+ 18
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java View File

@@ -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;
}

/** /**
* 根据用户名获取 * 根据用户名获取
* *


Loading…
Cancel
Save