Browse Source

2024/6/17

28169 2 months ago
parent
commit
327b2b3f2c

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 = 10644 //机构id
86
+		subscibe.OrgId = 10340 //机构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 = 10644 //机构id小英9675或4
96
+		adminUserInfo.CurrentOrgId = 10340 //机构id小英9675或4
97 97
 		adminUserInfo.CurrentAppId = 17260 //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 = 10644 //机构id小英9675或4
332
+		subscibe.OrgId = 10340 //机构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 = 10644 //机构id小英9675或4
342
+		adminUserInfo.CurrentOrgId = 10340 //机构id小英9675或4
343 343
 		adminUserInfo.CurrentAppId = 17260 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes

+ 8 - 3
controllers/device_api_controller.go View File

@@ -1,15 +1,17 @@
1 1
 package controllers
2 2
 
3 3
 import (
4
+	"time"
5
+
4 6
 	"XT_New/utils"
5 7
 	"github.com/jinzhu/gorm"
6
-	"time"
7 8
 
8 9
 	"XT_New/enums"
9 10
 	"XT_New/models"
10 11
 	"XT_New/service"
11 12
 
12 13
 	"fmt"
14
+
13 15
 	"github.com/astaxie/beego"
14 16
 )
15 17
 
@@ -520,6 +522,7 @@ func (this *DeviceAPIController) GetZones() {
520 522
 func (this *DeviceAPIController) CreateZone() {
521 523
 	name := this.GetString("name")
522 524
 	type_, _ := this.GetInt("type")
525
+	sort, _ := this.GetInt64("sort")
523 526
 	if len(name) == 0 || type_ <= 0 {
524 527
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
525 528
 		return
@@ -527,9 +530,9 @@ func (this *DeviceAPIController) CreateZone() {
527 530
 
528 531
 	adminInfo := this.GetAdminUserInfo()
529 532
 	_, errcode := service.GetZoneByName(name, adminInfo.CurrentOrgId)
530
-	fmt.Println("errcode=----------", errcode)
533
+
531 534
 	if errcode == gorm.ErrRecordNotFound {
532
-		zone, createErr := service.CreateDeviceZone(adminInfo.CurrentOrgId, name, type_)
535
+		zone, createErr := service.CreateDeviceZone(adminInfo.CurrentOrgId, name, type_, sort)
533 536
 		if createErr != nil {
534 537
 			this.ErrorLog("创建设备分区失败:%v", createErr)
535 538
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDBCreate)
@@ -552,6 +555,7 @@ func (this *DeviceAPIController) ModifyZone() {
552 555
 	id, _ := this.GetInt64("id")
553 556
 	name := this.GetString("name")
554 557
 	type_, _ := this.GetInt("type")
558
+	sort, _ := this.GetInt64("sort")
555 559
 	if id <= 0 || len(name) == 0 || type_ <= 0 {
556 560
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
557 561
 		return
@@ -570,6 +574,7 @@ func (this *DeviceAPIController) ModifyZone() {
570 574
 
571 575
 	zone.Name = name
572 576
 	zone.Type = type_
577
+	zone.Sort = sort
573 578
 	zone.ModifyTime = time.Now().Unix()
574 579
 
575 580
 	byName, _ := service.GetZoneByNameOne(name, adminInfo.CurrentOrgId)

+ 1 - 1
controllers/his_api_controller.go View File

@@ -3183,7 +3183,7 @@ func (c *HisApiController) CreateHisPrescription() {
3183 3183
 	var adviceList []models.HisDoctorAdviceInfo
3184 3184
 	var projectList []models.HisPrescriptionProject
3185 3185
 
3186
-	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10537 || adminInfo.CurrentOrgId == 10265 || adminInfo.CurrentOrgId == 10644 || adminInfo.CurrentOrgId == 10164 {
3186
+	if adminInfo.CurrentOrgId == 10489 || adminInfo.CurrentOrgId == 10510 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10478 || adminInfo.CurrentOrgId == 10318 || adminInfo.CurrentOrgId == 10480 || adminInfo.CurrentOrgId == 10633 || adminInfo.CurrentOrgId == 10610 || adminInfo.CurrentOrgId == 10402 || adminInfo.CurrentOrgId == 10138 || adminInfo.CurrentOrgId == 10278 || adminInfo.CurrentOrgId == 10537 || adminInfo.CurrentOrgId == 10265 || adminInfo.CurrentOrgId == 10644 || adminInfo.CurrentOrgId == 10164 || adminInfo.CurrentOrgId == 10598 || adminInfo.CurrentOrgId == 10028 {
3187 3187
 		if dataBody["prescriptions"] != nil && reflect.TypeOf(dataBody["prescriptions"]).String() == "[]interface {}" {
3188 3188
 			prescriptions, _ := dataBody["prescriptions"].([]interface{})
3189 3189
 

+ 2 - 1
controllers/mobile_api_controllers/patient_api_controller.go View File

@@ -300,7 +300,7 @@ func (c *PatientApiController) EditDoctorAdvice() {
300 300
 	advice.UpdatedTime = time.Now().Unix()
301 301
 	advice.UserOrgId = adminUserInfo.Org.Id
302 302
 	advice.Modifier = adminUserInfo.AdminUser.Id
303
-
303
+	advice.AdviceDoctor = adminUserInfo.AdminUser.Id
304 304
 	//处理修改医嘱开始时间逻辑(不包括子医嘱)
305 305
 	//1.一组医嘱内只有一条医嘱(不包括子医嘱)的情况下,只需要直接修改医嘱开始时间,不需要重新分配组号
306 306
 	//2.一组医嘱内有多条医嘱(不包括子医嘱)的情况下,需要为修改的那条医嘱重新分配组号,并修改医嘱开始时间
@@ -393,6 +393,7 @@ func (c *PatientApiController) EditDoctorAdvice() {
393 393
 				gruopNo := service.GetMaxAdviceGroupID(adminUserInfo.Org.Id)
394 394
 				gruopNo = gruopNo + 1
395 395
 				advice.GroupNo = gruopNo
396
+				advice.AdviceDoctor = adminUserInfo.AdminUser.Id
396 397
 				err = service.UpdateDoctorAdviceAndSubAdvice(&advice)
397 398
 				key := strconv.FormatInt(adminUserInfo.Org.Id, 10) + ":" + strconv.FormatInt(patient_id, 10) + ":" + strconv.FormatInt(doc_advice_date, 10) + ":doctor_advices"
398 399
 

+ 4 - 4
controllers/patient_api_controller.go View File

@@ -7674,7 +7674,7 @@ func (c *PatientApiController) SavePatientLapse() {
7674 7674
 	//病人转出
7675 7675
 	if lapse_type == 2 {
7676 7676
 
7677
-		service.UpdatePatientLapsetoByPatientId(patient_id, recordDate)
7677
+		service.UpdatePatientLapsetoByPatientId(patient_id, recordDate, lapse_reason)
7678 7678
 
7679 7679
 		service.UpdateScheduleByDeathTime(patient_id, recordDate)
7680 7680
 
@@ -7684,7 +7684,7 @@ func (c *PatientApiController) SavePatientLapse() {
7684 7684
 	//病人转出
7685 7685
 	if lapse_type == 3 {
7686 7686
 
7687
-		service.UpdatePatientLapsetoByPatientIdOne(patient_id, recordDate)
7687
+		service.UpdatePatientLapsetoByPatientIdOne(patient_id, recordDate, lapse_reason)
7688 7688
 
7689 7689
 		service.UpdateScheduleByDeathTime(patient_id, recordDate)
7690 7690
 
@@ -7857,7 +7857,7 @@ func (c *DialysisApiController) UpdatePatientLapseRecord() {
7857 7857
 
7858 7858
 	//病人转出
7859 7859
 	if lapse_type == 2 {
7860
-		service.UpdatePatientLapsetoByPatientId(patient_id, recordDate)
7860
+		service.UpdatePatientLapsetoByPatientId(patient_id, recordDate, lapse_reason)
7861 7861
 
7862 7862
 		service.UpdateScheduleByDeathTime(patient_id, recordDate)
7863 7863
 
@@ -7865,7 +7865,7 @@ func (c *DialysisApiController) UpdatePatientLapseRecord() {
7865 7865
 	}
7866 7866
 
7867 7867
 	if lapse_type == 3 {
7868
-		service.UpdatePatientLapsetoByPatientIdOne(patient_id, recordDate)
7868
+		service.UpdatePatientLapsetoByPatientIdOne(patient_id, recordDate, lapse_reason)
7869 7869
 
7870 7870
 		service.UpdateScheduleByDeathTime(patient_id, recordDate)
7871 7871
 

+ 5 - 3
service/device_service.go View File

@@ -1,13 +1,14 @@
1 1
 package service
2 2
 
3 3
 import (
4
-	"XT_New/models"
5 4
 	"encoding/json"
6 5
 	"fmt"
7
-	"github.com/jinzhu/gorm"
8 6
 	"strconv"
9 7
 	"strings"
10 8
 	"time"
9
+
10
+	"XT_New/models"
11
+	"github.com/jinzhu/gorm"
11 12
 )
12 13
 
13 14
 //////// 设备基本信息
@@ -302,7 +303,7 @@ func GetZoneByNameOne(name string, orgid int64) (zone models.DeviceZone, err err
302 303
 	return zone, err
303 304
 }
304 305
 
305
-func CreateDeviceZone(orgID int64, name string, type_ int) (*models.DeviceZone, error) {
306
+func CreateDeviceZone(orgID int64, name string, type_ int, sort int64) (*models.DeviceZone, error) {
306 307
 	now := time.Now().Unix()
307 308
 	zone := models.DeviceZone{
308 309
 		OrgID:      orgID,
@@ -311,6 +312,7 @@ func CreateDeviceZone(orgID int64, name string, type_ int) (*models.DeviceZone,
311 312
 		Status:     1,
312 313
 		CreateTime: now,
313 314
 		ModifyTime: now,
315
+		Sort:       sort,
314 316
 	}
315 317
 	err := writeDb.Model(&models.DeviceZone{}).Create(&zone).Error
316 318
 	if err != nil {

+ 6 - 6
service/patient_service.go View File

@@ -2143,20 +2143,20 @@ func UpdateScheduleByDeathTime(patientid int64, shcheduledate int64) error {
2143 2143
 	return err
2144 2144
 }
2145 2145
 
2146
-func UpdatePatientLapsetoByPatientId(patient_id int64, record_date int64) error {
2146
+func UpdatePatientLapsetoByPatientId(patient_id int64, record_date int64, lapse_reason string) error {
2147 2147
 
2148
-	err := XTWriteDB().Model(&models.Patients{}).Where("id = ? and status= 1", patient_id).Updates(map[string]interface{}{"death_time": record_date, "lapseto": 2}).Error
2148
+	err := XTWriteDB().Model(&models.Patients{}).Where("id = ? and status= 1", patient_id).Updates(map[string]interface{}{"death_time": record_date, "lapseto": 2, "out_reason": lapse_reason}).Error
2149 2149
 
2150
-	err = XTWriteDB().Model(&models.XtPatientsNew{}).Where("blood_id = ? and status=1", patient_id).Updates(map[string]interface{}{"death_time": record_date, "lapseto": 2}).Error
2150
+	err = XTWriteDB().Model(&models.XtPatientsNew{}).Where("blood_id = ? and status=1", patient_id).Updates(map[string]interface{}{"death_time": record_date, "lapseto": 2, "out_reason": lapse_reason}).Error
2151 2151
 
2152 2152
 	return err
2153 2153
 }
2154 2154
 
2155
-func UpdatePatientLapsetoByPatientIdOne(patient_id int64, record_date int64) error {
2155
+func UpdatePatientLapsetoByPatientIdOne(patient_id int64, record_date int64, lapse_reason string) error {
2156 2156
 
2157
-	err := XTWriteDB().Model(&models.Patients{}).Where("id = ? and status= 1", patient_id).Updates(map[string]interface{}{"death_time": record_date, "lapseto": 3}).Error
2157
+	err := XTWriteDB().Model(&models.Patients{}).Where("id = ? and status= 1", patient_id).Updates(map[string]interface{}{"death_time": record_date, "lapseto": 3, "out_reason": lapse_reason}).Error
2158 2158
 
2159
-	err = XTWriteDB().Model(&models.XtPatientsNew{}).Where("blood_id = ? and status=1", patient_id).Updates(map[string]interface{}{"death_time": record_date, "lapseto": 3}).Error
2159
+	err = XTWriteDB().Model(&models.XtPatientsNew{}).Where("blood_id = ? and status=1", patient_id).Updates(map[string]interface{}{"death_time": record_date, "lapseto": 3, "out_reason": lapse_reason}).Error
2160 2160
 
2161 2161
 	return err
2162 2162
 }

+ 1 - 1
service/self_drug_service.go View File

@@ -3127,7 +3127,7 @@ func GetInitOutBanceList(good_id int64, user_org_id int64, start_time int64, end
3127 3127
 		db = db.Where("storehouse_id = ?", storehouse_id)
3128 3128
 	}
3129 3129
 
3130
-	err = db.Group("patient_id,good_id,sys_record_time,is_sys").Find(&list).Error
3130
+	err = db.Group("patient_id,good_id,sys_record_time,is_sys,ctime").Find(&list).Error
3131 3131
 
3132 3132
 	return list, err
3133 3133
 }