Browse Source

2024/6/17

28169 6 days ago
parent
commit
aa25291d41

BIN
XT_New.exe View File


+ 4 - 4
controllers/base_api_controller.go View File

@@ -83,7 +83,7 @@ func (this *BaseAuthAPIController) Prepare() {
83 83
 		userAdmin.ModifyTime = 1530786071
84 84
 		var subscibe models.ServeSubscibe
85 85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10677 //机构id
86
+		subscibe.OrgId = 10164 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,7 +93,7 @@ func (this *BaseAuthAPIController) Prepare() {
93 93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94 94
 		subscibes[4] = &subscibe
95 95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10677 //机构id小英9675或4
96
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
97 97
 		adminUserInfo.CurrentAppId = 12123 //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
@@ -329,7 +329,7 @@ func (this *BaseServeAPIController) Prepare() {
329 329
 		userAdmin.ModifyTime = 1530786071
330 330
 		var subscibe models.ServeSubscibe
331 331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10677 //机构id小英9675或4
332
+		subscibe.OrgId = 10164 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,7 +339,7 @@ func (this *BaseServeAPIController) Prepare() {
339 339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340 340
 		subscibes[4] = &subscibe
341 341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10677 //机构id小英9675或4
342
+		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
343 343
 		adminUserInfo.CurrentAppId = 12123 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes

+ 158 - 0
controllers/his_api_controller.go View File

@@ -3745,10 +3745,165 @@ func (c *HisApiController) CreateHisPrescription() {
3745 3745
 										//fmt.Println("药品名称----------------------", drug.IsUse)
3746 3746
 										//fmt.Println("is_user_total-------------------------", is_user_total)
3747 3747
 										//fmt.Println("no_user_total-------------------------", no_user_total)
3748
+										//fmt.Println("drug.IsUse---------------", drug.IsUse)
3749
+										//fmt.Println("00000000000000000000", s.UserOrgId)
3748 3750
 
3749 3751
 										if is_user_total != no_user_total {
3750 3752
 											//出库
3753
+											//针对御享天源
3754
+											if drug.IsUse == 1 && s.UserOrgId == 10635 {
3755
+
3756
+												creater := adminInfo.AdminUser.Id
3757
+												newadviceInfo := &models.HisDoctorAdviceInfo{
3758
+													ID:                    s.ID,
3759
+													UserOrgId:             s.UserOrgId,
3760
+													PatientId:             s.PatientId,
3761
+													HisPatientId:          s.HisPatientId,
3762
+													AdviceType:            s.AdviceType,
3763
+													AdviceDate:            s.AdviceDate,
3764
+													StartTime:             s.StartTime,
3765
+													AdviceName:            s.AdviceName,
3766
+													AdviceDesc:            s.AdviceDesc,
3767
+													ReminderDate:          s.ReminderDate,
3768
+													SingleDose:            s.SingleDose,
3769
+													SingleDoseUnit:        s.SingleDoseUnit,
3770
+													PrescribingNumber:     s.PrescribingNumber,
3771
+													PrescribingNumberUnit: s.PrescribingNumberUnit,
3772
+													DeliveryWay:           s.DeliveryWay,
3773
+													ExecutionFrequency:    s.ExecutionFrequency,
3774
+													AdviceDoctor:          s.AdviceDoctor,
3775
+													Status:                s.Status,
3776
+													CreatedTime:           s.CreatedTime,
3777
+													UpdatedTime:           s.UpdatedTime,
3778
+													AdviceAffirm:          s.AdviceAffirm,
3779
+													Remark:                s.Remark,
3780
+													StopTime:              s.StopTime,
3781
+													StopReason:            s.StopReason,
3782
+													StopDoctor:            s.StopDoctor,
3783
+													StopState:             s.StopState,
3784
+													ParentId:              s.ParentId,
3785
+													ExecutionTime:         s.ExecutionTime,
3786
+													ExecutionStaff:        s.ExecutionStaff,
3787
+													ExecutionState:        s.ExecutionState,
3788
+													Checker:               s.Checker,
3789
+													RecordDate:            s.RecordDate,
3790
+													DialysisOrderId:       s.DialysisOrderId,
3791
+													CheckTime:             s.CheckTime,
3792
+													CheckState:            s.CheckState,
3793
+													DrugSpec:              s.DrugSpec,
3794
+													DrugSpecUnit:          s.DrugSpecUnit,
3795
+													Groupno:               s.Groupno,
3796
+													RemindType:            s.RemindType,
3797
+													FrequencyType:         s.FrequencyType,
3798
+													DayCount:              s.DayCount,
3799
+													WeekDay:               s.WeekDay,
3800
+													TemplateId:            s.TemplateId,
3801
+													Modifier:              s.Modifier,
3802
+													DrugId:                s.DrugId,
3803
+													Price:                 s.Price,
3804
+													PrescriptionId:        s.PrescriptionId,
3805
+													MedListCodg:           s.MedListCodg,
3806
+													FeedetlSn:             s.FeedetlSn,
3807
+													Day:                   s.DayCount,
3808
+													ChildDoctorAdvice:     nil,
3809
+													Drug:                  models.Drug{},
3810
+													Diagnosis:             s.Diagnosis,
3811
+													Way:                   s.Way,
3812
+													HospApprFlag:          s.HospApprFlag,
3813
+													LmtUsedFlag:           s.LmtUsedFlag,
3814
+													HisOrderInfo:          models.HisOrderInfo{},
3815
+													IsMedicine:            s.IsMedicine,
3816
+													ExecutionFrequencyId:  s.ExecutionFrequencyId,
3817
+													Child:                 nil,
3818
+													IsSettle:              s.IsSettle,
3819
+													IsMobile:              s.IsMobile,
3820
+													IsSelfDrug:            s.IsSelfDrug,
3821
+													DrugWayCount:          s.DrugWayCount,
3822
+												}
3823
+
3824
+												var history_count int64
3825
+												var local_count int64
3826
+												//查找已经开过的医嘱信息
3827
+												adviceHistory, _ := service.GetHistory(s.ID, s.UserOrgId, tx)
3828
+
3829
+												if s.PrescribingNumberUnit == drug.MaxUnit && drug.MaxUnit != drug.MinUnit {
3830
+
3831
+													prescribingNumberTenty := strconv.FormatFloat(s.PrescribingNumber, 'f', -1, 64)
3832
+													prescribingNumberSevenTy, _ := strconv.ParseInt(prescribingNumberTenty, 10, 64)
3833
+
3834
+													local_count += prescribingNumberSevenTy * drug.MinNumber
3835
+												}
3836
+
3837
+												if s.PrescribingNumberUnit == drug.MinUnit && drug.MaxUnit != drug.MinUnit {
3838
+
3839
+													prescribingNumberTenty := strconv.FormatFloat(s.PrescribingNumber, 'f', -1, 64)
3840
+													prescribingNumberSevenTy, _ := strconv.ParseInt(prescribingNumberTenty, 10, 64)
3841
+													local_count += prescribingNumberSevenTy
3842
+												}
3843
+
3844
+												if s.PrescribingNumberUnit == drug.MaxUnit && drug.MaxUnit == drug.MinUnit {
3845
+
3846
+													prescribingNumberTenty := strconv.FormatFloat(s.PrescribingNumber, 'f', -1, 64)
3847
+													prescribingNumberSevenTy, _ := strconv.ParseInt(prescribingNumberTenty, 10, 64)
3848
+													local_count += prescribingNumberSevenTy
3849
+												}
3850
+
3851
+												if adviceHistory.PrescribingNumberUnit == drug.MaxUnit && drug.MaxUnit != drug.MinUnit {
3852
+
3853
+													prescribingNumberTenty := strconv.FormatFloat(adviceHistory.PrescribingNumber, 'f', -1, 64)
3854
+													prescribingNumberSevenTy, _ := strconv.ParseInt(prescribingNumberTenty, 10, 64)
3855
+
3856
+													history_count += prescribingNumberSevenTy * drug.MinNumber
3857
+												}
3858
+
3859
+												if adviceHistory.PrescribingNumberUnit == drug.MinUnit && drug.MaxUnit != drug.MinUnit {
3860
+
3861
+													prescribingNumberTenty := strconv.FormatFloat(adviceHistory.PrescribingNumber, 'f', -1, 64)
3862
+													prescribingNumberSevenTy, _ := strconv.ParseInt(prescribingNumberTenty, 10, 64)
3863
+													history_count += prescribingNumberSevenTy
3864
+												}
3865
+
3866
+												if adviceHistory.PrescribingNumberUnit == drug.MaxUnit && drug.MaxUnit == drug.MinUnit {
3867
+
3868
+													prescribingNumberTenty := strconv.FormatFloat(adviceHistory.PrescribingNumber, 'f', -1, 64)
3869
+													prescribingNumberSevenTy, _ := strconv.ParseInt(prescribingNumberTenty, 10, 64)
3870
+													history_count += prescribingNumberSevenTy
3871
+												}
3872
+
3873
+												fmt.Println("local_count---------------", local_count)
3874
+												fmt.Println("history_count---------------", history_count)
3875
+
3876
+												//如果当前出库数量大于历史出库数量则需要出库
3877
+												if local_count > history_count {
3878
+													//按最小单位出库
3879
+													var cha_count = local_count - history_count
3880
+
3881
+													newadviceInfo.PrescribingNumber = float64(cha_count)
3882
+													newadviceInfo.PrescribingNumberUnit = drug.MinUnit
3883
+
3884
+													service.NewHisDrugsDelivery(s.UserOrgId, creater, newadviceInfo, tx)
3885
+												}
3886
+
3887
+												//如果当前出库数量小于历史出库数量则需要退库
3888
+												if local_count < history_count {
3889
+
3890
+													var cha_count = history_count - local_count
3891
+
3892
+													service.NewHisDrugCancelInfo(s.UserOrgId, creater, newadviceInfo, cha_count, drug, tx)
3893
+
3894
+													service.NewHisDrugAutoCancelInfo(s.UserOrgId, creater, newadviceInfo, cha_count, drug, tx)
3895
+												}
3896
+
3897
+												if local_count == history_count {
3898
+													if is_user_total == 0 {
3899
+														service.NewHisDrugsDelivery(s.UserOrgId, creater, newadviceInfo, tx)
3900
+													}
3901
+
3902
+												}
3903
+											}
3904
+
3751 3905
 											if drug.IsUse == 2 {
3906
+
3752 3907
 												creater := adminInfo.AdminUser.Id
3753 3908
 												newadviceInfo := &models.HisDoctorAdviceInfo{
3754 3909
 													ID:                    s.ID,
@@ -3866,6 +4021,9 @@ func (c *HisApiController) CreateHisPrescription() {
3866 4021
 													history_count += prescribingNumberSevenTy
3867 4022
 												}
3868 4023
 
4024
+												fmt.Println("local_count---------------", local_count)
4025
+												fmt.Println("history_count---------------", history_count)
4026
+
3869 4027
 												//如果当前出库数量大于历史出库数量则需要出库
3870 4028
 												if local_count > history_count {
3871 4029
 													//按最小单位出库

+ 7 - 0
controllers/patient_api_controller.go View File

@@ -595,6 +595,7 @@ func (c *PatientApiController) CreatePatient() {
595 595
 		PatientAddress:               patient.PatientAddress,
596 596
 		PrintDate:                    patient.PrintDate,
597 597
 		FamalityRecord:               patient.FamalityRecord,
598
+		OrgLogo:                      patient.OrgLogo,
598 599
 	}
599 600
 	patientsNew.FirstLetter = firstLetter
600 601
 
@@ -837,6 +838,7 @@ func (c *PatientApiController) EditPatient() {
837 838
 		PatientAddress:            patient.PatientAddress,
838 839
 		PrintDate:                 patient.PrintDate,
839 840
 		FamalityRecord:            patient.FamalityRecord,
841
+		OrgLogo:                   patient.OrgLogo,
840 842
 	}
841 843
 	//	//更新病人ID获取新表病人ID
842 844
 	err = service.UpdatepatientTwo(&patientsNew, id)
@@ -6148,6 +6150,11 @@ func patientFormData(patient *models.Patients, data []byte, method string) (cont
6148 6150
 		patient_type := int64(patientBody["patient_type"].(float64))
6149 6151
 		patient.PatientType = patient_type
6150 6152
 	}
6153
+
6154
+	if patientBody["org_logo"] != nil && reflect.TypeOf(patientBody["org_logo"]).String() == "string" {
6155
+		org_logo := patientBody["org_logo"].(string)
6156
+		patient.OrgLogo = org_logo
6157
+	}
6151 6158
 	return
6152 6159
 
6153 6160
 }

+ 1 - 0
controllers/stock_in_api_controller.go View File

@@ -7548,6 +7548,7 @@ func (this *StockManagerApiController) CheckWarehouseInfo() {
7548 7548
 			"list": "list",
7549 7549
 		})
7550 7550
 	}
7551
+	return
7551 7552
 }
7552 7553
 
7553 7554
 func (this *StockManagerApiController) ReturnCheckWarehouseInfo() {

+ 2 - 0
models/patient_models.go View File

@@ -235,6 +235,7 @@ type Patients struct {
235 235
 	PrintDate                int64   `gorm:"column:print_date" json:"print_date" form:"print_date"`
236 236
 	FamalityRecord           string  `gorm:"column:famality_record" json:"famality_record" form:"famality_record"`
237 237
 	InsuplcAdmdvs            string  `gorm:"column:insuplc_admdvs" json:"insuplc_admdvs" form:"insuplc_admdvs"`
238
+	OrgLogo                  string  `gorm:"column:org_logo" json:"org_logo" form:"org_logo"`
238 239
 }
239 240
 
240 241
 func (Patients) TableName() string {
@@ -877,6 +878,7 @@ type XtPatientsNew struct {
877 878
 	FirstLetter                  string  `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
878 879
 	PrintDate                    int64   `gorm:"column:print_date" json:"print_date" form:"print_date"`
879 880
 	FamalityRecord               string  `gorm:"column:famality_record" json:"famality_record" form:"famality_record"`
881
+	OrgLogo                      string  `gorm:"column:org_logo" json:"org_logo" form:"org_logo"`
880 882
 }
881 883
 
882 884
 func (XtPatientsNew) TableName() string {

+ 3 - 6
service/new_stock_service.go View File

@@ -22,18 +22,14 @@ func GetGoodStockCount(user_org_id int64, storehouse_id int64, good_id int64) (*
22 22
 func GetNewGoodStockCount(user_org_id int64, storehouse_id int64, good_id int64, tx *gorm.DB) (*models.XtGoodStockCount, error) {
23 23
 
24 24
 	goodStock := models.XtGoodStockCount{}
25
-	var err error
26
-	err = tx.Where("user_org_id = ? and storehouse_id = ? and good_id = ?", user_org_id, storehouse_id, good_id).Find(&goodStock).Error
27
-	if err == gorm.ErrRecordNotFound {
25
+	err := tx.Where("user_org_id = ? and storehouse_id = ? and good_id = ?", user_org_id, storehouse_id, good_id).Find(&goodStock).Error
26
+	if err != gorm.ErrRecordNotFound {
28 27
 		if err != nil {
29 28
 			tx.Rollback()
30 29
 			return nil, err
31 30
 		}
32 31
 
33 32
 	}
34
-	if err != nil {
35
-		return nil, err
36
-	}
37 33
 	return &goodStock, nil
38 34
 }
39 35
 
@@ -177,6 +173,7 @@ func GetNewSumGoodList(orgid int64, storehouse_id int64, good_id int64, tx *gorm
177 173
 	err = tx.Where("org_id = ? and storehouse_id = ? and good_id = ? and status =1  and is_check = 1", orgid, storehouse_id, good_id).Find(&info).Error
178 174
 	if err != gorm.ErrRecordNotFound {
179 175
 		if err != nil {
176
+			tx.Rollback()
180 177
 			return info, err
181 178
 		}
182 179
 	}

+ 2 - 2
service/patient_service.go View File

@@ -956,8 +956,8 @@ func UpdatePatientLapseto(patientid int64, lapseto models.PatientLapseto) error
956 956
 
957 957
 func UpdatepatientTwo(patientsNew *models.XtPatientsNew, id int64) error {
958 958
 
959
-	err := XTWriteDB().Model(&patientsNew).Where("blood_id = ?", id).Update(map[string]interface{}{"user_org_id": patientsNew.UserOrgId, "user_id": patientsNew.UserId, "avatar": patientsNew.Avatar, "patient_type": patientsNew.Avatar, "dialysis_no": patientsNew.DialysisNo, "admission_number": patientsNew.AdmissionNumber, "source": patientsNew.Source, "lapseto": patientsNew.Lapseto, "partition_id": patientsNew.PartitionId, "bed_id": patientsNew.BedId, "name": patientsNew.Name, "alias": patientsNew.Alias, "gender": patientsNew.Gender, "marital_status": patientsNew.MaritalStatus, "id_card_no": patientsNew.IdCardNo, "birthday": patientsNew.Birthday, "reimbursement_way_id": patientsNew.ReimbursementWayId, "health_care_type": patientsNew.HealthCareType, "health_care_no": patientsNew.HealthCareType, "health_care_due_date": patientsNew.HealthCareType, "height": patientsNew.Height, "blood_type": patientsNew.BloodType, "rh": patientsNew.Rh, "health_care_due_alert_date": patientsNew.HealthCareDueAlertDate, "education_level": patientsNew.EducationLevel, "profession": patientsNew.Profession, "phone": patientsNew.Phone, "home_telephone": patientsNew.HomeTelephone, "relative_phone": patientsNew.RelativePhone, "relative_relations": patientsNew.RelativeRelations, "home_address": patientsNew.HomeAddress, "work_unit": patientsNew.WorkUnit, "unit_address": patientsNew.UnitAddress, "children": patientsNew.Children, "receiving_date": patientsNew.ReceivingDate, "is_hospital_first_dialysis": patientsNew.IsHospitalFirstDialysis, "first_dialysis_date": patientsNew.FirstDialysisDate, "first_dialysis_hospital": patientsNew.FirstDialysisHospital, "predialysis_condition": patientsNew.PredialysisCondition, "pre_hospital_dialysis_frequency": patientsNew.PreHospitalDialysisFrequency, "pre_hospital_dialysis_times": patientsNew.PreHospitalDialysisFrequency, "hospital_first_dialysis_date": patientsNew.HospitalFirstDialysisDate, "induction_period": patientsNew.InductionPeriod, "initial_dialysis": patientsNew.InitialDialysis, "total_dialysis": patientsNew.TotalDialysis, "attending_doctor_id": patientsNew.AttendingDoctorId, "head_nurse_id": patientsNew.HeadNurseId, "evaluate": patientsNew.Evaluate, "diagnose": patientsNew.Diagnose, "remark": patientsNew.Remark, "registrars_id": patientsNew.RegistrarsId, "registrars": patientsNew.Registrars, "qr_code": patientsNew.QrCode, "binding_state": patientsNew.BindingState, "patient_complains": patientsNew.PatientComplains, "present_history": patientsNew.PresentHistory, "past_history": patientsNew.PastHistory, "temperature": patientsNew.Temperature,
960
-		"pulse": patientsNew.Pulse, "respiratory": patientsNew.Respiratory, "sbp": patientsNew.Sbp, "dbp": patientsNew.Dbp, "nation": patientsNew.Nation, "native_place": patientsNew.NativePlace, "age": patientsNew.Age, "infectious_next_record_time": patientsNew.InfectiousNextRecordTime, "is_infectious": patientsNew.IsInfectious, "remind_cycle": patientsNew.RemindCycle, "response_result": patientsNew.ResponseResult, "is_open_remind": patientsNew.IsOpenRemind, "first_treatment_date": patientsNew.FirstTreatmentDate, "dialysis_age": patientsNew.DialysisAge, "expense_kind": patientsNew.ExpenseKind, "tell_phone": patientsNew.ExpenseKind, "contact_name": patientsNew.ContactName, "blood_patients": patientsNew.BloodPatients, "slow_patients": patientsNew.SlowPatients, "member_patients": patientsNew.MemberPatients, "ecommer_patients": patientsNew.EcommerPatients, "troble_shoot": patientsNew.TrobleShoot, "sch_remark": patientsNew.SchRemark, "treatment_plan": patientsNew.TreatmentPlan, "record_number": patientsNew.RecordNumber, "patient_start_time": patientsNew.PatientStartTime, "patient_end_time": patientsNew.PatientEndTime, "infectious_remark": patientsNew.InfectiousRemark, "allergic_history": patientsNew.AllergicHistory, "patient_address": patientsNew.PatientAddress, "print_date": patientsNew.PrintDate, "patient_type:": patientsNew.PatientType}).Error
959
+	err := XTWriteDB().Model(&patientsNew).Where("blood_id = ?", id).Update(map[string]interface{}{"user_org_id": patientsNew.UserOrgId, "user_id": patientsNew.UserId, "avatar": patientsNew.Avatar, "dialysis_no": patientsNew.DialysisNo, "admission_number": patientsNew.AdmissionNumber, "source": patientsNew.Source, "lapseto": patientsNew.Lapseto, "partition_id": patientsNew.PartitionId, "bed_id": patientsNew.BedId, "name": patientsNew.Name, "alias": patientsNew.Alias, "gender": patientsNew.Gender, "marital_status": patientsNew.MaritalStatus, "id_card_no": patientsNew.IdCardNo, "birthday": patientsNew.Birthday, "reimbursement_way_id": patientsNew.ReimbursementWayId, "health_care_type": patientsNew.HealthCareType, "health_care_no": patientsNew.HealthCareType, "health_care_due_date": patientsNew.HealthCareType, "height": patientsNew.Height, "blood_type": patientsNew.BloodType, "rh": patientsNew.Rh, "health_care_due_alert_date": patientsNew.HealthCareDueAlertDate, "education_level": patientsNew.EducationLevel, "profession": patientsNew.Profession, "phone": patientsNew.Phone, "home_telephone": patientsNew.HomeTelephone, "relative_phone": patientsNew.RelativePhone, "relative_relations": patientsNew.RelativeRelations, "home_address": patientsNew.HomeAddress, "work_unit": patientsNew.WorkUnit, "unit_address": patientsNew.UnitAddress, "children": patientsNew.Children, "receiving_date": patientsNew.ReceivingDate, "is_hospital_first_dialysis": patientsNew.IsHospitalFirstDialysis, "first_dialysis_date": patientsNew.FirstDialysisDate, "first_dialysis_hospital": patientsNew.FirstDialysisHospital, "predialysis_condition": patientsNew.PredialysisCondition, "pre_hospital_dialysis_frequency": patientsNew.PreHospitalDialysisFrequency, "pre_hospital_dialysis_times": patientsNew.PreHospitalDialysisFrequency, "hospital_first_dialysis_date": patientsNew.HospitalFirstDialysisDate, "induction_period": patientsNew.InductionPeriod, "initial_dialysis": patientsNew.InitialDialysis, "total_dialysis": patientsNew.TotalDialysis, "attending_doctor_id": patientsNew.AttendingDoctorId, "head_nurse_id": patientsNew.HeadNurseId, "evaluate": patientsNew.Evaluate, "diagnose": patientsNew.Diagnose, "remark": patientsNew.Remark, "registrars_id": patientsNew.RegistrarsId, "registrars": patientsNew.Registrars, "qr_code": patientsNew.QrCode, "binding_state": patientsNew.BindingState, "patient_complains": patientsNew.PatientComplains, "present_history": patientsNew.PresentHistory, "past_history": patientsNew.PastHistory, "temperature": patientsNew.Temperature,
960
+		"pulse": patientsNew.Pulse, "respiratory": patientsNew.Respiratory, "sbp": patientsNew.Sbp, "dbp": patientsNew.Dbp, "nation": patientsNew.Nation, "native_place": patientsNew.NativePlace, "age": patientsNew.Age, "infectious_next_record_time": patientsNew.InfectiousNextRecordTime, "is_infectious": patientsNew.IsInfectious, "remind_cycle": patientsNew.RemindCycle, "response_result": patientsNew.ResponseResult, "is_open_remind": patientsNew.IsOpenRemind, "first_treatment_date": patientsNew.FirstTreatmentDate, "dialysis_age": patientsNew.DialysisAge, "expense_kind": patientsNew.ExpenseKind, "tell_phone": patientsNew.ExpenseKind, "contact_name": patientsNew.ContactName, "blood_patients": patientsNew.BloodPatients, "slow_patients": patientsNew.SlowPatients, "member_patients": patientsNew.MemberPatients, "ecommer_patients": patientsNew.EcommerPatients, "troble_shoot": patientsNew.TrobleShoot, "sch_remark": patientsNew.SchRemark, "treatment_plan": patientsNew.TreatmentPlan, "record_number": patientsNew.RecordNumber, "patient_start_time": patientsNew.PatientStartTime, "patient_end_time": patientsNew.PatientEndTime, "infectious_remark": patientsNew.InfectiousRemark, "allergic_history": patientsNew.AllergicHistory, "patient_address": patientsNew.PatientAddress, "print_date": patientsNew.PrintDate, "org_logo": patientsNew.OrgLogo, "patient_type": patientsNew.PatientType}).Error
961 961
 	return err
962 962
 }
963 963
 

+ 4 - 0
service/stock_service.go View File

@@ -9331,6 +9331,10 @@ func UpdateGoodInfoAddSumCount(goodid int64, sum_count int64, orgid int64, sum_i
9331 9331
 func UpdateNewGoodInfoAddSumCount(goodid int64, sum_count int64, orgid int64, sum_in_count int64, tx *gorm.DB) error {
9332 9332
 
9333 9333
 	err := tx.Model(&models.GoodInfo{}).Where("id = ? and org_id = ? and status = 1", goodid, orgid).Update(map[string]interface{}{"sum_count": sum_count}).Error
9334
+	if err != nil {
9335
+		tx.Rollback()
9336
+		return err
9337
+	}
9334 9338
 
9335 9339
 	err = tx.Model(&models.GoodInfo{}).Where("id = ? and org_id = ? and status = 1", goodid, orgid).Update(map[string]interface{}{"sum_in_count": sum_in_count}).Error
9336 9340
 

+ 1 - 0
service/warhouse_service.go View File

@@ -2171,6 +2171,7 @@ func GetNewWarehouseById(id int64, tx *gorm.DB) (models.WarehouseOut, error) {
2171 2171
 	err := tx.Where("id=? and status = 1", id).Find(&out).Error
2172 2172
 	if err != gorm.ErrRecordNotFound {
2173 2173
 		if err != nil {
2174
+			tx.Rollback()
2174 2175
 			return out, err
2175 2176
 		}
2176 2177
 	}