Browse Source

测试上传

pull/1/head
超级管理员 4 years ago
parent
commit
c9f1b19881
  1. 220
      gin_server_admin/api/v1/archiveapi/archiveapihandle.go
  2. 6
      gin_server_admin/api/v1/archiveapi/enter.go
  3. 147
      gin_server_admin/api/v1/archiveapi/graphicinformation.go
  4. 73
      gin_server_admin/api/v1/archiveapi/requestdata.go
  5. 16
      gin_server_admin/api/v1/enter.go
  6. 8
      gin_server_admin/api/v1/examtestpage/healthreportstat.go
  7. 5
      gin_server_admin/api/v1/fileuploaddownload/enter.go
  8. 288
      gin_server_admin/api/v1/fileuploaddownload/fileuploaddown.go
  9. 711
      gin_server_admin/api/v1/shiyan/shiyan.go
  10. 11
      gin_server_admin/commonus/calculate_pages.go
  11. 19
      gin_server_admin/commonus/mapOutput.go
  12. 32
      gin_server_admin/commonus/publichaneld.go
  13. 6
      gin_server_admin/commonus/publicstruct.go
  14. 369
      gin_server_admin/conf/forkflow.json
  15. 14
      gin_server_admin/config.yaml
  16. 2
      gin_server_admin/config/config.go
  17. 1
      gin_server_admin/global/global.go
  18. 2
      gin_server_admin/initialize/gorm.go
  19. 16
      gin_server_admin/initialize/router.go
  20. 6
      gin_server_admin/main.go
  21. 39
      gin_server_admin/model/approvalprocess/approval_process.go
  22. 120
      gin_server_admin/model/archivesmodel/archives.go
  23. 33
      gin_server_admin/router/archive/archiverouter.go
  24. 5
      gin_server_admin/router/archive/enter.go
  25. 16
      gin_server_admin/router/enter.go
  26. 4
      gin_server_admin/router/shiyan/sys_shiyan.go
  27. 5
      gin_server_admin/router/uploaddownload/enter.go
  28. 19
      gin_server_admin/router/uploaddownload/fileuplaoddown.go
  29. 99
      gin_server_admin/shenpi-2.xml
  30. 527
      gin_server_admin/shenpi-5.json
  31. 501
      gin_server_admin/shenpi.json
  32. 347
      gin_server_admin/shenpi1.json
  33. 2
      gin_server_admin/shipi-4.ini
  34. BIN
      gin_server_admin/uploads/file/e8c0653fea13f91bf3c48159f7c24f78_20211221133334.jpg
  35. BIN
      gin_server_admin/uploads/file/eccbc87e4b5ce2fe28308fd9f2a7baf3_20211222085813.jpg
  36. 21
      gin_server_admin/utils/redishandel/myredis.go
  37. BIN
      gin_server_admin/其他支持文件/文档类栏目管理.zip
  38. 62
      gin_server_admin/其他支持文件/文档类栏目管理/恒信动态.txt
  39. 0
      gin_server_admin/其他支持文件/文档类栏目管理/恒信课堂.txt
  40. 1
      gin_server_admin/其他支持文件/文档类栏目管理/知识库.txt
  41. 33
      gin_server_admin/其他支持文件/文档类栏目管理/顶级栏目管理.txt

220
gin_server_admin/api/v1/archiveapi/archiveapihandle.go

@ -0,0 +1,220 @@
package archiveapi
import (
"time"
"github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/archivesmodel"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/gin-gonic/gin"
)
type ArchiveApiHandle struct{}
func (a *ArchiveApiHandle) Index(c *gin.Context) {
outPut := commonus.MapOut()
response.Result(0, outPut, "获取成功", c)
}
//栏目列表
func (a *ArchiveApiHandle) ArchiveTypeList(c *gin.Context) {
var requestData archiveTypeListStruct
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(101, err, "参数错误!请重新提交!", c)
return
}
if requestData.PageSize == 0 {
requestData.PageSize = 20
}
if requestData.Page <= 0 {
requestData.Page = 1
}
// psge := (requestData.Page - 1) * requestData.PageSize
psge := commonus.CalculatePages(requestData.Page, requestData.PageSize)
var archiveList []archivesmodel.ArchivesType
//条件
whereMap := commonus.MapOut()
if requestData.ParentId != 0 {
whereMap["at_parent_id"] = requestData.ParentId
} else {
whereMap["at_parent_id"] = 0
}
listErr := global.GVA_DB_Master.Where(whereMap).Where("`at_stater` IN ?", []int{1, 2}).Order("`at_sort` ASC,`at_id` DESC").Limit(requestData.PageSize).Offset(psge).Find(&archiveList).Error
if listErr != nil {
response.Result(102, err, "未获取到数据!", c)
return
}
var outPutList []archiveTypeOutPut
for _, listVal := range archiveList {
var listCont archiveTypeOutPut
listCont.Id = listVal.Id
listCont.ColumnrName = listVal.Title
listCont.Sort = listVal.Sort
if listVal.Stater == 1 {
listCont.State = true
} else {
listCont.State = false
}
outPutList = append(outPutList, listCont)
}
var total int64 //获取所有数据
counrErr := global.GVA_DB_Master.Model(&archiveList).Where(whereMap).Where("`at_stater` IN ?", []int{1, 2}).Count(&total).Error
if counrErr != nil {
total = 0
}
countSum := len(outPutList)
printData := commonus.OutPutList(total, int64(countSum), requestData.Page, requestData.PageSize, outPutList)
// fmt.Printf("%v\n", printData)
response.Result(0, printData, "查询成功!", c)
}
//添加栏目
func (a *ArchiveApiHandle) AddArchive(c *gin.Context) {
var arrData appArchiveType
err := c.ShouldBindJSON(&arrData)
if err != nil {
response.Result(101, err, "参数错误!请重新提交!", c)
return
}
if arrData.UID == 0 {
response.Result(102, err, "参数错误!请重新提交!", c)
return
}
if arrData.Title == "" {
response.Result(103, err, "请输入栏目名称!", c)
return
}
if arrData.Sort == 0 {
arrData.Sort = 50
}
// if
var archiveInfo archivesmodel.ArchivesType
archiveInfo.Id = commonus.GetFileNumberEs()
archiveInfo.ParentId = arrData.ParentId
archiveInfo.Stater = 1
archiveInfo.UID = arrData.UID
archiveInfo.Sort = arrData.Sort
archiveInfo.Time = time.Now().Unix()
archiveInfo.Title = arrData.Title
addArchiveErr := global.GVA_DB_Master.Create(&archiveInfo).Error
if addArchiveErr != nil {
response.Result(104, archiveInfo, "数据写入失败!", c)
} else {
response.Result(0, addArchiveErr, "数据写入成功!", c)
}
}
//获取单个信息栏目
func (a *ArchiveApiHandle) GetArchiveInfo(c *gin.Context) {
var arrData commonus.SetId
err := c.ShouldBindJSON(&arrData)
if err != nil {
response.Result(101, err, "参数错误!请重新提交!", c)
return
}
if arrData.Id == 0 {
response.Result(102, arrData, "参数错误!请重新提交!", c)
return
}
var archiveInfo archivesmodel.ArchivesType
archiveInfoErr := global.GVA_DB_Master.Where("at_id = ?", arrData.Id).First(&archiveInfo).Error
if archiveInfoErr != nil {
response.Result(103, archiveInfoErr, "该栏目不存在!", c)
return
}
response.Result(0, archiveInfo, "获取成功!", c)
}
//改变栏目状态
func (a *ArchiveApiHandle) EiteArchiveState(c *gin.Context) {
var arrData archiveState
err := c.ShouldBindJSON(&arrData)
if err != nil {
response.Result(101, err, "参数错误!请重新提交!", c)
return
}
if arrData.Id == 0 {
response.Result(102, arrData, "参数错误!请重新提交!", c)
return
}
if arrData.State == 0 {
arrData.State = 1
}
var archiveInfo archivesmodel.ArchivesType
if arrData.IsDel != 1 {
isTrue, saveErr := archiveStateSet(archiveInfo, arrData)
if isTrue != true {
response.Result(103, saveErr, "修改失败!", c)
return
}
response.Result(0, arrData, "修改成功!", c)
} else {
if arrData.State == 3 {
archiveInfoErr := global.GVA_DB_Master.Where("at_id = ?", arrData.Id).Delete(&archiveInfo).Error
if archiveInfoErr != nil {
response.Result(104, arrData, "删除失败!", c)
return
}
response.Result(0, arrData, "删除成功!", c)
} else {
isTrue, saveErr := archiveStateSet(archiveInfo, arrData)
if isTrue != true {
response.Result(105, saveErr, "修改失败!", c)
return
}
response.Result(0, arrData, "修改成功!", c)
}
}
}
//状态软操作
func archiveStateSet(archiveInfo archivesmodel.ArchivesType, arrData archiveState) (isTrue bool, archiveInfoErr error) {
isTrue = false
//软处理
saveData := commonus.MapOut()
saveData["at_stater"] = arrData.State
saveData["at_time"] = time.Now().Unix()
archiveInfoErr = global.GVA_DB_Master.Model(&archiveInfo).Where("at_id = ?", arrData.Id).Updates(saveData).Error
if archiveInfoErr != nil {
return
}
isTrue = true
return
}
//修改栏目信息
func (a *ArchiveApiHandle) EiteArchiveInfo(c *gin.Context) {
var arrData eiteArchiveCont
err := c.ShouldBindJSON(&arrData)
if err != nil {
response.Result(101, err, "参数错误!请重新提交!", c)
return
}
if arrData.Id == 0 {
response.Result(102, arrData, "参数错误!请重新提交!", c)
return
}
if arrData.Title == "" {
response.Result(103, err, "请输入栏目名称!", c)
return
}
if arrData.Sort == 0 {
arrData.Sort = 50
}
var archiveInfo archivesmodel.ArchivesType
saveData := commonus.MapOut()
saveData["at_title"] = arrData.Title
saveData["at_sort"] = arrData.Sort
saveData["at_time"] = time.Now().Unix()
archiveInfoErr := global.GVA_DB_Master.Model(&archiveInfo).Where("at_id = ?", arrData.Id).Updates(saveData).Error
if archiveInfoErr != nil {
response.Result(104, err, "修改失败!", c)
return
}
response.Result(0, err, "修改成功!", c)
}

6
gin_server_admin/api/v1/archiveapi/enter.go

@ -0,0 +1,6 @@
package archiveapi
type ApiGroup struct {
ArchiveApiHandle
GraphicInformation
}

147
gin_server_admin/api/v1/archiveapi/graphicinformation.go

@ -0,0 +1,147 @@
package archiveapi
import (
"github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/archivesmodel"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/gin-gonic/gin"
)
//图文信息模块
type GraphicInformation struct{}
//文档列表
func (g *GraphicInformation) ArchiveFileList(c *gin.Context) {
var requestData fileList
err := c.ShouldBindJSON(&requestData)
if err != nil {
response.Result(101, err, "参数错误!请重新提交!", c)
return
}
if requestData.ParentId == 0 {
response.Result(102, err, "参数错误!请重新提交!", c)
return
}
//查询条件
whereMap := commonus.MapOut()
whereMap["g_parent"] = requestData.ParentId
//判断集团
if requestData.Group != 0 {
whereMap["g_write_group"] = requestData.Group
}
//判断分厂
if requestData.Factory != 0 {
whereMap["g_write_bfid"] = requestData.Factory
}
//判断工段
if requestData.Position != 0 {
whereMap["g_ws_id"] = requestData.Position
}
//判断班组
if requestData.Team != 0 {
whereMap["g_team"] = requestData.Team
}
//判断所属栏目
if requestData.ColumnId != 0 {
whereMap["g_parent_sun"] = requestData.ColumnId
}
if requestData.PageSize == 0 {
requestData.PageSize = 20
}
if requestData.Page <= 0 {
requestData.Page = 1
}
// psge := (requestData.Page - 1) * requestData.PageSize
appointPages := commonus.CalculatePages(requestData.Page, requestData.PageSize)
var fileList []archivesmodel.ArchiveFile
var total int64 //获取所有数据
if requestData.Title != "" {
listTitleErr := global.GVA_DB_BooImgkDate.Where(whereMap).Where("`g_title` LIKE %?% AND `g_state` IN ?", requestData.Title, []int{1, 2, 3}).Order("`g_id` DESC").Limit(requestData.PageSize).Offset(appointPages).Find(&fileList).Error
if listTitleErr != nil {
response.Result(103, listTitleErr, "数据获取失败!", c)
return
}
counrErr := global.GVA_DB_BooImgkDate.Model(&fileList).Where(whereMap).Where("`g_title` LIKE %?% AND `g_state` IN ?", requestData.Title, []int{1, 2, 3}).Count(&total).Error
if counrErr != nil {
total = 0
}
} else {
listErr := global.GVA_DB_BooImgkDate.Where(whereMap).Where("`g_state` IN ?", []int{1, 2, 3}).Order("`g_id` DESC").Limit(requestData.PageSize).Offset(appointPages).Find(&fileList).Error
if listErr != nil {
response.Result(104, listErr, "数据获取失败!", c)
return
}
counrErr := global.GVA_DB_BooImgkDate.Model(&fileList).Where(whereMap).Where("`g_state` IN ?", []int{1, 2, 3}).Count(&total).Error
if counrErr != nil {
total = 0
}
}
var fileListAry []callBackFilesList
for _, fileCont := range fileList {
var archiveTypeCont archivesmodel.ArchivesType
var fileListInfo callBackFilesList
fileListInfo.Id = fileCont.Id
fileListInfo.Title = fileCont.Title
fileListInfo.ColumnId = fileCont.ParentSun
archiveTypeCont.Id = fileCont.ParentSun
arcTypeErr := archiveTypeCont.GetArchiveTypeInfo()
// fmt.Printf("%v========>%v------->%v\n", arcTypeErr, archiveTypeCont, archiveTypeCont.Title)
if arcTypeErr == nil {
fileListInfo.ColumnTitle = archiveTypeCont.Title
} else {
fileListInfo.ColumnTitle = ""
}
reading, comment, collect, likes, tread, score := getBookArrter(fileCont.Id) //计算文章属性
fileListInfo.Reading = reading
fileListInfo.Comment = comment
fileListInfo.Collect = collect
fileListInfo.Likes = likes
fileListInfo.Tread = tread
fileListInfo.Score = score
fileListInfo.Scope = fileCont.VisitStrat
if fileCont.State == 2 {
fileListInfo.State = true
} else {
fileListInfo.State = false
}
fileListAry = append(fileListAry, fileListInfo)
}
countSum := len(fileListAry)
printData := commonus.OutPutList(total, int64(countSum), requestData.Page, requestData.PageSize, fileListAry)
// fmt.Printf("%v\n", printData)
response.Result(0, printData, "查询成功!", c)
}
//获取文档属性 global.GVA_DB_BookDate
func getBookArrter(id int64) (Reading, Comment, Collect, Likes, Tread, Score int64) {
var bookAttr archivesmodel.BookAttribute
readingErr := global.GVA_DB_BookDate.Model(&bookAttr).Where("`b_file_id` = ? AND `b_stater` = ? AND `b_type` = ?", id, 1, 1).Count(&Reading).Error
if readingErr != nil {
Reading = 0
}
collectErr := global.GVA_DB_BookDate.Model(&bookAttr).Where("`b_file_id` = ? AND `b_stater` = ? AND `b_type` = ?", id, 1, 2).Count(&Collect).Error
if collectErr != nil {
Collect = 0
}
likesErr := global.GVA_DB_BookDate.Model(&bookAttr).Where("`b_file_id` = ? AND `b_stater` = ? AND `b_type` = ?", id, 1, 3).Count(&Likes).Error
if likesErr != nil {
Likes = 0
}
treadErr := global.GVA_DB_BookDate.Model(&bookAttr).Where("`b_file_id` = ? AND `b_stater` = ? AND `b_type` = ?", id, 1, 3).Count(&Tread).Error
if treadErr != nil {
Tread = 0
}
var siscussMsg archivesmodel.DiscussMsg
commentErr := global.GVA_DB_BookDate.Model(&siscussMsg).Where("dis_file_id = ? AND dis_stater = ?", id, 2).Count(&Comment).Error
if commentErr != nil {
Comment = 0
}
return
}

73
gin_server_admin/api/v1/archiveapi/requestdata.go

@ -0,0 +1,73 @@
package archiveapi
import "github.com/flipped-aurora/gin-vue-admin/server/commonus"
//ID
//文档接收列表
type archiveTypeListStruct struct {
commonus.PageSetLimt
ParentId int64 `json:"parentId"`
}
//文档类型输出格式
type archiveTypeOutPut struct {
commonus.SetId
ColumnrName string `json:"columnr_name"` //栏目名称
Sort int `json:"sort"` // 排序
State bool `json:"state"` // 状态
}
//添加栏目
type appArchiveType struct {
UID int64 `json:"uid"` //添加人
ParentId int64 `json:"parentId"` //父级
Title string `json:"title"` //标题
Sort int `json:"sort"` // 排序
}
//状态修改
type archiveState struct {
commonus.SetId
State int `json:"state"` // 状态
IsDel int `json:"isdel"` // 是否强制删除
}
//修改栏目
type eiteArchiveCont struct {
commonus.SetId
appArchiveType
}
//文档列表查询
type fileList struct {
commonus.PageSetLimt
ParentId int64 `json:"parentId"` //父级
Title string `json:"title"` //标题
ColumnId int64 `json:"columnId"` //栏目ID
GroupStruct
}
//组织架构相关
type GroupStruct struct {
Group int64 `json:"group"` //集团
Factory int64 `json:"factory"` //分厂
Position int64 `json:"position"` //工段
Team int64 `json:"team"` //班组
}
//文档列表返回结构
type callBackFilesList struct {
commonus.SetId
Title string `json:"title"` //标题
ColumnId int64 `json:"columnId"` //栏目ID
ColumnTitle string `json:"columnTitle"` //栏目标题
Scope int `json:"scope"` //可见范围
Reading int64 `json:"reading"` //阅读量
Comment int64 `json:"comment"` //评论数
Collect int64 `json:"collect"` //收藏数
Likes int64 `json:"like"` //点赞数
Tread int64 `json:"tread"` //踩
Score int64 `json:"score"` //综合评分
State bool `json:"state"` //状态
}

16
gin_server_admin/api/v1/enter.go

@ -1,21 +1,25 @@
package v1 package v1
import ( import (
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/archiveapi"
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/autocode" "github.com/flipped-aurora/gin-vue-admin/server/api/v1/autocode"
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/example" "github.com/flipped-aurora/gin-vue-admin/server/api/v1/example"
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/examtestpage" "github.com/flipped-aurora/gin-vue-admin/server/api/v1/examtestpage"
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/fileuploaddownload"
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/shiyan" "github.com/flipped-aurora/gin-vue-admin/server/api/v1/shiyan"
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/system" "github.com/flipped-aurora/gin-vue-admin/server/api/v1/system"
"github.com/flipped-aurora/gin-vue-admin/server/api/v1/wechatcallback" "github.com/flipped-aurora/gin-vue-admin/server/api/v1/wechatcallback"
) )
type ApiGroup struct { type ApiGroup struct {
ExampleApiGroup example.ApiGroup ExampleApiGroup example.ApiGroup
SystemApiGroup system.ApiGroup SystemApiGroup system.ApiGroup
AutoCodeApiGroup autocode.ApiGroup AutoCodeApiGroup autocode.ApiGroup
ShiyanApiGroup shiyan.ApiGroup ShiyanApiGroup shiyan.ApiGroup
GroupHandleApiGroup examtestpage.ApiGroup GroupHandleApiGroup examtestpage.ApiGroup
WeCahtCallBackGroup wechatcallback.ApiGroup WeCahtCallBackGroup wechatcallback.ApiGroup
ArchiveApi archiveapi.ApiGroup
FileUploadOrDownloadApi fileuploaddownload.ApiGroup
} }
var ApiGroupApp = new(ApiGroup) var ApiGroupApp = new(ApiGroup)

8
gin_server_admin/api/v1/examtestpage/healthreportstat.go

@ -330,8 +330,14 @@ func sendMessAgeAlarm(calCulTime int64, alarmUser []map[string]interface{}) {
sendImgMsg.AgentId = appId sendImgMsg.AgentId = appId
sendImgMsg.News.Articles = sendContAry sendImgMsg.News.Articles = sendContAry
sendImgMsg.DuplicateCheckInterval = 1800 sendImgMsg.DuplicateCheckInterval = 1800
sendImgMsg.SendImgMessage() callbakcMsg, isTrueCall, callBackCont := sendImgMsg.SendImgMessage()
fmt.Printf("发送信息返回:%v-----------%v----------->%v\n", callbakcMsg, isTrueCall, callBackCont)
} else {
fmt.Println("没有要通知的人")
} }
} else {
fmt.Println("没有要通知的人")
} }
// fmt.Printf("%v---------------------->%v\n", sendText, sendText) // fmt.Printf("%v---------------------->%v\n", sendText, sendText)
} }

5
gin_server_admin/api/v1/fileuploaddownload/enter.go

@ -0,0 +1,5 @@
package fileuploaddownload
type ApiGroup struct {
FileUploadDownload
}

288
gin_server_admin/api/v1/fileuploaddownload/fileuploaddown.go

@ -0,0 +1,288 @@
package fileuploaddownload
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strconv"
"strings"
"unsafe"
"github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/gin-gonic/gin"
)
type FileUploadDownload struct{}
type urlData struct {
Type int `json:"typeese"`
Sign string `json:"sign"`
}
//上传文件(远程)
func (f *FileUploadDownload) LongRangeFileUpload(c *gin.Context) {
// var file example.ExaFileUploadAndDownload
// noSave := c.DefaultQuery("noSave", "0")
var reportStatistics urlData
err := c.ShouldBindJSON(&reportStatistics)
file, errs := c.FormFile("file")
// filePart, header, err := c.Request.FormFile("file")
outPut := commonus.MapOut()
// outPut["filePart"] = filePart
// outPut["header"] = header
// outPut["err"] = err
// outPut["noSave"] = noSave
outPut["file"] = file
outPut["errs"] = errs
outPut["err"] = err
outPut["reportStatistics"] = reportStatistics
// url := "http://docu.hxgk.net/uploadfileing/uploadimging"
var jsonPostSample JsonPostSample
jsonPostSample.SamplePost()
// client := &http.Client{}
// config := map[string]interface{}{}
// config["type"] = 0
// config["sign"] = "input"
// // config["afa"] = 2
// configdata, _ := json.Marshal(config)
// outPut["configdata"] = string(configdata)
// //json序列化
// post := "{\"type\":\"" + string(configdata) +
// "\",\"sign\":\"" + string(configdata) +
// "\"}"
// fmt.Println(url, "post", post)
// var jsonStr = []byte(post)
// fmt.Println("jsonStr", jsonStr)
// fmt.Println("new_str", bytes.NewBuffer(jsonStr))
// // req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr))
// posts := "type=1&sign=123"
// req, err := http.NewRequest("POST", url, strings.NewReader(posts))
// if err != nil {
// // handle error
// }
// req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
// // req.Header.Set("Content-Type", "application/json")
// // req.Header.Set("Cookie", "name=anny")
// resp, err := client.Do(req)
// defer resp.Body.Close()
// body, err := ioutil.ReadAll(resp.Body)
// outPut["body"] = string(body)
response.Result(0, outPut, "获取成功", c)
}
func sendPost1(urlStr string) {
data := make(url.Values)
data["name"] = []string{"rnben"}
res, err := http.PostForm(urlStr, data)
if err != nil {
fmt.Println(err.Error())
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
fmt.Printf("==============>%v\n", string(body))
}
func postData(urlStr string) {
http.HandleFunc(urlStr, func(w http.ResponseWriter, r *http.Request) {
if r.Method == "POST" {
var (
name string = r.PostFormValue("type")
)
fmt.Printf("key is : %s\n", name)
}
})
err := http.ListenAndServe(":80", nil)
if err != nil {
fmt.Println(err.Error())
return
}
}
func httpDo(urlStr string) {
client := &http.Client{}
req, err := http.NewRequest("POST", urlStr, strings.NewReader("sign=cjb"))
if err != nil {
// handle error
}
// req.Header.Set("Accept", "application/json, text/javascript, */*; q=0.01")
// req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Cookie", "name=anny")
resp, err := client.Do(req)
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
// handle error
}
fmt.Printf("Body------------------->%v\n", string(body))
}
//上传测试副本
func (f *FileUploadDownload) LongRangeFileUploadES(c *gin.Context) {
// var file example.ExaFileUploadAndDownload
// noSave := c.DefaultQuery("noSave", "0")
var reportStatistics urlData
err := c.ShouldBindJSON(&reportStatistics)
file, errs := c.FormFile("file")
// filePart, header, err := c.Request.FormFile("file")
outPut := commonus.MapOut()
// outPut["filePart"] = filePart
// outPut["header"] = header
// outPut["err"] = err
// outPut["noSave"] = noSave
outPut["file"] = file
outPut["errs"] = errs
// outPut["reportStatistics"] = reportStatistics
// if err != nil {
// // global.GVA_LOG.Error("接收文件失败!", zap.Any("err", err))
// // response.FailWithMessage("接收文件失败", c)
// outPut["msgerr"] = "接收文件失败"
// // return
// } else {
// outPut["msgerr"] = "接收文件成功"
// }
// config := map[string]interface{}{}
// config["Id"] = 0
// config["afa"] = "input"
// config["afa"] = 2
// configdata, _ := json.Marshal(config)
// fmt.Println(config)
// body := bytes.NewBuffer([]byte(configdata))
// configdata, _ := json.Marshal(outPut)
// body := bytes.NewBuffer([]byte(configdata))
// resp, errkjh := http.Post("http://docs.hxgk.group/uploadfileing/uploadimging", "multipart/form-data;charset=utf-8", body)
// outPut["resp"] = resp
// outPut["errkjh"] = errkjh
DataUrlVal := make(map[string]string)
// DataUrlVal.Add("type", strconv.Itoa(reportStatistics.Type))
// DataUrlVal.Add("sign", reportStatistics.Sign)
DataUrlVal["type"] = strconv.Itoa(reportStatistics.Type)
DataUrlVal["sign"] = reportStatistics.Sign
// DataUrlValJson, _ := json.Marshal(DataUrlVal)
// DataUrlVal := url.Values{}
// url := "http://docs.hxgk.group/uploadfileing/uploadimging"
url := "http://docu.hxgk.net/uploadfileing/uploadimging"
// request, err := http.NewRequest("POST", url, strings.NewReader(string(DataUrlValJson)))
// if err != nil {
// response.Result(0, err, "打开链接失败", c)
// return
// }
// request.Header.Set("Accept", "application/json, text/javascript, */*; q=0.01")
// // request.Header.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8")
// request.Header.Add("Accept-Encoding", "gzip, deflate, br")
// request.Header.Add("Accept-Language", "zh-CN,zh;q=0.8,en-US;q=0.6,en;q=0.4")
// request.Header.Add("Connection", "keep-alive")
// request.Header.Add("Content-Length", "25")
// request.Header.Add("Content-Type", "application/x-www-form-urlencoded")
// request.Header.Add("Cookie", "user_trace_token=20170425200852-dfbddc2c21fd492caac33936c08aef7e; LGUID=20170425200852-f2e56fe3-29af-11e7-b359-5254005c3644; showExpriedIndex=1; showExpriedCompanyHome=1; showExpriedMyPublish=1; hasDeliver=22; index_location_city=%E5%85%A8%E5%9B%BD; JSESSIONID=CEB4F9FAD55FDA93B8B43DC64F6D3DB8; TG-TRACK-CODE=search_code; SEARCH_ID=b642e683bb424e7f8622b0c6a17ffeeb; Hm_lvt_4233e74dff0ae5bd0a3d81c6ccf756e6=1493122129,1493380366; Hm_lpvt_4233e74dff0ae5bd0a3d81c6ccf756e6=1493383810; _ga=GA1.2.1167865619.1493122129; LGSID=20170428195247-32c086bf-2c09-11e7-871f-525400f775ce; LGRID=20170428205011-376bf3ce-2c11-11e7-8724-525400f775ce; _putrc=AFBE3C2EAEBB8730")
// request.Header.Add("Host", "www.lagou.com")
// request.Header.Add("Origin", "https://www.lagou.com")
// request.Header.Add("Referer", "https://www.lagou.com/jobs/list_python?labelWords=&fromSearch=true&suginput=")
// request.Header.Add("X-Anit-Forge-Code", "0")
// request.Header.Add("X-Anit-Forge-Token", "None")
// request.Header.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36")
// request.Header.Add("X-Requested-With", "XMLHttpRequest")
// client := &http.Client{}
// responseww, err := client.Do(request)
// if err != nil {
// response.Result(102, err, "打开链接失败", c)
// return
// }
// defer responseww.Body.Close()
// body, err := ioutil.ReadAll(responseww.Body)
// outPut["body"] = string(body)
// outPut["DataUrlValJson"] = string(DataUrlValJson)
// PostWithFormData("POST", url, &DataUrlVal)
responsesss, err := http.Post(
url,
"application/x-www-form-urlencoded",
strings.NewReader("type=1&age=99"),
)
outPut["err"] = err
defer responsesss.Body.Close()
body, err := ioutil.ReadAll(responsesss.Body)
outPut["body"] = string(body)
httpDo(url)
response.Result(0, outPut, "获取成功", c)
}
type JsonPostSample struct {
}
func (this *JsonPostSample) SamplePost() {
song := make(map[string]interface{})
song["name"] = "李白"
song["timelength"] = 128
song["author"] = "李荣浩"
bytesData, err := json.Marshal(song)
if err != nil {
fmt.Println(err.Error())
return
}
reader := bytes.NewReader(bytesData)
// url := "http://localhost/echo.php"
url := "http://docu.hxgk.net/uploadfileing/uploadimging"
request, err := http.NewRequest("POST", url, reader)
if err != nil {
fmt.Println(err.Error())
return
}
request.Header.Set("Content-Type", "application/json;charset=UTF-8")
client := http.Client{}
resp, err := client.Do(request)
if err != nil {
fmt.Println(err.Error())
return
}
respBytes, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Println(err.Error())
return
}
//byte数组直接转成string,优化内存
str := (*string)(unsafe.Pointer(&respBytes))
fmt.Println(*str)
}
func curlShiyan(url string) {
// hsj := httpclient.PostJson()
}

711
gin_server_admin/api/v1/shiyan/shiyan.go

@ -1,15 +1,22 @@
package shiyan package shiyan
import ( import (
"encoding/json"
"encoding/xml"
"fmt" "fmt"
"os"
"strconv" "strconv"
"time"
"github.com/flipped-aurora/gin-vue-admin/server/commonus" "github.com/flipped-aurora/gin-vue-admin/server/commonus"
"github.com/flipped-aurora/gin-vue-admin/server/global" "github.com/flipped-aurora/gin-vue-admin/server/global"
"github.com/flipped-aurora/gin-vue-admin/server/model/approvalprocess"
"github.com/flipped-aurora/gin-vue-admin/server/model/common/response" "github.com/flipped-aurora/gin-vue-admin/server/model/common/response"
"github.com/flipped-aurora/gin-vue-admin/server/model/testpage" "github.com/flipped-aurora/gin-vue-admin/server/model/testpage"
"github.com/flipped-aurora/gin-vue-admin/server/model/wechat" "github.com/flipped-aurora/gin-vue-admin/server/model/wechat"
"github.com/flipped-aurora/gin-vue-admin/server/utils/redishandel"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/mitchellh/mapstructure"
) )
type ShiyanApi struct { type ShiyanApi struct {
@ -105,3 +112,707 @@ func (d *Ddigui) faherDigui(id int64, groupStruct []wechat.GroupForm, parentId [
// fmt.Printf("%v==========>*******\n", parentIds) // fmt.Printf("%v==========>*******\n", parentIds)
return parentIds return parentIds
} }
//实验结果保存到数组
func (s *ShiyanApi) GormToMap(c *gin.Context) {
// returnData := commonus.MapOut()
// var returnData []map[string]interface{}
// tableName := "groupform"
// global.GVA_DB_WatchDate.Table(tableName).Find(&returnData)
var pGorm commonus.GormTopMap
pGorm.Db = global.GVA_DB_WatchDate
pGorm.TableName = "groupform"
returnData := commonus.MapOut()
returnData["ary"] = pGorm.PublicOrmToMap()
returnData["one"] = pGorm.PublicOrmToMapOne()
response.Result(0, returnData, "查询成功", c)
}
type PersonInfo struct {
DefinitIons interface{} `json:"definitions"`
}
//读取json文件解析
func (s *ShiyanApi) ReadJsonFiles(c *gin.Context) {
filePtr, err := os.Open("conf/forkflow.json")
defer filePtr.Close()
if err != nil {
dfg := fmt.Sprintf("Open file failed [Err:%s]", err.Error())
// fmt.Println("Open file failed [Err:%s]", err.Error())
response.Result(0, dfg, "查询成功", c)
return
}
decoder := json.NewDecoder(filePtr)
var person []PersonInfo
err = decoder.Decode(&person)
if err != nil {
fmt.Println("Decoder failed", err.Error())
}
fmt.Println("Open file failed [Err:%s]", person)
returnData := commonus.MapOut()
returnData["json"] = person
response.Result(0, returnData, "查询成功", c)
}
//XML转换处理
/*
*XML结构体
*/
type Definitions struct {
XMLName xml.Name `xml:"definitions" json:"definitions"`
Text string `xml:",chardata" json:"chardata"`
Bpmn2 string `xml:"bpmn2,attr" json:"bpmn2"`
Xsi string `xml:"xsi,attr" json:"xsi"`
Bpmndi string `xml:"bpmndi,attr" json:"bpmndi"`
Dc string `xml:"dc,attr" json:"dc"`
Flowable string `xml:"flowable,attr" json:"flowable"`
Di string `xml:"di,attr" json:"di"`
ID string `xml:"id,attr" json:"id"`
TargetNamespace string `xml:"targetNamespace,attr" json:"targetNamespace"`
SchemaLocation string `xml:"schemaLocation,attr" json:"schemaLocation"`
Process ProcessStruct `xml:"process" json:"process"` //工作流过程
BPMNDiagram BPMNDiagramStruct `xml:"BPMNDiagram" json:"BPMNDiagram"` //BPMN图结构
}
//工作流过程
type ProcessStruct struct {
TextAndIdStruct
NameStruct
Documentation Documentationstruct `xml:"documentation" json:"documentation"` //结构描述
StartEvent StartEventStruct `xml:"startEvent" json:"startEvent"` //开始事件
UserTask []UserTaskStruct `xml:"userTask" json:"userTask"` //流程主体(用户任务)
EndEvent EndEventStruct `xml:"endEvent" json:"endEvent"` //结束事件
SequenceFlow []SequenceFlowStruct `xml:"sequenceFlow" json:"sequenceFlow"` //序列流
}
//text结构体
type TextStruct struct {
Text string `xml:",chardata" json:",text"`
}
//name结构体
type NameStruct struct {
Name string `xml:"name,attr" json:"name"`
}
//Text与ID 结构
type TextAndIdStruct struct {
TextStruct
ID string `xml:"id,attr" json:"id"`
}
type Documentationstruct struct {
TextStruct
}
//工作流开始事件
type StartEventStruct struct {
TextAndIdStruct
NameStruct
Outgoing []OutgoingStruct `xml:"outgoing" json:"outgoing"` //流程出口
}
//流程出口结构
type OutgoingStruct struct {
TextStruct
}
//流程主体(用户任务)
type UserTaskStruct struct {
TextAndIdStruct
NameStruct
Assignee string `xml:"assignee,attr" json:"assignee"` //处理人
CandidateGroups string `xml:"candidateGroups,attr" json:"candidateGroups"` //处理角色
CandidateUsers string `xml:"candidateUsers,attr" json:"candidateUsers"` //处理人
Incoming []IncomingStruct `xml:"incoming" json:"incoming"` //来源
Outgoing []OutgoingStruct `xml:"outgoing" json:"outgoing"` //流程去向(下一个节点)
}
//本节点来源
type IncomingStruct struct {
TextStruct
}
//结束事件
type EndEventStruct struct {
TextAndIdStruct
NameStruct
Incoming []IncomingStruct `xml:"incoming" json:"incoming"` //来源
}
//序列流
type SequenceFlowStruct struct {
TextAndIdStruct
NameStruct
SourceRef string `xml:"sourceRef,attr" json:"sourceRef"` //源
TargetRef string `xml:"targetRef,attr" json:"targetRef"` //流向
ConditionExpression ConditionExpressionStruct `xml:"conditionExpression" json:"conditionExpression"` //条件表达式
}
//条件表达式
type ConditionExpressionStruct struct {
TextStruct
Type string `xml:"type,attr" json:"type"`
}
//BPMN图结构
type BPMNDiagramStruct struct {
TextAndIdStruct
BPMNPlane BPMNPlaneStruct `xml:"BPMNPlane" json:"BPMNPlane"`
}
//图平面坐标参数
type BPMNPlaneStruct struct {
TextAndIdStruct
BpmnElement string `xml:"bpmnElement,attr" json:"bpmnElement"` //Bpmn元素
BPMNShape []BPMNShapeStruct `xml:"BPMNShape" json:"BPMNShape"` //Bpmn 坐标参数
BPMNEdge []BPMNEdgeStruct `xml:"BPMNEdge" json:"BPMNEdge"` //Bpmn界限
}
//Bpmn 坐标参数
type BPMNShapeStruct struct {
TextAndIdStruct
BpmnElement string `xml:"bpmnElement,attr" json:"bpmnElement"`
Bounds BoundsStruct `xml:"Bounds" json:"Bounds"` //图形元素坐标
BPMNLabel BPMNLabelStruct `xml:"BPMNLabel" json:"BPMNLabel"` //BPMN标签
}
//图形元素坐标
type BoundsStruct struct {
TextStruct
X string `xml:"x,attr" json:"x"`
Y string `xml:"y,attr" json:"y"`
Width string `xml:"width,attr" json:"width"`
Height string `xml:"height,attr" json:"height"`
}
//BPMN标签
type BPMNLabelStruct struct {
TextStruct
Bounds BoundsStruct `xml:"Bounds" json:"Bounds"` //图形元素坐标
}
//Bpmn界限
type BPMNEdgeStruct struct {
TextAndIdStruct
BpmnElement string `xml:"bpmnElement,attr" json:"bpmnElement"`
Waypoint []WaypointStruct `xml:"waypoint" json:"waypoint"` //线路径坐标
}
//线路径坐标
type WaypointStruct struct {
TextStruct
X string `xml:"x,attr" json:"x"`
Y string `xml:"y,attr" json:"y"`
}
//接收参数
type XmlCanShu struct {
ProcessKey string `json:"processKey"`
ProcessName string `json:"processName"`
ResourceName string `json:"resourceName"`
Xml string `json:"xml"`
Svg string `json:"svg"`
JsonStr string `json:"jsonstr"`
}
//工作流XML解析
func (s *ShiyanApi) XmlToJson(c *gin.Context) {
var xmlToStruct Definitions
var reportAnswer XmlCanShu
err := c.ShouldBindJSON(&reportAnswer)
// if err != nil {
// response.Result(101, err, "参数错误!", c)
// return
// }
if reportAnswer.Xml == "" {
response.Result(102, err, "参数错误!", c)
return
}
errs := xml.Unmarshal([]byte(reportAnswer.Xml), &xmlToStruct)
if nil != errs {
fmt.Println("Unmarshal fail")
} else {
fmt.Println("struct", xmlToStruct)
}
returnData := commonus.MapOut()
returnData["reportAnswer"] = reportAnswer
returnData["xmlToStruct"] = xmlToStruct
var approvalProcess approvalprocess.ApprovalProcess
processMap := commonus.MapOut()
processId := commonus.GetFileNumberEs()
approvalProcess.Id = processId
processMap["id"] = processId
approvalProcess.Name = xmlToStruct.Process.Name
processMap["name"] = xmlToStruct.Process.Name
result, jsonErr := json.Marshal(xmlToStruct)
if jsonErr == nil {
approvalProcess.Flow = string(result)
processMap["flow"] = string(result)
} else {
processMap["flow"] = ""
}
approvalProcess.FlowJson = reportAnswer.JsonStr
processMap["flowjson"] = reportAnswer.JsonStr
approvalProcess.FlowXml = reportAnswer.Xml
processMap["flowxml"] = reportAnswer.Xml
approvalProcess.FlowSvg = reportAnswer.Svg
processMap["flowsvg"] = reportAnswer.Svg
resultPro, jsonErrPro := json.Marshal(xmlToStruct.Process)
if jsonErrPro == nil {
approvalProcess.GetFlowJson = string(resultPro)
processMap["getflowjson"] = string(resultPro)
} else {
processMap["getflowjson"] = ""
}
approvalProcess.Time = time.Now().Unix()
approvalProcess.EiteTime = time.Now().Unix()
approvalProcess.Sate = 1
processMap["sate"] = 1
batchNum := commonus.GetFileNumberEs()
approvalProcess.Batch = batchNum
processMap["batchnum"] = batchNum
approvalProcess.EditionNum = "V1.0"
processMap["editionnum"] = "V1.0"
returnData["approvalProcess"] = approvalProcess
// writeRedisData := map[string]interface{}{
// "name": xmlToStruct.Process.Name,
// "flow": string(result),
// "flowjson": reportAnswer.JsonStr,
// "flowxml": reportAnswer.Xml,
// "flowsvg": reportAnswer.Svg,
// "getflowjson": string(resultPro),
// "sate": 1,
// "batchnum": batchNum,
// "editionnum": "V1.0",
// }
// addProcess := global.GVA_DB_ApprovalProcess.Create(&approvalProcess)
// if addProcess.Error != nil {
// response.Result(104, addProcess.Error, "流程创建失败", c)
// return
// }
redisClient := redishandel.RunRedis()
redisClient.SetRedisTime(0)
kks := redisClient.HashMsetAdd("Process:ApprovalProcess_"+global.GVA_CONFIG.RedisPrefix.Alias+"_"+strconv.FormatInt(batchNum, 10), processMap)
response.Result(103, kks, "参数错误!", c)
}
type ExamineApprove struct {
ProcessId int64 `json:"processId"` //流程批次
ExamineApproveId int64 `json:"examineApproveId"` //正在执行的流程
Type int `json:"type"` //状态(1:同意;2:驳回;3:暂存)
Condition string `json:"condition"` //判断条件
State int `json:"state"` //状态
}
//审批记录Redis过度
type ApprovalProcessLogRedis struct {
Id string `json:"id"`
Process string `json:"process" `
CurrentNode string `json:"currentNode"`
Title string `json:"title" `
Time string `json:"time"`
EiteTime string `json:"eiteTime"`
ProcessNum string `json:"processNum"`
IsEnd string `json:"isEnd"`
State string `json:"state"`
}
//创建及审批
func (s *ShiyanApi) EstablishApprove(c *gin.Context) {
var examineApprove ExamineApprove
err := c.ShouldBindJSON(&examineApprove)
if err != nil {
response.Result(101, err, "参数错误!", c)
return
}
if examineApprove.ProcessId == 0 || examineApprove.ExamineApproveId == 0 {
response.Result(102, examineApprove, "参数错误!", c)
return
}
if examineApprove.Type == 0 {
examineApprove.Type = 2
}
//正在执行的流程
var runApprovalProcess approvalprocess.ApprovalProcessLog
//缓存设置
redisClient := redishandel.RunRedis()
approvalProcessRedis, isTrue := redisClient.HashGetAll("Process:RunApprovalProcess_" + global.GVA_CONFIG.RedisPrefix.Alias + "_" + strconv.FormatInt(examineApprove.ExamineApproveId, 10))
if isTrue != true { //判断是否存在缓存
runProcessMap := commonus.MapOut()
appProLogErr := global.GVA_DB_ApprovalProcess.Where("`apl_id` = ?", examineApprove.ExamineApproveId).First(&runApprovalProcess).Error
if appProLogErr != nil {
var getApprovalProcess approvalprocess.ApprovalProcess
getProLogErr := global.GVA_DB_ApprovalProcess.Where("`ap_batch` = ? AND `ap_state` = 1", examineApprove.ProcessId).First(&getApprovalProcess).Error
if getProLogErr != nil {
response.Result(103, getApprovalProcess, "对不起该流程不存在", c)
return
}
runApprovalProcess.Process = getApprovalProcess.GetFlowJson
runProcessMap["process"] = getApprovalProcess.GetFlowJson
//流程json转为struct
var process ProcessStruct
jsonErrPro := json.Unmarshal([]byte(getApprovalProcess.GetFlowJson), &process)
if jsonErrPro == nil {
runApprovalProcess.CurrentNode = process.StartEvent.ID
runApprovalProcess.Title = process.StartEvent.Name
runApprovalProcess.ProcessNum = getApprovalProcess.Batch
runProcessMap["currentNode"] = process.StartEvent.ID
runProcessMap["title"] = process.StartEvent.Name
runProcessMap["processNum"] = getApprovalProcess.Batch
} else {
runApprovalProcess.CurrentNode = ""
runApprovalProcess.Title = ""
runApprovalProcess.ProcessNum = 0
runProcessMap["currentNode"] = ""
runProcessMap["title"] = ""
runProcessMap["processNum"] = 0
}
runApprovalProcess.Time = time.Now().Unix()
runApprovalProcess.EiteTime = time.Now().Unix()
runApprovalProcess.IsEnd = 1
runProcessMap["isend"] = 1
if examineApprove.State == 0 {
runApprovalProcess.Sate = 1
runProcessMap["state"] = 1
} else {
runApprovalProcess.Sate = examineApprove.State
runProcessMap["state"] = examineApprove.State
}
runProcessMap["time"] = time.Now().Unix()
runProcessMap["eiteTime"] = time.Now().Unix()
addProcess := global.GVA_DB_ApprovalProcess.Create(&runApprovalProcess).Error
if addProcess != nil {
response.Result(104, getApprovalProcess, "对不起该流程启用失败", c)
return
}
runProcessMap["id"] = runApprovalProcess.Id
redisClient.SetRedisTime(0)
redisClient.HashMsetAdd("Process:RunApprovalProcess_"+global.GVA_CONFIG.RedisPrefix.Alias+"_"+strconv.FormatInt(runApprovalProcess.Id, 10), runProcessMap)
} else {
runProcessMap["process"] = runApprovalProcess.Process
runProcessMap["currentNode"] = runApprovalProcess.CurrentNode
runProcessMap["title"] = runApprovalProcess.Title
runProcessMap["processNum"] = runApprovalProcess.ProcessNum
runProcessMap["time"] = runApprovalProcess.Time
runProcessMap["eiteTime"] = runApprovalProcess.EiteTime
runProcessMap["id"] = runApprovalProcess.Id
runProcessMap["isend"] = runApprovalProcess.IsEnd
runProcessMap["state"] = runApprovalProcess.Sate
if runApprovalProcess.IsEnd == 1 {
redisClient.SetRedisTime(0)
} else {
redisClient.SetRedisTime(604800)
}
redisClient.HashMsetAdd("Process:RunApprovalProcess_"+global.GVA_CONFIG.RedisPrefix.Alias+"_"+strconv.FormatInt(runApprovalProcess.Id, 10), runProcessMap)
if runApprovalProcess.IsEnd != 1 {
response.Result(105, runApprovalProcess, "该流程已经结束!请不要重复执行!", c)
return
}
}
} else {
// fmt.Printf("Redis====》%v\n", runApprovalProcess)
var approvalProcessLogRedis ApprovalProcessLogRedis
err := mapstructure.Decode(approvalProcessRedis, &approvalProcessLogRedis)
if err != nil {
response.Result(104, err, "对不起该流程启用失败", c)
return
// return departmentlist, false
}
appId, appIdErr := strconv.ParseInt(approvalProcessLogRedis.Id, 10, 64)
if appIdErr == nil {
runApprovalProcess.Id = appId
}
// fmt.Printf("审批ID==Redis==》%v-------------%v\n", approvalProcessLogRedis.Id, appId)
processNum, processNumErr := strconv.ParseInt(approvalProcessLogRedis.ProcessNum, 10, 64)
if processNumErr == nil {
runApprovalProcess.ProcessNum = processNum
}
timeVal, timeErr := strconv.ParseInt(approvalProcessLogRedis.Time, 10, 64)
if timeErr == nil {
runApprovalProcess.Time = timeVal
}
eiteTime, eiteTimeErr := strconv.ParseInt(approvalProcessLogRedis.EiteTime, 10, 64)
if eiteTimeErr == nil {
runApprovalProcess.EiteTime = eiteTime
}
isEnd, isEndErr := strconv.Atoi(approvalProcessLogRedis.IsEnd)
if isEndErr == nil {
runApprovalProcess.IsEnd = isEnd
} else {
response.Result(107, runApprovalProcess, "对不起该流程启用失败!", c)
return
}
sateSet, sateErr := strconv.Atoi(approvalProcessLogRedis.State)
if sateErr == nil {
runApprovalProcess.Sate = sateSet
} else {
response.Result(108, sateErr, "对不起该流程启用失败!", c)
return
}
runApprovalProcess.Process = approvalProcessLogRedis.Process
runApprovalProcess.CurrentNode = approvalProcessLogRedis.CurrentNode
runApprovalProcess.Title = approvalProcessLogRedis.Title
if runApprovalProcess.IsEnd != 1 {
response.Result(106, runApprovalProcess, "该流程已经结束!请不要重复执行!", c)
return
}
}
// fmt.Printf("数据结构===========>%v\n", runApprovalProcess)
switch examineApprove.Type {
case 1: //批准
ApproveOperation(runApprovalProcess, examineApprove)
case 3: //暂存
default: //驳回
}
}
//批准操作
func ApproveOperation(runApprovalProcess approvalprocess.ApprovalProcessLog, examineApprove ExamineApprove) (isTrue bool) {
// fmt.Printf("审批ID==Redis==》%v-------------%v\n", runApprovalProcess.Id, runApprovalProcess)
isTrue = false
// fmt.Printf("结果====》%v\n", runApprovalProcess)
var process ProcessStruct
jsonErrPro := json.Unmarshal([]byte(runApprovalProcess.Process), &process)
if jsonErrPro != nil {
fmt.Printf("转换失败====》%v\n", process)
return
}
if runApprovalProcess.CurrentNode == process.EndEvent.ID {
fmt.Printf("执行结束节点====》%v\n", process.EndEvent.ID)
return
}
if runApprovalProcess.CurrentNode == process.StartEvent.ID {
fmt.Printf("执行开始节点====》%v\n", process.StartEvent.ID)
if len(process.StartEvent.Outgoing) > 1 {
fmt.Printf("执行开始节点====有条件》%v\n", process.StartEvent.ID)
currentId := runApprovalProcess.CurrentNode
appId, appTitle, appIsTrue, isEnd := ApprovalCriteria(1, process, examineApprove, runApprovalProcess.CurrentNode)
fmt.Printf("执行审批节点==11111==下一个节点》%v----%v-----%v\n", appId, appTitle, appIsTrue)
if appIsTrue != true {
return
}
isTrue = true
currentId = appId
// for _, outGoing := range process.StartEvent.Outgoing {
// for _, seqFlow := range process.SequenceFlow {
// if outGoing.Text == seqFlow.ID {
// // fmt.Printf("条件(%v)====》对比条件-----%v\n", seqFlow.ConditionExpression.Text, examineApprove.Condition)
// if seqFlow.ConditionExpression.Text == examineApprove.Condition {
// isTrue = true
// currentId = seqFlow.TargetRef
// fmt.Printf("执行节点====》%v\n", seqFlow.TargetRef)
// }
// }
// }
// }
runApprovalProcess.CurrentNode = currentId
runApprovalProcess.Title = appTitle
runApprovalProcess.EiteTime = time.Now().Unix()
runProcessMap := commonus.MapOut()
runProcessMap["process"] = runApprovalProcess.Process
runProcessMap["currentNode"] = currentId
runProcessMap["processNum"] = runApprovalProcess.ProcessNum
runProcessMap["time"] = time.Now().Unix()
runProcessMap["title"] = appTitle
runProcessMap["eiteTime"] = time.Now().Unix()
if isEnd == true {
runApprovalProcess.IsEnd = 2
runProcessMap["isend"] = 2
}
//缓存设置
redisClient := redishandel.RunRedis()
redisClient.SetRedisTime(604800)
redisClient.HashMsetAdd("Process:RunApprovalProcess_"+global.GVA_CONFIG.RedisPrefix.Alias+"_"+strconv.FormatInt(runApprovalProcess.Id, 10), runProcessMap)
fmt.Printf("审批ID==22222==》%v\n", runApprovalProcess.Id)
eiteProcess := global.GVA_DB_ApprovalProcess.Where("`apl_id` = ?", runApprovalProcess.Id).Updates(&runApprovalProcess).Error
if eiteProcess == nil {
fmt.Printf("更新成功====》%v\n", runApprovalProcess)
} else {
fmt.Printf("更新失败====》%v\n", runApprovalProcess)
}
return
} else if len(process.StartEvent.Outgoing) < 1 {
fmt.Printf("执行开始节点====未知下个节点》%v\n", process.StartEvent.ID)
} else {
fmt.Printf("执行开始节点====直接到审批》%v\n", process.StartEvent.ID)
}
}
for _, taskVal := range process.UserTask {
if runApprovalProcess.CurrentNode == taskVal.ID {
fmt.Printf("执行审批节点====》%v\n", taskVal.ID)
appId, appTitle, appIsTrue, isEnd := ApprovalCriteria(3, process, examineApprove, runApprovalProcess.CurrentNode)
fmt.Printf("执行审批节点====下一个节点》%v----%v-----%v\n", appId, appTitle, appIsTrue)
currentId := runApprovalProcess.CurrentNode
if appIsTrue != true {
return
}
isTrue = true
currentId = appId
runApprovalProcess.CurrentNode = currentId
runApprovalProcess.Title = appTitle
runApprovalProcess.EiteTime = time.Now().Unix()
runProcessMap := commonus.MapOut()
runProcessMap["process"] = runApprovalProcess.Process
runProcessMap["currentNode"] = currentId
runProcessMap["processNum"] = runApprovalProcess.ProcessNum
runProcessMap["time"] = time.Now().Unix()
runProcessMap["title"] = appTitle
runProcessMap["eiteTime"] = time.Now().Unix()
if isEnd == true {
runApprovalProcess.IsEnd = 2
runProcessMap["isend"] = 2
}
//缓存设置
redisClient := redishandel.RunRedis()
redisClient.SetRedisTime(604800)
redisClient.HashMsetAdd("Process:RunApprovalProcess_"+global.GVA_CONFIG.RedisPrefix.Alias+"_"+strconv.FormatInt(runApprovalProcess.Id, 10), runProcessMap)
fmt.Printf("审批ID====》%v\n", runApprovalProcess.Id)
eiteProcess := global.GVA_DB_ApprovalProcess.Where("`apl_id` = ?", runApprovalProcess.Id).Updates(&runApprovalProcess).Error
if eiteProcess == nil {
fmt.Printf("更新成功uis====》%v\n", runApprovalProcess)
} else {
fmt.Printf("更新失败uis====》%v\n", runApprovalProcess)
}
return
}
}
return
}
//审批条件解析
/*
@execStatus 执行状态 1开始2结束3审批
*/
func ApprovalCriteria(execStatus int, process ProcessStruct, examineApprove ExamineApprove, currentNode string) (currentId, nextTitle string, isTrue, isEnd bool) {
isTrue = false
isEnd = false
//解析条件判断,获取出下个节点的ID
switch execStatus {
case 1:
fmt.Printf("State ----------> %v\n", execStatus)
for _, outGoing := range process.StartEvent.Outgoing {
for _, seqFlow := range process.SequenceFlow {
if outGoing.Text == seqFlow.ID {
fmt.Printf("条件(%v)====》对比条件-----%v\n", seqFlow.ConditionExpression.Text, examineApprove.Condition)
if seqFlow.ConditionExpression.Text == examineApprove.Condition {
isTrue = true
currentId = seqFlow.TargetRef
fmt.Printf("执行节点====》%v\n", seqFlow.TargetRef)
}
}
}
}
case 2:
fmt.Printf("State ----------> %v\n", execStatus)
default:
fmt.Printf("State ----------> %v\n", execStatus)
for _, taskVal := range process.UserTask {
if taskVal.ID == currentNode {
for _, outGoing := range taskVal.Outgoing {
for _, seqFlow := range process.SequenceFlow {
if outGoing.Text == seqFlow.ID {
fmt.Printf("条件(%v)====》对比条件-----%v\n", seqFlow.ConditionExpression.Text, examineApprove.Condition)
if seqFlow.ConditionExpression.Text == examineApprove.Condition {
isTrue = true
currentId = seqFlow.TargetRef
fmt.Printf("执行节点====》%v\n", seqFlow.TargetRef)
}
}
}
}
}
// for _, seqFlow := range process.SequenceFlow {
// fmt.Printf("条件(%v)====》对比条件-----%v\n", taskVal.ID, seqFlow.ID)
// if taskVal.ID == seqFlow.ID {
// if seqFlow.ConditionExpression.Text == examineApprove.Condition {
// isTrue = true
// currentId = seqFlow.TargetRef
// fmt.Printf("执行节点====》%v\n", seqFlow.TargetRef)
// }
// }
// }
}
}
nextNameIsTrue := false
//获取审批节点名称
for _, taskVal := range process.UserTask {
if taskVal.ID == currentId {
nextTitle = taskVal.Name
nextNameIsTrue = true
}
}
if nextNameIsTrue != true {
if currentId == process.EndEvent.ID {
nextTitle = process.EndEvent.Name
nextNameIsTrue = true
isEnd = true
return
}
if currentId == process.StartEvent.ID {
nextTitle = process.StartEvent.Name
nextNameIsTrue = true
}
}
return
}

11
gin_server_admin/commonus/calculate_pages.go

@ -0,0 +1,11 @@
package commonus
//计算翻页Offser数据
func CalculatePages(page, pageSize int) (offser int) {
pageVal := page - 1
if pageVal < 0 {
pageVal = 0
}
offser = pageVal * pageSize
return
}

19
gin_server_admin/commonus/mapOutput.go

@ -42,3 +42,22 @@ func UnixTimeToDay(timestamp int64) string {
datetime := time.Unix(timestamp, 0).Format(timeLayout) datetime := time.Unix(timestamp, 0).Format(timeLayout)
return datetime return datetime
} }
//列表输出标准格式
/*
@total 总数
@count 当前页总数
@page 页数
@pageSize 每页显示数量
@data 返回数据
*/
func OutPutList(total, count int64, page, pageSize int, data interface{}) (printMap map[string]interface{}) {
outMap := MapOut()
outMap["count"] = count
outMap["total"] = total
outMap["page"] = page
outMap["pageSize"] = pageSize
outMap["data"] = data
printMap = outMap
return
}

32
gin_server_admin/commonus/publichaneld.go

@ -12,6 +12,7 @@ import (
"github.com/flipped-aurora/gin-vue-admin/server/model/testpage" "github.com/flipped-aurora/gin-vue-admin/server/model/testpage"
"github.com/flipped-aurora/gin-vue-admin/server/model/wechat" "github.com/flipped-aurora/gin-vue-admin/server/model/wechat"
"github.com/flipped-aurora/gin-vue-admin/server/utils/redishandel" "github.com/flipped-aurora/gin-vue-admin/server/utils/redishandel"
"gorm.io/gorm"
) )
//遍历所有父类 //遍历所有父类
@ -532,3 +533,34 @@ func WriteInMan(wechat, calCulTime string, groupId int64) {
// fmt.Printf("Eite -----> %v ------>%v\n", abnErr, abn) // fmt.Printf("Eite -----> %v ------>%v\n", abnErr, abn)
} }
} }
//通用查询结果到map结构
type GormTopMap struct {
Db *gorm.DB
TableName string
WhereMap map[string]interface{}
}
//输出Map查询数据库结果(多行)
func (g *GormTopMap) PublicOrmToMap() (returnData []map[string]interface{}) {
if len(g.WhereMap) > 0 {
g.Db.Table(g.TableName).Where(g.WhereMap).Find(&returnData)
} else {
g.Db.Table(g.TableName).Find(&returnData)
}
return
}
//输出Map查询数据库结果(单行)
func (g *GormTopMap) PublicOrmToMapOne() (returnData map[string]interface{}) {
var selectData []map[string]interface{}
if len(g.WhereMap) > 0 {
g.Db.Table(g.TableName).Where(g.WhereMap).Take(&selectData)
} else {
g.Db.Table(g.TableName).Take(&selectData)
}
if len(selectData) < 1 && len(selectData) > 0 {
returnData = selectData[0]
}
return
}

6
gin_server_admin/commonus/publicstruct.go

@ -0,0 +1,6 @@
package commonus
//公共变量
type SetId struct {
Id int64 `json:"id"`
}

369
gin_server_admin/conf/forkflow.json

@ -0,0 +1,369 @@
{
"definitions": {
"process": {
"documentation": {
"__prefix": "bpmn2",
"__text": "流程描述"
},
"startEvent": {
"outgoing": [
{
"__prefix": "bpmn2",
"__text": "tiao_jian_1"
},
{
"__prefix": "bpmn2",
"__text": "tiao_jian_2"
}
],
"_id": "begin",
"_name": "开始",
"__prefix": "bpmn2"
},
"userTask": [
{
"incoming": {
"__prefix": "bpmn2",
"__text": "tiao_jian_1"
},
"outgoing": {
"__prefix": "bpmn2",
"__text": "SequenceFlow_0tvwafp"
},
"_id": "shen_pi_1",
"_name": "审批1",
"_flowable:assignee": "1001",
"__prefix": "bpmn2"
},
{
"incoming": {
"__prefix": "bpmn2",
"__text": "tiao_jian_2"
},
"outgoing": {
"__prefix": "bpmn2",
"__text": "SequenceFlow_18d12da"
},
"_id": "shen_pi_2",
"_name": "审批2",
"_flowable:candidateGroups": "personnel",
"__prefix": "bpmn2"
},
{
"incoming": {
"__prefix": "bpmn2",
"__text": "SequenceFlow_18d12da"
},
"outgoing": {
"__prefix": "bpmn2",
"__text": "SequenceFlow_0jui7b0"
},
"_id": "shen_pi_3",
"_name": "审批3",
"_flowable:candidateUsers": "1002,1003",
"__prefix": "bpmn2"
}
],
"endEvent": {
"incoming": [
{
"__prefix": "bpmn2",
"__text": "SequenceFlow_0tvwafp"
},
{
"__prefix": "bpmn2",
"__text": "SequenceFlow_0jui7b0"
}
],
"_id": "end",
"_name": "结束",
"__prefix": "bpmn2"
},
"sequenceFlow": [
{
"conditionExpression": {
"_xsi:type": "bpmn2:tFormalExpression",
"__prefix": "bpmn2",
"__text": ">100"
},
"_id": "tiao_jian_1",
"_name": "条件1",
"_sourceRef": "begin",
"_targetRef": "shen_pi_1",
"__prefix": "bpmn2"
},
{
"_id": "SequenceFlow_0tvwafp",
"_sourceRef": "shen_pi_1",
"_targetRef": "end",
"__prefix": "bpmn2"
},
{
"conditionExpression": {
"_xsi:type": "bpmn2:tFormalExpression",
"__prefix": "bpmn2",
"__text": "<100"
},
"_id": "tiao_jian_2",
"_name": "条件2",
"_sourceRef": "begin",
"_targetRef": "shen_pi_2",
"__prefix": "bpmn2"
},
{
"_id": "SequenceFlow_18d12da",
"_sourceRef": "shen_pi_2",
"_targetRef": "shen_pi_3",
"__prefix": "bpmn2"
},
{
"_id": "SequenceFlow_0jui7b0",
"_sourceRef": "shen_pi_3",
"_targetRef": "end",
"__prefix": "bpmn2"
}
],
"_id": "liu_cheng",
"_name": "流程",
"__prefix": "bpmn2"
},
"BPMNDiagram": {
"BPMNPlane": {
"BPMNShape": [
{
"Bounds": {
"_x": "142",
"_y": "212",
"_width": "36",
"_height": "36",
"__prefix": "dc"
},
"BPMNLabel": {
"Bounds": {
"_x": "149",
"_y": "255",
"_width": "22",
"_height": "14",
"__prefix": "dc"
},
"__prefix": "bpmndi"
},
"_id": "StartEvent_01ydzqe_di",
"_bpmnElement": "begin",
"__prefix": "bpmndi"
},
{
"Bounds": {
"_x": "310",
"_y": "200",
"_width": "100",
"_height": "80",
"__prefix": "dc"
},
"_id": "UserTask_1nsn57s_di",
"_bpmnElement": "shen_pi_1",
"__prefix": "bpmndi"
},
{
"Bounds": {
"_x": "662",
"_y": "222",
"_width": "36",
"_height": "36",
"__prefix": "dc"
},
"BPMNLabel": {
"Bounds": {
"_x": "669",
"_y": "198",
"_width": "22",
"_height": "14",
"__prefix": "dc"
},
"__prefix": "bpmndi"
},
"_id": "EndEvent_020ed1j_di",
"_bpmnElement": "end",
"__prefix": "bpmndi"
},
{
"Bounds": {
"_x": "300",
"_y": "350",
"_width": "100",
"_height": "80",
"__prefix": "dc"
},
"_id": "UserTask_0376y7f_di",
"_bpmnElement": "shen_pi_2",
"__prefix": "bpmndi"
},
{
"Bounds": {
"_x": "600",
"_y": "350",
"_width": "100",
"_height": "80",
"__prefix": "dc"
},
"_id": "UserTask_0ilgotg_di",
"_bpmnElement": "shen_pi_3",
"__prefix": "bpmndi"
}
],
"BPMNEdge": [
{
"waypoint": [
{
"_x": "178",
"_y": "230",
"__prefix": "di"
},
{
"_x": "244",
"_y": "230",
"__prefix": "di"
},
{
"_x": "244",
"_y": "240",
"__prefix": "di"
},
{
"_x": "310",
"_y": "240",
"__prefix": "di"
}
],
"BPMNLabel": {
"Bounds": {
"_x": "214",
"_y": "232",
"_width": "90",
"_height": "20",
"__prefix": "dc"
},
"__prefix": "bpmndi"
},
"_id": "SequenceFlow_16vcpv3_di",
"_bpmnElement": "tiao_jian_1",
"__prefix": "bpmndi"
},
{
"waypoint": [
{
"_x": "410",
"_y": "240",
"__prefix": "di"
},
{
"_x": "662",
"_y": "240",
"__prefix": "di"
}
],
"_id": "SequenceFlow_0tvwafp_di",
"_bpmnElement": "SequenceFlow_0tvwafp",
"__prefix": "bpmndi"
},
{
"waypoint": [
{
"_x": "178",
"_y": "230",
"__prefix": "di"
},
{
"_x": "239",
"_y": "230",
"__prefix": "di"
},
{
"_x": "239",
"_y": "390",
"__prefix": "di"
},
{
"_x": "300",
"_y": "390",
"__prefix": "di"
}
],
"BPMNLabel": {
"Bounds": {
"_x": "209",
"_y": "307",
"_width": "90",
"_height": "20",
"__prefix": "dc"
},
"__prefix": "bpmndi"
},
"_id": "SequenceFlow_0ao8d4c_di",
"_bpmnElement": "tiao_jian_2",
"__prefix": "bpmndi"
},
{
"waypoint": [
{
"_x": "400",
"_y": "390",
"__prefix": "di"
},
{
"_x": "600",
"_y": "390",
"__prefix": "di"
}
],
"_id": "SequenceFlow_18d12da_di",
"_bpmnElement": "SequenceFlow_18d12da",
"__prefix": "bpmndi"
},
{
"waypoint": [
{
"_x": "650",
"_y": "350",
"__prefix": "di"
},
{
"_x": "650",
"_y": "304",
"__prefix": "di"
},
{
"_x": "680",
"_y": "304",
"__prefix": "di"
},
{
"_x": "680",
"_y": "258",
"__prefix": "di"
}
],
"_id": "SequenceFlow_0jui7b0_di",
"_bpmnElement": "SequenceFlow_0jui7b0",
"__prefix": "bpmndi"
}
],
"_id": "BPMNPlane_1",
"_bpmnElement": "liu_cheng",
"__prefix": "bpmndi"
},
"_id": "BPMNDiagram_1",
"__prefix": "bpmndi"
},
"_xmlns:bpmn2": "http://www.omg.org/spec/BPMN/20100524/MODEL",
"_xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"_xmlns:bpmndi": "http://www.omg.org/spec/BPMN/20100524/DI",
"_xmlns:dc": "http://www.omg.org/spec/DD/20100524/DC",
"_xmlns:flowable": "http://flowable.org/bpmn",
"_xmlns:di": "http://www.omg.org/spec/DD/20100524/DI",
"_id": "sample-diagram",
"_targetNamespace": "http://bpmn.io/schema/bpmn",
"_xsi:schemaLocation": "http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd",
"__prefix": "bpmn2"
}
}

14
gin_server_admin/config.yaml

@ -263,6 +263,20 @@ mysqlHealthReportDate:
log-mode: false log-mode: false
log-zap: "" log-zap: ""
#审批流程数据库
mysqlApprovalProcess:
path: '127.0.0.1:3306'
config: 'charset=utf8mb4&parseTime=True&loc=Local'
db-name: 'workflow'
username: 'root'
password: 'root'
max-idle-conns: 100
max-open-conns: 1500
log-mode: false
log-zap: ""
#企业微信相关设置 #企业微信相关设置
workwechatid: workwechatid:
companyid: 'ww02f310301953277a' #企业ID companyid: 'ww02f310301953277a' #企业ID

2
gin_server_admin/config/config.go

@ -24,6 +24,8 @@ type Server struct {
MysqlQADate Mysql `mapstructure:"mysqlQADate" json:"mysqlQADate" yaml:"mysqlQADate"` MysqlQADate Mysql `mapstructure:"mysqlQADate" json:"mysqlQADate" yaml:"mysqlQADate"`
MysqlBillboardDate Mysql `mapstructure:"mysqlBillboardDate" json:"mysqlBillboardDate" yaml:"mysqlBillboardDate"` MysqlBillboardDate Mysql `mapstructure:"mysqlBillboardDate" json:"mysqlBillboardDate" yaml:"mysqlBillboardDate"`
MysqlHealthReportDate Mysql `mapstructure:"mysqlHealthReportDate" json:"mysqlHealthReportDate" yaml:"mysqlHealthReportDate"` MysqlHealthReportDate Mysql `mapstructure:"mysqlHealthReportDate" json:"mysqlHealthReportDate" yaml:"mysqlHealthReportDate"`
MysqlApprovalProcess Mysql `mapstructure:"mysqlApprovalProcess" json:"mysqlApprovalProcess" yaml:"mysqlApprovalProcess"`
// oss // oss
Local Local `mapstructure:"local" json:"local" yaml:"local"` Local Local `mapstructure:"local" json:"local" yaml:"local"`
Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"` Qiniu Qiniu `mapstructure:"qiniu" json:"qiniu" yaml:"qiniu"`

1
gin_server_admin/global/global.go

@ -38,4 +38,5 @@ var (
GVA_DB_QADate *gorm.DB GVA_DB_QADate *gorm.DB
GVA_DB_BillboardDate *gorm.DB GVA_DB_BillboardDate *gorm.DB
GVA_DB_HealthReport *gorm.DB GVA_DB_HealthReport *gorm.DB
GVA_DB_ApprovalProcess *gorm.DB
) )

2
gin_server_admin/initialize/gorm.go

@ -152,6 +152,8 @@ func GormMysqlChange(setDataBaseName string) *gorm.DB {
m = global.GVA_CONFIG.MysqlBillboardDate m = global.GVA_CONFIG.MysqlBillboardDate
case "mysqlHealthReportDate": case "mysqlHealthReportDate":
m = global.GVA_CONFIG.MysqlHealthReportDate m = global.GVA_CONFIG.MysqlHealthReportDate
case "mysqlApprovalProcess":
m = global.GVA_CONFIG.MysqlApprovalProcess
default: default:
m = global.GVA_CONFIG.Mysql m = global.GVA_CONFIG.Mysql
} }

16
gin_server_admin/initialize/router.go

@ -37,14 +37,18 @@ func Routers() *gin.Engine {
// 方便统一添加路由组前缀 多服务器上线使用 // 方便统一添加路由组前缀 多服务器上线使用
//获取路由组实例 //获取路由组实例
systemRouter := router.RouterGroupApp.System systemRouter := router.RouterGroupApp.System // 注册基础功能路由
exampleRouter := router.RouterGroupApp.Example exampleRouter := router.RouterGroupApp.Example
autocodeRouter := router.RouterGroupApp.Autocode autocodeRouter := router.RouterGroupApp.Autocode
shiyanRouter := router.RouterGroupApp.Shiyan shiyanRouter := router.RouterGroupApp.Shiyan //实验模块
groupHandleRouter := router.RouterGroupApp.GroupHandle groupHandleRouter := router.RouterGroupApp.GroupHandle //健康上报
weChatCallBaclRouter := router.RouterGroupApp.WeChatCallBacl weChatCallBaclRouter := router.RouterGroupApp.WeChatCallBacl //企业微信相关
archiveApi := router.RouterGroupApp.ArchiveStructApi //文档信息处理
fileUpDownApi := router.RouterGroupApp.FileUpDownLoad //文件上传下载模块
PublicGroup := Router.Group("") PublicGroup := Router.Group("")
{ {
@ -67,6 +71,10 @@ func Routers() *gin.Engine {
shiyanRouter.InitShiyanRouter(PublicGroup) // 实验路由 shiyanRouter.InitShiyanRouter(PublicGroup) // 实验路由
weChatCallBaclRouter.InitGroupRouter(PublicGroup) // 微信回调 weChatCallBaclRouter.InitGroupRouter(PublicGroup) // 微信回调
archiveApi.InitGroupRouter(PublicGroup) // 文档管理
fileUpDownApi.InitGroupRouter(PublicGroup)
} }
PrivateGroup := Router.Group("") PrivateGroup := Router.Group("")
PrivateGroup.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler()) PrivateGroup.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())

6
gin_server_admin/main.go

@ -73,7 +73,11 @@ func main() {
} }
global.GVA_DB_HealthReport = initialize.GormMysqlChange("mysqlHealthReportDate") global.GVA_DB_HealthReport = initialize.GormMysqlChange("mysqlHealthReportDate")
if global.GVA_DB_HealthReport != nil { if global.GVA_DB_HealthReport != nil {
fmt.Printf("%v==>数据库mysqlBillboardDate初始化成功\n", global.GVA_DB_HealthReport) fmt.Printf("%v==>数据库mysqlHealthReportDate初始化成功\n", global.GVA_DB_HealthReport)
}
global.GVA_DB_ApprovalProcess = initialize.GormMysqlChange("mysqlApprovalProcess")
if global.GVA_DB_ApprovalProcess != nil {
fmt.Printf("%v==>数据库mysqlApprovalProcess初始化成功\n", global.GVA_DB_ApprovalProcess)
} }
// fmt.Printf("%v===>%v----->%v\n", global.GVA_CONFIG.WorkWechatId, global.GVA_CONFIG.WorkWechatSchool, global.GVA_CONFIG.WorkWechatMailList) // fmt.Printf("%v===>%v----->%v\n", global.GVA_CONFIG.WorkWechatId, global.GVA_CONFIG.WorkWechatSchool, global.GVA_CONFIG.WorkWechatMailList)
// fmt.Printf("%v===>%v----->%v\n", global.GVA_CONFIG.WorkWechatIds, global.GVA_CONFIG.WorkWechatSchools, global.GVA_CONFIG.WorkWechatMailLists)MysqlHealthReportDate // fmt.Printf("%v===>%v----->%v\n", global.GVA_CONFIG.WorkWechatIds, global.GVA_CONFIG.WorkWechatSchools, global.GVA_CONFIG.WorkWechatMailLists)MysqlHealthReportDate

39
gin_server_admin/model/approvalprocess/approval_process.go

@ -0,0 +1,39 @@
package approvalprocess
//审批流程图
type ApprovalProcess struct {
Id int64 `json:"id" gorm:"column:ap_id;type:bigint(20);;primaryKey;unique;not null;autoIncrement;index"`
Name string `json:"name" gorm:"column:ap_name;type:varchar(255);not null;comment:流程名称"`
Flow string `json:"flow" gorm:"column:ap_flow;type:longtext;not null;comment:流程主体"`
FlowJson string `json:"flowJson" gorm:"column:ap_flow_json;type:longtext;not null;comment:流程json"`
FlowXml string `json:"flowXml" gorm:"column:ap_flow_xml;type:longtext;not null;comment:流程xml"`
FlowSvg string `json:"flowSvg" gorm:"column:ap_flow_svg;type:longtext;not null;comment:流程svg"`
GetFlowJson string `json:"getFlowJson" gorm:"column:ap_get_flow_json;type:longtext;not null;comment:流程get_json"`
Time int64 `json:"time" gorm:"column:ap_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
EiteTime int64 `json:"eiteTime" gorm:"column:ap_eite;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"`
Sate int `json:"state" gorm:"column:ap_state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:启用,2:禁用;3:删除)"`
Batch int64 `json:"batch" gorm:"column:ap_batch;type:bigint(30) unsigned;default:0;not null;comment:批次"`
EditionNum string `json:"editionNum" gorm:"column:ap_edition_num;type:varchar(255);not null;comment:版本"`
}
func (ApprovalProcess *ApprovalProcess) TableName() string {
return "approval_process"
}
//审批记录
type ApprovalProcessLog struct {
Id int64 `json:"id" gorm:"column:apl_id;type:bigint(20);;primaryKey;unique;not null;autoIncrement;index"`
Process string `json:"process" gorm:"column:apl_process;type:longtext;not null;comment:当前执行的流程"`
CurrentNode string `json:"currentNode" gorm:"column:apl_current_node;type:varchar(255);not null;comment:当前审批节点"`
Title string `json:"title" gorm:"column:apl_title;type:varchar(255);not null;comment:审批名称"`
Time int64 `json:"time" gorm:"column:apl_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
EiteTime int64 `json:"eiteTime" gorm:"column:apl_eite_time;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"`
ProcessNum int64 `json:"processNum" gorm:"column:apl_process_num;type:bigint(20) unsigned;default:0;not null;comment:当前执行流程的批次"`
IsEnd int `json:"isEnd" gorm:"column:apl_is_end;type:tinyint(1) unsigned;default:1;not null;comment:流程是否结束(1:未结束;2:结束)"`
Sate int `json:"state" gorm:"column:apl_state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:草稿;2:正常;3:删除)"`
}
func (ApprovalProcessLog *ApprovalProcessLog) TableName() string {
return "approval_process_log"
}

120
gin_server_admin/model/archivesmodel/archives.go

@ -0,0 +1,120 @@
package archivesmodel
import (
"github.com/flipped-aurora/gin-vue-admin/server/global"
)
//文档分类相关
type ArchivesType struct {
Id int64 `json:"id" gorm:"column:at_id;type:bigint(20) unsigned;not null;comment:Id"`
Title string `json:"title" gorm:"column:at_title;type:varchar(255);comment:档案分类名称"`
Stater int `json:"stater" gorm:"column:at_stater;type:tinyint(1) unsigned;default:1;not null;comment:档案分类状态"`
ParentId int64 `json:"parentId" gorm:"column:at_parent_id;type:bigint(20) unsigned;default:0;not null;comment:档案分类父级"`
Time int64 `json:"time" gorm:"column:at_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
UID int64 `json:"uid" gorm:"column:at_uid;type:bigint(20) unsigned;default:0;not null;comment:添加人员"`
Sort int `json:"sort" gorm:"column:at_sort;type:smallint(3) unsigned;default:50;not null;comment:排序"`
}
func (ArchivesType *ArchivesType) TableName() string {
return "archives_type"
}
//获取文档详细信息
func (a *ArchivesType) GetArchiveTypeInfo() (err error) {
err = global.GVA_DB_Master.Where("at_id = ?", a.Id).First(&a).Error
return
}
//文档列表
type ArchiveFile struct {
Id int64 `json:"id" gorm:"column:g_id;type:bigint(20) unsigned;not null;comment:Id"`
Title string `json:"title" gorm:"column:g_title;type:varchar(255);not null;comment:标题"`
Key string `json:"key" gorm:"column:g_key;type:varchar(255);default:null;comment:关键字"`
Describe string `json:"describe" gorm:"column:g_describe;type:mediumtext;comment:描述"`
Parent int64 `json:"parent" gorm:"column:g_parent;type:bigint(20) unsigned;default:0;not null;comment:父级"`
ParentSun int64 `json:"parentSun" gorm:"column:g_parent_sun;type:bigint(20) unsigned;default:0;not null;comment:分类"`
Source int `json:"source" gorm:"column:g_source;type:tinyint(1) unsigned;default:1;not null;comment:文档来源(1:原创;2:转载)"`
SourceUrl string `json:"sourceUrl" gorm:"column:g_source_url;type:varchar(255);default:null;comment:转载地址"`
Thumbnail string `json:"thumbnail" gorm:"column:g_thumbnail;type:varchar(255);default:null;comment:缩略图"`
Sort int64 `json:"sort" gorm:"column:g_sort;type:bigint(20) unsigned;default:50;not null;comment:排序"`
Comment int `json:"comment" gorm:"column:g_comment;type:tinyint(1) unsigned;default:1;not null;comment:评论设置(1:允许评论;2:禁止评论)"`
VisitStrat int `json:"visitStrat" gorm:"column:g_visit_strat;type:tinyint(1) unsigned;default:1;not null;comment:访问权限(1:公开;2:分厂;3:工段;4:自定义)"`
State int `json:"state" gorm:"column:g_state;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:草稿;2:发表;3:下架;4:删除)"`
Time int64 `json:"time" gorm:"column:g_add_time;type:bigint(20) unsigned;default:0;not null;comment:创建时间"`
EiteTime int64 `json:"eiteTime" gorm:"column:g_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"`
UserKey int64 `json:"userKey" gorm:"column:g_user_key;type:bigint(20) unsigned;default:0;not null;comment:编辑人员"`
FactoryID int64 `json:"factoryId" gorm:"column:g_bf_id;type:bigint(20) unsigned;default:0;not null;comment:分厂"`
PositionID int64 `json:"positionId" gorm:"column:g_ws_id;type:bigint(20) unsigned;default:0;not null;comment:工段"`
TeamId int64 `json:"teamId" gorm:"column:g_team;type:bigint(20) unsigned;default:0;not null;comment:班组"`
DownloadState int `json:"downloadState" gorm:"column:g_download_state;type:tinyint(1) unsigned;default:1;not null;comment:是否允许下载(1:允许;2:禁止)"`
Read int64 `json:"read" gorm:"column:g_read;type:int(9) unsigned;default:0;not null;comment:阅读量"`
Discuss int64 `json:"discuss" gorm:"column:g_com_sum;type:int(9) unsigned;default:0;not null;comment:评论数"`
Collection int64 `json:"collection" gorm:"column:g_collection_sum;type:int(9) unsigned;default:0;not null;comment:收藏数"`
Likes int64 `json:"likes" gorm:"column:g_likes;type:int(9) unsigned;default:0;not null;comment:点赞数"`
Recommend int `json:"recommend" gorm:"column:g_recommend;type:tinyint(1) unsigned;default:2;not null;comment:推荐(1:推荐,2:不推荐)"`
Content string `json:"content" gorm:"column:g_content;type:longtext;comment:图文详情"`
StepOn int64 `json:"stepOn" gorm:"column:g_step_on;type:int(9) unsigned;default:0;not null;comment:踩数量"`
Ranges string `json:"ranges" gorm:"column:g_range;type:mediumtext;comment:自定义可见范围"`
WriteFactoryID int64 `json:"writeFactoryId" gorm:"column:g_write_bfid;type:bigint(20) unsigned;default:0;not null;comment:写入分厂"`
TextName string `json:"textName" gorm:"column:g_text_name;type:varchar(255);default:'';comment:正文文档名称"`
TestUrl string `json:"testUrl" gorm:"column:g_test_url;type:varchar(255);default:'';comment:正文文档URL"`
PhysicsPath string `json:"physicsPath" gorm:"column:g_physics_path;type:varchar(255);default:null;comment:物理地址"`
WriteGroup int64 `json:"writeGroup" gorm:"column:g_write_group;type:bigint(20) unsigned;default:3;not null;comment:写入人员组织"`
OuterLink string `json:"outerLink" gorm:"column:g_outer_link;type:varchar(255);default:'';comment:外部链接"`
}
func (ArchiveFile *ArchiveFile) TableName() string {
return "graphicform"
}
//获取文档详细信息
func (a *ArchiveFile) GetArchiveFileInfo() (err error) {
err = global.GVA_DB_BooImgkDate.Where("g_id = ?", a.Id).First(&a).Error
return
}
//文档属性
type BookAttribute struct {
Id int64 `json:"id" gorm:"column:b_id;type:bigint(20) unsigned;not null;autoIncrement;index;comment:Id"`
FileId int64 `json:"fileId" gorm:"column:b_file_id;type:bigint(20) unsigned;default:0;not null;comment:文档ID"`
UserId int64 `json:"userId" gorm:"column:b_userid;type:bigint(20) unsigned;default:0;not null;comment:阅读人ID"`
Time int64 `json:"time" gorm:"column:b_time;type:bigint(20) unsigned;default:0;not null;comment:阅读时间"`
Type int `json:"type" gorm:"column:b_type;type:tinyint(1) unsigned;default:1;not null;comment:类型 (1:阅读量;2:收藏数;3:赞;4:踩)"`
Stater int `json:"stater" gorm:"column:b_stater;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:有效;2:无效)"`
EiteTime int64 `json:"eiteTime" gorm:"column:b_eite_time;type:bigint(20) unsigned;default:0;not null;comment:编辑时间"`
Source int `json:"source" gorm:"column:b_source;type:tinyint(1) unsigned;default:1;not null;comment:来源(1:文档类;2:文档类评论;3:问题;4:问题答案;5:问题答案评论)"`
}
func (brchiveFile *BookAttribute) TableName() string {
return "bookattribute"
}
//获取文档详细信息
func (b *BookAttribute) GetBookAttributeInfo() (err error) {
err = global.GVA_DB_BooImgkDate.Where("b_id = ?", b.Id).First(&b).Error
return
}
//评论列表
type DiscussMsg struct {
Id int64 `json:"id" gorm:"column:dis_id;type:bigint(20) unsigned;not null;comment:Id"`
FileId int64 `json:"fileId" gorm:"column:dis_file_id;type:bigint(20) unsigned;default:0;not null;comment:文档ID"`
UserId int64 `json:"userId" gorm:"column:dis_user_id;type:bigint(20) unsigned;default:0;not null;comment:阅读人ID"`
Prent int64 `json:"prent" gorm:"column:dis_prent;type:bigint(20) unsigned;default:0;not null;comment:归属(0:评论源)"`
Content string `json:"cont" gorm:"column:dis_cont;type:text;comment:评论内容"`
Time int64 `json:"time" gorm:"column:dis_time;type:bigint(20) unsigned;default:0;not null;comment:时间"`
Stater int `json:"stater" gorm:"column:dis_stater;type:tinyint(1) unsigned;default:1;not null;comment:状态(1:审核;2:发布;3:下架;4:删除)"`
Source int `json:"source" gorm:"column:dis_source;type:tinyint(1) unsigned;default:1;not null;comment:来源(1:文档类;2:文档类评论;3:问题;4:问题答案;5:问题答案评论)"`
UserJson string `json:"userJson" gorm:"column:dis_user_json;type:mediumtext;comment:评论人基本信息"`
EiteTime int64 `json:"eiteTime" gorm:"column:dis_eite_time;type:bigint(20) unsigned;default:0;not null;comment:修改时间"`
}
func (DiscussMsg *DiscussMsg) TableName() string {
return "discussmsg"
}
//获取文档详细信息
func (d *DiscussMsg) GetDiscussMsgInfo() (err error) {
err = global.GVA_DB_BooImgkDate.Where("b_id = ?", d.Id).First(&d).Error
return
}

33
gin_server_admin/router/archive/archiverouter.go

@ -0,0 +1,33 @@
package archive
import (
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
"github.com/gin-gonic/gin"
)
type ArchiveStruct struct{}
func (a *ArchiveStruct) InitGroupRouter(Router *gin.RouterGroup) {
groupCodeRouter := Router.Group("archive")
var authorityApi = v1.ApiGroupApp.ArchiveApi.ArchiveApiHandle
{
groupCodeRouter.POST("", authorityApi.Index)
groupCodeRouter.GET("", authorityApi.Index)
groupCodeRouter.POST("/", authorityApi.Index)
groupCodeRouter.GET("/", authorityApi.Index)
groupCodeRouter.POST("archivetypelist", authorityApi.ArchiveTypeList) //获取文档栏目列表
groupCodeRouter.POST("addarchivetype", authorityApi.AddArchive) //添加栏目
groupCodeRouter.POST("getarchiveinfo", authorityApi.GetArchiveInfo) //获取单个栏目信息
groupCodeRouter.POST("eitearchivestate", authorityApi.EiteArchiveState) //改变栏目状态
groupCodeRouter.POST("eitearchiveinfo", authorityApi.EiteArchiveInfo) //修改栏目信息
// groupCodeRouter.POST("archivefilelist", authorityApi.ArchiveFileList) //文章列表
}
var arcjiveFileApi = v1.ApiGroupApp.ArchiveApi.GraphicInformation
{
groupCodeRouter.POST("archivefilelist", arcjiveFileApi.ArchiveFileList) //文章列表
}
}

5
gin_server_admin/router/archive/enter.go

@ -0,0 +1,5 @@
package archive
type RouterGroup struct {
ArchiveStruct
}

16
gin_server_admin/router/enter.go

@ -1,21 +1,25 @@
package router package router
import ( import (
"github.com/flipped-aurora/gin-vue-admin/server/router/archive"
"github.com/flipped-aurora/gin-vue-admin/server/router/autocode" "github.com/flipped-aurora/gin-vue-admin/server/router/autocode"
"github.com/flipped-aurora/gin-vue-admin/server/router/example" "github.com/flipped-aurora/gin-vue-admin/server/router/example"
"github.com/flipped-aurora/gin-vue-admin/server/router/examtestpage" "github.com/flipped-aurora/gin-vue-admin/server/router/examtestpage"
"github.com/flipped-aurora/gin-vue-admin/server/router/shiyan" "github.com/flipped-aurora/gin-vue-admin/server/router/shiyan"
"github.com/flipped-aurora/gin-vue-admin/server/router/system" "github.com/flipped-aurora/gin-vue-admin/server/router/system"
"github.com/flipped-aurora/gin-vue-admin/server/router/uploaddownload"
"github.com/flipped-aurora/gin-vue-admin/server/router/wechatcallbackrouter" "github.com/flipped-aurora/gin-vue-admin/server/router/wechatcallbackrouter"
) )
type RouterGroup struct { type RouterGroup struct {
System system.RouterGroup System system.RouterGroup
Example example.RouterGroup Example example.RouterGroup
Autocode autocode.RouterGroup Autocode autocode.RouterGroup
Shiyan shiyan.RouterGroup Shiyan shiyan.RouterGroup
GroupHandle examtestpage.RouterGroup GroupHandle examtestpage.RouterGroup
WeChatCallBacl wechatcallbackrouter.RouterGroup WeChatCallBacl wechatcallbackrouter.RouterGroup
ArchiveStructApi archive.RouterGroup
FileUpDownLoad uploaddownload.RouterGroup //文件上传下载
} }
var RouterGroupApp = new(RouterGroup) var RouterGroupApp = new(RouterGroup)

4
gin_server_admin/router/shiyan/sys_shiyan.go

@ -13,6 +13,10 @@ func (s *ShiyanRouter) InitShiyanRouter(Router *gin.RouterGroup) {
{ {
shiyanCodeRouter.POST("/", authorityApi.AddBaseMenu) // 删除回滚记录 shiyanCodeRouter.POST("/", authorityApi.AddBaseMenu) // 删除回滚记录
shiyanCodeRouter.POST("/digui", authorityApi.DiGui) shiyanCodeRouter.POST("/digui", authorityApi.DiGui)
shiyanCodeRouter.POST("/datamap", authorityApi.GormToMap)
shiyanCodeRouter.POST("/jsonstr", authorityApi.ReadJsonFiles)
shiyanCodeRouter.POST("/xml", authorityApi.XmlToJson)
shiyanCodeRouter.POST("/approve", authorityApi.EstablishApprove) //审批操作
} }
} }

5
gin_server_admin/router/uploaddownload/enter.go

@ -0,0 +1,5 @@
package uploaddownload
type RouterGroup struct {
FileUploadDownload
}

19
gin_server_admin/router/uploaddownload/fileuplaoddown.go

@ -0,0 +1,19 @@
package uploaddownload
import (
v1 "github.com/flipped-aurora/gin-vue-admin/server/api/v1"
"github.com/gin-gonic/gin"
)
type FileUploadDownload struct{}
func (f *FileUploadDownload) InitGroupRouter(Router *gin.RouterGroup) {
groupCodeRouter := Router.Group("upordown")
var authorityApi = v1.ApiGroupApp.FileUploadOrDownloadApi.FileUploadDownload
{
groupCodeRouter.POST("", authorityApi.LongRangeFileUpload) //上传文件
// groupCodeRouter.POST("archivefilelist", authorityApi.ArchiveFileList) //文章列表
}
}

99
gin_server_admin/shenpi-2.xml

@ -0,0 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions
xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:flowable="http://flowable.org/bpmn"
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"
id="sample-diagram"
targetNamespace="http://bpmn.io/schema/bpmn"
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd">
<bpmn2:process id="liu_cheng" name="流程">
<bpmn2:documentation>流程描述</bpmn2:documentation>
<bpmn2:startEvent id="begin" name="开始">
<bpmn2:outgoing>SequenceFlow_1ubjhis</bpmn2:outgoing>
<bpmn2:outgoing>SequenceFlow_1g5ddlz</bpmn2:outgoing>
</bpmn2:startEvent>
<bpmn2:userTask id="shen_pi_1" name="审批1" flowable:assignee="1001">
<bpmn2:incoming>SequenceFlow_1ubjhis</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_042i1f0</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:userTask id="shen_pi_2" name="审批2" flowable:candidateGroups="personnel">
<bpmn2:incoming>SequenceFlow_042i1f0</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_0kxnuqq</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:userTask id="shen_pi_3" name="审批3" flowable:candidateUsers="1001,1002">
<bpmn2:incoming>SequenceFlow_1g5ddlz</bpmn2:incoming>
<bpmn2:outgoing>SequenceFlow_1rrokxg</bpmn2:outgoing>
</bpmn2:userTask>
<bpmn2:endEvent id="end" name="结束">
<bpmn2:incoming>SequenceFlow_0kxnuqq</bpmn2:incoming>
<bpmn2:incoming>SequenceFlow_1rrokxg</bpmn2:incoming>
</bpmn2:endEvent>
<bpmn2:sequenceFlow id="SequenceFlow_1ubjhis" sourceRef="begin" targetRef="shen_pi_1" />
<bpmn2:sequenceFlow id="SequenceFlow_1g5ddlz" sourceRef="begin" targetRef="shen_pi_3" />
<bpmn2:sequenceFlow id="SequenceFlow_042i1f0" sourceRef="shen_pi_1" targetRef="shen_pi_2" />
<bpmn2:sequenceFlow id="SequenceFlow_0kxnuqq" sourceRef="shen_pi_2" targetRef="end" />
<bpmn2:sequenceFlow id="SequenceFlow_1rrokxg" sourceRef="shen_pi_3" targetRef="end" />
</bpmn2:process>
<bpmndi:BPMNDiagram id="BPMNDiagram_1">
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="liu_cheng">
<bpmndi:BPMNShape id="StartEvent_01ydzqe_di" bpmnElement="begin">
<dc:Bounds x="102" y="162" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="109" y="205" width="22" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_0s3acj5_di" bpmnElement="shen_pi_1">
<dc:Bounds x="210" y="30" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_0lps88c_di" bpmnElement="shen_pi_2">
<dc:Bounds x="470" y="30" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="UserTask_0dhr1b8_di" bpmnElement="shen_pi_3">
<dc:Bounds x="310" y="270" width="100" height="80" />
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="EndEvent_1s5z0sm_di" bpmnElement="end">
<dc:Bounds x="642" y="162" width="36" height="36" />
<bpmndi:BPMNLabel>
<dc:Bounds x="649" y="205" width="22" height="14" />
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="SequenceFlow_1ubjhis_di" bpmnElement="SequenceFlow_1ubjhis">
<di:waypoint x="138" y="180" />
<di:waypoint x="174" y="180" />
<di:waypoint x="174" y="70" />
<di:waypoint x="210" y="70" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1g5ddlz_di" bpmnElement="SequenceFlow_1g5ddlz">
<di:waypoint x="138" y="180" />
<di:waypoint x="224" y="180" />
<di:waypoint x="224" y="310" />
<di:waypoint x="310" y="310" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_042i1f0_di" bpmnElement="SequenceFlow_042i1f0">
<di:waypoint x="310" y="70" />
<di:waypoint x="470" y="70" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_0kxnuqq_di" bpmnElement="SequenceFlow_0kxnuqq">
<di:waypoint x="570" y="70" />
<di:waypoint x="606" y="70" />
<di:waypoint x="606" y="180" />
<di:waypoint x="642" y="180" />
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge id="SequenceFlow_1rrokxg_di" bpmnElement="SequenceFlow_1rrokxg">
<di:waypoint x="410" y="310" />
<di:waypoint x="526" y="310" />
<di:waypoint x="526" y="180" />
<di:waypoint x="642" y="180" />
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</bpmn2:definitions>

527
gin_server_admin/shenpi-5.json

@ -0,0 +1,527 @@
{
"code": 103,
"data": {
"XMLName": {
"Space": "http://www.omg.org/spec/BPMN/20100524/MODEL",
"Local": "definitions"
},
"Text": "",
"Bpmn2": "http://www.omg.org/spec/BPMN/20100524/MODEL",
"Xsi": "http://www.w3.org/2001/XMLSchema-instance",
"Bpmndi": "http://www.omg.org/spec/BPMN/20100524/DI",
"Dc": "http://www.omg.org/spec/DD/20100524/DC",
"Flowable": "http://flowable.org/bpmn",
"Di": "http://www.omg.org/spec/DD/20100524/DI",
"ID": "sample-diagram",
"TargetNamespace": "http://bpmn.io/schema/bpmn",
"SchemaLocation": "http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd",
"Process": {
"Text": "",
"ID": "流程ID",
"Name": "流程名称",
"Documentation": {
"Text": "流程描述"
},
"StartEvent": {
"Text": "",
"ID": "开始ID",
"Name": "开始名称",
"Outgoing": [
{
"Text": "条件1——ID"
},
{
"Text": "条件2——ID"
}
]
},
"UserTask": [
{
"Text": "",
"ID": "审批1——ID",
"Name": "审批1——名称(指定人员)",
"Assignee": "1001",
"CandidateGroups": "",
"CandidateUsers": "",
"Incoming": [
{
"Text": "条件1——ID"
}
],
"Outgoing": [
{
"Text": "条件4——ID"
},
{
"Text": "条件3——ID"
}
]
},
{
"Text": "",
"ID": "审批2——ID",
"Name": "审批2名称——(候选人)",
"Assignee": "",
"CandidateGroups": "",
"CandidateUsers": "1001,1002,1003",
"Incoming": [
{
"Text": "条件4——ID"
}
],
"Outgoing": [
{
"Text": "结束指向1——ID"
}
]
},
{
"Text": "",
"ID": "审批3——ID",
"Name": "审批3——名称(岗位)",
"Assignee": "",
"CandidateGroups": "personnel",
"CandidateUsers": "",
"Incoming": [
{
"Text": "条件2——ID"
}
],
"Outgoing": [
{
"Text": "条件6——ID"
}
]
},
{
"Text": "",
"ID": "审批4——ID",
"Name": "审批4名称——(经理)",
"Assignee": "",
"CandidateGroups": "manager",
"CandidateUsers": "",
"Incoming": [
{
"Text": "条件6——ID"
},
{
"Text": "条件3——ID"
}
],
"Outgoing": [
{
"Text": "结束指向2——ID"
}
]
}
],
"EndEvent": {
"Text": "",
"ID": "结束ID",
"Name": "结束名称",
"Incoming": [
{
"Text": "结束指向1——ID"
},
{
"Text": "结束指向2——ID"
}
]
},
"SequenceFlow": [
{
"Text": "",
"ID": "条件1——ID",
"Name": "条件1——名称",
"SourceRef": "开始ID",
"TargetRef": "审批1——ID",
"ConditionExpression": {
"Text": "id>100",
"Type": "bpmn2:tFormalExpression"
}
},
{
"Text": "",
"ID": "条件4——ID",
"Name": "条件4——名称",
"SourceRef": "审批1——ID",
"TargetRef": "审批2——ID",
"ConditionExpression": {
"Text": "!=100",
"Type": "bpmn2:tFormalExpression"
}
},
{
"Text": "",
"ID": "结束指向1——ID",
"Name": "结束指向1——名称",
"SourceRef": "审批2——ID",
"TargetRef": "结束ID",
"ConditionExpression": {
"Text": "lll",
"Type": "bpmn2:tFormalExpression"
}
},
{
"Text": "",
"ID": "条件2——ID",
"Name": "条件2——ID",
"SourceRef": "开始ID",
"TargetRef": "审批3——ID",
"ConditionExpression": {
"Text": "ID<100",
"Type": "bpmn2:tFormalExpression"
}
},
{
"Text": "",
"ID": "条件6——ID",
"Name": "条件6——名称",
"SourceRef": "审批3——ID",
"TargetRef": "审批4——ID",
"ConditionExpression": {
"Text": "250",
"Type": "bpmn2:tFormalExpression"
}
},
{
"Text": "",
"ID": "结束指向2——ID",
"Name": "结束指向2——名称",
"SourceRef": "审批4——ID",
"TargetRef": "结束ID",
"ConditionExpression": {
"Text": "rrrr",
"Type": "bpmn2:tFormalExpression"
}
},
{
"Text": "",
"ID": "条件3——ID",
"Name": "条件3——名称",
"SourceRef": "审批1——ID",
"TargetRef": "审批4——ID",
"ConditionExpression": {
"Text": "ID=100",
"Type": "bpmn2:tFormalExpression"
}
}
]
},
"BPMNDiagram": {
"Text": "",
"ID": "BPMNDiagram_1",
"BPMNPlane": {
"Text": "",
"ID": "BPMNPlane_1",
"BpmnElement": "流程ID",
"BPMNShape": [
{
"Text": "",
"ID": "StartEvent_01ydzqe_di",
"BpmnElement": "开始ID",
"Bounds": {
"Text": "",
"X": "142",
"Y": "212",
"Width": "36",
"Height": "36"
},
"BPMNLabel": {
"Text": "",
"Bounds": {
"Text": "",
"X": "149",
"Y": "255",
"Width": "22",
"Height": "14"
}
}
},
{
"Text": "",
"ID": "UserTask_10pidv1_di",
"BpmnElement": "审批1——ID",
"Bounds": {
"Text": "",
"X": "220",
"Y": "90",
"Width": "100",
"Height": "80"
},
"BPMNLabel": {
"Text": "",
"Bounds": {
"Text": "",
"X": "",
"Y": "",
"Width": "",
"Height": ""
}
}
},
{
"Text": "",
"ID": "UserTask_17p1zqm_di",
"BpmnElement": "审批2——ID",
"Bounds": {
"Text": "",
"X": "440",
"Y": "90",
"Width": "100",
"Height": "80"
},
"BPMNLabel": {
"Text": "",
"Bounds": {
"Text": "",
"X": "",
"Y": "",
"Width": "",
"Height": ""
}
}
},
{
"Text": "",
"ID": "UserTask_0vur320_di",
"BpmnElement": "审批3——ID",
"Bounds": {
"Text": "",
"X": "220",
"Y": "330",
"Width": "100",
"Height": "80"
},
"BPMNLabel": {
"Text": "",
"Bounds": {
"Text": "",
"X": "",
"Y": "",
"Width": "",
"Height": ""
}
}
},
{
"Text": "",
"ID": "UserTask_10m2y3g_di",
"BpmnElement": "审批4——ID",
"Bounds": {
"Text": "",
"X": "440",
"Y": "330",
"Width": "100",
"Height": "80"
},
"BPMNLabel": {
"Text": "",
"Bounds": {
"Text": "",
"X": "",
"Y": "",
"Width": "",
"Height": ""
}
}
},
{
"Text": "",
"ID": "EndEvent_1ss6r1e_di",
"BpmnElement": "结束ID",
"Bounds": {
"Text": "",
"X": "632",
"Y": "222",
"Width": "36",
"Height": "36"
},
"BPMNLabel": {
"Text": "",
"Bounds": {
"Text": "",
"X": "639",
"Y": "265",
"Width": "22",
"Height": "14"
}
}
}
],
"BPMNEdge": [
{
"Text": "",
"ID": "SequenceFlow_1a144xd_di",
"BpmnElement": "条件1——ID",
"Waypoint": [
{
"Text": "",
"X": "178",
"Y": "230"
},
{
"Text": "",
"X": "199",
"Y": "230"
},
{
"Text": "",
"X": "199",
"Y": "130"
},
{
"Text": "",
"X": "220",
"Y": "130"
}
]
},
{
"Text": "",
"ID": "SequenceFlow_1f488nn_di",
"BpmnElement": "条件4——ID",
"Waypoint": [
{
"Text": "",
"X": "320",
"Y": "130"
},
{
"Text": "",
"X": "440",
"Y": "130"
}
]
},
{
"Text": "",
"ID": "SequenceFlow_1su08qu_di",
"BpmnElement": "结束指向1——ID",
"Waypoint": [
{
"Text": "",
"X": "540",
"Y": "130"
},
{
"Text": "",
"X": "586",
"Y": "130"
},
{
"Text": "",
"X": "586",
"Y": "230"
},
{
"Text": "",
"X": "635",
"Y": "230"
}
]
},
{
"Text": "",
"ID": "SequenceFlow_1sn3aag_di",
"BpmnElement": "条件2——ID",
"Waypoint": [
{
"Text": "",
"X": "178",
"Y": "230"
},
{
"Text": "",
"X": "199",
"Y": "230"
},
{
"Text": "",
"X": "199",
"Y": "370"
},
{
"Text": "",
"X": "220",
"Y": "370"
}
]
},
{
"Text": "",
"ID": "SequenceFlow_13unl6c_di",
"BpmnElement": "条件6——ID",
"Waypoint": [
{
"Text": "",
"X": "320",
"Y": "370"
},
{
"Text": "",
"X": "440",
"Y": "370"
}
]
},
{
"Text": "",
"ID": "SequenceFlow_1y6oad7_di",
"BpmnElement": "结束指向2——ID",
"Waypoint": [
{
"Text": "",
"X": "540",
"Y": "370"
},
{
"Text": "",
"X": "586",
"Y": "370"
},
{
"Text": "",
"X": "586",
"Y": "250"
},
{
"Text": "",
"X": "635",
"Y": "250"
}
]
},
{
"Text": "",
"ID": "SequenceFlow_18hsq1p_di",
"BpmnElement": "条件3——ID",
"Waypoint": [
{
"Text": "",
"X": "320",
"Y": "160"
},
{
"Text": "",
"X": "380",
"Y": "160"
},
{
"Text": "",
"X": "380",
"Y": "340"
},
{
"Text": "",
"X": "440",
"Y": "340"
}
]
}
]
}
}
},
"msg": "参数错误!"
}

501
gin_server_admin/shenpi.json

@ -0,0 +1,501 @@
{
"XMLName": {
"Space": "http://www.omg.org/spec/BPMN/20100524/MODEL",
"Local": "definitions"
},
"Text": "",
"Bpmn2": "http://www.omg.org/spec/BPMN/20100524/MODEL",
"Xsi": "http://www.w3.org/2001/XMLSchema-instance",
"Bpmndi": "http://www.omg.org/spec/BPMN/20100524/DI",
"Dc": "http://www.omg.org/spec/DD/20100524/DC",
"Flowable": "http://flowable.org/bpmn",
"Di": "http://www.omg.org/spec/DD/20100524/DI",
"ID": "sample-diagram",
"TargetNamespace": "http://bpmn.io/schema/bpmn",
"SchemaLocation": "http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd",
"Process": {
"Text": "",
"ID": "流程ID",
"Name": "流程名称",
"Documentation": {
"Text": "流程描述"
},
"StartEvent": {
"Text": "",
"ID": "开始ID",
"Name": "开始名称",
"Outgoing": [
{
"Text": "条件1——ID"
},
{
"Text": "条件2——ID"
}
]
},
"UserTask": [
{
"Text": "",
"ID": "审批1——ID",
"Name": "审批1——名称(指定人员)",
"Assignee": "1001",
"CandidateGroups": "",
"CandidateUsers": "",
"Incoming": {
"Text": "条件1——ID"
},
"Outgoing": {
"Text": "条件3——ID"
}
},
{
"Text": "",
"ID": "审批2——ID",
"Name": "审批2名称——(候选人)",
"Assignee": "",
"CandidateGroups": "",
"CandidateUsers": "1002,1003,1001",
"Incoming": {
"Text": "SequenceFlow_1f488nn"
},
"Outgoing": {
"Text": "SequenceFlow_1su08qu"
}
},
{
"Text": "",
"ID": "审批3——ID",
"Name": "审批3——名称(岗位)",
"Assignee": "",
"CandidateGroups": "personnel",
"CandidateUsers": "",
"Incoming": {
"Text": "条件2——ID"
},
"Outgoing": {
"Text": "SequenceFlow_13unl6c"
}
},
{
"Text": "",
"ID": "审批4——ID",
"Name": "审批4名称——(经理)",
"Assignee": "",
"CandidateGroups": "manager",
"CandidateUsers": "",
"Incoming": {
"Text": "条件3——ID"
},
"Outgoing": {
"Text": "SequenceFlow_1y6oad7"
}
}
],
"EndEvent": {
"Text": "",
"ID": "结束ID",
"Name": "结束名称",
"Incoming": [
{
"Text": "SequenceFlow_1su08qu"
},
{
"Text": "SequenceFlow_1y6oad7"
}
]
},
"SequenceFlow": [
{
"Text": "",
"ID": "条件1——ID",
"Name": "条件1——名称",
"SourceRef": "开始ID",
"TargetRef": "审批1——ID",
"ConditionExpression": {
"Text": "id>100",
"Type": "bpmn2:tFormalExpression"
}
},
{
"Text": "",
"ID": "SequenceFlow_1f488nn",
"Name": "",
"SourceRef": "审批1——ID",
"TargetRef": "审批2——ID",
"ConditionExpression": {
"Text": "",
"Type": ""
}
},
{
"Text": "",
"ID": "SequenceFlow_1su08qu",
"Name": "",
"SourceRef": "审批2——ID",
"TargetRef": "结束ID",
"ConditionExpression": {
"Text": "",
"Type": ""
}
},
{
"Text": "",
"ID": "条件2——ID",
"Name": "条件2——ID",
"SourceRef": "开始ID",
"TargetRef": "审批3——ID",
"ConditionExpression": {
"Text": "ID<100",
"Type": "bpmn2:tFormalExpression"
}
},
{
"Text": "",
"ID": "SequenceFlow_13unl6c",
"Name": "",
"SourceRef": "审批3——ID",
"TargetRef": "审批4——ID",
"ConditionExpression": {
"Text": "",
"Type": ""
}
},
{
"Text": "",
"ID": "SequenceFlow_1y6oad7",
"Name": "",
"SourceRef": "审批4——ID",
"TargetRef": "结束ID",
"ConditionExpression": {
"Text": "",
"Type": ""
}
},
{
"Text": "",
"ID": "条件3——ID",
"Name": "条件3——名称",
"SourceRef": "审批1——ID",
"TargetRef": "审批4——ID",
"ConditionExpression": {
"Text": "ID=100",
"Type": "bpmn2:tFormalExpression"
}
}
]
},
"BPMNDiagram": {
"Text": "",
"ID": "BPMNDiagram_1",
"BPMNPlane": {
"Text": "",
"ID": "BPMNPlane_1",
"BpmnElement": "流程ID",
"BPMNShape": [
{
"Text": "",
"ID": "StartEvent_01ydzqe_di",
"BpmnElement": "开始ID",
"Bounds": {
"Text": "",
"X": "142",
"Y": "212",
"Width": "36",
"Height": "36"
},
"BPMNLabel": {
"Text": "",
"Bounds": {
"Text": "",
"X": "149",
"Y": "255",
"Width": "22",
"Height": "14"
}
}
},
{
"Text": "",
"ID": "UserTask_10pidv1_di",
"BpmnElement": "审批1——ID",
"Bounds": {
"Text": "",
"X": "220",
"Y": "90",
"Width": "100",
"Height": "80"
},
"BPMNLabel": {
"Text": "",
"Bounds": {
"Text": "",
"X": "",
"Y": "",
"Width": "",
"Height": ""
}
}
},
{
"Text": "",
"ID": "UserTask_17p1zqm_di",
"BpmnElement": "审批2——ID",
"Bounds": {
"Text": "",
"X": "440",
"Y": "90",
"Width": "100",
"Height": "80"
},
"BPMNLabel": {
"Text": "",
"Bounds": {
"Text": "",
"X": "",
"Y": "",
"Width": "",
"Height": ""
}
}
},
{
"Text": "",
"ID": "UserTask_0vur320_di",
"BpmnElement": "审批3——ID",
"Bounds": {
"Text": "",
"X": "220",
"Y": "330",
"Width": "100",
"Height": "80"
},
"BPMNLabel": {
"Text": "",
"Bounds": {
"Text": "",
"X": "",
"Y": "",
"Width": "",
"Height": ""
}
}
},
{
"Text": "",
"ID": "UserTask_10m2y3g_di",
"BpmnElement": "审批4——ID",
"Bounds": {
"Text": "",
"X": "440",
"Y": "330",
"Width": "100",
"Height": "80"
},
"BPMNLabel": {
"Text": "",
"Bounds": {
"Text": "",
"X": "",
"Y": "",
"Width": "",
"Height": ""
}
}
},
{
"Text": "",
"ID": "EndEvent_1ss6r1e_di",
"BpmnElement": "结束ID",
"Bounds": {
"Text": "",
"X": "632",
"Y": "222",
"Width": "36",
"Height": "36"
},
"BPMNLabel": {
"Text": "",
"Bounds": {
"Text": "",
"X": "639",
"Y": "265",
"Width": "22",
"Height": "14"
}
}
}
],
"BPMNEdge": [
{
"Text": "",
"ID": "SequenceFlow_1a144xd_di",
"BpmnElement": "条件1——ID",
"Waypoint": [
{
"Text": "",
"X": "178",
"Y": "230"
},
{
"Text": "",
"X": "199",
"Y": "230"
},
{
"Text": "",
"X": "199",
"Y": "130"
},
{
"Text": "",
"X": "220",
"Y": "130"
}
]
},
{
"Text": "",
"ID": "SequenceFlow_1f488nn_di",
"BpmnElement": "SequenceFlow_1f488nn",
"Waypoint": [
{
"Text": "",
"X": "320",
"Y": "130"
},
{
"Text": "",
"X": "440",
"Y": "130"
}
]
},
{
"Text": "",
"ID": "SequenceFlow_1su08qu_di",
"BpmnElement": "SequenceFlow_1su08qu",
"Waypoint": [
{
"Text": "",
"X": "540",
"Y": "130"
},
{
"Text": "",
"X": "586",
"Y": "130"
},
{
"Text": "",
"X": "586",
"Y": "230"
},
{
"Text": "",
"X": "635",
"Y": "230"
}
]
},
{
"Text": "",
"ID": "SequenceFlow_1sn3aag_di",
"BpmnElement": "条件2——ID",
"Waypoint": [
{
"Text": "",
"X": "178",
"Y": "230"
},
{
"Text": "",
"X": "199",
"Y": "230"
},
{
"Text": "",
"X": "199",
"Y": "370"
},
{
"Text": "",
"X": "220",
"Y": "370"
}
]
},
{
"Text": "",
"ID": "SequenceFlow_13unl6c_di",
"BpmnElement": "SequenceFlow_13unl6c",
"Waypoint": [
{
"Text": "",
"X": "320",
"Y": "370"
},
{
"Text": "",
"X": "440",
"Y": "370"
}
]
},
{
"Text": "",
"ID": "SequenceFlow_1y6oad7_di",
"BpmnElement": "SequenceFlow_1y6oad7",
"Waypoint": [
{
"Text": "",
"X": "540",
"Y": "370"
},
{
"Text": "",
"X": "586",
"Y": "370"
},
{
"Text": "",
"X": "586",
"Y": "250"
},
{
"Text": "",
"X": "635",
"Y": "250"
}
]
},
{
"Text": "",
"ID": "SequenceFlow_18hsq1p_di",
"BpmnElement": "条件3——ID",
"Waypoint": [
{
"Text": "",
"X": "320",
"Y": "160"
},
{
"Text": "",
"X": "380",
"Y": "160"
},
{
"Text": "",
"X": "380",
"Y": "340"
},
{
"Text": "",
"X": "440",
"Y": "340"
}
]
}
]
}
}
}

347
gin_server_admin/shenpi1.json

@ -0,0 +1,347 @@
{
"definitions": {
"process": {
"documentation": {
"__prefix": "bpmn2",
"__text": "流程描述"
},
"startEvent": {
"outgoing": [
{
"__prefix": "bpmn2",
"__text": "SequenceFlow_1ubjhis"
},
{
"__prefix": "bpmn2",
"__text": "SequenceFlow_1g5ddlz"
}
],
"id": "begin",
"name": "开始",
"__prefix": "bpmn2"
},
"userTask": [
{
"incoming": {
"__prefix": "bpmn2",
"__text": "SequenceFlow_1ubjhis"
},
"outgoing": {
"__prefix": "bpmn2",
"__text": "SequenceFlow_042i1f0"
},
"id": "shen_pi_1",
"name": "审批1",
"flowable:assignee": "1001",
"__prefix": "bpmn2"
},
{
"incoming": {
"__prefix": "bpmn2",
"__text": "SequenceFlow_042i1f0"
},
"outgoing": {
"__prefix": "bpmn2",
"__text": "SequenceFlow_0kxnuqq"
},
"id": "shen_pi_2",
"name": "审批2",
"flowable:candidateGroups": "personnel",
"__prefix": "bpmn2"
},
{
"incoming": {
"__prefix": "bpmn2",
"__text": "SequenceFlow_1g5ddlz"
},
"outgoing": {
"__prefix": "bpmn2",
"__text": "SequenceFlow_1rrokxg"
},
"id": "shen_pi_3",
"name": "审批3",
"flowable:candidateUsers": "1001,1002",
"__prefix": "bpmn2"
}
],
"endEvent": {
"incoming": [
{
"__prefix": "bpmn2",
"__text": "SequenceFlow_0kxnuqq"
},
{
"__prefix": "bpmn2",
"__text": "SequenceFlow_1rrokxg"
}
],
"id": "end",
"name": "结束",
"__prefix": "bpmn2"
},
"sequenceFlow": [
{
"id": "SequenceFlow_1ubjhis",
"sourceRef": "begin",
"targetRef": "shen_pi_1",
"__prefix": "bpmn2"
},
{
"id": "SequenceFlow_1g5ddlz",
"sourceRef": "begin",
"targetRef": "shen_pi_3",
"__prefix": "bpmn2"
},
{
"id": "SequenceFlow_042i1f0",
"sourceRef": "shen_pi_1",
"targetRef": "shen_pi_2",
"__prefix": "bpmn2"
},
{
"id": "SequenceFlow_0kxnuqq",
"sourceRef": "shen_pi_2",
"targetRef": "end",
"__prefix": "bpmn2"
},
{
"id": "SequenceFlow_1rrokxg",
"sourceRef": "shen_pi_3",
"targetRef": "end",
"__prefix": "bpmn2"
}
],
"id": "liu_cheng",
"name": "流程",
"__prefix": "bpmn2"
},
"BPMNDiagram": {
"BPMNPlane": {
"BPMNShape": [
{
"Bounds": {
"x": "102",
"y": "162",
"width": "36",
"height": "36",
"__prefix": "dc"
},
"BPMNLabel": {
"Bounds": {
"x": "109",
"y": "205",
"width": "22",
"height": "14",
"__prefix": "dc"
},
"__prefix": "bpmndi"
},
"id": "StartEvent_01ydzqe_di",
"bpmnElement": "begin",
"__prefix": "bpmndi"
},
{
"Bounds": {
"x": "210",
"y": "30",
"width": "100",
"height": "80",
"__prefix": "dc"
},
"id": "UserTask_0s3acj5_di",
"bpmnElement": "shen_pi_1",
"__prefix": "bpmndi"
},
{
"Bounds": {
"x": "470",
"y": "30",
"width": "100",
"height": "80",
"__prefix": "dc"
},
"id": "UserTask_0lps88c_di",
"bpmnElement": "shen_pi_2",
"__prefix": "bpmndi"
},
{
"Bounds": {
"x": "310",
"y": "270",
"width": "100",
"height": "80",
"__prefix": "dc"
},
"id": "UserTask_0dhr1b8_di",
"bpmnElement": "shen_pi_3",
"__prefix": "bpmndi"
},
{
"Bounds": {
"x": "642",
"y": "162",
"width": "36",
"height": "36",
"__prefix": "dc"
},
"BPMNLabel": {
"Bounds": {
"x": "649",
"y": "205",
"width": "22",
"height": "14",
"__prefix": "dc"
},
"__prefix": "bpmndi"
},
"id": "EndEvent_1s5z0sm_di",
"bpmnElement": "end",
"__prefix": "bpmndi"
}
],
"BPMNEdge": [
{
"waypoint": [
{
"x": "138",
"y": "180",
"__prefix": "di"
},
{
"x": "174",
"y": "180",
"__prefix": "di"
},
{
"x": "174",
"y": "70",
"__prefix": "di"
},
{
"x": "210",
"y": "70",
"__prefix": "di"
}
],
"id": "SequenceFlow_1ubjhis_di",
"bpmnElement": "SequenceFlow_1ubjhis",
"__prefix": "bpmndi"
},
{
"waypoint": [
{
"x": "138",
"y": "180",
"__prefix": "di"
},
{
"x": "224",
"y": "180",
"__prefix": "di"
},
{
"x": "224",
"y": "310",
"__prefix": "di"
},
{
"x": "310",
"y": "310",
"__prefix": "di"
}
],
"id": "SequenceFlow_1g5ddlz_di",
"bpmnElement": "SequenceFlow_1g5ddlz",
"__prefix": "bpmndi"
},
{
"waypoint": [
{
"x": "310",
"y": "70",
"__prefix": "di"
},
{
"x": "470",
"y": "70",
"__prefix": "di"
}
],
"id": "SequenceFlow_042i1f0_di",
"bpmnElement": "SequenceFlow_042i1f0",
"__prefix": "bpmndi"
},
{
"waypoint": [
{
"x": "570",
"y": "70",
"__prefix": "di"
},
{
"x": "606",
"y": "70",
"__prefix": "di"
},
{
"x": "606",
"y": "180",
"__prefix": "di"
},
{
"x": "642",
"y": "180",
"__prefix": "di"
}
],
"id": "SequenceFlow_0kxnuqq_di",
"bpmnElement": "SequenceFlow_0kxnuqq",
"__prefix": "bpmndi"
},
{
"waypoint": [
{
"x": "410",
"y": "310",
"__prefix": "di"
},
{
"x": "526",
"y": "310",
"__prefix": "di"
},
{
"x": "526",
"y": "180",
"__prefix": "di"
},
{
"x": "642",
"y": "180",
"__prefix": "di"
}
],
"id": "SequenceFlow_1rrokxg_di",
"bpmnElement": "SequenceFlow_1rrokxg",
"__prefix": "bpmndi"
}
],
"id": "BPMNPlane_1",
"bpmnElement": "liu_cheng",
"__prefix": "bpmndi"
},
"id": "BPMNDiagram_1",
"__prefix": "bpmndi"
},
"xmlns:bpmn2": "http://www.omg.org/spec/BPMN/20100524/MODEL",
"xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
"xmlns:bpmndi": "http://www.omg.org/spec/BPMN/20100524/DI",
"xmlns:dc": "http://www.omg.org/spec/DD/20100524/DC",
"xmlns:flowable": "http://flowable.org/bpmn",
"xmlns:di": "http://www.omg.org/spec/DD/20100524/DI",
"id": "sample-diagram",
"targetNamespace": "http://bpmn.io/schema/bpmn",
"xsi:schemaLocation": "http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd",
"__prefix": "bpmn2"
}
}

2
gin_server_admin/shipi-4.ini

File diff suppressed because one or more lines are too long

BIN
gin_server_admin/uploads/file/e8c0653fea13f91bf3c48159f7c24f78_20211221133334.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 KiB

BIN
gin_server_admin/uploads/file/eccbc87e4b5ce2fe28308fd9f2a7baf3_20211222085813.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 KiB

21
gin_server_admin/utils/redishandel/myredis.go

@ -85,7 +85,12 @@ func (r *RedisStoreType) HashSet(hashName, hashKey, hashVal string) bool {
if err != nil { if err != nil {
return false return false
} }
global.GVA_REDIS.PExpire(r.Context, r.PreKey+hashName, r.Expiration) if r.Expiration == 0 {
global.GVA_REDIS.Persist(r.Context, r.PreKey+hashName)
} else {
global.GVA_REDIS.PExpire(r.Context, r.PreKey+hashName, r.Expiration)
}
// global.GVA_REDIS.PExpire(r.Context, r.PreKey+hashName, r.Expiration)
return true return true
} }
@ -101,7 +106,12 @@ func (r *RedisStoreType) HashMsetAdd(hashName string, hashVal map[string]interfa
if err != nil { if err != nil {
return false return false
} }
global.GVA_REDIS.PExpire(r.Context, r.PreKey+hashName, r.Expiration) if r.Expiration == 0 {
global.GVA_REDIS.Persist(r.Context, r.PreKey+hashName)
} else {
global.GVA_REDIS.PExpire(r.Context, r.PreKey+hashName, r.Expiration)
}
// fmt.Printf("错误sss=========》%v\n", hashVal) // fmt.Printf("错误sss=========》%v\n", hashVal)
return true return true
} }
@ -112,7 +122,12 @@ func (r *RedisStoreType) HashMsetAddAry(hashName string, hashVal []map[string]in
if err != nil { if err != nil {
return false return false
} }
global.GVA_REDIS.PExpire(r.Context, r.PreKey+hashName, r.Expiration) if r.Expiration == 0 {
global.GVA_REDIS.Persist(r.Context, r.PreKey+hashName)
} else {
global.GVA_REDIS.PExpire(r.Context, r.PreKey+hashName, r.Expiration)
}
// global.GVA_REDIS.PExpire(r.Context, r.PreKey+hashName, r.Expiration)
// fmt.Printf("错误sss=========》%v\n", hashVal) // fmt.Printf("错误sss=========》%v\n", hashVal)
return true return true
} }

BIN
gin_server_admin/其他支持文件/文档类栏目管理.zip

Binary file not shown.

62
gin_server_admin/其他支持文件/文档类栏目管理/恒信动态.txt

@ -0,0 +1,62 @@
[
{
// 栏目id
id:1,
// 栏目名称
columnr_name:'精益6S管理',
// 排序
sort:'1',
// 状态
state:false
},
{
// 栏目id
id:2,
// 栏目名称
columnr_name:'疫情防控',
// 排序
sort:'2',
// 状态
state:true
},
{
// 栏目id
id:3,
// 栏目名称
columnr_name:'新闻动态',
// 排序
sort:'3',
// 状态
state:true
},
{
// 栏目id
id:4,
// 栏目名称
columnr_name:'检查通报',
// 排序
sort:'4',
// 状态
state:true
},
{
// 栏目id
id:5,
// 栏目名称
columnr_name:'通知公告',
// 排序
sort:'5',
// 状态
state:true
},
{
// 栏目id
id:6,
// 栏目名称
columnr_name:'会议纪要',
// 排序
sort:'6',
// 状态
state:false
},
],

0
gin_server_admin/其他支持文件/文档类栏目管理/恒信课堂.txt

1
gin_server_admin/其他支持文件/文档类栏目管理/知识库.txt

@ -0,0 +1 @@
同顶级栏目/恒信动态相同

33
gin_server_admin/其他支持文件/文档类栏目管理/顶级栏目管理.txt

@ -0,0 +1,33 @@
[
{
// 栏目id
id:1,
// 栏目名称
columnr_name:'恒信动态',
// 排序
sort:'1',
// 状态
state:true
},
{
// 栏目id
id:2,
// 栏目名称
columnr_name:'知识库',
// 排序
sort:'2',
// 状态
state:true
},
{
// 栏目id
id:3,
// 栏目名称
columnr_name:'恒信课堂',
// 排序
sort:'3',
// 状态
state:true
},
],
Loading…
Cancel
Save