陈少旭 před 3 týdny
rodič
revize
9af28ea31c
1 změnil soubory, kde provedl 17 přidání a 18 odebrání
  1. 17 18
      controllers/his_api_controller.go

+ 17 - 18
controllers/his_api_controller.go Zobrazit soubor

@@ -1918,17 +1918,6 @@ func (c *HisApiController) CreateHisPrescription() {
1918 1918
 		return
1919 1919
 	}
1920 1920
 
1921
-	// 开始主事务
1922
-	db := service.XTWriteDB()
1923
-	tx := db.Begin()
1924
-
1925
-	// 在函数结束时处理事务回滚
1926
-	defer func() {
1927
-		if r := recover(); r != nil {
1928
-			tx.Rollback()
1929
-		}
1930
-	}()
1931
-
1932 1921
 	pharmacyConfig, _ := service.FindPharmacyConfig(adminInfo.CurrentOrgId)
1933 1922
 
1934 1923
 	//药品发药出库
@@ -3101,6 +3090,16 @@ func (c *HisApiController) CreateHisPrescription() {
3101 3090
 	var projectList []models.HisPrescriptionProject
3102 3091
 
3103 3092
 	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10164 {
3093
+		// 开始主事务
3094
+		db := service.XTWriteDB()
3095
+		tx := db.Begin()
3096
+
3097
+		// 在函数结束时处理事务回滚
3098
+		defer func() {
3099
+			if r := recover(); r != nil {
3100
+				tx.Rollback()
3101
+			}
3102
+		}()
3104 3103
 		if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
3105 3104
 			prescriptions, _ := dataBody["prescriptions"].([]interface{})
3106 3105
 
@@ -10516,7 +10515,7 @@ func (c *HisApiController) GetFaPiaoData() {
10516 10515
 				laboratoryCostSelfTotal = laboratoryCostTotal
10517 10516
 			}
10518 10517
 
10519
-			if item.MedChrgitmType == "05" || item.MedChrgitmType == "14" { //治疗费
10518
+			if item.MedChrgitmType == "05" || item.MedChrgitmType == "14" || item.MedChrgitmType == "201" { //治疗费
10520 10519
 				treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
10521 10520
 				treatCostSelfTotal = treatCostTotal
10522 10521
 			}
@@ -10526,12 +10525,12 @@ func (c *HisApiController) GetFaPiaoData() {
10526 10525
 				operationCostSelfTotal = treatCostTotal
10527 10526
 			}
10528 10527
 
10529
-			if item.MedChrgitmType == "08" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" || item.MedChrgitmType == "1401" { //材料费
10528
+			if item.MedChrgitmType == "08" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" || item.MedChrgitmType == "1401" || item.MedChrgitmType == "301" { //材料费
10530 10529
 				materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
10531 10530
 				materialCostSelfTotal = materialCostTotal
10532 10531
 			}
10533 10532
 
10534
-			if item.MedChrgitmType == "09" { //西药费
10533
+			if item.MedChrgitmType == "09" || item.MedChrgitmType == "101" { //西药费
10535 10534
 				westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
10536 10535
 				westernMedicineCostSelfTotal = westernMedicineCostTotal
10537 10536
 			}
@@ -10593,7 +10592,7 @@ func (c *HisApiController) GetFaPiaoData() {
10593 10592
 
10594 10593
 			}
10595 10594
 
10596
-			if item.MedChrgitmType == "05" || item.MedChrgitmType == "14" { //治疗费
10595
+			if item.MedChrgitmType == "05" || item.MedChrgitmType == "14" || item.MedChrgitmType == "201" { //治疗费
10597 10596
 				treatCostTotal, _ = decimal.NewFromFloat(treatCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
10598 10597
 				treatCostSelfTotal, _ = decimal.NewFromFloat(treatCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
10599 10598
 				treatCostPartSelfTotal, _ = decimal.NewFromFloat(treatCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
@@ -10606,19 +10605,19 @@ func (c *HisApiController) GetFaPiaoData() {
10606 10605
 				operationCostPartSelfTotal, _ = decimal.NewFromFloat(operationCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
10607 10606
 			}
10608 10607
 
10609
-			if item.MedChrgitmType == "08" || item.MedChrgitmType == "1401" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" { //材料费
10608
+			if item.MedChrgitmType == "08" || item.MedChrgitmType == "1401" || item.MedChrgitmType == "1402" || item.MedChrgitmType == "1403" || item.MedChrgitmType == "301" { //材料费
10610 10609
 				materialCostTotal, _ = decimal.NewFromFloat(materialCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
10611 10610
 				materialCostSelfTotal, _ = decimal.NewFromFloat(materialCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
10612 10611
 				materialCostPartSelfTotal, _ = decimal.NewFromFloat(materialCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
10613 10612
 			}
10614 10613
 
10615
-			if item.MedChrgitmType == "07" { //西药费
10614
+			if item.MedChrgitmType == "07" { //护理
10616 10615
 				hiliCostTotal, _ = decimal.NewFromFloat(hiliCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
10617 10616
 				hiliCostSelfTotal, _ = decimal.NewFromFloat(hiliCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
10618 10617
 				hiliCostPartSelfTotal, _ = decimal.NewFromFloat(hiliCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()
10619 10618
 			}
10620 10619
 
10621
-			if item.MedChrgitmType == "09" { //西药费
10620
+			if item.MedChrgitmType == "09" || item.MedChrgitmType == "101" { //西药费
10622 10621
 				westernMedicineCostTotal, _ = decimal.NewFromFloat(westernMedicineCostTotal).Add(decimal.NewFromFloat(item.DetItemFeeSumamt)).Float64()
10623 10622
 				westernMedicineCostSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostSelfTotal).Add(decimal.NewFromFloat(item.OverlmtAmt)).Float64()
10624 10623
 				westernMedicineCostPartSelfTotal, _ = decimal.NewFromFloat(westernMedicineCostPartSelfTotal).Add(decimal.NewFromFloat(item.PreselfpayAmt)).Float64()