diff --git a/laws-modules/src/main/java/com/jero/modules/laws/common/service/ILawsCommonService.java b/laws-modules/src/main/java/com/jero/modules/laws/common/service/ILawsCommonService.java index cdd86e7a..34d6288b 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/common/service/ILawsCommonService.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/common/service/ILawsCommonService.java @@ -55,14 +55,14 @@ public interface ILawsCommonService { * @Date: 2023/8/24 10:53 * @Description: 获取表单模型 **/ - Map getFormModel(String module); + Map getFormModel(String module, Integer type); /** * @Author: liao * @Date: 2023/8/24 11:49 * @Description: 根据id和模块标识获取信息 **/ - Map getByIdAndModule(String id, String module); + Map getByIdAndModule(String id, String module, Integer type); /** * @Author: liao 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 5fd4a396..5e00287a 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 @@ -440,7 +440,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService { String id = (String) parameterMap.get(FieldCommon.ID); parameterMap.remove(FieldCommon.ID); // 获取数据库里没修改的数据 - Map oldDataMap = getByIdAndModule(id, module); + Map oldDataMap = getByIdAndModule(id, module, 2); // 组装更新内容 StringBuilder recordBuffer = new StringBuilder(); @@ -570,7 +570,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService { * @Description: 获取表单模型 **/ @Override - public Map getFormModel(String module) { + public Map getFormModel(String module, Integer type) { // 获取操作语言 LanguageEnum language = MessageUtils.getLanguage(); // 获取要操作的表名 @@ -578,8 +578,16 @@ public class LawsCommonServiceImpl implements ILawsCommonService { // 获取全部字段 List fieldList = lawsCommonMapper.getFieldList(tableName); // 筛选表单显示的字段 - fieldList = fieldList.stream().filter(lawsTag -> YesOrNoEnum.YES.getValue() - .equals(lawsTag.getIsShowForm().toString())).collect(Collectors.toList()); + if (1 == type) { + // 详情显示 + fieldList = fieldList.stream().filter(lawsTag -> YesOrNoEnum.YES.getValue() + .equals(lawsTag.getIsShowForm().toString())).collect(Collectors.toList()); + } else { + // 新增编辑显示 + fieldList = fieldList.stream().filter(lawsTag -> YesOrNoEnum.YES.getValue() + .equals(lawsTag.getIsShowFormCreate().toString())).collect(Collectors.toList()); + } + // 获取区域管理 LawsArea lawsArea = new LawsArea(); lawsArea.setIsModel(module); @@ -613,7 +621,7 @@ public class LawsCommonServiceImpl implements ILawsCommonService { * @Description: 根据id和模块标识获取信息 **/ @Override - public Map getByIdAndModule(String id, String module) { + public Map getByIdAndModule(String id, String module, Integer type) { if (StringUtils.isBlank(id)) { throw new JeroBootException(ResultCommon.EMPTY_COMMON, "id"); } @@ -622,8 +630,15 @@ public class LawsCommonServiceImpl implements ILawsCommonService { // 获取全部字段 List fieldList = lawsCommonMapper.getFieldList(tableName); // 筛选表单显示的字段(传id查表单) - fieldList = fieldList.stream().filter(lawsTag -> YesOrNoEnum.YES.getValue() - .equals(lawsTag.getIsShowForm().toString())).collect(Collectors.toList()); + if (1 == type) { + // 详情显示 + fieldList = fieldList.stream().filter(lawsTag -> YesOrNoEnum.YES.getValue() + .equals(lawsTag.getIsShowForm().toString())).collect(Collectors.toList()); + } else { + // 新增编辑显示 + fieldList = fieldList.stream().filter(lawsTag -> YesOrNoEnum.YES.getValue() + .equals(lawsTag.getIsShowFormCreate().toString())).collect(Collectors.toList()); + } // 封装查询显示的字段 String selectField = getSelectField(fieldList); 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 950528c6..a22207eb 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 @@ -88,15 +88,16 @@ public class LawsDomesticController { @AutoLog(value = "国内法规标准-获取表单模型") @ApiOperation(value="国内法规标准-获取表单模型", notes="国内法规标准-获取表单模型") @GetMapping(value = "getFormModel") - public Result> getFormModel() { - return Result.OK(lawsCommonService.getFormModel(MODULE_VALUE)); + public Result> getFormModel(@RequestParam(name="type") Integer type) { + return Result.OK(lawsCommonService.getFormModel(MODULE_VALUE, type)); } @AutoLog(value = "国内法规标准-根据id和模块标识获取信息") @ApiOperation(value="国内法规标准-根据id和模块标识获取信息", notes="国内法规标准-根据id和模块标识获取信息") @GetMapping(value = "getByIdAndModule") - public Result> getByIdAndModule(@RequestParam(name="id") String id) { - return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE)); + public Result> getByIdAndModule(@RequestParam(name="id") String id, + @RequestParam(name="type") Integer type) { + return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE, type)); } @AutoLog(value = "国内法规标准-根据ids和模块标识删除信息") diff --git a/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsEnterpriseController.java b/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsEnterpriseController.java index c6e4e3bf..6caed6f3 100644 --- a/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsEnterpriseController.java +++ b/laws-modules/src/main/java/com/jero/modules/laws/standard/controller/LawsEnterpriseController.java @@ -98,15 +98,16 @@ public class LawsEnterpriseController { @AutoLog(value = "企业法规标准-获取表单模型") @ApiOperation(value="企业法规标准-获取表单模型", notes="企业法规标准-获取表单模型") @GetMapping(value = "getFormModel") - public Result> getFormModel() { - return Result.OK(lawsCommonService.getFormModel(MODULE_VALUE)); + public Result> getFormModel(@RequestParam(name="type") Integer type) { + return Result.OK(lawsCommonService.getFormModel(MODULE_VALUE, type)); } @AutoLog(value = "企业法规标准-根据id和模块标识获取信息") @ApiOperation(value="企业法规标准-根据id和模块标识获取信息", notes="企业法规标准-根据id和模块标识获取信息") @GetMapping(value = "getByIdAndModule") - public Result> getByIdAndModule(@RequestParam(name="id") String id) { - return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE)); + public Result> getByIdAndModule(@RequestParam(name="id") String id, + @RequestParam(name="type") Integer type) { + return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE, type)); } @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 b03f1bf4..f15cb422 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 @@ -89,15 +89,16 @@ public class LawsOverseasController { @AutoLog(value = "海外法规标准-获取表单模型") @ApiOperation(value="海外法规标准-获取表单模型", notes="海外法规标准-获取表单模型") @GetMapping(value = "getFormModel") - public Result> getFormModel() { - return Result.OK(lawsCommonService.getFormModel(MODULE_VALUE)); + public Result> getFormModel(@RequestParam(name="type") Integer type) { + return Result.OK(lawsCommonService.getFormModel(MODULE_VALUE, type)); } @AutoLog(value = "海外法规标准-根据id和模块标识获取信息") @ApiOperation(value="海外法规标准-根据id和模块标识获取信息", notes="海外法规标准-根据id和模块标识获取信息") @GetMapping(value = "getByIdAndModule") - public Result> getByIdAndModule(@RequestParam(name="id") String id) { - return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE)); + public Result> getByIdAndModule(@RequestParam(name="id") String id, + @RequestParam(name="type") Integer type) { + return Result.OK(lawsCommonService.getByIdAndModule(id, MODULE_VALUE, type)); } @AutoLog(value = "海外法规标准-根据ids和模块标识删除信息")