From d65c2c63e77f23c88e42fec4cce4850af1e03a9d Mon Sep 17 00:00:00 2001 From: ly19960718 <1622779752@qq.com> Date: Wed, 5 May 2021 11:41:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8A=A5=E5=90=8D=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=9B=E5=BB=BA=E4=BA=BA=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java | 11 +++++++++++ .../resources/mybatis/mapper/apply/apply-mapper.xml | 8 ++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java index 0b66659..37471eb 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java @@ -52,6 +52,9 @@ public class ApplyDTO { private String applyUserCardPhoto; @ApiModelProperty(name = "applyAuditState", value = "报名状态 0 待审核 1用户撤回 2审核通过 3未报到 4报名完成-1审核不通过") private Integer applyAuditState; + @ApiModelProperty(name = "申请用户ID", value = "申请用户ID") + private String create; + @ApiModelProperty(name = "gmtCreate", value = "报名时间") private String gmtCreate; @@ -259,4 +262,12 @@ public class ApplyDTO { public void setApplyPhysicalStateName(String applyPhysicalStateName) { this.applyPhysicalStateName = applyPhysicalStateName; } + + public String getCreate() { + return create; + } + + public void setCreate(String create) { + this.create = create; + } } diff --git a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml index cd7e666..3f6501a 100644 --- a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml +++ b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml @@ -23,6 +23,7 @@ + @@ -263,7 +264,8 @@ t1.apply_user_card_photo, t1.apply_audit_state, t1.apply_id, - + t1.creator, + t1.gmt_create, t2.data_name AS apply_sex_name, t3.data_name AS apply_card_type_name, t4.data_name AS apply_culture_level_name, @@ -383,6 +385,7 @@ t1.apply_user_card_photo, t1.apply_audit_state, t1.gmt_create, + t1,t1.creator, t2.data_name AS apply_sex_name, t3.data_name AS apply_card_type_name, t4.data_name AS apply_culture_level_name, @@ -437,9 +440,6 @@ #{applyAuditStates[${index}]} - - - ORDER BY t1.gmt_create DESC From a4ba12e13e0e533a414d73db722228c7beeb1e98 Mon Sep 17 00:00:00 2001 From: ly19960718 <1622779752@qq.com> Date: Wed, 5 May 2021 12:47:02 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/api/apply/ApplyAppController.java | 18 ++++++++ .../com/tenlion/pojo/dtos/apply/ApplyDTO.java | 22 ++++++++++ .../tenlion/service/apply/IApplyService.java | 8 ++++ .../service/apply/impl/ApplyServiceImpl.java | 44 +++++++++++++++++-- .../mybatis/mapper/apply/apply-mapper.xml | 6 ++- 5 files changed, 93 insertions(+), 5 deletions(-) diff --git a/src/main/java/cn/com/tenlion/controller/app/api/apply/ApplyAppController.java b/src/main/java/cn/com/tenlion/controller/app/api/apply/ApplyAppController.java index aed3dca..4535799 100644 --- a/src/main/java/cn/com/tenlion/controller/app/api/apply/ApplyAppController.java +++ b/src/main/java/cn/com/tenlion/controller/app/api/apply/ApplyAppController.java @@ -39,6 +39,24 @@ public class ApplyAppController extends DefaultBaseController { + @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("listPageMyApply") + public SuccessResultList> listPageMyApply(@RequestHeader("token") String token, ListPage page) throws Exception{ + Map params = requestParams(); + page.setParams(params); + return applyService.listPageMyApply(token,page); + } + + @ApiOperation(value = "报名计划分页列表", notes = "报名计划分页列表接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header"), diff --git a/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java b/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java index 37471eb..dd239f0 100644 --- a/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java +++ b/src/main/java/cn/com/tenlion/pojo/dtos/apply/ApplyDTO.java @@ -70,6 +70,11 @@ public class ApplyDTO { @ApiModelProperty(name = "applyPhysicalStateName", value = "身体状态中文") private String applyPhysicalStateName; + @ApiModelProperty(name = "是否可查看准考证", value = "是否可查看准考证 0不可查看 1可查看") + private int distributionCardState; + @ApiModelProperty(name = "准考证码", value = "准考证码") + private String distributionCardCode; + public String getApplyInstitutionId() { return applyInstitutionId; @@ -270,4 +275,21 @@ public class ApplyDTO { public void setCreate(String create) { this.create = create; } + + + public int getDistributionCardState() { + return distributionCardState; + } + + public void setDistributionCardState(int distributionCardState) { + this.distributionCardState = distributionCardState; + } + + public String getDistributionCardCode() { + return distributionCardCode; + } + + public void setDistributionCardCode(String distributionCardCode) { + this.distributionCardCode = distributionCardCode; + } } diff --git a/src/main/java/cn/com/tenlion/service/apply/IApplyService.java b/src/main/java/cn/com/tenlion/service/apply/IApplyService.java index 2679e5c..38e610f 100644 --- a/src/main/java/cn/com/tenlion/service/apply/IApplyService.java +++ b/src/main/java/cn/com/tenlion/service/apply/IApplyService.java @@ -27,6 +27,14 @@ public interface IApplyService { */ void audit(String token,ApplyAuditVO applyAuditVO); + /** + * 获取我的报名列表 + * @param token + * @param page + * @return + */ + SuccessResultList> listPageMyApply(String token,ListPage page); + /** * 获取报名计划列表 * @param page diff --git a/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java b/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java index cc2e485..45d0e69 100644 --- a/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java +++ b/src/main/java/cn/com/tenlion/service/apply/impl/ApplyServiceImpl.java @@ -2,16 +2,19 @@ package cn.com.tenlion.service.apply.impl; import cn.com.tenlion.pojo.dtos.apply.ApplyClassPlanDTO; import cn.com.tenlion.pojo.dtos.classplan.ClassPlanDTO; +import cn.com.tenlion.pojo.dtos.distributioncard.DistributionCardDTO; import cn.com.tenlion.pojo.vos.apply.ApplyAuditVO; import cn.com.tenlion.pojo.vos.applyauditlog.ApplyAuditLogVO; import cn.com.tenlion.pojo.vos.traininginstitutionuser.InstitutionUserVO; import cn.com.tenlion.service.applyauditlog.IApplyAuditLogService; import cn.com.tenlion.service.classplan.IClassPlanService; +import cn.com.tenlion.service.examination.distributioncard.IDistributionCardService; import ink.wgink.common.base.DefaultBaseService; import ink.wgink.exceptions.ParamsException; import ink.wgink.exceptions.SaveException; import ink.wgink.exceptions.SearchException; import ink.wgink.pojo.ListPage; +import ink.wgink.pojo.app.AppTokenUser; import ink.wgink.pojo.result.SuccessResult; import ink.wgink.pojo.result.SuccessResultList; import ink.wgink.util.date.DateUtil; @@ -50,6 +53,39 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic private IApplyAuditLogService applyAuditLogService; @Autowired private IClassPlanService classPlanService; + @Autowired + private IDistributionCardService distributionCardService; + + + + + public SuccessResultList> listPageMyApply(String token,ListPage page){ + if (StringUtils.isBlank(token)) { + page.getParams().put("creator",securityComponent.getCurrentUser().getUserId()); + } else { + AppTokenUser appTokenUser = getAppTokenUser(token); + page.getParams().put("creator",appTokenUser.getId()); + } + PageHelper.startPage(page.getPage(), page.getRows()); + List applyDTOs = list(page.getParams()); + for (ApplyDTO applyDTO : applyDTOs) { + DistributionCardDTO distributionCardDTO = distributionCardService.get(applyDTO.getApplyId()); + if(distributionCardDTO == null){ + applyDTO.setDistributionCardState(0); + }else{ + applyDTO.setDistributionCardState(1); + applyDTO.setDistributionCardCode(distributionCardDTO.getDistributionCardPictures()); + } + } + PageInfo pageInfo = new PageInfo<>(applyDTOs); + return new SuccessResultList<>(applyDTOs, pageInfo.getPageNum(), pageInfo.getTotal()); + } + + + + + + public void audit(String token,ApplyAuditVO applyAuditVO){ @@ -276,10 +312,6 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic @Override public List list(Map params) { - InstitutionUserVO institutionUserVO = securityComponent.getExpandData(InstitutionUserVO.class); - if(institutionUserVO != null){ - params.put("applyInstitutionId",institutionUserVO.getInstitutionId()); - } return applyDao.list(params); } @@ -295,6 +327,10 @@ public class ApplyServiceImpl extends DefaultBaseService implements IApplyServic @Override public SuccessResultList> listPage(ListPage page) { + InstitutionUserVO institutionUserVO = securityComponent.getExpandData(InstitutionUserVO.class); + if(institutionUserVO != null){ + page.getParams().put("applyInstitutionId",institutionUserVO.getInstitutionId()); + } PageHelper.startPage(page.getPage(), page.getRows()); List applyDTOs = list(page.getParams()); PageInfo pageInfo = new PageInfo<>(applyDTOs); diff --git a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml index 3f6501a..3b54ce4 100644 --- a/src/main/resources/mybatis/mapper/apply/apply-mapper.xml +++ b/src/main/resources/mybatis/mapper/apply/apply-mapper.xml @@ -385,7 +385,7 @@ t1.apply_user_card_photo, t1.apply_audit_state, t1.gmt_create, - t1,t1.creator, + t1.creator, t2.data_name AS apply_sex_name, t3.data_name AS apply_card_type_name, t4.data_name AS apply_culture_level_name, @@ -433,6 +433,10 @@ AND t1.apply_institution_id = #{applyInstitutionId} + + AND + t1.creator = #{creator} + AND t1.apply_audit_state IN