瀏覽代碼

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

XMLWAN 3 年之前
父節點
當前提交
f29ecdee29

+ 8 - 10
controllers/his_api_controller.go 查看文件

2076
 		project.Checker = temp_project.Checker
2076
 		project.Checker = temp_project.Checker
2077
 		project.CheckState = temp_project.CheckState
2077
 		project.CheckState = temp_project.CheckState
2078
 		project.CheckTime = temp_project.CheckTime
2078
 		project.CheckTime = temp_project.CheckTime
2079
-
2079
+		project.TeamId = temp_project.TeamId
2080
 	}
2080
 	}
2081
 	if json["type"] != nil || reflect.TypeOf(json["type"]).String() == "float64" {
2081
 	if json["type"] != nil || reflect.TypeOf(json["type"]).String() == "float64" {
2082
 		types := int64(json["type"].(float64))
2082
 		types := int64(json["type"].(float64))
2088
 		fmt.Println(project_id)
2088
 		fmt.Println(project_id)
2089
 		fmt.Println(project.ProjectId)
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
 	if json["price"] != nil || reflect.TypeOf(json["price"]).String() == "string" {
2098
 	if json["price"] != nil || reflect.TypeOf(json["price"]).String() == "string" {
2098
 		price, _ := strconv.ParseFloat(json["price"].(string), 64)
2099
 		price, _ := strconv.ParseFloat(json["price"].(string), 64)
2099
 		project.Price = price
2100
 		project.Price = price
3829
 	decimal.DivisionPrecision = 2
3830
 	decimal.DivisionPrecision = 2
3830
 
3831
 
3831
 	if his.BalanceAccountsType == 2 {
3832
 	if his.BalanceAccountsType == 2 {
3832
-
3833
 		orderInfos_two, _ := service.GetHisOrderDetailByNumber(order.Number, adminUser.CurrentOrgId)
3833
 		orderInfos_two, _ := service.GetHisOrderDetailByNumber(order.Number, adminUser.CurrentOrgId)
3834
-
3835
 		for _, item := range orderInfos_two {
3834
 		for _, item := range orderInfos_two {
3836
 			item.FulamtOwnpayAmt = item.DetItemFeeSumamt
3835
 			item.FulamtOwnpayAmt = item.DetItemFeeSumamt
3837
 			if item.HisDoctorAdviceInfo.ID > 0 && item.HisPrescriptionProject.ID == 0 { //药品
3836
 			if item.HisDoctorAdviceInfo.ID > 0 && item.HisPrescriptionProject.ID == 0 { //药品
3838
 				item.MedChrgitmType = "09"
3837
 				item.MedChrgitmType = "09"
3839
-
3840
 			}
3838
 			}
3841
 			if item.HisPrescriptionProject.ID > 0 && item.HisDoctorAdviceInfo.ID == 0 {
3839
 			if item.HisPrescriptionProject.ID > 0 && item.HisDoctorAdviceInfo.ID == 0 {
3842
 				if item.HisPrescriptionProject.Type == 2 {
3840
 				if item.HisPrescriptionProject.Type == 2 {

+ 5 - 0
controllers/new_mobile_api_controllers/mobile_his_api_controller.go 查看文件

931
 		fmt.Println(project_id)
931
 		fmt.Println(project_id)
932
 		fmt.Println(project.ProjectId)
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
 	// if json["price"] != nil || reflect.TypeOf(json["price"]).String() == "float64" {
939
 	// if json["price"] != nil || reflect.TypeOf(json["price"]).String() == "float64" {
935
 	// 	price := int64(json["price"].(float64))
940
 	// 	price := int64(json["price"].(float64))
936
 	// 	formatInt_price := strconv.FormatInt(price, 10)
941
 	// 	formatInt_price := strconv.FormatInt(price, 10)

+ 9 - 7
models/his_models.go 查看文件

506
 	HisPatient             VMHisPatient              `gorm:"ForeignKey:PatientId;AssociationForeignKey:patient_id" json:"hisPatient"`
506
 	HisPatient             VMHisPatient              `gorm:"ForeignKey:PatientId;AssociationForeignKey:patient_id" json:"hisPatient"`
507
 	HisDoctorAdviceInfo    []*HisDoctorAdviceInfo    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"advices"`
507
 	HisDoctorAdviceInfo    []*HisDoctorAdviceInfo    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"advices"`
508
 	HisPrescriptionProject []*HisPrescriptionProject `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"project"`
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
 func (HisPrescription) TableName() string {
517
 func (HisPrescription) TableName() string {
772
 	CheckState     int64 `gorm:"column:check_state" json:"check_state" form:"check_state"`
771
 	CheckState     int64 `gorm:"column:check_state" json:"check_state" form:"check_state"`
773
 	Checker        int64 `gorm:"column:checker" json:"checker" form:"checker"`
772
 	Checker        int64 `gorm:"column:checker" json:"checker" form:"checker"`
774
 	StartTime      int64 `gorm:"column:start_time" json:"start_time" form:"start_time"`
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
 func (HisPrescriptionProject) TableName() string {
779
 func (HisPrescriptionProject) TableName() string {

+ 1 - 1
service/his_project_service.go 查看文件

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 {
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
 		return db.Where("status = 1 and user_org_id = ?", orgid).Preload("Drug", "status = 1")
408
 		return db.Where("status = 1 and user_org_id = ?", orgid).Preload("Drug", "status = 1")
409
 	}).Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
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
 	}).Preload("HisPrescriptionInfo", "status =1 and user_org_id = ?", orgid).Preload("HisAdditionalCharge", "status = 1 and user_org_id = ?", orgid).Find(&prescription).Error
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
 	return prescription, err
413
 	return prescription, err

+ 2 - 5
service/his_service.go 查看文件

714
 }
714
 }
715
 
715
 
716
 func GetAllDrugLibList(org_id int64) (list []*BaseDrugLib, err error) {
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
 	return
718
 	return
723
 }
719
 }
724
 
720
 
1521
 	CheckState     int64 `gorm:"column:check_state" json:"check_state" form:"check_state"`
1517
 	CheckState     int64 `gorm:"column:check_state" json:"check_state" form:"check_state"`
1522
 	Checker        int64 `gorm:"column:checker" json:"checker" form:"checker"`
1518
 	Checker        int64 `gorm:"column:checker" json:"checker" form:"checker"`
1523
 	StartTime      int64 `gorm:"column:start_time" json:"start_time" form:"start_time"`
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
 func (HisPrescriptionProject) TableName() string {
1523
 func (HisPrescriptionProject) TableName() string {