28169 пре 7 месеци
родитељ
комит
1a3d851610

+ 4 - 4
controllers/base_api_controller.go Прегледај датотеку

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

+ 1 - 1
controllers/dialysis_api_controller.go Прегледај датотеку

2573
 			service.CreateDialysisFinish(finish)
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
 			var dewater_amount float64
2577
 			var dewater_amount float64
2578
 			dewater_amount = 0
2578
 			dewater_amount = 0
2579
 			if dry_weight > 0 {
2579
 			if dry_weight > 0 {

+ 3 - 1
controllers/drug_stock_api_contorller.go Прегледај датотеку

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

+ 13 - 0
controllers/his_api_controller.go Прегледај датотеку

106
 	beego.Router("/api/checkhispatient", &HisApiController{}, "get:CheckHisPatient")
106
 	beego.Router("/api/checkhispatient", &HisApiController{}, "get:CheckHisPatient")
107
 	beego.Router("/api/hisorder/listtwo", &HisApiController{}, "get:GetHisOrderListTwo")
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
 func (c *HisApiController) CheckHisPatient() {
113
 func (c *HisApiController) CheckHisPatient() {
14174
 
14176
 
14175
 	return
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 Прегледај датотеку

165
 	is_show, _ := c.GetInt64("is_show")
165
 	is_show, _ := c.GetInt64("is_show")
166
 	adminInfo := c.GetAdminUserInfo()
166
 	adminInfo := c.GetAdminUserInfo()
167
 	is_self_drug, _ := c.GetInt64("is_self_drug")
167
 	is_self_drug, _ := c.GetInt64("is_self_drug")
168
-
168
+	specification_name := c.GetString("specification_name")
169
 	hans := drug_name // 要转换的汉字字符串
169
 	hans := drug_name // 要转换的汉字字符串
170
 
170
 
171
 	// 创建一个拼音转换器
171
 	// 创建一个拼音转换器
256
 		IsProject:                   is_project,
256
 		IsProject:                   is_project,
257
 		IsShow:                      is_show,
257
 		IsShow:                      is_show,
258
 		IsSelfDrug:                  is_self_drug,
258
 		IsSelfDrug:                  is_self_drug,
259
+		SpecificationName:           specification_name,
259
 	}
260
 	}
260
 	drugLib.FirstLetter = firstLetter
261
 	drugLib.FirstLetter = firstLetter
261
 	drugLib.Pinyin = firstLetter
262
 	drugLib.Pinyin = firstLetter
272
 
273
 
273
 			drugLib.DrugSpec = drugLib.Dose + drugLib.DoseUnit + "*" + string(drugLib.MinNumber) + drugLib.MinUnit + "/" + drugLib.MaxUnit
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
 		err := service.CreateBaseDrugLib(drugLib)
286
 		err := service.CreateBaseDrugLib(drugLib)
276
 		if err == nil {
287
 		if err == nil {
277
 			c.ServeSuccessJSON(map[string]interface{}{
288
 			c.ServeSuccessJSON(map[string]interface{}{
369
 	is_project, _ := c.GetInt64("is_project")
380
 	is_project, _ := c.GetInt64("is_project")
370
 	is_show, _ := c.GetInt64("is_show")
381
 	is_show, _ := c.GetInt64("is_show")
371
 	is_self_drug, _ := c.GetInt64("is_self_drug")
382
 	is_self_drug, _ := c.GetInt64("is_self_drug")
383
+	specification_name := c.GetString("specification_name")
372
 	adminInfo := c.GetAdminUserInfo()
384
 	adminInfo := c.GetAdminUserInfo()
373
 	drug, _ := service.FindBaseDrugLibRecord(adminInfo.CurrentOrgId, id)
385
 	drug, _ := service.FindBaseDrugLibRecord(adminInfo.CurrentOrgId, id)
374
 
386
 
465
 		FirstLetter:                 firstLetter,
477
 		FirstLetter:                 firstLetter,
466
 		IsShow:                      is_show,
478
 		IsShow:                      is_show,
467
 		IsSelfDrug:                  is_self_drug,
479
 		IsSelfDrug:                  is_self_drug,
480
+		SpecificationName:           specification_name,
468
 	}
481
 	}
469
 	if adminInfo.CurrentOrgId == 10206 || adminInfo.CurrentOrgId == 10344 {
482
 	if adminInfo.CurrentOrgId == 10206 || adminInfo.CurrentOrgId == 10344 {
470
 
483
 
471
 		drugLib.DrugSpec = drugLib.Dose + drugLib.DoseUnit + "*" + string(drugLib.MinNumber) + drugLib.MinUnit + "/" + drugLib.MaxUnit
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
 	err := service.UpdateBaseDrugLib(drugLib)
510
 	err := service.UpdateBaseDrugLib(drugLib)
475
 
511
 
476
 	//查下医嘱模板
512
 	//查下医嘱模板
575
 
611
 
576
 	_, errSix := service.GetDoctorAdviceIsExist(id, adminInfo.CurrentOrgId)
612
 	_, errSix := service.GetDoctorAdviceIsExist(id, adminInfo.CurrentOrgId)
577
 	if errSix == gorm.ErrRecordNotFound {
613
 	if errSix == gorm.ErrRecordNotFound {
578
-		fmt.Println("进来了吗5")
579
 		c.ServeSuccessJSON(map[string]interface{}{
614
 		c.ServeSuccessJSON(map[string]interface{}{
580
 			"msg": "修改成功",
615
 			"msg": "修改成功",
581
 		})
616
 		})
597
 	_, errSeven := service.GetDoctorAdviceTemplateIsExist(id, adminInfo.CurrentOrgId)
632
 	_, errSeven := service.GetDoctorAdviceTemplateIsExist(id, adminInfo.CurrentOrgId)
598
 
633
 
599
 	if errSeven == gorm.ErrRecordNotFound {
634
 	if errSeven == gorm.ErrRecordNotFound {
600
-		fmt.Println("进来了吗6")
601
 		c.ServeSuccessJSON(map[string]interface{}{
635
 		c.ServeSuccessJSON(map[string]interface{}{
602
 			"msg": "修改成功",
636
 			"msg": "修改成功",
603
 		})
637
 		})

+ 31 - 10
controllers/mobile_api_controllers/patient_api_controller.go Прегледај датотеку

1418
 											//查询今日是否出库
1418
 											//查询今日是否出库
1419
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1419
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1420
 											if drugOutInfo.ID == 0 {
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
 										if pharmacyConfig.IsOpen != 1 {
1428
 										if pharmacyConfig.IsOpen != 1 {
1426
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1429
 											drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1427
 											if drugOutInfo.ID == 0 {
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
 									if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
1455
 									if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
1450
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1456
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1451
 										if drugOutInfo.ID == 0 {
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
 									if pharmacyConfig.IsOpen != 1 {
1464
 									if pharmacyConfig.IsOpen != 1 {
1470
 										service.CreateDrugError(drugError)
1479
 										service.CreateDrugError(drugError)
1471
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1480
 										drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1472
 										if drugOutInfo.ID == 0 {
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
 									//查询今日是否出库
1591
 									//查询今日是否出库
1581
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1592
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1582
 									if drugOutInfo.ID == 0 {
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
 								if pharmacyConfig.IsOpen != 1 {
1600
 								if pharmacyConfig.IsOpen != 1 {
1587
 									//查询今日是否出库
1601
 									//查询今日是否出库
1588
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1602
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
1589
 									if drugOutInfo.ID == 0 {
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
 
2220
 
2204
 										newadviceInfo.PrescribingNumber = float64(cha_count)
2221
 										newadviceInfo.PrescribingNumber = float64(cha_count)
2205
 										newadviceInfo.PrescribingNumberUnit = medical.MinUnit
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
 
2237
 
2220
 									if prescribing_number_total == out_count {
2238
 									if prescribing_number_total == out_count {
2221
 										if out_count == 0 {
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
 	if evaluation.DryWeight > 0 {
3486
 	if evaluation.DryWeight > 0 {
3466
 		dewater_amount = evaluation.WeightBefore - evaluation.DryWeight - evaluation.AdditionalWeight
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
 			if adminUserInfo.Org.Id != 10551 && adminUserInfo.Org.Id != 10579 && adminUserInfo.Org.Id != 10580 && adminUserInfo.Org.Id != 10585 {
3491
 			if adminUserInfo.Org.Id != 10551 && adminUserInfo.Org.Id != 10579 && adminUserInfo.Org.Id != 10580 && adminUserInfo.Org.Id != 10585 {
3471
 				dewater_amount = dewater_amount * 1000
3492
 				dewater_amount = dewater_amount * 1000

+ 24 - 6
controllers/patient_api_controller.go Прегледај датотеку

2252
 					if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
2252
 					if pharmacyConfig.IsOpen == 1 && medical.IsPharmacy == 0 {
2253
 						drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2253
 						drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2254
 						if drugOutInfo.ID == 0 {
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
 					if pharmacyConfig.IsOpen != 1 {
2262
 					if pharmacyConfig.IsOpen != 1 {
2260
 						drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2263
 						drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2261
 						if drugOutInfo.ID == 0 {
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
 
2611
 
2606
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2612
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2607
 									if drugOutInfo.ID == 0 {
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
 
2623
 
2615
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2624
 									drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2616
 									if drugOutInfo.ID == 0 {
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
 
2679
 
2668
 								drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2680
 								drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2669
 								if drugOutInfo.ID == 0 {
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
 
2690
 
2676
 								drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2691
 								drugOutInfo, _ := service.GetAdviceIsOut(item.ID, item.UserOrgId, item.PatientId, item.AdviceDate, item.DrugId)
2677
 								if drugOutInfo.ID == 0 {
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 Прегледај датотеку

338
 	types, _ := this.GetInt("type", 0)
338
 	types, _ := this.GetInt("type", 0)
339
 	start_time := this.GetString("start_time")
339
 	start_time := this.GetString("start_time")
340
 	end_time := this.GetString("end_time")
340
 	end_time := this.GetString("end_time")
341
+	storehouse_id, _ := this.GetInt64("storehouse_id")
341
 	adminUserInfo := this.GetAdminUserInfo()
342
 	adminUserInfo := this.GetAdminUserInfo()
342
 
343
 
343
 	timeLayout := "2006-01-02"
344
 	timeLayout := "2006-01-02"
366
 
367
 
367
 	//入库详情
368
 	//入库详情
368
 	if types == 1 {
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
 		if err != nil {
371
 		if err != nil {
371
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
372
 			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
372
 			return
373
 			return

+ 15 - 7
controllers/stock_in_api_controller.go Прегледај датотеку

8162
 
8162
 
8163
 func (this *StockManagerApiController) UpdateBaseDrugListByUserOrgID() {
8163
 func (this *StockManagerApiController) UpdateBaseDrugListByUserOrgID() {
8164
 
8164
 
8165
-	orgId := this.GetAdminUserInfo().CurrentOrgId
8165
+	//orgId := this.GetAdminUserInfo().CurrentOrgId
8166
 
8166
 
8167
 	//list, _ := service.GetAllBaseDrugList(orgId)
8167
 	//list, _ := service.GetAllBaseDrugList(orgId)
8168
 	//
8168
 	//
8227
 
8227
 
8228
 	//info, _ := service.GetDrugAllInfo(orgId)
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 Прегледај датотеку

90
 	DrugDosageFormName string `gorm:"column:drug_dosage_form_name" json:"drug_dosage_form_name" form:"drug_dosage_form_name"`
90
 	DrugDosageFormName string `gorm:"column:drug_dosage_form_name" json:"drug_dosage_form_name" form:"drug_dosage_form_name"`
91
 	IsShow             int64  `gorm:"column:is_show" json:"is_show" form:"is_show"`
91
 	IsShow             int64  `gorm:"column:is_show" json:"is_show" form:"is_show"`
92
 	IsSelfDrug         int64  `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
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
 func (BaseDrugLib) TableName() string {
96
 func (BaseDrugLib) TableName() string {

+ 1 - 0
models/self_drug_models.go Прегледај датотеку

82
 	IsShow                 int64   `gorm:"column:is_show" json:"is_show" form:"is_show"`
82
 	IsShow                 int64   `gorm:"column:is_show" json:"is_show" form:"is_show"`
83
 	IsSelfDrug             int64   `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
83
 	IsSelfDrug             int64   `gorm:"column:is_self_drug" json:"is_self_drug" form:"is_self_drug"`
84
 	SumCount               int64   `gorm:"column:sum_count" json:"sum_count" form:"sum_count"`
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
 func (XtBaseDrug) TableName() string {
88
 func (XtBaseDrug) TableName() string {

+ 4 - 1
service/drug_stock_service.go Прегледај датотеку

194
 	return info, err
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
 	db := XTReadDB().Table("xt_drug_warehouse_info as x").Where("x.status = 1")
199
 	db := XTReadDB().Table("xt_drug_warehouse_info as x").Where("x.status = 1")
200
 	if startime > 0 {
200
 	if startime > 0 {
206
 	if orgid > 0 {
206
 	if orgid > 0 {
207
 		db = db.Where("x.org_id = ?", orgid)
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
 	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
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
 	//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
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 Прегледај датотеку

1088
 	return drug, err
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
 func GetScheduleConfigByOrgId(org_id int64) (config models.ScheduleConfig, err error) {
1098
 func GetScheduleConfigByOrgId(org_id int64) (config models.ScheduleConfig, err error) {
1092
 	err = XTReadDB().Model(&models.ScheduleConfig{}).Where("user_org_id = ?", org_id).First(&config).Error
1099
 	err = XTReadDB().Model(&models.ScheduleConfig{}).Where("user_org_id = ?", org_id).First(&config).Error
1093
 	return config, err
1100
 	return config, err

+ 5 - 1
service/print_data_service/schedule_dialysis/print_schedule_dialysis_service.go Прегледај датотеку

266
 	return goodInfo, err
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
 	//offset := (page - 1) * limit
270
 	//offset := (page - 1) * limit
271
 	db := p_service.XTReadDB().Table("xt_warehouse_info as x").Where("x.status = 1")
271
 	db := p_service.XTReadDB().Table("xt_warehouse_info as x").Where("x.status = 1")
272
 	table := p_service.XTReadDB().Table("xt_good_information as t").Where("t.status = 1")
272
 	table := p_service.XTReadDB().Table("xt_good_information as t").Where("t.status = 1")
282
 		db = db.Where("x.ctime<=?", endtime)
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
 	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
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
 	return info, err
290
 	return info, err
287
 }
291
 }

+ 7 - 0
service/self_drug_service.go Прегледај датотеку

138
 	return drug, err
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
 func GetBaseDrugMedicalOne(id int64, tx *gorm.DB) (models.XtBaseDrug, error) {
148
 func GetBaseDrugMedicalOne(id int64, tx *gorm.DB) (models.XtBaseDrug, error) {
142
 	drug := models.XtBaseDrug{}
149
 	drug := models.XtBaseDrug{}
143
 	err := tx.Model(&drug).Where("id = ? and status = 1", id).Find(&drug).Error
150
 	err := tx.Model(&drug).Where("id = ? and status = 1", id).Find(&drug).Error