|
|
|
@ -135,19 +135,25 @@ public class DistributionParcelListController extends BladeController {
|
|
|
|
|
@ApiOperationSupport(order = 5) |
|
|
|
|
@ApiOperation(value = "修改", notes = "传入distributionParcelList") |
|
|
|
|
public R update(@Valid @RequestBody DistributionParcelListDTO distributionParcelListDTO) { |
|
|
|
|
|
|
|
|
|
if(ObjectUtils.isNotNull(distributionParcelListDTO.getMaterialId())){ |
|
|
|
|
BasicMaterialEntity materialOwnId = basicMaterialClient.getMaterialOwnId(distributionParcelListDTO.getMaterialId()); |
|
|
|
|
if(ObjectUtils.isNotNull(materialOwnId)){ |
|
|
|
|
distributionParcelListDTO.setMaterialCode(materialOwnId.getProductCode()); |
|
|
|
|
distributionParcelListDTO.setMaterialName(materialOwnId.getName()); |
|
|
|
|
distributionParcelListDTO.setMaterialUnit(DictBizCache.getValue(DictBizConstant.LOGPM_UNIT,materialOwnId.getLogpmUnit())); |
|
|
|
|
distributionParcelListDTO.setSku(materialOwnId.getSku()); |
|
|
|
|
distributionParcelListDTO.getIds().forEach( i ->{ |
|
|
|
|
distributionParcelListDTO.setId(Long.parseLong(i)); |
|
|
|
|
distributionParcelListDTO.setMaterialCode(materialOwnId.getProductCode()); |
|
|
|
|
distributionParcelListDTO.setMaterialName(materialOwnId.getName()); |
|
|
|
|
distributionParcelListDTO.setMaterialUnit(DictBizCache.getValue(DictBizConstant.LOGPM_UNIT,materialOwnId.getLogpmUnit())); |
|
|
|
|
distributionParcelListDTO.setSku(materialOwnId.getSku()); |
|
|
|
|
distributionParcelListService.updateById(distributionParcelListDTO); |
|
|
|
|
}); |
|
|
|
|
return R.status(true); |
|
|
|
|
}else{ |
|
|
|
|
return R.fail("操作失败!!"); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
return R.fail("数据不存在!!"); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
return R.status(distributionParcelListService.updateById(distributionParcelListDTO)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|