Browse Source

Merge branch '20230223_xt_api_new_branch' of http://git.shengws.com/csx/XT_New into 20230223_xt_api_new_branch

28169 6 days ago
parent
commit
c480cca962
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

@@ -10906,6 +10906,7 @@ func (c *HisApiController) GetUploadInfo() {
10906 10906
 					}
10907 10907
 				}
10908 10908
 			}
10909
+
10909 10910
 			if item.Type == 2 { //项目
10910 10911
 				for _, subItem := range item.HisPrescriptionProject {
10911 10912
 					if subItem.Type == 2 {
@@ -10943,6 +10944,7 @@ func (c *HisApiController) GetUploadInfo() {
10943 10944
 
10944 10945
 				}
10945 10946
 			}
10947
+
10946 10948
 			for _, item := range item.HisAdditionalCharge {
10947 10949
 				cus := &Custom{
10948 10950
 					ItemId:           item.ID,
@@ -11231,6 +11233,16 @@ func (c *HisApiController) Refund() {
11231 11233
 		}
11232 11234
 	}
11233 11235
 
11236
+	fapiao, _ := service.GetFaPiaoHisOrderByID(order_id)
11237
+
11238
+	if fapiao.ID > 0 {
11239
+		c.ServeSuccessJSON(map[string]interface{}{
11240
+			"failed_code": -10,
11241
+			"msg":         "该结算已经开具发票无法退费,请先红冲发票",
11242
+		})
11243
+		return
11244
+	}
11245
+
11234 11246
 	orders, _ := service.GetHisOrderDetailByNumberThree(order.Number, order.UserOrgId)
11235 11247
 	houseConfig, _ := service.GetAllStoreHouseConfig(order.UserOrgId)
11236 11248
 	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
+}