Răsfoiți Sursa

仓库库存数据接口更新

mac 2 ani în urmă
părinte
comite
a67557173f

+ 11 - 1
kxs-product/kxs-product-api/src/main/java/com/kxs/product/api/feign/RemoteKxsProductService.java

@@ -49,7 +49,15 @@ public interface RemoteKxsProductService {
 	@PostExchange("/machine/getActivityMachineByIdAndTime")
 	GetActivityStatByIdAndTimeVO getActivityMachineByIdAndTime(@RequestBody GetActivityMachineByIdAndTimeDTO param, @RequestHeader(SecurityConstants.FROM) String from);
 
-
+	/**
+	 * 获取 仓库 库存
+	 *
+	 * @param warehouseId 仓库 ID
+	 * @param from        从
+	 * @return {@link Long}
+	 */
+	@GetExchange("/machine/loadWhsStockNum")
+	R<Integer> loadWhsStockNum(@RequestParam("whsId") Integer warehouseId, @RequestHeader(SecurityConstants.FROM) String from);
 
 
 	/**
@@ -167,4 +175,6 @@ public interface RemoteKxsProductService {
 	@GetExchange("/brand/list")
     R<List<KxsBrand>> loadByAllBrand();
 
+
+
 }

+ 29 - 20
kxs-product/kxs-product-biz/src/main/java/com/kxs/product/biz/controller/kxsapp/MachineController.java

@@ -2,6 +2,7 @@ package com.kxs.product.biz.controller.kxsapp;
 
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.kxs.common.core.constant.CommonConstants;
 import com.kxs.common.core.constant.enums.MachineTypeEnum;
 import com.kxs.common.core.util.R;
 import com.kxs.common.security.annotation.Inner;
@@ -41,6 +42,15 @@ public class MachineController {
     private final KxsMachineTransferService kxsMachineTransferService;
 
 
+    /**
+     * 获取时间内的广电和pos绑定且激活量
+     */
+    @Inner
+    @PostMapping("/getActivityMachineByIdAndTime")
+    public GetActivityStatByIdAndTimeVO getActivityMachineByIdAndTime(@RequestBody GetActivityMachineByIdAndTimeDTO param) {
+
+        return kxsMachineService.getActivityMachineByIdAndTime(param);
+    }
 
     /**
      * 可循环机列表
@@ -49,22 +59,11 @@ public class MachineController {
      * @return 可循环机列表
      */
     @GetMapping("/recycleMachines")
-    public R recycleMachines(@ParameterObject Page<RecycleMachinesVO> page, @RequestParam("brandType") Integer brandType ) {
+    public R recycleMachines(@ParameterObject Page<RecycleMachinesVO> page, @RequestParam("brandType") Integer brandType) {
 
         return R.ok(kxsMachineService.recycleMachinesPage(page, brandType));
     }
 
-    /**
-     * 获取时间内的广电和pos绑定且激活量
-     *
-     *
-     */
-    @PostMapping("/getActivityMachineByIdAndTime")
-    @Inner
-    public GetActivityStatByIdAndTimeVO getActivityMachineByIdAndTime(@RequestBody GetActivityMachineByIdAndTimeDTO param) {
-
-        return kxsMachineService.getActivityMachineByIdAndTime(param);
-    }
     /**
      * 申请机具说明
      *
@@ -80,7 +79,7 @@ public class MachineController {
     /**
      * 未绑定机具列表
      *
-     * @param page 分页对象
+     * @param page  分页对象
      * @param param 查询实体
      * @return 未绑定机具列表
      */
@@ -94,7 +93,7 @@ public class MachineController {
     /**
      * 已绑定列表
      *
-     * @param page 分页对象
+     * @param page  分页对象
      * @param param 查询实体
      * @return 已绑定列表
      */
@@ -108,7 +107,7 @@ public class MachineController {
     /**
      * 全部机具
      *
-     * @param page 分页对象
+     * @param page  分页对象
      * @param param 查询实体
      * @return 全部机具
      */
@@ -148,7 +147,7 @@ public class MachineController {
     /**
      * 未绑定划拨记录
      *
-     * @param page 分页对象
+     * @param page  分页对象
      * @param param 查询实体
      * @return 未绑定划拨记录
      */
@@ -162,7 +161,7 @@ public class MachineController {
     /**
      * 用户机具和箱具码搜索
      *
-     * @param page 分页对象
+     * @param page  分页对象
      * @param param 查询实体
      * @return 用户机具和箱具码搜索
      */
@@ -226,7 +225,7 @@ public class MachineController {
     /**
      * 仓库库存机具列表
      *
-     * @param page 分页对象
+     * @param page  分页对象
      * @param param 查询实体
      * @return 仓库库存机具列表
      */
@@ -240,7 +239,7 @@ public class MachineController {
     /**
      * 仓库机具搜索
      *
-     * @param page 分页对象
+     * @param page  分页对象
      * @param param 查询实体
      * @return 机具搜索
      */
@@ -279,10 +278,20 @@ public class MachineController {
 
     @Inner
     @GetMapping("/loadMachineBySn")
-    public R loadMachineBySn(@RequestParam("sn") String sn){
+    public R loadMachineBySn(@RequestParam("sn") String sn) {
 
         return R.ok(kxsMachineService.getOne(Wrappers.lambdaQuery(KxsMachine.class)
                 .eq(KxsMachine::getPosSn, sn)));
     }
+
+    @Inner
+    @GetMapping("/loadWhsStockNum")
+    public R loadMachineBySn(@RequestParam("whsId") Integer whsId) {
+
+        return R.ok(kxsMachineService.count(Wrappers.lambdaQuery(KxsMachine.class)
+                .eq(KxsMachine::getStatus, MachineTypeEnum.STATUS_IS.getType())
+                .eq(KxsMachine::getPreUserId, CommonConstants.FAIL)
+                .eq(KxsMachine::getWarehouseId, whsId)));
+    }
 }
 

+ 2 - 3
kxs-store/kxs-store-biz/src/main/java/com/kxs/store/biz/service/impl/KxsWarehouseServiceImpl.java

@@ -100,9 +100,8 @@ public class KxsWarehouseServiceImpl extends ServiceImpl<KxsWarehouseMapper, Kxs
         storeDataVO.setUnSendCount(unSendCount.intValue());
 
         //库存数
-        KxsWarehouseStock warehouseStock = kxsWarehouseStockMapper.selectOne(Wrappers.<KxsWarehouseStock>lambdaQuery()
-                .eq(KxsWarehouseStock::getWarehouseId, warehouseId));
-        storeDataVO.setStockNum(warehouseStock.getStockNum());
+        R<Integer> res = remoteKxsProductService.loadWhsStockNum(warehouseId, SecurityConstants.FROM_IN);
+        storeDataVO.setStockNum(res.getData());
 
         //仓库预发机数量
         Long preMachineCount = kxsMachineAdvanceMapper.selectWarehouseUserCount(warehouseId);