ClientController.java 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. package com.qmth.distributed.print.api;
  2. import com.baomidou.mybatisplus.core.metadata.IPage;
  3. import com.qmth.boot.api.annotation.Aac;
  4. import com.qmth.boot.api.annotation.BOOL;
  5. import com.qmth.boot.api.constant.ApiConstant;
  6. import com.qmth.distributed.print.business.bean.dto.ClientExamStudentDto;
  7. import com.qmth.distributed.print.business.bean.dto.ClientExamTaskDto;
  8. import com.qmth.distributed.print.business.bean.dto.ClientPrintTaskDto;
  9. import com.qmth.distributed.print.business.entity.SysUser;
  10. import com.qmth.distributed.print.business.service.*;
  11. import com.qmth.distributed.print.common.util.Result;
  12. import com.qmth.distributed.print.common.util.ResultUtil;
  13. import io.swagger.annotations.Api;
  14. import io.swagger.annotations.ApiOperation;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.web.bind.annotation.*;
  17. import java.util.List;
  18. import java.util.Map;
  19. /**
  20. * @Date: 2021/4/19.
  21. */
  22. @Api(tags = "客户端Controller")
  23. @RestController
  24. @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.client}")
  25. @Aac(auth = BOOL.FALSE)
  26. public class ClientController {
  27. @Autowired
  28. private ClientService clientService;
  29. /**
  30. * 登录
  31. *
  32. * @param sysUser
  33. * @return
  34. */
  35. @ApiOperation(value = "登录")
  36. @RequestMapping(value = "/user/login", method = RequestMethod.POST)
  37. public Result login(@RequestBody SysUser sysUser) {
  38. return null;
  39. }
  40. /**
  41. * 试卷打样-列表
  42. *
  43. * @param schoolId 学校ID
  44. * @param machineCode 机器唯一码
  45. * @param orgId 机构ID
  46. * @param printPlanId 印刷计划ID
  47. * @param courseCode 课程代码
  48. * @param paperNumber 试卷编号
  49. * @param isTry 是否打样
  50. * @param isPass 是否合格
  51. * @param pageNumber
  52. * @param pageSize
  53. * @return
  54. */
  55. @ApiOperation(value = "试卷打样-列表")
  56. @RequestMapping(value = "/paper_try/list", method = RequestMethod.POST)
  57. public Result paperTryList(@RequestParam("schoolId") Long schoolId,
  58. @RequestParam("machineCode") String machineCode,
  59. @RequestParam("orgId") Long orgId,
  60. @RequestParam(value = "printPlanId", required = false) Long printPlanId,
  61. @RequestParam(value = "courseCode", required = false) String courseCode,
  62. @RequestParam(value = "paperNumber", required = false) String paperNumber,
  63. @RequestParam(value = "isTry", required = false) Boolean isTry,
  64. @RequestParam(value = "isPass", required = false) Boolean isPass,
  65. @RequestParam("pageNumber") Integer pageNumber,
  66. @RequestParam("pageSize") Integer pageSize) {
  67. IPage<ClientExamTaskDto> examTasks = clientService.listTryTask(schoolId, machineCode, orgId, printPlanId, courseCode, paperNumber, isTry, isPass, pageNumber, pageSize);
  68. return ResultUtil.ok(examTasks);
  69. }
  70. /**
  71. * 试卷打样-查看/试印/重印
  72. *
  73. * @param schoolId
  74. * @param examTaskId
  75. * @return
  76. */
  77. @ApiOperation(value = "试卷打样-查看/试印/重印")
  78. @RequestMapping(value = "/paper_try/print", method = RequestMethod.POST)
  79. public Result paperTryPrint(@RequestParam("schoolId") Long schoolId,
  80. @RequestParam("examTaskId") Long examTaskId) {
  81. String url = clientService.getUrl(schoolId, examTaskId);
  82. return ResultUtil.ok(url);
  83. }
  84. /**
  85. * 试卷打样-标记合格状态
  86. *
  87. * @param schoolId
  88. * @param examTaskId
  89. * @param machineCode
  90. * @param isPass
  91. * @param userId
  92. * @return
  93. */
  94. @ApiOperation(value = "试卷打样-标记合格状态")
  95. @RequestMapping(value = "/paper_try/tag_pass", method = RequestMethod.POST)
  96. public Result paperTryTagPass(@RequestParam("schoolId") Long schoolId,
  97. @RequestParam("examTaskId") Long examTaskId,
  98. @RequestParam("machineCode") String machineCode,
  99. @RequestParam("isPass") Boolean isPass,
  100. @RequestParam("userId") Long userId) {
  101. Boolean isSuccess = clientService.tagPass(schoolId, examTaskId, machineCode, isPass, userId);
  102. return ResultUtil.ok(isSuccess);
  103. }
  104. /**
  105. * 印刷管理-查询列表
  106. *
  107. * @param schoolId
  108. * @param machineCode
  109. * @param orgId
  110. * @param printPlanId
  111. * @param status
  112. * @param courseCode
  113. * @param paperNumber
  114. * @param examPlace
  115. * @param examRoom
  116. * @param examStartTime
  117. * @param examEndTime
  118. * @param isDownload
  119. * @param validate
  120. * @param pageNumber
  121. * @param pageSize
  122. * @return
  123. */
  124. @ApiOperation(value = "印刷管理-查询列表")
  125. @RequestMapping(value = "/print/task_list", method = RequestMethod.POST)
  126. public Result printTaskList(@RequestParam("schoolId") Long schoolId,
  127. @RequestParam("machineCode") Long machineCode,
  128. @RequestParam("orgId") String orgId,
  129. @RequestParam(value = "printPlanId", required = false) String printPlanId,
  130. @RequestParam(value = "status", required = false) String status,
  131. @RequestParam(value = "courseCode", required = false) String courseCode,
  132. @RequestParam(value = "paperNumber", required = false) String paperNumber,
  133. @RequestParam(value = "examPlace", required = false) String examPlace,
  134. @RequestParam(value = "examRoom", required = false) String examRoom,
  135. @RequestParam(value = "examStartTime", required = false) Long examStartTime,
  136. @RequestParam(value = "examEndTime", required = false) Long examEndTime,
  137. @RequestParam(value = "isDownload", required = false) Boolean isDownload,
  138. @RequestParam(value = "validate", required = false) Boolean validate,
  139. @RequestParam("pageNumber") Integer pageNumber,
  140. @RequestParam("pageSize") Integer pageSize) {
  141. IPage<ClientPrintTaskDto> printTaskDtoIPage = clientService.listClientPrintTask(schoolId, machineCode, orgId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, pageNumber, pageSize);
  142. return ResultUtil.ok(printTaskDtoIPage);
  143. }
  144. /**
  145. * 印刷管理-汇总数据查询
  146. *
  147. * @param schoolId
  148. * @param machineCode
  149. * @param orgId
  150. * @param printPlanId
  151. * @param status
  152. * @param courseCode
  153. * @param paperNumber
  154. * @param examPlace
  155. * @param examRoom
  156. * @param examStartTime
  157. * @param examEndTime
  158. * @param isDownload
  159. * @param validate
  160. * @return
  161. */
  162. @ApiOperation(value = "印刷管理-汇总数据查询")
  163. @RequestMapping(value = "/print/task_total_data", method = RequestMethod.POST)
  164. public Result printTaskTotalData(@RequestParam("schoolId") Long schoolId,
  165. @RequestParam("machineCode") Long machineCode,
  166. @RequestParam("orgId") String orgId,
  167. @RequestParam(value = "printPlanId", required = false) String printPlanId,
  168. @RequestParam(value = "status", required = false) String status,
  169. @RequestParam(value = "courseCode", required = false) String courseCode,
  170. @RequestParam(value = "paperNumber", required = false) String paperNumber,
  171. @RequestParam(value = "examPlace", required = false) String examPlace,
  172. @RequestParam(value = "examRoom", required = false) String examRoom,
  173. @RequestParam(value = "examStartTime", required = false) Long examStartTime,
  174. @RequestParam(value = "examEndTime", required = false) Long examEndTime,
  175. @RequestParam(value = "isDownload", required = false) Boolean isDownload,
  176. @RequestParam(value = "validate", required = false) Boolean validate) {
  177. return null;
  178. }
  179. /**
  180. * 印刷管理-查看
  181. *
  182. * @param schoolId
  183. * @param orgId
  184. * @param examDetailId
  185. * @return
  186. */
  187. @ApiOperation(value = "印刷管理-查看")
  188. @RequestMapping(value = "/print/preview", method = RequestMethod.POST)
  189. public Result printPreview(@RequestParam("schoolId") Long schoolId,
  190. @RequestParam("orgId") Long orgId,
  191. @RequestParam("examDetailId") Long examDetailId) {
  192. return null;
  193. }
  194. /**
  195. * 印刷管理-印刷/缓存数据
  196. *
  197. * @param schoolId
  198. * @param examDetailId
  199. * @param machineCode
  200. * @param isForceTry
  201. * @param printUser
  202. * @return
  203. */
  204. @ApiOperation(value = "印刷管理-印刷/缓存数据")
  205. @RequestMapping(value = "/print/get_print_data", method = RequestMethod.POST)
  206. public Result printGetPrintData(@RequestParam("schoolId") Long schoolId,
  207. @RequestParam("examDetailId") Long examDetailId,
  208. @RequestParam("machineCode") String machineCode,
  209. @RequestParam("isForceTry") Boolean isForceTry,
  210. @RequestParam(value = "printUser", required = false) String printUser) {
  211. Map<String, Object> map = clientService.getPrintData(schoolId, examDetailId, machineCode, isForceTry, printUser);
  212. return ResultUtil.ok(map);
  213. }
  214. /**
  215. * 印刷管理-批量缓存数据
  216. *
  217. * @param schoolId
  218. * @param orgId
  219. * @param examDetailId
  220. * @param machineCode
  221. * @return
  222. */
  223. @ApiOperation(value = "印刷管理-批量缓存数据")
  224. @RequestMapping(value = "/print/get_print_data_batch", method = RequestMethod.POST)
  225. public Result printGetPrintDataBatch(@RequestParam("schoolId") Long schoolId,
  226. @RequestParam("orgId") Long orgId,
  227. @RequestParam("examDetailId") Long examDetailId,
  228. @RequestParam("machineCode") String machineCode) {
  229. return null;
  230. }
  231. /**
  232. * 印刷管理-校验
  233. *
  234. * @param schoolId
  235. * @param orgId
  236. * @param examDetailId
  237. * @param machineCode
  238. * @param packageCode
  239. * @param lastCode
  240. * @return
  241. */
  242. @ApiOperation(value = "印刷管理-校验")
  243. @RequestMapping(value = "/print/data_check", method = RequestMethod.POST)
  244. public Result dataCheck(@RequestParam("schoolId") Long schoolId,
  245. @RequestParam("orgId") Long orgId,
  246. @RequestParam("examDetailId") Long examDetailId,
  247. @RequestParam("machineCode") String machineCode,
  248. @RequestParam("packageCode") String packageCode,
  249. @RequestParam("lastCode") String lastCode) {
  250. return null;
  251. }
  252. /**
  253. * 印刷管理-更新打印进度
  254. *
  255. * @param schoolId
  256. * @param examDetailId
  257. * @param printProgress
  258. * @return
  259. */
  260. @ApiOperation(value = "印刷管理-更新打印进度")
  261. @RequestMapping(value = "/print/update_progress", method = RequestMethod.POST)
  262. public Result updateProgress(@RequestParam("schoolId") Long schoolId,
  263. @RequestParam("examDetailId") Long examDetailId,
  264. @RequestParam("printProgress") Integer printProgress) {
  265. Boolean isSuccess = clientService.updatePrintProgress(schoolId, examDetailId, printProgress);
  266. return ResultUtil.ok(isSuccess);
  267. }
  268. /**
  269. * 重打-查询考生列表
  270. *
  271. * @param schoolId
  272. * @param examDetailId
  273. * @param ticketNumber
  274. * @param studentName
  275. * @param courseCode
  276. * @return
  277. */
  278. @ApiOperation(value = "重打-查询考生列表")
  279. @RequestMapping(value = "/print/list_student", method = RequestMethod.POST)
  280. public Result listStudent(@RequestParam("schoolId") Long schoolId,
  281. @RequestParam("examDetailId") Long examDetailId,
  282. @RequestParam(value = "ticketNumber", required = false) String ticketNumber,
  283. @RequestParam(value = "studentName", required = false) String studentName,
  284. @RequestParam(value = "courseCode", required = false) String courseCode,
  285. @RequestParam("pageNumber") Integer pageNumber,
  286. @RequestParam("pageSize") Integer pageSize) {
  287. IPage<ClientExamStudentDto> examStudentDtoIPage = clientService.listStudent(schoolId, examDetailId, ticketNumber, studentName, courseCode, pageNumber, pageSize);
  288. return ResultUtil.ok(examStudentDtoIPage);
  289. }
  290. /**
  291. * 重打-内容查询
  292. *
  293. * @param schoolId
  294. * @param examDetailId
  295. * @param ticketNumber
  296. * @param type
  297. * @return
  298. */
  299. @ApiOperation(value = "重打-内容查询")
  300. @RequestMapping(value = "/print/get_reprint_data", method = RequestMethod.POST)
  301. public Result getReprintData(@RequestParam("schoolId") Long schoolId,
  302. @RequestParam("examDetailId") Long examDetailId,
  303. @RequestParam("ticketNumber") String ticketNumber,
  304. @RequestParam("type") String type) {
  305. Map<String, Object> map = clientService.getReprintData(schoolId, examDetailId, ticketNumber, type);
  306. return ResultUtil.ok(map);
  307. }
  308. }