Commit 2861c4f0 by ddx

修改自动注实时税号

parent 0ded4f33
...@@ -636,8 +636,10 @@ public class InvoiceFileServiceImpl implements InvoiceFileService { ...@@ -636,8 +636,10 @@ public class InvoiceFileServiceImpl implements InvoiceFileService {
Map dataResult = new HashMap(); Map dataResult = new HashMap();
dataResult.put("taxno", invoiceFileReq.getTaxno()); dataResult.put("taxno", invoiceFileReq.getTaxno());
Set<String> functionNoSet = Sets.newHashSet();
for (InvoiceFileTaxManageFunctionReq function : functionList) { for (InvoiceFileTaxManageFunctionReq function : functionList) {
String functionNo = function.getFunctionNo(); String functionNo = function.getFunctionNo();
functionNoSet.add(functionNo);
Map functionResult = new HashMap(); Map functionResult = new HashMap();
functionResult.put("functionNo", functionNo); functionResult.put("functionNo", functionNo);
...@@ -684,10 +686,6 @@ public class InvoiceFileServiceImpl implements InvoiceFileService { ...@@ -684,10 +686,6 @@ public class InvoiceFileServiceImpl implements InvoiceFileService {
continue; continue;
} }
} }
//04-token服务入库
//移到外层
//01-发票下载服务 //01-发票下载服务
if (TkUserUrl.FUNCTION_NO_INVOICE_DOWNLOAD.equals(functionNo)) {//发票下载 if (TkUserUrl.FUNCTION_NO_INVOICE_DOWNLOAD.equals(functionNo)) {//发票下载
boolean saveFlag = saveFunction01(uuidFlag, invoiceFileReq, functionResult, functionResultList, function); boolean saveFlag = saveFunction01(uuidFlag, invoiceFileReq, functionResult, functionResultList, function);
...@@ -695,15 +693,6 @@ public class InvoiceFileServiceImpl implements InvoiceFileService { ...@@ -695,15 +693,6 @@ public class InvoiceFileServiceImpl implements InvoiceFileService {
continue; continue;
} }
} else if (TkUserUrl.FUNCTION_NO_INVOICE_COLLECT.equals(functionNo) || TkUserUrl.FUNCTION_NO_CLOUD_INVOICE_COLLECT.equals(functionNo)) { } else if (TkUserUrl.FUNCTION_NO_INVOICE_COLLECT.equals(functionNo) || TkUserUrl.FUNCTION_NO_CLOUD_INVOICE_COLLECT.equals(functionNo)) {
// 实时认证,开通05勾选功能的同时开通勾选实时功能
TkUserUrl tkUser07Url = tkUserUrlService.getUserUrl(userName, TkUserUrl.FUNCTION_NO_CLOUD_INVOICE_REAL_COLLECT);
if (null != tkUser07Url && TkUserUrl.FUNCTION_NO_CLOUD_INVOICE_COLLECT.equals(functionNo)) {
logger.info("{} real verify for taxno:{} username:{}", uuidFlag, taxno, tkUser07Url.getUsername());
JSONObject addResult = addEnterprise(uuidFlag, tkUser07Url.getRequestUrl(), invoiceFileReq);
if (addResult != null) {
logger.info("{} add enterprise for taxno:{} response:{}", uuidFlag, taxno, addResult);
}
}
JSONObject taxInfoJson = callTaxInfo(uuidFlag, invoiceFileReq, function, tkUserUrlService.getUserUrl(userName, functionNo));//调用内部服务 JSONObject taxInfoJson = callTaxInfo(uuidFlag, invoiceFileReq, function, tkUserUrlService.getUserUrl(userName, functionNo));//调用内部服务
if (null == taxInfoJson || !"0".equals(taxInfoJson.getString("CODE"))) { if (null == taxInfoJson || !"0".equals(taxInfoJson.getString("CODE"))) {
String message = null==taxInfoJson?"未知异常":taxInfoJson.getString("MESSAGE"); String message = null==taxInfoJson?"未知异常":taxInfoJson.getString("MESSAGE");
...@@ -727,6 +716,19 @@ public class InvoiceFileServiceImpl implements InvoiceFileService { ...@@ -727,6 +716,19 @@ public class InvoiceFileServiceImpl implements InvoiceFileService {
functionResultList.add(functionResult); functionResultList.add(functionResult);
} }
if(functionNoSet.contains(TkUserUrl.FUNCTION_NO_CLOUD_INVOICE_COLLECT)
||functionNoSet.contains(TkUserUrl.FUNCTION_NO_CLOUD_INVOICE_NUMBER_COLLECT)) {
// 实时认证,开通05勾选功能的同时开通勾选实时功能
TkUserUrl tkUser07Url = tkUserUrlService.getUserUrl(userName, TkUserUrl.FUNCTION_NO_CLOUD_INVOICE_REAL_COLLECT);
if (null != tkUser07Url) {
logger.info("{} real verify for taxno:{} username:{}", uuidFlag, taxno, tkUser07Url.getUsername());
JSONObject addResult = addEnterprise(uuidFlag, tkUser07Url.getRequestUrl(), invoiceFileReq);
if (addResult != null) {
logger.info("{} add enterprise for taxno:{} response:{}", uuidFlag, taxno, addResult);
}
}
}
dataResult.put("functionList", functionResultList); dataResult.put("functionList", functionResultList);
result.setData(dataResult); result.setData(dataResult);
} }
......
...@@ -10,8 +10,8 @@ import java.util.List; ...@@ -10,8 +10,8 @@ import java.util.List;
import java.util.Map; import java.util.Map;
public class FileManageTest { public class FileManageTest {
String accessKeyID = "bwgf-limit"; String accessKeyID = "edd";
static String accessKeySecret = "bw@2u9%5Ts#2"; static String accessKeySecret = "edd@01!@#ccd143";
// static String host = "http://127.0.0.1:8767"; // static String host = "http://127.0.0.1:8767";
static String host = "https://api.taxservices.cn"; static String host = "https://api.taxservices.cn";
// static String host = "http://60.205.138.54:8767"; // static String host = "http://60.205.138.54:8767";
......
...@@ -12,10 +12,10 @@ import java.util.Map; ...@@ -12,10 +12,10 @@ import java.util.Map;
public class UserManageTest { public class UserManageTest {
String accessKeyID = "echangcheng"; String accessKeyID = "edd";
static String accessKeySecret = "echangcheng#@rrwea2"; static String accessKeySecret = "edd@01!@#ccd143";
static String host = "https://api.xfapiao.com"; static String host = "https://api.taxservices.cn";
@Test @Test
...@@ -39,8 +39,8 @@ public class UserManageTest { ...@@ -39,8 +39,8 @@ public class UserManageTest {
param.put("taxno","91330110MA28U72K75"); param.put("taxno","91330110MA28U72K75");
param.put("taxType","1"); param.put("taxType","1");
System.out.println(url); System.out.println(url);
String ret = HttpHelper.postWithJson(url,JSON.toJSONString(param)); ResponseContent ret = HttpHelper.postJsonEntity(url,JSON.toJSONString(param));
System.out.println(ret); System.out.println(ret.getContent());
} }
@Test @Test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment