Browse Source

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

XMLWAN 3 years ago
parent
commit
776e193b7f
2 changed files with 11 additions and 2 deletions
  1. 9 0
      controllers/patient_api_controller.go
  2. 2 2
      controllers/schedule_api_controller.go

+ 9 - 0
controllers/patient_api_controller.go View File

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

+ 2 - 2
controllers/schedule_api_controller.go View File

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