yuhongqi 1 тиждень тому
батько
коміт
5704c32c09

+ 9 - 7
fs-admin/src/main/java/com/fs/live/controller/LiveOrderController.java

@@ -33,6 +33,8 @@ import com.fs.his.service.IFsExpressService;
 import com.fs.his.service.IFsUserService;
 import com.fs.hisStore.dto.StoreOrderExpressExportDTO;
 import com.fs.hisStore.param.*;
+import com.fs.hisStore.service.IFsExpressScrmService;
+import com.fs.hisStore.task.ExpressTask;
 import com.fs.hisStore.task.LiveTask;
 import com.fs.hisStore.vo.FsStoreOrderVO;
 import com.fs.live.domain.*;
@@ -95,7 +97,7 @@ public class LiveOrderController extends BaseController
     @Autowired
     private TokenService tokenService;
     @Autowired
-    private IFsExpressService expressService;
+    private IFsExpressScrmService expressService;
 //    @Autowired
 //    private FsWarehousesMapper fsWarehousesMapper;
     @Autowired
@@ -168,15 +170,16 @@ public class LiveOrderController extends BaseController
             vo.setCompanyUserPhone(ParseUtils.parsePhone(vo.getCompanyUserPhone()));
             vo.setUserBindPhone(ParseUtils.parsePhone(vo.getUserBindPhone()));
             vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
-            vo.setCost(BigDecimal.ZERO);
+
             // 财务独特字段
             if (loginUser.getPermissions().contains("live:liveOrder:finance") || loginUser.getPermissions().contains("*:*:*")) {
                 vo.setCostPrice(vo.getCostPrice());
-                vo.setFPrice(BigDecimal.valueOf((long) vo.getCostPrice().intValue() * Integer.parseInt(vo.getTotalNum())));
+                vo.setFPrice(vo.getCostPrice().multiply(BigDecimal.valueOf(Long.parseLong(vo.getTotalNum()))));
             } else {
                 vo.setCostPrice(BigDecimal.ZERO);
                 vo.setFPrice(BigDecimal.ZERO);
             }
+            vo.setCost(vo.getCostPrice());
 
         }
         return getDataTable(list);
@@ -197,15 +200,15 @@ public class LiveOrderController extends BaseController
             vo.setCompanyUserPhone(ParseUtils.parsePhone(vo.getCompanyUserPhone()));
             vo.setUserBindPhone(ParseUtils.parsePhone(vo.getUserBindPhone()));
             vo.setUserAddress(ParseUtils.parseAddress(vo.getUserAddress()));
-            vo.setCost(BigDecimal.ZERO);
             // 财务独特字段
             if (loginUser.getPermissions().contains("live:liveOrder:finance") || loginUser.getPermissions().contains("*:*:*")) {
                 vo.setCostPrice(vo.getCostPrice());
-                vo.setFPrice(BigDecimal.valueOf((long) vo.getCostPrice().intValue() * Integer.parseInt(vo.getTotalNum())));
+                vo.setFPrice(vo.getCostPrice().multiply(BigDecimal.valueOf(Long.parseLong(vo.getTotalNum()))));
             } else {
                 vo.setCostPrice(BigDecimal.ZERO);
                 vo.setFPrice(BigDecimal.ZERO);
             }
+            vo.setCost(vo.getCostPrice());
         }
         ExcelUtil<LiveOrderVoZm> util = new ExcelUtil<LiveOrderVoZm>(LiveOrderVoZm.class);
         return util.exportExcel(list, "订单数据");
@@ -397,8 +400,7 @@ public class LiveOrderController extends BaseController
     @ApiOperation("物流查询")
     @PostMapping("/getExpressByDeliverId")
     public R getExpressByDeliverId(@Validated @RequestBody FsStoreOrderExpressParam param, HttpServletRequest request){
-//        return expressService.getLiveExpressByDeliverId(param);
-        return R.ok();
+        return expressService.getLiveExpressByDeliverId(param);
     }
 
     @PreAuthorize("@ss.hasPermi('live:liveOrder:auditPayRemain')")

+ 16 - 37
fs-company/src/main/java/com/fs/company/controller/live/LiveOrderController.java

@@ -1,5 +1,6 @@
 package com.fs.company.controller.live;
 
+import cn.hutool.core.util.StrUtil;
 import com.fs.common.annotation.Log;
 import com.fs.common.core.controller.BaseController;
 import com.fs.common.core.domain.AjaxResult;
@@ -8,6 +9,7 @@ import com.fs.common.core.page.TableDataInfo;
 import com.fs.common.enums.BusinessType;
 import com.fs.common.utils.ParseUtils;
 import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.StringUtils;
 import com.fs.common.utils.poi.ExcelUtil;
 import com.fs.framework.security.LoginUser;
 import com.fs.framework.security.SecurityUtils;
@@ -18,7 +20,10 @@ import com.fs.his.domain.FsUser;
 import com.fs.his.param.FsStoreOrderBindCustomerParam;
 import com.fs.his.service.IFsExpressService;
 import com.fs.his.service.IFsUserService;
+import com.fs.hisStore.dto.ExpressInfoDTO;
+import com.fs.hisStore.enums.ShipperCodeEnum;
 import com.fs.hisStore.param.FsStoreOrderExpressParam;
+import com.fs.hisStore.service.IFsExpressScrmService;
 import com.fs.live.domain.*;
 import com.fs.live.enums.LiveOrderCancleReason;
 import com.fs.live.param.LiveOrderExpressParam;
@@ -40,6 +45,8 @@ import java.math.BigDecimal;
 import java.util.List;
 import java.util.Map;
 
+import static com.fs.his.utils.PhoneUtil.decryptPhone;
+
 
 /**
  * 订单Controller
@@ -67,7 +74,7 @@ public class LiveOrderController extends BaseController
     @Autowired
     private TokenService tokenService;
     @Autowired
-    private IFsExpressService expressService;
+    private IFsExpressScrmService expressService;
 
 
 //    @Autowired
@@ -204,8 +211,8 @@ public class LiveOrderController extends BaseController
     @PostMapping("/getExpressByDeliverId")
     public R getExpressByDeliverId(@Validated @RequestBody FsStoreOrderExpressParam param, HttpServletRequest request){
 
-//        return expressService.getLiveExpressByDeliverId(param);
-        return R.ok();
+        return expressService.getLiveExpressByDeliverId(param);
+//        return R.ok();
     }
 
     /**
@@ -287,40 +294,12 @@ public class LiveOrderController extends BaseController
     /**
      * 查看物流状态
      * */
-//    @PreAuthorize("@ss.hasPermi('live:liveOrder:express')")
-//    @GetMapping(value = "/getExpress/{id}")
-//    public R getExpress(@PathVariable("id") String id)
-//    {
-//        LiveOrder order=liveOrderService.selectLiveOrderByOrderId(id);
-//        ExpressInfoDTO expressInfoDTO=null;
-//        if(StringUtils.isNotEmpty(order.getDeliverySn())){
-//            String lastFourNumber = "";
-//            if (order.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
-//
-//                lastFourNumber = order.getUserPhone();
-//                if (lastFourNumber.length() == 11) {
-//                    lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
-//                }else if (lastFourNumber.length()>11){
-//                    String jm = decryptPhone(lastFourNumber);
-//                    lastFourNumber = StrUtil.sub(jm, jm.length(), -4);
-//                }
-//            }
-//            expressInfoDTO=expressService.getExpressInfo(order.getOrderCode(),order.getDeliveryCode(),order.getDeliverySn(),lastFourNumber);
-//
-//            if((expressInfoDTO.getStateEx()!=null&&expressInfoDTO.getStateEx().equals("0"))&&(expressInfoDTO.getState()!=null&&expressInfoDTO.getState().equals("0"))){
-//                lastFourNumber = "19923690275";
-//                if (order.getDeliveryCode().equals(ShipperCodeEnum.SF.getValue())) {
-//                    if (lastFourNumber.length() == 11) {
-//                        lastFourNumber = StrUtil.sub(lastFourNumber, lastFourNumber.length(), -4);
-//                    }
-//                }
-//
-//                expressInfoDTO=expressService.getExpressInfo(order.getOrderCode(),order.getDeliveryCode(),order.getDeliverySn(),lastFourNumber);
-//
-//            }
-//        }
-//        return R.ok().put("data",expressInfoDTO);
-//    }
+    @PreAuthorize("@ss.hasPermi('live:liveOrder:express')")
+    @GetMapping(value = "/getExpress/{id}")
+    public R getExpress(@PathVariable("id") String id)
+    {
+        return liveOrderService.syncExpress(Long.valueOf(id));
+    }
 
     /**
      * 支付订单

+ 9 - 6
fs-service/src/main/java/com/fs/hisStore/service/IFsExpressScrmService.java

@@ -7,10 +7,11 @@ import com.fs.api.vo.ExpressVO;
 import com.fs.common.core.domain.R;
 import com.fs.hisStore.domain.FsExpressScrm;
 import com.fs.hisStore.dto.ExpressInfoDTO;
+import com.fs.hisStore.param.FsStoreOrderExpressParam;
 
 /**
  * 快递公司Service接口
- * 
+ *
  * @author fs
  * @date 2022-03-15
  */
@@ -18,7 +19,7 @@ public interface IFsExpressScrmService
 {
     /**
      * 查询快递公司
-     * 
+     *
      * @param id 快递公司ID
      * @return 快递公司
      */
@@ -26,7 +27,7 @@ public interface IFsExpressScrmService
 
     /**
      * 查询快递公司列表
-     * 
+     *
      * @param fsExpress 快递公司
      * @return 快递公司集合
      */
@@ -34,7 +35,7 @@ public interface IFsExpressScrmService
 
     /**
      * 新增快递公司
-     * 
+     *
      * @param fsExpress 快递公司
      * @return 结果
      */
@@ -42,7 +43,7 @@ public interface IFsExpressScrmService
 
     /**
      * 修改快递公司
-     * 
+     *
      * @param fsExpress 快递公司
      * @return 结果
      */
@@ -50,7 +51,7 @@ public interface IFsExpressScrmService
 
     /**
      * 批量删除快递公司
-     * 
+     *
      * @param ids 需要删除的快递公司ID
      * @return 结果
      */
@@ -78,4 +79,6 @@ public interface IFsExpressScrmService
 
 
     List<ExpressVO> getExpressInfoAPI(ExpressParam param);
+
+    R getLiveExpressByDeliverId(FsStoreOrderExpressParam param);
 }

+ 1 - 1
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -1561,7 +1561,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         // 由于套餐制单前面有生成oderkey,并且要取修改的价格,所以这里判断,如果有传就用传的orderkey,如果没有就生成(代表走的是直接购买)
         String uuid;
         BigDecimal totalMoney;
-        if(param.getCreateOrderKey().isEmpty() ){
+        if(StringUtils.isEmpty(param.getCreateOrderKey())){
             //直接购买
             uuid = IdUtil.randomUUID();
             totalMoney = storeProductPackage.getPayMoney();