zhangqian
2024-07-05 9ceaa0c500368b0a512be2053e54e2ee49c5f537
controllers/report_forms_controller.go
@@ -475,17 +475,18 @@
      return
   }
   now := time.Now().Local()
   today := now.Day()
   nowMonth := now.Format("2006-01")
   if len(result) == 0 {
      util.ResponseFormatList(c, code.Success, result, int(total))
      return
   }
   day, dateStr, _ := service.NewSystemConfigService().GetInventoryCutOffPoint()
   if nowMonth == params.Date && today < day || today == day && now.Format("15:04") < dateStr { //本月未至结算时间点
   nowMonth := time.Now().Local().Format("2006-01")
   if nowMonth == params.Date {
      productIds := make([]string, 0, len(result))
      for _, item := range result {
         productIds = append(productIds, item.ProductId)
      }
      statsRecords, err := service.GetCurrentWarehouseStats(params.Date, params.WarehouseID, productIds)
      statsRecords, err := service.GetCurrentWarehouseStats(params.Date, params.WarehouseID, productIds, true)
      if err != nil {
         util.ResponseFormat(c, code.InternalError, "内部错误")
         return
@@ -506,6 +507,7 @@
   }
   util.ResponseFormatList(c, code.Success, result, int(total))
}
// DoWareHouseMonthStats
@@ -551,6 +553,7 @@
      return
   }
   params.Preload = true
   monthFormsService := service.NewWarehouseMonthFormsService()
   list, err := monthFormsService.FetchAll(params)
   if err != nil {