Kaynağa Gözat

重推订单信息到免税mall

lhm 3 yıl önce
ebeveyn
işleme
70d37add3b

+ 5 - 0
kmall-admin/src/main/java/com/kmall/admin/controller/OrderController.java

@@ -1500,6 +1500,11 @@ public class OrderController {
         return orderService.resendOrderHkMall(orderSn);
     }
 
+    @RequestMapping("/resendOrderHkMall/{orderSn}/vmcshop")
+    public R resendOrderInfoToVmcShop(@PathVariable("orderSn") String orderSn) {
+        return orderService.resendOrderInfoToVmcShop(orderSn);
+    }
+
     /**
      * 总计
      */

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/haikong/HaiKongSendOrderInfoRecordDao.java

@@ -37,4 +37,6 @@ public interface HaiKongSendOrderInfoRecordDao {
     int saveBatch(List<HaiKongSendOrderInfoRecordEntity> entities);
 
     void updateResendStatusBatch(List<HaiKongSendOrderInfoRecordEntity> entities);
+
+    void updateByOrderSn(HaiKongSendOrderInfoRecordEntity sendOrderInfoRecordEntity);
 }

+ 2 - 0
kmall-admin/src/main/java/com/kmall/admin/service/OrderService.java

@@ -258,4 +258,6 @@ public interface OrderService {
     void integralTask();
 
     int queryOrderMainTotal();
+
+    R resendOrderInfoToVmcShop(String orderSn);
 }

+ 4 - 0
kmall-admin/src/main/java/com/kmall/admin/service/haikong/HaiKongSendOrderInfoRecordService.java

@@ -76,4 +76,8 @@ public interface HaiKongSendOrderInfoRecordService {
     List<HaiKongSendOrderInfoRecordEntity> queryListByResendStatus();
 
     void updateResendStatusBatch(List<HaiKongSendOrderInfoRecordEntity> entities);
+
+    HaiKongSendOrderInfoRecordEntity queryObjectByOrderSn(String orderSn);
+
+    void updateByOrderSn(HaiKongSendOrderInfoRecordEntity sendOrderInfoRecordEntity);
 }

+ 31 - 2
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -2818,7 +2818,7 @@ public class OrderServiceImpl implements OrderService {
             JedisUtil.del(Constants.WAREHOUSE_STOCK_MAP_KEY + "_" + storeId);
 
 
-            if (org.springframework.util.StringUtils.isEmpty(env) && Constants.TEST.equals(env)) {
+            if (!org.springframework.util.StringUtils.isEmpty(env) && Constants.TEST.equals(env)) {
                 order.setPayApp("wxpay");
                 order.setRequest("1111111111111111111");
                 order.setResponse("2222222222222222222");
@@ -2878,6 +2878,10 @@ public class OrderServiceImpl implements OrderService {
             } else if (Objects.nonNull(r) && ErrorCodeConstants.VmcShopSysErrorCodeEnum.CODE_10500.getCode().equals(r.getCode())) {
                 pickUpCodeService.updatePickUpCodeStatusByOrderSn(orderSn, Dict.PickUpCodeStatusEnum.item_6.getStatus());
                 haiKongSendOrderInfoRecordEntity.setResendStatus(HaiKongMemberOrderResendStatusEnum.NON_RESEND.getStatus());
+                Map<String, Object> map = new HashMap<>();
+                map.put("orderSn", orderSn);
+                map.put("clearMsg", response);
+                orderProcessRecordDao.updateMallOrderProcessRecord(map);
                 LOGGER.error("推送订单到免税mall失败!响应结果:{}", response);
             } else if (Objects.isNull(r)) {
                 pickUpCodeService.updatePickUpCodeStatusByOrderSn(orderSn, Dict.PickUpCodeStatusEnum.item_6.getStatus());
@@ -5352,6 +5356,7 @@ public class OrderServiceImpl implements OrderService {
             return R.error("该订单所属商户不存在:"+orderEntity.getOrderSn());
         }
         // 组装支付单信息
+        UserEntity userEntity = userService.queryByMobile(orderEntity.getMobile());
         Map<String, Object> orderSendCusParams = new HashMap<>();
         if(Dict.payFlag.item_weixin.getItem().equals(orderEntity.getPayFlag())){
             orderSendCusParams.put("merchSn", orderEntity.getMerchSn());
@@ -5369,7 +5374,6 @@ public class OrderServiceImpl implements OrderService {
             orderSendCusParams.put("orderFee", orderFee);
             orderSendCusParams.put("productFee", orderFee);
             orderSendCusParams.put("transportFee", 0);
-            UserEntity userEntity = userService.queryByMobile(orderEntity.getMobile());
             orderSendCusParams.put("certId", userEntity.getIdNo());
             orderSendCusParams.put("name", orderEntity.getPayName());
 
@@ -5385,6 +5389,8 @@ public class OrderServiceImpl implements OrderService {
             //阿里支付流水号
             orderSendCusParams.put("tradeNo", orderEntity.getAliTradeNo());
             orderSendCusParams.put("amount", orderEntity.getActualPrice());
+            orderSendCusParams.put("certId", userEntity.getIdNo());
+            orderSendCusParams.put("name", orderEntity.getPayName());
 
             // 将支付单信息发送到当前项目下的 cuspay
             aliCusDeclareBiz.biz(orderSendCusParams);
@@ -5442,4 +5448,27 @@ public class OrderServiceImpl implements OrderService {
     public int queryOrderMainTotal() {
         return orderDao.queryOrderMainTotal();
     }
+
+    @Override
+    public R resendOrderInfoToVmcShop(String orderSn) {
+
+        HaiKongSendOrderInfoRecordEntity sendOrderInfoRecordEntity = haiKongSendOrderInfoRecordService.queryObjectByOrderSn(orderSn);
+
+        if (Objects.isNull(sendOrderInfoRecordEntity)) {
+            LOGGER.error(String.format("重新推送订单到免税mall,订单号【%s】对应发送记录不存在", orderSn));
+            return R.error(String.format("订单号【%s】对应发送记录不存在", orderSn));
+        }
+        // 直接修改状态
+        if (!HaiKongMemberOrderResendStatusEnum.RESEND_SUCCESS.getStatus().equals(sendOrderInfoRecordEntity.getResendStatus())) {
+            HaiKongSendOrderInfoRecordEntity sendOrderInfoRecordEntity1 = new HaiKongSendOrderInfoRecordEntity();
+            sendOrderInfoRecordEntity1.setResendStatus(HaiKongMemberOrderResendStatusEnum.WAIT_RESEND.getStatus());
+            sendOrderInfoRecordEntity1.setOuterOrderNo(orderSn);
+            haiKongSendOrderInfoRecordService.updateByOrderSn(sendOrderInfoRecordEntity1);
+        } else {
+            return R.ok("已经推送到免税mall成功,无需重推!");
+        }
+
+
+        return R.ok("重推成功!");
+    }
 }

+ 10 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/haikong/HaikongSendOrderInfoRecordServiceImpl.java

@@ -75,4 +75,14 @@ public class HaikongSendOrderInfoRecordServiceImpl implements HaiKongSendOrderIn
     public void updateResendStatusBatch(List<HaiKongSendOrderInfoRecordEntity> entities) {
         haikongSendOrderInfoRecordDao.updateResendStatusBatch(entities);
     }
+
+    @Override
+    public HaiKongSendOrderInfoRecordEntity queryObjectByOrderSn(String orderSn) {
+        return haikongSendOrderInfoRecordDao.queryObjectByOuterOrderNo(orderSn);
+    }
+
+    @Override
+    public void updateByOrderSn(HaiKongSendOrderInfoRecordEntity sendOrderInfoRecordEntity) {
+        haikongSendOrderInfoRecordDao.updateByOrderSn(sendOrderInfoRecordEntity);
+    }
 }

+ 3 - 0
kmall-admin/src/main/resources/mybatis/mapper/OrderProcessRecordDao.xml

@@ -539,6 +539,9 @@ select
 			<if test="invtNo != null">
 				invt_no = #{invtNo},
 			</if>
+			<if test="clearMsg != null">
+				customs_msg = #{clearMsg},
+			</if>
 		</set>
 		where order_sn = #{orderSn,jdbcType=VARCHAR}
 	</update>

+ 33 - 0
kmall-admin/src/main/resources/mybatis/mapper/haikong/HaikongSendOrderInfoRecordDao.xml

@@ -373,6 +373,39 @@
 			#{item.id}
 		</foreach>
 	</update>
+	<update id="updateByOrderSn">
+		update haikong_send_order_info_record
+		<set>
+			<if test="payApp != null">`pay_app` = #{payApp}, </if>
+			<if test="dlytypeCode != null">`dlytype_code` = #{dlytypeCode}, </if>
+			<if test="consigneeName != null">`consignee_name` = #{consigneeName}, </if>
+			<if test="consigneeAreaProvince != null">`consignee_area_province` = #{consigneeAreaProvince}, </if>
+			<if test="consigneeAreaCity != null">`consignee_area_city` = #{consigneeAreaCity}, </if>
+			<if test="consigneeAreaCounty != null">`consignee_area_county` = #{consigneeAreaCounty}, </if>
+			<if test="consigneeAddress != null">`consignee_address` = #{consigneeAddress}, </if>
+			<if test="consigneeZip != null">`consignee_zip` = #{consigneeZip}, </if>
+			<if test="consigneeTel != null">`consignee_tel` = #{consigneeTel}, </if>
+			<if test="consigneeEmail != null">`consignee_email` = #{consigneeEmail}, </if>
+			<if test="consigneeMobile != null">`consignee_mobile` = #{consigneeMobile}, </if>
+			<if test="weight != null">`weight` = #{weight}, </if>
+			<if test="quantity != null">`quantity` = #{quantity}, </if>
+			<if test="orderTotal != null">`order_total` = #{orderTotal}, </if>
+			<if test="platform != null">`platform` = #{platform}, </if>
+			<if test="money != null">`money` = #{money}, </if>
+			<if test="payMode != null">`pay_mode` = #{payMode}, </if>
+			<if test="request != null">`request` = #{request}, </if>
+			<if test="response != null">`response` = #{response}, </if>
+			<if test="outTradeNo != null">`out_trade_no` = #{outTradeNo}, </if>
+			<if test="seaportCode != null">`seaport_code` = #{seaportCode}, </if>
+			<if test="seaportPlatform != null">`seaport_platform` = #{seaportPlatform}, </if>
+			<if test="identityCard != null">`identity_card` = #{identityCard}, </if>
+			<if test="identityName != null">`identity_name` = #{identityName}, </if>
+			<if test="identityMobile != null">`identity_mobile` = #{identityMobile}, </if>
+			<if test="orderProductInfo != null">`order_product_info` = #{orderProductInfo}, </if>
+			<if test="resendStatus != null">`resend_status` = #{resendStatus}</if>
+		</set>
+		where outer_order_no = #{outerOrderNo}
+	</update>
 
 	<delete id="delete">
 		delete from haikong_send_order_info_record where id = #{value}

+ 1 - 0
kmall-admin/src/main/webapp/WEB-INF/page/sale/sale.html

@@ -520,6 +520,7 @@
 <!--                            <button type="button" style="margin:0 30px 0 20px;font-size: 25px;" class="btn btn-warning" @click="confirmDelivery" id="confirmDelivery" data-dismiss="modal">确定提货</button>-->
 <!--                            <button type="button" style="margin:0 30px 0 20px;font-size: 25px;" class="btn btn-primary" @click="resendNotice" id="resendNotice" data-dismiss="modal">重发通知</button>-->
 <!--                            <button type="button" style="margin:0 30px 0 20px;font-size: 25px;" class="btn btn-primary" @click="resendWaybill" id="resendWaybill" data-dismiss="modal">重发运单</button>-->
+                            <button type="button" style="margin:0 30px 0 20px;font-size: 25px;" class="btn btn-primary" @click="resendorderinfo" id="resendorderinfo" data-dismiss="modal">重推订单信息</button>
                             <button type="button" style="margin:0 30px 0 20px;font-size: 25px;" class="btn btn-primary" @click="resendorder" id="resendorder" data-dismiss="modal">重发订单</button>
                             <button type="button" style="margin:0 30px 0 20px;font-size: 25px;" class="btn btn-primary" @click="resendPayment" id="resendPayment" data-dismiss="modal">重发支付单</button>
 <!--                            <button type="button" style="margin:0 30px 0 20px;font-size: 25px;" class="btn btn-primary" @click="resendOrder" id="resendOrder" data-dismiss="modal">重发订单</button>-->

+ 7 - 0
kmall-admin/src/main/webapp/js/sale/sale.js

@@ -1261,6 +1261,13 @@ let vm = new Vue({
                 }
             });
         },
+        resendorderinfo: function () {
+            confirm('确认重发订单信息到免税mall吗?', function () {
+                $.get("../order/resendOrderHkMall/"+vm.orderEntity.orderSn+"/vmcshop", function (r) {
+                    alert(r.msg);
+                });
+            })
+        },
         resendNotice:function(){
             confirm('确认重发重置吗?', function () {
                 $.get("../order/resendOrderToCCNET/"+vm.orderEntity.orderSn+"/notice", function (r) {