use of com.whoiszxl.entity.ProductAllocation in project shopzz by whoiszxl.
the class ProductAllocationController method save.
@SaCheckLogin
@PostMapping
@ApiOperation(value = "新增货位", notes = "新增货位", response = ResponseResult.class)
public ResponseResult<Boolean> save(@RequestBody ProductAllocationVO productAllocationVO) {
ProductAllocation productAllocation = productAllocationVO.clone(ProductAllocation.class);
boolean saveFlag = productAllocationService.save(productAllocation);
return ResponseResult.buildByFlag(saveFlag);
}
use of com.whoiszxl.entity.ProductAllocation in project shopzz by whoiszxl.
the class ProductAllocationController method update.
@SaCheckLogin
@PutMapping
@ApiOperation(value = "更新货位", notes = "更新货位", response = ResponseResult.class)
public ResponseResult<Boolean> update(@RequestBody ProductAllocationVO productAllocationVO) {
ProductAllocation productAllocation = productAllocationVO.clone(ProductAllocation.class);
boolean updateFlag = productAllocationService.updateById(productAllocation);
return ResponseResult.buildByFlag(updateFlag);
}
use of com.whoiszxl.entity.ProductAllocation in project shopzz by whoiszxl.
the class PurchaseOrderController method batchOnShelves.
@PutMapping("/shelves/on")
@ApiOperation(value = "批量新增采购入库单的上架条目", notes = "批量新增采购入库单的上架条目", response = ResponseResult.class)
public ResponseResult<Boolean> batchOnShelves(@RequestBody List<PurchaseInboundOnItemVO> putOnItems) {
// 采购入库单状态判断
for (PurchaseInboundOnItemVO putOnItem : putOnItems) {
Long purchaseOrderItemId = putOnItem.getPurchaseOrderItemId();
PurchaseOrderItem purchaseOrderItem = purchaseOrderItemService.getById(purchaseOrderItemId);
if (purchaseOrderItem == null) {
return ResponseResult.buildError("采购单条目不存在");
}
ProductAllocation productAllocation = productAllocationService.getById(putOnItem.getProductAllocationId());
if (productAllocation == null) {
return ResponseResult.buildError("采购单条目上架的货位不存在");
}
if (putOnItem.getPutOnShelvesCount() > purchaseOrderItem.getPurchaseQuantity()) {
return ResponseResult.buildError(putOnItem.getProductSkuId() + "上架条目数量大于采购数量");
}
}
List<PurchaseInboundOnItem> items = BeanCopierUtils.copyListProperties(putOnItems, PurchaseInboundOnItem::new);
boolean saveFlag = purchaseInboundOnItemService.saveBatch(items);
return ResponseResult.buildByFlag(saveFlag);
}
Aggregations