28169 hace 1 año
padre
commit
1ffb2b91d2

+ 4 - 2
controllers/doctors_api_controller.go Ver fichero

103
 	config, _ := service.GetHisDoctorConfig(orgID)
103
 	config, _ := service.GetHisDoctorConfig(orgID)
104
 	project_config, _ := service.GetHisProjectConfig(orgID)
104
 	project_config, _ := service.GetHisProjectConfig(orgID)
105
 
105
 
106
+	var keyword string
106
 	if config.IsOpen == 0 || config.IsOpen == 2 {
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
 		adminUser, _ := service.GetAllAdminUsers(orgID, adminUserInfo.CurrentAppId)
109
 		adminUser, _ := service.GetAllAdminUsers(orgID, adminUserInfo.CurrentAppId)
109
 		if err != nil {
110
 		if err != nil {
110
 			c.ErrorLog("获取排班信息失败:%v", err)
111
 			c.ErrorLog("获取排班信息失败:%v", err)
1393
 	excution_way, _ := c.GetInt64("excution_way")
1394
 	excution_way, _ := c.GetInt64("excution_way")
1394
 	cost_type, _ := c.GetInt64("cost_type")
1395
 	cost_type, _ := c.GetInt64("cost_type")
1395
 	execution_frequency := c.GetString("execution_frequency")
1396
 	execution_frequency := c.GetString("execution_frequency")
1397
+	keyword := c.GetString("keyword")
1396
 	if adviceType != 1 && adviceType != 3 && adviceType != 2 {
1398
 	if adviceType != 1 && adviceType != 3 && adviceType != 2 {
1397
 		adviceType = 0
1399
 		adviceType = 0
1398
 	}
1400
 	}
1415
 	project_config, _ := service.GetHisProjectConfig(orgID)
1417
 	project_config, _ := service.GetHisProjectConfig(orgID)
1416
 
1418
 
1417
 	if config.IsOpen == 0 || config.IsOpen == 2 {
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
 		adminUser, _ := service.GetAllAdminUsers(orgID, adminUserInfo.CurrentAppId)
1421
 		adminUser, _ := service.GetAllAdminUsers(orgID, adminUserInfo.CurrentAppId)
1420
 		if err != nil {
1422
 		if err != nil {
1421
 			c.ErrorLog("获取排班信息失败:%v", err)
1423
 			c.ErrorLog("获取排班信息失败:%v", err)

+ 75 - 2
controllers/his_api_controller.go Ver fichero

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

+ 3 - 0
controllers/mobile_api_controllers/patient_api_controller.go Ver fichero

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

+ 0 - 1
controllers/schedule_api_controller.go Ver fichero

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

+ 110 - 8
controllers/sign_api_controller.go Ver fichero

657
 
657
 
658
 func (this *SignApiController) UploadPrintOrder() {
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
 	this.ServeSuccessJSON(map[string]interface{}{
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
 
815
 
716
 func (this *SignApiController) SavePdfInformation() {
816
 func (this *SignApiController) SavePdfInformation() {
717
 
817
 
718
-	information, pdfBase64 := service.SavePdfInformation()
818
+	var name string
819
+	information, pdfBase64 := service.SavePdfInformation(name)
719
 	informationOne := service.ToCheckInformation(pdfBase64)
820
 	informationOne := service.ToCheckInformation(pdfBase64)
720
 
821
 
721
 	maprequest := make(map[string]interface{})
822
 	maprequest := make(map[string]interface{})
973
 
1074
 
974
 func (this *SignApiController) ToCheckInformation() {
1075
 func (this *SignApiController) ToCheckInformation() {
975
 
1076
 
976
-	information, pdfBase64 := service.SavePdfInformation()
1077
+	var name string
1078
+	information, pdfBase64 := service.SavePdfInformation(name)
977
 	informationOne := service.ToCheckInformation(pdfBase64)
1079
 	informationOne := service.ToCheckInformation(pdfBase64)
978
 
1080
 
979
 	this.ServeSuccessJSON(map[string]interface{}{
1081
 	this.ServeSuccessJSON(map[string]interface{}{

+ 1 - 1
controllers/stock_in_api_controller.go Ver fichero

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

+ 3 - 0
models/patient_models.go Ver fichero

1808
 	AdminUserId                int64   `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
1808
 	AdminUserId                int64   `gorm:"column:admin_user_id" json:"admin_user_id" form:"admin_user_id"`
1809
 	DialysisRemark             string  `gorm:"column:dialysis_remark" json:"dialysis_remark" form:"dialysis_remark"`
1809
 	DialysisRemark             string  `gorm:"column:dialysis_remark" json:"dialysis_remark" form:"dialysis_remark"`
1810
 	DialyzerPerfusionApparatus string  `gorm:"column:dialyzer_perfusion_apparatus" json:"dialyzer_perfusion_apparatus"`
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
 func (NewDialysisPrescription) TableName() string {
1816
 func (NewDialysisPrescription) TableName() string {

+ 1 - 1
service/manage_service.go Ver fichero

1818
 
1818
 
1819
 func GetDialysisOrderPatient(org_id int64) (order []*models.XtDialysisOrder, err error) {
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
 	return order, err
1823
 	return order, err
1824
 }
1824
 }

+ 423 - 108
service/mobile_dialysis_service.go Ver fichero

4518
 	return record, err
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
 	var vms []*MScheduleDoctorAdviceVM
4523
 	var vms []*MScheduleDoctorAdviceVM
4524
+
4525
+	keyword = "%" + keyword + "%"
4524
 	adviceWhere := ""
4526
 	adviceWhere := ""
4527
+
4525
 	adviceCondition := []interface{}{}
4528
 	adviceCondition := []interface{}{}
4526
 	if adviceType == 0 {
4529
 	if adviceType == 0 {
4527
 		if patientType == 0 {
4530
 		if patientType == 0 {
4529
 				if execution_state > 0 {
4532
 				if execution_state > 0 {
4530
 					if cost_type > 0 {
4533
 					if cost_type > 0 {
4531
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 					} else {
4557
 					} else {
4540
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 							adviceWhere = "status = 1 AND user_org_id = ? AND record_date = ? AND (advice_type = 3 OR advice_type = 1) and patient_id = ? and execution_frequency = ?"
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
 							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_frequency)
4593
 							adviceCondition = append(adviceCondition, adviceWhere, orgID, scheduleDate, patient_id, execution_frequency)
4564
 						} else {
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
 				if execution_state > 0 {
4610
 				if execution_state > 0 {
4575
 					if cost_type > 0 {
4611
 					if cost_type > 0 {
4576
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 					} else {
4632
 					} else {
4585
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 				} else {
4655
 				} else {
4596
 					if cost_type > 0 {
4656
 					if cost_type > 0 {
4597
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 					} else {
4677
 					} else {
4606
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 				if execution_state > 0 {
4706
 				if execution_state > 0 {
4623
 					if cost_type > 0 {
4707
 					if cost_type > 0 {
4624
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 					} else {
4728
 					} else {
4633
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 				} else {
4751
 				} else {
4644
 					if cost_type > 0 {
4752
 					if cost_type > 0 {
4645
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 					} else {
4773
 					} else {
4654
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 				if execution_state > 0 {
4799
 				if execution_state > 0 {
4668
 					if cost_type > 0 {
4800
 					if cost_type > 0 {
4669
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 					} else {
4821
 					} else {
4678
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 				} else {
4844
 				} else {
4689
 					if cost_type > 0 {
4845
 					if cost_type > 0 {
4690
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 					} else {
4866
 					} else {
4699
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 				if execution_state > 0 {
4895
 				if execution_state > 0 {
4716
 					if cost_type > 0 {
4896
 					if cost_type > 0 {
4717
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 					} else {
4917
 					} else {
4726
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 				} else {
4940
 				} else {
4737
 					if cost_type > 0 {
4941
 					if cost_type > 0 {
4738
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 					} else {
4962
 					} else {
4747
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 				if execution_state > 0 {
4988
 				if execution_state > 0 {
4761
 					if cost_type > 0 {
4989
 					if cost_type > 0 {
4762
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 					} else {
5010
 					} else {
4771
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 				} else {
5033
 				} else {
4782
 					if cost_type > 0 {
5034
 					if cost_type > 0 {
4783
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 					} else {
5055
 					} else {
4792
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 				if execution_state > 0 {
5087
 				if execution_state > 0 {
4812
 					if cost_type > 0 {
5088
 					if cost_type > 0 {
4813
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 					} else {
5109
 					} else {
4822
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 				} else {
5132
 				} else {
4833
 					if cost_type > 0 {
5133
 					if cost_type > 0 {
4834
 						if len(execution_frequency) > 0 {
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
 						} else {
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
 					} else {
5154
 					} else {
4843
 						if len(execution_frequency) > 0 {
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 Ver fichero

10
 	"encoding/json"
10
 	"encoding/json"
11
 	"fmt"
11
 	"fmt"
12
 	"github.com/astaxie/beego"
12
 	"github.com/astaxie/beego"
13
+	"github.com/jung-kurt/gofpdf"
13
 	"io/ioutil"
14
 	"io/ioutil"
14
 	"net/http"
15
 	"net/http"
16
+	"path"
15
 )
17
 )
16
 
18
 
17
 func GetSignNameByPhone(phoneOne string) string {
19
 func GetSignNameByPhone(phoneOne string) string {
1657
 	return str, orderId
1659
 	return str, orderId
1658
 }
1660
 }
1659
 
1661
 
1660
-func SavePdfInformation() (string, string) {
1662
+func SavePdfInformation(name string) (string, string) {
1661
 
1663
 
1662
 	var url string
1664
 	var url string
1663
 
1665
 
1671
 
1673
 
1672
 	maprequest["signTitle"] = "举报合同"
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
 	//签署用户人ID
1691
 	//签署用户人ID
1689
 	maprequest["userId"] = "JMO9U8JH4TN8E3QOI0GUVUF2"
1692
 	maprequest["userId"] = "JMO9U8JH4TN8E3QOI0GUVUF2"
1712
 	//预冲者样式
1715
 	//预冲者样式
1713
 	inputArrOne := make(map[string]interface{})
1716
 	inputArrOne := make(map[string]interface{})
1714
 	inputArrOne["sealName"] = "1"
1717
 	inputArrOne["sealName"] = "1"
1715
-	inputArrOne["keyword"] = "杨姣"
1718
+	inputArrOne["keyword"] = "穿刺者"
1716
 	inputArrOne["pages"] = "0"
1719
 	inputArrOne["pages"] = "0"
1717
 	inputArrOne["offsetX"] = "50"
1720
 	inputArrOne["offsetX"] = "50"
1718
 	inputArrOne["offsetY"] = "0"
1721
 	inputArrOne["offsetY"] = "0"
1719
 
1722
 
1720
 	keywordSignControls = append(keywordSignControls, inputArrOne)
1723
 	keywordSignControls = append(keywordSignControls, inputArrOne)
1721
-
1722
-	//穿刺者样式
1724
+	stepStamper["keywordSignControls"] = keywordSignControls
1725
+	//医生签名
1723
 	//inputArr := make(map[string]interface{})
1726
 	//inputArr := make(map[string]interface{})
1724
 	//inputArr["sealName"] = "2"
1727
 	//inputArr["sealName"] = "2"
1725
-	//inputArr["keyword"] = "治疗护士"
1728
+	//inputArr["keyword"] = "医生签名"
1726
 	//inputArr["pages"] = "1"
1729
 	//inputArr["pages"] = "1"
1727
 	//inputArr["offsetX"] = "100"
1730
 	//inputArr["offsetX"] = "100"
1728
 	//inputArr["offsetY"] = "0"
1731
 	//inputArr["offsetY"] = "0"
1729
 	//
1732
 	//
1730
 	//keywordSignControls = append(keywordSignControls, inputArr)
1733
 	//keywordSignControls = append(keywordSignControls, inputArr)
1731
 	//
1734
 	//
1732
-	////上机者
1735
+	//上机者
1733
 	//inputArrSix := make(map[string]interface{})
1736
 	//inputArrSix := make(map[string]interface{})
1734
 	//inputArrSix["sealName"] = "3"
1737
 	//inputArrSix["sealName"] = "3"
1735
-	//inputArrSix["keyword"] = "核对护士"
1738
+	//inputArrSix["keyword"] = "护士签名"
1736
 	//inputArrSix["pages"] = "1"
1739
 	//inputArrSix["pages"] = "1"
1737
 	//inputArrSix["offsetX"] = "100"
1740
 	//inputArrSix["offsetX"] = "100"
1738
 	//inputArrSix["offsetY"] = "0"
1741
 	//inputArrSix["offsetY"] = "0"
1739
 	//
1742
 	//
1740
 	//keywordSignControls = append(keywordSignControls, inputArrSix)
1743
 	//keywordSignControls = append(keywordSignControls, inputArrSix)
1741
-	//
1742
 
1744
 
1743
 	////医生签名
1745
 	////医生签名
1744
 	//inputArrSeven := make(map[string]interface{})
1746
 	//inputArrSeven := make(map[string]interface{})
1745
 	//inputArrSeven["sealName"] = "4"
1747
 	//inputArrSeven["sealName"] = "4"
1746
-	//inputArrSeven["keyword"] = "医生签名"
1748
+	//inputArrSeven["keyword"] = "核对护士签名"
1747
 	//inputArrSeven["pages"] = "1"
1749
 	//inputArrSeven["pages"] = "1"
1748
 	//inputArrSeven["offsetX"] = "100"
1750
 	//inputArrSeven["offsetX"] = "100"
1749
 	//inputArrSeven["offsetY"] = "0"
1751
 	//inputArrSeven["offsetY"] = "0"
1750
 	//
1752
 	//
1751
 	//keywordSignControls = append(keywordSignControls, inputArrSeven)
1753
 	//keywordSignControls = append(keywordSignControls, inputArrSeven)
1752
-	//
1754
+
1753
 	//stepStamper["keywordSignControls"] = keywordSignControls
1755
 	//stepStamper["keywordSignControls"] = keywordSignControls
1754
-	stepStamper["keywordSignControls"] = keywordSignControls
1755
 	//
1756
 	//
1756
 
1757
 
1757
 	//crossSignControls := make([]map[string]interface{}, 0)
1758
 	//crossSignControls := make([]map[string]interface{}, 0)
1766
 	//stepStamper["crossSignControls"] = crossSignControls
1767
 	//stepStamper["crossSignControls"] = crossSignControls
1767
 	//
1768
 	//
1768
 	//xySignControls := make([]map[string]interface{}, 0)
1769
 	//xySignControls := make([]map[string]interface{}, 0)
1769
-	//
1770
 	//inputArrThree := make(map[string]interface{})
1770
 	//inputArrThree := make(map[string]interface{})
1771
 	//inputArrThree["sealName"] = "1"
1771
 	//inputArrThree["sealName"] = "1"
1772
-	//inputArrThree["positionX"] = "100"
1773
-	//inputArrThree["positionY"] = "0"
1772
+	//inputArrThree["positionX"] = "200"
1773
+	//inputArrThree["positionY"] = "100"
1774
 	//inputArrThree["pages"] = "0"
1774
 	//inputArrThree["pages"] = "0"
1775
 	//
1775
 	//
1776
 	//xySignControls = append(xySignControls, inputArrThree)
1776
 	//xySignControls = append(xySignControls, inputArrThree)
1777
-	//
1777
+	////
1778
 	//stepStamper["xySignControls"] = xySignControls
1778
 	//stepStamper["xySignControls"] = xySignControls
1779
-
1779
+	//
1780
 	maprequest["stepStamper"] = stepStamper
1780
 	maprequest["stepStamper"] = stepStamper
1781
 
1781
 
1782
 	seals := make([]map[string]interface{}, 0)
1782
 	seals := make([]map[string]interface{}, 0)
1794
 
1794
 
1795
 	sealTextsList := make(map[string]interface{})
1795
 	sealTextsList := make(map[string]interface{})
1796
 	sealTextsList["text"] = "2023年8月8日"
1796
 	sealTextsList["text"] = "2023年8月8日"
1797
-	sealTextsList["fontSize"] = "100"
1797
+	sealTextsList["fontSize"] = "12"
1798
 	sealTextsList["fontColor"] = "#333333"
1798
 	sealTextsList["fontColor"] = "#333333"
1799
 	sealTextsList["isTextArea"] = true
1799
 	sealTextsList["isTextArea"] = true
1800
 	sealTextsList["textAlign"] = 0
1800
 	sealTextsList["textAlign"] = 0
1941
 
1941
 
1942
 	}
1942
 	}
1943
 	str := string(respBytes)
1943
 	str := string(respBytes)
1944
-
1944
+	fmt.Println("报错提示", str)
1945
 	var respJSON map[string]interface{}
1945
 	var respJSON map[string]interface{}
1946
 	if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
1946
 	if err := json.Unmarshal([]byte(string(respBytes)), &respJSON); err != nil {
1947
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
1947
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
2037
 	err := XTWriteDB().Model(&models.XtDevicePersonEnterprise{}).Where("id=? and status =1", id).Updates(map[string]interface{}{"user_id": userId}).Error
2037
 	err := XTWriteDB().Model(&models.XtDevicePersonEnterprise{}).Where("id=? and status =1", id).Updates(map[string]interface{}{"user_id": userId}).Error
2038
 	return err
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 Ver fichero

5756
 			}
5756
 			}
5757
 			CreateGoodErrcode(goodErrcode)
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
 	return nil
5763
 	return nil
5765
 }
5764
 }
5766
 
5765