interface.go 25 KB

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