Browse Source

2024/6/17

28169 2 months ago
parent
commit
1a3d851610

+ 4 - 4
controllers/base_api_controller.go View File

@@ -83,7 +83,7 @@ func (this *BaseAuthAPIController) Prepare() {
83 83
 		userAdmin.ModifyTime = 1530786071
84 84
 		var subscibe models.ServeSubscibe
85 85
 		subscibe.ID = 11
86
-		subscibe.OrgId = 10567 //机构id
86
+		subscibe.OrgId = 10644 //机构id
87 87
 		subscibe.PeriodStart = 1547447814
88 88
 		subscibe.PeriodEnd = 1550039814
89 89
 		subscibe.State = 1
@@ -93,7 +93,7 @@ func (this *BaseAuthAPIController) Prepare() {
93 93
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
94 94
 		subscibes[4] = &subscibe
95 95
 		var adminUserInfo service.AdminUserInfo
96
-		adminUserInfo.CurrentOrgId = 10567 //机构id小英9675或4
96
+		adminUserInfo.CurrentOrgId = 10644 //机构id小英9675或4
97 97
 		adminUserInfo.CurrentAppId = 10697 //4
98 98
 		adminUserInfo.AdminUser = &userAdmin
99 99
 		adminUserInfo.Subscibes = subscibes
@@ -329,7 +329,7 @@ func (this *BaseServeAPIController) Prepare() {
329 329
 		userAdmin.ModifyTime = 1530786071
330 330
 		var subscibe models.ServeSubscibe
331 331
 		subscibe.ID = 11
332
-		subscibe.OrgId = 10567 //机构id小英9675或4
332
+		subscibe.OrgId = 10644 //机构id小英9675或4
333 333
 		subscibe.PeriodStart = 1538035409
334 334
 		subscibe.PeriodEnd = 1569571409
335 335
 		subscibe.State = 1
@@ -339,7 +339,7 @@ func (this *BaseServeAPIController) Prepare() {
339 339
 		subscibes := make(map[int64]*models.ServeSubscibe, 0)
340 340
 		subscibes[4] = &subscibe
341 341
 		var adminUserInfo service.AdminUserInfo
342
-		adminUserInfo.CurrentOrgId = 10567 //机构id小英9675或4
342
+		adminUserInfo.CurrentOrgId = 10644 //机构id小英9675或4
343 343
 		adminUserInfo.CurrentAppId = 16787 //4
344 344
 		adminUserInfo.AdminUser = &userAdmin
345 345
 		adminUserInfo.Subscibes = subscibes

+ 1 - 1
controllers/dialysis_api_controller.go View File

@@ -2573,7 +2573,7 @@ func (c *DialysisApiController) PostAssessmentBeforeDislysis() {
2573 2573
 			service.CreateDialysisFinish(finish)
2574 2574
 		}
2575 2575
 
2576
-		if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10469 || adminUserInfo.CurrentOrgId == 10551 || adminUserInfo.CurrentOrgId == 10579 || adminUserInfo.CurrentOrgId == 10580 || adminUserInfo.CurrentOrgId == 10585 || adminUserInfo.CurrentOrgId == 10344 || adminUserInfo.CurrentOrgId == 10622 || adminUserInfo.CurrentOrgId == 10702 {
2576
+		if adminUserInfo.CurrentOrgId == 9671 || adminUserInfo.CurrentOrgId == 3877 || adminUserInfo.CurrentOrgId == 10469 || adminUserInfo.CurrentOrgId == 10551 || adminUserInfo.CurrentOrgId == 10579 || adminUserInfo.CurrentOrgId == 10580 || adminUserInfo.CurrentOrgId == 10585 || adminUserInfo.CurrentOrgId == 10344 || adminUserInfo.CurrentOrgId == 10622 || adminUserInfo.CurrentOrgId == 10702 || adminUserInfo.CurrentOrgId == 10635 {
2577 2577
 			var dewater_amount float64
2578 2578
 			dewater_amount = 0
2579 2579
 			if dry_weight > 0 {

+ 3 - 1
controllers/drug_stock_api_contorller.go View File

@@ -3470,6 +3470,8 @@ func (c *StockDrugApiController) GetDrugWarehouseInfoPrint() {
3470 3470
 	end_time := c.GetString("end_time")
3471 3471
 
3472 3472
 	order_type, _ := c.GetInt64("order_type")
3473
+
3474
+	storehouse_id, _ := c.GetInt64("storehouse_id")
3473 3475
 	timeLayout := "2006-01-02"
3474 3476
 	loc, _ := time.LoadLocation("Local")
3475 3477
 
@@ -3496,7 +3498,7 @@ func (c *StockDrugApiController) GetDrugWarehouseInfoPrint() {
3496 3498
 	adminUserInfo := c.GetAdminUserInfo()
3497 3499
 	orgId := adminUserInfo.CurrentOrgId
3498 3500
 	if order_type == 1 {
3499
-		list, err := service.GetDrugWarehouseInfoPrint(startTime, endTime, orgId)
3501
+		list, err := service.GetDrugWarehouseInfoPrint(startTime, endTime, orgId, storehouse_id)
3500 3502
 		manufacturerList, _ := service.GetAllManufacturerList(orgId)
3501 3503
 		dealerList, _ := service.GetAllDealerList(orgId)
3502 3504
 		if err == nil {

+ 13 - 0
controllers/his_api_controller.go View File

@@ -106,6 +106,8 @@ func HisManagerApiRegistRouters() {
106 106
 	beego.Router("/api/checkhispatient", &HisApiController{}, "get:CheckHisPatient")
107 107
 	beego.Router("/api/hisorder/listtwo", &HisApiController{}, "get:GetHisOrderListTwo")
108 108
 
109
+	beego.Router("/api/getallgoodinforlist", &HisApiController{}, "Get:GetAllGoodInforList")
110
+
109 111
 }
110 112
 
111 113
 func (c *HisApiController) CheckHisPatient() {
@@ -14174,3 +14176,14 @@ func GetCompareData(dataBody map[string]interface{}) (editCustomData EditCustomD
14174 14176
 
14175 14177
 	return
14176 14178
 }
14179
+
14180
+func (c *HisApiController) GetAllGoodInforList() {
14181
+
14182
+	orgId := c.GetAdminUserInfo().CurrentOrgId
14183
+	goodList, _ := service.GetAllGoodList(orgId)
14184
+
14185
+	c.ServeSuccessJSON(map[string]interface{}{
14186
+		"goodList": goodList,
14187
+	})
14188
+	return
14189
+}

+ 37 - 3
controllers/manager_center_api_controller.go View File

@@ -165,7 +165,7 @@ func (c *ManagerCenterApiController) CreateBaseDrugLib() {
165 165
 	is_show, _ := c.GetInt64("is_show")
166 166
 	adminInfo := c.GetAdminUserInfo()
167 167
 	is_self_drug, _ := c.GetInt64("is_self_drug")
168
-
168
+	specification_name := c.GetString("specification_name")
169 169
 	hans := drug_name // 要转换的汉字字符串
170 170
 
171 171
 	// 创建一个拼音转换器
@@ -256,6 +256,7 @@ func (c *ManagerCenterApiController) CreateBaseDrugLib() {
256 256
 		IsProject:                   is_project,
257 257
 		IsShow:                      is_show,
258 258
 		IsSelfDrug:                  is_self_drug,
259
+		SpecificationName:           specification_name,
259 260
 	}
260 261
 	drugLib.FirstLetter = firstLetter
261 262
 	drugLib.Pinyin = firstLetter
@@ -272,6 +273,16 @@ func (c *ManagerCenterApiController) CreateBaseDrugLib() {
272 273
 
273 274
 			drugLib.DrugSpec = drugLib.Dose + drugLib.DoseUnit + "*" + string(drugLib.MinNumber) + drugLib.MinUnit + "/" + drugLib.MaxUnit
274 275
 		}
276
+		if drugLib.IsSpecialDiseases == 0 {
277
+			drugLib.IsSpecialDiseases = 1
278
+		}
279
+		if drugLib.IsSelfDrug == 0 {
280
+			drugLib.IsSelfDrug = 2
281
+		}
282
+
283
+		if drugLib.SpecificationName == "" || len(drugLib.SpecificationName) == 0 {
284
+			drugLib.SpecificationName = drugLib.Dose + drugLib.DoseUnit + "*" + string(drugLib.MinNumber) + drugLib.MinUnit + "/" + drugLib.MaxUnit
285
+		}
275 286
 		err := service.CreateBaseDrugLib(drugLib)
276 287
 		if err == nil {
277 288
 			c.ServeSuccessJSON(map[string]interface{}{
@@ -369,6 +380,7 @@ func (c *ManagerCenterApiController) EditBaseDrugLib() {
369 380
 	is_project, _ := c.GetInt64("is_project")
370 381
 	is_show, _ := c.GetInt64("is_show")
371 382
 	is_self_drug, _ := c.GetInt64("is_self_drug")
383
+	specification_name := c.GetString("specification_name")
372 384
 	adminInfo := c.GetAdminUserInfo()
373 385
 	drug, _ := service.FindBaseDrugLibRecord(adminInfo.CurrentOrgId, id)
374 386
 
@@ -465,12 +477,36 @@ func (c *ManagerCenterApiController) EditBaseDrugLib() {
465 477
 		FirstLetter:                 firstLetter,
466 478
 		IsShow:                      is_show,
467 479
 		IsSelfDrug:                  is_self_drug,
480
+		SpecificationName:           specification_name,
468 481
 	}
469 482
 	if adminInfo.CurrentOrgId == 10206 || adminInfo.CurrentOrgId == 10344 {
470 483
 
471 484
 		drugLib.DrugSpec = drugLib.Dose + drugLib.DoseUnit + "*" + string(drugLib.MinNumber) + drugLib.MinUnit + "/" + drugLib.MaxUnit
472 485
 	}
473 486
 
487
+	if len(drugLib.SpecificationName) == 0 || drugLib.SpecificationName == "" {
488
+
489
+		drugLib.SpecificationName = drugLib.Dose + drugLib.DoseUnit + "*" + string(drugLib.MinNumber) + drugLib.MinUnit + "/" + drugLib.MaxUnit
490
+	}
491
+
492
+	//查询该药品信息
493
+	baseDrugMedical, _ := service.GetBaseDrugMedical(id)
494
+
495
+	var specificationName = ""
496
+	var specificationNameOne = ""
497
+	specificationName = drugLib.Dose + drugLib.DoseUnit + "*" + string(drugLib.MinNumber) + drugLib.MinUnit + "/" + drugLib.MaxUnit
498
+
499
+	specificationNameOne = baseDrugMedical.Dose + baseDrugMedical.DoseUnit + "*" + string(baseDrugMedical.MinNumber) + baseDrugMedical.MinUnit + "/" + baseDrugMedical.MaxUnit
500
+
501
+	if specificationName != specificationNameOne {
502
+		//查询是否入库
503
+		drugInfo, _ := service.GetDrugWarehosueInfoById(id, adminInfo.CurrentOrgId)
504
+		if len(drugInfo) > 0 {
505
+			c.ServeDynamicFailJsonSend(baseDrugMedical.DrugName + "该药品已经入库,不能修改规格换算单位,请联系工作人员!")
506
+			return
507
+		}
508
+	}
509
+
474 510
 	err := service.UpdateBaseDrugLib(drugLib)
475 511
 
476 512
 	//查下医嘱模板
@@ -575,7 +611,6 @@ func (c *ManagerCenterApiController) EditBaseDrugLib() {
575 611
 
576 612
 	_, errSix := service.GetDoctorAdviceIsExist(id, adminInfo.CurrentOrgId)
577 613
 	if errSix == gorm.ErrRecordNotFound {
578
-		fmt.Println("进来了吗5")
579 614
 		c.ServeSuccessJSON(map[string]interface{}{
580 615
 			"msg": "修改成功",
581 616
 		})
@@ -597,7 +632,6 @@ func (c *ManagerCenterApiController) EditBaseDrugLib() {
597 632
 	_, errSeven := service.GetDoctorAdviceTemplateIsExist(id, adminInfo.CurrentOrgId)
598 633
 
599 634
 	if errSeven == gorm.ErrRecordNotFound {
600
-		fmt.Println("进来了吗6")
601 635
 		c.ServeSuccessJSON(map[string]interface{}{
602 636
 			"msg": "修改成功",
603 637
 		})

+ 31 - 10
controllers/mobile_api_controllers/patient_api_controller.go View File

@@ -1418,14 +1418,20 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1418 1418
 											//查询今日是否出库
1419 1419
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1420 1420
 											if drugOutInfo.ID == 0 {
1421
-												service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1421
+												if item.UserOrgId != 10644 {
1422
+													service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1423
+												}
1424
+
1422 1425
 											}
1423 1426
 
1424 1427
 										}
1425 1428
 										if pharmacyConfig.IsOpen != 1 {
1426 1429
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1427 1430
 											if drugOutInfo.ID == 0 {
1428
-												service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1431
+												if item.UserOrgId != 10644 {
1432
+													service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1433
+												}
1434
+
1429 1435
 											}
1430 1436
 										}
1431 1437
 
@@ -1449,7 +1455,10 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1449 1455
 									if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
1450 1456
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1451 1457
 										if drugOutInfo.ID == 0 {
1452
-											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1458
+											if item.UserOrgId != 10644 {
1459
+												service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1460
+											}
1461
+
1453 1462
 										}
1454 1463
 									}
1455 1464
 									if pharmacyConfig.IsOpen != 1 {
@@ -1470,8 +1479,10 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1470 1479
 										service.CreateDrugError(drugError)
1471 1480
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1472 1481
 										if drugOutInfo.ID == 0 {
1482
+											if item.UserOrgId != 10644 {
1483
+												service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1484
+											}
1473 1485
 
1474
-											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1475 1486
 										}
1476 1487
 									}
1477 1488
 
@@ -1580,14 +1591,20 @@ func (c *PatientApiController) ExecDoctorAdvice() {
1580 1591
 									//查询今日是否出库
1581 1592
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1582 1593
 									if drugOutInfo.ID == 0 {
1583
-										service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1594
+										if item.UserOrgId != 10644 {
1595
+											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1596
+										}
1597
+
1584 1598
 									}
1585 1599
 								}
1586 1600
 								if pharmacyConfig.IsOpen != 1 {
1587 1601
 									//查询今日是否出库
1588 1602
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1589 1603
 									if drugOutInfo.ID == 0 {
1590
-										service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1604
+										if item.UserOrgId != 10644 {
1605
+											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, &item)
1606
+										}
1607
+
1591 1608
 									}
1592 1609
 								}
1593 1610
 
@@ -2203,8 +2220,9 @@ func (c *PatientApiController) ExecDoctorAdvice() {
2203 2220
 
2204 2221
 										newadviceInfo.PrescribingNumber = float64(cha_count)
2205 2222
 										newadviceInfo.PrescribingNumberUnit = medical.MinUnit
2206
-
2207
-										service.NewHisDrugsDelivery(advice.UserOrgId, creater, newadviceInfo, tx)
2223
+										if advice.UserOrgId != 10644 {
2224
+											service.NewHisDrugsDelivery(advice.UserOrgId, creater, newadviceInfo, tx)
2225
+										}
2208 2226
 
2209 2227
 									}
2210 2228
 
@@ -2219,7 +2237,10 @@ func (c *PatientApiController) ExecDoctorAdvice() {
2219 2237
 
2220 2238
 									if prescribing_number_total == out_count {
2221 2239
 										if out_count == 0 {
2222
-											service.NewHisDrugsDelivery(advice.UserOrgId, creater, newadviceInfo, tx)
2240
+											if advice.UserOrgId != 10644 {
2241
+												service.NewHisDrugsDelivery(advice.UserOrgId, creater, newadviceInfo, tx)
2242
+											}
2243
+
2223 2244
 										}
2224 2245
 
2225 2246
 									}
@@ -3465,7 +3486,7 @@ func (c *PatientApiController) EditAssessmentBeforeDislysis() {
3465 3486
 	if evaluation.DryWeight > 0 {
3466 3487
 		dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
3467 3488
 
3468
-		if template.TemplateId == 17 || template.TemplateId == 22 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 34 || template.TemplateId == 32 || adminUserInfo.Org.Id == 10469 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10551 || adminUserInfo.Org.Id == 10579 || adminUserInfo.Org.Id == 10580 || adminUserInfo.Org.Id == 10585 {
3489
+		if template.TemplateId == 17 || template.TemplateId == 22 || template.TemplateId == 21 || template.TemplateId == 26 || template.TemplateId == 34 || template.TemplateId == 32 || adminUserInfo.Org.Id == 10469 || adminUserInfo.Org.Id == 3877 || adminUserInfo.Org.Id == 10551 || adminUserInfo.Org.Id == 10579 || adminUserInfo.Org.Id == 10580 || adminUserInfo.Org.Id == 10585 || adminUserInfo.Org.Id == 10635 {
3469 3490
 
3470 3491
 			if adminUserInfo.Org.Id != 10551 && adminUserInfo.Org.Id != 10579 && adminUserInfo.Org.Id != 10580 && adminUserInfo.Org.Id != 10585 {
3471 3492
 				dewater_amount = dewater_amount * 1000

+ 24 - 6
controllers/patient_api_controller.go View File

@@ -2252,14 +2252,20 @@ func (c *PatientApiController) ExecGroupAdvice() {
2252 2252
 					if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
2253 2253
 						drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2254 2254
 						if drugOutInfo.ID == 0 {
2255
-							service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
2255
+							if item.UserOrgId != 10644 {
2256
+								service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
2257
+							}
2258
+
2256 2259
 						}
2257 2260
 
2258 2261
 					}
2259 2262
 					if pharmacyConfig.IsOpen != 1 {
2260 2263
 						drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2261 2264
 						if drugOutInfo.ID == 0 {
2262
-							service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
2265
+							if item.UserOrgId != 10644 {
2266
+								service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
2267
+							}
2268
+
2263 2269
 						}
2264 2270
 					}
2265 2271
 
@@ -2605,7 +2611,10 @@ func (c *PatientApiController) ExecDoctorAdvice() {
2605 2611
 
2606 2612
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2607 2613
 									if drugOutInfo.ID == 0 {
2608
-										service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
2614
+										if item.UserOrgId != 10644 {
2615
+											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
2616
+										}
2617
+
2609 2618
 									}
2610 2619
 								}
2611 2620
 								//不通过药房发药
@@ -2614,7 +2623,10 @@ func (c *PatientApiController) ExecDoctorAdvice() {
2614 2623
 
2615 2624
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2616 2625
 									if drugOutInfo.ID == 0 {
2617
-										service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
2626
+										if item.UserOrgId != 10644 {
2627
+											service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
2628
+										}
2629
+
2618 2630
 									}
2619 2631
 								}
2620 2632
 
@@ -2667,7 +2679,10 @@ func (c *PatientApiController) ExecDoctorAdvice() {
2667 2679
 
2668 2680
 								drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2669 2681
 								if drugOutInfo.ID == 0 {
2670
-									service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
2682
+									if item.UserOrgId != 10644 {
2683
+										service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
2684
+									}
2685
+
2671 2686
 								}
2672 2687
 							}
2673 2688
 							//不通过药房发药
@@ -2675,7 +2690,10 @@ func (c *PatientApiController) ExecDoctorAdvice() {
2675 2690
 
2676 2691
 								drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2677 2692
 								if drugOutInfo.ID == 0 {
2678
-									service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
2693
+									if item.UserOrgId != 10644 {
2694
+										service.DrugsDelivery(item.UserOrgId, item.ExecutionStaff, item)
2695
+									}
2696
+
2679 2697
 								}
2680 2698
 							}
2681 2699
 							//更新字典里面的库存

+ 2 - 1
controllers/print_data_api_controller.go View File

@@ -338,6 +338,7 @@ func (this *PrintDataAPIController) GetGoodDetailPrintList() {
338 338
 	types, _ := this.GetInt("type", 0)
339 339
 	start_time := this.GetString("start_time")
340 340
 	end_time := this.GetString("end_time")
341
+	storehouse_id, _ := this.GetInt64("storehouse_id")
341 342
 	adminUserInfo := this.GetAdminUserInfo()
342 343
 
343 344
 	timeLayout := "2006-01-02"
@@ -366,7 +367,7 @@ func (this *PrintDataAPIController) GetGoodDetailPrintList() {
366 367
 
367 368
 	//入库详情
368 369
 	if types == 1 {
369
-		list, err := service.GetWarehouseInfoGoodDetailPrintList(adminUserInfo.CurrentOrgId, startTime, endTime, limit, page)
370
+		list, err := service.GetWarehouseInfoGoodDetailPrintList(adminUserInfo.CurrentOrgId, startTime, endTime, limit, page, storehouse_id)
370 371
 		if err != nil {
371 372
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
372 373
 			return

+ 15 - 7
controllers/stock_in_api_controller.go View File

@@ -8162,7 +8162,7 @@ func (this *StockManagerApiController) GetGoodPatientName() {
8162 8162
 
8163 8163
 func (this *StockManagerApiController) UpdateBaseDrugListByUserOrgID() {
8164 8164
 
8165
-	orgId := this.GetAdminUserInfo().CurrentOrgId
8165
+	//orgId := this.GetAdminUserInfo().CurrentOrgId
8166 8166
 
8167 8167
 	//list, _ := service.GetAllBaseDrugList(orgId)
8168 8168
 	//
@@ -8227,15 +8227,23 @@ func (this *StockManagerApiController) UpdateBaseDrugListByUserOrgID() {
8227 8227
 
8228 8228
 	//info, _ := service.GetDrugAllInfo(orgId)
8229 8229
 
8230
-	info, _ := service.GetDrugOutAllInfo(orgId)
8231
-
8232
-	for _, item := range info {
8230
+	//info, _ := service.GetDrugOutAllInfo(orgId)
8231
+	//
8232
+	//for _, item := range info {
8233
+	//
8234
+	//	//dealer, _ := service.GetDealerById(item.Dealer)
8235
+	//
8236
+	//	manufacturer, _ := service.GetManufactureById(item.Manufacturer)
8237
+	//
8238
+	//	service.UpdateDealerManufacturerOne(item.ID, manufacturer.ManufacturerName)
8239
+	//}
8233 8240
 
8234
-		//dealer, _ := service.GetDealerById(item.Dealer)
8241
+	drugList, _ := service.GetAllBaseDrugListTwenty(10644)
8235 8242
 
8236
-		manufacturer, _ := service.GetManufactureById(item.Manufacturer)
8243
+	for _, item := range drugList {
8244
+		var drug_spec = item.Dose + item.DoseUnit + "*" + strconv.FormatInt(item.MinNumber, 10) + item.MinUnit + "/" + item.MaxUnit
8237 8245
 
8238
-		service.UpdateDealerManufacturerOne(item.ID, manufacturer.ManufacturerName)
8246
+		service.UpdateBaseDrugList(item.ID, drug_spec)
8239 8247
 	}
8240 8248
 
8241 8249
 }

+ 1 - 0
models/drug.go View File

@@ -90,6 +90,7 @@ type BaseDrugLib struct {
90 90
 	DrugDosageFormName string `gorm:"column:drug_dosage_form_name" json:"drug_dosage_form_name" form:"drug_dosage_form_name"`
91 91
 	IsShow             int64  `gorm:"column:is_show" json:"is_show" form:"is_show"`
92 92
 	IsSelfDrug         int64  `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
93
+	SpecificationName  string `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
93 94
 }
94 95
 
95 96
 func (BaseDrugLib) TableName() string {

+ 1 - 0
models/self_drug_models.go View File

@@ -82,6 +82,7 @@ type XtBaseDrug struct {
82 82
 	IsShow                 int64   `gorm:"column:is_show" json:"is_show" form:"is_show"`
83 83
 	IsSelfDrug             int64   `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
84 84
 	SumCount               int64   `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
85
+	SpecificationName      string  `gorm:"column:specification_name" json:"specification_name" form:"specification_name"`
85 86
 }
86 87
 
87 88
 func (XtBaseDrug) TableName() string {

+ 4 - 1
service/drug_stock_service.go View File

@@ -194,7 +194,7 @@ func GetDrugCancelExportList(orderid []string, orgid int64) (info []*models.Drug
194 194
 	return info, err
195 195
 }
196 196
 
197
-func GetDrugWarehouseInfoPrint(startime int64, endtime int64, orgid int64) (info []*models.XtDrugWarehouseInfo, err error) {
197
+func GetDrugWarehouseInfoPrint(startime int64, endtime int64, orgid int64, storehouse_id int64) (info []*models.XtDrugWarehouseInfo, err error) {
198 198
 
199 199
 	db := XTReadDB().Table("xt_drug_warehouse_info as x").Where("x.status = 1")
200 200
 	if startime > 0 {
@@ -206,6 +206,9 @@ func GetDrugWarehouseInfoPrint(startime int64, endtime int64, orgid int64) (info
206 206
 	if orgid > 0 {
207 207
 		db = db.Where("x.org_id = ?", orgid)
208 208
 	}
209
+	if storehouse_id > 0 {
210
+		db = db.Where("storehouse_id =?", storehouse_id)
211
+	}
209 212
 	err = db.Select("x.id,x.warehousing_id,x.drug_id,x.number,x.product_date,x.expiry_date,sum(x.warehousing_count) as warehousing_count,x.price,x.total_price,x.manufacturer,x.remark,x.is_return,x.warehousing_order,x.type,x.retail_price,x.retail_total_price,x.warehouseing_unit,x.max_unit,x.min_unit,x.stock_max_number,x.stock_min_number,x.batch_number,x.dealer,x.manufacturer").Preload("XtBaseDrug", "status = 1 and org_id = ?", orgid).Group("x.drug_id").Find(&info).Error
210 213
 
211 214
 	//err = db.Select("x.id,x.warehousing_id,x.drug_id,x.number,x.product_date,x.expiry_date,sum(x.warehousing_count) as warehousing_count,x.price,x.total_price,x.dealer,x.manufacturer,x.remark,x.is_return,x.warehousing_order,x.type,x.retail_price,x.retail_total_price,x.warehouseing_unit,x.max_unit,x.min_unit,x.stock_max_number,x.stock_min_number,x.batch_number").Group("x.drug_id").Find(&DrugWarehouseInfo{}).Error

+ 7 - 0
service/gobal_config_service.go View File

@@ -1088,6 +1088,13 @@ func GetAllBaseDrugListTwenty(orgid int64) (drug []*models.BaseDrugLibTwenty, er
1088 1088
 	return drug, err
1089 1089
 }
1090 1090
 
1091
+func UpdateBaseDrugList(drug_id int64, specification_name string) error {
1092
+
1093
+	err := XTWriteDB().Model(&models.XtBaseDrug{}).Where("id = ? and status=1", drug_id).Updates(map[string]interface{}{"specification_name": specification_name}).Error
1094
+
1095
+	return err
1096
+}
1097
+
1091 1098
 func GetScheduleConfigByOrgId(org_id int64) (config models.ScheduleConfig, err error) {
1092 1099
 	err = XTReadDB().Model(&models.ScheduleConfig{}).Where("user_org_id = ?", org_id).First(&config).Error
1093 1100
 	return config, err

+ 5 - 1
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go View File

@@ -266,7 +266,7 @@ func GetGoodInfomationList(orgid int64) (goodInfo []*models.GoodInfo, err error)
266 266
 	return goodInfo, err
267 267
 }
268 268
 
269
-func GetWarehouseInfoGoodDetailPrintList(orgid int64, startime int64, endtime int64, limit int64, page int64) (info []*models.VmWarehousingInfo, err error) {
269
+func GetWarehouseInfoGoodDetailPrintList(orgid int64, startime int64, endtime int64, limit int64, page int64, storehouse_id int64) (info []*models.VmWarehousingInfo, err error) {
270 270
 	//offset := (page - 1) * limit
271 271
 	db := p_service.XTReadDB().Table("xt_warehouse_info as x").Where("x.status = 1")
272 272
 	table := p_service.XTReadDB().Table("xt_good_information as t").Where("t.status = 1")
@@ -282,6 +282,10 @@ func GetWarehouseInfoGoodDetailPrintList(orgid int64, startime int64, endtime in
282 282
 		db = db.Where("x.ctime<=?", endtime)
283 283
 	}
284 284
 
285
+	if storehouse_id > 0 {
286
+		db = db.Where("x.storehouse_id =?", storehouse_id)
287
+	}
288
+
285 289
 	err = db.Select("x.id,x.warehousing_id,x.good_id,x.good_type_id,x.number,x.product_date,x.expiry_date,sum(x.warehousing_count) as warehousing_count,x.warehousing_unit,x.stock_count,x.price,x.total_price,x.dealer,x.manufacturer,x.remark,x.is_return,x.warehousing_order,x.type,x.license_number,t.good_name,t.specification_name,t.min_number,t.packing_unit").Joins("left join xt_good_information as t on t.id = x.good_id").Group("x.good_id").Scan(&info).Error
286 290
 	return info, err
287 291
 }

+ 7 - 0
service/self_drug_service.go View File

@@ -138,6 +138,13 @@ func GetBaseDrugMedical(id int64) (models.XtBaseDrug, error) {
138 138
 	return drug, err
139 139
 }
140 140
 
141
+func GetDrugWarehosueInfoById(drug_id int64, org_id int64) (drugInfo []*models.XtDrugWarehouseInfo, err error) {
142
+
143
+	err = XTReadDB().Where("drug_id = ? and org_id = ? and status =1", drug_id, org_id).Find(&drugInfo).Error
144
+
145
+	return drugInfo, err
146
+}
147
+
141 148
 func GetBaseDrugMedicalOne(id int64, tx *gorm.DB) (models.XtBaseDrug, error) {
142 149
 	drug := models.XtBaseDrug{}
143 150
 	err := tx.Model(&drug).Where("id = ? and status = 1", id).Find(&drug).Error