package model import ( "fmt" operationPb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/operation" ) type PastureCommonRequest struct { Name string `json:"name"` Page int32 `json:"page,omitempty"` Offset int32 `json:"offset"` PageCount int32 `json:"pagecount,omitempty"` ReturnType string `json:"returntype,omitempty"` Checked int32 `json:"checked,omitempty"` ParamMaps interface{} `json:"parammaps"` } type FormulaEstimateParams struct { PastureId string `json:"pastureid"` StartTime string `json:"startTime"` StopTime string `json:"stopTime"` Search string `json:"search"` TempletId string `json:"templetid"` Barid string `json:"barid"` ImforName string `json:"inforname,omitempty"` } type PastureCommonResponse struct { Code int32 `json:"code"` Msg string `json:"msg"` Data *PastureCommonData `json:"data"` } type PastureCommonData struct { List interface{} `json:"list"` Data interface{} `json:"data"` PageSize int32 `json:"pageSize"` Total int32 `json:"total"` PageNum int32 `json:"pageNum"` } type InventoryStatisticsParams struct { PastureId string `json:"pastureid"` StartTime string `json:"startTime"` StopTime string `json:"stopTime"` FeedName string `json:"feedname"` } type InventoryStatisticsList struct { FeedName string `json:"feedname"` LaidSum string `json:"laidsum"` // 入库重量 StartPrice string `json:"startprice"` // 期初价格 StartSum string `json:"startsum"` // 期初库存 StopPrice string `json:"stopprice"` // 期末价格 StopSum string `json:"stopsum"` // 期末库存 UseSumRG string `json:"usesumRG"` // 人工用料重量 UseSumXH string `json:"usesumXH"` // 损耗重量 UseSumXT string `json:"usesumXT"` // 系统出库重量 } type UserMaterialsStatisticsParams struct { PastureId string `json:"pastureid"` StartTime string `json:"startTime"` StopTime string `json:"stopTime"` FeedName string `json:"fname"` Typea string `json:"typea"` } type UserMaterialsList struct { Data1 []interface{} `json:"data1"` Data2 []*UserMaterialsListData2 `json:"data2"` } type UserMaterialsListData2 struct { Children []*Children `json:"children"` Label string `json:"label"` } type Children struct { Label string `json:"label"` Prop string `json:"prop"` } type PriceStatisticsParams struct { PastureId string `json:"pastureid"` StartTime string `json:"startTime"` StopTime string `json:"stopTime"` FeedName string `json:"fname"` } // FeedStatisticsParams 饲喂效率-效率统计 type FeedStatisticsParams struct { PastureId string `json:"pastureid"` StartTime string `json:"startTime"` StopTime string `json:"stopTime"` Date string `json:"date"` FeedTName string `json:"ftname"` BarName string `json:"barname"` CowClass string `json:"cowclass"` Times string `json:"times"` } func NewFeedStatisticsParams(pastureId int64, req *operationPb.SearchFeedStatisticsRequest) *FeedStatisticsParams { times := "" if req.ClassNumber > 0 { times = fmt.Sprintf("%d", req.ClassNumber) } return &FeedStatisticsParams{ PastureId: fmt.Sprintf("%d", pastureId), StartTime: req.StartTime, StopTime: req.EndTime, Date: req.StartTime, FeedTName: req.FormulaTemplate, BarName: req.BarnName, CowClass: req.CattleCategoryName, Times: times, } } // FeedChartParams 饲喂效率-图形统计 type FeedChartParams struct { ParamMaps interface{} `json:"parammaps"` } type ParamMaps struct { PastureId string `json:"pastureid"` StartTime string `json:"startTime"` StopTime string `json:"stopTime"` Status int32 `json:"status"` } // MixFeedStatisticsParams 准确性分析-混料统计 type MixFeedStatisticsParams struct { PastureId string `json:"pastureid"` StartTime string `json:"startTime"` StopTime string `json:"stopTime"` TmrTName string `json:"tmrTName"` ProjName string `json:"projName"` Times string `json:"times"` ButtonType string `json:"buttonType"` TempletName string `json:"templetName"` Isuse string `json:"isuse"` Hlwc1 int32 `json:"hlwc1,omitempty"` Hlwc2 int32 `json:"hlwc2,omitempty"` Hlzq1 int32 `json:"hlzq1,omitempty"` Hlzq2 int32 `json:"hlzq2,omitempty"` Hlzql1 int32 `json:"hlzql1,omitempty"` Hlzql2 int32 `json:"hlzql2,omitempty"` Error bool `json:"error,omitempty"` } func NewMixFeedStatisticsParams(pastureId int64, req *operationPb.MixFeedStatisticsRequest) *MixFeedStatisticsParams { times := "" if req.ClassNumber > 0 { times = fmt.Sprintf("%d", req.ClassNumber) } return &MixFeedStatisticsParams{ PastureId: fmt.Sprintf("%d", pastureId), StartTime: req.StartTime, StopTime: req.StartTime, TmrTName: req.EquipmentName, ProjName: req.TrainNumber, Times: times, ButtonType: req.ButtonType, TempletName: req.FormulationName, Isuse: req.IsUse, Hlwc1: req.Hlwc1, Hlwc2: req.Hlwc2, Hlzq1: req.Hlzq1, Hlzq2: req.Hlzq2, Hlzql1: req.Hlzql1, Hlzql2: req.Hlzql2, Error: req.IsError, } } // SprinkleStatisticsParams 准确性分析-撒料统计 type SprinkleStatisticsParams struct { PastureId string `json:"pastureid"` StartTime string `json:"startTime"` StopTime string `json:"stopTime"` TmrTName string `json:"tmrTName"` ProjName string `json:"projName"` Times string `json:"times"` Fname string `json:"fname"` ButtonType string `json:"buttontype"` TempletName string `json:"templetname"` Isuse string `json:"isuse,omitempty"` Slwc1 int32 `json:"slwc1,omitempty"` Slwc2 int32 `json:"slwc2,omitempty"` Slzq1 int32 `json:"slzq1,omitempty"` Slzq2 int32 `json:"slzq2,omitempty"` Slzql1 int32 `json:"slzql1,omitempty"` Slzql2 int32 `json:"slzql2,omitempty"` Error bool `json:"error,omitempty"` } func NewSprinkleStatisticsParams(pastureId int64, req *operationPb.SprinkleStatisticsRequest) *SprinkleStatisticsParams { times := "" if req.ClassNumber > 0 { times = fmt.Sprintf("%d", req.ClassNumber) } return &SprinkleStatisticsParams{ PastureId: fmt.Sprintf("%d", pastureId), StartTime: req.StartTime, StopTime: req.StartTime, TmrTName: req.EquipmentName, ProjName: req.TrainNumber, Times: times, ButtonType: req.ButtonType, TempletName: req.FormulationName, Isuse: req.IsUse, Fname: req.BarnName, Slwc1: req.Slwc1, Slwc2: req.Slwc2, Slzq2: req.Slzq2, Slzq1: req.Slzq1, Slzql1: req.Slzql1, Slzql2: req.Slzql2, Error: req.IsError, } } // ProcessAnalysisParams 过程分析 type ProcessAnalysisParams struct { PastureId string `json:"pastureid"` StartTime string `json:"startTime"` StopTime string `json:"stopTime"` TmrTName []string `json:"tmrTName"` IsCompleted string `json:"iscompleted"` LpPlanType string `json:"lpplantype"` FClassId string `json:"fclassid"` Hlwc1 int32 `json:"hlwc1,omitempty"` Hlwc2 int32 `json:"hlwc2,omitempty"` Hlzq1 int32 `json:"hlzq1,omitempty"` Hlzq2 int32 `json:"hlzq2,omitempty"` Slwc1 int32 `json:"slwc1,omitempty"` Slwc2 int32 `json:"slwc2,omitempty"` Slzq1 int32 `json:"slzq1,omitempty"` Slzq2 int32 `json:"slzq2,omitempty"` Error string `json:"error,omitempty"` } func NewProcessAnalysisParams(pastureId int64, req *operationPb.ProcessAnalysisRequest) *ProcessAnalysisParams { if req.TmrName == nil { req.TmrName = make([]string, 0) } lpPlanType := "" if req.PlanType > 0 { lpPlanType = fmt.Sprintf("%d", req.PlanType) } return &ProcessAnalysisParams{ PastureId: fmt.Sprintf("%d", pastureId), StartTime: req.StartTime, StopTime: req.EndTime, TmrTName: req.TmrName, IsCompleted: "", LpPlanType: lpPlanType, FClassId: req.MixFeedType, Hlzq1: req.Hlzq1, Hlzq2: req.Hlzq2, Hlwc1: req.Hlwc1, Hlwc2: req.Hlwc2, Slwc1: req.Slwc1, Slwc2: req.Slwc2, Slzq2: req.Slzq2, Slzq1: req.Slzq1, Error: req.ErrorRange, } } // AccuracyAggParams 准确性分析-汇总统计 type AccuracyAggParams struct { PastureId string `json:"pastureid"` StartTime string `json:"startTime"` StopTime string `json:"stopTime"` FName string `json:"fname"` Sort string `json:"sort"` Times string `json:"times"` Status string `json:"status"` Genre int32 `json:"genre"` IsDate int32 `json:"isdate"` Hlwc1 int32 `json:"hlwc1,omitempty"` Hlwc2 int32 `json:"hlwc2,omitempty"` Hlzq1 int32 `json:"hlzq1,omitempty"` Hlzq2 int32 `json:"hlzq2,omitempty"` Hlzql1 int32 `json:"hlzql1,omitempty"` Hlzql2 int32 `json:"hlzql2,omitempty"` Slwc1 int32 `json:"slwc1,omitempty"` Slwc2 int32 `json:"slwc2,omitempty"` Slzq1 int32 `json:"slzq1,omitempty"` Slzq2 int32 `json:"slzq2,omitempty"` Slzql1 int32 `json:"slzql1,omitempty"` Slzql2 int32 `json:"slzql2,omitempty"` Error bool `json:"error,omitempty"` } func NewAccuracyAggParams(pastureId int64, req *operationPb.AccuracyAggStatisticsRequest) *AccuracyAggParams { return &AccuracyAggParams{ PastureId: fmt.Sprintf("%d", pastureId), StartTime: req.StartTime, StopTime: req.EndTime, FName: req.Fname, Sort: req.Sort, Status: req.Status, Times: req.Times, Genre: req.Genre, IsDate: req.Isdate, Hlwc1: req.Hlwc1, Hlwc2: req.Hlwc2, Hlzq1: req.Hlzq1, Hlzq2: req.Hlzq2, Hlzql1: req.Hlzql1, Hlzql2: req.Hlzql2, Slwc1: req.Slwc1, Slwc2: req.Slwc2, Slzq1: req.Slzq1, Slzq2: req.Slzq2, Slzql1: req.Slzql1, Slzql2: req.Slzql2, Error: req.IsError, } } // TrainNumberParams 班次 type TrainNumberParams struct { PastureId string `json:"pastureid"` InfoRName string `json:"inforname"` } // TrainNumberList 班次 type TrainNumberList struct { InfoName string `json:"inforname"` InfoValue string `json:"inforvalue"` } type GetDataByNameParams struct { PastureId string `json:"pastureid"` StartTime string `json:"startTime"` StopTime string `json:"stopTime"` Pid string `json:"pid"` Optdevice string `json:"optdevice,omitempty"` FtId int32 `json:"ftid,omitempty"` Name string `json:"name,omitempty"` } type FeedStatisticsResponse struct { Code int32 `json:"code"` Msg string `json:"msg"` Data *FeedStatisticsData `json:"data"` } type FeedStatisticsData struct { List map[string]interface{} `json:"list"` } var DefaultSheetName = "Sheet1" type FeedStatisticsConversions struct { PastureName string `json:"pasture_name"` // 牧场名称 TmrDryMatter string `json:"tmr_dry_matter"` // TMR干物质 BarName string `json:"bar_name"` // 栏舍名称 MilkYield string `json:"milk_yield"` // 产奶量 TodayLeftovers string `json:"today_leftovers"` // 今日剩料量 FeedCosts float64 `json:"feed_costs"` // 公斤奶饲料成本 LeftoverRate string `json:"leftover_rate"` // 剩料率 ActualDryMatterIntake string `json:"actual_dry_matter_intake"` // 实际干物质采食量 ActualCost string `json:"actual_cost"` // 实际成本 ActualNumberOfCattle string `json:"actual_number_of_cattle"` // 实际牛头数 AmountToBeMixed string `json:"amount_to_be_mixed"` // 应混料量 MixingTime string `json:"mixing_time"` // 混料时间 CategoryCattleName string `json:"category_cattle_name"` // 牲畜类别 TheoreticalDryMatter string `json:"theoretical_dry_matter"` // 理论干物质 LeftoverMaterial float64 `json:"leftover_material"` // 转投剩料量 FormulatedDryMatterIntake string `json:"formulated_dry_matter_intake"` // 配方干物质采食量 CostOfFormulation string `json:"cost_of_formulation"` // 配方成本 FoodIntakeRate string `json:"food_intake_rate"` // 采食率 FeedConversionRatio float64 `json:"feed_conversion_ratio"` // 饲料转化率 FeedFormulaName string `json:"feed_formula_name"` // 配方模板 ActualMixedVolume string `json:"actual_mixed_volume"` // 实际混料量 SprinkleVolume string `json:"sprinkle_volume"` // 撒料量 } type MixedSprinkleDetailRequest struct { PastureId string `json:"pastureid"` Id string `json:"id"` PId string `json:"pid"` FClassId string `json:"fclassid"` } func NewMixedSprinkleDetailRequest(pastureId int64, req *operationPb.ProcessMixedSprinkleDetailRequest) *MixedSprinkleDetailRequest { return &MixedSprinkleDetailRequest{ PastureId: fmt.Sprintf("%d", pastureId), FClassId: req.FclassId, PId: req.Pid, Id: req.Id, } } type PastureFeedTemplateHistoryRequest struct { PastureId string `json:"pastureid"` FTid int64 `json:"ftid"` StartDate string `json:"startdate"` EndDate string `json:"enddate"` } type PastureFeedTemplateHistoryResponse struct { Code int32 `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data"` } type PastureBarnHistoryRequest struct { PastureId string `json:"pastureid,omitempty"` BarName string `json:"barname"` StartDate string `json:"startDate"` EndDate string `json:"endDate"` } type PastureBarnHistoryResponse struct { Code int32 `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data"` }