瀏覽代碼

历史排班

28169 1 年之前
父節點
當前提交
527b4b7c1d

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

71
 	this.BaseAPIController.Prepare()
71
 	this.BaseAPIController.Prepare()
72
 	if this.GetAdminUserInfo() == nil {
72
 	if this.GetAdminUserInfo() == nil {
73
 		var userAdmin models.AdminUser
73
 		var userAdmin models.AdminUser
74
-		userAdmin.Id = 1448
74
+		userAdmin.Id = 841
75
 		userAdmin.Mobile = "15717313968"
75
 		userAdmin.Mobile = "15717313968"
76
-		userAdmin.Id = 1 //4,809
76
+		userAdmin.Id = 841 //4,809
77
 		userAdmin.Mobile = "12222222222"
77
 		userAdmin.Mobile = "12222222222"
78
 		userAdmin.IsSuperAdmin = true
78
 		userAdmin.IsSuperAdmin = true
79
 		userAdmin.Status = 1
79
 		userAdmin.Status = 1
81
 		userAdmin.ModifyTime = 1530786071
81
 		userAdmin.ModifyTime = 1530786071
82
 		var subscibe models.ServeSubscibe
82
 		var subscibe models.ServeSubscibe
83
 		subscibe.ID = 11
83
 		subscibe.ID = 11
84
-		subscibe.OrgId = 3877 //机构id
84
+		subscibe.OrgId = 10191 //机构id 10344
85
 		subscibe.PeriodStart = 1547447814
85
 		subscibe.PeriodStart = 1547447814
86
 		subscibe.PeriodEnd = 1550039814
86
 		subscibe.PeriodEnd = 1550039814
87
 		subscibe.State = 1
87
 		subscibe.State = 1
91
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
91
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
92
 		subscibes[4] = &subscibe
92
 		subscibes[4] = &subscibe
93
 		var adminUserInfo service.AdminUserInfo
93
 		var adminUserInfo service.AdminUserInfo
94
-		adminUserInfo.CurrentOrgId = 3877 //机构id小英9675或4
95
-		adminUserInfo.CurrentAppId = 3244 //4
94
+		adminUserInfo.CurrentOrgId = 10191 //机构id小英9675或4
95
+		adminUserInfo.CurrentAppId = 3467  //4
96
 		adminUserInfo.AdminUser = &userAdmin
96
 		adminUserInfo.AdminUser = &userAdmin
97
 		adminUserInfo.Subscibes = subscibes
97
 		adminUserInfo.Subscibes = subscibes
98
 		this.SetSession("admin_user_info", &adminUserInfo)
98
 		this.SetSession("admin_user_info", &adminUserInfo)
316
 	this.BaseAPIController.Prepare()
316
 	this.BaseAPIController.Prepare()
317
 	if this.GetAdminUserInfo() == nil {
317
 	if this.GetAdminUserInfo() == nil {
318
 		var userAdmin models.AdminUser
318
 		var userAdmin models.AdminUser
319
-		userAdmin.Id = 1448
319
+		userAdmin.Id = 841
320
 		userAdmin.Mobile = "15717313968"
320
 		userAdmin.Mobile = "15717313968"
321
 
321
 
322
-		userAdmin.Id = 1 //4,809
322
+		userAdmin.Id = 841 //4,809
323
 		userAdmin.Mobile = "12222222222"
323
 		userAdmin.Mobile = "12222222222"
324
 		userAdmin.IsSuperAdmin = false
324
 		userAdmin.IsSuperAdmin = false
325
 		userAdmin.Status = 1
325
 		userAdmin.Status = 1
327
 		userAdmin.ModifyTime = 1530786071
327
 		userAdmin.ModifyTime = 1530786071
328
 		var subscibe models.ServeSubscibe
328
 		var subscibe models.ServeSubscibe
329
 		subscibe.ID = 11
329
 		subscibe.ID = 11
330
-		subscibe.OrgId = 3877 //机构id小英9675或4
330
+		subscibe.OrgId = 10191 //机构id小英10344或4
331
 		subscibe.PeriodStart = 1538035409
331
 		subscibe.PeriodStart = 1538035409
332
 		subscibe.PeriodEnd = 1569571409
332
 		subscibe.PeriodEnd = 1569571409
333
 		subscibe.State = 1
333
 		subscibe.State = 1
337
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
337
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
338
 		subscibes[4] = &subscibe
338
 		subscibes[4] = &subscibe
339
 		var adminUserInfo service.AdminUserInfo
339
 		var adminUserInfo service.AdminUserInfo
340
-		adminUserInfo.CurrentOrgId = 3877 //机构id小英9675或4
341
-		adminUserInfo.CurrentAppId = 3244 //4
340
+		adminUserInfo.CurrentOrgId = 10191 //机构id小英9675或4
341
+		adminUserInfo.CurrentAppId = 3467  //4
342
 		adminUserInfo.AdminUser = &userAdmin
342
 		adminUserInfo.AdminUser = &userAdmin
343
 		adminUserInfo.Subscibes = subscibes
343
 		adminUserInfo.Subscibes = subscibes
344
 		this.SetSession("admin_user_info", &adminUserInfo)
344
 		this.SetSession("admin_user_info", &adminUserInfo)

+ 3 - 0
controllers/dialysis_record_api_controller.go 查看文件

567
 	FilterPressure              string  `gorm:"column:filter_pressure" json:"filter_pressure" form:"filter_pressure"`
567
 	FilterPressure              string  `gorm:"column:filter_pressure" json:"filter_pressure" form:"filter_pressure"`
568
 	ReplacementSpeed            float64 `gorm:"column:replacement_speed" json:"replacement_speed" form:"replacement_speed"`
568
 	ReplacementSpeed            float64 `gorm:"column:replacement_speed" json:"replacement_speed" form:"replacement_speed"`
569
 	Dicarbonate                 float64 `gorm:"column:dicarbonate" json:"dicarbonate" form:"dicarbonate"`
569
 	Dicarbonate                 float64 `gorm:"column:dicarbonate" json:"dicarbonate" form:"dicarbonate"`
570
+	IsPressure                  string  `gorm:"column:is_pressure" json:"is_pressure" form:"is_pressure"`
570
 }
571
 }
571
 
572
 
572
 // /api/dislysis/monitor/edit [post]
573
 // /api/dislysis/monitor/edit [post]
715
 			FilterPressure:              monitorParam.FilterPressure,
716
 			FilterPressure:              monitorParam.FilterPressure,
716
 			ReplacementSpeed:            monitorParam.ReplacementSpeed,
717
 			ReplacementSpeed:            monitorParam.ReplacementSpeed,
717
 			Dicarbonate:                 monitorParam.Dicarbonate,
718
 			Dicarbonate:                 monitorParam.Dicarbonate,
719
+			IsPressure:                  monitorParam.IsPressure,
718
 		}
720
 		}
719
 		createErr := service.CreateMonitor(&monitor)
721
 		createErr := service.CreateMonitor(&monitor)
720
 
722
 
834
 		monitor.FilterPressure = monitorParam.FilterPressure
836
 		monitor.FilterPressure = monitorParam.FilterPressure
835
 		monitor.ReplacementSpeed = monitorParam.ReplacementSpeed
837
 		monitor.ReplacementSpeed = monitorParam.ReplacementSpeed
836
 		monitor.Dicarbonate = monitorParam.Dicarbonate
838
 		monitor.Dicarbonate = monitorParam.Dicarbonate
839
+		monitor.IsPressure = monitorParam.IsPressure
837
 		updateErr := service.UpdateMonitor(monitor)
840
 		updateErr := service.UpdateMonitor(monitor)
838
 		//记录日志
841
 		//记录日志
839
 		byterequest, _ := json.Marshal(monitor)
842
 		byterequest, _ := json.Marshal(monitor)

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

427
 func (this *MachineApiController) UpdateMachinetwo() {
427
 func (this *MachineApiController) UpdateMachinetwo() {
428
 	adminUserInfo := this.GetAdminUserInfo()
428
 	adminUserInfo := this.GetAdminUserInfo()
429
 	orgid := adminUserInfo.CurrentOrgId
429
 	orgid := adminUserInfo.CurrentOrgId
430
-	//fmt.Println("机构id", orgid)
431
 	dataBody := make(map[string]interface{}, 0)
430
 	dataBody := make(map[string]interface{}, 0)
432
 	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
431
 	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
433
-	//fmt.Println("错误是", err)
434
 	id := int64(dataBody["id"].(float64))
432
 	id := int64(dataBody["id"].(float64))
435
-	//fmt.Println("id是什么", id)
436
-	//serial_number := int64(dataBody["serial_number"].(float64))
437
 	bed_nunmber := dataBody["beds"].(string)
433
 	bed_nunmber := dataBody["beds"].(string)
438
-	//fmt.Print("机位号z", bes)
439
-	// bed_nunmber := strconv.FormatInt(bes,10)
440
 	serial_number := dataBody["serial_number"].(string)
434
 	serial_number := dataBody["serial_number"].(string)
441
-	//fmt.Println("序列号", serial_number)
442
 	device_type := int64(dataBody["devicetype"].(float64))
435
 	device_type := int64(dataBody["devicetype"].(float64))
443
-	//fmt.Println("设备类型", device_type)
444
-	//	bed_nunmber := dataBody["bed_number"].(string)
445
-	//fmt.Println("床位好", bed_nunmber)
446
 	device_name := dataBody["device_name"].(string)
436
 	device_name := dataBody["device_name"].(string)
447
-	//fmt.Println("设备名称", device_name)
448
 	manufacture_factory := dataBody["manufacture_factory"].(string)
437
 	manufacture_factory := dataBody["manufacture_factory"].(string)
449
-	//fmt.Println("生产厂家", manufacture_factory)
450
 	service_manufacturer := dataBody["service_manufacturer"].(string)
438
 	service_manufacturer := dataBody["service_manufacturer"].(string)
451
-	//fmt.Println("维修厂家", service_manufacturer)
452
 	unit_type := int64(dataBody["unit_type"].(float64))
439
 	unit_type := int64(dataBody["unit_type"].(float64))
453
-	//unit_type := strconv.FormatInt(unittype, 10)
454
-	//fmt.Println("设备型号", unit_type)
455
 	use_section := dataBody["use_section"].(string)
440
 	use_section := dataBody["use_section"].(string)
456
-	//fmt.Println("使用科室", use_section)
457
 	section_number := dataBody["section_number"].(string)
441
 	section_number := dataBody["section_number"].(string)
458
-	//fmt.Println("科室编号", section_number)
459
 	buy_date := dataBody["buy_date"].(string)
442
 	buy_date := dataBody["buy_date"].(string)
460
-	//fmt.Println("buy_date", buy_date)
461
 	timeLayout := "2006-01-02 15:04:05"
443
 	timeLayout := "2006-01-02 15:04:05"
462
 	theTime, err := utils.ParseTimeStringToTime(timeLayout, buy_date+" 00:00:00")
444
 	theTime, err := utils.ParseTimeStringToTime(timeLayout, buy_date+" 00:00:00")
463
 	buydate := theTime.Unix()
445
 	buydate := theTime.Unix()
465
 	if int_num < 0 {
447
 	if int_num < 0 {
466
 		buydate = 0
448
 		buydate = 0
467
 	}
449
 	}
468
-	//fmt.Println("购买日期", buydate)
469
 	install_date := dataBody["install_date"].(string)
450
 	install_date := dataBody["install_date"].(string)
470
 	toTime, err := utils.ParseTimeStringToTime(timeLayout, install_date+" 00:00:00")
451
 	toTime, err := utils.ParseTimeStringToTime(timeLayout, install_date+" 00:00:00")
471
 	installdate := toTime.Unix()
452
 	installdate := toTime.Unix()
473
 	if buy_num < 0 {
454
 	if buy_num < 0 {
474
 		installdate = 0
455
 		installdate = 0
475
 	}
456
 	}
476
-	//fmt.Println("安装日期", installdate)
477
-
478
 	start_date := dataBody["start_date"].(string)
457
 	start_date := dataBody["start_date"].(string)
479
 	stringToTime, err := utils.ParseTimeStringToTime(timeLayout, start_date+" 00:00:00")
458
 	stringToTime, err := utils.ParseTimeStringToTime(timeLayout, start_date+" 00:00:00")
480
 	startdate := stringToTime.Unix()
459
 	startdate := stringToTime.Unix()
482
 	if start_num < 0 {
461
 	if start_num < 0 {
483
 		startdate = 0
462
 		startdate = 0
484
 	}
463
 	}
485
-	//fmt.Println("启用日期", startdate)
486
 	maintenance_engineer := dataBody["maintenance_engineer"].(string)
464
 	maintenance_engineer := dataBody["maintenance_engineer"].(string)
487
-	//fmt.Println("维修工程", maintenance_engineer)
488
 	telephone := dataBody["telephone"].(string)
465
 	telephone := dataBody["telephone"].(string)
489
-	//fmt.Println("telephone", telephone)
490
 	guarantee_date := dataBody["guarantee_date"].(string)
466
 	guarantee_date := dataBody["guarantee_date"].(string)
491
-	//fmt.Println("保修期限", guarantee_date)
492
 	machine_status := int64(dataBody["machine_status"].(float64))
467
 	machine_status := int64(dataBody["machine_status"].(float64))
493
-	//fmt.Println("机器状态", machine_status)
494
 	user_total := dataBody["user_total"].(string)
468
 	user_total := dataBody["user_total"].(string)
495
-	//fmt.Println("初次使用次数", user_total)
496
 	remarks := dataBody["remarks"].(string)
469
 	remarks := dataBody["remarks"].(string)
497
-	//fmt.Println("备注", remarks)
498
 	rubbish_date := dataBody["rubbish_date"].(string)
470
 	rubbish_date := dataBody["rubbish_date"].(string)
499
 	timeStringToTime, err := utils.ParseTimeStringToTime(timeLayout, rubbish_date+" 00:00:00")
471
 	timeStringToTime, err := utils.ParseTimeStringToTime(timeLayout, rubbish_date+" 00:00:00")
500
 	rubbishdate := timeStringToTime.Unix()
472
 	rubbishdate := timeStringToTime.Unix()
502
 	if rubb_num < 0 {
474
 	if rubb_num < 0 {
503
 		rubbishdate = 0
475
 		rubbishdate = 0
504
 	}
476
 	}
505
-	//fmt.Println("报废日期", rubbishdate)
506
 	rubbish_reason := int64(dataBody["rubbish_reason"].(float64))
477
 	rubbish_reason := int64(dataBody["rubbish_reason"].(float64))
507
-	//fmt.Println("报废原因", rubbish_reason)
508
 	user_year := dataBody["user_year"].(string)
478
 	user_year := dataBody["user_year"].(string)
509
-	//fmt.Println("使用年限", user_year)
510
 	work_time := dataBody["work_time"].(string)
479
 	work_time := dataBody["work_time"].(string)
511
-	//fmt.Println("工作时长", work_time)
512
 	disinfection_mode := int64(dataBody["Disinfection_mode"].(float64))
480
 	disinfection_mode := int64(dataBody["Disinfection_mode"].(float64))
513
 
481
 
514
 	revers_modes := int64(dataBody["revers_mode"].(float64))
482
 	revers_modes := int64(dataBody["revers_mode"].(float64))
542
 		ReversMode:          revers_modes,
510
 		ReversMode:          revers_modes,
543
 		ZoneId:              zone_id,
511
 		ZoneId:              zone_id,
544
 	}
512
 	}
545
-	fmt.Println("addmacher", addmacher)
546
 	err = service.UpdateMachine(id, orgid, &addmacher)
513
 	err = service.UpdateMachine(id, orgid, &addmacher)
547
 	fmt.Println("报错", err)
514
 	fmt.Println("报错", err)
548
 	if err != nil {
515
 	if err != nil {

+ 4 - 0
controllers/mobile_api_controllers/dialysis_api_controller_extend.go 查看文件

109
 	filter_pressure := this.GetString("filter_pressure")
109
 	filter_pressure := this.GetString("filter_pressure")
110
 	replacement_speed, _ := this.GetFloat("replacement_speed")
110
 	replacement_speed, _ := this.GetFloat("replacement_speed")
111
 	dicarbonate, _ := this.GetFloat("dicarbonate")
111
 	dicarbonate, _ := this.GetFloat("dicarbonate")
112
+	is_pressure := this.GetString("is_pressure")
112
 	adminInfo := this.GetMobileAdminUserInfo()
113
 	adminInfo := this.GetMobileAdminUserInfo()
113
 	patient, getPatientErr := service.MobileGetPatientById(adminInfo.Org.Id, patientID)
114
 	patient, getPatientErr := service.MobileGetPatientById(adminInfo.Org.Id, patientID)
114
 	if getPatientErr != nil {
115
 	if getPatientErr != nil {
201
 		FilterPressure:              filter_pressure,
202
 		FilterPressure:              filter_pressure,
202
 		Dicarbonate:                 dicarbonate,
203
 		Dicarbonate:                 dicarbonate,
203
 		ReplacementSpeed:            replacement_speed,
204
 		ReplacementSpeed:            replacement_speed,
205
+		IsPressure:                  is_pressure,
204
 	}
206
 	}
205
 
207
 
206
 	err := service.CreateMonitor(&record)
208
 	err := service.CreateMonitor(&record)
350
 	filter_pressure := this.GetString("filter_pressure")
352
 	filter_pressure := this.GetString("filter_pressure")
351
 	replacement_speed, _ := this.GetFloat("replacement_speed")
353
 	replacement_speed, _ := this.GetFloat("replacement_speed")
352
 	dicarbonate, _ := this.GetFloat("dicarbonate")
354
 	dicarbonate, _ := this.GetFloat("dicarbonate")
355
+	is_pressure := this.GetString("is_pressure")
353
 	monitor, err := service.GetMonitor(adminInfo.Org.Id, patientID, id)
356
 	monitor, err := service.GetMonitor(adminInfo.Org.Id, patientID, id)
354
 	if err != nil {
357
 	if err != nil {
355
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
358
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
409
 	monitor.HeparinAmount = heparin_amount
412
 	monitor.HeparinAmount = heparin_amount
410
 	monitor.Dehydration = dehydration
413
 	monitor.Dehydration = dehydration
411
 	monitor.FilterPressure = filter_pressure
414
 	monitor.FilterPressure = filter_pressure
415
+	monitor.IsPressure = is_pressure
412
 
416
 
413
 	// 查询信息规挡的设置天数
417
 	// 查询信息规挡的设置天数
414
 
418
 

+ 5 - 18
controllers/new_mobile_api_controllers/new_manage_api_controller.go 查看文件

100
 	orgid := adminUser.Org.Id
100
 	orgid := adminUser.Org.Id
101
 	bedid, _ := this.GetInt64("bed_id")
101
 	bedid, _ := this.GetInt64("bed_id")
102
 	start_time := this.GetString("start_time")
102
 	start_time := this.GetString("start_time")
103
-	//startdate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", start_time)
104
-	//startdateunix := startdate.Unix()
105
 	disinfectime, _ := this.GetInt64("disinfec_time")
103
 	disinfectime, _ := this.GetInt64("disinfec_time")
106
 	endtime := this.GetString("end_time")
104
 	endtime := this.GetString("end_time")
107
-	//enddate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", endtime)
108
-	//enddateunix := enddate.Unix()
109
-
110
 	scheduledate, _ := this.GetInt64("schedule_date")
105
 	scheduledate, _ := this.GetInt64("schedule_date")
111
 	zoneid, _ := this.GetInt64("zone_id")
106
 	zoneid, _ := this.GetInt64("zone_id")
112
 	patientid, _ := this.GetInt64("patient_id")
107
 	patientid, _ := this.GetInt64("patient_id")
153
 	fmt.Println("透析减少", dislysis.WeightLoss)
148
 	fmt.Println("透析减少", dislysis.WeightLoss)
154
 	//			//根据床位号获取设备id
149
 	//			//根据床位号获取设备id
155
 	addmacher, _ := service.GetEquimentIDTwo(bedid, orgid)
150
 	addmacher, _ := service.GetEquimentIDTwo(bedid, orgid)
156
-	//unitype, _ := strconv.ParseInt(addmacher.UnitType, 10, 64)
157
-	//fmt.Println(unitype)
151
+
158
 	plan, errplan := service.GetDisinfectionTwo(addmacher.UnitType, scheduletype, orgid)
152
 	plan, errplan := service.GetDisinfectionTwo(addmacher.UnitType, scheduletype, orgid)
159
-	//counts, errplan := service.GetUserTotalCount(orgid, bedid)
160
-	//var usertoal  int64
161
-	//fmt.Println(usertoal)
162
-	//for index, count := range counts {
163
-	//   if(index == 0){
164
-	//      usertoal = count.Total
165
-	//   }
166
-	//}
167
-	//usertotalint, errplan := strconv.ParseInt(addmacher.UserTotal, 10, 64)
168
-	//var total = usertoal + usertotalint
169
-	//totals := strconv.FormatInt(total, 10)
153
+
170
 	if errplan == gorm.ErrRecordNotFound {
154
 	if errplan == gorm.ErrRecordNotFound {
171
 		returnData := make(map[string]interface{}, 0)
155
 		returnData := make(map[string]interface{}, 0)
172
 		returnData["msstatus"] = "2"
156
 		returnData["msstatus"] = "2"
253
 	}
237
 	}
254
 	//查询今日所有设备使用登记
238
 	//查询今日所有设备使用登记
255
 	information, err := service.GetDeviceInfomation(orgid, recordDate.Unix())
239
 	information, err := service.GetDeviceInfomation(orgid, recordDate.Unix())
240
+	//获取所有设备型号
241
+	devicetype, _ := service.GetAllMode(orgid)
256
 	if err != nil {
242
 	if err != nil {
257
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
243
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
258
 		return
244
 		return
259
 	}
245
 	}
260
 	this.ServeSuccessJSON(map[string]interface{}{
246
 	this.ServeSuccessJSON(map[string]interface{}{
261
 		"information": information,
247
 		"information": information,
248
+		"devicetype":  devicetype,
262
 	})
249
 	})
263
 }
250
 }

+ 3 - 0
controllers/schedule_api_controller.go 查看文件

1842
 	}
1842
 	}
1843
 	schedule.IsExport = 1000
1843
 	schedule.IsExport = 1000
1844
 	err = service.CreateSchedule(&schedule, id)
1844
 	err = service.CreateSchedule(&schedule, id)
1845
+
1846
+	lastSchedule, _ := service.GetLastSchedule(patientID, adminUserInfo.CurrentOrgId)
1845
 	if err == nil {
1847
 	if err == nil {
1846
 		redis := service.RedisClient()
1848
 		redis := service.RedisClient()
1847
 		key := "scheduals_" + scheduleDate + "_" + strconv.FormatInt(adminUserInfo.CurrentOrgId, 10)
1849
 		key := "scheduals_" + scheduleDate + "_" + strconv.FormatInt(adminUserInfo.CurrentOrgId, 10)
1868
 			"msg":          "ok",
1870
 			"msg":          "ok",
1869
 			"schedule":     schedule,
1871
 			"schedule":     schedule,
1870
 			"schedule_two": schedule_two,
1872
 			"schedule_two": schedule_two,
1873
+			"lastSchedule": lastSchedule,
1871
 		})
1874
 		})
1872
 		return
1875
 		return
1873
 	} else {
1876
 	} else {

+ 97 - 1
controllers/sign_api_controller.go 查看文件

3
 import (
3
 import (
4
 	"XT_New/models"
4
 	"XT_New/models"
5
 	"XT_New/service"
5
 	"XT_New/service"
6
+	"encoding/base64"
6
 	"encoding/json"
7
 	"encoding/json"
7
 	"fmt"
8
 	"fmt"
8
 	"github.com/astaxie/beego"
9
 	"github.com/astaxie/beego"
9
 	"github.com/jung-kurt/gofpdf"
10
 	"github.com/jung-kurt/gofpdf"
11
+	"io/ioutil"
10
 	"time"
12
 	"time"
11
 )
13
 )
12
 
14
 
80
 	beego.Router("/api/device/createskdsendinformation", &SignApiController{}, "Post:CreateSdkSendInformation")
82
 	beego.Router("/api/device/createskdsendinformation", &SignApiController{}, "Post:CreateSdkSendInformation")
81
 
83
 
82
 	//删除
84
 	//删除
83
-	beego.Router("/api/device/tosavepdfinformation", &SignApiController{}, "Post:SavePdfInformation")
85
+	beego.Router("/api/device/tosavepdfinformation", &SignApiController{}, "Get:SavePdfInformation")
84
 
86
 
85
 }
87
 }
86
 
88
 
659
 func (this *SignApiController) SavePdfInformation() {
661
 func (this *SignApiController) SavePdfInformation() {
660
 
662
 
661
 	information, orderId := service.SavePdfInformation()
663
 	information, orderId := service.SavePdfInformation()
664
+
665
+	maprequest := make(map[string]interface{})
666
+
667
+	Receiver := make(map[string]interface{})
668
+
669
+	//业务单号
670
+	maprequest["orderId"] = "13318464642"
671
+
672
+	maprequest["signTitle"] = "新合同"
673
+
674
+	file := "C:/Users/28169/Desktop/2.pdf"
675
+
676
+	fileBytes, _ := ioutil.ReadFile(file) // 读取file
677
+
678
+	contractBase64 := base64.StdEncoding.EncodeToString(fileBytes) // 加密成base64字符串
679
+	//文件获取方式
680
+	maprequest["fileType"] = contractBase64
681
+	//合同内容
682
+	maprequest["fileContent"] = "绝密文件"
683
+
684
+	//签署用户人ID
685
+	maprequest["userId"] = "JMO9U8JH4TN8E3QOI0GUVUF2"
686
+
687
+	//业务单号
688
+	maprequest["receiver"] = Receiver
689
+
690
+	//签署人账号
691
+	Receiver["account"] = "13318464642"
692
+	//签署个人类型 1.个人 2.企业
693
+	Receiver["signerType"] = 1
694
+
695
+	//签署人姓名
696
+	Receiver["realName "] = "马文强"
697
+
698
+	// 证件类型
699
+	Receiver["cardType"] = 0
700
+
701
+	//证件编码
702
+	Receiver["cardNumber"] = "430526199408156511"
703
+
704
+	stepStamper := make([]map[string]interface{}, 0)
705
+	for _, item := range stepStamper {
706
+		fmt.Println(item)
707
+		keywordSignControls := make(map[string]interface{})
708
+		keywordSignControls["sealName"] = "1"
709
+		keywordSignControls["keyword"] = ""
710
+		keywordSignControls["pages"] = "0"
711
+		keywordSignControls["offsetX"] = "100"
712
+		keywordSignControls["offsetY"] = "100"
713
+		stepStamper = append(stepStamper, keywordSignControls)
714
+
715
+		crossSignControls := make(map[string]interface{})
716
+		crossSignControls["sealName"] = "2"
717
+		crossSignControls["positionX"] = "100"
718
+		crossSignControls["positionY"] = "100"
719
+		stepStamper = append(stepStamper, crossSignControls)
720
+
721
+		xySignControls := make(map[string]interface{})
722
+		xySignControls["sealName"] = "2"
723
+		xySignControls["positionX"] = "100"
724
+		xySignControls["positionY"] = "100"
725
+
726
+		stepStamper = append(stepStamper, xySignControls)
727
+	}
728
+
729
+	maprequest["stepStamper"] = stepStamper
730
+
731
+	seals := make([]map[string]interface{}, 0)
732
+
733
+	sealImages := make(map[string]interface{})
734
+	sealImages["sealBase64"] = "2"
735
+	sealImages["width"] = "100"
736
+	sealImages["height"] = "100"
737
+	sealImages["verticalAlign"] = "middle"
738
+
739
+	seals = append(seals, sealImages)
740
+
741
+	sealTexts := make(map[string]interface{})
742
+	sealTexts["text"] = "2"
743
+	sealTexts["fontSize"] = "100"
744
+	sealTexts["fontColor"] = "100"
745
+	sealTexts["isTextArea"] = true
746
+	sealTexts["textAlign"] = 0
747
+	sealTexts["width"] = 300
748
+	sealTexts["height"] = 300
749
+
750
+	seals = append(seals, sealTexts)
751
+
752
+	maprequest["seals"] = seals
753
+
754
+	maprequest["isUserWishes"] = true
755
+	maprequest["phone"] = "13318464642"
756
+	maprequest["verificationCode"] = "18888888888"
662
 	this.ServeSuccessJSON(map[string]interface{}{
757
 	this.ServeSuccessJSON(map[string]interface{}{
663
 		"information": information,
758
 		"information": information,
664
 		"orderId":     orderId,
759
 		"orderId":     orderId,
760
+		"maprequest":  maprequest,
665
 	})
761
 	})
666
 
762
 
667
 }
763
 }

+ 1 - 0
models/dialysis.go 查看文件

768
 	FilterPressure              string  `gorm:"column:filter_pressure" json:"filter_pressure" form:"filter_pressure"`
768
 	FilterPressure              string  `gorm:"column:filter_pressure" json:"filter_pressure" form:"filter_pressure"`
769
 	ReplacementSpeed            float64 `gorm:"column:replacement_speed" json:"replacement_speed" form:"replacement_speed"`
769
 	ReplacementSpeed            float64 `gorm:"column:replacement_speed" json:"replacement_speed" form:"replacement_speed"`
770
 	Dicarbonate                 float64 `gorm:"column:dicarbonate" json:"dicarbonate" form:"dicarbonate"`
770
 	Dicarbonate                 float64 `gorm:"column:dicarbonate" json:"dicarbonate" form:"dicarbonate"`
771
+	IsPressure                  string  `gorm:"column:is_pressure" json:"is_pressure" form:"is_pressure"`
771
 }
772
 }
772
 
773
 
773
 func (MonitoringRecord) TableName() string {
774
 func (MonitoringRecord) TableName() string {

+ 1 - 0
models/patient_models.go 查看文件

1625
 	ModeName                   string `gorm:"column:mode_name" json:"mode_name" form:"mode_name"`
1625
 	ModeName                   string `gorm:"column:mode_name" json:"mode_name" form:"mode_name"`
1626
 	ModeId                     int64  `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
1626
 	ModeId                     int64  `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
1627
 	SolutionStatus             int64  `gorm:"column:solution_status" json:"solution_status" form:"solution_status"`
1627
 	SolutionStatus             int64  `gorm:"column:solution_status" json:"solution_status" form:"solution_status"`
1628
+	Anticoagulant              int64  `gorm:"column:anticoagulant" json:"anticoagulant" form:"anticoagulant"`
1628
 }
1629
 }
1629
 
1630
 
1630
 func (VmDialysisSolutionOne) TableName() string {
1631
 func (VmDialysisSolutionOne) TableName() string {

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

671
 
671
 
672
 	offset := (page - 1) * limit
672
 	offset := (page - 1) * limit
673
 
673
 
674
-	err = db.Group("a.id").Order("a.ctime asc").Select("a.id,a.serial_number,a.device_type,a.bed_number,a.device_name,a.manufacture_factory,a.service_manufacturer,a.unit_type,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.bed_id,x.name,m.device_mode,n.number,i.equiment_id").Count(&total).
674
+	err = db.Group("a.id").Order("a.ctime asc").Select("a.id,a.serial_number,a.device_type,a.bed_number,a.device_name,a.manufacture_factory,a.service_manufacturer,a.unit_type,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.bed_id,a.zone_id,x.name,m.device_mode,n.number,i.equiment_id").Count(&total).
675
 		Joins("Left JOIN xt_device_mode as m on m.id = a.unit_type ").Joins("left join sgj_xt.xt_device_number as n on n.id = a.bed_id").Joins("Left JOIN sgj_xt.xt_device_zone as x On x.id = n.zone_id").Joins("left join xt_device_information as i on i.bed_number = a.bed_id").Offset(offset).Limit(limit).Scan(&addmahcer).Error
675
 		Joins("Left JOIN xt_device_mode as m on m.id = a.unit_type ").Joins("left join sgj_xt.xt_device_number as n on n.id = a.bed_id").Joins("Left JOIN sgj_xt.xt_device_zone as x On x.id = n.zone_id").Joins("left join xt_device_information as i on i.bed_number = a.bed_id").Offset(offset).Limit(limit).Scan(&addmahcer).Error
676
 
676
 
677
 	if err != nil {
677
 	if err != nil {

+ 7 - 0
service/schedule_service.go 查看文件

1732
 
1732
 
1733
 	return err
1733
 	return err
1734
 }
1734
 }
1735
+
1736
+func GetLastSchedule(patient_id int64, user_org_id int64) (models.XtSchedule, error) {
1737
+
1738
+	schedule := models.XtSchedule{}
1739
+	err := XTReadDB().Where("patient_id = ? and status =1 and user_org_id = ?", patient_id, user_org_id).Find(&schedule).Error
1740
+	return schedule, err
1741
+}

+ 7 - 3
service/sign_service.go 查看文件

1671
 	//业务单号
1671
 	//业务单号
1672
 	maprequest["orderId"] = "13318464642"
1672
 	maprequest["orderId"] = "13318464642"
1673
 
1673
 
1674
-	//合同标题
1675
-	maprequest["signType"] = "pdf"
1674
+	maprequest["signTitle"] = "新合同"
1676
 
1675
 
1677
 	file := "C:/Users/28169/Desktop/2.pdf"
1676
 	file := "C:/Users/28169/Desktop/2.pdf"
1678
 
1677
 
1685
 	maprequest["fileContent"] = "绝密文件"
1684
 	maprequest["fileContent"] = "绝密文件"
1686
 
1685
 
1687
 	//签署用户人ID
1686
 	//签署用户人ID
1688
-	maprequest["userId"] = ""
1687
+	maprequest["userId"] = "JMO9U8JH4TN8E3QOI0GUVUF2"
1689
 
1688
 
1690
 	//业务单号
1689
 	//业务单号
1691
 	maprequest["receiver"] = Receiver
1690
 	maprequest["receiver"] = Receiver
1732
 	maprequest["stepStamper"] = stepStamper
1731
 	maprequest["stepStamper"] = stepStamper
1733
 
1732
 
1734
 	seals := make([]map[string]interface{}, 0)
1733
 	seals := make([]map[string]interface{}, 0)
1734
+
1735
 	sealImages := make(map[string]interface{})
1735
 	sealImages := make(map[string]interface{})
1736
 	sealImages["sealBase64"] = "2"
1736
 	sealImages["sealBase64"] = "2"
1737
 	sealImages["width"] = "100"
1737
 	sealImages["width"] = "100"
1738
 	sealImages["height"] = "100"
1738
 	sealImages["height"] = "100"
1739
 	sealImages["verticalAlign"] = "middle"
1739
 	sealImages["verticalAlign"] = "middle"
1740
 
1740
 
1741
+	seals = append(seals, sealImages)
1742
+
1741
 	sealTexts := make(map[string]interface{})
1743
 	sealTexts := make(map[string]interface{})
1742
 	sealTexts["text"] = "2"
1744
 	sealTexts["text"] = "2"
1743
 	sealTexts["fontSize"] = "100"
1745
 	sealTexts["fontSize"] = "100"
1747
 	sealTexts["width"] = 300
1749
 	sealTexts["width"] = 300
1748
 	sealTexts["height"] = 300
1750
 	sealTexts["height"] = 300
1749
 
1751
 
1752
+	seals = append(seals, sealTexts)
1753
+
1750
 	maprequest["seals"] = seals
1754
 	maprequest["seals"] = seals
1751
 
1755
 
1752
 	maprequest["isUserWishes"] = true
1756
 	maprequest["isUserWishes"] = true