Browse Source

历史排班

28169 1 year ago
parent
commit
527b4b7c1d

+ 10 - 10
controllers/base_api_controller.go View File

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

+ 3 - 0
controllers/dialysis_record_api_controller.go View File

@@ -567,6 +567,7 @@ type EditMonitorParamObject struct {
567 567
 	FilterPressure              string  `gorm:"column:filter_pressure" json:"filter_pressure" form:"filter_pressure"`
568 568
 	ReplacementSpeed            float64 `gorm:"column:replacement_speed" json:"replacement_speed" form:"replacement_speed"`
569 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 573
 // /api/dislysis/monitor/edit [post]
@@ -715,6 +716,7 @@ func (this *DialysisRecordAPIController) EditMonitor() {
715 716
 			FilterPressure:              monitorParam.FilterPressure,
716 717
 			ReplacementSpeed:            monitorParam.ReplacementSpeed,
717 718
 			Dicarbonate:                 monitorParam.Dicarbonate,
719
+			IsPressure:                  monitorParam.IsPressure,
718 720
 		}
719 721
 		createErr := service.CreateMonitor(&monitor)
720 722
 
@@ -834,6 +836,7 @@ func (this *DialysisRecordAPIController) EditMonitor() {
834 836
 		monitor.FilterPressure = monitorParam.FilterPressure
835 837
 		monitor.ReplacementSpeed = monitorParam.ReplacementSpeed
836 838
 		monitor.Dicarbonate = monitorParam.Dicarbonate
839
+		monitor.IsPressure = monitorParam.IsPressure
837 840
 		updateErr := service.UpdateMonitor(monitor)
838 841
 		//记录日志
839 842
 		byterequest, _ := json.Marshal(monitor)

+ 0 - 33
controllers/manage_api_controller.go View File

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

+ 4 - 0
controllers/mobile_api_controllers/dialysis_api_controller_extend.go View File

@@ -109,6 +109,7 @@ func (this *DialysisAPIController) AddMonitorRecord() {
109 109
 	filter_pressure := this.GetString("filter_pressure")
110 110
 	replacement_speed, _ := this.GetFloat("replacement_speed")
111 111
 	dicarbonate, _ := this.GetFloat("dicarbonate")
112
+	is_pressure := this.GetString("is_pressure")
112 113
 	adminInfo := this.GetMobileAdminUserInfo()
113 114
 	patient, getPatientErr := service.MobileGetPatientById(adminInfo.Org.Id, patientID)
114 115
 	if getPatientErr != nil {
@@ -201,6 +202,7 @@ func (this *DialysisAPIController) AddMonitorRecord() {
201 202
 		FilterPressure:              filter_pressure,
202 203
 		Dicarbonate:                 dicarbonate,
203 204
 		ReplacementSpeed:            replacement_speed,
205
+		IsPressure:                  is_pressure,
204 206
 	}
205 207
 
206 208
 	err := service.CreateMonitor(&record)
@@ -350,6 +352,7 @@ func (this *DialysisAPIController) EditMonitorRecord() {
350 352
 	filter_pressure := this.GetString("filter_pressure")
351 353
 	replacement_speed, _ := this.GetFloat("replacement_speed")
352 354
 	dicarbonate, _ := this.GetFloat("dicarbonate")
355
+	is_pressure := this.GetString("is_pressure")
353 356
 	monitor, err := service.GetMonitor(adminInfo.Org.Id, patientID, id)
354 357
 	if err != nil {
355 358
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
@@ -409,6 +412,7 @@ func (this *DialysisAPIController) EditMonitorRecord() {
409 412
 	monitor.HeparinAmount = heparin_amount
410 413
 	monitor.Dehydration = dehydration
411 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 View File

@@ -100,13 +100,8 @@ func (this *NewManageApiController) SaveDisInfectionInfo() {
100 100
 	orgid := adminUser.Org.Id
101 101
 	bedid, _ := this.GetInt64("bed_id")
102 102
 	start_time := this.GetString("start_time")
103
-	//startdate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", start_time)
104
-	//startdateunix := startdate.Unix()
105 103
 	disinfectime, _ := this.GetInt64("disinfec_time")
106 104
 	endtime := this.GetString("end_time")
107
-	//enddate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04", endtime)
108
-	//enddateunix := enddate.Unix()
109
-
110 105
 	scheduledate, _ := this.GetInt64("schedule_date")
111 106
 	zoneid, _ := this.GetInt64("zone_id")
112 107
 	patientid, _ := this.GetInt64("patient_id")
@@ -153,20 +148,9 @@ func (this *NewManageApiController) SaveDisInfectionInfo() {
153 148
 	fmt.Println("透析减少", dislysis.WeightLoss)
154 149
 	//			//根据床位号获取设备id
155 150
 	addmacher, _ := service.GetEquimentIDTwo(bedid, orgid)
156
-	//unitype, _ := strconv.ParseInt(addmacher.UnitType, 10, 64)
157
-	//fmt.Println(unitype)
151
+
158 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 154
 	if errplan == gorm.ErrRecordNotFound {
171 155
 		returnData := make(map[string]interface{}, 0)
172 156
 		returnData["msstatus"] = "2"
@@ -253,11 +237,14 @@ func (this *NewManageApiController) GetDeviceInformation() {
253 237
 	}
254 238
 	//查询今日所有设备使用登记
255 239
 	information, err := service.GetDeviceInfomation(orgid, recordDate.Unix())
240
+	//获取所有设备型号
241
+	devicetype, _ := service.GetAllMode(orgid)
256 242
 	if err != nil {
257 243
 		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
258 244
 		return
259 245
 	}
260 246
 	this.ServeSuccessJSON(map[string]interface{}{
261 247
 		"information": information,
248
+		"devicetype":  devicetype,
262 249
 	})
263 250
 }

+ 3 - 0
controllers/schedule_api_controller.go View File

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

+ 97 - 1
controllers/sign_api_controller.go View File

@@ -3,10 +3,12 @@ package controllers
3 3
 import (
4 4
 	"XT_New/models"
5 5
 	"XT_New/service"
6
+	"encoding/base64"
6 7
 	"encoding/json"
7 8
 	"fmt"
8 9
 	"github.com/astaxie/beego"
9 10
 	"github.com/jung-kurt/gofpdf"
11
+	"io/ioutil"
10 12
 	"time"
11 13
 )
12 14
 
@@ -80,7 +82,7 @@ func SignApiRegistRouters() {
80 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,9 +661,103 @@ func (this *SignApiController) CreateSdkSendInformation() {
659 661
 func (this *SignApiController) SavePdfInformation() {
660 662
 
661 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 757
 	this.ServeSuccessJSON(map[string]interface{}{
663 758
 		"information": information,
664 759
 		"orderId":     orderId,
760
+		"maprequest":  maprequest,
665 761
 	})
666 762
 
667 763
 }

+ 1 - 0
models/dialysis.go View File

@@ -768,6 +768,7 @@ type MonitoringRecord struct {
768 768
 	FilterPressure              string  `gorm:"column:filter_pressure" json:"filter_pressure" form:"filter_pressure"`
769 769
 	ReplacementSpeed            float64 `gorm:"column:replacement_speed" json:"replacement_speed" form:"replacement_speed"`
770 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 774
 func (MonitoringRecord) TableName() string {

+ 1 - 0
models/patient_models.go View File

@@ -1625,6 +1625,7 @@ type VmDialysisSolutionOne struct {
1625 1625
 	ModeName                   string `gorm:"column:mode_name" json:"mode_name" form:"mode_name"`
1626 1626
 	ModeId                     int64  `gorm:"column:mode_id" json:"mode_id" form:"mode_id"`
1627 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 1631
 func (VmDialysisSolutionOne) TableName() string {

+ 1 - 1
service/device_service.go View File

@@ -671,7 +671,7 @@ func GetAllMachineInfo(page int64, limit int64, keyword string, zoneid int64, eq
671 671
 
672 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 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 677
 	if err != nil {

+ 7 - 0
service/schedule_service.go View File

@@ -1732,3 +1732,10 @@ func CreateScheduleLog(log models.XtScheduleLog) error {
1732 1732
 
1733 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 View File

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