23 changed files with 1529 additions and 30 deletions
@ -0,0 +1,22 @@ |
|||
let shenpi = { |
|||
"nodeNumber": "d1f460e7970e404e8894028ec5a434af", |
|||
"nodeName": "部门负责人", |
|||
"error": false, |
|||
"type": 1, |
|||
"settype": 3, |
|||
"selectMode": 0, |
|||
"selectRange": 0, |
|||
"directorLevel": 1, |
|||
"examineMode": 1, |
|||
"noHanderAction": 2, |
|||
"examineEndDirectorLevel": 1, |
|||
"childNode": {}, |
|||
"nodeUserList": [], |
|||
"fromNode": "61183cb9a0f24c3e942d5c037c26fea8", |
|||
"gotoNode": [ |
|||
"64f360f608024c09a986ab98269a01cd" |
|||
], |
|||
"sendBackNode": "beginnode", |
|||
"attribute": 1, |
|||
"customNode": "beginnode" |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
let zhixingren = { |
|||
"nodeNumber": "64f360f608024c09a986ab98269a01cd", |
|||
"nodeName": "被考核人", |
|||
"error": false, |
|||
"type": 3, |
|||
"settype": 7, |
|||
"selectMode": 0, |
|||
"selectRange": 0, |
|||
"directorLevel": 1, |
|||
"examineMode": 1, |
|||
"noHanderAction": 2, |
|||
"examineEndDirectorLevel": 1, |
|||
"childNode":{}, |
|||
"nodeUserList": [], |
|||
"fromNode": "d1f460e7970e404e8894028ec5a434af", |
|||
"gotoNode": [ |
|||
"53ce9a28c951427589c7b32c3d5c0eda" |
|||
], |
|||
"sendBackNode": "d1f460e7970e404e8894028ec5a434af", |
|||
"attribute": 1, |
|||
"customNode": "d1f460e7970e404e8894028ec5a434af" |
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
let chaosong ={ |
|||
"nodeNumber": "7c4db5b388a8406082a9f6a8163ab5b3", |
|||
"nodeName": "抄送人", |
|||
"type": 2, |
|||
"ccSelfSelectFlag": 1, |
|||
"childNode": null, |
|||
"nodeUserList": [], |
|||
"fromNode": "1216c7a2c16d4b869fbcf832c224ff7c", |
|||
"gotoNode": [ |
|||
"" |
|||
], |
|||
"error": false |
|||
|
|||
} |
|||
@ -0,0 +1,14 @@ |
|||
let tiaojian = { |
|||
"nodeNumber": "61183cb9a0f24c3e942d5c037c26fea8", |
|||
"nodeName": "条件1", |
|||
"error": false, |
|||
"type": 4, |
|||
"priorityLevel": 1, |
|||
"conditionList": [], |
|||
"nodeUserList": [], |
|||
"childNode": {}, |
|||
"fromNode": "1216c7a2c16d4b869fbcf832c224ff7c", |
|||
"gotoNode": [ |
|||
"d1f460e7970e404e8894028ec5a434af" |
|||
] |
|||
} |
|||
@ -0,0 +1,123 @@ |
|||
let conditionList= [ |
|||
{ |
|||
"id": 1, |
|||
"name": "申请人", |
|||
"factorid": "applicant", |
|||
"type": 1, |
|||
"isok": false, |
|||
"isCheckbox": true, |
|||
"options": [], |
|||
"answers": [], |
|||
"customFields": [], |
|||
"nodeUserList": [ |
|||
{ |
|||
"type": 2, |
|||
"targetId": "1", |
|||
"name": "超级管理员" |
|||
}, |
|||
{ |
|||
"type": 2, |
|||
"targetId": "3", |
|||
"name": "高管" |
|||
}, |
|||
{ |
|||
"type": 1, |
|||
"targetId": "16048852977430055", |
|||
"name": "张延考", |
|||
"icon": "http://wework.qpic.cn/wwhead/duc2TvpEgSTPk74IwG7Bs3cMoS8QicE4cibhM9m5qKoavN85KpHxtBr8fhWZADzdDpCgwkIQPvBdY/0", |
|||
"iconToBase64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAB4AGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaE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p9R+td/xtzmvmmPzhIsvmsGX+LdjFdvpfjnV4tOa3LrMw+VJpOWXj0749/WvKxGBblzQ69D1sNj0o8tTp1PR9T13T9Nyt1dxRybdwjLfMR7Dqa8w8Q+JJtYkKIvlW4bKr3PuaybmYyTzXFxIzycF5HOSSahA34aNgQehrpw+BhSd3qzlxGOnVVlogQfianyQVUdaFhZQCaIzumyf4R+td1uhxOZMR5a4HXvTF+Yk0Mc5xSr8q1dieZj8jpRVdpMGigd2VC26b6VOpwaKKESyR2ANIeVJNFFMRTKIVZm4QdTjk+wqKS6nEeY8Qxj7qqOfzoorNloSLUHCsl0hdGx8wGCPyxWpbmIRL9n2lR2B/nRRSjuOWwxROty7M4aFskDjj0FNV9rOe5NFFXFWIbuTJwnNBf5aKKsRUY5Yk0UUVBR//2Q==" |
|||
}, |
|||
{ |
|||
"type": 1, |
|||
"targetId": "16048851807127870", |
|||
"name": "徐新平", |
|||
"icon": "https://wework.qpic.cn/wwhead/duc2TvpEgSTPk74IwG7Bs68Uo3iaQiaXgQ8dES36Cc4iaDtt9mKcRiaMzACXYEt1Usw797DIIcrzibSk/0", |
|||
"iconToBase64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAB4AGQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWG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eHvEmueGohFpeoyxQA58l8On4Bs4/DFdzYfGXVYsC/021uF9YmMZ/wDZhXmvSnBcLWUsLTlujRYioup7nZ/Fvw7Pbh7kXNtL3jMe/H4iivDCoorH6hA1WLmXGbc0y+1NU5RaZki9kX/YzToz2rrSOdsd/GKTrIfUUp+9mm5xKaqxFyG4+SZWHHIqYk569KZOnmLjvTmPLH8qVrMGxr4HPUfWomGDn2qTGcE5zTSOQaZIxgQMnrTR0FOflsUnemUKBk06kB4pM4600xNDs44opvB5opiJUB+0O3UiMA/pT14NFFQih/VqYfv0UVRKHH71NdcnpRRUvcaE2kAUxugJ9D/SiikMjAzzW1o2kRXkDzTCRwGK4QgbcAHJ/MfrRRXBmlWdLDOUHZ6Hbl9OFTEKM1dElz4aczKYJEijcEqLhsEn0BA5zyR9D6ZMaeFr2R1Hn23JI++ew57UUV4kM0xKgtTsr4OkqrSWhBL4d1OKQqIA455VhjrjvRRRWkc5xDWy+7/gmH1On5n/2Q==" |
|||
}, |
|||
{ |
|||
"type": 3, |
|||
"targetId": "102", |
|||
"name": "企管部" |
|||
}, |
|||
{ |
|||
"type": 3, |
|||
"targetId": "104", |
|||
"name": "营销部" |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
"id": 2, |
|||
"name": "自定义字段", |
|||
"factorid": "customFields", |
|||
"type": 2, |
|||
"isok": false, |
|||
"isCheckbox": false, |
|||
"options": [], |
|||
"answers": [], |
|||
"customFields": [ |
|||
{ |
|||
"wordfield": "one", |
|||
"optType": "1", |
|||
"leftval": "5" |
|||
}, |
|||
{ |
|||
"wordfield": "qujian", |
|||
"optType": "6", |
|||
"leftval": "1", |
|||
"leftoptType": "1", |
|||
"rightoptType": "3", |
|||
"rightval": "10" |
|||
} |
|||
] |
|||
}, |
|||
{ |
|||
"id": 3, |
|||
"name": "单选框组(固定选项)", |
|||
"factorid": "dan1xuan3kuang1zu3gu4ding4xuan3xiang4", |
|||
"type": 3, |
|||
"isok": false, |
|||
"isCheckbox": false, |
|||
"options": [ |
|||
{ |
|||
"label": "男", |
|||
"value": "1" |
|||
}, |
|||
{ |
|||
"label": "女", |
|||
"value": "2" |
|||
} |
|||
], |
|||
"answers": [ |
|||
"2" |
|||
], |
|||
"customFields": [] |
|||
}, |
|||
{ |
|||
"id": 4, |
|||
"name": "多选框组", |
|||
"factorid": "checkbox1695712007255", |
|||
"type": 3, |
|||
"isok": false, |
|||
"isCheckbox": true, |
|||
"options": [ |
|||
{ |
|||
"label": "书", |
|||
"value": "1" |
|||
}, |
|||
{ |
|||
"label": "笔", |
|||
"value": "2" |
|||
}, |
|||
{ |
|||
"label": "墨", |
|||
"value": "3" |
|||
} |
|||
], |
|||
"answers": [ |
|||
"2", |
|||
"3" |
|||
], |
|||
"customFields": [] |
|||
} |
|||
] |
|||
@ -0,0 +1,28 @@ |
|||
let kjk={ |
|||
"nodeNumber": "178070847322345472", |
|||
"nodeName": "发起人", |
|||
"type": 0, |
|||
"fromNode": "", |
|||
"gotoNode": [ |
|||
"1216c7a2c16d4b869fbcf832c224ff7c" |
|||
], |
|||
"attribute": "", |
|||
"error": false, |
|||
"priorityLevel": 0, |
|||
"settype": 0, |
|||
"selectMode": 0, |
|||
"selectRange": 0, |
|||
"directorLevel": 0, |
|||
"examineMode": 0, |
|||
"noHanderAction": 0, |
|||
"examineEndDirectorLevel": 0, |
|||
"nodeUserList": null, |
|||
"ccSelfSelectFlag": 0, |
|||
"conditionList": null, |
|||
"childNode":{}, |
|||
"conditionNodes": null, |
|||
"sendBackNode": "", |
|||
"databasecondition": null, |
|||
"customNode": "", |
|||
"executionaddress": "" |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
let route = { |
|||
"nodeNumber": "1216c7a2c16d4b869fbcf832c224ff7c", |
|||
"nodeName": "路由", |
|||
"type": 5, |
|||
"childNode": {}, |
|||
"fromNode": "178070847322345472", |
|||
"gotoNode": [ |
|||
"7c4db5b388a8406082a9f6a8163ab5b3" |
|||
], |
|||
"conditionNodes": [] |
|||
} |
|||
@ -0,0 +1,103 @@ |
|||
package taskflow |
|||
|
|||
import "appPlatform/overall/publicmethod" |
|||
|
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2023-10-26 09:34:29 |
|||
@ 功能: 工作流结构体 |
|||
*/ |
|||
type FlowMainBody struct { |
|||
TableId string `json:"tableId"` //工作流识别吗
|
|||
WorkFlowDef WorkFlowDefInfo `json:"workFlowDef"` //工作流主体属性
|
|||
DirectorMaxLevel int `json:"directorMaxLevel"` //审批主管最大层级
|
|||
FlowPermission []FlowPermissionInfo `json:"flowPermission"` //流程发起人
|
|||
NodeConfig NodePublicInfo `json:"nodeConfig"` //节点信息内容
|
|||
} |
|||
|
|||
//工作流主体属性
|
|||
type WorkFlowDefInfo struct { |
|||
FormKey string `json:"formKey"` //关联操作ID
|
|||
publicmethod.PublicName //姓名
|
|||
} |
|||
|
|||
//人员;角色;行政组织;职务通用结构体
|
|||
type FlowPermissionInfo struct { |
|||
Types int `json:"type"` //1:人员;2:角色;3:行政组织;4:职务
|
|||
TargetId string `json:"targetId"` //相关内容识别符
|
|||
publicmethod.PublicName //相关内容名称
|
|||
Icon string `json:"icon"` //头像
|
|||
IconToBase64 string `json:"iconToBase64"` //头像Base64
|
|||
} |
|||
type NodePublicInfoES struct { |
|||
NodeNumber string `json:"nodeNumber"` //节点识别符
|
|||
NodeName string `json:"nodeName"` //节点名称
|
|||
Types int `json:"type"` //0:发起人;1:审批;2:抄送;3:执行人;4:条件;5:路由
|
|||
FromNode string `json:"fromNode"` //来源节点
|
|||
GotoNode []string `json:"gotoNode"` //流向节点
|
|||
PriorityLevel int `json:"priorityLevel"` // 条件优先级
|
|||
Attribute int `json:"attribute"` //属性 1:申请人为基线;2:目标人为基线
|
|||
Errors bool `json:"error"` //当前审批是否通过校验
|
|||
CcSelfSelectFlag int `json:"ccSelfSelectFlag"` //允许发起人自选抄送人(0:不允许;1:允许)
|
|||
NodeUserList []NodeUserListInfo `json:"nodeUserList"` //操作人
|
|||
ConditionList []ConditionListInfo `json:"conditionList"` //判断条件主体
|
|||
ChildNode *NodePublicInfo `json:"childNode"` //子节点
|
|||
} |
|||
|
|||
//节点通用内容
|
|||
type NodePublicInfo struct { |
|||
NodePublicInfoES |
|||
Settype int `json:"settype"` // 审批人设置 1:指定成员; 2:主管;3:行政岗位; 4:发起人自选; 5:发起人自己;6:连续多级主管;7:指定前置审批为本节点设置审批人;8:表单字段
|
|||
SelectMode int `json:"selectMode"` //审批人数 1选一个人 2选多个人
|
|||
SelectRange int `json:"selectRange"` //选择范围 1.全公司 2指定成员 2指定角色
|
|||
DirectorLevel int `json:"directorLevel"` //审批终点 最高层主管数
|
|||
ExamineMode int `json:"examineMode"` //多人审批时采用的审批方式 1:依次审批; 2:会签;3:非会签
|
|||
NoHanderAction int `json:"noHanderAction"` //审批人为空时 1自动审批通过/不允许发起 2转交给审核管理员
|
|||
ExamineEndDirectorLevel int `json:"examineEndDirectorLevel"` //审批终点 第n层主管
|
|||
SendBackNode string `json:"sendBackNode"` //退回哪个节点
|
|||
CustomNode string `json:"customNode"` //指定前置审批为本节点设置审批人
|
|||
|
|||
ConditionNodes []NodePublicInfoES `json:"conditionNodes"` //判断条件,当节点是路由时有效
|
|||
Executionaddress string `json:"executionaddress"` //第三方执行地址
|
|||
|
|||
ChildNode *NodePublicInfo `json:"childNode"` //子节点
|
|||
} |
|||
|
|||
//节点执行人
|
|||
type NodeUserListInfo struct { |
|||
FlowPermissionInfo |
|||
publicmethod.CommonId[string] |
|||
publicmethod.PublicName |
|||
Options []OptionsInfo `json:"options"` //可选项(用于关联表单使用)
|
|||
IsCheckbox bool `json:"isCheckbox"` //结果值多选
|
|||
} |
|||
|
|||
//可选项(用于关联表单使用)
|
|||
type OptionsInfo struct { |
|||
Label string `json:"label"` //名称
|
|||
Value string `json:"value"` //值
|
|||
} |
|||
|
|||
//判断条件主体
|
|||
type ConditionListInfo struct { |
|||
publicmethod.CommonId[int] //条件顺序
|
|||
publicmethod.PublicName //条件名称
|
|||
Factorid string `json:"factorid"` //条件识别字段
|
|||
Types int `json:"type"` //条件类型:1:人员、行政组织、角色;2:自定义字段;3:关联表单字段;
|
|||
Isok bool `json:"isok"` //页面渲染使用
|
|||
IsCheckbox bool `json:"isCheckbox"` //结果值多选
|
|||
Options []OptionsInfo `json:"options"` //可选项(用于关联表单使用)
|
|||
Answers []string `json:"answers"` //可选项锚定值(用于关联表单使用)
|
|||
CustomFields []CustomFieldsInfo `json:"customFields"` //自定义字段条件主体
|
|||
NodeUserList []FlowPermissionInfo `json:"nodeUserList"` //人员、行政组织、角色为条件主体
|
|||
} |
|||
|
|||
//自定义字段条件主体
|
|||
type CustomFieldsInfo struct { |
|||
Wordfield string `json:"wordfield"` //判断字段
|
|||
OptType string `json:"optType"` //判定方法(1:小于;2:大于;3:小于等于;4:等于;5:大于等于;6:介于两数之间;7:包含;8:不包含)
|
|||
LeftVal string `json:"leftval"` //左侧值
|
|||
LeftOptType string `json:"leftoptType"` //OptType值为6时;左侧判定方法
|
|||
RightOptType string `json:"rightoptType"` //OptType值为6时;右侧判定方法
|
|||
RightVal string `json:"rightval"` //OptType值为6时;右侧值
|
|||
} |
|||
@ -0,0 +1,451 @@ |
|||
package taskflow |
|||
|
|||
import ( |
|||
"appPlatform/models/modelAppPlatform" |
|||
"appPlatform/overall" |
|||
"appPlatform/overall/publicmethod" |
|||
"encoding/json" |
|||
"fmt" |
|||
"strconv" |
|||
"strings" |
|||
"time" |
|||
|
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
/* |
|||
* |
|||
@ 作者: 秦东 |
|||
@ 时间: 2023-10-26 11:36:54 |
|||
@ 功能: 写入工作流 |
|||
@ 参数 |
|||
|
|||
# |
|||
|
|||
@ 返回值 |
|||
|
|||
# |
|||
|
|||
@ 方法原型 |
|||
|
|||
# |
|||
*/ |
|||
func (a *ApiMethod) SaveFlowCont(c *gin.Context) { |
|||
var requestData FlowMainBody |
|||
err := c.ShouldBindJSON(&requestData) |
|||
if err != nil { |
|||
publicmethod.Result(100, err, c) |
|||
return |
|||
} |
|||
if requestData.NodeConfig.NodeNumber == "" { |
|||
publicmethod.Result(1, err, c, "工作流数据错误!请检查后再提交") |
|||
return |
|||
} |
|||
uuid := publicmethod.GetUUid(1) |
|||
if requestData.TableId != "" { |
|||
requestData.TableId = strconv.FormatInt(publicmethod.GetUUid(1), 10) |
|||
uuid, _ = strconv.ParseInt(requestData.TableId, 10, 64) |
|||
} |
|||
if requestData.DirectorMaxLevel == 0 { |
|||
requestData.DirectorMaxLevel = 4 |
|||
} |
|||
publicTime := time.Now().Unix() |
|||
var worfFlowMain modelAppPlatform.WorkFlow //工作流主体
|
|||
worfFlowMain.Id = uuid |
|||
worfFlowMain.Name = requestData.WorkFlowDef.Name |
|||
worfFlowMain.Describe = fmt.Sprintf("%v关联工作流", requestData.WorkFlowDef.Name) |
|||
worfFlowMain.OpenWechat = 1 |
|||
worfFlowMain.State = 1 |
|||
if requestData.WorkFlowDef.FormKey != "" { |
|||
formKey, _ := strconv.ParseInt(requestData.WorkFlowDef.FormKey, 10, 64) |
|||
worfFlowMain.FormKey = formKey |
|||
} |
|||
worfFlowMain.Time = publicTime |
|||
var numVal int64 |
|||
var flowVersion modelAppPlatform.WorkFlowVersion |
|||
overall.CONSTANT_DB_AppPlatform.Model(&flowVersion).Where("`key` = ?", uuid).Count(&numVal) |
|||
flowVersion.Key = uuid |
|||
flowVersion.Version = strconv.FormatInt(numVal+1, 10) |
|||
var isVersionNum int64 |
|||
overall.CONSTANT_DB_AppPlatform.Model(&flowVersion).Where("`state` = 1 AND `key` = ?", uuid).Count(&isVersionNum) |
|||
flowVersion.State = 1 |
|||
if isVersionNum > 0 { |
|||
flowVersion.State = 2 |
|||
} |
|||
flowVersion.Time = publicTime |
|||
jsonCont, _ := json.Marshal(requestData) |
|||
flowVersion.Content = string(jsonCont) |
|||
var userList []string |
|||
var orgList []string |
|||
isFormWrite := false |
|||
if len(requestData.FlowPermission) > 0 { |
|||
for _, v := range requestData.FlowPermission { |
|||
if v.Types == 3 { |
|||
// orgId, _ := strconv.ParseInt(v.TargetId, 10, 64)
|
|||
orgList = append(orgList, v.TargetId) |
|||
isFormWrite = true |
|||
} |
|||
if v.Types == 1 { |
|||
// userId, _ := strconv.ParseInt(v.TargetId, 10, 64)
|
|||
userList = append(userList, v.TargetId) |
|||
isFormWrite = true |
|||
} |
|||
} |
|||
} |
|||
|
|||
if isFormWrite { |
|||
var customerForm modelAppPlatform.CustomerForm |
|||
err = customerForm.GetCont(map[string]interface{}{"`id`": requestData.WorkFlowDef.FormKey}, "`permitstr`", "`userpermit`") |
|||
if err == nil { |
|||
saveData := publicmethod.MapOut[string]() |
|||
if len(orgList) > 0 { |
|||
if customerForm.PermitStr != "" { |
|||
oldOrgList := strings.Split(customerForm.PermitStr, ",") |
|||
orgNew := publicmethod.MergeStruct(orgList, oldOrgList) |
|||
saveData["permitstr"] = strings.Join(orgNew, ",") |
|||
flowVersion.OrgPermit = strings.Join(orgNew, ",") |
|||
} |
|||
} else { |
|||
flowVersion.OrgPermit = customerForm.PermitStr |
|||
} |
|||
if len(userList) > 0 { |
|||
if customerForm.UserPermit != "" { |
|||
oldUserList := strings.Split(customerForm.UserPermit, ",") |
|||
userNew := publicmethod.MergeStruct(userList, oldUserList) |
|||
saveData["userpermit"] = strings.Join(userNew, ",") |
|||
flowVersion.UserPermit = strings.Join(userNew, ",") |
|||
} |
|||
} else { |
|||
flowVersion.UserPermit = customerForm.UserPermit |
|||
} |
|||
saveData["flowkey"] = uuid |
|||
if len(saveData) > 0 { |
|||
saveData["edit_time"] = time.Now().Unix() |
|||
customerForm.EiteCont(map[string]interface{}{"`id`": requestData.WorkFlowDef.FormKey}, saveData) |
|||
} |
|||
} |
|||
} |
|||
|
|||
sendMap := publicmethod.MapOut[string]() |
|||
writeDb := overall.CONSTANT_DB_AppPlatform.Begin() |
|||
flowErr := writeDb.Create(&worfFlowMain).Error |
|||
versionErr := writeDb.Create(&flowVersion).Error |
|||
sendMap["flowErr"] = flowErr |
|||
sendMap["versionErr"] = versionErr |
|||
if flowErr == nil && versionErr == nil { |
|||
writeDb.Commit() |
|||
|
|||
} else { |
|||
writeDb.Rollback() |
|||
publicmethod.Result(104, sendMap, c) |
|||
} |
|||
publicmethod.Result(0, sendMap, c) |
|||
} |
|||
|
|||
/* |
|||
* |
|||
@ 作者: 秦东 |
|||
@ 时间: 2023-10-27 10:25:00 |
|||
@ 功能: 获取工作流内容 |
|||
@ 参数 |
|||
|
|||
# |
|||
|
|||
@ 返回值 |
|||
|
|||
# |
|||
|
|||
@ 方法原型 |
|||
|
|||
# |
|||
*/ |
|||
func (a *ApiMethod) GainFlowInfo(c *gin.Context) { |
|||
var requestData publicmethod.CommonId[string] |
|||
err := c.ShouldBindJSON(&requestData) |
|||
if err != nil || requestData.Id == "" { |
|||
publicmethod.Result(100, err, c) |
|||
return |
|||
} |
|||
var flowVersionInfo modelAppPlatform.FlowVersion |
|||
err = flowVersionInfo.GetCont(map[string]interface{}{"`id`": requestData.Id}, "`content`") |
|||
if err != nil && flowVersionInfo.Content == "" { |
|||
publicmethod.Result(104, err, c) |
|||
return |
|||
} |
|||
var flowVersionCont FlowMainBody |
|||
err = json.Unmarshal([]byte(flowVersionInfo.Content), &flowVersionCont) |
|||
if err != nil { |
|||
publicmethod.Result(104, err, c) |
|||
return |
|||
} |
|||
publicmethod.Result(0, flowVersionCont, c) |
|||
} |
|||
|
|||
/* |
|||
* |
|||
@ 作者: 秦东 |
|||
@ 时间: 2023-10-27 14:41:00 |
|||
@ 功能: 编辑工作流 |
|||
@ 参数 |
|||
|
|||
# |
|||
|
|||
@ 返回值 |
|||
|
|||
# |
|||
|
|||
@ 方法原型 |
|||
|
|||
# |
|||
*/ |
|||
func (a *ApiMethod) EditFlowCont(c *gin.Context) { |
|||
var requestData EditFlowInfo |
|||
err := c.ShouldBindJSON(&requestData) |
|||
if err != nil || requestData.Id == "" { |
|||
publicmethod.Result(100, err, c) |
|||
return |
|||
} |
|||
why := publicmethod.MapOut[string]() |
|||
why["`id`"] = requestData.Id |
|||
var flowVersionInfo modelAppPlatform.FlowVersion |
|||
err = flowVersionInfo.GetCont(why) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
var userList []string |
|||
var orgList []string |
|||
isFormWrite := false |
|||
if len(requestData.FlowInfo.FlowPermission) > 0 { |
|||
for _, v := range requestData.FlowInfo.FlowPermission { |
|||
if v.Types == 3 { |
|||
// orgId, _ := strconv.ParseInt(v.TargetId, 10, 64)
|
|||
orgList = append(orgList, v.TargetId) |
|||
isFormWrite = true |
|||
} |
|||
if v.Types == 1 { |
|||
// userId, _ := strconv.ParseInt(v.TargetId, 10, 64)
|
|||
userList = append(userList, v.TargetId) |
|||
isFormWrite = true |
|||
} |
|||
} |
|||
} |
|||
editInfo := publicmethod.MapOut[string]() |
|||
jsonCont, _ := json.Marshal(requestData.FlowInfo) |
|||
editInfo["`content`"] = jsonCont |
|||
editInfo["`time`"] = time.Now().Unix() |
|||
if isFormWrite { |
|||
var customerForm modelAppPlatform.CustomerForm |
|||
err = customerForm.GetCont(map[string]interface{}{"`id`": flowVersionInfo.FormKey}, "`permitstr`", "`userpermit`") |
|||
if err == nil { |
|||
saveData := publicmethod.MapOut[string]() |
|||
if len(orgList) > 0 { |
|||
if customerForm.PermitStr != "" { |
|||
oldOrgList := strings.Split(customerForm.PermitStr, ",") |
|||
orgNew := publicmethod.MergeStruct(orgList, oldOrgList) |
|||
saveData["permitstr"] = strings.Join(orgNew, ",") |
|||
editInfo["orgpermit"] = strings.Join(orgNew, ",") |
|||
} |
|||
} else { |
|||
editInfo["orgpermit"] = customerForm.PermitStr |
|||
} |
|||
if len(userList) > 0 { |
|||
if customerForm.UserPermit != "" { |
|||
oldUserList := strings.Split(customerForm.UserPermit, ",") |
|||
userNew := publicmethod.MergeStruct(userList, oldUserList) |
|||
saveData["userpermit"] = strings.Join(userNew, ",") |
|||
editInfo["userpermit"] = strings.Join(userNew, ",") |
|||
} |
|||
} else { |
|||
editInfo["userpermit"] = customerForm.UserPermit |
|||
} |
|||
if len(saveData) > 0 { |
|||
saveData["edit_time"] = time.Now().Unix() |
|||
customerForm.EiteCont(map[string]interface{}{"`id`": flowVersionInfo.FormKey}, saveData) |
|||
} |
|||
} |
|||
} |
|||
err = flowVersionInfo.EiteCont(why, editInfo) |
|||
if err != nil { |
|||
publicmethod.Result(106, err, c) |
|||
return |
|||
} |
|||
publicmethod.Result(0, err, c) |
|||
} |
|||
|
|||
/* |
|||
* |
|||
@ 作者: 秦东 |
|||
@ 时间: 2023-10-27 15:54:31 |
|||
@ 功能: 另存为新版 |
|||
@ 参数 |
|||
|
|||
# |
|||
|
|||
@ 返回值 |
|||
|
|||
# |
|||
|
|||
@ 方法原型 |
|||
|
|||
# |
|||
*/ |
|||
func (a *ApiMethod) SaveNewFlow(c *gin.Context) { |
|||
var requestData EditFlowInfo |
|||
err := c.ShouldBindJSON(&requestData) |
|||
if err != nil || requestData.Id == "" { |
|||
publicmethod.Result(100, err, c) |
|||
return |
|||
} |
|||
why := publicmethod.MapOut[string]() |
|||
why["`id`"] = requestData.Id |
|||
var flowVersionInfo modelAppPlatform.FlowVersion |
|||
err = flowVersionInfo.GetCont(why) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
uuid := flowVersionInfo.Key |
|||
publicTime := time.Now().Unix() |
|||
var numVal int64 |
|||
var flowVersion modelAppPlatform.WorkFlowVersion |
|||
overall.CONSTANT_DB_AppPlatform.Model(&flowVersion).Where("`key` = ?", uuid).Count(&numVal) |
|||
flowVersion.Key = uuid |
|||
flowVersion.Version = strconv.FormatInt(numVal+1, 10) |
|||
var isVersionNum int64 |
|||
overall.CONSTANT_DB_AppPlatform.Model(&flowVersion).Where("`state` = 1 AND `key` = ?", uuid).Count(&isVersionNum) |
|||
flowVersion.State = 1 |
|||
if isVersionNum > 0 { |
|||
flowVersion.State = 2 |
|||
} |
|||
flowVersion.Time = publicTime |
|||
jsonCont, _ := json.Marshal(requestData.FlowInfo) |
|||
flowVersion.Content = string(jsonCont) |
|||
var userList []string |
|||
var orgList []string |
|||
isFormWrite := false |
|||
if len(requestData.FlowInfo.FlowPermission) > 0 { |
|||
for _, v := range requestData.FlowInfo.FlowPermission { |
|||
if v.Types == 3 { |
|||
// orgId, _ := strconv.ParseInt(v.TargetId, 10, 64)
|
|||
orgList = append(orgList, v.TargetId) |
|||
isFormWrite = true |
|||
} |
|||
if v.Types == 1 { |
|||
// userId, _ := strconv.ParseInt(v.TargetId, 10, 64)
|
|||
userList = append(userList, v.TargetId) |
|||
isFormWrite = true |
|||
} |
|||
} |
|||
} |
|||
|
|||
if isFormWrite { |
|||
var customerForm modelAppPlatform.CustomerForm |
|||
err = customerForm.GetCont(map[string]interface{}{"`id`": flowVersionInfo.FormKey}, "`permitstr`", "`userpermit`") |
|||
if err == nil { |
|||
saveData := publicmethod.MapOut[string]() |
|||
if len(orgList) > 0 { |
|||
if customerForm.PermitStr != "" { |
|||
oldOrgList := strings.Split(customerForm.PermitStr, ",") |
|||
orgNew := publicmethod.MergeStruct(orgList, oldOrgList) |
|||
saveData["permitstr"] = strings.Join(orgNew, ",") |
|||
flowVersion.OrgPermit = strings.Join(orgNew, ",") |
|||
} |
|||
} else { |
|||
flowVersion.OrgPermit = customerForm.PermitStr |
|||
} |
|||
if len(userList) > 0 { |
|||
if customerForm.UserPermit != "" { |
|||
oldUserList := strings.Split(customerForm.UserPermit, ",") |
|||
userNew := publicmethod.MergeStruct(userList, oldUserList) |
|||
saveData["userpermit"] = strings.Join(userNew, ",") |
|||
flowVersion.UserPermit = strings.Join(userNew, ",") |
|||
} |
|||
} else { |
|||
flowVersion.UserPermit = customerForm.UserPermit |
|||
} |
|||
saveData["flowkey"] = uuid |
|||
if len(saveData) > 0 { |
|||
saveData["edit_time"] = time.Now().Unix() |
|||
customerForm.EiteCont(map[string]interface{}{"`id`": flowVersionInfo.FormKey}, saveData) |
|||
} |
|||
} |
|||
} |
|||
err = flowVersion.InSetCont() |
|||
if err != nil { |
|||
publicmethod.Result(104, err, c) |
|||
return |
|||
} |
|||
publicmethod.Result(0, err, c) |
|||
} |
|||
|
|||
/* |
|||
* |
|||
@ 作者: 秦东 |
|||
@ 时间: 2023-10-27 16:33:54 |
|||
@ 功能: 启用&禁用 |
|||
@ 参数 |
|||
|
|||
# |
|||
|
|||
@ 返回值 |
|||
|
|||
# |
|||
|
|||
@ 方法原型 |
|||
|
|||
# |
|||
*/ |
|||
func (a *ApiMethod) SwitchFlowVersion(c *gin.Context) { |
|||
var requestData SwitchFlowStatus |
|||
err := c.ShouldBindJSON(&requestData) |
|||
if err != nil || requestData.Id == "" { |
|||
publicmethod.Result(100, err, c) |
|||
return |
|||
} |
|||
if requestData.Status == 0 { |
|||
requestData.Status = 2 |
|||
} |
|||
why := publicmethod.MapOut[string]() |
|||
why["`id`"] = requestData.Id |
|||
var flowVersionInfo modelAppPlatform.FlowVersion |
|||
err = flowVersionInfo.GetCont(why) |
|||
if err != nil { |
|||
publicmethod.Result(107, err, c) |
|||
return |
|||
} |
|||
publicTime := time.Now().Unix() |
|||
var flowVersionCont modelAppPlatform.WorkFlowVersion |
|||
saveVersion := publicmethod.MapOut[string]() |
|||
saveVersion["`state`"] = requestData.Status |
|||
saveVersion["`time`"] = publicTime |
|||
var isVersionNum int64 |
|||
overall.CONSTANT_DB_AppPlatform.Model(&flowVersionCont).Where("`state` = 1 AND `key` = ?", flowVersionInfo.Key).Count(&isVersionNum) |
|||
if requestData.Status == 1 { |
|||
if isVersionNum < 1 { |
|||
err = flowVersionCont.EiteCont(why, saveVersion) |
|||
if err == nil { |
|||
var flowInfo modelAppPlatform.WorkFlow |
|||
err = flowInfo.EiteCont(map[string]interface{}{"`id`": flowVersionInfo.Key}, map[string]interface{}{"`state`": requestData.Status, "`time`": publicTime}) |
|||
} |
|||
} else { |
|||
err = flowVersionCont.EiteCont(map[string]interface{}{"`key`": flowVersionInfo.Key}, map[string]interface{}{"`state`": 2, "`time`": publicTime}) |
|||
if err == nil { |
|||
err = flowVersionCont.EiteCont(why, saveVersion) |
|||
} |
|||
} |
|||
} else { |
|||
err = flowVersionCont.EiteCont(why, saveVersion) |
|||
if isVersionNum <= 1 { |
|||
if err == nil { |
|||
var flowInfo modelAppPlatform.WorkFlow |
|||
err = flowInfo.EiteCont(map[string]interface{}{"`id`": flowVersionInfo.Key}, map[string]interface{}{"`state`": requestData.Status, "`time`": publicTime}) |
|||
} |
|||
} |
|||
} |
|||
if err != nil { |
|||
publicmethod.Result(104, err, c) |
|||
return |
|||
} |
|||
publicmethod.Result(0, err, c) |
|||
} |
|||
@ -0,0 +1,247 @@ |
|||
package taskflow |
|||
|
|||
import ( |
|||
"appPlatform/api/version1/customerform" |
|||
"appPlatform/models/modelAppPlatform" |
|||
"appPlatform/overall" |
|||
"appPlatform/overall/publicmethod" |
|||
"encoding/json" |
|||
"fmt" |
|||
"strconv" |
|||
|
|||
"github.com/gin-gonic/gin" |
|||
) |
|||
|
|||
/* |
|||
* |
|||
@ 作者: 秦东 |
|||
@ 时间: 2023-10-10 13:44:07 |
|||
@ 功能: 初始化工作流 |
|||
@ 参数 |
|||
|
|||
# |
|||
|
|||
@ 返回值 |
|||
|
|||
# |
|||
|
|||
@ 方法原型 |
|||
|
|||
# |
|||
*/ |
|||
func (a *ApiMethod) InitializeWorkFlow(c *gin.Context) { |
|||
var requestData publicmethod.PublicName |
|||
c.ShouldBindJSON(&requestData) |
|||
var workFlowStruct FlowStructIng |
|||
workFlowStruct.TableId = strconv.FormatInt(publicmethod.GetUUid(2), 10) |
|||
if requestData.Name != "" { |
|||
workFlowStruct.WorkFlowDef.Name = requestData.Name |
|||
} else { |
|||
workFlowStruct.WorkFlowDef.Name = "自定义工作流" |
|||
} |
|||
workFlowStruct.NodeConfig.NodeNumber = strconv.FormatInt(publicmethod.GetUUid(5), 10) |
|||
workFlowStruct.NodeConfig.NodeName = "发起人" |
|||
workFlowStruct.DirectorMaxLevel = 4 |
|||
workFlowStruct.NodeConfig.Attribute = 0 |
|||
// err := json.Unmarshal([]byte(jsonStrSmaill), &workFlowStruct)
|
|||
outData := publicmethod.MapOut[string]() |
|||
outData["workFlowStruct"] = workFlowStruct |
|||
// outData["err"] = err
|
|||
publicmethod.Result(0, workFlowStruct, c) |
|||
} |
|||
|
|||
/* |
|||
* |
|||
@ 作者: 秦东 |
|||
@ 时间: 2023-10-19 14:02:54 |
|||
@ 功能: 获取工作流版本列表 |
|||
@ 参数 |
|||
|
|||
# |
|||
|
|||
@ 返回值 |
|||
|
|||
# |
|||
|
|||
@ 方法原型 |
|||
|
|||
# |
|||
*/ |
|||
func (a *ApiMethod) GainFlowVersionList(c *gin.Context) { |
|||
var requestData publicmethod.CommonId[string] |
|||
err := c.ShouldBindJSON(&requestData) |
|||
if err != nil || requestData.Id == "" { |
|||
publicmethod.Result(10001, err, c) |
|||
return |
|||
} |
|||
var flowVersionList []modelAppPlatform.FlowVersion |
|||
err = overall.CONSTANT_DB_AppPlatform.Where("`state` IN ? AND `formkey` = ?", []int{1, 2}, requestData.Id).Find(&flowVersionList).Error |
|||
if err != nil || len(flowVersionList) < 1 { |
|||
publicmethod.Result(10001, err, c) |
|||
return |
|||
} |
|||
var sendList []SendSmaileFlowVersion |
|||
for _, v := range flowVersionList { |
|||
var sendCont SendSmaileFlowVersion |
|||
sendCont.Id = strconv.FormatInt(v.Id, 10) |
|||
sendCont.Version = v.Version |
|||
sendCont.State = v.State |
|||
sendCont.Key = strconv.FormatInt(v.Key, 10) |
|||
sendList = append(sendList, sendCont) |
|||
} |
|||
publicmethod.Result(0, sendList, c) |
|||
} |
|||
|
|||
/* |
|||
* |
|||
@ 作者: 秦东 |
|||
@ 时间: 2023-10-19 16:18:36 |
|||
@ 功能: 获取审批节点或条件节点 |
|||
@ 参数 |
|||
|
|||
# |
|||
|
|||
@ 返回值 |
|||
|
|||
# |
|||
|
|||
@ 方法原型 |
|||
|
|||
# |
|||
*/ |
|||
func (a *ApiMethod) GainNodeFactor(c *gin.Context) { |
|||
var requestData GainNodeFactor |
|||
err := c.ShouldBindJSON(&requestData) |
|||
if err != nil || requestData.Id == "" { |
|||
publicmethod.Result(100, err, c) |
|||
return |
|||
} |
|||
var customerFormCont modelAppPlatform.CustomerForm |
|||
err = customerFormCont.GetCont(map[string]interface{}{"`id`": requestData.Id}, "`tablename`") |
|||
if err != nil { |
|||
publicmethod.Result(106, err, c) |
|||
return |
|||
} |
|||
var customerFormVersionCont modelAppPlatform.CustomerFormVersion |
|||
err = customerFormVersionCont.GetCont(map[string]interface{}{"`tablekey`": customerFormCont.TableNames, "`status`": 1}, "`mastesformjson`") |
|||
if err != nil { |
|||
publicmethod.Result(106, err, c) |
|||
return |
|||
} |
|||
var sendList []SendFormNodeFactor |
|||
if customerFormVersionCont.MastesFormJson != "" { |
|||
var formJsonCont customerform.CustomerFormMaster |
|||
json.Unmarshal([]byte(customerFormVersionCont.MastesFormJson), &formJsonCont) |
|||
var unitList CustomerFormUnit |
|||
unitList.GetFormUnit(formJsonCont.Form.Name, formJsonCont.List, true) |
|||
|
|||
sendData := publicmethod.MapOut[string]() |
|||
// master, sunTable, jsonerr := taskmanagement.GainFormStruct(customerFormVersionCont.MastesFormJson)
|
|||
// if jsonerr != nil {
|
|||
// publicmethod.Result(104, err, c)
|
|||
// return
|
|||
// }
|
|||
if len(unitList.MasterInfo) > 0 { |
|||
var masterUnit []customerform.MasterStruct |
|||
for _, v := range unitList.MasterInfo { |
|||
if v.IsMaster { |
|||
masterUnit = v.Info |
|||
} |
|||
} |
|||
for _, v := range masterUnit { |
|||
var sendCont SendFormNodeFactor |
|||
if requestData.Types == 1 && publicmethod.IsInTrue[string](v.Type, []string{"expand-user"}) { |
|||
sendCont.Id = v.Name |
|||
sendCont.Name = v.Name |
|||
if v.Item.Label != "" { |
|||
sendCont.Name = v.Item.Label |
|||
} |
|||
sendList = append(sendList, sendCont) |
|||
} else if requestData.Types != 1 && publicmethod.IsInTrue[string](v.Type, []string{"radio", "checkbox", "select", "switch"}) { |
|||
sendCont.Id = v.Name |
|||
sendCont.Name = v.Name |
|||
if v.Type == "switch" { |
|||
jsonstr, _ := json.Marshal(v.Control) |
|||
fmt.Printf("------>%v\n", string(jsonstr)) |
|||
var optInfoOne customerform.OptionsStruct |
|||
optInfoOne.Label = "是" |
|||
optInfoOne.Value = v.Control.ActiveValue |
|||
sendCont.Options = append(sendCont.Options, optInfoOne) |
|||
var optInfoTwo customerform.OptionsStruct |
|||
optInfoTwo.Label = "否" |
|||
optInfoTwo.Value = v.Control.InactiveValue |
|||
sendCont.Options = append(sendCont.Options, optInfoTwo) |
|||
} else { |
|||
sendCont.Options = v.Options |
|||
} |
|||
if v.Type == "checkbox" { |
|||
sendCont.IsCheckbox = true |
|||
} |
|||
|
|||
if v.Item.Label != "" { |
|||
sendCont.Name = v.Item.Label |
|||
} |
|||
sendList = append(sendList, sendCont) |
|||
} |
|||
} |
|||
} |
|||
// sendData["master"] = master
|
|||
// sendData["sunTable"] = sunTable
|
|||
sendData["sendList"] = sendList |
|||
sendData["unitList"] = unitList |
|||
publicmethod.Result(0, sendList, c) |
|||
} |
|||
// publicmethod.Result(0, sendList, c)
|
|||
} |
|||
|
|||
// 获取表单组件
|
|||
func (f *CustomerFormUnit) GetFormUnit(tablename string, subUnitAry []customerform.MasterStruct, isMaster bool) { |
|||
if len(subUnitAry) > 0 { |
|||
var sqlAllAry []customerform.MasterStruct |
|||
for _, v := range subUnitAry { |
|||
switch v.Type { |
|||
case "flex", "table": |
|||
if len(v.List) > 0 { |
|||
f.GetFormUnit(v.Name, v.List, false) |
|||
} |
|||
case "grid", "tabs": |
|||
if len(v.Columns) > 0 { |
|||
for _, mv := range v.Columns { |
|||
f.GetFormUnit(tablename, mv.List, isMaster) |
|||
} |
|||
} |
|||
case "card", "div": |
|||
if len(v.List) > 0 { |
|||
f.GetFormUnit(tablename, v.List, isMaster) |
|||
} |
|||
default: |
|||
sqlAllAry = append(sqlAllAry, v) |
|||
|
|||
} |
|||
} |
|||
if len(sqlAllAry) > 0 { |
|||
if len(f.MasterInfo) > 0 { |
|||
isWrite := true |
|||
for sk, s := range f.MasterInfo { |
|||
if s.UnitKey == tablename { |
|||
f.MasterInfo[sk].Info = append(f.MasterInfo[sk].Info, sqlAllAry...) |
|||
isWrite = false |
|||
} |
|||
} |
|||
if isWrite { |
|||
var sunSqlInfo SunFormUnit |
|||
sunSqlInfo.UnitKey = tablename |
|||
sunSqlInfo.IsMaster = isMaster |
|||
sunSqlInfo.Info = sqlAllAry |
|||
f.MasterInfo = append(f.MasterInfo, sunSqlInfo) |
|||
} |
|||
} else { |
|||
var sunSqlInfo SunFormUnit |
|||
sunSqlInfo.UnitKey = tablename |
|||
sunSqlInfo.IsMaster = isMaster |
|||
sunSqlInfo.Info = sqlAllAry |
|||
f.MasterInfo = append(f.MasterInfo, sunSqlInfo) |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,65 @@ |
|||
package modelAppPlatform |
|||
|
|||
import ( |
|||
"appPlatform/overall" |
|||
"strings" |
|||
) |
|||
|
|||
// 工作流版本
|
|||
type FlowVersion struct { |
|||
Id int64 `json:"id" gorm:"column:id;type:bigint(20) unsigned;not null;comment:Id"` |
|||
Content string `json:"content" gorm:"column:content;type:longtext ;comment:关联部门"` |
|||
Version string `json:"version" gorm:"column:version;type:varchar(255) ;default:'';comment:维度"` |
|||
Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` |
|||
State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` |
|||
Key int64 `json:"key" gorm:"column:key;type:bigint(20) unsigned;default:0;not null;comment:标识符"` |
|||
Name string `json:"name" gorm:"column:name;type:varchar(255) ;default:'';comment:维度"` |
|||
Describe string `json:"describe" gorm:"column:describe;type:longtext ;comment:描述"` |
|||
OpenWechat int `json:"openwechat" gorm:"column:open_wechat;type:int(1) unsigned;default:1;not null;comment:是否开启企业微信通知及审批(1:无;2:开启通知;3:开启审批及通知)"` |
|||
FormKey int64 `json:"formkey" gorm:"column:formkey;type:bigint(20) unsigned;default:0;not null;comment:表单标识符"` |
|||
} |
|||
|
|||
func (FlowVersion *FlowVersion) TableName() string { |
|||
return "flow_version" |
|||
} |
|||
|
|||
// 编辑内容
|
|||
func (cont *FlowVersion) EiteCont(whereMap interface{}, saveData interface{}) (err error) { |
|||
err = overall.CONSTANT_DB_AppPlatform.Model(&cont).Where(whereMap).Updates(saveData).Error |
|||
return |
|||
} |
|||
|
|||
// 获取内容
|
|||
func (cont *FlowVersion) GetCont(whereMap interface{}, field ...string) (err error) { |
|||
gormDb := overall.CONSTANT_DB_AppPlatform.Model(&cont) |
|||
if len(field) > 0 { |
|||
fieldStr := strings.Join(field, ",") |
|||
gormDb = gormDb.Select(fieldStr) |
|||
} |
|||
gormDb = gormDb.Where(whereMap) |
|||
err = gormDb.First(&cont).Error |
|||
return |
|||
} |
|||
|
|||
// 根据条件获取总数
|
|||
func (cont *FlowVersion) CountCont(whereMap interface{}) (countId int64) { |
|||
overall.CONSTANT_DB_AppPlatform.Model(&cont).Where(whereMap).Count(&countId) |
|||
return |
|||
} |
|||
|
|||
// 读取全部信息
|
|||
func (cont *FlowVersion) ContMap(whereMap interface{}, field ...string) (countAry []FlowVersion, err error) { |
|||
gormDb := overall.CONSTANT_DB_AppPlatform.Model(&cont) |
|||
if len(field) > 0 { |
|||
fieldStr := strings.Join(field, ",") |
|||
gormDb = gormDb.Select(fieldStr) |
|||
} |
|||
err = gormDb.Where(whereMap).Find(&countAry).Error |
|||
return |
|||
} |
|||
|
|||
// 删除内容
|
|||
func (cont *FlowVersion) DelCont(whereMap interface{}) (err error) { |
|||
err = overall.CONSTANT_DB_AppPlatform.Where(whereMap).Delete(&cont).Error |
|||
return |
|||
} |
|||
@ -0,0 +1,68 @@ |
|||
package modelAppPlatform |
|||
|
|||
import ( |
|||
"appPlatform/overall" |
|||
"strings" |
|||
) |
|||
|
|||
// 工作流
|
|||
type WorkFlow struct { |
|||
Id int64 `json:"id" gorm:"primaryKey;column:id;type:bigint(20) unsigned;not null;comment:Id"` |
|||
Name string `json:"name" gorm:"column:name;type:varchar(255) ;default:'';comment:维度"` |
|||
Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` |
|||
Describe string `json:"describe" gorm:"column:describe;type:longtext ;comment:描述"` |
|||
State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` |
|||
OpenWechat int `json:"openwechat" gorm:"column:open_wechat;type:int(1) unsigned;default:1;not null;comment:是否开启企业微信通知及审批(1:无;2:开启通知;3:开启审批及通知)"` |
|||
FormKey int64 `json:"formkey" gorm:"column:formkey;type:bigint(20) unsigned;default:0;not null;comment:自定义表单ID"` |
|||
} |
|||
|
|||
func (WorkFlow *WorkFlow) TableName() string { |
|||
return "work_flow" |
|||
} |
|||
|
|||
// 写入内容
|
|||
func (cont *WorkFlow) InSetCont(whereMap interface{}, saveData interface{}) (err error) { |
|||
err = overall.CONSTANT_DB_AppPlatform.Create(cont).Error |
|||
return |
|||
} |
|||
|
|||
// 编辑内容
|
|||
func (cont *WorkFlow) EiteCont(whereMap interface{}, saveData interface{}) (err error) { |
|||
err = overall.CONSTANT_DB_AppPlatform.Model(&cont).Where(whereMap).Updates(saveData).Error |
|||
return |
|||
} |
|||
|
|||
// 获取内容
|
|||
func (cont *WorkFlow) GetCont(whereMap interface{}, field ...string) (err error) { |
|||
gormDb := overall.CONSTANT_DB_AppPlatform.Model(&cont) |
|||
if len(field) > 0 { |
|||
fieldStr := strings.Join(field, ",") |
|||
gormDb = gormDb.Select(fieldStr) |
|||
} |
|||
gormDb = gormDb.Where(whereMap) |
|||
err = gormDb.First(&cont).Error |
|||
return |
|||
} |
|||
|
|||
// 根据条件获取总数
|
|||
func (cont *WorkFlow) CountCont(whereMap interface{}) (countId int64) { |
|||
overall.CONSTANT_DB_AppPlatform.Model(&cont).Where(whereMap).Count(&countId) |
|||
return |
|||
} |
|||
|
|||
// 读取全部信息
|
|||
func (cont *WorkFlow) ContMap(whereMap interface{}, field ...string) (countAry []WorkFlow, err error) { |
|||
gormDb := overall.CONSTANT_DB_AppPlatform.Model(&cont) |
|||
if len(field) > 0 { |
|||
fieldStr := strings.Join(field, ",") |
|||
gormDb = gormDb.Select(fieldStr) |
|||
} |
|||
err = gormDb.Where(whereMap).Find(&countAry).Error |
|||
return |
|||
} |
|||
|
|||
// 删除内容
|
|||
func (cont *WorkFlow) DelCont(whereMap interface{}) (err error) { |
|||
err = overall.CONSTANT_DB_AppPlatform.Where(whereMap).Delete(&cont).Error |
|||
return |
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
package modelAppPlatform |
|||
|
|||
import ( |
|||
"appPlatform/overall" |
|||
"strings" |
|||
) |
|||
|
|||
// 工作流版本
|
|||
type WorkFlowVersion struct { |
|||
Id int64 `json:"id" gorm:"column:id;type:bigint(20) unsigned;not null;comment:Id"` |
|||
Content string `json:"content" gorm:"column:content;type:longtext ;comment:关联部门"` |
|||
Version string `json:"version" gorm:"column:version;type:varchar(255) ;default:'';comment:维度"` |
|||
Time int64 `json:"time" gorm:"column:time;type:bigint(20) unsigned;default:0;not null;comment:写入时间"` |
|||
State int `json:"state" gorm:"column:state;type:int(1) unsigned;default:1;not null;comment:状态(1:启用;2:禁用;3:删除)"` |
|||
Key int64 `json:"key" gorm:"column:key;type:bigint(20) unsigned;default:0;not null;comment:标识符"` |
|||
UserPermit string `json:"userpermit" gorm:"column:userpermit;type:mediumtext;default:'';comment:授权范围"` |
|||
OrgPermit string `json:"orgpermit" gorm:"column:orgpermit;type:mediumtext;default:'';comment:授权范围"` |
|||
RolePermit string `json:"rolepermit" gorm:"column:rolepermit;type:mediumtext;default:'';comment:授权范围"` |
|||
PostPermit string `json:"postpermit" gorm:"column:postpermit;type:mediumtext;default:'';comment:授权范围"` |
|||
} |
|||
|
|||
func (WorkFlowVersion *WorkFlowVersion) TableName() string { |
|||
return "work_flow_version" |
|||
} |
|||
|
|||
// 写入内容
|
|||
func (cont *WorkFlowVersion) InSetCont() (err error) { |
|||
err = overall.CONSTANT_DB_AppPlatform.Create(cont).Error |
|||
return |
|||
} |
|||
|
|||
// 编辑内容
|
|||
func (cont *WorkFlowVersion) EiteCont(whereMap interface{}, saveData interface{}) (err error) { |
|||
err = overall.CONSTANT_DB_AppPlatform.Model(&cont).Where(whereMap).Updates(saveData).Error |
|||
return |
|||
} |
|||
|
|||
// 获取内容
|
|||
func (cont *WorkFlowVersion) GetCont(whereMap interface{}, field ...string) (err error) { |
|||
gormDb := overall.CONSTANT_DB_AppPlatform.Model(&cont) |
|||
if len(field) > 0 { |
|||
fieldStr := strings.Join(field, ",") |
|||
gormDb = gormDb.Select(fieldStr) |
|||
} |
|||
gormDb = gormDb.Where(whereMap) |
|||
err = gormDb.First(&cont).Error |
|||
return |
|||
} |
|||
|
|||
// 根据条件获取总数
|
|||
func (cont *WorkFlowVersion) CountCont(whereMap interface{}) (countId int64) { |
|||
overall.CONSTANT_DB_AppPlatform.Model(&cont).Where(whereMap).Count(&countId) |
|||
return |
|||
} |
|||
|
|||
// 读取全部信息
|
|||
func (cont *WorkFlowVersion) ContMap(whereMap interface{}, field ...string) (countAry []WorkFlowVersion, err error) { |
|||
gormDb := overall.CONSTANT_DB_AppPlatform.Model(&cont) |
|||
if len(field) > 0 { |
|||
fieldStr := strings.Join(field, ",") |
|||
gormDb = gormDb.Select(fieldStr) |
|||
} |
|||
err = gormDb.Where(whereMap).Find(&countAry).Error |
|||
return |
|||
} |
|||
|
|||
// 删除内容
|
|||
func (cont *WorkFlowVersion) DelCont(whereMap interface{}) (err error) { |
|||
err = overall.CONSTANT_DB_AppPlatform.Where(whereMap).Delete(&cont).Error |
|||
return |
|||
} |
|||
Loading…
Reference in new issue