28169 3 周前
父节点
当前提交
496d1a6937

二进制
XT_New.exe 查看文件


+ 2 - 2
controllers/base_api_controller.go 查看文件

94
 		subscibes[4] = &subscibe
94
 		subscibes[4] = &subscibe
95
 		var adminUserInfo service.AdminUserInfo
95
 		var adminUserInfo service.AdminUserInfo
96
 		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
96
 		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
97
-		adminUserInfo.CurrentAppId = 12123 //4
97
+		adminUserInfo.CurrentAppId = 17733 //4
98
 		adminUserInfo.AdminUser = &userAdmin
98
 		adminUserInfo.AdminUser = &userAdmin
99
 		adminUserInfo.Subscibes = subscibes
99
 		adminUserInfo.Subscibes = subscibes
100
 		this.SetSession("admin_user_info", &adminUserInfo)
100
 		this.SetSession("admin_user_info", &adminUserInfo)
340
 		subscibes[4] = &subscibe
340
 		subscibes[4] = &subscibe
341
 		var adminUserInfo service.AdminUserInfo
341
 		var adminUserInfo service.AdminUserInfo
342
 		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
342
 		adminUserInfo.CurrentOrgId = 10164 //机构id小英9675或4
343
-		adminUserInfo.CurrentAppId = 12123 //4
343
+		adminUserInfo.CurrentAppId = 17733 //4
344
 		adminUserInfo.AdminUser = &userAdmin
344
 		adminUserInfo.AdminUser = &userAdmin
345
 		adminUserInfo.Subscibes = subscibes
345
 		adminUserInfo.Subscibes = subscibes
346
 		this.SetSession("admin_user_info", &adminUserInfo)
346
 		this.SetSession("admin_user_info", &adminUserInfo)

+ 12 - 0
controllers/manage_api_controller.go 查看文件

255
 	home_address := dataBody["home_address"].(string)
255
 	home_address := dataBody["home_address"].(string)
256
 
256
 
257
 	home_setting := dataBody["home_setting"].(string)
257
 	home_setting := dataBody["home_setting"].(string)
258
+
259
+	home_type := dataBody["home_type"].(string)
260
+
261
+	home_big_type := dataBody["home_big_type"].(string)
262
+
258
 	ids := make([]int64, 0)
263
 	ids := make([]int64, 0)
259
 	for _, treat := range treat_types {
264
 	for _, treat := range treat_types {
260
 		id := int64(treat.(float64))
265
 		id := int64(treat.(float64))
300
 		UserOrgId:           orgid,
305
 		UserOrgId:           orgid,
301
 		HomeAddress:         home_address,
306
 		HomeAddress:         home_address,
302
 		HomeSetting:         home_setting,
307
 		HomeSetting:         home_setting,
308
+		HomeType:            home_type,
309
+		HomeBigType:         home_big_type,
303
 	}
310
 	}
304
 	err = service.CreateMacher(addmacher)
311
 	err = service.CreateMacher(addmacher)
305
 	if err != nil {
312
 	if err != nil {
382
 	treat_types := dataBody["treat_type"].([]interface{})
389
 	treat_types := dataBody["treat_type"].([]interface{})
383
 	home_address := dataBody["home_address"].(string)
390
 	home_address := dataBody["home_address"].(string)
384
 	home_setting := dataBody["home_setting"].(string)
391
 	home_setting := dataBody["home_setting"].(string)
392
+	home_type := dataBody["home_type"].(string)
393
+
394
+	home_big_type := dataBody["home_big_type"].(string)
385
 	ids := make([]int64, 0)
395
 	ids := make([]int64, 0)
386
 	for _, treat := range treat_types {
396
 	for _, treat := range treat_types {
387
 		id := int64(treat.(float64))
397
 		id := int64(treat.(float64))
421
 		ZoneId:              zone_id,
431
 		ZoneId:              zone_id,
422
 		HomeAddress:         home_address,
432
 		HomeAddress:         home_address,
423
 		HomeSetting:         home_setting,
433
 		HomeSetting:         home_setting,
434
+		HomeType:            home_type,
435
+		HomeBigType:         home_big_type,
424
 	}
436
 	}
425
 	err = service.UpdateMachine(id, orgid, &addmacher)
437
 	err = service.UpdateMachine(id, orgid, &addmacher)
426
 	errors := service.UpdateTreatMode(id, orgid, ids)
438
 	errors := service.UpdateTreatMode(id, orgid, ids)

+ 9 - 9
controllers/mobile_api_controllers/patient_api_controller.go 查看文件

1696
 
1696
 
1697
 							if medical.IsUse != 1 {
1697
 							if medical.IsUse != 1 {
1698
 								if (list.Count*medical.MinNumber + list.StockMinNumber) == 0 {
1698
 								if (list.Count*medical.MinNumber + list.StockMinNumber) == 0 {
1699
-									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 && advice.UserOrgId != 10724 && advice.UserOrgId != 10571 && advice.UserOrgId != 10731 {
1699
+									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 && advice.UserOrgId != 10724 && advice.UserOrgId != 10571 && advice.UserOrgId != 10731 && advice.UserOrgId != 10610 {
1700
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1700
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1701
 										advice.ExecutionTime = 0
1701
 										advice.ExecutionTime = 0
1702
 										advice.ExecutionState = 2
1702
 										advice.ExecutionState = 2
1712
 
1712
 
1713
 								}
1713
 								}
1714
 								if prescribing_number_total > total {
1714
 								if prescribing_number_total > total {
1715
-									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 && advice.UserOrgId != 10724 && advice.UserOrgId != 10571 && advice.UserOrgId != 10731 {
1715
+									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 && advice.UserOrgId != 10724 && advice.UserOrgId != 10571 && advice.UserOrgId != 10731 && advice.UserOrgId != 10610 {
1716
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1716
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1717
 										advice.ExecutionTime = 0
1717
 										advice.ExecutionTime = 0
1718
 										advice.ExecutionState = 2
1718
 										advice.ExecutionState = 2
1739
 											//查询今日是否出库
1739
 											//查询今日是否出库
1740
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1740
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1741
 											if drugOutInfo.ID == 0 {
1741
 											if drugOutInfo.ID == 0 {
1742
-												if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1742
+												if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1743
 													service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1743
 													service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1744
 												}
1744
 												}
1745
 
1745
 
1749
 										if pharmacyConfig.IsOpen != 1 {
1749
 										if pharmacyConfig.IsOpen != 1 {
1750
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1750
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1751
 											if drugOutInfo.ID == 0 {
1751
 											if drugOutInfo.ID == 0 {
1752
-												if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1752
+												if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1753
 													service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1753
 													service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1754
 												}
1754
 												}
1755
 
1755
 
1776
 									if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
1776
 									if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
1777
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1777
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1778
 										if drugOutInfo.ID == 0 {
1778
 										if drugOutInfo.ID == 0 {
1779
-											if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1779
+											if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1780
 												service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1780
 												service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1781
 											}
1781
 											}
1782
 
1782
 
1800
 										service.CreateDrugError(drugError)
1800
 										service.CreateDrugError(drugError)
1801
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1801
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1802
 										if drugOutInfo.ID == 0 {
1802
 										if drugOutInfo.ID == 0 {
1803
-											if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1803
+											if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1804
 												service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1804
 												service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1805
 											}
1805
 											}
1806
 
1806
 
1893
 									return
1893
 									return
1894
 								}
1894
 								}
1895
 								if prescribing_number_total > total {
1895
 								if prescribing_number_total > total {
1896
-									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1896
+									if advice.UserOrgId != 10278 && advice.UserOrgId != 10697 && advice.UserOrgId != 10635 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1897
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1897
 										service.UpdateDoctorAdviceByExcecute(advice.ID, advice.UserOrgId)
1898
 										advice.ExecutionTime = 0
1898
 										advice.ExecutionTime = 0
1899
 										advice.ExecutionState = 2
1899
 										advice.ExecutionState = 2
1912
 									//查询今日是否出库
1912
 									//查询今日是否出库
1913
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1913
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1914
 									if drugOutInfo.ID == 0 {
1914
 									if drugOutInfo.ID == 0 {
1915
-										if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1915
+										if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1916
 											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1916
 											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1917
 										}
1917
 										}
1918
 
1918
 
1922
 									//查询今日是否出库
1922
 									//查询今日是否出库
1923
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1923
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1924
 									if drugOutInfo.ID == 0 {
1924
 									if drugOutInfo.ID == 0 {
1925
-										if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 {
1925
+										if item.UserOrgId != 10644 && item.UserOrgId != 10721 && item.UserOrgId != 10138 && item.UserOrgId != 10278 && item.UserOrgId != 10724 && item.UserOrgId != 10571 && item.UserOrgId != 10731 && item.UserOrgId != 10610 {
1926
 											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1926
 											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1927
 										}
1927
 										}
1928
 
1928
 

+ 11 - 5
controllers/patient_api_controller.go 查看文件

9146
 
9146
 
9147
 	inspection, _ := service.GetNewInspectionByProjectId(patient_id, project_id, inspect_date, orgId)
9147
 	inspection, _ := service.GetNewInspectionByProjectId(patient_id, project_id, inspect_date, orgId)
9148
 
9148
 
9149
+	referenceList, _ := service.GetNewInspectionRefence(orgId, project_id)
9150
+
9149
 	this.ServeSuccessJSON(map[string]interface{}{
9151
 	this.ServeSuccessJSON(map[string]interface{}{
9150
-		"inspection": inspection,
9152
+		"inspection":    inspection,
9153
+		"referenceList": referenceList,
9151
 	})
9154
 	})
9152
 }
9155
 }
9153
 
9156
 
9353
 
9356
 
9354
 	id, _ := this.GetInt64("id")
9357
 	id, _ := this.GetInt64("id")
9355
 
9358
 
9359
+	patient_id, _ := this.GetInt64("patient_id")
9360
+
9356
 	db := service.XTWriteDB()
9361
 	db := service.XTWriteDB()
9357
 	// 开始外部循环的事务
9362
 	// 开始外部循环的事务
9358
 	tx := db.Begin()
9363
 	tx := db.Begin()
9371
 	warehouseInfo, _ := service.GetPatientCountById(id, tx)
9376
 	warehouseInfo, _ := service.GetPatientCountById(id, tx)
9372
 
9377
 
9373
 	if warehouseInfo.ID > 0 {
9378
 	if warehouseInfo.ID > 0 {
9374
-		service.ModiftyPatientCount(warehouseInfo.Count, warehouseInfo.IsType, warehouseInfo.PatientId, tx)
9375
-		patient, _ := service.GetSfPatientById(tx, warehouseInfo.PatientId)
9379
+
9380
+		service.ModiftyPatientCount(warehouseInfo.Count, warehouseInfo.IsType, patient_id, tx)
9381
+		patient, _ := service.GetSfPatientById(tx, patient_id)
9376
 
9382
 
9377
 		var over_count int64
9383
 		var over_count int64
9378
 		if warehouseInfo.IsType == 1 {
9384
 		if warehouseInfo.IsType == 1 {
9396
 			Count:           warehouseInfo.Count,
9402
 			Count:           warehouseInfo.Count,
9397
 			ModeId:          warehouseInfo.IsType,
9403
 			ModeId:          warehouseInfo.IsType,
9398
 			IsType:          1,
9404
 			IsType:          1,
9399
-			PatientId:       warehouseInfo.PatientId,
9405
+			PatientId:       patient_id,
9400
 			Status:          1,
9406
 			Status:          1,
9401
 			Ctime:           time.Now().Unix(),
9407
 			Ctime:           time.Now().Unix(),
9402
 			Mtime:           time.Now().Unix(),
9408
 			Mtime:           time.Now().Unix(),
9409
 	}
9415
 	}
9410
 
9416
 
9411
 	checkpatientcount, _ := service.CheckPatientCount(id, tx)
9417
 	checkpatientcount, _ := service.CheckPatientCount(id, tx)
9412
-
9418
+	fmt.Println("checkpatientcount----------------", checkpatientcount)
9413
 	tx.Commit()
9419
 	tx.Commit()
9414
 
9420
 
9415
 	this.ServeSuccessJSON(map[string]interface{}{
9421
 	this.ServeSuccessJSON(map[string]interface{}{

+ 1 - 1
controllers/stock_in_api_controller.go 查看文件

8217
 	//	service.UpdateDealerManufacturerOne(item.ID, manufacturer.ManufacturerName)
8217
 	//	service.UpdateDealerManufacturerOne(item.ID, manufacturer.ManufacturerName)
8218
 	//}
8218
 	//}
8219
 
8219
 
8220
-	drugList, _ := service.GetAllBaseDrugListTwentyOne(10726)
8220
+	drugList, _ := service.GetAllBaseDrugListTwentyOne(10265)
8221
 
8221
 
8222
 	for _, item := range drugList {
8222
 	for _, item := range drugList {
8223
 		var drug_spec = item.Dose + item.DoseUnit + "*" + strconv.FormatInt(item.MinNumber, 10) + item.MinUnit + "/" + item.MaxUnit
8223
 		var drug_spec = item.Dose + item.DoseUnit + "*" + strconv.FormatInt(item.MinNumber, 10) + item.MinUnit + "/" + item.MaxUnit

+ 4 - 0
models/device_models.go 查看文件

317
 	EquimentId          int64  `gorm:"column:equiment_id" json:"equiment_id" form:"equiment_id"`
317
 	EquimentId          int64  `gorm:"column:equiment_id" json:"equiment_id" form:"equiment_id"`
318
 	HomeAddress         string `gorm:"column:home_address" json:"home_address" form:"home_address"`
318
 	HomeAddress         string `gorm:"column:home_address" json:"home_address" form:"home_address"`
319
 	HomeSetting         string `gorm:"column:home_setting" json:"home_setting" form:"home_setting"`
319
 	HomeSetting         string `gorm:"column:home_setting" json:"home_setting" form:"home_setting"`
320
+	HomeType            string `gorm:"column:home_type" json:"home_type" form:"home_type"`
321
+	HomeBigType         string `gorm:"column:home_big_type" json:"home_big_type" form:"home_big_type"`
320
 }
322
 }
321
 
323
 
322
 type DeviceAddmacher struct {
324
 type DeviceAddmacher struct {
353
 	BedId               int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
355
 	BedId               int64  `gorm:"column:bed_id" json:"bed_id" form:"bed_id"`
354
 	HomeAddress         string `gorm:"column:home_address" json:"home_address" form:"home_address"`
356
 	HomeAddress         string `gorm:"column:home_address" json:"home_address" form:"home_address"`
355
 	HomeSetting         string `gorm:"column:home_setting" json:"home_setting" form:"home_setting"`
357
 	HomeSetting         string `gorm:"column:home_setting" json:"home_setting" form:"home_setting"`
358
+	HomeType            string `gorm:"column:home_type" json:"home_type" form:"home_type"`
359
+	HomeBigType         string `gorm:"column:home_big_type" json:"home_big_type" form:"home_big_type"`
356
 }
360
 }
357
 
361
 
358
 func (DeviceAddmacher) TableName() string {
362
 func (DeviceAddmacher) TableName() string {

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

725
 	db := readUserDb.Table("xt_device_addmacher as a").Where("a.status =1")
725
 	db := readUserDb.Table("xt_device_addmacher as a").Where("a.status =1")
726
 	d := readUserDb.Table("xt_device_mode as d")
726
 	d := readUserDb.Table("xt_device_mode as d")
727
 	fmt.Print("d", d)
727
 	fmt.Print("d", d)
728
-	err := db.Select("a.id,a.serial_number,a.device_type,a.bed_number,a.device_name,a.manufacture_factory,a.service_manufacturer,a.unit_type as device_mode,a.use_section,a.section_number,a.buy_date,a.install_date,a.start_date,a.maintenace_engineer,a.telephone,a.guarantee_date,a.machine_status,a.user_total,a.disinfection_mode,a.remarks,a.rubbish_date,a.rubbish_reason,a.user_year,a.work_time,a.revers_mode,a.user_org_id,a.status,a.ctime,a.mtime,a.zone_id,a.bed_id,a.home_address,a.home_setting").Joins("left join xt_device_mode as d on d.id = a.unit_type ").Where("a.id = ? and a.user_org_id = ?", id, orgid).Find(&addmacher).Error
728
+	err := db.Select("a.id,a.serial_number,a.device_type,a.bed_number,a.device_name,a.manufacture_factory,a.service_manufacturer,a.unit_type as device_mode,a.use_section,a.section_number,a.buy_date,a.install_date,a.start_date,a.maintenace_engineer,a.telephone,a.guarantee_date,a.machine_status,a.user_total,a.disinfection_mode,a.remarks,a.rubbish_date,a.rubbish_reason,a.user_year,a.work_time,a.revers_mode,a.user_org_id,a.status,a.ctime,a.mtime,a.zone_id,a.bed_id,a.home_address,a.home_setting,a.home_type,a.home_big_type").Joins("left join xt_device_mode as d on d.id = a.unit_type ").Where("a.id = ? and a.user_org_id = ?", id, orgid).Find(&addmacher).Error
729
 	return addmacher, err
729
 	return addmacher, err
730
 }
730
 }
731
 
731
 

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

54
 
54
 
55
 func UpdateMachine(id int64, orgid int64, addmacher *models.DeviceAddmacher) error {
55
 func UpdateMachine(id int64, orgid int64, addmacher *models.DeviceAddmacher) error {
56
 
56
 
57
-	err := writeUserDb.Model(&addmacher).Where("id = ? AND user_org_id = ? AND status = ?", id, orgid, 1).Updates(map[string]interface{}{"serial_number": addmacher.SerialNumber, "device_type": addmacher.DeviceType, "bed_number": addmacher.BedNumber, "device_name": addmacher.DeviceName, "manufacture_factory": addmacher.ManufactureFactory, "service_manufacturer": addmacher.ServiceManufacturer, "unit_type": addmacher.UnitType, "use_section": addmacher.UseSection, "section_number": addmacher.SectionNumber, "buy_date": addmacher.BuyDate, "install_date": addmacher.InstallDate, "start_date": addmacher.StartDate, "maintenace_engineer": addmacher.MaintenaceEngineer, "telephone": addmacher.Telephone, "guarantee_date": addmacher.GuaranteeDate, "machine_status": addmacher.MachineStatus, "user_total": addmacher.UserTotal, "remarks": addmacher.Remarks, "rubbish_date": addmacher.RubbishDate, "rubbish_reason": addmacher.RubbishReason, "user_year": addmacher.UserYear, "work_time": addmacher.WorkTime, "bed_id": addmacher.BedId, "disinfection_mode": addmacher.DisinfectionMode, "revers_mode": addmacher.ReversMode, "mtime": time.Now().Unix(), "zone_id": addmacher.ZoneId, "home_address": addmacher.HomeAddress, "home_setting": addmacher.HomeSetting}).Error
57
+	err := writeUserDb.Model(&addmacher).Where("id = ? AND user_org_id = ? AND status = ?", id, orgid, 1).Updates(map[string]interface{}{"serial_number": addmacher.SerialNumber, "device_type": addmacher.DeviceType, "bed_number": addmacher.BedNumber, "device_name": addmacher.DeviceName, "manufacture_factory": addmacher.ManufactureFactory, "service_manufacturer": addmacher.ServiceManufacturer, "unit_type": addmacher.UnitType, "use_section": addmacher.UseSection, "section_number": addmacher.SectionNumber, "buy_date": addmacher.BuyDate, "install_date": addmacher.InstallDate, "start_date": addmacher.StartDate, "maintenace_engineer": addmacher.MaintenaceEngineer, "telephone": addmacher.Telephone, "guarantee_date": addmacher.GuaranteeDate, "machine_status": addmacher.MachineStatus, "user_total": addmacher.UserTotal, "remarks": addmacher.Remarks, "rubbish_date": addmacher.RubbishDate, "rubbish_reason": addmacher.RubbishReason, "user_year": addmacher.UserYear, "work_time": addmacher.WorkTime, "bed_id": addmacher.BedId, "disinfection_mode": addmacher.DisinfectionMode, "revers_mode": addmacher.ReversMode, "mtime": time.Now().Unix(), "zone_id": addmacher.ZoneId, "home_address": addmacher.HomeAddress, "home_setting": addmacher.HomeSetting, "home_type": addmacher.HomeType, "home_big_type": addmacher.HomeBigType}).Error
58
 
58
 
59
 	return err
59
 	return err
60
 
60
 

+ 8 - 1
service/patient_service.go 查看文件

5051
 	return inspection, err
5051
 	return inspection, err
5052
 }
5052
 }
5053
 
5053
 
5054
+func GetNewInspectionRefence(org_id int64, project_id int64) (reference []*models.XtInspectionReference, err error) {
5055
+
5056
+	err = XTReadDB().Where("(org_id = ? or org_id = 0) and project_id = ?", org_id, project_id).Find(&reference).Error
5057
+
5058
+	return reference, err
5059
+}
5060
+
5054
 func GetSelfDrugOutInfo(patient_id int64, sys_record_time int64, drug_id int64) (outInfo []*models.XtSelfDrugWarehouseOutInfo, err error) {
5061
 func GetSelfDrugOutInfo(patient_id int64, sys_record_time int64, drug_id int64) (outInfo []*models.XtSelfDrugWarehouseOutInfo, err error) {
5055
 
5062
 
5056
 	err = XTReadDB().Where("patient_id = ? and sys_record_time = ? and drug_id = ? and status=1", patient_id, sys_record_time, drug_id).Find(&outInfo).Error
5063
 	err = XTReadDB().Where("patient_id = ? and sys_record_time = ? and drug_id = ? and status=1", patient_id, sys_record_time, drug_id).Find(&outInfo).Error
5280
 
5287
 
5281
 	patientInCount := models.SfPatientInCount{}
5288
 	patientInCount := models.SfPatientInCount{}
5282
 
5289
 
5283
-	err := tx.Where("id = ?", id).Find(&patientInCount).Error
5290
+	err := tx.Where("id = ? and status=1", id).Find(&patientInCount).Error
5284
 	if err != nil {
5291
 	if err != nil {
5285
 		tx.Rollback()
5292
 		tx.Rollback()
5286
 		return patientInCount, err
5293
 		return patientInCount, err

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

100
 
100
 
101
 	err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.status=1 and uar.org_id=?  and ua.status=1", orgId).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error
101
 	err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.status=1 and uar.org_id=?  and ua.status=1", orgId).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error
102
 
102
 
103
-	if orgId == 10724 {
103
+	if orgId == 10724 || orgId == 10653 {
104
 		err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.org_id=?", orgId).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error
104
 		err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.org_id=?", orgId).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error
105
 	} else {
105
 	} else {
106
 		err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.status=1 and uar.org_id=?  and ua.status=1", orgId).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error
106
 		err = readUserDb.Table("sgj_user_admin_role as uar").Joins("JOIN sgj_user_admin as ua ON ua.id = uar.admin_user_id").Where("uar.status=1 and uar.org_id=?  and ua.status=1", orgId).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error