diff --git a/src/main/java/com/sztzjy/fund_investment/mapper/UserMapper.java b/src/main/java/com/sztzjy/fund_investment/mapper/UserMapper.java index bcf943b..47a399a 100644 --- a/src/main/java/com/sztzjy/fund_investment/mapper/UserMapper.java +++ b/src/main/java/com/sztzjy/fund_investment/mapper/UserMapper.java @@ -1,10 +1,12 @@ package com.sztzjy.fund_investment.mapper; +import com.github.pagehelper.PageInfo; import com.sztzjy.fund_investment.entity.User; import com.sztzjy.fund_investment.entity.UserExample; import java.util.List; import java.util.Map; +import com.sztzjy.fund_investment.entity.dto.UserDto; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -36,4 +38,7 @@ public interface UserMapper { @Select("select distinct(class_id),class_name from wx_user where school_id = #{schoolId}") List> selectClassNameBySchoolId(@Param("schoolId") String schoolId); + + ListgetStudentScoreDetails(@Param("schoolId") String schoolId, @Param("classId")String classId, @Param("studentIdOrName")String studentIdOrName); + } \ No newline at end of file diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InquiryIssuanceServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InquiryIssuanceServiceImpl.java index 73aec06..d8efac5 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InquiryIssuanceServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/InquiryIssuanceServiceImpl.java @@ -344,7 +344,7 @@ public class InquiryIssuanceServiceImpl implements InquiryIssuanceService { inquiryParticipation1.setSecuritiesAccount(inquiryParticipation.getSecuritiesAccount()); inquiryParticipation1.setCustodianSeat(inquiryParticipation.getCustodianSeat()); inquiryParticipation1.setVoluntaryLockup(inquiryParticipation.getVoluntaryLockup()); - inquiryParticipation.setRemark(inquiryParticipation.getRemark()); + inquiryParticipation1.setRemark(inquiryParticipation.getRemark()); inquiryParticipation1.setDeclarationPrice(inquiryParticipation.getDeclarationPrice()); inquiryParticipation1.setIntendedSubscriptionQuantity(inquiryParticipation.getIntendedSubscriptionQuantity()); inquiryParticipation1.setStatus("1"); diff --git a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java index c7b1dfa..1dc1f48 100644 --- a/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java +++ b/src/main/java/com/sztzjy/fund_investment/service/serviceImpl/tea/ClassScoreServiceImpl.java @@ -1,6 +1,7 @@ package com.sztzjy.fund_investment.service.serviceImpl.tea; import cn.hutool.core.util.IdUtil; +import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.sztzjy.fund_investment.config.Constant; import com.sztzjy.fund_investment.entity.*; @@ -23,6 +24,8 @@ import javax.servlet.http.HttpServletResponse; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; /** * @Author xcj @@ -152,62 +155,81 @@ public class ClassScoreServiceImpl implements ClassScoreService { } +// /* 成绩详情页面 +// * @author xcj +// * @Date 2023/11/27 +// */ +// @Override +// public PageInfo getStudentScoreDetails(Integer index, Integer size, String schoolId, String classId, String studentIdOrName) { +// UserExample userTableExample = new UserExample(); +// UserExample.Criteria criteria = userTableExample.createCriteria(); +// UserExample.Criteria orCriteria = userTableExample.createCriteria(); +// criteria.andRoleIdEqualTo(4); +// if (StringUtils.isNotBlank(classId)) { +// criteria.andClassIdEqualTo(classId); +// } else { +// criteria.andSchoolIdEqualTo(schoolId); +// } +// if (StringUtils.isNotBlank(studentIdOrName)) { +// criteria.andNameEqualTo(studentIdOrName); +// orCriteria.andStudentIdEqualTo(studentIdOrName); +// } +// userTableExample.or(orCriteria); +// List userTables = userMapper.selectByExample(userTableExample); +// +// List userDtoList = new ArrayList<>(); +// for (User userTable : userTables) { +// UserDto userDto = new UserDto(); +// BeanUtils.copyProperties(userTable, userDto); +// Flow flow = flowMapper.selectByPrimaryKey(userTable.getUserid()); +// String flowId = flow.getFlowId(); +// TrainingReportExample trainingReportExample = new TrainingReportExample(); +// trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(Constant.TZBG); +// List trainingReports = reportMapper.selectByExample(trainingReportExample); +// PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample(); +// performanceScoreExample.createCriteria().andFlowIdEqualTo(flowId); +// List performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample); +// if (!performanceScores.isEmpty()) { +// PerformanceScore performanceScore = performanceScores.get(0); +// if (trainingReports.isEmpty()) { +// continue; +// } +// for (TrainingReport trainingReport : trainingReports) { +// userDto.setReportId(trainingReport.getId()); +// userDto.setReportName(trainingReport.getReportName()); +// } +// userDto.setFlowId(flowId); +// userDto.setScore(performanceScore.getTotalScore()); +// userDto.setPerformanceScoreId(performanceScore.getId()); +// userDtoList.add(userDto); +// } +// } +// if (userDtoList.size() <= 0) { +// return null; +// } +// userDtoList.sort(new StuUserDtoComparator()); //比较器按得分排序 +// return PageUtil.pageHelper(userDtoList, index, size); //分页 +// } + + /* 成绩详情页面 * @author xcj * @Date 2023/11/27 */ @Override public PageInfo getStudentScoreDetails(Integer index, Integer size, String schoolId, String classId, String studentIdOrName) { - UserExample userTableExample = new UserExample(); - UserExample.Criteria criteria = userTableExample.createCriteria(); - UserExample.Criteria orCriteria = userTableExample.createCriteria(); - criteria.andRoleIdEqualTo(4); - if (StringUtils.isNotBlank(classId)) { - criteria.andClassIdEqualTo(classId); - } else { - criteria.andSchoolIdEqualTo(schoolId); - } - if (StringUtils.isNotBlank(studentIdOrName)) { - criteria.andNameEqualTo(studentIdOrName); - orCriteria.andStudentIdEqualTo(studentIdOrName); - } - userTableExample.or(orCriteria); - List userTables = userMapper.selectByExample(userTableExample); - List userDtoList = new ArrayList<>(); - for (User userTable : userTables) { - UserDto userDto = new UserDto(); - BeanUtils.copyProperties(userTable, userDto); - Flow flow = flowMapper.selectByPrimaryKey(userTable.getUserid()); - String flowId = flow.getFlowId(); - TrainingReportExample trainingReportExample = new TrainingReportExample(); - trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo(Constant.TZBG); - List trainingReports = reportMapper.selectByExample(trainingReportExample); - PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample(); - performanceScoreExample.createCriteria().andFlowIdEqualTo(flowId); - List performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample); - if (!performanceScores.isEmpty()) { - PerformanceScore performanceScore = performanceScores.get(0); - if (trainingReports.isEmpty()) { - continue; - } - for (TrainingReport trainingReport : trainingReports) { - userDto.setReportId(trainingReport.getId()); - userDto.setReportName(trainingReport.getReportName()); - } - userDto.setFlowId(flowId); - userDto.setScore(performanceScore.getTotalScore()); - userDto.setPerformanceScoreId(performanceScore.getId()); - userDtoList.add(userDto); - } - } - if (userDtoList.size() <= 0) { - return null; - } - userDtoList.sort(new StuUserDtoComparator()); //比较器按得分排序 - return PageUtil.pageHelper(userDtoList, index, size); //分页 + PageHelper.startPage(index,size); + List studentScoreDetails = userMapper.getStudentScoreDetails(schoolId, classId, studentIdOrName); + PageInfo pageInfo =new PageInfo(studentScoreDetails); + return pageInfo; } + + + + + /* 成绩详情导出功能 * @author xcj * @Date 2023/11/27 diff --git a/src/main/resources/mappers/UserMapper.xml b/src/main/resources/mappers/UserMapper.xml index 7132d3f..0a23aac 100644 --- a/src/main/resources/mappers/UserMapper.xml +++ b/src/main/resources/mappers/UserMapper.xml @@ -390,4 +390,45 @@ login_type = #{loginType,jdbcType=INTEGER} where userid = #{userid,jdbcType=VARCHAR} + + + + + + + + + + + + + + + + + + + + \ No newline at end of file