Browse Source

Merge branch 'feature/asyncOrder' of http://git.aseanbusiness.cn/qzyReal/market-server into feature/asyncOrder

qzy 2 months ago
parent
commit
1bfe7045c1

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

@@ -41,6 +41,7 @@ public class TbOrder extends Model<TbOrder> implements Serializable {
     public static final String PERMISSION_CODE_EDIT = "tb-order-edit";
     public static final String PERMISSION_CODE_EDIT = "tb-order-edit";
     public static final String PERMISSION_CODE_DEL = "tb-order-del";
     public static final String PERMISSION_CODE_DEL = "tb-order-del";
     public static final String PERMISSION_CODE_EDIT_PRICE = "tb-order-edit-price";
     public static final String PERMISSION_CODE_EDIT_PRICE = "tb-order-edit-price";
+	public static final String PERMISSION_CODE_DEDUCTION = "tb-order-deduction";
 
 
 
 
     // ---------- 表中字段 ----------
     // ---------- 表中字段 ----------
@@ -520,6 +521,14 @@ public class TbOrder extends Model<TbOrder> implements Serializable {
 	 * (一级市场)订单扣款回执时间
 	 * (一级市场)订单扣款回执时间
 	 */
 	 */
 	private Date Sxb010StatusTime;
 	private Date Sxb010StatusTime;
+	/**
+	 * (一级市场)订单补扣款次数
+	 */
+	private Integer deductionCount;
+	/**
+	 * (一级市场)订单最近一次补扣款时间
+	 */
+	private Date deductionTime;
 
 
     /**
     /**
      * 上架状态(1=未上架,2=上架,3=已下架)
      * 上架状态(1=未上架,2=上架,3=已下架)

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

@@ -67,7 +67,6 @@ public class TbOrderController {
 	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
 	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
 	@RequestMapping("getList")
 	@RequestMapping("getList")
 	@SaCheckPermission(TbOrder.PERMISSION_CODE)
 	@SaCheckPermission(TbOrder.PERMISSION_CODE)
-
 	public AjaxJson getList() {
 	public AjaxJson getList() {
 		SoMap so = SoMap.getRequestSoMap();
 		SoMap so = SoMap.getRequestSoMap();
 		List<TbOrder> list = tbOrderService.getList(so.startPage());
 		List<TbOrder> list = tbOrderService.getList(so.startPage());
@@ -109,6 +108,13 @@ public class TbOrderController {
 		return AjaxJson.toAjax(batch);
 		return AjaxJson.toAjax(batch);
 	}
 	}
 
 
+	/** 订单补扣款 */
+	@RequestMapping("deduction")
+	@SaCheckPermission(TbOrder.PERMISSION_CODE_DEDUCTION)
+	public AjaxJson deduction(Long id){
+		tbOrderService.deduction(id);
+		return AjaxJson.getSuccess();
+	}
 
 
 
 
 	/*-----           正常业务逻辑👆👆    rpc远程调用👇👇 -----*/
 	/*-----           正常业务逻辑👆👆    rpc远程调用👇👇 -----*/

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

@@ -474,10 +474,10 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
         //tbOrder.setTradeStatus(TradeStatus.TRADE_STATUS_ONE.getCode()); //已支付
         //tbOrder.setTradeStatus(TradeStatus.TRADE_STATUS_ONE.getCode()); //已支付
         //tbOrder.setTradeTime(new Date()); //支付回执时间
         //tbOrder.setTradeTime(new Date()); //支付回执时间
         //tbOrder.setPayType(0); //支付类型
         //tbOrder.setPayType(0); //支付类型
-        if ("1".equals(tbOrder.getDeclareType())) {
-            // tbOrder.setFinishStatus(FinishStatus.FINISH_STATUS_ONE.getCode()); //已完成->完成后可以进行转售
+        /*if ("1".equals(tbOrder.getDeclareType())) {
+            tbOrder.setFinishStatus(FinishStatus.FINISH_STATUS_ONE.getCode()); //已完成->完成后可以进行转售
             tbOrder.setFinishTime(new Date());
             tbOrder.setFinishTime(new Date());
-        }
+        }*/
 
 
         boolean update = super.updateById(tbOrder);
         boolean update = super.updateById(tbOrder);
         // TODO: 2023/8/28 边民发起支付申请,调用银行接口:验证边民支付信息,将货款先存入银行第三方账户,并给出回执
         // TODO: 2023/8/28 边民发起支付申请,调用银行接口:验证边民支付信息,将货款先存入银行第三方账户,并给出回执
@@ -673,6 +673,24 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
         return update;
         return update;
     }
     }
 
 
+    /** 订单补扣款 */
+    public boolean deduction(Long id){
+        TbOrder tbOrder = getById(id);
+        if (tbOrder == null) {
+            throw new AjaxError("订单不存在");
+        }
+
+        PaymentDto paymentDto = this.getPaymentData(tbOrder);
+        StaticLog.info("\n---订单补扣款---sendSXB010——PaymentDto——:{}", JSONUtil.toJsonStr(paymentDto));
+        paymentServerInterface.sendSXB010(paymentDto);
+
+        tbOrder.setDeductionCount(tbOrder.getDeductionCount() + 1);
+        tbOrder.setDeductionTime(new Date());
+
+        boolean update = super.updateById(tbOrder);
+        return update;
+    }
+
     /*-----           正常业务逻辑👆👆    rpc远程调用👇👇 -----*/
     /*-----           正常业务逻辑👆👆    rpc远程调用👇👇 -----*/
 
 
     //进出口申报单退单-逻辑处理
     //进出口申报单退单-逻辑处理
@@ -748,9 +766,9 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
         PaymentDto paymentDto = new PaymentDto();
         PaymentDto paymentDto = new PaymentDto();
         for (TbOrder tbOrder : tbOrders) {
         for (TbOrder tbOrder : tbOrders) {
             tradeNos += tbOrder.getTradeNo() + ",";
             tradeNos += tbOrder.getTradeNo() + ",";
-            //收到007结关信息后还需转发给银行,银行打款给采购商,系统收到打款成功回执SXB017才能完成订单,然后边民才可上架订单
-            //tbOrder.setFinishTime(new Date());
-            //tbOrder.setFinishStatus(FinishStatus.FINISH_STATUS_ONE.getCode());
+            //收到007结关信息后边民即可上架订单,不需等收到打款给外籍商户的成功回执SXB017才能完成订单
+            tbOrder.setFinishTime(new Date());
+            tbOrder.setFinishStatus(FinishStatus.FINISH_STATUS_ONE.getCode());
 
 
             //todo: 收到航通007报文即收到海关结关信息,转发结关信息给到银行
             //todo: 收到航通007报文即收到海关结关信息,转发结关信息给到银行
             paymentDto.setTradeNo(tbOrder.getTradeNo());
             paymentDto.setTradeNo(tbOrder.getTradeNo());
@@ -759,7 +777,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
             StaticLog.info("\nsendCXB001——PaymentDto——:{}", JSONUtil.toJsonStr(paymentDto));
             StaticLog.info("\nsendCXB001——PaymentDto——:{}", JSONUtil.toJsonStr(paymentDto));
             paymentServerInterface.sendCXB001(paymentDto);
             paymentServerInterface.sendCXB001(paymentDto);
         }
         }
-        //this.updateBatchById(tbOrders);
+        this.updateBatchById(tbOrders);
 
 
 
 
         //todo: 调用银行接口发起划扣:将边民划扣至银行第三方账户的货款,支付至外籍商户的账户
         //todo: 调用银行接口发起划扣:将边民划扣至银行第三方账户的货款,支付至外籍商户的账户