ClientController.java 27 KB

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