修改学生端获奖和成绩

main
王家东 12 months ago
parent 9ad3dc5a07
commit fbf184222b
  1. 36
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/controller/AwardPersionController.java
  2. 3
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/mapper/AwardPersionMapper.java
  3. 3
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/service/IAwardPersionService.java
  4. 9
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/awardpersion/service/impl/AwardPersionServiceImpl.java
  5. 29
      jeecg-boot-master/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/scorepersion/controller/ScorePersionController.java

@ -140,6 +140,42 @@ public class AwardPersionController extends JeecgController<AwardPersion, IAward
return Result.OK(pageList); return Result.OK(pageList);
} }
/**
* 分页列表查询学生端
*
* @param awardPersion
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "获奖管理-分页列表查询(学生端)")
@ApiOperation(value="获奖管理-分页列表查询(学生端)", notes="获奖管理-分页列表查询(学生端)")
@GetMapping(value = "/liststu")
public Result<IPage<AwardPersion>> liststu(AwardPersion compExp,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<AwardPersion> queryWrapper = QueryGenerator.initQueryWrapper(compExp, req.getParameterMap());
LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> str = awardPersionService.getteambyuserid(user.getId());
queryWrapper.in("enroll_code",str);
Page<AwardPersion> page = new Page<AwardPersion>(pageNo, pageSize);
IPage<AwardPersion> pageList = awardPersionService.page(page, queryWrapper);
for(int i = 0 ; i < pageList.getRecords().size();i++){
TeamManagement teamManagement = new TeamManagement();
QueryWrapper<TeamManagement> queryWrappertm = QueryGenerator.initQueryWrapper(teamManagement, req.getParameterMap());
queryWrappertm.eq("enroll_code",pageList.getRecords().get(i).getEnrollCode());
List<TeamManagement> 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);
}
/** /**
* 添加 * 添加
* *

@ -3,6 +3,7 @@ package org.jeecg.modules.demo.awardpersion.mapper;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; import org.jeecg.modules.demo.awardpersion.entity.AwardPersion;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -14,4 +15,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface AwardPersionMapper extends BaseMapper<AwardPersion> { public interface AwardPersionMapper extends BaseMapper<AwardPersion> {
@Select("select enroll_code from team_management where user_id = #{id}")
List<String> getteambyuserid(String id);
} }

@ -3,6 +3,8 @@ package org.jeecg.modules.demo.awardpersion.service;
import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; import org.jeecg.modules.demo.awardpersion.entity.AwardPersion;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/** /**
* @Description: 获奖管理 * @Description: 获奖管理
* @Author: jeecg-boot * @Author: jeecg-boot
@ -11,4 +13,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface IAwardPersionService extends IService<AwardPersion> { public interface IAwardPersionService extends IService<AwardPersion> {
List<String> getteambyuserid(String id);
} }

@ -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.entity.AwardPersion;
import org.jeecg.modules.demo.awardpersion.mapper.AwardPersionMapper; import org.jeecg.modules.demo.awardpersion.mapper.AwardPersionMapper;
import org.jeecg.modules.demo.awardpersion.service.IAwardPersionService; import org.jeecg.modules.demo.awardpersion.service.IAwardPersionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import java.util.List;
/** /**
* @Description: 获奖管理 * @Description: 获奖管理
* @Author: jeecg-boot * @Author: jeecg-boot
@ -15,5 +18,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
*/ */
@Service @Service
public class AwardPersionServiceImpl extends ServiceImpl<AwardPersionMapper, AwardPersion> implements IAwardPersionService { public class AwardPersionServiceImpl extends ServiceImpl<AwardPersionMapper, AwardPersion> implements IAwardPersionService {
@Autowired
private AwardPersionMapper awardPersionMapper;
@Override
public List<String> getteambyuserid(String id) {
return awardPersionMapper.getteambyuserid(id);
}
} }

@ -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.annualcompetitionprojectregistration.service.IAnnualCompetitionProjectRegistrationService;
import org.jeecg.modules.demo.awardpersion.entity.AwardPersion; import org.jeecg.modules.demo.awardpersion.entity.AwardPersion;
import org.jeecg.modules.demo.awardpersion.entity.AwardPersionMb; 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.ScorePersion;
import org.jeecg.modules.demo.scorepersion.entity.ScorePersionMb; import org.jeecg.modules.demo.scorepersion.entity.ScorePersionMb;
import org.jeecg.modules.demo.scorepersion.service.IScorePersionService; import org.jeecg.modules.demo.scorepersion.service.IScorePersionService;
@ -64,6 +65,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
@Slf4j @Slf4j
public class ScorePersionController extends JeecgController<ScorePersion, IScorePersionService> { public class ScorePersionController extends JeecgController<ScorePersion, IScorePersionService> {
@Autowired @Autowired
private IAwardPersionService awardPersionService;
@Autowired
private IScorePersionService scorePersionService; private IScorePersionService scorePersionService;
@Autowired @Autowired
private IAnnualCompetitionProjectRegistrationService annualCompetitionProjectRegistrationService; private IAnnualCompetitionProjectRegistrationService annualCompetitionProjectRegistrationService;
@ -93,6 +96,32 @@ public class ScorePersionController extends JeecgController<ScorePersion, IScore
return Result.OK(pageList); return Result.OK(pageList);
} }
/**
* 分页列表查询(学生端)
*
* @param scorePersion
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "成绩管理-分页列表查询")
@ApiOperation(value="成绩管理-分页列表查询(学生端)", notes="成绩管理-分页列表查询(学生端)")
@GetMapping(value = "/liststu")
public Result<IPage<ScorePersion>> liststu(ScorePersion scorePersion,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ScorePersion> queryWrapper = QueryGenerator.initQueryWrapper(scorePersion, req.getParameterMap());
LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal();
List<String> str = awardPersionService.getteambyuserid(user.getId());
queryWrapper.in("enroll_code",str);
Page<ScorePersion> page = new Page<ScorePersion>(pageNo, pageSize);
IPage<ScorePersion> pageList = scorePersionService.page(page, queryWrapper);
return Result.OK(pageList);
}
/** /**
* 添加 * 添加
* *

Loading…
Cancel
Save