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); }