移动端生产领料、生产退料的新增接口,仓库属性更新修改为根据code进行。

This commit is contained in:
yinjinlu-pc\尹金路 2025-01-16 17:48:50 +08:00
parent 30e5302a9b
commit 9132b2a7f4
2 changed files with 43 additions and 36 deletions

View File

@ -73,21 +73,26 @@ public class WmProductRectpLineMobController extends BaseController {
@PostMapping
public AjaxResult add(@RequestBody WmProductRecptLine wmProductRecptLine)
{
if(StringUtils.isNotNull(wmProductRecptLine.getWarehouseId())){
WmWarehouse warehouse = wmWarehouseService.selectWmWarehouseByWarehouseId(wmProductRecptLine.getWarehouseId());
wmProductRecptLine.setWarehouseCode(warehouse.getWarehouseCode());
if(StringUtils.isNotNull(wmProductRecptLine.getWarehouseCode())){
WmWarehouse warehouse = wmWarehouseService.selectWmWarehouseByWarehouseCode(wmProductRecptLine.getWarehouseCode());
wmProductRecptLine.setWarehouseId(warehouse.getWarehouseId());
wmProductRecptLine.setWarehouseName(warehouse.getWarehouseName());
}
if(StringUtils.isNotNull(wmProductRecptLine.getLocationId())){
WmStorageLocation location = wmStorageLocationService.selectWmStorageLocationByLocationId(wmProductRecptLine.getLocationId());
wmProductRecptLine.setLocationCode(location.getLocationCode());
if(StringUtils.isNotNull(wmProductRecptLine.getLocationCode())){
WmStorageLocation location = wmStorageLocationService.selectWmStorageLocationByLocationCode(wmProductRecptLine.getLocationCode());
wmProductRecptLine.setLocationId(location.getLocationId());
wmProductRecptLine.setLocationName(location.getLocationName());
}
if(StringUtils.isNotNull(wmProductRecptLine.getAreaId())){
WmStorageArea area = wmStorageAreaService.selectWmStorageAreaByAreaId(wmProductRecptLine.getAreaId());
wmProductRecptLine.setAreaCode(area.getAreaCode());
if(StringUtils.isNotNull(wmProductRecptLine.getAreaCode())){
WmStorageArea area = wmStorageAreaService.selectWmStorageAreaByAreaCode(wmProductRecptLine.getAreaCode());
wmProductRecptLine.setAreaId(area.getAreaId());
wmProductRecptLine.setAreaName(area.getAreaName());
}
wmProductRecptLine.setCreateBy(getUsername());
wmProductRecptLineService.insertWmProductRecptLine(wmProductRecptLine);
return AjaxResult.success(wmProductRecptLine);
@ -102,19 +107,21 @@ public class WmProductRectpLineMobController extends BaseController {
@PutMapping
public AjaxResult edit(@RequestBody WmProductRecptLine wmProductRecptLine)
{
if(StringUtils.isNotNull(wmProductRecptLine.getWarehouseId())){
WmWarehouse warehouse = wmWarehouseService.selectWmWarehouseByWarehouseId(wmProductRecptLine.getWarehouseId());
wmProductRecptLine.setWarehouseCode(warehouse.getWarehouseCode());
if(StringUtils.isNotNull(wmProductRecptLine.getWarehouseCode())){
WmWarehouse warehouse = wmWarehouseService.selectWmWarehouseByWarehouseCode(wmProductRecptLine.getWarehouseCode());
wmProductRecptLine.setWarehouseId(warehouse.getWarehouseId());
wmProductRecptLine.setWarehouseName(warehouse.getWarehouseName());
}
if(StringUtils.isNotNull(wmProductRecptLine.getLocationId())){
WmStorageLocation location = wmStorageLocationService.selectWmStorageLocationByLocationId(wmProductRecptLine.getLocationId());
wmProductRecptLine.setLocationCode(location.getLocationCode());
if(StringUtils.isNotNull(wmProductRecptLine.getLocationCode())){
WmStorageLocation location = wmStorageLocationService.selectWmStorageLocationByLocationCode(wmProductRecptLine.getLocationCode());
wmProductRecptLine.setLocationId(location.getLocationId());
wmProductRecptLine.setLocationName(location.getLocationName());
}
if(StringUtils.isNotNull(wmProductRecptLine.getAreaId())){
WmStorageArea area = wmStorageAreaService.selectWmStorageAreaByAreaId(wmProductRecptLine.getAreaId());
wmProductRecptLine.setAreaCode(area.getAreaCode());
if(StringUtils.isNotNull(wmProductRecptLine.getAreaCode())){
WmStorageArea area = wmStorageAreaService.selectWmStorageAreaByAreaCode(wmProductRecptLine.getAreaCode());
wmProductRecptLine.setAreaId(area.getAreaId());
wmProductRecptLine.setAreaName(area.getAreaName());
}
return toAjax(wmProductRecptLineService.updateWmProductRecptLine(wmProductRecptLine));

View File

@ -78,19 +78,19 @@ public class WmRtIssueLineMobController extends BaseController {
wmRtIssueLine.setBatchCode(stock.getBatchCode());
}
if(StringUtils.isNotNull(wmRtIssueLine.getWarehouseId())){
WmWarehouse warehouse = wmWarehouseService.selectWmWarehouseByWarehouseId(wmRtIssueLine.getWarehouseId());
wmRtIssueLine.setWarehouseCode(warehouse.getWarehouseCode());
if(StringUtils.isNotNull(wmRtIssueLine.getWarehouseCode())){
WmWarehouse warehouse = wmWarehouseService.selectWmWarehouseByWarehouseCode(wmRtIssueLine.getWarehouseCode());
wmRtIssueLine.setWarehouseId(warehouse.getWarehouseId());
wmRtIssueLine.setWarehouseName(warehouse.getWarehouseName());
}
if(StringUtils.isNotNull(wmRtIssueLine.getLocationId())){
WmStorageLocation location = wmStorageLocationService.selectWmStorageLocationByLocationId(wmRtIssueLine.getLocationId());
wmRtIssueLine.setLocationCode(location.getLocationCode());
if(StringUtils.isNotNull(wmRtIssueLine.getLocationCode())){
WmStorageLocation location = wmStorageLocationService.selectWmStorageLocationByLocationCode(wmRtIssueLine.getLocationCode());
wmRtIssueLine.setLocationId(location.getLocationId());
wmRtIssueLine.setLocationName(location.getLocationName());
}
if(StringUtils.isNotNull(wmRtIssueLine.getAreaId())){
WmStorageArea area = wmStorageAreaService.selectWmStorageAreaByAreaId(wmRtIssueLine.getAreaId());
wmRtIssueLine.setAreaCode(area.getAreaCode());
if(StringUtils.isNotNull(wmRtIssueLine.getAreaCode())){
WmStorageArea area = wmStorageAreaService.selectWmStorageAreaByAreaCode(wmRtIssueLine.getAreaCode());
wmRtIssueLine.setAreaId(area.getAreaId());
wmRtIssueLine.setAreaName(area.getAreaName());
}
wmRtIssueLine.setCreateBy(getUsername());
@ -116,19 +116,19 @@ public class WmRtIssueLineMobController extends BaseController {
wmRtIssueLine.setBatchCode(stock.getBatchCode());
}
if(StringUtils.isNotNull(wmRtIssueLine.getWarehouseId())){
WmWarehouse warehouse = wmWarehouseService.selectWmWarehouseByWarehouseId(wmRtIssueLine.getWarehouseId());
wmRtIssueLine.setWarehouseCode(warehouse.getWarehouseCode());
if(StringUtils.isNotNull(wmRtIssueLine.getWarehouseCode())){
WmWarehouse warehouse = wmWarehouseService.selectWmWarehouseByWarehouseCode(wmRtIssueLine.getWarehouseCode());
wmRtIssueLine.setWarehouseId(warehouse.getWarehouseId());
wmRtIssueLine.setWarehouseName(warehouse.getWarehouseName());
}
if(StringUtils.isNotNull(wmRtIssueLine.getLocationId())){
WmStorageLocation location = wmStorageLocationService.selectWmStorageLocationByLocationId(wmRtIssueLine.getLocationId());
wmRtIssueLine.setLocationCode(location.getLocationCode());
if(StringUtils.isNotNull(wmRtIssueLine.getLocationCode())){
WmStorageLocation location = wmStorageLocationService.selectWmStorageLocationByLocationCode(wmRtIssueLine.getLocationCode());
wmRtIssueLine.setLocationId(location.getLocationId());
wmRtIssueLine.setLocationName(location.getLocationName());
}
if(StringUtils.isNotNull(wmRtIssueLine.getAreaId())){
WmStorageArea area = wmStorageAreaService.selectWmStorageAreaByAreaId(wmRtIssueLine.getAreaId());
wmRtIssueLine.setAreaCode(area.getAreaCode());
if(StringUtils.isNotNull(wmRtIssueLine.getAreaCode())){
WmStorageArea area = wmStorageAreaService.selectWmStorageAreaByAreaCode(wmRtIssueLine.getAreaCode());
wmRtIssueLine.setAreaId(area.getAreaId());
wmRtIssueLine.setAreaName(area.getAreaName());
}
return toAjax(wmRtIssueLineService.updateWmRtIssueLine(wmRtIssueLine));