删除后同步修改BIP的开票申请存的NCC信息-代码优化
This commit is contained in:
parent
12df83d8b3
commit
debbb2cc57
|
@ -9,7 +9,7 @@ import nc.bs.trade.business.HYSuperDMO;
|
||||||
import nc.bs.uapbd.util.IgnoreSslUtil;
|
import nc.bs.uapbd.util.IgnoreSslUtil;
|
||||||
import nc.impl.pubapp.pattern.rule.IRule;
|
import nc.impl.pubapp.pattern.rule.IRule;
|
||||||
import nc.vo.bd.defdoc.DefdocVO;
|
import nc.vo.bd.defdoc.DefdocVO;
|
||||||
import nc.vo.pubapp.pattern.exception.ExceptionUtils;
|
import nc.vo.pub.BusinessException;
|
||||||
import nc.vo.so.m32.entity.SaleInvoiceBVO;
|
import nc.vo.so.m32.entity.SaleInvoiceBVO;
|
||||||
import nc.vo.so.m32.entity.SaleInvoiceHVO;
|
import nc.vo.so.m32.entity.SaleInvoiceHVO;
|
||||||
import nc.vo.so.m32.entity.SaleInvoiceVO;
|
import nc.vo.so.m32.entity.SaleInvoiceVO;
|
||||||
|
@ -34,11 +34,11 @@ import java.util.*;
|
||||||
*/
|
*/
|
||||||
public class SyncBipBillRuleForDelete implements IRule<SaleInvoiceVO> {
|
public class SyncBipBillRuleForDelete implements IRule<SaleInvoiceVO> {
|
||||||
private HYSuperDMO superDMO = null;
|
private HYSuperDMO superDMO = null;
|
||||||
private static String appKey = "a3c57e0d871240e9b9bf56b35001a324";
|
private String appKey = "";
|
||||||
private static String appSecret = "a959f7786db8dbb9a2c0493b5855a46bea68ad75";
|
private String appSecret = "";
|
||||||
private String baseUrl = "https://www.tkkfbip.com";
|
private String baseUrl = "https://www.tkkfbip.com";
|
||||||
private static String tokenUrl = "/iuap-api-auth/open-auth/selfAppAuth/getAccessToken";
|
private String tokenUrl = "/iuap-api-auth/open-auth/selfAppAuth/getAccessToken";
|
||||||
private static String toBipUrl = "/iuap-api-gateway/oxp4h3x6/current_yonbip_default_sys/KKAPI/invoiceApplication/updateInvoice?access_token=";
|
private String toBipUrl = "/iuap-api-gateway/oxp4h3x6/current_yonbip_default_sys/KKAPI/invoiceApplication/updateInvoice?access_token=";
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(SaleInvoiceVO[] vos) {
|
public void process(SaleInvoiceVO[] vos) {
|
||||||
|
@ -66,7 +66,7 @@ public class SyncBipBillRuleForDelete implements IRule<SaleInvoiceVO> {
|
||||||
SaleInvoiceBVO[] bvos = invoiceVO.getChildrenVO();
|
SaleInvoiceBVO[] bvos = invoiceVO.getChildrenVO();
|
||||||
if (access_token.isEmpty()) {
|
if (access_token.isEmpty()) {
|
||||||
Logger.error("SyncBipBillRuleForDelete-token获取失败");
|
Logger.error("SyncBipBillRuleForDelete-token获取失败");
|
||||||
ExceptionUtils.wrappBusinessException("token»ñȡʧ°Ü");
|
throw new BusinessException("token»ñȡʧ°Ü");
|
||||||
}
|
}
|
||||||
// bip旗舰版发票主键
|
// bip旗舰版发票主键
|
||||||
String vdef38 = hvo.getVdef38();
|
String vdef38 = hvo.getVdef38();
|
||||||
|
@ -89,7 +89,7 @@ public class SyncBipBillRuleForDelete implements IRule<SaleInvoiceVO> {
|
||||||
NCCForUAPLogger.debug("SyncBipBillRuleForDelete-bipRes = " + bipRes);
|
NCCForUAPLogger.debug("SyncBipBillRuleForDelete-bipRes = " + bipRes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (NoSuchAlgorithmException | InvalidKeyException | IOException e) {
|
} catch (Exception e) {
|
||||||
Logger.error("SyncBipBillRuleForDelete-exp:" + e.getMessage(), e);
|
Logger.error("SyncBipBillRuleForDelete-exp:" + e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -109,6 +109,7 @@ public class SyncBipBillRuleForDelete implements IRule<SaleInvoiceVO> {
|
||||||
* @date 2025/3/20
|
* @date 2025/3/20
|
||||||
*/
|
*/
|
||||||
private String getAccessToken() throws NoSuchAlgorithmException, InvalidKeyException, IOException {
|
private String getAccessToken() throws NoSuchAlgorithmException, InvalidKeyException, IOException {
|
||||||
|
String access_token = "";
|
||||||
// 获取旗舰版的token
|
// 获取旗舰版的token
|
||||||
Map<String, String> params = new HashMap<>();
|
Map<String, String> params = new HashMap<>();
|
||||||
// 除签名外的其他参数
|
// 除签名外的其他参数
|
||||||
|
@ -130,10 +131,9 @@ public class SyncBipBillRuleForDelete implements IRule<SaleInvoiceVO> {
|
||||||
String responseString = doGet(baseUrl + tokenUrl, params);
|
String responseString = doGet(baseUrl + tokenUrl, params);
|
||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
Map result = gson.fromJson(responseString, Map.class);
|
Map result = gson.fromJson(responseString, Map.class);
|
||||||
String access_token = "";
|
if (StringUtils.equals("00000", result.getOrDefault("code", "") + "")) {
|
||||||
if (StringUtils.equals("00000", result.get("code").toString())) {
|
|
||||||
Map<String, Object> tokenInfo = (Map<String, Object>) result.get("data");
|
Map<String, Object> tokenInfo = (Map<String, Object>) result.get("data");
|
||||||
access_token = (String) tokenInfo.get("access_token");
|
access_token = (String) tokenInfo.getOrDefault("access_token", "");
|
||||||
}
|
}
|
||||||
Logger.error("SyncBipBillRuleForDelete-getAccessToken = " + access_token);
|
Logger.error("SyncBipBillRuleForDelete-getAccessToken = " + access_token);
|
||||||
return access_token;
|
return access_token;
|
||||||
|
|
Loading…
Reference in New Issue