liujunchi 2 anni fa
parent
commit
819a90d593

+ 2 - 2
cooleshow-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/controller/OmsOrderController.java

@@ -134,7 +134,7 @@ public class OmsOrderController {
     @GetMapping(value = "/refreshCourier")
     @ResponseBody
     public CommonResult refreshCourier(@RequestParam String  deliverySn) throws InterruptedException {
-        orderCourierService.refreshCourier(deliverySn);
-        return CommonResult.success(null);
+        OmsOrderCourier omsOrderCourier = orderCourierService.refreshCourier(deliverySn);
+        return CommonResult.success(omsOrderCourier);
     }
 }

+ 2 - 1
cooleshow-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/service/OmsOrderCourierService.java

@@ -23,7 +23,8 @@ public interface OmsOrderCourierService {
 
     /**
      * 刷新物流信息
+     * @return
      */
     @Transactional
-    void refreshCourier(String deliverySn) throws InterruptedException;
+    OmsOrderCourier refreshCourier(String deliverySn) throws InterruptedException;
 }

+ 5 - 3
cooleshow-mall/mall-admin/src/main/java/com/yonge/cooleshow/admin/service/impl/OmsOrderCourierServiceImpl.java

@@ -50,11 +50,12 @@ public class OmsOrderCourierServiceImpl implements OmsOrderCourierService {
     }
 
     @Override
-    public void refreshCourier(String deliverySn) throws InterruptedException {
+    public OmsOrderCourier refreshCourier(String deliverySn) throws InterruptedException {
         RLock lock = redissonClient.getLock(OrderCacheEnum.COURIER_LOCK.getCode());
-        boolean b = lock.tryLock(1, TimeUnit.HOURS);
+        boolean b = lock.tryLock(0,1, TimeUnit.HOURS);
+
+        OmsOrderCourier omsOrderCourier = omsOrderCourierMapper.queryByCourierNo(deliverySn);
         if (b) {
-            OmsOrderCourier omsOrderCourier = omsOrderCourierMapper.queryByCourierNo(deliverySn);
             if (omsOrderCourier == null) {
                 throw new BizException("未找到物流信息");
             }
@@ -62,5 +63,6 @@ public class OmsOrderCourierServiceImpl implements OmsOrderCourierService {
                                                                 omsOrderCourier.getCourierNo());
             updateCourierInfo(courierInfo);
         }
+        return omsOrderCourierMapper.queryByCourierNo(deliverySn);
     }
 }

+ 1 - 1
cooleshow-mall/mall-common/src/main/java/com/yonge/cooleshow/mall/common/courier/service/impl/Courier100ServiceImpl.java

@@ -116,7 +116,7 @@ public class Courier100ServiceImpl implements CourierService {
                 throw new BizException(execute.getError());
             }
             JSONObject jsonObject = JSON.parseObject(execute.getBody());
-            if (!"200".equals(jsonObject.getString("status"))) {
+            if (!"200".equals(jsonObject.getString("returnCode"))) {
                 throw new BizException(jsonObject.getString("message"));
             }
             return true;

+ 2 - 1
cooleshow-mall/mall-portal/src/main/java/com/yonge/cooleshow/portal/controller/open/OpenShareController.java

@@ -20,6 +20,7 @@ import io.swagger.annotations.ApiOperation;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 
 import javax.annotation.Resource;
@@ -65,7 +66,7 @@ public class OpenShareController extends BaseController {
 
 
     @ApiOperation(value = "快递信息回调")
-    @PostMapping(value="/courierCallback")
+    @PostMapping(value="/courierCallback", consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
     @ResponseBody
     public CommonResult courierCallback(@RequestBody String obj) {
         log.info("快递信息回调:{}",obj);