Explorar o código

1.修复资产撰写产品时如果更改了委托人信息会导致订单中的客户名称与来源被置空的bug

GouGengquan hai 5 días
pai
achega
40197f0dab

+ 10 - 6
service/src/main/java/com/dayou/service/impl/AssetsProductionServiceImpl.java

@@ -133,6 +133,7 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
 
     /**
      * 产品信息更新
+     *
      * @param assetsProduction prod
      * @return Boolean
      */
@@ -143,6 +144,7 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
 
     /**
      * 更新产品选择类型
+     *
      * @param assetsProduction prod
      * @return Boolean
      */
@@ -222,10 +224,11 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
         }
         // 产品如果填了新的委托人信息就将订单的委托人信息一起更新
         if (ObjectUtil.isNotNull(assetsProduction.getClientName())) {
-            Assets assets = new Assets();
-            assets.setId(assetsProduction.getBusinessId());
-            assets.setBailor(assetsProduction.getClientName());
-            assetsService.updateById(assets);
+            assetsService.update(
+                    new LambdaUpdateWrapper<Assets>()
+                            .eq(Assets::getId, assetsProduction.getBusinessId())
+                            .set(Assets::getBailor, assetsProduction.getClientName())
+            );
         }
         // 生成产品二维码
         assetsProduction.setQrCode(businessProductionService.doCreateNormalCode(assetsProduction.getProductionType(), assetsProduction.getProductionNo()));
@@ -240,7 +243,7 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
                 .eq(AssetsProduction::getProductionNo, assetsProduction.getProductionNo())
                 .eq(BaseEntity::getDeleted, 0));
         // 生成防伪验证二维码
-        return this.update(new LambdaUpdateWrapper<AssetsProduction>().eq(BaseEntity::getId,validateCodeProInfo.getId()).set(AssetsProduction::getValidateCode, businessProductionService.doCreateValidateCode(ASSET_BUSINESS,validateCodeProInfo.getId(),validateCodeProInfo.getProductionNo())));
+        return this.update(new LambdaUpdateWrapper<AssetsProduction>().eq(BaseEntity::getId, validateCodeProInfo.getId()).set(AssetsProduction::getValidateCode, businessProductionService.doCreateValidateCode(ASSET_BUSINESS, validateCodeProInfo.getId(), validateCodeProInfo.getProductionNo())));
     }
 
     /**
@@ -490,6 +493,7 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
 
     /**
      * 根据订单收款id获取产品收款信息
+     *
      * @param orderFundId 资产订单收款id
      * @return List<ReportDTO>
      */
@@ -553,7 +557,7 @@ public class AssetsProductionServiceImpl extends ServiceImpl<AssetsProductionMap
     @Override
     public void updateSigner(String jsonString, Long reportId) {
         this.update(new LambdaUpdateWrapper<AssetsProduction>()
-                .set(AssetsProduction::getSignatory,jsonString).eq(BaseEntity::getId,reportId));
+                .set(AssetsProduction::getSignatory, jsonString).eq(BaseEntity::getId, reportId));
     }
 
     /**