Browse Source

提交代码

陈少旭 6 days ago
parent
commit
53fa25aee5
2 changed files with 20 additions and 0 deletions
  1. 12 0
      controllers/his_api_controller.go
  2. 8 0
      service/his_service.go

+ 12 - 0
controllers/his_api_controller.go View File

@@ -10748,6 +10748,7 @@ func (c *HisApiController) GetUploadInfo() {
10748 10748
 					}
10749 10749
 				}
10750 10750
 			}
10751
+
10751 10752
 			if item.Type == 2 { //项目
10752 10753
 				for _, subItem := range item.HisPrescriptionProject {
10753 10754
 					if subItem.Type == 2 {
@@ -10785,6 +10786,7 @@ func (c *HisApiController) GetUploadInfo() {
10785 10786
 
10786 10787
 				}
10787 10788
 			}
10789
+
10788 10790
 			for _, item := range item.HisAdditionalCharge {
10789 10791
 				cus := &Custom{
10790 10792
 					ItemId:           item.ID,
@@ -11073,6 +11075,16 @@ func (c *HisApiController) Refund() {
11073 11075
 		}
11074 11076
 	}
11075 11077
 
11078
+	fapiao, _ := service.GetFaPiaoHisOrderByID(order_id)
11079
+
11080
+	if fapiao.ID > 0 {
11081
+		c.ServeSuccessJSON(map[string]interface{}{
11082
+			"failed_code": -10,
11083
+			"msg":         "该结算已经开具发票无法退费,请先红冲发票",
11084
+		})
11085
+		return
11086
+	}
11087
+
11076 11088
 	orders, _ := service.GetHisOrderDetailByNumberThree(order.Number, order.UserOrgId)
11077 11089
 	houseConfig, _ := service.GetAllStoreHouseConfig(order.UserOrgId)
11078 11090
 	var goods []*models.DialysisBeforePrepareGoods

+ 8 - 0
service/his_service.go View File

@@ -2,6 +2,7 @@ package service
2 2
 
3 3
 import (
4 4
 	"fmt"
5
+	"strconv"
5 6
 	"strings"
6 7
 	"time"
7 8
 
@@ -3640,3 +3641,10 @@ func DeleteGood(id int64) (models.XtGoodTeam, error) {
3640 3641
 
3641 3642
 	return goodTeam, err
3642 3643
 }
3644
+
3645
+func GetFaPiaoHisOrderByID(order_id int64) (order models.HisFaPiaoOrder, err error) {
3646
+	str := strconv.FormatInt(order_id, 10)
3647
+	key := "%" + str + "%"
3648
+	err = readDb.Model(&models.HisFaPiaoOrder{}).Where("order_ids like ? and status = 1", key).First(&order).Error
3649
+	return
3650
+}