28169 пре 1 месец
родитељ
комит
6470a77708

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

@@ -466,7 +466,6 @@ func (this *PharmacyController) DispensingMedicine() {
466 466
 	if orgid == 10480 || orgid == 10188 || orgid == 10217 || orgid == 10164 || orgid == 10666 {
467 467
 		//发药逻辑
468 468
 
469
-		fmt.Println("hhhhhhhhhhhhhhhhhhhhhhhhhhh尽力")
470 469
 		service.DispensingMedicineOne(orgid, patient_id, stime, etime, creater)
471 470
 
472 471
 		//针对桑植盛康

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

@@ -6434,11 +6434,21 @@ func (c *SelfDrugApiController) GetDrugInventoryModePrintList() {
6434 6434
 	outList, _ := service.GetDrugWarhouseHouseOutInfo(orgId, startTime, endTime)
6435 6435
 
6436 6436
 	drugList, _ := service.GetAllDrugList(orgId)
6437
+
6438
+	warehouseInfoFlow, _ := service.GetDrugMonthWarehouseInfo(orgId, startTime)
6439
+
6440
+	warehouseOutFlow, _ := service.GetDrugMonthWarehouseOutInfo(orgId, startTime)
6441
+
6442
+	cancelFlow, _ := service.GetDrugMonthCancelOutInfo(orgId, startTime)
6443
+
6437 6444
 	c.ServeSuccessJSON(map[string]interface{}{
6438
-		"list":             list,
6439
-		"manufacturerList": manufacturerList,
6440
-		"outList":          outList,
6441
-		"infoList":         infoList,
6442
-		"drugList":         drugList,
6445
+		"list":              list,
6446
+		"manufacturerList":  manufacturerList,
6447
+		"outList":           outList,
6448
+		"infoList":          infoList,
6449
+		"drugList":          drugList,
6450
+		"warehouseInfoFlow": warehouseInfoFlow,
6451
+		"warehouseOutFlow":  warehouseOutFlow,
6452
+		"cancelFlow":        cancelFlow,
6443 6453
 	})
6444 6454
 }

+ 10 - 8
service/pharmacy_service.go Прегледај датотеку

@@ -879,13 +879,15 @@ func DispensingMedicineOne(orgid, patient_id, stime, etime, creater int64) (err
879 879
 	if len(adviceList) > 0 {
880 880
 		for _, item := range adviceList {
881 881
 
882
-			pharmacyConfig := IsPharmacyConfig(orgid)
883
-			if pharmacyConfig == true {
884
-				//扣减库存
885
-				err = HisFaDrugsDelivery(orgid, creater, item)
886
-				if err != nil {
887
-					err = fmt.Errorf("!:%v", err)
888
-					return
882
+			if orgid != 10480 {
883
+				pharmacyConfig := IsPharmacyConfig(orgid)
884
+				if pharmacyConfig == true {
885
+					//扣减库存
886
+					err = HisFaDrugsDelivery(orgid, creater, item)
887
+					if err != nil {
888
+						err = fmt.Errorf("!:%v", err)
889
+						return
890
+					}
889 891
 				}
890 892
 			}
891 893
 
@@ -1050,7 +1052,7 @@ func DrugWithdrawal(orgid, patient_id, stime, etime, creater int64) (err error)
1050 1052
 	}
1051 1053
 
1052 1054
 	//针对阜阳经沃
1053
-	if orgid != 104801 {
1055
+	if orgid != 10480 {
1054 1056
 		for _, v := range advice_info {
1055 1057
 
1056 1058
 			//扣减库存

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

@@ -5292,3 +5292,54 @@ func GetDrugWarhouseHouseOutInfo(org_id int64, start_time int64, end_time int64)
5292 5292
 	return flow, err
5293 5293
 
5294 5294
 }
5295
+
5296
+func GetDrugMonthWarehouseInfo(org_id int64, start_time int64) (flow []*models.XtDrugFlowList, err error) {
5297
+
5298
+	db := XTReadDB().Model(&flow).Where("status=1 and (consumable_type=1 or consumable_type=10)")
5299
+
5300
+	if org_id > 0 {
5301
+		db = db.Where("user_org_id = ?", org_id)
5302
+	}
5303
+
5304
+	if start_time > 0 {
5305
+		db = db.Where("ctime < ?", start_time)
5306
+	}
5307
+
5308
+	err = db.Find(&flow).Error
5309
+
5310
+	return flow, err
5311
+}
5312
+
5313
+func GetDrugMonthWarehouseOutInfo(org_id int64, start_time int64) (flow []*models.XtDrugFlowList, err error) {
5314
+
5315
+	db := XTReadDB().Model(&flow).Where("status=1 and (consumable_type=2 or consumable_type=3 or consumable_type=11)")
5316
+
5317
+	if org_id > 0 {
5318
+		db = db.Where("user_org_id = ?", org_id)
5319
+	}
5320
+
5321
+	if start_time > 0 {
5322
+		db = db.Where("ctime < ?", start_time)
5323
+	}
5324
+
5325
+	err = db.Find(&flow).Error
5326
+
5327
+	return flow, err
5328
+}
5329
+
5330
+func GetDrugMonthCancelOutInfo(org_id int64, start_time int64) (flow []*models.XtDrugFlowList, err error) {
5331
+
5332
+	db := XTReadDB().Model(&flow).Where("status=1 and (consumable_type=7)")
5333
+
5334
+	if org_id > 0 {
5335
+		db = db.Where("user_org_id = ?", org_id)
5336
+	}
5337
+
5338
+	if start_time > 0 {
5339
+		db = db.Where("ctime < ?", start_time)
5340
+	}
5341
+
5342
+	err = db.Find(&flow).Error
5343
+
5344
+	return flow, err
5345
+}