XMLWAN 4 anni fa
parent
commit
1f86675666
1 ha cambiato i file con 88 aggiunte e 8 eliminazioni
  1. 88 8
      controllers/sz/sz_his_api_controller.go

+ 88 - 8
controllers/sz/sz_his_api_controller.go Vedi File

3449
 			return
3449
 			return
3450
 		}
3450
 		}
3451
 		fmt.Println(isSuccess)
3451
 		fmt.Println(isSuccess)
3452
+		c.ServeSuccessJSON(map[string]interface{}{
3453
+			"failed_code": -10,
3454
+			"msg":         res.Transreturnmessage,
3455
+		})
3456
+		return
3452
 	}
3457
 	}
3453
 
3458
 
3454
 }
3459
 }
3550
 					return
3555
 					return
3551
 				}
3556
 				}
3552
 				fmt.Println(isSuccess)
3557
 				fmt.Println(isSuccess)
3558
+				c.ServeSuccessJSON(map[string]interface{}{
3559
+					"failed_code": -10,
3560
+					"msg":         res.Transreturnmessage,
3561
+				})
3562
+				return
3553
 			}
3563
 			}
3554
 
3564
 
3555
 		}
3565
 		}
3625
 					fmt.Println("err", err)
3635
 					fmt.Println("err", err)
3626
 				}
3636
 				}
3627
 				fmt.Println(isSuccess)
3637
 				fmt.Println(isSuccess)
3638
+				c.ServeSuccessJSON(map[string]interface{}{
3639
+					"failed_code": -10,
3640
+					"msg":         res.Transreturnmessage,
3641
+				})
3642
+				return
3628
 			}
3643
 			}
3629
 
3644
 
3630
 		}
3645
 		}
3707
 					return
3722
 					return
3708
 				}
3723
 				}
3709
 				fmt.Println(isSuccess)
3724
 				fmt.Println(isSuccess)
3725
+				c.ServeSuccessJSON(map[string]interface{}{
3726
+					"failed_code": -10,
3727
+					"msg":         res.Transreturnmessage,
3728
+				})
3729
+				return
3710
 			}
3730
 			}
3711
 		}
3731
 		}
3712
 
3732
 
3769
 					return
3789
 					return
3770
 				}
3790
 				}
3771
 				fmt.Println(isSuccess)
3791
 				fmt.Println(isSuccess)
3792
+				c.ServeSuccessJSON(map[string]interface{}{
3793
+					"failed_code": -10,
3794
+					"msg":         res.Transreturnmessage,
3795
+				})
3796
+				return
3772
 			}
3797
 			}
3773
 		}
3798
 		}
3774
 	}
3799
 	}
3849
 					return
3874
 					return
3850
 				}
3875
 				}
3851
 				fmt.Println(isSuccess)
3876
 				fmt.Println(isSuccess)
3877
+				c.ServeSuccessJSON(map[string]interface{}{
3878
+					"failed_code": -10,
3879
+					"msg":         res.Transreturnmessage,
3880
+				})
3881
+				return
3852
 			}
3882
 			}
3853
 		}
3883
 		}
3854
 		//备案
3884
 		//备案
3897
 				var res Result
3927
 				var res Result
3898
 				if err := json.Unmarshal(userJSONBytes, &res); err != nil {
3928
 				if err := json.Unmarshal(userJSONBytes, &res); err != nil {
3899
 					utils.ErrorLog("解析失败:%v", err)
3929
 					utils.ErrorLog("解析失败:%v", err)
3900
-					c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
3930
+					c.ServeSuccessJSON(map[string]interface{}{
3931
+						"failed_code": -10,
3932
+						"msg":         res.Transreturnmessage,
3933
+					})
3901
 					return
3934
 					return
3902
 				}
3935
 				}
3903
 				if res.Transreturncode == "00000000" {
3936
 				if res.Transreturncode == "00000000" {
3909
 					isSuccess = false
3942
 					isSuccess = false
3910
 					//失败
3943
 					//失败
3911
 
3944
 
3912
-					c.ServeFailJSONWithSGJErrorCode(enums.ErrorDrugPreSettleFaildParamWrong)
3945
+					c.ServeSuccessJSON(map[string]interface{}{
3946
+						"failed_code": -10,
3947
+						"msg":         res.Transreturnmessage,
3948
+					})
3913
 					return
3949
 					return
3914
 				}
3950
 				}
3915
 				fmt.Println(isSuccess)
3951
 				fmt.Println(isSuccess)
3952
+				c.ServeSuccessJSON(map[string]interface{}{
3953
+					"failed_code": -10,
3954
+					"msg":         res.Transreturnmessage,
3955
+				})
3956
+				return
3916
 			}
3957
 			}
3917
 		}
3958
 		}
3918
 
3959
 
4018
 		var res Result
4059
 		var res Result
4019
 		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
4060
 		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
4020
 			utils.ErrorLog("解析失败:%v", err)
4061
 			utils.ErrorLog("解析失败:%v", err)
4021
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4062
+			c.ServeSuccessJSON(map[string]interface{}{
4063
+				"failed_code": -10,
4064
+				"msg":         res.Transreturnmessage,
4065
+			})
4022
 			return
4066
 			return
4023
 		}
4067
 		}
4024
 		if res.Transreturncode == "00000000" {
4068
 		if res.Transreturncode == "00000000" {
4036
 			return
4080
 			return
4037
 		}
4081
 		}
4038
 		fmt.Println(isSuccess)
4082
 		fmt.Println(isSuccess)
4083
+		c.ServeSuccessJSON(map[string]interface{}{
4084
+			"failed_code": -10,
4085
+			"msg":         res.Transreturnmessage,
4086
+		})
4087
+		return
4039
 	}
4088
 	}
4040
 
4089
 
4041
 }
4090
 }
4130
 			var res Result
4179
 			var res Result
4131
 			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
4180
 			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
4132
 				utils.ErrorLog("解析失败:%v", err)
4181
 				utils.ErrorLog("解析失败:%v", err)
4133
-				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4182
+				c.ServeSuccessJSON(map[string]interface{}{
4183
+					"failed_code": -10,
4184
+					"msg":         res.Transreturnmessage,
4185
+				})
4134
 				return
4186
 				return
4135
 			}
4187
 			}
4136
 			if res.Transreturncode == "00000000" {
4188
 			if res.Transreturncode == "00000000" {
4148
 				return
4200
 				return
4149
 			}
4201
 			}
4150
 			fmt.Println(isSuccess)
4202
 			fmt.Println(isSuccess)
4203
+			c.ServeSuccessJSON(map[string]interface{}{
4204
+				"failed_code": -10,
4205
+				"msg":         res.Transreturnmessage,
4206
+			})
4207
+			return
4151
 		}
4208
 		}
4152
 	}
4209
 	}
4153
 
4210
 
4229
 			var res Result
4286
 			var res Result
4230
 			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
4287
 			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
4231
 				utils.ErrorLog("解析失败:%v", err)
4288
 				utils.ErrorLog("解析失败:%v", err)
4232
-				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4289
+				c.ServeSuccessJSON(map[string]interface{}{
4290
+					"failed_code": -10,
4291
+					"msg":         res.Transreturnmessage,
4292
+				})
4233
 				return
4293
 				return
4234
 			}
4294
 			}
4235
 			if res.Transreturncode == "00000000" {
4295
 			if res.Transreturncode == "00000000" {
4246
 				return
4306
 				return
4247
 			}
4307
 			}
4248
 			fmt.Println(isSuccess)
4308
 			fmt.Println(isSuccess)
4309
+			c.ServeSuccessJSON(map[string]interface{}{
4310
+				"failed_code": -10,
4311
+				"msg":         res.Transreturnmessage,
4312
+			})
4313
+			return
4249
 
4314
 
4250
 		}
4315
 		}
4251
 	}
4316
 	}
4357
 		var res Result
4422
 		var res Result
4358
 		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
4423
 		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
4359
 			utils.ErrorLog("解析失败:%v", err)
4424
 			utils.ErrorLog("解析失败:%v", err)
4360
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
4425
+			c.ServeSuccessJSON(map[string]interface{}{
4426
+				"failed_code": -10,
4427
+				"msg":         res.Transreturnmessage,
4428
+			})
4361
 			return
4429
 			return
4362
 		}
4430
 		}
4363
 		if res.Transreturncode == "00000000" {
4431
 		if res.Transreturncode == "00000000" {
4366
 			isSuccess = false
4434
 			isSuccess = false
4367
 			//失败
4435
 			//失败
4368
 
4436
 
4369
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorDrugPreSettleFaildParamWrong)
4437
+			c.ServeSuccessJSON(map[string]interface{}{
4438
+				"failed_code": -10,
4439
+				"msg":         res.Transreturnmessage,
4440
+			})
4370
 			return
4441
 			return
4371
 		}
4442
 		}
4372
 		fmt.Println(isSuccess)
4443
 		fmt.Println(isSuccess)
4373
-
4444
+		c.ServeSuccessJSON(map[string]interface{}{
4445
+			"failed_code": -10,
4446
+			"msg":         res.Transreturnmessage,
4447
+		})
4448
+		return
4374
 	}
4449
 	}
4375
 }
4450
 }
4376
 
4451
 
4448
 			return
4523
 			return
4449
 		}
4524
 		}
4450
 		fmt.Println(isSuccess)
4525
 		fmt.Println(isSuccess)
4526
+		c.ServeSuccessJSON(map[string]interface{}{
4527
+			"failed_code": -10,
4528
+			"msg":         res.Transreturnmessage,
4529
+		})
4530
+		return
4451
 	}
4531
 	}
4452
 }
4532
 }
4453
 
4533