Ver código fonte

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

tags/24080901
liuxinxin 1 ano atrás
pai
commit
19542081ff
6 arquivos alterados com 36 adições e 9 exclusões
  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 Ver arquivo

@@ -12,11 +12,11 @@ import org.springframework.stereotype.Component;
public interface UserInfoHelper {

/**
* 根据用户id 获取 用户所属公司id
* 根据用户id 获取 用户所属公司 organizationCode
*
* @param userId
* @return
*/
Long getCompanyId(Long userId);
String getOrganizationCode(Long userId);

}

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

@@ -1,6 +1,9 @@
package com.ningdatech.pmapi.common.helper.impl;

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;

/**
@@ -8,11 +11,17 @@ import org.springframework.stereotype.Component;
* @date 2023/2/10 下午4:40
*/
@Component
@RequiredArgsConstructor
public class UserInfoHelperImpl implements UserInfoHelper {


private final UserAuthLoginManage userAuthLoginManage;


@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 Ver arquivo

@@ -26,7 +26,7 @@ public class CompanyFiscalCode implements Serializable {

private String fiscalCode;

private Long companyId;
private String organizationCode;

private LocalDateTime createOn;



+ 3
- 3
pmapi/src/main/java/com/ningdatech/pmapi/fiscal/manage/CompanyFiscalCodeManage.java Ver arquivo

@@ -28,14 +28,14 @@ public class CompanyFiscalCodeManage {

public void fiscalCodeConfigure(ReqCompanyFiscalCodeAndSealSnPO reqCompanyFiscalCodeAndSealSnPO) {
Long userId = LoginUserUtil.getUserId();
Long companyId = userInfoHelper.getCompanyId(userId);
String organizationCode = userInfoHelper.getOrganizationCode(userId);
// TODO 校验用户权限

// 保存财政编码配置
String fiscalCode = reqCompanyFiscalCodeAndSealSnPO.getFiscalCode();
CompanyFiscalCode companyFiscalCodeSaveRecord = new CompanyFiscalCode();
companyFiscalCodeSaveRecord.setFiscalCode(fiscalCode);
companyFiscalCodeSaveRecord.setCompanyId(companyId);
companyFiscalCodeSaveRecord.setOrganizationCode(organizationCode);
companyFiscalCodeSaveRecord.setCreateOn(LocalDateTime.now());
companyFiscalCodeSaveRecord.setUpdateOn(LocalDateTime.now());
companyFiscalCodeSaveRecord.setCreateBy(userId);
@@ -46,7 +46,7 @@ public class CompanyFiscalCodeManage {
String sealSn = reqCompanyFiscalCodeAndSealSnPO.getSealSn();
CompanySignature companySignatureSaveRecord = new CompanySignature();
companySignatureSaveRecord.setSealSn(sealSn);
companySignatureSaveRecord.setCompanyId(companyId);
companySignatureSaveRecord.setOrganizationCode(organizationCode);
companySignatureSaveRecord.setCreateOn(LocalDateTime.now());
companySignatureSaveRecord.setUpdateOn(LocalDateTime.now());
companySignatureSaveRecord.setCreateBy(userId);


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/signature/entity/CompanySignature.java Ver arquivo

@@ -26,7 +26,7 @@ public class CompanySignature implements Serializable {

private String sealSn;

private Long companyId;
private String organizationCode;

private LocalDateTime createOn;



+ 18
- 0
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserAuthLoginManage.java Ver arquivo

@@ -39,6 +39,24 @@ public class UserAuthLoginManage {
private final IDingEmployeeInfoService iDingEmployeeInfoService;
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;
}

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


Carregando…
Cancelar
Salvar