修改实务认知得分和智能评分规则

master
xiaoCJ 11 months ago
parent 863930e15e
commit 7b22b9cf8a

@ -1,10 +1,12 @@
package com.sztzjy.fund_investment.mapper; package com.sztzjy.fund_investment.mapper;
import com.github.pagehelper.PageInfo;
import com.sztzjy.fund_investment.entity.User; import com.sztzjy.fund_investment.entity.User;
import com.sztzjy.fund_investment.entity.UserExample; import com.sztzjy.fund_investment.entity.UserExample;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.sztzjy.fund_investment.entity.dto.UserDto;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; 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}") @Select("select distinct(class_id),class_name from wx_user where school_id = #{schoolId}")
List<Map<String,String>> selectClassNameBySchoolId(@Param("schoolId") String schoolId); List<Map<String,String>> selectClassNameBySchoolId(@Param("schoolId") String schoolId);
List<UserDto>getStudentScoreDetails(@Param("schoolId") String schoolId, @Param("classId")String classId, @Param("studentIdOrName")String studentIdOrName);
} }

@ -344,7 +344,7 @@ public class InquiryIssuanceServiceImpl implements InquiryIssuanceService {
inquiryParticipation1.setSecuritiesAccount(inquiryParticipation.getSecuritiesAccount()); inquiryParticipation1.setSecuritiesAccount(inquiryParticipation.getSecuritiesAccount());
inquiryParticipation1.setCustodianSeat(inquiryParticipation.getCustodianSeat()); inquiryParticipation1.setCustodianSeat(inquiryParticipation.getCustodianSeat());
inquiryParticipation1.setVoluntaryLockup(inquiryParticipation.getVoluntaryLockup()); inquiryParticipation1.setVoluntaryLockup(inquiryParticipation.getVoluntaryLockup());
inquiryParticipation.setRemark(inquiryParticipation.getRemark()); inquiryParticipation1.setRemark(inquiryParticipation.getRemark());
inquiryParticipation1.setDeclarationPrice(inquiryParticipation.getDeclarationPrice()); inquiryParticipation1.setDeclarationPrice(inquiryParticipation.getDeclarationPrice());
inquiryParticipation1.setIntendedSubscriptionQuantity(inquiryParticipation.getIntendedSubscriptionQuantity()); inquiryParticipation1.setIntendedSubscriptionQuantity(inquiryParticipation.getIntendedSubscriptionQuantity());
inquiryParticipation1.setStatus("1"); inquiryParticipation1.setStatus("1");

@ -1,6 +1,7 @@
package com.sztzjy.fund_investment.service.serviceImpl.tea; package com.sztzjy.fund_investment.service.serviceImpl.tea;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.fund_investment.config.Constant; import com.sztzjy.fund_investment.config.Constant;
import com.sztzjy.fund_investment.entity.*; import com.sztzjy.fund_investment.entity.*;
@ -23,6 +24,8 @@ import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.math.RoundingMode; import java.math.RoundingMode;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/** /**
* @Author xcj * @Author xcj
@ -152,62 +155,81 @@ public class ClassScoreServiceImpl implements ClassScoreService {
} }
// /* 成绩详情页面
// * @author xcj
// * @Date 2023/11/27
// */
// @Override
// public PageInfo<UserDto> 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<User> userTables = userMapper.selectByExample(userTableExample);
//
// List<UserDto> 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<TrainingReport> trainingReports = reportMapper.selectByExample(trainingReportExample);
// PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
// performanceScoreExample.createCriteria().andFlowIdEqualTo(flowId);
// List<PerformanceScore> 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 * @author xcj
* @Date 2023/11/27 * @Date 2023/11/27
*/ */
@Override @Override
public PageInfo<UserDto> getStudentScoreDetails(Integer index, Integer size, String schoolId, String classId, String studentIdOrName) { public PageInfo<UserDto> getStudentScoreDetails(Integer index, Integer size, String schoolId, String classId, String studentIdOrName) {
UserExample userTableExample = new UserExample(); PageHelper.startPage(index,size);
UserExample.Criteria criteria = userTableExample.createCriteria(); List<UserDto> studentScoreDetails = userMapper.getStudentScoreDetails(schoolId, classId, studentIdOrName);
UserExample.Criteria orCriteria = userTableExample.createCriteria(); PageInfo <UserDto>pageInfo =new PageInfo(studentScoreDetails);
criteria.andRoleIdEqualTo(4); return pageInfo;
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<User> userTables = userMapper.selectByExample(userTableExample);
List<UserDto> 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<TrainingReport> trainingReports = reportMapper.selectByExample(trainingReportExample);
PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
performanceScoreExample.createCriteria().andFlowIdEqualTo(flowId);
List<PerformanceScore> 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 * @author xcj
* @Date 2023/11/27 * @Date 2023/11/27

@ -390,4 +390,45 @@
login_type = #{loginType,jdbcType=INTEGER} login_type = #{loginType,jdbcType=INTEGER}
where userid = #{userid,jdbcType=VARCHAR} where userid = #{userid,jdbcType=VARCHAR}
</update> </update>
<resultMap id="UserDtoMap" type="com.sztzjy.fund_investment.entity.dto.UserDto">
<id column="userid" jdbcType="VARCHAR" property="userid"/>
<result column="school_name" jdbcType="VARCHAR" property="schoolName"/>
<result column="class_name" jdbcType="VARCHAR" property="className"/>
<result column="name" jdbcType="VARCHAR" property="name"/>
<result column="student_id" jdbcType="VARCHAR" property="studentId"/>
<result column="class_id" jdbcType="VARCHAR" property="classId"/>
<result column="school_id" jdbcType="VARCHAR" property="schoolId"/>
<result column="report_name" jdbcType="VARCHAR" property="reportName"/>
<result column="total_score" jdbcType="DECIMAL" property="score"/>
<result column="flow_id" jdbcType="VARCHAR" property="flowId"/>
<result column="id" jdbcType="VARCHAR" property="performanceScoreId"/>
<result column="report_id" jdbcType="VARCHAR" property="reportId"/>
</resultMap>
<select id="getStudentScoreDetails" resultMap="UserDtoMap">
SELECT u.class_id,u.class_name,u.school_id,u.school_name,u.`name`,u.student_id,
u.userid,
tr.report_name,tr.id report_id,
ps.total_score,ps.id,
f.flow_id
FROM wx_user u
JOIN flow f on u.userid = f.userid
LEFT JOIN training_report tr ON tr.flow_id = f.flow_id AND tr.step = '投资报告'
LEFT JOIN performance_score ps on ps.flow_id = f.flow_id
WHERE u.role_id = 4
<if test="schoolId != null">
AND u.school_id = #{schoolId}
</if>
<if test="classId != null">
AND u.class_id = #{classId}
</if>
<if test="studentIdOrName != null">
AND u.name like '%${studentIdOrName}%' OR u.student_id like '%${studentIdOrName}%'
</if>
ORDER BY ps.total_score DESC
</select>
</mapper> </mapper>
Loading…
Cancel
Save