|
@@ -6,15 +6,20 @@ import com.qmth.boot.api.annotation.Aac;
|
|
|
import com.qmth.boot.api.annotation.BOOL;
|
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
|
import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailDto;
|
|
|
+import com.qmth.distributed.print.business.bean.dto.PrintTaskDto;
|
|
|
+import com.qmth.distributed.print.business.bean.dto.PrintTaskTotalDto;
|
|
|
import com.qmth.distributed.print.business.bean.dto.RelatePaperDto;
|
|
|
import com.qmth.distributed.print.business.bean.params.DeleteParams;
|
|
|
import com.qmth.distributed.print.business.bean.params.PrintPlanParams;
|
|
|
+import com.qmth.distributed.print.business.bean.params.RelatePaperParam;
|
|
|
import com.qmth.distributed.print.business.entity.ExamPrintPlan;
|
|
|
+import com.qmth.distributed.print.business.entity.SysUser;
|
|
|
import com.qmth.distributed.print.business.enums.PrintPlanStatusEnum;
|
|
|
import com.qmth.distributed.print.business.service.ExamDetailService;
|
|
|
import com.qmth.distributed.print.business.service.ExamPrintPlanService;
|
|
|
import com.qmth.distributed.print.business.service.ExamTaskDetailService;
|
|
|
import com.qmth.distributed.print.business.service.ExamTaskService;
|
|
|
+import com.qmth.distributed.print.business.util.ServletUtil;
|
|
|
import com.qmth.distributed.print.common.contant.SystemConstant;
|
|
|
import com.qmth.distributed.print.common.util.Result;
|
|
|
import com.qmth.distributed.print.common.util.ResultUtil;
|
|
@@ -27,7 +32,6 @@ import javax.annotation.Resource;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.validation.Valid;
|
|
|
import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -57,31 +61,32 @@ public class ExamPrintPlanController {
|
|
|
@ApiOperation(value = "印刷计划查询")
|
|
|
@RequestMapping(value = "/list", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
|
|
|
- public Result findPrintPlanPage(@ApiParam(value = "学校主键", required = true) @RequestParam String schoolId,
|
|
|
- @ApiParam(value = "印刷计划名称") @RequestParam(required = false) String name,
|
|
|
+ public Result findPrintPlanPage(@ApiParam(value = "印刷计划id") @RequestParam(required = false) String printPlanId,
|
|
|
@ApiParam(value = "印刷计划状态") @RequestParam(required = false) PrintPlanStatusEnum status,
|
|
|
@ApiParam(value = "计划创建时间段开始时间") @RequestParam(required = false) Long startTime,
|
|
|
@ApiParam(value = "计划创建时间段结束时间") @RequestParam(required = false) Long endTime,
|
|
|
@ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber,
|
|
|
@ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
|
|
|
|
|
|
- return ResultUtil.ok(examPrintPlanService.printPlanPage(SystemConstant.convertIdToLong(schoolId), name, status, startTime, endTime, pageNumber, pageSize));
|
|
|
+ Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
+ return ResultUtil.ok(examPrintPlanService.printPlanPage(schoolId, SystemConstant.convertIdToLong(printPlanId), status, startTime, endTime, pageNumber, pageSize));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "印刷计划模糊查询")
|
|
|
@RequestMapping(value = "/query", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
|
|
|
- public Result findPrintPlanQuery(@ApiParam(value = "印刷计划名称", required = true) @RequestParam String param) {
|
|
|
- return ResultUtil.ok(examPrintPlanService.printPlanBriefQuery(param));
|
|
|
+ public Result findPrintPlanQuery() {
|
|
|
+ return ResultUtil.ok(examPrintPlanService.printPlanBriefQuery());
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "按类型查询模板")
|
|
|
@RequestMapping(value = "/get_template", method = RequestMethod.POST)
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "查询成功", response = Result.class)})
|
|
|
- public Result findPrintPlanPage(@ApiParam(value = "学校主键", required = true) @RequestParam String schoolId,
|
|
|
- @ApiParam(value = "用户主键", required = true) @RequestParam String userId) {
|
|
|
-
|
|
|
- return ResultUtil.ok(examPrintPlanService.printPlanTemplateDatasource(SystemConstant.convertIdToLong(schoolId), SystemConstant.convertIdToLong(userId)));
|
|
|
+ public Result findPrintPlanPage() {
|
|
|
+ Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
+ SysUser user = (SysUser) ServletUtil.getRequestUser();
|
|
|
+ Long userId = user.getId();
|
|
|
+ return ResultUtil.ok(examPrintPlanService.printPlanTemplateDatasource(schoolId, userId));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "印刷计划-新增/修改")
|
|
@@ -91,6 +96,8 @@ public class ExamPrintPlanController {
|
|
|
if (bindingResult.hasErrors()) {
|
|
|
return ResultUtil.error(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
|
}
|
|
|
+ Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
|
|
|
+ printPlanParams.setSchoolId(schoolId);
|
|
|
return ResultUtil.ok(examPrintPlanService.savePrintPlan(printPlanParams));
|
|
|
}
|
|
|
|
|
@@ -117,10 +124,10 @@ public class ExamPrintPlanController {
|
|
|
*/
|
|
|
@ApiOperation(value = "关联试卷管理-查询")
|
|
|
@RequestMapping(value = "/relate_list", method = RequestMethod.POST)
|
|
|
- public Result relateList(@RequestParam String relateType,
|
|
|
- @RequestParam Long printPlanId,
|
|
|
- @RequestParam String courseCode,
|
|
|
- @RequestParam String paperNumber,
|
|
|
+ public Result relateList(@RequestParam(value = "relateType", required = false) String relateType,
|
|
|
+ @RequestParam(value = "printPlanId", required = false) Long printPlanId,
|
|
|
+ @RequestParam(value = "courseCode", required = false) String courseCode,
|
|
|
+ @RequestParam(value = "paperNumber", required = false) String paperNumber,
|
|
|
@RequestParam Integer pageNumber,
|
|
|
@RequestParam Integer pageSize) {
|
|
|
IPage<ExamTaskDetailDto> examTasks = examTaskDetailService.list(relateType, printPlanId, courseCode, paperNumber, pageNumber, pageSize);
|
|
@@ -130,13 +137,12 @@ public class ExamPrintPlanController {
|
|
|
/**
|
|
|
* 关联/更换试卷
|
|
|
*
|
|
|
- * @param request
|
|
|
- * @param map
|
|
|
+ * @param paperParam
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "/relate_update", method = RequestMethod.POST)
|
|
|
- public Result relateUpdate(HttpServletRequest request, @RequestBody Map<String, String> map) {
|
|
|
- boolean isSuccess = examTaskDetailService.updatePaper(map);
|
|
|
+ public Result relateUpdate(@RequestBody RelatePaperParam paperParam) {
|
|
|
+ boolean isSuccess = examTaskDetailService.updatePaper(paperParam);
|
|
|
return ResultUtil.ok(isSuccess);
|
|
|
}
|
|
|
|
|
@@ -155,7 +161,7 @@ public class ExamPrintPlanController {
|
|
|
/**
|
|
|
* 印刷任务管理-查询
|
|
|
*
|
|
|
- * @param printPlanName
|
|
|
+ * @param printPlanId
|
|
|
* @param status
|
|
|
* @param courseCode
|
|
|
* @param paperNumber
|
|
@@ -168,16 +174,17 @@ public class ExamPrintPlanController {
|
|
|
*/
|
|
|
@ApiOperation(value = "印刷任务管理-查询")
|
|
|
@RequestMapping(value = "/task_list", method = RequestMethod.POST)
|
|
|
- public Result taskList(@RequestParam String printPlanName,
|
|
|
- @RequestParam String status,
|
|
|
- @RequestParam String courseCode,
|
|
|
- @RequestParam String paperNumber,
|
|
|
- @RequestParam String examPlace,
|
|
|
- @RequestParam Long examStartTime,
|
|
|
- @RequestParam Long examEndTime,
|
|
|
+ public Result taskList(@RequestParam(value = "printPlanId", required = false) Long printPlanId,
|
|
|
+ @RequestParam(value = "status", required = false) String status,
|
|
|
+ @RequestParam(value = "courseCode", required = false) String courseCode,
|
|
|
+ @RequestParam(value = "paperNumber", required = false) String paperNumber,
|
|
|
+ @RequestParam(value = "examPlace", required = false) String examPlace,
|
|
|
+ @RequestParam(value = "examRoom", required = false) String examRoom,
|
|
|
+ @RequestParam(value = "examStartTime", required = false) Long examStartTime,
|
|
|
+ @RequestParam(value = "examEndTime", required = false) Long examEndTime,
|
|
|
@RequestParam Integer pageNumber,
|
|
|
@RequestParam Integer pageSize) {
|
|
|
- IPage<ExamTaskDetailDto> examTasks = examDetailService.listPrintTask(printPlanName, status, courseCode, paperNumber, examPlace, examStartTime, examEndTime, pageNumber, pageSize);
|
|
|
+ IPage<PrintTaskDto> examTasks = examDetailService.listPrintTask(printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime, pageNumber, pageSize);
|
|
|
return ResultUtil.ok(examTasks);
|
|
|
}
|
|
|
|
|
@@ -206,28 +213,28 @@ public class ExamPrintPlanController {
|
|
|
/**
|
|
|
* 印刷任务管理-汇总数据查询
|
|
|
*
|
|
|
- * @param request
|
|
|
- * @param printPlanName
|
|
|
+ * @param printPlanId
|
|
|
* @param status
|
|
|
* @param courseCode
|
|
|
* @param paperNumber
|
|
|
* @param examPlace
|
|
|
+ * @param examRoom
|
|
|
* @param examStartTime
|
|
|
* @param examEndTime
|
|
|
* @return
|
|
|
*/
|
|
|
@ApiOperation(value = "印刷任务管理-汇总数据查询")
|
|
|
@RequestMapping(value = "/task_total_data", method = RequestMethod.POST)
|
|
|
- public Result taskTotalData(HttpServletRequest request,
|
|
|
- @RequestParam String printPlanName,
|
|
|
- @RequestParam String status,
|
|
|
- @RequestParam String courseCode,
|
|
|
- @RequestParam String paperNumber,
|
|
|
- @RequestParam String examPlace,
|
|
|
- @RequestParam Long examStartTime,
|
|
|
- @RequestParam Long examEndTime) {
|
|
|
- Map<String, Object> map = examDetailService.taskTotalData(printPlanName, status, courseCode, paperNumber, examPlace, examStartTime, examEndTime);
|
|
|
- return ResultUtil.ok(map);
|
|
|
+ public Result taskTotalData(@RequestParam(value = "printPlanId", required = false) Long printPlanId,
|
|
|
+ @RequestParam(value = "status", required = false) String status,
|
|
|
+ @RequestParam(value = "courseCode", required = false) String courseCode,
|
|
|
+ @RequestParam(value = "paperNumber", required = false) String paperNumber,
|
|
|
+ @RequestParam(value = "examPlace", required = false) String examPlace,
|
|
|
+ @RequestParam(value = "examRoom", required = false) String examRoom,
|
|
|
+ @RequestParam(value = "examStartTime", required = false) Long examStartTime,
|
|
|
+ @RequestParam(value = "examEndTime", required = false) Long examEndTime) {
|
|
|
+ PrintTaskTotalDto printTaskTotalDto = examDetailService.taskTotalData(printPlanId, status, courseCode, paperNumber, examPlace, examRoom, examStartTime, examEndTime);
|
|
|
+ return ResultUtil.ok(printTaskTotalDto);
|
|
|
}
|
|
|
|
|
|
/**
|