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 1556135..2203d5a 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 @@ -520,7 +520,7 @@ public class AssetCurrentController extends BaseController { } } //保存未修改之前的单位名称 - AssetCurrent byId = assetCurrentService.getById(assetCurrent.getId()); +// AssetCurrent byId = assetCurrentService.getById(assetCurrent.getId()); StringBuilder a = new StringBuilder(); if (assetCurrent.getGlymList() != null) { assetCurrent.getGlymList().forEach(x -> { 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 719c6a9..a752b1c 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 @@ -31,6 +31,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; @@ -95,9 +96,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); @@ -118,9 +125,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()); @@ -179,9 +192,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 0d5ee5a..146a7e3 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 @@ -20,6 +20,7 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; +import java.util.Objects; /** * 公众号资产(asset_official_account)表服务实现类 @@ -92,9 +93,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()); @@ -133,9 +140,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());