|
@@ -7,6 +7,7 @@ import (
|
|
|
"FollowUp_Notice/models/Account"
|
|
|
"FollowUp_Notice/models/Illness"
|
|
|
"FollowUp_Notice/models/Patient"
|
|
|
+ "FollowUp_Notice/models/Surgical"
|
|
|
"FollowUp_Notice/models/System"
|
|
|
"FollowUp_Notice/models/Tag"
|
|
|
"encoding/json"
|
|
@@ -47,8 +48,10 @@ func (c *PatientController) Patient_List() {
|
|
|
T_name := c.GetString("T_name")
|
|
|
// 标签
|
|
|
T_tag, _ := c.GetInt("T_tag")
|
|
|
- // 疾病
|
|
|
+ // 诊断
|
|
|
T_illness, _ := c.GetInt("T_illness")
|
|
|
+ // 术式
|
|
|
+ T_surgical, _ := c.GetInt("T_surgical")
|
|
|
// 通知状态 1待通知 2已通知
|
|
|
T_notice, _ := c.GetInt("T_notice")
|
|
|
// 复诊状态 1正常 2超时
|
|
@@ -59,7 +62,8 @@ func (c *PatientController) Patient_List() {
|
|
|
T_next_time_sort, _ := c.GetInt("T_next_time_sort")
|
|
|
Tag.Read_Tag_All_Map()
|
|
|
Illness.Read_Illness_All_Map()
|
|
|
- R_List, R_cnt := Patient.Read_Patient_List(c.User.Id, T_number, T_name, T_tag, T_illness, T_notice, T_follow_up, T_age_sort, T_next_time_sort, page, page_z)
|
|
|
+ Surgical.Read_Surgical_All_Map()
|
|
|
+ R_List, R_cnt := Patient.Read_Patient_List(c.User.Id, T_number, T_name, T_tag, T_illness, T_surgical, T_notice, T_follow_up, T_age_sort, T_next_time_sort, page, page_z)
|
|
|
|
|
|
var r_jsons lib.R_JSONS
|
|
|
r_jsons.Num = R_cnt
|
|
@@ -80,6 +84,7 @@ func (c *PatientController) Patient_Add() {
|
|
|
T_age, _ := c.GetInt("T_age")
|
|
|
T_tag := c.GetString("T_tag")
|
|
|
T_illness, _ := c.GetInt("T_illness")
|
|
|
+ T_surgical, _ := c.GetInt("T_surgical")
|
|
|
T_phone := c.GetString("T_phone")
|
|
|
T_notice_phone, _ := c.GetInt("T_notice_phone")
|
|
|
T_notice_message, _ := c.GetInt("T_notice_message")
|
|
@@ -93,6 +98,7 @@ func (c *PatientController) Patient_Add() {
|
|
|
T_age: T_age,
|
|
|
T_tag: T_tag,
|
|
|
T_illness: T_illness,
|
|
|
+ T_surgical: T_surgical,
|
|
|
T_phone: T_phone,
|
|
|
T_notice_phone: T_notice_phone,
|
|
|
T_notice_message: T_notice_message,
|
|
@@ -299,7 +305,12 @@ func (c *PatientController) VoiceCall_Status() {
|
|
|
c.Data["json"] = lib.JSONS{Code: 202, Msg: "json.Unmarshal is err:" + err.Error()}
|
|
|
c.ServeJSON()
|
|
|
}
|
|
|
- if body.EventType == "disconnect" {
|
|
|
+ if body.EventType == "answer" {
|
|
|
+ c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
|
|
|
+ c.ServeJSON()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if body.EventType == "disconnect" && body.StatusInfo.StateCode != "0" {
|
|
|
r, err := Patient.Read_PatientSend_ByT_id(body.StatusInfo.SessionId)
|
|
|
if err != nil {
|
|
|
c.Data["json"] = lib.JSONS{Code: 202, Msg: "SessionId Err!"}
|
|
@@ -327,7 +338,7 @@ func Cron_Patient() {
|
|
|
//创建一个定时任务对象
|
|
|
c := cron.New(cron.WithSeconds())
|
|
|
//给对象增加定时任务
|
|
|
- //c.AddFunc("0 */1 * * * ?", Cron_Patient_Notice)
|
|
|
+ //c.AddFunc("0 */1 * * * ?", Cron_Patient_ChangeFollowUp)
|
|
|
c.AddFunc("@daily", Cron_Patient_ChangeFollowUp) // 修改复诊状态
|
|
|
c.AddFunc("0 0 8 * * *", Cron_Patient_Notice) // 消息通知
|
|
|
|
|
@@ -348,7 +359,7 @@ func Cron_Patient_ChangeFollowUp() {
|
|
|
logs.Info("开始处理" + T_date + "患者通知状态")
|
|
|
// T_notice 通知状态 1待通知 2已通知
|
|
|
// T_follow_up 复诊状态 1正常 2超时
|
|
|
- list, _ := Patient.Read_Patient_List(0, "", "", 0, 0, 2, 1, 0, 0, 0, 9999)
|
|
|
+ list, _ := Patient.Read_Patient_List(0, "", "", 0, 0, 0, 2, 1, 0, 0, 0, 9999)
|
|
|
for _, v := range list {
|
|
|
nextTime, _ := lib.DateStrToTime(v.T_next_time)
|
|
|
if nextTime.Before(time.Now()) {
|
|
@@ -378,7 +389,7 @@ func Cron_Patient_Notice() {
|
|
|
if (user.T_money <= 0 && user.T_arrears_notice == 2) || user.T_State == 2 {
|
|
|
continue
|
|
|
}
|
|
|
- patientList, _ := Patient.Read_Patient_List(user.Id, "", "", 0, 0, 0, 1, 0, 0, 0, 9999)
|
|
|
+ patientList, _ := Patient.Read_Patient_List(user.Id, "", "", 0, 0, 0, 0, 1, 0, 0, 0, 9999)
|
|
|
for _, v := range patientList {
|
|
|
nextTime, _ := lib.DateStrToTime(v.T_next_time)
|
|
|
var success bool
|