ClientController.java 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. package com.qmth.distributed.print.api;
  2. import com.alibaba.fastjson.JSON;
  3. import com.alibaba.fastjson.JSONObject;
  4. import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
  5. import com.baomidou.mybatisplus.core.metadata.IPage;
  6. import com.qmth.boot.api.annotation.Aac;
  7. import com.qmth.boot.api.constant.ApiConstant;
  8. import com.qmth.distributed.print.business.bean.dto.*;
  9. import com.qmth.distributed.print.business.bean.params.ClientLoginParam;
  10. import com.qmth.distributed.print.business.service.ClientService;
  11. import com.qmth.teachcloud.common.bean.dto.SchoolDto;
  12. import com.qmth.teachcloud.common.bean.result.LoginClientResult;
  13. import com.qmth.teachcloud.common.bean.result.LoginResult;
  14. import com.qmth.teachcloud.common.contant.SystemConstant;
  15. import com.qmth.teachcloud.common.entity.BasicSchool;
  16. import com.qmth.teachcloud.common.entity.SysUser;
  17. import com.qmth.teachcloud.common.enums.AppSourceEnum;
  18. import com.qmth.teachcloud.common.enums.ExceptionResultEnum;
  19. import com.qmth.teachcloud.common.service.CommonCacheService;
  20. import com.qmth.teachcloud.common.service.SysUserService;
  21. import com.qmth.teachcloud.common.service.TeachcloudCommonService;
  22. import com.qmth.teachcloud.common.util.Result;
  23. import com.qmth.teachcloud.common.util.ResultUtil;
  24. import io.swagger.annotations.*;
  25. import org.apache.commons.collections4.CollectionUtils;
  26. import org.springframework.validation.BindingResult;
  27. import org.springframework.web.bind.annotation.*;
  28. import javax.annotation.Resource;
  29. import javax.servlet.http.HttpServletResponse;
  30. import javax.validation.Valid;
  31. import java.security.NoSuchAlgorithmException;
  32. import java.util.List;
  33. import java.util.Map;
  34. import java.util.Objects;
  35. import java.util.stream.Collectors;
  36. /**
  37. * 客户端接口(打印端)
  38. */
  39. @Api(tags = "客户端Controller")
  40. @RestController
  41. @RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_CLIENT)
  42. //@Validated
  43. public class ClientController {
  44. @Resource
  45. ClientService clientService;
  46. @Resource
  47. SysUserService sysUserService;
  48. @Resource
  49. CommonCacheService commonCacheService;
  50. @Resource
  51. TeachcloudCommonService teachcloudCommonService;
  52. // /**
  53. // * 登录
  54. // *
  55. // * @param login 登录参数
  56. // */
  57. // @ApiOperation(value = "登录")
  58. // @PostMapping("/user/login")
  59. // @ApiResponses({@ApiResponse(code = 200, message = "用户信息", response = LoginResult.class)})
  60. // @Aac(auth = false)
  61. // public Result login(@ApiParam(value = "用户信息", required = true) @Valid @RequestBody ClientLoginParam login, BindingResult bindingResult) throws NoSuchAlgorithmException {
  62. // if (bindingResult.hasErrors()) {
  63. // return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
  64. // }
  65. // BasicSchool basicSchool = commonCacheService.schoolCache(login.getSchoolCode());
  66. // if (Objects.isNull(basicSchool)) {
  67. // throw ExceptionResultEnum.SCHOOL_NO_DATA.exception();
  68. // }
  69. // QueryWrapper<SysUser> wrapper = new QueryWrapper<>();
  70. // wrapper.lambda().eq(SysUser::getSchoolId, basicSchool.getId()).eq(SysUser::getLoginName, login.getLoginName());
  71. // SysUser sysUser = sysUserService.getOne(wrapper);
  72. // // 用户不存在
  73. // if (Objects.isNull(sysUser)) {
  74. // throw ExceptionResultEnum.USER_NO_DATA.exception();
  75. // }
  76. // // 校验密码
  77. // if (!Objects.equals(sysUser.getPassword(), login.getPassword())) {
  78. // throw ExceptionResultEnum.USER_NO_DATA.exception();
  79. // }
  80. // // 是否有客户端权限
  81. // clientService.checkPrivilege(sysUser.getId());
  82. //
  83. // LoginResult loginResult = teachcloudCommonService.login(login.getPassword(), sysUser, AppSourceEnum.SYSTEM);
  84. // return ResultUtil.ok(new LoginClientResult(sysUser, loginResult));
  85. // }
  86. /**
  87. * 试卷打样-列表
  88. *
  89. * @param machineCode 机器唯一码
  90. * @param orgId 机构ID
  91. * @param printPlanId 印刷计划ID
  92. * @param courseCode 课程代码
  93. * @param paperNumber 试卷编号
  94. * @param isTry 是否打样
  95. * @param isPass 是否合格
  96. * @param pageNumber 分页参数
  97. * @param pageSize 分页参数
  98. */
  99. @ApiOperation(value = "试卷打样-列表")
  100. @PostMapping("/paper_try/list")
  101. public Result paperTryList(@RequestParam("machineCode") String machineCode,
  102. @RequestParam("orgId") Long orgId,
  103. @RequestParam(value = "semesterId", required = false) Long semesterId,
  104. @RequestParam(value = "examId", required = false) Long examId,
  105. @RequestParam(value = "printPlanId", required = false) Long printPlanId,
  106. @RequestParam(value = "courseCode", required = false) String courseCode,
  107. @RequestParam(value = "paperNumber", required = false) String paperNumber,
  108. @RequestParam(value = "isTry", required = false) Boolean isTry,
  109. @RequestParam(value = "isPass", required = false) Boolean isPass,
  110. @RequestParam Integer pageNumber,
  111. @RequestParam Integer pageSize) {
  112. IPage<ClientExamTaskDto> examTasks = clientService.listTryTask(machineCode, orgId, semesterId, examId, printPlanId, courseCode, paperNumber, isTry, isPass, pageNumber, pageSize);
  113. return ResultUtil.ok(examTasks);
  114. }
  115. /**
  116. * 试卷打样-查看/试印/重印
  117. *
  118. * @param data 多任务集合
  119. */
  120. @ApiOperation(value = "试卷打样-查看/试印/重印")
  121. @PostMapping("/paper_try/print")
  122. public Result paperTryPrint(@RequestParam("data") String data) {
  123. List<JSONObject> objects = JSON.parseArray(data, JSONObject.class);
  124. List<Map<String, Object>> list = clientService.getPaperUrl(objects);
  125. return ResultUtil.ok(list);
  126. }
  127. /**
  128. * 试卷打样-批量试印
  129. *
  130. * @param machineCode 机器码
  131. * @param orgId 机构ID
  132. * @param printPlanId 印刷计划ID
  133. * @param courseCode 课程代码
  134. * @param paperNumber 试卷编号
  135. * @param isTry 是否打样
  136. * @param isPass 是否通过
  137. */
  138. @ApiOperation(value = "试卷打样-批量试印")
  139. @PostMapping("/paper_try/print_batch")
  140. public Result printBatch(@RequestParam("machineCode") String machineCode,
  141. @RequestParam("orgId") Long orgId,
  142. @RequestParam(value = "semesterId", required = false) Long semesterId,
  143. @RequestParam(value = "examId", required = false) Long examId,
  144. @RequestParam(value = "printPlanId", required = false) Long printPlanId,
  145. @RequestParam(value = "courseCode", required = false) String courseCode,
  146. @RequestParam(value = "paperNumber", required = false) String paperNumber,
  147. @RequestParam(value = "isTry", required = false) Boolean isTry,
  148. @RequestParam(value = "isPass", required = false) Boolean isPass) {
  149. List<Map<String, Object>> urls = clientService.getBatchUrl(machineCode, orgId, semesterId, examId, printPlanId, courseCode, paperNumber, isTry, isPass);
  150. return ResultUtil.ok(urls);
  151. }
  152. /**
  153. * 试卷打样-标记合格状态
  154. *
  155. * @param machineCode 机器码
  156. * @param isPass 是否通过
  157. * @param userId 用户Id
  158. */
  159. @ApiOperation(value = "试卷打样-标记合格状态")
  160. @PostMapping("/paper_try/tag_pass")
  161. public Result paperTryTagPass(@RequestParam("printPlanId") Long printPlanId,
  162. @RequestParam("courseCode") String courseCode,
  163. @RequestParam("courseName") String courseName,
  164. @RequestParam("paperNumber") String paperNumber,
  165. @RequestParam("machineCode") String machineCode,
  166. @RequestParam("isPass") Boolean isPass,
  167. @RequestParam("userId") Long userId) {
  168. Boolean isSuccess = clientService.tagPass(printPlanId, courseCode, courseName, paperNumber, machineCode, isPass, userId);
  169. return ResultUtil.ok(isSuccess);
  170. }
  171. /**
  172. * 印刷管理-查询列表
  173. *
  174. * @param machineCode 机器码
  175. * @param orgId 机构ID
  176. * @param printPlanId 印刷计划ID
  177. * @param status 状态
  178. * @param courseCode 课程代码
  179. * @param paperNumber 试卷编号
  180. * @param examPlace 考点
  181. * @param examRoom 考场
  182. * @param examStartTime 考试时间(开始)
  183. * @param examEndTime 考试时间(结束)
  184. * @param isDownload 是否缓存
  185. * @param validate 是否校验
  186. * @param pageNumber 分页参数
  187. * @param pageSize 分页参数
  188. */
  189. @ApiOperation(value = "印刷管理-查询列表")
  190. @PostMapping("/print/task_list")
  191. public Result printTaskList(@RequestParam("machineCode") String machineCode,
  192. @RequestParam("orgId") Long orgId,
  193. @RequestParam(value = "semesterId", required = false) Long semesterId,
  194. @RequestParam(value = "examId", required = false) Long examId,
  195. @RequestParam(value = "printPlanId", required = false) String printPlanId,
  196. @RequestParam(value = "status", required = false) String status,
  197. @RequestParam(value = "courseCode", required = false) String courseCode,
  198. @RequestParam(value = "paperNumber", required = false) String paperNumber,
  199. @RequestParam(value = "examPlace", required = false) String examPlace,
  200. @RequestParam(value = "examRoom", required = false) String examRoom,
  201. @RequestParam(value = "examStartTime", required = false) Long examStartTime,
  202. @RequestParam(value = "examEndTime", required = false) Long examEndTime,
  203. @RequestParam(value = "isDownload", required = false) Boolean isDownload,
  204. @RequestParam(value = "validate", required = false) Boolean validate,
  205. @RequestParam Integer pageNumber,
  206. @RequestParam Integer pageSize) {
  207. IPage<ClientPrintTaskDto> printTaskDtoIPage = clientService.listClientPrintTask(machineCode, orgId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, pageNumber, pageSize);
  208. return ResultUtil.ok(printTaskDtoIPage);
  209. }
  210. /**
  211. * 印刷管理-导出
  212. *
  213. * @param response response
  214. * @param machineCode 机器码
  215. * @param orgId 机构ID
  216. * @param printPlanId 印刷计划ID
  217. * @param status 状态
  218. * @param courseCode 课程代码
  219. * @param paperNumber 试卷编号
  220. * @param examPlace 考点
  221. * @param examRoom 考场
  222. * @param examStartTime 考试时间(开始)
  223. * @param examEndTime 考试时间(结束)
  224. * @param isDownload 是否缓存
  225. * @param validate 是否核验
  226. */
  227. @ApiOperation(value = "印刷管理-导出")
  228. @PostMapping("/print/task_list_export")
  229. public void printTaskListExport(HttpServletResponse response,
  230. @RequestParam("machineCode") String machineCode,
  231. @RequestParam("orgId") Long orgId,
  232. @RequestParam(value = "semesterId", required = false) Long semesterId,
  233. @RequestParam(value = "examId", required = false) Long examId,
  234. @RequestParam(value = "printPlanId", required = false) String printPlanId,
  235. @RequestParam(value = "status", required = false) String status,
  236. @RequestParam(value = "courseCode", required = false) String courseCode,
  237. @RequestParam(value = "paperNumber", required = false) String paperNumber,
  238. @RequestParam(value = "examPlace", required = false) String examPlace,
  239. @RequestParam(value = "examRoom", required = false) String examRoom,
  240. @RequestParam(value = "examStartTime", required = false) Long examStartTime,
  241. @RequestParam(value = "examEndTime", required = false) Long examEndTime,
  242. @RequestParam(value = "isDownload", required = false) Boolean isDownload,
  243. @RequestParam(value = "validate", required = false) Boolean validate) throws Exception {
  244. clientService.exportClientPrintTask(response, machineCode, orgId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate);
  245. }
  246. /**
  247. * 印刷管理-汇总数据查询
  248. *
  249. * @param machineCode 机器码
  250. * @param orgId 机构ID
  251. * @param printPlanId 印刷计划ID
  252. * @param status 状态
  253. * @param courseCode 课程代码
  254. * @param paperNumber 试卷编号
  255. * @param examPlace 考点
  256. * @param examRoom 考场
  257. * @param examStartTime 考试时间(开始)
  258. * @param examEndTime 考试时间(结束)
  259. * @param isDownload 是否缓存
  260. * @param validate 是否校验
  261. */
  262. @ApiOperation(value = "印刷管理-汇总数据查询")
  263. @PostMapping("/print/task_total_data")
  264. public Result printTaskTotalData(@RequestParam("machineCode") String machineCode,
  265. @RequestParam("orgId") Long orgId,
  266. @RequestParam(value = "semesterId", required = false) Long semesterId,
  267. @RequestParam(value = "examId", required = false) Long examId,
  268. @RequestParam(value = "printPlanId", required = false) String printPlanId,
  269. @RequestParam(value = "status", required = false) String status,
  270. @RequestParam(value = "courseCode", required = false) String courseCode,
  271. @RequestParam(value = "paperNumber", required = false) String paperNumber,
  272. @RequestParam(value = "examPlace", required = false) String examPlace,
  273. @RequestParam(value = "examRoom", required = false) String examRoom,
  274. @RequestParam(value = "examStartTime", required = false) Long examStartTime,
  275. @RequestParam(value = "examEndTime", required = false) Long examEndTime,
  276. @RequestParam(value = "isDownload", required = false) Boolean isDownload,
  277. @RequestParam(value = "validate", required = false) Boolean validate) {
  278. ClientPrintTaskTotalDto clientPrintTaskTotalDto = clientService.taskTotalData(semesterId, examId, printPlanId, orgId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate, machineCode);
  279. return ResultUtil.ok(clientPrintTaskTotalDto);
  280. }
  281. /**
  282. * 印刷管理-查看
  283. *
  284. * @param examDetailId 命题任务ID
  285. */
  286. @ApiOperation(value = "印刷管理-查看")
  287. @PostMapping("/print/preview")
  288. public Result printPreview(@RequestParam("examDetailId") Long examDetailId) {
  289. Map<String, Object> map = clientService.getUrlByExamDetailId(examDetailId);
  290. return ResultUtil.ok(map);
  291. }
  292. /**
  293. * 印刷管理-印刷/缓存数据
  294. *
  295. * @param examDetailId 考场ID
  296. * @param machineCode 机器码
  297. * @param printUser 打印员
  298. */
  299. @ApiOperation(value = "印刷管理-印刷/缓存数据")
  300. @PostMapping("/print/get_print_data")
  301. public Result printGetPrintData(@RequestParam("examDetailId") String examDetailId,
  302. @RequestParam("machineCode") String machineCode,
  303. @RequestParam("isPrint") Boolean isPrint,
  304. @RequestParam(value = "printUser", required = false) String printUser) {
  305. List<Map<String, Object>> mapList = clientService.getPrintData(examDetailId, machineCode, isPrint, printUser);
  306. return ResultUtil.ok(mapList);
  307. }
  308. /**
  309. * 印刷管理-批量缓存数据
  310. *
  311. * @param orgId 机构ID
  312. * @param machineCode 机器码
  313. */
  314. @ApiOperation(value = "印刷管理-批量缓存数据")
  315. @PostMapping("/print/get_print_data_batch")
  316. public Result printGetPrintDataBatch(@RequestParam("machineCode") String machineCode,
  317. @RequestParam("orgId") Long orgId,
  318. @RequestParam(value = "semesterId", required = false) Long semesterId,
  319. @RequestParam(value = "examId", required = false) Long examId,
  320. @RequestParam(value = "printPlanId", required = false) String printPlanId,
  321. @RequestParam(value = "status", required = false) String status,
  322. @RequestParam(value = "courseCode", required = false) String courseCode,
  323. @RequestParam(value = "paperNumber", required = false) String paperNumber,
  324. @RequestParam(value = "examPlace", required = false) String examPlace,
  325. @RequestParam(value = "examRoom", required = false) String examRoom,
  326. @RequestParam(value = "examStartTime", required = false) Long examStartTime,
  327. @RequestParam(value = "examEndTime", required = false) Long examEndTime,
  328. @RequestParam(value = "isDownload", required = false) Boolean isDownload,
  329. @RequestParam(value = "validate", required = false) Boolean validate) {
  330. List<Map<String, Object>> list = clientService.getPrintDataBatch(machineCode, orgId, semesterId, examId, printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, isDownload, validate);
  331. return ResultUtil.ok(list);
  332. }
  333. /**
  334. * @param examDetailId 考场ID
  335. * @param machineCode 机器码
  336. * @param isDownload 是否缓存
  337. */
  338. @ApiOperation(value = "印刷管理-缓存后更新状态")
  339. @PostMapping("/print/update_download")
  340. public Result updateDownload(@RequestParam("examDetailId") Long examDetailId,
  341. @RequestParam("machineCode") String machineCode,
  342. @RequestParam("isDownload") Boolean isDownload) {
  343. Boolean isSuccess = clientService.updateDownload(examDetailId, machineCode, isDownload);
  344. return ResultUtil.ok(isSuccess);
  345. }
  346. /**
  347. * 印刷管理-校验
  348. *
  349. * @param examDetailId 考场ID
  350. * @param packageCode 机器码
  351. * @param lastCode 校验条码号
  352. */
  353. @ApiOperation(value = "印刷管理-校验")
  354. @PostMapping("/print/validate_data")
  355. public Result dataCheck(@RequestParam("examDetailId") Long examDetailId,
  356. @RequestParam("packageCode") String packageCode,
  357. @RequestParam("lastCode") String lastCode) {
  358. Boolean isSuccess = clientService.validateData(examDetailId, packageCode, lastCode);
  359. return ResultUtil.ok(isSuccess);
  360. }
  361. /**
  362. * 印刷管理-更新打印进度
  363. *
  364. * @param examDetailId 考场ID
  365. * @param machineCode 机器码
  366. * @param printProgress 打印进度
  367. */
  368. @ApiOperation(value = "印刷管理-更新打印进度")
  369. @PostMapping("/print/update_progress")
  370. public Result updateProgress(@RequestParam("examDetailId") Long examDetailId,
  371. @RequestParam("machineCode") String machineCode,
  372. @RequestParam("printProgress") Integer printProgress,
  373. @RequestParam(value = "isPrint", required = false) Boolean isPrint) {
  374. Boolean isSuccess = clientService.updatePrintProgress(examDetailId, machineCode, printProgress, isPrint);
  375. return ResultUtil.ok(isSuccess);
  376. }
  377. /**
  378. * 重打-查询考生列表
  379. *
  380. * @param examDetailId 考场ID
  381. * @param studentCode 学号
  382. * @param studentName 学号
  383. * @param courseCode 课程代码
  384. */
  385. @ApiOperation(value = "重打-查询考生列表")
  386. @PostMapping("/print/list_student")
  387. public Result listStudent(@RequestParam("examDetailId") Long examDetailId,
  388. @RequestParam(value = "studentCode", required = false) String studentCode,
  389. @RequestParam(value = "studentName", required = false) String studentName,
  390. @RequestParam(value = "courseCode", required = false) String courseCode,
  391. @RequestParam Integer pageNumber,
  392. @RequestParam Integer pageSize) {
  393. IPage<ClientExamStudentDto> examStudentDtoIPage = clientService.listStudent(examDetailId, studentCode, studentName, courseCode, pageNumber, pageSize);
  394. return ResultUtil.ok(examStudentDtoIPage);
  395. }
  396. /**
  397. * 重打-内容查询
  398. *
  399. * @param examDetailId 考场ID
  400. * @param studentCode 学号
  401. * @param type 类型
  402. */
  403. @ApiOperation(value = "重打-内容查询")
  404. @PostMapping("/print/get_reprint_data")
  405. public Result getReprintData(@RequestParam("examDetailId") Long examDetailId,
  406. @RequestParam("studentCode") String studentCode,
  407. @RequestParam("type") String type) {
  408. Map<String, Object> map = clientService.getReprintData(examDetailId, studentCode, type);
  409. return ResultUtil.ok(map);
  410. }
  411. /**
  412. * 统计查询-查询列表
  413. *
  414. * @param orgId 机构ID
  415. * @param printPlanId 印刷计划ID
  416. * @param examPlace 考点
  417. * @param examStartTime 考试时间(开始)
  418. * @param examEndTime 考试时间(结束)
  419. * @param courseCode 课程代码
  420. * @param paperNumber 试卷编号
  421. * @param pageNumber 分页参数
  422. * @param pageSize 分页参数
  423. */
  424. @ApiOperation(value = "统计查询-查询列表")
  425. @PostMapping("/print/statistics_list")
  426. public Result printStatisticsList(@RequestParam("orgId") Long orgId,
  427. @RequestParam(value = "semesterId", required = false) Long semesterId,
  428. @RequestParam(value = "examId", required = false) Long examId,
  429. @RequestParam(value = "printPlanId", required = false) String printPlanId,
  430. @RequestParam(value = "examPlace", required = false) String examPlace,
  431. @RequestParam(value = "examStartTime", required = false) Long examStartTime,
  432. @RequestParam(value = "examEndTime", required = false) Long examEndTime,
  433. @RequestParam(value = "courseCode", required = false) String courseCode,
  434. @RequestParam(value = "paperNumber", required = false) String paperNumber,
  435. @RequestParam Integer pageNumber,
  436. @RequestParam Integer pageSize) {
  437. IPage<ClientPrintStatisticsDto> statisticsDtoIPage = clientService.listClientPrintStatistics(orgId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber, pageNumber, pageSize);
  438. return ResultUtil.ok(statisticsDtoIPage);
  439. }
  440. /**
  441. * 统计查询-汇总数据查询
  442. *
  443. * @param orgId 机构ID
  444. * @param printPlanId 印刷计划Id
  445. * @param examPlace 考点
  446. * @param examStartTime 考试时间(开始)
  447. * @param examEndTime 考试时间(结束)
  448. * @param courseCode 课程代码
  449. * @param paperNumber 试卷编号
  450. */
  451. @ApiOperation(value = "统计查询-汇总数据查询")
  452. @PostMapping("/print/statistics_total_data")
  453. public Result printStatisticsTotalData(@RequestParam("orgId") Long orgId,
  454. @RequestParam(value = "semesterId", required = false) Long semesterId,
  455. @RequestParam(value = "examId", required = false) Long examId,
  456. @RequestParam(value = "printPlanId", required = false) Long printPlanId,
  457. @RequestParam(value = "examPlace", required = false) String examPlace,
  458. @RequestParam(value = "examStartTime", required = false) Long examStartTime,
  459. @RequestParam(value = "examEndTime", required = false) Long examEndTime,
  460. @RequestParam(value = "courseCode", required = false) String courseCode,
  461. @RequestParam(value = "paperNumber", required = false) String paperNumber) {
  462. ClientPrintStatisticsTotalDto statisticsTotalDto = clientService.clientStatisticsTotalData(orgId, semesterId, examId, printPlanId, examPlace, examStartTime, examEndTime, courseCode, paperNumber);
  463. return ResultUtil.ok(statisticsTotalDto);
  464. }
  465. /**
  466. * 学校查询
  467. *
  468. * @return
  469. */
  470. @ApiOperation(value = "查询")
  471. @RequestMapping(value = "/school/list", method = RequestMethod.POST)
  472. @Aac(strict = false, auth = false)
  473. public Result list(@RequestParam(required = false) String code) {
  474. List<SchoolDto> list = clientService.listSchool(code);
  475. if (CollectionUtils.isNotEmpty(list)) {
  476. List<SchoolDto> defaultSchools = list.stream().filter(m -> m.getDefaultSchool() != null && m.getDefaultSchool()).collect(Collectors.toList());
  477. if (CollectionUtils.isNotEmpty(defaultSchools)) {
  478. return ResultUtil.ok(defaultSchools);
  479. }
  480. }
  481. return ResultUtil.ok(list);
  482. }
  483. /**
  484. * 修改密码
  485. *
  486. * @return
  487. */
  488. @ApiOperation(value = "修改密码")
  489. @RequestMapping(value = "/user/update_password", method = RequestMethod.POST)
  490. @Aac(strict = false, auth = false)
  491. public Result updatePassword(@RequestParam Long userId,
  492. @RequestParam String password) {
  493. return ResultUtil.ok(clientService.updatePassword(userId, password));
  494. }
  495. }