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
 					}
10748
 					}
10749
 				}
10749
 				}
10750
 			}
10750
 			}
10751
+
10751
 			if item.Type == 2 { //项目
10752
 			if item.Type == 2 { //项目
10752
 				for _, subItem := range item.HisPrescriptionProject {
10753
 				for _, subItem := range item.HisPrescriptionProject {
10753
 					if subItem.Type == 2 {
10754
 					if subItem.Type == 2 {
10785
 
10786
 
10786
 				}
10787
 				}
10787
 			}
10788
 			}
10789
+
10788
 			for _, item := range item.HisAdditionalCharge {
10790
 			for _, item := range item.HisAdditionalCharge {
10789
 				cus := &Custom{
10791
 				cus := &Custom{
10790
 					ItemId:           item.ID,
10792
 					ItemId:           item.ID,
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
 	orders, _ := service.GetHisOrderDetailByNumberThree(order.Number, order.UserOrgId)
11088
 	orders, _ := service.GetHisOrderDetailByNumberThree(order.Number, order.UserOrgId)
11077
 	houseConfig, _ := service.GetAllStoreHouseConfig(order.UserOrgId)
11089
 	houseConfig, _ := service.GetAllStoreHouseConfig(order.UserOrgId)
11078
 	var goods []*models.DialysisBeforePrepareGoods
11090
 	var goods []*models.DialysisBeforePrepareGoods

+ 8 - 0
service/his_service.go View File

2
 
2
 
3
 import (
3
 import (
4
 	"fmt"
4
 	"fmt"
5
+	"strconv"
5
 	"strings"
6
 	"strings"
6
 	"time"
7
 	"time"
7
 
8
 
3640
 
3641
 
3641
 	return goodTeam, err
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
+}