From d387556ceec7094696b172a9ac79c7c697228499 Mon Sep 17 00:00:00 2001 From: du <1725534722@qq.com> Date: Thu, 9 Jan 2025 14:43:51 +0800 Subject: [PATCH 1/2] bugfix --- .../java/com/ruoyi/tc/controller/AssetCurrentController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java index de3159b..981096e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java @@ -507,7 +507,7 @@ public class AssetCurrentController extends BaseController { @PutMapping public AjaxResult update(@RequestBody @Valid AssetCurrent assetCurrent) { //保存未修改之前的单位名称 - AssetCurrent byId = assetCurrentService.getById(assetCurrent.getId()); +// AssetCurrent byId = assetCurrentService.getById(assetCurrent.getId()); StringBuilder a = new StringBuilder(); if (assetCurrent.getGlymList() != null) { assetCurrent.getGlymList().forEach(x -> { @@ -656,6 +656,8 @@ public class AssetCurrentController extends BaseController { if (dwmcList.isEmpty()) { delete(assetCurrent); }else{ + + delete(assetCurrent); for (AssetTask s:dwmcList){ From 649fdf24f17da9d00aa097cf3ab3154a928549ff Mon Sep 17 00:00:00 2001 From: du <1725534722@qq.com> Date: Fri, 10 Jan 2025 11:19:47 +0800 Subject: [PATCH 2/2] bugfix --- .../AssetOfficialAccountController.java | 37 ++++++++++++++----- .../impl/AssetOfficialAccountServiceImpl.java | 25 ++++++++++--- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetOfficialAccountController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetOfficialAccountController.java index 8fb07d9..cdbcdec 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetOfficialAccountController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetOfficialAccountController.java @@ -33,6 +33,7 @@ import javax.validation.Valid; import java.security.Security; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import static com.ruoyi.common.core.domain.AjaxResult.success; @@ -92,9 +93,15 @@ public class AssetOfficialAccountController { String[] s3 = byId.getCdlx().split("\\|"); for (int i = 0; i < s1.length; i++) { AssetOfficialAccountMenu as = new AssetOfficialAccountMenu(); - as.setCdmc(s1[i]); - as.setCdlj(s2[i]); - as.setCdlx(s3[i]); + if(s1[i]!=null&& !Objects.equals(s1[i], "")){ + as.setCdmc(s1[i]); + } + if(s2[i]!=null&& !Objects.equals(s2[i], "")){ + as.setCdlj(s2[i]); + } + if(s3[i]!=null&& !Objects.equals(s3[i], "")){ + as.setCdlx(s3[i]); + } a1.add(as); } byId.setCdList(a1); @@ -115,9 +122,15 @@ public class AssetOfficialAccountController { StringBuilder b = new StringBuilder(); StringBuilder c = new StringBuilder(); ao.getCdList().forEach(x -> { - a.append(x.getCdmc()).append("|"); - b.append(x.getCdlj()).append("|"); - c.append(x.getCdlx()).append("|"); + if(!Objects.equals(x.getCdmc(), "") &&x.getCdmc()!=null){ + a.append(x.getCdmc()).append("|"); + } + if(!Objects.equals(x.getCdlj(), "") &&x.getCdlj()!=null){ + b.append(x.getCdlj()).append("|"); + } + if(!Objects.equals(x.getCdlx(), "") &&x.getCdlx()!=null){ + c.append(x.getCdlx()).append("|"); + } }); ao.setCdmc(a.toString()); ao.setCdlj(b.toString()); @@ -176,9 +189,15 @@ public class AssetOfficialAccountController { String[] s3 = byId.getCdlx().split("\\|"); for (int i = 0; i < s1.length; i++) { AssetOfficialAccountMenu as = new AssetOfficialAccountMenu(); - as.setCdmc(s1[i]); - as.setCdlj(s2[i]); - as.setCdlx(s3[i]); + if(s1[i]!=null&& !Objects.equals(s1[i], "")){ + as.setCdmc(s1[i]); + } + if(s2[i]!=null&& !Objects.equals(s2[i], "")){ + as.setCdlj(s2[i]); + } + if(s3[i]!=null&& !Objects.equals(s3[i], "")){ + as.setCdlx(s3[i]); + } a1.add(as); } byId.setCdList(a1); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetOfficialAccountServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetOfficialAccountServiceImpl.java index 1b4c9b6..b8b768c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetOfficialAccountServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetOfficialAccountServiceImpl.java @@ -17,6 +17,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; +import java.util.Objects; /** * 公众号资产(asset_official_account)表服务实现类 @@ -88,9 +89,15 @@ public class AssetOfficialAccountServiceImpl extends ServiceImpl { - a.append(x.getCdmc()).append("|"); - b.append(x.getCdlj()).append("|"); - c.append(x.getCdlx()).append("|"); + if(!Objects.equals(x.getCdmc(), "") &&x.getCdmc()!=null){ + a.append(x.getCdmc()).append("|"); + } + if(!Objects.equals(x.getCdlj(), "") &&x.getCdlj()!=null){ + b.append(x.getCdlj()).append("|"); + } + if(!Objects.equals(x.getCdlx(), "") &&x.getCdlx()!=null){ + c.append(x.getCdlx()).append("|"); + } }); assetOfficialAccount.setCdmc(a.toString()); assetOfficialAccount.setCdlj(b.toString()); @@ -129,9 +136,15 @@ public class AssetOfficialAccountServiceImpl extends ServiceImpl { - a.append(x.getCdmc()).append("|"); - b.append(x.getCdlj()).append("|"); - c.append(x.getCdlx()).append("|"); + if(!Objects.equals(x.getCdmc(), "") &&x.getCdmc()!=null){ + a.append(x.getCdmc()).append("|"); + } + if(!Objects.equals(x.getCdlj(), "") &&x.getCdlj()!=null){ + b.append(x.getCdlj()).append("|"); + } + if(!Objects.equals(x.getCdlx(), "") &&x.getCdlx()!=null){ + c.append(x.getCdlx()).append("|"); + } }); assetOfficialAccount.setCdmc(a.toString()); assetOfficialAccount.setCdlj(b.toString());