Commit b369b363b686d1681fd17ecc7de425428aa46800
1 parent
b7a90c2c
动态表单 命名规范
Showing
15 changed files
with
160 additions
and
93 deletions
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/OsFormController.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/WlFormController.java
| 1 | 1 | package cn.iocoder.yudao.adminserver.modules.activiti.controller.form; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.*; |
| 4 | -import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.OsFormConvert; | |
| 5 | -import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; | |
| 6 | -import cn.iocoder.yudao.adminserver.modules.activiti.service.form.OsFormService; | |
| 4 | +import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.WfFormConvert; | |
| 5 | +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm; | |
| 6 | +import cn.iocoder.yudao.adminserver.modules.activiti.service.form.WfFormService; | |
| 7 | 7 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 8 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | 9 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| ... | ... | @@ -28,24 +28,24 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E |
| 28 | 28 | // TODO @风里雾里: Os=》Wf,/os 改成 /wl 开头。目前这个模块,咱先定位成给工作流用的 |
| 29 | 29 | @Api(tags = "动态表单") |
| 30 | 30 | @RestController |
| 31 | -@RequestMapping("/os/form") | |
| 31 | +@RequestMapping("/wl/form") | |
| 32 | 32 | @Validated |
| 33 | -public class OsFormController { | |
| 33 | +public class WlFormController { | |
| 34 | 34 | |
| 35 | 35 | @Resource |
| 36 | - private OsFormService formService; | |
| 36 | + private WfFormService formService; | |
| 37 | 37 | |
| 38 | 38 | @PostMapping("/create") |
| 39 | 39 | @ApiOperation("创建动态表单") |
| 40 | 40 | @PreAuthorize("@ss.hasPermission('os:form:create')") |
| 41 | - public CommonResult<Long> createForm(@Valid @RequestBody OsFormCreateReqVO createReqVO) { | |
| 41 | + public CommonResult<Long> createForm(@Valid @RequestBody WfFormCreateReqVO createReqVO) { | |
| 42 | 42 | return success(formService.createForm(createReqVO)); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | @PutMapping("/update") |
| 46 | 46 | @ApiOperation("更新动态表单") |
| 47 | 47 | @PreAuthorize("@ss.hasPermission('os:form:update')") |
| 48 | - public CommonResult<Boolean> updateForm(@Valid @RequestBody OsFormUpdateReqVO updateReqVO) { | |
| 48 | + public CommonResult<Boolean> updateForm(@Valid @RequestBody WfFormUpdateReqVO updateReqVO) { | |
| 49 | 49 | formService.updateForm(updateReqVO); |
| 50 | 50 | return success(true); |
| 51 | 51 | } |
| ... | ... | @@ -63,38 +63,38 @@ public class OsFormController { |
| 63 | 63 | @ApiOperation("获得动态表单") |
| 64 | 64 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) |
| 65 | 65 | @PreAuthorize("@ss.hasPermission('os:form:query')") |
| 66 | - public CommonResult<OsFormRespVO> getForm(@RequestParam("id") Long id) { | |
| 67 | - OsFormDO form = formService.getForm(id); | |
| 68 | - return success(OsFormConvert.INSTANCE.convert(form)); | |
| 66 | + public CommonResult<WfFormRespVO> getForm(@RequestParam("id") Long id) { | |
| 67 | + WfForm form = formService.getForm(id); | |
| 68 | + return success(WfFormConvert.INSTANCE.convert(form)); | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | @GetMapping("/list") |
| 72 | 72 | @ApiOperation("获得动态表单列表") |
| 73 | 73 | @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) |
| 74 | 74 | @PreAuthorize("@ss.hasPermission('os:form:query')") |
| 75 | - public CommonResult<List<OsFormRespVO>> getFormList(@RequestParam("ids") Collection<Long> ids) { | |
| 76 | - List<OsFormDO> list = formService.getFormList(ids); | |
| 77 | - return success(OsFormConvert.INSTANCE.convertList(list)); | |
| 75 | + public CommonResult<List<WfFormRespVO>> getFormList(@RequestParam("ids") Collection<Long> ids) { | |
| 76 | + List<WfForm> list = formService.getFormList(ids); | |
| 77 | + return success(WfFormConvert.INSTANCE.convertList(list)); | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | @GetMapping("/page") |
| 81 | 81 | @ApiOperation("获得动态表单分页") |
| 82 | 82 | @PreAuthorize("@ss.hasPermission('os:form:query')") |
| 83 | - public CommonResult<PageResult<OsFormRespVO>> getFormPage(@Valid OsFormPageReqVO pageVO) { | |
| 84 | - PageResult<OsFormDO> pageResult = formService.getFormPage(pageVO); | |
| 85 | - return success(OsFormConvert.INSTANCE.convertPage(pageResult)); | |
| 83 | + public CommonResult<PageResult<WfFormRespVO>> getFormPage(@Valid WfFormPageReqVO pageVO) { | |
| 84 | + PageResult<WfForm> pageResult = formService.getFormPage(pageVO); | |
| 85 | + return success(WfFormConvert.INSTANCE.convertPage(pageResult)); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | @GetMapping("/export-excel") |
| 89 | 89 | @ApiOperation("导出动态表单 Excel") |
| 90 | 90 | @PreAuthorize("@ss.hasPermission('os:form:export')") |
| 91 | 91 | @OperateLog(type = EXPORT) |
| 92 | - public void exportFormExcel(@Valid OsFormExportReqVO exportReqVO, | |
| 92 | + public void exportFormExcel(@Valid WfFormExportReqVO exportReqVO, | |
| 93 | 93 | HttpServletResponse response) throws IOException { |
| 94 | - List<OsFormDO> list = formService.getFormList(exportReqVO); | |
| 94 | + List<WfForm> list = formService.getFormList(exportReqVO); | |
| 95 | 95 | // 导出 Excel |
| 96 | - List<OsFormExcelVO> datas = OsFormConvert.INSTANCE.convertList02(list); | |
| 97 | - ExcelUtils.write(response, "动态表单.xls", "数据", OsFormExcelVO.class, datas); | |
| 96 | + List<WfFormExcelVO> datas = WfFormConvert.INSTANCE.convertList02(list); | |
| 97 | + ExcelUtils.write(response, "动态表单.xls", "数据", WfFormExcelVO.class, datas); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | } | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormBaseVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormBaseVO.java
| ... | ... | @@ -9,7 +9,7 @@ import javax.validation.constraints.*; |
| 9 | 9 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 10 | 10 | */ |
| 11 | 11 | @Data |
| 12 | -public class OsFormBaseVO { | |
| 12 | +public class WfFormBaseVO { | |
| 13 | 13 | |
| 14 | 14 | @ApiModelProperty(value = "表单名称", required = true) |
| 15 | 15 | @NotNull(message = "表单名称不能为空") | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormCreateReqVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormCreateReqVO.java
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExcelVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormExcelVO.java
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExportReqVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormExportReqVO.java
| ... | ... | @@ -8,7 +8,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 8 | 8 | |
| 9 | 9 | @ApiModel(value = "动态表单 Excel 导出 Request VO", description = "参数和 OsFormPageReqVO 是一致的") |
| 10 | 10 | @Data |
| 11 | -public class OsFormExportReqVO { | |
| 11 | +public class WfFormExportReqVO { | |
| 12 | 12 | |
| 13 | 13 | @ApiModelProperty(value = "表单名称") |
| 14 | 14 | private String name; | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormPageReqVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormPageReqVO.java
| ... | ... | @@ -11,7 +11,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ |
| 11 | 11 | @Data |
| 12 | 12 | @EqualsAndHashCode(callSuper = true) |
| 13 | 13 | @ToString(callSuper = true) |
| 14 | -public class OsFormPageReqVO extends PageParam { | |
| 14 | +public class WfFormPageReqVO extends PageParam { | |
| 15 | 15 | |
| 16 | 16 | @ApiModelProperty(value = "表单名称") |
| 17 | 17 | private String name; | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormRespVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormRespVO.java
| ... | ... | @@ -8,7 +8,7 @@ import io.swagger.annotations.*; |
| 8 | 8 | @Data |
| 9 | 9 | @EqualsAndHashCode(callSuper = true) |
| 10 | 10 | @ToString(callSuper = true) |
| 11 | -public class OsFormRespVO extends OsFormBaseVO { | |
| 11 | +public class WfFormRespVO extends WfFormBaseVO { | |
| 12 | 12 | |
| 13 | 13 | @ApiModelProperty(value = "表单编号", required = true) |
| 14 | 14 | private Long id; | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormUpdateReqVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormUpdateReqVO.java
| ... | ... | @@ -8,7 +8,7 @@ import javax.validation.constraints.*; |
| 8 | 8 | @Data |
| 9 | 9 | @EqualsAndHashCode(callSuper = true) |
| 10 | 10 | @ToString(callSuper = true) |
| 11 | -public class OsFormUpdateReqVO extends OsFormBaseVO { | |
| 11 | +public class WfFormUpdateReqVO extends WfFormBaseVO { | |
| 12 | 12 | |
| 13 | 13 | @ApiModelProperty(value = "表单编号", required = true) |
| 14 | 14 | @NotNull(message = "表单编号不能为空") | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/OsFormConvert.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/WfFormConvert.java
| 1 | 1 | package cn.iocoder.yudao.adminserver.modules.activiti.convert.form; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormCreateReqVO; | |
| 4 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormExcelVO; | |
| 5 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormRespVO; | |
| 6 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormUpdateReqVO; | |
| 7 | -import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; | |
| 3 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormCreateReqVO; | |
| 4 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExcelVO; | |
| 5 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormRespVO; | |
| 6 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm; | |
| 8 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | 9 | import org.mapstruct.Mapper; |
| 10 | 10 | import org.mapstruct.factory.Mappers; |
| ... | ... | @@ -17,20 +17,20 @@ import java.util.List; |
| 17 | 17 | * @author 芋艿 |
| 18 | 18 | */ |
| 19 | 19 | @Mapper |
| 20 | -public interface OsFormConvert { | |
| 20 | +public interface WfFormConvert { | |
| 21 | 21 | |
| 22 | - OsFormConvert INSTANCE = Mappers.getMapper(OsFormConvert.class); | |
| 22 | + WfFormConvert INSTANCE = Mappers.getMapper(WfFormConvert.class); | |
| 23 | 23 | |
| 24 | - OsFormDO convert(OsFormCreateReqVO bean); | |
| 24 | + WfForm convert(WfFormCreateReqVO bean); | |
| 25 | 25 | |
| 26 | - OsFormDO convert(OsFormUpdateReqVO bean); | |
| 26 | + WfForm convert(WfFormUpdateReqVO bean); | |
| 27 | 27 | |
| 28 | - OsFormRespVO convert(OsFormDO bean); | |
| 28 | + WfFormRespVO convert(WfForm bean); | |
| 29 | 29 | |
| 30 | - List<OsFormRespVO> convertList(List<OsFormDO> list); | |
| 30 | + List<WfFormRespVO> convertList(List<WfForm> list); | |
| 31 | 31 | |
| 32 | - PageResult<OsFormRespVO> convertPage(PageResult<OsFormDO> page); | |
| 32 | + PageResult<WfFormRespVO> convertPage(PageResult<WfForm> page); | |
| 33 | 33 | |
| 34 | - List<OsFormExcelVO> convertList02(List<OsFormDO> list); | |
| 34 | + List<WfFormExcelVO> convertList02(List<WfForm> list); | |
| 35 | 35 | |
| 36 | 36 | } | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/OsFormDO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/WfForm.java
| 1 | 1 | package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; |
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 4 | 5 | import com.baomidou.mybatisplus.annotation.TableId; |
| 5 | 6 | import com.baomidou.mybatisplus.annotation.TableName; |
| 7 | +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; | |
| 6 | 8 | import lombok.*; |
| 7 | 9 | |
| 8 | -// TODO @风里雾里:切到 https://gitee.com/zhijiantianya/ruoyi-vue-pro/blob/feature/activiti/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/workflow/dal/dataobject/form/WfForm.java 。status 添加进去哈。 | |
| 10 | +import java.util.List; | |
| 11 | + | |
| 9 | 12 | /** |
| 10 | - * 动态表单 DO | |
| 13 | + * 工作流的表单定义 | |
| 14 | + * 用于工作流的申请表单,需要动态配置的场景 | |
| 11 | 15 | * |
| 12 | - * @author 芋艿 | |
| 16 | + * @author 芋道源码 | |
| 13 | 17 | */ |
| 14 | -@TableName("os_form") | |
| 18 | +@TableName(value = "wf_form", autoResultMap = true) | |
| 15 | 19 | @Data |
| 16 | 20 | @EqualsAndHashCode(callSuper = true) |
| 17 | 21 | @ToString(callSuper = true) |
| 18 | 22 | @Builder |
| 19 | 23 | @NoArgsConstructor |
| 20 | 24 | @AllArgsConstructor |
| 21 | -public class OsFormDO extends BaseDO { | |
| 25 | +public class WfForm extends BaseDO { | |
| 22 | 26 | |
| 23 | 27 | /** |
| 24 | - * 表单编号 | |
| 28 | + * 编号 | |
| 25 | 29 | */ |
| 26 | 30 | @TableId |
| 27 | 31 | private Long id; |
| 28 | 32 | /** |
| 29 | - * 表单名称 | |
| 33 | + * 表单名 | |
| 30 | 34 | */ |
| 31 | 35 | private String name; |
| 32 | 36 | /** |
| 33 | - * 商户状态 | |
| 37 | + * 状态 | |
| 34 | 38 | */ |
| 35 | 39 | private Integer status; |
| 36 | 40 | /** |
| ... | ... | @@ -38,8 +42,16 @@ public class OsFormDO extends BaseDO { |
| 38 | 42 | */ |
| 39 | 43 | private String formJson; |
| 40 | 44 | /** |
| 45 | + * 表单配置 | |
| 46 | + * | |
| 47 | + * 目前直接将 https://github.com/JakHuang/form-generator 生成的 JSON 串,直接保存 | |
| 48 | + * 定义:https://github.com/JakHuang/form-generator/issues/46 | |
| 49 | + */ | |
| 50 | + @TableField(typeHandler = JacksonTypeHandler.class) | |
| 51 | + private List<String> fields; | |
| 52 | + /** | |
| 41 | 53 | * 备注 |
| 42 | 54 | */ |
| 43 | 55 | private String remark; |
| 44 | 56 | |
| 45 | 57 | -} |
| 58 | +} | |
| 46 | 59 | \ No newline at end of file | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/WfFormData.java
0 → 100644
| 1 | +package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form; | |
| 2 | + | |
| 3 | +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; | |
| 4 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 6 | +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; | |
| 7 | +import lombok.*; | |
| 8 | + | |
| 9 | +import java.util.List; | |
| 10 | +import java.util.Map; | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 工作流的表单结果 | |
| 14 | + * 用户每次填写工作流的申请表单时,会保存一条记录到该表】 | |
| 15 | + * | |
| 16 | + * @author 芋道源码 | |
| 17 | + */ | |
| 18 | +@TableName(value = "wf_form", autoResultMap = true) | |
| 19 | +@Data | |
| 20 | +@EqualsAndHashCode(callSuper = true) | |
| 21 | +@ToString(callSuper = true) | |
| 22 | +@Builder | |
| 23 | +@NoArgsConstructor | |
| 24 | +@AllArgsConstructor | |
| 25 | +public class WfFormData extends BaseDO { | |
| 26 | + | |
| 27 | + /** | |
| 28 | + * 编号 | |
| 29 | + */ | |
| 30 | + private Long id; | |
| 31 | + /** | |
| 32 | + * 表单编号 | |
| 33 | + * | |
| 34 | + * 关联 {@link WfForm#getId()} | |
| 35 | + */ | |
| 36 | + private Long formId; | |
| 37 | + /** | |
| 38 | + * 状态 | |
| 39 | + */ | |
| 40 | + private Integer status; | |
| 41 | + /** | |
| 42 | + * 表单配置 | |
| 43 | + * | |
| 44 | + * 冗余 {@link WfForm#getFields()} | |
| 45 | + * 主要考虑,表单是可以修改的 | |
| 46 | + */ | |
| 47 | + @TableField(typeHandler = JacksonTypeHandler.class) | |
| 48 | + private List<String> fields; | |
| 49 | + /** | |
| 50 | + * 表单值 | |
| 51 | + */ | |
| 52 | + @TableField(typeHandler = JacksonTypeHandler.class) | |
| 53 | + private Map<String, Object> values; | |
| 54 | + | |
| 55 | +} | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/mysql/form/OsFormMapper.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/mysql/form/WfFormMapper.java
| ... | ... | @@ -2,9 +2,9 @@ package cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.form; |
| 2 | 2 | |
| 3 | 3 | |
| 4 | 4 | |
| 5 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormExportReqVO; | |
| 6 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormPageReqVO; | |
| 7 | -import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; | |
| 5 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExportReqVO; | |
| 6 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormPageReqVO; | |
| 7 | +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm; | |
| 8 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | 9 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 10 | 10 | import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; |
| ... | ... | @@ -15,13 +15,13 @@ import java.util.List; |
| 15 | 15 | /** |
| 16 | 16 | * 动态表单 Mapper |
| 17 | 17 | * |
| 18 | - * @author 芋艿 | |
| 18 | + * @author 风里雾里 | |
| 19 | 19 | */ |
| 20 | 20 | @Mapper |
| 21 | -public interface OsFormMapper extends BaseMapperX<OsFormDO> { | |
| 21 | +public interface WfFormMapper extends BaseMapperX<WfForm> { | |
| 22 | 22 | |
| 23 | - default PageResult<OsFormDO> selectPage(OsFormPageReqVO reqVO) { | |
| 24 | - return selectPage(reqVO, new QueryWrapperX<OsFormDO>() | |
| 23 | + default PageResult<WfForm> selectPage(WfFormPageReqVO reqVO) { | |
| 24 | + return selectPage(reqVO, new QueryWrapperX<WfForm>() | |
| 25 | 25 | .likeIfPresent("name", reqVO.getName()) |
| 26 | 26 | .eqIfPresent("status", reqVO.getStatus()) |
| 27 | 27 | .eqIfPresent("form_json", reqVO.getFormJson()) |
| ... | ... | @@ -30,8 +30,8 @@ public interface OsFormMapper extends BaseMapperX<OsFormDO> { |
| 30 | 30 | .orderByDesc("id") ); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - default List<OsFormDO> selectList(OsFormExportReqVO reqVO) { | |
| 34 | - return selectList(new QueryWrapperX<OsFormDO>() | |
| 33 | + default List<WfForm> selectList(WfFormExportReqVO reqVO) { | |
| 34 | + return selectList(new QueryWrapperX<WfForm>() | |
| 35 | 35 | .likeIfPresent("name", reqVO.getName()) |
| 36 | 36 | .eqIfPresent("status", reqVO.getStatus()) |
| 37 | 37 | .eqIfPresent("form_json", reqVO.getFormJson()) | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/enums/form/FormErrorCodeConstants.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/enums/form/WfFormErrorCodeConstants.java
| ... | ... | @@ -9,6 +9,6 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode; |
| 9 | 9 | * 001 oa |
| 10 | 10 | * activiti 系统,使用 1-003-000-000 段 |
| 11 | 11 | */ |
| 12 | -public interface FormErrorCodeConstants { | |
| 12 | +public interface WfFormErrorCodeConstants { | |
| 13 | 13 | ErrorCode FORM_NOT_EXISTS = new ErrorCode(1003001002, "动态表单不存在"); |
| 14 | 14 | } | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/OsFormService.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/WfFormService.java
| 1 | 1 | package cn.iocoder.yudao.adminserver.modules.activiti.service.form; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormCreateReqVO; | |
| 4 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormExportReqVO; | |
| 5 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormPageReqVO; | |
| 6 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormUpdateReqVO; | |
| 7 | -import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; | |
| 3 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormCreateReqVO; | |
| 4 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExportReqVO; | |
| 5 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormPageReqVO; | |
| 6 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm; | |
| 8 | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | 9 | |
| 10 | 10 | import java.util.*; |
| ... | ... | @@ -14,9 +14,9 @@ import javax.validation.*; |
| 14 | 14 | /** |
| 15 | 15 | * 动态表单 Service 接口 |
| 16 | 16 | * |
| 17 | - * @author 芋艿 | |
| 17 | + * TODO @风里雾里 | |
| 18 | 18 | */ |
| 19 | -public interface OsFormService { | |
| 19 | +public interface WfFormService { | |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * 创建动态表单 |
| ... | ... | @@ -24,14 +24,14 @@ public interface OsFormService { |
| 24 | 24 | * @param createReqVO 创建信息 |
| 25 | 25 | * @return 编号 |
| 26 | 26 | */ |
| 27 | - Long createForm(@Valid OsFormCreateReqVO createReqVO); | |
| 27 | + Long createForm(@Valid WfFormCreateReqVO createReqVO); | |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | 30 | * 更新动态表单 |
| 31 | 31 | * |
| 32 | 32 | * @param updateReqVO 更新信息 |
| 33 | 33 | */ |
| 34 | - void updateForm(@Valid OsFormUpdateReqVO updateReqVO); | |
| 34 | + void updateForm(@Valid WfFormUpdateReqVO updateReqVO); | |
| 35 | 35 | |
| 36 | 36 | /** |
| 37 | 37 | * 删除动态表单 |
| ... | ... | @@ -46,7 +46,7 @@ public interface OsFormService { |
| 46 | 46 | * @param id 编号 |
| 47 | 47 | * @return 动态表单 |
| 48 | 48 | */ |
| 49 | - OsFormDO getForm(Long id); | |
| 49 | + WfForm getForm(Long id); | |
| 50 | 50 | |
| 51 | 51 | /** |
| 52 | 52 | * 获得动态表单列表 |
| ... | ... | @@ -54,7 +54,7 @@ public interface OsFormService { |
| 54 | 54 | * @param ids 编号 |
| 55 | 55 | * @return 动态表单列表 |
| 56 | 56 | */ |
| 57 | - List<OsFormDO> getFormList(Collection<Long> ids); | |
| 57 | + List<WfForm> getFormList(Collection<Long> ids); | |
| 58 | 58 | |
| 59 | 59 | /** |
| 60 | 60 | * 获得动态表单分页 |
| ... | ... | @@ -62,7 +62,7 @@ public interface OsFormService { |
| 62 | 62 | * @param pageReqVO 分页查询 |
| 63 | 63 | * @return 动态表单分页 |
| 64 | 64 | */ |
| 65 | - PageResult<OsFormDO> getFormPage(OsFormPageReqVO pageReqVO); | |
| 65 | + PageResult<WfForm> getFormPage(WfFormPageReqVO pageReqVO); | |
| 66 | 66 | |
| 67 | 67 | /** |
| 68 | 68 | * 获得动态表单列表, 用于 Excel 导出 |
| ... | ... | @@ -70,6 +70,6 @@ public interface OsFormService { |
| 70 | 70 | * @param exportReqVO 查询条件 |
| 71 | 71 | * @return 动态表单列表 |
| 72 | 72 | */ |
| 73 | - List<OsFormDO> getFormList(OsFormExportReqVO exportReqVO); | |
| 73 | + List<WfForm> getFormList(WfFormExportReqVO exportReqVO); | |
| 74 | 74 | |
| 75 | 75 | } | ... | ... |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/OsFormServiceImpl.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/WfFormServiceImpl.java
| 1 | 1 | package cn.iocoder.yudao.adminserver.modules.activiti.service.form.impl; |
| 2 | 2 | |
| 3 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormCreateReqVO; | |
| 4 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormExportReqVO; | |
| 5 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormPageReqVO; | |
| 6 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormUpdateReqVO; | |
| 7 | -import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.OsFormConvert; | |
| 8 | -import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; | |
| 9 | -import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.form.OsFormMapper; | |
| 10 | -import cn.iocoder.yudao.adminserver.modules.activiti.service.form.OsFormService; | |
| 3 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormCreateReqVO; | |
| 4 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExportReqVO; | |
| 5 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormPageReqVO; | |
| 6 | +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormUpdateReqVO; | |
| 7 | +import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.WfFormConvert; | |
| 8 | +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm; | |
| 9 | +import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.form.WfFormMapper; | |
| 10 | +import cn.iocoder.yudao.adminserver.modules.activiti.service.form.WfFormService; | |
| 11 | 11 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 12 | 12 | import org.springframework.stereotype.Service; |
| 13 | 13 | import org.springframework.validation.annotation.Validated; |
| ... | ... | @@ -16,36 +16,36 @@ import javax.annotation.Resource; |
| 16 | 16 | import java.util.Collection; |
| 17 | 17 | import java.util.List; |
| 18 | 18 | |
| 19 | -import static cn.iocoder.yudao.adminserver.modules.activiti.enums.form.FormErrorCodeConstants.FORM_NOT_EXISTS; | |
| 19 | +import static cn.iocoder.yudao.adminserver.modules.activiti.enums.form.WfFormErrorCodeConstants.FORM_NOT_EXISTS; | |
| 20 | 20 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * 动态表单 Service 实现类 |
| 24 | 24 | * |
| 25 | - * @author 芋艿 // TODO @风里雾里:作者改成你自己哈 | |
| 25 | + * TODO @风里雾里 | |
| 26 | 26 | */ |
| 27 | 27 | @Service |
| 28 | 28 | @Validated |
| 29 | -public class OsFormServiceImpl implements OsFormService { | |
| 29 | +public class WfFormServiceImpl implements WfFormService { | |
| 30 | 30 | |
| 31 | 31 | @Resource |
| 32 | - private OsFormMapper formMapper; | |
| 32 | + private WfFormMapper formMapper; | |
| 33 | 33 | |
| 34 | 34 | @Override |
| 35 | - public Long createForm(OsFormCreateReqVO createReqVO) { | |
| 35 | + public Long createForm(WfFormCreateReqVO createReqVO) { | |
| 36 | 36 | // 插入 |
| 37 | - OsFormDO form = OsFormConvert.INSTANCE.convert(createReqVO); | |
| 37 | + WfForm form = WfFormConvert.INSTANCE.convert(createReqVO); | |
| 38 | 38 | formMapper.insert(form); |
| 39 | 39 | // 返回 |
| 40 | 40 | return form.getId(); |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | @Override |
| 44 | - public void updateForm(OsFormUpdateReqVO updateReqVO) { | |
| 44 | + public void updateForm(WfFormUpdateReqVO updateReqVO) { | |
| 45 | 45 | // 校验存在 |
| 46 | 46 | this.validateFormExists(updateReqVO.getId()); |
| 47 | 47 | // 更新 |
| 48 | - OsFormDO updateObj = OsFormConvert.INSTANCE.convert(updateReqVO); | |
| 48 | + WfForm updateObj = WfFormConvert.INSTANCE.convert(updateReqVO); | |
| 49 | 49 | formMapper.updateById(updateObj); |
| 50 | 50 | } |
| 51 | 51 | |
| ... | ... | @@ -64,22 +64,22 @@ public class OsFormServiceImpl implements OsFormService { |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | @Override |
| 67 | - public OsFormDO getForm(Long id) { | |
| 67 | + public WfForm getForm(Long id) { | |
| 68 | 68 | return formMapper.selectById(id); |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | @Override |
| 72 | - public List<OsFormDO> getFormList(Collection<Long> ids) { | |
| 72 | + public List<WfForm> getFormList(Collection<Long> ids) { | |
| 73 | 73 | return formMapper.selectBatchIds(ids); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | @Override |
| 77 | - public PageResult<OsFormDO> getFormPage(OsFormPageReqVO pageReqVO) { | |
| 77 | + public PageResult<WfForm> getFormPage(WfFormPageReqVO pageReqVO) { | |
| 78 | 78 | return formMapper.selectPage(pageReqVO); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | @Override |
| 82 | - public List<OsFormDO> getFormList(OsFormExportReqVO exportReqVO) { | |
| 82 | + public List<WfForm> getFormList(WfFormExportReqVO exportReqVO) { | |
| 83 | 83 | return formMapper.selectList(exportReqVO); |
| 84 | 84 | } |
| 85 | 85 | ... | ... |