‘linchangsheng’ 6 months ago
parent
commit
7ba0639c97

+ 0 - 3
src/main/java/com/zfire/mall/manager/bean/front/CustomerOrderBean.java

@@ -22,9 +22,6 @@ public class CustomerOrderBean {
      @ApiModelProperty(value = "同步嘉贤状态")
      private SyncStatusEnum syncStatus;
  */
-    @ZfireField(tbName = "co")
-    @ApiModelProperty(value = "嘉贤订单号")
-    private String jiaxianOrderId;
 
     @ZfireField(tbName = "co")
     @ApiModelProperty(value = "客户销售单号")

+ 2 - 76
src/main/java/com/zfire/mall/manager/controller/customerFront/CustomerFrontOrderController.java

@@ -137,7 +137,7 @@ public class CustomerFrontOrderController {
     }
 
 
-    @PostMapping("/signIn")
+/*    @PostMapping("/signIn")
     @ApiOperation("客户销售订单签收")
     public ResponseHelper signIn(@ApiParam(required = false, value = "销售订单id") @RequestParam(required = false) String id,
                                @ApiParam(required = false, value = "1 已提交 2 待发货 3已发货 4已签收 5已退货") @RequestParam(required = false) Integer status, HttpServletRequest request) throws Exception {
@@ -152,7 +152,7 @@ public class CustomerFrontOrderController {
             obtain.unlock();
         }
         return ResponseHelper.success();
-    }
+    }*/
 
 
     @PostMapping("/update")
@@ -320,78 +320,4 @@ public class CustomerFrontOrderController {
         return ResponseHelper.success();
     }
 
-
-
-    ////////////////////////////嘉贤订单同步/////////////////////
-
-
-
-    @ApiOperation(value = "同步客户销售订单列表")
-    @PostMapping("/customerOrderPush")
-    @ApiNotAuth
-    @Sign
-    public ResponseHelper<String> customerOrderPush(
-            @ApiParam(required = false, value = "更新时间,秒级别") @RequestParam(required = false) String encrypted
-    ) throws Exception {
-        CustomerOrderPushBean customerOrderBeanIPage = customerFrontOrderLogic.listPush(encrypted);
-        String pi = JSONUtil.toJsonStr(customerOrderBeanIPage);
-        return ResponseHelper.success(pi);
-    }
-
-
-    @ApiOperation(value = "同步客户销售退货单列表")
-    @PostMapping("/orderRefundPush")
-    @ApiNotAuth
-    @Sign
-    public ResponseHelper<String> orderRefundPush(
-            @ApiParam(required = false, value = "更新时间,秒级别") @RequestParam(required = false) String encrypted
-    ) throws Exception {
-        CustomerOrderRefundPushBean customerOrderBeanIPage = customerFrontOrderLogic.orderRefundPush(encrypted);
-        String pi = JSONUtil.toJsonStr(customerOrderBeanIPage);
-        return ResponseHelper.success(pi);
-    }
-
-
-    @ApiOperation(value = "同步库存调整列表")
-    @PostMapping("/customerStockAcc")
-    @ApiNotAuth
-    @Sign
-    public ResponseHelper<String> customerStockAcc(
-            @ApiParam(required = false, value = "更新时间,秒级别") @RequestParam(required = false) String encrypted
-    ) throws Exception {
-        CustomerStockOrderPushBean customerOrderBeanIPage = customerFrontOrderLogic.customerStockAcc(encrypted);
-        String pi = JSONUtil.toJsonStr(customerOrderBeanIPage);
-        return ResponseHelper.success(pi);
-    }
-
-
-
-    ////////////////////////////////物流接口 /////////////////////////
-
-    @ZfireList
-    @PostMapping("/orderTrackList")
-    @ApiOperation("物流信息获取")
-    public ResponseHelper<IPage<OrderTrackTocBean>> orderTrackList(
-            @RequestBody ZfireParamBean zfireParamBean
-    ) throws RemoteServiceException {
-        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
-        IPage<OrderTrackTocBean> customerOrderBeanIPage = customerFrontOrderLogic.orderTrackList(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
-        return ResponseHelper.success(customerOrderBeanIPage, new TypeReference<OrderTrackTocBean>() {});
-    }
-
-    @PostMapping("/orderTrackList/export")
-    @ApiOperation("物流信息获取导出")
-    public void orderTrackListExport(
-            @RequestBody ZfireParamBean zfireParamBean,
-            HttpServletRequest request,
-            HttpServletResponse response
-    ) throws Exception {
-        //1.组装查询条件
-        ZfireParamBean zfireParam = FieldUtils.supplyParam(zfireParamBean);
-        //2.查询要导出的内容
-        IPage<OrderTrackTocBean> stockBeanIPage = customerFrontOrderLogic.orderTrackList(new Page(zfireParam.getPageNum(), zfireParam.getPageSize()), zfireParam);
-        //3.导出
-        FieldUtils.exportData(stockBeanIPage.getRecords(), zfireParam.getExportFields(), request, response);
-    }
-
 }

+ 11 - 111
src/main/java/com/zfire/mall/manager/logic/front/CustomerFrontOrderLogic.java

@@ -177,8 +177,9 @@ public class CustomerFrontOrderLogic {
 
         }
         customerOrderItemService.saveBatch(customerOrderDetail.getOrders());
-        if (customerOrderDetail.getStockType().equals(CustomerStockEnum.NO.getKey()))
-            gongdanLogic.installOrder(customerOrderDetail.getId());
+
+      /*  if (customerOrderDetail.getStockType().equals(CustomerStockEnum.NO.getKey()))
+            gongdanLogic.installOrder(customerOrderDetail.getId());*/
         return customerOrderDetail.getId();
     }
 
@@ -314,7 +315,7 @@ public class CustomerFrontOrderLogic {
     public void send(String id, Integer status) throws Exception {
 
         CustomerOrder customerOrderOne = customerOrderService.getById(id);
-        if (!customerOrderOne.getStatus().equals(1) || customerOrderOne.getStockType().equals(2))
+        if (!customerOrderOne.getStatus().equals(1) )
             throw new RemoteServiceException("订单不为嘉贤仓或提交状态,不能通知发货");
 
         List<CustomerOrderItem> list = customerOrderItemService.lambdaQuery().eq(CustomerOrderItem::getOrderId, id).list();
@@ -325,6 +326,9 @@ public class CustomerFrontOrderLogic {
                     .eq(CustomerStock::getMaterialCode, customerOrderRefundItem.getMaterialCode())
                     .last("limit 1").one();
 
+            customerStock.setStockNum(customerStock.getStockNum().subtract(Convert.toBigDecimal(customerOrderRefundItem.getRealQty())));
+            if (customerStock.getStockNum().doubleValue() < 0)
+                customerStock.setStockNum(BigDecimal.ZERO);
             customerStock.updateById();
 
         }
@@ -333,52 +337,8 @@ public class CustomerFrontOrderLogic {
         customerOrderOne.setId(id);
         customerOrderOne.setStatus(status);
 
-        if (!customerOrderOne.getStockType().equals(1))
-            return;
-
-        List<CustomerOrderJiaBean> customerOrderJiaBeans = new ArrayList<>();
-
-
-        CustomerOrderJiaBean customerOrderJiaBean = new CustomerOrderJiaBean();
-        customerOrderJiaBean.setReceiptAddress(customerOrderOne.getReceAddress());
-
-        customerOrderJiaBean.setRequireDeliveryDate(Convert.toStr(customerOrderOne.getPickTime().getTime()));
-        customerOrderJiaBean.setMerchantName(customerOrderOne.getCustomerName());
-        customerOrderJiaBean.setMerchantCode(customerOrderOne.getCustomerNumber());
-        customerOrderJiaBean.setCustomerName(customerOrderOne.getUserName());
-        customerOrderJiaBean.setCustomerPhone(customerOrderOne.getPhone());
-        customerOrderJiaBean.setComment(customerOrderOne.getNotes());
-        customerOrderJiaBean.setProvince(customerOrderOne.getProvince());
-        customerOrderJiaBean.setCity(customerOrderOne.getCity());
-        customerOrderJiaBean.setArea(customerOrderOne.getArea());
-        customerOrderJiaBean.setStreet(customerOrderOne.getStreet());
-
-        List<SaleOrderJsonListDto> saleOrderJsonListDtos = new ArrayList<>();
-        for (CustomerOrderItem customerOrderItem : list) {
-            SaleOrderJsonListDto saleOrderJsonListDto = new SaleOrderJsonListDto();
-            saleOrderJsonListDto.setMaterialCode(customerOrderItem.getMaterialOldNumber());
-            saleOrderJsonListDto.setMaterialName(customerOrderItem.getMaterialName());
-            saleOrderJsonListDto.setDeliveredNumber(customerOrderItem.getQty());
-            saleOrderJsonListDtos.add(saleOrderJsonListDto);
-        }
-        customerOrderJiaBean.setSaleOrderDetailList(saleOrderJsonListDtos);
-
-
-        customerOrderJiaBeans.add(customerOrderJiaBean);
-
-
-        try {
-            List<String> strings = jiaXianUtils.apiSaleOrderSave(customerOrderJiaBeans);
-            customerOrderOne.setSyncStatus("OK");
-            customerOrderOne.setJiaxianOrderId(strings.get(0));
-            customerOrderOne.setStatus(status);
-            customerOrderOne.updateById();
-        } catch (Exception e) {
-
-            throw new RemoteServiceException(e.getMessage());
-        }
+        //todo下推工单
 
-        gongdanLogic.installOrder(customerOrderOne.getId());
 
     }
 
@@ -420,59 +380,6 @@ public class CustomerFrontOrderLogic {
         customerOrder.updateById();
 
 
-        if (!customerOrderOne.getStockType().equals(1))
-            return;
-
-        List<SaleOrderReturnJsonList> customerOrderJiaBeans = new ArrayList<>();
-
-
-        SaleOrderReturnJsonList customerOrderJiaBean = new SaleOrderReturnJsonList();
-        customerOrderJiaBean.setReceiptAddress(customerOrderOne.getReceAddress());
-
-        CustomerOrder byId = customerOrderService.getById(customerOrderOne.getCustomerOrderNo());
-
-        customerOrderJiaBean.setPickUpDate(Convert.toStr(customerOrderOne.getPickTime().getTime()));
-        customerOrderJiaBean.setMerchantName(customerOrderOne.getCustomerName());
-        customerOrderJiaBean.setMerchantCode(customerOrderOne.getCustomerNumber());
-        customerOrderJiaBean.setCustomerName(customerOrderOne.getUserName());
-        customerOrderJiaBean.setCustomerPhone(customerOrderOne.getPhone());
-        customerOrderJiaBean.setComment(customerOrderOne.getRefundRemark());
-        customerOrderJiaBean.setProvince(customerOrderOne.getProvince());
-        customerOrderJiaBean.setCity(customerOrderOne.getCity());
-        customerOrderJiaBean.setArea(customerOrderOne.getArea());
-        customerOrderJiaBean.setStreet(customerOrderOne.getStreet());
-        customerOrderJiaBean.setSaleOrderCode(byId.getJiaxianOrderId());
-
-        List<SaleOrderReturnDetailList> saleOrderJsonListDtos = new ArrayList<>();
-        for (CustomerOrderRefundItem customerOrderItem : list) {
-
-            CustomerOrderItem one = customerOrderItemService.lambdaQuery().eq(CustomerOrderItem::getOrderId, customerOrderOne.getCustomerOrderNo())
-                    .eq(CustomerOrderItem::getMaterialId, customerOrderItem.getMaterialId()).last("limit 1").one();
-
-            SaleOrderReturnDetailList saleOrderJsonListDto = new SaleOrderReturnDetailList();
-            saleOrderJsonListDto.setMaterialCode(customerOrderItem.getMaterialOldNumber());
-            saleOrderJsonListDto.setMaterialName(customerOrderItem.getMaterialName());
-            saleOrderJsonListDto.setMaterialSpecification(customerOrderItem.getSpecification());
-            saleOrderJsonListDto.setDeliveredNumber(one.getQty());
-            saleOrderJsonListDto.setReturnNumber(customerOrderItem.getQty());
-            saleOrderJsonListDtos.add(saleOrderJsonListDto);
-        }
-        customerOrderJiaBean.setSaleOrderReturnDetailList(saleOrderJsonListDtos);
-
-
-        customerOrderJiaBeans.add(customerOrderJiaBean);
-
-
-        try {
-            List<String> strings = jiaXianUtils.apiSaleOrderReturnSave(customerOrderJiaBeans);
-            customerOrderOne.setSyncStatus("OK");
-            customerOrderOne.setJiaxianOrderId(strings.get(0));
-            customerOrderOne.setStatus(status);
-            customerOrderOne.updateById();
-        } catch (Exception e) {
-
-            throw new RemoteServiceException(e.getMessage());
-        }
     }
 
     @Transactional(rollbackFor = Exception.class)
@@ -717,6 +624,8 @@ public class CustomerFrontOrderLogic {
                     .eq(CustomerStock::getMaterialCode, customerOrderRefundItem.getMaterialCode())
                     .last("limit 1").one();
 
+            customerStock.setStockNum(customerStock.getStockNum().add(Convert.toBigDecimal(customerOrderRefundItem.getRealQty())));
+
             customerStock.updateById();
 
         }
@@ -725,16 +634,7 @@ public class CustomerFrontOrderLogic {
         customerOrder.setStatus(status);
         customerOrder.updateById();
 
-        if (!customerOrderOne.getStockType().equals(1))
-            return;
-
-        List<String> orderId = new ArrayList<>();
-        orderId.add(customerOrderOne.getJiaxianOrderId());
-        try {
-            jiaXianUtils.apiSaleOrderRemove(orderId);
-        } catch (Exception e) {
-            throw new RemoteServiceException(e.getMessage());
-        }
+      //todo 取消工单
     }
 
     public IPage<OrderTrackTocBean> orderTrackList(Page page, ZfireParamBean zfireParam) {

+ 3 - 0
src/main/java/com/zfire/mall/manager/logic/k3/K3MaterialLogic.java

@@ -235,6 +235,9 @@ public class K3MaterialLogic {
                 throw new RemoteServiceException(kingDeeMaterial.getCategoryNumber()+"未查到对应编号得存货类别");
             }
 
+            KingDeeCategory kingDeeCategory = list.stream().filter(item -> item.getNumber().equals(kingDeeMaterial.getCategoryNumber())).collect(Collectors.toList()).get(0);
+
+            kingDeeMaterial.setCategoryNumber(kingDeeCategory.getId());
 
             kingDeeMaterial.setCategoryName((String)row.get(9));
             kingDeeMaterial.setBaseUnitCode((String)row.get(10));