Browse Source

修改流程触发问题

v2
herenshan112 7 months ago
parent
commit
5ca3de3689
  1. 1
      api/version1/customerApp/appControll.go
  2. 10
      api/version1/customerform/formTable.go
  3. 9
      api/version1/dataCenter/runDataBase.go
  4. 28
      api/version1/taskplatform/taskmanagement/appControl.go
  5. 3
      api/version1/taskplatform/taskmanagement/formcontrol.go

1
api/version1/customerApp/appControll.go

@ -954,6 +954,7 @@ func (a *ApiMethod) CreateAppForm(c *gin.Context) {
// mastSql, _ := formJsonCont.CreateFormDatabaseTable()
// mastSql, _ := formJsonCont.DisassembleForm()
mastSql, _ := formJsonCont.CreateFormTable()
formVersion.TableStructure = mastSql //;default:'';comment:字表结构"`
}

10
api/version1/customerform/formTable.go

@ -281,8 +281,8 @@ func (c *CustomerFormMaster) CreateFormTable() (relevance string, err error) {
var tableFormSqlAry FormTableSql
tableFormSqlAry.TableSubUnitAnalysis(c.Form.Name, c.List, true, tableFieldList)
// jsonStr, _ := json.Marshal(tableFieldList)
// fmt.Printf("数据表-----》%v\n", string(jsonStr))
jsonStr, _ := json.Marshal(tableFieldList)
fmt.Printf("数据表-----》%v\n", string(jsonStr))
isSunForm := false
if len(tableFormSqlAry.MasterSql) <= 0 {
err = errors.New("没有主表!")
@ -294,7 +294,7 @@ func (c *CustomerFormMaster) CreateFormTable() (relevance string, err error) {
} else {
err = CreateForm(c.Form.Name, c.Form.FormName, "MyISAM", true)
}
// fmt.Printf("数据表--1---》%v\n", tableFormSqlAry.MasterSql)
fmt.Printf("数据表--1---》%v\n", tableFormSqlAry.MasterSql)
CreateFormFiled(c.Form.Name, c.Form.FormName, true, tableFormSqlAry.MasterSql) //添加主表字段
sunFormNameAry := make(map[string]string)
var sunTableNameAry []string
@ -476,6 +476,8 @@ func newFieldOld(tablename string, oldTable, alreadyExists []string) (sql []stri
sql = append(sql, fmt.Sprintf("ALTER TABLE `%v` ADD COLUMN %v int(1) unsigned NOT NULL DEFAULT '1' COMMENT '状态(1:启用,2:禁用;3:删除)';", tablename, v))
case "flowIsOpen":
sql = append(sql, fmt.Sprintf("ALTER TABLE `%v` ADD COLUMN %v int(1) unsigned NOT NULL DEFAULT '2' COMMENT '是否开启工作流';", tablename, v))
case "createrOrg":
sql = append(sql, fmt.Sprintf("ALTER TABLE `%v` ADD COLUMN %v int(1) unsigned NOT NULL DEFAULT '2' COMMENT '创建人行政组织';", tablename, v))
default:
}
}
@ -1571,7 +1573,7 @@ func (a *ApiMethod) GainFormPageListCont(c *gin.Context) {
for i, v := range formList {
formList[i]["isRetract"] = false
if mastrKey, ok := v["runFlowId"]; ok {
// fmt.Printf("masters_key----------->%v\n", v["masters_key"])
fmt.Printf("runFlowId------wrewrwerwerwerwe----->%v\n", v["runFlowId"])
mastrKeyInt, _ := publicmethod.StringToInt64(mastrKey)
if mastrKeyInt != 0 {
var runFlowInfo customerForm.RunWorkflow

9
api/version1/dataCenter/runDataBase.go

@ -1,6 +1,7 @@
package datacenter
import (
"appPlatform/overall"
"appPlatform/overall/publicmethod"
"fmt"
@ -54,11 +55,11 @@ func (a *ApiMethod) GainDataTable(c *gin.Context) {
}
tableInfo, err := requestData.ObtainDataBaseAllTableMysql()
fmt.Printf("tableInfo:%v\n", tableInfo)
// for _, v := range tableInfo {
for _, v := range tableInfo {
// if v.TableKey != "taskrecord" {
// sql := fmt.Sprintf("ALTER TABLE `%v` ADD COLUMN %v bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '是否开启工作流';", v.TableKey, "createrOrg")
// overall.CONSTANT_DB_CustomerForm.Exec(sql)
// }
sql := fmt.Sprintf("ALTER TABLE `%v` ADD COLUMN %v bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT '创建人行政组织';", v.TableKey, "createrOrg")
overall.CONSTANT_DB_CustomerForm.Exec(sql)
// }
}
publicmethod.Result(0, tableInfo, c)
}

28
api/version1/taskplatform/taskmanagement/appControl.go

@ -197,5 +197,33 @@ func (a *ApiMethod) CreateAppTask(c *gin.Context) {
sendData["sunFormName"] = sunFormName
sendData["mapData"] = mapData
//判断是否要发送信息
if formCont.ListJson != "" {
// var sendMsgInterface FormListInfo
// json.Unmarshal([]byte(formCont.ListJson), &sendMsgInterface)
// var sendMsgInfo SendMsgInfo
// sendMsgInfo = sendMsgInterface.SendMsg
// msgid, _ := sendMsgInfo.SendMsg(userCont, taskCont.Title, uuid, cureeTime, masterField, masrWriteMap, masterUnitList)
// fmt.Printf("发送返回信息------------->%v\n\n\n", msgid)
// if msgid != "" {
// //设定redis Key名称
// redisKey := fmt.Sprintf("SendMsg:Work_WeChat_%v", uuid)
// redisClient := grocerystore.RunRedis(overall.CONSTANT_REDIS3)
// redisClient.SetRedisTime(86400)
// redisClient.Set(redisKey, msgid)
// }
// sendConfig := sendMsgInterface.SendMsg
// if sendConfig.Open {
// msgTitle := taskCont.Title
// if len(sendConfig.Title) > 0 {
// }
// sendData["msgTitle"] = msgTitle
// switch sendConfig.SendRange {
// }
// }
}
publicmethod.Result(0, sendData, c)
}

3
api/version1/taskplatform/taskmanagement/formcontrol.go

@ -835,6 +835,9 @@ func (a *ApiMethod) AddCustomerForm(c *gin.Context) {
publicmethod.Result(107, err, c)
return
}
if appKey == 0 {
appKey = formCont.Groupid
}
var sunFormName []string //子表名称集合
if formCont.TableStructure != "" { //拆解获取子表名称
var sunFormStruct map[string]string

Loading…
Cancel
Save