28169 3 miesięcy temu
rodzic
commit
d13e5bbd8e

BIN
XT_New.exe Wyświetl plik


+ 4 - 4
controllers/base_api_controller.go Wyświetl plik

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

+ 10 - 0
controllers/manager_center_api_controller.go Wyświetl plik

@@ -168,6 +168,10 @@ func (c *ManagerCenterApiController) CreateBaseDrugLib() {
168 168
 	is_zero_flag, _ := c.GetInt64("is_zero_flag")
169 169
 
170 170
 	specification_name := c.GetString("specification_name")
171
+
172
+	scan_code := c.GetString("scan_code")
173
+	drug_identification_code := c.GetString("drug_identification_code")
174
+
171 175
 	hans := drug_name // 要转换的汉字字符串
172 176
 
173 177
 	// 创建一个拼音转换器
@@ -260,6 +264,8 @@ func (c *ManagerCenterApiController) CreateBaseDrugLib() {
260 264
 		IsSelfDrug:                  is_self_drug,
261 265
 		SpecificationName:           specification_name,
262 266
 		IsZeroFlag:                  is_zero_flag,
267
+		ScanCode:                    scan_code,
268
+		DrugIdentificationCode:      drug_identification_code,
263 269
 	}
264 270
 	drugLib.FirstLetter = firstLetter
265 271
 	drugLib.Pinyin = firstLetter
@@ -385,6 +391,8 @@ func (c *ManagerCenterApiController) EditBaseDrugLib() {
385 391
 	is_self_drug, _ := c.GetInt64("is_self_drug")
386 392
 	specification_name := c.GetString("specification_name")
387 393
 	is_zero_flag, _ := c.GetInt64("is_zero_flag")
394
+	scan_code := c.GetString("scan_code")
395
+	drug_identification_code := c.GetString("drug_identification_code")
388 396
 
389 397
 	adminInfo := c.GetAdminUserInfo()
390 398
 	drug, _ := service.FindBaseDrugLibRecord(adminInfo.CurrentOrgId, id)
@@ -484,6 +492,8 @@ func (c *ManagerCenterApiController) EditBaseDrugLib() {
484 492
 		IsSelfDrug:                  is_self_drug,
485 493
 		SpecificationName:           specification_name,
486 494
 		IsZeroFlag:                  is_zero_flag,
495
+		ScanCode:                    scan_code,
496
+		DrugIdentificationCode:      drug_identification_code,
487 497
 	}
488 498
 	if adminInfo.CurrentOrgId == 10206 || adminInfo.CurrentOrgId == 10344 {
489 499
 

+ 6 - 3
controllers/mobile_api_controllers/dialysis_api_controller.go Wyświetl plik

@@ -5320,13 +5320,16 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
5320 5320
 			if adminInfo.Org.Id == 10735 {
5321 5321
 
5322 5322
 				lastMonitorRecordList, _ := service.GetLastMonitorRecordList(patientID, monitorDate, adminInfo.Org.Id)
5323
+				totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
5324
+				var ultrafiltration_rate_one = math.Floor(prescription.TargetUltrafiltration*1000/float64(totalMin)*60*1000) / 1000
5325
+
5323 5326
 				if lastMonitorRecordList.ID > 0 {
5324
-					record.UltrafiltrationRate = lastMonitorRecordList.UltrafiltrationRate
5325
-					ultrafiltration_volume := math.Floor(float64(record.OperateTime+1800-fristrecord.OperateTime) / 3600 * lastMonitorRecordList.UltrafiltrationRate)
5327
+					record.UltrafiltrationRate = ultrafiltration_rate_one
5328
+					ultrafiltration_volume := math.Floor(float64(record.OperateTime+1800-fristrecord.OperateTime) / 3600 * ultrafiltration_rate_one)
5326 5329
 
5327 5330
 					record.UltrafiltrationVolume = ultrafiltration_volume
5328 5331
 				} else {
5329
-					ultrafiltration_volume := math.Floor(float64(record.OperateTime+1800-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
5332
+					ultrafiltration_volume := math.Floor(float64(record.OperateTime+1800-fristrecord.OperateTime) / 3600 * ultrafiltration_rate_one)
5330 5333
 
5331 5334
 					record.UltrafiltrationVolume = ultrafiltration_volume
5332 5335
 				}

+ 13 - 1
controllers/patient_api_controller.go Wyświetl plik

@@ -8760,7 +8760,19 @@ func (this *PatientApiController) ModifyCoursePrint() {
8760 8760
 	id := int64(dataBody["id"].(float64))
8761 8761
 	content := dataBody["content"].(string)
8762 8762
 
8763
-	coursePrint, _ := service.ModifyCoursePrint(id, content)
8763
+	record_date := dataBody["record_date"].(string)
8764
+	timeLayout := "2006-01-02"
8765
+	loc, _ := time.LoadLocation("Local")
8766
+	var theStartTime int64
8767
+	if len(record_date) > 0 {
8768
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
8769
+		if err != nil {
8770
+			utils.ErrorLog(err.Error())
8771
+		}
8772
+		theStartTime = theTime.Unix()
8773
+	}
8774
+
8775
+	coursePrint, _ := service.ModifyCoursePrint(id, content, theStartTime)
8764 8776
 
8765 8777
 	this.ServeSuccessJSON(map[string]interface{}{
8766 8778
 		"coursePrint": coursePrint,

+ 12 - 1
controllers/patient_dataconfig_api_controller.go Wyświetl plik

@@ -931,6 +931,17 @@ func (this *PatientDataConfigAPIController) Rescues() {
931 931
 func (this *PatientDataConfigAPIController) CreateRescue() {
932 932
 	patientID, _ := this.GetInt64("patient_id")
933 933
 	content := this.GetString("content")
934
+	record_date := this.GetString("record_date")
935
+	timeLayout := "2006-01-02"
936
+	loc, _ := time.LoadLocation("Local")
937
+	var theStartTime int64
938
+	if len(record_date) > 0 {
939
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
940
+		if err != nil {
941
+			utils.ErrorLog(err.Error())
942
+		}
943
+		theStartTime = theTime.Unix()
944
+	}
934 945
 	if patientID <= 0 || len(content) == 0 {
935 946
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
936 947
 		return
@@ -952,7 +963,7 @@ func (this *PatientDataConfigAPIController) CreateRescue() {
952 963
 		OrgID:      adminUserInfo.CurrentOrgId,
953 964
 		PatientID:  patientID,
954 965
 		Recorder:   adminUserInfo.AdminUser.Id,
955
-		RecordTime: now,
966
+		RecordTime: theStartTime,
956 967
 		Content:    content,
957 968
 		Status:     1,
958 969
 		CreateTime: now,

+ 21 - 17
models/drug.go Wyświetl plik

@@ -85,13 +85,15 @@ type BaseDrugLib struct {
85 85
 	Bby01     string `gorm:"column:bby01" json:"bby01" form:"bby01"`
86 86
 	Bbx01     string `gorm:"column:bbx01" json:"bbx01" form:"bbx01"`
87 87
 
88
-	FirstLetter        string `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
89
-	IsProject          int64  `gorm:"column:is_project" json:"is_project" form:"is_project"`
90
-	DrugDosageFormName string `gorm:"column:drug_dosage_form_name" json:"drug_dosage_form_name" form:"drug_dosage_form_name"`
91
-	IsShow             int64  `gorm:"column:is_show" json:"is_show" form:"is_show"`
92
-	IsSelfDrug         int64  `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
93
-	SpecificationName  string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
94
-	IsZeroFlag         int64  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
88
+	FirstLetter            string `gorm:"column:first_letter" json:"first_letter" form:"first_letter"`
89
+	IsProject              int64  `gorm:"column:is_project" json:"is_project" form:"is_project"`
90
+	DrugDosageFormName     string `gorm:"column:drug_dosage_form_name" json:"drug_dosage_form_name" form:"drug_dosage_form_name"`
91
+	IsShow                 int64  `gorm:"column:is_show" json:"is_show" form:"is_show"`
92
+	IsSelfDrug             int64  `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
93
+	SpecificationName      string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
94
+	IsZeroFlag             int64  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
95
+	ScanCode               string `gorm:"column:scan_code" json:"scan_code" form:"scan_code"`
96
+	DrugIdentificationCode string `gorm:"column:drug_identification_code" json:"drug_identification_code" form:"drug_identification_code"`
95 97
 }
96 98
 
97 99
 func (BaseDrugLib) TableName() string {
@@ -145,16 +147,18 @@ func (BaseDrugLibTwentyOne) TableName() string {
145 147
 }
146 148
 
147 149
 type BaseDrugLibEleven struct {
148
-	ID               int64  `gorm:"column:id" json:"id" form:"id"`
149
-	DrugName         string `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
150
-	Manufacturer     int64  `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
151
-	ManufacturerName string `gorm:"column:manufacturer_name" json:"manufacturer_name"`
152
-	MaxUnit          string `gorm:"column:max_unit" json:"max_unit" form:"max_unit"`
153
-	MinNumber        int64  `gorm:"column:min_number" json:"min_number" form:"min_number"`
154
-	MinUnit          string `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
155
-	Dose             string `gorm:"column:dose" json:"dose" form:"dose"`
156
-	DoseUnit         string `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
157
-	IsZeroFlag       int64  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
150
+	ID                     int64  `gorm:"column:id" json:"id" form:"id"`
151
+	DrugName               string `gorm:"column:drug_name" json:"drug_name" form:"drug_name"`
152
+	Manufacturer           int64  `gorm:"column:manufacturer" json:"manufacturer" form:"manufacturer"`
153
+	ManufacturerName       string `gorm:"column:manufacturer_name" json:"manufacturer_name"`
154
+	MaxUnit                string `gorm:"column:max_unit" json:"max_unit" form:"max_unit"`
155
+	MinNumber              int64  `gorm:"column:min_number" json:"min_number" form:"min_number"`
156
+	MinUnit                string `gorm:"column:min_unit" json:"min_unit" form:"min_unit"`
157
+	Dose                   string `gorm:"column:dose" json:"dose" form:"dose"`
158
+	DoseUnit               string `gorm:"column:dose_unit" json:"dose_unit" form:"dose_unit"`
159
+	IsZeroFlag             int64  `gorm:"column:is_zero_flag" json:"is_zero_flag" form:"is_zero_flag"`
160
+	ScanCode               string `gorm:"column:scan_code" json:"scan_code" form:"scan_code"`
161
+	DrugIdentificationCode string `gorm:"column:drug_identification_code" json:"drug_identification_code" form:"drug_identification_code"`
158 162
 }
159 163
 
160 164
 func (BaseDrugLibEleven) TableName() string {

+ 2 - 2
service/patient_service.go Wyświetl plik

@@ -4735,11 +4735,11 @@ func GetPatientRescueRecord(id int64) (models.XtPatientRescueRecord, error) {
4735 4735
 	return rescueRecords, err
4736 4736
 }
4737 4737
 
4738
-func ModifyCoursePrint(id int64, content string) (models.XtPatientRescueRecord, error) {
4738
+func ModifyCoursePrint(id int64, content string, record_date int64) (models.XtPatientRescueRecord, error) {
4739 4739
 
4740 4740
 	rescueRecord := models.XtPatientRescueRecord{}
4741 4741
 
4742
-	err := XTWriteDB().Model(&rescueRecord).Where("id = ? and status=1", id).Updates(map[string]interface{}{"content": content}).Error
4742
+	err := XTWriteDB().Model(&rescueRecord).Where("id = ? and status=1", id).Updates(map[string]interface{}{"content": content, "record_time": record_date}).Error
4743 4743
 
4744 4744
 	return rescueRecord, err
4745 4745
 }

+ 6 - 1
service/user_service.go Wyświetl plik

@@ -99,7 +99,12 @@ func GetAllAdminUsers(orgId, appid int64) (list []*AdminUserList, err error) {
99 99
 func GetAllAdminUsersTwo(orgId int64) (list []*AdminUserList, err error) {
100 100
 
101 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
-	//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 ua.status=1").Select("ua.id, uar.user_name as name, uar.user_type").Scan(&list).Error
102
+
103
+	if orgId == 10724 {
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.status=1 and uar.org_id=?", orgId).Select("ua.id, uar.user_name as name, uar.user_type,uar.status").Scan(&list).Error
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
107
+	}
103 108
 	return
104 109
 }
105 110