123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426 |
- 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"`
- }
|