wangliang 1 жил өмнө
parent
commit
4ab49b75e5
17 өөрчлөгдсөн 1351 нэмэгдсэн , 101 устгасан
  1. 24 30
      sop-business/src/main/java/com/qmth/sop/business/bean/FormPropertyBean.java
  2. 274 0
      sop-business/src/main/java/com/qmth/sop/business/bean/result/FlowFormWidgetResult.java
  3. 211 0
      sop-business/src/main/java/com/qmth/sop/business/bean/result/FlowTablePropResult.java
  4. 111 0
      sop-business/src/main/java/com/qmth/sop/business/bean/result/FlowTdFormWidgetResult.java
  5. 43 0
      sop-business/src/main/java/com/qmth/sop/business/bean/result/FormWidgetResult.java
  6. 20 0
      sop-business/src/main/java/com/qmth/sop/business/cache/CommonCacheService.java
  7. 54 0
      sop-business/src/main/java/com/qmth/sop/business/cache/impl/CommonCacheServiceImpl.java
  8. 23 1
      sop-business/src/main/java/com/qmth/sop/business/entity/TDFormWidget.java
  9. 1 0
      sop-common/src/main/java/com/qmth/sop/common/contant/SystemConstant.java
  10. 2 2
      sop-common/src/main/java/com/qmth/sop/common/enums/WidgetCodeEnum.java
  11. 1 1
      sop-common/src/main/java/com/qmth/sop/common/enums/WidgetTypeEnum.java
  12. 64 35
      sop-server/src/main/java/com/qmth/sop/server/api/ActivitiFromHtmlController.java
  13. 213 1
      sop-server/src/main/java/com/qmth/sop/server/api/TDFormWidgetController.java
  14. 28 0
      sop-server/src/main/resources/inside_approve.form
  15. 28 0
      sop-server/src/main/resources/project.form
  16. 245 0
      sop-server/src/main/resources/start.form
  17. 9 31
      sop-server/src/main/resources/testform1.bpmn

+ 24 - 30
sop-business/src/main/java/com/qmth/sop/business/bean/FormPropertyBean.java

@@ -1,8 +1,8 @@
-package com.qmth.sop.business.bean.auth;
+package com.qmth.sop.business.bean;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
+import com.qmth.sop.business.bean.result.FlowFormWidgetResult;
 import io.swagger.annotations.ApiModelProperty;
-import org.activiti.engine.form.FormProperty;
 
 import java.io.Serializable;
 import java.util.List;
@@ -10,9 +10,15 @@ import java.util.List;
 @JsonInclude(JsonInclude.Include.NON_NULL)
 public class FormPropertyBean implements Serializable {
 
+    @ApiModelProperty(value = "流程名称")
+    String flowName;
+
     @ApiModelProperty(value = "流程id")
     String flowId;
 
+    @ApiModelProperty(value = "sopid")
+    String sopId;
+
     @ApiModelProperty(value = "流程任务id")
     String taskId;
 
@@ -22,48 +28,40 @@ public class FormPropertyBean implements Serializable {
     @ApiModelProperty(value = "taskKey")
     String taskDefinitionKey;
 
-    @ApiModelProperty(value = "流程id")
-    List<FormProperty> formProperty;
-
-    @ApiModelProperty(value = "html内容")
-    String htmlContent;
+    @ApiModelProperty(value = "动态表单")
+    List<FlowFormWidgetResult> formProperty;
 
     public FormPropertyBean() {
 
     }
 
-    public FormPropertyBean(String flowId, String taskId, List<FormProperty> formProperty) {
+    public FormPropertyBean(String flowId, String taskId, List<FlowFormWidgetResult> formProperty) {
         this.flowId = flowId;
         this.taskId = taskId;
         this.formProperty = formProperty;
     }
 
-    public FormPropertyBean(String flowId, String taskId, String htmlContent) {
+    public FormPropertyBean(String flowId, String taskId, String userId, List<FlowFormWidgetResult> formProperty) {
         this.flowId = flowId;
         this.taskId = taskId;
-        this.htmlContent = htmlContent;
+        this.userId = userId;
+        this.formProperty = formProperty;
     }
 
-    public FormPropertyBean(String flowId, String taskId, String userId, String taskDefinitionKey) {
-        this.flowId = flowId;
-        this.taskId = taskId;
-        this.userId = userId;
-        this.taskDefinitionKey = taskDefinitionKey;
+    public String getFlowName() {
+        return flowName;
     }
 
-    public FormPropertyBean(String flowId, String taskId, String userId, List<FormProperty> formProperty) {
-        this.flowId = flowId;
-        this.taskId = taskId;
-        this.userId = userId;
-        this.formProperty = formProperty;
+    public void setFlowName(String flowName) {
+        this.flowName = flowName;
     }
 
-    public String getHtmlContent() {
-        return htmlContent;
+    public String getSopId() {
+        return sopId;
     }
 
-    public void setHtmlContent(String htmlContent) {
-        this.htmlContent = htmlContent;
+    public void setSopId(String sopId) {
+        this.sopId = sopId;
     }
 
     public String getTaskDefinitionKey() {
@@ -74,10 +72,6 @@ public class FormPropertyBean implements Serializable {
         this.taskDefinitionKey = taskDefinitionKey;
     }
 
-    public FormPropertyBean(List<FormProperty> formProperty) {
-        this.formProperty = formProperty;
-    }
-
     public String getUserId() {
         return userId;
     }
@@ -102,11 +96,11 @@ public class FormPropertyBean implements Serializable {
         this.taskId = taskId;
     }
 
-    public List<FormProperty> getFormProperty() {
+    public List<FlowFormWidgetResult> getFormProperty() {
         return formProperty;
     }
 
-    public void setFormProperty(List<FormProperty> formProperty) {
+    public void setFormProperty(List<FlowFormWidgetResult> formProperty) {
         this.formProperty = formProperty;
     }
 }

+ 274 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/FlowFormWidgetResult.java

@@ -0,0 +1,274 @@
+package com.qmth.sop.business.bean.result;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import com.qmth.sop.common.enums.WidgetCodeEnum;
+import com.qmth.sop.common.enums.WidgetInputTypeEnum;
+import com.qmth.sop.common.enums.WidgetTypeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.List;
+import java.util.Objects;
+
+/**
+ * @Description: 表单控件result
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2023/7/18
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class FlowFormWidgetResult implements Serializable {
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "主键")
+    @TableId(value = "id")
+    private Long id;
+
+    @ApiModelProperty(value = "机构id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long orgId;
+
+    @ApiModelProperty(value = "编码,TEXT:文本,TEXTAREA:文本域,SELECT:下拉框,RADIO:单选框,CHECKBOX:复选框,DATE:日期,BUTTON:按钮,IMG:图片,VIDEO:视频,AUDIO:音频,FILE:文件,POP_SELECT:弹出选择框,LABEL:标签,TABLE:表格,OTHER:其它")
+    private WidgetCodeEnum code;
+
+    @ApiModelProperty(value = "类型,FORM:表单,TABLE:表格,OTHER:其它")
+    private WidgetTypeEnum type;
+
+    @ApiModelProperty(value = "表单id")
+    private String formId;
+
+    @ApiModelProperty(value = "表单名称")
+    private String formName;
+
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    @ApiModelProperty(value = "输入类型,STRING:字符串,INT:整型,LONG:长整型,DOUBLE:浮点型,ENUM:枚举,DATE:日期,BOOL:布尔,BIGDECIMAL:精确浮点")
+    private WidgetInputTypeEnum inputType;
+
+    @ApiModelProperty(value = "是否必填,0:非必填,1:必填")
+    private Boolean required;
+
+    @ApiModelProperty(value = "是否只读,0:非只读,1:只读")
+    private Boolean readable;
+
+    @ApiModelProperty(value = "是否可写,0:非可写,1:可写")
+    private Boolean writable;
+
+    @ApiModelProperty(value = "是否可见,0:不可见,1:可见")
+    private Boolean visable;
+
+    @ApiModelProperty(value = "保留小数点几位")
+    private Integer scale;
+
+    @ApiModelProperty(value = "长度")
+    private Integer length;
+
+    @ApiModelProperty(value = "绑定字段")
+    private String binding;
+
+    @ApiModelProperty(value = "控件用值")
+    private String value;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "数据来源")
+    private String dataGrid;
+
+    @ApiModelProperty(value = "提示")
+    private String tips;
+
+    @ApiModelProperty(value = "格式化")
+    private String format;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "表格信息")
+    private List<FlowTablePropResult> tablePropList;
+
+    public String getFormat() {
+        return format;
+    }
+
+    public void setFormat(String format) {
+        this.format = format;
+    }
+
+    public String getBinding() {
+        return binding;
+    }
+
+    public void setBinding(String binding) {
+        this.binding = binding;
+    }
+
+    public String getName() {
+        if (Objects.nonNull(this.code)) {
+            return this.code.getTitle();
+        } else {
+            return name;
+        }
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public List<FlowTablePropResult> getTablePropList() {
+        return tablePropList;
+    }
+
+    public void setTablePropList(List<FlowTablePropResult> tablePropList) {
+        this.tablePropList = tablePropList;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getOrgId() {
+        return orgId;
+    }
+
+    public void setOrgId(Long orgId) {
+        this.orgId = orgId;
+    }
+
+    public WidgetCodeEnum getCode() {
+        return code;
+    }
+
+    public void setCode(WidgetCodeEnum code) {
+        this.code = code;
+    }
+
+    public WidgetTypeEnum getType() {
+        return type;
+    }
+
+    public void setType(WidgetTypeEnum type) {
+        this.type = type;
+    }
+
+    public String getFormId() {
+        return formId;
+    }
+
+    public void setFormId(String formId) {
+        this.formId = formId;
+    }
+
+    public String getFormName() {
+        return formName;
+    }
+
+    public void setFormName(String formName) {
+        this.formName = formName;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public WidgetInputTypeEnum getInputType() {
+        return inputType;
+    }
+
+    public void setInputType(WidgetInputTypeEnum inputType) {
+        this.inputType = inputType;
+    }
+
+    public Boolean getRequired() {
+        return required;
+    }
+
+    public void setRequired(Boolean required) {
+        this.required = required;
+    }
+
+    public Boolean getReadable() {
+        return readable;
+    }
+
+    public void setReadable(Boolean readable) {
+        this.readable = readable;
+    }
+
+    public Boolean getWritable() {
+        return writable;
+    }
+
+    public void setWritable(Boolean writable) {
+        this.writable = writable;
+    }
+
+    public Boolean getVisable() {
+        return visable;
+    }
+
+    public void setVisable(Boolean visable) {
+        this.visable = visable;
+    }
+
+    public Integer getScale() {
+        return scale;
+    }
+
+    public void setScale(Integer scale) {
+        this.scale = scale;
+    }
+
+    public Integer getLength() {
+        return length;
+    }
+
+    public void setLength(Integer length) {
+        this.length = length;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getDataGrid() {
+        return dataGrid;
+    }
+
+    public void setDataGrid(String dataGrid) {
+        this.dataGrid = dataGrid;
+    }
+
+    public String getTips() {
+        return tips;
+    }
+
+    public void setTips(String tips) {
+        this.tips = tips;
+    }
+}

+ 211 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/FlowTablePropResult.java

@@ -0,0 +1,211 @@
+package com.qmth.sop.business.bean.result;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+
+/**
+ * @Description: 表单控件result
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2023/7/18
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class FlowTablePropResult implements Serializable {
+
+    @JsonSerialize(using = ToStringSerializer.class)
+    @ApiModelProperty(value = "主键")
+    @TableId(value = "id")
+    private Long id;
+
+    @ApiModelProperty(value = "控件id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long widgetId;
+
+    @ApiModelProperty(value = "序号")
+    private Integer tdIndex;
+
+    @ApiModelProperty(value = "列id")
+    private String tdId;
+
+    @ApiModelProperty(value = "列名称")
+    private String tdName;
+
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    @ApiModelProperty(value = "宽度")
+    private Double width;
+
+    @ApiModelProperty(value = "高度")
+    private Double height;
+
+    @ApiModelProperty(value = "颜色")
+    private String color;
+
+    @ApiModelProperty(value = "跨行")
+    private Integer rowspan;
+
+    @ApiModelProperty(value = "跨列")
+    private Integer colspan;
+
+    @ApiModelProperty(value = "提示")
+    private String tips;
+
+    @ApiModelProperty(value = "是否排序,0:不排序,1:排序")
+    private Boolean tdOrder;
+
+    @ApiModelProperty(value = "是否搜索,0:不搜索,1:搜索")
+    private Boolean tdSearch;
+
+    @ApiModelProperty(value = "编辑控件id")
+    @JsonSerialize(using = ToStringSerializer.class)
+    private Long editWidgetId;
+
+    @ApiModelProperty(value = "实体内容")
+    private String obj;
+
+    @ApiModelProperty(value = "列控件")
+    private FlowTdFormWidgetResult tdFormWidget;
+
+    public FlowTdFormWidgetResult getTdFormWidget() {
+        return tdFormWidget;
+    }
+
+    public void setTdFormWidget(FlowTdFormWidgetResult tdFormWidget) {
+        this.tdFormWidget = tdFormWidget;
+    }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public Long getWidgetId() {
+        return widgetId;
+    }
+
+    public void setWidgetId(Long widgetId) {
+        this.widgetId = widgetId;
+    }
+
+    public Integer getTdIndex() {
+        return tdIndex;
+    }
+
+    public void setTdIndex(Integer tdIndex) {
+        this.tdIndex = tdIndex;
+    }
+
+    public String getTdId() {
+        return tdId;
+    }
+
+    public void setTdId(String tdId) {
+        this.tdId = tdId;
+    }
+
+    public String getTdName() {
+        return tdName;
+    }
+
+    public void setTdName(String tdName) {
+        this.tdName = tdName;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public Double getWidth() {
+        return width;
+    }
+
+    public void setWidth(Double width) {
+        this.width = width;
+    }
+
+    public Double getHeight() {
+        return height;
+    }
+
+    public void setHeight(Double height) {
+        this.height = height;
+    }
+
+    public String getColor() {
+        return color;
+    }
+
+    public void setColor(String color) {
+        this.color = color;
+    }
+
+    public Integer getRowspan() {
+        return rowspan;
+    }
+
+    public void setRowspan(Integer rowspan) {
+        this.rowspan = rowspan;
+    }
+
+    public Integer getColspan() {
+        return colspan;
+    }
+
+    public void setColspan(Integer colspan) {
+        this.colspan = colspan;
+    }
+
+    public String getTips() {
+        return tips;
+    }
+
+    public void setTips(String tips) {
+        this.tips = tips;
+    }
+
+    public Boolean getTdOrder() {
+        return tdOrder;
+    }
+
+    public void setTdOrder(Boolean tdOrder) {
+        this.tdOrder = tdOrder;
+    }
+
+    public Boolean getTdSearch() {
+        return tdSearch;
+    }
+
+    public void setTdSearch(Boolean tdSearch) {
+        this.tdSearch = tdSearch;
+    }
+
+    public Long getEditWidgetId() {
+        return editWidgetId;
+    }
+
+    public void setEditWidgetId(Long editWidgetId) {
+        this.editWidgetId = editWidgetId;
+    }
+
+    public String getObj() {
+        return obj;
+    }
+
+    public void setObj(String obj) {
+        this.obj = obj;
+    }
+}

+ 111 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/FlowTdFormWidgetResult.java

@@ -0,0 +1,111 @@
+package com.qmth.sop.business.bean.result;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.qmth.sop.common.enums.WidgetCodeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * @Description: 表单控件result
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2023/7/18
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class FlowTdFormWidgetResult implements Serializable {
+
+    @ApiModelProperty(value = "编码,TEXT:文本,TEXTAREA:文本域,SELECT:下拉框,RADIO:单选框,CHECKBOX:复选框,DATE:日期,BUTTON:按钮,IMG:图片,VIDEO:视频,AUDIO:音频,FILE:文件,POP_SELECT:弹出选择框,LABEL:标签,TABLE:表格,OTHER:其它")
+    private WidgetCodeEnum code;
+
+    @ApiModelProperty(value = "绑定字段")
+    private String binding;
+
+    @ApiModelProperty(value = "控件用值")
+    private String value;
+
+    @ApiModelProperty(value = "备注")
+    private String remark;
+
+    @ApiModelProperty(value = "数据来源")
+    private String dataGrid;
+
+    @ApiModelProperty(value = "提示")
+    private String tips;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    @ApiModelProperty(value = "格式化")
+    private String format;
+
+    public String getFormat() {
+        return format;
+    }
+
+    public void setFormat(String format) {
+        this.format = format;
+    }
+
+    public String getBinding() {
+        return binding;
+    }
+
+    public void setBinding(String binding) {
+        this.binding = binding;
+    }
+
+    public String getName() {
+        if (Objects.nonNull(this.code)) {
+            return this.code.getTitle();
+        } else {
+            return name;
+        }
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public WidgetCodeEnum getCode() {
+        return code;
+    }
+
+    public void setCode(WidgetCodeEnum code) {
+        this.code = code;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getDataGrid() {
+        return dataGrid;
+    }
+
+    public void setDataGrid(String dataGrid) {
+        this.dataGrid = dataGrid;
+    }
+
+    public String getTips() {
+        return tips;
+    }
+
+    public void setTips(String tips) {
+        this.tips = tips;
+    }
+}

+ 43 - 0
sop-business/src/main/java/com/qmth/sop/business/bean/result/FormWidgetResult.java

@@ -0,0 +1,43 @@
+package com.qmth.sop.business.bean.result;
+
+import com.qmth.sop.common.enums.WidgetCodeEnum;
+import io.swagger.annotations.ApiModelProperty;
+
+import java.io.Serializable;
+import java.util.Objects;
+
+/**
+ * @Description: 表单控件result
+ * @Param:
+ * @return:
+ * @Author: wangliang
+ * @Date: 2023/7/18
+ */
+public class FormWidgetResult implements Serializable {
+
+    @ApiModelProperty(value = "编码,TEXT:文本,TEXTAREA:文本域,SELECT:下拉框,RADIO:单选框,CHECKBOX:复选框,DATE:日期,BUTTON:按钮,IMG:图片,VIDEO:视频,AUDIO:音频,FILE:文件,POP_SELECT:弹出选择框,LABEL:标签,TABLE:表格,OTHER:其它")
+    private WidgetCodeEnum code;
+
+    @ApiModelProperty(value = "名称")
+    private String name;
+
+    public WidgetCodeEnum getCode() {
+        return code;
+    }
+
+    public void setCode(WidgetCodeEnum code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        if (Objects.nonNull(code)) {
+            return code.getTitle();
+        } else {
+            return name;
+        }
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 20 - 0
sop-business/src/main/java/com/qmth/sop/business/cache/CommonCacheService.java

@@ -1,6 +1,7 @@
 package com.qmth.sop.business.cache;
 
 import com.qmth.sop.business.bean.auth.AuthBean;
+import com.qmth.sop.business.bean.result.FormWidgetResult;
 import com.qmth.sop.business.entity.*;
 import com.qmth.sop.common.enums.PrivilegePropertyEnum;
 
@@ -234,4 +235,23 @@ public interface CommonCacheService {
      * @param privilegePropertyEnum
      */
     public void removePrivilegeUrlCache(PrivilegePropertyEnum privilegePropertyEnum);
+
+    /**
+     * 添加控件缓存
+     *
+     * @return
+     */
+    public List<FormWidgetResult> formWidgetCache();
+
+    /**
+     * 修改控件缓存
+     *
+     * @return
+     */
+    public List<FormWidgetResult> updateFormWidgetCache();
+
+    /**
+     * 删除控件缓存
+     */
+    public void removeFormWidgetCache();
 }

+ 54 - 0
sop-business/src/main/java/com/qmth/sop/business/cache/impl/CommonCacheServiceImpl.java

@@ -1,8 +1,10 @@
 package com.qmth.sop.business.cache.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.google.gson.reflect.TypeToken;
 import com.qmth.boot.core.cache.service.CacheService;
 import com.qmth.sop.business.bean.auth.AuthBean;
+import com.qmth.sop.business.bean.result.FormWidgetResult;
 import com.qmth.sop.business.cache.CommonCacheService;
 import com.qmth.sop.business.entity.*;
 import com.qmth.sop.business.service.*;
@@ -11,6 +13,8 @@ import com.qmth.sop.common.enums.ExceptionResultEnum;
 import com.qmth.sop.common.enums.PrivilegeEnum;
 import com.qmth.sop.common.enums.PrivilegePropertyEnum;
 import com.qmth.sop.common.enums.RoleTypeEnum;
+import com.qmth.sop.common.util.GsonUtil;
+import com.qmth.sop.common.util.JacksonUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.context.annotation.Scope;
@@ -61,6 +65,9 @@ public class CommonCacheServiceImpl implements CommonCacheService {
     @Resource
     SysRolePrivilegeService sysRolePrivilegeService;
 
+    @Resource
+    TDFormWidgetService tdFormWidgetService;
+
     /**
      * 添加用户缓存
      *
@@ -479,6 +486,53 @@ public class CommonCacheServiceImpl implements CommonCacheService {
         cacheService.evict(SystemConstant.PRIVILEGE_URL_CACHE, privilegePropertyEnum.name());
     }
 
+    /**
+     * 添加控件缓存
+     *
+     * @return
+     */
+    @Override
+    public List<FormWidgetResult> formWidgetCache() {
+        return formWidgetCacheCommon();
+    }
+
+    /**
+     * 修改控件缓存
+     *
+     * @return
+     */
+    @Override
+    public List<FormWidgetResult> updateFormWidgetCache() {
+        cacheService.evict(SystemConstant.FORM_WIDGET_CACHE, SystemConstant.FORM_WIDGET_CACHE);
+        return formWidgetCacheCommon();
+    }
+
+    /**
+     * 删除控件缓存
+     */
+    @Override
+    public void removeFormWidgetCache() {
+        cacheService.evict(SystemConstant.FORM_WIDGET_CACHE, SystemConstant.FORM_WIDGET_CACHE);
+    }
+
+    /**
+     * 控件缓存共用
+     *
+     * @return
+     */
+    private List<FormWidgetResult> formWidgetCacheCommon() {
+        List<FormWidgetResult> formWidgetResultList = (List<FormWidgetResult>) cacheService.get(SystemConstant.FORM_WIDGET_CACHE, SystemConstant.FORM_WIDGET_CACHE);
+        if (CollectionUtils.isEmpty(formWidgetResultList)) {
+            List<TDFormWidget> tdFormWidgetList = tdFormWidgetService.list(new QueryWrapper<TDFormWidget>().select(" DISTINCT code "));
+            if (!CollectionUtils.isEmpty(tdFormWidgetList)) {
+                formWidgetResultList = GsonUtil.fromJson(JacksonUtil.parseJson(tdFormWidgetList), new TypeToken<List<FormWidgetResult>>() {
+                }.getType());
+                cacheService.put(SystemConstant.FORM_WIDGET_CACHE, SystemConstant.FORM_WIDGET_CACHE, formWidgetResultList);
+            }
+        }
+        return formWidgetResultList;
+    }
+
     /**
      * 鉴权url缓存共用
      *

+ 23 - 1
sop-business/src/main/java/com/qmth/sop/business/entity/TDFormWidget.java

@@ -29,7 +29,7 @@ public class TDFormWidget extends BaseEntity implements Serializable {
     @JsonSerialize(using = ToStringSerializer.class)
     private Long orgId;
 
-    @ApiModelProperty(value = "编码,TEXT:文本,TEXTAREA:文本域,SELECT:下拉框,RADIO:单选框,CHECKBOX:复选框,DATE:日期,BUTTON:按钮,IMG:图片,VIDEO:视频,AUDIO:音频,FILE:文件,POP_SELECT:弹出选择框,LABLE:标签,TABEL:表格,OTHER:其它")
+    @ApiModelProperty(value = "编码,TEXT:文本,TEXTAREA:文本域,SELECT:下拉框,RADIO:单选框,CHECKBOX:复选框,DATE:日期,BUTTON:按钮,IMG:图片,VIDEO:视频,AUDIO:音频,FILE:文件,POP_SELECT:弹出选择框,LABEL:标签,TABLE:表格,OTHER:其它")
     private WidgetCodeEnum code;
 
     @ApiModelProperty(value = "类型,FORM:表单,TABLE:表格,OTHER:其它")
@@ -68,6 +68,9 @@ public class TDFormWidget extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "长度")
     private Integer length;
 
+    @ApiModelProperty(value = "绑定字段")
+    private String binding;
+
     @ApiModelProperty(value = "控件用值")
     private String value;
 
@@ -80,6 +83,25 @@ public class TDFormWidget extends BaseEntity implements Serializable {
     @ApiModelProperty(value = "提示")
     private String tips;
 
+    @ApiModelProperty(value = "格式化")
+    private String format;
+
+    public String getFormat() {
+        return format;
+    }
+
+    public void setFormat(String format) {
+        this.format = format;
+    }
+
+    public String getBinding() {
+        return binding;
+    }
+
+    public void setBinding(String binding) {
+        this.binding = binding;
+    }
+
     public Long getOrgId() {
         return orgId;
     }

+ 1 - 0
sop-common/src/main/java/com/qmth/sop/common/contant/SystemConstant.java

@@ -76,6 +76,7 @@ public class SystemConstant {
     public static final String PRIVILEGE_URL_CACHE = "privilege:url:cache";
     public static final String ROLE_PRIVILEGE_CACHE = "role:privilege:cache";
     public static final String USER_ROLE_PRIVILEGE_CACHE = "user:role:privilege:cache";
+    public static final String FORM_WIDGET_CACHE = "form:widget:cache";
 
     /**
      * 鉴权

+ 2 - 2
sop-common/src/main/java/com/qmth/sop/common/enums/WidgetCodeEnum.java

@@ -33,9 +33,9 @@ public enum WidgetCodeEnum {
 
     POP_SELECT("弹出选择框"),
 
-    LABLE("标签"),
+    LABEL("标签"),
 
-    TABEL("表格"),
+    TABLE("表格"),
 
     OTHER("其它");
 

+ 1 - 1
sop-common/src/main/java/com/qmth/sop/common/enums/WidgetTypeEnum.java

@@ -11,7 +11,7 @@ public enum WidgetTypeEnum {
 
     FORM("表单"),
 
-    TABEL("表格"),
+    TABLE("表格"),
 
     OTHER("其它");
 

+ 64 - 35
sop-server/src/main/java/com/qmth/sop/server/api/ActivitiFromController.java → sop-server/src/main/java/com/qmth/sop/server/api/ActivitiFromHtmlController.java

@@ -1,35 +1,39 @@
 package com.qmth.sop.server.api;
 
-import com.qmth.sop.business.bean.auth.FormPropertyBean;
+import com.google.gson.reflect.TypeToken;
+import com.qmth.sop.business.bean.FormPropertyBean;
+import com.qmth.sop.business.bean.result.FlowFormWidgetResult;
 import com.qmth.sop.business.service.ActivitiConsumerService;
+import com.qmth.sop.common.util.GsonUtil;
 import com.qmth.sop.common.util.JacksonUtil;
 import io.swagger.annotations.*;
 import org.activiti.engine.FormService;
 import org.activiti.engine.RepositoryService;
 import org.activiti.engine.TaskService;
-import org.activiti.engine.form.FormProperty;
-import org.activiti.engine.form.StartFormData;
-import org.activiti.engine.form.TaskFormData;
 import org.activiti.engine.repository.DeploymentBuilder;
 import org.activiti.engine.runtime.ProcessInstance;
 import org.activiti.engine.task.Task;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.core.io.ClassPathResource;
 import org.springframework.util.CollectionUtils;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
+import java.io.IOException;
 import java.util.*;
+import java.util.zip.ZipInputStream;
 
-@Api(tags = "测试流程表单Controller")
+@Api(tags = "测试流程表单htmlController")
 @RestController
-@RequestMapping("/activiti/form")
-public class ActivitiFromController {
-    private final static Logger log = LoggerFactory.getLogger(ActivitiFromController.class);
+@RequestMapping("/activiti/form/html")
+public class ActivitiFromHtmlController {
+    private final static Logger log = LoggerFactory.getLogger(ActivitiFromHtmlController.class);
 
     @Resource
     private ActivitiConsumerService activitiConsumerService;
@@ -51,9 +55,15 @@ public class ActivitiFromController {
     @ApiOperation(value = "创建流程接口")
     @RequestMapping(value = "/createDeployment", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
-    public Map<String, Object> createDeployment() {
+    public Map<String, Object> createDeployment() throws IOException {
         DeploymentBuilder builder = repositoryService.createDeployment();
-        builder.addClasspathResource("testform1.bpmn");
+//        builder.addClasspathResource("testform3.bpmn");
+//        builder.addClasspathResource("start.form");
+//        builder.addClasspathResource("dept-leader-audit.form");
+        ClassPathResource resource = new ClassPathResource("testform3.zip");
+//        ClassPathResource resource = new ClassPathResource("testform4.zip");
+        ZipInputStream zip = new ZipInputStream(resource.getInputStream());
+        builder.addZipInputStream(zip);
         return getFlowStartFormData(builder.deploy().getId());
     }
 
@@ -68,10 +78,15 @@ public class ActivitiFromController {
     public Map<String, Object> getFlowStartFormData(@ApiParam(value = "部署流程id", required = true) @RequestParam String deploymentId) {
         Map<String, Object> map = new HashMap<>();
         String processDefinitionId = activitiConsumerService.findProcessDefinitionIdByDeploymentId(deploymentId);
-        StartFormData formData = formService.getStartFormData(processDefinitionId);
-        List<FormProperty> formProperties = formData.getFormProperties();
-        log.info("start formProperties:{}", JacksonUtil.parseJson(formProperties));
-        map.put("FormProperty", new FormPropertyBean(null, null, formProperties));
+//        ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().processDefinitionId(processDefinitionId).singleResult();
+//        boolean hasStartFormKey = processDefinition.hasStartFormKey();
+        Object o = formService.getRenderedStartForm(processDefinitionId);
+        if (Objects.nonNull(o)) {
+            log.info("start formProperties:{}", JacksonUtil.parseJson(o));
+            List<FlowFormWidgetResult> list = GsonUtil.fromJson(JacksonUtil.parseJson(o), new TypeToken<List<FlowFormWidgetResult>>() {
+            }.getType());
+            map.put("FormProperty", new FormPropertyBean(null, null, list));
+        }
         map.put("processDefinitionId", processDefinitionId);
         map.put("deploymentId", deploymentId);
         return map;
@@ -99,11 +114,15 @@ public class ActivitiFromController {
             for (Task t : taskList) {
                 String flowTaskId = t.getId();
                 String processInstanceId = t.getProcessInstanceId();
-                TaskFormData taskFormData = formService.getTaskFormData(flowTaskId);
-                List<FormProperty> formProperties = taskFormData.getFormProperties();
+                Object o = formService.getRenderedTaskForm(flowTaskId);
+//                List<FormProperty> formProperties = taskFormData.getFormProperties();
                 log.info("taskId:{},flowId:{}", flowTaskId, processInstanceId);
-                log.info("task formProperties:{}", JacksonUtil.parseJson(formProperties));
-                formPropertyList.add(new FormPropertyBean(processInstanceId, flowTaskId, t.getAssignee(), formProperties));
+                if (Objects.nonNull(o)) {
+                    log.info("task formProperties:{}", JacksonUtil.parseJson(o));
+                    List<FlowFormWidgetResult> list = GsonUtil.fromJson(JacksonUtil.parseJson(o), new TypeToken<List<FlowFormWidgetResult>>() {
+                    }.getType());
+                    formPropertyList.add(new FormPropertyBean(processInstanceId, flowTaskId, t.getAssignee(), list));
+                }
             }
             varMap.put("formProperties", formPropertyList);
         }
@@ -120,6 +139,7 @@ public class ActivitiFromController {
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
     public Map<String, Object> startActivityDemo(@ApiParam(value = "流程定义id", required = true) @RequestParam String processDefinitionId,
                                                  @ApiParam(value = "审批人id", required = true) @RequestParam String approveId,
+                                                 @ApiParam(value = "上传文件") @RequestParam(required = false) MultipartFile file,
                                                  HttpServletRequest request) {
         Map<String, Object> varMap = new HashMap<>();
         Map<String, String> formDataMap = new HashMap<>();
@@ -131,6 +151,7 @@ public class ActivitiFromController {
             formDataMap.put(key, value[0]);
         }
         varMap.putAll(formDataMap);
+
         ProcessInstance processInstance = formService.submitStartFormData(processDefinitionId, formDataMap);
         if (Objects.nonNull(processInstance)) {
             List<Task> taskList = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
@@ -139,11 +160,14 @@ public class ActivitiFromController {
                 for (Task t : taskList) {
                     String flowTaskId = t.getId();
                     String processInstanceId = t.getProcessInstanceId();
-                    TaskFormData taskFormData = formService.getTaskFormData(flowTaskId);
-                    List<FormProperty> formProperties = taskFormData.getFormProperties();
+                    Object o = formService.getRenderedTaskForm(flowTaskId);
                     log.info("flowTaskId:{},flowId:{}", flowTaskId, processInstanceId);
-                    log.info("task formProperties:{}", JacksonUtil.parseJson(formProperties));
-                    formPropertyList.add(new FormPropertyBean(processInstanceId, flowTaskId, formProperties));
+                    if (Objects.nonNull(o)) {
+                        log.info("task formProperties:{}", JacksonUtil.parseJson(o));
+                        List<FlowFormWidgetResult> list = GsonUtil.fromJson(JacksonUtil.parseJson(o), new TypeToken<List<FlowFormWidgetResult>>() {
+                        }.getType());
+                        formPropertyList.add(new FormPropertyBean(processInstanceId, flowTaskId, list));
+                    }
                 }
                 varMap.put("formProperties", formPropertyList);
             }
@@ -168,15 +192,16 @@ public class ActivitiFromController {
                 String flowTaskId = t.getId();
                 String processInstanceId = t.getProcessInstanceId();
                 String processDefinitionId = t.getProcessDefinitionId();
-                TaskFormData taskFormData = formService.getTaskFormData(flowTaskId);
-                List<FormProperty> formProperties = taskFormData.getFormProperties();
-                for (FormProperty f : formProperties) {
-                    log.info("datePattern:{}", f.getType().getInformation("datePattern"));
-                    log.info("values:{}", f.getType().getInformation("values"));
+                log.info("用户id:{},taskId:{},flowId:{},processDefinitionId:{},formKey:{}", userId, flowTaskId, processInstanceId, processDefinitionId, t.getFormKey());
+                if (Objects.nonNull(t.getFormKey())) {
+                    Object o = formService.getRenderedTaskForm(flowTaskId);
+                    if (Objects.nonNull(o)) {
+                        log.info("task formProperties:{}", JacksonUtil.parseJson(o));
+                        List<FlowFormWidgetResult> list = GsonUtil.fromJson(JacksonUtil.parseJson(o), new TypeToken<List<FlowFormWidgetResult>>() {
+                        }.getType());
+                        formPropertyList.add(new FormPropertyBean(processInstanceId, flowTaskId, userId, list));
+                    }
                 }
-                log.info("用户id:{},taskId:{},flowId:{},processDefinitionId:{}", userId, flowTaskId, processInstanceId, processDefinitionId);
-                log.info("task formProperties:{}", JacksonUtil.parseJson(formProperties));
-                formPropertyList.add(new FormPropertyBean(processInstanceId, flowTaskId, userId, formProperties));
                 varMap.put("formProperties", formPropertyList);
             }
         }
@@ -192,7 +217,8 @@ public class ActivitiFromController {
     @ApiOperation(value = "流程提交接口")
     @RequestMapping(value = "/complete", method = RequestMethod.POST)
     @ApiResponses({@ApiResponse(code = 200, message = "返回信息", response = Object.class)})
-    public Map<String, Object> complete(@ApiParam(value = "流程taskId", required = true) @RequestParam String taskId, HttpServletRequest request) {
+    public Map<String, Object> complete(@ApiParam(value = "流程taskId", required = true) @RequestParam String taskId,
+                                        @ApiParam(value = "上传文件") @RequestParam(required = false) MultipartFile[] files, HttpServletRequest request) {
         Task task = taskService.createTaskQuery().taskId(taskId).singleResult();
         Map<String, Object> varMap = new HashMap<>();
         Map<String, String> formDataMap = new HashMap<>();
@@ -213,11 +239,14 @@ public class ActivitiFromController {
             List<FormPropertyBean> formPropertyList = new LinkedList<>();
             for (Task t : taskList) {
                 String nextFlowTaskId = t.getId();
-                TaskFormData taskFormData = formService.getTaskFormData(nextFlowTaskId);
-                List<FormProperty> formProperties = taskFormData.getFormProperties();
+                Object o = formService.getRenderedTaskForm(nextFlowTaskId);
                 log.info("userId:{},taskId:{},flowId:{},processDefinitionId:{}", t.getAssignee(), nextFlowTaskId, processInstanceId, processDefinitionId);
-                log.info("task formProperties:{}", JacksonUtil.parseJson(formProperties));
-                formPropertyList.add(new FormPropertyBean(processInstanceId, nextFlowTaskId, formProperties));
+                if (Objects.nonNull(o)) {
+                    log.info("task formProperties:{}", JacksonUtil.parseJson(o));
+                    List<FlowFormWidgetResult> list = GsonUtil.fromJson(JacksonUtil.parseJson(o), new TypeToken<List<FlowFormWidgetResult>>() {
+                    }.getType());
+                    formPropertyList.add(new FormPropertyBean(processInstanceId, flowTaskId, t.getAssignee(), list));
+                }
                 varMap.put("formProperties", formPropertyList);
             }
         }

+ 213 - 1
sop-server/src/main/java/com/qmth/sop/server/api/TDFormWidgetController.java

@@ -1,16 +1,228 @@
 package com.qmth.sop.server.api;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.google.gson.reflect.TypeToken;
+import com.qmth.boot.api.annotation.Aac;
+import com.qmth.boot.api.annotation.BOOL;
 import com.qmth.boot.api.constant.ApiConstant;
+import com.qmth.sop.business.bean.result.FlowFormWidgetResult;
+import com.qmth.sop.business.bean.result.FlowTablePropResult;
+import com.qmth.sop.business.bean.result.FlowTdFormWidgetResult;
+import com.qmth.sop.business.cache.CommonCacheService;
+import com.qmth.sop.business.entity.TDFormWidget;
+import com.qmth.sop.business.entity.TDTableProp;
+import com.qmth.sop.business.service.TDFormWidgetService;
+import com.qmth.sop.business.service.TDTablePropService;
 import com.qmth.sop.common.contant.SystemConstant;
-import io.swagger.annotations.Api;
+import com.qmth.sop.common.enums.WidgetCodeEnum;
+import com.qmth.sop.common.enums.WidgetTypeEnum;
+import com.qmth.sop.common.util.GsonUtil;
+import com.qmth.sop.common.util.JacksonUtil;
+import com.qmth.sop.common.util.Result;
+import com.qmth.sop.common.util.ResultUtil;
+import io.swagger.annotations.*;
+import org.springframework.util.CollectionUtils;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.annotation.Resource;
+import java.util.*;
+import java.util.stream.Collectors;
+
 @Api(tags = "系统控件Controller")
 @RestController
 @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_WIDGET)
 @Validated
+@Aac(auth = BOOL.FALSE)
 public class TDFormWidgetController {
 
+    @Resource
+    CommonCacheService commonCacheService;
+
+    @Resource
+    TDFormWidgetService tdFormWidgetService;
+
+    @Resource
+    TDTablePropService tdTablePropService;
+
+    @ApiOperation(value = "控件查询列表")
+    @ApiResponses({@ApiResponse(code = 200, message = "控件查询列表信息", response = Object.class)})
+    @RequestMapping(value = "/list", method = RequestMethod.POST)
+    public Result list() {
+        return ResultUtil.ok(commonCacheService.formWidgetCache());
+    }
+
+    @ApiOperation(value = "流程控件查询")
+    @ApiResponses({@ApiResponse(code = 200, message = "流程控件查询", response = Object.class)})
+    @RequestMapping(value = "/flow/select", method = RequestMethod.POST)
+    public Result flowSelect(@ApiParam(value = "开始id", required = true) @RequestParam Long beginId,
+                             @ApiParam(value = "结束id", required = true) @RequestParam Long endId) {
+        List<TDFormWidget> tdFormWidgetList = tdFormWidgetService.list(new QueryWrapper<TDFormWidget>().lambda().ge(TDFormWidget::getId, beginId).le(TDFormWidget::getId, endId).eq(TDFormWidget::getType, WidgetTypeEnum.FORM));
+        List<FlowFormWidgetResult> flowFormWidgetResultList = null;
+        if (!CollectionUtils.isEmpty(tdFormWidgetList)) {
+            flowFormWidgetResultList = GsonUtil.fromJson(JacksonUtil.parseJson(tdFormWidgetList), new TypeToken<List<FlowFormWidgetResult>>() {
+            }.getType());
+            Set<FlowFormWidgetResult> flowFormWidgetResultSet = flowFormWidgetResultList.stream().filter(s -> s.getCode() == WidgetCodeEnum.TABLE).collect(Collectors.toSet());
+            if (!CollectionUtils.isEmpty(flowFormWidgetResultSet)) {
+                for (FlowFormWidgetResult f : flowFormWidgetResultSet) {
+                    List<TDTableProp> tdTablePropList = tdTablePropService.list(new QueryWrapper<TDTableProp>().lambda().eq(TDTableProp::getWidgetId, f.getId()));
+                    if (!CollectionUtils.isEmpty(tdTablePropList)) {
+                        List<FlowTablePropResult> flowTablePropResultList = GsonUtil.fromJson(JacksonUtil.parseJson(tdTablePropList), new TypeToken<List<FlowTablePropResult>>() {
+                        }.getType());
+                        for (FlowTablePropResult tf : flowTablePropResultList) {
+                            TDFormWidget tdFormWidget = tdFormWidgetService.getById(tf.getEditWidgetId());
+                            FlowTdFormWidgetResult flowTdFormWidgetResult = GsonUtil.fromJson(GsonUtil.toJson(tdFormWidget), FlowTdFormWidgetResult.class);
+                            tf.setTdFormWidget(flowTdFormWidgetResult);
+                        }
+                        f.setTablePropList(flowTablePropResultList);
+                    }
+                }
+            }
+        }
+        return ResultUtil.ok(flowFormWidgetResultList);
+    }
+
+    @ApiOperation(value = "测试客户类型列表")
+    @ApiResponses({@ApiResponse(code = 200, message = "客户类型列表信息", response = Object.class)})
+    @RequestMapping(value = "/custom/list", method = RequestMethod.POST)
+    public Result customList() {
+        List<Map> customListMap = new ArrayList<>();
+        Map map = new LinkedHashMap();
+        map.put("id", "1");
+        map.put("code", "jwc");
+        map.put("name", "教务处");
+        customListMap.add(map);
+
+        map = new LinkedHashMap();
+        map.put("id", "2");
+        map.put("code", "cloudMark");
+        map.put("name", "云阅卷");
+        customListMap.add(map);
+        return ResultUtil.ok(customListMap);
+    }
+
+    @ApiOperation(value = "测试派单客户经理")
+    @ApiResponses({@ApiResponse(code = 200, message = "测试派单客户经理", response = Object.class)})
+    @RequestMapping(value = "/crm/manager", method = RequestMethod.POST)
+    public Result crmManager() {
+        List<Map> crmManagerListMap = new ArrayList<>();
+        Map map = new LinkedHashMap();
+        map.put("id", "1");
+        map.put("login_name", "sysadmin");
+        map.put("real_name", "sysadmin");
+        map.put("role", "ADMIN");
+        map.put("roleName", "系统管理员");
+        crmManagerListMap.add(map);
+
+        map = new LinkedHashMap();
+        map.put("id", "2");
+        map.put("login_name", "admin1");
+        map.put("real_name", "admin1");
+        map.put("role", "SCHOOL_ADMIN");
+        map.put("roleName", "学校管理员");
+        crmManagerListMap.add(map);
+
+        map = new LinkedHashMap();
+        map.put("id", "3");
+        map.put("login_name", "cs1");
+        map.put("real_name", "cs1");
+        map.put("role", "TEACHER");
+        map.put("roleName", "测试打杂的1");
+        crmManagerListMap.add(map);
+
+        map = new LinkedHashMap();
+        map.put("id", "4");
+        map.put("login_name", "cs2");
+        map.put("real_name", "cs2");
+        map.put("role", "TEACHER");
+        map.put("roleName", "测试打杂的2");
+        crmManagerListMap.add(map);
+        return ResultUtil.ok(crmManagerListMap);
+    }
+
+    @ApiOperation(value = "测试客户名称")
+    @ApiResponses({@ApiResponse(code = 200, message = "测试客户名称", response = Object.class)})
+    @RequestMapping(value = "/school/list", method = RequestMethod.POST)
+    public Result schoolList() {
+        List<Map> schoolListMap = new ArrayList<>();
+        Map map = new LinkedHashMap();
+        map.put("id", "1");
+        map.put("code", "whdx");
+        map.put("name", "武汉大学");
+        schoolListMap.add(map);
+
+        map = new LinkedHashMap();
+        map.put("id", "2");
+        map.put("code", "hzkjdx");
+        map.put("name", "华中科技大学");
+        schoolListMap.add(map);
+        return ResultUtil.ok(schoolListMap);
+    }
+
+    @ApiOperation(value = "测试项目母单编号")
+    @ApiResponses({@ApiResponse(code = 200, message = "测试项目母单编号", response = Object.class)})
+    @RequestMapping(value = "/crm/parent_no/list", method = RequestMethod.POST)
+    public Result crmParentNoList() {
+        List<Map> crmParentNoListMap = new ArrayList<>();
+        Map map = new LinkedHashMap();
+        map.put("id", "1");
+        map.put("code", "CRM_000001");
+        map.put("name", "武汉大学数学学院2023上半年教务处印刷");
+        crmParentNoListMap.add(map);
+
+        map = new LinkedHashMap();
+        map.put("id", "2");
+        map.put("code", "CRM_000002");
+        map.put("name", "武汉大学物理学院2023上半年教务处印刷");
+        crmParentNoListMap.add(map);
+
+        map = new LinkedHashMap();
+        map.put("id", "3");
+        map.put("code", "CRM_000003");
+        map.put("name", "华中科技大学2023研究生云阅卷");
+        crmParentNoListMap.add(map);
+        return ResultUtil.ok(crmParentNoListMap);
+    }
+
+    @ApiOperation(value = "测试实施产品")
+    @ApiResponses({@ApiResponse(code = 200, message = "测试实施产品", response = Object.class)})
+    @RequestMapping(value = "/product/list", method = RequestMethod.POST)
+    public Result productList() {
+        List<Map> productListMap = new ArrayList<>();
+        Map map = new LinkedHashMap();
+        map.put("id", "1");
+        map.put("code", "QM_WHDX_SX_000001");
+        map.put("name", "武汉大学数学学院2023上半年教务处印刷");
+        productListMap.add(map);
+
+        map = new LinkedHashMap();
+        map.put("id", "2");
+        map.put("code", "QM_WHDX_WL_000002");
+        map.put("name", "武汉大学物理学院2023上半年教务处印刷");
+        productListMap.add(map);
+
+        map = new LinkedHashMap();
+        map.put("id", "3");
+        map.put("code", "QM_HZKJDX_CLOUD_MARK_000001");
+        map.put("name", "华中科技大学2023研究生云阅卷");
+        productListMap.add(map);
+        return ResultUtil.ok(productListMap);
+    }
+
+    @ApiOperation(value = "测试CRM信息")
+    @ApiResponses({@ApiResponse(code = 200, message = "测试CRM信息", response = Object.class)})
+    @RequestMapping(value = "/crm/info", method = RequestMethod.POST)
+    public Result crmInfo() {
+        Map map = new LinkedHashMap();
+        map.put("id", "1");
+        map.put("crm_child_no", "CRM_CHILD_000001");
+        map.put("exam_start_time", 1688194545000L);
+        map.put("exam_end_time", 1689663345000L);
+        map.put("remark", "测试CRM特殊要求及备注");
+        map.put("project_type", "测试CRM项目类型");
+        return ResultUtil.ok(map);
+    }
 }

+ 28 - 0
sop-server/src/main/resources/inside_approve.form

@@ -0,0 +1,28 @@
+<table border="1">
+	<tr>
+		<td>请假类型:</td>
+		<td>
+			<select id="leaveType" name="fp_leaveType">
+				<option>公休</option>
+				<option>病假</option>
+				<option>调休</option>
+				<option>事假</option>
+				<option>婚假</option>
+			</select>
+		</td>
+	</tr>
+	<tr>
+		<td>开始时间:</td>
+		<td><input type="text" id="startTime" name="fp_startTime" class="datetime required" /></td>
+	</tr>
+	<tr>
+		<td>结束时间:</td>
+		<td><input type="text" id="endTime" name="fp_endTime" class="datetime required" /></td>
+	</tr>
+	<tr>
+		<td>请假原因:</td>
+		<td>
+			<textarea id="reason" name="fp_reason"></textarea>
+		</td>
+	</tr>
+</table>

+ 28 - 0
sop-server/src/main/resources/project.form

@@ -0,0 +1,28 @@
+<table border="1">
+	<tr>
+		<td>请假类型:</td>
+		<td>
+			<select id="leaveType" name="fp_leaveType">
+				<option>公休</option>
+				<option>病假</option>
+				<option>调休</option>
+				<option>事假</option>
+				<option>婚假</option>
+			</select>
+		</td>
+	</tr>
+	<tr>
+		<td>开始时间:</td>
+		<td><input type="text" id="startTime" name="fp_startTime" class="datetime required" /></td>
+	</tr>
+	<tr>
+		<td>结束时间:</td>
+		<td><input type="text" id="endTime" name="fp_endTime" class="datetime required" /></td>
+	</tr>
+	<tr>
+		<td>请假原因:</td>
+		<td>
+			<textarea id="reason" name="fp_reason"></textarea>
+		</td>
+	</tr>
+</table>

+ 245 - 0
sop-server/src/main/resources/start.form

@@ -0,0 +1,245 @@
+[
+    {
+        "id": "1",
+        "createId": "1",
+        "createTime": 1,
+        "code": "TEXT",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "crm_child_no",
+        "formName": "crm_child_no",
+        "title": "项目子单编号",
+        "inputType": "STRING",
+        "required": false,
+        "readable": true,
+        "writable": false,
+        "visable": true,
+        "value": "crm_child_no",
+        "name": "文本"
+    },
+    {
+        "id": "2",
+        "createId": "1",
+        "createTime": 1,
+        "code": "SELECT",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "custom_type",
+        "formName": "custom_type",
+        "title": "客户类型",
+        "required": true,
+        "readable": false,
+        "writable": true,
+        "visable": true,
+        "dataGrid": "/api/admin/widget/custom/list",
+        "name": "下拉框"
+    },
+    {
+        "id": "3",
+        "createId": "1",
+        "createTime": 1,
+        "code": "POP_SELECT",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "crm_manager",
+        "formName": "crm_manager",
+        "title": "派单客户经理",
+        "required": true,
+        "readable": false,
+        "writable": true,
+        "visable": true,
+        "dataGrid": "/api/admin/widget/crm/manager",
+        "name": "弹出选择框"
+    },
+    {
+        "id": "4",
+        "createId": "1",
+        "createTime": 1,
+        "code": "SELECT",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "custom_name",
+        "formName": "custom_name",
+        "title": "客户名称",
+        "required": true,
+        "readable": false,
+        "writable": true,
+        "visable": true,
+        "dataGrid": "/api/admin/widget/school/list",
+        "name": "下拉框"
+    },
+    {
+        "id": "5",
+        "createId": "1",
+        "createTime": 1,
+        "code": "SELECT",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "crm_parent_no",
+        "formName": "crm_parent_no",
+        "title": "项目母单编号",
+        "required": false,
+        "readable": false,
+        "writable": true,
+        "visable": true,
+        "dataGrid": "/api/admin/widget/crm/parent_no/list",
+        "name": "下拉框"
+    },
+    {
+        "id": "6",
+        "createId": "1",
+        "createTime": 1,
+        "code": "TEXT",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "crm_name",
+        "formName": "crm_name",
+        "title": "项目名称",
+        "inputType": "STRING",
+        "required": true,
+        "readable": false,
+        "writable": true,
+        "visable": true,
+        "name": "文本"
+    },
+    {
+        "id": "7",
+        "createId": "1",
+        "createTime": 1,
+        "code": "TEXT",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "org_name",
+        "formName": "org_name",
+        "title": "学院分(子)机构",
+        "inputType": "STRING",
+        "required": true,
+        "readable": false,
+        "writable": true,
+        "visable": true,
+        "name": "文本"
+    },
+    {
+        "id": "8",
+        "createId": "1",
+        "createTime": 1,
+        "code": "SELECT",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "product",
+        "formName": "product",
+        "title": "实施产品",
+        "required": true,
+        "readable": false,
+        "writable": true,
+        "visable": true,
+        "dataGrid": "/api/admin/widget/product/list",
+        "name": "下拉框"
+    },
+    {
+        "id": "9",
+        "createId": "1",
+        "createTime": 1,
+        "code": "POP_SELECT",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "child_manager",
+        "formName": "child_manager",
+        "title": "子项目经理",
+        "required": true,
+        "readable": false,
+        "writable": true,
+        "visable": true,
+        "dataGrid": "/api/admin/widget/crm/manager",
+        "name": "弹出选择框"
+    },
+    {
+        "id": "10",
+        "createId": "1",
+        "createTime": 1,
+        "code": "LABEL",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "crm_info",
+        "formName": "crm_info",
+        "title": "派单信息",
+        "inputType": "STRING",
+        "required": false,
+        "readable": true,
+        "writable": false,
+        "visable": true,
+        "name": "标签"
+    },
+    {
+        "id": "11",
+        "createId": "1",
+        "createTime": 1,
+        "code": "TEXT",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "exam_start_time",
+        "formName": "exam_start_time",
+        "title": "考试开始时间",
+        "inputType": "STRING",
+        "required": false,
+        "readable": true,
+        "writable": false,
+        "visable": true,
+        "value": "exam_start_time",
+        "name": "文本"
+    },
+    {
+        "id": "12",
+        "createId": "1",
+        "createTime": 1,
+        "code": "TEXT",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "exam_end_time",
+        "formName": "exam_end_time",
+        "title": "考试结束时间",
+        "inputType": "STRING",
+        "required": false,
+        "readable": true,
+        "writable": false,
+        "visable": true,
+        "value": "exam_end_time",
+        "name": "文本"
+    },
+    {
+        "id": "13",
+        "createId": "1",
+        "createTime": 1,
+        "code": "TEXT",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "remark",
+        "formName": "remark",
+        "title": "特殊要求及备注",
+        "inputType": "STRING",
+        "required": false,
+        "readable": true,
+        "writable": false,
+        "visable": true,
+        "value": "remark",
+        "name": "文本"
+    },
+    {
+        "id": "14",
+        "createId": "1",
+        "createTime": 1,
+        "code": "TEXT",
+        "type": "FORM",
+        "fit": "COMMON",
+        "formId": "project_type",
+        "formName": "project_type",
+        "title": "项目类型",
+        "inputType": "STRING",
+        "required": false,
+        "readable": true,
+        "writable": false,
+        "visable": true,
+        "value": "project_type",
+        "name": "文本"
+    }
+]

+ 9 - 31
sop-server/src/main/resources/testform1.bpmn

@@ -1,50 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:tns="http://www.activiti.org/test" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test" id="m1626068475250" name="">
   <process id="myFormProcess_1" isExecutable="true" isClosed="false" processType="None">
-    <startEvent id="_2" name="开始">
-      <extensionElements>
-        <activiti:formProperty id="createId" name="发起人" type="string" required="true"></activiti:formProperty>
-        <activiti:formProperty id="createTime" name="发起日期" type="date"></activiti:formProperty>
-      </extensionElements>
-    </startEvent>
-    <userTask id="_3" name="提交审批" activiti:assignee="${approveId}">
-      <extensionElements>
-        <activiti:formProperty id="approver" name="是否同意" type="enum" required="true">
-          <activiti:value id="1" name="true"></activiti:value>
-          <activiti:value id="2" name="false"></activiti:value>
-        </activiti:formProperty>
-        <activiti:formProperty id="approverDate" name="审批日期" type="date"></activiti:formProperty>
-      </extensionElements>
-    </userTask>
-    <userTask id="_4" name="审批" activiti:assignee="${approveId}">
-      <extensionElements>
-        <activiti:formProperty id="days" name="天数" type="long" required="true"></activiti:formProperty>
-        <activiti:formProperty id="ok" name="同意" type="boolean"></activiti:formProperty>
-      </extensionElements>
-    </userTask>
+    <startEvent id="usertask_jwc_start" name="开始" activiti:formKey="start.form"></startEvent>
+    <userTask id="usertask_jwc_project" name="教务处sop_项目关键信息" activiti:assignee="${approveId}" activiti:formKey="project.form"></userTask>
+    <userTask id="usertask_jwc_inside_approve" name="教务处sop_内审" activiti:assignee="${approveId}" activiti:formKey="inside_approve.form"></userTask>
     <endEvent id="_5" name="结束"></endEvent>
-    <sequenceFlow id="_6" sourceRef="_2" targetRef="_3"></sequenceFlow>
-    <sequenceFlow id="_7" sourceRef="_3" targetRef="_4"></sequenceFlow>
-    <sequenceFlow id="_8" sourceRef="_4" targetRef="_5"></sequenceFlow>
+    <sequenceFlow id="_6" sourceRef="jwc_usertask_start" targetRef="usertask_jwc_project"></sequenceFlow>
+    <sequenceFlow id="_7" sourceRef="usertask_jwc_project" targetRef="usertask_jwc_inside_approve"></sequenceFlow>
+    <sequenceFlow id="_8" sourceRef="usertask_jwc_inside_approve" targetRef="_5"></sequenceFlow>
   </process>
   <bpmndi:BPMNDiagram id="BPMNDiagram_myFormProcess_1">
     <bpmndi:BPMNPlane bpmnElement="myFormProcess_1" id="BPMNPlane_myFormProcess_1">
-      <bpmndi:BPMNShape bpmnElement="_2" id="BPMNShape__2">
+      <bpmndi:BPMNShape bpmnElement="usertask_jwc_start" id="BPMNShape_usertask_jwc_start">
         <omgdc:Bounds height="35.0" width="35.0" x="240.0" y="15.0"></omgdc:Bounds>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="_3" id="BPMNShape__3">
+      <bpmndi:BPMNShape bpmnElement="usertask_jwc_project" id="BPMNShape_usertask_jwc_project">
         <omgdc:Bounds height="55.0" width="85.0" x="205.0" y="135.0"></omgdc:Bounds>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape bpmnElement="_4" id="BPMNShape__4">
+      <bpmndi:BPMNShape bpmnElement="usertask_jwc_inside_approve" id="BPMNShape_usertask_jwc_inside_approve">
         <omgdc:Bounds height="55.0" width="85.0" x="200.0" y="275.0"></omgdc:Bounds>
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape bpmnElement="_5" id="BPMNShape__5">
         <omgdc:Bounds height="35.0" width="35.0" x="230.0" y="480.0"></omgdc:Bounds>
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge bpmnElement="_6" id="BPMNEdge__6">
-        <omgdi:waypoint x="257.0" y="50.0"></omgdi:waypoint>
-        <omgdi:waypoint x="247.0" y="135.0"></omgdi:waypoint>
-      </bpmndi:BPMNEdge>
       <bpmndi:BPMNEdge bpmnElement="_7" id="BPMNEdge__7">
         <omgdi:waypoint x="247.0" y="190.0"></omgdi:waypoint>
         <omgdi:waypoint x="242.0" y="275.0"></omgdi:waypoint>