|
@@ -4,6 +4,7 @@ package com.pj.xml;
|
|
|
import com.pj.api.dto.CompanyDto;
|
|
|
import com.pj.api.dto.PaymentDto;
|
|
|
import com.pj.api.dto.PaymentTwoDto;
|
|
|
+import com.pj.utils.CryptoUtil;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
@@ -13,7 +14,9 @@ import java.util.UUID;
|
|
|
public class MessageXML {
|
|
|
static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss sss");
|
|
|
|
|
|
- /** 订单扣款:一级市场--->银行 */
|
|
|
+ /**
|
|
|
+ * 订单扣款:一级市场--->银行
|
|
|
+ */
|
|
|
public static String SXB010(PaymentDto paymentDto) {
|
|
|
String date = sdf.format(new Date());
|
|
|
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
|
|
@@ -21,15 +24,15 @@ public class MessageXML {
|
|
|
"<headers>\n" +
|
|
|
" <item>\n" +
|
|
|
" <key>sn</key>\n" +
|
|
|
- " <value>"+ UUID.randomUUID()+"</value>\n" +
|
|
|
+ " <value>" + UUID.randomUUID() + "</value>\n" +
|
|
|
" </item>\n" +
|
|
|
" <item>\n" +
|
|
|
" <key>date</key>\n" +
|
|
|
- " <value>"+date+"</value>\n" +
|
|
|
+ " <value>" + date + "</value>\n" +
|
|
|
" </item>\n" +
|
|
|
" <item>\n" +
|
|
|
" <key>organization</key>\n" +
|
|
|
- " <value>"+paymentDto.getFieldCode()+"</value>\n" +//互市点机构代码
|
|
|
+ " <value>" + paymentDto.getFieldCode() + "</value>\n" +//互市点机构代码
|
|
|
" </item>\n" +
|
|
|
" <item>\n" +
|
|
|
" <key>bankCode</key>\n" +
|
|
@@ -41,62 +44,98 @@ public class MessageXML {
|
|
|
" </item>\n" +
|
|
|
"</headers>\n" +
|
|
|
" <payload xsi:type=\"orderDTO\">\n" +
|
|
|
- " <sn>"+paymentDto.getTradeNo()+"</sn>\n" + //订单号
|
|
|
+ " <sn>" + paymentDto.getTradeNo() + "</sn>\n" + //订单号
|
|
|
" <export>false</export>\n" + //出口标识 true:出口,false:进口
|
|
|
- " <organization>"+paymentDto.getFieldCode()+"</organization>\n" + //互市点机构代码
|
|
|
- " <currency>"+paymentDto.getCurrCode()+"</currency>\n" + //币种
|
|
|
+ " <organization>" + paymentDto.getFieldCode() + "</organization>\n" + //互市点机构代码
|
|
|
+ " <currency>" + paymentDto.getCurrCode() + "</currency>\n" + //币种
|
|
|
" <type>01</type>\n" + //业务类型 01 代表扣款报文
|
|
|
- " <charging>"+paymentDto.getResalePrice()+"</charging>\n" + //计费金额(二级市场转售总金额)
|
|
|
- " <total>"+paymentDto.getTotalPrice()+"</total>\n" + //总金额8000.00(一级市场边民订单金额)
|
|
|
- " <date>"+paymentDto.getDeclTime()+"</date>\n" + //订单时间 YYYY-MM—DD HH:MM:DD SSS
|
|
|
+ " <charging>" + paymentDto.getResalePrice() + "</charging>\n" + //计费金额(二级市场转售总金额)
|
|
|
+ " <total>" + paymentDto.getTotalPrice() + "</total>\n" + //总金额8000.00(一级市场边民订单金额)
|
|
|
+ " <date>" + paymentDto.getDeclTime() + "</date>\n" + //订单时间 YYYY-MM—DD HH:MM:DD SSS
|
|
|
"<vendee>\n" +
|
|
|
- " <name>"+paymentDto.getBorderName()+"</name>\n" + //边民姓名
|
|
|
+ " <name>" + paymentDto.getBorderName() + "</name>\n" + //边民姓名
|
|
|
" <paperType>0001</paperType>\n" + //证件类型 0001 身份证
|
|
|
- " <paperNo>"+paymentDto.getBorderidno()+"</paperNo>\n" + //边民证件号
|
|
|
+ " <paperNo>" + paymentDto.getBorderidno() + "</paperNo>\n" + //边民证件号
|
|
|
" <nationality>中国</nationality>\n" + //国籍
|
|
|
- " <accountNo>"+paymentDto.getBankCode()+"</accountNo>\n" + //银行账号
|
|
|
+ " <accountNo>" + paymentDto.getBankCode() + "</accountNo>\n" + //银行账号
|
|
|
" <bankCode>ICBKCNBJYUN</bankCode>\n" + //开户行代码
|
|
|
- " <tel>"+paymentDto.getBorderTel()+"</tel>\n" + //联系电话
|
|
|
+ " <tel>" + paymentDto.getBorderTel() + "</tel>\n" + //联系电话
|
|
|
"</vendee>\n" +
|
|
|
"<vendor>\n" +
|
|
|
- " <name>"+paymentDto.getOwnerName()+"</name>\n" + //商铺所属人姓名
|
|
|
- " <paperType>"+paymentDto.getOwnerIdtype()+"</paperType>\n" + //所属人证件类型
|
|
|
+ " <name>" + paymentDto.getOwnerName() + "</name>\n" + //商铺所属人姓名
|
|
|
+ " <paperType>" + paymentDto.getOwnerIdtype() + "</paperType>\n" + //所属人证件类型
|
|
|
" <paperNo></paperNo>\n" + //所属人证件号
|
|
|
" <nationality></nationality>\n" + //国籍
|
|
|
- " <accountNo>"+paymentDto.getBankAccount()+"</accountNo>\n" + //银行账号
|
|
|
+ " <accountNo>" + paymentDto.getBankAccount() + "</accountNo>\n" + //银行账号
|
|
|
" <bankCode>ICBKCNBJYUN</bankCode>\n" + //开户行代码
|
|
|
- " <tel>"+paymentDto.getOwnerTel()+"</tel>\n" + //联系电话
|
|
|
+ " <tel>" + paymentDto.getOwnerTel() + "</tel>\n" + //联系电话
|
|
|
"<vendor>\n" +
|
|
|
"<items>\n" +
|
|
|
- " <name>"+paymentDto.getGoodsName()+"</name>\n" + //商品名称
|
|
|
- " <unit>"+paymentDto.getGoodsUnit()+"</unit>\n" + //商品单位
|
|
|
- " <price>"+paymentDto.getDeclPrice()+"</price>\n" + //商品单价
|
|
|
- " <quantity>"+paymentDto.getBuyQty()+"</quantity>\n" + //商品数量
|
|
|
- " <weight>"+paymentDto.getGrossWt()+"</weight>\n" + //商品重量
|
|
|
- " <amount>"+paymentDto.getTotalPrice()+"</amount>\n" + //金额
|
|
|
+ " <name>" + paymentDto.getGoodsName() + "</name>\n" + //商品名称
|
|
|
+ " <unit>" + paymentDto.getGoodsUnit() + "</unit>\n" + //商品单位
|
|
|
+ " <price>" + paymentDto.getDeclPrice() + "</price>\n" + //商品单价
|
|
|
+ " <quantity>" + paymentDto.getBuyQty() + "</quantity>\n" + //商品数量
|
|
|
+ " <weight>" + paymentDto.getGrossWt() + "</weight>\n" + //商品重量
|
|
|
+ " <amount>" + paymentDto.getTotalPrice() + "</amount>\n" + //金额
|
|
|
"</items>\n" +
|
|
|
"</payload>\n" +
|
|
|
"</message>\n";
|
|
|
return xml;
|
|
|
}
|
|
|
|
|
|
- /** 订单退款:一级市场--->银行 */
|
|
|
+ /**
|
|
|
+ * 订单退款:一级市场--->银行
|
|
|
+ */
|
|
|
public static String SXB013(PaymentDto paymentDto) {
|
|
|
String date = sdf.format(new Date());
|
|
|
+ String payload = " <sn>" + paymentDto.getTradeNo() + "</sn>\n" + //订单号
|
|
|
+ " <organization>" + paymentDto.getFieldCode() + "</organization>\n" + //互市点机构代码
|
|
|
+ " <currency>" + paymentDto.getCurrCode() + "</currency>\n" + //币种
|
|
|
+ " <type>02</type>\n" + //业务类型 02代表退款报文
|
|
|
+ " <charging>" + paymentDto.getResalePrice() + "</charging>\n" + //计费金额(二级市场转售总金额)
|
|
|
+ " <total>" + paymentDto.getTotalPrice() + "</total>\n" + //总金额8000.00(一级市场边民订单金额)
|
|
|
+ " <date>" + paymentDto.getDeclTime() + "</date>\n" + //订单时间 YYYY-MM—DD HH:MM:DD SSS
|
|
|
+ "<vendee>\n" +
|
|
|
+ " <name>" + paymentDto.getBorderName() + "</name>\n" + //边民姓名
|
|
|
+ " <paperType>0001</paperType>\n" + //证件类型 0001 身份证
|
|
|
+ " <paperNo>" + paymentDto.getBorderidno() + "</paperNo>\n" + //边民证件号
|
|
|
+ " <nationality>中国</nationality>\n" + //国籍
|
|
|
+ " <accountNo>" + paymentDto.getBankCode() + "</accountNo>\n" + //银行账号
|
|
|
+ " <bankCode>ICBKCNBJYUN</bankCode>\n" + //开户行代码
|
|
|
+ " <tel>" + paymentDto.getBorderTel() + "</tel>\n" + //联系电话
|
|
|
+ "</vendee>\n" +
|
|
|
+ "<vendor>\n" +
|
|
|
+ " <name>" + paymentDto.getOwnerName() + "</name>\n" + //商铺所属人姓名
|
|
|
+ " <paperType>" + paymentDto.getOwnerIdtype() + "</paperType>\n" + //所属人证件类型
|
|
|
+ " <paperNo></paperNo>\n" + //所属人证件号
|
|
|
+ " <nationality></nationality>\n" + //国籍
|
|
|
+ " <accountNo>" + paymentDto.getBankAccount() + "</accountNo>\n" + //银行账号
|
|
|
+ " <bankCode>ICBKCNBJYUN</bankCode>\n" + //开户行代码
|
|
|
+ " <tel>" + paymentDto.getOwnerTel() + "</tel>\n" + //联系电话
|
|
|
+ "<vendor>\n" +
|
|
|
+ "<items>\n" +
|
|
|
+ " <name>" + paymentDto.getGoodsName() + "</name>\n" + //商品名称
|
|
|
+ " <unit>" + paymentDto.getGoodsUnit() + "</unit>\n" + //商品单位
|
|
|
+ " <price>" + paymentDto.getDeclPrice() + "</price>\n" + //商品单价
|
|
|
+ " <quantity>" + paymentDto.getBuyQty() + "</quantity>\n" + //商品数量
|
|
|
+ " <weight>" + paymentDto.getGrossWt() + "</weight>\n" + //商品重量
|
|
|
+ " <amount>" + paymentDto.getTotalPrice() + "</amount>\n" + //金额
|
|
|
+ "</items>\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" +
|
|
|
"<headers>\n" +
|
|
|
" <item>\n" +
|
|
|
" <key>sn</key>\n" +
|
|
|
- " <value>"+UUID.randomUUID()+"</value>\n" +
|
|
|
+ " <value>" + UUID.randomUUID() + "</value>\n" +
|
|
|
" </item>\n" +
|
|
|
" <item>\n" +
|
|
|
" <key>date</key>\n" +
|
|
|
- " <value>"+date+"</value>\n" +
|
|
|
+ " <value>" + date + "</value>\n" +
|
|
|
" </item>\n" +
|
|
|
" <item>\n" +
|
|
|
" <key>organization</key>\n" +
|
|
|
- " <value>"+paymentDto.getFieldCode()+"</value>\n" +//互市点机构代码
|
|
|
+ " <value>" + paymentDto.getFieldCode() + "</value>\n" +//互市点机构代码
|
|
|
" </item>\n" +
|
|
|
" <item>\n" +
|
|
|
" <key>bankCode</key>\n" +
|
|
@@ -108,61 +147,34 @@ public class MessageXML {
|
|
|
" </item>\n" +
|
|
|
"</headers>\n" +
|
|
|
" <payload xsi:type=\"orderDTO\">\n" +
|
|
|
- " <sn>"+paymentDto.getTradeNo()+"</sn>\n" + //订单号
|
|
|
- " <organization>"+paymentDto.getFieldCode()+"</organization>\n" + //互市点机构代码
|
|
|
- " <currency>"+paymentDto.getCurrCode()+"</currency>\n" + //币种
|
|
|
- " <type>02</type>\n" + //业务类型 02代表退款报文
|
|
|
- " <charging>"+paymentDto.getResalePrice()+"</charging>\n" + //计费金额(二级市场转售总金额)
|
|
|
- " <total>"+paymentDto.getTotalPrice()+"</total>\n" + //总金额8000.00(一级市场边民订单金额)
|
|
|
- " <date>"+paymentDto.getDeclTime()+"</date>\n" + //订单时间 YYYY-MM—DD HH:MM:DD SSS
|
|
|
- "<vendee>\n" +
|
|
|
- " <name>"+paymentDto.getBorderName()+"</name>\n" + //边民姓名
|
|
|
- " <paperType>0001</paperType>\n" + //证件类型 0001 身份证
|
|
|
- " <paperNo>"+paymentDto.getBorderidno()+"</paperNo>\n" + //边民证件号
|
|
|
- " <nationality>中国</nationality>\n" + //国籍
|
|
|
- " <accountNo>"+paymentDto.getBankCode()+"</accountNo>\n" + //银行账号
|
|
|
- " <bankCode>ICBKCNBJYUN</bankCode>\n" + //开户行代码
|
|
|
- " <tel>"+paymentDto.getBorderTel()+"</tel>\n" + //联系电话
|
|
|
- "</vendee>\n" +
|
|
|
- "<vendor>\n" +
|
|
|
- " <name>"+paymentDto.getOwnerName()+"</name>\n" + //商铺所属人姓名
|
|
|
- " <paperType>"+paymentDto.getOwnerIdtype()+"</paperType>\n" + //所属人证件类型
|
|
|
- " <paperNo></paperNo>\n" + //所属人证件号
|
|
|
- " <nationality></nationality>\n" + //国籍
|
|
|
- " <accountNo>"+paymentDto.getBankAccount()+"</accountNo>\n" + //银行账号
|
|
|
- " <bankCode>ICBKCNBJYUN</bankCode>\n" + //开户行代码
|
|
|
- " <tel>"+paymentDto.getOwnerTel()+"</tel>\n" + //联系电话
|
|
|
- "<vendor>\n" +
|
|
|
- "<items>\n" +
|
|
|
- " <name>"+paymentDto.getGoodsName()+"</name>\n" + //商品名称
|
|
|
- " <unit>"+paymentDto.getGoodsUnit()+"</unit>\n" + //商品单位
|
|
|
- " <price>"+paymentDto.getDeclPrice()+"</price>\n" + //商品单价
|
|
|
- " <quantity>"+paymentDto.getBuyQty()+"</quantity>\n" + //商品数量
|
|
|
- " <weight>"+paymentDto.getGrossWt()+"</weight>\n" + //商品重量
|
|
|
- " <amount>"+paymentDto.getTotalPrice()+"</amount>\n" + //金额
|
|
|
- "</items>\n" +
|
|
|
+ CryptoUtil.encrypt(payload)+
|
|
|
"</payload>\n" +
|
|
|
"</message>\n";
|
|
|
return xml;
|
|
|
}
|
|
|
|
|
|
- /** 通关车批信息同步(车出一级市场时):一级市场--->银行 */
|
|
|
+ /**
|
|
|
+ * 通关车批信息同步(车出一级市场时):一级市场--->银行
|
|
|
+ */
|
|
|
public static String SXB023(PaymentDto paymentDto) {
|
|
|
String date = sdf.format(new Date());
|
|
|
+ String payload= "<registration>" + paymentDto.getVoyageNo() + "</registration>\n" + //车辆批号
|
|
|
+ " <plateNumber>" + paymentDto.getVeNo() + "</plateNumber>\n" + //车牌号
|
|
|
+ " <Order>" + paymentDto.getTradeNo() + "</Order>\n" ; //订单号 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" +
|
|
|
"<headers>\n" +
|
|
|
" <item>\n" +
|
|
|
" <key>sn</key>\n" +
|
|
|
- " <value>"+UUID.randomUUID()+"</value>\n" +
|
|
|
+ " <value>" + UUID.randomUUID() + "</value>\n" +
|
|
|
" </item>\n" +
|
|
|
" <item>\n" +
|
|
|
" <key>date</key>\n" +
|
|
|
- " <value>"+date+"</value>\n" +
|
|
|
+ " <value>" + date + "</value>\n" +
|
|
|
" </item>\n" +
|
|
|
" <item>\n" +
|
|
|
" <key>organization</key>\n" +
|
|
|
- " <value>"+paymentDto.getFieldCode()+"</value>\n" +//互市点机构代码
|
|
|
+ " <value>" + paymentDto.getFieldCode() + "</value>\n" +//互市点机构代码
|
|
|
" </item>\n" +
|
|
|
" <item>\n" +
|
|
|
" <key>bankCode</key>\n" +
|
|
@@ -174,140 +186,130 @@ public class MessageXML {
|
|
|
" </item>\n" +
|
|
|
"</headers>\n" +
|
|
|
" <payload xsi:type=\"carDTO\">\n" +
|
|
|
- " <registration>"+paymentDto.getVoyageNo()+"</registration>\n" + //车辆批号
|
|
|
- " <plateNumber>"+paymentDto.getVeNo()+"</plateNumber>\n" + //车牌号
|
|
|
- " <Order>"+paymentDto.getTradeNo()+"</Order>\n" + //订单号 n个
|
|
|
+ CryptoUtil.encrypt(payload)+
|
|
|
"</payload>\n" +
|
|
|
"</message>\n";
|
|
|
return xml;
|
|
|
}
|
|
|
|
|
|
- /** 订单扣款(无手续费):二级市场--->银行 */
|
|
|
+ /**
|
|
|
+ * 订单扣款(无手续费):二级市场--->银行
|
|
|
+ */
|
|
|
public static String MKT006_NoCommission(PaymentTwoDto paymentTwoDto) {
|
|
|
String date = sdf.format(new Date());
|
|
|
+ String payload= " <sn>" + paymentTwoDto.getOrderNo() + "</sn>\n" + //订单号
|
|
|
+ " <organization>" + paymentTwoDto.getFieldCode() + "</organization>\n" + //互市点机构代码
|
|
|
+ " <currency>" + paymentTwoDto.getCurrCode() + "</currency>\n" + //币种
|
|
|
+ " <type>001</type>\n" + //业务类型 001 代表扣款订单
|
|
|
+ " <total>" + paymentTwoDto.getResalePrice() + "</total>\n" + //订单总金额 8150.00 【买方总支付金额】(转售金额)
|
|
|
+ " <actualTotal></actualTotal>\n" + //扣除手续费边民实际到账金额 actualTotal忽略
|
|
|
+ " <dateTime>" + paymentTwoDto.getDeclTime() + "</dateTime>\n" + //订单时间 YYYY-MM—DD HH:MM:DD SSS
|
|
|
+
|
|
|
+ "<vendee>\n" +//买方基本信息(采购企业)
|
|
|
+ " <name>" + paymentTwoDto.getPcName() + "</name>\n" + //企业名称
|
|
|
+ " <paperType>0008</paperType>\n" + //证件类型 0008 社会统一信用代码(默认)
|
|
|
+ " <paperNo>" + paymentTwoDto.getBusinessLicense() + "</paperNo>\n" + //证件号
|
|
|
+ " <nationality>中国</nationality>\n" + //国籍
|
|
|
+ " <accountNo>" + paymentTwoDto.getPcBankAccount() + "</accountNo>\n" + //银行账号
|
|
|
+ " <bankCode>KCCBCN2K</bankCode>\n" + //开户行代码
|
|
|
+ " <tel>" + paymentTwoDto.getPcContact() + "</tel>\n" + //联系电话
|
|
|
+ "</vendee>\n" +
|
|
|
+
|
|
|
+ "<vendee>\n" +//卖方基础信息(边民)
|
|
|
+ " <name>" + paymentTwoDto.getBorderName() + "</name>\n" + //边民姓名
|
|
|
+ " <paperType>0001</paperType>\n" + //证件类型 0001 身份证
|
|
|
+ " <paperNo>" + paymentTwoDto.getBorderidno() + "</paperNo>\n" + //边民证件号
|
|
|
+ " <nationality>中国</nationality>\n" + //国籍
|
|
|
+ " <accountNo>" + paymentTwoDto.getBankCode() + "</accountNo>\n" + //银行账号
|
|
|
+ " <bankCode>KCCBCN2K</bankCode>\n" + //开户行代码
|
|
|
+ " <tel>" + paymentTwoDto.getBorderTel() + "</tel>\n" + //联系电话
|
|
|
+ "</vendee>\n" +
|
|
|
+
|
|
|
+ "<items>\n" +//商品明细
|
|
|
+ " <code>" + paymentTwoDto.getCodeTs() + "</code>\n" + //商品编码
|
|
|
+ " <name>" + paymentTwoDto.getGoodsName() + "</name>\n" + //商品名称
|
|
|
+ " <unit>" + paymentTwoDto.getGoodsUnit() + "</unit>\n" + //商品单位
|
|
|
+ " <price>" + paymentTwoDto.getDeclPrice() + "</price>\n" + //商品单价
|
|
|
+ " <quantity>" + paymentTwoDto.getBuyQty() + "</quantity>\n" + //商品数量
|
|
|
+ " <weight>" + paymentTwoDto.getGrossWt() + "</weight>\n" + //商品重量
|
|
|
+ " <amount>" + paymentTwoDto.getResalePrice() + "</amount>\n" + //金额
|
|
|
+ "</items>\n" +
|
|
|
+ "<items>\n" +
|
|
|
+ " <name>" + paymentTwoDto.getGoodsName() + "</name>\n" + //商品名称
|
|
|
+ " <unit>" + paymentTwoDto.getGoodsUnit() + "</unit>\n" + //商品单位
|
|
|
+ " <price>" + paymentTwoDto.getDeclPrice() + "</price>\n" + //商品单价
|
|
|
+ " <quantity>" + paymentTwoDto.getBuyQty() + "</quantity>\n" + //商品数量
|
|
|
+ " <weight>" + paymentTwoDto.getGrossWt() + "</weight>\n" + //商品重量
|
|
|
+ " <amount>" + paymentTwoDto.getResalePrice() + "</amount>\n" + //金额
|
|
|
+ "</items>\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=\"\" title=\"二级市场\">\n" +
|
|
|
"<headers>\n" +
|
|
|
- " <sn>"+UUID.randomUUID()+"</sn>\n" +
|
|
|
- " <date>"+date+"</date> \n" +
|
|
|
- " <organization>"+paymentTwoDto.getFieldCode()+"</organization>\n" +
|
|
|
+ " <sn>" + UUID.randomUUID() + "</sn>\n" +
|
|
|
+ " <date>" + date + "</date> \n" +
|
|
|
+ " <organization>" + paymentTwoDto.getFieldCode() + "</organization>\n" +
|
|
|
" <bankCode>KCCBCN2K</bankCode>\n" +
|
|
|
" <operation>MKT006</operation>\n" +
|
|
|
"</headers>\n" +
|
|
|
|
|
|
" <payload xsi:type=\"orderDTO\">\n" +
|
|
|
- " <sn>"+paymentTwoDto.getOrderNo()+"</sn>\n" + //订单号
|
|
|
- " <organization>"+paymentTwoDto.getFieldCode()+"</organization>\n" + //互市点机构代码
|
|
|
- " <currency>"+paymentTwoDto.getCurrCode()+"</currency>\n" + //币种
|
|
|
- " <type>001</type>\n" + //业务类型 001 代表扣款订单
|
|
|
- " <total>"+paymentTwoDto.getResalePrice()+"</total>\n" + //订单总金额 8150.00 【买方总支付金额】(转售金额)
|
|
|
- " <actualTotal></actualTotal>\n" + //扣除手续费边民实际到账金额 actualTotal忽略
|
|
|
- " <dateTime>"+paymentTwoDto.getDeclTime()+"</dateTime>\n" + //订单时间 YYYY-MM—DD HH:MM:DD SSS
|
|
|
-
|
|
|
- "<vendee>\n" +//买方基本信息(采购企业)
|
|
|
- " <name>"+paymentTwoDto.getPcName()+"</name>\n" + //企业名称
|
|
|
- " <paperType>0008</paperType>\n" + //证件类型 0008 社会统一信用代码(默认)
|
|
|
- " <paperNo>"+paymentTwoDto.getBusinessLicense()+"</paperNo>\n" + //证件号
|
|
|
- " <nationality>中国</nationality>\n" + //国籍
|
|
|
- " <accountNo>"+paymentTwoDto.getPcBankAccount()+"</accountNo>\n" + //银行账号
|
|
|
- " <bankCode>KCCBCN2K</bankCode>\n" + //开户行代码
|
|
|
- " <tel>"+paymentTwoDto.getPcContact()+"</tel>\n" + //联系电话
|
|
|
- "</vendee>\n" +
|
|
|
-
|
|
|
- "<vendee>\n" +//卖方基础信息(边民)
|
|
|
- " <name>"+paymentTwoDto.getBorderName()+"</name>\n" + //边民姓名
|
|
|
- " <paperType>0001</paperType>\n" + //证件类型 0001 身份证
|
|
|
- " <paperNo>"+paymentTwoDto.getBorderidno()+"</paperNo>\n" + //边民证件号
|
|
|
- " <nationality>中国</nationality>\n" + //国籍
|
|
|
- " <accountNo>"+paymentTwoDto.getBankCode()+"</accountNo>\n" + //银行账号
|
|
|
- " <bankCode>KCCBCN2K</bankCode>\n" + //开户行代码
|
|
|
- " <tel>"+paymentTwoDto.getBorderTel()+"</tel>\n" + //联系电话
|
|
|
- "</vendee>\n" +
|
|
|
-
|
|
|
- "<items>\n" +//商品明细
|
|
|
- " <code>"+paymentTwoDto.getCodeTs()+"</code>\n" + //商品编码
|
|
|
- " <name>"+paymentTwoDto.getGoodsName()+"</name>\n" + //商品名称
|
|
|
- " <unit>"+paymentTwoDto.getGoodsUnit()+"</unit>\n" + //商品单位
|
|
|
- " <price>"+paymentTwoDto.getDeclPrice()+"</price>\n" + //商品单价
|
|
|
- " <quantity>"+paymentTwoDto.getBuyQty()+"</quantity>\n" + //商品数量
|
|
|
- " <weight>"+paymentTwoDto.getGrossWt()+"</weight>\n" + //商品重量
|
|
|
- " <amount>"+paymentTwoDto.getResalePrice()+"</amount>\n" + //金额
|
|
|
- "</items>\n" +
|
|
|
- "<items>\n" +
|
|
|
- " <name>"+paymentTwoDto.getGoodsName()+"</name>\n" + //商品名称
|
|
|
- " <unit>"+paymentTwoDto.getGoodsUnit()+"</unit>\n" + //商品单位
|
|
|
- " <price>"+paymentTwoDto.getDeclPrice()+"</price>\n" + //商品单价
|
|
|
- " <quantity>"+paymentTwoDto.getBuyQty()+"</quantity>\n" + //商品数量
|
|
|
- " <weight>"+paymentTwoDto.getGrossWt()+"</weight>\n" + //商品重量
|
|
|
- " <amount>"+paymentTwoDto.getResalePrice()+"</amount>\n" + //金额
|
|
|
- "</items>\n" +
|
|
|
-
|
|
|
+ CryptoUtil.encrypt(payload)+
|
|
|
"</payload>\n" +
|
|
|
"</message>\n";
|
|
|
return xml;
|
|
|
}
|
|
|
|
|
|
- /** 订单扣款(+手续费):二级市场--->银行 */
|
|
|
+ /**
|
|
|
+ * 订单扣款(+手续费):二级市场--->银行
|
|
|
+ */
|
|
|
public static String MKT006(PaymentTwoDto paymentTwoDto) {
|
|
|
String date = sdf.format(new Date());
|
|
|
- String chargesXml = chargesXml(paymentTwoDto.getCompanyDtoList(),paymentTwoDto.getOrderNo());
|
|
|
- String xml =
|
|
|
- "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
|
|
|
- "<message xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"\" title=\"二级市场\">\n" +
|
|
|
- "<headers>\n" +
|
|
|
- " <sn>"+UUID.randomUUID()+"</sn>\n" +
|
|
|
- " <date>"+date+"</date> \n" +
|
|
|
- " <organization>"+paymentTwoDto.getFieldCode()+"</organization>\n" +
|
|
|
- " <bankCode>KCCBCN2K</bankCode>\n" +
|
|
|
- " <operation>MKT006</operation>\n" +
|
|
|
- "</headers>\n" +
|
|
|
-
|
|
|
- " <payload xsi:type=\"orderDTO\">\n" +
|
|
|
- " <sn>"+paymentTwoDto.getOrderNo()+"</sn>\n" + //订单号
|
|
|
- " <organization>"+paymentTwoDto.getFieldCode()+"</organization>\n" + //互市点机构代码
|
|
|
- " <currency>"+paymentTwoDto.getCurrCode()+"</currency>\n" + //币种
|
|
|
+ String chargesXml = chargesXml(paymentTwoDto.getCompanyDtoList(), paymentTwoDto.getOrderNo());
|
|
|
+ String payload= " <sn>" + paymentTwoDto.getOrderNo() + "</sn>\n" + //订单号
|
|
|
+ " <organization>" + paymentTwoDto.getFieldCode() + "</organization>\n" + //互市点机构代码
|
|
|
+ " <currency>" + paymentTwoDto.getCurrCode() + "</currency>\n" + //币种
|
|
|
" <type>001</type>\n" + //业务类型 001 代表扣款订单
|
|
|
- " <total>"+paymentTwoDto.getResalePrice()+"</total>\n" + //订单总金额 8150.00 【买方总支付金额】
|
|
|
- " <actualTotal>"+paymentTwoDto.getTotalPrice()+"</actualTotal>\n" + //扣除手续费边民实际到账金额 8050
|
|
|
- " <dateTime>"+paymentTwoDto.getDeclTime()+"</dateTime>\n" + //订单时间 YYYY-MM—DD HH:MM:DD SSS
|
|
|
+ " <total>" + paymentTwoDto.getResalePrice() + "</total>\n" + //订单总金额 8150.00 【买方总支付金额】
|
|
|
+ " <actualTotal>" + paymentTwoDto.getTotalPrice() + "</actualTotal>\n" + //扣除手续费边民实际到账金额 8050
|
|
|
+ " <dateTime>" + paymentTwoDto.getDeclTime() + "</dateTime>\n" + //订单时间 YYYY-MM—DD HH:MM:DD SSS
|
|
|
|
|
|
"<vendee>\n" +//买方基本信息(采购企业)
|
|
|
- " <name>"+paymentTwoDto.getPcName()+"</name>\n" + //企业名称
|
|
|
+ " <name>" + paymentTwoDto.getPcName() + "</name>\n" + //企业名称
|
|
|
" <paperType>0008</paperType>\n" + //证件类型 0008 社会统一信用代码(默认)
|
|
|
- " <paperNo>"+paymentTwoDto.getBusinessLicense()+"</paperNo>\n" + //证件号
|
|
|
+ " <paperNo>" + paymentTwoDto.getBusinessLicense() + "</paperNo>\n" + //证件号
|
|
|
" <nationality>中国</nationality>\n" + //国籍
|
|
|
- " <accountNo>"+paymentTwoDto.getPcBankAccount()+"</accountNo>\n" + //银行账号
|
|
|
+ " <accountNo>" + paymentTwoDto.getPcBankAccount() + "</accountNo>\n" + //银行账号
|
|
|
" <bankCode>KCCBCN2K</bankCode>\n" + //开户行代码
|
|
|
- " <tel>"+paymentTwoDto.getPcContact()+"</tel>\n" + //联系电话
|
|
|
+ " <tel>" + paymentTwoDto.getPcContact() + "</tel>\n" + //联系电话
|
|
|
"</vendee>\n" +
|
|
|
|
|
|
"<vendee>\n" +//卖方基础信息(边民)
|
|
|
- " <name>"+paymentTwoDto.getBorderName()+"</name>\n" + //边民姓名
|
|
|
+ " <name>" + paymentTwoDto.getBorderName() + "</name>\n" + //边民姓名
|
|
|
" <paperType>0001</paperType>\n" + //证件类型 0001 身份证
|
|
|
- " <paperNo>"+paymentTwoDto.getBorderidno()+"</paperNo>\n" + //边民证件号
|
|
|
+ " <paperNo>" + paymentTwoDto.getBorderidno() + "</paperNo>\n" + //边民证件号
|
|
|
" <nationality>中国</nationality>\n" + //国籍
|
|
|
- " <accountNo>"+paymentTwoDto.getBankCode()+"</accountNo>\n" + //银行账号
|
|
|
+ " <accountNo>" + paymentTwoDto.getBankCode() + "</accountNo>\n" + //银行账号
|
|
|
" <bankCode>KCCBCN2K</bankCode>\n" + //开户行代码
|
|
|
- " <tel>"+paymentTwoDto.getBorderTel()+"</tel>\n" + //联系电话
|
|
|
+ " <tel>" + paymentTwoDto.getBorderTel() + "</tel>\n" + //联系电话
|
|
|
"</vendee>\n" +
|
|
|
|
|
|
"<items>\n" +//商品明细
|
|
|
- " <code>"+paymentTwoDto.getCodeTs()+"</code>\n" + //商品编码
|
|
|
- " <name>"+paymentTwoDto.getGoodsName()+"</name>\n" + //商品名称
|
|
|
- " <unit>"+paymentTwoDto.getGoodsUnit()+"</unit>\n" + //商品单位
|
|
|
- " <price>"+paymentTwoDto.getDeclPrice()+"</price>\n" + //商品单价
|
|
|
- " <quantity>"+paymentTwoDto.getBuyQty()+"</quantity>\n" + //商品数量
|
|
|
- " <weight>"+paymentTwoDto.getGrossWt()+"</weight>\n" + //商品重量
|
|
|
- " <amount>"+paymentTwoDto.getResalePrice()+"</amount>\n" + //金额
|
|
|
+ " <code>" + paymentTwoDto.getCodeTs() + "</code>\n" + //商品编码
|
|
|
+ " <name>" + paymentTwoDto.getGoodsName() + "</name>\n" + //商品名称
|
|
|
+ " <unit>" + paymentTwoDto.getGoodsUnit() + "</unit>\n" + //商品单位
|
|
|
+ " <price>" + paymentTwoDto.getDeclPrice() + "</price>\n" + //商品单价
|
|
|
+ " <quantity>" + paymentTwoDto.getBuyQty() + "</quantity>\n" + //商品数量
|
|
|
+ " <weight>" + paymentTwoDto.getGrossWt() + "</weight>\n" + //商品重量
|
|
|
+ " <amount>" + paymentTwoDto.getResalePrice() + "</amount>\n" + //金额
|
|
|
"</items>\n" +
|
|
|
"<items>\n" +
|
|
|
- " <name>"+paymentTwoDto.getGoodsName()+"</name>\n" + //商品名称
|
|
|
- " <unit>"+paymentTwoDto.getGoodsUnit()+"</unit>\n" + //商品单位
|
|
|
- " <price>"+paymentTwoDto.getDeclPrice()+"</price>\n" + //商品单价
|
|
|
- " <quantity>"+paymentTwoDto.getBuyQty()+"</quantity>\n" + //商品数量
|
|
|
- " <weight>"+paymentTwoDto.getGrossWt()+"</weight>\n" + //商品重量
|
|
|
- " <amount>"+paymentTwoDto.getResalePrice()+"</amount>\n" + //金额
|
|
|
+ " <name>" + paymentTwoDto.getGoodsName() + "</name>\n" + //商品名称
|
|
|
+ " <unit>" + paymentTwoDto.getGoodsUnit() + "</unit>\n" + //商品单位
|
|
|
+ " <price>" + paymentTwoDto.getDeclPrice() + "</price>\n" + //商品单价
|
|
|
+ " <quantity>" + paymentTwoDto.getBuyQty() + "</quantity>\n" + //商品数量
|
|
|
+ " <weight>" + paymentTwoDto.getGrossWt() + "</weight>\n" + //商品重量
|
|
|
+ " <amount>" + paymentTwoDto.getResalePrice() + "</amount>\n" + //金额
|
|
|
"</items>\n" +
|
|
|
|
|
|
/*"<charges>\n" +//父级手续费(有子级手续费)
|
|
@@ -337,28 +339,41 @@ public class MessageXML {
|
|
|
"</childrenCharges>\n" +
|
|
|
"</charges>\n" +*/
|
|
|
|
|
|
- chargesXml + //父级手续费(无子级手续费)
|
|
|
+ chargesXml ; //父级手续费(无子级手续费);
|
|
|
+ String xml =
|
|
|
+ "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" +
|
|
|
+ "<message xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"\" title=\"二级市场\">\n" +
|
|
|
+ "<headers>\n" +
|
|
|
+ " <sn>" + UUID.randomUUID() + "</sn>\n" +
|
|
|
+ " <date>" + date + "</date> \n" +
|
|
|
+ " <organization>" + paymentTwoDto.getFieldCode() + "</organization>\n" +
|
|
|
+ " <bankCode>KCCBCN2K</bankCode>\n" +
|
|
|
+ " <operation>MKT006</operation>\n" +
|
|
|
+ "</headers>\n" +
|
|
|
|
|
|
- "</payload>\n" +
|
|
|
- "</message>\n";
|
|
|
+ " <payload xsi:type=\"orderDTO\">\n" +
|
|
|
+ CryptoUtil.encrypt(payload)+
|
|
|
+ "</payload>\n" +
|
|
|
+ "</message>\n";
|
|
|
return xml;
|
|
|
}
|
|
|
- private static String chargesXml(List<CompanyDto> companyDtoList, String orderNo){
|
|
|
+
|
|
|
+ private static String chargesXml(List<CompanyDto> companyDtoList, String orderNo) {
|
|
|
String xml = "";
|
|
|
for (CompanyDto companyDto : companyDtoList) {
|
|
|
- xml += "<charges>\n" +//父级手续费(无子级手续费)
|
|
|
+ xml += "<charges>\n" +//父级手续费(无子级手续费)
|
|
|
" <type></type>\n" + //手续费类型 数据字典:ChargeType
|
|
|
- " <sn>"+orderNo+"</sn>\n" + //订单号
|
|
|
- " <name>"+companyDto.getName()+"</name>\n" + //企业名称
|
|
|
+ " <sn>" + orderNo + "</sn>\n" + //订单号
|
|
|
+ " <name>" + companyDto.getName() + "</name>\n" + //企业名称
|
|
|
" <paperType>0008</paperType>\n" + //证件类型 0008 社会统一信用代码(默认)
|
|
|
- " <paperNo>"+companyDto.getUsci()+"</paperNo>\n" + //证件号
|
|
|
+ " <paperNo>" + companyDto.getUsci() + "</paperNo>\n" + //证件号
|
|
|
" <nationality>中国</nationality>\n" + //国籍
|
|
|
- " <accountNo>"+companyDto.getBankAccount()+"</accountNo>\n" + //银行账号
|
|
|
+ " <accountNo>" + companyDto.getBankAccount() + "</accountNo>\n" + //银行账号
|
|
|
" <bankCode>KCCBCN2K</bankCode>\n" + //开户行代码
|
|
|
" <bankNo></bankNo>\n" + //开户行行号 非必填
|
|
|
- " <tel>"+companyDto.getContact()+"</tel>\n" + //联系电话
|
|
|
- " <total>"+companyDto.getChargesPrice()+"</total>\n" + //手续费金额
|
|
|
- "</charges>\n" ;
|
|
|
+ " <tel>" + companyDto.getContact() + "</tel>\n" + //联系电话
|
|
|
+ " <total>" + companyDto.getChargesPrice() + "</total>\n" + //手续费金额
|
|
|
+ "</charges>\n";
|
|
|
}
|
|
|
return xml;
|
|
|
}
|