|
@@ -911,8 +911,6 @@ func (c *DialysisAPIController) PostDoubleCheck() {
|
911
|
911
|
//今日的日期减去设置的日期
|
912
|
912
|
cha_time = timeNewDate.Unix() - infor.WeekDay*86400
|
913
|
913
|
|
914
|
|
- fmt.Println(" recordDate.Unix()-----------", recordDate.Unix())
|
915
|
|
- fmt.Println("cha_time-------------", cha_time)
|
916
|
914
|
if cha_time >= recordDate.Unix() {
|
917
|
915
|
//查询审核是否允许
|
918
|
916
|
infor, _ := service.GetDialysisInformationByRecordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
|
@@ -1434,6 +1432,30 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
|
1434
|
1432
|
|
1435
|
1433
|
appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
|
1436
|
1434
|
|
|
1435
|
+ // 查询信息规挡的设置天数
|
|
1436
|
+
|
|
1437
|
+ infor, _ := service.GetDialysisInformationSetting(adminUserInfo.Org.Id)
|
|
1438
|
+ if infor.ID > 0 {
|
|
1439
|
+
|
|
1440
|
+ var cha_time int64
|
|
1441
|
+
|
|
1442
|
+ timeNowStr := time.Now().Format("2006-01-02")
|
|
1443
|
+ timeNewDate, _ := utils.ParseTimeStringToTime("2006-01-02", timeNowStr)
|
|
1444
|
+
|
|
1445
|
+ //今日的日期减去设置的日期
|
|
1446
|
+ cha_time = timeNewDate.Unix() - infor.WeekDay*86400
|
|
1447
|
+ fmt.Println("recordDate.Unix()", recordDate.Unix())
|
|
1448
|
+ if cha_time >= recordDate.Unix() {
|
|
1449
|
+ //查询审核是否允许
|
|
1450
|
+ infor, _ := service.GetDialysisInformationByRecordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
|
1451
|
+ //申请状态不允许的情况 拒绝修改
|
|
1452
|
+ if infor.ApplicationStatus != 1 {
|
|
1453
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeInformationExist)
|
|
1454
|
+ return
|
|
1455
|
+ }
|
|
1456
|
+
|
|
1457
|
+ }
|
|
1458
|
+ }
|
1437
|
1459
|
_, assessmentAfter := service.FindAssessmentAfterDislysisByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
1438
|
1460
|
if assessmentAfter.ID == 0 { //新增
|
1439
|
1461
|
if appRole.UserType == 2 || appRole.UserType == 1 {
|
|
@@ -1445,30 +1467,6 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
|
1445
|
1467
|
|
1446
|
1468
|
}
|
1447
|
1469
|
|
1448
|
|
- // 查询信息规挡的设置天数
|
1449
|
|
-
|
1450
|
|
- infor, _ := service.GetDialysisInformationSetting(adminUserInfo.Org.Id)
|
1451
|
|
- if infor.ID > 0 {
|
1452
|
|
-
|
1453
|
|
- var cha_time int64
|
1454
|
|
-
|
1455
|
|
- timeNowStr := time.Now().Format("2006-01-02")
|
1456
|
|
- timeNewDate, _ := utils.ParseTimeStringToTime("2006-01-02", timeNowStr)
|
1457
|
|
-
|
1458
|
|
- //今日的日期减去设置的日期
|
1459
|
|
- cha_time = timeNewDate.Unix() - infor.WeekDay*86400
|
1460
|
|
-
|
1461
|
|
- if cha_time >= recordDate.Unix() {
|
1462
|
|
- //查询审核是否允许
|
1463
|
|
- infor, _ := service.GetDialysisInformationByRecordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
|
1464
|
|
- //申请状态不允许的情况 拒绝修改
|
1465
|
|
- if infor.ApplicationStatus != 1 {
|
1466
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeInformationExist)
|
1467
|
|
- return
|
1468
|
|
- }
|
1469
|
|
-
|
1470
|
|
- }
|
1471
|
|
- }
|
1472
|
1470
|
err := service.AddSigleAssessmentAfterDislysisRecord(&assessmentAfterDislysis)
|
1473
|
1471
|
finish := models.XtDialysisFinish{
|
1474
|
1472
|
IsFinish: 1,
|
|
@@ -1482,7 +1480,7 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
|
1482
|
1480
|
PatientId: id,
|
1483
|
1481
|
}
|
1484
|
1482
|
|
1485
|
|
- dialysisFinish, err := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 9, id)
|
|
1483
|
+ dialysisFinish, _ := service.GetDialysisFinish(adminUserInfo.Org.Id, recordDate.Unix(), 9, id)
|
1486
|
1484
|
if dialysisFinish.ID == 0 {
|
1487
|
1485
|
service.CreateDialysisFinish(finish)
|
1488
|
1486
|
}
|
|
@@ -1529,7 +1527,7 @@ func (c *DialysisAPIController) PostAssessmentAfterDislysis() {
|
1529
|
1527
|
|
1530
|
1528
|
keyOne := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(recordDate.Unix(), 10) + ":assessment_after_dislysis_list_all"
|
1531
|
1529
|
redis.Set(keyOne, "", time.Second)
|
1532
|
|
- fmt.Println("err233332323232232323", err)
|
|
1530
|
+
|
1533
|
1531
|
if err == nil {
|
1534
|
1532
|
c.ServeSuccessJSON(map[string]interface{}{
|
1535
|
1533
|
"assessmentAfterDislysis": assessmentAfterDislysis,
|
|
@@ -2990,6 +2988,31 @@ func (this *DialysisAPIController) StartDialysis() {
|
2990
|
2988
|
return
|
2991
|
2989
|
}
|
2992
|
2990
|
|
|
2991
|
+ // 查询信息规挡的设置天数
|
|
2992
|
+
|
|
2993
|
+ infor, _ := service.GetDialysisInformationSetting(adminUserInfo.Org.Id)
|
|
2994
|
+ if infor.ID > 0 {
|
|
2995
|
+
|
|
2996
|
+ var cha_time int64
|
|
2997
|
+
|
|
2998
|
+ timeNowStr := time.Now().Format("2006-01-02")
|
|
2999
|
+ timeNewDate, _ := utils.ParseTimeStringToTime("2006-01-02", timeNowStr)
|
|
3000
|
+
|
|
3001
|
+ //今日的日期减去设置的日期
|
|
3002
|
+ cha_time = timeNewDate.Unix() - infor.WeekDay*86400
|
|
3003
|
+
|
|
3004
|
+ if cha_time >= recordDate.Unix() {
|
|
3005
|
+ //查询审核是否允许
|
|
3006
|
+ infor, _ := service.GetDialysisInformationByRecordDate(patientID, recordDate.Unix(), adminUserInfo.Org.Id)
|
|
3007
|
+ //申请状态不允许的情况 拒绝修改
|
|
3008
|
+ if infor.ApplicationStatus != 1 {
|
|
3009
|
+ this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeInformationExist)
|
|
3010
|
+ return
|
|
3011
|
+ }
|
|
3012
|
+
|
|
3013
|
+ }
|
|
3014
|
+ }
|
|
3015
|
+
|
2993
|
3016
|
dialysisRecord = &models.DialysisOrder{
|
2994
|
3017
|
DialysisDate: recordDate.Unix(),
|
2995
|
3018
|
UserOrgId: adminUserInfo.Org.Id,
|
|
@@ -3034,7 +3057,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
3034
|
3057
|
Ctime: time.Now().Unix(),
|
3035
|
3058
|
Mtime: 0,
|
3036
|
3059
|
Module: 6,
|
3037
|
|
- RecordDate: recordDate.Unix(),
|
|
3060
|
+ RecordDate: schedulestartTime,
|
3038
|
3061
|
Sourse: 1,
|
3039
|
3062
|
PatientId: patientID,
|
3040
|
3063
|
}
|
|
@@ -3218,31 +3241,6 @@ func (this *DialysisAPIController) StartDialysis() {
|
3218
|
3241
|
record.Temperature = 36.5
|
3219
|
3242
|
}
|
3220
|
3243
|
|
3221
|
|
- // 查询信息规挡的设置天数
|
3222
|
|
-
|
3223
|
|
- infor, _ := service.GetDialysisInformationSetting(adminUserInfo.Org.Id)
|
3224
|
|
- if infor.ID > 0 {
|
3225
|
|
-
|
3226
|
|
- var cha_time int64
|
3227
|
|
-
|
3228
|
|
- timeNowStr := time.Now().Format("2006-01-02")
|
3229
|
|
- timeNewDate, _ := utils.ParseTimeStringToTime("2006-01-02", timeNowStr)
|
3230
|
|
-
|
3231
|
|
- //今日的日期减去设置的日期
|
3232
|
|
- cha_time = timeNewDate.Unix() - infor.WeekDay*86400
|
3233
|
|
-
|
3234
|
|
- if cha_time >= recordDate.Unix() {
|
3235
|
|
- //查询审核是否允许
|
3236
|
|
- infor, _ := service.GetDialysisInformationByRecordDate(patientID, recordDate.Unix(), adminUserInfo.Org.Id)
|
3237
|
|
- //申请状态不允许的情况 拒绝修改
|
3238
|
|
- if infor.ApplicationStatus != 1 {
|
3239
|
|
- this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeInformationExist)
|
3240
|
|
- return
|
3241
|
|
- }
|
3242
|
|
-
|
3243
|
|
- }
|
3244
|
|
- }
|
3245
|
|
-
|
3246
|
3244
|
err := service.CreateMonitor(&record)
|
3247
|
3245
|
finish := models.XtDialysisFinish{
|
3248
|
3246
|
IsFinish: 1,
|
|
@@ -3251,7 +3249,7 @@ func (this *DialysisAPIController) StartDialysis() {
|
3251
|
3249
|
Ctime: time.Now().Unix(),
|
3252
|
3250
|
Mtime: 0,
|
3253
|
3251
|
Module: 7,
|
3254
|
|
- RecordDate: recordDate.Unix(),
|
|
3252
|
+ RecordDate: schedulestartTime,
|
3255
|
3253
|
Sourse: 1,
|
3256
|
3254
|
PatientId: patientID,
|
3257
|
3255
|
}
|