feature:去除aisinoutils

release
高荣琳 2 years ago
parent c5a3a3e125
commit ca8a12abd2
  1. 10
      order-management-consumer/pom.xml
  2. 30
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/bigdata/util/ProXml.java
  3. 30
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/jdjos/utils/ProXml.java
  4. 38
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/HomeBoardServiceImpl.java

@ -480,11 +480,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>

@ -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