|
@@ -21,7 +21,7 @@ func (this *CommonApiController) GetInspectionMajor() {
|
21
|
21
|
adminInfo := this.GetAdminUserInfo()
|
22
|
22
|
orgid := adminInfo.CurrentOrgId
|
23
|
23
|
major, err := service.GetInspectionMajor(orgid)
|
24
|
|
- fmt.Println("major====================================", major)
|
|
24
|
+
|
25
|
25
|
if len(major) == 0 {
|
26
|
26
|
major, _ := service.GetInspectionMajor(0)
|
27
|
27
|
if err != nil {
|
|
@@ -99,7 +99,13 @@ func (this *CommonApiController) SaveConfiguration() {
|
99
|
99
|
sort := dataBody["sort"].(string)
|
100
|
100
|
sorts, err := strconv.ParseInt(sort, 10, 64)
|
101
|
101
|
fmt.Println("sort", sort)
|
102
|
|
-
|
|
102
|
+ checktype := int64(dataBody["check_type"].(float64))
|
|
103
|
+ fmt.Println("检查类型", checktype)
|
|
104
|
+ rangvalue := dataBody["range_value"].(string)
|
|
105
|
+ fmt.Println("rangvalue", rangvalue)
|
|
106
|
+ if rangvalue == "0" {
|
|
107
|
+ rangvalue = ""
|
|
108
|
+ }
|
103
|
109
|
_, errcode := service.GetConfigurationById(inspectionmajor, inspectionMinor, orgid)
|
104
|
110
|
if errcode == gorm.ErrRecordNotFound {
|
105
|
111
|
standard := models.XtQualityControlStandard{
|
|
@@ -110,6 +116,8 @@ func (this *CommonApiController) SaveConfiguration() {
|
110
|
116
|
Sort: sorts,
|
111
|
117
|
UserOrgId: orgid,
|
112
|
118
|
Status: 1,
|
|
119
|
+ RangeType: checktype,
|
|
120
|
+ RangeValue: rangvalue,
|
113
|
121
|
CreatedTime: time.Now().Unix(),
|
114
|
122
|
}
|
115
|
123
|
fmt.Println(standard)
|
|
@@ -185,6 +193,12 @@ func (this *CommonApiController) UpdateConfiguration() {
|
185
|
193
|
fmt.Println("largerange", largerange)
|
186
|
194
|
sort := int64(dataBody["sort"].(float64))
|
187
|
195
|
fmt.Println("排序", sort)
|
|
196
|
+ rangvalue := dataBody["range_value"].(string)
|
|
197
|
+ fmt.Println("范围", rangvalue)
|
|
198
|
+ if rangvalue == "0" {
|
|
199
|
+ rangvalue = ""
|
|
200
|
+ }
|
|
201
|
+ rangtype := int64(dataBody["check_type"].(float64))
|
188
|
202
|
adminInfo := this.GetAdminUserInfo()
|
189
|
203
|
orgId := adminInfo.CurrentOrgId
|
190
|
204
|
configuration, err := service.GetConfigurationByIdTwo(inspectionmajor, inspectionMinor, orgId)
|
|
@@ -199,6 +213,8 @@ func (this *CommonApiController) UpdateConfiguration() {
|
199
|
213
|
MinRange: minrange,
|
200
|
214
|
LargeRange: largerange,
|
201
|
215
|
Sort: sort,
|
|
216
|
+ RangeValue: rangvalue,
|
|
217
|
+ RangeType: rangtype,
|
202
|
218
|
}
|
203
|
219
|
err = service.UpdarteConfiguration(&standard, id)
|
204
|
220
|
if err != nil {
|
|
@@ -396,19 +412,24 @@ func (this *CommonApiController) GetDialysisModeType() {
|
396
|
412
|
}
|
397
|
413
|
|
398
|
414
|
func (this *CommonApiController) GetTotalLapseCount() {
|
|
415
|
+ timeLayout := "2006-01-02"
|
|
416
|
+ loc, _ := time.LoadLocation("Local")
|
399
|
417
|
adminUser := this.GetAdminUserInfo()
|
400
|
418
|
orgid := adminUser.CurrentOrgId
|
401
|
|
- startime, _ := this.GetInt64("startime")
|
402
|
|
- fmt.Println("startime", startime)
|
403
|
|
- endtime, _ := this.GetInt64("endtime")
|
404
|
|
- fmt.Println("endtime", endtime)
|
405
|
|
-
|
|
419
|
+ startime := this.GetString("startime")
|
|
420
|
+ startTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", startime+" 00:00:00", loc)
|
|
421
|
+ startnunix := startTimes.Unix()
|
|
422
|
+ //fmt.Println("开始时间==========",startnunix)
|
|
423
|
+ endtime := this.GetString("endtime")
|
|
424
|
+ endtimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", endtime+" 23:59:59", loc)
|
|
425
|
+ endunix := endtimes.Unix()
|
|
426
|
+ //fmt.Println("结束日期========",endunix)
|
406
|
427
|
//统计一个月内转出的病人
|
407
|
428
|
//patients, total, err := service.GetTotalRollOut(startime, endtime, orgid)
|
408
|
429
|
//统计该机构的转出人数
|
409
|
|
- patients, err := service.GetTotalRollOutPatients(orgid, startime, endtime)
|
|
430
|
+ patients, err := service.GetTotalRollOutPatients(orgid, startnunix, endunix)
|
410
|
431
|
//统计该机构转出病人
|
411
|
|
- patienttwo, err := service.GetTotalRollOutPatientsTwo(orgid, startime, endtime)
|
|
432
|
+ patienttwo, err := service.GetTotalRollOutPatientsTwo(orgid, startnunix, endunix)
|
412
|
433
|
//统计总共病人
|
413
|
434
|
// _, count, _ := service.GetPatientTotalCountTwo(orgid, startime, endtime)
|
414
|
435
|
count := service.GetPatientTotalCount(orgid)
|
|
@@ -449,14 +470,18 @@ func (this *CommonApiController) GetTotalInfectiouscount() {
|
449
|
470
|
adminUser := this.GetAdminUserInfo()
|
450
|
471
|
orgid := adminUser.CurrentOrgId
|
451
|
472
|
fmt.Println("orgid", orgid)
|
452
|
|
- startime, _ := this.GetInt64("startime")
|
453
|
|
- fmt.Println("开始时间", startime)
|
454
|
|
- endtime, _ := this.GetInt64("endtime")
|
455
|
|
- fmt.Println("结束时间", endtime)
|
|
473
|
+ timeLayout := "2006-01-02"
|
|
474
|
+ loc, _ := time.LoadLocation("Local")
|
|
475
|
+ startime := this.GetString("startime")
|
|
476
|
+ startTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", startime+" 00:00:00", loc)
|
|
477
|
+ startnunix := startTimes.Unix()
|
|
478
|
+ endtime := this.GetString("endtime")
|
|
479
|
+ endtimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", endtime+" 23:59:59", loc)
|
|
480
|
+ endunix := endtimes.Unix()
|
456
|
481
|
//统计透析总人数
|
457
|
482
|
total := service.GetPatientTotalCount(orgid)
|
458
|
483
|
//统计透析人数传染病所占比例
|
459
|
|
- count, err := service.GetPatientInfectiousCount(orgid, startime, endtime)
|
|
484
|
+ count, err := service.GetPatientInfectiousCount(orgid, startnunix, endunix)
|
460
|
485
|
//统计其他
|
461
|
486
|
_, otherTotal, err := service.GetPatientOtherInfectious(orgid)
|
462
|
487
|
if err != nil {
|
|
@@ -559,7 +584,7 @@ func (this *CommonApiController) GetDialysislist() {
|
559
|
584
|
fmt.Println("limit", limit)
|
560
|
585
|
adminUser := this.GetAdminUserInfo()
|
561
|
586
|
orgId := adminUser.CurrentOrgId
|
562
|
|
-
|
|
587
|
+ count, _ := service.TotalDialysisCount(statime, entime, orgId)
|
563
|
588
|
dialysislist, total, err := service.GetDialysisList(statime, entime, page, limit, orgId)
|
564
|
589
|
prescriptionList, _ := service.GetAllDialysisList(statime, entime, orgId)
|
565
|
590
|
list, totallist, _ := service.GetDialysisPatientList(statime, entime, page, limit, orgId)
|
|
@@ -574,6 +599,7 @@ func (this *CommonApiController) GetDialysislist() {
|
574
|
599
|
"list": list,
|
575
|
600
|
"totallist": totallist,
|
576
|
601
|
"prescriptionList": prescriptionList,
|
|
602
|
+ "count": count,
|
577
|
603
|
})
|
578
|
604
|
}
|
579
|
605
|
|
|
@@ -933,13 +959,17 @@ func (this *CommonApiController) GetFirstQuarter() {
|
933
|
959
|
fmt.Println("结束日期", entime)
|
934
|
960
|
//group, parseDateErr := service.GetItemNameGroup(orgid, statime, entime)
|
935
|
961
|
//quarter, err := service.GetFirstQuarter(orgid, statime, entime)
|
|
962
|
+ //统计数值类型的数据
|
936
|
963
|
count, err := service.GetQuarterTotalCount(orgid, statime, entime, lapseto)
|
|
964
|
+ //统计rang_type== 2
|
|
965
|
+ countwo, _ := service.GetQuarterTotalCountTwo(orgid, statime, entime, lapseto)
|
937
|
966
|
if err != nil {
|
938
|
967
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
939
|
968
|
return
|
940
|
969
|
}
|
941
|
970
|
this.ServeSuccessJSON(map[string]interface{}{
|
942
|
|
- "count": count,
|
|
971
|
+ "count": count,
|
|
972
|
+ "countwo": countwo,
|
943
|
973
|
})
|
944
|
974
|
}
|
945
|
975
|
|
|
@@ -1005,12 +1035,14 @@ func (this *CommonApiController) GetProjectList() {
|
1005
|
1035
|
fourQuarterEnds, parseDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", fourQuarterEndStr)
|
1006
|
1036
|
fourQuarterEndStrUnix := fourQuarterEnds.Unix()
|
1007
|
1037
|
fmt.Println("第四季度结束时间", fourQuarterEndStrUnix)
|
|
1038
|
+ rangetype, parseDateErr := this.GetInt64("range_type")
|
1008
|
1039
|
//按季度统计
|
1009
|
|
- if itemtype == 1 {
|
|
1040
|
+ if rangetype == 1 {
|
1010
|
1041
|
//统计总共
|
1011
|
1042
|
list, err := service.GetProjectList(orgid, lapseto, modetype, statime, entime, firstQuarterStartUnix, fisrtQuarterEndStrUnix, secondeQuarterStartUnix, secondQuarterEndStrUnix, threeQuarterStartUnix, threeQuarterEndStrUnix, fourQuarterStartUnix, fourQuarterEndStrUnix)
|
1012
|
1043
|
//统计达标个数
|
1013
|
1044
|
standList, err := service.GetProjectStandList(orgid, lapseto, modetype, statime, entime, firstQuarterStartUnix, fisrtQuarterEndStrUnix, secondeQuarterStartUnix, secondQuarterEndStrUnix, threeQuarterStartUnix, threeQuarterEndStrUnix, fourQuarterStartUnix, fourQuarterEndStrUnix)
|
|
1045
|
+
|
1014
|
1046
|
if err != nil {
|
1015
|
1047
|
this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
|
1016
|
1048
|
return
|