Browse Source

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx 4 years ago
parent
commit
a847c1c827
4 changed files with 28 additions and 36 deletions
  1. 3 3
      conf/app.conf
  2. 1 1
      controllers/sg/gdyb_controller.go
  3. 22 30
      controllers/sg/his_api_controller.go
  4. 2 2
      service/gdyb_service.go

+ 3 - 3
conf/app.conf View File

@@ -1,6 +1,6 @@
1 1
 appname = 血透
2 2
 httpport = 9532
3
-runmode = dev
3
+runmode = prod
4 4
 
5 5
 #
6 6
 copyrequestbody = true
@@ -44,7 +44,7 @@ appsecret="61ee2e6268497d5aa9de0b0187c39aea"
44 44
 
45 45
 
46 46
 [prod]
47
-org_id = 9504
47
+org_id = 10106
48 48
 mobile_token_expiration_second = 86400
49 49
 httpdomain = https://api.xt.kuyicloud.com
50 50
 sso_domain = https://sso.kuyicloud.com
@@ -53,7 +53,7 @@ front_end_domain = "https://xt.kuyicloud.com/#"
53 53
 #url  = "http://192.168.1.228:17001/szsi-portal/transData"
54 54
 url = "http://192.168.1.88:6666/szsi-portal/transData"
55 55
 gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
56
-gdyb_paasid = "sg03_prd"
56
+gdyb_paasid = "jm_sc_yjyy"
57 57
 readmysqlhost = shengws1.mysql.rds.aliyuncs.com
58 58
 readmysqlport = 3306
59 59
 readmysqluser = syh

+ 1 - 1
controllers/sg/gdyb_controller.go View File

@@ -163,7 +163,7 @@ func (c *GdybController) PostFour() {
163 163
 	secret_key := c.GetString("secret_key")
164 164
 
165 165
 	var result string
166
-	if insuplc_admdvs == "440700" { //
166
+	if insuplc_admdvs == "440781" { //
167 167
 		result = service.Gdyb2203A(psnNo, mdtrtId, doctor, department, diag, org_name, med_type, doctor_id, fixmedins_code, diag_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, sick_code, sick_name)
168 168
 	} else {
169 169
 		result = service.Gdyb2203(psnNo, mdtrtId, doctor, department, diag, org_name, med_type, doctor_id, fixmedins_code, diag_code, insuplc_admdvs, mdtrtarea_admvs, secret_key, sick_code, sick_name)

+ 22 - 30
controllers/sg/his_api_controller.go View File

@@ -11,7 +11,6 @@ import (
11 11
 	"gdyb/service"
12 12
 	"gdyb/utils"
13 13
 	"github.com/astaxie/beego"
14
-	"github.com/axgle/mahonia"
15 14
 	"github.com/jinzhu/gorm"
16 15
 	"github.com/shopspring/decimal"
17 16
 	"io"
@@ -3629,7 +3628,7 @@ func (c *HisApiController) GetCheckCode() {
3629 3628
 				ID:             item.ID,
3630 3629
 				Name:           item.DrugName,
3631 3630
 				Code:           item.MedicalInsuranceNumber,
3632
-				List_type_code: item.MedicalInsuranceNumber,
3631
+				List_type_code: "101",
3633 3632
 			}
3634 3633
 			queryResult = append(queryResult, result)
3635 3634
 		}
@@ -3642,7 +3641,7 @@ func (c *HisApiController) GetCheckCode() {
3642 3641
 				ID:             item.ID,
3643 3642
 				Name:           item.GoodName,
3644 3643
 				Code:           item.MedicalInsuranceNumber,
3645
-				List_type_code: item.MedicalInsuranceNumber,
3644
+				List_type_code: "301",
3646 3645
 			}
3647 3646
 			queryResult = append(queryResult, result)
3648 3647
 		}
@@ -3653,7 +3652,7 @@ func (c *HisApiController) GetCheckCode() {
3653 3652
 				ID:             item.ID,
3654 3653
 				Name:           item.ProjectName,
3655 3654
 				Code:           item.MedicalCode,
3656
-				List_type_code: item.MedicalCode,
3655
+				List_type_code: "201",
3657 3656
 			}
3658 3657
 			queryResult = append(queryResult, result)
3659 3658
 		}
@@ -3683,14 +3682,20 @@ func (c *HisApiController) GetCheckCode() {
3683 3682
 
3684 3683
 	if config.IsOpen == 1 {
3685 3684
 		for _, item := range queryResult {
3686
-			result := service.Gdyb3301(baseParams, item.Name, item.Code, item.List_type_code, "2021-04-26", "")
3685
+			var result string
3686
+			if record_type == 1 {
3687
+				result = service.Gdyb3301(baseParams, item.Name, item.Code, item.List_type_code, "2021-04-26", "", item.List_type_code)
3688
+			} else if record_type == 2 {
3689
+				result = service.Gdyb3301(baseParams, item.Name, item.Code, item.List_type_code, "2021-04-26", "", item.List_type_code)
3690
+			} else if record_type == 3 {
3691
+				result = service.Gdyb3301(baseParams, item.Name, item.Code, item.List_type_code, "2021-04-26", "", item.List_type_code)
3692
+			}
3687 3693
 			var dat map[string]interface{}
3688 3694
 			if err := json.Unmarshal([]byte(result), &dat); err == nil {
3689 3695
 				fmt.Println(dat)
3690 3696
 			} else {
3691 3697
 				fmt.Println(err)
3692 3698
 			}
3693
-
3694 3699
 			userJSONBytes, _ := json.Marshal(dat)
3695 3700
 			var res ResultSix
3696 3701
 			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
@@ -3738,7 +3743,7 @@ func (c *HisApiController) UnCheckCode() {
3738 3743
 				ID:             item.ID,
3739 3744
 				Name:           item.DrugName,
3740 3745
 				Code:           item.MedicalInsuranceNumber,
3741
-				List_type_code: item.MedicalInsuranceNumber,
3746
+				List_type_code: "101",
3742 3747
 			}
3743 3748
 			queryResult = append(queryResult, result)
3744 3749
 		}
@@ -3751,7 +3756,7 @@ func (c *HisApiController) UnCheckCode() {
3751 3756
 				ID:             item.ID,
3752 3757
 				Name:           item.GoodName,
3753 3758
 				Code:           item.MedicalInsuranceNumber,
3754
-				List_type_code: item.MedicalInsuranceNumber,
3759
+				List_type_code: "301",
3755 3760
 			}
3756 3761
 			queryResult = append(queryResult, result)
3757 3762
 		}
@@ -3762,7 +3767,7 @@ func (c *HisApiController) UnCheckCode() {
3762 3767
 				ID:             item.ID,
3763 3768
 				Name:           item.ProjectName,
3764 3769
 				Code:           item.MedicalCode,
3765
-				List_type_code: item.MedicalCode,
3770
+				List_type_code: "201",
3766 3771
 			}
3767 3772
 			queryResult = append(queryResult, result)
3768 3773
 		}
@@ -3792,15 +3797,20 @@ func (c *HisApiController) UnCheckCode() {
3792 3797
 
3793 3798
 	if config.IsOpen == 1 {
3794 3799
 		for _, item := range queryResult {
3795
-
3796
-			result := service.Gdyb3302(baseParams, item.Name, item.Code, item.List_type_code)
3800
+			var result string
3801
+			if record_type == 1 {
3802
+				result = service.Gdyb3302(baseParams, item.Name, item.Code, item.List_type_code)
3803
+			} else if record_type == 2 {
3804
+				result = service.Gdyb3302(baseParams, item.Name, item.Code, item.List_type_code)
3805
+			} else if record_type == 3 {
3806
+				result = service.Gdyb3302(baseParams, item.Name, item.Code, item.List_type_code)
3807
+			}
3797 3808
 			var dat2 map[string]interface{}
3798 3809
 			if err := json.Unmarshal([]byte(result), &dat2); err == nil {
3799 3810
 				fmt.Println(dat2)
3800 3811
 			} else {
3801 3812
 				fmt.Println(err)
3802 3813
 			}
3803
-
3804 3814
 			userJSONBytes, _ := json.Marshal(dat2)
3805 3815
 			var res ResultSix
3806 3816
 			if err := json.Unmarshal(userJSONBytes, &res); err != nil {
@@ -3813,7 +3823,6 @@ func (c *HisApiController) UnCheckCode() {
3813 3823
 					service.UpdateDrugByIdDetail(item.ID)
3814 3824
 				} else if record_type == 2 {
3815 3825
 					service.UpdateGoodInfoById(item.ID)
3816
-
3817 3826
 				} else if record_type == 3 {
3818 3827
 					service.UpdateMyProjectById(item.ID)
3819 3828
 				}
@@ -4046,7 +4055,6 @@ func (c *HisApiController) PsnPutNCDSOnRecord() {
4046 4055
 	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
4047 4056
 	config, _ := service.GetMedicalInsuranceConfig(adminUser.CurrentOrgId)
4048 4057
 	sick, _ := service.FindSickById(sick_id)
4049
-	//role, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
4050 4058
 	doctor, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, doctor_id)
4051 4059
 	if config.IsOpen == 1 {
4052 4060
 		result := service.Gdyb2503(psn_no, insutype, miConfig.OrgName, doctor.UserName, miConfig.Code, strconv.FormatInt(doctor.ID, 10), miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, sick.ClassName, sick.CountryCode)
@@ -4261,19 +4269,3 @@ func RemoveRepeatedCode(arr []string) (newArr []string) {
4261 4269
 	}
4262 4270
 	return
4263 4271
 }
4264
-
4265
-type Charset string
4266
-
4267
-const (
4268
-	UTF8    = Charset("UTF-8")
4269
-	GB18030 = Charset("GB18030")
4270
-)
4271
-
4272
-func ConvertToString(src string, srcCode string, tagCode string) string {
4273
-	srcCoder := mahonia.NewDecoder(srcCode)
4274
-	srcResult := srcCoder.ConvertString(src)
4275
-	tagCoder := mahonia.NewDecoder(tagCode)
4276
-	_, cdata, _ := tagCoder.Translate([]byte(srcResult), true)
4277
-	result := string(cdata)
4278
-	return result
4279
-}

+ 2 - 2
service/gdyb_service.go View File

@@ -1526,7 +1526,7 @@ func Gdyb2001(baseParams models.BaseParams, psn_no string, insutype string, med_
1526 1526
 	return str
1527 1527
 }
1528 1528
 
1529
-func Gdyb3301(baseParams *models.BaseParams, name string, codg string, list_type_code string, start_time string, ent_time string) string {
1529
+func Gdyb3301(baseParams *models.BaseParams, name string, codg string, list_type_code string, start_time string, ent_time string, list_type string) string {
1530 1530
 	// 生成签名
1531 1531
 	nonce := GetRandomString(32)
1532 1532
 	timestamp := time.Now().Unix()
@@ -1539,7 +1539,7 @@ func Gdyb3301(baseParams *models.BaseParams, name string, codg string, list_type
1539 1539
 	inputMessage["infno"] = "3301" // 交易编码
1540 1540
 	inputData["fixmedins_hilist_id"] = codg
1541 1541
 	inputData["fixmedins_hilist_name"] = name
1542
-	inputData["list_type"] = list_type_code
1542
+	inputData["list_type"] = list_type
1543 1543
 	inputData["med_list_codg"] = codg
1544 1544
 	inputData["begndate"] = start_time
1545 1545
 	inputData["enddate"] = ent_time