From 83ce39f700e8fda353f76b82060622aaaac3430e Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 31 Oct 2021 11:06:27 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20.gitattributes=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6=EF=BC=8C=E9=81=BF=E5=85=8D=E8=AF=86=E5=88=AB?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=B1=BB=E5=9E=8B=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..3c200cd4a --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.sql linguist-language=java From a4948d27d28f31390390fa7ac92d3f0c9b6aa91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=8B=E9=81=93=E6=BA=90=E7=A0=81?= Date: Mon, 1 Nov 2021 02:04:26 +0000 Subject: [PATCH 2/7] update yudao-admin-server/src/main/resources/application-local.yaml. --- yudao-admin-server/src/main/resources/application-local.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yudao-admin-server/src/main/resources/application-local.yaml b/yudao-admin-server/src/main/resources/application-local.yaml index b34664b10..d7880547f 100644 --- a/yudao-admin-server/src/main/resources/application-local.yaml +++ b/yudao-admin-server/src/main/resources/application-local.yaml @@ -47,13 +47,13 @@ spring: url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: root + password: 123456 slave: # 模拟从库,可根据自己需要修改 name: ruoyi-vue-pro url: jdbc:mysql://127.0.0.1:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT driver-class-name: com.mysql.jdbc.Driver username: root - password: root + password: 123456 activiti: From 4cfa959d9869e72257f276232d1763688fc4a21a Mon Sep 17 00:00:00 2001 From: yex Date: Tue, 2 Nov 2021 12:25:41 +0800 Subject: [PATCH 3/7] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E5=92=8C=E5=AD=97=E5=85=B8=E6=9F=A5=E8=AF=A2=E6=9D=83=E9=99=90?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/controller/dict/SysDictTypeController.java | 6 +++--- .../system/controller/notice/SysNoticeController.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/dict/SysDictTypeController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/dict/SysDictTypeController.java index 9ab36610d..4057f8a3f 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/dict/SysDictTypeController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/dict/SysDictTypeController.java @@ -60,7 +60,7 @@ public class SysDictTypeController { @ApiOperation("/获得字典类型的分页列表") @GetMapping("/page") - @PreAuthorize("@ss.hasPermission('system:dict:quey')") + @PreAuthorize("@ss.hasPermission('system:dict:query')") public CommonResult> pageDictTypes(@Valid SysDictTypePageReqVO reqVO) { return success(SysDictTypeConvert.INSTANCE.convertPage(dictTypeService.getDictTypePage(reqVO))); } @@ -68,7 +68,7 @@ public class SysDictTypeController { @ApiOperation("/查询字典类型详细") @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @GetMapping(value = "/get") - @PreAuthorize("@ss.hasPermission('system:dict:quey')") + @PreAuthorize("@ss.hasPermission('system:dict:query')") public CommonResult getDictType(@RequestParam("id") Long id) { return success(SysDictTypeConvert.INSTANCE.convert(dictTypeService.getDictType(id))); } @@ -83,7 +83,7 @@ public class SysDictTypeController { @ApiOperation("导出数据类型") @GetMapping("/export") - @PreAuthorize("@ss.hasPermission('system:dict:quey')") + @PreAuthorize("@ss.hasPermission('system:dict:query')") @OperateLog(type = EXPORT) public void export(HttpServletResponse response, @Valid SysDictTypeExportReqVO reqVO) throws IOException { List list = dictTypeService.getDictTypeList(reqVO); diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/notice/SysNoticeController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/notice/SysNoticeController.java index f004c953e..5ab1944ab 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/notice/SysNoticeController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/system/controller/notice/SysNoticeController.java @@ -56,7 +56,7 @@ public class SysNoticeController { @GetMapping("/page") @ApiOperation("获取通知公告列表") - @PreAuthorize("@ss.hasPermission('system:notice:quey')") + @PreAuthorize("@ss.hasPermission('system:notice:query')") public CommonResult> pageNotices(@Validated SysNoticePageReqVO reqVO) { return success(SysNoticeConvert.INSTANCE.convertPage(noticeService.pageNotices(reqVO))); } @@ -64,7 +64,7 @@ public class SysNoticeController { @GetMapping("/get") @ApiOperation("获得通知公告") @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) - @PreAuthorize("@ss.hasPermission('system:notice:quey')") + @PreAuthorize("@ss.hasPermission('system:notice:query')") public CommonResult getNotice(@RequestParam("id") Long id) { return success(SysNoticeConvert.INSTANCE.convert(noticeService.getNotice(id))); } From 9d8cdb2670c64be4ffe1c324edb8be10138760e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A8=8A=E5=AE=87?= <970895810@qq.com> Date: Wed, 3 Nov 2021 10:26:01 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=A1=A8=E5=8D=95=20?= =?UTF-8?q?=E5=90=8E=E7=AB=AF=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/form/OsFormController.java | 96 +++++++++++++++++++ .../controller/form/vo/OsFormBaseVO.java | 28 ++++++ .../controller/form/vo/OsFormCreateReqVO.java | 12 +++ .../controller/form/vo/OsFormExcelVO.java | 34 +++++++ .../controller/form/vo/OsFormExportReqVO.java | 33 +++++++ .../controller/form/vo/OsFormPageReqVO.java | 36 +++++++ .../controller/form/vo/OsFormRespVO.java | 19 ++++ .../controller/form/vo/OsFormUpdateReqVO.java | 17 ++++ .../activiti/convert/form/OsFormConvert.java | 36 +++++++ .../dal/dataobject/form/OsFormDO.java | 44 +++++++++ .../activiti/dal/mysql/form/OsFormMapper.java | 43 +++++++++ .../enums/form/FormErrorCodeConstants.java | 14 +++ .../activiti/service/form/OsFormService.java | 75 +++++++++++++++ .../service/form/impl/OsFormServiceImpl.java | 85 ++++++++++++++++ 14 files changed, 572 insertions(+) create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/OsFormController.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormBaseVO.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormCreateReqVO.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExcelVO.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExportReqVO.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormPageReqVO.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormRespVO.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormUpdateReqVO.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/OsFormConvert.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/OsFormDO.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/mysql/form/OsFormMapper.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/enums/form/FormErrorCodeConstants.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/OsFormService.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/OsFormServiceImpl.java diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/OsFormController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/OsFormController.java new file mode 100644 index 000000000..847ef9f20 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/OsFormController.java @@ -0,0 +1,96 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.controller.form; + +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.*; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.OsFormConvert; +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; +import cn.iocoder.yudao.adminserver.modules.activiti.service.form.OsFormService; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.security.access.prepost.PreAuthorize; +import io.swagger.annotations.*; +import javax.validation.*; +import javax.servlet.http.*; +import java.util.*; +import java.io.IOException; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; +import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; + + + +@Api(tags = "动态表单") +@RestController +@RequestMapping("/os/form") +@Validated +public class OsFormController { + + @Resource + private OsFormService formService; + + @PostMapping("/create") + @ApiOperation("创建动态表单") + @PreAuthorize("@ss.hasPermission('os:form:create')") + public CommonResult createForm(@Valid @RequestBody OsFormCreateReqVO createReqVO) { + return success(formService.createForm(createReqVO)); + } + + @PutMapping("/update") + @ApiOperation("更新动态表单") + @PreAuthorize("@ss.hasPermission('os:form:update')") + public CommonResult updateForm(@Valid @RequestBody OsFormUpdateReqVO updateReqVO) { + formService.updateForm(updateReqVO); + return success(true); + } + + @DeleteMapping("/delete") + @ApiOperation("删除动态表单") + @ApiImplicitParam(name = "id", value = "编号", required = true) + @PreAuthorize("@ss.hasPermission('os:form:delete')") + public CommonResult deleteForm(@RequestParam("id") Long id) { + formService.deleteForm(id); + return success(true); + } + + @GetMapping("/get") + @ApiOperation("获得动态表单") + @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) + @PreAuthorize("@ss.hasPermission('os:form:query')") + public CommonResult getForm(@RequestParam("id") Long id) { + OsFormDO form = formService.getForm(id); + return success(OsFormConvert.INSTANCE.convert(form)); + } + + @GetMapping("/list") + @ApiOperation("获得动态表单列表") + @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) + @PreAuthorize("@ss.hasPermission('os:form:query')") + public CommonResult> getFormList(@RequestParam("ids") Collection ids) { + List list = formService.getFormList(ids); + return success(OsFormConvert.INSTANCE.convertList(list)); + } + + @GetMapping("/page") + @ApiOperation("获得动态表单分页") + @PreAuthorize("@ss.hasPermission('os:form:query')") + public CommonResult> getFormPage(@Valid OsFormPageReqVO pageVO) { + PageResult pageResult = formService.getFormPage(pageVO); + return success(OsFormConvert.INSTANCE.convertPage(pageResult)); + } + + @GetMapping("/export-excel") + @ApiOperation("导出动态表单 Excel") + @PreAuthorize("@ss.hasPermission('os:form:export')") + @OperateLog(type = EXPORT) + public void exportFormExcel(@Valid OsFormExportReqVO exportReqVO, + HttpServletResponse response) throws IOException { + List list = formService.getFormList(exportReqVO); + // 导出 Excel + List datas = OsFormConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "动态表单.xls", "数据", OsFormExcelVO.class, datas); + } + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormBaseVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormBaseVO.java new file mode 100644 index 000000000..7868be836 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormBaseVO.java @@ -0,0 +1,28 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; + +import lombok.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +/** +* 动态表单 Base VO,提供给添加、修改、详细的子 VO 使用 +* 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 +*/ +@Data +public class OsFormBaseVO { + + @ApiModelProperty(value = "表单名称", required = true) + @NotNull(message = "表单名称不能为空") + private String name; + + @ApiModelProperty(value = "商户状态", required = true) + @NotNull(message = "商户状态不能为空") + private Integer status; + + @ApiModelProperty(value = "表单JSON") + private String formJson; + + @ApiModelProperty(value = "备注") + private String remark; + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormCreateReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormCreateReqVO.java new file mode 100644 index 000000000..bd58aacf1 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormCreateReqVO.java @@ -0,0 +1,12 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; + +import lombok.*; +import io.swagger.annotations.*; + +@ApiModel("动态表单创建 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class OsFormCreateReqVO extends OsFormBaseVO { + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExcelVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExcelVO.java new file mode 100644 index 000000000..0d2147c96 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExcelVO.java @@ -0,0 +1,34 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; + +import lombok.*; +import java.util.*; + +import com.alibaba.excel.annotation.ExcelProperty; + +/** + * 动态表单 Excel VO + * + * @author 芋艿 + */ +@Data +public class OsFormExcelVO { + + @ExcelProperty("表单编号") + private Long id; + + @ExcelProperty("表单名称") + private String name; + + @ExcelProperty("商户状态") + private Integer status; + + @ExcelProperty("表单JSON") + private String formJson; + + @ExcelProperty("备注") + private String remark; + + @ExcelProperty("创建时间") + private Date createTime; + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExportReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExportReqVO.java new file mode 100644 index 000000000..bd68cd884 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExportReqVO.java @@ -0,0 +1,33 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import org.springframework.format.annotation.DateTimeFormat; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel(value = "动态表单 Excel 导出 Request VO", description = "参数和 OsFormPageReqVO 是一致的") +@Data +public class OsFormExportReqVO { + + @ApiModelProperty(value = "表单名称") + private String name; + + @ApiModelProperty(value = "商户状态") + private Integer status; + + @ApiModelProperty(value = "表单JSON") + private String formJson; + + @ApiModelProperty(value = "备注") + private String remark; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormPageReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormPageReqVO.java new file mode 100644 index 000000000..0c9167bc0 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormPageReqVO.java @@ -0,0 +1,36 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import org.springframework.format.annotation.DateTimeFormat; +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@ApiModel("动态表单分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class OsFormPageReqVO extends PageParam { + + @ApiModelProperty(value = "表单名称") + private String name; + + @ApiModelProperty(value = "商户状态") + private Integer status; + + @ApiModelProperty(value = "表单JSON") + private String formJson; + + @ApiModelProperty(value = "备注") + private String remark; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "开始创建时间") + private Date beginCreateTime; + + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + @ApiModelProperty(value = "结束创建时间") + private Date endCreateTime; + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormRespVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormRespVO.java new file mode 100644 index 000000000..adc63d31b --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormRespVO.java @@ -0,0 +1,19 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; + +import lombok.*; +import java.util.*; +import io.swagger.annotations.*; + +@ApiModel("动态表单 Response VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class OsFormRespVO extends OsFormBaseVO { + + @ApiModelProperty(value = "表单编号", required = true) + private Long id; + + @ApiModelProperty(value = "创建时间", required = true) + private Date createTime; + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormUpdateReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormUpdateReqVO.java new file mode 100644 index 000000000..daba1d922 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormUpdateReqVO.java @@ -0,0 +1,17 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo; + +import lombok.*; +import io.swagger.annotations.*; +import javax.validation.constraints.*; + +@ApiModel("动态表单更新 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class OsFormUpdateReqVO extends OsFormBaseVO { + + @ApiModelProperty(value = "表单编号", required = true) + @NotNull(message = "表单编号不能为空") + private Long id; + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/OsFormConvert.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/OsFormConvert.java new file mode 100644 index 000000000..96bff877c --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/OsFormConvert.java @@ -0,0 +1,36 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.convert.form; + +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormCreateReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormExcelVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormRespVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormUpdateReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +import java.util.List; + +/** + * 动态表单 Convert + * + * @author 芋艿 + */ +@Mapper +public interface OsFormConvert { + + OsFormConvert INSTANCE = Mappers.getMapper(OsFormConvert.class); + + OsFormDO convert(OsFormCreateReqVO bean); + + OsFormDO convert(OsFormUpdateReqVO bean); + + OsFormRespVO convert(OsFormDO bean); + + List convertList(List list); + + PageResult convertPage(PageResult page); + + List convertList02(List list); + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/OsFormDO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/OsFormDO.java new file mode 100644 index 000000000..8b6296da7 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/OsFormDO.java @@ -0,0 +1,44 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form; + +import lombok.*; +import java.util.*; +import com.baomidou.mybatisplus.annotation.*; +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; + +/** + * 动态表单 DO + * + * @author 芋艿 + */ +@TableName("os_form") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class OsFormDO extends BaseDO { + + /** + * 表单编号 + */ + @TableId + private Long id; + /** + * 表单名称 + */ + private String name; + /** + * 商户状态 + */ + private Integer status; + /** + * 表单JSON + */ + private String formJson; + /** + * 备注 + */ + private String remark; + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/mysql/form/OsFormMapper.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/mysql/form/OsFormMapper.java new file mode 100644 index 000000000..19acff215 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/mysql/form/OsFormMapper.java @@ -0,0 +1,43 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.form; + + + +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormExportReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormPageReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; +import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 动态表单 Mapper + * + * @author 芋艿 + */ +@Mapper +public interface OsFormMapper extends BaseMapperX { + + default PageResult selectPage(OsFormPageReqVO reqVO) { + return selectPage(reqVO, new QueryWrapperX() + .likeIfPresent("name", reqVO.getName()) + .eqIfPresent("status", reqVO.getStatus()) + .eqIfPresent("form_json", reqVO.getFormJson()) + .eqIfPresent("remark", reqVO.getRemark()) + .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc("id") ); + } + + default List selectList(OsFormExportReqVO reqVO) { + return selectList(new QueryWrapperX() + .likeIfPresent("name", reqVO.getName()) + .eqIfPresent("status", reqVO.getStatus()) + .eqIfPresent("form_json", reqVO.getFormJson()) + .eqIfPresent("remark", reqVO.getRemark()) + .betweenIfPresent("create_time", reqVO.getBeginCreateTime(), reqVO.getEndCreateTime()) + .orderByDesc("id") ); + } + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/enums/form/FormErrorCodeConstants.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/enums/form/FormErrorCodeConstants.java new file mode 100644 index 000000000..e0b961c00 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/enums/form/FormErrorCodeConstants.java @@ -0,0 +1,14 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.enums.form; + +import cn.iocoder.yudao.framework.common.exception.ErrorCode; + +/** + * activiti 系统 错误码枚举类 + * + * 003 activiti + * 001 oa + * activiti 系统,使用 1-003-000-000 段 + */ +public interface FormErrorCodeConstants { + ErrorCode FORM_NOT_EXISTS = new ErrorCode(1003001002, "动态表单不存在"); +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/OsFormService.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/OsFormService.java new file mode 100644 index 000000000..1691d412d --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/OsFormService.java @@ -0,0 +1,75 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.service.form; + +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormCreateReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormExportReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormPageReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormUpdateReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import java.util.*; +import javax.validation.*; + + +/** + * 动态表单 Service 接口 + * + * @author 芋艿 + */ +public interface OsFormService { + + /** + * 创建动态表单 + * + * @param createReqVO 创建信息 + * @return 编号 + */ + Long createForm(@Valid OsFormCreateReqVO createReqVO); + + /** + * 更新动态表单 + * + * @param updateReqVO 更新信息 + */ + void updateForm(@Valid OsFormUpdateReqVO updateReqVO); + + /** + * 删除动态表单 + * + * @param id 编号 + */ + void deleteForm(Long id); + + /** + * 获得动态表单 + * + * @param id 编号 + * @return 动态表单 + */ + OsFormDO getForm(Long id); + + /** + * 获得动态表单列表 + * + * @param ids 编号 + * @return 动态表单列表 + */ + List getFormList(Collection ids); + + /** + * 获得动态表单分页 + * + * @param pageReqVO 分页查询 + * @return 动态表单分页 + */ + PageResult getFormPage(OsFormPageReqVO pageReqVO); + + /** + * 获得动态表单列表, 用于 Excel 导出 + * + * @param exportReqVO 查询条件 + * @return 动态表单列表 + */ + List getFormList(OsFormExportReqVO exportReqVO); + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/OsFormServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/OsFormServiceImpl.java new file mode 100644 index 000000000..ed2f03046 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/OsFormServiceImpl.java @@ -0,0 +1,85 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.service.form.impl; + +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormCreateReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormExportReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormPageReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormUpdateReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.OsFormConvert; +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; +import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.form.OsFormMapper; +import cn.iocoder.yudao.adminserver.modules.activiti.service.form.OsFormService; +import cn.iocoder.yudao.framework.common.pojo.PageResult; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import java.util.*; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.adminserver.modules.activiti.enums.form.FormErrorCodeConstants.FORM_NOT_EXISTS; + +/** + * 动态表单 Service 实现类 + * + * @author 芋艿 + */ +@Service +@Validated +public class OsFormServiceImpl implements OsFormService { + + @Resource + private OsFormMapper formMapper; + + @Override + public Long createForm(OsFormCreateReqVO createReqVO) { + // 插入 + OsFormDO form = OsFormConvert.INSTANCE.convert(createReqVO); + formMapper.insert(form); + // 返回 + return form.getId(); + } + + @Override + public void updateForm(OsFormUpdateReqVO updateReqVO) { + // 校验存在 + this.validateFormExists(updateReqVO.getId()); + // 更新 + OsFormDO updateObj = OsFormConvert.INSTANCE.convert(updateReqVO); + formMapper.updateById(updateObj); + } + + @Override + public void deleteForm(Long id) { + // 校验存在 + this.validateFormExists(id); + // 删除 + formMapper.deleteById(id); + } + + private void validateFormExists(Long id) { + if (formMapper.selectById(id) == null) { + throw exception(FORM_NOT_EXISTS); + } + } + + @Override + public OsFormDO getForm(Long id) { + return formMapper.selectById(id); + } + + @Override + public List getFormList(Collection ids) { + return formMapper.selectBatchIds(ids); + } + + @Override + public PageResult getFormPage(OsFormPageReqVO pageReqVO) { + return formMapper.selectPage(pageReqVO); + } + + @Override + public List getFormList(OsFormExportReqVO exportReqVO) { + return formMapper.selectList(exportReqVO); + } + +} From 592f706cd849a37ae08cb90e96bd6f9ffb7fbf8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=8B=E9=81=93=E6=BA=90=E7=A0=81?= Date: Thu, 4 Nov 2021 00:54:27 +0000 Subject: [PATCH 5/7] =?UTF-8?q?update=20=E6=9B=B4=E6=96=B0=E6=97=A5?= =?UTF-8?q?=E5=BF=97.md.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 更新日志.md | 1 + 1 file changed, 1 insertion(+) diff --git a/更新日志.md b/更新日志.md index 012107729..748a6d2d9 100644 --- a/更新日志.md +++ b/更新日志.md @@ -21,6 +21,7 @@ ## [v1.2.0] 进行中 * 新增用户前台的昵称、头像的修改 +* 修复通知和字典查询权限 Bug TODO From b7a90c2c128550e0cd8290dd7fa342db1f28351f Mon Sep 17 00:00:00 2001 From: YunaiV Date: Thu, 4 Nov 2021 09:03:05 +0800 Subject: [PATCH 6/7] =?UTF-8?q?code=20review=20=E5=8A=A8=E6=80=81=E8=A1=A8?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/form/OsFormController.java | 28 +++++++++++-------- .../dal/dataobject/form/OsFormDO.java | 7 +++-- .../service/form/impl/OsFormServiceImpl.java | 11 ++++---- 3 files changed, 26 insertions(+), 20 deletions(-) diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/OsFormController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/OsFormController.java index 847ef9f20..3e61a8632 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/OsFormController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/OsFormController.java @@ -1,27 +1,31 @@ package cn.iocoder.yudao.adminserver.modules.activiti.controller.form; import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.*; -import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.OsFormConvert; import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; import cn.iocoder.yudao.adminserver.modules.activiti.service.form.OsFormService; -import org.springframework.web.bind.annotation.*; -import javax.annotation.Resource; -import org.springframework.validation.annotation.Validated; -import org.springframework.security.access.prepost.PreAuthorize; -import io.swagger.annotations.*; -import javax.validation.*; -import javax.servlet.http.*; -import java.util.*; -import java.io.IOException; import cn.iocoder.yudao.framework.common.pojo.CommonResult; -import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; -import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiOperation; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import javax.validation.Valid; +import java.io.IOException; +import java.util.Collection; +import java.util.List; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT; +// TODO @风里雾里: Os=》Wf,/os 改成 /wl 开头。目前这个模块,咱先定位成给工作流用的 @Api(tags = "动态表单") @RestController @RequestMapping("/os/form") diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/OsFormDO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/OsFormDO.java index 8b6296da7..bb0e3b237 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/OsFormDO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/OsFormDO.java @@ -1,10 +1,11 @@ package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form; -import lombok.*; -import java.util.*; -import com.baomidou.mybatisplus.annotation.*; import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.*; +// 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 添加进去哈。 /** * 动态表单 DO * diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/OsFormServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/OsFormServiceImpl.java index ed2f03046..b0ab903b8 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/OsFormServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/OsFormServiceImpl.java @@ -9,19 +9,20 @@ import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormD import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.form.OsFormMapper; import cn.iocoder.yudao.adminserver.modules.activiti.service.form.OsFormService; import cn.iocoder.yudao.framework.common.pojo.PageResult; - import org.springframework.stereotype.Service; -import javax.annotation.Resource; import org.springframework.validation.annotation.Validated; -import java.util.*; -import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import javax.annotation.Resource; +import java.util.Collection; +import java.util.List; + import static cn.iocoder.yudao.adminserver.modules.activiti.enums.form.FormErrorCodeConstants.FORM_NOT_EXISTS; +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; /** * 动态表单 Service 实现类 * - * @author 芋艿 + * @author 芋艿 // TODO @风里雾里:作者改成你自己哈 */ @Service @Validated From b369b363b686d1681fd17ecc7de425428aa46800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A8=8A=E5=AE=87?= <970895810@qq.com> Date: Thu, 4 Nov 2021 17:35:01 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=A1=A8=E5=8D=95=20?= =?UTF-8?q?=E5=91=BD=E5=90=8D=E8=A7=84=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...mController.java => WlFormController.java} | 42 +++++++------- .../{OsFormBaseVO.java => WfFormBaseVO.java} | 2 +- ...reateReqVO.java => WfFormCreateReqVO.java} | 2 +- ...{OsFormExcelVO.java => WfFormExcelVO.java} | 2 +- ...xportReqVO.java => WfFormExportReqVO.java} | 2 +- ...ormPageReqVO.java => WfFormPageReqVO.java} | 2 +- .../{OsFormRespVO.java => WfFormRespVO.java} | 2 +- ...pdateReqVO.java => WfFormUpdateReqVO.java} | 2 +- ...{OsFormConvert.java => WfFormConvert.java} | 26 ++++----- .../dal/dataobject/form/OsFormDO.java | 45 --------------- .../activiti/dal/dataobject/form/WfForm.java | 57 +++++++++++++++++++ .../dal/dataobject/form/WfFormData.java | 55 ++++++++++++++++++ .../{OsFormMapper.java => WfFormMapper.java} | 18 +++--- ...nts.java => WfFormErrorCodeConstants.java} | 2 +- ...{OsFormService.java => WfFormService.java} | 26 ++++----- ...erviceImpl.java => WfFormServiceImpl.java} | 40 ++++++------- 16 files changed, 196 insertions(+), 129 deletions(-) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/{OsFormController.java => WlFormController.java} (75%) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/{OsFormBaseVO.java => WfFormBaseVO.java} (96%) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/{OsFormCreateReqVO.java => WfFormCreateReqVO.java} (81%) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/{OsFormExcelVO.java => WfFormExcelVO.java} (95%) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/{OsFormExportReqVO.java => WfFormExportReqVO.java} (96%) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/{OsFormPageReqVO.java => WfFormPageReqVO.java} (95%) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/{OsFormRespVO.java => WfFormRespVO.java} (89%) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/{OsFormUpdateReqVO.java => WfFormUpdateReqVO.java} (88%) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/{OsFormConvert.java => WfFormConvert.java} (53%) delete mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/OsFormDO.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/WfForm.java create mode 100644 yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/WfFormData.java rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/mysql/form/{OsFormMapper.java => WfFormMapper.java} (77%) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/enums/form/{FormErrorCodeConstants.java => WfFormErrorCodeConstants.java} (88%) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/{OsFormService.java => WfFormService.java} (72%) rename yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/{OsFormServiceImpl.java => WfFormServiceImpl.java} (68%) diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/OsFormController.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/WlFormController.java similarity index 75% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/OsFormController.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/WlFormController.java index 3e61a8632..f2e795c64 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/OsFormController.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/WlFormController.java @@ -1,9 +1,9 @@ package cn.iocoder.yudao.adminserver.modules.activiti.controller.form; import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.*; -import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.OsFormConvert; -import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; -import cn.iocoder.yudao.adminserver.modules.activiti.service.form.OsFormService; +import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.WfFormConvert; +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm; +import cn.iocoder.yudao.adminserver.modules.activiti.service.form.WfFormService; import cn.iocoder.yudao.framework.common.pojo.CommonResult; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils; @@ -28,24 +28,24 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E // TODO @风里雾里: Os=》Wf,/os 改成 /wl 开头。目前这个模块,咱先定位成给工作流用的 @Api(tags = "动态表单") @RestController -@RequestMapping("/os/form") +@RequestMapping("/wl/form") @Validated -public class OsFormController { +public class WlFormController { @Resource - private OsFormService formService; + private WfFormService formService; @PostMapping("/create") @ApiOperation("创建动态表单") @PreAuthorize("@ss.hasPermission('os:form:create')") - public CommonResult createForm(@Valid @RequestBody OsFormCreateReqVO createReqVO) { + public CommonResult createForm(@Valid @RequestBody WfFormCreateReqVO createReqVO) { return success(formService.createForm(createReqVO)); } @PutMapping("/update") @ApiOperation("更新动态表单") @PreAuthorize("@ss.hasPermission('os:form:update')") - public CommonResult updateForm(@Valid @RequestBody OsFormUpdateReqVO updateReqVO) { + public CommonResult updateForm(@Valid @RequestBody WfFormUpdateReqVO updateReqVO) { formService.updateForm(updateReqVO); return success(true); } @@ -63,38 +63,38 @@ public class OsFormController { @ApiOperation("获得动态表单") @ApiImplicitParam(name = "id", value = "编号", required = true, example = "1024", dataTypeClass = Long.class) @PreAuthorize("@ss.hasPermission('os:form:query')") - public CommonResult getForm(@RequestParam("id") Long id) { - OsFormDO form = formService.getForm(id); - return success(OsFormConvert.INSTANCE.convert(form)); + public CommonResult getForm(@RequestParam("id") Long id) { + WfForm form = formService.getForm(id); + return success(WfFormConvert.INSTANCE.convert(form)); } @GetMapping("/list") @ApiOperation("获得动态表单列表") @ApiImplicitParam(name = "ids", value = "编号列表", required = true, example = "1024,2048", dataTypeClass = List.class) @PreAuthorize("@ss.hasPermission('os:form:query')") - public CommonResult> getFormList(@RequestParam("ids") Collection ids) { - List list = formService.getFormList(ids); - return success(OsFormConvert.INSTANCE.convertList(list)); + public CommonResult> getFormList(@RequestParam("ids") Collection ids) { + List list = formService.getFormList(ids); + return success(WfFormConvert.INSTANCE.convertList(list)); } @GetMapping("/page") @ApiOperation("获得动态表单分页") @PreAuthorize("@ss.hasPermission('os:form:query')") - public CommonResult> getFormPage(@Valid OsFormPageReqVO pageVO) { - PageResult pageResult = formService.getFormPage(pageVO); - return success(OsFormConvert.INSTANCE.convertPage(pageResult)); + public CommonResult> getFormPage(@Valid WfFormPageReqVO pageVO) { + PageResult pageResult = formService.getFormPage(pageVO); + return success(WfFormConvert.INSTANCE.convertPage(pageResult)); } @GetMapping("/export-excel") @ApiOperation("导出动态表单 Excel") @PreAuthorize("@ss.hasPermission('os:form:export')") @OperateLog(type = EXPORT) - public void exportFormExcel(@Valid OsFormExportReqVO exportReqVO, + public void exportFormExcel(@Valid WfFormExportReqVO exportReqVO, HttpServletResponse response) throws IOException { - List list = formService.getFormList(exportReqVO); + List list = formService.getFormList(exportReqVO); // 导出 Excel - List datas = OsFormConvert.INSTANCE.convertList02(list); - ExcelUtils.write(response, "动态表单.xls", "数据", OsFormExcelVO.class, datas); + List datas = WfFormConvert.INSTANCE.convertList02(list); + ExcelUtils.write(response, "动态表单.xls", "数据", WfFormExcelVO.class, datas); } } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormBaseVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormBaseVO.java similarity index 96% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormBaseVO.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormBaseVO.java index 7868be836..b3fe5d871 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormBaseVO.java +++ b/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.*; * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 */ @Data -public class OsFormBaseVO { +public class WfFormBaseVO { @ApiModelProperty(value = "表单名称", required = true) @NotNull(message = "表单名称不能为空") diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormCreateReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormCreateReqVO.java similarity index 81% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormCreateReqVO.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormCreateReqVO.java index bd58aacf1..7f989a33c 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormCreateReqVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormCreateReqVO.java @@ -7,6 +7,6 @@ import io.swagger.annotations.*; @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class OsFormCreateReqVO extends OsFormBaseVO { +public class WfFormCreateReqVO extends WfFormBaseVO { } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExcelVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormExcelVO.java similarity index 95% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExcelVO.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormExcelVO.java index 0d2147c96..111c19e1e 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExcelVO.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormExcelVO.java @@ -11,7 +11,7 @@ import com.alibaba.excel.annotation.ExcelProperty; * @author 芋艿 */ @Data -public class OsFormExcelVO { +public class WfFormExcelVO { @ExcelProperty("表单编号") private Long id; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExportReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormExportReqVO.java similarity index 96% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExportReqVO.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormExportReqVO.java index bd68cd884..358a38821 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormExportReqVO.java +++ b/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_ @ApiModel(value = "动态表单 Excel 导出 Request VO", description = "参数和 OsFormPageReqVO 是一致的") @Data -public class OsFormExportReqVO { +public class WfFormExportReqVO { @ApiModelProperty(value = "表单名称") private String name; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormPageReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormPageReqVO.java similarity index 95% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormPageReqVO.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormPageReqVO.java index 0c9167bc0..8cbdc077f 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormPageReqVO.java +++ b/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_ @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class OsFormPageReqVO extends PageParam { +public class WfFormPageReqVO extends PageParam { @ApiModelProperty(value = "表单名称") private String name; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormRespVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormRespVO.java similarity index 89% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormRespVO.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormRespVO.java index adc63d31b..779284be5 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormRespVO.java +++ b/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.*; @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class OsFormRespVO extends OsFormBaseVO { +public class WfFormRespVO extends WfFormBaseVO { @ApiModelProperty(value = "表单编号", required = true) private Long id; diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormUpdateReqVO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormUpdateReqVO.java similarity index 88% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormUpdateReqVO.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/WfFormUpdateReqVO.java index daba1d922..4a3bf4e2d 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/controller/form/vo/OsFormUpdateReqVO.java +++ b/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.*; @Data @EqualsAndHashCode(callSuper = true) @ToString(callSuper = true) -public class OsFormUpdateReqVO extends OsFormBaseVO { +public class WfFormUpdateReqVO extends WfFormBaseVO { @ApiModelProperty(value = "表单编号", required = true) @NotNull(message = "表单编号不能为空") diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/OsFormConvert.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/WfFormConvert.java similarity index 53% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/OsFormConvert.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/WfFormConvert.java index 96bff877c..ad07fafe8 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/OsFormConvert.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/convert/form/WfFormConvert.java @@ -1,10 +1,10 @@ package cn.iocoder.yudao.adminserver.modules.activiti.convert.form; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormCreateReqVO; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormExcelVO; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormRespVO; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormUpdateReqVO; -import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormCreateReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExcelVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormRespVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormUpdateReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm; import cn.iocoder.yudao.framework.common.pojo.PageResult; import org.mapstruct.Mapper; import org.mapstruct.factory.Mappers; @@ -17,20 +17,20 @@ import java.util.List; * @author 芋艿 */ @Mapper -public interface OsFormConvert { +public interface WfFormConvert { - OsFormConvert INSTANCE = Mappers.getMapper(OsFormConvert.class); + WfFormConvert INSTANCE = Mappers.getMapper(WfFormConvert.class); - OsFormDO convert(OsFormCreateReqVO bean); + WfForm convert(WfFormCreateReqVO bean); - OsFormDO convert(OsFormUpdateReqVO bean); + WfForm convert(WfFormUpdateReqVO bean); - OsFormRespVO convert(OsFormDO bean); + WfFormRespVO convert(WfForm bean); - List convertList(List list); + List convertList(List list); - PageResult convertPage(PageResult page); + PageResult convertPage(PageResult page); - List convertList02(List list); + List convertList02(List list); } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/OsFormDO.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/OsFormDO.java deleted file mode 100644 index bb0e3b237..000000000 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/OsFormDO.java +++ /dev/null @@ -1,45 +0,0 @@ -package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form; - -import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import lombok.*; - -// 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 添加进去哈。 -/** - * 动态表单 DO - * - * @author 芋艿 - */ -@TableName("os_form") -@Data -@EqualsAndHashCode(callSuper = true) -@ToString(callSuper = true) -@Builder -@NoArgsConstructor -@AllArgsConstructor -public class OsFormDO extends BaseDO { - - /** - * 表单编号 - */ - @TableId - private Long id; - /** - * 表单名称 - */ - private String name; - /** - * 商户状态 - */ - private Integer status; - /** - * 表单JSON - */ - private String formJson; - /** - * 备注 - */ - private String remark; - -} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/WfForm.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/WfForm.java new file mode 100644 index 000000000..0fa276d76 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/WfForm.java @@ -0,0 +1,57 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import lombok.*; + +import java.util.List; + +/** + * 工作流的表单定义 + * 用于工作流的申请表单,需要动态配置的场景 + * + * @author 芋道源码 + */ +@TableName(value = "wf_form", autoResultMap = true) +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class WfForm extends BaseDO { + + /** + * 编号 + */ + @TableId + private Long id; + /** + * 表单名 + */ + private String name; + /** + * 状态 + */ + private Integer status; + /** + * 表单JSON + */ + private String formJson; + /** + * 表单配置 + * + * 目前直接将 https://github.com/JakHuang/form-generator 生成的 JSON 串,直接保存 + * 定义:https://github.com/JakHuang/form-generator/issues/46 + */ + @TableField(typeHandler = JacksonTypeHandler.class) + private List fields; + /** + * 备注 + */ + private String remark; + +} \ No newline at end of file diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/WfFormData.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/WfFormData.java new file mode 100644 index 000000000..507a26ec6 --- /dev/null +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/dataobject/form/WfFormData.java @@ -0,0 +1,55 @@ +package cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form; + +import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler; +import lombok.*; + +import java.util.List; +import java.util.Map; + +/** + * 工作流的表单结果 + * 用户每次填写工作流的申请表单时,会保存一条记录到该表】 + * + * @author 芋道源码 + */ +@TableName(value = "wf_form", autoResultMap = true) +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +@Builder +@NoArgsConstructor +@AllArgsConstructor +public class WfFormData extends BaseDO { + + /** + * 编号 + */ + private Long id; + /** + * 表单编号 + * + * 关联 {@link WfForm#getId()} + */ + private Long formId; + /** + * 状态 + */ + private Integer status; + /** + * 表单配置 + * + * 冗余 {@link WfForm#getFields()} + * 主要考虑,表单是可以修改的 + */ + @TableField(typeHandler = JacksonTypeHandler.class) + private List fields; + /** + * 表单值 + */ + @TableField(typeHandler = JacksonTypeHandler.class) + private Map values; + +} diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/mysql/form/OsFormMapper.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/mysql/form/WfFormMapper.java similarity index 77% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/mysql/form/OsFormMapper.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/mysql/form/WfFormMapper.java index 19acff215..99bb312fc 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/dal/mysql/form/OsFormMapper.java +++ b/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; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormExportReqVO; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormPageReqVO; -import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExportReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormPageReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm; import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX; import cn.iocoder.yudao.framework.mybatis.core.query.QueryWrapperX; @@ -15,13 +15,13 @@ import java.util.List; /** * 动态表单 Mapper * - * @author 芋艿 + * @author 风里雾里 */ @Mapper -public interface OsFormMapper extends BaseMapperX { +public interface WfFormMapper extends BaseMapperX { - default PageResult selectPage(OsFormPageReqVO reqVO) { - return selectPage(reqVO, new QueryWrapperX() + default PageResult selectPage(WfFormPageReqVO reqVO) { + return selectPage(reqVO, new QueryWrapperX() .likeIfPresent("name", reqVO.getName()) .eqIfPresent("status", reqVO.getStatus()) .eqIfPresent("form_json", reqVO.getFormJson()) @@ -30,8 +30,8 @@ public interface OsFormMapper extends BaseMapperX { .orderByDesc("id") ); } - default List selectList(OsFormExportReqVO reqVO) { - return selectList(new QueryWrapperX() + default List selectList(WfFormExportReqVO reqVO) { + return selectList(new QueryWrapperX() .likeIfPresent("name", reqVO.getName()) .eqIfPresent("status", reqVO.getStatus()) .eqIfPresent("form_json", reqVO.getFormJson()) diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/enums/form/FormErrorCodeConstants.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/enums/form/WfFormErrorCodeConstants.java similarity index 88% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/enums/form/FormErrorCodeConstants.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/enums/form/WfFormErrorCodeConstants.java index e0b961c00..a771441d1 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/enums/form/FormErrorCodeConstants.java +++ b/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; * 001 oa * activiti 系统,使用 1-003-000-000 段 */ -public interface FormErrorCodeConstants { +public interface WfFormErrorCodeConstants { ErrorCode FORM_NOT_EXISTS = new ErrorCode(1003001002, "动态表单不存在"); } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/OsFormService.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/WfFormService.java similarity index 72% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/OsFormService.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/WfFormService.java index 1691d412d..80f60631a 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/OsFormService.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/WfFormService.java @@ -1,10 +1,10 @@ package cn.iocoder.yudao.adminserver.modules.activiti.service.form; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormCreateReqVO; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormExportReqVO; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormPageReqVO; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormUpdateReqVO; -import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormCreateReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExportReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormPageReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormUpdateReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm; import cn.iocoder.yudao.framework.common.pojo.PageResult; import java.util.*; @@ -14,9 +14,9 @@ import javax.validation.*; /** * 动态表单 Service 接口 * - * @author 芋艿 + * TODO @风里雾里 */ -public interface OsFormService { +public interface WfFormService { /** * 创建动态表单 @@ -24,14 +24,14 @@ public interface OsFormService { * @param createReqVO 创建信息 * @return 编号 */ - Long createForm(@Valid OsFormCreateReqVO createReqVO); + Long createForm(@Valid WfFormCreateReqVO createReqVO); /** * 更新动态表单 * * @param updateReqVO 更新信息 */ - void updateForm(@Valid OsFormUpdateReqVO updateReqVO); + void updateForm(@Valid WfFormUpdateReqVO updateReqVO); /** * 删除动态表单 @@ -46,7 +46,7 @@ public interface OsFormService { * @param id 编号 * @return 动态表单 */ - OsFormDO getForm(Long id); + WfForm getForm(Long id); /** * 获得动态表单列表 @@ -54,7 +54,7 @@ public interface OsFormService { * @param ids 编号 * @return 动态表单列表 */ - List getFormList(Collection ids); + List getFormList(Collection ids); /** * 获得动态表单分页 @@ -62,7 +62,7 @@ public interface OsFormService { * @param pageReqVO 分页查询 * @return 动态表单分页 */ - PageResult getFormPage(OsFormPageReqVO pageReqVO); + PageResult getFormPage(WfFormPageReqVO pageReqVO); /** * 获得动态表单列表, 用于 Excel 导出 @@ -70,6 +70,6 @@ public interface OsFormService { * @param exportReqVO 查询条件 * @return 动态表单列表 */ - List getFormList(OsFormExportReqVO exportReqVO); + List getFormList(WfFormExportReqVO exportReqVO); } diff --git a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/OsFormServiceImpl.java b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/WfFormServiceImpl.java similarity index 68% rename from yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/OsFormServiceImpl.java rename to yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/WfFormServiceImpl.java index b0ab903b8..84f335050 100644 --- a/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/OsFormServiceImpl.java +++ b/yudao-admin-server/src/main/java/cn/iocoder/yudao/adminserver/modules/activiti/service/form/impl/WfFormServiceImpl.java @@ -1,13 +1,13 @@ package cn.iocoder.yudao.adminserver.modules.activiti.service.form.impl; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormCreateReqVO; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormExportReqVO; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormPageReqVO; -import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.OsFormUpdateReqVO; -import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.OsFormConvert; -import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.OsFormDO; -import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.form.OsFormMapper; -import cn.iocoder.yudao.adminserver.modules.activiti.service.form.OsFormService; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormCreateReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormExportReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormPageReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.controller.form.vo.WfFormUpdateReqVO; +import cn.iocoder.yudao.adminserver.modules.activiti.convert.form.WfFormConvert; +import cn.iocoder.yudao.adminserver.modules.activiti.dal.dataobject.form.WfForm; +import cn.iocoder.yudao.adminserver.modules.activiti.dal.mysql.form.WfFormMapper; +import cn.iocoder.yudao.adminserver.modules.activiti.service.form.WfFormService; import cn.iocoder.yudao.framework.common.pojo.PageResult; import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; @@ -16,36 +16,36 @@ import javax.annotation.Resource; import java.util.Collection; import java.util.List; -import static cn.iocoder.yudao.adminserver.modules.activiti.enums.form.FormErrorCodeConstants.FORM_NOT_EXISTS; +import static cn.iocoder.yudao.adminserver.modules.activiti.enums.form.WfFormErrorCodeConstants.FORM_NOT_EXISTS; import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; /** * 动态表单 Service 实现类 * - * @author 芋艿 // TODO @风里雾里:作者改成你自己哈 + * TODO @风里雾里 */ @Service @Validated -public class OsFormServiceImpl implements OsFormService { +public class WfFormServiceImpl implements WfFormService { @Resource - private OsFormMapper formMapper; + private WfFormMapper formMapper; @Override - public Long createForm(OsFormCreateReqVO createReqVO) { + public Long createForm(WfFormCreateReqVO createReqVO) { // 插入 - OsFormDO form = OsFormConvert.INSTANCE.convert(createReqVO); + WfForm form = WfFormConvert.INSTANCE.convert(createReqVO); formMapper.insert(form); // 返回 return form.getId(); } @Override - public void updateForm(OsFormUpdateReqVO updateReqVO) { + public void updateForm(WfFormUpdateReqVO updateReqVO) { // 校验存在 this.validateFormExists(updateReqVO.getId()); // 更新 - OsFormDO updateObj = OsFormConvert.INSTANCE.convert(updateReqVO); + WfForm updateObj = WfFormConvert.INSTANCE.convert(updateReqVO); formMapper.updateById(updateObj); } @@ -64,22 +64,22 @@ public class OsFormServiceImpl implements OsFormService { } @Override - public OsFormDO getForm(Long id) { + public WfForm getForm(Long id) { return formMapper.selectById(id); } @Override - public List getFormList(Collection ids) { + public List getFormList(Collection ids) { return formMapper.selectBatchIds(ids); } @Override - public PageResult getFormPage(OsFormPageReqVO pageReqVO) { + public PageResult getFormPage(WfFormPageReqVO pageReqVO) { return formMapper.selectPage(pageReqVO); } @Override - public List getFormList(OsFormExportReqVO exportReqVO) { + public List getFormList(WfFormExportReqVO exportReqVO) { return formMapper.selectList(exportReqVO); }