Browse Source

印章配置/ 财政编码配置

master
liuxinxin 1 year ago
parent
commit
cc0737e44a
14 changed files with 168 additions and 36 deletions
  1. +22
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/UserInfoHelper.java
  2. +18
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/helper/impl/UserInfoHelperImpl.java
  3. +35
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/fiscal/controller/CompanyFiscalCodeController.java
  4. +0
    -20
      pmapi/src/main/java/com/ningdatech/pmapi/fiscal/controller/NdCompanyFiscalCodeController.java
  5. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/fiscal/entity/CompanyFiscalCode.java
  6. +56
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/fiscal/manage/CompanyFiscalCodeManage.java
  7. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/fiscal/mapper/NdCompanyFiscalCodeMapper.java
  8. +21
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/fiscal/model/po/ReqCompanyFiscalCodeAndSealSnPO.java
  9. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/fiscal/service/ICompanyFiscalCodeService.java
  10. +3
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/fiscal/service/impl/CompanyFiscalCodeServiceImpl.java
  11. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/signature/entity/CompanySignature.java
  12. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/signature/mapper/NdCompanySignatureMapper.java
  13. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/signature/service/ICompanySignatureService.java
  14. +3
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/signature/service/impl/CompanySignatureServiceImpl.java

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

@@ -0,0 +1,22 @@
package com.ningdatech.pmapi.common.helper;

import org.springframework.stereotype.Component;

/**
* @author liuxinxin
* @date 2023/2/10 下午4:38
* @Description: 用户信息管理工具类 helper
*/

@Component
public interface UserInfoHelper {

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

}

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

@@ -0,0 +1,18 @@
package com.ningdatech.pmapi.common.helper.impl;

import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import org.springframework.stereotype.Component;

/**
* @author liuxinxin
* @date 2023/2/10 下午4:40
*/
@Component
public class UserInfoHelperImpl implements UserInfoHelper {


@Override
public Long getCompanyId(Long userId) {
return null;
}
}

+ 35
- 0
pmapi/src/main/java/com/ningdatech/pmapi/fiscal/controller/CompanyFiscalCodeController.java View File

@@ -0,0 +1,35 @@
package com.ningdatech.pmapi.fiscal.controller;


import com.ningdatech.pmapi.fiscal.manage.CompanyFiscalCodeManage;
import com.ningdatech.pmapi.fiscal.model.po.ReqCompanyFiscalCodeAndSealSnPO;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
* <p>
* 前端控制器
* </p>
*
* @author Lierbao
* @since 2023-02-10
*/
@Controller
@RequestMapping("/api/v1/fiscal-code")
@RequiredArgsConstructor
public class CompanyFiscalCodeController {

private final CompanyFiscalCodeManage companyFiscalCodeManage;

@ApiOperation(value = "财政编码/配置", notes = "财政编码配置")
@GetMapping("/configure")
public void fiscalAndSealCodeConfigure(ReqCompanyFiscalCodeAndSealSnPO reqCompanyFiscalCodeAndSealSnPO) {
companyFiscalCodeManage.fiscalCodeConfigure(reqCompanyFiscalCodeAndSealSnPO);
}



}

+ 0
- 20
pmapi/src/main/java/com/ningdatech/pmapi/fiscal/controller/NdCompanyFiscalCodeController.java View File

@@ -1,20 +0,0 @@
package com.ningdatech.pmapi.fiscal.controller;


import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;

/**
* <p>
* 前端控制器
* </p>
*
* @author Lierbao
* @since 2023-02-10
*/
@Controller
@RequestMapping("/pmapi.fiscal/nd-company-fiscal-code")
public class NdCompanyFiscalCodeController {

}

pmapi/src/main/java/com/ningdatech/pmapi/fiscal/entity/NdCompanyFiscalCode.java → pmapi/src/main/java/com/ningdatech/pmapi/fiscal/entity/CompanyFiscalCode.java View File

@@ -18,7 +18,7 @@ import java.time.LocalDateTime;
@Data
@TableName("nd_company_fiscal_code")
@ApiModel(value = "NdCompanyFiscalCode对象", description = "")
public class NdCompanyFiscalCode implements Serializable {
public class CompanyFiscalCode implements Serializable {

private static final long serialVersionUID = 1L;


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

@@ -0,0 +1,56 @@
package com.ningdatech.pmapi.fiscal.manage;

import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.fiscal.entity.CompanyFiscalCode;
import com.ningdatech.pmapi.fiscal.model.po.ReqCompanyFiscalCodeAndSealSnPO;
import com.ningdatech.pmapi.fiscal.service.ICompanyFiscalCodeService;
import com.ningdatech.pmapi.signature.entity.CompanySignature;
import com.ningdatech.pmapi.signature.service.ICompanySignatureService;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
* @author liuxinxin
* @date 2023/2/10 下午4:23
*/
@Component
@RequiredArgsConstructor
public class CompanyFiscalCodeManage {

private final UserInfoHelper userInfoHelper;

private final ICompanyFiscalCodeService iCompanyFiscalCodeService;
private final ICompanySignatureService iCompanySignatureService;


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

// 保存财政编码配置
String fiscalCode = reqCompanyFiscalCodeAndSealSnPO.getFiscalCode();
CompanyFiscalCode companyFiscalCodeSaveRecord = new CompanyFiscalCode();
companyFiscalCodeSaveRecord.setFiscalCode(fiscalCode);
companyFiscalCodeSaveRecord.setCompanyId(companyId);
companyFiscalCodeSaveRecord.setCreateOn(LocalDateTime.now());
companyFiscalCodeSaveRecord.setUpdateOn(LocalDateTime.now());
companyFiscalCodeSaveRecord.setCreateBy(userId);
companyFiscalCodeSaveRecord.setUpdateBy(userId);
iCompanyFiscalCodeService.save(companyFiscalCodeSaveRecord);

// 保存印章配置
String sealSn = reqCompanyFiscalCodeAndSealSnPO.getSealSn();
CompanySignature companySignatureSaveRecord = new CompanySignature();
companySignatureSaveRecord.setSealSn(sealSn);
companySignatureSaveRecord.setCompanyId(companyId);
companySignatureSaveRecord.setCreateOn(LocalDateTime.now());
companySignatureSaveRecord.setUpdateOn(LocalDateTime.now());
companySignatureSaveRecord.setCreateBy(userId);
companySignatureSaveRecord.setUpdateBy(userId);
iCompanySignatureService.save(companySignatureSaveRecord);
}
}

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/fiscal/mapper/NdCompanyFiscalCodeMapper.java View File

@@ -1,6 +1,6 @@
package com.ningdatech.pmapi.fiscal.mapper;

import com.ningdatech.pmapi.fiscal.entity.NdCompanyFiscalCode;
import com.ningdatech.pmapi.fiscal.entity.CompanyFiscalCode;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author Lierbao
* @since 2023-02-10
*/
public interface NdCompanyFiscalCodeMapper extends BaseMapper<NdCompanyFiscalCode> {
public interface NdCompanyFiscalCodeMapper extends BaseMapper<CompanyFiscalCode> {

}

+ 21
- 0
pmapi/src/main/java/com/ningdatech/pmapi/fiscal/model/po/ReqCompanyFiscalCodeAndSealSnPO.java View File

@@ -0,0 +1,21 @@
package com.ningdatech.pmapi.fiscal.model.po;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
* @author liuxinxin
* @date 2023/2/10 下午4:24
*/
@Data
@ApiModel("财政编码配置")
public class ReqCompanyFiscalCodeAndSealSnPO {

@ApiModelProperty("财政编码")
private String fiscalCode;

@ApiModelProperty("印章编号")
private String sealSn;

}

pmapi/src/main/java/com/ningdatech/pmapi/fiscal/service/INdCompanyFiscalCodeService.java → pmapi/src/main/java/com/ningdatech/pmapi/fiscal/service/ICompanyFiscalCodeService.java View File

@@ -1,6 +1,6 @@
package com.ningdatech.pmapi.fiscal.service;

import com.ningdatech.pmapi.fiscal.entity.NdCompanyFiscalCode;
import com.ningdatech.pmapi.fiscal.entity.CompanyFiscalCode;
import com.baomidou.mybatisplus.extension.service.IService;

/**
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @author Lierbao
* @since 2023-02-10
*/
public interface INdCompanyFiscalCodeService extends IService<NdCompanyFiscalCode> {
public interface ICompanyFiscalCodeService extends IService<CompanyFiscalCode> {

}

pmapi/src/main/java/com/ningdatech/pmapi/fiscal/service/impl/NdCompanyFiscalCodeServiceImpl.java → pmapi/src/main/java/com/ningdatech/pmapi/fiscal/service/impl/CompanyFiscalCodeServiceImpl.java View File

@@ -1,8 +1,8 @@
package com.ningdatech.pmapi.fiscal.service.impl;

import com.ningdatech.pmapi.fiscal.entity.NdCompanyFiscalCode;
import com.ningdatech.pmapi.fiscal.entity.CompanyFiscalCode;
import com.ningdatech.pmapi.fiscal.mapper.NdCompanyFiscalCodeMapper;
import com.ningdatech.pmapi.fiscal.service.INdCompanyFiscalCodeService;
import com.ningdatech.pmapi.fiscal.service.ICompanyFiscalCodeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@@ -15,6 +15,6 @@ import org.springframework.stereotype.Service;
* @since 2023-02-10
*/
@Service
public class NdCompanyFiscalCodeServiceImpl extends ServiceImpl<NdCompanyFiscalCodeMapper, NdCompanyFiscalCode> implements INdCompanyFiscalCodeService {
public class CompanyFiscalCodeServiceImpl extends ServiceImpl<NdCompanyFiscalCodeMapper, CompanyFiscalCode> implements ICompanyFiscalCodeService {

}

pmapi/src/main/java/com/ningdatech/pmapi/signature/entity/NdCompanySignature.java → pmapi/src/main/java/com/ningdatech/pmapi/signature/entity/CompanySignature.java View File

@@ -18,7 +18,7 @@ import java.time.LocalDateTime;
@TableName("nd_company_signature")
@Data
@ApiModel(value = "NdCompanySignature对象", description = "")
public class NdCompanySignature implements Serializable {
public class CompanySignature implements Serializable {

private static final long serialVersionUID = 1L;


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/signature/mapper/NdCompanySignatureMapper.java View File

@@ -1,6 +1,6 @@
package com.ningdatech.pmapi.signature.mapper;

import com.ningdatech.pmapi.signature.entity.NdCompanySignature;
import com.ningdatech.pmapi.signature.entity.CompanySignature;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @author Lierbao
* @since 2023-02-10
*/
public interface NdCompanySignatureMapper extends BaseMapper<NdCompanySignature> {
public interface NdCompanySignatureMapper extends BaseMapper<CompanySignature> {

}

pmapi/src/main/java/com/ningdatech/pmapi/signature/service/INdCompanySignatureService.java → pmapi/src/main/java/com/ningdatech/pmapi/signature/service/ICompanySignatureService.java View File

@@ -1,6 +1,6 @@
package com.ningdatech.pmapi.signature.service;

import com.ningdatech.pmapi.signature.entity.NdCompanySignature;
import com.ningdatech.pmapi.signature.entity.CompanySignature;
import com.baomidou.mybatisplus.extension.service.IService;

/**
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @author Lierbao
* @since 2023-02-10
*/
public interface INdCompanySignatureService extends IService<NdCompanySignature> {
public interface ICompanySignatureService extends IService<CompanySignature> {

}

pmapi/src/main/java/com/ningdatech/pmapi/signature/service/impl/NdCompanySignatureServiceImpl.java → pmapi/src/main/java/com/ningdatech/pmapi/signature/service/impl/CompanySignatureServiceImpl.java View File

@@ -1,8 +1,8 @@
package com.ningdatech.pmapi.signature.service.impl;

import com.ningdatech.pmapi.signature.entity.NdCompanySignature;
import com.ningdatech.pmapi.signature.entity.CompanySignature;
import com.ningdatech.pmapi.signature.mapper.NdCompanySignatureMapper;
import com.ningdatech.pmapi.signature.service.INdCompanySignatureService;
import com.ningdatech.pmapi.signature.service.ICompanySignatureService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@@ -15,6 +15,6 @@ import org.springframework.stereotype.Service;
* @since 2023-02-10
*/
@Service
public class NdCompanySignatureServiceImpl extends ServiceImpl<NdCompanySignatureMapper, NdCompanySignature> implements INdCompanySignatureService {
public class CompanySignatureServiceImpl extends ServiceImpl<NdCompanySignatureMapper, CompanySignature> implements ICompanySignatureService {

}

Loading…
Cancel
Save