Procházet zdrojové kódy

Merge branch 'xt_statistics_branch'

csx před 5 roky
rodič
revize
f2f5ed4b65
1 změnil soubory, kde provedl 20 přidání a 17 odebrání
  1. 20 17
      controllers/schedule_api_controller.go

+ 20 - 17
controllers/schedule_api_controller.go Zobrazit soubor

10
 	"github.com/jinzhu/gorm"
10
 	"github.com/jinzhu/gorm"
11
 	"reflect"
11
 	"reflect"
12
 	"strconv"
12
 	"strconv"
13
+	"strings"
13
 	"time"
14
 	"time"
14
 
15
 
15
 	"github.com/astaxie/beego"
16
 	"github.com/astaxie/beego"
621
 
622
 
622
 }
623
 }
623
 
624
 
624
-type aa struct {
625
-	b int64
626
-	c int64
627
-}
628
-
629
 func (this *ScheduleApiController) GetWeekDaySchedule() {
625
 func (this *ScheduleApiController) GetWeekDaySchedule() {
630
 	week_type, _ := this.GetInt64("week_type", -1)
626
 	week_type, _ := this.GetInt64("week_type", -1)
631
 	fmt.Println(week_type)
627
 	fmt.Println(week_type)
757
 			} else {
753
 			} else {
758
 				var patient []*models.Patients
754
 				var patient []*models.Patients
759
 				for _, item := range patients {
755
 				for _, item := range patients {
760
-					if item.Name == name {
756
+					if strings.Replace(item.Name, " ", "", -1) == name {
761
 						patient = append(patient, item)
757
 						patient = append(patient, item)
762
 					}
758
 					}
763
 				}
759
 				}
765
 					err_log := models.ExportErrLog{
761
 					err_log := models.ExportErrLog{
766
 						LogType:    2,
762
 						LogType:    2,
767
 						UserOrgId:  this.GetAdminUserInfo().CurrentOrgId,
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
 						Status:     1,
765
 						Status:     1,
770
 						CreateTime: time.Now().Unix(),
766
 						CreateTime: time.Now().Unix(),
771
 						UpdateTime: time.Now().Unix(),
767
 						UpdateTime: time.Now().Unix(),
780
 				} else if len(patient) > 1 { //出现同名的情况
776
 				} else if len(patient) > 1 { //出现同名的情况
781
 
777
 
782
 					err_log := models.ExportErrLog{
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
 						Status:     1,
785
 						Status:     1,
787
 						CreateTime: time.Now().Unix(),
786
 						CreateTime: time.Now().Unix(),
788
 						UpdateTime: time.Now().Unix(),
787
 						UpdateTime: time.Now().Unix(),
1311
 			} else {
1310
 			} else {
1312
 				var patient []*models.Patients
1311
 				var patient []*models.Patients
1313
 				for _, item := range patients {
1312
 				for _, item := range patients {
1314
-					if item.Name == name {
1313
+					if strings.Replace(item.Name, " ", "", -1) == name {
1315
 						patient = append(patient, item)
1314
 						patient = append(patient, item)
1316
 					}
1315
 					}
1317
 				}
1316
 				}
1318
 				if len(patient) == 0 { //错误日志
1317
 				if len(patient) == 0 { //错误日志
1319
 					err_log := models.ExportErrLog{
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
 						Status:     1,
1324
 						Status:     1,
1324
 						CreateTime: time.Now().Unix(),
1325
 						CreateTime: time.Now().Unix(),
1325
 						UpdateTime: time.Now().Unix(),
1326
 						UpdateTime: time.Now().Unix(),
1334
 				} else if len(patient) > 1 { //出现同名的情况
1335
 				} else if len(patient) > 1 { //出现同名的情况
1335
 
1336
 
1336
 					err_log := models.ExportErrLog{
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
 						Status:     1,
1343
 						Status:     1,
1341
 						CreateTime: time.Now().Unix(),
1344
 						CreateTime: time.Now().Unix(),
1342
 						UpdateTime: time.Now().Unix(),
1345
 						UpdateTime: time.Now().Unix(),