简税框架:进项服务拆分模块,拆分查验、认证单独授权

beta-enc
dongxiaoke 2 years ago
parent bb61ef1838
commit 0840168fb2
  1. 31
      jianshui-admin/src/main/java/com/jianshui/api/controller/http/income/v1/InvoiceAuthController.java
  2. 2
      jianshui-income/src/main/java/com/jianshui/income/service/impl/EleAuthInvoiceImpl.java
  3. 1
      jianshui-income/src/main/java/com/jianshui/income/service/impl/adapter/request/AisinoIncomeRequestAdapterImpl.java
  4. 4
      jianshui-income/src/main/java/com/jianshui/income/service/impl/adapter/request/ElephentIncomeAuthRequestAdapterImpl.java
  5. 70
      jianshui-income/src/main/java/com/jianshui/income/service/impl/adapter/response/ElephentIncomeAuthResponseAdapterImpl.java

@ -57,10 +57,7 @@ public class InvoiceAuthController {
//入口报文适配器标志 这个东西是AisinoIncomeRequestAdapterImpl 中间的那块儿
private final static String SERVICE_KEY = "income";
// TODO-xkng: 2022/9/20 看看请求的前置处理封到一个service里面去,调用一个。先把接口搞出来着。
private final static String SERVICE_KEY = "auth";
@ApiOperation("状态采集")
@ -87,7 +84,7 @@ public class InvoiceAuthController {
JSONObject requestBody = incomeRequestService.decrypt(request, companyservice);
// 获得请求实例(根据companyservicemanager配置获取),并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()) + "_auth";
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IAuthInvoice iAuthInvoice = collectServiceFactory.getServiceAuth(serviceKey);
//请求
@ -130,7 +127,7 @@ public class InvoiceAuthController {
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()) + "_auth";
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IAuthInvoice iAuthInvoice = collectServiceFactory.getServiceAuth(serviceKey);
//请求
@ -171,7 +168,7 @@ public class InvoiceAuthController {
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()) + "_auth";
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IAuthInvoice iAuthInvoice = collectServiceFactory.getServiceAuth(serviceKey);
//请求
@ -212,7 +209,7 @@ public class InvoiceAuthController {
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()) + "_auth";
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IAuthInvoice iAuthInvoice = collectServiceFactory.getServiceAuth(serviceKey);
//请求
@ -253,7 +250,7 @@ public class InvoiceAuthController {
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()) + "_auth";
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IAuthInvoice iAuthInvoice = collectServiceFactory.getServiceAuth(serviceKey);
//请求
@ -293,7 +290,7 @@ public class InvoiceAuthController {
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()) + "_auth";
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IAuthInvoice iAuthInvoice = collectServiceFactory.getServiceAuth(serviceKey);
//请求
@ -334,7 +331,7 @@ public class InvoiceAuthController {
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()) + "_auth";
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IAuthInvoice iAuthInvoice = collectServiceFactory.getServiceAuth(serviceKey);
//请求
@ -375,7 +372,7 @@ public class InvoiceAuthController {
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()) + "_auth";
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IAuthInvoice iAuthInvoice = collectServiceFactory.getServiceAuth(serviceKey);
//请求
@ -422,7 +419,7 @@ public class InvoiceAuthController {
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()) + "_auth";
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IAuthInvoice incomeService = collectServiceFactory.getServiceAuth(serviceKey);
// 13位时间戳转10位
String CJKSRQ = requestBody.getString("CJKSRQ");
@ -472,7 +469,7 @@ public class InvoiceAuthController {
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()) + "_auth";
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IAuthInvoice incomeService = collectServiceFactory.getServiceAuth(serviceKey);
IncomeMasterInformationDTO incomeGetInvoiceDTO = requestBody.toJavaObject(IncomeMasterInformationDTO.class);
AjaxResult result = incomeService.masterInformation(incomeGetInvoiceDTO, companyservice);
@ -511,7 +508,7 @@ public class InvoiceAuthController {
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()) + "_auth";
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IAuthInvoice incomeService = collectServiceFactory.getServiceAuth(serviceKey);
IncomeCountInfoDTO incomeGetInvoiceDTO = requestBody.toJavaObject(IncomeCountInfoDTO.class);
AjaxResult result = incomeService.getCountInfo(incomeGetInvoiceDTO, companyservice);
@ -551,7 +548,7 @@ public class InvoiceAuthController {
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()) + "_auth";
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IAuthInvoice incomeService = collectServiceFactory.getServiceAuth(serviceKey);
IncomeApplyCountDTO incomeGetInvoiceDTO = requestBody.toJavaObject(IncomeApplyCountDTO.class);
AjaxResult result = incomeService.applyCount(incomeGetInvoiceDTO, companyservice);
@ -590,7 +587,7 @@ public class InvoiceAuthController {
// 获得请求实例,并且进行扣费
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid()) + "_auth";
String serviceKey = serviceManageService.getCompanyServiceSupplier(SERVICE_KEY, companyservice.getCompanyid());
IAuthInvoice incomeService = collectServiceFactory.getServiceAuth(serviceKey);
IncomeApplyCountResultDTO incomeGetInvoiceDTO = requestBody.toJavaObject(IncomeApplyCountResultDTO.class);
AjaxResult result = incomeService.applyCountResult(incomeGetInvoiceDTO, companyservice);

@ -51,7 +51,7 @@ import static com.jianshui.income.utils.elephant.ElephantCompanyserviceUtils.req
* @author xkng
* @date 2022/9/9 16:03
*/
@Component(value = "elephant_income_auth") // 这里是后台字典的服务配置键值 配置的
@Component(value = "elephant_auth") // 这里是后台字典的服务配置键值 配置的
public class EleAuthInvoiceImpl implements IAuthInvoice {
private static final Logger log = LoggerFactory.getLogger(EleAuthInvoiceImpl.class);

@ -18,6 +18,7 @@ import java.util.Map;
import java.util.Set;
/**
* 进项接口
* @Description
* @Author 巩权林
* @Date 2022-03-25 10:03

@ -25,8 +25,8 @@ import java.util.Set;
* @Date 2022-03-25 10:03
**/
@Slf4j
@Component("auth_income_request_adapter")
public class ElephentIncomeRequestAdapterImpl implements IIncomeRequestService {
@Component("jn_aisino_auth_request_adapter")
public class ElephentIncomeAuthRequestAdapterImpl implements IIncomeRequestService {
@Autowired
private ICompanyserviceService companyserviceService;

@ -0,0 +1,70 @@
package com.jianshui.income.service.impl.adapter.response;
import com.alibaba.fastjson.JSONObject;
import com.jianshui.common.core.domain.AjaxResult;
import com.jianshui.common.core.domain.entity.Companyservice;
import com.jianshui.common.exception.jianshui.JianshuiParamErrorException;
import com.jianshui.common.utils.StringUtils;
import com.jianshui.income.service.IIncomeResponseService;
import com.jianshui.system.service.ICompanyserviceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 进项-认证
* @Description
* @Author 巩权林
* @Date 2022-03-25 10:03
**/
@Slf4j
@Component("jn_aisino_auth_response_adapter")
public class ElephentIncomeAuthResponseAdapterImpl implements IIncomeResponseService {
@Autowired
private ICompanyserviceService companyserviceService;
@Override
public Object response(AjaxResult result, Companyservice companyservice, String src) {
// TODO 这里要利用反射拆分成函数,而不是再用equals
AjaxResult resp = result;
if (StringUtils.equals(src, "check_single")) {
if (result.isSuccess()) {
JSONObject content = (JSONObject) result.get("data");
if (content != null) {
resp = AjaxResult.success(content.getJSONObject("resultContent"));
}
}
}
if (StringUtils.equals(src, "check_multil")) {
}
if (StringUtils.equals(src, "check_multilreqult")) {
if (result.isSuccess()) {
JSONObject data = (JSONObject) result.get("data");
resp = AjaxResult.success(data.getJSONObject("data"));
}
}
// 全票面采集
if (StringUtils.equals(src, "get_invoice")) {
}
return resp;
}
@Override
public Object response(JianshuiParamErrorException result, Companyservice companyservice) {
JSONObject myResult = new JSONObject();
myResult.put("status", result.getErrorCode());
myResult.put("message", result.getMsg());
return myResult;
}
}
Loading…
Cancel
Save