Browse Source

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

csx 3 years ago
parent
commit
e5229e6ab3
4 changed files with 17 additions and 31 deletions
  1. 3 3
      conf/app.conf
  2. 6 6
      controllers/sg/gdyb_controller.go
  3. 1 8
      controllers/sg/his_api_controller.go
  4. 7 14
      service/his_service.go

+ 3 - 3
conf/app.conf View File

@@ -45,7 +45,7 @@ appsecret="61ee2e6268497d5aa9de0b0187c39aea"
45 45
 
46 46
 
47 47
 [prod]
48
-org_id = 10188
48
+org_id = 9919
49 49
 mobile_token_expiration_second = 86400
50 50
 httpdomain = https://api.xt.kuyicloud.com
51 51
 sso_domain = https://sso.kuyicloud.com
@@ -57,11 +57,11 @@ gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
57 57
 # gdyb_url="http://igb.hsa.gdgov.cn/ebus/sz_prd/hsa/hgs/"
58 58
 #内蒙古
59 59
 # gdyb_url = "http://10.38.23.105:8090/uif-hsaf-med-api/api/medical/service/"
60
-# gdyb_paasid = "sg03_prd"
60
+gdyb_paasid = "sg03_prd"
61 61
 # gdyb_paasid = "jm_sc_yjyy"
62 62
 # gdyb_paasid="zh_prd_yrojyy"
63 63
 #gdyb_paasid = "sz_prd_yjyy"
64
-gdyb_paasid = "zq_prd_yjyy"
64
+# gdyb_paasid = "zq_prd_yjyy"
65 65
 
66 66
 
67 67
 

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

@@ -403,12 +403,12 @@ func (c *GdybController) PostTen() {
403 403
 	fmt.Println(stmtBegndate)
404 404
 	fmt.Println(stmtEnddate)
405 405
 	fmt.Println(medfeeSumamt)
406
-	clrType = "11"
407
-	//if len(clrType) == 0 {
408
-	//	clrType = "11"
409
-	//} else {
410
-	//	clrType = "9903"
411
-	//}
406
+	//clrType = "11"
407
+	if len(clrType) == 0 {
408
+		clrType = "11"
409
+	} else {
410
+		clrType = "9903"
411
+	}
412 412
 	baseParams := models.BaseParams{
413 413
 		SecretKey:      secret_key,
414 414
 		FixmedinsCode:  fixmedins_code,

+ 1 - 8
controllers/sg/his_api_controller.go View File

@@ -4303,6 +4303,7 @@ func (c *HisApiController) GetUploadInfo() {
4303 4303
 							order.AcctMulaidPay = res.Output.Setlinfo.AcctMulaidPay
4304 4304
 							order.MedinsSetlId = res.Output.Setlinfo.MedinsSetlID
4305 4305
 							order.ClrOptins = res.Output.Setlinfo.ClrOptins
4306
+							order.ClrType = res.Output.Setlinfo.ClrType
4306 4307
 							order.ClrWay = res.Output.Setlinfo.ClrWay
4307 4308
 							order.Creator = order.Creator
4308 4309
 							order.Modify = roles.AdminUserId
@@ -6964,15 +6965,7 @@ func (c *HisApiController) GetCheckAccount() {
6964 6965
 	startime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
6965 6966
 	endtime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
6966 6967
 	orders, _ := service.GetOrderByTime(startime.Unix(), endtime.Unix(), adminUser.CurrentOrgId, insutype, clr_org, clr_type)
6967
-	//orders_two, _ := service.GetOrderByTimeThree(startime.Unix(), endtime.Unix(), adminUser.CurrentOrgId, insutype, clr_type)
6968 6968
 	fixmedins_setl_cnt := int64(len(orders))
6969
-	//
6970
-	////撤销的算2条数据为一笔
6971
-	//for _, item := range orders_two {
6972
-	//	if item.OrderStatus == 3 {
6973
-	//		fixmedins_setl_cnt = fixmedins_setl_cnt + 1
6974
-	//	}
6975
-	//}
6976 6969
 	var medfee_sumamt float64
6977 6970
 	var acct_pay float64
6978 6971
 	var fund_pay_sumamt float64

+ 7 - 14
service/his_service.go View File

@@ -965,22 +965,15 @@ func GetHisOrderInfoByNumberThree(order_number string) (order []*models.HisOrder
965 965
 }
966 966
 
967 967
 func GetOrderByTime(start_time int64, end_time int64, org_id int64, insutype string, clr_org string, clr_type string) (orders []*models.HisOrder, err error) {
968
-
968
+	db := readDb.Model(&models.HisOrder{})
969
+	db = db.Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time)  <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ?", org_id, end_time, start_time, insutype)
969 970
 	if len(clr_org) > 0 {
970
-		if len(clr_type) > 0 {
971
-			err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time)  <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ? AND clr_type = ? AND clr_optins = ?", org_id, end_time, start_time, insutype, clr_type, clr_org).Find(&orders).Error
972
-		} else {
973
-			err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time)  <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ? AND clr_optins = ?", org_id, end_time, start_time, insutype, clr_org).Find(&orders).Error
974
-			//err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time)  <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ? ", org_id, end_time, start_time, insutype).Find(&orders).Error
975
-		}
976
-	} else {
977
-		if len(clr_type) > 0 {
978
-			err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time)  <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ? AND clr_type = ?", org_id, end_time, start_time, insutype, clr_type).Find(&orders).Error
979
-		} else {
980
-			err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time)  <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ? ", org_id, end_time, start_time, insutype).Find(&orders).Error
981
-
982
-		}
971
+		db = db.Where("clr_optins = ?", clr_org)
972
+	}
973
+	if len(clr_type) > 0 {
974
+		db = db.Where("clr_type = ?", clr_type)
983 975
 	}
976
+	err = db.Find(&orders).Error
984 977
 	return
985 978
 }
986 979