|
@@ -151,6 +151,7 @@ func (c *PatientController) Patient_Edit() {
|
|
|
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")
|
|
@@ -184,17 +185,19 @@ func (c *PatientController) Patient_Edit() {
|
|
|
patient.T_age = T_age
|
|
|
cols = append(cols, "T_age")
|
|
|
}
|
|
|
- if len(T_tag) > 0 {
|
|
|
- patient.T_tag = T_tag
|
|
|
- cols = append(cols, "T_tag")
|
|
|
- }
|
|
|
- if T_illness > 0 {
|
|
|
- patient.T_illness = T_illness
|
|
|
- cols = append(cols, "T_illness")
|
|
|
- }
|
|
|
+
|
|
|
+ patient.T_tag = T_tag
|
|
|
+ cols = append(cols, "T_tag")
|
|
|
+
|
|
|
+ patient.T_illness = T_illness
|
|
|
+ cols = append(cols, "T_illness")
|
|
|
+
|
|
|
+ patient.T_surgical = T_surgical
|
|
|
+ cols = append(cols, "T_surgical")
|
|
|
+
|
|
|
if len(T_phone) > 0 {
|
|
|
patient.T_phone = T_phone
|
|
|
- cols = append(cols, "T_name")
|
|
|
+ cols = append(cols, "T_phone")
|
|
|
}
|
|
|
patient.T_notice_phone = T_notice_phone
|
|
|
cols = append(cols, "T_notice_phone")
|
|
@@ -293,7 +296,7 @@ func (c *PatientController) VoiceCall_Status() {
|
|
|
Timestamp string `json:"timestamp"`
|
|
|
Caller string `json:"caller"`
|
|
|
Called string `json:"called"`
|
|
|
- StateCode string `json:"stateCode"`
|
|
|
+ StateCode int `json:"stateCode"`
|
|
|
StateDesc string `json:"stateDesc"`
|
|
|
} `json:"statusInfo"`
|
|
|
}
|
|
@@ -305,21 +308,20 @@ func (c *PatientController) VoiceCall_Status() {
|
|
|
c.Data["json"] = lib.JSONS{Code: 202, Msg: "json.Unmarshal is err:" + err.Error()}
|
|
|
c.ServeJSON()
|
|
|
}
|
|
|
- if body.EventType == "answer" {
|
|
|
- c.Data["json"] = lib.JSONS{Code: 200, Msg: "ok!"}
|
|
|
- c.ServeJSON()
|
|
|
- return
|
|
|
- }
|
|
|
- if body.EventType == "disconnect" && body.StatusInfo.StateCode != "0" {
|
|
|
+
|
|
|
+ if body.EventType == "disconnect" {
|
|
|
r, err := Patient.Read_PatientSend_ByT_id(body.StatusInfo.SessionId)
|
|
|
if err != nil {
|
|
|
c.Data["json"] = lib.JSONS{Code: 202, Msg: "SessionId Err!"}
|
|
|
c.ServeJSON()
|
|
|
return
|
|
|
}
|
|
|
- r.T_State = 0
|
|
|
+ if body.StatusInfo.StateCode == 0 {
|
|
|
+ r.T_State = 1
|
|
|
+ }
|
|
|
+ r.T_code = body.StatusInfo.StateCode
|
|
|
r.T_remark = body.StatusInfo.StateDesc
|
|
|
- err = Patient.Update_PatientSend(r, "T_State", "T_remark")
|
|
|
+ err = Patient.Update_PatientSend(r, "T_State", "T_remark", "T_code")
|
|
|
if err != nil {
|
|
|
c.Data["json"] = lib.JSONS{Code: 202, Msg: "修改发送状态失败!"}
|
|
|
c.ServeJSON()
|
|
@@ -438,6 +440,7 @@ func Send_Notice(nextTime time.Time, user Account.User_R, patient Patient.Patien
|
|
|
T_type: 1,
|
|
|
T_id: res.Send_id,
|
|
|
T_remark: res.Status,
|
|
|
+ T_code: res.Fee,
|
|
|
T_State: 1,
|
|
|
}
|
|
|
if res.Status == "error" {
|
|
@@ -466,7 +469,7 @@ func Send_Notice(nextTime time.Time, user Account.User_R, patient Patient.Patien
|
|
|
T_type: 2,
|
|
|
T_id: res.SessionId,
|
|
|
T_remark: res.Resultdesc,
|
|
|
- T_State: 1,
|
|
|
+ T_State: 0,
|
|
|
}
|
|
|
if res.Resultcode != "0" {
|
|
|
smsSend.T_State = 0
|