From 8cca1d41886ebea2e27010812d98bb4657ecb903 Mon Sep 17 00:00:00 2001 From: yjz <3131811435@qq.com> Date: Fri, 27 Oct 2023 16:05:05 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AF=B9?= =?UTF-8?q?=E6=AF=94):=20=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AF=B9=E6=AF=94?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E8=AF=A6=E6=83=85=E6=9F=A5=E8=AF=A2=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LawsCustomCompareInfoController.java | 16 +++--- .../ILawsCustomCompareInfoService.java | 14 ++--- .../LawsCustomCompareInfoServiceImpl.java | 52 ++++++++++++------- 3 files changed, 47 insertions(+), 35 deletions(-) diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoController.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoController.java index df3a3407..5df18d89 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoController.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/controller/LawsCustomCompareInfoController.java @@ -108,10 +108,10 @@ public class LawsCustomCompareInfoController { @AutoLog(value = "自定义对比-标准列表分页查询") @ApiOperation(value="自定义对比-标准列表分页查询", notes="自定义对比-标准列表分页查询") @GetMapping(value = "/queryStandardByInfoId") - public Result> queryStandardList(String id, + public Result> queryStandardList(String infoId, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize) { - return Result.OK(lawsCustomCompareInfoService.queryStandardByInfoId(id, pageNo, pageSize)); + return Result.OK(lawsCustomCompareInfoService.queryStandardByInfoId(infoId, pageNo, pageSize)); } /** @@ -121,8 +121,8 @@ public class LawsCustomCompareInfoController { @AutoLog(value = "自定义对比-表格详情") @ApiOperation(value="自定义对比-表格详情", notes="自定义对比-表格详情") @GetMapping(value = "/queryTableDetail") - public Result queryTableDetail(String id) { - return Result.OK(lawsCustomCompareInfoService.queryTableDetail(id)); + public Result queryTableDetail(String infoId) { + return Result.OK(lawsCustomCompareInfoService.queryTableDetail(infoId)); } /** @@ -132,8 +132,8 @@ public class LawsCustomCompareInfoController { @AutoLog(value = "自定义对比-清单维护列表查询") @ApiOperation(value="自定义对比-清单维护列表查询", notes="自定义对比-清单维护列表查询") @GetMapping(value = "/queryInventory") - public Result> queryInventoryByInfoId(String id) { - return Result.OK(lawsCustomCompareInfoService.queryInventory(id)); + public Result> queryInventoryByInfoId(String infoId) { + return Result.OK(lawsCustomCompareInfoService.queryInventory(infoId)); } /** @@ -232,8 +232,8 @@ public class LawsCustomCompareInfoController { @AutoLog(value = "自定义对比-导出") @ApiOperation(value = "自定义对比-导出") @GetMapping("/exportExcel") - public void exportExcel(String id,HttpServletRequest request, HttpServletResponse response) { - lawsCustomCompareInfoService.exportExcel(id, request, response); + public void exportExcel(String infoId, HttpServletRequest request, HttpServletResponse response) { + lawsCustomCompareInfoService.exportExcel(infoId, request, response); } } diff --git a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInfoService.java b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInfoService.java index dc916084..2c744c44 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInfoService.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/customcompare/service/ILawsCustomCompareInfoService.java @@ -62,10 +62,10 @@ public interface ILawsCustomCompareInfoService extends IService queryInventory(String id); + Map queryInventory(String infoId); /** * 自定义对比-标准列表分页查询 - * @param id + * @param infoId * @return */ - IPage queryStandardByInfoId(String id,Integer pageNo, Integer pageSize); + IPage queryStandardByInfoId(String infoId,Integer pageNo, Integer pageSize); /** * 自定义对比-删除标准列表 @@ -98,7 +98,7 @@ public interface ILawsCustomCompareInfoService extends IService(pageNo, pageSize), queryWrapper); } @@ -224,14 +225,14 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl queryInventory(String id) { + public Map queryInventory(String infoId) { List list = lawsCustomCompareInventoryService.list( new LambdaQueryWrapper() - .eq(LawsCustomCompareInventory::getInfoId, id)); + .eq(LawsCustomCompareInventory::getInfoId, infoId)); Map map = new HashMap<>(); // 特点 @@ -285,11 +286,11 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl queryStandardByInfoId(String id, Integer pageNo, Integer pageSize){ + public IPage queryStandardByInfoId(String infoId, Integer pageNo, Integer pageSize){ // 自定义对比_标准 关联表 List list = lawsCustomCompareInfoStandardService.list( new LambdaQueryWrapper() - .eq(LawsCustomCompareInfoStandard::getInfoId, id) + .eq(LawsCustomCompareInfoStandard::getInfoId, infoId) .orderByAsc(LawsCustomCompareInfoStandard::getCreateTime)); if (!list.isEmpty()){ // 查询标准数据 @@ -311,9 +312,9 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl> countryMap = tableDetailVO.getCountryMap(); // 内容整合 @@ -522,17 +523,17 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl cellList = lawsCustomCompareCellService.list( new LambdaQueryWrapper() - .eq(LawsCustomCompareCell::getInfoId, id)); + .eq(LawsCustomCompareCell::getInfoId, infoId)); tableDetailVO.setList(cellList); } - private void setRanksMap(String id, TableDetailVO tableDetailVO) { + private void setRanksMap(String infoId, TableDetailVO tableDetailVO) { List inventoryList = lawsCustomCompareInventoryService.list( new LambdaQueryWrapper() - .eq(LawsCustomCompareInventory::getInfoId, id) + .eq(LawsCustomCompareInventory::getInfoId, infoId) .orderByAsc(LawsCustomCompareInventory::getCreateTime)); if (!inventoryList.isEmpty()){ List sysDictItemList = getDicItem("inventory_type"); @@ -561,10 +562,10 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl infoStandardList = lawsCustomCompareInfoStandardService.list( new LambdaQueryWrapper() - .eq(LawsCustomCompareInfoStandard::getInfoId, id) + .eq(LawsCustomCompareInfoStandard::getInfoId, infoId) .orderByAsc(LawsCustomCompareInfoStandard::getCreateTime)); if (!infoStandardList.isEmpty()){ // 国内 @@ -572,21 +573,30 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl LawsCustomCompareCommon.STANDARD_TYPE1.equals(v.getStandardType())) .map(LawsCustomCompareInfoStandard::getStandardId) .collect(Collectors.toList()); - List lawsDomesticStandards = lawsDomesticStandardService.listByIds(domesticIds); + List lawsDomesticStandards = new ArrayList<>(); + if (!domesticIds.isEmpty()){ + lawsDomesticStandards = lawsDomesticStandardService.listByIds(domesticIds); + } // 海外 List overseasIds= infoStandardList.stream() .filter(v -> LawsCustomCompareCommon.STANDARD_TYPE2.equals(v.getStandardType())) .map(LawsCustomCompareInfoStandard::getStandardId) .collect(Collectors.toList()); - List lawsOverseasStandards = lawsOverseasStandardService.listByIds(overseasIds); + List lawsOverseasStandards = new ArrayList<>(); + if (!overseasIds.isEmpty()){ + lawsOverseasStandards = lawsOverseasStandardService.listByIds(overseasIds); + } // 企业 List enterpriseIds = infoStandardList.stream() .filter(v -> LawsCustomCompareCommon.STANDARD_TYPE3.equals(v.getStandardType())) .map(LawsCustomCompareInfoStandard::getStandardId) .collect(Collectors.toList()); - List lawsEnterpriseStandards = lawsEnterpriseStandardService.listByIds(enterpriseIds); + List lawsEnterpriseStandards = new ArrayList<>(); + if (!enterpriseIds.isEmpty()){ + lawsEnterpriseStandards = lawsEnterpriseStandardService.listByIds(enterpriseIds); + } // 处理数据 List standardVOList = new ArrayList<>(); @@ -602,7 +612,7 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl> countryMap = standardVOList.stream() .map(v -> { - v.setInfoId(id); + v.setInfoId(infoId); // 字典翻译 String countryOrRegion = v.getCountryOrRegion(); if (StringUtils.isNotBlank(countryOrRegion)){ @@ -613,6 +623,8 @@ public class LawsCustomCompareInfoServiceImpl extends ServiceImpl