瀏覽代碼

1.库位视图增加日志
2.清除库存解锁redis

k 2 年之前
父節點
當前提交
b0c1e43e67

+ 5 - 1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/warewms/ams/LocationViewSafeController.java

@@ -11,8 +11,10 @@ import com.ruoyi.base.domain.BaseLocationZone;
 import com.ruoyi.base.domain.BaseWarehouse;
 import com.ruoyi.base.domain.dto.BasLocationGuiExtDTO;
 import com.ruoyi.base.service.IBaseLocationZoneService;
+import com.ruoyi.common.annotation.Log;
 import com.ruoyi.common.core.controller.BaseController;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
@@ -54,20 +56,22 @@ public class LocationViewSafeController extends BaseController {
         return AjaxResult.success(basLocationGuiDTOS);
     }
 
+    @Log(title = "库位任务状态调整", businessType = BusinessType.UPDATE)
     @GetMapping(value = "/lockLoc/{id}")
     public AjaxResult lockLoc(@PathVariable("id") Long id) {
         return invLotLocIdService.adjLocationStockStatus(id.toString(), Constant.WAREHOUSE_ID
                 , logger.getName());
     }
 
+    @Log(title = "库位库存清除", businessType = BusinessType.CLEAN)
     @GetMapping(value = "/clearLoc/{id}")
     public AjaxResult clearLoc(@PathVariable("id") Long id) {
         return invLotLocIdService.clear(id.toString(),Constant.WAREHOUSE_ID, logger.getName());
     }
 
+    @Log(title = "库存有货状态调整", businessType = BusinessType.CLEAN)
     @GetMapping(value = "/setIsEmpty/{id}")
     public AjaxResult adjLocationIsEmpty(@PathVariable("id") Long id) {
-
         return invLotLocIdService.adjLocationIsEmpty(id.toString(), Constant.WAREHOUSE_ID, logger.getName());
     }
 

+ 2 - 0
warewms-ams/src/main/java/com/ruoyi/ams/inv/service/impl/InvLotLocIdServiceImpl.java

@@ -354,6 +354,8 @@ public class InvLotLocIdServiceImpl implements IInvLotLocIdService {
         }
         // 修改库位为空闲无货
         baseLocationInfoService.updateLocationIdleAndEmpty(id, warehouseId, updateBy);
+        // 释放redis锁
+        redisCache.unlockCacheLocation(id.toString());
         return AjaxResult.success("操作成功!");
     }
 

+ 2 - 1
warewms-base/src/main/java/com/ruoyi/base/service/impl/BaseLocationInfoServiceImpl.java

@@ -10,6 +10,7 @@ import com.ruoyi.base.mapper.BaseLocationZoneMapper;
 import com.ruoyi.base.service.IBaseLocationInfoService;
 import com.ruoyi.base.utils.CommonUtils;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -40,7 +41,7 @@ public class BaseLocationInfoServiceImpl implements IBaseLocationInfoService {
     @Autowired
     private BaseLocationZoneMapper baseLocationZoneMapper;
     @Autowired
-    private RedisTemplate<String, String> redisTemplate;
+    private RedisCache redisCache;
 
     /**
      * 查询库位信息