From 43658fec38e48e65fc72ea2a85f57662fd156b05 Mon Sep 17 00:00:00 2001 From: du <1725534722@qq.com> Date: Tue, 14 Jan 2025 09:16:18 +0800 Subject: [PATCH] BUGFIX --- .../ruoyi/tc/entity/AssetOfficialAccount.java | 2 +- .../impl/AssetOfficialAccountServiceImpl.java | 27 +++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetOfficialAccount.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetOfficialAccount.java index 3633416..7728c3c 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetOfficialAccount.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/AssetOfficialAccount.java @@ -186,7 +186,7 @@ public class AssetOfficialAccount extends BaseClass implements Serializable { /** * 平台类型 */ - @Excel(name = "平台类型", sort = 99) + @Excel(name = "平台类型", sort = 99,readConverterExp = "1=微信,2=抖音,3=微博,4=今日头条,5=快手,6=B站,7=小红书") @ApiModelProperty("平台类型") private String ptlx; 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 ca3299b..2334609 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 @@ -88,12 +88,14 @@ public class AssetOfficialAccountServiceImpl extends ServiceImpl list3 = unitService.lambdaQuery().eq(Unit::getNickName, assetOfficialAccount.getSsdw()).eq(Unit::getDelFlag, 0).list(); - if (list3 == null || list3.isEmpty()) { - throw new ServiceException("请选择已有单位!"); - } - - List list1 = lambdaQuery().eq(AssetOfficialAccount::getSsdw, assetOfficialAccount.getSsdw()) +// List list3 = unitService.lambdaQuery() +// .eq(Unit::getNickName, assetOfficialAccount.getSsdw()).eq(Unit::getDelFlag, 0).list(); +// if (list3 == null || list3.isEmpty()) { +// throw new ServiceException("请选择已有单位!"); +// } + + List list1 = lambdaQuery() + .eq(AssetOfficialAccount::getSsdw, assetOfficialAccount.getSsdw()) .eq(AssetOfficialAccount::getGzhmc, assetOfficialAccount.getGzhmc()).list(); if (list1 != null&& !list1.isEmpty()){ throw new ServiceException("不允许新增重复资产!"); @@ -145,15 +147,12 @@ public class AssetOfficialAccountServiceImpl extends ServiceImpl list3 = unitService.lambdaQuery().eq(Unit::getNickName, assetOfficialAccount.getSsdw()).eq(Unit::getDelFlag, 0).list(); - if (list3 == null || list3.isEmpty()) { - throw new ServiceException("请选择已有单位!"); + List list4= lambdaQuery() + .eq(AssetOfficialAccount::getSsdw, assetOfficialAccount.getSsdw()) + .eq(AssetOfficialAccount::getGzhmc, assetOfficialAccount.getGzhmc()).list(); + if (list4 != null&& !list4.isEmpty()){ + throw new ServiceException("不允许新增重复资产!"); } - - - - if (assetOfficialAccount.getCdList() != null && !assetOfficialAccount.getCdList().isEmpty()) { StringBuilder a = new StringBuilder(); StringBuilder b = new StringBuilder();