|
@@ -1,8 +1,11 @@
|
|
|
package com.ruoyi.web.controller.warewms.ams;
|
|
|
|
|
|
+import com.ruoyi.ams.inv.mapper.InvLotLocIdMapper;
|
|
|
import com.ruoyi.ams.locationView.domain.form.LocationViewForm;
|
|
|
import com.ruoyi.ams.locationView.domain.vo.LocationViewVO;
|
|
|
import com.ruoyi.ams.locationView.service.LocationViewService;
|
|
|
+import com.ruoyi.base.domain.BaseLocationInfo;
|
|
|
+import com.ruoyi.base.service.IBaseLocationInfoService;
|
|
|
import com.ruoyi.common.core.controller.BaseController;
|
|
|
import com.ruoyi.common.core.domain.AjaxResult;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -19,11 +22,47 @@ public class LocationViewController extends BaseController {
|
|
|
|
|
|
@Autowired
|
|
|
private LocationViewService locationViewService;
|
|
|
+ @Autowired
|
|
|
+ private IBaseLocationInfoService baseLocationInfoService;
|
|
|
+ @Autowired
|
|
|
+ private InvLotLocIdMapper invLotLocIdMapper;
|
|
|
|
|
|
@GetMapping(value = "/view")
|
|
|
- public AjaxResult getInfo(LocationViewForm locationViewForm)
|
|
|
- {
|
|
|
+ public AjaxResult getInfo(LocationViewForm locationViewForm) {
|
|
|
LocationViewVO locationViewVO = locationViewService.locationView(locationViewForm);
|
|
|
return AjaxResult.success(locationViewVO);
|
|
|
}
|
|
|
+
|
|
|
+ @GetMapping(value = "/lockLoc/{id}")
|
|
|
+ public AjaxResult lockLoc(@PathVariable("id") Long id) {
|
|
|
+ BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoById(id);
|
|
|
+ if (baseLocationInfo != null) {
|
|
|
+ if (baseLocationInfo.getStockStatus().equals("00")) {
|
|
|
+ baseLocationInfoService.updateLocationStockStatus(id, "10");
|
|
|
+ return AjaxResult.success("锁定成功");
|
|
|
+ } else {
|
|
|
+ baseLocationInfoService.updateLocationStockStatus(id, "00");
|
|
|
+ return AjaxResult.success("解锁成功");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return AjaxResult.error("查询不到对应的库位");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping(value = "/clearLoc/{id}")
|
|
|
+ public AjaxResult clearLoc(@PathVariable("id") Long id) {
|
|
|
+ BaseLocationInfo baseLocationInfo = baseLocationInfoService.selectBaseLocationInfoById(id);
|
|
|
+ if (baseLocationInfo != null) {
|
|
|
+ if (baseLocationInfo.getStockStatus().equals("00")) {
|
|
|
+ baseLocationInfo.setIsEmpty("Y");
|
|
|
+ baseLocationInfoService.updateBaseLocationInfo(baseLocationInfo);
|
|
|
+ invLotLocIdMapper.deleteInvLotLocIdByLocationId(baseLocationInfo.getId());
|
|
|
+ return AjaxResult.success("清空成功");
|
|
|
+ } else {
|
|
|
+ return AjaxResult.error("锁定中的库位无法清空");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return AjaxResult.error("查询不到对应的库位");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|