Kaynağa Gözat

Merge branch 'xt_statistics_branch' of http://git.shengws.com/csx/XT_New into xt_statistics_branch

XMLWAN 4 yıl önce
ebeveyn
işleme
776e193b7f

+ 9 - 0
controllers/patient_api_controller.go Dosyayı Görüntüle

3871
 func IsIdCard(id string) (res bool) {
3871
 func IsIdCard(id string) (res bool) {
3872
 	id = strings.ToUpper(id)
3872
 	id = strings.ToUpper(id)
3873
 	if len(id) != 15 && len(id) != 18 {
3873
 	if len(id) != 15 && len(id) != 18 {
3874
+		fmt.Println("1111111")
3874
 		return false
3875
 		return false
3875
 	}
3876
 	}
3876
 	r := regexp.MustCompile("(\\d{15})|(\\d{17}([0-9]|X))")
3877
 	r := regexp.MustCompile("(\\d{15})|(\\d{17}([0-9]|X))")
3877
 	if !r.MatchString(id) {
3878
 	if !r.MatchString(id) {
3879
+		fmt.Println("2222222")
3880
+
3878
 		return false
3881
 		return false
3879
 	}
3882
 	}
3880
 	if len(id) == 15 {
3883
 	if len(id) == 15 {
3881
 		tm2, _ := time.Parse("01/02/2006", string([]byte(id)[8:10])+"/"+string([]byte(id)[10:12])+"/"+"19"+string([]byte(id)[6:8]))
3884
 		tm2, _ := time.Parse("01/02/2006", string([]byte(id)[8:10])+"/"+string([]byte(id)[10:12])+"/"+"19"+string([]byte(id)[6:8]))
3882
 		if tm2.Unix() <= 0 {
3885
 		if tm2.Unix() <= 0 {
3886
+			fmt.Println("33333333")
3887
+
3883
 			return false
3888
 			return false
3884
 		}
3889
 		}
3885
 		return true
3890
 		return true
3886
 	} else {
3891
 	} else {
3887
 		tm2, _ := time.Parse("01/02/2006", string([]byte(id)[10:12])+"/"+string([]byte(id)[12:14])+"/"+string([]byte(id)[6:10]))
3892
 		tm2, _ := time.Parse("01/02/2006", string([]byte(id)[10:12])+"/"+string([]byte(id)[12:14])+"/"+string([]byte(id)[6:10]))
3888
 		if tm2.Unix() <= 0 {
3893
 		if tm2.Unix() <= 0 {
3894
+			fmt.Println("444444444")
3895
+
3889
 			return false
3896
 			return false
3890
 		}
3897
 		}
3891
 		//检验18位身份证的校验码是否正确。
3898
 		//检验18位身份证的校验码是否正确。
3900
 		n := sign % 11
3907
 		n := sign % 11
3901
 		val_num := arr_ch[n]
3908
 		val_num := arr_ch[n]
3902
 		if val_num != string([]byte(id)[17:18]) {
3909
 		if val_num != string([]byte(id)[17:18]) {
3910
+			fmt.Println("555555555")
3911
+
3903
 			return false
3912
 			return false
3904
 		}
3913
 		}
3905
 		return true
3914
 		return true

+ 2 - 2
controllers/schedule_api_controller.go Dosyayı Görüntüle

771
 				} else if len(patient) == 1 { //
771
 				} else if len(patient) == 1 { //
772
 					sch.PatientId = patient[0].ID
772
 					sch.PatientId = patient[0].ID
773
 
773
 
774
-				} else if len(patient) > 2 { //出现同名的情况
774
+				} else if len(patient) > 1 { //出现同名的情况
775
 
775
 
776
 					err_log := models.ExportErrLog{
776
 					err_log := models.ExportErrLog{
777
 						LogType:    2,
777
 						LogType:    2,
1283
 				} else if len(patient) == 1 { //
1283
 				} else if len(patient) == 1 { //
1284
 					sch.PatientID = patient[0].ID
1284
 					sch.PatientID = patient[0].ID
1285
 
1285
 
1286
-				} else if len(patient) > 2 { //出现同名的情况
1286
+				} else if len(patient) > 1 { //出现同名的情况
1287
 
1287
 
1288
 					err_log := models.ExportErrLog{
1288
 					err_log := models.ExportErrLog{
1289
 						LogType:    3,
1289
 						LogType:    3,