Commit 7ef86c14c09ca66ebdb2f24ea0980c04666dfb8c
1 parent
4b2af44e
WfForm =》BpmForm
Showing
21 changed files
with
152 additions
and
281 deletions
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/WfFormConvert.java deleted
| 1 | -package cn.iocoder.yudao.adminserver.modules.activiti.convert.form; | ||
| 2 | - | ||
| 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 | -import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 9 | -import org.mapstruct.Mapper; | ||
| 10 | -import org.mapstruct.factory.Mappers; | ||
| 11 | - | ||
| 12 | -import java.util.List; | ||
| 13 | - | ||
| 14 | -/** | ||
| 15 | - * 动态表单 Convert | ||
| 16 | - * | ||
| 17 | - * @author 芋艿 | ||
| 18 | - */ | ||
| 19 | -@Mapper | ||
| 20 | -public interface WfFormConvert { | ||
| 21 | - | ||
| 22 | - WfFormConvert INSTANCE = Mappers.getMapper(WfFormConvert.class); | ||
| 23 | - | ||
| 24 | - WfForm convert(WfFormCreateReqVO bean); | ||
| 25 | - | ||
| 26 | - WfForm convert(WfFormUpdateReqVO bean); | ||
| 27 | - | ||
| 28 | - WfFormRespVO convert(WfForm bean); | ||
| 29 | - | ||
| 30 | - List<WfFormRespVO> convertList(List<WfForm> list); | ||
| 31 | - | ||
| 32 | - PageResult<WfFormRespVO> convertPage(PageResult<WfForm> page); | ||
| 33 | - | ||
| 34 | - List<WfFormExcelVO> convertList02(List<WfForm> list); | ||
| 35 | - | ||
| 36 | -} |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/WfForm.java deleted
| 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.TableId; | ||
| 6 | -import com.baomidou.mybatisplus.annotation.TableName; | ||
| 7 | -import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; | ||
| 8 | -import lombok.*; | ||
| 9 | - | ||
| 10 | -import java.util.List; | ||
| 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 WfForm extends BaseDO { | ||
| 26 | - | ||
| 27 | - /** | ||
| 28 | - * 编号 | ||
| 29 | - */ | ||
| 30 | - @TableId | ||
| 31 | - private Long id; | ||
| 32 | - /** | ||
| 33 | - * 表单名 | ||
| 34 | - */ | ||
| 35 | - private String name; | ||
| 36 | - /** | ||
| 37 | - * 状态 | ||
| 38 | - */ | ||
| 39 | - private Integer status; | ||
| 40 | - /** | ||
| 41 | - * 表单JSON | ||
| 42 | - */ | ||
| 43 | - private String formJson; | ||
| 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 | - /** | ||
| 53 | - * 备注 | ||
| 54 | - */ | ||
| 55 | - private String remark; | ||
| 56 | - | ||
| 57 | -} | ||
| 58 | \ No newline at end of file | 0 | \ No newline at end of file |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/WfFormData.java deleted
| 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/enums/form/WfFormErrorCodeConstants.java deleted
| 1 | -package cn.iocoder.yudao.adminserver.modules.activiti.enums.form; | ||
| 2 | - | ||
| 3 | -import cn.iocoder.yudao.framework.common.exception.ErrorCode; | ||
| 4 | - | ||
| 5 | -/** | ||
| 6 | - * activiti 系统 错误码枚举类 | ||
| 7 | - * | ||
| 8 | - * 003 activiti | ||
| 9 | - * 001 oa | ||
| 10 | - * activiti 系统,使用 1-003-000-000 段 | ||
| 11 | - */ | ||
| 12 | -public interface WfFormErrorCodeConstants { | ||
| 13 | - ErrorCode FORM_NOT_EXISTS = new ErrorCode(1003001002, "动态表单不存在"); | ||
| 14 | -} |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/package-info.java deleted
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/WlFormController.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/form/BpmFormController.java
| 1 | -package cn.iocoder.yudao.adminserver.modules.activiti.controller.form; | 1 | +package cn.iocoder.yudao.adminserver.modules.bpm.controller.form; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.*; | ||
| 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; | 3 | +import cn.iocoder.yudao.adminserver.modules.bpm.convert.form.BpmFormConvert; |
| 4 | +import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmForm; | ||
| 5 | +import cn.iocoder.yudao.adminserver.modules.bpm.service.form.BpmFormService; | ||
| 6 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.*; | ||
| 7 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 7 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; | 9 | import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; |
| @@ -25,27 +25,26 @@ import java.util.List; | @@ -25,27 +25,26 @@ import java.util.List; | ||
| 25 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 25 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 26 | import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; | 26 | import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; |
| 27 | 27 | ||
| 28 | -// TODO @风里雾里: Os=》Wf,/os 改成 /wl 开头。目前这个模块,咱先定位成给工作流用的 | ||
| 29 | @Api(tags = "动态表单") | 28 | @Api(tags = "动态表单") |
| 30 | @RestController | 29 | @RestController |
| 31 | -@RequestMapping("/wl/form") | 30 | +@RequestMapping("/bpm/form") |
| 32 | @Validated | 31 | @Validated |
| 33 | -public class WlFormController { | 32 | +public class BpmFormController { |
| 34 | 33 | ||
| 35 | @Resource | 34 | @Resource |
| 36 | - private WfFormService formService; | 35 | + private BpmFormService formService; |
| 37 | 36 | ||
| 38 | @PostMapping("/create") | 37 | @PostMapping("/create") |
| 39 | @ApiOperation("创建动态表单") | 38 | @ApiOperation("创建动态表单") |
| 40 | - @PreAuthorize("@ss.hasPermission('os:form:create')") | ||
| 41 | - public CommonResult<Long> createForm(@Valid @RequestBody WfFormCreateReqVO createReqVO) { | 39 | + @PreAuthorize("@ss.hasPermission('bpm:form:create')") |
| 40 | + public CommonResult<Long> createForm(@Valid @RequestBody BpmFormCreateReqVO createReqVO) { | ||
| 42 | return success(formService.createForm(createReqVO)); | 41 | return success(formService.createForm(createReqVO)); |
| 43 | } | 42 | } |
| 44 | 43 | ||
| 45 | @PutMapping("/update") | 44 | @PutMapping("/update") |
| 46 | @ApiOperation("更新动态表单") | 45 | @ApiOperation("更新动态表单") |
| 47 | - @PreAuthorize("@ss.hasPermission('os:form:update')") | ||
| 48 | - public CommonResult<Boolean> updateForm(@Valid @RequestBody WfFormUpdateReqVO updateReqVO) { | 46 | + @PreAuthorize("@ss.hasPermission('bpm:form:update')") |
| 47 | + public CommonResult<Boolean> updateForm(@Valid @RequestBody BpmFormUpdateReqVO updateReqVO) { | ||
| 49 | formService.updateForm(updateReqVO); | 48 | formService.updateForm(updateReqVO); |
| 50 | return success(true); | 49 | return success(true); |
| 51 | } | 50 | } |
| @@ -53,7 +52,7 @@ public class WlFormController { | @@ -53,7 +52,7 @@ public class WlFormController { | ||
| 53 | @DeleteMapping("/delete") | 52 | @DeleteMapping("/delete") |
| 54 | @ApiOperation("删除动态表单") | 53 | @ApiOperation("删除动态表单") |
| 55 | @ApiImplicitParam(name = "id", value = "编号", required = true) | 54 | @ApiImplicitParam(name = "id", value = "编号", required = true) |
| 56 | - @PreAuthorize("@ss.hasPermission('os:form:delete')") | 55 | + @PreAuthorize("@ss.hasPermission('bpm:form:delete')") |
| 57 | public CommonResult<Boolean> deleteForm(@RequestParam("id") Long id) { | 56 | public CommonResult<Boolean> deleteForm(@RequestParam("id") Long id) { |
| 58 | formService.deleteForm(id); | 57 | formService.deleteForm(id); |
| 59 | return success(true); | 58 | return success(true); |
| @@ -62,39 +61,39 @@ public class WlFormController { | @@ -62,39 +61,39 @@ public class WlFormController { | ||
| 62 | @GetMapping("/get") | 61 | @GetMapping("/get") |
| 63 | @ApiOperation("获得动态表单") | 62 | @ApiOperation("获得动态表单") |
| 64 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) | 63 | @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) |
| 65 | - @PreAuthorize("@ss.hasPermission('os:form:query')") | ||
| 66 | - public CommonResult<WfFormRespVO> getForm(@RequestParam("id") Long id) { | ||
| 67 | - WfForm form = formService.getForm(id); | ||
| 68 | - return success(WfFormConvert.INSTANCE.convert(form)); | 64 | + @PreAuthorize("@ss.hasPermission('bpm:form:query')") |
| 65 | + public CommonResult<BpmFormRespVO> getForm(@RequestParam("id") Long id) { | ||
| 66 | + BpmForm form = formService.getForm(id); | ||
| 67 | + return success(BpmFormConvert.INSTANCE.convert(form)); | ||
| 69 | } | 68 | } |
| 70 | 69 | ||
| 71 | @GetMapping("/list") | 70 | @GetMapping("/list") |
| 72 | @ApiOperation("获得动态表单列表") | 71 | @ApiOperation("获得动态表单列表") |
| 73 | @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) | 72 | @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) |
| 74 | - @PreAuthorize("@ss.hasPermission('os:form:query')") | ||
| 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)); | 73 | + @PreAuthorize("@ss.hasPermission('bpm:form:query')") |
| 74 | + public CommonResult<List<BpmFormRespVO>> getFormList(@RequestParam("ids") Collection<Long> ids) { | ||
| 75 | + List<BpmForm> list = formService.getFormList(ids); | ||
| 76 | + return success(BpmFormConvert.INSTANCE.convertList(list)); | ||
| 78 | } | 77 | } |
| 79 | 78 | ||
| 80 | @GetMapping("/page") | 79 | @GetMapping("/page") |
| 81 | @ApiOperation("获得动态表单分页") | 80 | @ApiOperation("获得动态表单分页") |
| 82 | - @PreAuthorize("@ss.hasPermission('os:form:query')") | ||
| 83 | - public CommonResult<PageResult<WfFormRespVO>> getFormPage(@Valid WfFormPageReqVO pageVO) { | ||
| 84 | - PageResult<WfForm> pageResult = formService.getFormPage(pageVO); | ||
| 85 | - return success(WfFormConvert.INSTANCE.convertPage(pageResult)); | 81 | + @PreAuthorize("@ss.hasPermission('bpm:form:query')") |
| 82 | + public CommonResult<PageResult<BpmFormRespVO>> getFormPage(@Valid BpmFormPageReqVO pageVO) { | ||
| 83 | + PageResult<BpmForm> pageResult = formService.getFormPage(pageVO); | ||
| 84 | + return success(BpmFormConvert.INSTANCE.convertPage(pageResult)); | ||
| 86 | } | 85 | } |
| 87 | 86 | ||
| 88 | @GetMapping("/export-excel") | 87 | @GetMapping("/export-excel") |
| 89 | @ApiOperation("导出动态表单 Excel") | 88 | @ApiOperation("导出动态表单 Excel") |
| 90 | - @PreAuthorize("@ss.hasPermission('os:form:export')") | 89 | + @PreAuthorize("@ss.hasPermission('bpm:form:export')") |
| 91 | @OperateLog(type = EXPORT) | 90 | @OperateLog(type = EXPORT) |
| 92 | - public void exportFormExcel(@Valid WfFormExportReqVO exportReqVO, | 91 | + public void exportFormExcel(@Valid BpmFormExportReqVO exportReqVO, |
| 93 | HttpServletResponse response) throws IOException { | 92 | HttpServletResponse response) throws IOException { |
| 94 | - List<WfForm> list = formService.getFormList(exportReqVO); | 93 | + List<BpmForm> list = formService.getFormList(exportReqVO); |
| 95 | // 导出 Excel | 94 | // 导出 Excel |
| 96 | - List<WfFormExcelVO> datas = WfFormConvert.INSTANCE.convertList02(list); | ||
| 97 | - ExcelUtils.write(response, "动态表单.xls", "数据", WfFormExcelVO.class, datas); | 95 | + List<BpmFormExcelVO> datas = BpmFormConvert.INSTANCE.convertList02(list); |
| 96 | + ExcelUtils.write(response, "动态表单.xls", "数据", BpmFormExcelVO.class, datas); | ||
| 98 | } | 97 | } |
| 99 | 98 | ||
| 100 | } | 99 | } |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormBaseVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/form/vo/BpmFormBaseVO.java
| 1 | -package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; | 1 | +package cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | import io.swagger.annotations.*; | 4 | import io.swagger.annotations.*; |
| @@ -9,7 +9,7 @@ import javax.validation.constraints.*; | @@ -9,7 +9,7 @@ import javax.validation.constraints.*; | ||
| 9 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 | 9 | * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 |
| 10 | */ | 10 | */ |
| 11 | @Data | 11 | @Data |
| 12 | -public class WfFormBaseVO { | 12 | +public class BpmFormBaseVO { |
| 13 | 13 | ||
| 14 | @ApiModelProperty(value = "表单名称", required = true) | 14 | @ApiModelProperty(value = "表单名称", required = true) |
| 15 | @NotNull(message = "表单名称不能为空") | 15 | @NotNull(message = "表单名称不能为空") |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormCreateReqVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/form/vo/BpmFormCreateReqVO.java
| 1 | -package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; | 1 | +package cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | import io.swagger.annotations.*; | 4 | import io.swagger.annotations.*; |
| @@ -7,6 +7,6 @@ import io.swagger.annotations.*; | @@ -7,6 +7,6 @@ import io.swagger.annotations.*; | ||
| 7 | @Data | 7 | @Data |
| 8 | @EqualsAndHashCode(callSuper = true) | 8 | @EqualsAndHashCode(callSuper = true) |
| 9 | @ToString(callSuper = true) | 9 | @ToString(callSuper = true) |
| 10 | -public class WfFormCreateReqVO extends WfFormBaseVO { | 10 | +public class BpmFormCreateReqVO extends BpmFormBaseVO { |
| 11 | 11 | ||
| 12 | } | 12 | } |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormExcelVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/form/vo/BpmFormExcelVO.java
| 1 | -package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; | ||
| 2 | - | ||
| 3 | -import lombok.*; | ||
| 4 | -import java.util.*; | 1 | +package cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo; |
| 5 | 2 | ||
| 6 | import com.alibaba.excel.annotation.ExcelProperty; | 3 | import com.alibaba.excel.annotation.ExcelProperty; |
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import java.util.Date; | ||
| 7 | 7 | ||
| 8 | /** | 8 | /** |
| 9 | * 动态表单 Excel VO | 9 | * 动态表单 Excel VO |
| @@ -11,7 +11,7 @@ import com.alibaba.excel.annotation.ExcelProperty; | @@ -11,7 +11,7 @@ import com.alibaba.excel.annotation.ExcelProperty; | ||
| 11 | * @author 芋艿 | 11 | * @author 芋艿 |
| 12 | */ | 12 | */ |
| 13 | @Data | 13 | @Data |
| 14 | -public class WfFormExcelVO { | 14 | +public class BpmFormExcelVO { |
| 15 | 15 | ||
| 16 | @ExcelProperty("表单编号") | 16 | @ExcelProperty("表单编号") |
| 17 | private Long id; | 17 | private Long id; |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormExportReqVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/form/vo/BpmFormExportReqVO.java
| 1 | -package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; | 1 | +package cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | import java.util.*; | 4 | import java.util.*; |
| @@ -8,7 +8,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | @@ -8,7 +8,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | ||
| 8 | 8 | ||
| 9 | @ApiModel(value = "动态表单 Excel 导出 Request VO", description = "参数和 OsFormPageReqVO 是一致的") | 9 | @ApiModel(value = "动态表单 Excel 导出 Request VO", description = "参数和 OsFormPageReqVO 是一致的") |
| 10 | @Data | 10 | @Data |
| 11 | -public class WfFormExportReqVO { | 11 | +public class BpmFormExportReqVO { |
| 12 | 12 | ||
| 13 | @ApiModelProperty(value = "表单名称") | 13 | @ApiModelProperty(value = "表单名称") |
| 14 | private String name; | 14 | private String name; |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormPageReqVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/form/vo/BpmFormPageReqVO.java
| 1 | -package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; | 1 | +package cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | import java.util.*; | 4 | import java.util.*; |
| @@ -11,7 +11,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | @@ -11,7 +11,7 @@ import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_ | ||
| 11 | @Data | 11 | @Data |
| 12 | @EqualsAndHashCode(callSuper = true) | 12 | @EqualsAndHashCode(callSuper = true) |
| 13 | @ToString(callSuper = true) | 13 | @ToString(callSuper = true) |
| 14 | -public class WfFormPageReqVO extends PageParam { | 14 | +public class BpmFormPageReqVO extends PageParam { |
| 15 | 15 | ||
| 16 | @ApiModelProperty(value = "表单名称") | 16 | @ApiModelProperty(value = "表单名称") |
| 17 | private String name; | 17 | private String name; |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormRespVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/form/vo/BpmFormRespVO.java
| 1 | -package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; | 1 | +package cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | import java.util.*; | 4 | import java.util.*; |
| @@ -8,7 +8,7 @@ import io.swagger.annotations.*; | @@ -8,7 +8,7 @@ import io.swagger.annotations.*; | ||
| 8 | @Data | 8 | @Data |
| 9 | @EqualsAndHashCode(callSuper = true) | 9 | @EqualsAndHashCode(callSuper = true) |
| 10 | @ToString(callSuper = true) | 10 | @ToString(callSuper = true) |
| 11 | -public class WfFormRespVO extends WfFormBaseVO { | 11 | +public class BpmFormRespVO extends BpmFormBaseVO { |
| 12 | 12 | ||
| 13 | @ApiModelProperty(value = "表单编号", required = true) | 13 | @ApiModelProperty(value = "表单编号", required = true) |
| 14 | private Long id; | 14 | private Long id; |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormUpdateReqVO.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/controller/form/vo/BpmFormUpdateReqVO.java
| 1 | -package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; | 1 | +package cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo; |
| 2 | 2 | ||
| 3 | import lombok.*; | 3 | import lombok.*; |
| 4 | import io.swagger.annotations.*; | 4 | import io.swagger.annotations.*; |
| @@ -8,7 +8,7 @@ import javax.validation.constraints.*; | @@ -8,7 +8,7 @@ import javax.validation.constraints.*; | ||
| 8 | @Data | 8 | @Data |
| 9 | @EqualsAndHashCode(callSuper = true) | 9 | @EqualsAndHashCode(callSuper = true) |
| 10 | @ToString(callSuper = true) | 10 | @ToString(callSuper = true) |
| 11 | -public class WfFormUpdateReqVO extends WfFormBaseVO { | 11 | +public class BpmFormUpdateReqVO extends BpmFormBaseVO { |
| 12 | 12 | ||
| 13 | @ApiModelProperty(value = "表单编号", required = true) | 13 | @ApiModelProperty(value = "表单编号", required = true) |
| 14 | @NotNull(message = "表单编号不能为空") | 14 | @NotNull(message = "表单编号不能为空") |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/convert/form/BpmFormConvert.java
0 → 100644
| 1 | +package cn.iocoder.yudao.adminserver.modules.bpm.convert.form; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormCreateReqVO; | ||
| 4 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormExcelVO; | ||
| 5 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormRespVO; | ||
| 6 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormUpdateReqVO; | ||
| 7 | +import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmForm; | ||
| 8 | +import cn.iocoder.yudao.framework.common.pojo.PageResult; | ||
| 9 | +import org.mapstruct.Mapper; | ||
| 10 | +import org.mapstruct.factory.Mappers; | ||
| 11 | + | ||
| 12 | +import java.util.List; | ||
| 13 | + | ||
| 14 | +/** | ||
| 15 | + * 动态表单 Convert | ||
| 16 | + * | ||
| 17 | + * @author 芋艿 | ||
| 18 | + */ | ||
| 19 | +@Mapper | ||
| 20 | +public interface BpmFormConvert { | ||
| 21 | + | ||
| 22 | + BpmFormConvert INSTANCE = Mappers.getMapper(BpmFormConvert.class); | ||
| 23 | + | ||
| 24 | + BpmForm convert(BpmFormCreateReqVO bean); | ||
| 25 | + | ||
| 26 | + BpmForm convert(BpmFormUpdateReqVO bean); | ||
| 27 | + | ||
| 28 | + BpmFormRespVO convert(BpmForm bean); | ||
| 29 | + | ||
| 30 | + List<BpmFormRespVO> convertList(List<BpmForm> list); | ||
| 31 | + | ||
| 32 | + PageResult<BpmFormRespVO> convertPage(PageResult<BpmForm> page); | ||
| 33 | + | ||
| 34 | + List<BpmFormExcelVO> convertList02(List<BpmForm> list); | ||
| 35 | + | ||
| 36 | +} |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/dataobject/form/BpmForm.java
| @@ -34,6 +34,14 @@ public class BpmForm extends BaseDO { | @@ -34,6 +34,14 @@ public class BpmForm extends BaseDO { | ||
| 34 | */ | 34 | */ |
| 35 | private String name; | 35 | private String name; |
| 36 | /** | 36 | /** |
| 37 | + * 状态 | ||
| 38 | + */ | ||
| 39 | + private Integer status; | ||
| 40 | + /** | ||
| 41 | + * 表单JSON | ||
| 42 | + */ | ||
| 43 | + private String formJson; | ||
| 44 | + /** | ||
| 37 | * 表单配置 | 45 | * 表单配置 |
| 38 | * | 46 | * |
| 39 | * 目前直接将 https://github.com/JakHuang/form-generator 生成的 JSON 串,直接保存 | 47 | * 目前直接将 https://github.com/JakHuang/form-generator 生成的 JSON 串,直接保存 |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/dataobject/form/BpmFormData.java
| @@ -15,7 +15,7 @@ import java.util.Map; | @@ -15,7 +15,7 @@ import java.util.Map; | ||
| 15 | * | 15 | * |
| 16 | * @author 芋道源码 | 16 | * @author 芋道源码 |
| 17 | */ | 17 | */ |
| 18 | -@TableName(value = "wf_form", autoResultMap = true) | 18 | +@TableName(value = "bpm_form_data", autoResultMap = true) |
| 19 | @Data | 19 | @Data |
| 20 | @EqualsAndHashCode(callSuper = true) | 20 | @EqualsAndHashCode(callSuper = true) |
| 21 | @ToString(callSuper = true) | 21 | @ToString(callSuper = true) |
| @@ -35,6 +35,10 @@ public class BpmFormData extends BaseDO { | @@ -35,6 +35,10 @@ public class BpmFormData extends BaseDO { | ||
| 35 | */ | 35 | */ |
| 36 | private Long formId; | 36 | private Long formId; |
| 37 | /** | 37 | /** |
| 38 | + * 状态 | ||
| 39 | + */ | ||
| 40 | + private Integer status; | ||
| 41 | + /** | ||
| 38 | * 表单配置 | 42 | * 表单配置 |
| 39 | * | 43 | * |
| 40 | * 冗余 {@link BpmForm#getFields()} | 44 | * 冗余 {@link BpmForm#getFields()} |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/mysql/form/WfFormMapper.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/dal/mysql/form/BpmFormMapper.java
| 1 | -package cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.form; | 1 | +package cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.form; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | - | ||
| 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; | 4 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormExportReqVO; |
| 5 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormPageReqVO; | ||
| 6 | +import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmForm; | ||
| 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 7 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; | 8 | import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; |
| 10 | import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; | 9 | import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; |
| @@ -18,26 +17,26 @@ import java.util.List; | @@ -18,26 +17,26 @@ import java.util.List; | ||
| 18 | * @author 风里雾里 | 17 | * @author 风里雾里 |
| 19 | */ | 18 | */ |
| 20 | @Mapper | 19 | @Mapper |
| 21 | -public interface WfFormMapper extends BaseMapperX<WfForm> { | 20 | +public interface BpmFormMapper extends BaseMapperX<BpmForm> { |
| 22 | 21 | ||
| 23 | - default PageResult<WfForm> selectPage(WfFormPageReqVO reqVO) { | ||
| 24 | - return selectPage(reqVO, new QueryWrapperX<WfForm>() | 22 | + default PageResult<BpmForm> selectPage(BpmFormPageReqVO reqVO) { |
| 23 | + return selectPage(reqVO, new QueryWrapperX<BpmForm>() | ||
| 25 | .likeIfPresent("name", reqVO.getName()) | 24 | .likeIfPresent("name", reqVO.getName()) |
| 26 | .eqIfPresent("status", reqVO.getStatus()) | 25 | .eqIfPresent("status", reqVO.getStatus()) |
| 27 | .eqIfPresent("form_json", reqVO.getFormJson()) | 26 | .eqIfPresent("form_json", reqVO.getFormJson()) |
| 28 | .eqIfPresent("remark", reqVO.getRemark()) | 27 | .eqIfPresent("remark", reqVO.getRemark()) |
| 29 | .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | 28 | .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) |
| 30 | - .orderByDesc("id") ); | 29 | + .orderByDesc("id")); |
| 31 | } | 30 | } |
| 32 | 31 | ||
| 33 | - default List<WfForm> selectList(WfFormExportReqVO reqVO) { | ||
| 34 | - return selectList(new QueryWrapperX<WfForm>() | 32 | + default List<BpmForm> selectList(BpmFormExportReqVO reqVO) { |
| 33 | + return selectList(new QueryWrapperX<BpmForm>() | ||
| 35 | .likeIfPresent("name", reqVO.getName()) | 34 | .likeIfPresent("name", reqVO.getName()) |
| 36 | .eqIfPresent("status", reqVO.getStatus()) | 35 | .eqIfPresent("status", reqVO.getStatus()) |
| 37 | .eqIfPresent("form_json", reqVO.getFormJson()) | 36 | .eqIfPresent("form_json", reqVO.getFormJson()) |
| 38 | .eqIfPresent("remark", reqVO.getRemark()) | 37 | .eqIfPresent("remark", reqVO.getRemark()) |
| 39 | .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) | 38 | .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) |
| 40 | - .orderByDesc("id") ); | 39 | + .orderByDesc("id")); |
| 41 | } | 40 | } |
| 42 | 41 | ||
| 43 | } | 42 | } |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/enums/BpmErrorCodeConstants.java
| @@ -23,11 +23,13 @@ public interface BpmErrorCodeConstants { | @@ -23,11 +23,13 @@ public interface BpmErrorCodeConstants { | ||
| 23 | ErrorCode OA_HR_POST_NOT_EXISTS = new ErrorCode(1003001006, "HR岗位未设置"); | 23 | ErrorCode OA_HR_POST_NOT_EXISTS = new ErrorCode(1003001006, "HR岗位未设置"); |
| 24 | ErrorCode OA_DAY_LEAVE_ERROR = new ErrorCode(1003001007, "请假天数必须>=1"); | 24 | ErrorCode OA_DAY_LEAVE_ERROR = new ErrorCode(1003001007, "请假天数必须>=1"); |
| 25 | 25 | ||
| 26 | - | ||
| 27 | - // ========== OA 工作流模块 1-004-001-000 ========== | 26 | + // ========== OA 工作流模块 1-003-002-000 ========== |
| 28 | ErrorCode BPMN_MODEL_EDITOR_SOURCE_NOT_EXISTS = new ErrorCode(1004001001, "模型数据为空,请先成功设计流程并保存"); | 27 | ErrorCode BPMN_MODEL_EDITOR_SOURCE_NOT_EXISTS = new ErrorCode(1004001001, "模型数据为空,请先成功设计流程并保存"); |
| 29 | ErrorCode BPMN_MODEL_ERROR = new ErrorCode(1004001002, "工作流模型异常"); | 28 | ErrorCode BPMN_MODEL_ERROR = new ErrorCode(1004001002, "工作流模型异常"); |
| 30 | ErrorCode BPMN_MODEL_PROCESS_NOT_EXISTS = new ErrorCode(1004001003, "流程数据为空"); | 29 | ErrorCode BPMN_MODEL_PROCESS_NOT_EXISTS = new ErrorCode(1004001003, "流程数据为空"); |
| 31 | ErrorCode BPMN_PROCESS_DEFINITION_NOT_EXISTS = new ErrorCode(1004001004, "流程定义不存在"); | 30 | ErrorCode BPMN_PROCESS_DEFINITION_NOT_EXISTS = new ErrorCode(1004001004, "流程定义不存在"); |
| 32 | 31 | ||
| 32 | + // ========== 动态表单模块 1-003-003-000 ========== | ||
| 33 | + ErrorCode BPM_FORM_NOT_EXISTS = new ErrorCode(1003001002, "动态表单不存在"); | ||
| 34 | + | ||
| 33 | } | 35 | } |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/WfFormService.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/form/BpmFormService.java
| 1 | -package cn.iocoder.yudao.adminserver.modules.activiti.service.form; | 1 | +package cn.iocoder.yudao.adminserver.modules.bpm.service.form; |
| 2 | 2 | ||
| 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; | 3 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormCreateReqVO; |
| 4 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormExportReqVO; | ||
| 5 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormPageReqVO; | ||
| 6 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormUpdateReqVO; | ||
| 7 | +import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmForm; | ||
| 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 8 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 9 | 9 | ||
| 10 | -import java.util.*; | ||
| 11 | -import javax.validation.*; | 10 | +import javax.validation.Valid; |
| 11 | +import java.util.Collection; | ||
| 12 | +import java.util.List; | ||
| 12 | 13 | ||
| 13 | 14 | ||
| 14 | /** | 15 | /** |
| 15 | * 动态表单 Service 接口 | 16 | * 动态表单 Service 接口 |
| 16 | * | 17 | * |
| 17 | - * TODO @风里雾里 | 18 | + * @author @风里雾里 |
| 18 | */ | 19 | */ |
| 19 | -public interface WfFormService { | 20 | +public interface BpmFormService { |
| 20 | 21 | ||
| 21 | /** | 22 | /** |
| 22 | * 创建动态表单 | 23 | * 创建动态表单 |
| @@ -24,14 +25,14 @@ public interface WfFormService { | @@ -24,14 +25,14 @@ public interface WfFormService { | ||
| 24 | * @param createReqVO 创建信息 | 25 | * @param createReqVO 创建信息 |
| 25 | * @return 编号 | 26 | * @return 编号 |
| 26 | */ | 27 | */ |
| 27 | - Long createForm(@Valid WfFormCreateReqVO createReqVO); | 28 | + Long createForm(@Valid BpmFormCreateReqVO createReqVO); |
| 28 | 29 | ||
| 29 | /** | 30 | /** |
| 30 | * 更新动态表单 | 31 | * 更新动态表单 |
| 31 | * | 32 | * |
| 32 | * @param updateReqVO 更新信息 | 33 | * @param updateReqVO 更新信息 |
| 33 | */ | 34 | */ |
| 34 | - void updateForm(@Valid WfFormUpdateReqVO updateReqVO); | 35 | + void updateForm(@Valid BpmFormUpdateReqVO updateReqVO); |
| 35 | 36 | ||
| 36 | /** | 37 | /** |
| 37 | * 删除动态表单 | 38 | * 删除动态表单 |
| @@ -46,7 +47,7 @@ public interface WfFormService { | @@ -46,7 +47,7 @@ public interface WfFormService { | ||
| 46 | * @param id 编号 | 47 | * @param id 编号 |
| 47 | * @return 动态表单 | 48 | * @return 动态表单 |
| 48 | */ | 49 | */ |
| 49 | - WfForm getForm(Long id); | 50 | + BpmForm getForm(Long id); |
| 50 | 51 | ||
| 51 | /** | 52 | /** |
| 52 | * 获得动态表单列表 | 53 | * 获得动态表单列表 |
| @@ -54,7 +55,7 @@ public interface WfFormService { | @@ -54,7 +55,7 @@ public interface WfFormService { | ||
| 54 | * @param ids 编号 | 55 | * @param ids 编号 |
| 55 | * @return 动态表单列表 | 56 | * @return 动态表单列表 |
| 56 | */ | 57 | */ |
| 57 | - List<WfForm> getFormList(Collection<Long> ids); | 58 | + List<BpmForm> getFormList(Collection<Long> ids); |
| 58 | 59 | ||
| 59 | /** | 60 | /** |
| 60 | * 获得动态表单分页 | 61 | * 获得动态表单分页 |
| @@ -62,7 +63,7 @@ public interface WfFormService { | @@ -62,7 +63,7 @@ public interface WfFormService { | ||
| 62 | * @param pageReqVO 分页查询 | 63 | * @param pageReqVO 分页查询 |
| 63 | * @return 动态表单分页 | 64 | * @return 动态表单分页 |
| 64 | */ | 65 | */ |
| 65 | - PageResult<WfForm> getFormPage(WfFormPageReqVO pageReqVO); | 66 | + PageResult<BpmForm> getFormPage(BpmFormPageReqVO pageReqVO); |
| 66 | 67 | ||
| 67 | /** | 68 | /** |
| 68 | * 获得动态表单列表, 用于 Excel 导出 | 69 | * 获得动态表单列表, 用于 Excel 导出 |
| @@ -70,6 +71,6 @@ public interface WfFormService { | @@ -70,6 +71,6 @@ public interface WfFormService { | ||
| 70 | * @param exportReqVO 查询条件 | 71 | * @param exportReqVO 查询条件 |
| 71 | * @return 动态表单列表 | 72 | * @return 动态表单列表 |
| 72 | */ | 73 | */ |
| 73 | - List<WfForm> getFormList(WfFormExportReqVO exportReqVO); | 74 | + List<BpmForm> getFormList(BpmFormExportReqVO exportReqVO); |
| 74 | 75 | ||
| 75 | } | 76 | } |
yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/WfFormServiceImpl.java renamed to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/bpm/service/form/BpmFormServiceImpl.java
| 1 | -package cn.iocoder.yudao.adminserver.modules.activiti.service.form.impl; | 1 | +package cn.iocoder.yudao.adminserver.modules.bpm.service.form; |
| 2 | 2 | ||
| 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; | 3 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormCreateReqVO; |
| 4 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormExportReqVO; | ||
| 5 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormPageReqVO; | ||
| 6 | +import cn.iocoder.yudao.adminserver.modules.bpm.controller.form.vo.BpmFormUpdateReqVO; | ||
| 7 | +import cn.iocoder.yudao.adminserver.modules.bpm.convert.form.BpmFormConvert; | ||
| 8 | +import cn.iocoder.yudao.adminserver.modules.bpm.dal.dataobject.form.BpmForm; | ||
| 9 | +import cn.iocoder.yudao.adminserver.modules.bpm.dal.mysql.form.BpmFormMapper; | ||
| 11 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 10 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 12 | import org.springframework.stereotype.Service; | 11 | import org.springframework.stereotype.Service; |
| 13 | import org.springframework.validation.annotation.Validated; | 12 | import org.springframework.validation.annotation.Validated; |
| @@ -16,36 +15,36 @@ import javax.annotation.Resource; | @@ -16,36 +15,36 @@ import javax.annotation.Resource; | ||
| 16 | import java.util.Collection; | 15 | import java.util.Collection; |
| 17 | import java.util.List; | 16 | import java.util.List; |
| 18 | 17 | ||
| 19 | -import static cn.iocoder.yudao.adminserver.modules.activiti.enums.form.WfFormErrorCodeConstants.FORM_NOT_EXISTS; | 18 | +import static cn.iocoder.yudao.adminserver.modules.bpm.enums.BpmErrorCodeConstants.BPM_FORM_NOT_EXISTS; |
| 20 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; | 19 | import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; |
| 21 | 20 | ||
| 22 | /** | 21 | /** |
| 23 | * 动态表单 Service 实现类 | 22 | * 动态表单 Service 实现类 |
| 24 | * | 23 | * |
| 25 | - * TODO @风里雾里 | 24 | + * @author 风里雾里 |
| 26 | */ | 25 | */ |
| 27 | @Service | 26 | @Service |
| 28 | @Validated | 27 | @Validated |
| 29 | -public class WfFormServiceImpl implements WfFormService { | 28 | +public class BpmFormServiceImpl implements BpmFormService { |
| 30 | 29 | ||
| 31 | @Resource | 30 | @Resource |
| 32 | - private WfFormMapper formMapper; | 31 | + private BpmFormMapper formMapper; |
| 33 | 32 | ||
| 34 | @Override | 33 | @Override |
| 35 | - public Long createForm(WfFormCreateReqVO createReqVO) { | 34 | + public Long createForm(BpmFormCreateReqVO createReqVO) { |
| 36 | // 插入 | 35 | // 插入 |
| 37 | - WfForm form = WfFormConvert.INSTANCE.convert(createReqVO); | 36 | + BpmForm form = BpmFormConvert.INSTANCE.convert(createReqVO); |
| 38 | formMapper.insert(form); | 37 | formMapper.insert(form); |
| 39 | // 返回 | 38 | // 返回 |
| 40 | return form.getId(); | 39 | return form.getId(); |
| 41 | } | 40 | } |
| 42 | 41 | ||
| 43 | @Override | 42 | @Override |
| 44 | - public void updateForm(WfFormUpdateReqVO updateReqVO) { | 43 | + public void updateForm(BpmFormUpdateReqVO updateReqVO) { |
| 45 | // 校验存在 | 44 | // 校验存在 |
| 46 | this.validateFormExists(updateReqVO.getId()); | 45 | this.validateFormExists(updateReqVO.getId()); |
| 47 | // 更新 | 46 | // 更新 |
| 48 | - WfForm updateObj = WfFormConvert.INSTANCE.convert(updateReqVO); | 47 | + BpmForm updateObj = BpmFormConvert.INSTANCE.convert(updateReqVO); |
| 49 | formMapper.updateById(updateObj); | 48 | formMapper.updateById(updateObj); |
| 50 | } | 49 | } |
| 51 | 50 | ||
| @@ -59,27 +58,27 @@ public class WfFormServiceImpl implements WfFormService { | @@ -59,27 +58,27 @@ public class WfFormServiceImpl implements WfFormService { | ||
| 59 | 58 | ||
| 60 | private void validateFormExists(Long id) { | 59 | private void validateFormExists(Long id) { |
| 61 | if (formMapper.selectById(id) == null) { | 60 | if (formMapper.selectById(id) == null) { |
| 62 | - throw exception(FORM_NOT_EXISTS); | 61 | + throw exception(BPM_FORM_NOT_EXISTS); |
| 63 | } | 62 | } |
| 64 | } | 63 | } |
| 65 | 64 | ||
| 66 | @Override | 65 | @Override |
| 67 | - public WfForm getForm(Long id) { | 66 | + public BpmForm getForm(Long id) { |
| 68 | return formMapper.selectById(id); | 67 | return formMapper.selectById(id); |
| 69 | } | 68 | } |
| 70 | 69 | ||
| 71 | @Override | 70 | @Override |
| 72 | - public List<WfForm> getFormList(Collection<Long> ids) { | 71 | + public List<BpmForm> getFormList(Collection<Long> ids) { |
| 73 | return formMapper.selectBatchIds(ids); | 72 | return formMapper.selectBatchIds(ids); |
| 74 | } | 73 | } |
| 75 | 74 | ||
| 76 | @Override | 75 | @Override |
| 77 | - public PageResult<WfForm> getFormPage(WfFormPageReqVO pageReqVO) { | 76 | + public PageResult<BpmForm> getFormPage(BpmFormPageReqVO pageReqVO) { |
| 78 | return formMapper.selectPage(pageReqVO); | 77 | return formMapper.selectPage(pageReqVO); |
| 79 | } | 78 | } |
| 80 | 79 | ||
| 81 | @Override | 80 | @Override |
| 82 | - public List<WfForm> getFormList(WfFormExportReqVO exportReqVO) { | 81 | + public List<BpmForm> getFormList(BpmFormExportReqVO exportReqVO) { |
| 83 | return formMapper.selectList(exportReqVO); | 82 | return formMapper.selectList(exportReqVO); |
| 84 | } | 83 | } |
| 85 | 84 |
yudao-framework/yudao-spring-boot-starter-activiti/src/main/java/cn/iocoder/yudao/framework/activiti/config/YudaoActivitiConfiguration.java
| 1 | package cn.iocoder.yudao.framework.activiti.config; | 1 | package cn.iocoder.yudao.framework.activiti.config; |
| 2 | 2 | ||
| 3 | -import lombok.AllArgsConstructor; | ||
| 4 | import org.activiti.image.ProcessDiagramGenerator; | 3 | import org.activiti.image.ProcessDiagramGenerator; |
| 5 | import org.activiti.image.impl.DefaultProcessDiagramGenerator; | 4 | import org.activiti.image.impl.DefaultProcessDiagramGenerator; |
| 6 | -import org.activiti.spring.SpringProcessEngineConfiguration; | ||
| 7 | import org.activiti.spring.boot.ProcessEngineConfigurationConfigurer; | 5 | import org.activiti.spring.boot.ProcessEngineConfigurationConfigurer; |
| 8 | import org.apache.ibatis.session.SqlSessionFactory; | 6 | import org.apache.ibatis.session.SqlSessionFactory; |
| 9 | import org.springframework.context.annotation.Bean; | 7 | import org.springframework.context.annotation.Bean; |
| 10 | import org.springframework.context.annotation.Configuration; | 8 | import org.springframework.context.annotation.Configuration; |
| 11 | -import org.springframework.stereotype.Component; | ||
| 12 | 9 | ||
| 13 | @Configuration | 10 | @Configuration |
| 14 | public class YudaoActivitiConfiguration { | 11 | public class YudaoActivitiConfiguration { |
| @@ -24,19 +21,9 @@ public class YudaoActivitiConfiguration { | @@ -24,19 +21,9 @@ public class YudaoActivitiConfiguration { | ||
| 24 | /** | 21 | /** |
| 25 | * ProcessEngineConfigurationConfigurer 实现类,设置使用 MyBatis SqlSessionFactory | 22 | * ProcessEngineConfigurationConfigurer 实现类,设置使用 MyBatis SqlSessionFactory |
| 26 | */ | 23 | */ |
| 27 | - @Component | ||
| 28 | - @AllArgsConstructor | ||
| 29 | - public static class SqlSessionFactoryProcessEngineConfigurationConfigurer | ||
| 30 | - implements ProcessEngineConfigurationConfigurer { | ||
| 31 | - | ||
| 32 | - private final SqlSessionFactory sqlSessionFactory; | ||
| 33 | - | ||
| 34 | - @Override | ||
| 35 | - public void configure(SpringProcessEngineConfiguration springProcessEngineConfiguration) { | ||
| 36 | - springProcessEngineConfiguration.setSqlSessionFactory(sqlSessionFactory); | ||
| 37 | - } | ||
| 38 | - | 24 | + @Bean |
| 25 | + public ProcessEngineConfigurationConfigurer processEngineConfigurationConfigurer(SqlSessionFactory sqlSessionFactory) { | ||
| 26 | + return springProcessEngineConfiguration -> springProcessEngineConfiguration.setSqlSessionFactory(sqlSessionFactory); | ||
| 39 | } | 27 | } |
| 40 | 28 | ||
| 41 | - | ||
| 42 | } | 29 | } |