From 578f116668d2dbac16cac9794c484f8ce21018f5 Mon Sep 17 00:00:00 2001 From: du <1725534722@qq.com> Date: Mon, 30 Dec 2024 15:18:25 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9tomcat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-prod.yml | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml index 6db1116..b7ffbf8 100644 --- a/ruoyi-admin/src/main/resources/application-prod.yml +++ b/ruoyi-admin/src/main/resources/application-prod.yml @@ -108,14 +108,19 @@ server: servlet: # 应用的访问路径 context-path: /api - tomcat: - # tomcat的URI编码 - uri-encoding: UTF-8 - # 连接数满后的排队数,默认为100 - accept-count: 1000 - threads: - # tomcat最大线程数,默认为200 - max: 800 - # Tomcat启动初始化的线程数,默认值10 - min-spare: 100 +# tomcat: +# # tomcat的URI编码 +# uri-encoding: UTF-8 +# # 连接数满后的排队数,默认为100 +# accept-count: 1000 +# threads: +# # tomcat最大线程数,默认为200 +# max: 800 +# # Tomcat启动初始化的线程数,默认值10 +# min-spare: 100 + tomcat: + max-threads: 500 + min-spare-threads: 50 + max-connections: 10000 + accept-count: 1000 isTime: true \ No newline at end of file From 285e716e75dcf6039d766f8c4e3b6d557b468ab4 Mon Sep 17 00:00:00 2001 From: du <1725534722@qq.com> Date: Mon, 30 Dec 2024 17:26:48 +0800 Subject: [PATCH 2/2] bugfix --- .../tc/controller/AssetCurrentController.java | 49 ++++++++++++------- .../tc/controller/AssetTaskController.java | 15 ++++-- .../tc/service/impl/AssetAppServiceImpl.java | 7 ++- .../service/impl/AssetEmailServiceImpl.java | 4 +- .../impl/AssetMiniProgramsServiceImpl.java | 4 +- .../impl/AssetOfficialAccountServiceImpl.java | 7 ++- .../tc/service/impl/AssetTaskServiceImpl.java | 28 ++++++----- .../src/main/resources/application-prod.yml | 10 +++- 8 files changed, 85 insertions(+), 39 deletions(-) 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 cc1296c..aedb734 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 @@ -30,6 +30,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.List; +import java.util.Objects; /** * 现有资产表(AssetCurrent)表控制层 @@ -89,7 +90,7 @@ public class AssetCurrentController extends BaseController { private AssetBusinessFormJyService assetBusinessFormJyService; @Resource - private AssetSupplyChainJyService assetSupplyChainJyService ; + private AssetSupplyChainJyService assetSupplyChainJyService; @Resource private UnitOtherConcatJyservice unitOtherConcatJyservice; @@ -146,16 +147,20 @@ public class AssetCurrentController extends BaseController { StringBuilder a = new StringBuilder(); if (assetCurrent.getGlymList() != null) { assetCurrent.getGlymList().forEach(x -> { - a.append(x.getKey()); - a.append(","); + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + a.append(x.getKey()); + a.append(","); + } }); } assetCurrent.setGlym(a.toString()); StringBuilder b = new StringBuilder(); if (assetCurrent.getGlIpList() != null) { - assetCurrent.getGlymList().forEach(x -> { - b.append(x.getKey()); - b.append(","); + assetCurrent.getGlIpList().forEach(x -> { + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + b.append(x.getKey()); + b.append(","); + } }); } assetCurrent.setGlIp(b.toString()); @@ -186,11 +191,12 @@ public class AssetCurrentController extends BaseController { //新增其他联系人 unitOtherConcatService.saveBatch(assetCurrent.getOtherConcat()); } + // 单位有进行中的任务时,管理端新增该单位下的资产则需同步至当前进行中的任务中。 //获取新增资产id Long id = assetCurrent.getId(); Integer i = unitService.selectTaskId(assetCurrent.getDwmc(), "0"); - if(i!=null){ + if (i != null) { //新增资产复制主表 AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo(); BeanUtil.copyProperties(assetCurrent, assetCurrentCpPo); @@ -228,9 +234,13 @@ public class AssetCurrentController extends BaseController { unitOtherConcatCpService.saveBatch(assetCurrentCpPo.getOtherConcat()); } } - return success(); + return + + success(); + } //================================================= + /** * 单位自编辑进行校验 */ @@ -347,12 +357,12 @@ public class AssetCurrentController extends BaseController { @GetMapping("/lookInfo/{id}") public AjaxResult lookInfo(@PathVariable Long id) { AssetCurrentCpPo byId = assetCurrentCpService.getById(id); - byId.setGylxxList(assetSupplyChainCpService.lambdaQuery().eq(AssetSupplyChainCpPo::getAssetId ,byId.getId()).isNull(AssetSupplyChainCpPo::getTaskId).list()); + byId.setGylxxList(assetSupplyChainCpService.lambdaQuery().eq(AssetSupplyChainCpPo::getAssetId, byId.getId()).isNull(AssetSupplyChainCpPo::getTaskId).list()); byId.setJcwlList(assetBasicNetworkCpService.lambdaQuery().eq(AssetBasicNetworkCpPo::getAssetId, byId.getId()).isNull(AssetBasicNetworkCpPo::getTaskId).list()); byId.setXjgywxt(assetBusinessFormCpService.lambdaQuery().eq(AssetBusinessFormCpPo::getAssetId, byId.getId()).isNull(AssetBusinessFormCpPo::getTaskId).one()); byId.setOtherConcat(unitOtherConcatCpService.lambdaQuery().eq(UnitOtherConcatCpPo::getAssetId, byId.getId()).isNull(UnitOtherConcatCpPo::getTaskId).list()); List a1 = new ArrayList<>(); - if(byId.getGlym()!=null){ + if (byId.getGlym() != null) { Arrays.asList(byId.getGlym().split(",")).forEach(x -> { Acomma acomma = new Acomma(); acomma.setKey(x); @@ -361,7 +371,7 @@ public class AssetCurrentController extends BaseController { byId.setGlymList(a1); } List a2 = new ArrayList<>(); - if(byId.getGlIp()!=null){ + if (byId.getGlIp() != null) { Arrays.asList(byId.getGlIp().split(",")).forEach(x -> { Acomma acomma = new Acomma(); acomma.setKey(x); @@ -444,16 +454,20 @@ public class AssetCurrentController extends BaseController { StringBuilder a = new StringBuilder(); if (assetCurrent.getGlymList() != null) { assetCurrent.getGlymList().forEach(x -> { - a.append(x.getKey()); - a.append(","); + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + a.append(x.getKey()); + a.append(","); + } }); } assetCurrent.setGlym(a.toString()); StringBuilder b = new StringBuilder(); if (assetCurrent.getGlIpList() != null) { - assetCurrent.getGlymList().forEach(x -> { - b.append(x.getKey()); - b.append(","); + assetCurrent.getGlIpList().forEach(x -> { + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + b.append(x.getKey()); + b.append(","); + } }); } assetCurrent.setGlIp(b.toString()); @@ -704,8 +718,9 @@ public class AssetCurrentController extends BaseController { AssetCurrentCpPo assetCurrentCpPo = new AssetCurrentCpPo(); BeanUtil.copyProperties(as, assetCurrentCpPo); assetCurrentCpPo.setTaskId(i); + assetCurrentCpPo.setStatus(0); AssetCurrentCpPo two = assetCurrentCpService.lambdaQuery().eq(AssetCurrentCpPo::getXtmc, as.getXtmc()) - .eq(AssetCurrentCpPo::getDwmc, as.getDwmc()).one(); + .eq(AssetCurrentCpPo::getDwmc, as.getDwmc()).isNotNull(AssetCurrentCpPo::getTaskId).one(); if (two != null) { assetCurrentCpPo.setId(two.getId()); assetCurrentCpService.updateById(assetCurrentCpPo); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetTaskController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetTaskController.java index 5804400..48bb4d3 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetTaskController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetTaskController.java @@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.time.LocalDateTime; import java.util.List; +import java.util.Objects; import java.util.Optional; /** @@ -308,16 +309,20 @@ public class AssetTaskController extends BaseController { StringBuilder a = new StringBuilder(); if (!assetCurrent.getGlymList().isEmpty()) { assetCurrent.getGlymList().forEach(x -> { - a.append(x); - a.append(","); + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + a.append(x.getKey()); + a.append(","); + } }); } assetCurrent.setGlym(a.toString()); StringBuilder b = new StringBuilder(); if (!assetCurrent.getGlIpList().isEmpty()) { - assetCurrent.getGlymList().forEach(x -> { - b.append(x); - b.append(","); + assetCurrent.getGlIpList().forEach(x -> { + if (!Objects.equals(x.getKey(), "") && x.getKey() != null) { + b.append(x.getKey()); + b.append(","); + } }); } assetCurrent.setGlIp(b.toString()); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetAppServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetAppServiceImpl.java index 0659fd0..b8aaa07 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetAppServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetAppServiceImpl.java @@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ruoyi.tc.entity.AssetApp; import com.ruoyi.tc.entity.po.AssetAppCpPo; import com.ruoyi.tc.entity.po.AssetEmailCpPo; +import com.ruoyi.tc.entity.po.AssetOfficialAccountCpPo; import com.ruoyi.tc.entity.request.AssetAppPageRequest; import com.ruoyi.tc.mapper.AssetAppMapper; import com.ruoyi.tc.service.AssetAppCpService; @@ -107,11 +108,15 @@ public class AssetAppServiceImpl extends ServiceImpl i @Override public Boolean edit(AssetApp assetApp) { updateById(assetApp); - AssetAppCpPo one = assetAppCpService.lambdaQuery().eq(AssetAppCpPo::getAssetId, assetApp.getId()).one(); + AssetAppCpPo one = assetAppCpService.lambdaQuery() + .eq(AssetAppCpPo::getAssetId, assetApp.getId()) + .isNotNull(AssetAppCpPo::getTaskId) + .one(); if (one != null) { BeanUtil.copyProperties(assetApp, one); one.setTaskId(unitService.selectTaskId(assetApp.getSsdw(), "4")); one.setAssetId(assetApp.getId()); + one.setStatus(0); return assetAppCpService.updateById(one); }else { return true; diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetEmailServiceImpl.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetEmailServiceImpl.java index 9d8d039..2a43be4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetEmailServiceImpl.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/service/impl/AssetEmailServiceImpl.java @@ -107,11 +107,13 @@ public class AssetEmailServiceImpl extends ServiceImpl a1 = new ArrayList<>(); - Arrays.asList(byId.getGlym().split(",")).forEach(x -> { - Acomma acomma = new Acomma(); - acomma.setKey(x); - a1.add(acomma); - }); - byId.setGlymList(a1); + if (byId.getGlym() != null) { + Arrays.asList(byId.getGlym().split(",")).forEach(x -> { + Acomma acomma = new Acomma(); + acomma.setKey(x); + a1.add(acomma); + }); + byId.setGlymList(a1); + } List a2 = new ArrayList<>(); - Arrays.asList(byId.getGlIp().split(",")).forEach(x -> { - Acomma acomma = new Acomma(); - acomma.setKey(x); - a2.add(acomma); - }); - byId.setGlIpList(a2); + if (byId.getGlIp() != null) { + Arrays.asList(byId.getGlIp().split(",")).forEach(x -> { + Acomma acomma = new Acomma(); + acomma.setKey(x); + a2.add(acomma); + }); + byId.setGlIpList(a2); + } return byId; diff --git a/ruoyi-admin/src/main/resources/application-prod.yml b/ruoyi-admin/src/main/resources/application-prod.yml index b7ffbf8..4aeed0f 100644 --- a/ruoyi-admin/src/main/resources/application-prod.yml +++ b/ruoyi-admin/src/main/resources/application-prod.yml @@ -123,4 +123,12 @@ server: min-spare-threads: 50 max-connections: 10000 accept-count: 1000 -isTime: true \ No newline at end of file +isTime: true +# token配置 +token: + # 令牌自定义标识 + header: Authorization + # 令牌密钥 + secret: abcdefghijklmnopqrstuvwxyz + # 令牌有效期(默认30分钟) + expireTime: 480 \ No newline at end of file