|
@@ -9,9 +9,11 @@ import com.pj.bank_info.BankInfo;
|
|
import com.pj.utils.CryptoUtil;
|
|
import com.pj.utils.CryptoUtil;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
|
+import java.util.Arrays;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.UUID;
|
|
import java.util.UUID;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
public class MessageXML {
|
|
public class MessageXML {
|
|
static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss sss");
|
|
static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss sss");
|
|
@@ -255,8 +257,9 @@ public class MessageXML {
|
|
" <sn>" + paymentDto.getTradeNo() + "</sn>\n" + //订单号
|
|
" <sn>" + paymentDto.getTradeNo() + "</sn>\n" + //订单号
|
|
" <export>false</export>\n" + //出口标识 true:出口,false:进口
|
|
" <export>false</export>\n" + //出口标识 true:出口,false:进口
|
|
" <organization>" + paymentDto.getFieldCode() + "</organization>\n" + //互市点机构代码
|
|
" <organization>" + paymentDto.getFieldCode() + "</organization>\n" + //互市点机构代码
|
|
- " <currency>" + paymentDto.getCurrCode() + "</currency>\n" + //币种
|
|
|
|
- " <type>01</type>\n" + //业务类型 01 代表扣款报文
|
|
|
|
|
|
+ //" <currency>" + paymentDto.getCurrCode() + "</currency>\n" + //币种
|
|
|
|
+ " <currency>RMB</currency>\n" + //币种
|
|
|
|
+ " <type>001</type>\n" + //业务类型 01 代表扣款报文
|
|
//" <charging>" + paymentDto.getResalePrice() + "</charging>\n" + //计费金额(二级市场转售总金额):charging送0
|
|
//" <charging>" + paymentDto.getResalePrice() + "</charging>\n" + //计费金额(二级市场转售总金额):charging送0
|
|
" <charging>0</charging>\n" + //一级市场订单还没有上架计费:charging送0
|
|
" <charging>0</charging>\n" + //一级市场订单还没有上架计费:charging送0
|
|
" <total>" + paymentDto.getTotalPrice() + "</total>\n" + //总金额8000.00(一级市场边民订单金额)
|
|
" <total>" + paymentDto.getTotalPrice() + "</total>\n" + //总金额8000.00(一级市场边民订单金额)
|
|
@@ -289,7 +292,8 @@ public class MessageXML {
|
|
"<items>\n" +
|
|
"<items>\n" +
|
|
" <code>" + paymentDto.getCodeTs() + "</code>\n" + //商品编码
|
|
" <code>" + paymentDto.getCodeTs() + "</code>\n" + //商品编码
|
|
" <name>" + paymentDto.getGoodsName() + "</name>\n" + //商品名称
|
|
" <name>" + paymentDto.getGoodsName() + "</name>\n" + //商品名称
|
|
- " <unit>" + paymentDto.getGoodsUnit() + "</unit>\n" + //商品单位
|
|
|
|
|
|
+ //" <unit>" + paymentDto.getGoodsUnit() + "</unit>\n" + //商品单位
|
|
|
|
+ " <unit>0001</unit>\n" + //商品单位——KG
|
|
" <price>" + paymentDto.getDeclPrice() + "</price>\n" + //商品单价
|
|
" <price>" + paymentDto.getDeclPrice() + "</price>\n" + //商品单价
|
|
" <quantity>" + paymentDto.getBuyQty() + "</quantity>\n" + //商品数量
|
|
" <quantity>" + paymentDto.getBuyQty() + "</quantity>\n" + //商品数量
|
|
" <weight>" + paymentDto.getNetWt() + "</weight>\n" + //商品重量(净重)
|
|
" <weight>" + paymentDto.getNetWt() + "</weight>\n" + //商品重量(净重)
|
|
@@ -338,8 +342,9 @@ public class MessageXML {
|
|
"<payload xsi:type=\"orderDTO\">" +
|
|
"<payload xsi:type=\"orderDTO\">" +
|
|
" <sn>" + paymentDto.getTradeNo() + "</sn>\n" + //订单号
|
|
" <sn>" + paymentDto.getTradeNo() + "</sn>\n" + //订单号
|
|
" <organization>" + paymentDto.getFieldCode() + "</organization>\n" + //互市点机构代码
|
|
" <organization>" + paymentDto.getFieldCode() + "</organization>\n" + //互市点机构代码
|
|
- " <currency>" + paymentDto.getCurrCode() + "</currency>\n" + //币种
|
|
|
|
- " <type>02</type>\n" + //业务类型 02代表退款报文
|
|
|
|
|
|
+ //" <currency>" + paymentDto.getCurrCode() + "</currency>\n" + //币种
|
|
|
|
+ " <currency>RMB</currency>\n" + //币种
|
|
|
|
+ " <type>002</type>\n" + //业务类型 02代表退款报文
|
|
//" <charging>" + paymentDto.getResalePrice() + "</charging>\n" + //计费金额(二级市场转售总金额):charging送0
|
|
//" <charging>" + paymentDto.getResalePrice() + "</charging>\n" + //计费金额(二级市场转售总金额):charging送0
|
|
" <charging>0</charging>\n" + //一级市场订单还没有上架计费:charging送0
|
|
" <charging>0</charging>\n" + //一级市场订单还没有上架计费:charging送0
|
|
" <total>" + paymentDto.getTotalPrice() + "</total>\n" + //总金额8000.00(一级市场边民订单金额)
|
|
" <total>" + paymentDto.getTotalPrice() + "</total>\n" + //总金额8000.00(一级市场边民订单金额)
|
|
@@ -372,7 +377,8 @@ public class MessageXML {
|
|
"<items>\n" +
|
|
"<items>\n" +
|
|
" <code>" + paymentDto.getCodeTs() + "</code>\n" + //商品编码
|
|
" <code>" + paymentDto.getCodeTs() + "</code>\n" + //商品编码
|
|
" <name>" + paymentDto.getGoodsName() + "</name>\n" + //商品名称
|
|
" <name>" + paymentDto.getGoodsName() + "</name>\n" + //商品名称
|
|
- " <unit>" + paymentDto.getGoodsUnit() + "</unit>\n" + //商品单位
|
|
|
|
|
|
+ //" <unit>" + paymentDto.getGoodsUnit() + "</unit>\n" + //商品单位
|
|
|
|
+ " <unit>0001</unit>\n" + //商品单位——KG
|
|
" <price>" + paymentDto.getDeclPrice() + "</price>\n" + //商品单价
|
|
" <price>" + paymentDto.getDeclPrice() + "</price>\n" + //商品单价
|
|
" <quantity>" + paymentDto.getBuyQty() + "</quantity>\n" + //商品数量
|
|
" <quantity>" + paymentDto.getBuyQty() + "</quantity>\n" + //商品数量
|
|
" <weight>" + paymentDto.getNetWt() + "</weight>\n" + //商品重量(净重)
|
|
" <weight>" + paymentDto.getNetWt() + "</weight>\n" + //商品重量(净重)
|
|
@@ -418,11 +424,16 @@ public class MessageXML {
|
|
public static String SXB023(PaymentDto paymentDto) {
|
|
public static String SXB023(PaymentDto paymentDto) {
|
|
paymentDto.setFieldCode("861501");
|
|
paymentDto.setFieldCode("861501");
|
|
String date = sdf.format(new Date());
|
|
String date = sdf.format(new Date());
|
|
|
|
+ List<String> tradeNoList = Arrays.stream(paymentDto.getTradeNos().split(",")).collect(Collectors.toList());
|
|
|
|
+ String orderXml = "";
|
|
|
|
+ for (String tradeNo: tradeNoList) {
|
|
|
|
+ orderXml = orderXml + "<Order>" + tradeNo + "</Order>\n";
|
|
|
|
+ }
|
|
String payload=
|
|
String payload=
|
|
"<payload xsi:type=\"carpoolDTO\">" +
|
|
"<payload xsi:type=\"carpoolDTO\">" +
|
|
"<registration>" + paymentDto.getVoyageNo() + "</registration>\n" + //车辆批号
|
|
"<registration>" + paymentDto.getVoyageNo() + "</registration>\n" + //车辆批号
|
|
"<plateNumber>" + paymentDto.getVeNo() + "</plateNumber>\n" + //车牌号
|
|
"<plateNumber>" + paymentDto.getVeNo() + "</plateNumber>\n" + //车牌号
|
|
- "<Order>" + paymentDto.getTradeNos() + "</Order>\n" +//订单号 n个
|
|
|
|
|
|
+ orderXml +//订单号 n个
|
|
"</payload>";
|
|
"</payload>";
|
|
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
|
|
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
|
|
"<message xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"\">\n" +
|
|
"<message xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"\">\n" +
|
|
@@ -573,7 +584,8 @@ public class MessageXML {
|
|
"<items" +//商品明细
|
|
"<items" +//商品明细
|
|
" code=\"" + paymentTwoDto.getCodeTs() + "\"" + //商品编码
|
|
" code=\"" + paymentTwoDto.getCodeTs() + "\"" + //商品编码
|
|
" name=\"" + paymentTwoDto.getGoodsName() + "\"" + //商品名称
|
|
" name=\"" + paymentTwoDto.getGoodsName() + "\"" + //商品名称
|
|
- " unit=\"" + paymentTwoDto.getGoodsUnit() + "\"" + //商品单位
|
|
|
|
|
|
+ //" unit=\"" + paymentTwoDto.getGoodsUnit() + "\"" + //商品单位
|
|
|
|
+ " unit=\"0001\"" + //商品单位——KG
|
|
" price=\"" + paymentTwoDto.getDeclPrice() + "\"" + //商品单价
|
|
" price=\"" + paymentTwoDto.getDeclPrice() + "\"" + //商品单价
|
|
" quantity=\"" + paymentTwoDto.getBuyQty() + "\"" + //商品数量
|
|
" quantity=\"" + paymentTwoDto.getBuyQty() + "\"" + //商品数量
|
|
" weight=\"" + paymentTwoDto.getNetWt() + "\"" + //商品重量
|
|
" weight=\"" + paymentTwoDto.getNetWt() + "\"" + //商品重量
|