Browse Source

历史排班

28169 1 year ago
parent
commit
73f734fdf4

+ 19 - 4
controllers/dialysis_api_controller.go View File

@@ -360,6 +360,8 @@ func (c *DialysisApiController) PostPrescription() {
360 360
 	prescription_water, _ := c.GetFloat("prescription_water")
361 361
 	dialysis_strainer := c.GetString("dialysis_strainer")
362 362
 	chaptalization := c.GetString("chaptalization")
363
+	washing_time := c.GetString("washing_time")
364
+	warsh_count := c.GetString("warsh_count")
363 365
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentOrgId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
364 366
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.CurrentOrgId)
365 367
 
@@ -478,6 +480,8 @@ func (c *DialysisApiController) PostPrescription() {
478 480
 		PrescriptionWater:          prescription_water,
479 481
 		DialysisStrainer:           dialysis_strainer,
480 482
 		Chaptalization:             chaptalization,
483
+		WarshCount:                 warsh_count,
484
+		WashingTime:                washing_time,
481 485
 	}
482 486
 
483 487
 	//长沙南雅医院,自动生成抗凝剂的临时处方
@@ -1003,6 +1007,8 @@ func (c *DialysisApiController) PostSoulution() {
1003 1007
 	prescription_water, _ := c.GetFloat("prescription_water")
1004 1008
 	dialysis_strainer := c.GetString("dialysis_strainer")
1005 1009
 	chaptalization := c.GetString("chaptalization")
1010
+	warsh_count := c.GetString("warsh_count")
1011
+	washing_time := c.GetString("washing_time")
1006 1012
 	var prescription_doctor int64
1007 1013
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.CurrentAppId, adminUserInfo.AdminUser.Id, adminUserInfo.CurrentAppId)
1008 1014
 
@@ -1171,6 +1177,8 @@ func (c *DialysisApiController) PostSoulution() {
1171 1177
 		PrescriptionWater:          prescription_water,
1172 1178
 		DialysisStrainer:           dialysis_strainer,
1173 1179
 		Chaptalization:             chaptalization,
1180
+		WarshCount:                 warsh_count,
1181
+		WashingTime:                washing_time,
1174 1182
 	}
1175 1183
 
1176 1184
 	if prescription.Anticoagulant == 0 {
@@ -1377,6 +1385,8 @@ func (c *DialysisApiController) PostSoulution() {
1377 1385
 		PrescriptionWater:          prescribing_number,
1378 1386
 		DialysisStrainer:           dialysis_strainer,
1379 1387
 		Chaptalization:             chaptalization,
1388
+		WarshCount:                 warsh_count,
1389
+		WashingTime:                washing_time,
1380 1390
 	}
1381 1391
 
1382 1392
 	if solution.Anticoagulant == 0 {
@@ -2521,13 +2531,15 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
2521 2531
 		if dialysisFinish.ID == 0 {
2522 2532
 			service.CreateDialysisFinish(finish)
2523 2533
 		}
2524
-		if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10469 {
2534
+		if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10469 || adminUserInfo.CurrentOrgId == 10551 {
2525 2535
 			var dewater_amount float64
2526 2536
 			dewater_amount = 0
2527 2537
 			if dry_weight > 0 {
2528 2538
 				dewater_amount = weight_before - dry_weight - additional_weight
2529 2539
 
2530
-				dewater_amount = dewater_amount * 1000
2540
+				if adminUserInfo.CurrentOrgId != 10551 {
2541
+					dewater_amount = dewater_amount * 1000
2542
+				}
2531 2543
 
2532 2544
 				if dewater_amount <= 0 {
2533 2545
 					dewater_amount = 0
@@ -2827,8 +2839,11 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
2827 2839
 		dewater_amount = 0
2828 2840
 		if evaluation.DryWeight > 0 {
2829 2841
 			dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
2830
-			if templateInfo.TemplateId == 17 || templateInfo.TemplateId == 22 || templateInfo.TemplateId == 21 || templateInfo.TemplateId == 34 {
2831
-				dewater_amount = dewater_amount * 1000
2842
+			if templateInfo.TemplateId == 17 || templateInfo.TemplateId == 22 || templateInfo.TemplateId == 21 || templateInfo.TemplateId == 34 || adminUserInfo.CurrentOrgId == 10551 {
2843
+				if adminUserInfo.CurrentOrgId != 10551 {
2844
+					dewater_amount = dewater_amount * 1000
2845
+				}
2846
+
2832 2847
 			}
2833 2848
 			if dewater_amount <= 0 {
2834 2849
 				dewater_amount = 0

+ 29 - 4
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -1808,6 +1808,8 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1808 1808
 	prescription_water, _ := c.GetFloat("prescription_water")
1809 1809
 	dialysis_strainer := c.GetString("dialysis_strainer")
1810 1810
 	chaptalization := c.GetString("chaptalization")
1811
+	washing_time := c.GetString("washing_time")
1812
+	warsh_count := c.GetString("warsh_count")
1811 1813
 	appRole, _ := service.FindAdminRoleTypeById(adminUserInfo.Org.Id, adminUserInfo.AdminUser.Id, adminUserInfo.App.Id)
1812 1814
 
1813 1815
 	//template, _ := service.GetOrgInfoTemplate(adminUserInfo.Org.Id)
@@ -1968,6 +1970,8 @@ func (c *DialysisAPIController) PostDialysisPrescription() {
1968 1970
 		PrescriptionWater:          prescription_water,
1969 1971
 		DialysisStrainer:           dialysis_strainer,
1970 1972
 		Chaptalization:             chaptalization,
1973
+		WashingTime:                washing_time,
1974
+		WarshCount:                 warsh_count,
1971 1975
 	}
1972 1976
 
1973 1977
 	//查询最近透析准备表里是否存在 透析器 灌流器
@@ -3381,12 +3385,17 @@ func (this *DialysisAPIController) StartDialysis() {
3381 3385
 			}
3382 3386
 
3383 3387
 			//针对
3384
-			if adminUserInfo.Org.Id == 10471 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10460 || adminUserInfo.Org.Id == 10551 {
3388
+			if adminUserInfo.Org.Id == 10471 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10460 {
3385 3389
 
3386 3390
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
3387 3391
 				ultrafiltration_rate = ultrafiltration_rate / 1000
3388 3392
 			}
3389 3393
 
3394
+			if adminUserInfo.Org.Id == 10551 {
3395
+				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 1000 / float64(totalMin) * 60 * 1000)
3396
+				ultrafiltration_rate = ultrafiltration_rate / 1000
3397
+			}
3398
+
3390 3399
 		}
3391 3400
 	}
3392 3401
 
@@ -3680,6 +3689,8 @@ func (c *DialysisAPIController) PostSolution() {
3680 3689
 	prescription_water, _ := c.GetFloat("prescription_water")
3681 3690
 	dialysis_strainer := c.GetString("dialysis_strainer")
3682 3691
 	chaptalization := c.GetString("chaptalization")
3692
+	washing_time := c.GetString("washing_time")
3693
+	warsh_count := c.GetString("warsh_count")
3683 3694
 	if mode_id > 0 {
3684 3695
 
3685 3696
 		var str string
@@ -3838,6 +3849,8 @@ func (c *DialysisAPIController) PostSolution() {
3838 3849
 		PrescriptionWater:          prescription_water,
3839 3850
 		DialysisStrainer:           dialysis_strainer,
3840 3851
 		Chaptalization:             chaptalization,
3852
+		WashingTime:                washing_time,
3853
+		WarshCount:                 warsh_count,
3841 3854
 	}
3842 3855
 
3843 3856
 	_, dialysisPrescription := service.FindDialysisPrescriptionByReordDate(id, recordDate.Unix(), adminUserInfo.Org.Id)
@@ -3962,6 +3975,8 @@ func (c *DialysisAPIController) PostSolution() {
3962 3975
 		PrescriptionWater:          prescription_water,
3963 3976
 		DialysisStrainer:           dialysis_strainer,
3964 3977
 		Chaptalization:             chaptalization,
3978
+		WashingTime:                washing_time,
3979
+		WarshCount:                 warsh_count,
3965 3980
 	}
3966 3981
 
3967 3982
 	//针对河间咸的
@@ -4328,7 +4343,6 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
4328 4343
 
4329 4344
 			totalMin := prescription.DialysisDurationHour*60 + prescription.DialysisDurationMinute
4330 4345
 			if (template.TemplateId == 6 || template.TemplateId == 65 || adminInfo.Org.Id == 10375) && adminInfo.Org.Id != 9538 {
4331
-				fmt.Println("hahhdahahah")
4332 4346
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
4333 4347
 				record.UltrafiltrationRate = ultrafiltration_rate
4334 4348
 
@@ -4392,13 +4406,18 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
4392 4406
 
4393 4407
 			}
4394 4408
 
4395
-			if adminInfo.Org.Id == 10460 || adminInfo.Org.Id == 10551 {
4409
+			if adminInfo.Org.Id == 10460 {
4396 4410
 
4397 4411
 				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration / float64(totalMin) * 60 * 1000)
4398 4412
 				record.UltrafiltrationRate = ultrafiltration_rate / 1000
4399 4413
 
4400 4414
 			}
4401 4415
 
4416
+			if adminInfo.Org.Id == 10551 {
4417
+				ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 1000 / float64(totalMin) * 60 * 1000)
4418
+				record.UltrafiltrationRate = ultrafiltration_rate / 1000
4419
+			}
4420
+
4402 4421
 			//if template.TemplateId == 47 {
4403 4422
 			//	ultrafiltration_rate = math.Floor(prescription.TargetUltrafiltration * 60 / float64(totalMin))
4404 4423
 			//	record.UltrafiltrationRate = ultrafiltration_rate
@@ -4442,8 +4461,14 @@ func (this *DialysisAPIController) GetLastMonitorRecordTody() {
4442 4461
 		record.UltrafiltrationVolume = ultrafiltration_volume / 1000
4443 4462
 	}
4444 4463
 
4445
-	if adminInfo.Org.Id == 10460 || adminInfo.Org.Id == 10551 {
4464
+	if adminInfo.Org.Id == 10460 {
4465
+
4466
+		ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
4467
+
4468
+		record.UltrafiltrationVolume = ultrafiltration_volume / 1000
4469
+	}
4446 4470
 
4471
+	if adminInfo.Org.Id == 10551 {
4447 4472
 		ultrafiltration_volume := math.Floor(float64(record.OperateTime+3600-fristrecord.OperateTime) / 3600 * ultrafiltration_rate)
4448 4473
 
4449 4474
 		record.UltrafiltrationVolume = ultrafiltration_volume / 1000

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

@@ -2602,8 +2602,11 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
2602 2602
 	if evaluation.DryWeight > 0 {
2603 2603
 		dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
2604 2604
 
2605
-		if template.TemplateId == 17 || template.TemplateId == 22 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 34 || template.TemplateId == 32 || adminUserInfo.Org.Id == 10469 || adminUserInfo.Org.Id == 3877 {
2606
-			dewater_amount = dewater_amount * 1000
2605
+		if template.TemplateId == 17 || template.TemplateId == 22 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 34 || template.TemplateId == 32 || adminUserInfo.Org.Id == 10469 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10551 {
2606
+
2607
+			if adminUserInfo.Org.Id != 10551 {
2608
+				dewater_amount = dewater_amount * 1000
2609
+			}
2607 2610
 
2608 2611
 		}
2609 2612
 

+ 13 - 0
controllers/sign_api_controller.go View File

@@ -79,6 +79,9 @@ func SignApiRegistRouters() {
79 79
 	//发送消息
80 80
 	beego.Router("/api/device/createskdsendinformation", &SignApiController{}, "Post:CreateSdkSendInformation")
81 81
 
82
+	//删除
83
+	beego.Router("/api/device/tosavepdfinformation", &SignApiController{}, "Post:SavePdfInformation")
84
+
82 85
 }
83 86
 
84 87
 // 短信服务接口
@@ -652,3 +655,13 @@ func (this *SignApiController) CreateSdkSendInformation() {
652 655
 		"orderId":     orderId,
653 656
 	})
654 657
 }
658
+
659
+func (this *SignApiController) SavePdfInformation() {
660
+
661
+	information, orderId := service.SavePdfInformation()
662
+	this.ServeSuccessJSON(map[string]interface{}{
663
+		"information": information,
664
+		"orderId":     orderId,
665
+	})
666
+
667
+}

+ 4 - 0
models/patient_models.go View File

@@ -376,6 +376,8 @@ type DialysisPrescription struct {
376 376
 	PrescriptionWater          float64       `gorm:"column:prescription_water" json:"prescription_water" form:"prescription_water"`
377 377
 	DialysisStrainer           string        `gorm:"column:dialysis_strainer" json:"dialysis_strainer" form:"dialysis_strainer"`
378 378
 	Chaptalization             string        `gorm:"column:chaptalization" json:"chaptalization" form:"chaptalization"`
379
+	WarshCount                 string        `gorm:"column:warsh_count" json:"warsh_count" form:"warsh_count"`
380
+	WashingTime                string        `gorm:"column:washing_time" json:"washing_time" form:"washing_time"`
379 381
 }
380 382
 
381 383
 func (DialysisPrescription) TableName() string {
@@ -594,6 +596,8 @@ type DialysisSolution struct {
594 596
 	PrescriptionWater          float64 `gorm:"column:prescription_water" json:"prescription_water" form:"prescription_water"`
595 597
 	DialysisStrainer           string  `gorm:"column:dialysis_strainer" json:"dialysis_strainer" form:"dialysis_strainer"`
596 598
 	Chaptalization             string  `gorm:"column:chaptalization" json:"chaptalization" form:"chaptalization"`
599
+	WarshCount                 string  `gorm:"column:warsh_count" json:"warsh_count" form:"warsh_count"`
600
+	WashingTime                string  `gorm:"column:washing_time" json:"washing_time" form:"washing_time"`
597 601
 }
598 602
 
599 603
 func (DialysisSolution) TableName() string {

+ 8 - 1
service/manage_service.go View File

@@ -1793,7 +1793,14 @@ func DeleteObjectTableDisinfect(id int64) error {
1793 1793
 
1794 1794
 func GetAirDisInfectionLongTime(user_org_id int64, storey string) (list []*models.XtNewAriDisinfect, err error) {
1795 1795
 
1796
-	err = XTReadDB().Where("user_org_id = ? and status = 1 and storey = ?", user_org_id, storey).Order("id desc").First(&list).Error
1796
+	db := XTReadDB().Model(&list).Where("status =1")
1797
+	if user_org_id > 0 {
1798
+		db = db.Where("user_org_id =?", user_org_id)
1799
+	}
1800
+	if len(storey) > 0 {
1801
+		db = db.Where("storey =?", storey)
1802
+	}
1803
+	err = db.Order("id desc").First(&list).Error
1797 1804
 	return
1798 1805
 }
1799 1806
 

+ 140 - 0
service/sign_service.go View File

@@ -1658,3 +1658,143 @@ func CreateSdkSendInformation() (string, string) {
1658 1658
 	//fmt.Println("str", orderId)
1659 1659
 	return str, orderId
1660 1660
 }
1661
+
1662
+func SavePdfInformation() (string, string) {
1663
+
1664
+	var url string
1665
+
1666
+	url = "http://localhost:8890/sdk/pdf/sign"
1667
+	maprequest := make(map[string]interface{})
1668
+
1669
+	Receiver := make(map[string]interface{})
1670
+
1671
+	//业务单号
1672
+	maprequest["orderId"] = "13318464642"
1673
+
1674
+	//合同标题
1675
+	maprequest["signType"] = "pdf"
1676
+
1677
+	file := "C:/Users/28169/Desktop/2.pdf"
1678
+
1679
+	fileBytes, err := ioutil.ReadFile(file) // 读取file
1680
+
1681
+	contractBase64 := base64.StdEncoding.EncodeToString(fileBytes) // 加密成base64字符串
1682
+	//文件获取方式
1683
+	maprequest["fileType"] = contractBase64
1684
+	//合同内容
1685
+	maprequest["fileContent"] = "绝密文件"
1686
+
1687
+	//签署用户人ID
1688
+	maprequest["userId"] = ""
1689
+
1690
+	//业务单号
1691
+	maprequest["receiver"] = Receiver
1692
+
1693
+	//签署人账号
1694
+	Receiver["account"] = "13318464642"
1695
+	//签署个人类型 1.个人 2.企业
1696
+	Receiver["signerType"] = 1
1697
+
1698
+	//签署人姓名
1699
+	Receiver["realName "] = "马文强"
1700
+
1701
+	// 证件类型
1702
+	Receiver["cardType"] = 0
1703
+
1704
+	//证件编码
1705
+	Receiver["cardNumber"] = "430526199408156511"
1706
+
1707
+	stepStamper := make([]map[string]interface{}, 0)
1708
+
1709
+	keywordSignControls := make(map[string]interface{})
1710
+
1711
+	keywordSignControls["sealName"] = "1"
1712
+	keywordSignControls["keyword"] = ""
1713
+	keywordSignControls["pages"] = "0"
1714
+	keywordSignControls["offsetX"] = "100"
1715
+	keywordSignControls["offsetY"] = "100"
1716
+
1717
+	stepStamper = append(stepStamper, keywordSignControls)
1718
+
1719
+	crossSignControls := make(map[string]interface{})
1720
+	crossSignControls["sealName"] = "2"
1721
+	crossSignControls["positionX"] = "100"
1722
+	crossSignControls["positionY"] = "100"
1723
+	stepStamper = append(stepStamper, crossSignControls)
1724
+
1725
+	xySignControls := make(map[string]interface{})
1726
+	xySignControls["sealName"] = "2"
1727
+	xySignControls["positionX"] = "100"
1728
+	xySignControls["positionY"] = "100"
1729
+
1730
+	stepStamper = append(stepStamper, xySignControls)
1731
+
1732
+	maprequest["stepStamper"] = stepStamper
1733
+
1734
+	seals := make([]map[string]interface{}, 0)
1735
+	sealImages := make(map[string]interface{})
1736
+	sealImages["sealBase64"] = "2"
1737
+	sealImages["width"] = "100"
1738
+	sealImages["height"] = "100"
1739
+	sealImages["verticalAlign"] = "middle"
1740
+
1741
+	sealTexts := make(map[string]interface{})
1742
+	sealTexts["text"] = "2"
1743
+	sealTexts["fontSize"] = "100"
1744
+	sealTexts["fontColor"] = "100"
1745
+	sealTexts["isTextArea"] = true
1746
+	sealTexts["textAlign"] = 0
1747
+	sealTexts["width"] = 300
1748
+	sealTexts["height"] = 300
1749
+
1750
+	maprequest["seals"] = seals
1751
+
1752
+	maprequest["isUserWishes"] = true
1753
+	maprequest["phone"] = "13318464642"
1754
+	maprequest["verificationCode"] = "18888888888"
1755
+
1756
+	byterequest, _ := json.Marshal(maprequest)
1757
+
1758
+	appId := beego.AppConfig.String("sign_appid")
1759
+
1760
+	serviceKye := beego.AppConfig.String("serviceKye")
1761
+
1762
+	reader := bytes.NewReader(byterequest)
1763
+	serviceCode := beego.AppConfig.String("serviceCode")
1764
+	signatureStr, _ := generateHMACSHA1SignatureOne(maprequest, serviceKye, serviceCode)
1765
+
1766
+	request, err := http.NewRequest("POST", url, reader)
1767
+	if err != nil {
1768
+		fmt.Println(err.Error())
1769
+	}
1770
+	fmt.Println("请求参数", request)
1771
+	fmt.Println("Content-Signature", signatureStr)
1772
+
1773
+	request.Header.Set("appId", appId)
1774
+	request.Header.Set("appKey", serviceKye)
1775
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
1776
+	request.Header.Set("Content-Signature", signatureStr)
1777
+	client := http.Client{}
1778
+
1779
+	resp, err := client.Do(request)
1780
+
1781
+	if err != nil {
1782
+		fmt.Println(err.Error())
1783
+
1784
+	}
1785
+	respBytes, err := ioutil.ReadAll(resp.Body)
1786
+	if err != nil {
1787
+		fmt.Println(err.Error())
1788
+
1789
+	}
1790
+	str := string(respBytes)
1791
+
1792
+	var respJSON map[string]interface{}
1793
+	if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
1794
+		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
1795
+	}
1796
+	var orderId string
1797
+	//orderId = respJSON["data"].(map[string]interface{})["orderId"].(string)
1798
+	//fmt.Println("str", orderId)
1799
+	return str, orderId
1800
+}