24282 2 éve
szülő
commit
a38ba75b9a

+ 0 - 12
hx-service/victoriatourist/src/main/java/com/fjhx/controller/stock/PurchaseInStockController.java

@@ -43,18 +43,6 @@ public class PurchaseInStockController {
         return R.success(result);
     }
 
-    // /**
-    //  * 物流单明细
-    //  *
-    //  * @param entity 查询条件
-    //  * @return
-    //  */
-    // @PostMapping("/logistics/details")
-    // public R logisticsDetails(@RequestBody LogisticsDetails entity) {
-    //     List<LogisticsDetails> result = logisticsDetailsService.getByLogisticsInfoId(entity.getLogisticsInfoId());
-    //     return R.success(result);
-    // }
-
     /**
      * 物流单明细
      */

+ 3 - 4
hx-service/victoriatourist/src/main/java/com/fjhx/service/logistics/LogisticsInfoService.java

@@ -32,7 +32,6 @@ public interface LogisticsInfoService extends BaseService<LogisticsInfo> {
      * 采购入库列表
      *
      * @param condition 查询条件
-     * @return
      */
     Page<LogisticsInfo> getPurchaseInStockPage(Map<String, Object> condition);
 
@@ -40,7 +39,6 @@ public interface LogisticsInfoService extends BaseService<LogisticsInfo> {
      * 根据采购ID查询
      *
      * @param purchaseIds 采购ID集合
-     * @return
      */
     List<LogisticsInfo> getByPurchaseIds(List<Long> purchaseIds);
 
@@ -48,7 +46,6 @@ public interface LogisticsInfoService extends BaseService<LogisticsInfo> {
      * 根据采购ID查询
      *
      * @param purchaseIds 采购ID集合
-     * @return
      */
     Map<Long, List<LogisticsInfo>> getByPurchaseIdsToMap(List<Long> purchaseIds);
 
@@ -64,7 +61,6 @@ public interface LogisticsInfoService extends BaseService<LogisticsInfo> {
      * 根据业务ID查询物流单号
      *
      * @param businessId 业务ID
-     * @return
      */
     List<LogisticsInfo> codeSelectByBusinessId(Long businessId);
 
@@ -78,6 +74,9 @@ public interface LogisticsInfoService extends BaseService<LogisticsInfo> {
      */
     void arrivalNotice(LogisticsInfoVo entity);
 
+    /**
+     * 入库
+     */
     void inStock(InStockAdd inStockAdd);
 
 }

+ 8 - 6
hx-service/victoriatourist/src/main/java/com/fjhx/service/logistics/impl/LogisticsInfoServiceImpl.java

@@ -337,7 +337,6 @@ public class LogisticsInfoServiceImpl extends ServiceImpl<LogisticsInfoMapper, L
         stockChangeDto.setDefaultRemarks("采购入库");
         stockChangeDto.setTypeEnum(InTypeEnum.PURCHASE);
         stockChangeDto.setChangeDetailsList(list);
-
         List<StockJournal> stockJournals = stockService.changeQuantity(stockChangeDto);
 
         // 修改入库数量
@@ -354,19 +353,22 @@ public class LogisticsInfoServiceImpl extends ServiceImpl<LogisticsInfoMapper, L
 
         for (LogisticsDetails logisticsDetail : logisticsDetails) {
 
-            // 发货数量
-            BigDecimal shipmentQuantity = logisticsDetail.getShipmentQuantity();
-
             // 入库数量
             BigDecimal receiptQuantity = logisticsDetail.getReceiptQuantity();
 
             // 本次入库数量
             BigDecimal bigDecimal = ObjectUtil.defaultIfNull(collect.get(logisticsDetail.getId()), BigDecimal.ZERO);
 
-            int compareTo = receiptQuantity.add(bigDecimal).compareTo(shipmentQuantity);
+            // 入库数量加本次入库数量 与 发货数量对比
+            int compareTo = receiptQuantity.add(bigDecimal).compareTo(logisticsDetail.getShipmentQuantity());
+
+            // 入库数量加本次入库数量 大于 发货数量
             if (compareTo > 0) {
                 throw new ServiceException("入库数量不能超过发货数量");
-            } else if (compareTo < 0) {
+            }
+
+            // 入库数量加本次入库数量 小于 发货数量,本次采购入库未完成
+            if (compareTo < 0) {
                 completeFlag = false;
             }
 

+ 1 - 1
hx-service/victoriatourist/src/main/java/com/fjhx/service/stock/impl/StockCombinationServiceImpl.java

@@ -118,7 +118,7 @@ public class StockCombinationServiceImpl extends ServiceImpl<StockCombinationMap
         for (ProductCombination productCombination : productCombinationList) {
 
             // 产品库存数量
-            BigDecimal stockQuantity = kv.get(productCombination.getProductId());
+            BigDecimal stockQuantity = kv.get(productCombination.getLinkProductId());
             if (Objects.isNull(stockQuantity)) {
                 return 0;
             }