@@ -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); | |||||
} |
@@ -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; | |||||
} | |||||
} |
@@ -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); | |||||
} | |||||
} |
@@ -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 { | |||||
} |
@@ -18,7 +18,7 @@ import java.time.LocalDateTime; | |||||
@Data | @Data | ||||
@TableName("nd_company_fiscal_code") | @TableName("nd_company_fiscal_code") | ||||
@ApiModel(value = "NdCompanyFiscalCode对象", description = "") | @ApiModel(value = "NdCompanyFiscalCode对象", description = "") | ||||
public class NdCompanyFiscalCode implements Serializable { | |||||
public class CompanyFiscalCode implements Serializable { | |||||
private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
@@ -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); | |||||
} | |||||
} |
@@ -1,6 +1,6 @@ | |||||
package com.ningdatech.pmapi.fiscal.mapper; | 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; | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
/** | /** | ||||
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
* @author Lierbao | * @author Lierbao | ||||
* @since 2023-02-10 | * @since 2023-02-10 | ||||
*/ | */ | ||||
public interface NdCompanyFiscalCodeMapper extends BaseMapper<NdCompanyFiscalCode> { | |||||
public interface NdCompanyFiscalCodeMapper extends BaseMapper<CompanyFiscalCode> { | |||||
} | } |
@@ -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; | |||||
} |
@@ -1,6 +1,6 @@ | |||||
package com.ningdatech.pmapi.fiscal.service; | 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; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
/** | /** | ||||
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||||
* @author Lierbao | * @author Lierbao | ||||
* @since 2023-02-10 | * @since 2023-02-10 | ||||
*/ | */ | ||||
public interface INdCompanyFiscalCodeService extends IService<NdCompanyFiscalCode> { | |||||
public interface ICompanyFiscalCodeService extends IService<CompanyFiscalCode> { | |||||
} | } |
@@ -1,8 +1,8 @@ | |||||
package com.ningdatech.pmapi.fiscal.service.impl; | 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.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 com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
@@ -15,6 +15,6 @@ import org.springframework.stereotype.Service; | |||||
* @since 2023-02-10 | * @since 2023-02-10 | ||||
*/ | */ | ||||
@Service | @Service | ||||
public class NdCompanyFiscalCodeServiceImpl extends ServiceImpl<NdCompanyFiscalCodeMapper, NdCompanyFiscalCode> implements INdCompanyFiscalCodeService { | |||||
public class CompanyFiscalCodeServiceImpl extends ServiceImpl<NdCompanyFiscalCodeMapper, CompanyFiscalCode> implements ICompanyFiscalCodeService { | |||||
} | } |
@@ -18,7 +18,7 @@ import java.time.LocalDateTime; | |||||
@TableName("nd_company_signature") | @TableName("nd_company_signature") | ||||
@Data | @Data | ||||
@ApiModel(value = "NdCompanySignature对象", description = "") | @ApiModel(value = "NdCompanySignature对象", description = "") | ||||
public class NdCompanySignature implements Serializable { | |||||
public class CompanySignature implements Serializable { | |||||
private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
@@ -1,6 +1,6 @@ | |||||
package com.ningdatech.pmapi.signature.mapper; | 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; | import com.baomidou.mybatisplus.core.mapper.BaseMapper; | ||||
/** | /** | ||||
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |||||
* @author Lierbao | * @author Lierbao | ||||
* @since 2023-02-10 | * @since 2023-02-10 | ||||
*/ | */ | ||||
public interface NdCompanySignatureMapper extends BaseMapper<NdCompanySignature> { | |||||
public interface NdCompanySignatureMapper extends BaseMapper<CompanySignature> { | |||||
} | } |
@@ -1,6 +1,6 @@ | |||||
package com.ningdatech.pmapi.signature.service; | 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; | import com.baomidou.mybatisplus.extension.service.IService; | ||||
/** | /** | ||||
@@ -11,6 +11,6 @@ import com.baomidou.mybatisplus.extension.service.IService; | |||||
* @author Lierbao | * @author Lierbao | ||||
* @since 2023-02-10 | * @since 2023-02-10 | ||||
*/ | */ | ||||
public interface INdCompanySignatureService extends IService<NdCompanySignature> { | |||||
public interface ICompanySignatureService extends IService<CompanySignature> { | |||||
} | } |
@@ -1,8 +1,8 @@ | |||||
package com.ningdatech.pmapi.signature.service.impl; | 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.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 com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | ||||
import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
@@ -15,6 +15,6 @@ import org.springframework.stereotype.Service; | |||||
* @since 2023-02-10 | * @since 2023-02-10 | ||||
*/ | */ | ||||
@Service | @Service | ||||
public class NdCompanySignatureServiceImpl extends ServiceImpl<NdCompanySignatureMapper, NdCompanySignature> implements INdCompanySignatureService { | |||||
public class CompanySignatureServiceImpl extends ServiceImpl<NdCompanySignatureMapper, CompanySignature> implements ICompanySignatureService { | |||||
} | } |