Quellcode durchsuchen

新增银行扣款模块

linbl vor 1 Jahr
Ursprung
Commit
ad442f46bc
44 geänderte Dateien mit 2808 neuen und 82 gelöschten Zeilen
  1. 9 0
      sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterface.java
  2. 10 0
      sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterfaceFallback.java
  3. 5 0
      sp-core/sp-api/src/main/java/com/pj/api/client/level_two_server/LevelTwoServerInterface.java
  4. 6 0
      sp-core/sp-api/src/main/java/com/pj/api/client/level_two_server/LevelTwoServerInterfaceFallback.java
  5. 29 0
      sp-core/sp-api/src/main/java/com/pj/api/client/payment_server/PaymentServerInterface.java
  6. 34 0
      sp-core/sp-api/src/main/java/com/pj/api/client/payment_server/PaymentServerInterfaceFallback.java
  7. 6 6
      sp-core/sp-api/src/main/java/com/pj/api/consts/FeignConsts.java
  8. 10 0
      sp-core/sp-api/src/main/java/com/pj/api/consts/FeignFactory.java
  9. 60 0
      sp-core/sp-api/src/main/java/com/pj/api/dto/HtDeclareChargebackDto.java
  10. 580 0
      sp-core/sp-api/src/main/java/com/pj/api/dto/PaymentDto.java
  11. 69 0
      sp-service/async-server/src/main/java/com/pj/ht_declare_chargeback/HtDeclareChargeback.java
  12. 87 0
      sp-service/async-server/src/main/java/com/pj/ht_declare_chargeback/HtDeclareChargebackController.java
  13. 30 0
      sp-service/async-server/src/main/java/com/pj/ht_declare_chargeback/HtDeclareChargebackMapper.java
  14. 51 0
      sp-service/async-server/src/main/java/com/pj/ht_declare_chargeback/HtDeclareChargebackMapper.xml
  15. 51 0
      sp-service/async-server/src/main/java/com/pj/ht_declare_chargeback/HtDeclareChargebackService.java
  16. 20 0
      sp-service/async-server/src/main/java/com/pj/task/HtByteTask.java
  17. 77 67
      sp-service/level-one-server/src/main/java/com/pj/ht_trade_settlement/HtTradeSettlement.java
  18. 3 0
      sp-service/level-one-server/src/main/java/com/pj/ht_trade_settlement/HtTradeSettlementService.java
  19. 10 0
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrder.java
  20. 7 0
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderAppController.java
  21. 8 0
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderController.java
  22. 106 9
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderService.java
  23. 13 0
      sp-service/level-two-server/src/main/java/com/pj/tb_orders/TbOrdersApiController.java
  24. 44 0
      sp-service/payment-server/pom.xml
  25. 45 0
      sp-service/payment-server/src/main/java/com/pj/PaymentServerApplication.java
  26. 81 0
      sp-service/payment-server/src/main/java/com/pj/bank_byte/BankByte.java
  27. 87 0
      sp-service/payment-server/src/main/java/com/pj/bank_byte/BankByteController.java
  28. 30 0
      sp-service/payment-server/src/main/java/com/pj/bank_byte/BankByteMapper.java
  29. 53 0
      sp-service/payment-server/src/main/java/com/pj/bank_byte/BankByteMapper.xml
  30. 51 0
      sp-service/payment-server/src/main/java/com/pj/bank_byte/BankByteService.java
  31. 116 0
      sp-service/payment-server/src/main/java/com/pj/bank_info/BankInfo.java
  32. 87 0
      sp-service/payment-server/src/main/java/com/pj/bank_info/BankInfoController.java
  33. 30 0
      sp-service/payment-server/src/main/java/com/pj/bank_info/BankInfoMapper.java
  34. 63 0
      sp-service/payment-server/src/main/java/com/pj/bank_info/BankInfoMapper.xml
  35. 51 0
      sp-service/payment-server/src/main/java/com/pj/bank_info/BankInfoService.java
  36. 26 0
      sp-service/payment-server/src/main/java/com/pj/dto/DataDto.java
  37. 61 0
      sp-service/payment-server/src/main/java/com/pj/listen/BaseInfoListen.java
  38. 40 0
      sp-service/payment-server/src/main/java/com/pj/rabbitmq/RabbitMQ.java
  39. 84 0
      sp-service/payment-server/src/main/java/com/pj/rabbitmq/RabbitmqConfig.java
  40. 280 0
      sp-service/payment-server/src/main/java/com/pj/task/BankByteTask.java
  41. 25 0
      sp-service/payment-server/src/main/java/com/pj/task/PaymentController.java
  42. 76 0
      sp-service/payment-server/src/main/java/com/pj/task/PaymentService.java
  43. 188 0
      sp-service/payment-server/src/main/java/com/pj/xml/MessageXML.java
  44. 9 0
      sp-service/payment-server/src/main/resources/bootstrap.yml

+ 9 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterface.java

@@ -119,6 +119,11 @@ public interface LevelOneServerInterface {
     @RequestMapping("/TbPeople/rpc/getAppUserByBorderPutrecNo")
     public AppUserDto getAppUserByBorderPutrecNo(@RequestParam("borderPutrecNo") String borderPutrecNo);
 
+
+    /** 系统接收到航通接口信息:进出口申报单退单 **/
+    @PostMapping("/TbOrder/rpc/chargeback")
+    public boolean chargeback(@RequestBody HtDeclareChargebackDto htDeclareChargebackDto);
+
     /** 系统接收到航通接口信息:车辆已出一级市场 ,修改相对应的一级市场订单状态 **/
     @PostMapping("/TbOrder/rpc/orderFinish")
     public boolean orderFinish(@RequestBody HtPassCardDTO htPassCardRecord);
@@ -135,4 +140,8 @@ public interface LevelOneServerInterface {
     /** 合作社保存银行卡信息 */
     @PostMapping("/app/TbCooperative/rpc/saveBankInfo")
     public boolean saveBankByCooperative(@RequestParam("id")Long id, @RequestParam("bankName")String bankName, @RequestParam("bankAccount")String bankAccount);
+
+    /** 远程调用  修改订单的叫车状态 */
+    @PostMapping("/app/TbOrder/rpc/confirmOrderFromBank")
+    public boolean confirmOrderFromBank(@RequestParam("tradeNo")String tradeNo);
 }

+ 10 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/level_one_server/LevelOneServerInterfaceFallback.java

@@ -187,6 +187,11 @@ public class LevelOneServerInterfaceFallback implements FallbackFactory<LevelOne
             }
 
             @Override
+            public boolean chargeback(HtDeclareChargebackDto htDeclareChargebackDto) {
+                return false;
+            }
+
+            @Override
             public boolean orderFinish(HtPassCardDTO dto) {
                 return false;
             }
@@ -205,6 +210,11 @@ public class LevelOneServerInterfaceFallback implements FallbackFactory<LevelOne
             public boolean saveBankByCooperative(Long id, String bankName, String bankAccount) {
                 return false;
             }
+
+            @Override
+            public boolean confirmOrderFromBank(String tradeNo) {
+                return false;
+            }
         };
     }
 }

+ 5 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/level_two_server/LevelTwoServerInterface.java

@@ -2,6 +2,7 @@ package com.pj.api.client.level_two_server;
 
 import com.pj.api.FeignInterceptor;
 import com.pj.api.consts.FeignConsts;
+import com.pj.api.dto.OrderDto;
 import com.pj.api.dto.PurchaserDto;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -29,4 +30,8 @@ public interface LevelTwoServerInterface {
     /** 添加国内收购商信息 */
     @RequestMapping("/TbPurchaser/purchaserDto")
     public boolean purchaserDto(@RequestBody PurchaserDto purchaserDto);
+
+    /** 查 - 根据一级市场订单id查二级市场的转售金额 */
+    @RequestMapping("/app/TbOrders/rpc/getResalePriceByLevelOneOrderId")
+    public Double getResalePriceByLevelOneOrderId(@RequestParam("orderId") Long orderId);
 }

+ 6 - 0
sp-core/sp-api/src/main/java/com/pj/api/client/level_two_server/LevelTwoServerInterfaceFallback.java

@@ -1,6 +1,7 @@
 package com.pj.api.client.level_two_server;
 
 import com.pj.api.client.admin.AdminInterfaceFallback;
+import com.pj.api.dto.OrderDto;
 import com.pj.api.dto.PurchaserDto;
 import feign.hystrix.FallbackFactory;
 import org.slf4j.Logger;
@@ -37,6 +38,11 @@ public class LevelTwoServerInterfaceFallback implements FallbackFactory<LevelTwo
                 log.error("国内商家信息添加错误:{},错误信息是{}",purchaserDto,throwable.getMessage());
                 return false;
             }
+
+            @Override
+            public Double getResalePriceByLevelOneOrderId(Long orderId) {
+                return null;
+            }
         };
     }
 }

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

@@ -0,0 +1,29 @@
+package com.pj.api.client.payment_server;
+
+import com.pj.api.FeignInterceptor;
+import com.pj.api.consts.FeignConsts;
+import com.pj.api.dto.*;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@FeignClient(
+        name = FeignConsts.PAYMENT_SERVER,                // 服务名称
+        configuration = FeignInterceptor.class,        // 请求拦截器
+        fallbackFactory = PaymentServerInterfaceFallback.class    // 服务降级
+)
+public interface PaymentServerInterface {
+
+    /**
+     * 调用银行扣款接口
+     */
+    @RequestMapping("/payment/rpc/sendSXB010")
+    void sendSXB010(@RequestBody PaymentDto paymentDto);
+
+    /**
+     * 调用银行退款接口
+     */
+    @RequestMapping("/payment/rpc/sendSXB013")
+    void sendSXB013(@RequestBody PaymentDto paymentDto);
+
+}

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

@@ -0,0 +1,34 @@
+package com.pj.api.client.payment_server;
+
+import com.pj.api.client.cfg.SpCfgInterfaceFallback;
+import com.pj.api.dto.*;
+import feign.hystrix.FallbackFactory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Component;
+
+
+@Component
+public class PaymentServerInterfaceFallback implements FallbackFactory<PaymentServerInterface> {
+
+    private static final Logger log = LoggerFactory.getLogger(SpCfgInterfaceFallback.class);
+
+    @Override
+    public PaymentServerInterface create(Throwable throwable) {
+        return new PaymentServerInterface() {
+
+
+            @Override
+            public void sendSXB010(PaymentDto paymentDto) {
+                System.out.println(throwable.getMessage());
+                log.error("调用银行扣款接口【SXB010】错误,当前对象:{},错误信息是:{}",paymentDto,throwable.getMessage());
+            }
+
+            @Override
+            public void sendSXB013(PaymentDto paymentDto) {
+                System.out.println(throwable.getMessage());
+                log.error("调用银行退款接口【SXB013】错误,当前对象:{},错误信息是:{}",paymentDto,throwable.getMessage());
+            }
+        };
+    }
+}

+ 6 - 6
sp-core/sp-api/src/main/java/com/pj/api/consts/FeignConsts.java

@@ -2,9 +2,9 @@ package com.pj.api.consts;
 
 public class FeignConsts {
 
-	
+
 	/**
-	 * 服务名:sp-home 
+	 * 服务名:sp-home
 	 */
 	public static final String SP_HOME = "sp-home";
 	public static final String SP_ADMIN = "sp-admin";
@@ -12,9 +12,9 @@ public class FeignConsts {
 	public static final String LEVEL_ONE_SERVER = "level-one-server";
 	public static final String LEVEL_TWO_SERVER = "level-two-server";
 	public static final String ASYNC_SERVER = "async-server";
+	public static final String PAYMENT_SERVER = "payment-server";
+
+
+
 
-	
-	
-	
-	
 }

+ 10 - 0
sp-core/sp-api/src/main/java/com/pj/api/consts/FeignFactory.java

@@ -4,6 +4,7 @@ import com.pj.api.client.admin.AdminInterface;
 import com.pj.api.client.async_server.AsyncServerInterface;
 import com.pj.api.client.level_one_server.LevelOneServerInterface;
 import com.pj.api.client.level_two_server.LevelTwoServerInterface;
+import com.pj.api.client.payment_server.PaymentServerInterface;
 import com.pj.api.client.transport.TransportInterface;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
@@ -67,4 +68,13 @@ public class FeignFactory {
 	public void setAsyncServerInterface(AsyncServerInterface asyncServerInterface){
 		FeignFactory.asyncServerInterface = asyncServerInterface;
 	}
+
+	/**
+	 * 银行扣款通信接口
+	 */
+	public static PaymentServerInterface paymentServerInterface;
+	@Autowired
+	public void setPaymentServerInterface(PaymentServerInterface paymentServerInterface){
+		FeignFactory.paymentServerInterface = paymentServerInterface;
+	}
 }

+ 60 - 0
sp-core/sp-api/src/main/java/com/pj/api/dto/HtDeclareChargebackDto.java

@@ -0,0 +1,60 @@
+package com.pj.api.dto;
+
+import java.io.Serializable;
+
+/**
+ * Model: ht_declare_chargeback -- 进出口申报单退单(010)
+ * @author lbl
+ */
+public class HtDeclareChargebackDto implements Serializable {
+
+
+	private Integer id;
+
+	/**
+	 * 申报单编号
+	 */
+	private String declareId;
+
+	/**
+	 * 监管场所编号
+	 */
+	private String fieldCode;
+
+	/**
+	 * 提运单号
+	 */
+	private String billNo;
+
+	public Integer getId() {
+		return id;
+	}
+
+	public void setId(Integer id) {
+		this.id = id;
+	}
+
+	public String getDeclareId() {
+		return declareId;
+	}
+
+	public void setDeclareId(String declareId) {
+		this.declareId = declareId;
+	}
+
+	public String getFieldCode() {
+		return fieldCode;
+	}
+
+	public void setFieldCode(String fieldCode) {
+		this.fieldCode = fieldCode;
+	}
+
+	public String getBillNo() {
+		return billNo;
+	}
+
+	public void setBillNo(String billNo) {
+		this.billNo = billNo;
+	}
+}

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

@@ -0,0 +1,580 @@
+package com.pj.api.dto;
+
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * 银行报文数据Dto
+ * @author lbl
+ */
+public class PaymentDto implements Serializable {
+
+
+	private Long id;
+
+	/**
+	 * 航通主键
+	 */
+	private String platSeqNo;
+
+	/**
+	 * 申报单编号
+	 */
+	private String declareId;
+
+	/**
+	 * 1-边民,2-商铺业主或其代理人,3-合作社代表,4-互助组代表
+	 */
+	private String declareType;
+
+	/**
+	 * 申报人姓名
+	 */
+	private String declareName;
+
+	/**
+	 * 身份证号码
+	 */
+	private String idno;
+
+	/**
+	 * 商铺编码
+	 */
+	private String shopNo;
+
+
+	/**
+	 * 商铺名称
+	 */
+	private String shopName;
+
+	/**
+	 * 申报人类别为3、4 时互助组/合作社备案编号
+	 */
+	private String orgPutrecNo;
+
+	/**
+	 * 申报人类别为3、4 时互助组/合租社名称
+	 */
+	private String orgName;
+
+	/**
+	 * 申报人类别为4 时边民合作社社会统一信用代码
+	 */
+	private String orgScc;
+
+	/**
+	 *  运输工具名称
+	 */
+	private String veNo;
+
+	/**
+	 * 业务模式, 进出口标志为进口时,01 区内交易、02 落地加工、03 原装提离。进出口标 志 为 出 口时,04:直接出口,05:出口销售。
+	 */
+	private String btrnbBizModecd;
+
+	/**
+	 * 商品流向, 进出口标志为进口时,必填,01-二次销售;02-生活自用;03-落地加工;
+	 */
+	private String gFlow;
+
+	/**
+	 * 进出口标志:I进口 E 出口
+	 */
+	private String iEFlag;
+
+	/**
+	 * 监管场所编号
+	 */
+	private String fieldCode;
+
+	/**
+	 * 监管场所名称
+	 */
+	private String fieldName;
+
+	/**
+	 * 申报口岸代码
+	 */
+	private String customsCode;
+
+	/**
+	 * 1-是、0-否
+	 */
+	private String carPool;
+
+	/**
+	 * 总金额(交易结算单006总金额)
+	 */
+	private Double sumAmt;
+
+	/**
+	 * 总毛重
+	 */
+	private Double sumGrossWt;
+
+	/**
+	 * 总净重
+	 */
+	private Double sumNetWt;
+
+	/**
+	 * 运输方式
+	 */
+	private String trafMode;
+
+	/**
+	 * 币制
+	 */
+	private String currCode;
+
+	/**
+	 * 件数,正整数
+	 */
+	private Long packNo;
+
+	/**
+	 * 申 报 时 间 :yyyy-MM-dd HH:mm:ss
+	 */
+	private String declTime;
+
+	/**
+	 * 提运单号
+	 */
+	private String billNo;
+
+	/**
+	 * 运输工具航次(班)号
+	 */
+	private String voyageNo;
+
+	/**
+	 * 商品名称,多个用英文逗号分割
+	 */
+	private String goodsNames;
+
+
+
+
+
+	/**
+	 * 订单编号
+	 */
+	private String tradeNo;
+
+	/**
+	 * 一级市场边民订单金额
+	 */
+	private BigDecimal totalPrice=BigDecimal.ZERO;
+
+	/**
+	 * 二级市场转售总金额
+	 */
+	private BigDecimal resalePrice=BigDecimal.ZERO;
+
+	//边民姓名
+	private String borderName;
+	//证件类型
+	//边民证件号
+	private String borderidno;
+	//国籍
+	//银行账号
+	private String bankCode;
+	//银行名称
+	private String bankName;
+	//银行代码
+	//联系电话
+	private String borderTel;
+
+	//商铺所属人姓名
+	private String ownerName;
+	//商铺所属人证件类型(01:身份证 02 护照)
+	private String ownerIdtype;
+	//商铺所属人证件号
+	//商铺国籍
+	//商铺银行账号
+	private String bankAccount;
+	//商铺开户行代码
+	private String bank;
+	//商铺联系电话
+	private String ownerTel;
+
+	//商品名称
+	private String goodsName;
+	//商品单位
+	private String goodsUnit;
+	//商品单价
+	//商品数量
+	private Double buyQty;
+	//商品重量(毛重)
+	private Double grossWt;
+
+	public String getOwnerName() {
+		return ownerName;
+	}
+
+	public void setOwnerName(String ownerName) {
+		this.ownerName = ownerName;
+	}
+
+	public String getOwnerIdtype() {
+		return ownerIdtype;
+	}
+
+	public void setOwnerIdtype(String ownerIdtype) {
+		this.ownerIdtype = ownerIdtype;
+	}
+
+	public String getBankAccount() {
+		return bankAccount;
+	}
+
+	public void setBankAccount(String bankAccount) {
+		this.bankAccount = bankAccount;
+	}
+
+	public String getBank() {
+		return bank;
+	}
+
+	public void setBank(String bank) {
+		this.bank = bank;
+	}
+
+	public String getOwnerTel() {
+		return ownerTel;
+	}
+
+	public void setOwnerTel(String ownerTel) {
+		this.ownerTel = ownerTel;
+	}
+
+	public String getGoodsName() {
+		return goodsName;
+	}
+
+	public void setGoodsName(String goodsName) {
+		this.goodsName = goodsName;
+	}
+
+	public String getGoodsUnit() {
+		return goodsUnit;
+	}
+
+	public void setGoodsUnit(String goodsUnit) {
+		this.goodsUnit = goodsUnit;
+	}
+
+	public Double getBuyQty() {
+		return buyQty;
+	}
+
+	public void setBuyQty(Double buyQty) {
+		this.buyQty = buyQty;
+	}
+
+	public Double getGrossWt() {
+		return grossWt;
+	}
+
+	public void setGrossWt(Double grossWt) {
+		this.grossWt = grossWt;
+	}
+
+	public String getBorderName() {
+		return borderName;
+	}
+
+	public void setBorderName(String borderName) {
+		this.borderName = borderName;
+	}
+
+	public String getBorderidno() {
+		return borderidno;
+	}
+
+	public void setBorderidno(String borderidno) {
+		this.borderidno = borderidno;
+	}
+
+	public String getBankCode() {
+		return bankCode;
+	}
+
+	public void setBankCode(String bankCode) {
+		this.bankCode = bankCode;
+	}
+
+	public String getBankName() {
+		return bankName;
+	}
+
+	public void setBankName(String bankName) {
+		this.bankName = bankName;
+	}
+
+	public String getBorderTel() {
+		return borderTel;
+	}
+
+	public void setBorderTel(String borderTel) {
+		this.borderTel = borderTel;
+	}
+
+	public BigDecimal getResalePrice() {
+		return resalePrice;
+	}
+
+	public void setResalePrice(BigDecimal resalePrice) {
+		this.resalePrice = resalePrice;
+	}
+
+	public String getTradeNo() {
+		return tradeNo;
+	}
+
+	public void setTradeNo(String tradeNo) {
+		this.tradeNo = tradeNo;
+	}
+
+	public Long getId() {
+		return id;
+	}
+
+	public void setId(Long id) {
+		this.id = id;
+	}
+
+	public String getPlatSeqNo() {
+		return platSeqNo;
+	}
+
+	public void setPlatSeqNo(String platSeqNo) {
+		this.platSeqNo = platSeqNo;
+	}
+
+	public String getDeclareId() {
+		return declareId;
+	}
+
+	public void setDeclareId(String declareId) {
+		this.declareId = declareId;
+	}
+
+	public String getDeclareType() {
+		return declareType;
+	}
+
+	public void setDeclareType(String declareType) {
+		this.declareType = declareType;
+	}
+
+	public String getDeclareName() {
+		return declareName;
+	}
+
+	public void setDeclareName(String declareName) {
+		this.declareName = declareName;
+	}
+
+	public String getIdno() {
+		return idno;
+	}
+
+	public void setIdno(String idno) {
+		this.idno = idno;
+	}
+
+	public String getShopNo() {
+		return shopNo;
+	}
+
+	public void setShopNo(String shopNo) {
+		this.shopNo = shopNo;
+	}
+
+	public String getShopName() {
+		return shopName;
+	}
+
+	public void setShopName(String shopName) {
+		this.shopName = shopName;
+	}
+
+	public String getOrgPutrecNo() {
+		return orgPutrecNo;
+	}
+
+	public void setOrgPutrecNo(String orgPutrecNo) {
+		this.orgPutrecNo = orgPutrecNo;
+	}
+
+	public String getOrgName() {
+		return orgName;
+	}
+
+	public void setOrgName(String orgName) {
+		this.orgName = orgName;
+	}
+
+	public String getOrgScc() {
+		return orgScc;
+	}
+
+	public void setOrgScc(String orgScc) {
+		this.orgScc = orgScc;
+	}
+
+	public String getVeNo() {
+		return veNo;
+	}
+
+	public void setVeNo(String veNo) {
+		this.veNo = veNo;
+	}
+
+	public String getBtrnbBizModecd() {
+		return btrnbBizModecd;
+	}
+
+	public void setBtrnbBizModecd(String btrnbBizModecd) {
+		this.btrnbBizModecd = btrnbBizModecd;
+	}
+
+	public String getgFlow() {
+		return gFlow;
+	}
+
+	public void setgFlow(String gFlow) {
+		this.gFlow = gFlow;
+	}
+
+	public String getiEFlag() {
+		return iEFlag;
+	}
+
+	public void setiEFlag(String iEFlag) {
+		this.iEFlag = iEFlag;
+	}
+
+	public String getFieldCode() {
+		return fieldCode;
+	}
+
+	public void setFieldCode(String fieldCode) {
+		this.fieldCode = fieldCode;
+	}
+
+	public String getFieldName() {
+		return fieldName;
+	}
+
+	public void setFieldName(String fieldName) {
+		this.fieldName = fieldName;
+	}
+
+	public String getCustomsCode() {
+		return customsCode;
+	}
+
+	public void setCustomsCode(String customsCode) {
+		this.customsCode = customsCode;
+	}
+
+	public String getCarPool() {
+		return carPool;
+	}
+
+	public void setCarPool(String carPool) {
+		this.carPool = carPool;
+	}
+
+	public Double getSumAmt() {
+		return sumAmt;
+	}
+
+	public void setSumAmt(Double sumAmt) {
+		this.sumAmt = sumAmt;
+	}
+
+	public Double getSumGrossWt() {
+		return sumGrossWt;
+	}
+
+	public void setSumGrossWt(Double sumGrossWt) {
+		this.sumGrossWt = sumGrossWt;
+	}
+
+	public Double getSumNetWt() {
+		return sumNetWt;
+	}
+
+	public void setSumNetWt(Double sumNetWt) {
+		this.sumNetWt = sumNetWt;
+	}
+
+	public String getTrafMode() {
+		return trafMode;
+	}
+
+	public void setTrafMode(String trafMode) {
+		this.trafMode = trafMode;
+	}
+
+	public String getCurrCode() {
+		return currCode;
+	}
+
+	public void setCurrCode(String currCode) {
+		this.currCode = currCode;
+	}
+
+	public Long getPackNo() {
+		return packNo;
+	}
+
+	public void setPackNo(Long packNo) {
+		this.packNo = packNo;
+	}
+
+	public String getDeclTime() {
+		return declTime;
+	}
+
+	public void setDeclTime(String declTime) {
+		this.declTime = declTime;
+	}
+
+	public String getBillNo() {
+		return billNo;
+	}
+
+	public void setBillNo(String billNo) {
+		this.billNo = billNo;
+	}
+
+	public String getVoyageNo() {
+		return voyageNo;
+	}
+
+	public void setVoyageNo(String voyageNo) {
+		this.voyageNo = voyageNo;
+	}
+
+	public String getGoodsNames() {
+		return goodsNames;
+	}
+
+	public void setGoodsNames(String goodsNames) {
+		this.goodsNames = goodsNames;
+	}
+
+	public BigDecimal getTotalPrice() {
+		return totalPrice;
+	}
+
+	public void setTotalPrice(BigDecimal totalPrice) {
+		this.totalPrice = totalPrice;
+	}
+}

+ 69 - 0
sp-service/async-server/src/main/java/com/pj/ht_declare_chargeback/HtDeclareChargeback.java

@@ -0,0 +1,69 @@
+package com.pj.ht_declare_chargeback;
+
+import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: ht_declare_chargeback -- 进出口申报单退单(010)
+ * @author lbl
+ */
+@Data
+@Accessors(chain = true)
+@TableName(HtDeclareChargeback.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class HtDeclareChargeback extends Model<HtDeclareChargeback> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id
+	 */
+	private static final long serialVersionUID = 1L;
+	/**
+	 * 此模块对应的表名
+	 */
+	public static final String TABLE_NAME = "ht_declare_chargeback";
+	/**
+	 * 此模块对应的权限码
+	 */
+	public static final String PERMISSION_CODE = "ht-declare-chargeback";
+	public static final String PERMISSION_CODE_ADD = "ht-declare-chargeback-add";
+	public static final String PERMISSION_CODE_EDIT = "ht-declare-chargeback-edit";
+	public static final String PERMISSION_CODE_DEL = "ht-declare-chargeback-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键
+	 */
+	@TableId(type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * 申报单编号
+	 */
+	private String declareId;
+
+	/**
+	 * 监管场所编号
+	 */
+	private String fieldCode;
+
+	/**
+	 * 提运单号
+	 */
+	private String billNo;
+
+	/**
+	 * 创建时间
+	 */
+	private String createTime;
+
+
+}

+ 87 - 0
sp-service/async-server/src/main/java/com/pj/ht_declare_chargeback/HtDeclareChargebackController.java

@@ -0,0 +1,87 @@
+package com.pj.ht_declare_chargeback;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: ht_declare_chargeback -- 进出口申报单退单(010)
+ * @author lbl
+ */
+@RestController
+@RequestMapping("/HtDeclareChargeback/")
+public class HtDeclareChargebackController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	HtDeclareChargebackService htDeclareChargebackService;
+
+	/** 增 */
+	@RequestMapping("add")
+	@SaCheckPermission(HtDeclareChargeback.PERMISSION_CODE_ADD)
+	public AjaxJson add(HtDeclareChargeback h){
+		htDeclareChargebackService.add(h);
+		h = htDeclareChargebackService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(h);
+	}
+
+	/** 删 */
+	@RequestMapping("delete")
+	@SaCheckPermission(HtDeclareChargeback.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 htDeclareChargebackService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 删 - 根据id列表 */
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(HtDeclareChargeback.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+		int line = SP.publicMapper.deleteByIds(HtDeclareChargeback.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+
+	/** 改 */
+	@RequestMapping("update")
+	@SaCheckPermission(HtDeclareChargeback.PERMISSION_CODE_EDIT)
+	public AjaxJson update(HtDeclareChargeback h){
+		htDeclareChargebackService.update(h);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */
+	@RequestMapping("getById")
+		@SaCheckPermission(HtDeclareChargeback.PERMISSION_CODE)
+	public AjaxJson getById(Integer id){
+		HtDeclareChargeback h = htDeclareChargebackService.getById(id);
+		return AjaxJson.getSuccessData(h);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	@RequestMapping("getList")
+		@SaCheckPermission(HtDeclareChargeback.PERMISSION_CODE)
+	public AjaxJson getList() {
+		SoMap so = SoMap.getRequestSoMap();
+		List<HtDeclareChargeback> list = htDeclareChargebackService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+
+
+
+
+
+
+
+
+
+}

+ 30 - 0
sp-service/async-server/src/main/java/com/pj/ht_declare_chargeback/HtDeclareChargebackMapper.java

@@ -0,0 +1,30 @@
+package com.pj.ht_declare_chargeback;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: ht_declare_chargeback -- 进出口申报单退单(010)
+ * @author lbl 
+ */
+
+@Mapper
+@Repository
+public interface HtDeclareChargebackMapper extends BaseMapper <HtDeclareChargeback> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<HtDeclareChargeback> getList(SoMap so);
+
+
+}

+ 51 - 0
sp-service/async-server/src/main/java/com/pj/ht_declare_chargeback/HtDeclareChargebackMapper.xml

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pj.ht_declare_chargeback.HtDeclareChargebackMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, declareId, fieldCode, billNo, create_time from ht_declare_chargeback  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.ht_declare_chargeback.HtDeclareChargeback"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from ht_declare_chargeback 
+	</sql>
+
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("declareId") '> and declareId = #{declareId} </if>
+			<if test=' this.has("fieldCode") '> and fieldCode = #{fieldCode} </if>
+			<if test=' this.has("billNo") '> and billNo = #{billNo} </if>
+			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> declareId desc </when>
+			<when test='sortType == 3'> fieldCode desc </when>
+			<when test='sortType == 4'> billNo desc </when>
+			<when test='sortType == 5'> create_time desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 51 - 0
sp-service/async-server/src/main/java/com/pj/ht_declare_chargeback/HtDeclareChargebackService.java

@@ -0,0 +1,51 @@
+package com.pj.ht_declare_chargeback;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+import com.pj.utils.sg.*;
+
+/**
+ * Service: ht_declare_chargeback -- 进出口申报单退单(010)
+ * @author lbl
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class HtDeclareChargebackService extends ServiceImpl<HtDeclareChargebackMapper, HtDeclareChargeback> implements IService<HtDeclareChargeback>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	HtDeclareChargebackMapper htDeclareChargebackMapper;
+
+	/** 增 */
+	void add(HtDeclareChargeback h){
+		save(h);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(HtDeclareChargeback h){
+		updateById(h);
+
+	}
+
+	/** 查 */
+	HtDeclareChargeback getById(Integer id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	List<HtDeclareChargeback> getList(SoMap so) {
+		return htDeclareChargebackMapper.getList(so);
+	}
+
+
+}

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

@@ -20,6 +20,8 @@ import com.pj.ht_borders_list.HtBordersList;
 import com.pj.ht_borders_list.HtBordersListMapper;
 import com.pj.ht_byte.HtByte;
 import com.pj.ht_byte.HtByteMapper;
+import com.pj.ht_declare_chargeback.HtDeclareChargeback;
+import com.pj.ht_declare_chargeback.HtDeclareChargebackMapper;
 import com.pj.ht_import_declare_people.HtImportDeclarePeople;
 import com.pj.ht_import_declare_people.HtImportDeclarePeopleMapper;
 import com.pj.ht_pass_card_record.HtPassCardRecord;
@@ -79,6 +81,8 @@ public class HtByteTask {
      */
     @Autowired
     private HtTradeSettlementMapper htTradeSettlementMapper;
+    @Autowired
+    private HtDeclareChargebackMapper htDeclareChargebackMapper;
 
 
     /**
@@ -209,6 +213,7 @@ public class HtByteTask {
                     }
                     break;
                 case "008":
+                    //进口申报单
                     HtImportOrderDto importOrderDto = JSONObject.parseObject(body, HtImportOrderDto.class);
                     boolean result = FeignFactory.levelOneServerInterface.importOrderDto(importOrderDto);
                     methodHtByteTask.updateHtByteInfo(result, item, dataDto);
@@ -231,6 +236,21 @@ public class HtByteTask {
                         System.err.println("\n进口申报单边民确认信息处理失败。 messageId = " + item.getMessageId() + "\n");
                     }
                     break;
+                case "010":
+                    //进出口申报单退单
+                    HtDeclareChargeback htDeclareChargeback = JSONObject.parseObject(body, HtDeclareChargeback.class);
+                    int insert3 = htDeclareChargebackMapper.insert(htDeclareChargeback);
+
+                    //调用银行退款接口-逻辑处理
+                    HtDeclareChargebackDto htDeclareChargebackDto = new HtDeclareChargebackDto();
+                    BeanUtils.copyProperties(htDeclareChargeback, htDeclareChargebackDto);
+                    boolean chargeback = FeignFactory.levelOneServerInterface.chargeback(htDeclareChargebackDto);
+                    methodHtByteTask.updateHtByteInfo(chargeback, item, dataDto);
+                    if (insert3 == 1) {
+                        System.err.println("\n进出口申报单退单信息处理成功。 messageId = " + item.getMessageId() + "\n");
+                    } else {
+                        System.err.println("\n进出口申报单退单信息处理失败。 messageId = " + item.getMessageId() + "\n");
+                    }
                 default:
                     throw new ServiceException("类型错误。");
             }

+ 77 - 67
sp-service/level-one-server/src/main/java/com/pj/ht_trade_settlement/HtTradeSettlement.java

@@ -17,7 +17,7 @@ import java.util.Date;
 
 /**
  * Model: ht_trade_settlement -- 航通交易结算表
- * @author yzs 
+ * @author yzs
  */
 @Data
 @Accessors(chain = true)
@@ -27,15 +27,15 @@ public class HtTradeSettlement extends Model<HtTradeSettlement> implements Seria
 
 	// ---------- 模块常量 ----------
 	/**
-	 * 序列化版本id 
+	 * 序列化版本id
 	 */
-	private static final long serialVersionUID = 1L;	
+	private static final long serialVersionUID = 1L;
 	/**
-	 * 此模块对应的表名 
+	 * 此模块对应的表名
 	 */
-	public static final String TABLE_NAME = "ht_trade_settlement";	
+	public static final String TABLE_NAME = "ht_trade_settlement";
 	/**
-	 * 此模块对应的权限码 
+	 * 此模块对应的权限码
 	 */
 	public static final String PERMISSION_CODE = "ht-trade-settlement";
 	public static final String PERMISSION_CODE_ADD = "ht-trade-settlement-add";
@@ -47,7 +47,7 @@ public class HtTradeSettlement extends Model<HtTradeSettlement> implements Seria
 
 	// ---------- 表中字段 ----------
 	/**
-	 * 预申报编号 
+	 * 预申报编号
 	 */
 	@TableId(type = IdType.AUTO)
 	private Long id;
@@ -55,163 +55,163 @@ public class HtTradeSettlement extends Model<HtTradeSettlement> implements Seria
 	/**
 	 * 航通主键
 	 */
-	private String platSeqNo;	
+	private String platSeqNo;
 
 	/**
-	 * 申报单编号 
+	 * 申报单编号
 	 */
-	private String declareId;	
+	private String declareId;
 
 	/**
-	 * 1-边民,2-商铺业主或其代理人,3-合作社代表,4-互助组代表 
+	 * 1-边民,2-商铺业主或其代理人,3-合作社代表,4-互助组代表
 	 */
-	private String declareType;	
+	private String declareType;
 
 	/**
-	 * 申报人姓名 
+	 * 申报人姓名
 	 */
-	private String declareName;	
+	private String declareName;
 
 	/**
-	 * 身份证号码 
+	 * 身份证号码
 	 */
-	private String idno;	
+	private String idno;
 
 	/**
-	 * 商铺编码 
+	 * 商铺编码
 	 */
 	private String shopNo;
 
 
 	/**
-	 * 商铺名称 
+	 * 商铺名称
 	 */
-	private String shopName;	
+	private String shopName;
 
 	/**
-	 * 申报人类别为3、4 时互助组/合作社备案编号 
+	 * 申报人类别为3、4 时互助组/合作社备案编号
 	 */
-	private String orgPutrecNo;	
+	private String orgPutrecNo;
 
 	/**
-	 * 申报人类别为3、4 时互助组/合租社名称 
+	 * 申报人类别为3、4 时互助组/合租社名称
 	 */
-	private String orgName;	
+	private String orgName;
 
 	/**
-	 * 申报人类别为4 时边民合作社社会统一信用代码 
+	 * 申报人类别为4 时边民合作社社会统一信用代码
 	 */
-	private String orgScc;	
+	private String orgScc;
 
 	/**
-	 *  运输工具名称 
+	 *  运输工具名称
 	 */
-	private String veNo;	
+	private String veNo;
 
 	/**
-	 * 业务模式, 进出口标志为进口时,01 区内交易、02 落地加工、03 原装提离。进出口标 志 为 出 口时,04:直接出口,05:出口销售。 
+	 * 业务模式, 进出口标志为进口时,01 区内交易、02 落地加工、03 原装提离。进出口标 志 为 出 口时,04:直接出口,05:出口销售。
 	 */
-	private String btrnbBizModecd;	
+	private String btrnbBizModecd;
 
 	/**
-	 * 商品流向, 进出口标志为进口时,必填,01-二次销售;02-生活自用;03-落地加工; 
+	 * 商品流向, 进出口标志为进口时,必填,01-二次销售;02-生活自用;03-落地加工;
 	 */
 	@JsonProperty("gFlow")
-	private String gFlow;	
+	private String gFlow;
 
 	/**
-	 * 进出口标志:I进口 E 出口 
+	 * 进出口标志:I进口 E 出口
 	 */
 	@JsonProperty("iEFlag")
-	private String iEFlag;	
+	private String iEFlag;
 
 	/**
-	 * 监管场所编号 
+	 * 监管场所编号
 	 */
-	private String fieldCode;	
+	private String fieldCode;
 
 	/**
-	 * 监管场所名称 
+	 * 监管场所名称
 	 */
-	private String fieldName;	
+	private String fieldName;
 
 	/**
-	 * 申报口岸代码 
+	 * 申报口岸代码
 	 */
-	private String customsCode;	
+	private String customsCode;
 
 	/**
-	 * 1-是、0-否 
+	 * 1-是、0-否
 	 */
-	private String carPool;	
+	private String carPool;
 
 	/**
-	 * 总金额 
+	 * 总金额
 	 */
-	private Double sumAmt;	
+	private Double sumAmt;
 
 	/**
-	 * 总毛重 
+	 * 总毛重
 	 */
-	private Double sumGrossWt;	
+	private Double sumGrossWt;
 
 	/**
-	 * 总净重 
+	 * 总净重
 	 */
-	private Double sumNetWt;	
+	private Double sumNetWt;
 
 	/**
-	 * 运输方式 
+	 * 运输方式
 	 */
-	private String trafMode;	
+	private String trafMode;
 
 	/**
-	 * 币制 
+	 * 币制
 	 */
-	private String currCode;	
+	private String currCode;
 
 	/**
-	 * 件数,正整数 
+	 * 件数,正整数
 	 */
-	private Long packNo;	
+	private Long packNo;
 
 	/**
-	 * 申 报 时 间 :yyyy-MM-dd HH:mm:ss 
+	 * 申 报 时 间 :yyyy-MM-dd HH:mm:ss
 	 */
-	private String declTime;	
+	private String declTime;
 
 	/**
-	 * 提运单号 
+	 * 提运单号
 	 */
-	private String billNo;	
+	private String billNo;
 
 	/**
-	 * 运输工具航次(班)号 
+	 * 运输工具航次(班)号
 	 */
-	private String voyageNo;	
+	private String voyageNo;
 
 	/**
-	 * 商品名称,多个用英文逗号分割 
+	 * 商品名称,多个用英文逗号分割
 	 */
-	private String goodsNames;	
+	private String goodsNames;
 
 	/**
-	 * 购买边民列表[     { "platSeqNo": "进出境申报单预申报编号",        "borderName": "边民姓名", "idno": "身份证号",        "borderPutrecNo": "边民备案编号",        "settleBillNo": "结算单号", "buyAmount": "申报金额", "netWt": "净重", "grossWt": "毛重",        "buyQty": "申报数量", "buyQty1": "第一数量",        "buyQty2": "第二数量", "preIeportNo": "进出口预申报单号"     }] 
+	 * 购买边民列表[     { "platSeqNo": "进出境申报单预申报编号",        "borderName": "边民姓名", "idno": "身份证号",        "borderPutrecNo": "边民备案编号",        "settleBillNo": "结算单号", "buyAmount": "申报金额", "netWt": "净重", "grossWt": "毛重",        "buyQty": "申报数量", "buyQty1": "第一数量",        "buyQty2": "第二数量", "preIeportNo": "进出口预申报单号"     }]
 	 */
 	@JSONField(serialize = false)
-	private String bordersList;	
+	private String bordersList;
 
 	/**
-	 * 边民购买商品列表[     { "platSeqNo": "进出境申报单预申报编号",        "borderName": "边民姓名",        "idno": "身份证号",           "borderPutrecNo": "边民备案编号",        "buyAmount": "申报金额",        "netWt": "净重",          "grossWt": "毛重",        "buyQty": "申报数量",        "buyQty1": "第一数量",        "buyQty2": "第二数量",        "preIeportNo": "进出口预申报单号",        "codeTs": "商品编码",        "goodsName": "商品名称"      }] 
+	 * 边民购买商品列表[     { "platSeqNo": "进出境申报单预申报编号",        "borderName": "边民姓名",        "idno": "身份证号",           "borderPutrecNo": "边民备案编号",        "buyAmount": "申报金额",        "netWt": "净重",          "grossWt": "毛重",        "buyQty": "申报数量",        "buyQty1": "第一数量",        "buyQty2": "第二数量",        "preIeportNo": "进出口预申报单号",        "codeTs": "商品编码",        "goodsName": "商品名称"      }]
 	 */
 	@JSONField(serialize = false)
-	private String borderBuyGoodsList;	
+	private String borderBuyGoodsList;
 
 	/**
-	 * 商铺卖货物列表[       { "platSeqNo": "进出境申报单预申报编号",           "gNo": "预申报编号", "codeTs": "商品编码",           "gName": "商品名称", "gModel": "规格型号",           "storageEnvm": "储存条件:常温 1:冷藏,2:冷冻:3",            "useTo": "用途:01 食用、02 工业用、03 药用、04 种用、05 饲用、06 其他",           "grossWt": "毛重",            "netWt": "净重",            "originCountry": "产销国",            "gQty": "货物数量",            "qty1": "第一数量",            "qty2": "第二数量",            "gUnit": "计量单位",            "unit1": "第一计量单位",            "unit2": "第二计量单位",            "declPrice": "单价",            "declTotal": "总价"       }] 
+	 * 商铺卖货物列表[       { "platSeqNo": "进出境申报单预申报编号",           "gNo": "预申报编号", "codeTs": "商品编码",           "gName": "商品名称", "gModel": "规格型号",           "storageEnvm": "储存条件:常温 1:冷藏,2:冷冻:3",            "useTo": "用途:01 食用、02 工业用、03 药用、04 种用、05 饲用、06 其他",           "grossWt": "毛重",            "netWt": "净重",            "originCountry": "产销国",            "gQty": "货物数量",            "qty1": "第一数量",            "qty2": "第二数量",            "gUnit": "计量单位",            "unit1": "第一计量单位",            "unit2": "第二计量单位",            "declPrice": "单价",            "declTotal": "总价"       }]
 	 */
 	@JSONField(serialize = false)
-	private String sellGoodsList;	
+	private String sellGoodsList;
 
 
 	/**
@@ -238,4 +238,14 @@ public class HtTradeSettlement extends Model<HtTradeSettlement> implements Seria
 	 */
 	private BigDecimal totalPrice=BigDecimal.ZERO;
 
+	/**
+	 * 查验结果[1=查验通过 2=查验不通过]
+	 */
+	private Integer checkPassStatus=1;
+
+	/**
+	 * 查验时间(不通过)
+	 */
+	private Date checkPassTime;
+
 }

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

@@ -148,6 +148,9 @@ public class HtTradeSettlementService extends ServiceImpl<HtTradeSettlementMappe
                     tbOrder.setGoodsId(tbGoods.getId());
                     tbOrder.setGoodsNames(tbGoods.getName());
                     tbOrder.setGoodsUnit(tbGoods.getUnit());
+
+                    tbOrder.setBuyQty(collect.get(0).getBuyQty());
+                    tbOrder.setGrossWt(collect.get(0).getGrossWt());
                 }
             }
             //根据身份证查询边民

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

@@ -322,6 +322,16 @@ public class TbOrder extends Model<TbOrder> implements Serializable {
 	private String applyFailReason;
 
 	/**
+	 * 查验结果[1=查验通过 2=查验不通过]
+	 */
+	private Integer checkPassStatus=1;
+
+	/**
+	 * 查验时间(不通过)
+	 */
+	private Date checkPassTime;
+
+	/**
 	 * 边民确认
 	 */
 	private Integer peopleConfirmStatus=0;

+ 7 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderAppController.java

@@ -135,6 +135,13 @@ public class TbOrderAppController {
 	/*-----           正常业务逻辑👆👆    rpc远程调用👇👇 -----*/
 
 	/** 查询当天的下单记录 */
+	@PostMapping("rpc/confirmOrderFromBank")
+	public boolean confirmOrderFromBank(@RequestParam("tradeNo")String tradeNo) {
+		boolean result = tbOrderService.confirmOrderFromBank(tradeNo);
+		return result;
+	}
+
+	/** 查询当天的下单记录 */
 	@RequestMapping("rpc/selectOrderList")
 	public List<OrderDto> selectOrderList( @RequestParam("appUserId") Long appUserId) {
 		List<OrderDto> orderDtos = tbOrderService.selectOrderList(appUserId);

+ 8 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderController.java

@@ -2,6 +2,7 @@ package com.pj.tb_order;
 
 import java.util.List;
 
+import com.pj.api.dto.HtDeclareChargebackDto;
 import com.pj.api.dto.HtPassCardDTO;
 import com.pj.current.mybatis.DataScope;
 import com.pj.utils.so.SoMap;
@@ -83,6 +84,13 @@ public class TbOrderController {
 
 	/*-----           正常业务逻辑👆👆    rpc远程调用👇👇 -----*/
 
+
+	/** 系统接收到航通接口信息:进出口申报单退单 **/
+	@RequestMapping("rpc/chargeback")
+	public boolean chargeback(HtDeclareChargebackDto htDeclareChargebackDto) {
+		return tbOrderService.chargeback(htDeclareChargebackDto);
+	}
+
 	/** 系统接收到航通接口信息:车辆已出一级市场 ,相对应的一级市场订单状态修改 **/
 	@RequestMapping("rpc/orderFinish")
 	public boolean orderFinish(HtPassCardDTO htPassCardDTO) {

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

@@ -1,5 +1,6 @@
 package com.pj.tb_order;
 
+import java.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -9,6 +10,8 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
 import com.pj.api.client.admin.AdminInterface;
 import com.pj.api.client.async_server.AsyncServerInterface;
 import com.pj.api.client.level_one_server.LevelOneServerInterface;
+import com.pj.api.client.level_two_server.LevelTwoServerInterface;
+import com.pj.api.client.payment_server.PaymentServerInterface;
 import com.pj.api.consts.FeignFactory;
 import com.pj.api.dto.*;
 import com.pj.common.core.exception.ServiceException;
@@ -31,6 +34,8 @@ import com.pj.tb_order_people_confirm.TbOrderPeopleConfirmMapper;
 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;
 import com.pj.utils.sg.AjaxError;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.BeanUtils;
@@ -56,7 +61,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
      * 底层 Mapper 对象
      */
     @Autowired
-    TbOrderMapper tbOrderMapper;
+    private TbOrderMapper tbOrderMapper;
 
     /**
      * 互市组
@@ -64,7 +69,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
     @Autowired
     private TbPeopleService tbPeopleService;
     @Autowired
-    TbOrderPeopleConfirmMapper tbOrderPeopleConfirmMapper;
+    private TbOrderPeopleConfirmMapper tbOrderPeopleConfirmMapper;
     @Autowired
     private MethodOrderService methodOrderService;
 
@@ -75,14 +80,19 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
     @Autowired
     private LevelOneServerInterface levelOneServerInterface;
     @Autowired
+    private LevelTwoServerInterface levelTwoServerInterface;
+    @Autowired
     private TbEnterpriseMapper tbEnterpriseMapper;
     @Autowired
     private AsyncServerInterface asyncServerInterface;
     @Autowired
     private TbPeopleMapper tbPeopleMapper;
-
+    @Autowired
+    private TbShopService tbShopService;
     @Resource
     private HtTradeSettlementService htTradeSettlementService;
+    @Autowired
+    private PaymentServerInterface paymentServerInterface;
 
     /**
      * 远程调用
@@ -380,9 +390,40 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
         return tbOrderMapper.getConfirmStatus(orderId);
     }
 
+    public PaymentDto getPaymentData(TbOrder tbOrder) {
+        HtTradeSettlement htTradeSettlement = htTradeSettlementService.getById(tbOrder.getSaleMainId());
+        PaymentDto paymentDto = new PaymentDto();
+        BeanUtils.copyProperties(htTradeSettlement, paymentDto);
+
+        paymentDto.setTradeNo(tbOrder.getTradeNo());
+        paymentDto.setBuyQty(tbOrder.getBuyQty());
+        paymentDto.setGrossWt(tbOrder.getGrossWt());
+        paymentDto.setGoodsName(tbOrder.getGoodsNames());
+        paymentDto.setGoodsUnit(tbOrder.getGoodsUnit());
+
+        paymentDto.setTotalPrice(BigDecimal.valueOf(tbOrder.getTotalPrice()));
+        Double resalePrice = levelTwoServerInterface.getResalePriceByLevelOneOrderId(tbOrder.getId());
+        paymentDto.setResalePrice(BigDecimal.valueOf(resalePrice));
+
+        TbPeople tbPeople = tbPeopleService.getById(tbOrder.getBuyUserId());
+        paymentDto.setBankCode(tbPeople.getBankCode());
+        paymentDto.setBankName(tbPeople.getBankName());
+        paymentDto.setBorderName(tbPeople.getName());
+        paymentDto.setBorderidno(tbPeople.getIdCard());
+        paymentDto.setBorderTel(tbPeople.getPhone());
+
+        TbShop tbShop = tbShopService.findByCode(htTradeSettlement.getShopNo());
+        paymentDto.setOwnerName(tbShop.getOwnerName());
+        paymentDto.setOwnerIdtype(tbShop.getOwnerIdtype());
+        paymentDto.setBankAccount(tbShop.getBankAccount());
+        paymentDto.setBank(tbShop.getBank());
+        paymentDto.setOwnerTel(tbShop.getOwnerTel());
+
+        return paymentDto;
+    }
+
     /**
      * 边民订单确认
-     *
      * @param orderId 一级市场订单表ID
      */
     public boolean confirmOrder(Long orderId) {
@@ -390,8 +431,29 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
         if (tbOrder == null) {
             throw new AjaxError("订单不存在");
         }
+        tbOrder.setPeopleConfirmTime(new Date())
+                .setPeopleConfirmStatus(ConfirmStatus.CONFIRM_STATUS_ONE.getCode())
+                .setUpdateTime(new Date());
+        boolean update = super.updateById(tbOrder);
         // TODO: 2023/8/28 边民发起支付申请,调用银行接口:验证边民支付信息,将货款先存入银行第三方账户,并给出回执
-        // 银行返回支付回执为"交易成功"时,方法往下执行
+        PaymentDto paymentDto = this.getPaymentData(tbOrder);
+        paymentServerInterface.sendSXB010(paymentDto);
+
+       return update;
+    }
+
+    /**
+     * 边民订单确认-收到银行扣款成功回执
+     * @param tradeNo 一级市场边民订单-订单编号
+     */
+    public boolean confirmOrderFromBank(String tradeNo) {
+        LambdaQueryWrapper<TbOrder> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(TbOrder::getTradeNo, tradeNo);
+        List<TbOrder> tbOrderList = this.list(wrapper);
+        if (tbOrderList.size() <= 0) {
+            throw new AjaxError("订单不存在");
+        }
+        TbOrder tbOrder = tbOrderList.get(0);
         // TODO: 2023/8/29 更新状态保存交易记录
         tbOrder.setPeopleConfirmTime(new Date())
                 .setPeopleConfirmStatus(ConfirmStatus.CONFIRM_STATUS_ONE.getCode())
@@ -402,9 +464,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
             //当declareType为边民时,不需要走后续两个确认,订单状态改为已完成
             tbOrder.setFinishStatus(FinishStatus.FINISH_STATUS_ONE.getCode());
         }
-       return super.updateById(tbOrder);
-
-
+        return super.updateById(tbOrder);
     }
 
     /**
@@ -518,8 +578,45 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
 
     /*-----           正常业务逻辑👆👆    rpc远程调用👇👇 -----*/
 
+    //进出口申报单退单-逻辑处理
+    public boolean chargeback(HtDeclareChargebackDto htDeclareChargebackDto) {
+        //查询出被退单的所有边民订单
+        LambdaQueryWrapper<TbOrder> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(TbOrder::getTradeAreaId, htDeclareChargebackDto.getFieldCode());
+        wrapper.eq(TbOrder::getPreNo, htDeclareChargebackDto.getBillNo());
+        List<TbOrder> tbOrderList = this.list(wrapper);
+
+        if (tbOrderList.size() <= 0) {
+            return false;
+        }
+        // TODO: 2023/11/27 查验不通过,车辆不通过卡3,调用银行退款划扣申请,从银行第三方账户,退回至边民借记卡账户
+        tbOrderList.forEach(order -> {
+            PaymentDto paymentDto = this.getPaymentData(order);
+            paymentServerInterface.sendSXB013(paymentDto);
+        });
+
+        //修改交易结算单(大订单)的查验结果
+        LambdaUpdateWrapper<HtTradeSettlement> updateWrapper = new LambdaUpdateWrapper<>();
+        updateWrapper.set(HtTradeSettlement::getCheckPassStatus, 2);//查验结果[1=查验通过 2=查验不通过]
+        updateWrapper.set(HtTradeSettlement::getCheckPassTime, new Date());//查验时间(不通过)
+        updateWrapper.eq(HtTradeSettlement::getFieldCode, htDeclareChargebackDto.getFieldCode());
+        updateWrapper.eq(HtTradeSettlement::getDeclareId, htDeclareChargebackDto.getDeclareId());
+        boolean update = htTradeSettlementService.update(updateWrapper);
+
+        //修改边民订单的查验结果
+        LambdaUpdateWrapper<TbOrder> updateWrapper1 = new LambdaUpdateWrapper<>();
+        updateWrapper1.set(TbOrder::getCheckPassStatus, 2);//查验结果[1=查验通过 2=查验不通过]
+        updateWrapper1.set(TbOrder::getCheckPassTime, new Date());//查验时间(不通过)
+        updateWrapper1.eq(TbOrder::getTradeAreaId, htDeclareChargebackDto.getFieldCode());
+        updateWrapper1.eq(TbOrder::getPreNo, htDeclareChargebackDto.getBillNo());
+        boolean update1 = this.update(updateWrapper1);
+
+        return update && update1;
+    }
+
 
-    // TODO: 2023/8/28 系统接收到航通接口信息:车辆已出一级市场
+    /** TODO: 2023/8/28 系统接收到航通接口信息:车辆已出一级市场
+       (系统接收到这个信息时,证明已经查验通过,不会有进出口申报单退单)*/
     public boolean orderFinish(HtPassCardDTO htPassCardDTO) {
         String billCode = htPassCardDTO.getBillCode();
         //1、todo: 调用银行接口发起划扣:将边民划扣至银行第三方账户的货款,支付至外籍商户的账户

+ 13 - 0
sp-service/level-two-server/src/main/java/com/pj/tb_orders/TbOrdersApiController.java

@@ -1,6 +1,7 @@
 package com.pj.tb_orders;
 
 import cn.dev33.satoken.annotation.SaCheckPermission;
+import com.pj.api.dto.OrderDto;
 import com.pj.project4sp.SP;
 import com.pj.tb_goods_demand.vo.GoodsDemandVo;
 import com.pj.utils.sg.AjaxJson;
@@ -140,4 +141,16 @@ public class TbOrdersApiController {
 	public AjaxJson updateResalePrice(TbOrders tbOrders) {
 		return AjaxJson.toAjax(tbOrdersService.updateResalePrice(tbOrders));
 	}
+
+
+	/** 查 - 根据一级市场订单id查二级市场的转售金额 */
+	@RequestMapping("rpc/getResalePriceByLevelOneOrderId")
+	public Double getResalePriceByLevelOneOrderId(@RequestParam("orderId") Long orderId){
+		SoMap so = new SoMap();
+		so.put("levelOneOrderId",orderId);
+		TbOrders orders = tbOrdersService.getByLevelOneOrderId(so);
+		Double resalePrice = orders.getResalePrice();
+		return resalePrice;
+	}
+
 }

+ 44 - 0
sp-service/payment-server/pom.xml

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>sp-service</artifactId>
+        <groupId>com.pj</groupId>
+        <version>0.0.1-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>async-server</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <properties>
+        <java.version>1.8</java.version>
+        <java.run.main.class>com.pj.PaymentServerApplication</java.run.main.class>
+    </properties>
+    <dependencies>
+
+        <!-- 依赖base基础包 -->
+        <dependency>
+            <groupId>com.pj</groupId>
+            <artifactId>sp-base</artifactId>
+            <version>${project.parent.version}</version>
+        </dependency>
+
+
+        <!-- rabbitmq 依赖 -->
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-amqp</artifactId>
+        </dependency>
+
+        <!-- mq的消息转换器 -->
+        <dependency>
+            <groupId>com.fasterxml.jackson.dataformat</groupId>
+            <artifactId>jackson-dataformat-xml</artifactId>
+            <version>2.9.10</version>
+        </dependency>
+
+
+    </dependencies>
+
+
+</project>

+ 45 - 0
sp-service/payment-server/src/main/java/com/pj/PaymentServerApplication.java

@@ -0,0 +1,45 @@
+package com.pj;
+
+import com.pj.current.SpCloudUtil;
+import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
+import org.springframework.amqp.support.converter.MessageConverter;
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.boot.context.ApplicationPidFileWriter;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.cloud.openfeign.EnableFeignClients;
+import org.springframework.context.annotation.Bean;
+import org.springframework.retry.annotation.EnableRetry;
+import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+import java.io.File;
+import java.util.Properties;
+
+@EnableCaching // 启用缓存
+@EnableScheduling // 启动定时任务
+@SpringBootApplication // springboot本尊
+@EnableTransactionManagement // 启动注解事务管理
+@EnableFeignClients        // 启用Feign实现RPC调用
+@EnableRetry   // 开启失败重试机制
+public class PaymentServerApplication {
+
+    public static void main(String[] args) {
+        Properties properties = System.getProperties();
+        String rootPath = properties.getProperty("user.dir");
+        SpringApplication application = new SpringApplication(PaymentServerApplication.class);
+        application.addListeners(new ApplicationPidFileWriter(rootPath + File.separator + "app.pid"));
+        application.run(args);
+        SpCloudUtil.printCurrentServiceInfo();
+    }
+
+    /**
+     * rabbitMQ 的消息转换器
+     * @return
+     */
+    @Bean
+    public MessageConverter jsonMessageConverter(){
+        return new Jackson2JsonMessageConverter();
+    }
+
+}

+ 81 - 0
sp-service/payment-server/src/main/java/com/pj/bank_byte/BankByte.java

@@ -0,0 +1,81 @@
+package com.pj.bank_byte;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: bank_byte -- 银行回执信息字节码表
+ * @author lbl
+ */
+@Data
+@Accessors(chain = true)
+@TableName(BankByte.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class BankByte extends Model<BankByte> implements Serializable {
+	public BankByte(String messageId, String body, String queueName, Integer finishStatus, Date createTime) {
+		this.messageId = messageId;
+		this.body = body;
+		this.queueName = queueName;
+		this.finishStatus = finishStatus;
+		this.createTime = createTime;
+	}
+// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id
+	 */
+	private static final long serialVersionUID = 1L;
+	/**
+	 * 此模块对应的表名
+	 */
+	public static final String TABLE_NAME = "bank_byte";
+	/**
+	 * 此模块对应的权限码
+	 */
+	public static final String PERMISSION_CODE = "bank-byte";
+	public static final String PERMISSION_CODE_ADD = "bank-byte-add";
+	public static final String PERMISSION_CODE_EDIT = "bank-byte-edit";
+	public static final String PERMISSION_CODE_DEL = "bank-byte-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 字节表主键
+	 */
+	@TableId(type = IdType.AUTO)
+	private Integer id;
+
+	/**
+	 * mq消息主键
+	 */
+	private String messageId;
+
+	/**
+	 * 字节数据主体
+	 */
+	private String body;
+
+	/**
+	 * mq队列名称
+	 */
+	private String queueName;
+
+	/**
+	 * 完成对象转换状态
+	 */
+	private Integer finishStatus;
+
+	/**
+	 * 创建时间
+	 */
+	private Date createTime;
+
+}

+ 87 - 0
sp-service/payment-server/src/main/java/com/pj/bank_byte/BankByteController.java

@@ -0,0 +1,87 @@
+package com.pj.bank_byte;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: bank_byte -- 银行回执信息字节码表
+ * @author lbl
+ */
+@RestController
+@RequestMapping("/BankByte/")
+public class BankByteController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	BankByteService bankByteService;
+
+	/** 增 */
+	@RequestMapping("add")
+	@SaCheckPermission(BankByte.PERMISSION_CODE_ADD)
+	public AjaxJson add(BankByte b){
+		bankByteService.add(b);
+		b = bankByteService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(b);
+	}
+
+	/** 删 */
+	@RequestMapping("delete")
+	@SaCheckPermission(BankByte.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 bankByteService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 删 - 根据id列表 */
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(BankByte.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+		int line = SP.publicMapper.deleteByIds(BankByte.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+
+	/** 改 */
+	@RequestMapping("update")
+	@SaCheckPermission(BankByte.PERMISSION_CODE_EDIT)
+	public AjaxJson update(BankByte b){
+		bankByteService.update(b);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */
+	@RequestMapping("getById")
+		@SaCheckPermission(BankByte.PERMISSION_CODE)
+	public AjaxJson getById(Integer id){
+		BankByte b = bankByteService.getById(id);
+		return AjaxJson.getSuccessData(b);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	@RequestMapping("getList")
+		@SaCheckPermission(BankByte.PERMISSION_CODE)
+	public AjaxJson getList() {
+		SoMap so = SoMap.getRequestSoMap();
+		List<BankByte> list = bankByteService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+
+
+
+
+
+
+
+
+
+}

+ 30 - 0
sp-service/payment-server/src/main/java/com/pj/bank_byte/BankByteMapper.java

@@ -0,0 +1,30 @@
+package com.pj.bank_byte;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: bank_byte -- 银行回执信息字节码表
+ * @author lbl 
+ */
+
+@Mapper
+@Repository
+public interface BankByteMapper extends BaseMapper <BankByte> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<BankByte> getList(SoMap so);
+
+
+}

+ 53 - 0
sp-service/payment-server/src/main/java/com/pj/bank_byte/BankByteMapper.xml

@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pj.bank_byte.BankByteMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, message_id, body, queue_name, finish_status, create_time from bank_byte  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.bank_byte.BankByte"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from bank_byte 
+	</sql>
+
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("messageId") '> and message_id = #{messageId} </if>
+			<if test=' this.has("body") '> and body = #{body} </if>
+			<if test=' this.has("queueName") '> and queue_name = #{queueName} </if>
+			<if test=' this.has("finishStatus") '> and finish_status = #{finishStatus} </if>
+			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> message_id desc </when>
+			<when test='sortType == 3'> body desc </when>
+			<when test='sortType == 4'> queue_name desc </when>
+			<when test='sortType == 5'> finish_status desc </when>
+			<when test='sortType == 6'> create_time desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 51 - 0
sp-service/payment-server/src/main/java/com/pj/bank_byte/BankByteService.java

@@ -0,0 +1,51 @@
+package com.pj.bank_byte;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+import com.pj.utils.sg.*;
+
+/**
+ * Service: bank_byte -- 银行回执信息字节码表
+ * @author lbl
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class BankByteService extends ServiceImpl<BankByteMapper, BankByte> implements IService<BankByte>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	BankByteMapper bankByteMapper;
+
+	/** 增 */
+	void add(BankByte t){
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(BankByte b){
+		updateById(b);
+
+	}
+
+	/** 查 */
+	BankByte getById(Integer id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	List<BankByte> getList(SoMap so) {
+		return bankByteMapper.getList(so);
+	}
+
+
+}

+ 116 - 0
sp-service/payment-server/src/main/java/com/pj/bank_info/BankInfo.java

@@ -0,0 +1,116 @@
+package com.pj.bank_info;
+
+import java.io.Serializable;
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: bank_info -- 银行回执信息表
+ * @author lbl
+ */
+@Data
+@Accessors(chain = true)
+@TableName(BankInfo.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class BankInfo extends Model<BankInfo> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id
+	 */
+	private static final long serialVersionUID = 1L;
+	/**
+	 * 此模块对应的表名
+	 */
+	public static final String TABLE_NAME = "bank_info";
+	/**
+	 * 此模块对应的权限码
+	 */
+	public static final String PERMISSION_CODE = "bank-info";
+	public static final String PERMISSION_CODE_ADD = "bank-info-add";
+	public static final String PERMISSION_CODE_EDIT = "bank-info-edit";
+	public static final String PERMISSION_CODE_DEL = "bank-info-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键
+	 */
+	@TableId(type = IdType.AUTO)
+	private Integer id;
+
+	/**---------------------------- 以下字段为:银行回执-headers-头部字段 ---------------------**/
+
+	/**
+	 * 报文编号
+	 */
+	private String sn;
+
+	/**
+	 * 报文发送时间
+	 */
+	private String date;
+
+	/**
+	 * 互市点机构代码
+	 */
+	private String organization;
+
+	/**
+	 * 银行标识
+	 */
+	private String bankCode;
+
+	/**
+	 * 报文业务类型
+	 */
+	private String operation;
+
+
+
+
+	/**---------------------------- 以下字段为:银行回执-payload-responseDTO字段 ---------------------**/
+
+	/**
+	 * 消息回执代码
+	 */
+	private String code;
+
+	/**
+	 * 订单号
+	 */
+	private String source;
+
+	/**
+	 * 扣款成功的流水单号
+	 */
+	private String result;
+
+	/**
+	 * 回执内容
+	 */
+	private String note;
+
+
+
+
+
+	/**
+	 * 创建时间
+	 */
+	private String createTime;
+
+
+
+
+
+
+
+
+}

+ 87 - 0
sp-service/payment-server/src/main/java/com/pj/bank_info/BankInfoController.java

@@ -0,0 +1,87 @@
+package com.pj.bank_info;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: bank_info -- 银行回执信息表
+ * @author lbl
+ */
+@RestController
+@RequestMapping("/BankInfo/")
+public class BankInfoController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	BankInfoService bankInfoService;
+
+	/** 增 */
+	@RequestMapping("add")
+	@SaCheckPermission(BankInfo.PERMISSION_CODE_ADD)
+	public AjaxJson add(BankInfo b){
+		bankInfoService.add(b);
+		b = bankInfoService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(b);
+	}
+
+	/** 删 */
+	@RequestMapping("delete")
+	@SaCheckPermission(BankInfo.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 bankInfoService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 删 - 根据id列表 */
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(BankInfo.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
+		int line = SP.publicMapper.deleteByIds(BankInfo.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+
+	/** 改 */
+	@RequestMapping("update")
+	@SaCheckPermission(BankInfo.PERMISSION_CODE_EDIT)
+	public AjaxJson update(BankInfo b){
+		bankInfoService.update(b);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */
+	@RequestMapping("getById")
+		@SaCheckPermission(BankInfo.PERMISSION_CODE)
+	public AjaxJson getById(Integer id){
+		BankInfo b = bankInfoService.getById(id);
+		return AjaxJson.getSuccessData(b);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	@RequestMapping("getList")
+		@SaCheckPermission(BankInfo.PERMISSION_CODE)
+	public AjaxJson getList() {
+		SoMap so = SoMap.getRequestSoMap();
+		List<BankInfo> list = bankInfoService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+
+
+
+
+
+
+
+
+
+}

+ 30 - 0
sp-service/payment-server/src/main/java/com/pj/bank_info/BankInfoMapper.java

@@ -0,0 +1,30 @@
+package com.pj.bank_info;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: bank_info -- 银行回执信息表
+ * @author lbl 
+ */
+
+@Mapper
+@Repository
+public interface BankInfoMapper extends BaseMapper <BankInfo> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<BankInfo> getList(SoMap so);
+
+
+}

+ 63 - 0
sp-service/payment-server/src/main/java/com/pj/bank_info/BankInfoMapper.xml

@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.pj.bank_info.BankInfoMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, sn, date, organization, bankCode, operation, code, source, result, note, create_time from bank_info  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.bank_info.BankInfo"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select * 
+		from bank_info 
+	</sql>
+
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("sn") '> and sn = #{sn} </if>
+			<if test=' this.has("date") '> and date = #{date} </if>
+			<if test=' this.has("organization") '> and organization = #{organization} </if>
+			<if test=' this.has("bankCode") '> and bankCode = #{bankCode} </if>
+			<if test=' this.has("operation") '> and operation = #{operation} </if>
+			<if test=' this.has("code") '> and code = #{code} </if>
+			<if test=' this.has("source") '> and source = #{source} </if>
+			<if test=' this.has("result") '> and result = #{result} </if>
+			<if test=' this.has("note") '> and note = #{note} </if>
+			<if test=' this.has("createTime") '> and create_time = #{createTime} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> sn desc </when>
+			<when test='sortType == 3'> date desc </when>
+			<when test='sortType == 4'> organization desc </when>
+			<when test='sortType == 5'> bankCode desc </when>
+			<when test='sortType == 6'> operation desc </when>
+			<when test='sortType == 7'> code desc </when>
+			<when test='sortType == 8'> source desc </when>
+			<when test='sortType == 9'> result desc </when>
+			<when test='sortType == 10'> note desc </when>
+			<when test='sortType == 11'> create_time desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 51 - 0
sp-service/payment-server/src/main/java/com/pj/bank_info/BankInfoService.java

@@ -0,0 +1,51 @@
+package com.pj.bank_info;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.transaction.annotation.Transactional;
+import com.pj.utils.sg.*;
+
+/**
+ * Service: bank_info -- 银行回执信息表
+ * @author lbl
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class BankInfoService extends ServiceImpl<BankInfoMapper, BankInfo> implements IService<BankInfo>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	BankInfoMapper bankInfoMapper;
+
+	/** 增 */
+	void add(BankInfo t){
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(BankInfo b){
+		updateById(b);
+
+	}
+
+	/** 查 */
+	BankInfo getById(Integer id){
+		return super.getById(id);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	List<BankInfo> getList(SoMap so) {
+		return bankInfoMapper.getList(so);
+	}
+
+
+}

+ 26 - 0
sp-service/payment-server/src/main/java/com/pj/dto/DataDto.java

@@ -0,0 +1,26 @@
+package com.pj.dto;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+public class DataDto implements Serializable {
+
+    /**
+     *  报文生成时间
+     */
+    @JsonProperty("msgTime")
+    private String msgTime;
+
+    /**
+     * 报文内容密文
+     */
+    @JsonProperty("data")
+    private String data;
+}

+ 61 - 0
sp-service/payment-server/src/main/java/com/pj/listen/BaseInfoListen.java

@@ -0,0 +1,61 @@
+package com.pj.listen;
+
+import cn.hutool.core.util.RandomUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.pj.bank_byte.BankByte;
+import com.pj.bank_byte.BankByteMapper;
+import com.pj.dto.DataDto;
+import com.pj.enummj.FinishStatus;
+import com.pj.rabbitmq.RabbitMQ;
+import com.pj.utils.ht.AESUtil;
+import org.springframework.amqp.core.Message;
+import org.springframework.amqp.rabbit.annotation.Queue;
+import org.springframework.amqp.rabbit.annotation.RabbitListener;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * @Author Mechrevo
+ * @Date 2023 08 25 12 30
+ **/
+@Component
+public class BaseInfoListen {
+
+
+    @Autowired
+    private BankByteMapper bankByteMapper;
+
+    /**
+     * 监听: 接收并保存银行回执信息
+     * @param json
+     */
+    @RabbitListener(queuesToDeclare = @Queue(RabbitMQ.TEST_ACCEPT_QUEUE))
+    public void accept(Message json){
+        System.out.println("-----------------开始接收:银行回执信息------------------------");
+        byte[] content = json.getBody();
+        //保存到数据库
+        String jsonString = new String(content);
+        bankByteMapper.insert(new BankByte(RandomUtil.randomString(64),jsonString,RabbitMQ.TEST_ACCEPT_QUEUE, FinishStatus.FINISH_STATUS_ZERO.getCode(),new Date()));
+        System.out.println("-----------------完成接收:银行回执信息------------------------");
+
+    }
+
+
+    /**
+     * 测试接收
+     * 测试已通过
+     */
+    @RabbitListener(queuesToDeclare = @Queue(RabbitMQ.TEST_SEND_QUEUE))
+    public void sendMessage(Message dataDto1){
+        System.out.println("---------开始发送:银行接口报文-----------------");
+        byte[] body = dataDto1.getBody();
+        String s = new String(body);
+        DataDto dataDto = JSONObject.parseObject(s, DataDto.class);
+        String cbc = AESUtil.decryptCBC(dataDto.getData(), RabbitMQ.ACC_KEY);
+        //OrderDto orderDto = JSONObject.parseObject(cbc, OrderDto.class);
+        System.out.println(cbc + "\n---------结束发送:银行接口报文-----------------");
+    }
+
+}

+ 40 - 0
sp-service/payment-server/src/main/java/com/pj/rabbitmq/RabbitMQ.java

@@ -0,0 +1,40 @@
+package com.pj.rabbitmq;
+
+/**
+ * MQ的基本配置
+ * @Author Mechrevo
+ * @Date 2023 08 25 12 14
+ **/
+public class RabbitMQ {
+
+
+    public static final String ACC_KEY = "klfksd78974s1d4f";
+
+
+    /**
+     *  发送方队列
+     */
+    public static final String TEST_SEND_QUEUE = "testAccept";
+
+    /**
+     *  发送方路由键
+     */
+    public static final String TEST_SEND_ROUTING_KEY = "testAcceptKey";
+
+    /**
+     *  接收方队列
+     */
+    public static final String TEST_ACCEPT_QUEUE = "testSend";
+
+    /**
+     *  接收方路由键
+     */
+    public static final String TEST_ACCEPT_ROUTING_KEY = "testSendKey";
+
+
+    /**
+     *  发送方MQ交换机名称
+     */
+    public static final String MQ_DIRECT_EXCHANGE = "test_exchange";
+
+}

+ 84 - 0
sp-service/payment-server/src/main/java/com/pj/rabbitmq/RabbitmqConfig.java

@@ -0,0 +1,84 @@
+package com.pj.rabbitmq;
+
+import org.springframework.amqp.core.Binding;
+import org.springframework.amqp.core.BindingBuilder;
+import org.springframework.amqp.core.DirectExchange;
+import org.springframework.amqp.core.Queue;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+
+
+
+/**
+ * @Author Mechrevo
+ * @Date 2023 08 25 12 21
+ **/
+@Configuration
+public class RabbitmqConfig {
+//
+//
+//    @Value("${spring.rabbitmq.host}")
+//    private String host;
+//
+//    @Value("${spring.rabbitmq.port}")
+//    private int port;
+//
+//    @Value("${spring.rabbitmq.username}")
+//    private String username;
+//
+//    @Value("${spring.rabbitmq.password}")
+//    private String password;
+//
+//    @Value("${spring.rabbitmq.virtual-host}")
+//    private String virtualHost;
+
+
+
+    /**
+     * 发送时的mq队列
+     * @return
+     */
+    @Bean
+    public Queue testSend(){
+        return new Queue(RabbitMQ.TEST_SEND_QUEUE,true);
+    }
+
+    /**
+     * 接收时的mq队列
+     * @return
+     */
+    @Bean
+    public Queue testAccept(){
+        return new Queue(RabbitMQ.TEST_ACCEPT_QUEUE,true);
+    }
+
+    /**
+     * 交换机
+     * @return
+     */
+    @Bean
+    public DirectExchange directExchange(){
+        return new DirectExchange(RabbitMQ.MQ_DIRECT_EXCHANGE,true,false);
+    }
+
+    /**
+     * 绑定
+     * 发送
+     */
+    @Bean
+    public Binding bindingSend(){
+        return BindingBuilder.bind(testSend()).to(directExchange()).with(RabbitMQ.TEST_SEND_ROUTING_KEY);
+    }
+
+    /**
+     * 绑定
+     * 接收
+     */
+    @Bean
+    public Binding bindingAccept(){
+        return BindingBuilder.bind(testAccept()).to(directExchange()).with(RabbitMQ.TEST_ACCEPT_ROUTING_KEY);
+    }
+
+}

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

@@ -0,0 +1,280 @@
+package com.pj.task;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.pj.api.client.level_one_server.LevelOneServerInterface;
+import com.pj.bank_byte.BankByte;
+import com.pj.bank_byte.BankByteMapper;
+import com.pj.bank_info.BankInfo;
+import com.pj.bank_info.BankInfoMapper;
+import com.pj.dto.HeadersDto;
+import com.pj.common.core.utils.StringUtils;
+import com.pj.dto.PayLoadDto;
+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;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.transaction.annotation.Transactional;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import java.io.IOException;
+import java.io.StringReader;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+@Configuration
+@EnableScheduling
+@Transactional(rollbackFor = Exception.class)
+public class BankByteTask {
+
+    /**
+     * 银行回执字节码mapper
+     */
+    @Autowired
+    private BankByteMapper bankByteMapper;
+    /**
+     * 银行回执信息mapper
+     */
+    @Autowired
+    private BankInfoMapper bankInfoMapper;
+
+    @Autowired
+    private LevelOneServerInterface levelOneServerInterface;
+
+    /**
+     * 启动定时任务
+     */
+    @Scheduled(cron = "*/10 * * * * ?")  // 每10秒扫描一次
+    private void bankByteTask() {
+
+        //扫描表内是否有待处理任务
+        List<BankByte> byteList = bankByteMapper.selectList(
+                new LambdaQueryWrapper<BankByte>().eq(BankByte::getFinishStatus, FinishStatus.FINISH_STATUS_ZERO.getCode()).orderByAsc(BankByte::getCreateTime));
+        //判断是否有任务,没有则返回
+        if (byteList.size() == 0) {
+            System.err.println("\n  ---  暂无待处理【银行回执信息】。" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) + "\n");
+            return;
+        }
+        //执行任务处理流程
+        byteList.forEach(item -> {
+            String body = item.getBody();
+            //数据解析
+            String xmlStr = AESUtil.decryptCBC(body, RabbitMQ.ACC_KEY);
+
+            BankInfo bankInfo = new BankInfo();
+
+            //银行回执——headers——获取头部字段
+            String headersStr = xmlStr.substring(xmlStr.indexOf("<headers>")+9, xmlStr.indexOf("</headers>"));
+            String[] headersSplit = headersStr.split("</item>");
+            for (String s : headersSplit) {
+                if(StringUtils.containsIgnoreCase(s,"sn")) {
+                    String substring = s.substring(s.indexOf("<value>")+7, s.indexOf("</value>"));
+                    bankInfo.setSn(substring);
+                }
+                if(StringUtils.containsIgnoreCase(s,"date")) {
+                    String substring = s.substring(s.indexOf("<value>")+7, s.indexOf("</value>"));
+                    bankInfo.setDate(substring);
+                }
+                if(StringUtils.containsIgnoreCase(s,"organization")) {
+                    String substring = s.substring(s.indexOf("<value>")+7, s.indexOf("</value>"));
+                    bankInfo.setOrganization(substring);
+                }
+                if(StringUtils.containsIgnoreCase(s,"bankCode")) {
+                    String substring = s.substring(s.indexOf("<value>")+7, s.indexOf("</value>"));
+                    bankInfo.setBankCode(substring);
+                }
+                if(StringUtils.containsIgnoreCase(s,"operation")) {
+                    String substring = s.substring(s.indexOf("<value>")+7, s.indexOf("</value>"));
+                    bankInfo.setOperation(substring);
+                }
+            }
+
+
+            //银行回执——payload——获取responseDTO
+            String payloadStr = xmlStr.substring(xmlStr.indexOf("</headers>")+10, xmlStr.indexOf("</message>"));
+            try {
+                // 创建DOM解析器
+                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+                DocumentBuilder builder = factory.newDocumentBuilder();
+
+                // 解析XML字符串,获取Document对象
+                Document document = builder.parse(new InputSource(new StringReader(payloadStr)));
+
+                // 创建XPath对象
+                XPath xpath = XPathFactory.newInstance().newXPath();
+
+                bankInfo.setCode(xpath.evaluate("/payload/code", document));
+                bankInfo.setSource(xpath.evaluate("/payload/source", document));
+                bankInfo.setResult(xpath.evaluate("/payload/result", document));
+                bankInfo.setNote(xpath.evaluate("/payload/note", document));
+
+            } catch (ParserConfigurationException e) {
+                e.printStackTrace();
+            } catch (SAXException e) {
+                e.printStackTrace();
+            } catch (IOException e) {
+                e.printStackTrace();
+            } catch (XPathExpressionException e) {
+                e.printStackTrace();
+            }
+
+            //保存银行回执信息
+            int insert = bankInfoMapper.insert(bankInfo);
+            //(一级市场)订单扣款-成功
+            if(bankInfo.getOperation().equalsIgnoreCase("SXB011")) {
+                //参数:一级市场边民订单-订单编号
+                boolean result = levelOneServerInterface.confirmOrderFromBank(bankInfo.getSource());
+            }
+            //(一级市场)订单扣款-失败
+            else if(bankInfo.getOperation().equalsIgnoreCase("SXB012")) {
+
+            }
+            //(一级市场)订单退款-成功
+            else if(bankInfo.getOperation().equalsIgnoreCase("SXB014")) {
+
+            }
+            //(一级市场)订单退款-失败
+            else if(bankInfo.getOperation().equalsIgnoreCase("SXB015")) {
+
+            }
+
+            //todo: 届时开启该数据校验
+            //amqpTemplateFeign.verifyContent(dataDto);
+
+            //数据处理完成状态
+            boolean flag = false;
+            // 根据类型匹配对象
+            /*switch (dataDto.getDataType()) {
+                case "001":
+                    //对象转换
+                    HtPeopleDto peopleDto = JSONObject.parseObject(body, HtPeopleDto.class);
+                    //根据其内的身份证,有则新增,无则修改???
+                    flag = FeignFactory.levelOneServerInterface.peopleDto(peopleDto);
+                    methodHtByteTask.updateHtByteInfo(flag, item, dataDto);
+                    if (!flag) {
+                        System.err.println("\n边民信息处理失败。 messageId = " + item.getMessageId() + "\n");
+                    } else {
+                        System.err.println("\n边民信息处理成功。 messageId = " + item.getMessageId() + "\n");
+                    }
+                    break;
+                case "002":
+                    //商铺备案
+                    HtShopDTO shopDto = JSONObject.parseObject(body, HtShopDTO.class);
+                    //保存
+                    flag = FeignFactory.levelOneServerInterface.shopDto(shopDto);
+                    methodHtByteTask.updateHtByteInfo(flag, item, dataDto);
+                    if (!flag) {
+                        System.err.println("\n店铺信息处理失败。 messageId = " + item.getMessageId() + "\n");
+                    } else {
+                        System.err.println("\n店铺信息处理完成。 messageId = " + item.getMessageId() + "\n");
+                    }
+                    break;
+                case "003":
+                    //边民互助组备案
+                    HtGroupDto groupDto = JSONObject.parseObject(body, HtGroupDto.class);
+                    //保存
+                    flag = FeignFactory.levelOneServerInterface.groupDto(groupDto);
+                    methodHtByteTask.updateHtByteInfo(flag, item, dataDto);
+                    if (!flag) {
+                        System.err.println("\n互助组信息处理失败。 messageId = " + item.getMessageId() + "\n");
+                    } else {
+                        System.err.println("\n互助组信息处理完成。 messageId = " + item.getMessageId() + "\n");
+                    }
+                    break;
+                case "004":
+                    //边民合作社备案
+                    HtCooperativeDto cooperativeDto = JSONObject.parseObject(body, HtCooperativeDto.class);
+                    //保存
+                    flag = FeignFactory.levelOneServerInterface.cooperativeDto(cooperativeDto);
+                    methodHtByteTask.updateHtByteInfo(flag, item, dataDto);
+                    if (!flag) {
+                        System.err.println("\n边民合作社信息处理失败。 messageId = " + item.getMessageId() + "\n");
+                    } else {
+                        System.err.println("\n边民合作社信息处理完成。 messageId = " + item.getMessageId() + "\n");
+                    }
+                    break;
+                case "005":
+                    //商品基础信息
+                    HtGoodsDto goodsDto = JSONObject.parseObject(body, HtGoodsDto.class);
+                    //保存
+                    flag = FeignFactory.levelOneServerInterface.goodsDto(goodsDto);
+                    methodHtByteTask.updateHtByteInfo(flag, item, dataDto);
+                    if (!flag) {
+                        System.err.println("\n海关监管商品信息处理失败。 messageId = " + item.getMessageId() + "\n");
+                    } else {
+                        System.err.println("\n海关监管商品信息处理完成。 messageId = " + item.getMessageId() + "\n");
+                    }
+                    break;
+                case "006":
+                    //交易结算信息
+                    HtTradeSettlement importDeclarePeople = JSONObject.parseObject(body, HtTradeSettlement.class);
+                    if (importDeclarePeople == null || !importDeclarePeople.getIEFlag().toLowerCase().contains("i")) {
+                        StaticLog.info("出口商品,暂时忽略:{}", body);
+                        break;
+                    }
+                    List<BordersListDto> bordersLists = JSON.parseArray(importDeclarePeople.getBordersList(), BordersListDto.class);
+                    //边民购买商品列表
+                    List<BorderBuyGoodsListDto> buyGoodsList = JSON.parseArray(importDeclarePeople.getBorderBuyGoodsList(), BorderBuyGoodsListDto.class);
+                    //保存航通监听记录
+                    TradeSettlementDto tradeSettlementDto = new TradeSettlementDto();
+                    BeanUtils.copyProperties(importDeclarePeople,tradeSettlementDto);
+                    tradeSettlementDto.setBordersListDtoList(bordersLists);
+                    tradeSettlementDto.setBorderBuyGoodsListDtoList(buyGoodsList);
+                    importDeclarePeople.setFinishStatus(FinishStatus.FINISH_STATUS_ZERO.getCode()); // 默认待处理
+                    importDeclarePeople.setCreateTime(new Date());
+                    boolean b = FeignFactory.levelOneServerInterface.tradeSettlementDto(tradeSettlementDto);
+                    StaticLog.info("\n交易结算信息处理完成:{}。 messageId:{} = " ,item.getMessageId() ,b);
+                    methodHtByteTask.updateHtByteInfo(b, item, dataDto);
+                    break;
+                case "007":
+                    //放行记录(过卡记录)
+                    HtPassCardDTO htPassCardDTO = JSONObject.parseObject(body, HtPassCardDTO.class);
+                    //系统接收到航通过卡记录且卡口类型为'3卡':车辆已出一级市场, 修改相对应的一级市场订单状态
+                    if ("3卡".equals(htPassCardDTO.getChannelType())) {
+                        FeignFactory.levelOneServerInterface.orderFinish(htPassCardDTO);
+                    }
+                    break;
+                case "008":
+                    //进口申报单
+                    HtImportOrderDto importOrderDto = JSONObject.parseObject(body, HtImportOrderDto.class);
+                    boolean result = FeignFactory.levelOneServerInterface.importOrderDto(importOrderDto);
+                    methodHtByteTask.updateHtByteInfo(result, item, dataDto);
+                    if (result) {
+                        System.err.println("\n进口申报单同步处理成功。 messageId = " + item.getMessageId() + "\n");
+                    } else {
+                        System.err.println("\n进口申报单同步处理失败。 messageId = " + item.getMessageId() + "\n");
+                    }
+                    break;
+                case "009":
+                    //进口申报单边民确认
+                    HtImportDeclarePeople htImportDeclarePeople = JSONObject.parseObject(body, HtImportDeclarePeople.class);
+                    htImportDeclarePeople.setFinishStatus(FinishStatus.FINISH_STATUS_ZERO.getCode());
+                    htImportDeclarePeople.setCreateTime(new Date());
+                    int insert2 = htImportDeclarePeopleMapper.insert(htImportDeclarePeople);
+                    methodHtByteTask.updateHtByteInfo(insert2 == 1, item, dataDto);
+                    if (insert2 == 1) {
+                        System.err.println("\n进口申报单边民确认信息处理成功。 messageId = " + item.getMessageId() + "\n");
+                    } else {
+                        System.err.println("\n进口申报单边民确认信息处理失败。 messageId = " + item.getMessageId() + "\n");
+                    }
+                    break;
+                default:
+                    throw new ServiceException("类型错误。");
+            }*/
+        });
+
+    }
+
+}

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

@@ -0,0 +1,25 @@
+package com.pj.task;
+
+import com.pj.api.dto.PaymentDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/payment/")
+public class PaymentController {
+
+    @Autowired
+    private PaymentService paymentService;
+
+    @RequestMapping("rpc/sendSXB010")
+    public void sendSXB010(@RequestBody PaymentDto paymentDto) {
+        paymentService.sendSXB010(paymentDto);
+    }
+
+    @RequestMapping("rpc/sendSXB013")
+    public void sendSXB013(@RequestBody PaymentDto paymentDto) {
+        paymentService.sendSXB013(paymentDto);
+    }
+}

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

@@ -0,0 +1,76 @@
+package com.pj.task;
+
+import com.alibaba.fastjson.JSON;
+import com.pj.api.dto.OrderDto;
+import com.pj.api.dto.PaymentDto;
+import com.pj.dto.DataDto;
+import com.pj.rabbitmq.RabbitMQ;
+import com.pj.utils.ht.AESUtil;
+import com.pj.xml.MessageXML;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.amqp.core.AmqpTemplate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+@Slf4j
+public class PaymentService {
+
+    @Autowired
+    private AmqpTemplate amqpTemplate;
+
+    /**
+     * ※ 订单扣款
+     * 报文名称:SXB010.xml  数据流向:一级市场--->银行
+     * @param paymentDto 一级市场订单信息
+     */
+    public void sendSXB010(PaymentDto paymentDto) {
+        log.info("send data to ht:{}", JSON.toJSONString(paymentDto));
+        String xml = MessageXML.SXB010(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));
+    }
+
+
+    /**
+     * ※ 订单退款
+     * 报文名称:SXB013.xml  数据流向:一级市场--->银行
+     * @param paymentDto 一级市场订单信息
+     */
+    public void sendSXB013(PaymentDto paymentDto) {
+        log.info("send data to ht:{}", JSON.toJSONString(paymentDto));
+        String xml = MessageXML.SXB013(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));
+    }
+    /**
+     * 获取航通数据时,验证其是否被篡改
+     */
+    /*public boolean verifyContent(DataDto dataDto){
+        //获取其签名
+        String sign = dataDto.getSign();
+        String signString = "msgId=" + dataDto.getMsgId() + "&appId=" + dataDto.getAppId() + "&dataType=" + dataDto.getDataType() + "&msgTime=" + dataDto.getMsgTime() + "&data=" + dataDto.getData();
+        String md5 = MD5.getMd5(signString, 32);
+        if(!sign.equals(md5))
+            throw new ServiceException("报文已经被修改。");
+        return true;
+    }*/
+
+
+}

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

@@ -0,0 +1,188 @@
+package com.pj.xml;
+
+
+import com.pj.api.dto.PaymentDto;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+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" +
+                "<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" +
+                "       </item>\n" +
+                "        <item>\n" +
+                "               <key>date</key>\n" +
+                "              <value>"+date+"</value>\n" +
+                "       </item>\n" +
+                "        <item>\n" +
+                "               <key>organization</key>\n" +
+                "              <value>"+paymentDto.getFieldCode()+"</value>\n" +//互市点机构代码
+                "       </item>\n" +
+                "        <item>\n" +
+                "            <key>bankCode</key>\n" +
+                "            <value>ICBKCNBJYUN</value>\n" +//银行标识
+                "        </item>\n" +
+                "        <item>\n" +
+                "               <key>operation</key>\n" +
+                "              <value>SXB010</value>\n" +
+                "       </item>\n" +
+                "</headers>\n" +
+                " <payload xsi:type=\"orderDTO\">\n" +
+                "         <sn>"+paymentDto.getTradeNo()+"</sn>\n" +                         //订单号
+                "         <export>false</export>\n" +                                       //出口标识	true:出口,false:进口
+                "         <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
+                "<vendee>\n" +
+                "         <name>"+paymentDto.getBorderName()+"</name>\n" +                  //边民姓名
+                "         <paperType>身份证</paperType>\n" +                                //证件类型
+                "         <paperNo>"+paymentDto.getBorderidno()+"</paperNo>\n" +           //边民证件号
+                "         <nationality>中国</nationality>\n" +                             //国籍
+                "         <accountNo>"+paymentDto.getBankCode()+"</accountNo>\n" +         //银行账号
+                "         <bankCode>"+paymentDto.getBankName()+"</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>"+paymentDto.getBank()+"</bankCode>\n" +               //开户行代码
+                "         <tel>"+paymentDto.getOwnerTel()+"</tel>\n" +                     //联系电话
+                "<vendor>\n" +
+                "<items>\n" +
+                "         <name>"+paymentDto.getGoodsName()+"</name>\n" +                   //商品名称
+                "         <unit>"+paymentDto.getGoodsUnit()+"</unit>\n" +                   //商品单位
+                "         <price></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 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" +
+                "       </item>\n" +
+                "        <item>\n" +
+                "               <key>date</key>\n" +
+                "              <value>"+date+"</value>\n" +
+                "       </item>\n" +
+                "        <item>\n" +
+                "               <key>organization</key>\n" +
+                "              <value>"+paymentDto.getFieldCode()+"</value>\n" +//互市点机构代码
+                "       </item>\n" +
+                "        <item>\n" +
+                "            <key>bankCode</key>\n" +
+                "            <value>ICBKCNBJYUN</value>\n" +//银行标识
+                "        </item>\n" +
+                "        <item>\n" +
+                "               <key>operation</key>\n" +
+                "              <value>SXB013</value>\n" +
+                "       </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>身份证</paperType>\n" +                                //证件类型
+                "         <paperNo>"+paymentDto.getBorderidno()+"</paperNo>\n" +           //边民证件号
+                "         <nationality>中国</nationality>\n" +                             //国籍
+                "         <accountNo>"+paymentDto.getBankCode()+"</accountNo>\n" +         //银行账号
+                "         <bankCode>"+paymentDto.getBankName()+"</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>"+paymentDto.getBank()+"</bankCode>\n" +               //开户行代码
+                "         <tel>"+paymentDto.getOwnerTel()+"</tel>\n" +                     //联系电话
+                "<vendor>\n" +
+                "<items>\n" +
+                "         <name>"+paymentDto.getGoodsName()+"</name>\n" +                   //商品名称
+                "         <unit>"+paymentDto.getGoodsUnit()+"</unit>\n" +                   //商品单位
+                "         <price></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 SXB023(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=\"\">\n" +
+                "<headers>\n" +
+                "        <item>\n" +
+                "               <key>sn</key>\n" +
+                "              <value>"+UUID.randomUUID()+"</value>\n" +
+                "       </item>\n" +
+                "        <item>\n" +
+                "               <key>date</key>\n" +
+                "              <value>"+date+"</value>\n" +
+                "       </item>\n" +
+                "        <item>\n" +
+                "               <key>organization</key>\n" +
+                "              <value>"+paymentDto.getFieldCode()+"</value>\n" +//互市点机构代码
+                "       </item>\n" +
+                "        <item>\n" +
+                "            <key>bankCode</key>\n" +
+                "            <value>ICBKCNBJYUN</value>\n" +//银行标识
+                "        </item>\n" +
+                "        <item>\n" +
+                "               <key>operation</key>\n" +
+                "              <value>SXB023</value>\n" +
+                "       </item>\n" +
+                "</headers>\n" +
+                " <payload xsi:type=\"carDTO\">\n" +
+                "         <registration></registration>\n" +  //车辆批号
+                "         <plateNumber></plateNumber>\n" +    //车牌号
+                "         <Order></Order>\n" +                //订单号	n个
+                "</payload>\n" +
+                "</message>\n";
+        return xml;
+    }
+
+    public static void main(String[] args) {
+        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss sss");
+        Date day = new Date();
+        String format = sdf.format(day);
+        System.out.println(UUID.randomUUID());
+    }
+}

+ 9 - 0
sp-service/payment-server/src/main/resources/bootstrap.yml

@@ -0,0 +1,9 @@
+# 端口
+server:
+    port: 8024
+
+spring:
+    # 服务名称
+    application.name: payment-server
+    # 当前环境
+    profiles.active: dev