Explorar el Código

前后:待办港信通提醒;年度评价导出不分页

dubch hace 4 años
padre
commit
36068a7386

+ 8 - 15
src/dashoo.cn/backend/api/business/todolist/todolist.go

@@ -19,21 +19,14 @@ type TodoList struct {
 }
 
 type SendVM struct {
-	Id               int    `xorm:"int(11)"`
-	SupplierId       string `xorm:"VARCHAR(30)"`
-	CertId           string `xorm:"VARCHAR(30)"`
-	QualId           string `xorm:"VARCHAR(30)"`
-	BusinessKey      string `xorm:"VARCHAR(30)"`
-	SupplierTypeCode string `xorm:"VARCHAR(30)"`
-	Type             string `xorm:"VARCHAR(10)"` // 1 准入 2 增项 3 年审 4 信息变更 5 资质变更
-	SupplierName     string `xorm:"VARCHAR(50)"`
-	UserName         string `xorm:"VARCHAR(50)"`
-	TaskName         string `xorm:"VARCHAR(50)"`
-	Status           string `xorm:"VARCHAR(50)"`
-	WorkflowId       string `xorm:"VARCHAR(50)"`
-	AnnualId         string `xorm:"VARCHAR(50)"`
-	Step             string `xorm:"VARCHAR(50)"`
-	CreateTime       int64
+	Title   	string `json:"title"` // 标题
+	ToUser  	string `json:"toUser"` // 接收成员帐号列表。多个接收者用竖线分隔,最多支持1000个
+	ToDept  	string `json:"toDept"` // 接收部门id列表。多个接收者用竖线分隔,最多支持100个。填0发送给组织架构全员
+	Content 	string `json:"content"` // 消息详细内容
+	MsgType 	string `json:"msgType"` // 系统消息
+	PopDuration string `json:"popDuration"` // 显示几秒
+	AppKey  	string `json:"appKey"` // 应用key
+	Secret  	string `json:"secret"` // 验签密钥
 }
 
 const (

+ 14 - 0
src/dashoo.cn/backend/api/business/workflow/ActivitiService.go

@@ -83,6 +83,20 @@ func (this *ActivitiService) PostOrigin(url string, params string, token string)
 	return resp
 }
 
+func (this *ActivitiService) PostToDu(url string, params string, token string) *http.Response {
+	client := &http.Client{}
+	ip := utils.Cfg.MustValue("workflow", "ToDu")
+	req, err := http.NewRequest("POST", ip+url, strings.NewReader(params))
+	req.Header.Add("Content-Type", "application/json")
+	req.Header.Add("Authorization", "Bearer "+token)
+	resp, err := client.Do(req)
+	if err != nil {
+		log.Println("err= ", err)
+	}
+	log.Println("resp= ", resp)
+	return resp
+}
+
 func (this *ActivitiService) Get(url string, params string, token string) *http.Response {
 	client := &http.Client{}
 	req, err := http.NewRequest("Get", this.BaseUrl+url, strings.NewReader(params))

+ 1 - 0
src/dashoo.cn/backend/api/conf/app.conf

@@ -77,6 +77,7 @@ goodsPdfHost=http://weed1.labsop.cn:9390/1,363c179f05a5
 basisPdfHost=http://weed1.labsop.cn:9390/5,363a63175da9
 techPdfHost=http://weed1.labsop.cn:9390/4,363bbbd2d097
 OriginUrl=http://localhost:8081/api
+ToDu=http://localhost:8090/api
 AposeUrl=http://localhost:8081/api/apose
 BaseUrl=http://localhost:8081/api/acti
 

+ 1 - 3
src/dashoo.cn/backend/api/controllers/oilcontract/contractSumScore.go

@@ -948,8 +948,6 @@ func (this *OilContractSumScoreController) DocExport() {
 // @Success	200	{object} controllers.Request
 // @router /exportexcel [get]
 func (this *OilContractSumScoreController) ExcelExport() {
-	//获取分页信息
-	page := this.GetPageInfoForm()
 	where := " 1=1 "
 	having := " 1=1 "
 	orderby := "contract.SupplierId"
@@ -1016,7 +1014,7 @@ func (this *OilContractSumScoreController) ExcelExport() {
 
 	svc := contractSumScore.GetOilContractSumScoreService(utils.DBE)
 	var list []contractSumScore.OilContractComputeSumScoreVo
-	svc.GetPagingComputeEntitiesWithOrderBytbl(page.CurrentPage, page.Size, orderby, asc, &list, where, having)
+	svc.GetPagingComputeEntitiesWithOrderBytbl(0, 0, orderby, asc, &list, where, having)
 
 	for index, item := range list {
 		where1 := where + " and contract.SupplierId = " + strconv.Itoa(item.SupplierId)

+ 28 - 16
src/dashoo.cn/backend/api/controllers/oilsupplier/todolist.go

@@ -601,14 +601,7 @@ func (this *TodoListController) GetMyTaskFinishedList() {
 // @Success 200 {object} []supplier.OilSupplierView
 // @router /getToDoSend [get]
 func (this *TodoListController) GetToDoSend() {
-	page := this.GetPageInfoForm()
-
-	supplierTypeCode := this.GetString("SupplierTypeCode")
-	supplierName := this.GetString("SupplierName")
-	wfNames := ""
-
 	var pagingResult workflow.ActiMyPagingResultVM
-	var myTasksRetWithTimes []workflow.ActiMyTasksRetWithTimeVM
 	actisvc := workflow.GetActivitiService(utils.DBE)
 	svcActiviti := workflow.GetActivitiService(utils.DBE)
 
@@ -620,7 +613,9 @@ func (this *TodoListController) GetToDoSend() {
 	tempstr := ""
 	for _,setting := range settingList {
 		ids := usvc.GetUserIdsByRoleId(strconv.Itoa(setting.RoleId))
-		tempstr += "," + strings.Join(ids, ",")
+		if len(ids) > 0 {
+			tempstr += "," + strings.Join(ids, ",")
+		}
 	}
 	uids := strings.Replace(tempstr, "uid_", "", -1)
 	uids = strings.Trim(uids, ",")
@@ -628,20 +623,37 @@ func (this *TodoListController) GetToDoSend() {
 		where := "Id in (" + uids + ")"
 		usvc.GetEntities(&userList, where)
 	}
-	for _,user := range userList {
-		pagingResult = actisvc.GetMyAllTypePagingTasksWithTime(strconv.Itoa(user.Id), page.CurrentPage, page.Size, wfNames, supplierTypeCode, supplierName)
-		myTasksRetWithTimes = pagingResult.TaskList
-		if len(myTasksRetWithTimes) > 0 {
+
+	userString := ""
+	i := 0
+	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{
+			i = 0
+			fmt.Println("港信通发送人"+strings.TrimLeft(userString, "|"))
+			if strings.TrimLeft(userString, "|") == "" {
+				continue
+			}
+			userString = ""
 			var sendVM todolist.SendVM
-			//wordTempVM.Datas = datas
-			//wordTempVM.TemplateUrl = templateUrl
-			//wordTempVM.FileName = fileName
+			sendVM.Title = "市场管理信息系统"
+			sendVM.ToUser = strings.TrimLeft(userString, "|")
+			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)
-			svcActiviti.PostOrigin("/v1.0/send-sys-msg", params, "")
+			svcActiviti.PostToDu("/jcfw/duanxin/v1.0/send-sys-msg", params, "")
 		}
 	}
 

+ 3 - 3
src/dashoo.cn/backend/api/controllers/toolbox/toolbox.go

@@ -13,7 +13,7 @@ import (
 func TimingTask(){
 	c := new(oilsupplier.OilSupplierCertController)
 	invoice := new(invoice.OilInvoiceController)
-	//todo := new(oilsupplier.TodoListController)
+	todo := new(oilsupplier.TodoListController)
 
 	//tkInFlag := toolbox.NewTask("myTaskInFlag", "0 0 1 * * *", func() error {
 	//	c.UpdataInFlag()
@@ -70,8 +70,8 @@ func TimingTask(){
 	toolbox.AddTask("myTaskInvoiceStatus", tkInvoiceStatus)
 
 	// 有待办调港信通
-	tkToDo := toolbox.NewTask("myTaskToDo", "0 0 2 * * *", func() error {
-		//todo.GetToDoSend()
+	tkToDo := toolbox.NewTask("myTaskToDo", "0 0 8 * * *", func() error {
+		todo.GetToDoSend()
 		return nil
 	})
 	toolbox.AddTask("myTaskToDo", tkToDo)