Browse Source

提交代码

陈少旭 7 months ago
parent
commit
a883e07822

+ 10 - 8
controllers/his_api_controller.go View File

@@ -5248,11 +5248,11 @@ func (c *HisApiController) DeletePrescription() {
5248 5248
 	new_prescription, p_err := service.GetPrescriptionById(prescription_id, c.GetAdminUserInfo().CurrentOrgId)
5249 5249
 	new_prescriptions, _ := service.GetHisPrescription(c.GetAdminUserInfo().CurrentOrgId, new_prescription.PatientId, new_prescription.RecordDate, new_prescription.PType)
5250 5250
 
5251
-	for _, item := range new_prescriptions {
5252
-		if item.IsMedicine == 1 {
5253
-			isMedicine = true
5254
-		}
5251
+	//for _, item := range new_prescriptions {
5252
+	if new_prescription.IsMedicine == 1 {
5253
+		isMedicine = true
5255 5254
 	}
5255
+	//}
5256 5256
 
5257 5257
 	for _, item := range new_prescriptions {
5258 5258
 		if item.OrderStatus == 4 {
@@ -5802,11 +5802,11 @@ func (c *HisApiController) DeleteDoctorAdvice() {
5802 5802
 
5803 5803
 	//获取今天该患者所有处方,判断是否发药或者收费
5804 5804
 	new_prescriptions, _ := service.GetHisPrescription(c.GetAdminUserInfo().CurrentOrgId, new_prescription.PatientId, new_prescription.RecordDate, new_prescription.PType)
5805
-	for _, item := range new_prescriptions {
5806
-		if item.IsMedicine == 1 {
5807
-			isMedicine = true
5808
-		}
5805
+	//for _, item := range new_prescriptions {
5806
+	if new_prescription.IsMedicine == 1 {
5807
+		isMedicine = true
5809 5808
 	}
5809
+	//}
5810 5810
 	for _, item := range new_prescriptions {
5811 5811
 		if item.OrderStatus == 4 {
5812 5812
 			isCharge = true
@@ -7629,6 +7629,7 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
7629 7629
 					}
7630 7630
 					//advice.Groupno = hisAdvice.Groupno
7631 7631
 				} else {
7632
+					advice.IsMedicine = 0
7632 7633
 					ctime := time.Now().Unix()
7633 7634
 					advice.CreatedTime = ctime
7634 7635
 					advice.UpdatedTime = ctime
@@ -7636,6 +7637,7 @@ func (c *HisApiController) setAdviceWithJSON(advice *models.HisDoctorAdviceInfo,
7636 7637
 				}
7637 7638
 			}
7638 7639
 		} else {
7640
+			advice.IsMedicine = 0
7639 7641
 			ctime := time.Now().Unix()
7640 7642
 			advice.CreatedTime = ctime
7641 7643
 			advice.UpdatedTime = ctime

+ 4 - 1
controllers/new_stock_api_controller.go View File

@@ -73,6 +73,9 @@ func (c *NewStockApiController) GetDrugChange() {
73 73
 	start_time := c.GetString("start_time")
74 74
 	end_time := c.GetString("end_time")
75 75
 
76
+	is_sale, _ := c.GetInt64("is_sale")
77
+	is_bg, _ := c.GetInt64("is_bg")
78
+
76 79
 	timeLayout := "2006-01-02"
77 80
 	loc, _ := time.LoadLocation("Local")
78 81
 	var startTime int64
@@ -98,7 +101,7 @@ func (c *NewStockApiController) GetDrugChange() {
98 101
 	orgId := c.GetAdminUserInfo().CurrentOrgId
99 102
 	page, _ := c.GetInt64("page")
100 103
 	limit, _ := c.GetInt64("limit")
101
-	list, total, _ := service.GetNewDrugFlow(orgId, limit, page, startTime, endTime)
104
+	list, total, _ := service.GetNewDrugFlow(orgId, limit, page, startTime, endTime, is_sale, is_bg)
102 105
 	manufacturerList, _ := service.GetAllManufacturerList(orgId)
103 106
 	dealerList, _ := service.GetAllDealerList(orgId)
104 107
 	houseList, _ := service.GetAllStoreHouseList(orgId)

+ 1 - 0
models/his_charge_models.go View File

@@ -371,6 +371,7 @@ type NewChargeDetail struct {
371 371
 	PType             string  `gorm:"column:p_type" json:"p_type" form:"p_type"`
372 372
 	SpecificationName string  `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
373 373
 	ItemId            int64   `gorm:"column:item_id" json:"item_id" form:"item_id"`
374
+	Pdate             string  `gorm:"column:pdate" json:"pdate" form:"pdate"`
374 375
 }
375 376
 
376 377
 type NewHisChargeOrder struct {

+ 9 - 4
models/new_drug_stock.go View File

@@ -60,10 +60,15 @@ type NewDrugFlow struct {
60 60
 	Remark                    string                 `gorm:"column:remark" json:"remark" form:"remark"`
61 61
 	OperateTime               int64                  `gorm:"column:operate_time" json:"operate_time" form:"operate_time"`
62 62
 	SaleDate                  string                 `gorm:"column:sale_date" json:"sale_date" form:"sale_date"`
63
-	PCount                    float64
64
-	SDate                     string
65
-	PDate                     int64
66
-	Unit                      string
63
+	IsSale                    int64                  `gorm:"column:is_sale" json:"is_sale" form:"is_sale"`
64
+	IsChange                  int64                  `gorm:"column:is_change" json:"is_change" form:"is_change"`
65
+	Bchno                     string                 `gorm:"column:bchno" json:"bchno" form:"bchno"`
66
+	BgBchno                   string                 `gorm:"column:bg_bchno" json:"bg_bchno" form:"bg_bchno"`
67
+
68
+	PCount float64
69
+	SDate  string
70
+	PDate  int64
71
+	Unit   string
67 72
 }
68 73
 
69 74
 func (NewDrugFlow) TableName() string {

+ 1 - 0
models/new_stock.go View File

@@ -33,6 +33,7 @@ type DrugWarehouseInfoTenOne struct {
33 33
 	PcDate                    int64       `gorm:"column:pc_date" json:"pc_date" form:"pc_date"`
34 34
 	IsPc                      int64       `gorm:"column:is_pc" json:"is_pc" form:"is_pc"`
35 35
 	IsBg                      int64       `gorm:"column:is_bg" json:"is_bg" form:"is_bg"`
36
+	BgBchno                   string      `gorm:"column:bg_bchno" json:"bg_bchno" form:"bg_bchno"`
36 37
 }
37 38
 
38 39
 func (DrugWarehouseInfoTenOne) TableName() string {

+ 8 - 1
service/new_stock_medical_insurance_service.go View File

@@ -30,7 +30,7 @@ func FindAllDrugWarehousingInfo(org_id int64, is_pc int64, is_bg int64, start_ti
30 30
 	return list, err
31 31
 }
32 32
 
33
-func GetNewDrugFlow(orgid int64, limit int64, page int64, startTime int64, endTime int64) (drug_flow []*models.NewDrugFlow, total int64, err error) {
33
+func GetNewDrugFlow(orgid int64, limit int64, page int64, startTime int64, endTime int64, is_sale int64, is_bg int64) (drug_flow []*models.NewDrugFlow, total int64, err error) {
34 34
 
35 35
 	offset := (page - 1) * limit
36 36
 	db := XTReadDB().Model(drug_flow).Where("status = 1")
@@ -43,6 +43,13 @@ func GetNewDrugFlow(orgid int64, limit int64, page int64, startTime int64, endTi
43 43
 	if endTime > 0 {
44 44
 		db = db.Where("ctime<=?", endTime)
45 45
 	}
46
+	if is_sale != 3 {
47
+		db = db.Where("is_sale = ?", is_sale)
48
+	}
49
+	if is_bg != 3 {
50
+		db = db.Where("is_change = ?", is_bg)
51
+	}
52
+
46 53
 	//if stock_type > 0 {
47 54
 
48 55
 	//手动入库