From 0ba98a9b3717ef8c30b43735e039b721a444b86c Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080@qq.com> Date: Wed, 9 Aug 2023 21:01:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=89=B9=E9=87=8F=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E7=89=A9=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionParcelListController.java | 18 ++++++++++++------ .../dto/DistributionParcelListDTO.java | 3 +++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionParcelListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionParcelListController.java index 74bfc1659..12a58f517 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionParcelListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionParcelListController.java @@ -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)); } /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionParcelListDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionParcelListDTO.java index 38dfd8e9d..e61d86591 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionParcelListDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistributionParcelListDTO.java @@ -20,6 +20,8 @@ import com.logpm.distribution.entity.DistributionParcelListEntity; import lombok.Data; import lombok.EqualsAndHashCode; +import java.util.List; + /** * 在库订单包件清单 数据传输对象实体类 * @@ -36,5 +38,6 @@ public class DistributionParcelListDTO extends DistributionParcelListEntity { private String materialCode; private String materialUnit; private String sku; + private List ids; }