From ba7b64502cd7084cffba15d9a275f9f87bbabfa9 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Thu, 28 Mar 2024 21:48:50 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E8=BF=90=E5=8D=95=E6=94=B6?= =?UTF-8?q?=E8=B4=A7=E4=BA=BA=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionStockArticleController.java | 31 +++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java index ccf65407f..03b5ae41c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java @@ -41,6 +41,7 @@ import org.springblade.core.mp.support.Query; import org.springblade.core.secure.BladeUser; import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; +import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.DateUtil; import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.StringUtil; @@ -353,7 +354,20 @@ public class DistributionStockArticleController extends BladeController { public R updateClient(@Valid @RequestBody DistributionStockArticleEntity distributionStockArticle) { Long id = distributionStockArticle.getId(); DistributionStockArticleEntity oldStockArticle = distributionStockArticleService.getById(id); - String content = oldStockArticle.compareCustomerInfo(distributionStockArticle); + DistributionStockArticleEntity newStockArticle = new DistributionStockArticleEntity(); + BeanUtil.copy(oldStockArticle,newStockArticle); + String consigneePerson = distributionStockArticle.getConsigneePerson(); + String customerName = distributionStockArticle.getCustomerName(); + if(StringUtil.isNotBlank(consigneePerson)){ + newStockArticle.setConsigneePerson(consigneePerson); + newStockArticle.setConsigneeMobile(distributionStockArticle.getConsigneeMobile()); + newStockArticle.setConsigneeAddress(distributionStockArticle.getConsigneeAddress()); + }else{ + newStockArticle.setCustomerName(customerName); + newStockArticle.setCustomerTelephone(distributionStockArticle.getCustomerTelephone()); + newStockArticle.setCustomerAddress(distributionStockArticle.getCustomerAddress()); + } + String content = oldStockArticle.compareCustomerInfo(newStockArticle); if(StringUtil.isNotBlank(content)){ distributionOrderCustomerLogService.saveLog(content,1,id); } @@ -368,7 +382,20 @@ public class DistributionStockArticleController extends BladeController { for (DistributionStockArticleEntity stockArticleEntity : entityList) { Long id = stockArticleEntity.getId(); DistributionStockArticleEntity oldStockArticle = distributionStockArticleService.getById(id); - String content = oldStockArticle.compareCustomerInfo(stockArticleEntity); + DistributionStockArticleEntity newStockArticle = new DistributionStockArticleEntity(); + BeanUtil.copy(oldStockArticle,newStockArticle); + String consigneePerson = stockArticleEntity.getConsigneePerson(); + String customerName = stockArticleEntity.getCustomerName(); + if(StringUtil.isNotBlank(consigneePerson)){ + newStockArticle.setConsigneePerson(consigneePerson); + newStockArticle.setConsigneeMobile(stockArticleEntity.getConsigneeMobile()); + newStockArticle.setConsigneeAddress(stockArticleEntity.getConsigneeAddress()); + }else{ + newStockArticle.setCustomerName(customerName); + newStockArticle.setCustomerTelephone(stockArticleEntity.getCustomerTelephone()); + newStockArticle.setCustomerAddress(stockArticleEntity.getCustomerAddress()); + } + String content = oldStockArticle.compareCustomerInfo(newStockArticle); if(StringUtil.isNotBlank(content)){ distributionOrderCustomerLogService.saveLog(content,2,id); }