feat: 国标外标支持根据标准号查询

This commit is contained in:
2024-02-02 10:04:14 +08:00
parent 921a4e89b5
commit 61f4a83eee
3 changed files with 21 additions and 11 deletions
@@ -167,6 +167,12 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
@Resource @Resource
private IProcessFbStandardConsultationService processFbStandardConsultationService; private IProcessFbStandardConsultationService processFbStandardConsultationService;
@Resource
private ILawsDomesticStandardService gbService;
@Resource
private ILawsOverseasStandardService fbService;
/** /**
* @Author: liao * @Author: liao
* @Date: 2023/8/23 16:57 * @Date: 2023/8/23 16:57
@@ -1172,11 +1178,13 @@ public class LawsCommonServiceImpl implements ILawsCommonService {
if (StringUtils.isBlank(id) && StringUtils.isBlank(standardNumber)) { if (StringUtils.isBlank(id) && StringUtils.isBlank(standardNumber)) {
throw new JeroBootException(ResultCommon.EMPTY_COMMON, "id和标准号不能同时为空"); throw new JeroBootException(ResultCommon.EMPTY_COMMON, "id和标准号不能同时为空");
} }
if (StrUtil.isBlank(id) && module.equals(TableNameEnum.ENTERPRISE_STANDARDS.getValue())) { ManyStandardSelectionBox singleStandard;
// 根据标准号获取id if (StrUtil.isNotBlank(id)) {
LambdaQueryWrapper<LawsEnterpriseStandard> esWrapper = new LambdaQueryWrapper<>(); singleStandard = getSingleStandard(null, id);
esWrapper.eq(LawsEnterpriseStandard::getStandardNumber, standardNumber); standardNumber = singleStandard.getStandardNumber();
id = esService.list(esWrapper).get(0).getId(); } else {
singleStandard = getSingleStandard(standardNumber, null);
id = singleStandard.getId();
} }
// 获取要操作的表名 // 获取要操作的表名
String tableName = TableNameEnum.getTableName(module); String tableName = TableNameEnum.getTableName(module);
@@ -144,9 +144,10 @@ public class LawsDomesticController {
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
@RequiresPermissions("domesticStandard:search") @RequiresPermissions("domesticStandard:search")
public Result<Map<String,Object>> getByIdAndModule(@RequestParam(name="id") @ApiParam("主键") String id, public Result<Map<String,Object>> getByIdAndModule(@RequestParam(name="id") @ApiParam("主键") String id,
@RequestParam(name="type") @ApiParam("类型(1详情,2新增编辑)") String type) { @RequestParam(name="type") @ApiParam("类型(1详情,2新增编辑)") String type,
lawsCommonService.addLookHistory(id, type, MODULE_VALUE, null); @RequestParam(name="standardNumber", required = false) @ApiParam("标准编号") String standardNumber) {
return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE, type, null)); lawsCommonService.addLookHistory(id, type, MODULE_VALUE, standardNumber);
return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE, type, standardNumber));
} }
@AutoLog(value = "国内法规标准-根据ids删除信息") @AutoLog(value = "国内法规标准-根据ids删除信息")
@@ -135,9 +135,10 @@ public class LawsOverseasController {
@ApiOperationSupport(order = 7) @ApiOperationSupport(order = 7)
@RequiresPermissions("overseasStandard:search") @RequiresPermissions("overseasStandard:search")
public Result<Map<String,Object>> getByIdAndModule(@RequestParam(name="id") @ApiParam("主键") String id, public Result<Map<String,Object>> getByIdAndModule(@RequestParam(name="id") @ApiParam("主键") String id,
@RequestParam(name="type") @ApiParam("类型(1详情,2新增编辑)") String type) { @RequestParam(name="type") @ApiParam("类型(1详情,2新增编辑)") String type,
lawsCommonService.addLookHistory(id, type, MODULE_VALUE, null); @RequestParam(name="standardNumber", required = false) @ApiParam("标准编号") String standardNumber) {
return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE, type, null)); lawsCommonService.addLookHistory(id, type, MODULE_VALUE, standardNumber);
return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE, type, standardNumber));
} }
@AutoLog(value = "海外法规标准-根据ids删除信息") @AutoLog(value = "海外法规标准-根据ids删除信息")