浏览代码

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

csx 3 年前
父节点
当前提交
136d644c51
共有 4 个文件被更改,包括 128 次插入11 次删除
  1. 107 4
      controllers/sg/his_api_controller.go
  2. 2 2
      models/his_models.go
  3. 5 5
      service/gdyb_service.go
  4. 14 0
      service/his_service.go

+ 107 - 4
controllers/sg/his_api_controller.go 查看文件

@@ -71,8 +71,114 @@ func HisManagerApiRegistRouters() {
71 71
 
72 72
 	//beego.Router("/api/reversal/one", &HisApiController{}, "get:ReversalOtherOneData")
73 73
 
74
+	//beego.Router("/api/settlelist/get", &HisApiController{}, "get:GetSettleList")
75
+
76
+}
77
+
78
+type CustomFundPay struct {
79
+	FundPayType string  `json:"fund_pay_type"`
80
+	FundPayamt  float64 `json:"fund_payamt"`
74 81
 }
75 82
 
83
+//func (c *HisApiController) GetSettleList() {
84
+//	order_id, _ := c.GetInt64("order_id")
85
+//	order, _ := service.GetHisOrderByIDTwo(order_id)
86
+//
87
+//	roles, _ := service.GetDoctorListTwo(c.GetAdminUserInfo().CurrentOrgId)
88
+//
89
+//	admin, _ := service.GetAdminUserByUserID(roles[0].AdminUserId)
90
+//	admin_user_id, _ := c.GetInt64("admin_user_id")
91
+//	curRoles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
92
+//
93
+//	depart, _ := service.GetDepartMentDetail(curRoles.DepartmentId)
94
+//
95
+//	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
96
+//
97
+//	if order.ID == 0 {
98
+//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisOrderNoExistParamWrong)
99
+//		return
100
+//	}
101
+//	struct4101 := &service.Struct4101{
102
+//		PsnNo:          order.PsnNo,
103
+//		MdtrtId:        order.MdtrtId,
104
+//		SetlId:         order.SetlId,
105
+//		PsnName:        order.PsnName,
106
+//		Gend:           order.Gend,
107
+//		Brdy:           order.HisPatient.Brdy,
108
+//		Naty:           order.Naty,
109
+//		PatnCertType:   order.MdtrtCertType,
110
+//		Certno:         order.Certno,
111
+//		Prfs:           "90",
112
+//		ConerName:      roles[0].UserName,
113
+//		PatnRlts:       "99",
114
+//		ConerAddr:      miConfig.OrgName,
115
+//		ConerTel:       admin.Mobile,
116
+//		HiType:         order.Insutype,
117
+//		Insuplc:        miConfig.InsuplcAdmdvs,
118
+//		MaindiagFlag:   "1",
119
+//		BillCode:       "",
120
+//		BizSn:          "",
121
+//		BillNo:         "",
122
+//		PsnSelfPay:     order.PsnPartAmt,
123
+//		PsnOwnPay:      order.PsnPartAmt,
124
+//		AcctPay:        order.AcctPay,
125
+//		PsnCashpay:     order.PsnCashPay,
126
+//		HiPaymtd:       "1",
127
+//		Hsorg:          "医保中心",
128
+//		HsorgOpter:     "医保中心",
129
+//		MedinsFillPsn:  curRoles.UserName,
130
+//		MedinsFillDept: depart.Name,
131
+//	}
132
+//	if order.SettleType == 1 {
133
+//		t := time.Unix(int64(order.SettleAccountsDate), 0)
134
+//		dateStr := t.Format("2006-01-02")
135
+//		struct4101.SetlBegnDate = dateStr
136
+//		struct4101.SetlEndDate = dateStr
137
+//	} else {
138
+//		t := time.Unix(int64(order.SettleStartTime), 0)
139
+//		t2 := time.Unix(int64(order.SettleEndTime), 0)
140
+//		dateStartStr := t.Format("2006-01-02")
141
+//		dateEndStr := t2.Format("2006-01-02")
142
+//		struct4101.SetlBegnDate = dateStartStr
143
+//		struct4101.SetlEndDate = dateEndStr
144
+//	}
145
+//
146
+//	var rf []*CustomFundPay
147
+//	json.Unmarshal([]byte(order.SetlDetail), &rf)
148
+//
149
+//	for _, item := range rf {
150
+//		var  tempFunPay service.CustomStruct
151
+//		tempFunPay.FundPayamt = item.FundPayamt
152
+//		tempFunPay.FundPayType = item.FundPayType
153
+//		struct4101.CustomStruct = append(struct4101.CustomStruct,tempFunPay)
154
+//	}
155
+//
156
+//	var  tempOpspdiseinfo service.OpspdiseinfoStruct
157
+//
158
+//	tempOpspdiseinfo.DiagCode = "M07801"
159
+//	tempOpspdiseinfo.DiagName = ""
160
+//	tempOpspdiseinfo.MaindiagFlag = "1"
161
+//	tempOpspdiseinfo.OprnOprtCode = ""
162
+//	tempOpspdiseinfo.OprnOprtName = ""
163
+//	struct4101.OpspdiseinfoStruct = append(struct4101.OpspdiseinfoStruct,tempOpspdiseinfo)
164
+//
165
+//	var  iteminfo service.IteminfoStruct
166
+//
167
+//
168
+//	for _, item := range order.HisOrderInfo{
169
+//
170
+//		iteminfo.MedChrgitm = item.MedChrgitmType
171
+//		iteminfo.Amt = item.DetItemFeeSumamt
172
+//		iteminfo.ClaaSumfee = item.
173
+//
174
+//	}
175
+//
176
+//
177
+//
178
+//	service.Gdyb4101()
179
+//
180
+//}
181
+
76 182
 func (c *HisApiController) TestGetBasBaseInfo() {
77 183
 	DllDef := syscall.MustLoadDLL("SSCard.dll")
78 184
 	Iinit := DllDef.MustFindProc("Init")
@@ -1191,7 +1297,6 @@ func (c *HisApiController) GetRegisterInfo() {
1191 1297
 			his.Ctime = time.Now().Unix()
1192 1298
 			his.Mtime = time.Now().Unix()
1193 1299
 			his.Status = 1
1194
-			err := service.CreateHisPatientTwo(&his)
1195 1300
 
1196 1301
 			lists, _ := service.GetHisPatientInfoList(adminInfo.CurrentOrgId, patient.ID, recordDateTime)
1197 1302
 			if len(lists) == 1 {
@@ -1249,7 +1354,7 @@ func (c *HisApiController) GetRegisterInfo() {
1249 1354
 					return
1250 1355
 
1251 1356
 				} else {
1252
-
1357
+					err := service.CreateHisPatientTwo(&his)
1253 1358
 					c.ServeSuccessJSON(map[string]interface{}{
1254 1359
 						"his_info": his,
1255 1360
 					})
@@ -2689,9 +2794,7 @@ func (c *HisApiController) Refund() {
2689 2794
 			return
2690 2795
 		}
2691 2796
 		if res.Infcode == 0 {
2692
-
2693 2797
 			result := service.Gdyb2205(order.PsnNo, order.MdtrtId, order.Number, miConfig.OrgName, roles.UserName, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, miConfig.Code)
2694
-
2695 2798
 			var dat map[string]interface{}
2696 2799
 			if err := json.Unmarshal([]byte(result), &dat); err == nil {
2697 2800
 				fmt.Println(dat)

+ 2 - 2
models/his_models.go 查看文件

@@ -678,9 +678,9 @@ type HisOrder struct {
678 678
 	RequestLog       string `gorm:"column:request_log" json:"request_log" form:"request_log"`
679 679
 	RefundRequestLog string `gorm:"column:refund_request_log" json:"refund_request_log" form:"refund_request_log"`
680 680
 
681
-	HisOrderInfo        HisOrderInfo        `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"order_info"`
681
+	HisOrderInfo        []*HisOrderInfo     `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"order_info"`
682 682
 	Patients            Patients            `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
683
-	HisPatient          HisPatient          `gorm:"ForeignKey:HisPatientId;AssociationForeignKey:ID" json:"his_patient"`
683
+	HisPatient          HisPatient          `gorm:"ForeignKey:MdtrtId;AssociationForeignKey:Number" json:"his_patient"`
684 684
 	HisPrescriptionInfo HisPrescriptionInfo `gorm:"ForeignKey:PatientId,SettleAccountsDate;AssociationForeignKey:PatientId,RecordDate" json:"p_info"`
685 685
 }
686 686
 

+ 5 - 5
service/gdyb_service.go 查看文件

@@ -2094,7 +2094,7 @@ func Gdyb5301(psnNo string, insutype string, org_name string, doctor string, fix
2094 2094
 
2095 2095
 type CustomStruct struct {
2096 2096
 	FundPayType string
2097
-	FundPayamt  string
2097
+	FundPayamt  float64
2098 2098
 }
2099 2099
 
2100 2100
 type OpspdiseinfoStruct struct {
@@ -2141,10 +2141,10 @@ type Struct4101 struct {
2141 2141
 	BizSn              string
2142 2142
 	SetlBegnDate       string
2143 2143
 	SetlEndDate        string
2144
-	PsnSelfPay         string
2145
-	PsnOwnPay          string
2146
-	AcctPay            string
2147
-	PsnCashpay         string
2144
+	PsnSelfPay         float64
2145
+	PsnOwnPay          float64
2146
+	AcctPay            float64
2147
+	PsnCashpay         float64
2148 2148
 	HiPaymtd           string
2149 2149
 	Hsorg              string
2150 2150
 	HsorgOpter         string

+ 14 - 0
service/his_service.go 查看文件

@@ -885,6 +885,11 @@ func GetHisOrderByID(order_id int64) (order models.HisOrder, err error) {
885 885
 	return
886 886
 }
887 887
 
888
+func GetHisOrderByIDTwo(order_id int64) (order models.HisOrder, err error) {
889
+	err = readDb.Model(&models.HisOrder{}).Preload("HisOrderInfo", "status = 1").Preload("HisPatient", "status = 1").Where("id = ? AND status = 1", order_id).First(&order).Error
890
+	return
891
+}
892
+
888 893
 func GetHisOrderInfoByNumber(order_number string) (order []*models.HisOrderInfo, err error) {
889 894
 	err = readDb.Model(&models.HisOrderInfo{}).Where("order_number = ? AND status = 1", order_number).Find(&order).Error
890 895
 	return
@@ -1034,6 +1039,15 @@ func GetDoctorList(orgid int64) (role []*models.SgjUserAdminRole, err error) {
1034 1039
 	return role, err
1035 1040
 }
1036 1041
 
1042
+func GetDoctorListTwo(orgid int64) (role []*models.SgjUserAdminRole, err error) {
1043
+
1044
+	db := UserReadDB().Table("sgj_user_admin_role as x").Where("x.status =1 AND x.user_type = 2")
1045
+	table := UserReadDB().Table("sgj_user_admin as a")
1046
+	fmt.Println(table)
1047
+	err = db.Select("x.id,x.admin_user_id,x.org_id,x.app_id,x.role_id,x.user_name,x.avatar,x.user_type,x.user_title,x.intro,x.user_title_name,x.role_ids,x.message,x.sex,x.birthday,x.sort,x.is_sort,x.department,x.department_id,x.age,x.nation,x.card_type,x.id_card,x.education,x.study_major_name,x.work_major_name,x.role_type,x.medical_code,x.doctor_code,x.licensing,x.job_number,x.prescription_qualification_identification,x.identification_outpatients,x.start_time,x.medical_range_code,x.medical_level,x.medical_type_job,x.pharmacist_registration_number,x.doctor_range_code,x.doctor_level,x.doctor_type_job,x.doctor_number,x.outpatient_illness_category,x.is_active,x.active_status,a.mobile").Joins("left join sgj_user_admin as a on a.id = x.admin_user_id").Scan(&role).Error
1048
+	return role, err
1049
+}
1050
+
1037 1051
 func GetRoleList(orgid int64) (role []*models.SgjUserRole, err error) {
1038 1052
 
1039 1053
 	err = UserReadDB().Model(&role).Where("org_id = ? and status =1", orgid).Find(&role).Error