diff --git a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java index 8390082a..f15ec353 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/common/service/impl/LawsCommonServiceImpl.java @@ -167,6 +167,12 @@ public class LawsCommonServiceImpl implements ILawsCommonService { @Resource private IProcessFbStandardConsultationService processFbStandardConsultationService; + @Resource + private ILawsDomesticStandardService gbService; + + @Resource + private ILawsOverseasStandardService fbService; + /** * @Author: liao * @Date: 2023/8/23 16:57 @@ -1172,11 +1178,13 @@ public class LawsCommonServiceImpl implements ILawsCommonService { if (StringUtils.isBlank(id) && StringUtils.isBlank(standardNumber)) { throw new JeroBootException(ResultCommon.EMPTY_COMMON, "id和标准号不能同时为空"); } - if (StrUtil.isBlank(id) && module.equals(TableNameEnum.ENTERPRISE_STANDARDS.getValue())) { - // 根据标准号获取id - LambdaQueryWrapper esWrapper = new LambdaQueryWrapper<>(); - esWrapper.eq(LawsEnterpriseStandard::getStandardNumber, standardNumber); - id = esService.list(esWrapper).get(0).getId(); + ManyStandardSelectionBox singleStandard; + if (StrUtil.isNotBlank(id)) { + singleStandard = getSingleStandard(null, id); + standardNumber = singleStandard.getStandardNumber(); + } else { + singleStandard = getSingleStandard(standardNumber, null); + id = singleStandard.getId(); } // 获取要操作的表名 String tableName = TableNameEnum.getTableName(module); diff --git a/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsDomesticController.java b/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsDomesticController.java index 6435473f..bbaaf9b1 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsDomesticController.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsDomesticController.java @@ -144,9 +144,10 @@ public class LawsDomesticController { @ApiOperationSupport(order = 7) @RequiresPermissions("domesticStandard:search") public Result> getByIdAndModule(@RequestParam(name="id") @ApiParam("主键") String id, - @RequestParam(name="type") @ApiParam("类型(1详情,2新增编辑)") String type) { - lawsCommonService.addLookHistory(id, type, MODULE_VALUE, null); - return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE, type, null)); + @RequestParam(name="type") @ApiParam("类型(1详情,2新增编辑)") String type, + @RequestParam(name="standardNumber", required = false) @ApiParam("标准编号") String standardNumber) { + lawsCommonService.addLookHistory(id, type, MODULE_VALUE, standardNumber); + return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE, type, standardNumber)); } @AutoLog(value = "国内法规标准-根据ids删除信息") diff --git a/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsOverseasController.java b/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsOverseasController.java index 22da8d9a..3b6072c0 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsOverseasController.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsOverseasController.java @@ -135,9 +135,10 @@ public class LawsOverseasController { @ApiOperationSupport(order = 7) @RequiresPermissions("overseasStandard:search") public Result> getByIdAndModule(@RequestParam(name="id") @ApiParam("主键") String id, - @RequestParam(name="type") @ApiParam("类型(1详情,2新增编辑)") String type) { - lawsCommonService.addLookHistory(id, type, MODULE_VALUE, null); - return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE, type, null)); + @RequestParam(name="type") @ApiParam("类型(1详情,2新增编辑)") String type, + @RequestParam(name="standardNumber", required = false) @ApiParam("标准编号") String standardNumber) { + lawsCommonService.addLookHistory(id, type, MODULE_VALUE, standardNumber); + return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE, type, standardNumber)); } @AutoLog(value = "海外法规标准-根据ids删除信息")