|
@@ -63,7 +63,10 @@ func CronScheduled(ctx context.Context) {
|
|
|
|
|
|
})
|
|
|
c.Start()
|
|
|
+ //自动同步前天有进行中的任务
|
|
|
+ manualUdData(pastureinfo)
|
|
|
|
|
|
+ //消息提醒
|
|
|
duetimecst2, _ := time.ParseInLocation("15:04:05", "00:01:00", time.Local)
|
|
|
duetimecst3, _ := time.ParseInLocation("15:04:05", "00:00:00", time.Local)
|
|
|
spec1 := fmt.Sprintf("@every %v", duetimecst2.Sub(duetimecst3))
|
|
@@ -76,128 +79,54 @@ func CronScheduled(ctx context.Context) {
|
|
|
return
|
|
|
}
|
|
|
for _, data := range dataList {
|
|
|
- if data["function"].(string) == "processAnalysisEarlyWarning" {
|
|
|
- // user := strings.Split(data["user"].(string), ",")
|
|
|
- if len(data["user"].(string)) > 0 {
|
|
|
- var userids string
|
|
|
- for _, str := range strings.Split(data["user"].(string), ",") {
|
|
|
- if len(userids) <= 0 {
|
|
|
- userids = fmt.Sprintf("'%s'", str)
|
|
|
- } else {
|
|
|
- userids += fmt.Sprintf(",'%s'", str)
|
|
|
- }
|
|
|
- }
|
|
|
- sql := fmt.Sprintf(` select openid from user_wx where pastureid = ? and userid in(%s)`, userids)
|
|
|
- openidList, err := tx.SQL(sql, pastureinfo.Pastureid).Query().List()
|
|
|
- // openidList, err := tx.Table("user_wx").Where(" pastureid = ? ", pastureinfo.Pastureid).And("userid in (?)", data["user"].(string)).Query().List()
|
|
|
- if err != nil {
|
|
|
- logs.Error("CronScheduled-error-4:", err)
|
|
|
- return
|
|
|
- }
|
|
|
+ var openIdList []string
|
|
|
+ if _, ok := data["user"]; ok {
|
|
|
+ openIdList = strings.Split(data["user"].(string), ",")
|
|
|
+ }
|
|
|
|
|
|
- var openIdList []string
|
|
|
- for _, open := range openidList {
|
|
|
- if open["openid"] != nil {
|
|
|
- openIdList = append(openIdList, open["openid"].(string))
|
|
|
- }
|
|
|
- }
|
|
|
- if len(openIdList) > 0 {
|
|
|
- processAnalysisEarlyWarning(openIdList, pastureinfo.Pastureid, data["id"].(int64))
|
|
|
- }
|
|
|
+ if data["function"].(string) == "processAnalysisEarlyWarning" {
|
|
|
+ if len(openIdList) > 0 {
|
|
|
+ processAnalysisEarlyWarning(openIdList, pastureinfo.Pastureid, data["id"].(int64))
|
|
|
}
|
|
|
} else if data["function"].(string) == "abnormalMixingDelay" {
|
|
|
- if data["user"] != nil {
|
|
|
- var userids string
|
|
|
- for _, str := range strings.Split(data["user"].(string), ",") {
|
|
|
- if len(userids) <= 0 {
|
|
|
- userids = fmt.Sprintf("'%s'", str)
|
|
|
- } else {
|
|
|
- userids += fmt.Sprintf(",'%s'", str)
|
|
|
- }
|
|
|
- }
|
|
|
- sql := fmt.Sprintf(` select openid from user_wx where pastureid = ? and userid in(%s)`, userids)
|
|
|
- openidList, err := tx.SQL(sql, pastureinfo.Pastureid).Query().List()
|
|
|
- // openidList, err := tx.Table("user_wx").Where(" pastureid = ? ", pastureinfo.Pastureid).And("userid in (?)", data["user"].(string)).Query().List()
|
|
|
- if err != nil {
|
|
|
- logs.Error("CronScheduled-error-4:", err)
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- var openIdList []string
|
|
|
- for _, open := range openidList {
|
|
|
- if open["openid"] != nil {
|
|
|
- openIdList = append(openIdList, open["openid"].(string))
|
|
|
- }
|
|
|
- }
|
|
|
- if len(openIdList) > 0 {
|
|
|
- abnormalMixingDelay(openIdList, pastureinfo.Pastureid, data["id"].(int64))
|
|
|
- }
|
|
|
+ if len(openIdList) > 0 {
|
|
|
+ abnormalMixingDelay(openIdList, pastureinfo.Pastureid, data["id"].(int64))
|
|
|
}
|
|
|
} else if data["function"].(string) == "endOfShift" {
|
|
|
- if data["user"] != nil {
|
|
|
- var userids string
|
|
|
- for _, str := range strings.Split(data["user"].(string), ",") {
|
|
|
- if len(userids) <= 0 {
|
|
|
- userids = fmt.Sprintf("'%s'", str)
|
|
|
- } else {
|
|
|
- userids += fmt.Sprintf(",'%s'", str)
|
|
|
- }
|
|
|
- }
|
|
|
- sql := fmt.Sprintf(` select openid from user_wx where pastureid = ? and userid in(%s)`, userids)
|
|
|
- openidList, err := tx.SQL(sql, pastureinfo.Pastureid).Query().List()
|
|
|
- // openidList, err := tx.Table("user_wx").Where(" pastureid = ? ", pastureinfo.Pastureid).And("userid in (?)", data["user"].(string)).Query().List()
|
|
|
- if err != nil {
|
|
|
- logs.Error("CronScheduled-error-4:", err)
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- var openIdList []string
|
|
|
- for _, open := range openidList {
|
|
|
- if open["openid"] != nil {
|
|
|
- openIdList = append(openIdList, open["openid"].(string))
|
|
|
- }
|
|
|
- }
|
|
|
- if len(openIdList) > 0 {
|
|
|
- endOfShift(openIdList, pastureinfo.Pastureid, data["id"].(int64))
|
|
|
- }
|
|
|
+ if len(openIdList) > 0 {
|
|
|
+ endOfShift(openIdList, pastureinfo.Pastureid, data["id"].(int64))
|
|
|
}
|
|
|
} else if data["function"].(string) == "plansToComplete" {
|
|
|
- if data["user"] != nil {
|
|
|
- var userids string
|
|
|
- for _, str := range strings.Split(data["user"].(string), ",") {
|
|
|
- if len(userids) <= 0 {
|
|
|
- userids = fmt.Sprintf("'%s'", str)
|
|
|
- } else {
|
|
|
- userids += fmt.Sprintf(",'%s'", str)
|
|
|
- }
|
|
|
- }
|
|
|
- sql := fmt.Sprintf(` select openid from user_wx where pastureid = ? and userid in(%s)`, userids)
|
|
|
- openidList, err := tx.SQL(sql, pastureinfo.Pastureid).Query().List()
|
|
|
- // openidList, err := tx.Table("user_wx").Where(" pastureid = ? ", pastureinfo.Pastureid).And("userid in (?)", data["user"].(string)).Query().List()
|
|
|
- if err != nil {
|
|
|
- logs.Error("CronScheduled-error-4:", err)
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- var openIdList []string
|
|
|
- for _, open := range openidList {
|
|
|
- if open["openid"] != nil {
|
|
|
- openIdList = append(openIdList, open["openid"].(string))
|
|
|
- }
|
|
|
- }
|
|
|
- if len(openIdList) > 0 {
|
|
|
- plansToComplete(openIdList, pastureinfo.Pastureid, data["id"].(int64))
|
|
|
- }
|
|
|
+ if len(openIdList) > 0 {
|
|
|
+ plansToComplete(openIdList, pastureinfo.Pastureid, data["id"].(int64))
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
})
|
|
|
-
|
|
|
downloadplandtl1.Start()
|
|
|
|
|
|
- //自动同步前天有进行中的任务
|
|
|
- manualUdData(pastureinfo)
|
|
|
+ dayCron := cron.New()
|
|
|
+ dayCron.AddFunc("30 23 * * *", func() {
|
|
|
+ dataList, err := tx.SQL(` select user,function,id from remind where pastureid = ? and function = ? `, pastureinfo.Pastureid, "inventoryWarning").Query().List()
|
|
|
+ if err != nil {
|
|
|
+ logs.Error("CronScheduled-error-5:", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, data := range dataList {
|
|
|
+ var openIdList []string
|
|
|
+ if _, ok := data["user"]; ok {
|
|
|
+ openIdList = strings.Split(data["user"].(string), ",")
|
|
|
+ }
|
|
|
+
|
|
|
+ if data["function"].(string) == "inventoryWarning" {
|
|
|
+ if len(openIdList) > 0 {
|
|
|
+ inventoryWarning(openIdList, pastureinfo.Pastureid, data["id"].(int64))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ dayCron.Start()
|
|
|
}
|
|
|
|
|
|
type ScheduledInfo struct {
|
|
@@ -828,7 +757,7 @@ func wxPush(target []string, content []interface{}, pastureId string, serviceId
|
|
|
dataStr := `{
|
|
|
"pasture_id":%s,
|
|
|
"service_id":%d,
|
|
|
- "sys_name": "tmrWatch_test",
|
|
|
+ "sys_name": "tmrWatch",
|
|
|
"target": %s,
|
|
|
"miniprogram": {
|
|
|
"appid": "wx9ab2b5b25701da0a",
|
|
@@ -846,7 +775,7 @@ func wxPush(target []string, content []interface{}, pastureId string, serviceId
|
|
|
targetStr, _ := json.Marshal(target)
|
|
|
contentStr, _ := json.Marshal(content)
|
|
|
dataStr = fmt.Sprintf(dataStr, pastureId, serviceId, string(targetStr), string(contentStr))
|
|
|
-
|
|
|
+ fmt.Println(dataStr)
|
|
|
var jsonStr = []byte(dataStr)
|
|
|
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr))
|
|
|
|
|
@@ -859,18 +788,14 @@ func wxPush(target []string, content []interface{}, pastureId string, serviceId
|
|
|
|
|
|
defer resp.Body.Close()
|
|
|
|
|
|
- body, _ := ioutil.ReadAll(resp.Body)
|
|
|
- fmt.Println(dataStr)
|
|
|
- logs.Info("response Body:", string(body), "fasong")
|
|
|
+ // body, _ := ioutil.ReadAll(resp.Body)
|
|
|
+ // logs.Info("response Body:", string(body), "fasong")
|
|
|
|
|
|
}
|
|
|
|
|
|
func UDPostPush1(data, method string) {
|
|
|
-
|
|
|
url := "https://wdc.unidairy.cn/copartner_uploads/"
|
|
|
// 超时时间:5秒
|
|
|
- fmt.Println(url, data)
|
|
|
-
|
|
|
var jsonStr = []byte(data)
|
|
|
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonStr))
|
|
|
|
|
@@ -883,7 +808,6 @@ func UDPostPush1(data, method string) {
|
|
|
|
|
|
defer resp.Body.Close()
|
|
|
body, _ := ioutil.ReadAll(resp.Body)
|
|
|
-
|
|
|
fmt.Println("response Body:", string(body))
|
|
|
}
|
|
|
|
|
@@ -893,19 +817,19 @@ func processAnalysisEarlyWarning(target []string, pastureId string, serviceId in
|
|
|
|
|
|
exist, err := tx2.Table("notice").Where("status = 1").And("content = ? ", "downloadplandtl1").Exist()
|
|
|
if err != nil {
|
|
|
- logs.Error("CronScheduled-error-4:", err)
|
|
|
+ logs.Error("processAnalysisEarlyWarning-error-1:", err)
|
|
|
return
|
|
|
}
|
|
|
if exist {
|
|
|
_, err := tx2.SQL(`update notice set status = 0 where content = ? `, "downloadplandtl1").Execute()
|
|
|
if err != nil {
|
|
|
- logs.Error("CronScheduled-error-5:", err)
|
|
|
+ logs.Error("processAnalysisEarlyWarning-error-2:", err)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
dataList, err := tx2.SQL("select * from downloadplandtl1_log where date = date_format(now(),'%Y-%m-%d') ").Query().List()
|
|
|
if err != nil {
|
|
|
- logs.Error("CronScheduled-error-6:", err)
|
|
|
+ logs.Error("processAnalysisEarlyWarning-error-3:", err)
|
|
|
return
|
|
|
}
|
|
|
plandtl1SlIdMap := make(map[string][]int64, 0)
|
|
@@ -920,7 +844,7 @@ func processAnalysisEarlyWarning(target []string, pastureId string, serviceId in
|
|
|
|
|
|
pastureList, err := tx2.SQL("select pasture_name from pasture where pastureid = ? ", pastureId).Query().List()
|
|
|
if err != nil {
|
|
|
- logs.Error("CronScheduled-error-6:", err)
|
|
|
+ logs.Error("processAnalysisEarlyWarning-error-4:", err)
|
|
|
return
|
|
|
}
|
|
|
var pastureName string
|
|
@@ -939,7 +863,7 @@ func processAnalysisEarlyWarning(target []string, pastureId string, serviceId in
|
|
|
data["planid"], data["sort"], data["pastureid"]).Query().List()
|
|
|
|
|
|
if err != nil {
|
|
|
- logs.Error("CronScheduled-error-7:", err)
|
|
|
+ logs.Error("processAnalysisEarlyWarning-error-5:", err)
|
|
|
return
|
|
|
}
|
|
|
for _, plandtl1 := range plandtl1List {
|
|
@@ -958,13 +882,9 @@ func processAnalysisEarlyWarning(target []string, pastureId string, serviceId in
|
|
|
|
|
|
errorvalue, _ := strconv.ParseFloat(plandtl1["errorvalue"].(string), 64)
|
|
|
if plandtl1["feedallowratio"].(float64) < errorvalue {
|
|
|
- // if plandtl1["feedallowratio"].(float64) < plandtl1["errorvalue"].(float64) {
|
|
|
- fmt.Println(plandtl1, "推送")
|
|
|
- // target := []string{"13916925233"}
|
|
|
var sendList []interface{}
|
|
|
sendStr := fmt.Sprintf("操作编号:%v\n牧场:%s\nTMR名称:%v\n描述:%v\n饲料名称:%v\n计划重量(kg):%v\n实际重量(kg):%v\n误差值(kg):%v\n准确率(%%):%v",
|
|
|
plandtl1["projname"], pastureName, plandtl1["tmrtname"], plandtl1["remark"], plandtl1["fname"], plandtl1["lweight"], plandtl1["actualweightminus"], plandtl1["errorvalue"], plandtl1["accuracy"])
|
|
|
- // content = append(content, "混料", plandtl1["begintime"], "kpt", sendStr, "搅拌预警")
|
|
|
|
|
|
sendMap1 := make(map[string]interface{}, 0)
|
|
|
sendMap1["value"] = "混料准确率异常"
|
|
@@ -980,10 +900,6 @@ func processAnalysisEarlyWarning(target []string, pastureId string, serviceId in
|
|
|
sendMap2["value"] = plandtl1["intime"]
|
|
|
sendMap2["color"] = "#173177"
|
|
|
sendList = append(sendList, sendMap2)
|
|
|
- // sendMap3 := make(map[string]interface{}, 0)
|
|
|
- // sendMap3["value"] = "kpt"
|
|
|
- // sendMap3["color"] = "#173177"
|
|
|
- // sendList = append(sendList, sendMap3)
|
|
|
|
|
|
sendMap5 := make(map[string]interface{}, 0)
|
|
|
sendMap5["value"] = "无备注"
|
|
@@ -995,7 +911,7 @@ func processAnalysisEarlyWarning(target []string, pastureId string, serviceId in
|
|
|
plandtl1SlIdMap["planid"] = append(plandtl1SlIdMap["planid"], plandtl1["id"].(int64))
|
|
|
_, err := tx2.SQL(" update downloadplandtl1_log set plandtl1 = ? where id = ? and type = 0 ", plandtl1["id"], data["id"]).Execute()
|
|
|
if err != nil {
|
|
|
- logs.Error("CronScheduled-error-8:", err)
|
|
|
+ logs.Error("processAnalysisEarlyWarning-error-6:", err)
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1009,7 +925,7 @@ func processAnalysisEarlyWarning(target []string, pastureId string, serviceId in
|
|
|
data["planid"], data["sort"], data["pastureid"]).Query().List()
|
|
|
// Where(" pid = ? ", data["planid"]).And("sort = ? ", data["sort"]).And(" pastureid = ? ", data["pastureid"]).And(" intime is not null").And("type = 0 ").Query().List()
|
|
|
if err != nil {
|
|
|
- logs.Error("CronScheduled-error-7:", err)
|
|
|
+ logs.Error("processAnalysisEarlyWarning-error-7:", err)
|
|
|
return
|
|
|
}
|
|
|
for _, plandtl1 := range plandtl1List {
|
|
@@ -1030,8 +946,6 @@ func processAnalysisEarlyWarning(target []string, pastureId string, serviceId in
|
|
|
errorvalue, _ := strconv.ParseFloat(plandtl1["errorvalue"].(string), 64)
|
|
|
if float64(plandtl1["allowratio"].(int64)) < errorvalue && float64(plandtl1["allowratio"].(int64)) != 0 {
|
|
|
fmt.Println(plandtl1, "推送")
|
|
|
- // target := []string{"13916925233"}
|
|
|
- // var content []interface{}
|
|
|
|
|
|
var sendList []interface{}
|
|
|
sendStr := fmt.Sprintf("操作编号:%v\n牧场:%s\nTMR名称:%v\n描述:%v\n栏舍名称:%v\n计划重量(kg):%v\n实际重量(kg):%v\n误差值(kg):%v\n准确率(%%):%v",
|
|
@@ -1061,7 +975,7 @@ func processAnalysisEarlyWarning(target []string, pastureId string, serviceId in
|
|
|
plandtl1SlIdMap["planid"] = append(plandtl1SlIdMap["planid"], plandtl1["id"].(int64))
|
|
|
_, err := tx2.SQL(" update downloadplandtl1_log set plandtl1 = ? where id = ? and type = 1 ", plandtl1["id"], data["id"]).Execute()
|
|
|
if err != nil {
|
|
|
- logs.Error("CronScheduled-error-8:", err)
|
|
|
+ logs.Error("processAnalysisEarlyWarning-error-8:", err)
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1072,7 +986,6 @@ func processAnalysisEarlyWarning(target []string, pastureId string, serviceId in
|
|
|
}
|
|
|
|
|
|
func manualUdData(pastureinfo *udPastureInfo) {
|
|
|
-
|
|
|
c := cron.New()
|
|
|
c.AddFunc("10 02 * * *", func() {
|
|
|
// fmt.Println(time.Now())
|
|
@@ -1089,7 +1002,7 @@ func manualUdData(pastureinfo *udPastureInfo) {
|
|
|
if exist {
|
|
|
dataList, err := tx.SQL(" select id from downloadedplan where mydate = ? ", now).QueryString()
|
|
|
if err != nil {
|
|
|
- logs.Error("manualUdData-error-1:", err)
|
|
|
+ logs.Error("manualUdData-error-2:", err)
|
|
|
return
|
|
|
}
|
|
|
var idList []string
|
|
@@ -1106,8 +1019,8 @@ func manualUdData(pastureinfo *udPastureInfo) {
|
|
|
func abnormalMixingDelay(target []string, pastureId string, serviceId int64) {
|
|
|
tx2 := restful.Engine.NewSession()
|
|
|
defer tx2.Close()
|
|
|
- // time.Now().Format("2006-01-02")
|
|
|
- dataList, err := tx2.SQL(` select id,planid,sort from downloadplandtl1_log where abnormalMixingDelay = 0 and type = 0 and pastureid = ? and date = ? `, pastureId, "2022-06-24").Query().List()
|
|
|
+ now := time.Now().Format("2006-01-02")
|
|
|
+ dataList, err := tx2.SQL(` select id,planid,sort from downloadplandtl1_log where abnormalMixingDelay = 0 and type = 0 and pastureid = ? and date = ? `, pastureId, now).Query().List()
|
|
|
if err != nil {
|
|
|
logs.Error("abnormalMixingDelay-error-1:", err)
|
|
|
return
|
|
@@ -1121,12 +1034,11 @@ func abnormalMixingDelay(target []string, pastureId string, serviceId int64) {
|
|
|
d.datacaptureno,(select pasture_name from pasture where pastureid = ?) as pasturename,de.actualweightminus from downloadplandtl1_exec de
|
|
|
join downloadedplan d on de.pid = d.id where de.pid = ? and de.sort = ? `, pastureId, data["planid"], data["sort"]).Query().List()
|
|
|
if err != nil {
|
|
|
- logs.Error("abnormalMixingDelay-error-1:", err)
|
|
|
+ logs.Error("abnormalMixingDelay-error-2:", err)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
for _, plan := range planList {
|
|
|
- // if plan["stirdelay"].(int64) > 0 {
|
|
|
showTime, _ := time.ParseInLocation("2006-01-02 15:04:05", fmt.Sprintf("%s %s", time.Now().Format("2006-01-02"), plan["processtime"]), local)
|
|
|
nowTime, _ := time.ParseInLocation("2006-01-02 15:04:05", fmt.Sprintf("%s 00:00:00", time.Now().Format("2006-01-02")), local)
|
|
|
|
|
@@ -1156,10 +1068,9 @@ func abnormalMixingDelay(target []string, pastureId string, serviceId int64) {
|
|
|
|
|
|
wxPush(target, sendList, pastureId, serviceId)
|
|
|
}
|
|
|
- // }
|
|
|
_, err := tx2.SQL(` update downloadplandtl1_log set abnormalMixingDelay = 1 where id = ? `, data["id"]).Execute()
|
|
|
if err != nil {
|
|
|
- logs.Error("abnormalMixingDelay-error-2:", err)
|
|
|
+ logs.Error("abnormalMixingDelay-error-3:", err)
|
|
|
return
|
|
|
}
|
|
|
}
|
|
@@ -1169,15 +1080,15 @@ func abnormalMixingDelay(target []string, pastureId string, serviceId int64) {
|
|
|
func endOfShift(target []string, pastureId string, serviceId int64) {
|
|
|
tx := restful.Engine.NewSession()
|
|
|
defer tx.Close()
|
|
|
- // time.Now().Format("2006-01-02")
|
|
|
- logList, err := tx.SQL(` select times from downloadedplan_log where date = ? and classes = 0 group by times `, "2022-06-24").Query().List()
|
|
|
+ now := time.Now().Format("2006-01-02")
|
|
|
+ logList, err := tx.SQL(` select times from downloadedplan_log where date = ? and classes = 0 group by times `, now).Query().List()
|
|
|
if err != nil {
|
|
|
logs.Error("endOfShift-error-1:", err)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
for _, item := range logList {
|
|
|
- exist, err := tx.SQL(` select id from downloadedplan where mydate = ? and times = ? and iscompleted = 0 and enable = 1 `, "2022-06-24", item["times"]).Exist()
|
|
|
+ exist, err := tx.SQL(` select id from downloadedplan where mydate = ? and times = ? and iscompleted = 0 and enable = 1 `, now, item["times"]).Exist()
|
|
|
if err != nil {
|
|
|
logs.Error("endOfShift-error-2:", err)
|
|
|
return
|
|
@@ -1192,7 +1103,7 @@ func endOfShift(target []string, pastureId string, serviceId int64) {
|
|
|
round( sum(UNIX_TIMESTAMP(concat("2022-01-01 ", de.processtime)) - UNIX_TIMESTAMP("2022-01-01 00:00:00") ),0) processtime ,abs(sum(de.actualweightminus)-sum(de.lweight)) as wcz
|
|
|
from downloadedplan d
|
|
|
join downloadplandtl1_exec de on de.pid = d.id
|
|
|
- where d.times = ? and d.mydate = ? and lpplantype in(0,1) group by d.times`, item["times"], "2022-06-24").Query().List()
|
|
|
+ where d.times = ? and d.mydate = ? and lpplantype in(0,1) group by d.times`, item["times"], now).Query().List()
|
|
|
if err != nil {
|
|
|
logs.Error("endOfShift-error-3:", err)
|
|
|
return
|
|
@@ -1205,7 +1116,7 @@ func endOfShift(target []string, pastureId string, serviceId int64) {
|
|
|
round( sum(UNIX_TIMESTAMP(concat("2022-01-01 ", de.processtime)) - UNIX_TIMESTAMP("2022-01-01 00:00:00") ),0) processtime ,abs(sum(de.actualweightminus)-sum(de.lweight)) as wcz
|
|
|
from downloadedplan d
|
|
|
join downloadplandtl2 de on de.pid = d.id
|
|
|
- where d.times = ? and d.mydate = ? and lpplantype in(0,2) group by d.times `, item["times"], "2022-06-24").Query().List()
|
|
|
+ where d.times = ? and d.mydate = ? and lpplantype in(0,2) group by d.times `, item["times"], now).Query().List()
|
|
|
if err != nil {
|
|
|
logs.Error("endOfShift-error-4:", err)
|
|
|
return
|
|
@@ -1259,7 +1170,7 @@ func endOfShift(target []string, pastureId string, serviceId int64) {
|
|
|
|
|
|
wxPush(target, sendList, pastureId, serviceId)
|
|
|
|
|
|
- _, err = tx.SQL(` update downloadedplan_log set classes = 1 where date = ? and times = ? `, "2022-06-24", item["times"]).Execute()
|
|
|
+ _, err = tx.SQL(` update downloadedplan_log set classes = 1 where date = ? and times = ? `, now, item["times"]).Execute()
|
|
|
if err != nil {
|
|
|
logs.Error("endOfShift-error-5:", err)
|
|
|
return
|
|
@@ -1273,13 +1184,14 @@ func plansToComplete(target []string, pastureId string, serviceId int64) {
|
|
|
tx := restful.Engine.NewSession()
|
|
|
defer tx.Close()
|
|
|
|
|
|
- exist, err := tx.SQL(` select id from downloadedplan_log where date = ? and dailyplan = 0 `, "2022-06-24").Exist()
|
|
|
+ now := time.Now()
|
|
|
+ exist, err := tx.SQL(` select id from downloadedplan_log where date = ? and dailyplan = 0 `, now).Exist()
|
|
|
if err != nil {
|
|
|
logs.Error("plansToComplete-error-1:", err)
|
|
|
return
|
|
|
}
|
|
|
if exist {
|
|
|
- downloadedplanExist, err := tx.SQL(` select id from downloadedplan where mydate = ? and iscompleted = 0 and enable = 1 `, "2022-06-24").Exist()
|
|
|
+ downloadedplanExist, err := tx.SQL(` select id from downloadedplan where mydate = ? and iscompleted = 0 and enable = 1 `, now).Exist()
|
|
|
if err != nil {
|
|
|
logs.Error("plansToComplete-error-2:", err)
|
|
|
return
|
|
@@ -1294,7 +1206,7 @@ func plansToComplete(target []string, pastureId string, serviceId int64) {
|
|
|
round( sum(UNIX_TIMESTAMP(concat("2022-01-01 ", de.processtime)) - UNIX_TIMESTAMP("2022-01-01 00:00:00") ),0) processtime ,abs(sum(de.actualweightminus)-sum(de.lweight)) as wcz
|
|
|
from downloadedplan d
|
|
|
join downloadplandtl1_exec de on de.pid = d.id
|
|
|
- where d.mydate = ? and lpplantype in(0,1) group by d.mydate`, "2022-06-24", "2022-06-24").Query().List()
|
|
|
+ where d.mydate = ? and lpplantype in(0,1) group by d.mydate`, now, now).Query().List()
|
|
|
if err != nil {
|
|
|
logs.Error("plansToComplete-error-3:", err)
|
|
|
return
|
|
@@ -1307,7 +1219,7 @@ func plansToComplete(target []string, pastureId string, serviceId int64) {
|
|
|
round( sum(UNIX_TIMESTAMP(concat("2022-01-01 ", de.processtime)) - UNIX_TIMESTAMP("2022-01-01 00:00:00") ),0) processtime ,abs(sum(de.actualweightminus)-sum(de.lweight)) as wcz
|
|
|
from downloadedplan d
|
|
|
join downloadplandtl2 de on de.pid = d.id
|
|
|
- where d.mydate = ? and lpplantype in(0,2) group by d.mydate `, "2022-06-24").Query().List()
|
|
|
+ where d.mydate = ? and lpplantype in(0,2) group by d.mydate `, now).Query().List()
|
|
|
if err != nil {
|
|
|
logs.Error("plansToComplete-error-4:", err)
|
|
|
return
|
|
@@ -1322,7 +1234,6 @@ func plansToComplete(target []string, pastureId string, serviceId int64) {
|
|
|
data["hlaccurate"] = hl["accurate"]
|
|
|
data["hlcorrect"] = hl["correct"]
|
|
|
data["hlcorrectcount"] = hl["correctcount"]
|
|
|
- // data["hlprocesstime"] = util.TimeTransformation(hl["processtime"].(int64))
|
|
|
data["hlwcz"] = hl["wcz"]
|
|
|
}
|
|
|
for _, sl := range slList {
|
|
@@ -1331,7 +1242,6 @@ func plansToComplete(target []string, pastureId string, serviceId int64) {
|
|
|
data["slaccurate"] = sl["accurate"]
|
|
|
data["slcorrect"] = sl["correct"]
|
|
|
data["slcorrectcount"] = sl["correctcount"]
|
|
|
- // data["slprocesstime"] = util.TimeTransformation(sl["processtime"].(int64))
|
|
|
data["slwcz"] = sl["wcz"]
|
|
|
}
|
|
|
sendStr := fmt.Sprintf("班次数:%v\n车次数:\n实际混料(kg):%v\n混料误差值(kg):%v\n混料准确率:%v\n混料正确数:%v\n混料正确率:%v\n混料完成时间:%v\n实际撒料(kg):%v\n撒料误差值(kg):%v\n撒料准确率:%v\n撒料正确数:%v\n撒料正确率:%v",
|
|
@@ -1362,7 +1272,7 @@ func plansToComplete(target []string, pastureId string, serviceId int64) {
|
|
|
|
|
|
wxPush(target, sendList, pastureId, serviceId)
|
|
|
|
|
|
- _, err = tx.SQL(` update downloadedplan_log set dailyplan = 1 where date = ? `, "2022-06-24").Execute()
|
|
|
+ _, err = tx.SQL(` update downloadedplan_log set dailyplan = 1 where date = ? `, now).Execute()
|
|
|
if err != nil {
|
|
|
logs.Error("plansToComplete-error-5:", err)
|
|
|
return
|
|
@@ -1370,3 +1280,346 @@ func plansToComplete(target []string, pastureId string, serviceId int64) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+func AddFormulaIssued(c *gin.Context) {
|
|
|
+ appG := app.Gin{C: c}
|
|
|
+ dataByte, _ := ioutil.ReadAll(c.Request.Body)
|
|
|
+ tempval_ := make(map[string]interface{})
|
|
|
+ tempCommon := make(map[string]interface{})
|
|
|
+ tempval := make([]map[string]interface{}, 0)
|
|
|
+ err := json.Unmarshal(dataByte, &tempval_)
|
|
|
+ logging.Info("AddFormulaIssued ", c.Keys, c.Request.RemoteAddr, tempval_["common"], tempval_["data"])
|
|
|
+ if err != nil {
|
|
|
+ } else {
|
|
|
+ if v, ok := tempval_["data"].([]interface{}); ok {
|
|
|
+ for _, Tvalue := range v {
|
|
|
+ if v1, ok := Tvalue.(map[string]interface{}); ok {
|
|
|
+ tempval = append(tempval, v1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tx := restful.Engine.NewSession()
|
|
|
+
|
|
|
+ err := tx.Begin()
|
|
|
+ if err != nil {
|
|
|
+ logging.Error("tx.Begin 事务启动失败__error:", err)
|
|
|
+ }
|
|
|
+ defer func() {
|
|
|
+ switch {
|
|
|
+ case err != nil:
|
|
|
+ if tx != nil {
|
|
|
+ tx.Rollback()
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ if tx != nil {
|
|
|
+ err = tx.Commit()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if tx != nil {
|
|
|
+ tx.Close()
|
|
|
+ }
|
|
|
+ }()
|
|
|
+
|
|
|
+ if err == nil {
|
|
|
+ if tempv, exists := c.Get("jwt_username"); exists {
|
|
|
+ tempCommon["jwt_username"] = tempv.(string)
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, paramvalue := range tempval {
|
|
|
+ if _, ok := paramvalue["resultname"]; !ok {
|
|
|
+ paramvalue["resultname"] = paramvalue["name"]
|
|
|
+ }
|
|
|
+ _, err = ExecDataParam(paramvalue, tempCommon, tempval, nil, nil, tx)
|
|
|
+ if err != nil {
|
|
|
+ logging.Error("AddFormulaIssued error-1:", err)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if err == nil {
|
|
|
+ var temid, jtpastureid, tcode, tname, ccname, fttype string
|
|
|
+ for _, tem := range tempval {
|
|
|
+ if tem["name"].(string) == "insertSpotList" {
|
|
|
+ for _, item := range tem["resultmaps"].(map[string]interface{})["list"].([]interface{}) {
|
|
|
+ itemmap := item.(map[string]interface{})
|
|
|
+ jtpastureid = itemmap["pastureid"].(string)
|
|
|
+ temid = itemmap["id"].(string)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ feedtempletList, err := tx.SQL(` select tname,tcode,id,ccname,fttype from feedtemplet where id = ? and pastureid = ? `, temid, jtpastureid).Query().List()
|
|
|
+ if err != nil {
|
|
|
+ logs.Error("AddFormulaIssued-error-2:", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, feedtemplet := range feedtempletList {
|
|
|
+ tcode = feedtemplet["tcode"].(string)
|
|
|
+ tname = feedtemplet["tname"].(string)
|
|
|
+ ccname = feedtemplet["ccname"].(string)
|
|
|
+ fttype = feedtemplet["fttype"].(string)
|
|
|
+ }
|
|
|
+ for _, tem := range tempval {
|
|
|
+ if tem["name"].(string) == "insertSpotList2" {
|
|
|
+ for _, item := range tem["resultmaps"].(map[string]interface{})["list"].([]interface{}) {
|
|
|
+ itemmap := item.(map[string]interface{})
|
|
|
+ dataList, err := tx.SQL(` select user,function,id,service_id from remind where pastureid = ? and function = ? `, itemmap["id"], "formulaIssued").Query().List()
|
|
|
+ if err != nil {
|
|
|
+ logs.Error("AddFormulaIssued-error-3:", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, data := range dataList {
|
|
|
+ var openIdList []string
|
|
|
+ if _, ok := data["user"]; ok {
|
|
|
+ openIdList = strings.Split(data["user"].(string), ",")
|
|
|
+ }
|
|
|
+
|
|
|
+ var sendList []interface{}
|
|
|
+ sendStr := fmt.Sprintf("配方名称:%v\n配方编码:%s\n牲畜类别:%v\n配方类型:%v",
|
|
|
+ tname, tcode, ccname, fttype)
|
|
|
+
|
|
|
+ sendMap1 := make(map[string]interface{}, 0)
|
|
|
+ sendMap1["value"] = "混料准确率异常"
|
|
|
+ sendMap1["color"] = "#173177"
|
|
|
+ sendList = append(sendList, sendMap1)
|
|
|
+
|
|
|
+ sendMap4 := make(map[string]interface{}, 0)
|
|
|
+ sendMap4["value"] = sendStr
|
|
|
+ sendMap4["color"] = "#173177"
|
|
|
+ sendList = append(sendList, sendMap4)
|
|
|
+
|
|
|
+ sendMap2 := make(map[string]interface{}, 0)
|
|
|
+ sendMap2["value"] = time.Now().Format("2006-01-02 15:04:05")
|
|
|
+ sendMap2["color"] = "#173177"
|
|
|
+ sendList = append(sendList, sendMap2)
|
|
|
+
|
|
|
+ sendMap5 := make(map[string]interface{}, 0)
|
|
|
+ sendMap5["value"] = "无备注"
|
|
|
+ sendMap5["color"] = "#173177"
|
|
|
+ sendList = append(sendList, sendMap5)
|
|
|
+ wxPush(openIdList, sendList, itemmap["id"].(string), data["service_id"].(int64))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if tempCommon["returnmap"] != nil && tempCommon["returnmap"] != "" {
|
|
|
+ appG.Response(http.StatusOK, e.SUCCESS, tempval)
|
|
|
+ } else {
|
|
|
+ appG.Response(http.StatusOK, e.SUCCESS, "成功执行!")
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ msg := geterrmsg(err.Error())
|
|
|
+ appG.Response(http.StatusOK, e.ERROR, msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if err != nil {
|
|
|
+ msg := geterrmsg(err.Error())
|
|
|
+ appG.Response(http.StatusOK, e.ERROR, msg)
|
|
|
+ appG.Response(http.StatusOK, 200, nil)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+func AddBigInventory(c *gin.Context) {
|
|
|
+ appG := app.Gin{C: c}
|
|
|
+ dataByte, _ := ioutil.ReadAll(c.Request.Body)
|
|
|
+ tempval_ := make(map[string]interface{})
|
|
|
+ tempCommon := make(map[string]interface{})
|
|
|
+ tempval := make([]map[string]interface{}, 0)
|
|
|
+ err := json.Unmarshal(dataByte, &tempval_)
|
|
|
+ logging.Info("AddBigInventory ", c.Keys, c.Request.RemoteAddr, tempval_["common"], tempval_["data"])
|
|
|
+
|
|
|
+ if err != nil {
|
|
|
+ } else {
|
|
|
+ if v, ok := tempval_["common"].(map[string]interface{}); ok {
|
|
|
+ tempCommon = v
|
|
|
+ }
|
|
|
+
|
|
|
+ if v, ok := tempval_["data"].([]interface{}); ok {
|
|
|
+ for _, Tvalue := range v {
|
|
|
+ if v1, ok := Tvalue.(map[string]interface{}); ok {
|
|
|
+ tempval = append(tempval, v1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ tx := restful.Engine.NewSession()
|
|
|
+
|
|
|
+ err := tx.Begin()
|
|
|
+ if err != nil {
|
|
|
+ logging.Error("tx.Begin 事务启动失败__error:", err)
|
|
|
+ }
|
|
|
+ defer func() {
|
|
|
+ switch {
|
|
|
+ case err != nil:
|
|
|
+ if tx != nil {
|
|
|
+ tx.Rollback()
|
|
|
+ }
|
|
|
+ default:
|
|
|
+ if tx != nil {
|
|
|
+ err = tx.Commit()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if tx != nil {
|
|
|
+ tx.Close()
|
|
|
+ }
|
|
|
+ }()
|
|
|
+
|
|
|
+ if err == nil {
|
|
|
+ if tempv, exists := c.Get("jwt_username"); exists {
|
|
|
+ tempCommon["jwt_username"] = tempv.(string)
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, paramvalue := range tempval {
|
|
|
+ if _, ok := paramvalue["resultname"]; !ok {
|
|
|
+ paramvalue["resultname"] = paramvalue["name"]
|
|
|
+ }
|
|
|
+ _, err = ExecDataParam(paramvalue, tempCommon, tempval, nil, nil, tx)
|
|
|
+ if err != nil {
|
|
|
+ logging.Error("AddBigInventory error-1:", err)
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if err == nil {
|
|
|
+
|
|
|
+ var pastureid, date string
|
|
|
+ for _, tem := range tempval {
|
|
|
+ if tem["name"].(string) == "insertBigInventory" {
|
|
|
+ parammaps := tem["parammaps"].(map[string]interface{})
|
|
|
+ pastureid = parammaps["pastureid"].(string)
|
|
|
+ date = parammaps["inventorydate"].(string)
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ feedinventoryList, err := tx.SQL(`SELECT
|
|
|
+ remark,DATE_FORMAT(inventorydate, '%Y-%m-%d') inventorydate,createuser,
|
|
|
+ TRIM(f.id) id,
|
|
|
+ TRIM(f.pastureid) pastureid,
|
|
|
+ ifnull(round((select sum(theoryweight-factweight) from feedinventorydetail fd where fd.pastureid and fd.invid = f.id and fd.theoryweight>fd.factweight) ,2),0) lessWeight,
|
|
|
+ ifnull(round((select sum(factweight-theoryweight) from feedinventorydetail fd where fd.pastureid and fd.invid = f.id and fd.theoryweight<fd.factweight),2),0) moreWeight ,
|
|
|
+ ifnull(round((select sum(factweight-theoryweight) from feedinventorydetail fd where fd.pastureid and fd.invid = f.id and fd.theoryweight<>fd.factweight) ,2),0) differWeight
|
|
|
+ FROM
|
|
|
+ feedinventory f
|
|
|
+ WHERE f.pastureid = ? and f.inventorydate=? `, pastureid, date).Query().List()
|
|
|
+ if err != nil {
|
|
|
+ logs.Error("AddBigInventory-error-2:", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ dataList, err := tx.SQL(` select user,function,id,service_id from remind where pastureid = ? and function = ? `, pastureid, "formulaIssued").Query().List()
|
|
|
+ if err != nil {
|
|
|
+ logs.Error("AddBigInventory-error-3:", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, data := range dataList {
|
|
|
+ var openIdList []string
|
|
|
+ if _, ok := data["user"]; ok {
|
|
|
+ openIdList = strings.Split(data["user"].(string), ",")
|
|
|
+ }
|
|
|
+ var createuser, lessWeight, moreWeight, differWeight interface{}
|
|
|
+ for _, f := range feedinventoryList {
|
|
|
+ createuser = f["createuser"]
|
|
|
+ lessWeight = f["lessWeight"]
|
|
|
+ moreWeight = f["moreWeight"]
|
|
|
+ differWeight = f["differWeight"]
|
|
|
+ }
|
|
|
+ var sendList []interface{}
|
|
|
+ sendStr := fmt.Sprintf("盘点人:%v\n盘盈库存(kg):%v\n盘亏库存(kg):%v\n盈亏净值(kg):%v",
|
|
|
+ createuser, moreWeight, lessWeight, differWeight)
|
|
|
+ sendMap1 := make(map[string]interface{}, 0)
|
|
|
+ sendMap1["value"] = "库存盘点"
|
|
|
+ sendMap1["color"] = "#173177"
|
|
|
+ sendList = append(sendList, sendMap1)
|
|
|
+
|
|
|
+ sendMap4 := make(map[string]interface{}, 0)
|
|
|
+ sendMap4["value"] = sendStr
|
|
|
+ sendMap4["color"] = "#173177"
|
|
|
+ sendList = append(sendList, sendMap4)
|
|
|
+
|
|
|
+ sendMap2 := make(map[string]interface{}, 0)
|
|
|
+ sendMap2["value"] = time.Now().Format("2006-01-02 15:04:05")
|
|
|
+ sendMap2["color"] = "#173177"
|
|
|
+ sendList = append(sendList, sendMap2)
|
|
|
+
|
|
|
+ sendMap5 := make(map[string]interface{}, 0)
|
|
|
+ sendMap5["value"] = "无备注"
|
|
|
+ sendMap5["color"] = "#173177"
|
|
|
+ sendList = append(sendList, sendMap5)
|
|
|
+
|
|
|
+ wxPush(openIdList, sendList, pastureid, data["service_id"].(int64))
|
|
|
+ }
|
|
|
+ if tempCommon["returnmap"] != nil && tempCommon["returnmap"] != "" {
|
|
|
+ appG.Response(http.StatusOK, e.SUCCESS, tempval)
|
|
|
+ } else {
|
|
|
+ appG.Response(http.StatusOK, e.SUCCESS, "成功执行!")
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ msg := geterrmsg(err.Error())
|
|
|
+ appG.Response(http.StatusOK, e.ERROR, msg)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if err != nil {
|
|
|
+ msg := geterrmsg(err.Error())
|
|
|
+ appG.Response(http.StatusOK, e.ERROR, msg)
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+func inventoryWarning(target []string, pastureId string, serviceId int64) {
|
|
|
+
|
|
|
+ tx := restful.Engine.NewSession()
|
|
|
+ defer tx.Close()
|
|
|
+
|
|
|
+ feedstorageList, err := tx.SQL(`
|
|
|
+ SELECT
|
|
|
+ (select fname from feed where pastureid =fs.pastureid and id = fs.feedid ) feedname,
|
|
|
+ fs.stockweight,round(fs.lweight,2) avgweight, if (fs.stockweight<=0,0, FLOOR(fs.stockweight/fs.lweight)) ldays,
|
|
|
+ TRIM(fs.feedid) feedid,
|
|
|
+ TRIM(fs.pastureid) pastureid,
|
|
|
+ DATE_FORMAT((select max(date) from fswarnhis where pastureid = fs.pastureid and feedid = fs.feedid ), '%Y-%m-%d') lastdate
|
|
|
+ FROM (SELECT fs.pushstatus,
|
|
|
+ fs.id,
|
|
|
+ fs.feedname,fs.stockweight,
|
|
|
+ fs.feedid feedid,
|
|
|
+ fs.pastureid pastureid,DATE_FORMAT(NOW(), '%Y-%m-%d') lastdate,
|
|
|
+ (SELECT SUM(d.lweight)/7 lweight FROM downloadplandtl1 d WHERE d.pastureid = fs.pastureid
|
|
|
+ AND date >= DATE_FORMAT(DATE_ADD(NOW(),INTERVAL -7 DAY), '%Y-%m-%d')
|
|
|
+ AND date <DATE_FORMAT(NOW(), '%Y-%m-%d') AND d.fid = fs.feedid) lweight
|
|
|
+ FROM feedstorage fs) fs
|
|
|
+ WHERE fs.pastureid=? AND fs.stockweight< fs.lweight*(SELECT inforvalue FROM sysopt WHERE sysopt.pastureid = fs.pastureid
|
|
|
+ AND inforname = 'repertoryWarn')
|
|
|
+ ORDER BY ldays ,stockweight `).Query().List()
|
|
|
+ if err != nil {
|
|
|
+ logs.Error("inventoryWarning-error-1:", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, f := range feedstorageList {
|
|
|
+ var sendList []interface{}
|
|
|
+ sendStr := fmt.Sprintf("饲料名称:%v\n库存量(kg):%s\n近7天平均计划量:%v\n剩余使用天数:%v",
|
|
|
+ f["feedname"], f["stockweight"], f["lweight"], f["ldays"])
|
|
|
+
|
|
|
+ sendMap1 := make(map[string]interface{}, 0)
|
|
|
+ sendMap1["value"] = "库存预警"
|
|
|
+ sendMap1["color"] = "#173177"
|
|
|
+ sendList = append(sendList, sendMap1)
|
|
|
+
|
|
|
+ sendMap4 := make(map[string]interface{}, 0)
|
|
|
+ sendMap4["value"] = sendStr
|
|
|
+ sendMap4["color"] = "#173177"
|
|
|
+ sendList = append(sendList, sendMap4)
|
|
|
+
|
|
|
+ sendMap2 := make(map[string]interface{}, 0)
|
|
|
+ sendMap2["value"] = time.Now().Format("2006-01-02 15:04:05")
|
|
|
+ sendMap2["color"] = "#173177"
|
|
|
+ sendList = append(sendList, sendMap2)
|
|
|
+
|
|
|
+ sendMap5 := make(map[string]interface{}, 0)
|
|
|
+ sendMap5["value"] = "无备注"
|
|
|
+ sendMap5["color"] = "#173177"
|
|
|
+ sendList = append(sendList, sendMap5)
|
|
|
+ wxPush(target, sendList, pastureId, serviceId)
|
|
|
+ }
|
|
|
+
|
|
|
+}
|