47 lines
1.6 KiB
Java
47 lines
1.6 KiB
Java
package com.engine.salary.remote.tax.client;
|
|
|
|
import com.engine.salary.entity.taxagent.po.TaxAgentTaxReturnPO;
|
|
import com.engine.salary.entity.taxdeclaration.po.TaxDeclarationApiConfigPO;
|
|
import com.engine.salary.mapper.taxagent.TaxAgentTaxReturnMapper;
|
|
import com.engine.salary.mapper.taxdeclaration.TaxDeclareApiConfigMapper;
|
|
import com.engine.salary.util.Sm4Utils;
|
|
import com.engine.salary.util.db.MapperProxyFactory;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
/**
|
|
* 人员信息登记报送服务
|
|
* <p>Copyright: Copyright (c) 2023</p>
|
|
* <p>Company: 泛微软件</p>
|
|
*
|
|
* @author qiantao
|
|
* @version 1.0
|
|
**/
|
|
@Slf4j
|
|
public class TaxBaseClient {
|
|
private TaxDeclareApiConfigMapper getTaxDeclareApiConfigMapper() {
|
|
return MapperProxyFactory.getProxy(TaxDeclareApiConfigMapper.class);
|
|
}
|
|
|
|
|
|
private TaxAgentTaxReturnMapper getTaxAgentTaxReturnMapper() {
|
|
return MapperProxyFactory.getProxy(TaxAgentTaxReturnMapper.class);
|
|
}
|
|
|
|
public Long taxAgentId;
|
|
public TaxDeclarationApiConfigPO apiConfig ;
|
|
public TaxAgentTaxReturnPO returnPO ;
|
|
|
|
public TaxBaseClient(Long taxAgentId) {
|
|
this.taxAgentId = taxAgentId;
|
|
this.apiConfig = getTaxDeclareApiConfigMapper().getOne();
|
|
TaxAgentTaxReturnPO taxReturnPO = getTaxAgentTaxReturnMapper().selectOneByTaxAgentId(taxAgentId);
|
|
try {
|
|
// 密码解密
|
|
taxReturnPO.setPwd(Sm4Utils.decryptEcb(apiConfig.getAppSecret(), taxReturnPO.getPwd()));
|
|
} catch (Exception e) {
|
|
log.error("Sm4Utils.decryptEcb ---- error: {}", e.getMessage());
|
|
}
|
|
this.returnPO = taxReturnPO;
|
|
}
|
|
}
|