Explorar o código

Merge remote-tracking branch 'origin/master'

caozj %!s(int64=2) %!d(string=hai) anos
pai
achega
764099689d
Modificáronse 18 ficheiros con 326 adicións e 17 borrados
  1. 44 0
      hx-common/src/main/java/com/fjhx/common/controller/currency/CurrencyRateController.java
  2. 33 0
      hx-common/src/main/java/com/fjhx/common/entity/currency/po/CurrencyRate.java
  3. 16 0
      hx-common/src/main/java/com/fjhx/common/mapper/currency/CurrencyRateMapper.java
  4. 28 0
      hx-common/src/main/java/com/fjhx/common/service/currency/CurrencyRateService.java
  5. 32 0
      hx-common/src/main/java/com/fjhx/common/service/currency/impl/CurrencyRateServiceImpl.java
  6. 5 0
      hx-common/src/main/resources/mapper/currency/CurrencyRateMapper.xml
  7. 41 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/deliver/DeliverGoodsPo.java
  8. 5 0
      hx-purchase/src/main/java/com/fjhx/purchase/entity/subscribe/dto/SubscribeDetailSelectDto.java
  9. 2 1
      hx-purchase/src/main/java/com/fjhx/purchase/entity/subscribe/vo/SubscribeDetailVo.java
  10. 9 0
      hx-purchase/src/main/java/com/fjhx/purchase/service/WdlyService.java
  11. 16 7
      hx-purchase/src/main/java/com/fjhx/purchase/service/arrival/impl/ArrivalServiceImpl.java
  12. 19 0
      hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/impl/SubscribeDetailServiceImpl.java
  13. 57 2
      hx-sale/src/main/java/com/fjhx/sale/flow/PurchaseFlowByWdly.java
  14. 1 1
      hx-supply/src/main/java/com/fjhx/supply/entity/supplier/po/SupplierInfo.java
  15. 1 1
      hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/entity/order/po/OrderInfo.java
  16. 13 3
      hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/service/WdlyServiceImpl.java
  17. 3 2
      hx-wms/src/main/java/com/fjhx/wms/service/stock/impl/StockServiceImpl.java
  18. 1 0
      hx-wms/src/main/resources/mapper/stock/StockMapper.xml

+ 44 - 0
hx-common/src/main/java/com/fjhx/common/controller/currency/CurrencyRateController.java

@@ -0,0 +1,44 @@
+package com.fjhx.common.controller.currency;
+
+import com.fjhx.common.entity.currency.po.CurrencyRate;
+import com.fjhx.common.service.currency.CurrencyRateService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 币种默认汇率 前端控制器
+ * </p>
+ *
+ * @author
+ * @since 2023-04-24
+ */
+@RestController
+@RequestMapping("/currencyRate")
+public class CurrencyRateController {
+
+    @Autowired
+    private CurrencyRateService currencyRateService;
+
+    /**
+     * 币种默认汇率列表
+     */
+    @PostMapping("/list")
+    public List<CurrencyRate> list() {
+        return currencyRateService.getList();
+    }
+
+    /**
+     * 币种默认汇率编辑
+     */
+    @PostMapping("/edit")
+    public void edit(@RequestBody List<CurrencyRate> currencyRateList) {
+        currencyRateService.edit(currencyRateList);
+    }
+
+}

+ 33 - 0
hx-common/src/main/java/com/fjhx/common/entity/currency/po/CurrencyRate.java

@@ -0,0 +1,33 @@
+package com.fjhx.common.entity.currency.po;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.core.domain.BasePo;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+
+/**
+ * <p>
+ * 币种默认汇率
+ * </p>
+ *
+ * @author
+ * @since 2023-04-24
+ */
+@Getter
+@Setter
+@TableName("currency_rate")
+public class CurrencyRate extends BasePo {
+
+    /**
+     * 币种类型
+     */
+    private String type;
+
+    /**
+     * 汇率
+     */
+    private BigDecimal rate;
+
+}

+ 16 - 0
hx-common/src/main/java/com/fjhx/common/mapper/currency/CurrencyRateMapper.java

@@ -0,0 +1,16 @@
+package com.fjhx.common.mapper.currency;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fjhx.common.entity.currency.po.CurrencyRate;
+
+/**
+ * <p>
+ * 币种默认汇率 Mapper 接口
+ * </p>
+ *
+ * @author
+ * @since 2023-04-24
+ */
+public interface CurrencyRateMapper extends BaseMapper<CurrencyRate> {
+
+}

+ 28 - 0
hx-common/src/main/java/com/fjhx/common/service/currency/CurrencyRateService.java

@@ -0,0 +1,28 @@
+package com.fjhx.common.service.currency;
+
+import com.fjhx.common.entity.currency.po.CurrencyRate;
+import com.ruoyi.common.core.service.BaseService;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 币种默认汇率 服务类
+ * </p>
+ *
+ * @author
+ * @since 2023-04-24
+ */
+public interface CurrencyRateService extends BaseService<CurrencyRate> {
+
+    /**
+     * 币种默认汇率列表
+     */
+    List<CurrencyRate> getList();
+
+    /**
+     * 币种默认汇率编辑
+     */
+    void edit(List<CurrencyRate> currencyRateList);
+
+}

+ 32 - 0
hx-common/src/main/java/com/fjhx/common/service/currency/impl/CurrencyRateServiceImpl.java

@@ -0,0 +1,32 @@
+package com.fjhx.common.service.currency.impl;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fjhx.common.entity.currency.po.CurrencyRate;
+import com.fjhx.common.mapper.currency.CurrencyRateMapper;
+import com.fjhx.common.service.currency.CurrencyRateService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * <p>
+ * 币种默认汇率 服务实现类
+ * </p>
+ *
+ * @author
+ * @since 2023-04-24
+ */
+@Service
+public class CurrencyRateServiceImpl extends ServiceImpl<CurrencyRateMapper, CurrencyRate> implements CurrencyRateService {
+
+    @Override
+    public List<CurrencyRate> getList() {
+        return list();
+    }
+
+    @Override
+    public void edit(List<CurrencyRate> currencyRateList) {
+        saveOrUpdateBatch(currencyRateList);
+    }
+
+}

+ 5 - 0
hx-common/src/main/resources/mapper/currency/CurrencyRateMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.common.mapper.currency.CurrencyRateMapper">
+
+</mapper>

+ 41 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/deliver/DeliverGoodsPo.java

@@ -0,0 +1,41 @@
+package com.fjhx.purchase.entity.deliver;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.ruoyi.common.core.domain.BasePo;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * <p>
+ * 发货
+ * </p>
+ *
+ * @author 
+ * @since 2023-04-13
+ */
+@Getter
+@Setter
+@TableName("deliver_goods")
+public class DeliverGoodsPo extends BasePo {
+
+    /**
+     * 物流公司编号
+     */
+    private String logisticsCompanyCode;
+
+    /**
+     * 物流单号
+     */
+    private String code;
+
+    /**
+     * 采购单号
+     */
+    private Long purchaseId;
+
+    /**
+     * 状态 0未到货 1到货
+     */
+    private Integer status;
+
+}

+ 5 - 0
hx-purchase/src/main/java/com/fjhx/purchase/entity/subscribe/dto/SubscribeDetailSelectDto.java

@@ -30,4 +30,9 @@ public class SubscribeDetailSelectDto extends BaseSelectDto {
      * id集合
      */
     private List<Long> ids;
+
+    /**
+     * 收货仓库id过滤
+     */
+    private Long receiptWarehouseId;
 }

+ 2 - 1
hx-purchase/src/main/java/com/fjhx/purchase/entity/subscribe/vo/SubscribeDetailVo.java

@@ -4,6 +4,7 @@ import com.fjhx.purchase.entity.subscribe.po.SubscribeDetail;
 import lombok.Getter;
 import lombok.Setter;
 
+import java.math.BigDecimal;
 import java.util.Date;
 
 /**
@@ -44,7 +45,7 @@ public class SubscribeDetailVo extends SubscribeDetail {
     /**
      * 采购数量
      */
-    private String purchaseCount;
+    private BigDecimal purchaseCount;
 
     /**
      * 维多利亚扩展json

+ 9 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/WdlyService.java

@@ -1,8 +1,17 @@
 package com.fjhx.purchase.service;
 
+import com.fjhx.purchase.entity.deliver.DeliverGoodsPo;
+
 public interface WdlyService {
     /**
      * 修改发货记录为到货
      */
     void updateDeliverGoodsStatus(Long id);
+
+    /**
+     * 获取发货信息
+     *
+     * @return
+     */
+    DeliverGoodsPo getDeliverGoodsInfo(Long id);
 }

+ 16 - 7
hx-purchase/src/main/java/com/fjhx/purchase/service/arrival/impl/ArrivalServiceImpl.java

@@ -19,6 +19,7 @@ import com.fjhx.purchase.entity.arrival.dto.ArrivalSelectDto;
 import com.fjhx.purchase.entity.arrival.po.Arrival;
 import com.fjhx.purchase.entity.arrival.po.ArrivalDetail;
 import com.fjhx.purchase.entity.arrival.vo.ArrivalVo;
+import com.fjhx.purchase.entity.deliver.DeliverGoodsPo;
 import com.fjhx.purchase.entity.purchase.po.Purchase;
 import com.fjhx.purchase.entity.purchase.po.PurchaseDetail;
 import com.fjhx.purchase.entity.subscribe.po.Subscribe;
@@ -37,6 +38,7 @@ import com.fjhx.wms.entity.stock.po.StockWait;
 import com.fjhx.wms.entity.stock.po.StockWaitDetails;
 import com.fjhx.wms.service.stock.StockWaitDetailsService;
 import com.fjhx.wms.service.stock.StockWaitService;
+import com.obs.services.internal.ServiceException;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -152,21 +154,29 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
     @DSTransactional
     @Override
     public void addByWdly(Arrival arrival) {
-
         arrival.setCode(CodeEnum.ARRIVAL.getCode());
         this.save(arrival);
 
         //修改采购状态
-        Purchase purchase = new Purchase();
-        purchase.setArrivalStatus(arrival.getArrivalStatus());
-        purchase.setId(arrival.getPurchaseId());
-        purchaseService.updateById(purchase);
+//        Purchase purchase = new Purchase();
+//        purchase.setArrivalStatus(arrival.getArrivalStatus());
+//        purchase.setId(arrival.getPurchaseId());
+//        purchaseService.updateById(purchase);
 
         //创建待入库记录
         String victoriatouristJson = arrival.getVictoriatouristJson();
         JSONObject json = JSONObject.parseObject(victoriatouristJson);
+        Long deliverGoodsId = json.getLong("deliverGoodsId");
+
+        if(ObjectUtil.isEmpty(deliverGoodsId)){
+            throw new ServiceException("发货id不能为空");
+        }
+
+        //查询发货信息 获取 采购id
+        DeliverGoodsPo deliverGoodsInfo = wdlyService.getDeliverGoodsInfo(deliverGoodsId);
+
         //去申购单取入库仓库id
-        PurchaseDetail one = purchaseDetailService.getOne(q -> q.eq(PurchaseDetail::getPurchaseId, arrival.getPurchaseId()));
+        PurchaseDetail one = purchaseDetailService.getOne(q -> q.eq(PurchaseDetail::getPurchaseId, deliverGoodsInfo.getPurchaseId()));
         Long subscribeDetailId = one.getSubscribeDetailId();
         SubscribeDetail byId = subscribeDetailService.getById(subscribeDetailId);
         Subscribe byId1 = subscribeService.getById(byId.getSubscribeId());
@@ -181,7 +191,6 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
         CompanyInfo logisticsCompanyCode = companyInfoService.getOne(q -> q.eq(CompanyInfo::getCode, json.getString("logisticsCompanyCode")));
         json.put("logisticsCompanyName",logisticsCompanyCode.getName());
         //修改发货记录的状态为到货
-        Long deliverGoodsId = json.getLong("deliverGoodsId");
         wdlyService.updateDeliverGoodsStatus(deliverGoodsId);
 
         //----------

+ 19 - 0
hx-purchase/src/main/java/com/fjhx/purchase/service/subscribe/impl/SubscribeDetailServiceImpl.java

@@ -9,12 +9,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.item.entity.product.vo.ProductInfoVo;
 import com.fjhx.item.service.product.ProductInfoService;
+import com.fjhx.purchase.entity.purchase.po.PurchaseDetail;
 import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailDto;
 import com.fjhx.purchase.entity.subscribe.dto.SubscribeDetailSelectDto;
 import com.fjhx.purchase.entity.subscribe.po.Subscribe;
 import com.fjhx.purchase.entity.subscribe.po.SubscribeDetail;
 import com.fjhx.purchase.entity.subscribe.vo.SubscribeDetailVo;
 import com.fjhx.purchase.mapper.subscribe.SubscribeDetailMapper;
+import com.fjhx.purchase.service.purchase.PurchaseDetailService;
 import com.fjhx.purchase.service.subscribe.SubscribeDetailService;
 import com.fjhx.wms.entity.warehouse.po.Warehouse;
 import com.fjhx.wms.service.warehouse.WarehouseService;
@@ -25,6 +27,7 @@ import org.apache.commons.collections4.MapUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
@@ -48,6 +51,8 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
     private ProductInfoService productInfoService;
     @Autowired
     WarehouseService warehouseService;
+    @Autowired
+    PurchaseDetailService purchaseDetailService;
 
     /**
      * 分页
@@ -82,6 +87,8 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
         if (StringUtils.isNotEmpty(dto.getKeyword())) {
             wrapper.like("t2", Subscribe::getCode, dto.getKeyword());
         }
+        //维多利亚扩展根据到货仓库id过滤
+        wrapper.eq("json_unquote(t2.victoriatourist_json -> '$.receiptWarehouseId')", dto.getReceiptWarehouseId());
         wrapper.orderByDesc("t1", SubscribeDetail::getCreateTime);
         Page<SubscribeDetailVo> page = this.baseMapper.getPage(dto.getPage(), wrapper);
         List<SubscribeDetailVo> list = page.getRecords();
@@ -106,6 +113,9 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
     public Page<SubscribeDetailVo> getPageByWdly(SubscribeDetailSelectDto dto) {
         Page<SubscribeDetailVo> page = getPage(dto);
         List<SubscribeDetailVo> records = page.getRecords();
+        if (ObjectUtil.isEmpty(records)) {
+            return page;
+        }
 
         //获取到货仓库id列表
         List<Long> wids = new ArrayList<>();
@@ -129,6 +139,15 @@ public class SubscribeDetailServiceImpl extends ServiceImpl<SubscribeDetailMappe
                 }
             }
         }
+        //赋值采购数量
+        for (SubscribeDetailVo record : records) {
+            List<PurchaseDetail> list = purchaseDetailService.list(q -> q.eq(PurchaseDetail::getSubscribeDetailId, record.getId()));
+            BigDecimal count = list.stream()
+                    .map(PurchaseDetail::getCount)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add);
+            record.setPurchaseCount(count);
+        }
+
         return page;
     }
 

+ 57 - 2
hx-sale/src/main/java/com/fjhx/sale/flow/PurchaseFlowByWdly.java

@@ -12,6 +12,7 @@ import com.fjhx.purchase.entity.purchase.enums.PurchaseDetailStatusEnum;
 import com.fjhx.purchase.entity.purchase.enums.PurchaseStatusEnum;
 import com.fjhx.purchase.entity.purchase.po.Purchase;
 import com.fjhx.purchase.entity.purchase.po.PurchaseDetail;
+import com.fjhx.purchase.entity.subscribe.enums.SubscribeDetailStatusEnum;
 import com.fjhx.purchase.entity.subscribe.po.Subscribe;
 import com.fjhx.purchase.entity.subscribe.po.SubscribeDetail;
 import com.fjhx.purchase.service.purchase.PurchaseDetailService;
@@ -29,6 +30,9 @@ import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.stream.Collectors;
 
 /**
  * 采购流程
@@ -51,6 +55,8 @@ public class PurchaseFlowByWdly extends FlowDelegate {
     private SubscribeService subscribeService;
     @Autowired
     private SubscribeDetailService subscribeDetailService;
+    @Autowired
+    private ContractProductService contractProductService;
 
     @Override
     public String getFlowKey() {
@@ -99,7 +105,7 @@ public class PurchaseFlowByWdly extends FlowDelegate {
             JSONObject json1 = JSONObject.parseObject(victoriatouristJson1);
             json1.put("receiptWarehouseId",receiptWarehouseId);
             purchase.setVictoriatouristJson(json1.toJSONString());
-            purchaseService.save(purchase);
+            purchaseService.updateById(purchase);
         }
         DynamicDataSourceContextHolder.poll();
         return purchase.getId();
@@ -113,7 +119,56 @@ public class PurchaseFlowByWdly extends FlowDelegate {
      */
     @Override
     public void end(Long flowId, Long businessId, JSONObject submitData) {
-        purchaseFlow.end(flowId,businessId,submitData);
+        //修改申购明细状态
+        List<PurchaseDetail> purchaseDetailList = purchaseDetailService.list(Wrappers.<PurchaseDetail>query().lambda().eq(PurchaseDetail::getPurchaseId,businessId));
+        Map<Long, PurchaseDetail> purchaseDetailMap = purchaseDetailList.stream().collect(Collectors.toMap(PurchaseDetail::getSubscribeDetailId, Function.identity()));
+        List<Long> subscribeDetailIds = purchaseDetailList.stream().map(PurchaseDetail::getSubscribeDetailId).collect(Collectors.toList());
+        List<SubscribeDetail> subscribeDetails = subscribeDetailService.listByIds(subscribeDetailIds);
+        for (SubscribeDetail subscribeDetail : subscribeDetails) {
+            PurchaseDetail purchaseDetail = purchaseDetailMap.get(subscribeDetail.getId());
+            if(purchaseDetail.getCount()==subscribeDetail.getCount()){
+                //修改为已采购
+                subscribeDetail.setStatus(SubscribeDetailStatusEnum.PURCHASED.getKey());
+            }else{
+                //修改为部分采购
+                subscribeDetail.setStatus(SubscribeDetailStatusEnum.LITT_PAID_AMOUNT.getKey());
+            }
+        }
+        subscribeDetailService.updateBatchById(subscribeDetails);
+//        purchaseFlow.end(flowId,businessId,submitData);
+
+        //通过业务ID查询采购数据
+        Purchase purchase = purchaseService.getById(businessId);
+        if(ObjectUtils.isEmpty(purchase)){
+            throw new ServiceException("采购单不存在");
+        }
+        //查询采购产品
+//        List<PurchaseDetail> purchaseDetailList = purchaseDetailService.list(Wrappers.<PurchaseDetail>query().lambda().eq(PurchaseDetail::getPurchaseId,businessId));
+        List<ContractProduct> upContractProduct = new ArrayList<>();
+        for(PurchaseDetail p:purchaseDetailList){
+            if(ObjectUtils.isNotEmpty(p.getDataResourceId())&&
+                    p.getDataResource()== PurchaseDataResourceEnum.DATA_RESOURCE_1.getKey()){//如果采购的是外销合同
+                ContractProduct contractProduct = contractProductService.getById(p.getDataResourceId());
+                BigDecimal expendQuantity = contractProduct.getExpendQuantity().subtract(p.getCount());
+                if(expendQuantity.compareTo(BigDecimal.ZERO)< 1){//小于0不让继续执行
+                    throw new ServiceException("采购数量不得大于外销合同数量");
+                }
+                contractProduct.setExpendQuantity(expendQuantity);
+                upContractProduct.add(contractProduct);
+            }
+        }
+        if(CollectionUtils.isNotEmpty(upContractProduct)){//扣减销售合同数量
+            contractProductService.updateBatchById(upContractProduct);
+        }
+        //修改采购状态为审批通过
+        purchase.setPurchaseStatus(PurchaseStatusEnum.PASS.getKey());
+        purchase.setApprovedDate(new Date());
+        purchaseService.updateById(purchase);
+        //修改采购明细为待采购
+        PurchaseDetail detail = new PurchaseDetail();
+        detail.setStatus(PurchaseDetailStatusEnum.PASS.getKey());
+        purchaseDetailService.update(detail,Wrappers.<PurchaseDetail>query()
+                .lambda().eq(PurchaseDetail::getPurchaseId,purchase.getId()));
     }
 
 }

+ 1 - 1
hx-supply/src/main/java/com/fjhx/supply/entity/supplier/po/SupplierInfo.java

@@ -26,7 +26,7 @@ public class SupplierInfo extends BasePo {
     /**
      * 供应商类型 1贸易商 2工厂
      */
-    private Integer type;
+    private String type;
 
     /**
      * 供应商名称

+ 1 - 1
hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/entity/order/po/OrderInfo.java

@@ -23,7 +23,7 @@ public class OrderInfo extends BasePo {
     /**
      * 订单类型(1线上 2线下 3京东订单 4补偿 5补发 6线下退换货 7采购退货)
      */
-    private Integer type;
+    private String type;
 
     /**
      * 客户id

+ 13 - 3
hx-victoriatourist/src/main/java/com/fjhx/victoriatourist/service/WdlyServiceImpl.java

@@ -1,20 +1,30 @@
 package com.fjhx.victoriatourist.service;
 
-import cn.hutool.extra.spring.SpringUtil;
+import cn.hutool.core.bean.BeanUtil;
+import com.fjhx.purchase.entity.deliver.DeliverGoodsPo;
 import com.fjhx.purchase.service.WdlyService;
 import com.fjhx.victoriatourist.entity.deliver.po.DeliverGoods;
 import com.fjhx.victoriatourist.service.deliver.DeliverGoodsService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 @Service
 public class WdlyServiceImpl implements WdlyService {
+    @Autowired
+    DeliverGoodsService deliverGoodsService;
+
     /**更新发货记录的状态为到货*/
     @Override
     public void updateDeliverGoodsStatus(Long id) {
-        DeliverGoodsService deliverGoodsService = SpringUtil.getBean(DeliverGoodsService.class);
-
         DeliverGoods byId = deliverGoodsService.getById(id);
         byId.setStatus(1);
         deliverGoodsService.updateById(byId);
     }
+
+    @Override
+    public DeliverGoodsPo getDeliverGoodsInfo(Long id) {
+        DeliverGoods byId = deliverGoodsService.getById(id);
+        DeliverGoodsPo deliverGoodsPo = BeanUtil.copyProperties(byId, DeliverGoodsPo.class);
+        return deliverGoodsPo;
+    }
 }

+ 3 - 2
hx-wms/src/main/java/com/fjhx/wms/service/stock/impl/StockServiceImpl.java

@@ -197,12 +197,13 @@ public class StockServiceImpl extends ServiceImpl<StockMapper, Stock> implements
     @Override
     public Page<StockVo> pageByProductSpu(StockSelectDto dto) {
         IWrapper<Stock> wrapper = getWrapper();
-        wrapper.orderByDesc("s", Stock::getId);
         wrapper.eq(Stock::getWarehouseId, dto.getId());
         wrapper.like(Stock::getQuantity, dto.getKeyword());
         wrapper.eq("pi.definition", dto.getDefinition());
-        wrapper.isNotNull("pi.product_spu_id");
+        wrapper.isNotNull("ps.id");
         wrapper.groupBy("pi.product_spu_id");
+        wrapper.orderByDesc("s", Stock::getId);
+
 
         Page<StockVo> page = this.baseMapper.pageByProductSpu(dto.getPage(), wrapper);
         List<StockVo> stockVos = page.getRecords();

+ 1 - 0
hx-wms/src/main/resources/mapper/stock/StockMapper.xml

@@ -51,6 +51,7 @@
             stock s
                 LEFT JOIN bytesailing_item.product_info pi ON s.product_id = pi.id
                 LEFT JOIN bytesailing_item.product_spu ps ON pi.product_spu_id = ps.id
+            ${ew.customSqlSegment}
     </select>
 
 </mapper>