diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java index 5c515010..cd509bfb 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java @@ -140,6 +140,42 @@ public class AwardPersionController extends JeecgController> liststu(AwardPersion compExp, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(compExp, req.getParameterMap()); + LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List str = awardPersionService.getteambyuserid(user.getId()); + queryWrapper.in("enroll_code",str); + Page page = new Page(pageNo, pageSize); + IPage pageList = awardPersionService.page(page, queryWrapper); + for(int i = 0 ; i < pageList.getRecords().size();i++){ + TeamManagement teamManagement = new TeamManagement(); + QueryWrapper queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap()); + queryWrappertm.eq("enroll_code",pageList.getRecords().get(i).getEnrollCode()); + List listtm = teamManagementService.list(queryWrappertm); + SysUser sysUser = sysUserService.getById(listtm.get(0).getUserId()); + pageList.getRecords().get(i).setStudentcode(sysUser.getUsername()); + pageList.getRecords().get(i).setStudentname(sysUser.getRealname()); + } + return Result.OK(pageList); + } + + /** * 添加 * diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/mapper/AwardPersionMapper.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/mapper/AwardPersionMapper.java index 044978a0..403bfed7 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/mapper/AwardPersionMapper.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/mapper/AwardPersionMapper.java @@ -3,6 +3,7 @@ package org.jeecg.modules.demo.awardpersion.mapper; import java.util.List; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @@ -14,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface AwardPersionMapper extends BaseMapper { + @Select("select enroll_code from team_management where user_id = #{id}") + List getteambyuserid(String id); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/service/IAwardPersionService.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/service/IAwardPersionService.java index e9050ccd..0adc4778 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/service/IAwardPersionService.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/service/IAwardPersionService.java @@ -3,6 +3,8 @@ package org.jeecg.modules.demo.awardpersion.service; import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * @Description: 获奖管理 * @Author: jeecg-boot @@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IAwardPersionService extends IService { + List getteambyuserid(String id); } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/service/impl/AwardPersionServiceImpl.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/service/impl/AwardPersionServiceImpl.java index 7f77fedb..82589d9e 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/service/impl/AwardPersionServiceImpl.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/service/impl/AwardPersionServiceImpl.java @@ -3,10 +3,13 @@ package org.jeecg.modules.demo.awardpersion.service.impl; import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; import org.jeecg.modules.demo.awardpersion.mapper.AwardPersionMapper; import org.jeecg.modules.demo.awardpersion.service.IAwardPersionService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.List; + /** * @Description: 获奖管理 * @Author: jeecg-boot @@ -15,5 +18,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; */ @Service public class AwardPersionServiceImpl extends ServiceImpl implements IAwardPersionService { + @Autowired + private AwardPersionMapper awardPersionMapper; + @Override + public List getteambyuserid(String id) { + return awardPersionMapper.getteambyuserid(id); + } } diff --git a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorepersion/controller/ScorePersionController.java b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorepersion/controller/ScorePersionController.java index 7d7b1bac..c01a3ea4 100644 --- a/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorepersion/controller/ScorePersionController.java +++ b/jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorepersion/controller/ScorePersionController.java @@ -26,6 +26,7 @@ import org.jeecg.modules.demo.annualcompetitionprojectregistration.entity.Annual import org.jeecg.modules.demo.annualcompetitionprojectregistration.service.IAnnualCompetitionProjectRegistrationService; import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; import org.jeecg.modules.demo.awardpersion.entity.AwardPersionMb; +import org.jeecg.modules.demo.awardpersion.service.IAwardPersionService; import org.jeecg.modules.demo.scorepersion.entity.ScorePersion; import org.jeecg.modules.demo.scorepersion.entity.ScorePersionMb; import org.jeecg.modules.demo.scorepersion.service.IScorePersionService; @@ -63,6 +64,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; @RequestMapping("/scorepersion/scorePersion") @Slf4j public class ScorePersionController extends JeecgController { + @Autowired + private IAwardPersionService awardPersionService; @Autowired private IScorePersionService scorePersionService; @Autowired @@ -93,6 +96,32 @@ public class ScorePersionController extends JeecgController> liststu(ScorePersion scorePersion, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(scorePersion, req.getParameterMap()); + LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); + List str = awardPersionService.getteambyuserid(user.getId()); + queryWrapper.in("enroll_code",str); + Page page = new Page(pageNo, pageSize); + IPage pageList = scorePersionService.page(page, queryWrapper); + return Result.OK(pageList); + } + /** * 添加 *