Browse Source

1.货架调整缓存

training
0.0 1 year ago
parent
commit
4f3c5c54ee
  1. 19
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsShelfController.java
  2. 1
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java

19
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataGoodsShelfController.java

@ -40,6 +40,7 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
@ -74,6 +75,8 @@ public class BasicdataGoodsShelfController extends BladeController {
private final IBasicdataWarehouseService basicdataWarehouseService;
private final BladeRedis bladeRedis;
/**
@ -135,6 +138,10 @@ public class BasicdataGoodsShelfController extends BladeController {
@ApiOperation(value = "编辑货位", notes = "传入BasicdataGoodsShelf")
public R allocation(@Valid @RequestBody BasicdataGoodsShelfDTO basicdataGoodsShelfDTO) {
R msg = basicdataGoodsShelfService.insertallocation(basicdataGoodsShelfDTO);
if (msg.getCode() == 200) {
String prefix = "warehouseGoodsAllocation/*";
bladeRedis.del(bladeRedis.keys(prefix));
}
return msg;
}
@ -149,6 +156,10 @@ public class BasicdataGoodsShelfController extends BladeController {
return R.fail("参数不全");
}
R msg = basicdataGoodsShelfService.addlayer(basicdataGoodsShelfDTO);
if (msg.getCode() == 200) {
String prefix = "warehouseGoodsAllocation/*";
bladeRedis.del(bladeRedis.keys(prefix));
}
return msg;
}
@ -194,6 +205,10 @@ public class BasicdataGoodsShelfController extends BladeController {
public R disable(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
// List<Long> longs = Func.toLongList(ids);
R msg = basicdataGoodsShelfService.disableGoodsArea(ids);
if (msg.getCode() == 200) {
String prefix = "warehouseGoodsAllocation/*";
bladeRedis.del(bladeRedis.keys(prefix));
}
return msg;
}
@ -206,6 +221,10 @@ public class BasicdataGoodsShelfController extends BladeController {
public R enable(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
// List<Long> longs = Func.toLongList(ids);
R msg = basicdataGoodsShelfService.enableGoodsArea(ids);
if (msg.getCode() == 200) {
String prefix = "warehouseGoodsAllocation/*";
bladeRedis.del(bladeRedis.keys(prefix));
}
return msg;
}

1
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataGoodsShelfServiceImpl.java

@ -834,6 +834,7 @@ public class BasicdataGoodsShelfServiceImpl extends BaseServiceImpl<BasicdataGoo
basicdataGoodsAllocationService.saveBatch(arrayList);
//更新层列数量
if ((layerNum+layerNum1) > basicdataGoodsShelfDTO.getStoreyNum()) {
basicdataGoodsShelfDTO.setColumnNum(null);
basicdataGoodsShelfDTO.setStoreyNum(layerNum+layerNum1);
boolean b = this.updateById(basicdataGoodsShelfDTO);
}

Loading…
Cancel
Save