From cb46ff719c43eed18b117150143a4c7d7d11b251 Mon Sep 17 00:00:00 2001 From: cuibaocheng Date: Fri, 7 May 2021 12:38:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=BE=E7=89=87=E5=A5=97=E7=89=88=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionCardAppController.java | 26 +++++++++++++++++++ .../service/classplan/IClassPlanService.java | 1 - .../impl/DistributionServiceImpl.java | 4 --- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/main/java/cn/com/tenlion/controller/app/api/examination/distributioncard/DistributionCardAppController.java b/src/main/java/cn/com/tenlion/controller/app/api/examination/distributioncard/DistributionCardAppController.java index c32cc5b..2082bd0 100644 --- a/src/main/java/cn/com/tenlion/controller/app/api/examination/distributioncard/DistributionCardAppController.java +++ b/src/main/java/cn/com/tenlion/controller/app/api/examination/distributioncard/DistributionCardAppController.java @@ -1,20 +1,25 @@ package cn.com.tenlion.controller.app.api.examination.distributioncard; +import cn.com.tenlion.pojo.dtos.examinationuser.ExaminationDTO; import cn.com.tenlion.service.examination.distributioncard.IDistributionCardService; import ink.wgink.annotation.CheckRequestBodyAnnotation; import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.common.component.SecurityComponent; import ink.wgink.interfaces.consts.ISystemConstant; import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.app.AppTokenUser; import ink.wgink.pojo.result.ErrorResult; import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResultData; import ink.wgink.pojo.result.SuccessResultList; import cn.com.tenlion.pojo.dtos.distributioncard.DistributionCardDTO; import cn.com.tenlion.pojo.vos.distributioncard.DistributionCardVO; +import ink.wgink.util.ReflectUtil; import io.swagger.annotations.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.Arrays; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -32,6 +37,8 @@ public class DistributionCardAppController extends DefaultBaseController { @Autowired private IDistributionCardService distributionCardService; + @Autowired + protected SecurityComponent securityComponent; @ApiOperation(value = "考场分配准考证详情(报名ID)", notes = "考场分配准考证详情(报名ID)接口") @ApiImplicitParams({ @@ -44,4 +51,23 @@ public class DistributionCardAppController extends DefaultBaseController { return distributionCardService.get(distributionCardId); } + @ApiOperation(value = "获取自己的准考证", notes = "获取自己的准考证分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("listpage") + public SuccessResultList> listPage(@RequestHeader("token") String token, ListPage page) throws ReflectUtil.ReflectException { + AppTokenUser user = securityComponent.getAppTokenUser(token); + Map params = requestParams(); + params.put("distributionCardUserId" , user.getId()); + page.setParams(params); + return distributionCardService.listPage(page); + } + } \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java b/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java index 8b4a4ac..2ef4f5d 100644 --- a/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java +++ b/src/main/java/cn/com/tenlion/service/classplan/IClassPlanService.java @@ -7,7 +7,6 @@ import cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO; import cn.com.tenlion.pojo.vos.classplan.ClassPlanVO; import cn.com.tenlion.pojo.bos.classplan.ClassPlanBO; import cn.com.tenlion.pojo.pos.classplan.ClassPlanPO; - import java.util.List; import java.util.Map; diff --git a/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java b/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java index d0607c5..3b46c3b 100644 --- a/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/examination/distribution/impl/DistributionServiceImpl.java @@ -16,20 +16,16 @@ import cn.com.tenlion.service.examination.distribution.IDistributionService; import cn.com.tenlion.service.examination.distributionfield.IDistributionFieldService; import cn.com.tenlion.service.examination.stationuser.IStationUserService; import ink.wgink.common.base.DefaultBaseService; -import ink.wgink.common.component.SecurityComponent; import ink.wgink.exceptions.SaveException; import ink.wgink.exceptions.UpdateException; import ink.wgink.pojo.ListPage; import ink.wgink.pojo.result.SuccessResultList; import ink.wgink.util.map.HashMapUtil; -import ink.wgink.util.UUIDUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; -import org.apache.commons.collections.map.HashedMap; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.*;