interface.go 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. package backend
  2. import (
  3. "context"
  4. "kpt-pasture/config"
  5. "kpt-pasture/model"
  6. "kpt-pasture/service/asynqsvc"
  7. "kpt-pasture/service/httpclient"
  8. "kpt-pasture/service/wechat"
  9. "kpt-pasture/store/kptstore"
  10. "mime/multipart"
  11. pasturePb "gitee.com/xuyiping_admin/go_proto/proto/go/backend/cow"
  12. "gitee.com/xuyiping_admin/pkg/di"
  13. "go.uber.org/dig"
  14. )
  15. var Module = di.Options(di.Provide(NewStore))
  16. type Hub struct {
  17. dig.In
  18. OpsService KptService
  19. }
  20. type StoreEntry struct {
  21. dig.In
  22. Cfg *config.AppConfig
  23. DB *kptstore.DB
  24. WeChatClient *wechat.ClientService
  25. AsynqClient asynqsvc.Client
  26. HttpClient *httpclient.Service
  27. }
  28. func NewStore(store StoreEntry) KptService {
  29. return &store
  30. }
  31. func NewStoreEntry(cfg *config.AppConfig, Db *kptstore.DB) *StoreEntry {
  32. return &StoreEntry{
  33. Cfg: cfg,
  34. DB: Db,
  35. WeChatClient: nil,
  36. AsynqClient: nil,
  37. HttpClient: nil,
  38. }
  39. }
  40. //go:generate mockgen -destination mock/kptservice.go -package kptservicemock kpt-pasture/module/backend KptService
  41. type KptService interface {
  42. SystemService // 系统相关操作
  43. PastureManageService // 牧场管理相关
  44. ConfigDataService // 配置数据相关
  45. EventService // 事件相关
  46. CowService // 牛只相关
  47. GoodsService // 牧场物品相关
  48. AnalyseService // 分析相关
  49. DashboardService // 牧场统计相关
  50. WorkService // 日常工作相关
  51. MilkHallService // 奶厅数据相关
  52. UploadService // 上传文件相关
  53. WarningService // 预警相关
  54. FeedingService // 饲喂相关
  55. TestService // 测试相关
  56. }
  57. //go:generate mockgen -destination mock/SystemService.go -package kptservicemock kpt-pasture/module/backend SystemService
  58. type SystemService interface {
  59. // Login 系统用户相关
  60. Login(ctx context.Context, req *pasturePb.SearchUserRequest) (*pasturePb.SystemUserResponse, error)
  61. SearchSystemUserList(ctx context.Context, req *pasturePb.SearchUserRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchUserResponse, error)
  62. IsShowSystemUser(ctx context.Context, userId int64) error
  63. DeleteSystemUser(ctx context.Context, userId int64) error
  64. SystemUserCreateOrUpdate(ctx context.Context, req *pasturePb.SearchUserRequest) error
  65. ResetPasswordSystemUser(ctx context.Context, req *pasturePb.ResetUserPasswordRequest) error
  66. SystemUserRole(ctx context.Context, userId int64) (*pasturePb.SystemUserRoleResponse, error)
  67. SystemUserRoleSave(ctx context.Context, req *pasturePb.SystemUserRoleRequest) error
  68. // GetSystemUserMenu 当前登录用户菜单权限
  69. GetSystemUserMenu(ctx context.Context) (*pasturePb.SystemUserMenuTreeResponse, error)
  70. // SearchSystemRoleList 系统角色相关
  71. SearchSystemRoleList(ctx context.Context, req *pasturePb.SearchRoleRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchRoleResponse, error)
  72. DeleteSystemRole(ctx context.Context, roleId int64) error
  73. IsShowSystemRole(ctx context.Context, roleId int64) error
  74. SystemRoleCreateOrUpdate(ctx context.Context, req *pasturePb.SearchRoleRequest) error
  75. GetRoleMenuList(ctx context.Context, roleId int64) (*pasturePb.SystemRoleMenuResponse, error)
  76. RoleMenuSave(ctx context.Context, res *pasturePb.SystemRoleMenuRequest) error
  77. SystemRoleList(ctx context.Context) (*pasturePb.GetRoleListResponse, error)
  78. // SearchSystemMenuList 系统菜单权限
  79. SearchSystemMenuList(ctx context.Context, req *pasturePb.SearchMenuRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchMenuResponse, error)
  80. SystemMenuTree(ctx context.Context, req *pasturePb.SearchMenuRequest) (*pasturePb.SystemMenuTreeResponse, error)
  81. // SearchSystemDeptList 部门列表
  82. SearchSystemDeptList(ctx context.Context, req *pasturePb.SearchDeptRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchDeptResponse, error)
  83. SystemDepthDelete(ctx context.Context, id int64) error
  84. SystemDeptCreateOrUpdate(ctx context.Context, req *pasturePb.SearchDeptRequest) error
  85. SystemDeptTree(ctx context.Context, req *pasturePb.SearchDeptRequest) (*pasturePb.DeptTreeResponse, error)
  86. // SearchUserPastureList 用户相关牧场列表
  87. SearchUserPastureList(ctx context.Context) (*pasturePb.SystemUserPastureListResponse, error)
  88. }
  89. //go:generate mockgen -destination mock/PastureManageService.go -package kptservicemock kpt-pasture/module/backend PastureManageService
  90. type PastureManageService interface {
  91. SearchBarnList(ctx context.Context, req *pasturePb.SearchNameRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchBarnResponse, error)
  92. CreateOrUpdateBarn(ctx context.Context, req *pasturePb.SearchBarnList) error
  93. SearchBarnTypeList(ctx context.Context, req *pasturePb.SearchNameRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchBaseConfigResponse, error)
  94. CreateOrUpdateBarnType(ctx context.Context, req *pasturePb.SearchBaseConfigList) error
  95. SearchBreedStatusList(ctx context.Context, req *pasturePb.SearchNameRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchBaseConfigResponse, error)
  96. CreateOrUpdateBreedStatus(ctx context.Context, req *pasturePb.SearchBaseConfigList) error
  97. SearchCowKindList(ctx context.Context, req *pasturePb.SearchNameRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchBaseConfigResponse, error)
  98. CreateOrUpdateCowKind(ctx context.Context, req *pasturePb.SearchBaseConfigList) error
  99. SearchCowStatusList(ctx context.Context, req *pasturePb.SearchNameRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchBaseConfigResponse, error)
  100. CreateOrUpdateCowStatus(ctx context.Context, req *pasturePb.SearchBaseConfigList) error
  101. SearchCowTypeList(ctx context.Context, req *pasturePb.SearchNameRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchBaseConfigResponse, error)
  102. CreateOrUpdateCowType(ctx context.Context, req *pasturePb.SearchBaseConfigList) error
  103. SearchTransferPenReasonList(ctx context.Context, req *pasturePb.SearchNameRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchBaseConfigResponse, error)
  104. CreateOrUpdateTransferPenReason(ctx context.Context, req *pasturePb.SearchBaseConfigList) error
  105. SearchCowSourceList(ctx context.Context, req *pasturePb.SearchNameRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchBaseConfigResponse, error)
  106. CreateOrUpdateCowSource(ctx context.Context, req *pasturePb.SearchBaseConfigList) error
  107. CreateOrUpdateSameTime(ctx context.Context, req *pasturePb.SearchSameTimeList) error
  108. SearchSameTimeList(ctx context.Context, req *pasturePb.SearchNameRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SameTimeResponse, error)
  109. SameTimeIsShow(ctx context.Context, id int64) error
  110. SearchDiseaseTypeList(ctx context.Context, req *pasturePb.SearchNameRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchBaseConfigResponse, error)
  111. CreateOrUpdateDiseaseType(ctx context.Context, req *pasturePb.SearchBaseConfigList) error
  112. SearchDiseaseList(ctx context.Context, req *pasturePb.SearchDiseaseRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchDiseaseResponse, error)
  113. CreateOrUpdateDisease(ctx context.Context, req *pasturePb.SearchDiseaseList) error
  114. SearchPrescriptionList(ctx context.Context, req *pasturePb.SearchPrescriptionRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchPrescriptionResponse, error)
  115. CreateOrUpdatePrescription(ctx context.Context, req *pasturePb.PrescriptionRequest) error
  116. PrescriptionDetail(ctx context.Context, id int64) (*pasturePb.PrescriptionDetailResponse, error)
  117. ImmunizationSetList(ctx context.Context, req *pasturePb.ImmunizationRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchImmunizationResponse, error)
  118. CreatedOrUpdateImmunization(ctx context.Context, req *pasturePb.ImmunizationRequest) error
  119. ImmunizationIsShow(ctx context.Context, id int64) error
  120. CreateOrUpdateDealer(crx context.Context, req *pasturePb.DealerItem) error
  121. SearchDealerList(crx context.Context, req *pasturePb.SearchNameRequest) (*pasturePb.SearchDealerResponse, error)
  122. DeleteDealer(crx context.Context, id int64) error
  123. SystemBasicEdit(ctx context.Context, req *pasturePb.BaseDataConfigBatch) error
  124. SystemBasicList(ctx context.Context) (*pasturePb.SearchBaseDataConfigResponse, error)
  125. }
  126. //go:generate mockgen -destination mock/ConfigDataService.go -package kptservicemock kpt-pasture/module/backend ConfigDataService
  127. type ConfigDataService interface {
  128. BarnTypeOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error)
  129. BarnListOptions(ctx context.Context, penType int, isAll string) (*pasturePb.ConfigOptionsListResponse, error)
  130. BreedStatusOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error)
  131. CowKindOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error)
  132. CowSourceOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error)
  133. CowTypeOptions(ctx context.Context, optionName, isAll string) (*pasturePb.ConfigOptionsListResponse, error)
  134. CowTransferPenReasonOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error)
  135. SystemUserOptions(ctx context.Context, depName string) (*pasturePb.ConfigOptionsListResponse, error)
  136. BullOptions(ctx context.Context) (*pasturePb.BullOptionsListResponse, error)
  137. SystemBaseConfigOptions(ctx context.Context, optionName, isAll string) (*pasturePb.ConfigOptionsListResponse, error)
  138. DiseaseTypeOptions(ctx context.Context, isChildren string) (*pasturePb.ConfigOptionsListResponse, error)
  139. DiseaseOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error)
  140. PrescriptionOptions(ctx context.Context) (*pasturePb.ConfigOptionsListResponse, error)
  141. FindCowHistoryBatchNumber(ctx context.Context) (*model.HistoryBatchNumberResponse, error)
  142. GenerateBatchNumber(ctx context.Context) (*model.GenerateBatchNumberResponse, error)
  143. }
  144. //go:generate mockgen -destination mock/EventService.go -package kptservicemock kpt-pasture/module/backend EventService
  145. type EventService interface {
  146. // EnterList 入场列表
  147. EnterList(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchEnterEventResponse, error)
  148. CreateEnter(ctx context.Context, req *pasturePb.EventEnterRequest) error
  149. // GroupTransferList 转群
  150. GroupTransferList(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchTransferGroupEventResponse, error)
  151. CreateGroupTransfer(ctx context.Context, req *pasturePb.TransferGroupEventRequest) error
  152. // BodyScoreList 体况评分
  153. BodyScoreList(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchBodyScoreEventResponse, error)
  154. CreateBodyScore(ctx context.Context, req *pasturePb.BodyScoreEventRequest) error
  155. // CalvingList 分娩
  156. CalvingList(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchLavingEventResponse, error)
  157. CalvingCreate(ctx context.Context, req *pasturePb.EventCalving) error
  158. // PregnantCheckList 孕检
  159. PregnantCheckList(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.EventPregnantCheckResponse, error)
  160. PregnantCheckCreateBatch(ctx context.Context, req *pasturePb.EventPregnantCheckBatch) error
  161. // MatingList 配种
  162. MatingList(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.EventMatingResponse, error)
  163. MatingBatch(ctx context.Context, req *pasturePb.EventMatingBatch) error
  164. // EstrusBatchMating 发情批量处理配种
  165. EstrusBatchMating(ctx context.Context, req *pasturePb.EventEstrusBatch) error
  166. EstrusList(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchEventEstrusResponse, error)
  167. // AbortionList 流产
  168. AbortionList(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.EventAbortionResponse, error)
  169. AbortionCreateBatch(ctx context.Context, req *pasturePb.EventAbortionBatch) error
  170. // DryMilkList 干奶
  171. DryMilkList(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.EventMilkResponse, error)
  172. DryMilkBatch(ctx context.Context, req *pasturePb.EventMilkBatch) error
  173. // ForbiddenMatingBatch 禁配
  174. ForbiddenMatingBatch(ctx context.Context, req *pasturePb.EventForbiddenMatingBatch) error
  175. ForbiddenMatingList(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.EventForbiddenMatingResponse, error)
  176. UnForbiddenMating(ctx context.Context, req *pasturePb.EventUnForbiddenMatingRequest) error
  177. // WeaningBatch 断奶
  178. WeaningBatch(ctx context.Context, req *pasturePb.EventWeaningBatch) error
  179. // SameTimeCreate 同期
  180. SameTimeCreate(ctx context.Context, req *pasturePb.EventSameTime) error
  181. SameTimeBatch(ctx context.Context, req *pasturePb.EventSameTimeBatch) error
  182. SameTimeList(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchSameTimeResponse, error)
  183. // WeightList 称重
  184. WeightList(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchWeightEventResponse, error)
  185. WeightBatch(ctx context.Context, req *pasturePb.BatchEventWeight) error
  186. // CowDiseaseCreate 提交发病牛只
  187. CowDiseaseCreate(ctx context.Context, req *pasturePb.EventCowDiseaseRequest, source string) error
  188. // CowDiseaseDiagnose 诊断
  189. CowDiseaseDiagnose(ctx context.Context, req *pasturePb.CowDiagnosedRequest) error
  190. // CowDiseaseTreatment 治疗
  191. CowDiseaseTreatment(ctx context.Context, req *pasturePb.CowTreatmentRequest) error
  192. // DiseaseSuggestPrescription 疾病推荐处方
  193. DiseaseSuggestPrescription(ctx context.Context, diseaseId int64) (*pasturePb.ConfigOptionsListResponse, error)
  194. // CowDiseaseTreatmentDetail 治疗详情
  195. CowDiseaseTreatmentDetail(ctx context.Context, req *pasturePb.EventCowTreatmentDetailRequest, pagination *pasturePb.PaginationModel) (*pasturePb.EventCowTreatmentDetailResponse, error)
  196. // CowDiseaseCurable 治愈
  197. CowDiseaseCurable(ctx context.Context, req *pasturePb.EventCowCurableRequest) error
  198. // DeathBatch 死亡
  199. DeathBatch(ctx context.Context, req *pasturePb.EventDeathBatch) error
  200. DeathList(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.EventDeathResponse, error)
  201. // CowEarNumberUpdate 修改耳号
  202. CowEarNumberUpdate(ctx context.Context, req *pasturePb.EventReplaceEarNumber) error
  203. // SubmitEventLog 记录提交事件结果日志
  204. SubmitEventLog(ctx context.Context, pastureId int64, cow *model.Cow, eventType pasturePb.EventType_Kind, req interface{}) *model.EventCowLog
  205. // CowSaleCreate 销售
  206. CowSaleCreate(ctx context.Context, req *pasturePb.EventCowSale) error
  207. CowSaleList(ctx context.Context, req *pasturePb.EventCowSaleRequest, pagination *pasturePb.PaginationModel) (*pasturePb.EventCowSaleResponse, error)
  208. // ImmunizationBatch 免疫事件相关
  209. ImmunizationBatch(ctx context.Context, req *pasturePb.ImmunizationItem) error
  210. ImmunizationList(ctx context.Context, req *pasturePb.SearchEventImmunizationRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchEventImmunizationResponse, error)
  211. }
  212. //go:generate mockgen -destination mock/CowService.go -package kptservicemock kpt-pasture/module/backend CowService
  213. type CowService interface {
  214. Detail(ctx context.Context, req *pasturePb.SearchEventRequest) (*pasturePb.CowInfoResponse, error)
  215. List(ctx context.Context, req *pasturePb.SearchEventRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchCowListResponse, error)
  216. EventList(ctx context.Context, req *pasturePb.SearchCowEventListRequest, pagination *pasturePb.PaginationModel) (*pasturePb.CowEventListResponse, error)
  217. BehaviorCurve(ctx context.Context, req *pasturePb.CowBehaviorCurveRequest) (*model.CowBehaviorCurveResponse, error)
  218. CowGrowthCurve(ctx context.Context, req *pasturePb.CowGrowthCurveRequest) (*pasturePb.CowGrowthCurveResponse, error)
  219. CowLactCurve(ctx context.Context, req *pasturePb.CowLactCurveRequest) (*pasturePb.CowLactCurveResponse, error)
  220. BehaviorRate(ctx context.Context, req *pasturePb.CowBehaviorRateRequest) (*pasturePb.CowBehaviorRateResponse, error)
  221. IndicatorsComparison(ctx context.Context, req *pasturePb.IndicatorsComparisonRequest) (*model.IndicatorsComparisonResponse, error)
  222. LongTermInfertility(ctx context.Context, req *pasturePb.LongTermInfertilityRequest, pagination *pasturePb.PaginationModel) (*pasturePb.LongTermInfertilityResponse, error)
  223. AlreadySale(ctx context.Context, req *pasturePb.AlreadySalesReportRequest, pagination *pasturePb.PaginationModel) (*pasturePb.AlreadySalesReportResponse, error)
  224. CanSale(ctx context.Context, req *pasturePb.CanSalesReportRequest, pagination *pasturePb.PaginationModel) (*pasturePb.CanSalesReportResponse, error)
  225. }
  226. //go:generate mockgen -destination mock/GoodsService.go -package kptservicemock kpt-pasture/module/backend GoodsService
  227. type GoodsService interface {
  228. // FrozenSemenList 冻精
  229. FrozenSemenList(ctx context.Context, req *pasturePb.FrozenSemenRequest, pagination *pasturePb.PaginationModel) (*pasturePb.FrozenSemenResponse, error)
  230. FrozenSemenCreate(ctx context.Context, req *pasturePb.SearchFrozenSemenList) error
  231. // DrugsList 药品
  232. DrugsList(ctx context.Context, req *pasturePb.SearchDrugsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchDrugsResponse, error)
  233. DrugsCreateOrUpdate(ctx context.Context, req *pasturePb.SearchDrugsList) error
  234. // MedicalEquipmentList 医疗设备
  235. MedicalEquipmentList(ctx context.Context, req *pasturePb.SearchMedicalEquipmentRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchMedicalEquipmentResponse, error)
  236. MedicalEquipmentCreateOrUpdate(ctx context.Context, req *pasturePb.SearchMedicalEquipmentList) error
  237. // NeckRingList 脖环相关
  238. NeckRingList(ctx context.Context, req *pasturePb.SearchNeckRingRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchNeckRingResponse, error)
  239. NeckRingCreateOrUpdate(ctx context.Context, req *pasturePb.NeckRingCreateRequest) error
  240. // OutboundApply 出库申请
  241. OutboundApply(ctx context.Context, req *pasturePb.OutboundApplyItem) error
  242. OutboundList(ctx context.Context, req *pasturePb.SearchOutboundApplyRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchOutboundApplyResponse, error)
  243. OutboundAudit(ctx context.Context, req *pasturePb.OutboundApplyAuditRequest) error
  244. OutboundDetail(ctx context.Context, id int64) (*pasturePb.OutboundDetailResponse, error)
  245. OutboundDelete(ctx context.Context, id int64) error
  246. }
  247. //go:generate mockgen -destination mock/AnalyseService.go -package kptservicemock kpt-pasture/module/backend AnalyseService
  248. type AnalyseService interface {
  249. WeightScatterPlot(ctx context.Context, req *pasturePb.SearchGrowthCurvesRequest, pagination *pasturePb.PaginationModel) (*pasturePb.GrowthCurvesResponse, error)
  250. WeightRange(ctx context.Context, req *pasturePb.WeightRangeRequest, pagination *pasturePb.PaginationModel) (*pasturePb.WeightRangeResponse, error)
  251. MatingTimely(ctx context.Context, req *pasturePb.MatingTimelyRequest) (*model.MatingTimelyResponse, error)
  252. PenWeight(ctx context.Context, req *pasturePb.PenWeightRequest, pagination *pasturePb.PaginationModel) (*pasturePb.PenWeightResponse, error)
  253. AbortionRate(ctx context.Context, req *pasturePb.AbortionRateRequest) (*pasturePb.AbortionRateResponse, error)
  254. TwentyOnePregnantRate(ctx context.Context, req *pasturePb.TwentyOnePregnantRateRequest) (*pasturePb.TwentyOnePregnantRateResponse, error)
  255. TwentyOnePregnantDetail(ctx context.Context, req *pasturePb.TwentyOnePregnantDetailsRequest) (*pasturePb.TwentyOnePregnantDetailsResponse, error)
  256. PregnancyReport(ctx context.Context, req *pasturePb.PregnancyReportRequest, pagination *pasturePb.PaginationModel) (*pasturePb.PregnancyReportResponse, error)
  257. CalvingReport(ctx context.Context, req *pasturePb.CalvingReportRequest) (*pasturePb.CalvingReportResponse, error)
  258. DiseaseCureReport(ctx context.Context, req *pasturePb.DiseaseCureRateRequest) (*pasturePb.DiseaseCureRateResponse, error)
  259. SaleCowReport(ctx context.Context, req *pasturePb.SaleCowReportRequest) (*pasturePb.SaleCowReportResponse, error)
  260. SingleFactorInfantSurvivalRateAnalysis(ctx context.Context, req *pasturePb.SingleFactorPregnancyRateRequest) (*pasturePb.SingleFactorPregnancyRateResponse, error)
  261. MultipleFactorAnalysis(ctx context.Context, req *pasturePb.MultiFactorPregnancyRateRequest) (*model.MultiFactorPregnancyRateResponse, error)
  262. PenBehavior(ctx context.Context, req *pasturePb.BarnBehaviorCurveRequest) (*pasturePb.BarnBehaviorCurveResponse, error)
  263. PenBehaviorDaily(ctx context.Context, req *pasturePb.BarnMonitorRequest) (*model.BarnMonitorResponse, error)
  264. CowBehaviorDistribution(ctx context.Context, req *pasturePb.CowBehaviorDistributionRequest) (*pasturePb.CowBehaviorDistributionResponse, error)
  265. }
  266. //go:generate mockgen -destination mock/DashboardService.go -package kptservicemock kpt-pasture/module/backend DashboardService
  267. type DashboardService interface {
  268. NeckRingWarning(ctx context.Context) (*pasturePb.IndexNeckRingResponse, error)
  269. FocusIndicatorsList(ctx context.Context, dimension string) (*pasturePb.IndexFocusIndicatorsResponse, error)
  270. FocusIndicatorsSet(ctx context.Context, req *pasturePb.IndexFocusIndicatorsSetRequest) error
  271. DataWarningSet(ctx context.Context, req *pasturePb.IndexDataWarningSetRequest) error
  272. DataWarningList(ctx context.Context) (*pasturePb.IndexDataWarningResponse, error)
  273. DataWarningPop(ctx context.Context, req *pasturePb.WarningDataListRequest, pagination *pasturePb.PaginationModel) (*model.WarningDataPopResponse, error)
  274. CalendarToDoCount(ctx context.Context) (*pasturePb.TodoCountResponse, error)
  275. Equipment(ctx context.Context) (*pasturePb.EquipmentResponse, error)
  276. OutNumber(ctx context.Context) (*pasturePb.OutNumberResponse, error)
  277. }
  278. //go:generate mockgen -destination mock/WorkService.go -package kptservicemock kpt-pasture/module/backend WorkService
  279. type WorkService interface {
  280. OrderList(ctx context.Context, req *pasturePb.SearchWorkOrderRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SearchWorkOrderResponse, error)
  281. OrderCreateOrUpdate(ctx context.Context, req *pasturePb.WorkOrderList) error
  282. OrderIsShow(ctx context.Context, id int64) error
  283. UserWorkOrderList(ctx context.Context, workOrderStatus pasturePb.WorkOrderStatus_Kind, pagination *pasturePb.PaginationModel) (*pasturePb.UserWorkOrderResponse, error)
  284. // CalendarList 日历相关
  285. CalendarList(ctx context.Context, req *pasturePb.CalendarRequest) (*pasturePb.CalendarResponse, error)
  286. CalendarToDoList(ctx context.Context, req *pasturePb.CalendarToDoRequest, pagination *pasturePb.PaginationModel) (*pasturePb.CalendarToDoResponse, error)
  287. CalendarTableDetail(ctx context.Context, req *pasturePb.CalendarTableRequest, pagination *pasturePb.PaginationModel) (interface{}, error)
  288. // SameTimeCowList 清单相关
  289. SameTimeCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.SameTimeItemResponse, error)
  290. ImmunisationCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.ImmunizationItemsResponse, error)
  291. PregnancyCheckCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.PregnancyCheckItemsResponse, error)
  292. WeaningCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.WeaningItemsResponse, error)
  293. MatingCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.MatingItemsResponse, error)
  294. CalvingCowList(ctx context.Context, req *pasturePb.ItemsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.CalvingItemsResponse, error)
  295. CowDiseaseList(ctx context.Context, req *pasturePb.SearchEventCowTreatmentRequest, pagination *pasturePb.PaginationModel) (*pasturePb.EventCowDiseaseResponse, error)
  296. // TaskDetail 任务明细详情
  297. TaskDetail(ctx context.Context, req *pasturePb.CalendarToDoRequest, pagination *pasturePb.PaginationModel) (*pasturePb.TaskDetailResponse, error)
  298. }
  299. type WarningService interface {
  300. NeckRingWarningEstrusOrAbortionCowList(ctx context.Context, req *pasturePb.WarningItemsRequest, pagination *pasturePb.PaginationModel) (*pasturePb.EstrusResponse, error)
  301. NeckRingWarningHealthCowList(ctx context.Context, req *pasturePb.HealthWarningRequest, pagination *pasturePb.PaginationModel) (*pasturePb.HealthWarningResponse, error)
  302. NeckRingNoEstrusBatch(ctx context.Context, req *pasturePb.NeckRingNoEstrusBatchRequest) error
  303. NeckRingNoDiseaseBatch(ctx context.Context, req *pasturePb.NeckRingNoEstrusBatchRequest) error
  304. DataNoticeDetail(ctx context.Context) *model.DataNoticeResponse
  305. DataNoticeKnown(ctx context.Context, dataNoticeId int64) error
  306. }
  307. type MilkHallService interface {
  308. MilkHallOriginal(ctx context.Context, req []byte) error
  309. }
  310. type UploadService interface {
  311. Photos(ctx context.Context, files []*multipart.FileHeader) ([]string, error)
  312. ImportExcel(ctx context.Context, data [][]string) error
  313. ImportExcel2(ctx context.Context, data [][]string, excelHeader []string) error
  314. }
  315. type FeedingService interface {
  316. GetFeedingHomepage(ctx context.Context, req *pasturePb.FeedingHomepageRequest) (*pasturePb.FeedingHomepageResponse, error)
  317. GetFeedingManagement(ctx context.Context, req *pasturePb.FeedingManagementRequest) (*pasturePb.FeedingManagementResponse, error)
  318. }
  319. type TestService interface {
  320. CowNeckRingNumberBound(ctx context.Context, pagination *pasturePb.PaginationModel) error
  321. CowNeckRingNumberBound2(ctx context.Context, pagination *pasturePb.PaginationModel) error
  322. UpdateCowPen(ctx context.Context, pagination *pasturePb.PaginationModel) error
  323. TestDataWaring(ctx context.Context, userId int64) error
  324. NeckRingOriginalAsync(ctx context.Context, pastureId int64, pagination *pasturePb.PaginationModel) error
  325. PastureInit(ctx context.Context, pastureId int64) error
  326. AdmissionAge(ctx context.Context) error
  327. CalvingAge(ctx context.Context) error
  328. SystemMenuInit(ctx context.Context) error
  329. }