Commit 91364482 by 朱继来

去掉采购邮件钉钉通知

parent cff660c5
Showing with 21 additions and 23 deletions
...@@ -2,26 +2,26 @@ package sendEmail ...@@ -2,26 +2,26 @@ package sendEmail
import ( import (
"encoding/json" "encoding/json"
"github.com/ichunt2019/logger" _ "go-queue-server/dal/order/OrderActionLog"
_"go-queue-server/dal/order/OrderActionLog"
"go-queue-server/util" "go-queue-server/util"
"go-queue-server/util/ding"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
_"strconv" _ "strconv"
"strings" "strings"
"github.com/ichunt2019/logger"
) )
// json 返回值 // json 返回值
type JosnResp struct { type JosnResp struct {
Errcode int `json:"err_code"` Errcode int `json:"err_code"`
Errmsg string `json:"err_msg"` Errmsg string `json:"err_msg"`
} }
// 队列参数 // 队列参数
type DataParams struct { type DataParams struct {
OrderId int `json:"order_id"` OrderId int `json:"order_id"`
OperatorId int `json:"operator_id"` OperatorId int `json:"operator_id"`
OperatorEvent string `json:"operator_event"` OperatorEvent string `json:"operator_event"`
} }
...@@ -29,28 +29,28 @@ type DataParams struct { ...@@ -29,28 +29,28 @@ type DataParams struct {
func SendPurchaseEmail(data string) (err error) { func SendPurchaseEmail(data string) (err error) {
crm_url := util.Configs.Crm_domain.SendMailUrl // CRM发送邮件接口 crm_url := util.Configs.Crm_domain.SendMailUrl // CRM发送邮件接口
header_map := map[string]string{ header_map := map[string]string{
"api-key": "crm a1b2c3d4e5f6g7h8i9jk", "api-key": "crm a1b2c3d4e5f6g7h8i9jk",
"Content-Type": "application/json", "Content-Type": "application/json",
} }
err = http_post(crm_url, data, header_map) err = http_post(crm_url, data, header_map)
// 钉钉通知 默认参数 // 钉钉通知 默认参数
var mobile []string = make([]string, 0) // var mobile []string = make([]string, 0)
var isAtAll bool = false // var isAtAll bool = false
if err != nil { if err != nil {
ding.Send(util.Configs.Ding_msg.Webhook,"监控告警", "邮件接口请求失败,原因:" + err.Error(), mobile, isAtAll) // ding.Send(util.Configs.Ding_msg.Webhook,"监控告警", "邮件接口请求失败,原因:" + err.Error(), mobile, isAtAll)
logger.Info(err.Error()) logger.Info(err.Error())
return err return err
} }
ding.Send(util.Configs.Ding_msg.Webhook, "监控告警", "推送采购邮件:" + data, mobile, isAtAll) // ding.Send(util.Configs.Ding_msg.Webhook, "监控告警", "推送采购邮件:" + data, mobile, isAtAll)
return return
//// 添加操作日志 //// 添加操作日志
//var data_params *DataParams //var data_params *DataParams
//json.Unmarshal([]byte(data), &data_params) //json.Unmarshal([]byte(data), &data_params)
//if data_params.OrderId == 0 { //if data_params.OrderId == 0 {
...@@ -58,18 +58,18 @@ func SendPurchaseEmail(data string) (err error) { ...@@ -58,18 +58,18 @@ func SendPurchaseEmail(data string) (err error) {
// return // return
//} //}
// //
//order_id := data_params.OrderId //order_id := data_params.OrderId
//operator_id := data_params.OperatorId //operator_id := data_params.OperatorId
//operator_event := data_params.OperatorEvent //operator_event := data_params.OperatorEvent
// //
//err = OrderActionLog.Insert(order_id, operator_id, 2, operator_event) //err = OrderActionLog.Insert(order_id, operator_id, 2, operator_event)
// //
//if err != nil { //if err != nil {
// ding.Send(util.Configs.Ding_msg.Webhook,"监控告警","添加操作日志失败", mobile, isAtAll) // ding.Send(util.Configs.Ding_msg.Webhook,"监控告警","添加操作日志失败", mobile, isAtAll)
// return err // return err
//} //}
// //
//// 推送ERP //// 推送ERP
//api_url := util.Configs.Api_domain.ApiUrl + "order/sysiteminfo" //api_url := util.Configs.Api_domain.ApiUrl + "order/sysiteminfo"
//params := "order_id="+strconv.Itoa(order_id) //params := "order_id="+strconv.Itoa(order_id)
//api_header_map := map[string]string{ //api_header_map := map[string]string{
...@@ -124,5 +124,3 @@ func http_post(url string, data string, header map[string]string) (err error) { ...@@ -124,5 +124,3 @@ func http_post(url string, data string, header map[string]string) (err error) {
return return
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment