|
|
@@ -2,6 +2,7 @@ package oilsupplier
|
|
|
|
|
|
import (
|
|
|
"dashoo.cn/backend/api/business/auditsetting"
|
|
|
+ "dashoo.cn/backend/api/business/iam"
|
|
|
"dashoo.cn/backend/api/business/invoiceinfo"
|
|
|
"dashoo.cn/backend/api/business/oilcontract/contract"
|
|
|
"dashoo.cn/backend/api/business/oilcontract/contractReview"
|
|
|
@@ -15,11 +16,12 @@ import (
|
|
|
"dashoo.cn/backend/api/business/register"
|
|
|
"dashoo.cn/backend/api/business/todolist"
|
|
|
"dashoo.cn/backend/api/business/workflow"
|
|
|
- "dashoo.cn/business2/userRole"
|
|
|
. "dashoo.cn/backend/api/controllers"
|
|
|
+ "dashoo.cn/business2/userRole"
|
|
|
"dashoo.cn/utils"
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
+ "log"
|
|
|
"sort"
|
|
|
"strconv"
|
|
|
"strings"
|
|
|
@@ -596,10 +598,6 @@ func (this *TodoListController) GetMyTaskFinishedList() {
|
|
|
this.ServeJSON()
|
|
|
}
|
|
|
|
|
|
-// @Title 获取待办-发港信通提醒
|
|
|
-// @Description get user by token
|
|
|
-// @Success 200 {object} []supplier.OilSupplierView
|
|
|
-// @router /getToDoSend [get]
|
|
|
func (this *TodoListController) GetToDoSend() {
|
|
|
var pagingResult workflow.ActiMyPagingResultVM
|
|
|
actisvc := workflow.GetActivitiService(utils.DBE)
|
|
|
@@ -611,7 +609,7 @@ func (this *TodoListController) GetToDoSend() {
|
|
|
usvc.GetEntities(&settingList, "1=1")
|
|
|
|
|
|
tempstr := ""
|
|
|
- for _,setting := range settingList {
|
|
|
+ for _, setting := range settingList {
|
|
|
ids := usvc.GetUserIdsByRoleId(strconv.Itoa(setting.RoleId))
|
|
|
if len(ids) > 0 {
|
|
|
tempstr += "," + strings.Join(ids, ",")
|
|
|
@@ -626,15 +624,15 @@ func (this *TodoListController) GetToDoSend() {
|
|
|
|
|
|
userString := ""
|
|
|
i := 0
|
|
|
- for index,user := range userList {
|
|
|
+ for index, user := range userList {
|
|
|
pagingResult = actisvc.GetMyAllTypePagingTasksWithTime(strconv.Itoa(user.Id), 0, 0, "", "", "")
|
|
|
if pagingResult.Total > 0 {
|
|
|
i++
|
|
|
userString += "|" + user.Username
|
|
|
}
|
|
|
- if i == 1000 || index == len(userList)-1{
|
|
|
+ if i == 1000 || index == len(userList)-1 {
|
|
|
i = 0
|
|
|
- fmt.Println("港信通发送人"+strings.TrimLeft(userString, "|"))
|
|
|
+ fmt.Println("港信通发送人" + strings.TrimLeft(userString, "|"))
|
|
|
if strings.TrimLeft(userString, "|") == "" {
|
|
|
continue
|
|
|
}
|
|
|
@@ -658,3 +656,56 @@ func (this *TodoListController) GetToDoSend() {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+// @Title 获取待办-发港信通提醒
|
|
|
+// @Description get user by token
|
|
|
+// @Success 200 {object} []supplier.OilSupplierView
|
|
|
+// @router /getToDoSend [get]
|
|
|
+func (this *TodoListController) PushMsgForTodoUser() {
|
|
|
+ actiSvc := workflow.GetActivitiService(utils.DBE)
|
|
|
+ userSvc := userRole.GetUserService(utils.DBE)
|
|
|
+ iamSvc := iam.GetIamService(utils.DBE)
|
|
|
+
|
|
|
+ var userList []userRole.Base_User
|
|
|
+ log.Println("开始请求工作流获取代办人")
|
|
|
+ allUserIdsStr := actiSvc.GetAllTodoTasksUserId()
|
|
|
+ log.Println("请求到的待办人: " + allUserIdsStr)
|
|
|
+ if allUserIdsStr != "" {
|
|
|
+ where := "Id in (" + allUserIdsStr + ") and UserName != ''"
|
|
|
+ userSvc.GetEntities(&userList, where)
|
|
|
+ }
|
|
|
+
|
|
|
+ userNoString := ""
|
|
|
+ i := 0
|
|
|
+ for index, userEntity := range userList {
|
|
|
+ if userEntity.Username != "" {
|
|
|
+ i++
|
|
|
+ if userNoString != "" {
|
|
|
+ userNoString += "|" + userEntity.Username
|
|
|
+ } else {
|
|
|
+ userNoString = userEntity.Username
|
|
|
+ }
|
|
|
+ if i == 1000 || index == len(userList)-1 {
|
|
|
+ var sendVM todolist.SendVM
|
|
|
+ sendVM.Title = "市场管理信息系统"
|
|
|
+ sendVM.ToUser = "yuedefeng" // userNoString
|
|
|
+ sendVM.ToDept = "0"
|
|
|
+ sendVM.Content = "您有未处理的待办任务,请及时审批"
|
|
|
+ sendVM.Secret = "20dGytG*xt@21mSg"
|
|
|
+ sendVM.AppKey = "scgl"
|
|
|
+ sendVM.PopDuration = "6"
|
|
|
+ sendVM.MsgType = "sysMsg"
|
|
|
+ jsonParam, err := json.Marshal(sendVM)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println(err, "生成json字符串错误")
|
|
|
+ }
|
|
|
+ params := string(jsonParam)
|
|
|
+ iamSvc.PostSendSysMsg("/jcfw/duanxin/v1.0/send-sys-msg", params, "")
|
|
|
+
|
|
|
+ i = 0
|
|
|
+ userNoString = ""
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+}
|