|
@@ -88,7 +88,7 @@ func (this *DialysisAPIController) Scheduals() {
|
88
|
88
|
|
89
|
89
|
key := "scheduals_" + schedualDate + "_" + strconv.FormatInt(orgID, 10)
|
90
|
90
|
scheduals_json_str, _ := redis.Get(key).Result()
|
91
|
|
- redis.Set(scheduals_json_str, "", time.Second)
|
|
91
|
+ redis.Set(key, "", time.Second)
|
92
|
92
|
patients, _ := service.GetAllPatientListSix(orgID)
|
93
|
93
|
if len(scheduals_json_str) == 0 { //没有到缓存数据,从数据库中获取数据,进行缓存到redis
|
94
|
94
|
scheduals, err := service.MobileGetDialysisScheduals(orgID, date.Unix(), schedualType)
|
|
@@ -782,20 +782,27 @@ func (c *DialysisAPIController) PostDoubleCheck() {
|
782
|
782
|
if adminUserInfo.Org.Id == 9671 || adminUserInfo.Org.Id == 9675 || adminUserInfo.Org.Id == 10340 {
|
783
|
783
|
|
784
|
784
|
list, _ := service.GetRoleList(adminUserInfo.Org.Id, modifier)
|
785
|
|
- if employee_number != list.JobNumber {
|
786
|
|
- _, check := service.FindDoubleCheckByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
787
|
|
- c.ServeSuccessJSON(map[string]interface{}{
|
788
|
|
- "doubleCheck": check,
|
789
|
|
- "msg": "2",
|
790
|
|
- })
|
791
|
|
- return
|
|
785
|
+ _, check := service.FindDoubleCheckByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
|
786
|
+ if check.ID == 0 {
|
|
787
|
+ if employee_number != list.JobNumber {
|
|
788
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
789
|
+ "doubleCheck": check,
|
|
790
|
+ "msg": "2",
|
|
791
|
+ })
|
|
792
|
+ return
|
|
793
|
+ }
|
|
794
|
+ }
|
|
795
|
+ if check.ID > 0 {
|
|
796
|
+ if employee_number != list.JobNumber {
|
|
797
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
798
|
+ "doubleCheck": check,
|
|
799
|
+ "msg": "2",
|
|
800
|
+ })
|
|
801
|
+ return
|
|
802
|
+ }
|
792
|
803
|
}
|
793
|
|
- }
|
794
|
804
|
|
795
|
|
- //now := time.Now()
|
796
|
|
- //year, month, day := now.Date()
|
797
|
|
- //today_time := time.Date(year, month, day, 0, 0, 0, 0, time.Local)
|
798
|
|
- //todayTimeStamp := today_time.Unix()
|
|
805
|
+ }
|
799
|
806
|
|
800
|
807
|
doubleCheck := models.DoubleCheck{
|
801
|
808
|
UserOrgId: adminUserInfo.Org.Id,
|
|
@@ -7020,13 +7027,13 @@ func (this *DialysisAPIController) GetDialysisRecordOrder() {
|
7020
|
7027
|
func (this *DialysisAPIController) GetScheduleTypeByIdList() {
|
7021
|
7028
|
|
7022
|
7029
|
org_id := this.GetMobileAdminUserInfo().Org.Id
|
7023
|
|
- fmt.Println("org_id23323322332323233232", org_id)
|
|
7030
|
+
|
7024
|
7031
|
schedule_date := this.GetString("schedule_date")
|
7025
|
7032
|
schedule_type, _ := this.GetInt64("schedule_type")
|
7026
|
7033
|
timeLayout := "2006-01-02"
|
7027
|
7034
|
loc, _ := time.LoadLocation("Local")
|
7028
|
7035
|
var startdateunix int64
|
7029
|
|
- fmt.Println("schedule_date23323232233232323232", schedule_date)
|
|
7036
|
+
|
7030
|
7037
|
if len(schedule_date) > 0 {
|
7031
|
7038
|
theTime, err := time.ParseInLocation(timeLayout+"15:04:05", schedule_date+"00:00:00", loc)
|
7032
|
7039
|
if err != nil {
|
|
@@ -7054,3 +7061,44 @@ func (this *DialysisAPIController) GetScheduleTypeByIdList() {
|
7054
|
7061
|
"scheduals": scheduals,
|
7055
|
7062
|
})
|
7056
|
7063
|
}
|
|
7064
|
+
|
|
7065
|
+func (this *DialysisAPIController) SavePatientPicture() {
|
|
7066
|
+
|
|
7067
|
+ patient_id, _ := this.GetInt64("patient_id")
|
|
7068
|
+ dialysis_date, _ := this.GetInt64("schedule_date")
|
|
7069
|
+ avatar := this.GetString("avatar")
|
|
7070
|
+ fmt.Println("patient_id", patient_id)
|
|
7071
|
+ orgId := this.GetMobileAdminUserInfo().Org.Id
|
|
7072
|
+
|
|
7073
|
+ order := models.DialysisOrder{
|
|
7074
|
+ Url: avatar,
|
|
7075
|
+ }
|
|
7076
|
+ err := service.UpdatePatientSign(patient_id, dialysis_date, order, orgId)
|
|
7077
|
+ redis := service.RedisClient()
|
|
7078
|
+
|
|
7079
|
+ key := strconv.FormatInt(orgId, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(dialysis_date, 10) + ":dialysis_order"
|
|
7080
|
+ redis.Set(key, "", time.Second)
|
|
7081
|
+ keyOne := strconv.FormatInt(orgId, 10) + ":" + strconv.FormatInt(dialysis_date, 10) + ":dialysis_orders_list_all"
|
|
7082
|
+ //清空key 值
|
|
7083
|
+ redis.Set(keyOne, "", time.Second)
|
|
7084
|
+ keyThree := strconv.FormatInt(orgId, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(dialysis_date, 10) + ":doctor_advices"
|
|
7085
|
+ redis.Set(keyThree, "", time.Second)
|
|
7086
|
+ keyFour := strconv.FormatInt(orgId, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(dialysis_date, 10) + ":monitor_records"
|
|
7087
|
+ redis.Set(keyFour, "", time.Second)
|
|
7088
|
+
|
|
7089
|
+ keyFive := strconv.FormatInt(orgId, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":patient_info"
|
|
7090
|
+ redis.Set(keyFive, "", time.Second)
|
|
7091
|
+
|
|
7092
|
+ keySix := strconv.FormatInt(orgId, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(dialysis_date, 10) + ":his_doctor_advice"
|
|
7093
|
+ redis.Set(keySix, "", time.Second)
|
|
7094
|
+
|
|
7095
|
+ keySeven := strconv.FormatInt(orgId, 10) + ":" + ":device_list_all"
|
|
7096
|
+ redis.Set(keySeven, "", time.Second)
|
|
7097
|
+ if err != nil {
|
|
7098
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBUpdate)
|
|
7099
|
+ return
|
|
7100
|
+ }
|
|
7101
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
7102
|
+ "order": order,
|
|
7103
|
+ })
|
|
7104
|
+}
|