Browse Source

Merge branch 'xt_statistics_branch'

csx 4 years ago
parent
commit
f2f5ed4b65
1 changed files with 20 additions and 17 deletions
  1. 20 17
      controllers/schedule_api_controller.go

+ 20 - 17
controllers/schedule_api_controller.go View File

@@ -10,6 +10,7 @@ import (
10 10
 	"github.com/jinzhu/gorm"
11 11
 	"reflect"
12 12
 	"strconv"
13
+	"strings"
13 14
 	"time"
14 15
 
15 16
 	"github.com/astaxie/beego"
@@ -621,11 +622,6 @@ func (this *ScheduleApiController) SearchSchedulePatients() {
621 622
 
622 623
 }
623 624
 
624
-type aa struct {
625
-	b int64
626
-	c int64
627
-}
628
-
629 625
 func (this *ScheduleApiController) GetWeekDaySchedule() {
630 626
 	week_type, _ := this.GetInt64("week_type", -1)
631 627
 	fmt.Println(week_type)
@@ -757,7 +753,7 @@ func (this *ScheduleApiController) ExportSchedule() {
757 753
 			} else {
758 754
 				var patient []*models.Patients
759 755
 				for _, item := range patients {
760
-					if item.Name == name {
756
+					if strings.Replace(item.Name, " ", "", -1) == name {
761 757
 						patient = append(patient, item)
762 758
 					}
763 759
 				}
@@ -765,7 +761,7 @@ func (this *ScheduleApiController) ExportSchedule() {
765 761
 					err_log := models.ExportErrLog{
766 762
 						LogType:    2,
767 763
 						UserOrgId:  this.GetAdminUserInfo().CurrentOrgId,
768
-						ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列的姓名在系统中不存在,请在系统中添加该病人",
764
+						ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列,患者姓名为\"" + name + "\"在系统中不存在,请在系统中添加该病人",
769 765
 						Status:     1,
770 766
 						CreateTime: time.Now().Unix(),
771 767
 						UpdateTime: time.Now().Unix(),
@@ -780,9 +776,12 @@ func (this *ScheduleApiController) ExportSchedule() {
780 776
 				} else if len(patient) > 1 { //出现同名的情况
781 777
 
782 778
 					err_log := models.ExportErrLog{
783
-						LogType:    2,
784
-						UserOrgId:  this.GetAdminUserInfo().CurrentOrgId,
785
-						ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列" + "患者姓名为" + name + "在当前机构中存在重名,无法确定到具体患者",
779
+						LogType:   2,
780
+						UserOrgId: this.GetAdminUserInfo().CurrentOrgId,
781
+						//ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列" + "患者姓名为" + name + "在当前机构中存在重名,无法确定到具体患者",
782
+
783
+						ErrMsg: "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列,患者姓名为\"" + name + "\"在在当前机构中存在重名,无法确定到具体患者",
784
+
786 785
 						Status:     1,
787 786
 						CreateTime: time.Now().Unix(),
788 787
 						UpdateTime: time.Now().Unix(),
@@ -1311,15 +1310,17 @@ func (this *ScheduleApiController) ExportScheduleTemplate() {
1311 1310
 			} else {
1312 1311
 				var patient []*models.Patients
1313 1312
 				for _, item := range patients {
1314
-					if item.Name == name {
1313
+					if strings.Replace(item.Name, " ", "", -1) == name {
1315 1314
 						patient = append(patient, item)
1316 1315
 					}
1317 1316
 				}
1318 1317
 				if len(patient) == 0 { //错误日志
1319 1318
 					err_log := models.ExportErrLog{
1320
-						LogType:    3,
1321
-						UserOrgId:  this.GetAdminUserInfo().CurrentOrgId,
1322
-						ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列的姓名在系统中不存在,请在系统中添加该病人",
1319
+						LogType:   3,
1320
+						UserOrgId: this.GetAdminUserInfo().CurrentOrgId,
1321
+						//ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列的姓名在系统中不存在,请在系统中添加该病人",
1322
+						ErrMsg: "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列患者姓名为\"" + name + "\"在系统中不存在,请在系统中添加该病人",
1323
+
1323 1324
 						Status:     1,
1324 1325
 						CreateTime: time.Now().Unix(),
1325 1326
 						UpdateTime: time.Now().Unix(),
@@ -1334,9 +1335,11 @@ func (this *ScheduleApiController) ExportScheduleTemplate() {
1334 1335
 				} else if len(patient) > 1 { //出现同名的情况
1335 1336
 
1336 1337
 					err_log := models.ExportErrLog{
1337
-						LogType:    3,
1338
-						UserOrgId:  this.GetAdminUserInfo().CurrentOrgId,
1339
-						ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列" + "患者姓名为" + name + "在当前机构中存在重名,无法确定到具体患者",
1338
+						LogType:   3,
1339
+						UserOrgId: this.GetAdminUserInfo().CurrentOrgId,
1340
+						//ErrMsg:     "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列" + "患者姓名为" + name + "在当前机构中存在重名,无法确定到具体患者",
1341
+						ErrMsg: "第" + strconv.FormatInt(int64(schMapM["index"].(float64)), 10) + "行,第" + schMapM["row"].(string) + "列患者姓名为\"" + name + "\"在当前机构中存在重名,无法确定到具体患者",
1342
+
1340 1343
 						Status:     1,
1341 1344
 						CreateTime: time.Now().Unix(),
1342 1345
 						UpdateTime: time.Now().Unix(),