From 4b46ea9039734cca6d0e554542880e467cebeb8f Mon Sep 17 00:00:00 2001 From: anthonywj Date: Tue, 16 Jan 2024 13:55:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=80=E6=9D=A5=E5=8D=95=E4=BD=8D=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/controller/basic/BasicCorpController.java | 7 ++++++- .../glxp/api/service/basic/impl/BasicCorpServiceImpl.java | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/basic/BasicCorpController.java b/src/main/java/com/glxp/api/controller/basic/BasicCorpController.java index fea3a66..5ca4d07 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicCorpController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicCorpController.java @@ -2,6 +2,7 @@ package com.glxp.api.controller.basic; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; @@ -21,6 +22,7 @@ import com.glxp.api.service.auth.AuthAdminService; import com.glxp.api.service.basic.BasicCorpService; import com.glxp.api.service.sup.UserCompanyService; import com.glxp.api.util.CustomUtil; +import com.glxp.api.util.StreamUtils; import org.springframework.beans.BeanUtils; import org.springframework.validation.BindingResult; import org.springframework.web.bind.annotation.GetMapping; @@ -55,7 +57,10 @@ public class BasicCorpController { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage()); } List basicUnitMaintainEntities; - basicUnitMaintainFilterRequest.setCompanyIdFk(Long.parseLong(getCompanyId())); + String companyId = getCompanyId(); + if (StrUtil.isNotEmpty(companyId)) { + basicUnitMaintainFilterRequest.setCompanyIdFk(Long.parseLong(getCompanyId())); + } basicUnitMaintainEntities = basicUnitMaintainService.filterList(basicUnitMaintainFilterRequest); diff --git a/src/main/java/com/glxp/api/service/basic/impl/BasicCorpServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/BasicCorpServiceImpl.java index 8f2aa0f..c821c2f 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/BasicCorpServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/BasicCorpServiceImpl.java @@ -121,8 +121,8 @@ public class BasicCorpServiceImpl extends ServiceImpl().eq("corpType", 1).eq("companyIdFk", companyId)); - Long customCount = basicCorpDao.selectCount(new QueryWrapper().eq("corpType", 2).eq("companyIdFk", companyId)); + Long supCount = basicCorpDao.selectCount(new QueryWrapper().eq("corpType", 2).eq("companyIdFk", companyId)); + Long customCount = basicCorpDao.selectCount(new QueryWrapper().eq("corpType", 1).eq("companyIdFk", companyId)); NmapTotalResponse nmapTotalResponse = new NmapTotalResponse(); nmapTotalResponse.setSupCount(supCount.intValue()); nmapTotalResponse.setCustomCount(customCount.intValue());