Browse Source

Merge branch 'fix/2022-07-30' into debug

Roc 2 years ago
parent
commit
9cbc35a0c3

+ 5 - 0
models/company_product.go

@@ -41,6 +41,11 @@ func CompanyFreeze(companyId, productId int) (companyReportPermissionList []*Com
 		freezeEndDate = time.Now().AddDate(0, 2, 0).Format(utils.FormatDate)
 	}
 
+	// 权益客户 冻结期 改为60天
+	if productId == 2 {
+		freezeEndDate = time.Now().AddDate(0, 0, 60).Format(utils.FormatDate)
+	}
+
 	//客户产品 状态 变更
 	sql := `UPDATE company_product SET status='冻结',is_formal=0,is_suspend=0,freeze_time=NOW(),modify_time=NOW(),start_date=?,end_date=?,freeze_start_date=?,freeze_end_date=?,try_stage=1 WHERE company_id=? AND product_id=? `
 	_, err = o.Raw(sql, freezeStartDate, freezeEndDate, freezeStartDate, freezeEndDate, companyId, productId).Exec()

+ 1 - 1
models/roadshow/calendar.go

@@ -106,4 +106,4 @@ func GetRsCalendarResearcherById(rsCalendarId int) (item *RsCalendarResearcher,
 	o := orm.NewOrm()
 	err = o.Raw(sql, rsCalendarId).QueryRow(&item)
 	return
-}
+}

+ 3 - 3
models/roadshow/public_meeting.go

@@ -19,7 +19,7 @@ func GetPublicMeetingList(endDate string) (list []*PublicMeetingView, err error)
 	sql := ` SELECT a.rs_calendar_id,min(DATE_FORMAT(CONCAT(b.start_date," ",b.start_time),'%Y-%m-%d %H:%i:%S')) AS min_time,max(DATE_FORMAT(CONCAT(b.end_date," ",b.end_time),'%Y-%m-%d %H:%i:%S')) AS max_time
 			FROM rs_calendar AS a
 			INNER JOIN rs_calendar_researcher AS b ON a.rs_calendar_id=b.rs_calendar_id
-			WHERE a.source=0 AND activity_type='公开会议'
+			WHERE a.source=0 AND activity_type='公开会议' AND b.status in (1,2)
 			AND b.end_date>=?
 			group by a.rs_calendar_id  `
 	o := orm.NewOrm()
@@ -47,7 +47,7 @@ func GetCoincideMeeting(startTime, endTime string) (list []*PublicMeetingView, e
 			SELECT a.rs_calendar_id,MIN(DATE_FORMAT(CONCAT(b.start_date," ",b.start_time),'%Y-%m-%d %H:%i:%S')) AS min_time,MAX(DATE_FORMAT(CONCAT(b.end_date," ",b.end_time),'%Y-%m-%d %H:%i:%S')) AS max_time
 						FROM rs_calendar AS a
 						INNER JOIN rs_calendar_researcher AS b ON a.rs_calendar_id=b.rs_calendar_id
-						WHERE a.source=0 AND activity_type='公开会议'
+						WHERE a.source=0 AND activity_type='公开会议' AND b.status in (1,2)
 						GROUP BY a.rs_calendar_id
 			) AS t
 			WHERE (t.min_time<=? AND t.max_time>=?) OR (?>=t.min_time AND ?<=t.max_time) or 
@@ -62,7 +62,7 @@ func GetCoincideMeetingMinAndMaxTime(startTime, endTime string) (min_time, max_t
 			SELECT a.rs_calendar_id,MIN(DATE_FORMAT(CONCAT(b.start_date," ",b.start_time),'%Y-%m-%d %H:%i:%S')) AS min_time,MAX(DATE_FORMAT(CONCAT(b.end_date," ",b.end_time),'%Y-%m-%d %H:%i:%S')) AS max_time
 						FROM rs_calendar AS a
 						INNER JOIN rs_calendar_researcher AS b ON a.rs_calendar_id=b.rs_calendar_id
-						WHERE a.source=0 AND activity_type='公开会议'
+						WHERE a.source=0 AND activity_type='公开会议' AND b.status in (1,2) 
 						GROUP BY a.rs_calendar_id
 			)as t
 			where (t.min_time<=? AND t.max_time>=?) OR (?>=t.min_time AND ?<=t.max_time) `

+ 21 - 0
services/data/edb_info.go

@@ -323,6 +323,27 @@ func CheckLtDataInterface(cont context.Context) (err error) {
 	return
 }
 
+// CheckThsDataInterface 检测同花顺数据服务器
+func CheckThsDataInterface(cont context.Context) (err error) {
+	go func() {
+		checkUrl := utils.Hz_Server_Data_Url + `hz_server`
+		body, err := http.Get(checkUrl)
+		if err != nil {
+			//go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"检测数据接口:失败提醒", "CheckPbDataInterface ErrMsg:"+err.Error(), utils.EmailSendToUsers)
+			msg := "检测同花顺数据服务器失败:CheckPbDataInterface ErrMsg:" + err.Error()
+			go alarm_msg.SendAlarmMsg(msg, 3)
+		} else {
+			result := string(body)
+			if result != "1" {
+				//go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"检测数据接口:失败提醒", "CheckPbDataInterface ErrMsg:"+string(body), utils.EmailSendToUsers)
+				msg := "检测同花顺数据服务器失败:CheckPbDataInterface ErrMsg:" + string(body)
+				go alarm_msg.SendAlarmMsg(msg, 3)
+			}
+		}
+	}()
+	return
+}
+
 ////刷新所有计算指标
 //func RefreshDataFromCalculateAll() (err error) {
 //	defer func() {

+ 3 - 3
services/roadshow/public_meeting.go

@@ -60,8 +60,8 @@ import (
 //}
 
 func SetPublicMeetingUnionCode(cont context.Context) (err error) {
-	fmt.Println("start SetPublicMeetingUnionCode"+time.Now().Format(utils.FormatDateTime))
-	now := time.Now().AddDate(-1,0,0).Format(utils.FormatDate)
+	fmt.Println("start SetPublicMeetingUnionCode" + time.Now().Format(utils.FormatDateTime))
+	now := time.Now().AddDate(-1, 0, 0).Format(utils.FormatDate)
 	//清空现有分组
 	err = roadshow.ClearCalendarUnionCode(now)
 	if err != nil {
@@ -98,7 +98,7 @@ func SetPublicMeetingUnionCode(cont context.Context) (err error) {
 		fmt.Println("SetCoincideMeeting:", startDateTime, endDateTime)
 		SetCoincideMeeting(startDateTime, endDateTime, unionCode)
 	}
-	fmt.Println("end SetPublicMeetingUnionCode"+time.Now().Format(utils.FormatDateTime))
+	fmt.Println("end SetPublicMeetingUnionCode" + time.Now().Format(utils.FormatDateTime))
 	return
 }
 

+ 4 - 0
services/task.go

@@ -194,6 +194,10 @@ func releaseTask() {
 	checkWindDataInterface := task.NewTask("checkWindDataInterface", "0 */2 * * * * ", data.CheckWindDataInterface)
 	task.AddTask("checkWindDataInterface", checkWindDataInterface)
 
+	// 检测同花顺数据服务器
+	checkThsDataInterface := task.NewTask("checkThsDataInterface", "0 */2 * * * * ", data.CheckThsDataInterface)
+	task.AddTask("checkThsDataInterface", checkThsDataInterface)
+
 	//初始化指标更新状态
 	resetEdbInfoIsUpdate := task.NewTask("resetEdbInfoIsUpdate", "0 0 0 * * *", data.ResetEdbInfoIsUpdate)
 	task.AddTask("resetEdbInfoIsUpdate", resetEdbInfoIsUpdate)