|
|
|
@ -21,6 +21,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
|
|
|
|
import com.logpm.basicdata.entity.BasicdataWarehouseEntity; |
|
|
|
|
import com.logpm.basicdata.feign.IBasicdataWarehouseClient; |
|
|
|
|
|
|
|
|
|
import com.logpm.warehouse.config.RedissonConfig; |
|
|
|
|
import com.logpm.warehouse.dto.*; |
|
|
|
|
import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity; |
|
|
|
|
import com.logpm.warehouse.excel.WarehouseGoodsAllocationExcel; |
|
|
|
@ -35,6 +37,7 @@ import io.swagger.annotations.ApiOperation;
|
|
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.log4j.Log4j2; |
|
|
|
|
import org.redisson.api.RLock; |
|
|
|
|
import org.springblade.common.exception.CustomerException; |
|
|
|
|
import org.springblade.core.boot.ctrl.BladeController; |
|
|
|
|
import org.springblade.core.excel.util.ExcelUtil; |
|
|
|
@ -55,6 +58,7 @@ import javax.validation.Valid;
|
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Objects; |
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -207,6 +211,13 @@ public class WarehouseGoodsAllocationController extends BladeController {
|
|
|
|
|
public R uporder(@RequestBody UpdownTypeDTO updownTypeDTO) { |
|
|
|
|
List<UpShelfOrderDTO> upShelfOrderList = updownTypeDTO.getUpShelfOrderList(); |
|
|
|
|
Long allocationId = updownTypeDTO.getAllocationId(); |
|
|
|
|
//设置lockey
|
|
|
|
|
String lockKey ="lock:upPackage:" + allocationId; |
|
|
|
|
RLock lock = new RedissonConfig().redisson().getLock(lockKey); |
|
|
|
|
if(lock.isLocked()){ |
|
|
|
|
return R.fail("该货位还在上架中!!!"); |
|
|
|
|
} |
|
|
|
|
lock.lock(5, TimeUnit.SECONDS); |
|
|
|
|
if (upShelfOrderList.size() == 0 || Objects.isNull(allocationId)) { |
|
|
|
|
return R.fail("参数不全"); |
|
|
|
|
} |
|
|
|
@ -239,6 +250,13 @@ public class WarehouseGoodsAllocationController extends BladeController {
|
|
|
|
|
//取出服务号
|
|
|
|
|
List<UpShelfOrderDTO> upShelfOrderList = updownTypeDTO.getUpShelfOrderList(); |
|
|
|
|
Long allocationId = updownTypeDTO.getAllocationId(); |
|
|
|
|
//设置lockey
|
|
|
|
|
String lockKey ="lock:upPackage:" + allocationId; |
|
|
|
|
RLock lock = new RedissonConfig().redisson().getLock(lockKey); |
|
|
|
|
if(lock.isLocked()){ |
|
|
|
|
return R.fail("该货位还在上架中!!!"); |
|
|
|
|
} |
|
|
|
|
lock.lock(5, TimeUnit.SECONDS); |
|
|
|
|
Boolean b = warehouseGoodsAllocationService.selectIsStocking(allocationId); |
|
|
|
|
if (b){ |
|
|
|
|
return R.fail("备货区不可上架"); |
|
|
|
@ -274,6 +292,13 @@ public class WarehouseGoodsAllocationController extends BladeController {
|
|
|
|
|
//取出包条Id
|
|
|
|
|
List<UpShelfPackageDTO> upShelfPackageList = updownTypeDTO.getUpShelfPackageList(); |
|
|
|
|
Long allocationId = updownTypeDTO.getAllocationId(); |
|
|
|
|
//设置lockey
|
|
|
|
|
String lockKey ="lock:upPackage:" + allocationId; |
|
|
|
|
RLock lock = new RedissonConfig().redisson().getLock(lockKey); |
|
|
|
|
if(lock.isLocked()){ |
|
|
|
|
return R.fail("该货位还在上架中!!!"); |
|
|
|
|
} |
|
|
|
|
lock.lock(3, TimeUnit.SECONDS); |
|
|
|
|
if (upShelfPackageList.size() == 0 || Objects.isNull(allocationId)) { |
|
|
|
|
return R.fail("参数不全"); |
|
|
|
|
} |
|
|
|
@ -287,6 +312,7 @@ public class WarehouseGoodsAllocationController extends BladeController {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
R r = warehouseUpdownTypeService.upShelfPackage(upShelfPackageList, allocationId,myCurrentWarehouse.getId()); |
|
|
|
|
|
|
|
|
|
// if (r.getCode() == 200) {
|
|
|
|
|
// warehouseGoodsAllocationService.updateAllocationCache(allocationId.toString());
|
|
|
|
|
// }
|
|
|
|
@ -302,6 +328,13 @@ public class WarehouseGoodsAllocationController extends BladeController {
|
|
|
|
|
public R upTray(@RequestBody UpdownTypeDTO updownTypeDTO) { |
|
|
|
|
String trayCode = updownTypeDTO.getCode();//托盘码
|
|
|
|
|
Long allocationId = updownTypeDTO.getAllocationId(); |
|
|
|
|
//设置lockey
|
|
|
|
|
String lockKey ="lock:upPackage:" + allocationId; |
|
|
|
|
RLock lock = new RedissonConfig().redisson().getLock(lockKey); |
|
|
|
|
if(lock.isLocked()){ |
|
|
|
|
return R.fail("该货位还在上架中!!!"); |
|
|
|
|
} |
|
|
|
|
lock.lock(5, TimeUnit.SECONDS); |
|
|
|
|
if (null == allocationId || StringUtil.isBlank(trayCode)) { |
|
|
|
|
return R.fail("参数不全"); |
|
|
|
|
} |
|
|
|
@ -330,6 +363,13 @@ public class WarehouseGoodsAllocationController extends BladeController {
|
|
|
|
|
public R upStock(@RequestBody UpdownTypeDTO updownTypeDTO) { |
|
|
|
|
Long allocationId = updownTypeDTO.getAllocationId();//库位Id
|
|
|
|
|
List<UpShelfStockDTO> upShelfStockList = updownTypeDTO.getUpShelfStockList(); |
|
|
|
|
//设置lockey
|
|
|
|
|
String lockKey ="lock:upPackage:" + allocationId; |
|
|
|
|
RLock lock = new RedissonConfig().redisson().getLock(lockKey); |
|
|
|
|
if(lock.isLocked()){ |
|
|
|
|
return R.fail("该货位还在上架中!!!"); |
|
|
|
|
} |
|
|
|
|
lock.lock(5, TimeUnit.SECONDS); |
|
|
|
|
if (null == allocationId || upShelfStockList.size() == 0) { |
|
|
|
|
return R.fail("参数不全"); |
|
|
|
|
} |
|
|
|
@ -360,6 +400,13 @@ public class WarehouseGoodsAllocationController extends BladeController {
|
|
|
|
|
public R upZeroOrder(@RequestBody UpdownTypeDTO updownTypeDTO) { |
|
|
|
|
Long allocationId = updownTypeDTO.getAllocationId();//库位编码
|
|
|
|
|
List<UpShelfZeroOrderDTO> upShelfZeroOrderList = updownTypeDTO.getUpShelfZeroOrderList(); |
|
|
|
|
//设置lockey
|
|
|
|
|
String lockKey ="lock:upPackage:" + allocationId; |
|
|
|
|
RLock lock = new RedissonConfig().redisson().getLock(lockKey); |
|
|
|
|
if(lock.isLocked()){ |
|
|
|
|
return R.fail("该货位还在上架中!!!"); |
|
|
|
|
} |
|
|
|
|
lock.lock(5, TimeUnit.SECONDS); |
|
|
|
|
if (null == allocationId || upShelfZeroOrderList.size() == 0) { |
|
|
|
|
return R.fail("参数不全"); |
|
|
|
|
} |
|
|
|
|