Browse Source

清理wdly代码

yzc 1 year ago
parent
commit
26b22c9ab6

+ 0 - 5
hx-admin/pom.xml

@@ -76,11 +76,6 @@
 
 
         <dependency>
         <dependency>
             <groupId>com.fjhx</groupId>
             <groupId>com.fjhx</groupId>
-            <artifactId>hx-victoriatourist</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>com.fjhx</groupId>
             <artifactId>hx-dingding</artifactId>
             <artifactId>hx-dingding</artifactId>
         </dependency>
         </dependency>
 
 

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

@@ -1,22 +1,22 @@
-package com.fjhx.purchase.service;
-
-import com.fjhx.purchase.entity.deliver.DeliverGoodsDetailsPo;
-import com.fjhx.purchase.entity.deliver.DeliverGoodsPo;
-
-import java.util.List;
-
-public interface WdlyService {
-    /**
-     * 修改发货记录为到货
-     */
-    void updateDeliverGoodsStatus(Long id);
-
-    /**
-     * 获取发货信息
-     */
-    DeliverGoodsPo getDeliverGoodsInfo(Long id);
-
-    List<DeliverGoodsDetailsPo> getDeliverGoodsDetailsInfo(Long id);
-
-    void addAbnormalInfo(Long linkId, String linkCode);
-}
+//package com.fjhx.purchase.service;
+//
+//import com.fjhx.purchase.entity.deliver.DeliverGoodsDetailsPo;
+//import com.fjhx.purchase.entity.deliver.DeliverGoodsPo;
+//
+//import java.util.List;
+//
+//public interface WdlyService {
+//    /**
+//     * 修改发货记录为到货
+//     */
+//    void updateDeliverGoodsStatus(Long id);
+//
+//    /**
+//     * 获取发货信息
+//     */
+//    DeliverGoodsPo getDeliverGoodsInfo(Long id);
+//
+//    List<DeliverGoodsDetailsPo> getDeliverGoodsDetailsInfo(Long id);
+//
+//    void addAbnormalInfo(Long linkId, String linkCode);
+//}

+ 159 - 179
hx-purchase/src/main/java/com/fjhx/purchase/service/arrival/impl/ArrivalServiceImpl.java

@@ -1,21 +1,15 @@
 package com.fjhx.purchase.service.arrival.impl;
 package com.fjhx.purchase.service.arrival.impl;
 
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
-import cn.hutool.core.util.ObjectUtil;
-import com.alibaba.fastjson2.JSONObject;
-import com.alibaba.fastjson2.JSONWriter;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
 import com.baomidou.dynamic.datasource.annotation.DSTransactional;
-import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.fjhx.common.constant.SourceConstant;
 import com.fjhx.common.enums.CodingRuleEnum;
 import com.fjhx.common.enums.CodingRuleEnum;
 import com.fjhx.common.service.coding.CodingRuleService;
 import com.fjhx.common.service.coding.CodingRuleService;
 import com.fjhx.common.utils.Assert;
 import com.fjhx.common.utils.Assert;
 import com.fjhx.item.service.product.ProductInfoService;
 import com.fjhx.item.service.product.ProductInfoService;
-import com.fjhx.kd100.entity.company.po.CompanyInfo;
 import com.fjhx.kd100.service.company.CompanyInfoService;
 import com.fjhx.kd100.service.company.CompanyInfoService;
 import com.fjhx.purchase.entity.arrival.dto.ArrivalDto;
 import com.fjhx.purchase.entity.arrival.dto.ArrivalDto;
 import com.fjhx.purchase.entity.arrival.dto.ArrivalSelectDto;
 import com.fjhx.purchase.entity.arrival.dto.ArrivalSelectDto;
@@ -23,14 +17,8 @@ import com.fjhx.purchase.entity.arrival.po.Arrival;
 import com.fjhx.purchase.entity.arrival.po.ArrivalDetail;
 import com.fjhx.purchase.entity.arrival.po.ArrivalDetail;
 import com.fjhx.purchase.entity.arrival.vo.ArrivalDetailVo;
 import com.fjhx.purchase.entity.arrival.vo.ArrivalDetailVo;
 import com.fjhx.purchase.entity.arrival.vo.ArrivalVo;
 import com.fjhx.purchase.entity.arrival.vo.ArrivalVo;
-import com.fjhx.purchase.entity.deliver.DeliverGoodsDetailsPo;
-import com.fjhx.purchase.entity.deliver.DeliverGoodsPo;
 import com.fjhx.purchase.entity.purchase.po.Purchase;
 import com.fjhx.purchase.entity.purchase.po.Purchase;
-import com.fjhx.purchase.entity.purchase.po.PurchaseDetail;
-import com.fjhx.purchase.entity.subscribe.po.Subscribe;
-import com.fjhx.purchase.entity.subscribe.po.SubscribeDetail;
 import com.fjhx.purchase.mapper.arrival.ArrivalMapper;
 import com.fjhx.purchase.mapper.arrival.ArrivalMapper;
-import com.fjhx.purchase.service.WdlyService;
 import com.fjhx.purchase.service.arrival.ArrivalDetailService;
 import com.fjhx.purchase.service.arrival.ArrivalDetailService;
 import com.fjhx.purchase.service.arrival.ArrivalService;
 import com.fjhx.purchase.service.arrival.ArrivalService;
 import com.fjhx.purchase.service.purchase.PurchaseDetailService;
 import com.fjhx.purchase.service.purchase.PurchaseDetailService;
@@ -45,19 +33,14 @@ import com.fjhx.wms.service.stock.StockWaitDetailsService;
 import com.fjhx.wms.service.stock.StockWaitService;
 import com.fjhx.wms.service.stock.StockWaitService;
 import com.ruoyi.common.core.domain.BaseIdPo;
 import com.ruoyi.common.core.domain.BaseIdPo;
 import com.ruoyi.common.core.domain.BasePo;
 import com.ruoyi.common.core.domain.BasePo;
-import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import com.ruoyi.common.utils.wrapper.IWrapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
-import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
-import java.util.Map;
-import java.util.function.Function;
-import java.util.stream.Collectors;
 
 
 
 
 /**
 /**
@@ -84,9 +67,6 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
     private StockWaitDetailsService stockWaitDetailsService;
     private StockWaitDetailsService stockWaitDetailsService;
 
 
     @Autowired
     @Autowired
-    private WdlyService wdlyService;
-
-    @Autowired
     private SubscribeDetailService subscribeDetailService;
     private SubscribeDetailService subscribeDetailService;
 
 
     @Autowired
     @Autowired
@@ -180,167 +160,167 @@ public class ArrivalServiceImpl extends ServiceImpl<ArrivalMapper, Arrival> impl
     @DSTransactional
     @DSTransactional
     @Override
     @Override
     public void addByWdly(ArrivalDto arrival) {
     public void addByWdly(ArrivalDto arrival) {
-        //获取维多利亚json中的发货id
-        String victoriatouristJson = arrival.getVictoriatouristJson();
-        JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
-        if (ObjectUtil.isEmpty(arrival.getDeliverGoodsId())) {
-            arrival.setDeliverGoodsId(json.getLong("deliverGoodsId"));
-        }
-        //根据发货id查采购信息
-        if (ObjectUtil.isNotEmpty(arrival.getDeliverGoodsId())) {
-            DeliverGoodsPo deliverGoodsInfo = wdlyService.getDeliverGoodsInfo(arrival.getDeliverGoodsId());
-            Assert.notEmpty(deliverGoodsInfo, "查询不到发货信息");
-            arrival.setPurchaseId(deliverGoodsInfo.getPurchaseId());
-        }
-
-        if (ObjectUtil.isEmpty(arrival.getPurchaseId())) {
-            throw new ServiceException("采购id不能为空");
-        }
-        Purchase purchase0 = purchaseService.getById(arrival.getPurchaseId());
-        Assert.notEmpty(purchase0, "无法获取到采购信息");
-        arrival.setSupplyId(purchase0.getSupplyId());
-        arrival.setCode(codingRuleService.createCode(CodingRuleEnum.ARRIVAL.getKey(), null));
-//        arrival.setCode(CodeEnum.ARRIVAL.getCode());
-        arrival.setStatus(1);//设置到货
-        this.save(arrival);
-
-        //修改采购状态
-//        Purchase purchase = new Purchase();
-//        purchase.setArrivalStatus(arrival.getArrivalStatus());
-//        purchase.setId(arrival.getPurchaseId());
-//        purchaseService.updateById(purchase);
-
-        //创建待入库记录
+//        //获取维多利亚json中的发货id
 //        String victoriatouristJson = arrival.getVictoriatouristJson();
 //        String victoriatouristJson = arrival.getVictoriatouristJson();
 //        JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
 //        JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
-        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, deliverGoodsInfo.getPurchaseId()));
-        Long subscribeDetailId = one.getSubscribeDetailId();
-        SubscribeDetail byId = subscribeDetailService.getById(subscribeDetailId);
-        Subscribe byId1 = subscribeService.getById(byId.getSubscribeId());
-        String victoriatouristJson1 = byId1.getVictoriatouristJson();
-        if (ObjectUtil.isNotEmpty(victoriatouristJson1)) {
-            //去申购单取仓库id
-            JSONObject json1 = JSONObject.parseObject(victoriatouristJson1);
-            Long receiptWarehouseId = json1.getLong("receiptWarehouseId");
-            json.put("receiptWarehouseId", receiptWarehouseId);
-        }
-        //赋值物流公司名称
-        CompanyInfo logisticsCompanyCode = companyInfoService.getOne(q -> q.eq(CompanyInfo::getCode, json.getString("logisticsCompanyCode")));
-        json.put("logisticsCompanyName", logisticsCompanyCode.getName());
-        //修改发货记录的状态为到货
-        wdlyService.updateDeliverGoodsStatus(deliverGoodsId);
-
-        //获取采购信息
-        Purchase purchase = purchaseService.getById(deliverGoodsInfo.getPurchaseId());
-
-        //----------
-        StockWait stockWait = new StockWait();
-        stockWait.setType(1);//入库
-        stockWait.setStatus(0);//待入库
-        stockWait.setBusinessType(StockWaitType.PURCHASE_ARRIVAL_IN.getDetailType());//采购到货
-        //将业务信息设置成采购id和采购编码
-        stockWait.setBusinessId(purchase.getId());
-        String victoriatouristJson2 = purchase.getVictoriatouristJson();
-        JSONObject json2 = ObjectUtil.isNotEmpty(victoriatouristJson2) ? JSONObject.parseObject(victoriatouristJson2) : new JSONObject();
-//        stockWait.setBusinessCode(purchase.getCode());
-        stockWait.setBusinessCode(json2.getString("contractCode"));
-
-        json.put("arrivalId", arrival.getId());
-        json.put("arrivalCode", arrival.getCode());
-        stockWait.setVictoriatouristJson(JSONObject.toJSONString(json, JSONWriter.Feature.WriteLongAsString));
-        stockWaitService.save(stockWait);
-
-        //取出到货明细
-        List<ArrivalDetail> arrivalDetailList = arrival.getArrivalDetailList();
-        if (CollectionUtils.isEmpty(arrivalDetailList)) {
-            return;
-        }
-
-        List<StockWaitDetails> stockWaitDetailsList = new ArrayList<>();
-        List<Long> arrivalDids = arrivalDetailList.stream().map(ArrivalDetail::getPurchaseDetailId).collect(Collectors.toList());
-        List<PurchaseDetail> purchaseDetailList = purchaseDetailService.listByIds(arrivalDids);
-        if (ObjectUtil.isNotEmpty(purchaseDetailList)) {
-            Map<Long, PurchaseDetail> purchaseDetailMap = purchaseDetailList.stream().collect(Collectors.toMap(PurchaseDetail::getId, Function.identity()));
-            //获取发货明细
-            List<DeliverGoodsDetailsPo> deliverGoodsDetailsInfo = wdlyService.getDeliverGoodsDetailsInfo(deliverGoodsId);
-            Map<Long, DeliverGoodsDetailsPo> deliverGoodsDetailsInfoMap = deliverGoodsDetailsInfo.stream().collect(Collectors.toMap(DeliverGoodsDetailsPo::getId, Function.identity()));
-            int flag = 0;//到货数量不等于发货数量计数
-            for (ArrivalDetail d : arrivalDetailList) {
-                Long id = IdWorker.getId();
-                d.setId(id);
-                d.setArrivalId(arrival.getId());
-
-                Long deliverGoodsDetailsId = d.getDeliverGoodsDetailsId();
-                DeliverGoodsDetailsPo deliverGoodsDetailsPo = deliverGoodsDetailsInfoMap.get(deliverGoodsDetailsId);
-                if (ObjectUtil.isEmpty(deliverGoodsDetailsPo)) {
-                    throw new ServiceException("未找到发货明细信息");
-                }
-
-                //如果到货数量不等于发货数量 创建异常
-                if (deliverGoodsDetailsPo.getDeliverGoodsQuantity().compareTo(d.getCount()) != 0) {
-                    flag++;
-                }
-
-                StockWaitDetails stockWaitDetails = new StockWaitDetails();
-                stockWaitDetails.setStockWaitId(stockWait.getId());
-                //业务明细id设置成到货明细id
-                stockWaitDetails.setBusinessDetailsId(d.getId());
-                stockWaitDetails.setProductId(d.getBussinessId());
-                stockWaitDetails.setQuantity(d.getCount());
-                //赋值已采购数量信息
-                PurchaseDetail byId2 = purchaseDetailMap.get(d.getPurchaseDetailId());
-                BigDecimal count = byId2.getCount();
-                stockWaitDetails.setPurchaseQuantity(count);
-                stockWaitDetailsList.add(stockWaitDetails);
-            }
-
-            //存在到货数量不等于发货数量 创建异常
-            if (flag != 0) {
-                wdlyService.addAbnormalInfo(arrival.getId(), arrival.getCode());
-            }
-        }
-        arrivalDetailService.saveBatch(arrivalDetailList);
-        DynamicDataSourceContextHolder.push(SourceConstant.WMS);
-        stockWaitDetailsService.saveBatch(stockWaitDetailsList);
-        DynamicDataSourceContextHolder.poll();
-
-        //修改到货状态
-        Integer flag = 0;
-        List<PurchaseDetail> purchaseDetailsList1 = purchaseDetailService.list(q -> q.eq(PurchaseDetail::getPurchaseId, purchase.getId()));
-        if (ObjectUtil.isNotEmpty(purchaseDetailsList1)) {
-            List<Long> purchaseDetailsIds = purchaseDetailsList1.stream().map(PurchaseDetail::getId).collect(Collectors.toList());
-            List<ArrivalDetail> arrivalDetailsList1 = arrivalDetailService.list(q -> q.in(ArrivalDetail::getPurchaseDetailId, purchaseDetailsIds));
-            if (ObjectUtil.isNotEmpty(arrivalDetailsList1)) {
-                Map<Long, List<ArrivalDetail>> arrivalDetailsMap = arrivalDetailsList1.stream().collect(Collectors.groupingBy(ArrivalDetail::getPurchaseDetailId));
-                for (PurchaseDetail purchaseDetail : purchaseDetailsList1) {
-                    List<ArrivalDetail> arrivalDetails = arrivalDetailsMap.get(purchaseDetail.getId());
-                    BigDecimal count = arrivalDetails.stream()
-                            .map(ArrivalDetail::getCount)
-                            .reduce(BigDecimal.ZERO, BigDecimal::add);
-                    if (count.compareTo(purchaseDetail.getCount()) >= 0) {
-                        flag++;
-                    }
-                }
-                if (purchaseDetailsList1.size() == flag) {
-                    //完全到货
-                    purchase.setArrivalStatus(20);
-                } else {
-                    //部分到货
-                    purchase.setArrivalStatus(10);
-                }
-                purchaseService.updateById(purchase);
-            }
-        }
+//        if (ObjectUtil.isEmpty(arrival.getDeliverGoodsId())) {
+//            arrival.setDeliverGoodsId(json.getLong("deliverGoodsId"));
+//        }
+//        //根据发货id查采购信息
+//        if (ObjectUtil.isNotEmpty(arrival.getDeliverGoodsId())) {
+//            DeliverGoodsPo deliverGoodsInfo = wdlyService.getDeliverGoodsInfo(arrival.getDeliverGoodsId());
+//            Assert.notEmpty(deliverGoodsInfo, "查询不到发货信息");
+//            arrival.setPurchaseId(deliverGoodsInfo.getPurchaseId());
+//        }
+//
+//        if (ObjectUtil.isEmpty(arrival.getPurchaseId())) {
+//            throw new ServiceException("采购id不能为空");
+//        }
+//        Purchase purchase0 = purchaseService.getById(arrival.getPurchaseId());
+//        Assert.notEmpty(purchase0, "无法获取到采购信息");
+//        arrival.setSupplyId(purchase0.getSupplyId());
+//        arrival.setCode(codingRuleService.createCode(CodingRuleEnum.ARRIVAL.getKey(), null));
+////        arrival.setCode(CodeEnum.ARRIVAL.getCode());
+//        arrival.setStatus(1);//设置到货
+//        this.save(arrival);
+//
+//        //修改采购状态
+////        Purchase purchase = new Purchase();
+////        purchase.setArrivalStatus(arrival.getArrivalStatus());
+////        purchase.setId(arrival.getPurchaseId());
+////        purchaseService.updateById(purchase);
+//
+//        //创建待入库记录
+////        String victoriatouristJson = arrival.getVictoriatouristJson();
+////        JSONObject json = ObjectUtil.isNotEmpty(victoriatouristJson) ? JSONObject.parseObject(victoriatouristJson) : new JSONObject();
+//        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, deliverGoodsInfo.getPurchaseId()));
+//        Long subscribeDetailId = one.getSubscribeDetailId();
+//        SubscribeDetail byId = subscribeDetailService.getById(subscribeDetailId);
+//        Subscribe byId1 = subscribeService.getById(byId.getSubscribeId());
+//        String victoriatouristJson1 = byId1.getVictoriatouristJson();
+//        if (ObjectUtil.isNotEmpty(victoriatouristJson1)) {
+//            //去申购单取仓库id
+//            JSONObject json1 = JSONObject.parseObject(victoriatouristJson1);
+//            Long receiptWarehouseId = json1.getLong("receiptWarehouseId");
+//            json.put("receiptWarehouseId", receiptWarehouseId);
+//        }
+//        //赋值物流公司名称
+//        CompanyInfo logisticsCompanyCode = companyInfoService.getOne(q -> q.eq(CompanyInfo::getCode, json.getString("logisticsCompanyCode")));
+//        json.put("logisticsCompanyName", logisticsCompanyCode.getName());
+//        //修改发货记录的状态为到货
+//        wdlyService.updateDeliverGoodsStatus(deliverGoodsId);
+//
+//        //获取采购信息
+//        Purchase purchase = purchaseService.getById(deliverGoodsInfo.getPurchaseId());
+//
+//        //----------
+//        StockWait stockWait = new StockWait();
+//        stockWait.setType(1);//入库
+//        stockWait.setStatus(0);//待入库
+//        stockWait.setBusinessType(StockWaitType.PURCHASE_ARRIVAL_IN.getDetailType());//采购到货
+//        //将业务信息设置成采购id和采购编码
+//        stockWait.setBusinessId(purchase.getId());
+//        String victoriatouristJson2 = purchase.getVictoriatouristJson();
+//        JSONObject json2 = ObjectUtil.isNotEmpty(victoriatouristJson2) ? JSONObject.parseObject(victoriatouristJson2) : new JSONObject();
+////        stockWait.setBusinessCode(purchase.getCode());
+//        stockWait.setBusinessCode(json2.getString("contractCode"));
+//
+//        json.put("arrivalId", arrival.getId());
+//        json.put("arrivalCode", arrival.getCode());
+//        stockWait.setVictoriatouristJson(JSONObject.toJSONString(json, JSONWriter.Feature.WriteLongAsString));
+//        stockWaitService.save(stockWait);
+//
+//        //取出到货明细
+//        List<ArrivalDetail> arrivalDetailList = arrival.getArrivalDetailList();
+//        if (CollectionUtils.isEmpty(arrivalDetailList)) {
+//            return;
+//        }
+//
+//        List<StockWaitDetails> stockWaitDetailsList = new ArrayList<>();
+//        List<Long> arrivalDids = arrivalDetailList.stream().map(ArrivalDetail::getPurchaseDetailId).collect(Collectors.toList());
+//        List<PurchaseDetail> purchaseDetailList = purchaseDetailService.listByIds(arrivalDids);
+//        if (ObjectUtil.isNotEmpty(purchaseDetailList)) {
+//            Map<Long, PurchaseDetail> purchaseDetailMap = purchaseDetailList.stream().collect(Collectors.toMap(PurchaseDetail::getId, Function.identity()));
+//            //获取发货明细
+//            List<DeliverGoodsDetailsPo> deliverGoodsDetailsInfo = wdlyService.getDeliverGoodsDetailsInfo(deliverGoodsId);
+//            Map<Long, DeliverGoodsDetailsPo> deliverGoodsDetailsInfoMap = deliverGoodsDetailsInfo.stream().collect(Collectors.toMap(DeliverGoodsDetailsPo::getId, Function.identity()));
+//            int flag = 0;//到货数量不等于发货数量计数
+//            for (ArrivalDetail d : arrivalDetailList) {
+//                Long id = IdWorker.getId();
+//                d.setId(id);
+//                d.setArrivalId(arrival.getId());
+//
+//                Long deliverGoodsDetailsId = d.getDeliverGoodsDetailsId();
+//                DeliverGoodsDetailsPo deliverGoodsDetailsPo = deliverGoodsDetailsInfoMap.get(deliverGoodsDetailsId);
+//                if (ObjectUtil.isEmpty(deliverGoodsDetailsPo)) {
+//                    throw new ServiceException("未找到发货明细信息");
+//                }
+//
+//                //如果到货数量不等于发货数量 创建异常
+//                if (deliverGoodsDetailsPo.getDeliverGoodsQuantity().compareTo(d.getCount()) != 0) {
+//                    flag++;
+//                }
+//
+//                StockWaitDetails stockWaitDetails = new StockWaitDetails();
+//                stockWaitDetails.setStockWaitId(stockWait.getId());
+//                //业务明细id设置成到货明细id
+//                stockWaitDetails.setBusinessDetailsId(d.getId());
+//                stockWaitDetails.setProductId(d.getBussinessId());
+//                stockWaitDetails.setQuantity(d.getCount());
+//                //赋值已采购数量信息
+//                PurchaseDetail byId2 = purchaseDetailMap.get(d.getPurchaseDetailId());
+//                BigDecimal count = byId2.getCount();
+//                stockWaitDetails.setPurchaseQuantity(count);
+//                stockWaitDetailsList.add(stockWaitDetails);
+//            }
+//
+//            //存在到货数量不等于发货数量 创建异常
+//            if (flag != 0) {
+//                wdlyService.addAbnormalInfo(arrival.getId(), arrival.getCode());
+//            }
+//        }
+//        arrivalDetailService.saveBatch(arrivalDetailList);
+//        DynamicDataSourceContextHolder.push(SourceConstant.WMS);
+//        stockWaitDetailsService.saveBatch(stockWaitDetailsList);
+//        DynamicDataSourceContextHolder.poll();
+//
+//        //修改到货状态
+//        Integer flag = 0;
+//        List<PurchaseDetail> purchaseDetailsList1 = purchaseDetailService.list(q -> q.eq(PurchaseDetail::getPurchaseId, purchase.getId()));
+//        if (ObjectUtil.isNotEmpty(purchaseDetailsList1)) {
+//            List<Long> purchaseDetailsIds = purchaseDetailsList1.stream().map(PurchaseDetail::getId).collect(Collectors.toList());
+//            List<ArrivalDetail> arrivalDetailsList1 = arrivalDetailService.list(q -> q.in(ArrivalDetail::getPurchaseDetailId, purchaseDetailsIds));
+//            if (ObjectUtil.isNotEmpty(arrivalDetailsList1)) {
+//                Map<Long, List<ArrivalDetail>> arrivalDetailsMap = arrivalDetailsList1.stream().collect(Collectors.groupingBy(ArrivalDetail::getPurchaseDetailId));
+//                for (PurchaseDetail purchaseDetail : purchaseDetailsList1) {
+//                    List<ArrivalDetail> arrivalDetails = arrivalDetailsMap.get(purchaseDetail.getId());
+//                    BigDecimal count = arrivalDetails.stream()
+//                            .map(ArrivalDetail::getCount)
+//                            .reduce(BigDecimal.ZERO, BigDecimal::add);
+//                    if (count.compareTo(purchaseDetail.getCount()) >= 0) {
+//                        flag++;
+//                    }
+//                }
+//                if (purchaseDetailsList1.size() == flag) {
+//                    //完全到货
+//                    purchase.setArrivalStatus(20);
+//                } else {
+//                    //部分到货
+//                    purchase.setArrivalStatus(10);
+//                }
+//                purchaseService.updateById(purchase);
+//            }
+//        }
     }
     }
 
 
     @Override
     @Override

+ 17 - 17
hx-wms/src/main/java/com/fjhx/wms/service/WmsService.java

@@ -1,17 +1,17 @@
-package com.fjhx.wms.service;
-
-import com.fjhx.wms.entity.stock.dto.StockWaitDetailsDto;
-import com.fjhx.wms.entity.stock.dto.StockWaitDto;
-
-public interface WmsService {
-
-    /**
-     * 销售订单出库
-     */
-    void outbound(StockWaitDetailsDto stockWaitDetailsDto);
-
-    /**
-     * 销售订单出库多条
-     */
-    void outbounds(StockWaitDto stockWaitDto);
-}
+//package com.fjhx.wms.service;
+//
+//import com.fjhx.wms.entity.stock.dto.StockWaitDetailsDto;
+//import com.fjhx.wms.entity.stock.dto.StockWaitDto;
+//
+//public interface WmsService {
+//
+//    /**
+//     * 销售订单出库
+//     */
+//    void outbound(StockWaitDetailsDto stockWaitDetailsDto);
+//
+//    /**
+//     * 销售订单出库多条
+//     */
+//    void outbounds(StockWaitDto stockWaitDto);
+//}

+ 4 - 7
hx-wms/src/main/java/com/fjhx/wms/service/stock/impl/StockWaitServiceImpl.java

@@ -28,7 +28,6 @@ import com.fjhx.wms.entity.stock.vo.StockWaitVo;
 import com.fjhx.wms.entity.warehouse.po.Warehouse;
 import com.fjhx.wms.entity.warehouse.po.Warehouse;
 import com.fjhx.wms.mapper.stock.StockWaitMapper;
 import com.fjhx.wms.mapper.stock.StockWaitMapper;
 import com.fjhx.wms.service.MyPurchaseService;
 import com.fjhx.wms.service.MyPurchaseService;
-import com.fjhx.wms.service.WmsService;
 import com.fjhx.wms.service.arrival.ArrivalStockRecordsDetailsService;
 import com.fjhx.wms.service.arrival.ArrivalStockRecordsDetailsService;
 import com.fjhx.wms.service.arrival.ArrivalStockRecordsService;
 import com.fjhx.wms.service.arrival.ArrivalStockRecordsService;
 import com.fjhx.wms.service.stock.*;
 import com.fjhx.wms.service.stock.*;
@@ -77,8 +76,6 @@ public class StockWaitServiceImpl extends ServiceImpl<StockWaitMapper, StockWait
     @Autowired
     @Autowired
     private ArrivalStockRecordsDetailsService arrivalStockRecordsDetailsService;
     private ArrivalStockRecordsDetailsService arrivalStockRecordsDetailsService;
     @Autowired
     @Autowired
-    private WmsService wmsService;
-    @Autowired
     private StockFrozenService stockFrozenService;
     private StockFrozenService stockFrozenService;
     @Autowired
     @Autowired
     private MyPurchaseService myPurchaseService;
     private MyPurchaseService myPurchaseService;
@@ -362,10 +359,10 @@ public class StockWaitServiceImpl extends ServiceImpl<StockWaitMapper, StockWait
             arrivalStockRecordsDetailsService.saveBatch(arrivalStockRecordsDetailsList);
             arrivalStockRecordsDetailsService.saveBatch(arrivalStockRecordsDetailsList);
         }
         }
 
 
-        //销售订单出库
-        if (StockWaitType.SALE_ORDER_OUT.getDetailType().equals(businessType)) {
-            wmsService.outbounds(stockWaitDto);
-        }
+//        //销售订单出库
+//        if (StockWaitType.SALE_ORDER_OUT.getDetailType().equals(businessType)) {
+//            wmsService.outbounds(stockWaitDto);
+//        }
 
 
         //生产任务待出库
         //生产任务待出库
         if (StockWaitType.PRODUCTION_TASK_OUT.getDetailType().equals(businessType)) {
         if (StockWaitType.PRODUCTION_TASK_OUT.getDetailType().equals(businessType)) {

+ 0 - 6
pom.xml

@@ -26,7 +26,6 @@
         <module>hx-purchase</module>
         <module>hx-purchase</module>
         <module>hx-account</module>
         <module>hx-account</module>
         <module>hx-sale</module>
         <module>hx-sale</module>
-        <module>hx-victoriatourist</module>
         <module>hx-dingding</module>
         <module>hx-dingding</module>
         <module>hx-form</module>
         <module>hx-form</module>
         <module>hx-jxst</module>
         <module>hx-jxst</module>
@@ -127,11 +126,6 @@
                 <version>${hx.version}</version>
                 <version>${hx.version}</version>
             </dependency>
             </dependency>
 
 
-            <dependency>
-                <groupId>com.fjhx</groupId>
-                <artifactId>hx-victoriatourist</artifactId>
-                <version>${hx.version}</version>
-            </dependency>
 
 
             <dependency>
             <dependency>
                 <groupId>com.fjhx</groupId>
                 <groupId>com.fjhx</groupId>