Ver código fonte

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

csx 3 anos atrás
pai
commit
b81df843e1
3 arquivos alterados com 36 adições e 23 exclusões
  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 Ver arquivo

@@ -81,6 +81,7 @@ type CustomFundPay struct {
81 81
 }
82 82
 
83 83
 func (c *HisApiController) GetSettleList() {
84
+
84 85
 	order_id, _ := c.GetInt64("order_id")
85 86
 	admin_user_id, _ := c.GetInt64("admin_user_id")
86 87
 
@@ -114,16 +115,16 @@ func (c *HisApiController) GetSettleList() {
114 115
 		HiType:         order.Insutype,
115 116
 		Insuplc:        miConfig.InsuplcAdmdvs,
116 117
 		MaindiagFlag:   "1",
117
-		BillCode:       "",
118
-		BizSn:          "",
119
-		BillNo:         "",
118
+		BillCode:       order.FaPiaoCode,
119
+		BillNo:         order.FaPiaoNumber,
120
+		BizSn:          order.Number,
120 121
 		PsnSelfPay:     order.PsnPartAmt,
121 122
 		PsnOwnPay:      order.PsnPartAmt,
122 123
 		AcctPay:        order.AcctPay,
123 124
 		PsnCashpay:     order.PsnCashPay,
124 125
 		HiPaymtd:       "1",
125
-		Hsorg:          "医保中心",
126
-		HsorgOpter:     "医保中心",
126
+		Hsorg:          miConfig.InsuplcAdmdvs,
127
+		HsorgOpter:     miConfig.InsuplcAdmdvs,
127 128
 		MedinsFillPsn:  curRoles.UserName,
128 129
 		MedinsFillDept: depart.Name,
129 130
 	}
@@ -256,11 +257,11 @@ func (c *HisApiController) GetSettleList() {
256 257
 				bed_claa_sunmfee, _ = decimal.NewFromFloat(bed_claa_sunmfee).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
257 258
 			}
258 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 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,11 +277,11 @@ func (c *HisApiController) GetSettleList() {
276 277
 
277 278
 			}
278 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 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,11 +296,11 @@ func (c *HisApiController) GetSettleList() {
295 296
 
296 297
 			}
297 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 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,11 +315,11 @@ func (c *HisApiController) GetSettleList() {
314 315
 
315 316
 			}
316 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 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,11 +335,11 @@ func (c *HisApiController) GetSettleList() {
334 335
 
335 336
 			}
336 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 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,11 +354,11 @@ func (c *HisApiController) GetSettleList() {
353 354
 
354 355
 			}
355 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 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,11 +373,11 @@ func (c *HisApiController) GetSettleList() {
372 373
 
373 374
 			}
374 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 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,11 +392,11 @@ func (c *HisApiController) GetSettleList() {
391 392
 
392 393
 			}
393 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 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,11 +410,11 @@ func (c *HisApiController) GetSettleList() {
409 410
 
410 411
 			}
411 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 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,6 +510,7 @@ func (c *HisApiController) GetSettleList() {
509 510
 		iteminfo.OthAmt = other_other_amt
510 511
 		struct4101.IteminfoStruct = append(struct4101.IteminfoStruct, iteminfo)
511 512
 	}
513
+	struct4101.Ntly = "中国"
512 514
 	result := service.Gdyb4101(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs)
513 515
 	fmt.Println(result)
514 516
 
@@ -1835,6 +1837,9 @@ func (c *HisApiController) GetUploadInfo() {
1835 1837
 	settle_accounts_type, _ := c.GetInt64("settle_accounts_type")
1836 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 1843
 	timeLayout := "2006-01-02"
1839 1844
 	loc, _ := time.LoadLocation("Local")
1840 1845
 	theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
@@ -1975,6 +1980,8 @@ func (c *HisApiController) GetUploadInfo() {
1975 1980
 				SettleEndTime:         end_time,
1976 1981
 				Creator:               roles.AdminUserId,
1977 1982
 				Modify:                roles.AdminUserId,
1983
+				FaPiaoNumber:          fapiao_number,
1984
+				FaPiaoCode:            fapiao_code,
1978 1985
 			}
1979 1986
 			err = service.CreateOrder(order)
1980 1987
 			if err != nil {

+ 3 - 0
models/his_models.go Ver arquivo

@@ -667,6 +667,9 @@ type HisOrder struct {
667 667
 	SzMedicineInsuranceInfo string `gorm:"column:sz_medicine_insurance_info" json:"sz_medicine_insurance_info" form:"sz_medicine_insurance_info"`
668 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 673
 	MzNumber      string `gorm:"column:mz_number" json:"mz_number" form:"mz_number"`
671 674
 	OrgSetlNumber string `gorm:"column:org_setl_number" json:"org_setl_number" form:"org_setl_number"`
672 675
 

+ 3 - 0
service/his_service.go Ver arquivo

@@ -777,6 +777,9 @@ type XtHisOrder struct {
777 777
 	Creator            int64  `gorm:"column:creator" json:"creator" form:"creator"`
778 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 783
 	HisOrderInfo        models.HisOrderInfo        `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"order_info"`
781 784
 	Patients            models.Patients            `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
782 785
 	HisPatient          models.HisPatient          `gorm:"ForeignKey:HisPatientId;AssociationForeignKey:ID" json:"his_patient"`