Parcourir la source

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

XMLWAN il y a 3 ans
Parent
révision
f29ecdee29

+ 8 - 10
controllers/his_api_controller.go Voir le fichier

@@ -2076,7 +2076,7 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
2076 2076
 		project.Checker = temp_project.Checker
2077 2077
 		project.CheckState = temp_project.CheckState
2078 2078
 		project.CheckTime = temp_project.CheckTime
2079
-
2079
+		project.TeamId = temp_project.TeamId
2080 2080
 	}
2081 2081
 	if json["type"] != nil || reflect.TypeOf(json["type"]).String() == "float64" {
2082 2082
 		types := int64(json["type"].(float64))
@@ -2088,12 +2088,13 @@ func (c *HisApiController) setProjectWithJSON(project *models.HisPrescriptionPro
2088 2088
 		fmt.Println(project_id)
2089 2089
 		fmt.Println(project.ProjectId)
2090 2090
 	}
2091
-	// if json["price"] != nil || reflect.TypeOf(json["price"]).String() == "float64" {
2092
-	// 	price := int64(json["price"].(float64))
2093
-	// 	formatInt_price := strconv.FormatInt(price, 10)
2094
-	// 	float_price, _ := strconv.ParseFloat(formatInt_price, 64)
2095
-	// 	project.Price = float_price
2096
-	// }
2091
+
2092
+	if json["team_id"] != nil && reflect.TypeOf(json["team_id"]).String() == "float64" {
2093
+		team_id := int64(json["team_id"].(float64))
2094
+		project.TeamId = team_id
2095
+
2096
+	}
2097
+
2097 2098
 	if json["price"] != nil || reflect.TypeOf(json["price"]).String() == "string" {
2098 2099
 		price, _ := strconv.ParseFloat(json["price"].(string), 64)
2099 2100
 		project.Price = price
@@ -3829,14 +3830,11 @@ func (c *HisApiController) GetFaPiaoData() {
3829 3830
 	decimal.DivisionPrecision = 2
3830 3831
 
3831 3832
 	if his.BalanceAccountsType == 2 {
3832
-
3833 3833
 		orderInfos_two, _ := service.GetHisOrderDetailByNumber(order.Number, adminUser.CurrentOrgId)
3834
-
3835 3834
 		for _, item := range orderInfos_two {
3836 3835
 			item.FulamtOwnpayAmt = item.DetItemFeeSumamt
3837 3836
 			if item.HisDoctorAdviceInfo.ID > 0 && item.HisPrescriptionProject.ID == 0 { //药品
3838 3837
 				item.MedChrgitmType = "09"
3839
-
3840 3838
 			}
3841 3839
 			if item.HisPrescriptionProject.ID > 0 && item.HisDoctorAdviceInfo.ID == 0 {
3842 3840
 				if item.HisPrescriptionProject.Type == 2 {

+ 5 - 0
controllers/new_mobile_api_controllers/mobile_his_api_controller.go Voir le fichier

@@ -931,6 +931,11 @@ func (c *MobileHisApiController) setProjectWithJSON(project *models.HisPrescript
931 931
 		fmt.Println(project_id)
932 932
 		fmt.Println(project.ProjectId)
933 933
 	}
934
+	if json["team_id"] != nil || reflect.TypeOf(json["team_id"]).String() == "float64" {
935
+		team_id := int64(json["team_id"].(float64))
936
+		project.TeamId = team_id
937
+
938
+	}
934 939
 	// if json["price"] != nil || reflect.TypeOf(json["price"]).String() == "float64" {
935 940
 	// 	price := int64(json["price"].(float64))
936 941
 	// 	formatInt_price := strconv.FormatInt(price, 10)

+ 9 - 7
models/his_models.go Voir le fichier

@@ -506,13 +506,12 @@ type HisPrescription struct {
506 506
 	HisPatient             VMHisPatient              `gorm:"ForeignKey:PatientId;AssociationForeignKey:patient_id" json:"hisPatient"`
507 507
 	HisDoctorAdviceInfo    []*HisDoctorAdviceInfo    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"advices"`
508 508
 	HisPrescriptionProject []*HisPrescriptionProject `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"project"`
509
-
510
-	HisAdditionalCharge []*HisAdditionalCharge `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"addition"`
511
-	HisPrescriptionInfo HisPrescriptionInfo    `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,ScheduleDate" json:"info"`
512
-	Total               string                 `gorm:"-" json:"total" form:"total"`
513
-	PType               int64                  `gorm:"column:p_type" json:"p_type" form:"p_type"`
514
-	MedType             string                 `gorm:"column:med_type" json:"med_type" form:"med_type"`
515
-	TempHisOrder        TempHisOrder           `gorm:"ForeignKey:Number,MedType;AssociationForeignKey:BatchNumber,MedType" json:"order"`
509
+	HisAdditionalCharge    []*HisAdditionalCharge    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"addition"`
510
+	HisPrescriptionInfo    HisPrescriptionInfo       `gorm:"ForeignKey:PatientId,RecordDate;AssociationForeignKey:PatientId,ScheduleDate" json:"info"`
511
+	Total                  string                    `gorm:"-" json:"total" form:"total"`
512
+	PType                  int64                     `gorm:"column:p_type" json:"p_type" form:"p_type"`
513
+	MedType                string                    `gorm:"column:med_type" json:"med_type" form:"med_type"`
514
+	TempHisOrder           TempHisOrder              `gorm:"ForeignKey:Number,MedType;AssociationForeignKey:BatchNumber,MedType" json:"order"`
516 515
 }
517 516
 
518 517
 func (HisPrescription) TableName() string {
@@ -772,6 +771,9 @@ type HisPrescriptionProject struct {
772 771
 	CheckState     int64 `gorm:"column:check_state" json:"check_state" form:"check_state"`
773 772
 	Checker        int64 `gorm:"column:checker" json:"checker" form:"checker"`
774 773
 	StartTime      int64 `gorm:"column:start_time" json:"start_time" form:"start_time"`
774
+	TeamId         int64 `gorm:"column:team_id" json:"team_id" form:"team_id"`
775
+
776
+	XtHisProjectTeam XtHisProjectTeam `gorm:"ForeignKey:TeamId;AssociationForeignKey:ID" json:"team"`
775 777
 }
776 778
 
777 779
 func (HisPrescriptionProject) TableName() string {

+ 1 - 1
service/his_project_service.go Voir le fichier

@@ -407,7 +407,7 @@ func GetDoctorAdvicePrint(his_patient_id int64, recorddate int64, schIDs []strin
407 407
 	err = XTReadDB().Model(&prescription).Where("patient_id = ? and record_date = ? and id in(?) and  status = 1 ", his_patient_id, recorddate, schIDs).Preload("Patients", "status = 1 and user_org_id = ?", orgid).Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
408 408
 		return db.Where("status = 1 and user_org_id = ?", orgid).Preload("Drug", "status = 1")
409 409
 	}).Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
410
-		return db.Where("status = 1 AND user_org_id = ?", orgid).Preload("HisProject").Preload("GoodInfo", "status=1")
410
+		return db.Where("status = 1 AND user_org_id = ?", orgid).Preload("HisProject").Preload("GoodInfo", "status=1").Preload("XtHisProjectTeam", "status = 1")
411 411
 	}).Preload("HisPrescriptionInfo", "status =1 and user_org_id = ?", orgid).Preload("HisAdditionalCharge", "status = 1 and user_org_id = ?", orgid).Find(&prescription).Error
412 412
 
413 413
 	return prescription, err

+ 2 - 5
service/his_service.go Voir le fichier

@@ -714,11 +714,7 @@ func (BaseDrugLib) TableName() string {
714 714
 }
715 715
 
716 716
 func GetAllDrugLibList(org_id int64) (list []*BaseDrugLib, err error) {
717
-	err = readDb.Model(&BaseDrugLib{}).Preload("OtherDrugWarehouseInfo", "status = 1 AND org_id = ?", org_id).
718
-		Preload("VMDrugSalesReturnInfo", "status = 1 AND org_id = ?", org_id).
719
-		Preload("VMDrugWarehouseOutInfo", "status = 1 AND org_id = ?", org_id).
720
-		Preload("VMDrugCancelStockInfo", "status = 1 AND org_id = ?", org_id).
721
-		Where("org_id = ?  AND status = 1 AND  find_in_set('停用',drug_status) = 0", org_id).Find(&list).Error
717
+	err = readDb.Model(&BaseDrugLib{}).Where("org_id = ?  AND status = 1 AND  find_in_set('停用',drug_status) = 0", org_id).Find(&list).Error
722 718
 	return
723 719
 }
724 720
 
@@ -1521,6 +1517,7 @@ type HisPrescriptionProject struct {
1521 1517
 	CheckState     int64 `gorm:"column:check_state" json:"check_state" form:"check_state"`
1522 1518
 	Checker        int64 `gorm:"column:checker" json:"checker" form:"checker"`
1523 1519
 	StartTime      int64 `gorm:"column:start_time" json:"start_time" form:"start_time"`
1520
+	TeamId         int64 `gorm:"column:team_id" json:"team_id" form:"team_id"`
1524 1521
 }
1525 1522
 
1526 1523
 func (HisPrescriptionProject) TableName() string {