123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385 |
- package backend
- import (
- "context"
- "kpt-pasture/model"
- pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
- )
- func (s *StoreEntry) OutReasonEnumList(isAll string) []*pasturePb.ConfigOptionsList {
- configOptions := make([]*pasturePb.ConfigOptionsList, 0)
- if isAll == model.IsAllYes {
- configOptions = append(configOptions,
- &pasturePb.ConfigOptionsList{
- Value: int32(0),
- Label: "全部",
- Disabled: true,
- })
- }
- configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Respiratory_System_Disease),
- Label: "呼吸系统疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Nutritional_Metabolic_Disease),
- Label: "营养代谢疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Breeding_Disease),
- Label: "繁殖疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Breast_Disease),
- Label: "乳房疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Long_Term_infertility),
- Label: "久配不孕",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Multiple_Miscarriages),
- Label: "多次流产",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Long_Treatment_Without_Recovery),
- Label: "久治不愈",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Postpartum_Paralysis),
- Label: "产后瘫痪",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Mastitis),
- Label: "乳房炎",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Hoof_Disease),
- Label: "蹄病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Congenital_Malformation),
- Label: "先天畸形",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Congenital_Malformation),
- Label: "先天畸形",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Dysplasia),
- Label: "发育不良",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Hernia),
- Label: "疝气",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Excessive_Age),
- Label: "月龄过大",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Excessive_Age),
- Label: "月龄过大",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Excessive_Weight),
- Label: "体重过肥",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Other_Disease),
- Label: "其他疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Weak_Child),
- Label: "弱仔",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Obsessive_Bull),
- Label: "恶癖牛",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Low_Milk),
- Label: "低产",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Slow_Growing),
- Label: "生长缓慢",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Other),
- Label: "其他",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Unknown),
- Label: "未知原因",
- Disabled: true,
- })
- return configOptions
- }
- func (s *StoreEntry) DeathReasonEnumList(isAll string) []*pasturePb.ConfigOptionsList {
- configOptions := make([]*pasturePb.ConfigOptionsList, 0)
- if isAll == model.IsAllYes {
- configOptions = append(configOptions,
- &pasturePb.ConfigOptionsList{
- Value: int32(0),
- Label: "全部",
- Disabled: true,
- })
- }
- configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Digestive_System_Diseases),
- Label: "消化性疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Respiratory_System_Diseases),
- Label: "呼吸性疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Reproductive_System_Diseases),
- Label: "繁殖性疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Metabolic_System_Diseases),
- Label: "代谢性疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Infectious_Diseases),
- Label: "传染性疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Difficult_Birth),
- Label: "难产",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Accident_Dead),
- Label: "意外死亡",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Stress),
- Label: "应激",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Trauma),
- Label: "外伤",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Pneumonia),
- Label: "肺炎",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Diarrhea),
- Label: "腹泻",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Ketosis),
- Label: "酮症",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Acidosis),
- Label: "酸中毒",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Rumina_Impaction),
- Label: "瘤胃积食",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Intestinal_Torsion),
- Label: "肠扭转",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathReason_Other),
- Label: "其他",
- Disabled: true,
- })
- return configOptions
- }
- func (s *StoreEntry) MatingResultEnumList(isAll string) []*pasturePb.ConfigOptionsList {
- configOptions := make([]*pasturePb.ConfigOptionsList, 0)
- if isAll == model.IsAllYes {
- configOptions = append(configOptions,
- &pasturePb.ConfigOptionsList{
- Value: int32(0),
- Label: "全部",
- Disabled: true,
- })
- }
- configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.MatingResult_Unknown),
- Label: "未知",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.MatingResult_ReMatch),
- Label: "复配",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.MatingResult_Pregnant),
- Label: "怀孕",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.MatingResult_Empty),
- Label: "空怀",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.MatingResult_Abort),
- Label: "流产",
- Disabled: true,
- })
- return configOptions
- }
- func (s *StoreEntry) EventCategoryEnumList(isAll string) []*pasturePb.ConfigOptionsList {
- configOptions := make([]*pasturePb.ConfigOptionsList, 0)
- if isAll == model.IsAllYes {
- configOptions = append(configOptions,
- &pasturePb.ConfigOptionsList{
- Value: int32(0),
- Label: "全部",
- Disabled: true,
- })
- }
- configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.EventCategory_Base),
- Label: "基础事件",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.EventCategory_Breed),
- Label: "繁殖事件",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.EventCategory_Health),
- Label: "兽医事件",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.EventCategory_Other),
- Label: "其他事件",
- Disabled: true,
- })
- return configOptions
- }
- func (s *StoreEntry) IndicatorsDetailsList(isAll string) []*pasturePb.ConfigOptionsList {
- configOptions := make([]*pasturePb.ConfigOptionsList, 0)
- if isAll == model.IsAllYes {
- configOptions = append(configOptions,
- &pasturePb.ConfigOptionsList{
- Value: int32(0),
- Label: "全部",
- Disabled: true,
- })
- }
- indicatorsDetailsList, _ := s.FindIndicatorsDetailsList(context.Background())
- if len(indicatorsDetailsList) <= 0 {
- return configOptions
- }
- for _, v := range indicatorsDetailsList {
- configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
- Label: v.Name,
- Disabled: true,
- Props: v.Kind,
- })
- }
- return configOptions
- }
- func (s *StoreEntry) CowPurposeList(isAll string) []*pasturePb.ConfigOptionsList {
- configOptions := make([]*pasturePb.ConfigOptionsList, 0)
- if isAll == model.IsAllYes {
- configOptions = append(configOptions,
- &pasturePb.ConfigOptionsList{
- Value: int32(0),
- Label: "全部",
- Disabled: true,
- })
- }
- configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.Purpose_Breeding),
- Label: "繁殖",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.Purpose_Fatten),
- Label: "育肥",
- Disabled: true,
- })
- return configOptions
- }
- func (s *StoreEntry) CowOutReasonList(isAll string) []*pasturePb.ConfigOptionsList {
- configOptions := make([]*pasturePb.ConfigOptionsList, 0)
- if isAll == model.IsAllYes {
- configOptions = append(configOptions,
- &pasturePb.ConfigOptionsList{
- Value: int32(0),
- Label: "全部",
- Disabled: true,
- })
- }
- configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Respiratory_System_Disease),
- Label: "呼吸系统疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Nutritional_Metabolic_Disease),
- Label: "营养代谢疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Breeding_Disease),
- Label: "繁殖疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Breast_Disease),
- Label: "乳房疾病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Hoof_Disease),
- Label: "蹄病",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Low_Milk),
- Label: "低产",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Slow_Growing),
- Label: "生长缓慢",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Slow_Growing),
- Label: "生长缓慢",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.OutReasons_Other),
- Label: "其他原因",
- Disabled: true,
- })
- return configOptions
- }
- func (s *StoreEntry) CowDeathDestinationList(isAll string) []*pasturePb.ConfigOptionsList {
- configOptions := make([]*pasturePb.ConfigOptionsList, 0)
- if isAll == model.IsAllYes {
- configOptions = append(configOptions,
- &pasturePb.ConfigOptionsList{
- Value: int32(0),
- Label: "全部",
- Disabled: true,
- })
- }
- configOptions = append(configOptions, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathDestination_NuisanceLess),
- Label: "无公害处理",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathDestination_Slaughterhouse),
- Label: "屠宰场",
- Disabled: true,
- }, &pasturePb.ConfigOptionsList{
- Value: int32(pasturePb.DeathDestination_Other),
- Label: "其他",
- Disabled: true,
- })
- return configOptions
- }
|