Merge remote-tracking branch 'origin/dev-scyl' into release

release
wangrangrang 2 years ago
commit 79e36ce2ba
  1. 20
      order-management-consumer/pom.xml
  2. 30
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/bigdata/util/ProXml.java
  3. 236
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/jdjos/service/impl/PushInvoiceToJdJosServiceImpl.java
  4. 30
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/jdjos/utils/ProXml.java
  5. 38
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/HomeBoardServiceImpl.java

@ -464,11 +464,11 @@
<!-- 京东宙斯对接SDK --> <!-- 京东宙斯对接SDK -->
<dependency> <!--<dependency>-->
<groupId>com.jd</groupId> <!--<groupId>com.jd</groupId>-->
<artifactId>open-api-sdk</artifactId> <!--<artifactId>open-api-sdk</artifactId>-->
<version>2.2</version> <!--<version>2.2</version>-->
</dependency> <!--</dependency>-->
<!-- 京东宙斯对接SDK依赖包 --> <!-- 京东宙斯对接SDK依赖包 -->
<!-- 大数据服务依赖包 --> <!-- 大数据服务依赖包 -->
<dependency> <dependency>
@ -478,11 +478,11 @@
</dependency> </dependency>
<!-- 京东宙斯对接SDK依赖包 --> <!-- 京东宙斯对接SDK依赖包 -->
<!-- 大数据服务依赖包 --> <!-- 大数据服务依赖包 -->
<dependency> <!--<dependency>-->
<groupId>com.aisino</groupId> <!--<groupId>com.aisino</groupId>-->
<artifactId>aisinoutils</artifactId> <!--<artifactId>aisinoutils</artifactId>-->
<version>1.0</version> <!--<version>1.0</version>-->
</dependency> <!--</dependency>-->
<!-- 京东宙斯对接SDK依赖包 --> <!-- 京东宙斯对接SDK依赖包 -->
<!-- 大数据服务依赖包 --> <!-- 大数据服务依赖包 -->
<dependency> <dependency>

@ -10,7 +10,7 @@
package com.dxhy.order.consumer.modules.bigdata.util; package com.dxhy.order.consumer.modules.bigdata.util;
import com.aisino.common.util.XMLShellFactory; //import com.aisino.common.util.XMLShellFactory;
import com.dxhy.order.constant.ConfigureConstant; import com.dxhy.order.constant.ConfigureConstant;
import com.dxhy.order.utils.Base64Encoding; import com.dxhy.order.utils.Base64Encoding;
import com.dxhy.order.utils.GbkUtil; import com.dxhy.order.utils.GbkUtil;
@ -214,7 +214,7 @@ public class ProXml {
public static String makeFirstLayerXml(BigDataGlobalInfo glo, Object reqObj, String encryptCode) { public static String makeFirstLayerXml(BigDataGlobalInfo glo, Object reqObj, String encryptCode) {
BigDataReturnStateInfo rs = ProXml.getReturnStateInfo(XmlPar.BUSI_SSUCCESS, ""); BigDataReturnStateInfo rs = ProXml.getReturnStateInfo(XmlPar.BUSI_SSUCCESS, "");
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream();
XMLShellFactory.newInstance().saveXml(out, reqObj); // XMLShellFactory.newInstance().saveXml(out, reqObj);
BigDataData data = ProXml.getData(out, encryptCode, false); BigDataData data = ProXml.getData(out, encryptCode, false);
return ProXml.getXml(glo, rs, data); return ProXml.getXml(glo, rs, data);
} }
@ -266,25 +266,25 @@ public class ProXml {
/** /**
* <p>获取二层协议中的协议对象</p> * <p>获取二层协议中的协议对象</p>
* *
* @param xml * @param
* @return * @return
* @throws Exception List * @throws Exception List
* @author: jerome.wang * @author: jerome.wang
* @date: Created on 2016-5-11 下午02:33:25 * @date: Created on 2016-5-11 下午02:33:25
*/ */
@SuppressWarnings("AlibabaUndefineMagicConstant") @SuppressWarnings("AlibabaUndefineMagicConstant")
public static List getDataRoot(String xml) throws Exception { // public static List getDataRoot(String xml) throws Exception {
String xmlRootStart = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <ROOT>"; // String xmlRootStart = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <ROOT>";
String xmlRootEnd = "</ROOT>"; // String xmlRootEnd = "</ROOT>";
if (xml.startsWith("<?xml")) { // if (xml.startsWith("<?xml")) {
XMLShellFactory factory = XMLShellFactory.newInstance(); // XMLShellFactory factory = XMLShellFactory.newInstance();
return (List) factory.generateDomainObject(xml).get(0); // return (List) factory.generateDomainObject(xml).get(0);
} else { // } else {
XMLShellFactory factory = XMLShellFactory.newInstance(); // XMLShellFactory factory = XMLShellFactory.newInstance();
return (List) factory.generateDomainObject(xmlRootStart + xml + xmlRootEnd).get(0); // return (List) factory.generateDomainObject(xmlRootStart + xml + xmlRootEnd).get(0);
} // }
//
} // }
/** /**
* <p>获取一层协议的data对象</p> * <p>获取一层协议的data对象</p>

@ -22,19 +22,19 @@ import com.dxhy.order.consumer.modules.jdjos.utils.ProXml;
import com.dxhy.order.invoice.config.InvoiceConfig; import com.dxhy.order.invoice.config.InvoiceConfig;
import com.dxhy.order.invoice.module.invoice.model.FileDownLoad; import com.dxhy.order.invoice.module.invoice.model.FileDownLoad;
import com.dxhy.order.invoice.module.invoice.service.OrderInvoiceInfoService; import com.dxhy.order.invoice.module.invoice.service.OrderInvoiceInfoService;
import com.jd.open.api.sdk.DefaultJdClient; //import com.jd.open.api.sdk.DefaultJdClient;
import com.jd.open.api.sdk.JdClient; //import com.jd.open.api.sdk.JdClient;
import com.jd.open.api.sdk.domain.e_invoice.IvcPopEnterpriseJsfService.request.updateStateAndLimitMoney.BushuJiChuVo; //import com.jd.open.api.sdk.domain.e_invoice.IvcPopEnterpriseJsfService.request.updateStateAndLimitMoney.BushuJiChuVo;
import com.jd.open.api.sdk.domain.e_invoice.IvcPopEnterpriseJsfService.request.updateStateAndLimitMoney.BushuZhuangtaiXianeChangeParm; //import com.jd.open.api.sdk.domain.e_invoice.IvcPopEnterpriseJsfService.request.updateStateAndLimitMoney.BushuZhuangtaiXianeChangeParm;
import com.jd.open.api.sdk.domain.e_invoice.IvcPopEnterpriseJsfService.request.updateStateAndLimitMoney.XianEVo; //import com.jd.open.api.sdk.domain.e_invoice.IvcPopEnterpriseJsfService.request.updateStateAndLimitMoney.XianEVo;
import com.jd.open.api.sdk.domain.e_invoice.IvcPopEnterpriseJsfService.response.updateStateAndLimitMoney.DxCommonData; //import com.jd.open.api.sdk.domain.e_invoice.IvcPopEnterpriseJsfService.response.updateStateAndLimitMoney.DxCommonData;
import com.jd.open.api.sdk.domain.e_invoice.IvcPopEnterpriseJsfService.response.updateStateAndLimitMoney.DxReturnStateInfo; //import com.jd.open.api.sdk.domain.e_invoice.IvcPopEnterpriseJsfService.response.updateStateAndLimitMoney.DxReturnStateInfo;
import com.jd.open.api.sdk.request.e_invoice.JosReceiveInvoiceStateRequest; //import com.jd.open.api.sdk.request.e_invoice.JosReceiveInvoiceStateRequest;
import com.jd.open.api.sdk.request.e_invoice.ReceiveInvoicePdfRequest; //import com.jd.open.api.sdk.request.e_invoice.ReceiveInvoicePdfRequest;
import com.jd.open.api.sdk.request.e_invoice.UpdateStateAndLimitMoneyRequest; //import com.jd.open.api.sdk.request.e_invoice.UpdateStateAndLimitMoneyRequest;
import com.jd.open.api.sdk.response.e_invoice.JosReceiveInvoiceStateResponse; //import com.jd.open.api.sdk.response.e_invoice.JosReceiveInvoiceStateResponse;
import com.jd.open.api.sdk.response.e_invoice.ReceiveInvoicePdfResponse; //import com.jd.open.api.sdk.response.e_invoice.ReceiveInvoicePdfResponse;
import com.jd.open.api.sdk.response.e_invoice.UpdateStateAndLimitMoneyResponse; //import com.jd.open.api.sdk.response.e_invoice.UpdateStateAndLimitMoneyResponse;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime; import org.joda.time.DateTime;
@ -139,17 +139,17 @@ public class PushInvoiceToJdJosServiceImpl implements PushInvoiceToJdJosService
String pushXml = ProXml.makeFirstLayerXml(new JdJosGlobalInfo(), fpjgxx, ConfigurerInfo.ENCRYPTCODE_0); String pushXml = ProXml.makeFirstLayerXml(new JdJosGlobalInfo(), fpjgxx, ConfigurerInfo.ENCRYPTCODE_0);
JdClient client = new DefaultJdClient(openApiConfig.getJdJosUrl(), "", openApiConfig.getJdJosAppKey(), openApiConfig.getJdJosAppSecret()); // JdClient client = new DefaultJdClient(openApiConfig.getJdJosUrl(), "", openApiConfig.getJdJosAppKey(), openApiConfig.getJdJosAppSecret());
ReceiveInvoicePdfRequest request = new ReceiveInvoicePdfRequest(); // ReceiveInvoicePdfRequest request = new ReceiveInvoicePdfRequest();
log.info("{}推送京东宙斯接口,请求参数:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(pushXml)); // log.info("{}推送京东宙斯接口,请求参数:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(pushXml));
request.setInvoiceXml(pushXml); // request.setInvoiceXml(pushXml);
try { // try {
final DateTime begin = DateTime.now(); // final DateTime begin = DateTime.now();
ReceiveInvoicePdfResponse response = client.execute(request); // ReceiveInvoicePdfResponse response = client.execute(request);
log.info("(pushInvoice)流水号:{},返回报文:{}, 耗时{}毫秒", fpjgxx.getFPQQLSH(), JsonUtils.getInstance().toJsonString(response), new Duration(begin, DateTime.now()).getMillis()); // log.info("(pushInvoice)流水号:{},返回报文:{}, 耗时{}毫秒", fpjgxx.getFPQQLSH(), JsonUtils.getInstance().toJsonString(response), new Duration(begin, DateTime.now()).getMillis());
} catch (Exception e) { // } catch (Exception e) {
log.error("(pushInvoice)流水号:{},推送京东jos失败,异常信息:{}", fpjgxx.getFPQQLSH(), e); // log.error("(pushInvoice)流水号:{},推送京东jos失败,异常信息:{}", fpjgxx.getFPQQLSH(), e);
} // }
return R.ok(); return R.ok();
} }
@ -162,37 +162,37 @@ public class PushInvoiceToJdJosServiceImpl implements PushInvoiceToJdJosService
try { try {
JdClient client = new DefaultJdClient(openApiConfig.getJdJosUrl(), "", openApiConfig.getJdJosAppKey(), openApiConfig.getJdJosAppSecret()); // JdClient client = new DefaultJdClient(openApiConfig.getJdJosUrl(), "", openApiConfig.getJdJosAppKey(), openApiConfig.getJdJosAppSecret());
JosReceiveInvoiceStateRequest josReceiveInvoiceStateRequest = new JosReceiveInvoiceStateRequest(); // JosReceiveInvoiceStateRequest josReceiveInvoiceStateRequest = new JosReceiveInvoiceStateRequest();
josReceiveInvoiceStateRequest.setExpand12(""); // josReceiveInvoiceStateRequest.setExpand12("");
josReceiveInvoiceStateRequest.setExpand1(""); // josReceiveInvoiceStateRequest.setExpand1("");
josReceiveInvoiceStateRequest.setBusinessId(fpFailTsMqData.getDdh()); // josReceiveInvoiceStateRequest.setBusinessId(fpFailTsMqData.getDdh());
josReceiveInvoiceStateRequest.setResultCode(fpFailTsMqData.getDdzt()); // josReceiveInvoiceStateRequest.setResultCode(fpFailTsMqData.getDdzt());
josReceiveInvoiceStateRequest.setReqNo(fpFailTsMqData.getFpqqlsh()); // josReceiveInvoiceStateRequest.setReqNo(fpFailTsMqData.getFpqqlsh());
josReceiveInvoiceStateRequest.setSource(1); // josReceiveInvoiceStateRequest.setSource(1);
josReceiveInvoiceStateRequest.setResultMessage(fpFailTsMqData.getDdztxx()); // josReceiveInvoiceStateRequest.setResultMessage(fpFailTsMqData.getDdztxx());
josReceiveInvoiceStateRequest.setTimestamp(DateUtil.now()); // josReceiveInvoiceStateRequest.setTimestamp(DateUtil.now());
//
log.info("{}推送京东宙斯接口,请求参数:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(josReceiveInvoiceStateRequest)); // log.info("{}推送京东宙斯接口,请求参数:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(josReceiveInvoiceStateRequest));
try { // try {
final DateTime begin = DateTime.now(); // final DateTime begin = DateTime.now();
JosReceiveInvoiceStateResponse response = client.execute(josReceiveInvoiceStateRequest); // JosReceiveInvoiceStateResponse response = client.execute(josReceiveInvoiceStateRequest);
log.info("{}流水号:{},返回报文:{}, 耗时{}毫秒",LOGGER_MSG, fpFailTsMqData.getFpqqlsh(), JsonUtils.getInstance().toJsonString(response), new Duration(begin, DateTime.now()).getMillis()); // log.info("{}流水号:{},返回报文:{}, 耗时{}毫秒",LOGGER_MSG, fpFailTsMqData.getFpqqlsh(), JsonUtils.getInstance().toJsonString(response), new Duration(begin, DateTime.now()).getMillis());
if(ObjectUtil.isNotNull(response) && StringUtils.isNotBlank(response.getReturnMsg())){ // if(ObjectUtil.isNotNull(response) && StringUtils.isNotBlank(response.getReturnMsg())){
//
Map map = JsonUtils.getInstance().parseObject(response.getReturnMsg(), Map.class); // Map map = JsonUtils.getInstance().parseObject(response.getReturnMsg(), Map.class);
if(ConfigureConstant.STRING_0000.equals(map.get(ConfigureConstant.CODE))){ // if(ConfigureConstant.STRING_0000.equals(map.get(ConfigureConstant.CODE))){
log.info("{}流水号:{},推送宙斯成功,返回报文:{}",LOGGER_MSG, fpFailTsMqData.getFpqqlsh(), response.getReturnMsg()); // log.info("{}流水号:{},推送宙斯成功,返回报文:{}",LOGGER_MSG, fpFailTsMqData.getFpqqlsh(), response.getReturnMsg());
return R.ok(); // return R.ok();
}else { // }else {
return R.error(map.get("errorMessage")); // return R.error(map.get("errorMessage"));
} // }
}else { // }else {
return R.error(response.getMsg()); // return R.error(response.getMsg());
} // }
} catch (Exception e) { // } catch (Exception e) {
log.error("{}流水号:{},推送京东jos失败,异常信息:{}",LOGGER_MSG, fpFailTsMqData.getFpqqlsh(), e); // log.error("{}流水号:{},推送京东jos失败,异常信息:{}",LOGGER_MSG, fpFailTsMqData.getFpqqlsh(), e);
} // }
} catch (Exception e) { } catch (Exception e) {
log.warn("{}推送京东宙斯失败发票数据异常:{}!", LOGGER_MSG,e); log.warn("{}推送京东宙斯失败发票数据异常:{}!", LOGGER_MSG,e);
@ -209,69 +209,69 @@ public class PushInvoiceToJdJosServiceImpl implements PushInvoiceToJdJosService
try { try {
JdClient client = new DefaultJdClient(openApiConfig.getJdJosUrl(), "", openApiConfig.getJdJosAppKey(), openApiConfig.getJdJosAppSecret()); // JdClient client = new DefaultJdClient(openApiConfig.getJdJosUrl(), "", openApiConfig.getJdJosAppKey(), openApiConfig.getJdJosAppSecret());
UpdateStateAndLimitMoneyRequest updateStateAndLimitMoneyRequest = new UpdateStateAndLimitMoneyRequest(); // UpdateStateAndLimitMoneyRequest updateStateAndLimitMoneyRequest = new UpdateStateAndLimitMoneyRequest();
BushuZhuangtaiXianeChangeParm bushuZhuangtaiXianeChangeParm = new BushuZhuangtaiXianeChangeParm(); // BushuZhuangtaiXianeChangeParm bushuZhuangtaiXianeChangeParm = new BushuZhuangtaiXianeChangeParm();
bushuZhuangtaiXianeChangeParm.setNSRMC(jdwjMqData.getNSRMC()); // bushuZhuangtaiXianeChangeParm.setNSRMC(jdwjMqData.getNSRMC());
bushuZhuangtaiXianeChangeParm.setBSZT(jdwjMqData.getBSZT()); // bushuZhuangtaiXianeChangeParm.setBSZT(jdwjMqData.getBSZT());
bushuZhuangtaiXianeChangeParm.setQYID(jdwjMqData.getQYID()); // bushuZhuangtaiXianeChangeParm.setQYID(jdwjMqData.getQYID());
bushuZhuangtaiXianeChangeParm.setTSLX(jdwjMqData.getTSLX()); // bushuZhuangtaiXianeChangeParm.setTSLX(jdwjMqData.getTSLX());
bushuZhuangtaiXianeChangeParm.setNSRSBH(jdwjMqData.getNSRSBH()); // bushuZhuangtaiXianeChangeParm.setNSRSBH(jdwjMqData.getNSRSBH());
bushuZhuangtaiXianeChangeParm.setBSZTDM(jdwjMqData.getBSZTDM()); // bushuZhuangtaiXianeChangeParm.setBSZTDM(jdwjMqData.getBSZTDM());
bushuZhuangtaiXianeChangeParm.setSouceId(jdwjMqData.getSouceId()); // bushuZhuangtaiXianeChangeParm.setSouceId(jdwjMqData.getSouceId());
bushuZhuangtaiXianeChangeParm.setType(jdwjMqData.getType()); // bushuZhuangtaiXianeChangeParm.setType(jdwjMqData.getType());
//
List<BushuJiChuVo> bushuJiChuVoList = new ArrayList<>(); // List<BushuJiChuVo> bushuJiChuVoList = new ArrayList<>();
if(ObjectUtil.isNotEmpty(jdwjMqData.getSBJCXX())){ // if(ObjectUtil.isNotEmpty(jdwjMqData.getSBJCXX())){
for (SBJCXXDTO sbjcxx : jdwjMqData.getSBJCXX()) { // for (SBJCXXDTO sbjcxx : jdwjMqData.getSBJCXX()) {
BushuJiChuVo bushuJiChuVo = new BushuJiChuVo(); // BushuJiChuVo bushuJiChuVo = new BushuJiChuVo();
List<XianEVo> xianEVoList = new ArrayList<>(); // List<XianEVo> xianEVoList = new ArrayList<>();
if(ObjectUtil.isNotEmpty(sbjcxx.getFPLXDMXX())){ // if(ObjectUtil.isNotEmpty(sbjcxx.getFPLXDMXX())){
for (FPLXDMXXDTO fplxdmxx : sbjcxx.getFPLXDMXX()) { // for (FPLXDMXXDTO fplxdmxx : sbjcxx.getFPLXDMXX()) {
XianEVo xianEVo = new XianEVo(); // XianEVo xianEVo = new XianEVo();
xianEVo.setFPLXDM(CommonUtils.transFplxdm(fplxdmxx.getFPLXDM())); // xianEVo.setFPLXDM(CommonUtils.transFplxdm(fplxdmxx.getFPLXDM()));
xianEVo.setDZKPXE(fplxdmxx.getDZKPXE()); // xianEVo.setDZKPXE(fplxdmxx.getDZKPXE());
//
xianEVoList.add(xianEVo); // xianEVoList.add(xianEVo);
} // }
} // }
//
bushuJiChuVo.setJQBH(sbjcxx.getJQBH()); // bushuJiChuVo.setJQBH(sbjcxx.getJQBH());
bushuJiChuVo.setFPLXDMXX(xianEVoList); // bushuJiChuVo.setFPLXDMXX(xianEVoList);
//
bushuJiChuVoList.add(bushuJiChuVo); // bushuJiChuVoList.add(bushuJiChuVo);
} // }
//
} // }
//
//
bushuZhuangtaiXianeChangeParm.setSBJCXX(bushuJiChuVoList); // bushuZhuangtaiXianeChangeParm.setSBJCXX(bushuJiChuVoList);
//
updateStateAndLimitMoneyRequest.setParam1(bushuZhuangtaiXianeChangeParm); // updateStateAndLimitMoneyRequest.setParam1(bushuZhuangtaiXianeChangeParm);
//
log.info("{}推送京东宙斯部署状态数据接口,请求参数:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(updateStateAndLimitMoneyRequest)); // log.info("{}推送京东宙斯部署状态数据接口,请求参数:{}", LOGGER_MSG, JsonUtils.getInstance().toJsonString(updateStateAndLimitMoneyRequest));
try { // try {
final DateTime begin = DateTime.now(); // final DateTime begin = DateTime.now();
UpdateStateAndLimitMoneyResponse response = client.execute(updateStateAndLimitMoneyRequest); // UpdateStateAndLimitMoneyResponse response = client.execute(updateStateAndLimitMoneyRequest);
log.info("{}推送京东宙斯部署状态数据接口,返回报文:{}, 耗时{}毫秒",LOGGER_MSG, JsonUtils.getInstance().toJsonString(response), new Duration(begin, DateTime.now()).getMillis()); // log.info("{}推送京东宙斯部署状态数据接口,返回报文:{}, 耗时{}毫秒",LOGGER_MSG, JsonUtils.getInstance().toJsonString(response), new Duration(begin, DateTime.now()).getMillis());
//
if(ObjectUtil.isNotNull(response)){ // if(ObjectUtil.isNotNull(response)){
DxCommonData returnType = response.getReturnType(); // DxCommonData returnType = response.getReturnType();
if(ObjectUtil.isNotNull(returnType)){ // if(ObjectUtil.isNotNull(returnType)){
DxReturnStateInfo returnStateInfo = returnType.getReturnStateInfo(); // DxReturnStateInfo returnStateInfo = returnType.getReturnStateInfo();
if(ObjectUtil.isNotNull(returnStateInfo)){ // if(ObjectUtil.isNotNull(returnStateInfo)){
if(ConfigureConstant.STRING_000000.equals(returnStateInfo.getReturnCode())){ // if(ConfigureConstant.STRING_000000.equals(returnStateInfo.getReturnCode())){
return R.error(returnStateInfo.getReturnCode(),returnStateInfo.getReturnMessage()); // return R.error(returnStateInfo.getReturnCode(),returnStateInfo.getReturnMessage());
}else { // }else {
return R.error(returnStateInfo.getReturnCode(),returnStateInfo.getReturnMessage()); // return R.error(returnStateInfo.getReturnCode(),returnStateInfo.getReturnMessage());
} // }
} // }
} // }
} // }
//
} catch (Exception e) { // } catch (Exception e) {
log.error("{}推送京东宙斯部署状态数据接口,推送京东jos失败,异常信息:{}",LOGGER_MSG, e); // log.error("{}推送京东宙斯部署状态数据接口,推送京东jos失败,异常信息:{}",LOGGER_MSG, e);
} // }
} catch (Exception e) { } catch (Exception e) {
log.warn("{}推送京东宙斯部署状态数据接口,异常:{}!", LOGGER_MSG,e); log.warn("{}推送京东宙斯部署状态数据接口,异常:{}!", LOGGER_MSG,e);

@ -10,7 +10,7 @@
package com.dxhy.order.consumer.modules.jdjos.utils; package com.dxhy.order.consumer.modules.jdjos.utils;
import com.aisino.common.util.XMLShellFactory; //import com.aisino.common.util.XMLShellFactory;
import com.dxhy.order.constant.ConfigureConstant; import com.dxhy.order.constant.ConfigureConstant;
import com.dxhy.order.utils.Base64Encoding; import com.dxhy.order.utils.Base64Encoding;
import com.dxhy.order.utils.GbkUtil; import com.dxhy.order.utils.GbkUtil;
@ -214,7 +214,7 @@ public class ProXml {
public static String makeFirstLayerXml(JdJosGlobalInfo glo, Object reqObj, String encryptCode) { public static String makeFirstLayerXml(JdJosGlobalInfo glo, Object reqObj, String encryptCode) {
JdJosReturnStateInfo rs = ProXml.getReturnStateInfo(XmlPar.BUSI_SSUCCESS, ""); JdJosReturnStateInfo rs = ProXml.getReturnStateInfo(XmlPar.BUSI_SSUCCESS, "");
ByteArrayOutputStream out = new ByteArrayOutputStream(); ByteArrayOutputStream out = new ByteArrayOutputStream();
XMLShellFactory.newInstance().saveXml(out, reqObj); //XMLShellFactory.newInstance().saveXml(out, reqObj);
JdJosData data = ProXml.getData(out, encryptCode, false); JdJosData data = ProXml.getData(out, encryptCode, false);
return ProXml.getXml(glo, rs, data); return ProXml.getXml(glo, rs, data);
} }
@ -266,25 +266,25 @@ public class ProXml {
/** /**
* <p>获取二层协议中的协议对象</p> * <p>获取二层协议中的协议对象</p>
* *
* @param xml * @param
* @return * @return
* @throws Exception List * @throws Exception List
* @author: jerome.wang * @author: jerome.wang
* @date: Created on 2016-5-11 下午02:33:25 * @date: Created on 2016-5-11 下午02:33:25
*/ */
@SuppressWarnings("AlibabaUndefineMagicConstant") @SuppressWarnings("AlibabaUndefineMagicConstant")
public static List getDataRoot(String xml) throws Exception { // public static List getDataRoot(String xml) throws Exception {
String xmlRootStart = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <ROOT>"; // String xmlRootStart = "<?xml version=\"1.0\" encoding=\"UTF-8\"?> <ROOT>";
String xmlRootEnd = "</ROOT>"; // String xmlRootEnd = "</ROOT>";
if (xml.startsWith("<?xml")) { // if (xml.startsWith("<?xml")) {
XMLShellFactory factory = XMLShellFactory.newInstance(); // XMLShellFactory factory = XMLShellFactory.newInstance();
return (List) factory.generateDomainObject(xml).get(0); // return (List) factory.generateDomainObject(xml).get(0);
} else { // } else {
XMLShellFactory factory = XMLShellFactory.newInstance(); // XMLShellFactory factory = XMLShellFactory.newInstance();
return (List) factory.generateDomainObject(xmlRootStart + xml + xmlRootEnd).get(0); // return (List) factory.generateDomainObject(xmlRootStart + xml + xmlRootEnd).get(0);
} // }
//
} // }
/** /**
* <p>获取一层协议的data对象</p> * <p>获取一层协议的data对象</p>

@ -157,37 +157,37 @@ public class HomeBoardServiceImpl implements HomeBoardService {
String currDateStr = DateUtil.format(currDate, ConfigureConstant.DATE_FORMAT_DATE_Y_M_DH_M_S); String currDateStr = DateUtil.format(currDate, ConfigureConstant.DATE_FORMAT_DATE_Y_M_DH_M_S);
if (StringUtils.equals(ConfigureConstant.STRING_0, queryType)) { if (StringUtils.equals(ConfigureConstant.STRING_0, queryType)) {
//本月开票数据 //本月开票数据
DateTime beginOfMonth = DateUtil.beginOfMonth(currDate); // DateTime beginOfMonth = DateUtil.beginOfMonth(currDate);
String beginOfMonthStr = DateUtil.formatDateTime(beginOfMonth); // String beginOfMonthStr = DateUtil.formatDateTime(beginOfMonth);
startTime = com.aisino.common.util.DateUtil.parse(beginOfMonthStr, // startTime = com.aisino.common.util.DateUtil.parse(beginOfMonthStr,
ConfigureConstant.DATE_FORMAT_DATE_Y_M_DH_M_S); // ConfigureConstant.DATE_FORMAT_DATE_Y_M_DH_M_S);
endTime = com.aisino.common.util.DateUtil.parse(currDateStr, // endTime = com.aisino.common.util.DateUtil.parse(currDateStr,
ConfigureConstant.DATE_FORMAT_DATE_Y_M_DH_M_S); // ConfigureConstant.DATE_FORMAT_DATE_Y_M_DH_M_S);
} else if (StringUtils.equals(ConfigureConstant.STRING_1, queryType)) { } else if (StringUtils.equals(ConfigureConstant.STRING_1, queryType)) {
//本季度开票数据 //本季度开票数据
DateTime beginOfQuarter = DateUtil.beginOfQuarter(currDate); DateTime beginOfQuarter = DateUtil.beginOfQuarter(currDate);
String beginOfQuarterStr = DateUtil.formatDateTime(beginOfQuarter); String beginOfQuarterStr = DateUtil.formatDateTime(beginOfQuarter);
startTime = com.aisino.common.util.DateUtil.parse(beginOfQuarterStr, // startTime = com.aisino.common.util.DateUtil.parse(beginOfQuarterStr,
ConfigureConstant.DATE_FORMAT_DATE_Y_M_DH_M_S); // ConfigureConstant.DATE_FORMAT_DATE_Y_M_DH_M_S);
endTime = com.aisino.common.util.DateUtil.parse(currDateStr, // endTime = com.aisino.common.util.DateUtil.parse(currDateStr,
ConfigureConstant.DATE_FORMAT_DATE_Y_M_DH_M_S); // ConfigureConstant.DATE_FORMAT_DATE_Y_M_DH_M_S);
} else if (StringUtils.equals(ConfigureConstant.STRING_2, queryType)) { } else if (StringUtils.equals(ConfigureConstant.STRING_2, queryType)) {
//累计开票数据 //累计开票数据
endTime = com.aisino.common.util.DateUtil.parse(currDateStr, // endTime = com.aisino.common.util.DateUtil.parse(currDateStr,
ConfigureConstant.DATE_FORMAT_DATE_Y_M_DH_M_S); // ConfigureConstant.DATE_FORMAT_DATE_Y_M_DH_M_S);
} else { } else {
throw new OrderReceiveException(ConfigureConstant.STRING_9999, "查询类型不合法,只能是0:本月,1:本季度,2:累计"); throw new OrderReceiveException(ConfigureConstant.STRING_9999, "查询类型不合法,只能是0:本月,1:本季度,2:累计");
} }
List<String> shList = Lists.newArrayList(kpsjBO.getNsrsbh()); List<String> shList = Lists.newArrayList(kpsjBO.getNsrsbh());
List<String> entList = Lists.newArrayList(kpsjBO.getEntId()); List<String> entList = Lists.newArrayList(kpsjBO.getEntId());
KpsjVO kpsjVO = new KpsjVO(); KpsjVO kpsjVO = new KpsjVO();
InvoiceCount invoiceCount = invoiceCountService.countInvoiceInfoByTime(startTime, endTime, shList, entList); // InvoiceCount invoiceCount = invoiceCountService.countInvoiceInfoByTime(startTime, endTime, shList, entList);
if (Objects.isNull(invoiceCount)) { // if (Objects.isNull(invoiceCount)) {
throw new OrderReceiveException(ConfigureConstant.STRING_9999, "未查询到相关开票数据!"); // throw new OrderReceiveException(ConfigureConstant.STRING_9999, "未查询到相关开票数据!");
} // }
kpsjVO.setKpl(Integer.parseInt(invoiceCount.getCount())); // kpsjVO.setKpl(Integer.parseInt(invoiceCount.getCount()));
kpsjVO.setHjje(invoiceCount.getHjje()); // kpsjVO.setHjje(invoiceCount.getHjje());
kpsjVO.setHjse(invoiceCount.getHjse()); // kpsjVO.setHjse(invoiceCount.getHjse());
return kpsjVO; return kpsjVO;
} }

Loading…
Cancel
Save