Browse Source

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

csx 3 years ago
parent
commit
b81df843e1
3 changed files with 36 additions and 23 deletions
  1. 30 23
      controllers/sg/his_api_controller.go
  2. 3 0
      models/his_models.go
  3. 3 0
      service/his_service.go

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

81
 }
81
 }
82
 
82
 
83
 func (c *HisApiController) GetSettleList() {
83
 func (c *HisApiController) GetSettleList() {
84
+
84
 	order_id, _ := c.GetInt64("order_id")
85
 	order_id, _ := c.GetInt64("order_id")
85
 	admin_user_id, _ := c.GetInt64("admin_user_id")
86
 	admin_user_id, _ := c.GetInt64("admin_user_id")
86
 
87
 
114
 		HiType:         order.Insutype,
115
 		HiType:         order.Insutype,
115
 		Insuplc:        miConfig.InsuplcAdmdvs,
116
 		Insuplc:        miConfig.InsuplcAdmdvs,
116
 		MaindiagFlag:   "1",
117
 		MaindiagFlag:   "1",
117
-		BillCode:       "",
118
-		BizSn:          "",
119
-		BillNo:         "",
118
+		BillCode:       order.FaPiaoCode,
119
+		BillNo:         order.FaPiaoNumber,
120
+		BizSn:          order.Number,
120
 		PsnSelfPay:     order.PsnPartAmt,
121
 		PsnSelfPay:     order.PsnPartAmt,
121
 		PsnOwnPay:      order.PsnPartAmt,
122
 		PsnOwnPay:      order.PsnPartAmt,
122
 		AcctPay:        order.AcctPay,
123
 		AcctPay:        order.AcctPay,
123
 		PsnCashpay:     order.PsnCashPay,
124
 		PsnCashpay:     order.PsnCashPay,
124
 		HiPaymtd:       "1",
125
 		HiPaymtd:       "1",
125
-		Hsorg:          "医保中心",
126
-		HsorgOpter:     "医保中心",
126
+		Hsorg:          miConfig.InsuplcAdmdvs,
127
+		HsorgOpter:     miConfig.InsuplcAdmdvs,
127
 		MedinsFillPsn:  curRoles.UserName,
128
 		MedinsFillPsn:  curRoles.UserName,
128
 		MedinsFillDept: depart.Name,
129
 		MedinsFillDept: depart.Name,
129
 	}
130
 	}
256
 				bed_claa_sunmfee, _ = decimal.NewFromFloat(bed_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
257
 				bed_claa_sunmfee, _ = decimal.NewFromFloat(bed_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
257
 			}
258
 			}
258
 			if item.ChrgitmLv == "2" {
259
 			if item.ChrgitmLv == "2" {
259
-				bed_clab_amt, _ = decimal.NewFromFloat(bed_clab_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
260
+				bed_clab_amt, _ = decimal.NewFromFloat(bed_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
260
 
261
 
261
 			}
262
 			}
262
 			if item.ChrgitmLv == "3" {
263
 			if item.ChrgitmLv == "3" {
263
-				bed_other_amt, _ = decimal.NewFromFloat(bed_other_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
264
+				bed_other_amt, _ = decimal.NewFromFloat(bed_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
264
 			}
265
 			}
265
 
266
 
266
 		}
267
 		}
276
 
277
 
277
 			}
278
 			}
278
 			if item.ChrgitmLv == "2" {
279
 			if item.ChrgitmLv == "2" {
279
-				check_clab_amt, _ = decimal.NewFromFloat(check_clab_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
280
+				check_clab_amt, _ = decimal.NewFromFloat(check_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
280
 
281
 
281
 			}
282
 			}
282
 			if item.ChrgitmLv == "3" {
283
 			if item.ChrgitmLv == "3" {
283
-				check_other_amt, _ = decimal.NewFromFloat(check_other_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
284
+				check_other_amt, _ = decimal.NewFromFloat(check_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
284
 			}
285
 			}
285
 		}
286
 		}
286
 
287
 
295
 
296
 
296
 			}
297
 			}
297
 			if item.ChrgitmLv == "2" {
298
 			if item.ChrgitmLv == "2" {
298
-				laboratory_clab_amt, _ = decimal.NewFromFloat(laboratory_clab_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
299
+				laboratory_clab_amt, _ = decimal.NewFromFloat(laboratory_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
299
 
300
 
300
 			}
301
 			}
301
 			if item.ChrgitmLv == "3" {
302
 			if item.ChrgitmLv == "3" {
302
-				laboratory_other_amt, _ = decimal.NewFromFloat(laboratory_other_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
303
+				laboratory_other_amt, _ = decimal.NewFromFloat(laboratory_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
303
 			}
304
 			}
304
 		}
305
 		}
305
 
306
 
314
 
315
 
315
 			}
316
 			}
316
 			if item.ChrgitmLv == "2" {
317
 			if item.ChrgitmLv == "2" {
317
-				treat_clab_amt, _ = decimal.NewFromFloat(treat_clab_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
318
+				treat_clab_amt, _ = decimal.NewFromFloat(treat_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
318
 
319
 
319
 			}
320
 			}
320
 			if item.ChrgitmLv == "3" {
321
 			if item.ChrgitmLv == "3" {
321
-				treat_other_amt, _ = decimal.NewFromFloat(treat_other_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
322
+				treat_other_amt, _ = decimal.NewFromFloat(treat_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
322
 			}
323
 			}
323
 		}
324
 		}
324
 
325
 
334
 
335
 
335
 			}
336
 			}
336
 			if item.ChrgitmLv == "2" {
337
 			if item.ChrgitmLv == "2" {
337
-				operation_clab_amt, _ = decimal.NewFromFloat(operation_clab_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
338
+				operation_clab_amt, _ = decimal.NewFromFloat(operation_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
338
 
339
 
339
 			}
340
 			}
340
 			if item.ChrgitmLv == "3" {
341
 			if item.ChrgitmLv == "3" {
341
-				operation_other_amt, _ = decimal.NewFromFloat(operation_other_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
342
+				operation_other_amt, _ = decimal.NewFromFloat(operation_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
342
 			}
343
 			}
343
 		}
344
 		}
344
 
345
 
353
 
354
 
354
 			}
355
 			}
355
 			if item.ChrgitmLv == "2" {
356
 			if item.ChrgitmLv == "2" {
356
-				material_clab_amt, _ = decimal.NewFromFloat(material_clab_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
357
+				material_clab_amt, _ = decimal.NewFromFloat(material_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
357
 
358
 
358
 			}
359
 			}
359
 			if item.ChrgitmLv == "3" {
360
 			if item.ChrgitmLv == "3" {
360
-				material_other_amt, _ = decimal.NewFromFloat(material_other_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
361
+				material_other_amt, _ = decimal.NewFromFloat(material_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
361
 			}
362
 			}
362
 		}
363
 		}
363
 
364
 
372
 
373
 
373
 			}
374
 			}
374
 			if item.ChrgitmLv == "2" {
375
 			if item.ChrgitmLv == "2" {
375
-				westernMedicine_clab_amt, _ = decimal.NewFromFloat(westernMedicine_clab_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
376
+				westernMedicine_clab_amt, _ = decimal.NewFromFloat(westernMedicine_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
376
 
377
 
377
 			}
378
 			}
378
 			if item.ChrgitmLv == "3" {
379
 			if item.ChrgitmLv == "3" {
379
-				westernMedicine_other_amt, _ = decimal.NewFromFloat(westernMedicine_other_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
380
+				westernMedicine_other_amt, _ = decimal.NewFromFloat(westernMedicine_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
380
 			}
381
 			}
381
 		}
382
 		}
382
 
383
 
391
 
392
 
392
 			}
393
 			}
393
 			if item.ChrgitmLv == "2" {
394
 			if item.ChrgitmLv == "2" {
394
-				chineseTraditional_clab_amt, _ = decimal.NewFromFloat(chineseTraditional_clab_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
395
+				chineseTraditional_clab_amt, _ = decimal.NewFromFloat(chineseTraditional_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
395
 
396
 
396
 			}
397
 			}
397
 			if item.ChrgitmLv == "3" {
398
 			if item.ChrgitmLv == "3" {
398
-				chineseTraditional_other_amt, _ = decimal.NewFromFloat(chineseTraditional_other_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
399
+				chineseTraditional_other_amt, _ = decimal.NewFromFloat(chineseTraditional_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
399
 			}
400
 			}
400
 		}
401
 		}
401
 
402
 
409
 
410
 
410
 			}
411
 			}
411
 			if item.ChrgitmLv == "2" {
412
 			if item.ChrgitmLv == "2" {
412
-				other_clab_amt, _ = decimal.NewFromFloat(other_clab_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
413
+				other_clab_amt, _ = decimal.NewFromFloat(other_clab_amt).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
413
 
414
 
414
 			}
415
 			}
415
 			if item.ChrgitmLv == "3" {
416
 			if item.ChrgitmLv == "3" {
416
-				other_other_amt, _ = decimal.NewFromFloat(other_other_amt).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
417
+				other_other_amt, _ = decimal.NewFromFloat(other_other_amt).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
417
 			}
418
 			}
418
 		}
419
 		}
419
 
420
 
509
 		iteminfo.OthAmt = other_other_amt
510
 		iteminfo.OthAmt = other_other_amt
510
 		struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
511
 		struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
511
 	}
512
 	}
513
+	struct4101.Ntly = "中国"
512
 	result := service.Gdyb4101(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs)
514
 	result := service.Gdyb4101(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs)
513
 	fmt.Println(result)
515
 	fmt.Println(result)
514
 
516
 
1835
 	settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
1837
 	settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
1836
 	admin_user_id, _ := c.GetInt64("admin_user_id")
1838
 	admin_user_id, _ := c.GetInt64("admin_user_id")
1837
 
1839
 
1840
+	fapiao_code := c.GetString("fapiao_code")
1841
+	fapiao_number := c.GetString("fapiao_number")
1842
+
1838
 	timeLayout := "2006-01-02"
1843
 	timeLayout := "2006-01-02"
1839
 	loc, _ := time.LoadLocation("Local")
1844
 	loc, _ := time.LoadLocation("Local")
1840
 	theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
1845
 	theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
1975
 				SettleEndTime:         end_time,
1980
 				SettleEndTime:         end_time,
1976
 				Creator:               roles.AdminUserId,
1981
 				Creator:               roles.AdminUserId,
1977
 				Modify:                roles.AdminUserId,
1982
 				Modify:                roles.AdminUserId,
1983
+				FaPiaoNumber:          fapiao_number,
1984
+				FaPiaoCode:            fapiao_code,
1978
 			}
1985
 			}
1979
 			err = service.CreateOrder(order)
1986
 			err = service.CreateOrder(order)
1980
 			if err != nil {
1987
 			if err != nil {

+ 3 - 0
models/his_models.go View File

667
 	SzMedicineInsuranceInfo string `gorm:"column:sz_medicine_insurance_info" json:"sz_medicine_insurance_info" form:"sz_medicine_insurance_info"`
667
 	SzMedicineInsuranceInfo string `gorm:"column:sz_medicine_insurance_info" json:"sz_medicine_insurance_info" form:"sz_medicine_insurance_info"`
668
 	YiliaoNumber            string `gorm:"column:yiliao_number" json:"yiliao_number" form:"yiliao_number"`
668
 	YiliaoNumber            string `gorm:"column:yiliao_number" json:"yiliao_number" form:"yiliao_number"`
669
 
669
 
670
+	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
671
+	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
672
+
670
 	MzNumber      string `gorm:"column:mz_number" json:"mz_number" form:"mz_number"`
673
 	MzNumber      string `gorm:"column:mz_number" json:"mz_number" form:"mz_number"`
671
 	OrgSetlNumber string `gorm:"column:org_setl_number" json:"org_setl_number" form:"org_setl_number"`
674
 	OrgSetlNumber string `gorm:"column:org_setl_number" json:"org_setl_number" form:"org_setl_number"`
672
 
675
 

+ 3 - 0
service/his_service.go View File

777
 	Creator            int64  `gorm:"column:creator" json:"creator" form:"creator"`
777
 	Creator            int64  `gorm:"column:creator" json:"creator" form:"creator"`
778
 	Modify             int64  `gorm:"column:modify" json:"modify" form:"modify"`
778
 	Modify             int64  `gorm:"column:modify" json:"modify" form:"modify"`
779
 
779
 
780
+	FaPiaoCode   string `gorm:"column:fa_piao_code" json:"fa_piao_code" form:"fa_piao_code"`
781
+	FaPiaoNumber string `gorm:"column:fa_piao_number" json:"fa_piao_number" form:"fa_piao_number"`
782
+
780
 	HisOrderInfo        models.HisOrderInfo        `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"order_info"`
783
 	HisOrderInfo        models.HisOrderInfo        `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"order_info"`
781
 	Patients            models.Patients            `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
784
 	Patients            models.Patients            `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
782
 	HisPatient          models.HisPatient          `gorm:"ForeignKey:HisPatientId;AssociationForeignKey:ID" json:"his_patient"`
785
 	HisPatient          models.HisPatient          `gorm:"ForeignKey:HisPatientId;AssociationForeignKey:ID" json:"his_patient"`