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 1/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 From 4e016f22680d2074b59346c15560844e858a87e3 Mon Sep 17 00:00:00 2001 From: wans <747101512@qq.com> Date: Wed, 5 May 2021 12:51:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B0=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tenlion/controller/api/classplan/ClassPlanController.java | 2 +- .../com/tenlion/controller/api/lessons/LessonsController.java | 2 +- .../com/tenlion/controller/api/teacher/TeacherController.java | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/cn/com/tenlion/controller/api/classplan/ClassPlanController.java b/src/main/java/cn/com/tenlion/controller/api/classplan/ClassPlanController.java index c2ef39b..a6f57c7 100644 --- a/src/main/java/cn/com/tenlion/controller/api/classplan/ClassPlanController.java +++ b/src/main/java/cn/com/tenlion/controller/api/classplan/ClassPlanController.java @@ -27,7 +27,7 @@ import java.util.Map; * @Date: 2021-05-03 06:54:52 * @Version: 3.0 **/ -@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "接口") +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "培训计划接口") @RestController @RequestMapping(ISystemConstant.API_PREFIX + "/classplan") public class ClassPlanController extends DefaultBaseController { diff --git a/src/main/java/cn/com/tenlion/controller/api/lessons/LessonsController.java b/src/main/java/cn/com/tenlion/controller/api/lessons/LessonsController.java index 0468564..70bafd7 100644 --- a/src/main/java/cn/com/tenlion/controller/api/lessons/LessonsController.java +++ b/src/main/java/cn/com/tenlion/controller/api/lessons/LessonsController.java @@ -26,7 +26,7 @@ import java.util.Map; * @Date: 2021-05-02 07:03:18 * @Version: 3.0 **/ -@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "接口") +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "课程接口") @RestController @RequestMapping(ISystemConstant.API_PREFIX + "/lessons") public class LessonsController extends DefaultBaseController { diff --git a/src/main/java/cn/com/tenlion/controller/api/teacher/TeacherController.java b/src/main/java/cn/com/tenlion/controller/api/teacher/TeacherController.java index 69a0f9d..f05983f 100644 --- a/src/main/java/cn/com/tenlion/controller/api/teacher/TeacherController.java +++ b/src/main/java/cn/com/tenlion/controller/api/teacher/TeacherController.java @@ -106,4 +106,5 @@ public class TeacherController extends DefaultBaseController { public SuccessResult delete(@PathVariable("ids") String ids) throws RemoveException { return teacherService.delete(ids); } + }