| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523 | 
							- package backend
 
- import (
 
- 	"context"
 
- 	"fmt"
 
- 	"kpt-pasture/model"
 
- 	"kpt-pasture/util"
 
- 	"net/http"
 
- 	"time"
 
- 	pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
 
- 	"gitee.com/xuyiping_admin/pkg/xerr"
 
- )
 
- // CalendarToDoList 获取日历待办列表
 
- func (s *StoreEntry) CalendarToDoList(ctx context.Context, req *pasturePb.CalendarToDoRequest, pagination *pasturePb.PaginationModel) (*pasturePb.CalendarToDoResponse, error) {
 
- 	currentUser, err := s.GetCurrentSystemUser(ctx)
 
- 	if err != nil || currentUser.Id <= 0 {
 
- 		return nil, xerr.Custom("当前登录用户失败,请退出重新登录")
 
- 	}
 
- 	var count int64 = 0
 
- 	eventItem := make([]*model.EventItem, 0)
 
- 	pref := s.DB.Model(&model.EventItem{})
 
- 	if req.StartAt > 0 && req.EndAt > 0 && req.StartAt <= req.EndAt {
 
- 		pref = pref.Where("plan_day >= ?", req.StartAt).
 
- 			Where("plan_day <= ?", req.EndAt)
 
- 	}
 
- 	if len(req.CowIds) > 0 {
 
- 		cowList, _ := s.ParseCowIds(ctx, currentUser.PastureId, req.CowIds)
 
- 		cowIds := make([]int64, 0)
 
- 		for _, cow := range cowList {
 
- 			cowIds = append(cowIds, cow.Id)
 
- 		}
 
- 		if len(cowIds) > 0 {
 
- 			pref.Where("cow_id IN (?)", cowIds)
 
- 		}
 
- 	}
 
- 	if req.CalendarType > 0 {
 
- 		pref.Where("calendar_type = ?", req.CalendarType)
 
- 	}
 
- 	if req.IsFinish > 0 {
 
- 		pref.Where("is_finish = ?", req.IsFinish)
 
- 	}
 
- 	if req.IsExpire > 0 {
 
- 		pref.Where("is_expire = ?", req.IsExpire)
 
- 	}
 
- 	if err = pref.Order("id desc").
 
- 		Count(&count).
 
- 		Limit(int(pagination.PageSize)).
 
- 		Offset(int(pagination.PageOffset)).
 
- 		Find(&eventItem).Error; err != nil {
 
- 		return nil, xerr.WithStack(err)
 
- 	}
 
- 	penMap := s.PenMap(ctx, currentUser.PastureId)
 
- 	calendarMap := CalendarTypeMap()
 
- 	return &pasturePb.CalendarToDoResponse{
 
- 		Code:    http.StatusOK,
 
- 		Message: "ok",
 
- 		Data: &pasturePb.CalendarToDoData{
 
- 			List:     model.EventItemSlice(eventItem).ToPB(penMap, calendarMap),
 
- 			Total:    int32(count),
 
- 			PageSize: pagination.PageSize,
 
- 			Page:     pagination.Page,
 
- 		},
 
- 	}, nil
 
- }
 
- func (s *StoreEntry) CalendarList(ctx context.Context, req *pasturePb.CalendarRequest) (*pasturePb.CalendarResponse, error) {
 
- 	currentUser, err := s.GetCurrentSystemUser(ctx)
 
- 	if err != nil || currentUser.Id <= 0 {
 
- 		return nil, xerr.Customf("登录信息异常,请退出重新登录")
 
- 	}
 
- 	calendarList := make([]*model.Calendar, 0)
 
- 	if err = s.DB.Model(&model.Calendar{}).
 
- 		Where("show_day >= ?", req.ShowStartDay).
 
- 		Where("show_day <= ?", req.ShowEndDay).
 
- 		Where("pasture_id = ?", currentUser.PastureId).
 
- 		Where("is_show = ?", pasturePb.IsShow_Ok).
 
- 		Find(&calendarList).Error; err != nil {
 
- 		return nil, xerr.WithStack(err)
 
- 	}
 
- 	return &pasturePb.CalendarResponse{
 
- 		Code:    http.StatusOK,
 
- 		Message: "ok",
 
- 		Data:    model.CalendarSlice(calendarList).ToPB(),
 
- 	}, nil
 
- }
 
- func (s *StoreEntry) CalendarTableDetail(
 
- 	ctx context.Context,
 
- 	req *pasturePb.CalendarTableRequest,
 
- 	pagination *pasturePb.PaginationModel,
 
- ) (interface{}, error) {
 
- 	if req.Start != time.Now().Format(model.LayoutDate2) {
 
- 		return nil, xerr.Custom("只能获取当天的数据")
 
- 	}
 
- 	currentUser, err := s.GetCurrentSystemUser(ctx)
 
- 	if err != nil || currentUser.Id <= 0 {
 
- 		return nil, xerr.Customf("登录信息异常,请退出重新登录")
 
- 	}
 
- 	newCalendar := &model.Calendar{}
 
- 	if err = s.DB.Model(&model.Calendar{}).
 
- 		Where("calendar_type = ?", req.CalendarType).
 
- 		Where("show_day = ?", req.Start).
 
- 		Where("is_show = ?", pasturePb.IsShow_Ok).
 
- 		Where("pasture_id = ?", currentUser.PastureId).
 
- 		First(newCalendar).Error; err != nil {
 
- 		return nil, xerr.WithStack(err)
 
- 	}
 
- 	if newCalendar.Id <= 0 {
 
- 		return nil, xerr.New("不存在该日历数据")
 
- 	}
 
- 	return s.getCalendarCowList(ctx, req.CalendarType, req.Start, pagination, currentUser.PastureId)
 
- }
 
- func (s *StoreEntry) getCalendarCowList(
 
- 	ctx context.Context,
 
- 	calendarType pasturePb.CalendarType_Kind,
 
- 	showDay string,
 
- 	pagination *pasturePb.PaginationModel,
 
- 	pastureId int64,
 
- ) (interface{}, error) {
 
- 	req := &pasturePb.ItemsRequest{EndDay: showDay, CalendarType: calendarType, Status: pasturePb.IsShow_No, PastureId: int32(pastureId)}
 
- 	switch calendarType {
 
- 	case pasturePb.CalendarType_Immunisation: // 免疫
 
- 		return s.ImmunisationCowList(ctx, req, pagination)
 
- 	case pasturePb.CalendarType_PG, pasturePb.CalendarType_RnGH: // 同期
 
- 		return s.SameTimeCowList(ctx, req, pagination)
 
- 	case pasturePb.CalendarType_Pregnancy_Check: // 孕检
 
- 		return s.PregnancyCheckCowList(ctx, req, pagination)
 
- 	case pasturePb.CalendarType_WorkOrder: // 工作单
 
- 		return s.WorkOrderCowList(ctx, req, pagination)
 
- 	case pasturePb.CalendarType_Weaning: // 断奶
 
- 		return s.WeaningCowList(ctx, req, pagination)
 
- 	case pasturePb.CalendarType_Treatment: // 治疗
 
- 		return s.TreatmentCowList(ctx, req, pagination)
 
- 	case pasturePb.CalendarType_Mating: // 配种
 
- 		return s.MatingCowList(ctx, req, pagination)
 
- 	case pasturePb.CalendarType_Calving: // 产犊
 
- 		return s.CalvingCowList(ctx, req, pagination)
 
- 	default:
 
- 		return nil, xerr.New("不支持的日历类型")
 
- 	}
 
- }
 
- func (s *StoreEntry) ImmunisationCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.ImmunizationItemsResponse, error) {
 
- 	eventImmunizationPlanList := make([]*model.EventImmunizationPlan, 0)
 
- 	count := int64(0)
 
- 	pref := s.DB.Model(&model.EventImmunizationPlan{}).
 
- 		Where("status = ?", pasturePb.IsShow_No).
 
- 		Where("pasture_id = ?", req.PastureId)
 
- 	if req.StartDay != "" {
 
- 		dateTime := util.TimeParseLocalUnix(req.StartDay)
 
- 		pref.Where("plan_day >= ?", dateTime)
 
- 	}
 
- 	if req.EndDay != "" {
 
- 		dateTime := util.TimeParseLocalEndUnix(req.EndDay)
 
- 		pref.Where("plan_day <= ?", dateTime)
 
- 	}
 
- 	if req.CowId > 0 {
 
- 		pref.Where("cow_id = ?", req.CowId)
 
- 	}
 
- 	if req.ImmunizationId > 0 {
 
- 		pref.Where("plan_id = ?", req.ImmunizationId)
 
- 	}
 
- 	if req.PenId > 0 {
 
- 		pref.Where("pen_id = ?", req.PenId)
 
- 	}
 
- 	if req.Status > 0 {
 
- 		pref.Where("status = ?", req.Status)
 
- 	}
 
- 	if err := pref.Order("id desc").
 
- 		Count(&count).
 
- 		Limit(int(pagination.PageSize)).
 
- 		Offset(int(pagination.PageOffset)).
 
- 		Order("id desc").
 
- 		Find(&eventImmunizationPlanList).Error; err != nil {
 
- 		return nil, xerr.WithStack(err)
 
- 	}
 
- 	return &pasturePb.ImmunizationItemsResponse{
 
- 		Code:    http.StatusOK,
 
- 		Message: "ok",
 
- 		Data: &pasturePb.ImmunizationItemsData{
 
- 			Total:    int32(count),
 
- 			Page:     pagination.Page,
 
- 			PageSize: pagination.PageSize,
 
- 			Header: map[string]string{
 
- 				"id":                   "编号",
 
- 				"cowId":                "牛号",
 
- 				"penName":              "栏舍",
 
- 				"dayAge":               "日龄",
 
- 				"planDay":              "免疫开始时间",
 
- 				"immunizationPlanName": "免疫名称",
 
- 				"status":               "状态",
 
- 			},
 
- 			List: model.EventImmunizationPlanSlice(eventImmunizationPlanList).ToPB(),
 
- 		},
 
- 	}, nil
 
- }
 
- func (s *StoreEntry) SameTimeCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SameTimeItemResponse, error) {
 
- 	sameTimeBodyList := make([]*model.SameTimeItemBody, 0)
 
- 	count := int64(0)
 
- 	pref := s.DB.Table(fmt.Sprintf("%s as a", new(model.EventCowSameTime).TableName())).
 
- 		Select("a.id,a.cow_id,a.pen_name,a.status,a.same_time_type,b.breed_status,a.same_time_name,b.cow_type,b.day_age,b.calving_age,b.abortion_age,b.last_calving_at,b.last_abortion_at").
 
- 		Joins("left join cow as b on a.cow_id = b.id").
 
- 		Where("b.admission_status = ?", pasturePb.AdmissionStatus_Admission).
 
- 		Where("a.pasture_id = ?", req.PastureId).
 
- 		Where("a.status = ?", pasturePb.IsShow_No)
 
- 	if req.EndDay != "" {
 
- 		dateTime := util.TimeParseLocalEndUnix(req.EndDay)
 
- 		pref.Where("a.plan_day <= ?", dateTime)
 
- 	}
 
- 	if req.CalendarType > 0 {
 
- 		pref.Where("a.same_time_type = ?", req.CalendarType)
 
- 	}
 
- 	if req.CowType > 0 {
 
- 		pref.Where("b.cow_type = ?", req.CowType)
 
- 	}
 
- 	if req.Status > 0 {
 
- 		pref.Where("a.status = ?", pasturePb.IsShow_No)
 
- 	}
 
- 	if err := pref.Order("a.id desc").Count(&count).
 
- 		Limit(int(pagination.PageSize)).
 
- 		Offset(int(pagination.PageOffset)).
 
- 		Order("id desc").
 
- 		Find(&sameTimeBodyList).Error; err != nil {
 
- 		return nil, xerr.WithStack(err)
 
- 	}
 
- 	breedStatusMap := s.CowBreedStatusMap()
 
- 	penMap := s.PenMap(ctx, int64(req.PastureId))
 
- 	sameTimeTypeMap := s.SameTimeTypeMap()
 
- 	return &pasturePb.SameTimeItemResponse{
 
- 		Code:    http.StatusOK,
 
- 		Message: "ok",
 
- 		Data: &pasturePb.SameTimeItemsData{
 
- 			Total:    int32(count),
 
- 			Page:     pagination.Page,
 
- 			PageSize: pagination.PageSize,
 
- 			Header: map[string]string{
 
- 				"id":               "编号",
 
- 				"cowId":            "牛号",
 
- 				"breedStatusName":  "繁殖状态",
 
- 				"cowTypeName":      "牛只类型",
 
- 				"penName":          "栏舍",
 
- 				"lact":             "胎次",
 
- 				"calvingAge":       "产后天数",
 
- 				"abortionAge":      "流产天数",
 
- 				"dayAge":           "日龄",
 
- 				"status":           "状态",
 
- 				"sameTimeTypeName": "处理方式",
 
- 				"matingTimes":      "本胎次配次",
 
- 				"calvingAtFormat":  "产犊日期",
 
- 				"abortionAtFormat": "流产日期",
 
- 				"sameTimeName":     "同情名称",
 
- 			},
 
- 			List: model.SameTimeBodySlice(sameTimeBodyList).ToPB(breedStatusMap, penMap, sameTimeTypeMap),
 
- 		},
 
- 	}, nil
 
- }
 
- func (s *StoreEntry) PregnancyCheckCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.PregnancyCheckItemsResponse, error) {
 
- 	newPregnancyCheckItems := make([]*pasturePb.PregnancyCheckItems, 0)
 
- 	var count int64
 
- 	pref := s.DB.Table(fmt.Sprintf("%s as a", new(model.EventPregnantCheck).TableName())).
 
- 		Select("a.id,a.cow_id,a.pen_id,a.status,b.breed_status,b.cow_type,b.day_age,b.calving_age,b.abortion_age,a.bull_id").
 
- 		Joins("left join cow as b on a.cow_id = b.id").
 
- 		Where("b.admission_status = ?", pasturePb.AdmissionStatus_Admission).
 
- 		Where("a.pasture_id = ?", req.PastureId).
 
- 		Where("a.status = ?", pasturePb.IsShow_No)
 
- 	if req.EndDay != "" {
 
- 		dateTime := util.TimeParseLocalEndUnix(req.EndDay)
 
- 		pref.Where("plan_day <= ?", dateTime)
 
- 	}
 
- 	if req.CowType > 0 {
 
- 		pref.Where("cow_type = ?", req.CowType)
 
- 	}
 
- 	if req.Status > 0 {
 
- 		pref.Where("a.status = ?", req.Status)
 
- 	}
 
- 	if req.PregnantCheckType > 0 {
 
- 		pref.Where("pregnant_check_name = ?", model.PregnantCheckNameValueMap[req.PregnantCheckType])
 
- 	}
 
- 	if err := pref.Order("id desc").
 
- 		Count(&count).
 
- 		Limit(int(pagination.PageSize)).
 
- 		Offset(int(pagination.PageOffset)).
 
- 		Order("id desc").
 
- 		Find(&newPregnancyCheckItems).Error; err != nil {
 
- 		return nil, xerr.WithStack(err)
 
- 	}
 
- 	return &pasturePb.PregnancyCheckItemsResponse{
 
- 		Code:    http.StatusOK,
 
- 		Message: "ok",
 
- 		Data: &pasturePb.PregnancyCheckItemsData{
 
- 			Total:    int32(count),
 
- 			Page:     pagination.Page,
 
- 			PageSize: pagination.PageSize,
 
- 			Header: map[string]string{
 
- 				"id":              "编号",
 
- 				"cowId":           "牛号",
 
- 				"cowTypeName":     "牛只类型",
 
- 				"penName":         "栏舍",
 
- 				"lact":            "胎次",
 
- 				"dayAge":          "日龄",
 
- 				"planDay":         "孕检日期",
 
- 				"checkTypeName":   "孕检名称",
 
- 				"status":          "状态",
 
- 				"matingTimes":     "配次",
 
- 				"calvingAtFormat": "产检日期",
 
- 				"matingAtFormat":  "配种日期",
 
- 				"matingAge":       "配后天数",
 
- 				"bullId":          "配种公牛",
 
- 			},
 
- 			List: newPregnancyCheckItems,
 
- 		},
 
- 	}, nil
 
- }
 
- func (s *StoreEntry) WeaningCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.WeaningItemsResponse, error) {
 
- 	weaningItems := make([]*pasturePb.WeaningItems, 0)
 
- 	count := int64(0)
 
- 	pref := s.DB.Table(fmt.Sprintf("%s as a", new(model.EventWeaning).TableName())).
 
- 		Select("a.*,b.day_age,c.name as pen_name").
 
- 		Joins("left join cow as b on a.cow_id = b.id").
 
- 		Joins("left join pen as c on a.before_pen_id = c.id").
 
- 		Where("b.admission_status = ?", pasturePb.AdmissionStatus_Admission).
 
- 		Where("a.pasture_id = ?", req.PastureId).
 
- 		Where("a.status = ?", pasturePb.IsShow_No)
 
- 	if req.EndDay != "" {
 
- 		dateTime := util.TimeParseLocalEndUnix(req.EndDay)
 
- 		pref.Where("a.plan_day <= ?", dateTime)
 
- 	}
 
- 	if req.Status > 0 {
 
- 		pref.Where("a.status = ?", req.Status)
 
- 	}
 
- 	if err := pref.Order("a.id desc").Count(&count).
 
- 		Limit(int(pagination.PageSize)).
 
- 		Offset(int(pagination.PageOffset)).
 
- 		Find(&weaningItems).Error; err != nil {
 
- 		return nil, xerr.WithStack(err)
 
- 	}
 
- 	return &pasturePb.WeaningItemsResponse{
 
- 		Code:    http.StatusOK,
 
- 		Message: "ok",
 
- 		Data: &pasturePb.WeaningItemsData{
 
- 			Total:    int32(count),
 
- 			Page:     pagination.Page,
 
- 			PageSize: pagination.PageSize,
 
- 			Header: map[string]string{
 
- 				"id":      "编号",
 
- 				"cowId":   "牛号",
 
- 				"penName": "栏舍",
 
- 				"planDay": "断奶日期",
 
- 				"dayAge":  "日龄",
 
- 				"status":  "状态",
 
- 			},
 
- 			List: weaningItems,
 
- 		},
 
- 	}, nil
 
- }
 
- func (s *StoreEntry) MatingCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.MatingItemsResponse, error) {
 
- 	matingItems := make([]*pasturePb.MatingItems, 0)
 
- 	count := int64(0)
 
- 	pref := s.DB.Table(fmt.Sprintf("%s as a", new(model.EventMating).TableName())).
 
- 		Select("a.id,a.cow_id,a.status,b.breed_status,b.cow_type,b.pen_id,b.day_age,b.calving_age,b.abortion_age,c.name as pen_name").
 
- 		Joins("left join cow as b on a.cow_id = b.id").
 
- 		Joins("left join pen as c on a.pen_id = c.id").
 
- 		Where("").
 
- 		Where("a.status = ?", pasturePb.IsShow_No)
 
- 	if req.EndDay != "" {
 
- 		dateTime := util.TimeParseLocalEndUnix(req.EndDay)
 
- 		pref.Where("a.plan_day <= ?", dateTime)
 
- 	}
 
- 	if req.PenId > 0 {
 
- 		pref.Where("a.pen_id = ?", req.PenId)
 
- 	}
 
- 	if req.Status > 0 {
 
- 		pref.Where("a.status = ?", req.Status)
 
- 	}
 
- 	if err := pref.Order("a.id desc").
 
- 		Count(&count).
 
- 		Limit(int(pagination.PageSize)).
 
- 		Offset(int(pagination.PageOffset)).
 
- 		Find(&matingItems).Error; err != nil {
 
- 		return nil, xerr.WithStack(err)
 
- 	}
 
- 	return &pasturePb.MatingItemsResponse{
 
- 		Code:    http.StatusOK,
 
- 		Message: "ok",
 
- 		Data: &pasturePb.MatingItemsData{
 
- 			Total:    int32(count),
 
- 			Page:     pagination.Page,
 
- 			PageSize: pagination.PageSize,
 
- 			Header: map[string]string{
 
- 				"id":              "编号",
 
- 				"cowId":           "牛号",
 
- 				"breedStatusName": "繁殖状态",
 
- 				"cowTypeName":     "牛只类型",
 
- 				"penName":         "栏舍",
 
- 				"lact":            "胎次",
 
- 				"calvingAge":      "产后天数",
 
- 				"abortionAge":     "流产天数",
 
- 				"dayAge":          "日龄",
 
- 				"status":          "状态",
 
- 			},
 
- 			List: matingItems,
 
- 		},
 
- 	}, nil
 
- }
 
- func (s *StoreEntry) CalvingCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.CalvingItemsResponse, error) {
 
- 	calvingItems := make([]*pasturePb.CalvingItems, 0)
 
- 	count := int64(0)
 
- 	pref := s.DB.Table(fmt.Sprintf("%s as a", new(model.EventCalving).TableName())).
 
- 		Select(`a.id,a.cow_id,a.status,b.breed_status,b.pen_id,DATE_FORMAT(FROM_UNIXTIME(last_mating_at), '%Y-%m-%d') AS mating_at_format,
 
- 		b.day_age,b.last_bull_number as bull_id,DATEDIFF(NOW(),FROM_UNIXTIME(last_mating_at)) AS mating_age,DATE_FORMAT(FROM_UNIXTIME(a.plan_day), '%Y-%m-%d') AS plan_day`).
 
- 		Joins("left join cow as b on a.cow_id = b.id").
 
- 		Where("b.admission_status = ?", pasturePb.AdmissionStatus_Admission)
 
- 	if req.EndDay != "" {
 
- 		dateTime := util.TimeParseLocalEndUnix(req.EndDay)
 
- 		pref.Where("a.plan_day <= ?", dateTime)
 
- 	}
 
- 	if req.Status > 0 {
 
- 		pref.Where("a.status = ?", req.Status)
 
- 	}
 
- 	if err := pref.Order("a.id desc").
 
- 		Count(&count).
 
- 		Limit(int(pagination.PageSize)).
 
- 		Offset(int(pagination.PageOffset)).
 
- 		Find(&calvingItems).Error; err != nil {
 
- 		return nil, xerr.WithStack(err)
 
- 	}
 
- 	breedStatusMap := s.CowBreedStatusMap()
 
- 	for _, v := range calvingItems {
 
- 		breedStatusName := ""
 
- 		if breedStatus, ok := breedStatusMap[v.BreedStatus]; ok {
 
- 			breedStatusName = breedStatus
 
- 		}
 
- 		v.BreedStatusName = breedStatusName
 
- 	}
 
- 	return &pasturePb.CalvingItemsResponse{
 
- 		Code:    http.StatusOK,
 
- 		Message: "ok",
 
- 		Data: &pasturePb.CalvingItemsData{
 
- 			Total:    int32(count),
 
- 			Page:     pagination.Page,
 
- 			PageSize: pagination.PageSize,
 
- 			Header: map[string]string{
 
- 				"id":              "编号",
 
- 				"cowId":           "牛号",
 
- 				"breedStatusName": "繁殖状态",
 
- 				"penName":         "栏舍",
 
- 				"lact":            "胎次",
 
- 				"matingAge":       "配后天数",
 
- 				"dayAge":          "日龄",
 
- 				"status":          "是否完成",
 
- 				"bullId":          "配种公牛号",
 
- 				"planDay":         "预产时间",
 
- 				"matingAtFormat":  "配种时间",
 
- 			},
 
- 			List: calvingItems,
 
- 		},
 
- 	}, nil
 
- }
 
- // WorkOrderCowList 暂时不处理工单业务
 
- func (s *StoreEntry) WorkOrderCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (interface{}, error) {
 
- 	return nil, nil
 
- }
 
- // TreatmentCowList 治疗清单
 
- func (s *StoreEntry) TreatmentCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (interface{}, error) {
 
- 	return nil, nil
 
- }
 
 
  |