|
@@ -2737,29 +2737,6 @@ func (this *SelfDrugApiController) GetGoodNewQuery() {
|
2737
|
2737
|
keyword := this.GetString("keyword")
|
2738
|
2738
|
page, _ := this.GetInt64("page")
|
2739
|
2739
|
limit, _ := this.GetInt64("limit")
|
2740
|
|
- //start_time := this.GetString("start_time")
|
2741
|
|
- //end_time := this.GetString("end_time")
|
2742
|
|
- //timeLayout := "2006-01-02"
|
2743
|
|
- //loc, _ := time.LoadLocation("Local")
|
2744
|
|
- //var startTime int64
|
2745
|
|
- //if len(start_time) > 0 {
|
2746
|
|
- // theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
2747
|
|
- // if err != nil {
|
2748
|
|
- // this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
2749
|
|
- // return
|
2750
|
|
- // }
|
2751
|
|
- // startTime = theTime.Unix()
|
2752
|
|
- //}
|
2753
|
|
- //var endTime int64
|
2754
|
|
- //if len(end_time) > 0 {
|
2755
|
|
- // theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
2756
|
|
- // if err != nil {
|
2757
|
|
- // utils.ErrorLog(err.Error())
|
2758
|
|
- // this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
|
2759
|
|
- // return
|
2760
|
|
- // }
|
2761
|
|
- // endTime = theTime.Unix()
|
2762
|
|
- //}
|
2763
|
2740
|
|
2764
|
2741
|
// 查询该机构所有耗材入库信息
|
2765
|
2742
|
goodList, _ := service.GetAllGoodListSeven(orgId)
|
|
@@ -2774,18 +2751,6 @@ func (this *SelfDrugApiController) GetGoodNewQuery() {
|
2774
|
2751
|
service.UpdateGoodInformation(it.ID, orgId, sum_total)
|
2775
|
2752
|
}
|
2776
|
2753
|
|
2777
|
|
- //查询删除的耗材数据
|
2778
|
|
- //listOne, _ := service.GetHisPrescriptionProjectByOrgId(orgId)
|
2779
|
|
- //for _, item := range listOne {
|
2780
|
|
- // //查询流水
|
2781
|
|
- // flowDetail, _ := service.GetPatientStockFlow(item.PatientId, item.RecordDate, item.ProjectId)
|
2782
|
|
- // formatInt, _ := strconv.ParseInt(item.Count, 10, 64)
|
2783
|
|
- // vmFlow := models.VmStockFlow{
|
2784
|
|
- // Count: formatInt,
|
2785
|
|
- // }
|
2786
|
|
- // service.ModifyPatientStockFlow(flowDetail.ID,vmFlow)
|
2787
|
|
- //}
|
2788
|
|
-
|
2789
|
2754
|
var ids []int64
|
2790
|
2755
|
var goodIds []int64
|
2791
|
2756
|
manufacturerList, _ := service.GetManufacturerListByKeyword(orgId, keyword)
|
|
@@ -2796,41 +2761,8 @@ func (this *SelfDrugApiController) GetGoodNewQuery() {
|
2796
|
2761
|
for _, it := range infoList {
|
2797
|
2762
|
goodIds = append(goodIds, it.GoodId)
|
2798
|
2763
|
}
|
2799
|
|
- //list, _, err := service.GetGoodNewQuery(orgId, storehouse_id, good_type, keyword, page, limit, ids, goodIds, startTime, endTime)
|
2800
|
2764
|
|
2801
|
2765
|
stockList, total, err := service.GetGoodStockList(orgId, storehouse_id, good_type, keyword, page, limit, ids)
|
2802
|
|
- //for _,item :=range list{
|
2803
|
|
- // //查询入库信息分组
|
2804
|
|
- // warehouseInfo, _ := service.FindGoodWarehouseInfoGroup(item.ID, orgId, storehouse_id, startTime, endTime)
|
2805
|
|
- // for _,it :=range warehouseInfo {
|
2806
|
|
- // item.WarehousingInfo = append(item.WarehousingInfo, it)
|
2807
|
|
- // }
|
2808
|
|
- // //查询入库信息
|
2809
|
|
- // info, _ := service.FindGoodWarehouseInfo(item.ID, orgId, storehouse_id, startTime, endTime)
|
2810
|
|
- // for _,it :=range info {
|
2811
|
|
- // item.StWarehousingInfo = append(item.StWarehousingInfo, it)
|
2812
|
|
- // }
|
2813
|
|
- // //出库数据
|
2814
|
|
- // outInfo, _ := service.FindGoodWarehouseOutInfo(item.ID, orgId, storehouse_id, startTime, endTime)
|
2815
|
|
- // for _,it :=range outInfo {
|
2816
|
|
- // item.WarehouseOutInfo = append(item.WarehouseOutInfo, it)
|
2817
|
|
- // }
|
2818
|
|
- // //出库流水
|
2819
|
|
- // outFlow, _ := service.FindGoodStockOutFlow(item.ID, item.OrgId, storehouse_id, startTime, endTime)
|
2820
|
|
- // for _,it :=range outFlow {
|
2821
|
|
- // item.FlowOutInfo = append(item.FlowOutInfo, it)
|
2822
|
|
- // }
|
2823
|
|
- // //退库流水
|
2824
|
|
- // cancelFlow, _ := service.FindGoodCancelFlow(item.ID, item.OrgId, storehouse_id, startTime, endTime)
|
2825
|
|
- // for _,it :=range cancelFlow {
|
2826
|
|
- // item.FlowCancelInfo = append(item.FlowCancelInfo, it)
|
2827
|
|
- // }
|
2828
|
|
- // //退库数据
|
2829
|
|
- // cancelInfo, _ := service.FindCancelStockInfo(item.ID, orgId, storehouse_id, startTime, endTime)
|
2830
|
|
- // for _,it :=range cancelInfo {
|
2831
|
|
- // item.CancelStockInfo = append(item.CancelStockInfo, it)
|
2832
|
|
- // }
|
2833
|
|
- //}
|
2834
|
2766
|
|
2835
|
2767
|
if err != nil {
|
2836
|
2768
|
this.ServeFailJsonSend(enums.ErrorCodeDataException, "获取查询信息失败")
|
|
@@ -2838,8 +2770,7 @@ func (this *SelfDrugApiController) GetGoodNewQuery() {
|
2838
|
2770
|
}
|
2839
|
2771
|
|
2840
|
2772
|
this.ServeSuccessJSON(map[string]interface{}{
|
2841
|
|
- "total": total,
|
2842
|
|
- //"list": list,
|
|
2773
|
+ "total": total,
|
2843
|
2774
|
"stockList": stockList,
|
2844
|
2775
|
})
|
2845
|
2776
|
}
|
|
@@ -3470,12 +3401,14 @@ func (this *SelfDrugApiController) GetDrugNewQuery() {
|
3470
|
3401
|
for _, it := range drug {
|
3471
|
3402
|
var sum_count int64
|
3472
|
3403
|
var limit_count int64
|
3473
|
|
-
|
|
3404
|
+ fmt.Println("it233323323232323223", it.DrugName)
|
3474
|
3405
|
drugInfo, _ := service.GetDrugWarehouseInfoName(it.ID, orgId)
|
3475
|
3406
|
for _, item := range drugInfo {
|
|
3407
|
+
|
3476
|
3408
|
sum_count += item.StockMaxNumber*it.MinNumber + item.StockMinNumber
|
3477
|
3409
|
}
|
3478
|
|
- limit_count = it.DrugStockLimitCount * it.MinNumber
|
|
3410
|
+ stockInt, _ := strconv.ParseInt(it.DrugStockLimit, 10, 64)
|
|
3411
|
+ limit_count = stockInt * it.MinNumber
|
3479
|
3412
|
service.UpdateDrugById(it.ID, orgId, limit_count, sum_count)
|
3480
|
3413
|
}
|
3481
|
3414
|
|