|
@@ -3911,6 +3911,7 @@ func (c *DialysisAPIController) EditConsumables() {
|
3911
|
3911
|
err = ConsumablesDeliveryTotalSeven(adminInfo.Org.Id, patient_id, record_time, beforePrepares, adminInfo.AdminUser.Id, item.Count)
|
3912
|
3912
|
break
|
3913
|
3913
|
}
|
|
3914
|
+
|
3914
|
3915
|
var last_total int64
|
3915
|
3916
|
|
3916
|
3917
|
//如果当前出库数量大于 最后一次出库数量,那么则需要去查询当前批次耗材的库存是否足够
|
|
@@ -4580,7 +4581,6 @@ func (c *DialysisAPIController) UpdateStockGoods() {
|
4580
|
4581
|
//当前数据比上一次出库数据少
|
4581
|
4582
|
func ConsumablesDeliveryTotalSeven(orgID int64, patient_id int64, record_time int64, goods []*models.DialysisBeforePrepareGoods, creater int64, count int64) (err error) {
|
4582
|
4583
|
|
4583
|
|
- fmt.Println("w我的中国馆公共区发电房阿道夫安抚安抚安抚安抚安抚安抚阿道夫阿道夫阿凡达阿道夫a", count)
|
4584
|
4584
|
//查询该患者当天已经出库的耗材信息
|
4585
|
4585
|
goods_yc, _ := service.FindConsumablesByDateThree(orgID, patient_id, record_time)
|
4586
|
4586
|
// 和新请求的出库数据进行对比,分出那些是继续出库的,那些是需要删除出库的
|
|
@@ -4619,7 +4619,6 @@ func ConsumablesDeliveryTotalSeven(orgID int64, patient_id int64, record_time in
|
4619
|
4619
|
|
4620
|
4620
|
// goods_yc 这个数据就是需要已经出库了,但是现在需要删除出库的耗材数据
|
4621
|
4621
|
// goods 这个数据就是需要出库的耗材的数据(新增的数据)
|
4622
|
|
- fmt.Println("goodsy999999999999", goods_yc)
|
4623
|
4622
|
|
4624
|
4623
|
//退库
|
4625
|
4624
|
if len(goods_yc) > 0 {
|
|
@@ -4635,10 +4634,8 @@ func ConsumablesDeliveryTotalSeven(orgID int64, patient_id int64, record_time in
|
4635
|
4634
|
//耗材出库删除
|
4636
|
4635
|
func ConsumablesDeliveryDeleteFour(orgID int64, record_time int64, good_yc *models.BloodAutomaticReduceDetail, warehouseOut *models.WarehouseOut, patient_id int64, creater int64, count int64) (err error) {
|
4637
|
4636
|
|
4638
|
|
- fmt.Println("count2323223884584854854854u5454785487547845785478758487545475475487,count", count)
|
4639
|
4637
|
// 先根据相关信息查询当天该耗材的出库信息
|
4640
|
4638
|
warehouseOutInfos, err := service.FindStockOutInfoByStockTwo(orgID, good_yc.GoodTypeId, good_yc.GoodId, record_time, good_yc.PatientId)
|
4641
|
|
- fmt.Println("errr232323232323232323232323232", err)
|
4642
|
4639
|
|
4643
|
4640
|
if err != nil {
|
4644
|
4641
|
return err
|
|
@@ -4740,7 +4737,7 @@ func ConsumablesDeliveryDeleteFour(orgID int64, record_time int64, good_yc *mode
|
4740
|
4737
|
PatientId: patient_id,
|
4741
|
4738
|
}
|
4742
|
4739
|
|
4743
|
|
- service.UpdatedStockFlow(stockFlow)
|
|
4740
|
+ service.UpdatedStockFlowOne(stockFlow, warehouseOut.ID, patient_id, record_time, good_yc.GoodId)
|
4744
|
4741
|
}
|
4745
|
4742
|
|
4746
|
4743
|
if errOne != nil {
|
|
@@ -4807,7 +4804,8 @@ func ConsumablesDeliveryDeleteFour(orgID int64, record_time int64, good_yc *mode
|
4807
|
4804
|
PatientId: patient_id,
|
4808
|
4805
|
ReturnCount: delete_count,
|
4809
|
4806
|
}
|
4810
|
|
- service.UpdatedStockFlow(stockFlow)
|
|
4807
|
+ //service.UpdatedStockFlow(stockFlow)
|
|
4808
|
+ service.UpdatedStockFlowOne(stockFlow, warehouseOut.ID, patient_id, record_time, good_yc.GoodId)
|
4811
|
4809
|
}
|
4812
|
4810
|
|
4813
|
4811
|
}
|
|
@@ -4841,7 +4839,8 @@ func ConsumablesDeliveryDeleteFour(orgID int64, record_time int64, good_yc *mode
|
4841
|
4839
|
// 删除出库完成后,要增加对应批次的库存数量
|
4842
|
4840
|
fmt.Println("deletecount2323232323232323232323232323", delete_count)
|
4843
|
4841
|
errThree := service.UpDateWarehouseInfoByStockDelete(warehouseOutInfos.WarehouseInfotId, delete_count)
|
4844
|
|
-
|
|
4842
|
+ errOne := service.UpDateWarehouStockFlowByStockDelete(warehouseOutInfos.WarehouseInfotId, record_time, good_yc.GoodId, delete_count, good_yc.PatientId)
|
|
4843
|
+ fmt.Println("erron2332323232323232232323", errOne)
|
4845
|
4844
|
if errThree != nil {
|
4846
|
4845
|
return errThree
|
4847
|
4846
|
}
|
|
@@ -4994,14 +4993,17 @@ func ConsumablesDeliveryDeleteThree(orgID int64, record_time int64, good_yc *mod
|
4994
|
4993
|
stockInInfo, _ := service.FindLastStockInInfoRecord(good_yc.GoodId, orgID)
|
4995
|
4994
|
warehouseOutInfo.Price = stockInInfo.Price
|
4996
|
4995
|
errOne := service.AddSigleWarehouseOutInfo(warehouseOutInfo)
|
|
4996
|
+
|
4997
|
4997
|
if errOne != nil {
|
4998
|
4998
|
return errOne
|
4999
|
4999
|
}
|
5000
|
5000
|
|
5001
|
|
- //更改自动出库的表格
|
5002
|
|
-
|
5003
|
5001
|
// 删除出库完成后,要增加对应批次的库存数量
|
5004
|
|
- fmt.Println("deletecount2323232323232323232323232323", delete_count)
|
|
5002
|
+ fmt.Println("时间人秘股呢换药2232323223323223322323232323232323232323232323", delete_count)
|
|
5003
|
+
|
|
5004
|
+ // 删除出库完成后,要改变流水库存
|
|
5005
|
+ errOne = service.UpDateWarehouStockFlowByStockDelete(ware.WarehouseInfotId, record_time, good_yc.GoodId, delete_count, good_yc.PatientId)
|
|
5006
|
+ fmt.Println("erron2332323232323232232323", errOne)
|
5005
|
5007
|
errThree := service.UpDateWarehouseInfoByStockDelete(ware.WarehouseInfotId, delete_count)
|
5006
|
5008
|
|
5007
|
5009
|
if errThree != nil {
|