|
@@ -101,6 +101,7 @@ func DrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *model
|
101
|
101
|
if advice.PrescribingNumberUnit == drup.MaxUnit {
|
102
|
102
|
drug_price = drup.RetailPrice
|
103
|
103
|
}
|
|
104
|
+ fmt.Println(drug_price)
|
104
|
105
|
|
105
|
106
|
if advice.PrescribingNumberUnit == drup.MinUnit {
|
106
|
107
|
drug_price = drup.MinPrice
|
|
@@ -145,9 +146,9 @@ func DrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *model
|
145
|
146
|
DrugId: advice.DrugId,
|
146
|
147
|
Number: warehouse.Number,
|
147
|
148
|
BatchNumber: warehouse.BatchNumber,
|
148
|
|
- Price: drug_price,
|
|
149
|
+ Price: warehouse.RetailPrice,
|
149
|
150
|
CountUnit: drup.MinUnit,
|
150
|
|
- RetailPrice: drug_price,
|
|
151
|
+ RetailPrice: warehouse.RetailPrice,
|
151
|
152
|
ProductDate: warehouse.ProductDate,
|
152
|
153
|
ExpiryDate: warehouse.ExpiryDate,
|
153
|
154
|
PatientId: advice.PatientId,
|
|
@@ -163,7 +164,7 @@ func DrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *model
|
163
|
164
|
ProductDate: warehouse.ProductDate,
|
164
|
165
|
ExpireDate: warehouse.ExpiryDate,
|
165
|
166
|
Count: deliver_number, //按最小单位计算,
|
166
|
|
- Price: drug_price,
|
|
167
|
+ Price: warehouse.RetailPrice,
|
167
|
168
|
Status: 1,
|
168
|
169
|
Ctime: time.Now().Unix(),
|
169
|
170
|
UserOrgId: orgID,
|
|
@@ -278,7 +279,7 @@ func DrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *model
|
278
|
279
|
DrugId: advice.DrugId,
|
279
|
280
|
Number: warehouse.Number,
|
280
|
281
|
BatchNumber: warehouse.BatchNumber,
|
281
|
|
- Price: drug_price,
|
|
282
|
+ Price: warehouse.RetailPrice,
|
282
|
283
|
CountUnit: drup.MinUnit,
|
283
|
284
|
ProductDate: warehouse.ProductDate,
|
284
|
285
|
ExpiryDate: warehouse.ExpiryDate,
|
|
@@ -318,7 +319,7 @@ func DrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *model
|
318
|
319
|
ProductDate: warehouse.ProductDate,
|
319
|
320
|
ExpiryDate: warehouse.ExpiryDate,
|
320
|
321
|
WarehousingCount: warehouse.WarehousingCount,
|
321
|
|
- Price: warehouse.Price,
|
|
322
|
+ Price: warehouse.RetailPrice,
|
322
|
323
|
TotalPrice: warehouse.TotalPrice,
|
323
|
324
|
Dealer: warehouse.Dealer,
|
324
|
325
|
Manufacturer: warehouse.Manufacturer,
|
|
@@ -354,7 +355,7 @@ func DrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *model
|
354
|
355
|
ProductDate: warehouse.ProductDate,
|
355
|
356
|
ExpireDate: warehouse.ExpiryDate,
|
356
|
357
|
Count: stock_number,
|
357
|
|
- Price: drug_price,
|
|
358
|
+ Price: warehouse.RetailPrice,
|
358
|
359
|
Status: 1,
|
359
|
360
|
Ctime: time.Now().Unix(),
|
360
|
361
|
UserOrgId: orgID,
|
|
@@ -477,7 +478,7 @@ func HisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *mo
|
477
|
478
|
if advice.PrescribingNumberUnit != drup.MaxUnit && advice.PrescribingNumberUnit != drup.MinUnit {
|
478
|
479
|
min_price = drup.RetailPrice
|
479
|
480
|
}
|
480
|
|
-
|
|
481
|
+ fmt.Println(min_price)
|
481
|
482
|
// 根据先进先出原则,查询最先入库的批次,进行出库
|
482
|
483
|
// 如果没有对应的库存,则报错
|
483
|
484
|
|
|
@@ -511,9 +512,9 @@ func HisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *mo
|
511
|
512
|
DrugId: advice.DrugId,
|
512
|
513
|
Number: warehouse.Number,
|
513
|
514
|
BatchNumber: warehouse.BatchNumber,
|
514
|
|
- Price: min_price,
|
|
515
|
+ Price: warehouse.RetailPrice,
|
515
|
516
|
CountUnit: drup.MinUnit,
|
516
|
|
- RetailPrice: min_price,
|
|
517
|
+ RetailPrice: warehouse.RetailPrice,
|
517
|
518
|
ProductDate: warehouse.ProductDate,
|
518
|
519
|
ExpiryDate: warehouse.ExpiryDate,
|
519
|
520
|
PatientId: advice.PatientId,
|
|
@@ -530,7 +531,7 @@ func HisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *mo
|
530
|
531
|
ProductDate: warehouse.ProductDate,
|
531
|
532
|
ExpireDate: warehouse.ExpiryDate,
|
532
|
533
|
Count: deliver_number,
|
533
|
|
- Price: min_price,
|
|
534
|
+ Price: warehouse.RetailPrice,
|
534
|
535
|
Status: 1,
|
535
|
536
|
Ctime: time.Now().Unix(),
|
536
|
537
|
UserOrgId: orgID,
|
|
@@ -659,8 +660,8 @@ func HisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *mo
|
659
|
660
|
DrugId: advice.DrugId,
|
660
|
661
|
Number: warehouse.Number,
|
661
|
662
|
BatchNumber: warehouse.BatchNumber,
|
662
|
|
- Price: min_price,
|
663
|
|
- RetailPrice: min_price,
|
|
663
|
+ Price: warehouse.RetailPrice,
|
|
664
|
+ RetailPrice: warehouse.RetailPrice,
|
664
|
665
|
ProductDate: warehouse.ProductDate,
|
665
|
666
|
ExpiryDate: warehouse.ExpiryDate,
|
666
|
667
|
PatientId: advice.PatientId,
|
|
@@ -678,7 +679,7 @@ func HisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *mo
|
678
|
679
|
ProductDate: warehouse.ProductDate,
|
679
|
680
|
ExpireDate: warehouse.ExpiryDate,
|
680
|
681
|
Count: stock_number,
|
681
|
|
- Price: min_price,
|
|
682
|
+ Price: warehouse.RetailPrice,
|
682
|
683
|
Status: 1,
|
683
|
684
|
Ctime: time.Now().Unix(),
|
684
|
685
|
UserOrgId: orgID,
|
|
@@ -926,7 +927,7 @@ func AutoDrugDeliverInfo(orgID int64, prescribingNumber int64, warehouseout *mod
|
926
|
927
|
}
|
927
|
928
|
warehouseOutInfo.Count = stock_number
|
928
|
929
|
|
929
|
|
- warehouseOutInfo.CountUnit = advice.CountUnit
|
|
930
|
+ //warehouseOutInfo.CountUnit = advice.CountUnit
|
930
|
931
|
|
931
|
932
|
errOne := AddSigleDrugWarehouseOutInfo(warehouseOutInfo)
|
932
|
933
|
if errOne != nil {
|
|
@@ -1124,7 +1125,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
|
1124
|
1125
|
PatientId: patient_id,
|
1125
|
1126
|
Number: warehouse.Number,
|
1126
|
1127
|
LicenseNumber: warehouse.LicenseNumber,
|
1127
|
|
- Price: info.PackingPrice,
|
|
1128
|
+ Price: warehouse.PackingPrice,
|
1128
|
1129
|
ExpiryDate: warehouse.ExpiryDate,
|
1129
|
1130
|
ProductDate: warehouse.ProductDate,
|
1130
|
1131
|
ProjectId: goods.ProjectId,
|
|
@@ -1172,7 +1173,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
|
1172
|
1173
|
ProductDate: warehouse.ProductDate,
|
1173
|
1174
|
ExpireDate: warehouse.ExpiryDate,
|
1174
|
1175
|
Count: deliver_number,
|
1175
|
|
- Price: info.PackingPrice,
|
|
1176
|
+ Price: warehouse.PackingPrice,
|
1176
|
1177
|
Status: 1,
|
1177
|
1178
|
Ctime: time.Now().Unix(),
|
1178
|
1179
|
UserOrgId: orgID,
|
|
@@ -1207,7 +1208,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
|
1207
|
1208
|
ProductDate: warehouse.ProductDate,
|
1208
|
1209
|
ExpireDate: warehouse.ExpiryDate,
|
1209
|
1210
|
Count: exsit.Count + goods.Count,
|
1210
|
|
- Price: info.PackingPrice,
|
|
1211
|
+ Price: warehouse.PackingPrice,
|
1211
|
1212
|
Status: 1,
|
1212
|
1213
|
Ctime: time.Now().Unix(),
|
1213
|
1214
|
UserOrgId: orgID,
|
|
@@ -1241,7 +1242,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
|
1241
|
1242
|
ProductDate: warehouse.ProductDate,
|
1242
|
1243
|
ExpireDate: warehouse.ExpiryDate,
|
1243
|
1244
|
Count: deliver_number,
|
1244
|
|
- Price: info.PackingPrice,
|
|
1245
|
+ Price: warehouse.PackingPrice,
|
1245
|
1246
|
Status: 1,
|
1246
|
1247
|
Ctime: time.Now().Unix(),
|
1247
|
1248
|
UserOrgId: orgID,
|
|
@@ -1275,7 +1276,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
|
1275
|
1276
|
ProductDate: warehouse.ProductDate,
|
1276
|
1277
|
ExpireDate: warehouse.ExpiryDate,
|
1277
|
1278
|
Count: exsit.Count + goods.Count,
|
1278
|
|
- Price: info.PackingPrice,
|
|
1279
|
+ Price: warehouse.PackingPrice,
|
1279
|
1280
|
Status: 1,
|
1280
|
1281
|
Ctime: time.Now().Unix(),
|
1281
|
1282
|
UserOrgId: orgID,
|
|
@@ -1341,7 +1342,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
|
1341
|
1342
|
PatientId: patient_id,
|
1342
|
1343
|
Number: warehouse.Number,
|
1343
|
1344
|
LicenseNumber: warehouse.LicenseNumber,
|
1344
|
|
- Price: info.PackingPrice,
|
|
1345
|
+ Price: warehouse.PackingPrice,
|
1345
|
1346
|
ExpiryDate: warehouse.ExpiryDate,
|
1346
|
1347
|
ProductDate: warehouse.ProductDate,
|
1347
|
1348
|
ProjectId: goods.ProjectId,
|
|
@@ -1365,7 +1366,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
|
1365
|
1366
|
ProductDate: warehouse.ProductDate,
|
1366
|
1367
|
ExpireDate: warehouse.ExpiryDate,
|
1367
|
1368
|
Count: stock_number,
|
1368
|
|
- Price: info.PackingPrice,
|
|
1369
|
+ Price: warehouse.PackingPrice,
|
1369
|
1370
|
Status: 1,
|
1370
|
1371
|
Ctime: time.Now().Unix(),
|
1371
|
1372
|
UserOrgId: orgID,
|
|
@@ -1397,7 +1398,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
|
1397
|
1398
|
ProductDate: warehouse.ProductDate,
|
1398
|
1399
|
ExpireDate: warehouse.ExpiryDate,
|
1399
|
1400
|
Count: exsit.Count + goods.Count,
|
1400
|
|
- Price: info.PackingPrice,
|
|
1401
|
+ Price: warehouse.PackingPrice,
|
1401
|
1402
|
Status: 1,
|
1402
|
1403
|
Ctime: time.Now().Unix(),
|
1403
|
1404
|
UserOrgId: orgID,
|
|
@@ -1434,7 +1435,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
|
1434
|
1435
|
ProductDate: warehouse.ProductDate,
|
1435
|
1436
|
ExpireDate: warehouse.ExpiryDate,
|
1436
|
1437
|
Count: stock_number,
|
1437
|
|
- Price: info.PackingPrice,
|
|
1438
|
+ Price: warehouse.PackingPrice,
|
1438
|
1439
|
Status: 1,
|
1439
|
1440
|
Ctime: time.Now().Unix(),
|
1440
|
1441
|
UserOrgId: orgID,
|
|
@@ -1466,7 +1467,7 @@ func ConsumablesDelivery(orgID int64, patient_id int64, record_time int64, goods
|
1466
|
1467
|
ProductDate: warehouse.ProductDate,
|
1467
|
1468
|
ExpireDate: warehouse.ExpiryDate,
|
1468
|
1469
|
Count: exsit.Count + goods.Count,
|
1469
|
|
- Price: info.PackingPrice,
|
|
1470
|
+ Price: warehouse.PackingPrice,
|
1470
|
1471
|
Status: 1,
|
1471
|
1472
|
Ctime: time.Now().Unix(),
|
1472
|
1473
|
UserOrgId: orgID,
|
|
@@ -1694,7 +1695,7 @@ func ConsumablesDeliveryOne(orgID int64, record_time int64, goods *models.Wareho
|
1694
|
1695
|
Status: 1,
|
1695
|
1696
|
Ctime: time.Now().Unix(),
|
1696
|
1697
|
Mtime: 0,
|
1697
|
|
- Price: goods.Price,
|
|
1698
|
+ Price: warehouse.PackingPrice,
|
1698
|
1699
|
WarehousingDetailId: 0,
|
1699
|
1700
|
WarehouseOutDetailId: warehouseOutInfo.ID,
|
1700
|
1701
|
CancelOutDetailId: 0,
|
|
@@ -1742,7 +1743,7 @@ func ConsumablesDeliveryOne(orgID int64, record_time int64, goods *models.Wareho
|
1742
|
1743
|
ExpiryDate: goods.ExpiryDate,
|
1743
|
1744
|
ProductDate: goods.ProductDate,
|
1744
|
1745
|
Number: warehouse.Number,
|
1745
|
|
- Price: goods.Price,
|
|
1746
|
+ Price: warehouse.PackingPrice,
|
1746
|
1747
|
LicenseNumber: goods.LicenseNumber,
|
1747
|
1748
|
}
|
1748
|
1749
|
warehouseOutInfo.Count = stock_number
|
|
@@ -1785,7 +1786,7 @@ func ConsumablesDeliveryOne(orgID int64, record_time int64, goods *models.Wareho
|
1785
|
1786
|
Status: 1,
|
1786
|
1787
|
Ctime: time.Now().Unix(),
|
1787
|
1788
|
Mtime: 0,
|
1788
|
|
- Price: goods.Price,
|
|
1789
|
+ Price: warehouse.PackingPrice,
|
1789
|
1790
|
WarehousingDetailId: 0,
|
1790
|
1791
|
WarehouseOutDetailId: warehouseOutInfo.ID,
|
1791
|
1792
|
CancelOutDetailId: 0,
|
|
@@ -1850,7 +1851,7 @@ func ConsumablesDeliveryTwo(orgID int64, goods *models.WarehouseOutInfo, count i
|
1850
|
1851
|
ExpiryDate: goods.ExpiryDate,
|
1851
|
1852
|
ProductDate: goods.ProductDate,
|
1852
|
1853
|
Number: goods.Number,
|
1853
|
|
- Price: goods.Price,
|
|
1854
|
+ Price: warehouse.PackingPrice,
|
1854
|
1855
|
LicenseNumber: goods.LicenseNumber,
|
1855
|
1856
|
ConsumableType: 2,
|
1856
|
1857
|
}
|
|
@@ -1900,7 +1901,7 @@ func ConsumablesDeliveryTwo(orgID int64, goods *models.WarehouseOutInfo, count i
|
1900
|
1901
|
ExpiryDate: goods.ExpiryDate,
|
1901
|
1902
|
ProductDate: goods.ProductDate,
|
1902
|
1903
|
Number: goods.Number,
|
1903
|
|
- Price: goods.Price,
|
|
1904
|
+ Price: warehouse.PackingPrice,
|
1904
|
1905
|
LicenseNumber: goods.LicenseNumber,
|
1905
|
1906
|
ConsumableType: 2,
|
1906
|
1907
|
}
|
|
@@ -1990,7 +1991,7 @@ func NewDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *mo
|
1990
|
1991
|
DrugId: advice.DrugId,
|
1991
|
1992
|
Number: warehouse.Number,
|
1992
|
1993
|
BatchNumber: warehouse.BatchNumber,
|
1993
|
|
- Price: drug_price,
|
|
1994
|
+ Price: warehouse.RetailPrice,
|
1994
|
1995
|
CountUnit: drup.MinUnit,
|
1995
|
1996
|
RetailPrice: drug_price,
|
1996
|
1997
|
ProductDate: warehouse.ProductDate,
|
|
@@ -2009,7 +2010,7 @@ func NewDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *mo
|
2009
|
2010
|
ProductDate: warehouse.ProductDate,
|
2010
|
2011
|
ExpireDate: warehouse.ExpiryDate,
|
2011
|
2012
|
Count: deliver_number, //按最小单位计算,
|
2012
|
|
- Price: drug_price,
|
|
2013
|
+ Price: warehouse.RetailPrice,
|
2013
|
2014
|
Status: 1,
|
2014
|
2015
|
Ctime: time.Now().Unix(),
|
2015
|
2016
|
UserOrgId: orgID,
|
|
@@ -2116,7 +2117,7 @@ func NewDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *mo
|
2116
|
2117
|
DrugId: advice.DrugId,
|
2117
|
2118
|
Number: warehouse.Number,
|
2118
|
2119
|
BatchNumber: warehouse.BatchNumber,
|
2119
|
|
- Price: drug_price,
|
|
2120
|
+ Price: warehouse.RetailPrice,
|
2120
|
2121
|
CountUnit: drup.MinUnit,
|
2121
|
2122
|
ProductDate: warehouse.ProductDate,
|
2122
|
2123
|
ExpiryDate: warehouse.ExpiryDate,
|
|
@@ -2207,7 +2208,7 @@ func NewDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout *mo
|
2207
|
2208
|
ProductDate: warehouse.ProductDate,
|
2208
|
2209
|
ExpireDate: warehouse.ExpiryDate,
|
2209
|
2210
|
Count: deliver_number,
|
2210
|
|
- Price: drug_price,
|
|
2211
|
+ Price: warehouse.RetailPrice,
|
2211
|
2212
|
Status: 1,
|
2212
|
2213
|
Ctime: time.Now().Unix(),
|
2213
|
2214
|
UserOrgId: orgID,
|
|
@@ -2264,7 +2265,7 @@ func NewHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout
|
2264
|
2265
|
if advice.PrescribingNumberUnit != drup.MaxUnit && advice.PrescribingNumberUnit != drup.MinUnit {
|
2265
|
2266
|
min_price = drup.RetailPrice
|
2266
|
2267
|
}
|
2267
|
|
-
|
|
2268
|
+ fmt.Println(min_price)
|
2268
|
2269
|
// 根据先进先出原则,查询最先入库的批次,进行出库
|
2269
|
2270
|
// 如果没有对应的库存,则报错
|
2270
|
2271
|
//开启事物
|
|
@@ -2298,9 +2299,9 @@ func NewHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout
|
2298
|
2299
|
DrugId: advice.DrugId,
|
2299
|
2300
|
Number: warehouse.Number,
|
2300
|
2301
|
BatchNumber: warehouse.BatchNumber,
|
2301
|
|
- Price: min_price,
|
|
2302
|
+ Price: warehouse.RetailPrice,
|
2302
|
2303
|
CountUnit: drup.MinUnit,
|
2303
|
|
- RetailPrice: min_price,
|
|
2304
|
+ RetailPrice: warehouse.RetailPrice,
|
2304
|
2305
|
ProductDate: warehouse.ProductDate,
|
2305
|
2306
|
ExpiryDate: warehouse.ExpiryDate,
|
2306
|
2307
|
PatientId: advice.PatientId,
|
|
@@ -2317,7 +2318,7 @@ func NewHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout
|
2317
|
2318
|
ProductDate: warehouse.ProductDate,
|
2318
|
2319
|
ExpireDate: warehouse.ExpiryDate,
|
2319
|
2320
|
Count: deliver_number,
|
2320
|
|
- Price: min_price,
|
|
2321
|
+ Price: warehouse.RetailPrice,
|
2321
|
2322
|
Status: 1,
|
2322
|
2323
|
Ctime: time.Now().Unix(),
|
2323
|
2324
|
UserOrgId: orgID,
|
|
@@ -2418,8 +2419,8 @@ func NewHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout
|
2418
|
2419
|
DrugId: advice.DrugId,
|
2419
|
2420
|
Number: warehouse.Number,
|
2420
|
2421
|
BatchNumber: warehouse.BatchNumber,
|
2421
|
|
- Price: min_price,
|
2422
|
|
- RetailPrice: min_price,
|
|
2422
|
+ Price: warehouse.RetailPrice,
|
|
2423
|
+ RetailPrice: warehouse.RetailPrice,
|
2423
|
2424
|
ProductDate: warehouse.ProductDate,
|
2424
|
2425
|
ExpiryDate: warehouse.ExpiryDate,
|
2425
|
2426
|
PatientId: advice.PatientId,
|
|
@@ -2437,7 +2438,7 @@ func NewHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout
|
2437
|
2438
|
ProductDate: warehouse.ProductDate,
|
2438
|
2439
|
ExpireDate: warehouse.ExpiryDate,
|
2439
|
2440
|
Count: stock_number,
|
2440
|
|
- Price: min_price,
|
|
2441
|
+ Price: warehouse.RetailPrice,
|
2441
|
2442
|
Status: 1,
|
2442
|
2443
|
Ctime: time.Now().Unix(),
|
2443
|
2444
|
UserOrgId: orgID,
|
|
@@ -2489,7 +2490,7 @@ func NewHisDrugDeliverInfo(orgID int64, prescribingNumber float64, warehouseout
|
2489
|
2490
|
ProductDate: warehouse.ProductDate,
|
2490
|
2491
|
ExpiryDate: warehouse.ExpiryDate,
|
2491
|
2492
|
WarehousingCount: warehouse.WarehousingCount,
|
2492
|
|
- Price: warehouse.Price,
|
|
2493
|
+ Price: warehouse.RetailPrice,
|
2493
|
2494
|
TotalPrice: warehouse.TotalPrice,
|
2494
|
2495
|
Dealer: warehouse.Dealer,
|
2495
|
2496
|
Manufacturer: warehouse.Manufacturer,
|