Browse Source

Merge branch 'master' of http://git.shengws.com/csx/XT_New

XMLWAN 4 years ago
parent
commit
f8c69bec40
2 changed files with 19 additions and 17 deletions
  1. 5 5
      controllers/base_api_controller.go
  2. 14 12
      service/patient_service.go

+ 5 - 5
controllers/base_api_controller.go View File

@@ -77,7 +77,7 @@ func (this *BaseAuthAPIController) Prepare() {
77 77
 		//userAdmin.ModifyTime = 1530786071
78 78
 		//var subscibe models.ServeSubscibe
79 79
 		//subscibe.ID = 1
80
-		//subscibe.OrgId = 9538
80
+		//subscibe.OrgId = 12
81 81
 		//subscibe.PeriodStart = 1538035409
82 82
 		//subscibe.PeriodEnd = 1569571409
83 83
 		//subscibe.State = 1
@@ -87,7 +87,7 @@ func (this *BaseAuthAPIController) Prepare() {
87 87
 		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
88 88
 		//subscibes[4] = &subscibe
89 89
 		//var adminUserInfo service.AdminUserInfo
90
-		//adminUserInfo.CurrentOrgId = 9538
90
+		//adminUserInfo.CurrentOrgId = 12
91 91
 		//adminUserInfo.CurrentAppId = 18
92 92
 		//adminUserInfo.AdminUser = &userAdmin
93 93
 		//adminUserInfo.Subscibes = subscibes
@@ -316,7 +316,7 @@ type BaseServeAPIController struct {
316 316
 func (this *BaseServeAPIController) Prepare() {
317 317
 	this.BaseAPIController.Prepare()
318 318
 	if this.GetAdminUserInfo() == nil {
319
-		//	var userAdmin models.AdminUser
319
+		//var userAdmin models.AdminUser
320 320
 		//userAdmin.Id = 400
321 321
 		//userAdmin.Mobile = "13535547901"
322 322
 		//userAdmin.Id = 597
@@ -327,7 +327,7 @@ func (this *BaseServeAPIController) Prepare() {
327 327
 		//userAdmin.ModifyTime = 1530786071
328 328
 		//var subscibe models.ServeSubscibe
329 329
 		//subscibe.ID = 1
330
-		//subscibe.OrgId = 9538
330
+		//subscibe.OrgId = 12
331 331
 		//subscibe.PeriodStart = 1538035409
332 332
 		//subscibe.PeriodEnd = 1569571409
333 333
 		//subscibe.State = 1
@@ -337,7 +337,7 @@ func (this *BaseServeAPIController) Prepare() {
337 337
 		//subscibes := make(map[int64]*models.ServeSubscibe, 0)
338 338
 		//subscibes[4] = &subscibe
339 339
 		//var adminUserInfo service.AdminUserInfo
340
-		//adminUserInfo.CurrentOrgId = 9538
340
+		//adminUserInfo.CurrentOrgId = 12
341 341
 		//adminUserInfo.CurrentAppId = 18
342 342
 		//adminUserInfo.AdminUser = &userAdmin
343 343
 		//adminUserInfo.Subscibes = subscibes

+ 14 - 12
service/patient_service.go View File

@@ -1217,18 +1217,20 @@ func CreateExportPatient(patient *models.Patients, contagions []int64, org_creat
1217 1217
 		return
1218 1218
 	}
1219 1219
 
1220
-	var dryWeight models.SgjPatientDryweight
1221
-	dryWeight.PatientId = patient.ID
1222
-	dryWeight.UserOrgId = patient.UserOrgId
1223
-	dryWeight.Status = 1
1224
-	dryWeight.AdjustedValue = "/"
1225
-	dryWeight.Creator = org_creator
1226
-	dryWeight.UserId = org_creator
1227
-	dryWeight.Ctime = time.Now().Unix()
1228
-	dryWeight.Mtime = time.Now().Unix()
1229
-	dryWeight.DryWeight = patient.DryWeight
1230
-	dryWeight.Remakes = ""
1231
-	err = utx.Create(&dryWeight).Error
1220
+	if patient.DryWeight > 0 {
1221
+		var dryWeight models.SgjPatientDryweight
1222
+		dryWeight.PatientId = patient.ID
1223
+		dryWeight.UserOrgId = patient.UserOrgId
1224
+		dryWeight.Status = 1
1225
+		dryWeight.AdjustedValue = "/"
1226
+		dryWeight.Creator = org_creator
1227
+		dryWeight.UserId = org_creator
1228
+		dryWeight.Ctime = time.Now().Unix()
1229
+		dryWeight.Mtime = time.Now().Unix()
1230
+		dryWeight.DryWeight = patient.DryWeight
1231
+		dryWeight.Remakes = ""
1232
+		err = utx.Create(&dryWeight).Error
1233
+	}
1232 1234
 
1233 1235
 	var lapseto models.PatientLapseto
1234 1236
 	lapseto.PatientId = patient.ID