Browse Source

手机端接口补充

li_v1
hreenshan112 1 year ago
parent
commit
03440dba2e
  1. 101
      api/version1/customerApp/runAppControll.go
  2. 28
      api/version1/customerApp/type.go
  3. 23
      api/version1/customerform/formTableView.go
  4. 293
      api/version1/newsclass/newsapi.go
  5. 38
      api/version1/newsclass/type.go
  6. 3
      api/version1/taskplatform/taskflow/appTaskFlow.go
  7. 3
      api/version1/taskplatform/taskflow/types.go
  8. 12
      api/version1/taskplatform/taskmanagement/formcontrol.go
  9. 3
      apirouter/v1/customerformrouter/router.go
  10. 5
      apirouter/v1/newsclassrouter/apirouter.go

101
api/version1/customerApp/runAppControll.go

@ -435,4 +435,105 @@ func (s *StatisTaskCount) GetTotalPAge(appk string, types int) {
default: //我的请求 default: //我的请求
s.MyCreateCount = totales s.MyCreateCount = totales
} }
} /**
@ 作者: 秦东
@ 时间: 2024-11-08 13:34:24
@ 功能: 根据分组获取App列表
@ 参数
#
@ 返回值
#
@ 方法原型
#
*/
func (a *ApiMethod) GetAppList(c *gin.Context) {
var requestData publicmethod.PublicId
err := c.ShouldBindJSON(&requestData)
if err != nil {
publicmethod.Result(100, err, c)
return
}
if requestData.Id == "" {
publicmethod.Result(102, err, c)
return
}
var list []SendAppInfo
overall.CONSTANT_DB_AppPlatform.Where("`classify` = 3 AND `groupid` = ?", requestData.Id).Limit(10).Order("`creater_time` DESC").Find(&list)
for i, v := range list {
list[i].SignCodeStr = strconv.FormatInt(v.SignCode, 10)
list[i].GroupIdStr = strconv.FormatInt(v.Groupid, 10)
list[i].FlowkeyStr = strconv.FormatInt(v.FlowKey, 10)
}
publicmethod.Result(0, list, c)
}
/*
*
@ 作者: 秦东
@ 时间: 2024-11-12 13:46:28
@ 功能: 获取分组及App
@ 参数
#
@ 返回值
#
@ 方法原型
#
*/
func (a *ApiMethod) GetGroupAndApp(c *gin.Context) {
var appGroup []modelAppPlatform.CustomerFormGroup
overall.CONSTANT_DB_AppPlatform.Where("`state` = 1").Find(&appGroup)
var sendList []SendGroupAppList
if len(appGroup) < 1 {
publicmethod.Result(0, sendList, c)
return
}
var xieChengchuli XiechengApp
for _, v := range appGroup {
syncSeting.Add(1)
go xieChengchuli.GainAppList(v.Id)
}
syncSeting.Wait()
for _, v := range appGroup {
var sendInfo SendGroupAppList
sendInfo.Id = v.Id //
sendInfo.Title = v.Title //分组名称
sendInfo.Superior = v.Superior //父级
sendInfo.Sort = v.Sort //排序
sendInfo.Ordid = v.Ordid //归属行政组织
sendInfo.State = v.State //显示状态(1:启用;2:禁用,3:删除)
sendInfo.Time = v.Time //创建时间"`
sendInfo.Icon = v.Icon //图标
for _, vv := range xieChengchuli.Child {
if v.Id == vv.GroupKey {
sendInfo.Child = vv.List
}
}
sendList = append(sendList, sendInfo)
}
sort.Slice(sendList, func(i, j int) bool {
return sendList[i].Sort < sendList[j].Sort
})
publicmethod.Result(0, sendList, c)
}
func (x *XiechengApp) GainAppList(id int64) {
defer syncSeting.Done()
var appList []AppListCont
overall.CONSTANT_DB_AppPlatform.Where("`classify` = 3 AND `states` = 1 AND `groupid` = ?", id).Find(&appList)
if len(appList) > 0 {
for i, v := range appList {
appList[i].SignCodeStr = strconv.FormatInt(v.SignCode, 10)
}
var childInfo XiechengAppEs
childInfo.GroupKey = id
childInfo.List = appList
// for _,v := range appList {}
x.Child = append(x.Child, childInfo)
}
} }

28
api/version1/customerApp/type.go

@ -222,3 +222,31 @@ type SendStatisInfo struct {
Count int64 `json:"count"` Count int64 `json:"count"`
Sort int `json:"sort"` Sort int `json:"sort"`
} }
// 输出App内容列表
type SendAppInfo struct {
modelAppPlatform.CustomerForm
SignCodeStr string `json:"signCodeStr" gorm:"-"`
GroupIdStr string `json:"groupIdStr" gorm:"-"`
FlowkeyStr string `json:"flowkeyStr" gorm:"-"`
}
// 按分组输出App列表
type SendGroupAppList struct {
modelAppPlatform.CustomerFormGroup
Child []AppListCont `json:"child" gorm:"-"`
}
// 协程取分组App
type XiechengApp struct {
// publicmethod.CommonId[int64]
Child []XiechengAppEs
}
type XiechengAppEs struct {
List []AppListCont
GroupKey int64
}
type AppListCont struct {
modelAppPlatform.CustomerForm
SignCodeStr string `json:"signCodeStr" gorm:"-"`
}

23
api/version1/customerform/formTableView.go

@ -801,6 +801,7 @@ func TimeHaveAry(dateList []TimeAryInfo, listDate []map[string]interface{}) []Ti
for _, v := range listDate { for _, v := range listDate {
for mi, mv := range v { for mi, mv := range v {
if tv.Date == mi { if tv.Date == mi {
fmt.Printf("测试类型--1->%v=============>%v\n", tv.Date, mi)
dateList[ti].List = mv dateList[ti].List = mv
} }
} }
@ -845,16 +846,36 @@ func (c *CalendarList) GetDayCont(day TimeAryInfo, tableName string, userCont mo
if class, isOk := viewCondition["date"]; isOk { if class, isOk := viewCondition["date"]; isOk {
if class.Status { if class.Status {
startTime, endTime := publicmethod.OenDayStartOrEndTime(day.Date, 1) startTime, endTime := publicmethod.OenDayStartOrEndTime(day.Date, 1)
fmt.Printf("时间:day.Date=%v---->startTime=%v---->endTime=%v\n", day.Date, startTime, class.Form.StartTime)
if class.Form.StartTime != "" && class.Form.EndTime != "" { if class.Form.StartTime != "" && class.Form.EndTime != "" {
whySql := fmt.Sprintf("f.`%v` BETWEEN %v AND %v OR f.`%v` BETWEEN %v AND %v", class.Form.StartTime, startTime, endTime, class.Form.EndTime, startTime, endTime) whySql := fmt.Sprintf("f.`%v` BETWEEN %v AND %v OR f.`%v` BETWEEN %v AND %v", class.Form.StartTime, startTime, endTime, class.Form.EndTime, startTime, endTime)
gormDb = gormDb.Where(whySql) gormDb = gormDb.Where(whySql)
fmt.Printf("语句1===》%v\n", whySql)
} else if class.Form.StartTime != "" && class.Form.EndTime == "" { } else if class.Form.StartTime != "" && class.Form.EndTime == "" {
whySql := fmt.Sprintf("f.`%v` BETWEEN %v AND %v", class.Form.StartTime, startTime, endTime) whySql := fmt.Sprintf("f.`%v` BETWEEN %v AND %v", class.Form.StartTime, startTime, endTime)
gormDb = gormDb.Where(whySql) gormDb = gormDb.Where(whySql)
fmt.Printf("语句2===》%v\n", whySql)
} else if class.Form.StartTime == "" && class.Form.EndTime != "" { } else if class.Form.StartTime == "" && class.Form.EndTime != "" {
whySql := fmt.Sprintf("f.`%v` BETWEEN %v AND %v", class.Form.EndTime, startTime, endTime) whySql := fmt.Sprintf("f.`%v` BETWEEN %v AND %v", class.Form.EndTime, startTime, endTime)
gormDb = gormDb.Where(whySql) gormDb = gormDb.Where(whySql)
} fmt.Printf("语句3===》%v\n", whySql)
}
// startTimeInt, _ := publicmethod.StringToInt64(startTime)
// endTimeInt, _ := publicmethod.StringToInt64(endTime)
// if startTimeInt != 0 && endTimeInt != 0 {
// whySql := fmt.Sprintf("f.`%v` BETWEEN %v AND %v OR f.`%v` BETWEEN %v AND %v", class.Form.StartTime, startTime, endTime, class.Form.EndTime, startTime, endTime)
// gormDb = gormDb.Where(whySql)
// fmt.Printf("语句1===》%v\n", whySql)
// } else if startTimeInt != 0 && endTimeInt == 0 {
// whySql := fmt.Sprintf("f.`%v` BETWEEN %v AND %v", class.Form.StartTime, startTime, endTime)
// gormDb = gormDb.Where(whySql)
// fmt.Printf("语句2===》%v\n", whySql)
// } else if startTimeInt == 0 && endTimeInt != 0 {
// whySql := fmt.Sprintf("f.`%v` BETWEEN %v AND %v", class.Form.EndTime, startTime, endTime)
// gormDb = gormDb.Where(whySql)
// fmt.Printf("语句3===》%v\n", whySql)
// }
} }
} }
var formList []map[string]interface{} var formList []map[string]interface{}

293
api/version1/newsclass/newsapi.go

@ -66,10 +66,16 @@ func (a *ApiMethod) HotNews(c *gin.Context) {
} }
var list []modelbookimg.GraphicForm var list []modelbookimg.GraphicForm
gormDb := overall.CONSTANT_DB_IMAGES_TEST.Model(&modelbookimg.GraphicForm{}).Select("`g_id`,`g_title`,`g_content`,`g_text_name`,`g_test_url`,`g_physics_path`,`g_add_time`,`g_read`,`g_com_sum`,`g_collection_sum`,`g_likes`,`g_step_on`") gormDb := overall.CONSTANT_DB_IMAGES_TEST.Model(&modelbookimg.GraphicForm{}).Select("`g_id`,`g_title`,`g_content`,`g_text_name`,`g_test_url`,`g_physics_path`,`g_add_time`,`g_read`,`g_com_sum`,`g_collection_sum`,`g_likes`,`g_step_on`,`g_thumbnail`")
if requestData.Types == 5 { if requestData.Types == 5 {
gormDb = gormDb.Where("`g_recommend` = 1") gormDb = gormDb.Where("`g_recommend` = 1")
} }
if requestData.GroupId != "" {
gormDb = gormDb.Where("`g_parent` = ?", requestData.GroupId)
}
if requestData.SunGroupId != "" {
gormDb = gormDb.Where("`g_parent_sun` = ?", requestData.SunGroupId)
}
gormDb = gormDb.Where("`g_state` = 2") gormDb = gormDb.Where("`g_state` = 2")
gormDb = gormDb.Where("`g_visit_strat` = 1 OR (`g_visit_strat` = 2 AND `g_bf_id` IN ?) OR (`g_visit_strat` = 3 AND `g_ws_id` IN ?) OR (`g_visit_strat` = 4 AND FIND_IN_SET(?,`g_range`))", orgAry, workPost, userCont.Id) gormDb = gormDb.Where("`g_visit_strat` = 1 OR (`g_visit_strat` = 2 AND `g_bf_id` IN ?) OR (`g_visit_strat` = 3 AND `g_ws_id` IN ?) OR (`g_visit_strat` = 4 AND FIND_IN_SET(?,`g_range`))", orgAry, workPost, userCont.Id)
@ -119,7 +125,292 @@ func (a *ApiMethod) HotNews(c *gin.Context) {
sendCont.CollectNumber = v.CollectionSum //collectNumber"` sendCont.CollectNumber = v.CollectionSum //collectNumber"`
sendCont.LikeNumber = v.Likes //likeNumber"` sendCont.LikeNumber = v.Likes //likeNumber"`
sendCont.CriticizeNumber = v.StepOn //criticizeNumber"` sendCont.CriticizeNumber = v.StepOn //criticizeNumber"`
sendCont.Thumbnail = v.Thumbnail
sendCont.Describe = v.Describe
sendList = append(sendList, sendCont) sendList = append(sendList, sendCont)
} }
publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(sendList)), sendList, c) publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(sendList)), sendList, c)
} }
/*
*
@ 作者: 秦东
@ 时间: 2024-11-08 11:29:11
@ 功能: 录播图
@ 参数
#
@ 返回值
#
@ 方法原型
#
*/
func (a *ApiMethod) HomeCarouselImage(c *gin.Context) {
var requestData CarouselImage
err := c.ShouldBindJSON(&requestData)
if err != nil {
publicmethod.Result(10001, err, c)
return
}
if requestData.Num == 0 {
requestData.Num = 1
}
var list []modelbookimg.GraphicForm
overall.CONSTANT_DB_IMAGES_TEST.Model(&modelbookimg.GraphicForm{}).Select("`g_id`,`g_title`,`g_thumbnail`").Where("`g_state` = 2 AND `g_thumbnail` <> '' ").Limit(requestData.Num).Order("`g_add_time` DESC").Find(&list)
var sendData []SendCarouselImage
for _, v := range list {
var sendInfo SendCarouselImage
sendInfo.Id = strconv.FormatInt(v.Id, 10)
sendInfo.Title = v.Title
sendInfo.Img = v.Thumbnail
sendData = append(sendData, sendInfo)
}
publicmethod.Result(0, sendData, c)
}
/*
*
@ 作者: 秦东
@ 时间: 2024-11-11 08:41:54
@ 功能: 按分类获取新闻信息
@ 参数
#
@ 返回值
#
@ 方法原型
#
*/
func (a *ApiMethod) GetHomenNews(c *gin.Context) {
var requestData NewsClassInfo
c.ShouldBindJSON(&requestData)
//获取当前登录人信息
context, _ := c.Get(overall.MyContJwt)
var userCont modelshr.ManCont
userCont.GetLoginCont(context)
var sunOrg publicmethod.GetOrgAllParent
sunOrg.GetOrgSonAllId(userCont.MainDeparment)
sunOrg.Id = append(sunOrg.Id, userCont.MainDeparment)
//获取知行学院组织架构
// var schoolId []int64
var list []SendNewsInfo
gormDb := overall.CONSTANT_DB_IMAGES_TEST.Model(&modelbookimg.GraphicForm{}).Where("`g_state` = 2")
if requestData.GroupId != "" {
gormDb = gormDb.Where("`g_parent` = ?", requestData.GroupId)
}
if requestData.SunGroupId != "" {
gormDb = gormDb.Where("`g_parent_sun` = ?", requestData.SunGroupId)
}
switch requestData.Types {
case 1:
gormDb = gormDb.Where("`g_recommend` = 1")
gormDb = gormDb.Order("`g_add_time` DESC")
case 2: //不推荐
gormDb = gormDb.Where("`g_recommend` <> 1")
gormDb = gormDb.Order("`g_add_time` DESC")
case 3: //热门
gormDb = gormDb.Order("`g_read` DESC")
gormDb = gormDb.Order("`g_com_sum` DESC")
case 4: //收藏
gormDb = gormDb.Where("`g_collection_sum` > 0")
gormDb = gormDb.Order("`g_collection_sum` DESC")
case 5: //点赞
gormDb = gormDb.Where("`g_likes` > 0")
gormDb = gormDb.Order("`g_likes` DESC")
case 6: //评论
gormDb = gormDb.Where("`g_com_sum` > 0")
gormDb = gormDb.Order("`g_com_sum` DESC")
case 7: //阅读量
gormDb = gormDb.Order("`g_read` DESC")
default:
gormDb = gormDb.Order("`g_add_time` DESC")
}
// gormDb = gormDb.Where("`g_visit_strat` = 1 OR (`g_visit_strat` = 2 AND `g_bf_id` IN ?) OR (`g_visit_strat` = 3 AND `g_ws_id` IN ?) OR (`g_visit_strat` = 4 AND FIND_IN_SET(?,`g_range`))", orgAry, workPost, userCont.Id)
if requestData.Limit < 1 {
requestData.Limit = 1
}
err := gormDb.Limit(requestData.Limit).Find(&list).Error
if err != nil && len(list) < 1 {
publicmethod.Result(0, err, c)
return
}
for i, v := range list {
list[i].IdStr = strconv.FormatInt(v.Id, 10)
list[i].CreationTime = publicmethod.UnixTimeToDay(v.AddTime, 4)
}
publicmethod.Result(0, list, c)
}
/*
*
@ 作者: 秦东
@ 时间: 2024-11-11 15:23:15
@ 功能: 获取新闻类型分类
@ 参数
#
@ 返回值
#
@ 方法原型
#
*/
func (a *ApiMethod) GetNewType(c *gin.Context) {
var requestData publicmethod.PublicId
err := c.ShouldBindJSON(&requestData)
if err != nil {
publicmethod.Result(100, err, c)
return
}
if requestData.Id == "" {
publicmethod.Result(1, err, c, "未知参数!")
return
}
var list []SendMsgArchives
err = overall.CONSTANT_DB_Master.Where("`at_stater` = 1 AND `at_parent_id` = ?", requestData.Id).Order("`at_sort` ASC").Find(&list).Error
if err != nil || len(list) < 1 {
publicmethod.Result(0, list, c)
return
}
for i, v := range list {
list[i].IdStr = strconv.FormatInt(v.Id, 10)
}
publicmethod.Result(0, list, c)
}
/*
*
@ 作者: 秦东
@ 时间: 2024-11-12 10:05:02
@ 功能: 新闻列表资讯
@ 参数
#
@ 返回值
#
@ 方法原型
#
*/
func (a *ApiMethod) NewHotNews(c *gin.Context) {
var requestData HosNewsParameter
err := c.ShouldBindJSON(&requestData)
if err != nil {
publicmethod.Result(10001, err, c)
return
}
if requestData.Page == 0 {
requestData.Page = 1
}
if requestData.PageSize == 0 {
requestData.PageSize = 7
}
if requestData.Types == 0 {
requestData.Types = 1
}
context, _ := c.Get(overall.MyContJwt)
var userCont modelshr.ManCont
userCont.GetLoginCont(context)
var sunOrg publicmethod.GetOrgAllParent
sunOrg.GetOrgSonAllId(userCont.MainDeparment)
sunOrg.Id = append(sunOrg.Id, userCont.MainDeparment)
var orgListInfo []modelshr.OrgContType
overall.CONSTANT_DB_HR.Select("`id`,`level`").Where("`id` IN ?", sunOrg.Id).Find(&orgListInfo)
var orgAry []int64
var workPost []int64
for i := 0; i < len(orgListInfo); i++ {
// var orgType modelshr.OrgContType
// orgType.GetCont(map[string]interface{}{"`id`": orgListInfo[i].OrganizationType}, "`level`")
if orgListInfo[i].Level >= 6 {
workPost = append(workPost, orgListInfo[i].Id)
} else {
orgAry = append(orgAry, orgListInfo[i].Id)
}
}
var list []SendNewsInfo
gormDb := overall.CONSTANT_DB_IMAGES_TEST.Model(&modelbookimg.GraphicForm{}).Where("`g_state` = 2")
if requestData.Types == 5 {
gormDb = gormDb.Where("`g_recommend` = 1")
}
if requestData.GroupId != "" {
gormDb = gormDb.Where("`g_parent` = ?", requestData.GroupId)
}
if requestData.SunGroupId != "" {
gormDb = gormDb.Where("`g_parent_sun` = ?", requestData.SunGroupId)
}
gormDb = gormDb.Where("`g_visit_strat` = 1 OR (`g_visit_strat` = 2 AND `g_bf_id` IN ?) OR (`g_visit_strat` = 3 AND `g_ws_id` IN ?) OR (`g_visit_strat` = 4 AND FIND_IN_SET(?,`g_range`))", orgAry, workPost, userCont.Id)
var total int64
totalErr := gormDb.Count(&total).Error
if totalErr != nil {
total = 0
}
gormDb = publicmethod.PageTurningSettings(gormDb, requestData.Page, requestData.PageSize)
switch requestData.Types {
case 1:
gormDb = gormDb.Order("`g_read` DESC").Order("`g_add_time` DESC")
case 2:
gormDb = gormDb.Order("`g_com_sum` DESC").Order("`g_add_time` DESC")
case 3:
gormDb = gormDb.Order("`g_collection_sum` DESC").Order("`g_add_time` DESC")
case 4:
gormDb = gormDb.Order("`g_likes` DESC").Order("`g_add_time` DESC")
case 5:
gormDb = gormDb.Order("`g_recommend` DESC").Order("`g_add_time` DESC")
case 6:
gormDb = gormDb.Order("`g_step_on` DESC").Order("`g_add_time` DESC")
default:
gormDb = gormDb.Order("`g_add_time` DESC")
}
err = gormDb.Find(&list).Error
if err != nil && len(list) < 1 {
publicmethod.Result(0, err, c)
return
}
// var sendList []SendHotNews
// for _, v := range list {
// var sendCont SendHotNews
// sendCont.Id = strconv.FormatInt(v.Id, 10)
// sendCont.Title = v.Title //"title"`
// sendCont.PageInfo = v.Content //"pageInfo"`
// sendCont.FileName = v.TextName //"fileName"`
// sendCont.FileUrl = v.TestUrl //"fileUrl"`
// sendCont.FilePath = v.PhysicsPath //"filePath"`
// sendCont.PageType = 1 //"pagetype"`
// if v.TestUrl != "" {
// sendCont.PageType = 2
// }
// sendCont.Time = publicmethod.UnixTimeToDay(v.AddTime, 24) //"time"`
// sendCont.ReadNumber = v.Read //readNumber"`
// sendCont.CommentNumber = v.ComSum //commentNumber"`
// sendCont.CollectNumber = v.CollectionSum //collectNumber"`
// sendCont.LikeNumber = v.Likes //likeNumber"`
// sendCont.CriticizeNumber = v.StepOn //criticizeNumber"`
// sendCont.Thumbnail = v.Thumbnail
// sendCont.Describe = v.Describe
// sendList = append(sendList, sendCont)
// }
for i, v := range list {
list[i].IdStr = strconv.FormatInt(v.Id, 10)
list[i].CreationTime = publicmethod.UnixTimeToDay(v.AddTime, 4)
}
publicmethod.ResultList(0, requestData.Page, requestData.PageSize, total, int64(len(list)), list, c)
}

38
api/version1/newsclass/type.go

@ -1,6 +1,7 @@
package newsclass package newsclass
import ( import (
"appPlatform/models/modelbookimg"
"appPlatform/overall/publicmethod" "appPlatform/overall/publicmethod"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
@ -19,6 +20,8 @@ func (a *ApiMethod) Index(c *gin.Context) {
// 热点新闻 // 热点新闻
type HosNewsParameter struct { type HosNewsParameter struct {
publicmethod.PagesTurn publicmethod.PagesTurn
GroupId string `json:"groupId"` //大类
SunGroupId string `json:"sunGroupId"` //二级类
Types int `json:"type"` //1:热点新闻(阅读量);2:评论;3:收藏;4:点赞;5:推荐;6:最差文章 Types int `json:"type"` //1:热点新闻(阅读量);2:评论;3:收藏;4:点赞;5:推荐;6:最差文章
} }
@ -37,4 +40,39 @@ type SendHotNews struct {
CollectNumber int `json:"collectNumber"` CollectNumber int `json:"collectNumber"`
LikeNumber int `json:"likeNumber"` LikeNumber int `json:"likeNumber"`
CriticizeNumber int `json:"criticizeNumber"` CriticizeNumber int `json:"criticizeNumber"`
Thumbnail string `json:"thumbnail"`
Describe string `json:"describe"`
}
// 轮播图参数
type CarouselImage struct {
Num int `json:"number"`
}
// 发送轮播图
type SendCarouselImage struct {
publicmethod.PublicId
Title string `json:"title"`
Img string `json:"img"`
}
// 新闻信息类参数
type NewsClassInfo struct {
GroupId string `json:"groupId"` //大类
SunGroupId string `json:"sunGroupId"` //二级类
Types int `json:"types"` //属性 1:推荐,2:不推荐,3:热门,4:收藏,5:点赞,6:评论,7:阅读量
Limit int `json:"limit"` // 显示多少条数据
}
// 发送首页新闻信息
type SendNewsInfo struct {
modelbookimg.GraphicForm
IdStr string `json:"idStr" gorm:"-"` //
CreationTime string `json:"creationTime" gorm:"-"`
}
// 文章信息分类
type SendMsgArchives struct {
modelbookimg.ArchivesType
IdStr string `json:"idStr" gorm:"-"` //
} }

3
api/version1/taskplatform/taskflow/appTaskFlow.go

@ -89,9 +89,12 @@ func (a *ApiMethod) GainAppTaskList(c *gin.Context) {
for i := 0; i < len(userList); i++ { for i := 0; i < len(userList); i++ {
userList[i].FormVersionId = strconv.FormatInt(userList[i].VersionId, 10) userList[i].FormVersionId = strconv.FormatInt(userList[i].VersionId, 10)
userList[i].IdStr = strconv.FormatInt(userList[i].Id, 10) userList[i].IdStr = strconv.FormatInt(userList[i].Id, 10)
userList[i].RunFlowIdStr = strconv.FormatInt(userList[i].Id, 10)
userList[i].FlowKeys = strconv.FormatInt(userList[i].FlowKey, 10) userList[i].FlowKeys = strconv.FormatInt(userList[i].FlowKey, 10)
userList[i].CreaterInfo = GainSmaillUserInfo[int64](userList[i].Creater) userList[i].CreaterInfo = GainSmaillUserInfo[int64](userList[i].Creater)
userList[i].MastersKeyStr = strconv.FormatInt(userList[i].MastersKey, 10) userList[i].MastersKeyStr = strconv.FormatInt(userList[i].MastersKey, 10)
userList[i].AppKeyStr = strconv.FormatInt(userList[i].AppKey, 10)
userList[i].TableKeyStr = strconv.FormatInt(userList[i].TableKey, 10)
if userList[i].NextExecutor != "" { if userList[i].NextExecutor != "" {
nextAry := strings.Split(userList[i].NextExecutor, ",") nextAry := strings.Split(userList[i].NextExecutor, ",")
for _, v := range nextAry { for _, v := range nextAry {

3
api/version1/taskplatform/taskflow/types.go

@ -257,6 +257,9 @@ type SendAppTaskFlowInfo struct {
FormVersionId string `json:"formVersionId" gorm:"-"` FormVersionId string `json:"formVersionId" gorm:"-"`
IsRetract bool `json:"isRetract" gorm:"-"` //是否可以撤回 IsRetract bool `json:"isRetract" gorm:"-"` //是否可以撤回
MastersKeyStr string `json:"mastersKeyStr" gorm:"-"` //唯一标识符 MastersKeyStr string `json:"mastersKeyStr" gorm:"-"` //唯一标识符
AppKeyStr string `json:"appKeyStr" gorm:"-"` //唯一标识符
TableKeyStr string `json:"tableKeyStr" gorm:"-"` //唯一标识符
RunFlowIdStr string `json:"runFlowIdStr" gorm:"-"` //唯一标识符
} }
// 人员剪短信息 // 人员剪短信息

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

@ -804,6 +804,15 @@ func (a *ApiMethod) AddCustomerForm(c *gin.Context) {
publicmethod.Result(1, err, c, "非法表单!不能提交数据!") publicmethod.Result(1, err, c, "非法表单!不能提交数据!")
return return
} }
var appKey int64 = 0
if appKeyVal, ok := mapData["appKey"]; ok {
appKey, _ = publicmethod.StringToInt64(appKeyVal)
}
var tableKey int64 = 0
if tableVal, ok := mapData["versionId"]; ok {
tableKey, _ = publicmethod.StringToInt64(tableVal)
}
if val, ok := mapData["status"]; !ok { if val, ok := mapData["status"]; !ok {
if valInt, isTrue := val.(int); isTrue { if valInt, isTrue := val.(int); isTrue {
status = valInt status = valInt
@ -866,7 +875,8 @@ func (a *ApiMethod) AddCustomerForm(c *gin.Context) {
var taskCont customerForm.TaskRecord var taskCont customerForm.TaskRecord
taskCont.MastersKey = uuid taskCont.MastersKey = uuid
taskCont.Title = fmt.Sprintf("%v-%v(%v)-%v", formCont.Name, userCont.Name, userCont.Number, publicmethod.UnixTimeToDay(cureeTime, 14)) //标题"` taskCont.Title = fmt.Sprintf("%v-%v(%v)-%v", formCont.Name, userCont.Name, userCont.Number, publicmethod.UnixTimeToDay(cureeTime, 14)) //标题"`
taskCont.AppKey = appKey
taskCont.TableKey = tableKey
taskCont.Creater = userCont.Key //创建人"` taskCont.Creater = userCont.Key //创建人"`
taskCont.CreaterTime = cureeTime //创建时间"` taskCont.CreaterTime = cureeTime //创建时间"`
taskCont.EditTime = cureeTime //编辑时间"` taskCont.EditTime = cureeTime //编辑时间"`

3
apirouter/v1/customerformrouter/router.go

@ -95,5 +95,8 @@ func (a *ApiRouter) RouterGroupPc(router *gin.RouterGroup) {
appApiRouter.POST("editAppMenusIcon", methodAppHand.EditAppMenusIcon) //编辑APP菜单图标 appApiRouter.POST("editAppMenusIcon", methodAppHand.EditAppMenusIcon) //编辑APP菜单图标
appApiRouter.POST("getAllAppTableForm", methodAppHand.GetAllAppTableForm) //获取此应用的所有表单 appApiRouter.POST("getAllAppTableForm", methodAppHand.GetAllAppTableForm) //获取此应用的所有表单
appApiRouter.POST("calculateQuantityOption", methodAppHand.CalculateQuantityOption) //计算待办事宜,已办事宜,我创建的,抄送我的数量 appApiRouter.POST("calculateQuantityOption", methodAppHand.CalculateQuantityOption) //计算待办事宜,已办事宜,我创建的,抄送我的数量
appApiRouter.POST("getAppList", methodAppHand.GetAppList) //根据分组获取App列表
appApiRouter.POST("getGroupAndApp", methodAppHand.GetGroupAndApp) //获取分组及App
} }
} }

5
apirouter/v1/newsclassrouter/apirouter.go

@ -14,5 +14,10 @@ func (a *ApiRouter) RouterGroup(router *gin.RouterGroup) {
apiRouter.GET("", newsClassRouter.Index) //入口 apiRouter.GET("", newsClassRouter.Index) //入口
apiRouter.POST("", newsClassRouter.Index) //入口 apiRouter.POST("", newsClassRouter.Index) //入口
apiRouter.POST("hot_news", newsClassRouter.HotNews) //属性文章 apiRouter.POST("hot_news", newsClassRouter.HotNews) //属性文章
apiRouter.POST("newHotNews", newsClassRouter.NewHotNews) //属性文章
apiRouter.POST("homeCarouselImage", newsClassRouter.HomeCarouselImage) //文章缩略图
apiRouter.POST("getHomenNews", newsClassRouter.GetHomenNews) //按分类获取新闻信息
apiRouter.POST("getNewType", newsClassRouter.GetNewType) //获取新闻类型分类
} }
} }

Loading…
Cancel
Save