Browse Source

提交代码

陈少旭 9 months ago
parent
commit
137c39b82b

+ 9 - 0
controllers/his_project_api_controller.go View File

@@ -149,6 +149,7 @@ func (this *HisProjectApiController) SaveProject() {
149 149
 			firstLetter += string(py[0][0])
150 150
 		}
151 151
 	}
152
+
152 153
 	hisProject := models.XtHisProject{
153 154
 		ProjectName:                 project_name,
154 155
 		Pinyin:                      firstLetter,
@@ -191,6 +192,10 @@ func (this *HisProjectApiController) SaveProject() {
191 192
 		ZuobiaoId:                   bbx01,
192 193
 		FirstLetter:                 firstLetter,
193 194
 	}
195
+	if this.GetAdminUserInfo().CurrentOrgId == 10206 {
196
+		de, _ := service.GetDepartMentDetail(executive_section)
197
+		hisProject.Bck01b = de.Number
198
+	}
194 199
 	//查询项目名称是否存在
195 200
 	_, errcode := service.GetHisProjectIsExist(project_name, orgId)
196 201
 	if errcode == gorm.ErrRecordNotFound {
@@ -343,6 +348,10 @@ func (this *HisProjectApiController) UpdatedProject() {
343 348
 		ZuobiaoId:                   bbx01,
344 349
 		UserOrgId:                   orgId,
345 350
 	}
351
+	if this.GetAdminUserInfo().CurrentOrgId == 10206 {
352
+		de, _ := service.GetDepartMentDetail(executive_section)
353
+		hisProject.Bck01b = de.Number
354
+	}
346 355
 
347 356
 	err := service.UpdatedProject(id, &hisProject)
348 357
 

+ 2 - 0
controllers/manager_center_api_controller.go View File

@@ -1682,6 +1682,7 @@ func (c *ManagerCenterApiController) CreateGoodInfo() {
1682 1682
 		Bbx01:                       bbx01,
1683 1683
 		Bby01:                       bby01,
1684 1684
 		ZuobiaoId:                   bbx01,
1685
+		Bck01b:                      "55",
1685 1686
 	}
1686 1687
 	err, goodInfos := service.AddSigleGoodInfo(&goodInfo)
1687 1688
 	if err == nil {
@@ -1825,6 +1826,7 @@ func (c *ManagerCenterApiController) ModifyGoodInfo() {
1825 1826
 		Bbx01:                       bbx01,
1826 1827
 		Bby01:                       bby01,
1827 1828
 		ZuobiaoId:                   bbx01,
1829
+		Bck01b:                      "55",
1828 1830
 	}
1829 1831
 
1830 1832
 	totals := service.FindGoodInfoByNameOne(specification_name, adminUserInfo.CurrentOrgId, good_id, id, good_name)

+ 3 - 1
models/good_models.go View File

@@ -104,7 +104,9 @@ type GoodInfo struct {
104 104
 	SumInCount                  int64                `gorm:"column:sum_in_count" json:"sum_in_count" form:"sum_in_count"`
105 105
 	Bbx01                       string               `gorm:"column:bbx01" json:"bbx01" form:"bbx01"`
106 106
 	Bby01                       string               `gorm:"column:bby01" json:"bby01" form:"bby01"`
107
-	ZuobiaoId                   string               `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
107
+	Bck01b                      string               `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
108
+
109
+	ZuobiaoId string `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
108 110
 
109 111
 	WarehousingInfoOne []*StartWarehousingInfo `gorm:"json:"warehouse_info"` //期间增加
110 112
 

+ 2 - 1
models/his_models.go View File

@@ -48,6 +48,7 @@ type XtHisProject struct {
48 48
 	Bbx01                       string  `gorm:"column:bbx01" json:"bbx01" form:"bbx01"`
49 49
 	Bby01                       string  `gorm:"column:bby01" json:"bby01" form:"bby01"`
50 50
 	ZuobiaoId                   string  `gorm:"column:zuobiao_id" json:"zuobiao_id" form:"zuobiao_id"`
51
+	Bck01b                      string  `gorm:"column:bck01b" json:"bck01b" form:"bck01b"`
51 52
 }
52 53
 
53 54
 func (XtHisProject) TableName() string {
@@ -557,7 +558,7 @@ type HisPrescription struct {
557 558
 	BatchNumber            string                    `gorm:"column:batch_number" json:"batch_number" form:"batch_number"`
558 559
 	PrescriptionNumber     string                    `gorm:"column:prescription_number" json:"prescription_number" form:"prescription_number"`
559 560
 	Patients               Patients                  `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
560
-	HisPatient             VMHisPatient              `gorm:"ForeignKey:PatientId;AssociationForeignKey:patient_id" json:"hisPatient"`
561
+	HisPatient             VMHisPatient              `gorm:"ForeignKey:ID;AssociationForeignKey:HisPatientId" json:"hisPatient"`
561 562
 	HisDoctorAdviceInfo    []*HisDoctorAdviceInfo    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"advices"`
562 563
 	HisPrescriptionProject []*HisPrescriptionProject `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"project"`
563 564
 	HisAdditionalCharge    []*HisAdditionalCharge    `gorm:"ForeignKey:PrescriptionId;AssociationForeignKey:ID" json:"addition"`

+ 2 - 2
service/his_project_service.go View File

@@ -59,7 +59,7 @@ func GetProjectDetail(id int64) (models.XtHisProject, error) {
59 59
 
60 60
 func UpdatedProject(id int64, pro *models.XtHisProject) error {
61 61
 
62
-	err := XTWriteDB().Model(&pro).Where("id=?", id).Updates(map[string]interface{}{"project_name": pro.ProjectName, "pinyin": pro.Pinyin, "wubi": pro.Pinyin, "price": pro.Price, "unit": pro.Unit, "cost_classify": pro.CostClassify, "executive_section": pro.ExecutiveSection, "medical_coverage": pro.MedicalCoverage, "statistical_classification": pro.StatisticalClassification, "disease_directory": pro.DiseaseDirectory, "is_record": pro.IsRecord, "medical_code": pro.MedicalCode, "tube_color": pro.TubeColor, "medical_status": pro.MedicalStatus, "remark": pro.Remark, "sign": pro.Sign, "default_number": pro.DefaultNumber, "is_default": pro.IsDefault, "is_charge": pro.IsCharge, "is_estimate": pro.IsEstimate, "is_workload": pro.IsWorkload, "sort": pro.Sort, "doctor_advice": pro.DoctorAdvice, "single_dose": pro.SingleDose, "execution_frequency": pro.ExecutionFrequency, "delivery_way": pro.DeliveryWay, "number_days": pro.NumberDays, "total": pro.Total, "updated_time": pro.UpdatedTime, "category": pro.Category, "specail_project": pro.SpecailProject, "social_security_directory_code": pro.SocialSecurityDirectoryCode, "record_date": pro.RecordDate, "is_print": pro.IsPrint, "bbx01": pro.Bbx01, "bby01": pro.Bby01, "zuobiao_id": pro.ZuobiaoId}).Error
62
+	err := XTWriteDB().Model(&pro).Where("id=?", id).Updates(map[string]interface{}{"project_name": pro.ProjectName, "pinyin": pro.Pinyin, "wubi": pro.Pinyin, "price": pro.Price, "unit": pro.Unit, "cost_classify": pro.CostClassify, "executive_section": pro.ExecutiveSection, "medical_coverage": pro.MedicalCoverage, "statistical_classification": pro.StatisticalClassification, "disease_directory": pro.DiseaseDirectory, "is_record": pro.IsRecord, "medical_code": pro.MedicalCode, "tube_color": pro.TubeColor, "medical_status": pro.MedicalStatus, "remark": pro.Remark, "sign": pro.Sign, "default_number": pro.DefaultNumber, "is_default": pro.IsDefault, "is_charge": pro.IsCharge, "is_estimate": pro.IsEstimate, "is_workload": pro.IsWorkload, "sort": pro.Sort, "doctor_advice": pro.DoctorAdvice, "single_dose": pro.SingleDose, "execution_frequency": pro.ExecutionFrequency, "delivery_way": pro.DeliveryWay, "number_days": pro.NumberDays, "total": pro.Total, "updated_time": pro.UpdatedTime, "category": pro.Category, "specail_project": pro.SpecailProject, "social_security_directory_code": pro.SocialSecurityDirectoryCode, "record_date": pro.RecordDate, "is_print": pro.IsPrint, "bbx01": pro.Bbx01, "bby01": pro.Bby01, "zuobiao_id": pro.ZuobiaoId, "bck01b": pro.Bck01b}).Error
63 63
 	return err
64 64
 }
65 65
 
@@ -419,7 +419,7 @@ func GetHistPatient(orgid int64, keyword string) (hisPatient []*models.HisPatien
419 419
 }
420 420
 
421 421
 func GetDoctorAdvicePrint(his_patient_id int64, recorddate int64, schIDs []string, orgid int64, p_type int64) (prescription []*models.HisPrescription, err error) {
422
-	err = XTReadDB().Model(&prescription).Where("patient_id = ? and record_date = ? and id in(?) and  status = 1 and p_type = ? ", his_patient_id, recorddate, schIDs, p_type).Preload("Patients", "status = 1 and user_org_id = ?", orgid).Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
422
+	err = XTReadDB().Model(&prescription).Where("patient_id = ? and record_date = ? and id in(?) and  status = 1 and p_type = ? ", his_patient_id, recorddate, schIDs, p_type).Preload("HisPatient", "status = 1 and  user_org_id = ?", orgid).Preload("Patients", "status = 1 and user_org_id = ?", orgid).Preload("HisDoctorAdviceInfo", func(db *gorm.DB) *gorm.DB {
423 423
 		return db.Where("status = 1 and user_org_id = ?", orgid).Preload("Drug", "status = 1")
424 424
 	}).Preload("HisPrescriptionProject", func(db *gorm.DB) *gorm.DB {
425 425
 		return db.Where("status = 1 AND user_org_id = ?", orgid).Preload("HisProject").Preload("GoodInfo", "status=1").Preload("XtHisProjectTeam", "status = 1")