interface.go 25 KB

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