Browse Source

历史排班

28169 1 year ago
parent
commit
1ffb2b91d2

+ 4 - 2
controllers/doctors_api_controller.go View File

@@ -103,8 +103,9 @@ func (c *DoctorsApiController) ScheduleAdvices() {
103 103
 	config, _ := service.GetHisDoctorConfig(orgID)
104 104
 	project_config, _ := service.GetHisProjectConfig(orgID)
105 105
 
106
+	var keyword string
106 107
 	if config.IsOpen == 0 || config.IsOpen == 2 {
107
-		scheduals, err := service.MobileGetScheduleDoctorAdvicesOne(orgID, date.Unix(), adviceType, patientType, adminUserInfo.AdminUser.Id, delivery_way, schedule_type, partition_type, patient_id, excution_way, 0, execution_frequency)
108
+		scheduals, err := service.MobileGetScheduleDoctorAdvicesOne(orgID, date.Unix(), adviceType, patientType, adminUserInfo.AdminUser.Id, delivery_way, schedule_type, partition_type, patient_id, excution_way, 0, execution_frequency, keyword)
108 109
 		adminUser, _ := service.GetAllAdminUsers(orgID, adminUserInfo.CurrentAppId)
109 110
 		if err != nil {
110 111
 			c.ErrorLog("获取排班信息失败:%v", err)
@@ -1393,6 +1394,7 @@ func (c *DoctorsApiController) GetScheduleAdvicesList() {
1393 1394
 	excution_way, _ := c.GetInt64("excution_way")
1394 1395
 	cost_type, _ := c.GetInt64("cost_type")
1395 1396
 	execution_frequency := c.GetString("execution_frequency")
1397
+	keyword := c.GetString("keyword")
1396 1398
 	if adviceType != 1 && adviceType != 3 && adviceType != 2 {
1397 1399
 		adviceType = 0
1398 1400
 	}
@@ -1415,7 +1417,7 @@ func (c *DoctorsApiController) GetScheduleAdvicesList() {
1415 1417
 	project_config, _ := service.GetHisProjectConfig(orgID)
1416 1418
 
1417 1419
 	if config.IsOpen == 0 || config.IsOpen == 2 {
1418
-		scheduals, err := service.MobileGetScheduleDoctorAdvicesOne(orgID, date.Unix(), adviceType, patientType, adminUserInfo.AdminUser.Id, delivery_way, schedule_type, partition_type, patient_id, excution_way, cost_type, execution_frequency)
1420
+		scheduals, err := service.MobileGetScheduleDoctorAdvicesOne(orgID, date.Unix(), adviceType, patientType, adminUserInfo.AdminUser.Id, delivery_way, schedule_type, partition_type, patient_id, excution_way, cost_type, execution_frequency, keyword)
1419 1421
 		adminUser, _ := service.GetAllAdminUsers(orgID, adminUserInfo.CurrentAppId)
1420 1422
 		if err != nil {
1421 1423
 			c.ErrorLog("获取排班信息失败:%v", err)

+ 75 - 2
controllers/his_api_controller.go View File

@@ -1817,12 +1817,22 @@ func (c *HisApiController) CreateHisPrescription() {
1817 1817
 								//查询该药品是否存在开药记录
1818 1818
 								advicelist, _ := service.GetHisAdviceListByDrugIdEight(drug_id, patient_id, recordDateTime, adviceId)
1819 1819
 
1820
+								fmt.Println("wooooooooooooo", advicelist.ID)
1821
+								fmt.Println("prescribingNumberUnit", prescribingNumberUnit)
1822
+								fmt.Println("prescribingNumberUnit", drug.MinUnit)
1823
+								fmt.Println("prescribingNumberUnit", drug.MaxUnit)
1820 1824
 								//新增处方
1821 1825
 								if advicelist.ID == 0 {
1822 1826
 									all_count, _ := strconv.ParseFloat(totals, 64)
1823 1827
 									if prescribingNumberUnit == drug.MinUnit {
1824
-
1828
+										fmt.Println("prescribing_number", prescribing_number)
1829
+										fmt.Println("all_count", all_count)
1825 1830
 										if drug.IsUse != 1 {
1831
+											if all_count == 0 {
1832
+												c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
1833
+												return
1834
+											}
1835
+
1826 1836
 											if prescribing_number > all_count {
1827 1837
 												c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
1828 1838
 												return
@@ -1834,6 +1844,10 @@ func (c *HisApiController) CreateHisPrescription() {
1834 1844
 									if prescribingNumberUnit == drug.MaxUnit {
1835 1845
 										num := prescribing_number * float64(drug.MinNumber)
1836 1846
 										if drug.IsUse != 1 {
1847
+											if all_count == 0 {
1848
+												c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
1849
+												return
1850
+											}
1837 1851
 											if num > all_count {
1838 1852
 												c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
1839 1853
 												return
@@ -1890,6 +1904,10 @@ func (c *HisApiController) CreateHisPrescription() {
1890 1904
 											all_count, _ := strconv.ParseFloat(totals, 64)
1891 1905
 											if prescribingNumberUnit == drug.MinUnit {
1892 1906
 												if drug.IsUse != 1 {
1907
+													if all_count == 0 {
1908
+														c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
1909
+														return
1910
+													}
1893 1911
 													if prescribing_number > all_count {
1894 1912
 														c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
1895 1913
 														return
@@ -1899,6 +1917,10 @@ func (c *HisApiController) CreateHisPrescription() {
1899 1917
 												if prescribingNumberUnit == drug.MaxUnit {
1900 1918
 													num := prescribing_number * float64(drug.MinNumber)
1901 1919
 													if drug.IsUse != 1 {
1920
+														if all_count == 0 {
1921
+															c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
1922
+															return
1923
+														}
1902 1924
 														if num > all_count {
1903 1925
 															c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
1904 1926
 															return
@@ -2011,13 +2033,21 @@ func (c *HisApiController) CreateHisPrescription() {
2011 2033
 								var batch_number_count int64
2012 2034
 								batch_number_count = info.StockMaxNumber*drug.MinNumber + info.StockMinNumber
2013 2035
 								batch_number_counts := strconv.FormatInt(batch_number_count, 10)
2036
+								fmt.Println("woowowowowowwowowo", advicelist.ID)
2037
+								fmt.Println("prescribing_number", prescribing_number)
2038
+								fmt.Println("totototootto", totals)
2014 2039
 								//新增处方
2015 2040
 								if advicelist.ID == 0 {
2016 2041
 									all_count, _ := strconv.ParseFloat(totals, 64)
2017 2042
 									batch_number_all_count, _ := strconv.ParseFloat(batch_number_counts, 64)
2043
+
2018 2044
 									if prescribingNumberUnit == drug.MinUnit {
2019 2045
 
2020 2046
 										if drug.IsUse != 1 {
2047
+											if all_count == 0 {
2048
+												c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2049
+												return
2050
+											}
2021 2051
 											if prescribing_number > all_count {
2022 2052
 												c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2023 2053
 												return
@@ -2036,6 +2066,10 @@ func (c *HisApiController) CreateHisPrescription() {
2036 2066
 									if prescribingNumberUnit == drug.MaxUnit {
2037 2067
 										num := prescribing_number * float64(drug.MinNumber)
2038 2068
 										if drug.IsUse != 1 {
2069
+											if all_count == 0 {
2070
+												c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2071
+												return
2072
+											}
2039 2073
 											if num > all_count {
2040 2074
 												c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2041 2075
 												return
@@ -2105,6 +2139,10 @@ func (c *HisApiController) CreateHisPrescription() {
2105 2139
 											if prescribingNumberUnit == drug.MinUnit {
2106 2140
 												batch_number_all_count, _ := strconv.ParseFloat(batch_number_counts, 64)
2107 2141
 												if drug.IsUse != 1 {
2142
+													if all_count == 0 {
2143
+														c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2144
+														return
2145
+													}
2108 2146
 													if prescribing_number > all_count {
2109 2147
 														c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2110 2148
 														return
@@ -2123,6 +2161,10 @@ func (c *HisApiController) CreateHisPrescription() {
2123 2161
 													batch_number_all_count, _ := strconv.ParseFloat(batch_number_counts, 64)
2124 2162
 													num := prescribing_number * float64(drug.MinNumber)
2125 2163
 													if drug.IsUse != 1 {
2164
+														if all_count == 0 {
2165
+															c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2166
+															return
2167
+														}
2126 2168
 														if num > all_count {
2127 2169
 															c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2128 2170
 															return
@@ -2174,6 +2216,10 @@ func (c *HisApiController) CreateHisPrescription() {
2174 2216
 											if (number_count - device_number) > 0 {
2175 2217
 												//如果修改的差数量 大于库存数量
2176 2218
 												if drug.IsUse != 1 {
2219
+													if total_count == 0 {
2220
+														c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2221
+														return
2222
+													}
2177 2223
 													if (number_count - device_number) > total_count {
2178 2224
 														c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2179 2225
 														return
@@ -2339,6 +2385,10 @@ func (c *HisApiController) CreateHisPrescription() {
2339 2385
 											if prescribingNumberUnit == drug.MinUnit {
2340 2386
 												batch_number_all_count, _ := strconv.ParseFloat(batch_number_counts, 64)
2341 2387
 												if drug.IsUse != 1 {
2388
+													if all_count == 0 {
2389
+														c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2390
+														return
2391
+													}
2342 2392
 													if prescribing_number > all_count {
2343 2393
 														c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2344 2394
 														return
@@ -2357,6 +2407,10 @@ func (c *HisApiController) CreateHisPrescription() {
2357 2407
 													batch_number_all_count, _ := strconv.ParseFloat(batch_number_counts, 64)
2358 2408
 													num := prescribing_number * float64(drug.MinNumber)
2359 2409
 													if drug.IsUse != 1 {
2410
+														if all_count == 0 {
2411
+															c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2412
+															return
2413
+														}
2360 2414
 														if num > all_count {
2361 2415
 															c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2362 2416
 															return
@@ -2406,6 +2460,10 @@ func (c *HisApiController) CreateHisPrescription() {
2406 2460
 											if (number_count - device_number) > 0 {
2407 2461
 												//如果修改的差数量 大于库存数量
2408 2462
 												if drug.IsUse != 1 {
2463
+													if total_count == 0 {
2464
+														c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2465
+														return
2466
+													}
2409 2467
 													if (number_count - device_number) > total_count {
2410 2468
 														c.ServeDynamicFailJsonSend(drug.DrugName + "库存不足")
2411 2469
 														return
@@ -2449,7 +2507,10 @@ func (c *HisApiController) CreateHisPrescription() {
2449 2507
 															var sum_in_count int64
2450 2508
 															warehouseInfo, _ := service.FindLastDrugWarehousingInfoByID(drug_id, storeConfig.DrugStorehouseOut)
2451 2509
 															sum_in_count = warehouseInfo.StockMaxNumber*drug.MinNumber + warehouseInfo.StockMinNumber
2452
-
2510
+															if sum_in_count == 0 {
2511
+																c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(warehouseInfo.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(warehouseInfo.StockMinNumber, 10) + drug.MinUnit)
2512
+																return
2513
+															}
2453 2514
 															//如果修改的数量大于有库存的第一个批次
2454 2515
 															if number_count > sum_in_count {
2455 2516
 																c.ServeDynamicFailJsonSend(drug.DrugName + "该批次剩余库存不足,剩余库存:" + strconv.FormatInt(warehouseInfo.StockMaxNumber, 10) + drug.MaxUnit + strconv.FormatInt(warehouseInfo.StockMinNumber, 10) + drug.MinUnit)
@@ -2522,6 +2583,10 @@ func (c *HisApiController) CreateHisPrescription() {
2522 2583
 										}
2523 2584
 										stock_counts := strconv.FormatInt(stock_count, 10)
2524 2585
 										stock_total_count, _ := strconv.ParseFloat(stock_counts, 64)
2586
+										if stock_total_count == 0 {
2587
+											c.ServeDynamicFailJsonSend(project_name + "库存不足")
2588
+											return
2589
+										}
2525 2590
 										if totals > stock_total_count {
2526 2591
 											c.ServeDynamicFailJsonSend(project_name + "库存不足")
2527 2592
 											return
@@ -2545,6 +2610,10 @@ func (c *HisApiController) CreateHisPrescription() {
2545 2610
 												}
2546 2611
 
2547 2612
 												//库存不足
2613
+												if stock_count == 0 {
2614
+													c.ServeDynamicFailJsonSend(project_name + "库存不足")
2615
+													return
2616
+												}
2548 2617
 												if (parsetotal - count) > stock_count {
2549 2618
 													c.ServeDynamicFailJsonSend(project_name + "库存不足")
2550 2619
 													return
@@ -2620,6 +2689,10 @@ func (c *HisApiController) CreateHisPrescription() {
2620 2689
 											}
2621 2690
 											stock_counts := strconv.FormatInt(stock_count, 10)
2622 2691
 											stock_total_count, _ := strconv.ParseFloat(stock_counts, 64)
2692
+											if stock_total_count == 0 {
2693
+												c.ServeDynamicFailJsonSend(project_name + "库存不足")
2694
+												return
2695
+											}
2623 2696
 											if totals > stock_total_count {
2624 2697
 												c.ServeDynamicFailJsonSend(project_name + "库存不足")
2625 2698
 												return

+ 3 - 0
controllers/mobile_api_controllers/patient_api_controller.go View File

@@ -1265,6 +1265,7 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1265 1265
 		})
1266 1266
 		return
1267 1267
 	} else if origin == 2 {
1268
+		fmt.Println("缉拿咯喔我我哦我我")
1268 1269
 		adminInfo := c.GetMobileAdminUserInfo()
1269 1270
 		creater := c.GetMobileAdminUserInfo().AdminUser.Id
1270 1271
 		var ids []string
@@ -1659,6 +1660,8 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1659 1660
 				}
1660 1661
 
1661 1662
 				//
1663
+				fmt.Println("config.IsOpen", config.IsOpen)
1664
+				fmt.Println("config.IsOpen", item.UserOrgId)
1662 1665
 				if config.IsOpen == 1 && item.UserOrgId == 10028 {
1663 1666
 
1664 1667
 					service.HisDrugsDelivery(adminInfo.Org.Id, creater, &advice)

+ 0 - 1
controllers/schedule_api_controller.go View File

@@ -4223,7 +4223,6 @@ func (this *ScheduleApiController) GetBloodScheduleList() {
4223 4223
 
4224 4224
 	orgId := this.GetAdminUserInfo().CurrentOrgId
4225 4225
 
4226
-	fmt.Println("weekt_ywppwepwpwwep", week_type)
4227 4226
 	if week_type > 0 {
4228 4227
 		list, err := service.GetWeekDayScheduleByIdThee(orgId, targetDay.Unix(), week_time, zone)
4229 4228
 		for _, item := range list {

+ 110 - 8
controllers/sign_api_controller.go View File

@@ -657,14 +657,114 @@ func (this *SignApiController) GetEnterPriseDetail() {
657 657
 
658 658
 func (this *SignApiController) UploadPrintOrder() {
659 659
 
660
-	dataBody := make(map[string]interface{}, 0)
661
-	err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
662
-	fmt.Println("err", err)
663
-	name := dataBody["name"].(string)
660
+	//dataBody := make(map[string]interface{}, 0)
661
+	//err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody)
662
+	//fmt.Println(err)
663
+	//name := dataBody["name"].(string)
664
+	//fmt.Println(name)
665
+	//sign := service.CreateNewUploadPact(name)
666
+	//fmt.Println("sign")
667
+	//information, pdfBase64 := service.SavePdfInformation(name)
668
+
669
+	pdf := gofpdf.New("P", "mm", "A4", "")
670
+	pdf.AddPage()
671
+	pdf.Text(5, 10, "血液净化治疗记录单")
672
+	//wd := pdf.GetStringWidth(titleStr) + 6
673
+	//fmt.Println("wd", wd)
674
+	//pdf.SetY(0.6)            //先要设置 Y,然后再设置 X。否则,会导致 X 失效
675
+	//pdf.SetX((210 - wd) / 2) //水平居中的算法
676
+	//pdf.AddUTF8Font("simkai", "", "D:/go/src/pkg/mod/github.com/jung-kurt/gofpdf@v1.16.2/font/simfang.ttf")
677
+	//pdf.SetFont("simkai", "", 20)
678
+
679
+	//将字体加载进来
680
+	//AddUTF8Font("给字体起个别名", "", "fontPath")
681
+	pdf.AddUTF8Font("simfang", "", "D:/go/src/pkg/mod/github.com/jung-kurt/gofpdf@v1.16.2/font/simfang.ttf")
682
+	pdf.SetFont("simfang", "", 20)
683
+	var title = "血液透析(滤过)记录表单"
684
+	//表格居中显示
685
+	pdf.Text(70, 10, title)
686
+	wd := pdf.GetStringWidth(title) + 100
687
+	fmt.Println("wd", wd)
688
+	pdf.SetY(100)            //先要设置 Y,然后再设置 X。否则,会导致 X 失效
689
+	pdf.SetX((210 - wd) / 2) //水平居中的算法
690
+	//pdf.SetLineWidth(0)
691
+
692
+	//pdf.Line(10, 30, 585, 30)
693
+	//pdf.Ln(1)
694
+	//pdf.Write(10, "\n")
695
+	var numuber = "100000"
696
+	//表格居中显示
697
+	pdf.SetFont("", "", 14) // 设置加粗字体和字号
698
+	pdf.Text(10, 20, "病历号:"+numuber)
699
+	pdf.SetFont("", "", 14) // 设置加粗字体和字号
700
+	pdf.Text(60, 20, "姓名:")
701
+	pdf.SetFont("", "", 14) // 设置正常字体和字号
702
+	pdf.Text(90, 20, "性别:")
703
+	pdf.SetFont("", "", 14) // 设置正常字体和字号
704
+	pdf.Text(120, 20, "年龄:")
705
+	pdf.SetFont("", "", 14) // 设置正常字体和字号
706
+	pdf.Text(150, 20, "透析次数:")
707
+	pdf.SetFont("", "", 14) // 设置正常字体和字号
708
+
709
+	//表格居中显示
710
+	pdf.SetFont("", "", 14) // 设置加粗字体和字号
711
+	pdf.Text(10, 30, "入科方式:"+numuber)
712
+	pdf.SetFont("", "", 14) // 设置加粗字体和字号
713
+	pdf.Text(60, 30, "诊断:")
714
+
715
+	//param1: 单元格的宽,为0时表示一行,单位根据new()里面设置的来
716
+	//param2: 单元格的高,不能为0,单位根据new()里面设置的来
717
+	//param3: 单元格内容
718
+	//param4: 边框样式,一个空字符串表示无边框,“1”表示全边框,一个或多个“L”,“T”,“R”和“B”分别表示边界左,上,右,下
719
+	//param5: 表示调用后当前位置的位置。可能的值为0,接着当前行继续,1换行,2目前没有试过
720
+	//param6: 字体的位置,水平对齐包括"L", “C"或"R”(左,中,右)。垂直对齐由包含控制"T", “M”, “B"或"A”(上,中,下,基线),可以组合,比如说LT,CM等等
721
+	//param7: 是否填充单元格,需要调用SetFillColor()方法.默认false
722
+	//param8: 内部超链接,没用过
723
+	//param9: 超链接,没用过
724
+	pdf.AddUTF8Font("simfang", "", "D:/go/src/pkg/mod/github.com/jung-kurt/gofpdf@v1.16.2/font/simfang.ttf")
725
+	pdf.SetFont("simfang", "", 14)  // 设置字体、字号
726
+	pdf.SetFillColor(200, 200, 200) // 设置填充颜色
727
+
728
+	// 设置起始位置
729
+	var x = 10.0
730
+	var y = 40.0
731
+	// 创建8行2列的表格
732
+
733
+	for j := 0; j < 1; j++ {
734
+		//cellText := fmt.Sprintf("行%d列%d", i+1, j+1)                 // 填充每个单元格的内容
735
+		pdf.SetXY(x, y)                                         // 设置当前位置
736
+		pdf.CellFormat(15, 15, "时间", "1", 0, "C", false, 0, "") // 使用CellFormat()方法创建表格单元格
737
+		pdf.CellFormat(20, 15, "血压(mmHg)", "1", 0, "CM", false, 0, "")
738
+		pdf.CellFormat(20, 15, "脉搏(次/分)", "1", 0, "CM", false, 0, "")
739
+		pdf.CellFormat(20, 15, "呼吸(次/分)", "1", 0, "CM", false, 0, "")
740
+		pdf.CellFormat(20, 15, "血流量(ml/min)", "1", 0, "CM", false, 0, "")
741
+		pdf.CellFormat(20, 15, "静脉压(mmHg)", "1", 0, "CM", false, 0, "")
742
+		pdf.CellFormat(20, 15, "跨膜压(mmHg)", "1", 0, "CM", false, 0, "")
743
+		pdf.CellFormat(20, 15, "透析液温(℃)", "1", 0, "CM", false, 0, "")
744
+		pdf.CellFormat(20, 15, "钠浓度(mmol/L)", "1", 0, "CM", false, 0, "")
745
+		pdf.CellFormat(20, 15, "超滤量(ml) ", "1", 0, "CM", false, 0, "")
746
+		pdf.CellFormat(35, 15, "病情变化及处理", "1", 0, "CM", false, 0, "")
747
+
748
+		y += 15 // 下一行起始位置的y坐标增加60(单元格高度)
749
+	}
750
+	x += 200.0 // 下一列起始位置的x坐标增加190(单元格宽度)
751
+	y = 10.0   // 行起始位置的y坐标重置为10
752
+
753
+	//设置表格单元格大小,
754
+	//pdf.CellFormat(180, 15, "李王", "1", 0, "LM", false, 0, "")
755
+
756
+	pdf.Ln(2)
757
+	//pdf.Ln(2) 行距2mm
758
+
759
+	if err := pdf.OutputFileAndClose("6.pdf"); err != nil {
760
+		panic(err.Error())
761
+	}
664 762
 
665
-	sign := service.CreateNewUploadPact(name)
666 763
 	this.ServeSuccessJSON(map[string]interface{}{
667
-		"sign": sign,
764
+		//"sign":      information,
765
+		//"pdfBase64": pdfBase64,
766
+		//"name": name,
767
+
668 768
 	})
669 769
 
670 770
 }
@@ -715,7 +815,8 @@ func (this *SignApiController) CreateSdkSendInformation() {
715 815
 
716 816
 func (this *SignApiController) SavePdfInformation() {
717 817
 
718
-	information, pdfBase64 := service.SavePdfInformation()
818
+	var name string
819
+	information, pdfBase64 := service.SavePdfInformation(name)
719 820
 	informationOne := service.ToCheckInformation(pdfBase64)
720 821
 
721 822
 	maprequest := make(map[string]interface{})
@@ -973,7 +1074,8 @@ func (this *SignApiController) SavePdfInformation() {
973 1074
 
974 1075
 func (this *SignApiController) ToCheckInformation() {
975 1076
 
976
-	information, pdfBase64 := service.SavePdfInformation()
1077
+	var name string
1078
+	information, pdfBase64 := service.SavePdfInformation(name)
977 1079
 	informationOne := service.ToCheckInformation(pdfBase64)
978 1080
 
979 1081
 	this.ServeSuccessJSON(map[string]interface{}{

+ 1 - 1
controllers/stock_in_api_controller.go View File

@@ -7107,7 +7107,7 @@ func (this *StockManagerApiController) CheckWarehouseOut() {
7107 7107
 		}
7108 7108
 		service.CreateGoodErrcode(goodErrcode)
7109 7109
 	}
7110
-	//查询已审核的单据
7110
+	//查询已保存的单据
7111 7111
 	warehousingOutInfo, erroce := service.GetWarehouseOutById(id, orgId)
7112 7112
 	if erroce != nil {
7113 7113
 		goodErrcode := models.XtGoodErrcode{

+ 3 - 0
models/patient_models.go View File

@@ -1808,6 +1808,9 @@ type NewDialysisPrescription struct {
1808 1808
 	AdminUserId                int64   `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
1809 1809
 	DialysisRemark             string  `gorm:"column:dialysis_remark" json:"dialysis_remark" form:"dialysis_remark"`
1810 1810
 	DialyzerPerfusionApparatus string  `gorm:"column:dialyzer_perfusion_apparatus" json:"dialyzer_perfusion_apparatus"`
1811
+	DialysateFlow              float64 `gorm:"column:dialysate_flow" json:"dialysate_flow" form:"dialysate_flow"`
1812
+	DisplaceLiquiValue         float64 `gorm:"column:displace_liqui_value" json:"displace_liqui_value" form:"displace_liqui_value"`
1813
+	BloodFlowVolume            float64 `gorm:"column:blood_flow_volume" json:"blood_flow_volume" form:"blood_flow_volume"`
1811 1814
 }
1812 1815
 
1813 1816
 func (NewDialysisPrescription) TableName() string {

+ 1 - 1
service/manage_service.go View File

@@ -1818,7 +1818,7 @@ func GetObjectDisInfectionLongTime(user_org_id int64) (list []*models.XtNewObjec
1818 1818
 
1819 1819
 func GetDialysisOrderPatient(org_id int64) (order []*models.XtDialysisOrder, err error) {
1820 1820
 
1821
-	err = XTReadDB().Where("user_org_id = ? and dialysis_date>=? and dialysis_date<=? and status =1", org_id, 1667232000, 1669737600).Find(&order).Error
1821
+	err = XTReadDB().Where("user_org_id = ? and dialysis_date>=? and dialysis_date<=? and status =1", org_id, 1669824000, 1672416000).Find(&order).Error
1822 1822
 
1823 1823
 	return order, err
1824 1824
 }

+ 423 - 108
service/mobile_dialysis_service.go View File

@@ -4518,10 +4518,13 @@ func GetFistMonitorSix(orgid int64, patient_id int64, dialysis_date int64) (reco
4518 4518
 	return record, err
4519 4519
 }
4520 4520
 
4521
-func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceType int, patientType int, adminUserId int64, deliverWay string, scheduleType int64, partitonType int64, patient_id int64, execution_state int64, cost_type int64, execution_frequency string) ([]*MScheduleDoctorAdviceVM, error) {
4521
+func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceType int, patientType int, adminUserId int64, deliverWay string, scheduleType int64, partitonType int64, patient_id int64, execution_state int64, cost_type int64, execution_frequency string, keyword string) ([]*MScheduleDoctorAdviceVM, error) {
4522 4522
 
4523 4523
 	var vms []*MScheduleDoctorAdviceVM
4524
+
4525
+	keyword = "%" + keyword + "%"
4524 4526
 	adviceWhere := ""
4527
+
4525 4528
 	adviceCondition := []interface{}{}
4526 4529
 	if adviceType == 0 {
4527 4530
 		if patientType == 0 {
@@ -4529,20 +4532,47 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4529 4532
 				if execution_state > 0 {
4530 4533
 					if cost_type > 0 {
4531 4534
 						if len(execution_frequency) > 0 {
4532
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and execution_frequency = ?"
4533
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency)
4535
+							if len(keyword) > 0 {
4536
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
4537
+
4538
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency, keyword)
4539
+							} else {
4540
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and execution_frequency = ?"
4541
+
4542
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency)
4543
+							}
4544
+
4534 4545
 						} else {
4535
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ?"
4536
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type)
4546
+
4547
+							if len(keyword) > 0 {
4548
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and advice_name like ?"
4549
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, keyword)
4550
+							} else {
4551
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ?"
4552
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type)
4553
+							}
4554
+
4537 4555
 						}
4538 4556
 
4539 4557
 					} else {
4540 4558
 						if len(execution_frequency) > 0 {
4541
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and  execution_frequency = ?"
4542
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency)
4559
+							if len(keyword) > 0 {
4560
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and  execution_frequency = ? and advice_name like ?"
4561
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency, keyword)
4562
+							} else {
4563
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and  execution_frequency = ?"
4564
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency)
4565
+							}
4566
+
4543 4567
 						} else {
4544
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ?"
4545
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state)
4568
+							if len(keyword) > 0 {
4569
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and advice_name like ?"
4570
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, keyword)
4571
+							} else {
4572
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ?"
4573
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state)
4574
+							}
4575
+
4546 4576
 						}
4547 4577
 
4548 4578
 					}
@@ -4562,8 +4592,14 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4562 4592
 							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_frequency = ?"
4563 4593
 							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_frequency)
4564 4594
 						} else {
4565
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ?"
4566
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id)
4595
+							if len(keyword) > 0 {
4596
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and advice_name like ?"
4597
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, keyword)
4598
+							} else {
4599
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ?"
4600
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id)
4601
+							}
4602
+
4567 4603
 						}
4568 4604
 
4569 4605
 					}
@@ -4574,20 +4610,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4574 4610
 				if execution_state > 0 {
4575 4611
 					if cost_type > 0 {
4576 4612
 						if len(execution_frequency) > 0 {
4577
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and is_settle = ? and execution_frequency = ?"
4578
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, execution_frequency)
4613
+							if len(keyword) > 0 {
4614
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
4615
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, execution_frequency, keyword)
4616
+							} else {
4617
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and is_settle = ? and execution_frequency = ?"
4618
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, execution_frequency)
4619
+							}
4620
+
4579 4621
 						} else {
4580
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and is_settle = ?"
4581
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type)
4622
+							if len(keyword) > 0 {
4623
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and is_settle = ? and advice_name like ?"
4624
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, keyword)
4625
+							} else {
4626
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and is_settle = ?"
4627
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type)
4628
+							}
4629
+
4582 4630
 						}
4583 4631
 
4584 4632
 					} else {
4585 4633
 						if len(execution_frequency) > 0 {
4586
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and execution_frequency = ?"
4587
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, execution_frequency)
4634
+							if len(keyword) > 0 {
4635
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and execution_frequency = ? and advice_name like ?"
4636
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, execution_frequency, keyword)
4637
+							} else {
4638
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and execution_frequency = ?"
4639
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, execution_frequency)
4640
+							}
4641
+
4588 4642
 						} else {
4589
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ?"
4590
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state)
4643
+							if len(keyword) > 0 {
4644
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ? and advice_name like ?"
4645
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, keyword)
4646
+							} else {
4647
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_state= ?"
4648
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state)
4649
+							}
4650
+
4591 4651
 						}
4592 4652
 
4593 4653
 					}
@@ -4595,20 +4655,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4595 4655
 				} else {
4596 4656
 					if cost_type > 0 {
4597 4657
 						if len(execution_frequency) > 0 {
4598
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and is_settle = ? and execution_frequency = ?"
4599
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, execution_frequency)
4658
+							if len(keyword) > 0 {
4659
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and is_settle = ? and execution_frequency = ? and advice_name like ?"
4660
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, execution_frequency, keyword)
4661
+							} else {
4662
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and is_settle = ? and execution_frequency = ?"
4663
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, execution_frequency)
4664
+							}
4665
+
4600 4666
 						} else {
4601
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and is_settle = ?"
4602
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type)
4667
+							if len(keyword) > 0 {
4668
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and is_settle = ? and advice_name like ?"
4669
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, keyword)
4670
+							} else {
4671
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and is_settle = ?"
4672
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type)
4673
+							}
4674
+
4603 4675
 						}
4604 4676
 
4605 4677
 					} else {
4606 4678
 						if len(execution_frequency) > 0 {
4607
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_frequency = ?"
4608
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_frequency)
4679
+							if len(keyword) > 0 {
4680
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_frequency = ? and advice_name like ?"
4681
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_frequency, keyword)
4682
+							} else {
4683
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and execution_frequency = ?"
4684
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_frequency)
4685
+							}
4686
+
4609 4687
 						} else {
4610
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1)"
4611
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate)
4688
+							if len(keyword) > 0 {
4689
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and advice_name like ?"
4690
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, keyword)
4691
+							} else {
4692
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1)"
4693
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate)
4694
+							}
4695
+
4612 4696
 						}
4613 4697
 
4614 4698
 					}
@@ -4622,20 +4706,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4622 4706
 				if execution_state > 0 {
4623 4707
 					if cost_type > 0 {
4624 4708
 						if len(execution_frequency) > 0 {
4625
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and execution_frequency = ?"
4626
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, cost_type, execution_frequency)
4709
+							if len(keyword) > 0 {
4710
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
4711
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, cost_type, execution_frequency, keyword)
4712
+							} else {
4713
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and execution_frequency = ?"
4714
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, cost_type, execution_frequency)
4715
+							}
4716
+
4627 4717
 						} else {
4628
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ?"
4629
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, cost_type)
4718
+							if len(keyword) > 0 {
4719
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ? and advice_name like ?"
4720
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, cost_type, keyword)
4721
+							} else {
4722
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and is_settle = ?"
4723
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, cost_type)
4724
+							}
4725
+
4630 4726
 						}
4631 4727
 
4632 4728
 					} else {
4633 4729
 						if len(execution_frequency) > 0 {
4634
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and execution_frequency = ?"
4635
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, execution_frequency)
4730
+							if len(keyword) > 0 {
4731
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and execution_frequency = ? and advice_name like ?"
4732
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, execution_frequency, keyword)
4733
+							} else {
4734
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and execution_frequency = ?"
4735
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, execution_frequency)
4736
+							}
4737
+
4636 4738
 						} else {
4637
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ?"
4638
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state)
4739
+							if len(keyword) > 0 {
4740
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ? and advice_name like ?"
4741
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state, keyword)
4742
+							} else {
4743
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_state= ?"
4744
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_state)
4745
+							}
4746
+
4639 4747
 						}
4640 4748
 
4641 4749
 					}
@@ -4643,20 +4751,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4643 4751
 				} else {
4644 4752
 					if cost_type > 0 {
4645 4753
 						if len(execution_frequency) > 0 {
4646
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and is_settle=? and execution_frequency = ?"
4647
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, cost_type, execution_frequency)
4754
+							if len(keyword) > 0 {
4755
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and is_settle=? and execution_frequency = ? and advice_name like ?"
4756
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, cost_type, execution_frequency, keyword)
4757
+							} else {
4758
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and is_settle=? and execution_frequency = ?"
4759
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, cost_type, execution_frequency)
4760
+							}
4761
+
4648 4762
 						} else {
4649
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and is_settle=?"
4650
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, cost_type)
4763
+							if len(keyword) > 0 {
4764
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and is_settle=? and advice_name like ?"
4765
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, cost_type, keyword)
4766
+							} else {
4767
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and is_settle=?"
4768
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, cost_type)
4769
+							}
4770
+
4651 4771
 						}
4652 4772
 
4653 4773
 					} else {
4654 4774
 						if len(execution_frequency) > 0 {
4655
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_frequency = ?"
4656
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_frequency)
4775
+							if len(keyword) > 0 {
4776
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_frequency = ? and advice_name like ?"
4777
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_frequency, keyword)
4778
+							} else {
4779
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_frequency = ?"
4780
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, execution_frequency)
4781
+							}
4782
+
4657 4783
 						} else {
4658
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ?"
4659
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id)
4784
+							if len(keyword) > 0 {
4785
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ? and advice_name like ?"
4786
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id, keyword)
4787
+							} else {
4788
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and patient_id = ?"
4789
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, patient_id)
4790
+							}
4791
+
4660 4792
 						}
4661 4793
 
4662 4794
 					}
@@ -4667,20 +4799,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4667 4799
 				if execution_state > 0 {
4668 4800
 					if cost_type > 0 {
4669 4801
 						if len(execution_frequency) > 0 {
4670
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and execution_frequency = ?"
4671
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, cost_type, execution_frequency)
4802
+							if len(keyword) > 0 {
4803
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and execution_frequency = ? and advice_name like ?"
4804
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, cost_type, execution_frequency, keyword)
4805
+							} else {
4806
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and execution_frequency = ?"
4807
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, cost_type, execution_frequency)
4808
+							}
4809
+
4672 4810
 						} else {
4673
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=?"
4674
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, cost_type)
4811
+							if len(keyword) > 0 {
4812
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and advice_name like ?"
4813
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, cost_type, keyword)
4814
+							} else {
4815
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=?"
4816
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, cost_type)
4817
+							}
4818
+
4675 4819
 						}
4676 4820
 
4677 4821
 					} else {
4678 4822
 						if len(execution_frequency) > 0 {
4679
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and execution_frequency = ?"
4680
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, execution_frequency)
4823
+							if len(keyword) > 0 {
4824
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and execution_frequency = ? and advice_name like ?"
4825
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, execution_frequency, keyword)
4826
+							} else {
4827
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and execution_frequency = ?"
4828
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, execution_frequency)
4829
+							}
4830
+
4681 4831
 						} else {
4682
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ?"
4683
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state)
4832
+							if len(keyword) > 0 {
4833
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and advice_name like ?"
4834
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state, keyword)
4835
+							} else {
4836
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_state = ?"
4837
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_state)
4838
+							}
4839
+
4684 4840
 						}
4685 4841
 
4686 4842
 					}
@@ -4688,20 +4844,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4688 4844
 				} else {
4689 4845
 					if cost_type > 0 {
4690 4846
 						if len(execution_frequency) > 0 {
4691
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and  is_settle=? and execution_frequency = ?"
4692
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, cost_type, execution_frequency)
4847
+							if len(keyword) > 0 {
4848
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and  is_settle=? and execution_frequency = ? and advice_name like ?"
4849
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, cost_type, execution_frequency, keyword)
4850
+							} else {
4851
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and  is_settle=? and execution_frequency = ?"
4852
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, cost_type, execution_frequency)
4853
+							}
4854
+
4693 4855
 						} else {
4694
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and  is_settle=?"
4695
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, cost_type)
4856
+							if len(keyword) > 0 {
4857
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and  is_settle=? and advice_name like ?"
4858
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, cost_type, keyword)
4859
+							} else {
4860
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and  is_settle=?"
4861
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, cost_type)
4862
+							}
4863
+
4696 4864
 						}
4697 4865
 
4698 4866
 					} else {
4699 4867
 						if len(execution_frequency) > 0 {
4700
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_frequency = ?"
4701
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_frequency)
4868
+							if len(keyword) > 0 {
4869
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_frequency = ? and advice_name like ?"
4870
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_frequency, keyword)
4871
+							} else {
4872
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and execution_frequency = ?"
4873
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, execution_frequency)
4874
+							}
4875
+
4702 4876
 						} else {
4703
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1)"
4704
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId)
4877
+							if len(keyword) > 0 {
4878
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1) and advice_name like ?"
4879
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId, keyword)
4880
+							} else {
4881
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND advice_doctor = ? AND(advice_type = 3 OR advice_type = 1)"
4882
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, adminUserId)
4883
+							}
4884
+
4705 4885
 						}
4706 4886
 
4707 4887
 					}
@@ -4715,20 +4895,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4715 4895
 				if execution_state > 0 {
4716 4896
 					if cost_type > 0 {
4717 4897
 						if len(execution_frequency) > 0 {
4718
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and is_settle=? and execution_frequency = ?"
4719
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency)
4898
+							if len(keyword) > 0 {
4899
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and is_settle=? and execution_frequency = ? and advice_name like ?"
4900
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency, keyword)
4901
+							} else {
4902
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and is_settle=? and execution_frequency = ?"
4903
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency)
4904
+							}
4905
+
4720 4906
 						} else {
4721
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and is_settle=?"
4722
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type)
4907
+							if len(keyword) > 0 {
4908
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and is_settle=? and advice_name like ?"
4909
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, keyword)
4910
+							} else {
4911
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and is_settle=?"
4912
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type)
4913
+							}
4914
+
4723 4915
 						}
4724 4916
 
4725 4917
 					} else {
4726 4918
 						if len(execution_frequency) > 0 {
4727
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ?and execution_frequency = ?"
4728
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency)
4919
+							if len(keyword) > 0 {
4920
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ?and execution_frequency = ? and advice_name like ?"
4921
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency, keyword)
4922
+							} else {
4923
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ?and execution_frequency = ?"
4924
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency)
4925
+							}
4926
+
4729 4927
 						} else {
4730
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ?"
4731
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state)
4928
+							if len(keyword) > 0 {
4929
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ? and advice_name like ?"
4930
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, keyword)
4931
+							} else {
4932
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and execution_state = ?"
4933
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state)
4934
+							}
4935
+
4732 4936
 						}
4733 4937
 
4734 4938
 					}
@@ -4736,20 +4940,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4736 4940
 				} else {
4737 4941
 					if cost_type > 0 {
4738 4942
 						if len(execution_frequency) > 0 {
4739
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and is_settle=? and execution_frequency = ?"
4740
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, execution_frequency)
4943
+							if len(keyword) > 0 {
4944
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and is_settle=? and execution_frequency = ? and advice_name like ?"
4945
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, execution_frequency, keyword)
4946
+							} else {
4947
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and is_settle=? and execution_frequency = ?"
4948
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, execution_frequency)
4949
+							}
4950
+
4741 4951
 						} else {
4742
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and is_settle=?"
4743
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type)
4952
+							if len(keyword) > 0 {
4953
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and is_settle=? and advice_name like ?"
4954
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, keyword)
4955
+							} else {
4956
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and is_settle=?"
4957
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type)
4958
+							}
4959
+
4744 4960
 						}
4745 4961
 
4746 4962
 					} else {
4747 4963
 						if len(execution_frequency) > 0 {
4748
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?)and execution_frequency = ?"
4749
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_frequency)
4964
+							if len(keyword) > 0 {
4965
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?)and execution_frequency = ? and advice_name like ?"
4966
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_frequency, keyword)
4967
+							} else {
4968
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?)and execution_frequency = ?"
4969
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_frequency)
4970
+							}
4971
+
4750 4972
 						} else {
4751
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?)"
4752
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id)
4973
+							if len(keyword) > 0 {
4974
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?) and advice_name like ?"
4975
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, keyword)
4976
+							} else {
4977
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1 and patient_id = ?)"
4978
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id)
4979
+							}
4980
+
4753 4981
 						}
4754 4982
 
4755 4983
 					}
@@ -4760,20 +4988,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4760 4988
 				if execution_state > 0 {
4761 4989
 					if cost_type > 0 {
4762 4990
 						if len(execution_frequency) > 0 {
4763
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and execution_frequency = ?"
4764
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, execution_frequency)
4991
+							if len(keyword) > 0 {
4992
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and execution_frequency = ? and advice_name like ?"
4993
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, execution_frequency, keyword)
4994
+							} else {
4995
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and execution_frequency = ?"
4996
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, execution_frequency)
4997
+							}
4998
+
4765 4999
 						} else {
4766
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=?"
4767
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type)
5000
+							if len(keyword) > 0 {
5001
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=? and advice_name like ?"
5002
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type, keyword)
5003
+							} else {
5004
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and is_settle=?"
5005
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, cost_type)
5006
+							}
5007
+
4768 5008
 						}
4769 5009
 
4770 5010
 					} else {
4771 5011
 						if len(execution_frequency) > 0 {
4772
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and execution_frequency = ?"
4773
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, execution_frequency)
5012
+							if len(keyword) > 0 {
5013
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and execution_frequency = ? and advice_name like ?"
5014
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, execution_frequency, keyword)
5015
+							} else {
5016
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and execution_frequency = ?"
5017
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, execution_frequency)
5018
+							}
5019
+
4774 5020
 						} else {
4775
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ?"
4776
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state)
5021
+							if len(keyword) > 0 {
5022
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ? and advice_name like ?"
5023
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state, keyword)
5024
+							} else {
5025
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_state = ?"
5026
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_state)
5027
+							}
5028
+
4777 5029
 						}
4778 5030
 
4779 5031
 					}
@@ -4781,20 +5033,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4781 5033
 				} else {
4782 5034
 					if cost_type > 0 {
4783 5035
 						if len(execution_frequency) > 0 {
4784
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and is_settle = ? and execution_frequency = ?"
4785
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, execution_frequency)
5036
+							if len(keyword) > 0 {
5037
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and is_settle = ? and execution_frequency = ? and advice_name like ?"
5038
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, execution_frequency, keyword)
5039
+							} else {
5040
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and is_settle = ? and execution_frequency = ?"
5041
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, execution_frequency)
5042
+							}
5043
+
4786 5044
 						} else {
4787
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and is_settle = ?"
4788
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type)
5045
+							if len(keyword) > 0 {
5046
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and is_settle = ? and advice_name like ?"
5047
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type, keyword)
5048
+							} else {
5049
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and is_settle = ?"
5050
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, cost_type)
5051
+							}
5052
+
4789 5053
 						}
4790 5054
 
4791 5055
 					} else {
4792 5056
 						if len(execution_frequency) > 0 {
4793
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_frequency = ?"
4794
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_frequency)
5057
+							if len(keyword) > 0 {
5058
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_frequency = ? and advice_name like ?"
5059
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_frequency, keyword)
5060
+							} else {
5061
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and execution_frequency = ?"
5062
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, execution_frequency)
5063
+							}
5064
+
4795 5065
 						} else {
4796
-							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1)"
4797
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate)
5066
+							if len(keyword) > 0 {
5067
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1) and advice_name like ?"
5068
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, keyword)
5069
+							} else {
5070
+								adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND execution_staff = 0 AND(advice_type = 3 OR advice_type = 1)"
5071
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate)
5072
+							}
5073
+
4798 5074
 						}
4799 5075
 
4800 5076
 					}
@@ -4811,20 +5087,44 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4811 5087
 				if execution_state > 0 {
4812 5088
 					if cost_type > 0 {
4813 5089
 						if len(execution_frequency) > 0 {
4814
-							adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and is_settle = ? and execution_frequency = ?"
4815
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency)
5090
+							if len(keyword) > 0 {
5091
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
5092
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency, keyword)
5093
+							} else {
5094
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and is_settle = ? and execution_frequency = ?"
5095
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, execution_frequency)
5096
+							}
5097
+
4816 5098
 						} else {
4817
-							adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and is_settle = ?"
4818
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type)
5099
+							if len(keyword) > 0 {
5100
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and is_settle = ? and advice_name like ?"
5101
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type, keyword)
5102
+							} else {
5103
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and is_settle = ?"
5104
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, cost_type)
5105
+							}
5106
+
4819 5107
 						}
4820 5108
 
4821 5109
 					} else {
4822 5110
 						if len(execution_frequency) > 0 {
4823
-							adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and execution_frequency = ?"
4824
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency)
5111
+							if len(keyword) > 0 {
5112
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and execution_frequency = ? and advice_name like ?"
5113
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency, keyword)
5114
+							} else {
5115
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and execution_frequency = ?"
5116
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, execution_frequency)
5117
+							}
5118
+
4825 5119
 						} else {
4826
-							adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ?"
4827
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state)
5120
+							if len(keyword) > 0 {
5121
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ? and advice_name like ?"
5122
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state, keyword)
5123
+							} else {
5124
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_state = ?"
5125
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_state)
5126
+							}
5127
+
4828 5128
 						}
4829 5129
 
4830 5130
 					}
@@ -4832,20 +5132,35 @@ func MobileGetScheduleDoctorAdvicesOne(orgID int64, scheduleDate int64, adviceTy
4832 5132
 				} else {
4833 5133
 					if cost_type > 0 {
4834 5134
 						if len(execution_frequency) > 0 {
4835
-							adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and is_settle = ? and execution_frequency = ?"
4836
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, execution_frequency)
5135
+							if len(keyword) > 0 {
5136
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and is_settle = ? and execution_frequency = ? and advice_name like ?"
5137
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, execution_frequency, keyword)
5138
+							} else {
5139
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and is_settle = ? and execution_frequency = ?"
5140
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, execution_frequency)
5141
+							}
5142
+
4837 5143
 						} else {
4838
-							adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and is_settle = ? "
4839
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type)
5144
+							if len(keyword) > 0 {
5145
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and is_settle = ? and advice_name like ? "
5146
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type, keyword)
5147
+							} else {
5148
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and is_settle = ? "
5149
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, cost_type)
5150
+							}
5151
+
4840 5152
 						}
4841 5153
 
4842 5154
 					} else {
4843 5155
 						if len(execution_frequency) > 0 {
4844
-							adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? and execution_frequency = ?"
4845
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_frequency)
4846
-						} else {
4847
-							adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? "
4848
-							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id)
5156
+							if len(keyword) > 0 {
5157
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ?  and advice_name like ?"
5158
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, keyword)
5159
+							} else {
5160
+								adviceWhere = "status = 1 AND user_org_id = ? AND advice_type = 1 AND record_date = ? and patient_id = ? "
5161
+								adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id)
5162
+							}
5163
+
4849 5164
 						}
4850 5165
 
4851 5166
 					}

+ 39 - 26
service/sign_service.go View File

@@ -10,8 +10,10 @@ import (
10 10
 	"encoding/json"
11 11
 	"fmt"
12 12
 	"github.com/astaxie/beego"
13
+	"github.com/jung-kurt/gofpdf"
13 14
 	"io/ioutil"
14 15
 	"net/http"
16
+	"path"
15 17
 )
16 18
 
17 19
 func GetSignNameByPhone(phoneOne string) string {
@@ -1657,7 +1659,7 @@ func CreateSdkSendInformation() (string, string) {
1657 1659
 	return str, orderId
1658 1660
 }
1659 1661
 
1660
-func SavePdfInformation() (string, string) {
1662
+func SavePdfInformation(name string) (string, string) {
1661 1663
 
1662 1664
 	var url string
1663 1665
 
@@ -1671,19 +1673,20 @@ func SavePdfInformation() (string, string) {
1671 1673
 
1672 1674
 	maprequest["signTitle"] = "举报合同"
1673 1675
 
1674
-	//file := "C:/Users/28169/Desktop/2.pdf"
1675
-	file := "/swspan/gopath/src/XT_New/static/6.pdf"
1676
-
1677
-	fileBytes, _ := ioutil.ReadFile(file) // 读取file
1676
+	//file := "C:/Users/28169/Desktop/9.pdf"
1677
+	//file := "/swspan/gopath/src/XT_New/static/16.pdf"
1678
+	//fileBytes, _ := ioutil.ReadFile(file) // 读取file
1679
+	//
1680
+	//contractBase64 := base64.StdEncoding.EncodeToString(fileBytes) // 加密成base64字符串
1678 1681
 
1679
-	contractBase64 := base64.StdEncoding.EncodeToString(fileBytes) // 加密成base64字符串
1682
+	//fmt.Println("contractBase64", contractBase64)
1680 1683
 
1681 1684
 	//文件获取方式
1682
-	maprequest["fileType"] = 1
1685
+	maprequest["fileType"] = 3
1683 1686
 
1684
-	maprequest["pdfBase64"] = contractBase64
1687
+	//maprequest["pdfBase64"] = name
1685 1688
 	//合同内容
1686
-	maprequest["fileContent"] = contractBase64
1689
+	maprequest["fileContent"] = "https://kuyi.shengws.com/20.pdf"
1687 1690
 
1688 1691
 	//签署用户人ID
1689 1692
 	maprequest["userId"] = "JMO9U8JH4TN8E3QOI0GUVUF2"
@@ -1712,46 +1715,44 @@ func SavePdfInformation() (string, string) {
1712 1715
 	//预冲者样式
1713 1716
 	inputArrOne := make(map[string]interface{})
1714 1717
 	inputArrOne["sealName"] = "1"
1715
-	inputArrOne["keyword"] = "杨姣"
1718
+	inputArrOne["keyword"] = "穿刺者"
1716 1719
 	inputArrOne["pages"] = "0"
1717 1720
 	inputArrOne["offsetX"] = "50"
1718 1721
 	inputArrOne["offsetY"] = "0"
1719 1722
 
1720 1723
 	keywordSignControls = append(keywordSignControls, inputArrOne)
1721
-
1722
-	//穿刺者样式
1724
+	stepStamper["keywordSignControls"] = keywordSignControls
1725
+	//医生签名
1723 1726
 	//inputArr := make(map[string]interface{})
1724 1727
 	//inputArr["sealName"] = "2"
1725
-	//inputArr["keyword"] = "治疗护士"
1728
+	//inputArr["keyword"] = "医生签名"
1726 1729
 	//inputArr["pages"] = "1"
1727 1730
 	//inputArr["offsetX"] = "100"
1728 1731
 	//inputArr["offsetY"] = "0"
1729 1732
 	//
1730 1733
 	//keywordSignControls = append(keywordSignControls, inputArr)
1731 1734
 	//
1732
-	////上机者
1735
+	//上机者
1733 1736
 	//inputArrSix := make(map[string]interface{})
1734 1737
 	//inputArrSix["sealName"] = "3"
1735
-	//inputArrSix["keyword"] = "核对护士"
1738
+	//inputArrSix["keyword"] = "护士签名"
1736 1739
 	//inputArrSix["pages"] = "1"
1737 1740
 	//inputArrSix["offsetX"] = "100"
1738 1741
 	//inputArrSix["offsetY"] = "0"
1739 1742
 	//
1740 1743
 	//keywordSignControls = append(keywordSignControls, inputArrSix)
1741
-	//
1742 1744
 
1743 1745
 	////医生签名
1744 1746
 	//inputArrSeven := make(map[string]interface{})
1745 1747
 	//inputArrSeven["sealName"] = "4"
1746
-	//inputArrSeven["keyword"] = "医生签名"
1748
+	//inputArrSeven["keyword"] = "核对护士签名"
1747 1749
 	//inputArrSeven["pages"] = "1"
1748 1750
 	//inputArrSeven["offsetX"] = "100"
1749 1751
 	//inputArrSeven["offsetY"] = "0"
1750 1752
 	//
1751 1753
 	//keywordSignControls = append(keywordSignControls, inputArrSeven)
1752
-	//
1754
+
1753 1755
 	//stepStamper["keywordSignControls"] = keywordSignControls
1754
-	stepStamper["keywordSignControls"] = keywordSignControls
1755 1756
 	//
1756 1757
 
1757 1758
 	//crossSignControls := make([]map[string]interface{}, 0)
@@ -1766,17 +1767,16 @@ func SavePdfInformation() (string, string) {
1766 1767
 	//stepStamper["crossSignControls"] = crossSignControls
1767 1768
 	//
1768 1769
 	//xySignControls := make([]map[string]interface{}, 0)
1769
-	//
1770 1770
 	//inputArrThree := make(map[string]interface{})
1771 1771
 	//inputArrThree["sealName"] = "1"
1772
-	//inputArrThree["positionX"] = "100"
1773
-	//inputArrThree["positionY"] = "0"
1772
+	//inputArrThree["positionX"] = "200"
1773
+	//inputArrThree["positionY"] = "100"
1774 1774
 	//inputArrThree["pages"] = "0"
1775 1775
 	//
1776 1776
 	//xySignControls = append(xySignControls, inputArrThree)
1777
-	//
1777
+	////
1778 1778
 	//stepStamper["xySignControls"] = xySignControls
1779
-
1779
+	//
1780 1780
 	maprequest["stepStamper"] = stepStamper
1781 1781
 
1782 1782
 	seals := make([]map[string]interface{}, 0)
@@ -1794,7 +1794,7 @@ func SavePdfInformation() (string, string) {
1794 1794
 
1795 1795
 	sealTextsList := make(map[string]interface{})
1796 1796
 	sealTextsList["text"] = "2023年8月8日"
1797
-	sealTextsList["fontSize"] = "100"
1797
+	sealTextsList["fontSize"] = "12"
1798 1798
 	sealTextsList["fontColor"] = "#333333"
1799 1799
 	sealTextsList["isTextArea"] = true
1800 1800
 	sealTextsList["textAlign"] = 0
@@ -1941,7 +1941,7 @@ func SavePdfInformation() (string, string) {
1941 1941
 
1942 1942
 	}
1943 1943
 	str := string(respBytes)
1944
-
1944
+	fmt.Println("报错提示", str)
1945 1945
 	var respJSON map[string]interface{}
1946 1946
 	if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
1947 1947
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
@@ -2037,3 +2037,16 @@ func UpdatePersionEnterPrise(id int64, userId string) error {
2037 2037
 	err := XTWriteDB().Model(&models.XtDevicePersonEnterprise{}).Where("id=? and status =1", id).Updates(map[string]interface{}{"user_id": userId}).Error
2038 2038
 	return err
2039 2039
 }
2040
+
2041
+func SingleImg2Pdf(pathStr string) {
2042
+	pdf := gofpdf.New("P", "mm", "A4", "")
2043
+	pdf.AddPage()
2044
+	pdf.SetFont("Arial", "", 11)
2045
+	pdf.Image(pathStr, 10, 10, pdf.GetPageSizeStr("A4").Wd-20, 0, false, "", 0, "")
2046
+	// pdf.Text(50, 20, "logo.png")
2047
+	fileNameAll := path.Base(pathStr)
2048
+	fileSuffix := path.Ext(pathStr)
2049
+	fileStr := fmt.Sprintf("./pdfs/%s.pdf", fileNameAll[0:len(fileNameAll)-len(fileSuffix)])
2050
+	err := pdf.OutputFileAndClose(fileStr)
2051
+	fmt.Println(err)
2052
+}

+ 3 - 4
service/warhouse_service.go View File

@@ -5756,11 +5756,10 @@ func ConsumablesDeliveryThirty(orgID int64, record_time int64, goods *models.War
5756 5756
 			}
5757 5757
 			CreateGoodErrcode(goodErrcode)
5758 5758
 		}
5759
-	}
5760
-
5761
-	goods.Count = deliver_number - stock_number
5762
-	ConsumablesDeliveryThirty(orgID, record_time, goods, warehouseOut, count, creator)
5763 5759
 
5760
+		goods.Count = deliver_number - stock_number
5761
+		ConsumablesDeliveryThirty(orgID, record_time, goods, warehouseOut, count, creator)
5762
+	}
5764 5763
 	return nil
5765 5764
 }
5766 5765