IAdminService.cs 91 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986
  1. using AIPlatform.Protocol.Entities;
  2. using AIPlatform.Protocol.Entities.Ventilator;
  3. using AIPlatform.Protocol.Model;
  4. using System;
  5. using System.Collections.Generic;
  6. using System.Threading.Tasks;
  7. namespace AIPlatform.Protocol.Services
  8. {
  9. public interface IAdminService
  10. {
  11. /// <summary>
  12. /// Login the system with admin name and password.
  13. /// </summary>
  14. /// <param name="name">The name of the admin</param>
  15. /// <param name="password">The password of the admin</param>
  16. /// <returns>The login result</returns>
  17. Task<AdminLoginResult> LoginAsync(string name, string password);
  18. /// <summary>
  19. /// SeniorLabeler login to the system to check the labeler statistics
  20. /// </summary>
  21. /// <param name="name">The name of the senior labeler</param>
  22. /// <param name="password">The password of the senior labeler</param>
  23. /// <returns>The login result.</returns>
  24. Task<LabelerLoginResult> SeniorLabelerLoginAsync(string name, string password);
  25. /// <summary>
  26. /// Logoff from system.
  27. /// </summary>
  28. /// <param name="sessionId">The session id.</param>
  29. /// <returns></returns>
  30. Task LogOff(long sessionId);
  31. #region organization management
  32. /// <summary>
  33. /// Get all organizations from system
  34. /// </summary>
  35. /// <param name="sessionId">The session of current admin</param>
  36. /// <returns>The loaded organizations.</returns>
  37. Task<List<Organization>> GetOrganizationsAsync(long sessionId);
  38. /// <summary>
  39. /// Get all organizations from system
  40. /// </summary>
  41. /// <param name="pageIndex">The index of page.</param>
  42. /// <param name="pageSize">The item count per page.</param>
  43. /// <param name="keyword">The searched key word.</param>
  44. /// <returns>The loaded organizations.</returns>
  45. Task<List<Organization>> GetOrganizationsAsync(long sessionId, int pageIndex, int pageSize, string keyword);
  46. /// <summary>
  47. /// Get total organization count.
  48. /// </summary>
  49. /// <param name="keyword">The searched key word.</param>
  50. /// <returns>The organization count.</returns>
  51. Task<int> GetOrganizationCountAsync(long sessionId, string keyword);
  52. /// <summary>
  53. /// Create an organization
  54. /// </summary>
  55. /// <param name="name">The name of the organization.</param>
  56. /// <param name="description">The description of the organization.</param>
  57. /// <returns></returns>
  58. Task<Organization> CreateOrganizationAsync(long sessionId, string name, string description, List<AuthorityBase> authorities, List<SupportedDataType> supportedDataTypes);
  59. /// <summary>
  60. /// Delete an organization from the system.
  61. /// </summary>
  62. /// <returns>Void</returns>
  63. Task DeleteOrganizationAsync(long sessionId, long id);
  64. /// <summary>
  65. /// Check whether there are children in the organization.
  66. /// </summary>
  67. /// <param name="id">The id of organization.</param>
  68. /// <returns>The loaded organizations.</returns>
  69. Task<bool> ExistOrganizationChildrenAsync(long sessionId, long id);
  70. /// <summary>
  71. /// 检查组织下是否已绑定用户
  72. /// </summary>
  73. /// <param name="organizationId"></param>
  74. /// <returns></returns>
  75. Task<bool> ExistAccountByOrganizationAsync(long sessionId, long organizationId);
  76. /// <summary>
  77. /// Update one organization.
  78. /// </summary>
  79. /// <param name="id">The id of organization.</param>
  80. /// <param name="description">The description of the organization.</param>
  81. /// <returns>Void</returns>
  82. Task UpdateOrganizationAsync(long sessionId, long id, string description, List<AuthorityBase> authorities, List<SupportedDataType> supportedDataTypes);
  83. #endregion organization management
  84. #region 机构管理
  85. /// <summary>
  86. /// Get the Institution from system
  87. /// </summary>
  88. /// <returns>The loaded Institution.</returns>
  89. Task<Institution> GetInstitutionAsync(long sessionId, long id);
  90. /// <summary>
  91. /// Get the Institutions by organizationId
  92. /// </summary>
  93. /// <returns>The loaded Institutions.</returns>
  94. Task<List<Institution>> GetInstitutionsByOrganizationIdAsync(long sessionId, long organizationId);
  95. /// <summary>
  96. /// Get all Institutions from system
  97. /// </summary>
  98. /// <param name="pageIndex">The index of page.</param>
  99. /// <param name="pageSize">The item count per page.</param>
  100. /// <param name="keyword">The searched key word.</param>
  101. /// <returns>The loaded Institutions.</returns>
  102. Task<List<Institution>> GetInstitutionsAsync(long sessionId, int pageIndex, int pageSize, string keyword);
  103. /// <summary>
  104. /// Get total Institution count.
  105. /// </summary>
  106. /// <param name="keyword">The searched key word.</param>
  107. /// <returns>The Institution count.</returns>
  108. Task<int> GetInstitutionCountAsync(long sessionId, string keyword);
  109. /// <summary>
  110. /// Create the Institution
  111. /// </summary>
  112. /// <param name="name">The name of the Institution.</param>
  113. /// <param name="description">The description of the Institution.</param>
  114. /// <returns></returns>
  115. Task<Institution> CreateInstitutionAsync(long sessionId, string name, string description, List<EntityBase> organizations, InstitutionType type, bool isPaid);
  116. /// <summary>
  117. /// Delete the Institution from the system.
  118. /// </summary>
  119. /// <returns>Void</returns>
  120. Task DeleteInstitutionAsync(long sessionId, long id);
  121. /// <summary>
  122. /// Update the Institution.
  123. /// </summary>
  124. /// <param name="id">The id of Institution.</param>
  125. /// <param name="description">The description of the Institution.</param>
  126. /// <returns>Void</returns>
  127. Task UpdateInstitutionAsync(long sessionId, long id, string description, List<EntityBase> organizations, InstitutionType type, bool isPaid);
  128. /// <summary>
  129. /// 检查机构下是否已绑定用户
  130. /// </summary>
  131. /// <param name="sessionId"></param>
  132. /// <param name="institutionId"></param>
  133. /// <returns></returns>
  134. /// <exception cref="InvalidOperationException"></exception>
  135. Task<bool> ExistAccountByInstitutionIdAsync(long sessionId, long institutionId);
  136. #endregion 机构管理
  137. #region admin management
  138. /// <summary>
  139. /// Get all system admins.
  140. /// </summary>
  141. /// <param name="sessionId">The session of current admin</param>
  142. /// <returns>The loaded admins</returns>
  143. Task<List<Account>> GetAccountsAsync(long sessionId, Role role);
  144. /// <summary>
  145. /// Get all admins from system
  146. /// </summary>
  147. /// <param name="sessionId">The session of current admin</param>
  148. /// <param name="pageIndex">The index of page.</param>
  149. /// <param name="pageSize">The item count per page.</param>
  150. /// <param name="keyword">The searched key word.</param>
  151. /// <returns>The loaded admins</returns>
  152. Task<List<Account>> GetAccountsAsync(long sessionId, int pageIndex, int pageSize, string keyword, long organizationId, long institutionId, Role role);
  153. /// <summary>
  154. /// Get total admin count.
  155. /// </summary>
  156. /// <param name="keyword">The searched key word.</param>
  157. /// <returns>The admin count.</returns>
  158. Task<int> GetAccountCountAsync(long sessionId, string keyword, long organizationId, long institutionId, Role role);
  159. /// <summary>
  160. /// Create a admin in system.
  161. /// </summary>
  162. /// <param name="sessionId">The session of current admin</param>
  163. /// <param name="name">The name of the admin</param>
  164. /// <param name="fullName">The full name of the admin</param>
  165. /// <param name="password">The password of the admin</param>
  166. /// <returns>The created admin</returns>
  167. Task<Account> CreateAccountAsync(long sessionId, string name, string fullName, string password, List<EntityBase> organizations, List<Role> roles, List<AuthorityBase> authorities,
  168. DeveloperAuthorityInfo developerAuthorityInfo, LabelerAuthorityInfo labelerAuthorityInfo, int handyToolExportDelay, long institutionId);
  169. /// <summary>
  170. /// Update one admin.
  171. /// </summary>
  172. /// <param name="sessionId"></param>
  173. /// <param name="id"></param>
  174. /// <returns>Void</returns>
  175. Task UpdateAccountAsync(long sessionId, long id, string fullName, List<EntityBase> organizations, List<Role> roles, List<AuthorityBase> authorities,
  176. DeveloperAuthorityInfo developerAuthorityInfo, LabelerAuthorityInfo labelerAuthorityInfo, int handyToolExportDelay, long institutionId);
  177. /// <summary>
  178. /// Update a admin password.
  179. /// </summary>
  180. /// <param name="sessionId">The session id of current admin.</param>
  181. /// <param name="id">The admin id of the admin to operated.</param>
  182. /// <param name="password">The password of the admin.</param>
  183. /// <returns>Void</returns>
  184. Task UpdateAccountPasswordAsync(long sessionId, long id, string password);
  185. /// <summary>
  186. /// Delete one admin from the system.
  187. /// </summary>
  188. /// <param name="sessionId">The session id of current admin.</param>
  189. /// <param name="adminId">The admin id of the admin to process</param>
  190. /// <returns>Void</returns>
  191. Task DeleteAccountAsync(long sessionId, long adminId);
  192. /// <summary>
  193. /// Get the admin by admin id.
  194. /// </summary>
  195. /// <param name="adminId">The id of the admin</param>
  196. /// <returns>The admin</returns>
  197. Task<Account> GetAccountAsync(long sessionId, long adminId);
  198. #endregion admin management
  199. #region developer management
  200. /// <summary>
  201. /// Get total developer count.
  202. /// </summary>
  203. /// <param name="keyword">The searched key word</param>
  204. /// <param name="sessionId">The session id of the admin</param>
  205. /// <returns>The developer count.</returns>
  206. Task<int> GetDeveloperCountAsync(long sessionId, string keyword);
  207. /// <summary>
  208. /// Get all developers from system
  209. /// </summary>
  210. /// <returns>The loaded developers.</returns>
  211. Task<List<DeveloperAccount>> GetDevelopersAsync(long sessionId);
  212. /// <summary>
  213. /// Get all developers from the system.
  214. /// </summary>
  215. /// <param name="sessionId">The session id of the admin</param>
  216. /// <param name="pageIndex">The page index of result.</param>
  217. /// <param name="pageSize">The item count per page.</param>
  218. /// <returns>The developers in the system</returns>
  219. Task<List<DeveloperAccount>> GetDevelopersAsync(long sessionId, int pageIndex, int pageSize);
  220. /// <summary>
  221. /// Find a developer by search key.
  222. /// </summary>
  223. /// <param name="sessionId">The session id of the admin</param>
  224. /// <param name="key">The search key.</param>
  225. /// <param name="pageIndex">The page index of result.</param>
  226. /// <param name="pageSize">The item count per page.</param>
  227. /// <returns>The found developers.</returns>
  228. Task<List<DeveloperAccount>> FindDevelopersAsync(long sessionId, string key, int pageIndex, int pageSize);
  229. /// <summary>
  230. /// Create a developer in system.
  231. /// </summary>
  232. /// <param name="sessionId">The session id of the admin</param>
  233. /// <param name="name">The name of the developer.</param>
  234. /// <param name="fullName">The full name of the developer.</param>
  235. /// <param name="password">The password of the developer.</param>
  236. /// <returns>The created developer.</returns>
  237. Task<DeveloperAccount> CreateDeveloperAsync(long sessionId, string name, string fullName, string password, DateTime expireTime, List<EntityBase> organizations);
  238. /// <summary>
  239. /// Update one developer account.
  240. /// </summary>
  241. /// <param name="sessionId">The session id of the admin.</param>
  242. /// <param name="id">The id of developer to handle.</param>
  243. /// <param name="fullName">The full name of the developer.</param>
  244. /// <param name="expireTime">The token expire time.</param>
  245. /// <returns>Void</returns>
  246. Task UpdateDeveloperAsync(long sessionId, long id, string fullName, DateTime expireTime, List<EntityBase> organizations);
  247. /// <summary>
  248. /// Update one developer password.
  249. /// </summary>
  250. /// <param name="id">The id of developer to handle.</param>
  251. /// <param name="password">The password of the developer.</param>
  252. /// <returns>Void</returns>
  253. Task UpdateDeveloperPasswordAsync(long sessionId, long id, string password);
  254. /// <summary>
  255. /// Delete one developer from the system.
  256. /// </summary>
  257. /// <param name="sessionId">The session id of the admin.</param>
  258. /// <param name="developerId">The developer id of the developer to process</param>
  259. /// <returns>Void</returns>
  260. Task DeleteDeveloperAsync(long sessionId, long developerId);
  261. /// <summary>
  262. /// Create a token for a developer.
  263. /// </summary>
  264. /// <param name="sessionId">The session id of the admin.</param>
  265. /// <param name="developerId">The developer id of the developer to process</param>
  266. /// <param name="expireTime">The expired time for the token.</param>
  267. /// <returns>The created token.</returns>
  268. Task<string> CreateTokenAsync(long sessionId, long developerId, DateTime expireTime);
  269. /// <summary>
  270. /// Delete work token.
  271. /// </summary>
  272. /// <param name="sessionId">The session id of the admin</param>
  273. /// <param name="developerId">The id of the developer.</param>
  274. /// <returns></returns>
  275. Task DeleteWorkTokenAsync(long sessionId, long developerId);
  276. #endregion developer management
  277. #region labeler management
  278. /// <summary>
  279. /// Get total labeler count.
  280. /// </summary>
  281. /// <param name="sessionId">The session id of the admin</param>
  282. /// <param name="keyword">The searched keyword.</param>
  283. /// <param name="start">The start time.</param>
  284. /// <param name="end">The end time.</param>
  285. /// <returns>The labeler count.</returns>
  286. Task<int> GetLabelerCountAsync(long sessionId, string keyword, DateTime start, DateTime end);
  287. /// <summary>
  288. /// Get SameBatchLabelCase count.
  289. /// </summary>
  290. /// <param name="sessionId">The session id of the admin</param>
  291. /// <param name="keyword">The searched keyword.</param>
  292. /// <param name="start">The start time.</param>
  293. /// <param name="end">The end time.</param>
  294. /// <returns>The SameBatchLabelCase count</returns>
  295. Task<int> GetSameBatchLabelCaseCountAsync(long sessionId, long organizationId, long imageCategoryId, string keyword, DateTime start, DateTime end, DateTime updateStart, DateTime updateEnd);
  296. /// <summary>
  297. /// Get labeler by labeler id.
  298. /// </summary>
  299. /// <param name="labelerId">The id of the labeler.</param>
  300. /// <returns>The found labeler.</returns>
  301. Task<LabelerAccount> GetLabelerAsync(long sessionId, long labelerId);
  302. /// <summary>
  303. /// Get all labelers.
  304. /// </summary>
  305. /// <returns>LabelerAccounts from the system.</returns>
  306. Task<List<LabelerAccount>> GetLabelersAsync(long sessionId);
  307. /// <summary>
  308. /// Get senior labelers from the system.
  309. /// </summary>
  310. Task<List<LabelerAccount>> GetSeniorLabelersAsync(long sessionId);
  311. /// <summary>
  312. /// Find a labeler by search key.
  313. /// </summary>
  314. /// <param name="sessionId">The session id of the admin</param>
  315. /// <param name="key">The search key.</param>
  316. /// <param name="pageIndex">The page index of result.</param>
  317. /// <param name="pageSize">The item count per page.</param>
  318. /// <returns>The found labelers.</returns>
  319. Task<List<LabelerAccount>> GetLabelersAsync(long sessionId, string key, int pageIndex, int pageSize);
  320. /// <summary>
  321. /// Find a labeler by search key.
  322. /// </summary>
  323. /// <param name="sessionId">The session id of the admin</param>
  324. /// <param name="key">The search key.</param>
  325. /// <param name="pageIndex">The page index of result.</param>
  326. /// <param name="pageSize">The item count per page.</param>
  327. /// <param name="start">The start time.</param>
  328. /// <param name="end">The end time.</param>
  329. /// <returns>The found labelers.</returns>
  330. Task<List<LabelerAccount>> GetLabelersAsync(long sessionId, string key, int pageIndex, int pageSize, DateTime start, DateTime end);
  331. /// <summary>
  332. /// Create a labeler in system.
  333. /// </summary>
  334. /// <param name="sessionId">The session id of the admin</param>
  335. /// <param name="name">The name of the labeler.</param>
  336. /// <param name="fullName">The full name of the labeler.</param>
  337. /// <param name="password">The password of the labeler.</param>
  338. /// <param name="comeFrom">Where the labeler come from</param>
  339. /// <param name="qualification">The qualification of the labeler</param>
  340. /// <param name="seniorLabeler">The teacher of the labeler</param>
  341. /// <param name="organizations">The organizations of the labeler</param>
  342. /// <returns>The created labeler.</returns>
  343. Task<LabelerAccount> CreateLabelerAsync(long sessionId, string name, string fullName, string password, string comeFrom, string qualification, bool isRemote, EntityBase seniorLabeler, List<EntityBase> organizations);
  344. /// <summary>
  345. /// Update a labeler
  346. /// </summary>
  347. /// <param name="id">The id of the labeler</param>
  348. /// <param name="fullName">The full name of the labeler</param>
  349. /// <param name="comeFrom">where the labeler come from</param>
  350. /// <param name="qualification">The qualification of the labeler</param>
  351. /// <param name="seniorLabeler">The teacher of the labeler</param>
  352. /// <param name="organizations">The organizations of the labeler</param>
  353. /// <returns></returns>
  354. Task UpdateLabelerAsync(long sessionId, long id, string fullName, string comeFrom, string qualification, bool isRemote, EntityBase seniorLabeler, List<EntityBase> organizations);
  355. /// <summary>
  356. /// Update a labeler password.
  357. /// </summary>
  358. /// <param name="sessionId">The session id of the admin.</param>
  359. /// <param name="labelerId">The labeler id of the labeler to operated.</param>
  360. /// <param name="password">The password of the labeler.</param>
  361. /// <returns>Void</returns>
  362. Task UpdateLabelerPasswordAsync(long sessionId, long labelerId, string password);
  363. /// <summary>
  364. /// Delete one labeler from the system.
  365. /// </summary>
  366. /// <param name="sessionId">The session id of the admin.</param>
  367. /// <param name="labelerId">The labeler id of the labeler to process</param>
  368. /// <returns>Void</returns>
  369. Task DeleteLabelerAsync(long sessionId, long labelerId);
  370. /// <summary>
  371. /// Get all the SameBatchLabelCase.
  372. /// </summary>
  373. /// <param name="sessionId">The session id of the admin.</param>
  374. /// <param name="pageIndex">The index of page.</param>
  375. /// <param name="pageSize">The item count per page.</param>
  376. /// <param name="keyword">The searched keyword.</param>
  377. /// <param name="start">The start time.</param>
  378. /// <param name="end">The end time.</param>
  379. /// <returns>The loaded SameBatchLabelCase.</returns>
  380. Task<List<SameBatchLabelCase>> GetSameBatchLabelCasesAsync(long sessionId, int pageIndex, int pageSize, long organizationId, long imageCategoryId, string keyword, DateTime start, DateTime end, DateTime updateStart, DateTime updateEnd);
  381. /// <summary>
  382. /// Get all the SameBatchLabelCase.
  383. /// <param name="sessionId">The session id of the admin.</param>
  384. /// </summary>
  385. /// <returns>The loaded SameBatchLabelCase.</returns>
  386. Task<List<SameBatchLabelCase>> GetSameBatchLabelCasesAsync(long sessionId);
  387. /// <summary>
  388. /// Get the SameBatchLabelCases.
  389. /// </summary>
  390. /// <param name="sessionId">The session id of the admin</param>
  391. /// <param name="id">The same batch label case id.</param>
  392. /// <returns>The loaded SameBatchLabelCase.</returns>
  393. Task<SameBatchLabelCase> GetSameBatchLabelCaseAsync(long sessionId, long id);
  394. /// <summary>
  395. /// Get SameBatchLabelCase statistics by case id..
  396. /// </summary>
  397. /// <param name="sessionId">The admin session id.</param>
  398. /// <param name="caseId">The id of the SameBatchLabelCase.</param>
  399. /// <returns>The SameBatchLabelCase general statistics.</returns>
  400. Task<SameBatchLabelCaseStatisticData> GetSameBatchLabelCaseStatisticsAsync(long sessionId, long caseId);
  401. /// <summary>
  402. /// Get labeler statistics by case id..
  403. /// </summary>
  404. /// <param name="sessionId">The admin session id.</param>
  405. /// <param name="caseId">The id of the label case.</param>
  406. /// <returns>The labeler statistics.</returns>
  407. Task<LabelCaseStatistic> GetLabelCaseStatisticAsync(long sessionId, long caseId);
  408. /// <summary>
  409. /// Get labeler case statistics by the same batch label case id
  410. /// </summary>
  411. /// <param name="sessionId">The admin session id.</param>
  412. /// <param name="sameBatchLabelCaseId">The same batch label case id</param>
  413. /// <returns></returns>
  414. Task<List<LabelCaseStatistic>> GetLabelCaseStatisticsBySameBatchLabelCaseIdAsync(long sessionId, long sameBatchLabelCaseId);
  415. #endregion labeler management
  416. #region agent management
  417. /// <summary>
  418. /// Register a agent into the system.
  419. /// </summary>
  420. /// <param name="sessionId">The session id of the admin.</param>
  421. /// <param name="agentVersion">The version of the agent</param>
  422. /// <param name="agentName">The name of the agent.</param>
  423. /// <param name="description">The description of the agent.</param>
  424. /// <param name="hardwareCode">The hardware code of the agent.</param>
  425. /// <param name="ipAddress">The ip address of the agent.</param>
  426. /// <returns>Void</returns>
  427. Task RegisterAgentAsync(long sessionId, string agentVersion, string agentName, string description, string hardwareCode, string ipAddress, List<EntityBase> organizations);
  428. /// <summary>
  429. /// Un-register an agent from the system.
  430. /// </summary>
  431. /// <param name="sessionId">The session id of the admin.</param>
  432. /// <param name="agentId">The agent id to un-register</param>
  433. /// <returns>Void</returns>
  434. Task UnRegisterAgentAsync(long sessionId, long agentId);
  435. /// <summary>
  436. /// Update agent organizations from the system.
  437. /// </summary>
  438. /// <param name="sessionId">The session id of the admin.</param>
  439. /// <param name="agentId">The agent id</param>
  440. /// <param name="organizations">The organizations to update</param>
  441. /// <returns>Void</returns>
  442. Task UpdateAgentOrganizationsAsync(long sessionId, long agentId, List<EntityBase> organizations);
  443. /// <summary>
  444. /// Get all agents from the system.
  445. /// </summary>
  446. /// <param name="sessionId">The session id of the admin.</param>
  447. /// <returns>The agents in the system</returns>
  448. Task<List<AgentInfoEx>> GetAgentsAsync(long sessionId);
  449. /// <summary>
  450. /// Get the agents count from the system.
  451. /// </summary>
  452. /// <returns>Void</returns>
  453. Task<int> GetAgentsCountAsync(long sessionId);
  454. #endregion agent management
  455. #region image management
  456. /// <summary>
  457. /// Get ultrasound groups count by image category id.
  458. /// </summary>
  459. /// <param name="sessionId">The session id of the admin</param>
  460. /// <param name="imageCategoryId">The image category id.</param>
  461. /// <returns>Total group count</returns>
  462. Task<int> GetUltrasoundGroupCountAsync(long sessionId, long imageCategoryId, string keyword);
  463. /// <summary>
  464. /// Get labeled group count.
  465. /// </summary>
  466. /// <param name="sessionId">The id of the session.</param>
  467. /// <param name="imageCategoryId">The image category id to handle.</param>
  468. /// <returns>The group count.</returns>
  469. Task<int> GetLabeledGroupCountAsync(long sessionId, long imageCategoryId, string keyword);
  470. /// <summary>
  471. /// Get un-labeled group count.
  472. /// </summary>
  473. /// <param name="sessionId">The id of the session.</param>
  474. /// <param name="imageCategoryId">The image category id to handle.</param>
  475. /// <returns>The group count.</returns>
  476. Task<int> GetUnLabeledGroupCountAsync(long sessionId, long imageCategoryId, string keyword);
  477. /// <summary>
  478. /// Get gold standard groups count by image category id.
  479. /// </summary>
  480. /// <param name="sessionId">The session id of the admin</param>
  481. /// <param name="imageCategoryId">The image category id.</param>
  482. /// <returns>Total group count</returns>
  483. Task<int> GetGoldStandardGroupCountAsync(long sessionId, long imageCategoryId, string keyword);
  484. /// <summary>
  485. /// Get labeled group count.
  486. /// </summary>
  487. /// <param name="sessionId">The id of the session.</param>
  488. /// <param name="imageCategoryId">The image category id to handle.</param>
  489. /// <returns>The group count.</returns>
  490. Task<int> GetLabeledFileCountAsync(long sessionId, long imageCategoryId, string keyword);
  491. /// <summary>
  492. /// Get un-labeled file count.
  493. /// </summary>
  494. /// <param name="sessionId">The id of the session.</param>
  495. /// <param name="imageCategoryId">The image category id to handle.</param>
  496. /// <returns>The image count.</returns>
  497. Task<int> GetUnLabeledFileCountAsync(long sessionId, long imageCategoryId, string keyword);
  498. /// <summary>
  499. /// Add un-labeled file into the system.
  500. /// </summary>
  501. /// <param name="sessionId">The sessionId of the admin</param>
  502. /// <param name="imageCategoryId">The image category id</param>
  503. /// <param name="imageBatchId">The image batch id</param>
  504. /// <returns>Void</returns>
  505. Task<OpResult> AddUnLabeledFileAsync(long sessionId, long organinzationId, long imageCategoryId, long imageBatchId, UploadFileModel file);
  506. /// <summary>
  507. /// 分段上传视频
  508. /// </summary>
  509. /// <param name="fileId"></param>
  510. /// <param name="fileName"></param>
  511. /// <param name="fileBytes"></param>
  512. /// <returns></returns>
  513. Task<OpResult> UploadVideoBatchSizeAsync(string fileId, string fileName, byte[] fileBytes);
  514. /// <summary>
  515. /// Get ultrasound images count by on combined tag id.
  516. /// </summary>
  517. /// <param name="sessionId">The session id of the admin</param>
  518. /// <param name="imageCategoryId">The image category id of images</param>
  519. /// <returns>Total image count</returns>
  520. Task<int> GetUltrasoundFileCountAsync(long sessionId, long imageCategoryId, string keyword);
  521. /// <summary>
  522. /// Get gold standard images count by on combined tag id.
  523. /// </summary>
  524. /// <param name="sessionId">The session id of the admin</param>
  525. /// <param name="imageCategoryId">The image category id of images</param>
  526. /// <returns>Total image count</returns>
  527. Task<int> GetGoldStandardFileCountAsync(long sessionId, long imageCategoryId, string keyword);
  528. /// <summary>
  529. /// Get un-gold standard images count by on combined tag id.
  530. /// </summary>
  531. /// <param name="sessionId">The session id of the admin</param>
  532. /// <param name="imageCategoryId">The image category id of images</param>
  533. /// <returns>Total image count</returns>
  534. Task<int> GetUnGoldStandardFileCountAsync(long sessionId, long imageCategoryId, string keyword);
  535. /// <summary>
  536. /// Get Dispute labeled file count.
  537. /// </summary>
  538. /// <param name="sessionId">The id of the session.</param>
  539. /// <param name="imageCategoryId">The image category id to handle.</param>
  540. /// <returns>The image count.</returns>
  541. Task<int> GetDisputeLabeledFileCountAsync(long sessionId, long imageCategoryId, string keyword, bool isAssign, string keyWordLabele);
  542. /// <summary>
  543. /// Get files by ultrasoundGroupId
  544. /// </summary>
  545. /// <param name="sessionId">The session id of the admin</param>
  546. /// <param name="imageCategoryId">The id of image category.</param>
  547. /// <param name="ultrasoundGroupId">The id of ultrasound group.</param>
  548. /// <returns>The loaded files.</returns>
  549. Task<List<PreviewFileModel>> GetUltrasoundFilesByGroupIdAsync(long sessionId, long imageCategoryId, long ultrasoundGroupId);
  550. /// <summary>
  551. /// Get ultrasound images by on image category id.
  552. /// </summary>
  553. /// <param name="sessionId">The session id of the admin</param>
  554. /// <param name="imageCategoryId">The image category id of images</param>
  555. /// <param name="pageIndex">The page index</param>
  556. /// <param name="pageSize">The item count per page.</param>
  557. /// <returns>found ultrasound images</returns>
  558. Task<List<PreviewFileModel>> GetUltrasoundFilesInGroupAsync(long sessionId, long imageCategoryId, string keyword, int pageIndex, int pageSize);
  559. /// <summary>
  560. /// Get labeled files by on image category id.
  561. /// </summary>
  562. /// <param name="sessionId">The session id of the admin</param>
  563. /// <param name="imageCategoryId">The image category id of images</param>
  564. /// <param name="pageIndex">The page index</param>
  565. /// <param name="pageSize">The item count per page.</param>
  566. /// <returns>found ultrasound images</returns>
  567. Task<List<PreviewFileModel>> GetLatestLabeledFilesInGroupAsync(long sessionId, long imageCategoryId, string keyword, int pageIndex, int pageSize);
  568. /// <summary>
  569. /// Get unlabeled files by on image category id.
  570. /// </summary>
  571. /// <param name="sessionId">The session id of the admin</param>
  572. /// <param name="imageCategoryId">The image category id of images</param>
  573. /// <param name="pageIndex">The page index</param>
  574. /// <param name="pageSize">The item count per page.</param>
  575. /// <returns>found ultrasound images</returns>
  576. Task<List<PreviewFileModel>> GetUnLabeledFilesInGroupAsync(long sessionId, long imageCategoryId, string keyword, int pageIndex, int pageSize);
  577. /// <summary>
  578. /// Get gold standard images by on image category id.
  579. /// </summary>
  580. /// <param name="sessionId">The session id of the admin</param>
  581. /// <param name="imageCategoryId">The image category id of images</param>
  582. /// <param name="pageIndex">The page index</param>
  583. /// <param name="pageSize">The item count per page.</param>
  584. /// <returns>found ultrasound images</returns>
  585. Task<List<PreviewFileModel>> GetGoldStandardFilesInGroupAsync(long sessionId, long imageCategoryId, string keyword, int pageIndex, int pageSize);
  586. /// <summary>
  587. /// Get labeled files by on image category id.
  588. /// </summary>
  589. /// <param name="sessionId">The session id of the admin</param>
  590. /// <param name="imageCategoryId">The image category id of images</param>
  591. /// <param name="pageIndex">The page index</param>
  592. /// <param name="pageSize">The item count per page.</param>
  593. /// <returns>found ultrasound images</returns>
  594. Task<List<LabeledUltrasoundFile>> GetLabeledFilesAsync(long sessionId, long imageCategoryId, int pageIndex, int pageSize);
  595. /// <summary>
  596. /// Delete ultrasound image by ultrasound image id
  597. /// </summary>
  598. /// <param name="sessionId">The session id of the admin</param>
  599. /// <param name="UltrasoundFileId">The id of the image</param>
  600. /// <returns>Void</returns>
  601. Task DeleteUltrasoundFileAsync(long sessionId, long UltrasoundFileId);
  602. /// <summary>
  603. /// Get archived image by archivedImageId
  604. /// </summary>
  605. /// <param name="sessionId">The session id of the admin</param>
  606. /// <param name="archivedImageId">The id of the archived image</param>
  607. /// <returns>The found archived image.</returns>
  608. Task<ArchivedImage> GetArchivedImageAsync(long sessionId, long archivedImageId);
  609. /// <summary>
  610. /// Get the labeled result by id.
  611. /// </summary>
  612. /// <param name="sessionId">The session id of the admin</param>
  613. /// <param name="id"></param>
  614. /// <returns></returns>
  615. Task<LabeledResult> GetLabeledResultAsync(long sessionId, long id);
  616. /// <summary>
  617. /// Get the un assigned image count.
  618. /// </summary>
  619. /// <param name="sessionId">The session id of the admin</param>
  620. /// <param name="imageCategoryId">The tag id.</param>
  621. /// <returns>The count of the un-assigned images.</returns>
  622. Task<int> GetUnAssignedImageCountAsync(long sessionId, long imageCategoryId);
  623. /// <summary>
  624. /// Get un-adoptable image count.
  625. /// </summary>
  626. /// <param name="sessionId">The session id of the admin</param>
  627. /// <param name="imageCategoryId">The id of the tag.</param>
  628. /// <returns>The image's count.</returns>
  629. Task<int> GetUnAdoptableImageCountAsync(long sessionId, long imageCategoryId);
  630. /// <summary>
  631. /// Get all assignedLabelCases count of one labeler.
  632. /// </summary>
  633. /// <param name="labelerId">The labelerId which the cases assigned to.</param>
  634. /// <returns>The assigned label case count.</returns>
  635. Task<int> GetAssignedLabelCaseCountAsync(long sessionId, long labelerId, string keyword);
  636. /// <summary>
  637. /// Get cases which assigned to a labeler.
  638. /// </summary>
  639. /// <param name="sessionId">The session id of the admin</param>
  640. /// <param name="labelerId">The id of the labeler.</param>
  641. /// <returns>The cases of the labeler.</returns>
  642. Task<List<AssignedLabelCase>> GetAssignedLabelCasesByLabelerIdAsync(long sessionId, long labelerId, int pageIndex, int pageSize, string keyword);
  643. /// <summary>
  644. /// Get the assigned label cases.
  645. /// </summary>
  646. /// <param name="sessionId">The session id of the admin</param>
  647. /// <param name="sameBatchLabelCaseId">The id of the same batch label case</param>
  648. /// <returns>The cases</returns>
  649. Task<List<AssignedLabelCase>> GetAssignedLabelCasesBySameBatchLabelCaseIdAsync(long sessionId, long sameBatchLabelCaseId);
  650. /// <summary>
  651. /// Get total case image count in case.
  652. /// </summary>
  653. /// <param name="sessionId">The session id.</param>
  654. /// <param name="caseId">The case id.</param>
  655. /// <returns>The count.</returns>
  656. Task<int> GetCaseImageCountAsync(long sessionId, long caseId);
  657. /// <summary>
  658. /// Get labeled case image count of one case.
  659. /// </summary>
  660. /// <param name="sessionId">The session id.</param>
  661. /// <param name="caseId">The id of the case.</param>
  662. /// <returns>The count of the labeled case image</returns>
  663. Task<int> GetLabeledCaseImageCountAsync(long sessionId, long caseId);
  664. /// <summary>
  665. /// Get labeled files by on image category id.
  666. /// </summary>
  667. /// <param name="sessionId">The session id of the admin</param>
  668. /// <param name="imageCategoryId">The image category id of images</param>
  669. /// <param name="pageIndex">The page index</param>
  670. /// <param name="pageSize">The item count per page.</param>
  671. /// <returns>found ultrasound images</returns>
  672. Task<List<PreviewFileModel>> GetDisputeLabeledFilesAsync(long sessionId, long imageCategoryId, string keyword, int pageIndex, int pageSize, bool isAssign, string keyWordLabele);
  673. /// <summary>
  674. /// Get all labeler infos in the ultrasound file.
  675. /// </summary>
  676. /// <param name="sessionId">The session id of the admin</param>
  677. /// <param name="ultrasoundFileId">The id of ultrasound file.</param>
  678. /// <param name="imageCategoryId">The id of image category.</param>
  679. /// <returns></returns>
  680. Task<List<LabelerInfo>> GetLabelerInfosAsync(long sessionId, long ultrasoundFileId, long imageCategoryId);
  681. /// <summary>
  682. /// Delete labeled ultrasound image by ultrasound image id
  683. /// </summary>
  684. /// <param name="sessionId">The session id of the admin</param>
  685. /// <param name="labeledUltrasoundFileId">The id of the image</param>
  686. /// <returns>Void</returns>
  687. Task DeleteLabeledUltrasoundFileAsync(long sessionId, long labeledUltrasoundFileId);
  688. /// <summary>
  689. /// Delete all labeled ultrasound image for one ultrasound image by the ultrasound image id.
  690. /// </summary>
  691. /// <param name="sessionId">The session id of the admin</param>
  692. /// <param name="ultrasoundFileId">The id of the ultrasound image</param>
  693. /// <returns>Void</returns>
  694. Task DeleteAllLabeledUltrasoundFilesByUltrasoundFileIdAsync(long sessionId, long ultrasoundFileId);
  695. /// <summary>
  696. /// Update labeled ultrasound image.
  697. /// </summary>
  698. /// <param name="sessionId">The id of the session.</param>
  699. /// <param name="labeledImageId">The labeled ultrasound image id.</param>
  700. /// <param name="isGoldStandard">The value to indicate whether the labeled file is gold standard or not.</param>
  701. Task UpdateLabeledUltrasoundFileAsync(long sessionId, long labeledImageId, bool isGoldStandard);
  702. /// <summary>
  703. /// Update labeled ultrasound image's is adoptable state.
  704. /// </summary>
  705. /// <param name="sessionId">The id of the session.</param>
  706. /// <param name="labeledUltrasoundFileId">The id of the ultrasound image.</param>
  707. /// <param name="isAdoptable">The value to indicate whether the labeled file is adoptable or not.</param>
  708. /// <returns></returns>
  709. Task UpdateLabeledUltrasoundFileIsAdoptableAsync(long sessionId, long labeledUltrasoundFileId, bool isAdoptable);
  710. /// <summary>
  711. /// Get the latest labeled file info for one source image by labeledUltrasoundFileId.
  712. /// </summary>
  713. /// <param name="sessionId">The session id of the admin</param>
  714. /// <returns>found ultrasound image</returns>
  715. Task<LabeledUltrasoundFileInfo> GetLatestLabeledUltrasoundFileInfoAsync(long sessionId, long labeledUltrasoundFileId);
  716. /// <summary>
  717. /// Get all the labeled files for one source image by all labelers.
  718. /// </summary>
  719. /// <param name="sessionId">The session id of the admin</param>
  720. /// <param name="imageCategoryId">The image category id of images</param>
  721. /// <param name="pageIndex">The page index</param>
  722. /// <param name="pageSize">The item count per page.</param>
  723. /// <returns>found ultrasound images</returns>
  724. Task<List<LabeledUltrasoundFileInfo>> GetLabeledUltrasoundFilesByUltrasoundFileIdAsync(long sessionId, long ultrasoundFileId, long imageCategoryId);
  725. /// <summary>
  726. /// Get all the labeled files for one source image by all labelers.
  727. /// </summary>
  728. /// <param name="sessionId">The session id of the admin</param>
  729. /// <param name="imageCategoryId">The image category id of images</param>
  730. /// <returns>found ultrasound images count</returns>
  731. Task<int> GetLabeledUltrasoundFilesCountByUltrasoundFileIdAsync(long sessionId, long ultrasoundFileId);
  732. /// <summary>
  733. /// Get all the labeled files for one source image by all labelers.
  734. /// </summary>
  735. /// <param name="sessionId">The session id of the admin</param>
  736. /// <param name="imageCategoryId">The image category id of images</param>
  737. /// <returns>found ultrasound images count</returns>
  738. Task<int> GetValidAdoptableLabeledUltrasoundFilesCountOfImageCategoryIdAsync(long sessionId, long imageCategoryId);
  739. #endregion image management
  740. #region label item management
  741. /// <summary>
  742. /// Create a label package content.
  743. /// </summary>
  744. /// <param name="sessionId">The session id of current admin.</param>
  745. /// <param name="content">content of the label package.</param>
  746. /// <returns>The id of the label package content.</returns>
  747. Task<long> CreateLabelPackageContentAsync(long sessionId, string content);
  748. /// <summary>
  749. /// Get the LabelPackageContent by id
  750. /// </summary>
  751. /// <param name="sessionId">The session id of current admin.</param>
  752. /// <param name="labelPackageContentId">The id of the label package content.</param>
  753. /// <returns>The loaded label package content</returns>
  754. Task<LabelPackageContent> GetLabelPackageContentAsync(long sessionId, long labelPackageContentId);
  755. /// <summary>
  756. /// Update the label package content.
  757. /// </summary>
  758. /// <param name="sessionId">The session id of current admin.</param>
  759. /// <param name="labelPackageContentId">The id of the label package content.</param>
  760. /// <param name="content">The content of the label package content.</param>
  761. /// <returns>Void</returns>
  762. Task UpdateLabelPackageContentAsync(long sessionId, long labelPackageContentId, string content);
  763. /// <summary>
  764. /// Get all system label packages.
  765. /// </summary>
  766. /// <param name="sessionId">The session of current admin</param>
  767. /// <returns>The loaded admins</returns>
  768. Task<List<LabelPackage>> GetLabelPackagesAsync(long sessionId);
  769. /// <summary>
  770. /// Gets the label packages count by keyword.
  771. /// </summary>
  772. /// <returns>Label packages count from the system.</returns>
  773. Task<int> GetLabelPackagesCountAsync(long sessionId, string keyword);
  774. /// <summary>
  775. /// Gets the label packages by keyword.
  776. /// </summary>
  777. /// <returns>Label packages from the system.</returns>
  778. Task<List<LabelPackage>> GetLabelPackagesAsync(long sessionId, int pageIndex, int pageSize, string keyword);
  779. /// <summary>
  780. /// Create a label package in system.
  781. /// </summary>
  782. /// <param name="sessionId">The session of current admin</param>
  783. /// <param name="name">The name of the LabelPackage</param>
  784. /// <param name="organizations">The organizations of the LabelPackage.</param>
  785. /// <returns>The created LabelPackage</returns>
  786. Task<LabelPackage> CreateLabelPackageAsync(long sessionId, string name, List<EntityBase> organizations);
  787. /// <summary>
  788. /// Delete one label package from the system.
  789. /// </summary>
  790. /// <param name="sessionId">The session id of current admin.</param>
  791. /// <param name="labelPackageId">The id of the label package to process</param>
  792. /// <returns>Void</returns>
  793. Task DeleteLabelPackageAsync(long sessionId, long labelPackageId);
  794. #endregion label item management
  795. #region statistics
  796. /// <summary>
  797. /// Get labeler statistic data.
  798. /// </summary>
  799. /// <param name="sessionId">The admin session id.</param>
  800. /// <param name="labelerId">The id of the labeler.</param>
  801. /// <param name="start">The start time.</param>
  802. /// <param name="end">The end time.</param>
  803. /// <returns>The labeler statistic data.</returns>
  804. Task<LabelerStatisticData> GetLabelerStatisticDataAsync(long sessionId, long labelerId, DateTime start, DateTime end);
  805. /// <summary>
  806. /// Get committed count.
  807. /// </summary>
  808. /// <param name="sessionId">The admin session id.</param>
  809. /// <param name="labelerId">The id of the labeler.</param>
  810. /// <param name="start">The start time.</param>
  811. /// <param name="end">The end time.</param>
  812. /// <returns>The committed count.</returns>
  813. Task<int> GetLabeledImageCountAsync(long sessionId, long labelerId, DateTime start, DateTime end);
  814. /// <summary>
  815. /// Get committed count.
  816. /// </summary>
  817. /// <param name="sessionId">The session id of the admin</param>
  818. /// <param name="day">The start time.</param>
  819. /// <returns>The commit count of the day</returns>
  820. Task<int> GetDayCommittedCountAsync(long sessionId, DateTime day);
  821. /// <summary>
  822. /// Get committed region count.
  823. /// </summary>
  824. /// <param name="sessionId">The admin session id.</param>
  825. /// <param name="labelerId">The id of the labeler.</param>
  826. /// <param name="start">The start time.</param>
  827. /// <param name="end">The end time.</param>
  828. /// <returns>Get committed region count.</returns>
  829. Task<int> GetLabeledRegionCountAsync(long sessionId, long labelerId, DateTime start, DateTime end);
  830. /// <summary>
  831. /// Get assigned image count.
  832. /// </summary>
  833. /// <param name="sessionId">The admin session id.</param>
  834. /// <param name="labelerId">The id of the labeler.</param>
  835. /// <returns>Get assigned image count.</returns>
  836. Task<int> GetAssignedImageCountAsync(long sessionId, long labelerId);
  837. /// <summary>
  838. /// Get assigned image count.
  839. /// </summary>
  840. /// <param name="sessionId">The admin session id.</param>
  841. /// <param name="labelerId">The id of the labeler.</param>
  842. /// <param name="start">The start time.</param>
  843. /// <param name="end">The end time.</param>
  844. /// <returns>Get assigned image count.</returns>
  845. Task<int> GetAssignedImageCountAsync(long sessionId, long labelerId, DateTime start, DateTime end);
  846. /// <summary>
  847. /// Get left image count.
  848. /// </summary>
  849. /// <param name="sessionId">The admin session id.</param>
  850. /// <param name="labelerId">The id of the labeler.</param>
  851. /// <returns>Get left image count.</returns>
  852. Task<int> GetUnlabeledAssignedImageCountAsync(long sessionId, long labelerId);
  853. /// <summary>
  854. /// Assign conflict labeled data to Senior labelers.
  855. /// </summary>
  856. /// <param name="sessionId">The id of the session.</param>
  857. /// <returns></returns>
  858. Task AssignConflictLabeledDataAsync(long sessionId);
  859. #endregion statistics
  860. #region logs
  861. /// <summary>
  862. /// Get log item count.
  863. /// </summary>
  864. /// <param name="sessionId">The admin session id.</param>
  865. /// <returns>The count of log item.</returns>
  866. Task<int> GetLogItemCountAsync(long sessionId);
  867. /// <summary>
  868. /// Gets log item for one page.
  869. /// </summary>
  870. /// <param name="sessionId">The admin session id.</param>
  871. /// <param name="pageIndex">The index of the page.</param>
  872. /// <param name="pageSize">Items per page.</param>
  873. /// <returns>loaded log items.</returns>
  874. Task<List<LogItem>> GetLogItemsAsync(long sessionId, int pageIndex, int pageSize, string keyword);
  875. #endregion logs
  876. #region LabelerClient
  877. /// <summary>
  878. /// Add one labeler client.
  879. /// </summary>
  880. /// <param name="version">The version of labeler client.</param>
  881. /// <param name="description">The description of labeler client.</param>
  882. /// <param name="clientData">The data of the labeler client.</param>
  883. /// <param name="isDefault">True set to default.</param>
  884. /// <returns></returns>
  885. Task AddLabelerClientAsync(long sessionId, string fileName, string version, string description, byte[] clientData);
  886. /// <summary>
  887. /// Get all labeler client infos count.
  888. /// </summary>
  889. /// <returns>All labeler client infos count.</returns>
  890. Task<int> GetLabelerClientInfosCountAsync(long sessionId);
  891. /// <summary>
  892. /// Get all labeler client infos.
  893. /// </summary>
  894. /// <param name="pageIndex">The index of the page.</param>
  895. /// <param name="pageSize">Items per page.</param>
  896. /// <returns></returns>
  897. Task<List<ClientUpgradeInfo>> GetLabelerClientInfosAsync(long sessionId, int pageIndex, int pageSize, string keyword);
  898. /// <summary>
  899. /// Delete the labeler client info.
  900. /// </summary>
  901. /// <param name="sessionId">The id of the session.</param>
  902. /// <param name="labelerClientInfoId">The labeler client info's id</param>
  903. /// <returns></returns>
  904. Task DeleteLabelerClientInfoAsync(long sessionId, long labelerClientInfoId);
  905. /// <summary>
  906. /// Set the labeler client info to the default one.
  907. /// </summary>
  908. /// <param name="sessionId">The id of the session.</param>
  909. /// <param name="labelerClientInfoId">The labeler clientInfo id</param>
  910. /// <returns></returns>
  911. Task SetDefaultLabelerClientAsync(long sessionId, long labelerClientInfoId);
  912. /// <summary>
  913. /// Get the labeler client info by version.
  914. /// </summary>
  915. /// <param name="sessionId">The id of the session.</param>
  916. /// <param name="version">The version of the labeler client info..</param>
  917. /// <returns>The labeler client infos.</returns>
  918. Task<ClientUpgradeInfo> GetLabelerClientInfoByVersionAsync(long sessionId, string version);
  919. #endregion LabelerClient
  920. #region Assigned Label Case
  921. /// <summary>
  922. /// Get ths labeler group
  923. /// </summary>
  924. /// <param name="imageCategoryId">The image category id</param>
  925. /// <param name="labelerId">The labeler id</param>
  926. /// <returns></returns>
  927. Task<LabelerGroup> GetLabelerGroupAsync(long sessionId, long imageCategoryId, long labelerId);
  928. /// <summary>
  929. /// Get the sum of the assigned count of AssignedLabelCase.
  930. /// </summary>
  931. /// <param name="imageCategoryId">The image category id</param>
  932. /// <param name="labelerId">The labeler id</param>
  933. /// <returns></returns>
  934. Task<QuantityBase> GetAssignedCountForAssignedLabelCaseAsync(long sessionId, long imageCategoryId, long labelerId);
  935. /// <summary>
  936. /// Get the sum of the assigned ultrasound file count.
  937. /// </summary>
  938. /// <returns></returns>
  939. Task<int> GetAssignedUltrasoundFileCountAsync(long sessionId, long imageBatchId, AssignCondition condition, int assignGroupCount);
  940. /// <summary>
  941. /// Assign files to labelers.
  942. /// </summary>
  943. /// <param name="sessionId">The session id of the admin.</param>
  944. /// <param name="caseName">The label case name.</param>
  945. /// <param name="organization">The organization of label case.</param>
  946. /// <param name="imageCategoryId">The tag id of the images.</param>
  947. /// <param name="labelerInfos">The labelers to assign.</param>
  948. /// <param name="mode">The assign mode.</param>
  949. /// <param name="type">The assign type.</param>
  950. /// <param name="condition">The assign condition.</param>
  951. /// <param name="assignCount">The image count to assign.</param>
  952. /// <returns>The id of the assign operation.</returns>
  953. Task<OpResult> AssignLabelCaseAsync(long sessionId, long operationId, string caseName, EntityBase organization, long imageCategoryId, long imageBatchId, IEnumerable<AssignLabelerInfoModal> labelerInfos, AssignMode mode, AssignType type,
  954. AssignCondition condition, QuantityBase assignCount, VideoItem videoItem);
  955. /// <summary>
  956. /// Assign files to labelers.
  957. /// </summary>
  958. /// <param name="sessionId">The session id of the admin.</param>
  959. /// <param name="caseName">The label case name.</param>
  960. /// <param name="organization">The organization of label case.</param>
  961. /// <param name="imageCategoryId">The tag id of the images.</param>
  962. /// <param name="labelerInfos">The labelers to assign.</param>
  963. /// <param name="mode">The assign mode.</param>
  964. /// <param name="type">The assign type.</param>
  965. /// <param name="condition">The assign condition.</param>
  966. /// <param name="assignCount">The image count to assign.</param>
  967. /// <returns>The id of the assign operation.</returns>
  968. Task<long> AssignDisputeLabelCaseAsync(long sessionId, string caseName, EntityBase organization, long imageCategoryId, long imageBatchId, List<SameBatchLabelerInfo> labelerInfos, AssignMode mode,
  969. AssignType type, List<long> ultrasoundId);
  970. /// <summary>
  971. /// Assign files to labelers for relabeled.
  972. /// </summary>
  973. /// <param name="sessionId">The session id of the admin.</param>
  974. /// <param name="caseName">The label case name.</param>
  975. /// <param name="sameBatchLabelCaseId">The same batch label case id.</param>
  976. /// <param name="assignedLabelCaseId">The assigned label case id.</param>
  977. /// <returns>The assign operation id.</returns>
  978. Task<long> AssignRelabelCaseAsync(long sessionId, string caseName, long sameBatchLabelCaseId, long assignedLabelCaseId, EntityBase imageBatch);
  979. /// <summary>
  980. /// Assign labeled files to reviewers.
  981. /// </summary>
  982. /// <param name="sessionId"></param>
  983. /// <param name="sameBatchLabelCaseId"></param>
  984. /// <param name="reviewers">The labelers to review.</param>
  985. /// <returns></returns>
  986. Task<long> AssignReviewCaseAsync(long sessionId, long sameBatchLabelCaseId, List<EntityBase> reviewers, List<AssignReviewInfo> assignReviewInfos, bool isHideLabelerName, bool isHideReviewerName);
  987. /// <summary>
  988. /// Assign questioned label files to labeler.
  989. /// </summary>
  990. /// <param name="caseName">The label case name.</param>
  991. /// <param name="organization">The organization of label case.</param>
  992. /// <param name="imageCategoryId">The image category id.</param>
  993. /// <returns>The assign operation id.</returns>
  994. //Task<long> AssignQuestionedFilesAsync(long sessionId, EntityBase organization, long imageCategoryId, long imageBatchId, List<EntityBase> labelers, List<AssignQuestionCaseViewModel> assignQuestionCaseViews);
  995. /// <summary>
  996. ///
  997. /// </summary>
  998. /// <param name="sessionId"></param>
  999. /// <param name="organization"></param>
  1000. /// <param name="imageCategoryId"></param>
  1001. /// <param name="imageBatchId"></param>
  1002. /// <param name="labelers"></param>
  1003. /// <param name="assignQuestionCaseViews"></param>
  1004. /// <returns></returns>
  1005. Task<long> AssignQuestionedFilesEachAsync(long sessionId, EntityBase organization, long imageCategoryId, long imageBatchId, List<EntityBase> labelers, List<AssignQuestionCaseViewModel> assignQuestionCaseViews);
  1006. /// <summary>
  1007. /// Assign labeled files to reviewers from Developer Import
  1008. /// </summary>
  1009. /// <param name="sameBatchLabelCaseId"></param>
  1010. /// <param name="isHideLabelerName"></param>
  1011. /// <returns></returns>
  1012. Task<List<AssignedReviewCaseFile>> AssignReviewCaseForDeveloperAsync(long sameBatchLabelCaseId, List<EntityBase> reviewerList, bool isHideLabelerName);
  1013. /// <summary>
  1014. /// Get the progress of the assign operation.
  1015. /// </summary>
  1016. /// <param name="sessionId">The session id of the admin.</param>
  1017. /// <param name="assignId">The id of the assign operation.</param>
  1018. /// <returns>The progress of the assign operation.</returns>
  1019. Task<int> GetAssignImagesProgressAsync(long sessionId, long assignId);
  1020. /// <summary>
  1021. /// Assign label case to labelers again.
  1022. /// </summary>
  1023. /// <param name="sessionId">The id of the session.</param>
  1024. /// <param name="sameBatchLabelCaseId">The same batch label case id.</param>
  1025. /// <param name="labelers">The labelers.</param>
  1026. /// <returns></returns>
  1027. Task<long> AssignLabelCaseAgainAsync(long sessionId, long sameBatchLabelCaseId, List<EntityBase> labelers);
  1028. /// <summary>
  1029. /// Update same batch label case
  1030. /// </summary>
  1031. /// <param name="id">The id of SameBatchLabelCase.</param>
  1032. /// <param name="isHideLabelerName">Whether to hide Labeler Name.</param>
  1033. /// <returns></returns>
  1034. Task UpdateSameBatchLabelCaseAsync(long sessionId, long id, bool isHideLabelerName, bool isHideReviewerName);
  1035. /// <summary>
  1036. /// Set label case to unadoptable
  1037. /// </summary>
  1038. /// <param name="sessionId">The id of the session.</param>
  1039. /// <param name="sameBatchLabelCase">The SameBatchLabelCase.</param>
  1040. /// <returns></returns>
  1041. Task SetSameBatchLabelCaseToUnAdoptableAsync(long sessionId, SameBatchLabelCase sameBatchLabelCase);
  1042. /// <summary>
  1043. /// Clear labeled files
  1044. /// </summary>
  1045. /// <param name="sessionId">The id of the session.</param>
  1046. /// <param name="sameBatchLabelCaseId">The same batch label case id.</param>
  1047. /// <returns></returns>
  1048. Task ClearLabeledFilesAsync(long sessionId, long sameBatchLabelCaseId);
  1049. /// <summary>
  1050. /// Get Qusetion Info By Batch id
  1051. /// </summary>
  1052. /// <param name="batchId"></param>
  1053. /// <param name="sessionId">The id of the session.</param>
  1054. /// <returns></returns>
  1055. Task<List<AssignQuestionCaseViewModel>> GetQusetionInfoByBatchId(long sessionId, long batchId);
  1056. /// <summary>
  1057. /// Delete the label case.
  1058. /// </summary>
  1059. /// <param name="sessionId">The session id of the admin</param>
  1060. /// <param name="caseId">The id of the case.</param>
  1061. /// <returns>Void</returns>
  1062. Task DeleteLabelCaseAsync(long sessionId, long caseId);
  1063. /// <summary>
  1064. /// Move up the label case.
  1065. /// </summary>
  1066. /// <param name="sessionId">The session id of the admin</param>
  1067. /// <param name="caseId">The id of the case.</param>
  1068. /// <returns>Void</returns>
  1069. Task MoveUpLabelCaseAsync(long sessionId, long caseId);
  1070. /// <summary>
  1071. /// Move down the label case.
  1072. /// </summary>
  1073. /// <param name="sessionId">The session id of the admin</param>
  1074. /// <param name="caseId">The id of the case.</param>
  1075. /// <returns>Void</returns>
  1076. Task MoveDownLabelCaseAsync(long sessionId, long caseId);
  1077. #endregion Assigned Label Case
  1078. #region Assigned Review Case
  1079. /// <summary>
  1080. /// Get cases which assigned to a reviewer.
  1081. /// </summary>
  1082. /// <param name="sessionId">The session id of the admin</param>
  1083. /// <param name="reviewerId">The id of the reviewer.</param>
  1084. /// <returns>The cases of the labeler.</returns>
  1085. Task<List<AssignedReviewCase>> GetAssignedReviewCasesByReviewerIdAsync(long sessionId, long reviewerId, int pageIndex, int pageSize, string keyword);
  1086. /// <summary>
  1087. /// Get all assignedReviewCases count of one reviewer.
  1088. /// </summary>
  1089. /// <param name="reviewerId">The reviewerId which the cases assigned to.</param>
  1090. /// <returns>The assigned review case count.</returns>
  1091. Task<int> GetAssignedReviewCaseCountAsync(long sessionId, long reviewerId, string keyword);
  1092. /// <summary>
  1093. /// Delete the review case.
  1094. /// </summary>
  1095. /// <param name="sessionId">The session id of the admin</param>
  1096. /// <param name="caseId">The id of the case.</param>
  1097. /// <returns>Void</returns>
  1098. Task DeleteReviewCaseAsync(long sessionId, long caseId);
  1099. /// <summary>
  1100. /// Move up the review case.
  1101. /// </summary>
  1102. /// <param name="sessionId">The session id of the admin</param>
  1103. /// <param name="caseId">The id of the case.</param>
  1104. /// <returns>Void</returns>
  1105. Task MoveUpReviewCaseAsync(long sessionId, long caseId);
  1106. /// <summary>
  1107. /// Move down the review case.
  1108. /// </summary>
  1109. /// <param name="sessionId">The session id of the admin</param>
  1110. /// <param name="caseId">The id of the case.</param>
  1111. /// <returns>Void</returns>
  1112. Task MoveDownReviewCaseAsync(long sessionId, long caseId);
  1113. /// <summary>
  1114. /// Relabel and reassign label case to labeler.
  1115. /// </summary>
  1116. /// <param name="sessionId">The session id of the admin</param>
  1117. /// <param name="caseName">The same batch label case name.</param>
  1118. /// <param name="labeler">The labeler.</param>
  1119. /// <param name="isHideReviewerName">The value to indicate whether the labeler client hide reviewer name.</param>
  1120. /// <param name="sourceAssignedLabelCaseId">The source assign label case id.</param>
  1121. /// <returns></returns>
  1122. Task<long> RelabelReassignedLabelCaseAsync(long sessionId, string caseName, EntityBase labeler, bool isHideReviewerName, long organizationId, long imageCategoryId, long imageCaseId, long sourceAssignedLabelCaseId, List<long> LabeledUltrasoundFileId = null, long reLabelRecordId = 0, long reLabelRecourdCountId = 0);
  1123. #endregion Assigned Review Case
  1124. #region ReviewerClient
  1125. /// <summary>
  1126. /// Add one reviewer client.
  1127. /// </summary>
  1128. /// <param name="version">The version of reviewer client.</param>
  1129. /// <param name="description">The description of reviewer client.</param>
  1130. /// <param name="clientData">The data of the reviewer client.</param>
  1131. /// <returns></returns>
  1132. Task AddReviewerClientAsync(long sessionId, string fileName, string version, string description, byte[] clientData);
  1133. /// <summary>
  1134. /// Set the reviewer client info to the default one.
  1135. /// </summary>
  1136. /// <param name="sessionId">The id of the session.</param>
  1137. /// <param name="reviewerClientInfoId">The reviewer clientInfo id</param>
  1138. /// <returns></returns>
  1139. Task SetDefaultReviewerClientAsync(long sessionId, long reviewerClientInfoId);
  1140. /// <summary>
  1141. /// Get the reviewer client infos.
  1142. /// </summary>
  1143. /// <param name="sessionId">The id of the session.</param>
  1144. /// <returns>The found reviewer client infos.</returns>
  1145. Task<List<ClientUpgradeInfo>> GetReviewerClientInfosAsync(long sessionId, int pageIndex, int pageSize, string keyword);
  1146. /// <summary>
  1147. /// Get all reviewer client infos count.
  1148. /// </summary>
  1149. /// <returns>All reviewer client infos count.</returns>
  1150. Task<int> GetReviewerClientInfosCountAsync(long sessionId);
  1151. /// <summary>
  1152. /// Delete the reviewer client info.
  1153. /// </summary>
  1154. /// <param name="sessionId">The id of the session.</param>
  1155. /// <param name="labelerClientInfoId">The reviewer client info's id</param>
  1156. /// <returns></returns>
  1157. Task DeleteReviewerClientInfoAsync(long sessionId, long reviewerClientInfoId);
  1158. /// <summary>
  1159. /// Get the reviewer client info by version.
  1160. /// </summary>
  1161. /// <param name="sessionId">The id of the session.</param>
  1162. /// <param name="version">The version of the reviewer client info..</param>
  1163. /// <returns>The reivewer client infos.</returns>
  1164. Task<ClientUpgradeInfo> GetReviewerClientInfoByVersionAsync(long sessionId, string version);
  1165. #endregion ReviewerClient
  1166. #region Train Tasks
  1167. /// <summary>
  1168. /// Get the train tasks count by keyword.
  1169. /// </summary>
  1170. /// <param name="keyword">The searched keyword.</param>
  1171. /// <returns>The searched train tasks count.</returns>
  1172. Task<int> GetTrainTasksCountAsync(long sessionId, string keyword);
  1173. /// <summary>
  1174. /// Gets train tasks.
  1175. /// </summary>
  1176. /// <param name="sessionId">The id of the session.</param>
  1177. /// <param name="keyword">The searched key word.</param>
  1178. /// <returns>The searched train tasks.</returns>
  1179. Task<List<TrainTaskModel>> GetTrainTasksAsync(long sessionId, int pageIndex, int pageSize, string keyword);
  1180. /// <summary>
  1181. /// Cancel train task.
  1182. /// </summary>
  1183. /// <param name="sessionId">The id of the session.</param>
  1184. /// <param name="trainTaskId">The id of the train task.</param>
  1185. /// <returns></returns>
  1186. Task CancelTrainTaskAsync(long sessionId, long trainTaskId);
  1187. /// <summary>
  1188. /// Delete a train task from the system.
  1189. /// </summary>
  1190. /// <param name="sessionId">The id of the session.</param>
  1191. /// <param name="trainTaskId">The id of the train task to be deleted.</param>
  1192. /// <returns>Void</returns>
  1193. Task DeleteTrainTaskAsync(long sessionId, long trainTaskId);
  1194. #endregion Train Tasks
  1195. #region LabelerStatistics
  1196. /// <summary>
  1197. /// Get labelers' label statistics.
  1198. /// </summary>
  1199. /// <param name="start">The start time</param>
  1200. /// <param name="end">The end time</param>
  1201. /// <returns>The labelers' label statistics.</returns>
  1202. Task<List<LabelerLabelStatistic>> GetLabelerStatisticsAsync(long sessionId, int pageIndex, int pageSize, string keyword, long organizationId, long imageCategoryId, DateTime start, DateTime end);
  1203. /// <summary>
  1204. /// Get labelers' label Groups count.
  1205. /// </summary>
  1206. /// <param name="keyword">The searched keyword.</param>
  1207. /// <returns>The labelers' label Groups count</returns>
  1208. Task<int> GetLabelerGroupsCountAsync(long sessionId, string keyword, long organizationId, long imageCategoryId);
  1209. #endregion LabelerStatistics
  1210. #region Developer client
  1211. /// <summary>
  1212. /// Add one developer client.
  1213. /// </summary>
  1214. /// <param name="version">The version of developer client.</param>
  1215. /// <param name="description">The description of developer client.</param>
  1216. /// <param name="clientData">The data of the developer client.</param>
  1217. /// <returns></returns>
  1218. Task AddDeveloperClientAsync(long sessionId, string fileName, string version, string description, byte[] clientData);
  1219. /// <summary>
  1220. /// Set the developer client info to the default one.
  1221. /// </summary>
  1222. /// <param name="sessionId">The id of the session.</param>
  1223. /// <param name="developerClientInfoId">The developer clientInfo id</param>
  1224. /// <returns></returns>
  1225. Task SetDefaultDeveloperClientAsync(long sessionId, long developerClientInfoId);
  1226. /// <summary>
  1227. /// Get the developer client infos.
  1228. /// </summary>
  1229. /// <param name="sessionId">The id of the session.</param>
  1230. /// <returns>The found developer client infos.</returns>
  1231. Task<List<ClientUpgradeInfo>> GetDeveloperClientInfosAsync(long sessionId, int pageIndex, int pageSize, string keyword);
  1232. /// <summary>
  1233. /// Get all developer client infos.
  1234. /// </summary>
  1235. /// <param name="sessionId">The id of the session.</param>
  1236. /// <returns>All developer client infos.</returns>
  1237. Task<int> GetDeveloperClientInfosCountAsync(long sessionId);
  1238. /// <summary>
  1239. /// Delete the developer client info.
  1240. /// </summary>
  1241. /// <param name="sessionId">The id of the session.</param>
  1242. /// <param name="developerClientInfoId">The developer client info's id</param>
  1243. /// <returns></returns>
  1244. Task DeleteDeveloperClientInfoAsync(long sessionId, long developerClientInfoId);
  1245. /// <summary>
  1246. /// Get the developer client info by version.
  1247. /// </summary>
  1248. /// <param name="sessionId">The id of the session.</param>
  1249. /// <param name="version">The version of the developer client info..</param>
  1250. /// <returns>The reivewer client infos.</returns>
  1251. Task<ClientUpgradeInfo> GetDeveloperClientInfoByVersionAsync(long sessionId, string version);
  1252. #endregion Developer client
  1253. #region Authority Menu
  1254. /// <summary>
  1255. /// Get all system menus.
  1256. /// </summary>
  1257. /// <param name="sessionId"></param>
  1258. /// <returns></returns>
  1259. Task<List<AuthorityMenu>> GetAuthorityMenusAsync(long sessionId);
  1260. /// <summary>
  1261. /// Get defaulr authorities
  1262. /// </summary>
  1263. /// <returns></returns>
  1264. Task<List<AuthorityMenu>> GetDefaultAuthorityMenusAsync(long sessionId);
  1265. #endregion Authority Menu
  1266. #region image category
  1267. /// <summary>
  1268. /// Create a image category.
  1269. /// </summary>
  1270. /// <returns></returns>
  1271. Task<ImageCategory> CreateImageCategoryAsync(long sessionId, string name, CategoryLevel level, EntityBase parent, long organizatinId, long labelPackageContentId, long sameBatchLabelCaseId);
  1272. /// <summary>
  1273. /// Delete a image category.
  1274. /// </summary>
  1275. /// <returns>Void</returns>
  1276. Task DeleteImageCategoryAsync(long sessionId, long id);
  1277. /// <summary>
  1278. /// Get the image category by id.
  1279. /// </summary>
  1280. /// <param name="id">The searched id.</param>
  1281. /// <returns>The loaded image category.</returns>
  1282. Task<ImageCategory> GetImageCategoryAsync(long sessionId, long id);
  1283. /// <summary>
  1284. /// Get the image categories count by keyword.
  1285. /// </summary>
  1286. /// <param name="keyword">The searched keyword.</param>
  1287. /// <returns>The found image categories count.</returns>
  1288. Task<int> GetImageCategoriesCountAsync(long sessionId, string keyword);
  1289. /// <summary>
  1290. /// Get the image categories by keyword.
  1291. /// </summary>
  1292. /// <param name="keyword">The searched keyword.</param>
  1293. /// <returns>The loaded image categories.</returns>
  1294. Task<List<ImageCategory>> GetImageCategoriesAsync(long sessionId, int pageIndex, int pageSize, string keyword);
  1295. /// <summary>
  1296. /// Get all image categories.
  1297. /// </summary>
  1298. /// <param name="keyword">The searched keyword.</param>
  1299. /// <returns>The loaded image categories.</returns>
  1300. Task<List<ImageCategory>> GetImageCategoriesAsync(long sessionId, string keyword);
  1301. /// <summary>
  1302. /// Get the image categories by parent id.
  1303. /// </summary>
  1304. /// <param name="parentId">The searched parent id.</param>
  1305. /// <returns>The loaded image categories.</returns>
  1306. Task<List<ImageCategory>> GetImageCategoriesByParentIdAsync(long sessionId, long parentId);
  1307. /// <summary>
  1308. /// Get the image categories by category level.
  1309. /// </summary>
  1310. /// <param name="level">The searched category level.</param>
  1311. /// <returns>The loaded image categories.</returns>
  1312. Task<List<ImageCategory>> GetImageCategoriesByLevelAsync(long sessionId, CategoryLevel level);
  1313. /// <summary>
  1314. /// Get the cases of image categories by parent id.
  1315. /// </summary>
  1316. /// <param name="parentId">The searched parent id.</param>
  1317. /// <returns>The loaded image categories.</returns>
  1318. Task<List<ImageCategory>> GetImageCategoriesWithRelabeledCaseByParentIdAsync(long sessionId, long parentId);
  1319. /// <summary>
  1320. /// Get the image categories by labelPackageId.
  1321. /// </summary>
  1322. /// <param name="labelPackageId">The label package id.</param>
  1323. /// <returns>The loaded ImageCategories</returns>
  1324. Task<List<ImageCategory>> GetImageCategoriesHasChildrenAsync(long sessionId, long labelPackageId);
  1325. /// <summary>
  1326. /// Update the image category hasChildren in system.
  1327. /// </summary>
  1328. /// <returns></returns>
  1329. Task UpdateImageCategoryHasChildrenAsync(long sessionId, long id, bool hasChildren);
  1330. /// <summary>
  1331. /// Update the image category that assigned users in system.
  1332. /// </summary>
  1333. /// <returns></returns>
  1334. Task UpdateImageCategoryUsersAsync(long sessionId, long id, AccountType accountType, List<EntityBase> users);
  1335. /// <summary>
  1336. /// Update the image category gold standard and self-check image quantity item in system.
  1337. /// </summary>
  1338. /// <returns></returns>
  1339. Task UpdateImageCategoryGoldStandardAndSelfCheckQuantityItemAsync(long sessionId, long id, double goldStandardProportion, int goldStandardQualifiedPeople, double selfCheckProportion, bool isSupportedSkipFrame, VideoItem videoItem, DifficultyLevel difficultyLevel);
  1340. #endregion image category
  1341. #region Developer share info
  1342. /// <summary>
  1343. /// Gets the developer share infos by keyword.
  1344. /// </summary>
  1345. /// <param name="keyword">The searched keyword.</param>
  1346. /// <returns>The loaded developer share infos.</returns>
  1347. Task<List<DeveloperShareInfo>> GetDeveloperShareInfosAsync(long sessionId, int pageIndex, int pageSize, string keyword);
  1348. /// <summary>
  1349. /// Gets the developer share infos count by keyword.
  1350. /// </summary>
  1351. /// <param name="keyword">The searched keyword.</param>
  1352. /// <returns>The loaded ldeveloper share infos count.</returns>
  1353. Task<int> GetDeveloperShareInfosCountAsync(long sessionId, string keyword);
  1354. /// <summary>
  1355. /// Update shared developer folder
  1356. /// </summary>
  1357. /// <param name="folderId">The developer folder id</param>
  1358. /// <param name="state">The approval state</param>
  1359. /// <returns></returns>
  1360. Task UpdateSharedDeveloperFolderAsync(long sessionId, long id, ApprovalState state);
  1361. #endregion Developer share info
  1362. /// <summary>
  1363. /// Get TreatingProcess by ultrasoundId
  1364. /// </summary>
  1365. /// <param name="sessionId"></param>
  1366. /// <param name="ultrasoundId"></param>
  1367. /// <returns></returns>
  1368. Task<TreatingProcess> GetTreatingProcessByultrasoundId(long sessionId, long ultrasoundId);
  1369. /// <summary>
  1370. /// Get ReLabelRecord By SameBatchLabelCaseI
  1371. /// </summary>
  1372. /// <param name="sessionId"></param>
  1373. /// <param name="SameBatchLabelCaseId"></param>
  1374. /// <returns></returns>
  1375. Task<List<ReLabelRecord>> GetReLabelRecordBySameBatchLabelCaseId(long sessionId, long SameBatchLabelCaseId);
  1376. /// <summary>
  1377. /// 重新分配审核人员
  1378. /// </summary>
  1379. /// <param name="sessionId"></param>
  1380. /// <param name="assignedLabelCaseId"></param>
  1381. /// <param name="laberUltrasoundFileIds"></param>
  1382. /// <param name="reviewer"></param>
  1383. /// <param name="ImageCategoryId"></param>
  1384. /// <param name="reLabelRecordId"></param>
  1385. /// <param name="reLabelRecordCountId"></param>
  1386. /// <returns></returns>
  1387. Task ReAssignReviewCaseAsync(long sessionId, long assignedLabelCaseId, List<long> laberUltrasoundFileIds, EntityBase reviewer, long ImageCategoryId, long reLabelRecordCountId, long reLabelRecordId);
  1388. #region 呼吸机数据管理
  1389. /// <summary>
  1390. /// Add un-labeled Ventilator file into the system.
  1391. /// </summary>
  1392. /// <param name="sessionId">The sessionId of the admin</param>
  1393. /// <returns>Void</returns>
  1394. Task<VentilatorOpResult> AddUnLabeledVentilatorFileAsync(long sessionId, long organizationId, VentilatorFile ventilatorFile, byte[] fileData, string fileName);
  1395. /// <summary>
  1396. /// upload un-labeled Ventilator file into the system.
  1397. /// </summary>
  1398. /// <param name="sessionId">The sessionId of the admin</param>
  1399. /// <returns>Void</returns>
  1400. Task<OpResult> UploadUnLabeledVentilatorFileAsync(long sessionId, VentilatorFile ventilatorFile);
  1401. /// <summary>
  1402. /// 获取呼吸文件数量
  1403. /// </summary>
  1404. /// <param name="sessionId">The sessionId of the admin</param>
  1405. /// <returns></returns>
  1406. Task<int> GetVentilatorFilesCountAsync(long sessionId, SearchVentilatorFileModel searchModel);
  1407. /// <summary>
  1408. /// 获取呼吸文件.
  1409. /// <param name="sessionId">The sessionId of the admin</param>
  1410. /// <param name="pageIndex">The index of page.</param>
  1411. /// <param name="pageSize">The item count per page.</param>
  1412. /// </summary>
  1413. Task<List<VentilatorFile>> GetVentilatorFilesAsync(long sessionId, int pageIndex, int pageSize, SearchVentilatorFileModel searchModel);
  1414. /// <summary>
  1415. /// 获取呼吸文件.
  1416. /// <param name="sessionId">The sessionId of the admin</param>
  1417. /// <param name="ventilatorId">The index of page.</param>
  1418. /// </summary>
  1419. Task<VentilatorFile> GetVentilatorFileByIdAsync(long sessionId, long ventilatorId);
  1420. /// <summary>
  1421. /// 更新呼吸文件.
  1422. /// <param name="sessionId">The sessionId of the admin</param>
  1423. /// <param name="ventilatorFile">The ventilator file.</param>
  1424. /// </summary>
  1425. Task UpdateVentilatorFileByIdAsync(long sessionId, VentilatorFile ventilatorFile);
  1426. /// <summary>
  1427. /// Download the Ventilator Files
  1428. /// </summary>
  1429. /// <param name="sessionId">The id of the session.</param>
  1430. /// <param name="ventilatorIdList"></param>
  1431. /// <param name="deviceParameterList"></param>
  1432. /// <returns></returns>
  1433. Task<byte[]> DownloadVentilatorFilesAsync(long sessionId, List<long> ventilatorIdList, List<DeviceParameter> deviceParameterList);
  1434. /// <summary>
  1435. /// Get the VentilatorFileVersion count.
  1436. /// </summary>
  1437. /// <param name="sessionId">The id of the session.</param>
  1438. /// <param name="ventilatorFileId">The id of the ventilator file.</param>
  1439. /// <returns>The count of the VentilatorFileVersion.</returns>
  1440. Task<int> GetVentilatorFileVersionCountAsync(long sessionId, long ventilatorFileId);
  1441. /// <summary>
  1442. /// Get VentilatorFileVersion items.
  1443. /// </summary>
  1444. /// <param name="sessionId">The id of the session.</param>
  1445. /// <param name="pageIndex">The index of the page.</param>
  1446. /// <param name="pageSize">The size of the page.</param>
  1447. /// <returns>The loaded VentilatorFileVersions</returns>
  1448. Task<List<VentilatorFileVersion>> GetVentilatorFileVersionsAsync(long sessionId, long ventilatorFileId, int pageIndex, int pageSize);
  1449. /// <summary>
  1450. /// 删除呼吸文件.
  1451. /// <param name="sessionId">The sessionId of the admin</param>
  1452. /// <param name="ventilatorFileId">The ventilator file id</param>
  1453. /// </summary>
  1454. Task DeleteVentilatorFileByIdAsync(long sessionId, long ventilatorFileId);
  1455. /// <summary>
  1456. /// 同步呼吸机文件
  1457. /// </summary>
  1458. /// <param name="sessionId"></param>
  1459. /// <returns></returns>
  1460. Task<OpResult> SyncVentilatorFilesAsync(long sessionId, long organizationId);
  1461. /// <summary>
  1462. /// 获取呼吸机参数信息
  1463. /// </summary>
  1464. /// <param name="sessionId"></param>
  1465. /// <param name="ventilatorFileId"></param>
  1466. /// <returns></returns>
  1467. Task<VentilatorParameterInfo> GetVentilatorParameterInfoByIdAsync(long sessionId, long ventilatorFileId);
  1468. #endregion 呼吸机数据管理
  1469. #region HandyToolClient
  1470. /// <summary>
  1471. /// Add one HandyTool client.
  1472. /// </summary>
  1473. /// <param name="version">The version of HandyTool client.</param>
  1474. /// <param name="description">The description of HandyTool client.</param>
  1475. /// <param name="clientData">The data of the HandyTool client.</param>
  1476. /// <returns></returns>
  1477. Task AddHandyToolClientAsync(long sessionId, string fileName, string version, string description, byte[] clientData);
  1478. /// <summary>
  1479. /// Set the HandyTool client info to the default one.
  1480. /// </summary>
  1481. /// <param name="sessionId">The id of the session.</param>
  1482. /// <param name="HandyToolClientInfoId">The HandyTool clientInfo id</param>
  1483. /// <returns></returns>
  1484. Task SetDefaultHandyToolClientAsync(long sessionId, long HandyToolClientInfoId);
  1485. /// <summary>
  1486. /// Get the HandyTool client infos.
  1487. /// </summary>
  1488. /// <param name="sessionId">The id of the session.</param>
  1489. /// <returns>The found HandyTool client infos.</returns>
  1490. Task<List<ClientUpgradeInfo>> GetHandyToolClientInfosAsync(long sessionId, int pageIndex, int pageSize, string keyword);
  1491. /// <summary>
  1492. /// Get all HandyTool client infos count.
  1493. /// </summary>
  1494. /// <returns>All HandyTool client infos count.</returns>
  1495. Task<int> GetHandyToolClientInfosCountAsync(long sessionId);
  1496. /// <summary>
  1497. /// Delete the HandyTool client info.
  1498. /// </summary>
  1499. /// <param name="sessionId">The id of the session.</param>
  1500. /// <param name="labelerClientInfoId">The HandyTool client info's id</param>
  1501. /// <returns></returns>
  1502. Task DeleteHandyToolClientInfoAsync(long sessionId, long HandyToolClientInfoId);
  1503. /// <summary>
  1504. /// Get the HandyTool client info by version.
  1505. /// </summary>
  1506. /// <param name="sessionId">The id of the session.</param>
  1507. /// <param name="version">The version of the HandyTool client info..</param>
  1508. /// <returns>The reivewer client infos.</returns>
  1509. Task<ClientUpgradeInfo> GetHandyToolClientInfoByVersionAsync(long sessionId, string version);
  1510. #endregion HandyToolClient
  1511. #region GatherCategory
  1512. /// <summary>
  1513. /// Create a new GatherCategory
  1514. /// </summary>
  1515. /// <param name="sessionId"></param>
  1516. /// <param name="name"></param>
  1517. /// <param name="organziation"></param>
  1518. /// <param name="gatherers"></param>
  1519. /// <returns></returns>
  1520. Task CreateGatherCategoryAsync(long sessionId, string name, EntityBase organziation, List<EntityBase> gatherers);
  1521. /// <summary>
  1522. /// Update a GatherCategory
  1523. /// </summary>
  1524. /// <param name="sessionId"></param>
  1525. /// <param name="id"></param>
  1526. /// <param name="name"></param>
  1527. /// <param name="gatherers"></param>
  1528. /// <returns></returns>
  1529. Task UpdateGatherCategoryAsync(long sessionId, long id, string name, List<EntityBase> gatherers);
  1530. /// <summary>
  1531. /// Get GatherCategory by id
  1532. /// </summary>
  1533. /// <param name="sessionId"></param>
  1534. /// <returns></returns>
  1535. Task<GatherCategory> GetGatherCategoryByIdAsync(long sessionId, long id);
  1536. /// <summary>
  1537. /// Get the GatherCategories
  1538. /// </summary>
  1539. /// <param name="sessionId"></param>
  1540. /// <param name="pageIndex"></param>
  1541. /// <param name="pageSize"></param>
  1542. /// <param name="searchGatherCategoryModel"></param>
  1543. /// <returns></returns>
  1544. Task<List<GatherCategory>> GetGatherCategoriesAsync(long sessionId, int pageIndex, int pageSize, SearchGatherCategoryModel searchGatherCategoryModel);
  1545. /// <summary>
  1546. /// Get the GatherCategories Count
  1547. /// </summary>
  1548. /// <param name="id"></param>
  1549. /// <param name="searchGatherCategoryModel"></param>
  1550. /// <returns></returns>
  1551. Task<long> GetGatherCategoriesCountAsync(long sessionId, SearchGatherCategoryModel searchGatherCategoryModel);
  1552. /// <summary>
  1553. /// Get the GatherCategories by OrganizationId
  1554. /// </summary>
  1555. /// <param name="id"></param>
  1556. /// <param name="organizationId"></param>
  1557. /// <returns></returns>
  1558. Task<List<GatherCategory>> GetGatherCategoriesByOrganizationIdAsync(long id, long organizationId);
  1559. /// <summary>
  1560. /// Create Gather Data
  1561. /// </summary>
  1562. /// <param name="sessionId"></param>
  1563. /// <param name="category"></param>
  1564. /// <param name="organization"></param>
  1565. /// <param name="gatherer"></param>
  1566. /// <param name="modelType"></param>
  1567. /// <param name="source"></param>
  1568. /// <param name="collectionQuantity"></param>
  1569. /// <param name="startTime"></param>
  1570. /// <param name="endTime"></param>
  1571. /// <param name="SettlementTime"></param>
  1572. /// <returns></returns>
  1573. Task CreateGatherDataAsync(long sessionId, CategoryItem category, EntityBase organization, EntityBase gatherer, string modelType, string source, int collectionQuantity, DateTime startTime, DateTime endTime, DateTime SettlementTime);
  1574. /// <summary>
  1575. /// Update Gather Data
  1576. /// </summary>
  1577. /// <param name="sessionId"></param>
  1578. /// <param name="id"></param>
  1579. /// <param name="category"></param>
  1580. /// <param name="organization"></param>
  1581. /// <param name="gatherer"></param>
  1582. /// <param name="modelType"></param>
  1583. /// <param name="source"></param>
  1584. /// <param name="collectionQuantity"></param>
  1585. /// <param name="startTime"></param>
  1586. /// <param name="endTime"></param>
  1587. /// <param name="SettlementTime"></param>
  1588. /// <returns></returns>
  1589. Task UpdateGatherDataAsync(long sessionId, long id, CategoryItem category, EntityBase organization, EntityBase gatherer, string modelType, string source, int collectionQuantity, DateTime startTime, DateTime endTime, DateTime SettlementTime);
  1590. /// <summary>
  1591. /// Get Gather Data by id
  1592. /// </summary>
  1593. /// <param name="sessionId"></param>
  1594. /// <returns></returns>
  1595. Task<GatherData> GetGatherDataByIdAsync(long sessionId, long id);
  1596. /// <summary>
  1597. /// Get the Gather Datas
  1598. /// </summary>
  1599. /// <param name="sessionId"></param>
  1600. /// <param name="pageIndex"></param>
  1601. /// <param name="pageSize"></param>
  1602. /// <param name="searchGatherDataModel"></param>
  1603. /// <returns></returns>
  1604. Task<List<GatherData>> GetGatherDatasAsync(long sessionId, int pageIndex, int pageSize, SearchGatherDataModel searchGatherDataModel);
  1605. /// <summary>
  1606. /// Get the Gather Data Count
  1607. /// </summary>
  1608. /// <param name="sessionId"></param>
  1609. /// <param name="searchGatherDataModel"></param>
  1610. /// <returns></returns>
  1611. Task<long> GetGatherDatasCountAsync(long sessionId, SearchGatherDataModel searchGatherDataModel);
  1612. #endregion GatherCategory
  1613. #region 定价管理
  1614. /// <summary>
  1615. /// 获取个体定价数据
  1616. /// </summary>
  1617. /// <param name="organizationId">组织Id</param>
  1618. /// <param name="type">标注/审核/采集类型</param>
  1619. /// <returns></returns>
  1620. Task<List<IndividualPrice>> GetIndividualPricesAsync(long sessionId, long organizationId, DataProcessingType type);
  1621. /// <summary>
  1622. /// 新增个体定价
  1623. /// </summary>
  1624. /// <param name="item"></param>
  1625. /// <returns></returns>
  1626. Task CreateIndividualPriceAsync(long sessionId, IndividualPrice item);
  1627. /// <summary>
  1628. /// 更新个体定价
  1629. /// </summary>
  1630. /// <param name="price"></param>
  1631. /// <returns></returns>
  1632. Task UpdateIndividualPriceAsync(long sessionId, long id, double price);
  1633. /// <summary>
  1634. /// 获取个体系数
  1635. /// </summary>
  1636. /// <param name="pageIndex">The index of page.</param>
  1637. /// <param name="pageSize">The item count per page.</param>
  1638. /// <param name="keyword">The searched keyword.</param>
  1639. /// <returns>The loaded developers.</returns>
  1640. Task<List<IndividualCoefficient>> GetIndividualCoefficientsAsync(long sessionId, int pageIndex, int pageSize, string keyword, long organizationId);
  1641. /// <summary>
  1642. /// 获取个体系数数量
  1643. /// </summary>
  1644. /// <param name="keyword">The searched keyword.</param>
  1645. /// <returns>The developer count.</returns>
  1646. Task<int> GetIndividualCoefficientsCountAsync(long sessionId, string keyword, long organizationId);
  1647. /// <summary>
  1648. /// 新增个体系数
  1649. /// </summary>
  1650. /// <param name="item"></param>
  1651. /// <returns></returns>
  1652. Task CreateIndividualCoefficientAsync(long sessionId, IndividualCoefficient item);
  1653. /// <summary>
  1654. /// 更新个体系数
  1655. /// </summary>
  1656. /// <param name="item"></param>
  1657. /// <returns></returns>
  1658. Task UpdateIndividualCoefficientAsync(long sessionId, long id, double labelPriceCoefficient, double labelQuantityCoefficient, DateTime? startEffectiveTime, DateTime? endEffectiveTime);
  1659. /// <summary>
  1660. /// 删除个体系数
  1661. /// </summary>
  1662. /// <returns></returns>
  1663. Task DeleteIndividualCoefficientAsync(long sessionId, long id);
  1664. /// <summary>
  1665. /// 获取机构定价
  1666. /// </summary>
  1667. /// <param name="pageIndex">The index of page.</param>
  1668. /// <param name="pageSize">The item count per page.</param>
  1669. /// <returns>The loaded developers.</returns>
  1670. Task<List<InstitutionalPrice>> GetInstitutionalPricesAsync(long sessionId, int pageIndex, int pageSize, long organizationId, long institutionId);
  1671. /// <summary>
  1672. /// 获取机构定价数量
  1673. /// </summary>
  1674. /// <returns>The developer count.</returns>
  1675. Task<int> GetInstitutionalPricesCountAsync(long sessionId, long organizationId, long institutionId);
  1676. /// <summary>
  1677. /// 新增机构定价
  1678. /// </summary>
  1679. /// <param name="item"></param>
  1680. /// <returns></returns>
  1681. Task CreateInstitutionalPriceAsync(long sessionId, InstitutionalPrice item);
  1682. /// <summary>
  1683. /// 更新机构定价
  1684. /// </summary>
  1685. /// <param name="item"></param>
  1686. /// <returns></returns>
  1687. Task UpdateInstitutionalPriceAsync(long sessionId, long id, double labelPrice, double reviewPrice, double gatherPrice, double labelPriceCoefficient, double labelQuantityCoefficient, DateTime? startEffectiveTime, DateTime? endEffectiveTime);
  1688. /// <summary>
  1689. /// 删除机构定价
  1690. /// </summary>
  1691. /// <returns></returns>
  1692. Task DeleteInstitutionalPriceAsync(long sessionId, long id);
  1693. /// <summary>
  1694. /// 创建定价相关操作记录
  1695. /// </summary>
  1696. /// <param name="item"></param>
  1697. /// <returns></returns>
  1698. Task CreatePricingOperateLogAsync(long sessionId, PricingOperateLog item);
  1699. /// <summary>
  1700. /// 获取定价相关操作记录
  1701. /// </summary>
  1702. /// <returns></returns>
  1703. Task<List<PricingOperateLog>> GetPricingOperateLogsAsync(long sessionId, int pageIndex, int pageSize, long id, PricingType type);
  1704. /// <summary>
  1705. /// 获取定价相关操作记录数量
  1706. /// </summary>
  1707. /// <returns></returns>
  1708. Task<int> GetPricingOperateLogsCountAsync(long sessionId, long id, PricingType type);
  1709. #endregion 定价管理
  1710. }
  1711. }