ソースを参照

新增银行扣款模块

linbl 1 年間 前
コミット
83d1000784

+ 6 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/payment_server/PaymentServerInterface.java

@@ -26,4 +26,10 @@ public interface PaymentServerInterface {
     @RequestMapping("/payment/rpc/sendSXB013")
     void sendSXB013(@RequestBody PaymentDto paymentDto);
 
+    /**
+     * 调用通关车批信息同步接口(车出一级市场时)
+     */
+    @RequestMapping("/payment/rpc/sendSXB023")
+    void sendSXB023(@RequestBody PaymentDto paymentDto);
+
 }

+ 6 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/payment_server/PaymentServerInterfaceFallback.java

@@ -29,6 +29,12 @@ public class PaymentServerInterfaceFallback implements FallbackFactory<PaymentSe
                 System.out.println(throwable.getMessage());
                 log.error("调用银行退款接口【SXB013】错误,当前对象:{},错误信息是:{}",paymentDto,throwable.getMessage());
             }
+
+            @Override
+            public void sendSXB023(PaymentDto paymentDto) {
+                System.out.println(throwable.getMessage());
+                log.error("调用通关车批信息同步接口(车出一级市场时)【SXB023】错误,当前对象:{},错误信息是:{}",paymentDto,throwable.getMessage());
+            }
         };
     }
 }

+ 19 - 0
sp-core/sp-api/src/main/java/com/pj/api/dto/PaymentDto.java

@@ -205,11 +205,22 @@ public class PaymentDto implements Serializable {
 	//商品单位
 	private String goodsUnit;
 	//商品单价
+	private Double declPrice;
 	//商品数量
 	private Double buyQty;
 	//商品重量(毛重)
 	private Double grossWt;
 
+	private String tradeNos;
+
+	public String getTradeNos() {
+		return tradeNos;
+	}
+
+	public void setTradeNos(String tradeNos) {
+		this.tradeNos = tradeNos;
+	}
+
 	public String getOwnerName() {
 		return ownerName;
 	}
@@ -266,6 +277,14 @@ public class PaymentDto implements Serializable {
 		this.goodsUnit = goodsUnit;
 	}
 
+	public Double getDeclPrice() {
+		return declPrice;
+	}
+
+	public void setDeclPrice(Double declPrice) {
+		this.declPrice = declPrice;
+	}
+
 	public Double getBuyQty() {
 		return buyQty;
 	}

+ 9 - 0
sp-core/sp-api/src/main/java/com/pj/api/dto/TradeSettlementDto.java

@@ -187,6 +187,7 @@ public class TradeSettlementDto {
 
     private List<BordersListDto> bordersListDtoList ;
     private List<BorderBuyGoodsListDto> borderBuyGoodsListDtoList;
+    private List<SellGoodsListDto> sellGoodsListDtoList;
 
     public TradeSettlementDto(Long id, String platSeqNo, String declareId, String declareType, String declareName, String idno, String shopNo, String shopName, String orgPutrecNo, String orgName, String orgScc, String veNo, String btrnbBizModecd, String gFlow, String iEFlag, String fieldCode, String fieldName, String customsCode, String carPool, Double sumAmt, Double sumGrossWt, Double sumNetWt, String trafMode, String currCode, Long packNo, String declTime, String billNo, String voyageNo, String goodsNames, String bordersList, String borderBuyGoodsList, String sellGoodsList, Integer finishStatus, Date createTime, String preNo, List<BordersListDto> bordersListDtoList, List<BorderBuyGoodsListDto> borderBuyGoodsListDtoList) {
         this.id = id;
@@ -244,6 +245,14 @@ public class TradeSettlementDto {
         this.borderBuyGoodsListDtoList = borderBuyGoodsListDtoList;
     }
 
+    public List<SellGoodsListDto> getSellGoodsListDtoList() {
+        return sellGoodsListDtoList;
+    }
+
+    public void setSellGoodsListDtoList(List<SellGoodsListDto> sellGoodsListDtoList) {
+        this.sellGoodsListDtoList = sellGoodsListDtoList;
+    }
+
     public Long getId() {
         return id;
     }

+ 4 - 0
sp-service/async-server/src/main/java/com/pj/task/HtByteTask.java

@@ -190,14 +190,18 @@ public class HtByteTask {
                         StaticLog.info("出口商品,暂时忽略:{}", body);
                         break;
                     }
+                    //购买边民列表
                     List<BordersListDto> bordersLists = JSON.parseArray(importDeclarePeople.getBordersList(), BordersListDto.class);
                     //边民购买商品列表
                     List<BorderBuyGoodsListDto> buyGoodsList = JSON.parseArray(importDeclarePeople.getBorderBuyGoodsList(), BorderBuyGoodsListDto.class);
+                    //商铺卖货物列表
+                    List<SellGoodsListDto> sellGoodsList = JSON.parseArray(importDeclarePeople.getSellGoodsList(), SellGoodsListDto.class);
                     //保存航通监听记录
                     TradeSettlementDto tradeSettlementDto = new TradeSettlementDto();
                     BeanUtils.copyProperties(importDeclarePeople,tradeSettlementDto);
                     tradeSettlementDto.setBordersListDtoList(bordersLists);
                     tradeSettlementDto.setBorderBuyGoodsListDtoList(buyGoodsList);
+                    tradeSettlementDto.setSellGoodsListDtoList(sellGoodsList);
                     importDeclarePeople.setFinishStatus(FinishStatus.FINISH_STATUS_ZERO.getCode()); // 默认待处理
                     importDeclarePeople.setCreateTime(new Date());
                     boolean b = FeignFactory.levelOneServerInterface.tradeSettlementDto(tradeSettlementDto);

+ 7 - 4
sp-service/level-one-server/src/main/java/com/pj/ht_trade_settlement/HtTradeSettlementService.java

@@ -3,11 +3,11 @@ package com.pj.ht_trade_settlement;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.json.JSONUtil;
 import cn.hutool.log.StaticLog;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.api.dto.BorderBuyGoodsListDto;
 import com.pj.api.dto.BordersListDto;
+import com.pj.api.dto.SellGoodsListDto;
 import com.pj.api.dto.TradeSettlementDto;
 import com.pj.current.config.SystemObject;
 import com.pj.enummj.*;
@@ -16,7 +16,6 @@ import com.pj.tb_goods.TbGoodsService;
 import com.pj.tb_order.TbOrder;
 import com.pj.tb_order.TbOrderMapper;
 import com.pj.tb_people.TbPeople;
-import com.pj.tb_people.TbPeopleMapper;
 import com.pj.tb_people.TbPeopleService;
 import com.pj.tb_shop.TbShop;
 import com.pj.tb_shop.TbShopService;
@@ -113,9 +112,10 @@ public class HtTradeSettlementService extends ServiceImpl<HtTradeSettlementMappe
         int insert = htTradeSettlementMapper.insert(htTradeSettlement);
         //获取边民订单集合
         List<BordersListDto> bordersListDtoList = tradeSettlementDto.getBordersListDtoList();
-
         //获取订单商品列表集合
         List<BorderBuyGoodsListDto> borderBuyGoodsListDtoList = tradeSettlementDto.getBorderBuyGoodsListDtoList();
+        //获取商铺卖货物列表(目前逻辑为:当前商铺卖货集合,只有当前订单商品(一个商品))
+        List<SellGoodsListDto> sellGoodsListDtoList = tradeSettlementDto.getSellGoodsListDtoList();
 
         TbTradeArea tbTradeArea = tbTradeAreaService.updateHandler(tradeSettlementDto.getFieldCode(), tradeSettlementDto.getFieldName());
         Date applyTime = new Date(Long.parseLong(tradeSettlementDto.getDeclTime()));
@@ -139,7 +139,10 @@ public class HtTradeSettlementService extends ServiceImpl<HtTradeSettlementMappe
             //申报单类型,用以后续判断当前订单是否是委托单
             tbOrder.setDeclareType(tradeSettlementDto.getDeclareType());
 
-            //根据边民身份证号获取边民的订单商品列表(目前逻辑为一个边民对应一个商品)
+            //获取商品单价
+            if(sellGoodsListDtoList.size() > 0) tbOrder.setDeclPrice(sellGoodsListDtoList.get(0).getDeclPrice());
+
+                //根据边民身份证号获取边民的订单商品列表(目前逻辑为一个边民对应一个商品)
             List<BorderBuyGoodsListDto> collect = borderBuyGoodsListDtoList.stream().filter(borderBuyGoods -> item.getIdno().equals(borderBuyGoods.getIdno())).collect(Collectors.toList());
             if (collect.size() > 0) {
                 //根据商品编号查询商品表

+ 4 - 1
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrder.java

@@ -496,7 +496,10 @@ public class TbOrder extends Model<TbOrder> implements Serializable {
 	private String declareType;
 
 
-
+	/**
+	 * 商品单价
+	 */
+	private Double declPrice;
 
 
 

+ 12 - 5
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderService.java

@@ -400,6 +400,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
         paymentDto.setGrossWt(tbOrder.getGrossWt());
         paymentDto.setGoodsName(tbOrder.getGoodsNames());
         paymentDto.setGoodsUnit(tbOrder.getGoodsUnit());
+        paymentDto.setDeclPrice(tbOrder.getDeclPrice());
 
         paymentDto.setTotalPrice(BigDecimal.valueOf(tbOrder.getTotalPrice()));
         Double resalePrice = levelTwoServerInterface.getResalePriceByLevelOneOrderId(tbOrder.getId());
@@ -619,11 +620,6 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
        (系统接收到这个信息时,证明已经查验通过,不会有进出口申报单退单)*/
     public boolean orderFinish(HtPassCardDTO htPassCardDTO) {
         String billCode = htPassCardDTO.getBillCode();
-        //1、todo: 调用银行接口发起划扣:将边民划扣至银行第三方账户的货款,支付至外籍商户的账户
-        //收到划扣成功回执后,方法往下制行
-
-        //2、修改一级市场订单支付状态为已支付,修改一级市场订单完成状态为已完成
-        //获取登录人
         //获取出了一级市场的所有边民订单
         LambdaQueryWrapper<TbOrder> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(TbOrder::getPreNo, billCode);
@@ -631,6 +627,17 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
         if (tbOrders.isEmpty()) {
             return false;
         }
+        String tradeNos = "";
+        for (TbOrder tbOrder : tbOrders) {
+            tradeNos += tbOrder.getTradeNo() + ",";
+        }
+        //1、todo: 调用银行接口发起划扣:将边民划扣至银行第三方账户的货款,支付至外籍商户的账户
+        PaymentDto paymentDto = this.getPaymentData(tbOrders.get(0));
+        paymentDto.setTradeNos(tradeNos);
+        paymentServerInterface.sendSXB023(paymentDto);
+        //todo: 收到划扣成功回执后,方法往下制行?目前没有这个回执接口
+
+        //2、修改一级市场订单支付状态为已支付,修改一级市场订单完成状态为已完成
         //更新结算单状态
         Long settleId = tbOrders.get(0).getSaleMainId();
         HtTradeSettlement htTradeSettlement = htTradeSettlementService.getById(settleId);

+ 0 - 1
sp-service/payment-server/src/main/java/com/pj/task/BankByteTask.java

@@ -10,7 +10,6 @@ import com.pj.common.core.utils.StringUtils;
 import com.pj.enummj.FinishStatus;
 import com.pj.rabbitmq.RabbitMQ;
 import com.pj.utils.ht.AESUtil;
-import org.springframework.beans.factory.BeanNameAware;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.context.annotation.Configuration;
 import org.springframework.scheduling.annotation.EnableScheduling;

+ 5 - 0
sp-service/payment-server/src/main/java/com/pj/task/PaymentController.java

@@ -22,4 +22,9 @@ public class PaymentController {
     public void sendSXB013(@RequestBody PaymentDto paymentDto) {
         paymentService.sendSXB013(paymentDto);
     }
+
+    @RequestMapping("rpc/sendSXB023")
+    public void sendSXB023(@RequestBody PaymentDto paymentDto) {
+        paymentService.sendSXB023(paymentDto);
+    }
 }

+ 23 - 0
sp-service/payment-server/src/main/java/com/pj/task/PaymentService.java

@@ -59,6 +59,29 @@ public class PaymentService {
         amqpTemplate.convertAndSend(RabbitMQ.TEST_SEND_QUEUE, dataDto);
         log.info("send mq msg finish:{}", JSON.toJSONString(xml));
     }
+
+    /**
+     * ※ 通关车批信息同步(车出一级市场时)
+     * 报文名称:SXB023.xml  数据流向:一级市场--->银行
+     * @param paymentDto 一级市场订单信息
+     */
+    public void sendSXB023(PaymentDto paymentDto) {
+        log.info("send data to ht:{}", JSON.toJSONString(paymentDto));
+        String xml = MessageXML.SXB023(paymentDto);
+        //todo: 数据暂时定死
+        DataDto dataDto = new DataDto();
+        //报文加密
+        String jsonString = JSON.toJSONString(xml);
+        String encryptCBC = AESUtil.encryptCBC(jsonString, RabbitMQ.ACC_KEY);
+        dataDto.setData(encryptCBC);
+
+        //mq发送信息
+        amqpTemplate.convertAndSend(RabbitMQ.TEST_SEND_QUEUE, dataDto);
+        log.info("send mq msg finish:{}", JSON.toJSONString(xml));
+    }
+
+
+
     /**
      * 获取航通数据时,验证其是否被篡改
      */

+ 188 - 13
sp-service/payment-server/src/main/java/com/pj/xml/MessageXML.java

@@ -47,12 +47,12 @@ public class MessageXML {
                 "         <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>身份证</paperType>\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>"+paymentDto.getBankName()+"</bankCode>\n" +           //开户行代码
+                "         <bankCode>ICBKCNBJYUN</bankCode>\n" +                            //开户行代码
                 "         <tel>"+paymentDto.getBorderTel()+"</tel>\n" +                    //联系电话
                 "</vendee>\n" +
                 "<vendor>\n" +
@@ -61,13 +61,13 @@ public class MessageXML {
                 "         <paperNo></paperNo>\n" +                                         //所属人证件号
                 "         <nationality></nationality>\n" +                                 //国籍
                 "         <accountNo>"+paymentDto.getBankAccount()+"</accountNo>\n" +      //银行账号
-                "         <bankCode>"+paymentDto.getBank()+"</bankCode>\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></price>\n" +                                              //商品单价
+                "         <price>"+paymentDto.getDeclPrice()+"</price>\n" +                 //商品单价
                 "         <quantity>"+paymentDto.getBuyQty()+"</quantity>\n" +              //商品数量
                 "         <weight>"+paymentDto.getGrossWt()+"</weight>\n" +                 //商品重量
                 "         <amount>"+paymentDto.getTotalPrice()+"</amount>\n" +              //金额
@@ -113,12 +113,12 @@ public class MessageXML {
                 "         <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>身份证</paperType>\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>"+paymentDto.getBankName()+"</bankCode>\n" +           //开户行代码
+                "         <bankCode>ICBKCNBJYUN</bankCode>\n" +                            //开户行代码
                 "         <tel>"+paymentDto.getBorderTel()+"</tel>\n" +                    //联系电话
                 "</vendee>\n" +
                 "<vendor>\n" +
@@ -127,13 +127,13 @@ public class MessageXML {
                 "         <paperNo></paperNo>\n" +                                         //所属人证件号
                 "         <nationality></nationality>\n" +                                 //国籍
                 "         <accountNo>"+paymentDto.getBankAccount()+"</accountNo>\n" +      //银行账号
-                "         <bankCode>"+paymentDto.getBank()+"</bankCode>\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></price>\n" +                                              //商品单价
+                "         <price>"+paymentDto.getDeclPrice()+"</price>\n" +                 //商品单价
                 "         <quantity>"+paymentDto.getBuyQty()+"</quantity>\n" +              //商品数量
                 "         <weight>"+paymentDto.getGrossWt()+"</weight>\n" +                 //商品重量
                 "         <amount>"+paymentDto.getTotalPrice()+"</amount>\n" +              //金额
@@ -171,9 +171,184 @@ public class MessageXML {
                 "       </item>\n" +
                 "</headers>\n" +
                 " <payload xsi:type=\"carDTO\">\n" +
-                "         <registration></registration>\n" +  //车辆批号
-                "         <plateNumber></plateNumber>\n" +    //车牌号
-                "         <Order></Order>\n" +                //订单号	n个
+                "         <registration>"+paymentDto.getVoyageNo()+"</registration>\n" +  //车辆批号
+                "         <plateNumber>"+paymentDto.getVeNo()+"</plateNumber>\n" +        //车牌号
+                "         <Order>"+paymentDto.getTradeNo()+"</Order>\n" +                //订单号	n个
+                "</payload>\n" +
+                "</message>\n";
+        return xml;
+    }
+
+    /** 订单扣款(无手续费):二级市场--->银行  */
+    public static String MKT006_NoCommission(PaymentDto paymentDto) {
+        String date = sdf.format(new Date());
+
+        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>"+paymentDto.getFieldCode()+"</organization>\n" +
+                        "         <bankCode>KCCBCN2K</bankCode>\n" +
+                        "         <operation>MKT006</operation>\n" +
+                        "</headers>\n" +
+
+                        " <payload xsi:type=\"orderDTO\">\n" +
+                        "         <sn>"+paymentDto.getTradeNo()+"</sn>\n" +                         //订单号
+                        "         <organization>"+paymentDto.getFieldCode()+"</organization>\n" +   //互市点机构代码
+                        "         <currency>"+paymentDto.getCurrCode()+"</currency>\n" +            //币种
+                        "         <type>001</type>\n" +                                             //业务类型	001 代表扣款订单
+                        "         <total>"+paymentDto.getTotalPrice()+"</total>\n" +                //订单总金额 8150.00 【买方总支付金额】
+                        "         <actualTotal></actualTotal>\n" +                                  //扣除手续费边民实际到账金额  actualTotal忽略
+                        "         <dateTime>"+paymentDto.getDeclTime()+"</dateTime>\n" +            //订单时间	YYYY-MM—DD HH:MM:DD SSS
+
+                        "<vendee>\n" +//买方基本信息(采购企业)
+                        "         <name>"+paymentDto.getBorderName()+"</name>\n" +                 //企业名称
+                        "         <paperType>0008</paperType>\n" +                                 //证件类型  0008 社会统一信用代码(默认)
+                        "         <paperNo>"+paymentDto.getBorderidno()+"</paperNo>\n" +           //证件号
+                        "         <nationality>中国</nationality>\n" +                             //国籍
+                        "         <accountNo>"+paymentDto.getBankCode()+"</accountNo>\n" +         //银行账号
+                        "         <bankCode>KCCBCN2K</bankCode>\n" +                               //开户行代码
+                        "         <tel>"+paymentDto.getBorderTel()+"</tel>\n" +                    //联系电话
+                        "</vendee>\n" +
+
+                        "<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>KCCBCN2K</bankCode>\n" +                               //开户行代码
+                        "         <tel>"+paymentDto.getBorderTel()+"</tel>\n" +                    //联系电话
+                        "</vendee>\n" +
+
+                        "<items>\n" +//商品明细
+                        "         <code>"+paymentDto.getGoodsName()+"</code>\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" +
+                        "<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" +
+
+                        "</payload>\n" +
+                        "</message>\n";
+        return xml;
+    }
+
+    /** 订单扣款(+手续费):二级市场--->银行  */
+    public static String MKT006(PaymentDto paymentDto) {
+        String date = sdf.format(new Date());
+
+        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>"+paymentDto.getFieldCode()+"</organization>\n" +
+                "         <bankCode>KCCBCN2K</bankCode>\n" +
+                "         <operation>MKT006</operation>\n" +
+                "</headers>\n" +
+
+                " <payload xsi:type=\"orderDTO\">\n" +
+                "         <sn>"+paymentDto.getTradeNo()+"</sn>\n" +                         //订单号
+                "         <organization>"+paymentDto.getFieldCode()+"</organization>\n" +   //互市点机构代码
+                "         <currency>"+paymentDto.getCurrCode()+"</currency>\n" +            //币种
+                "         <type>001</type>\n" +                                             //业务类型	001 代表扣款订单
+                "         <total>"+paymentDto.getTotalPrice()+"</total>\n" +                //订单总金额 8150.00 【买方总支付金额】
+                "         <actualTotal>"+paymentDto.getTotalPrice()+"</actualTotal>\n" +    //扣除手续费边民实际到账金额 8050
+                "         <dateTime>"+paymentDto.getDeclTime()+"</dateTime>\n" +            //订单时间	YYYY-MM—DD HH:MM:DD SSS
+
+                "<vendee>\n" +//买方基本信息(采购企业)
+                "         <name>"+paymentDto.getBorderName()+"</name>\n" +                 //企业名称
+                "         <paperType>0008</paperType>\n" +                                 //证件类型  0008 社会统一信用代码(默认)
+                "         <paperNo>"+paymentDto.getBorderidno()+"</paperNo>\n" +           //证件号
+                "         <nationality>中国</nationality>\n" +                             //国籍
+                "         <accountNo>"+paymentDto.getBankCode()+"</accountNo>\n" +        //银行账号
+                "         <bankCode>KCCBCN2K</bankCode>\n" +                              //开户行代码
+                "         <tel>"+paymentDto.getBorderTel()+"</tel>\n" +                   //联系电话
+                "</vendee>\n" +
+
+                "<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>KCCBCN2K</bankCode>\n" +                              //开户行代码
+                "         <tel>"+paymentDto.getBorderTel()+"</tel>\n" +                    //联系电话
+                "</vendee>\n" +
+
+                "<items>\n" +//商品明细
+                "         <code>"+paymentDto.getGoodsName()+"</code>\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" +
+                "<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" +
+
+                "<charges>\n" +//父级手续费(有子级手续费)
+                "         <type>001</type>\n" +                                             //手续费类型	数据字典:ChargeType
+                "         <sn>"+UUID.randomUUID()+"</sn>\n" +                               //订单号
+                "         <name>"+paymentDto.getBorderName()+"</name>\n" +                  //企业名称
+                "         <paperType>0008</paperType>\n" +                                  //证件类型  0008 社会统一信用代码(默认)
+                "         <paperNo>"+paymentDto.getBorderidno()+"</paperNo>\n" +            //证件号
+                "         <nationality>中国</nationality>\n" +                               //国籍
+                "         <accountNo>"+paymentDto.getBankCode()+"</accountNo>\n" +          //银行账号
+                "         <bankCode>KCCBCN2K</bankCode>\n" +                                //开户行代码
+                "         <bankNo></bankNo>\n" +                                            //开户行行号	非必填
+                "         <tel>"+paymentDto.getBorderTel()+"</tel>\n" +                     //联系电话
+                "         <total>"+paymentDto.getBorderTel()+"</total>\n" +                 //手续费金额	70(包含了子级手续费 可多个)
+                        "<childrenCharges>\n" +//父级手续费(有子级手续费)
+                        "         <type>001</type>\n" +                                      //手续费类型	数据字典:ChargeType
+                        "         <sn>"+UUID.randomUUID()+"</sn>\n" +                        //订单号
+                        "         <name>"+paymentDto.getBorderName()+"</name>\n" +           //企业名称
+                        "         <paperType>0008</paperType>\n" +                           //证件类型  0008 社会统一信用代码(默认)
+                        "         <paperNo>"+paymentDto.getBorderidno()+"</paperNo>\n" +     //证件号
+                        "         <nationality>中国</nationality>\n" +                       //国籍
+                        "         <accountNo>"+paymentDto.getBankCode()+"</accountNo>\n" +  //银行账号
+                        "         <bankCode>KCCBCN2K</bankCode>\n" +                        //开户行代码
+                        "         <bankNo></bankNo>\n" +                                    //开户行行号	非必填
+                        "         <tel>"+paymentDto.getBorderTel()+"</tel>\n" +             //联系电话
+                        "         <total>"+paymentDto.getBorderTel()+"</total>\n" +         //手续费金额	2
+                        "</childrenCharges>\n" +
+                "</charges>\n" +
+
+                "<charges>\n" +//父级手续费(无子级手续费)
+                "         <type>001</type>\n" +                                            //手续费类型	数据字典:ChargeType
+                "         <sn>"+UUID.randomUUID()+"</sn>\n" +                              //订单号
+                "         <name>"+paymentDto.getBorderName()+"</name>\n" +                 //企业名称
+                "         <paperType>0008</paperType>\n" +                                 //证件类型  0008 社会统一信用代码(默认)
+                "         <paperNo>"+paymentDto.getBorderidno()+"</paperNo>\n" +           //证件号
+                "         <nationality>中国</nationality>\n" +                             //国籍
+                "         <accountNo>"+paymentDto.getBankCode()+"</accountNo>\n" +        //银行账号
+                "         <bankCode>KCCBCN2K</bankCode>\n" +                              //开户行代码
+                "         <bankNo></bankNo>\n" +                                          //开户行行号	非必填
+                "         <tel>"+paymentDto.getBorderTel()+"</tel>\n" +                   //联系电话
+                "         <total>"+paymentDto.getBorderTel()+"</total>\n" +               //手续费金额
+                "</charges>\n" +
+
                 "</payload>\n" +
                 "</message>\n";
         return xml;