@t2652009480 9 months ago
commit 12fc933b10

@ -155,6 +155,7 @@ public class TopicController {
if (time >= 120) {
score = BigDecimal.valueOf(5);
performanceScore.setPracticalCognitionScore(score);
performanceScore.setTotalScore(score);
} else {
performanceScore.setPracticalCognitionScore(BigDecimal.ZERO);
}

@ -141,30 +141,58 @@ public class ClassScoreController {
}
// @AnonymousAccess
// @PostMapping("/updateExperienceScore")
// @ApiOperation("成绩详情/实训心得/修改心得或报告分数")
// public void updateScoreByFlowId(@RequestParam String reportId,
// @RequestParam Integer score,
// @ApiParam("0为心得,1为报告") @RequestParam Integer type) {
// TrainingReport trainingReport = trainingReportMapper.selectByPrimaryKey(reportId);
//
// if (type == 0) {
// trainingReport.setExperienceScore(BigDecimal.valueOf(score));
// performanceScoreService.updateScore("experienceScore", score, trainingReport.getFlowId());
// }
// if (type == 1) {
// trainingReport.setReportScore(BigDecimal.valueOf(score));
// performanceScoreService.updateScore("investmentReportScore", score, trainingReport.getFlowId());
// }
// trainingReportMapper.updateByPrimaryKey(trainingReport);
// }
@AnonymousAccess
@PostMapping("/updateExperienceScore")
@ApiOperation("成绩详情/实训心得/修改心得或报告分数")
public void updateScoreByFlowId(@RequestParam String reportId,
@RequestParam Integer score,
@ApiParam("0为心得,1为报告") @RequestParam Integer type) {
TrainingReport trainingReport = trainingReportMapper.selectByPrimaryKey(reportId);
if (type == 0) {
trainingReport.setExperienceScore(BigDecimal.valueOf(score));
performanceScoreService.updateScore("experienceScore", score, trainingReport.getFlowId());
public void updateExperienceScore(@RequestParam String flowId,
@ApiParam("传Map的json字符串,例:{\"心得\": 分数,\"报告\": 分数}") @RequestParam String json) {
Map<String, Integer> map;
try {
ObjectMapper objectMapper = new ObjectMapper();
map = objectMapper.readValue(json, new TypeReference<Map<String, Integer>>() {
});
} catch (Exception e) {
throw new ClassCastException("类型转换错误");
}
for (Map.Entry<String, Integer> entry : map.entrySet()) {
String key = entry.getKey();
Integer score = entry.getValue();
if (key.equals("心得")) {
performanceScoreService.updateScore("experienceScore", score, flowId);
}
if (type == 1) {
trainingReport.setReportScore(BigDecimal.valueOf(score));
performanceScoreService.updateScore("investmentReportScore", score, trainingReport.getFlowId());
if (key.equals("报告")) {
performanceScoreService.updateScore("investmentReportScore", score, flowId);
}
trainingReportMapper.updateByPrimaryKey(trainingReport);
}
}
@AnonymousAccess
@GetMapping("/getClassNameBySchoolId")
@ApiOperation("成绩管理&互动答疑/班级下拉框")
public ResultEntity<List<Map<String,String>>> getClassNameBySchoolId(@RequestParam String schoolId) {
List<Map<String,String>> nameAndId = userMapper.selectClassNameBySchoolId(schoolId);
public ResultEntity<List<Map<String, String>>> getClassNameBySchoolId(@RequestParam String schoolId) {
List<Map<String, String>> nameAndId = userMapper.selectClassNameBySchoolId(schoolId);
return new ResultEntity<>(nameAndId);
}

@ -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<Map<String,String>> selectClassNameBySchoolId(@Param("schoolId") String schoolId);
List<UserDto>getStudentScoreDetails(@Param("schoolId") String schoolId, @Param("classId")String classId, @Param("studentIdOrName")String studentIdOrName);
}

@ -11,4 +11,5 @@ public interface PerformanceScoreService {
void calculateScoreByModule2(String methodName, Integer score, String flowId);
PerformanceScore getByFlowId(String flowId);
void updateScore(String methodName, Integer score, String flowId);
void ipoUpdateScore(String methodName, Integer score, String flowId);
}

@ -64,6 +64,8 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
@Autowired
private PerformanceScoreService performanceScoreService;
/**
*
*/
@ -513,8 +515,20 @@ public class ContractInvestmentServiceImpl implements ContractInvestmentService
else {
issuanceParameterInput.setId(IdUtil.fastSimpleUUID());
issuanceParameterInputMapper.insertSelective(issuanceParameterInput);
performanceScoreService.calculateScoreByModule("pricingIssuanceEnteringScore", 2, issuanceParameterInput.getFlowId());
//添加询价发行完成时间
PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
performanceScoreExample.createCriteria().andFlowIdEqualTo(issuanceParameterInput.getFlowId());
List<PerformanceScore> performanceScoreList = performanceScoreMapper.selectByExample(performanceScoreExample);
if (!performanceScoreList.isEmpty()){
performanceScoreList.get(0).setPricingIssuanceTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScoreList.get(0));
}
return new ResultEntity<>(HttpStatus.OK);
}

@ -57,6 +57,19 @@ public class PerformanceScoreServiceImpl implements PerformanceScoreService {
performanceScoreMapper.updateByPrimaryKey(performanceScore);
}
@Override //ipo接口算分
public void ipoUpdateScore(String methodName, Integer score, String flowId) {
PerformanceScore performanceScore = getByFlowId(flowId);
BigDecimal oldScore = (BigDecimal) performanceScore.get(methodName);
if (oldScore==null){
oldScore = BigDecimal.ZERO;
}
performanceScore.set(methodName, BigDecimal.valueOf(score).add(oldScore));
BigDecimal add = performanceScore.getTotalScore().add(BigDecimal.valueOf(score));
performanceScore.setTotalScore(add);
performanceScoreMapper.updateByPrimaryKey(performanceScore);
}
@Override // 实体类字段名 分数 流程ID
public void calculateScoreByModule2(String methodName, Integer score, String flowId) {
PerformanceScore performanceScore = getByFlowId(flowId);

@ -278,7 +278,7 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
profitDistribution.setRoundSubordinatedLp(subtract);
profitDistributionMapper.insert(profitDistribution);
//判断算分
if (rightOwnFunds.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
if (BigDecimal.ZERO.compareTo(userRoundOwnFunds) == 0 && rightFundraisingAmount.compareTo(userRoundPreferredLp) == 0 &&
BigDecimal.ZERO.compareTo(userRemainingOwnFunds) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsPreferredLp) == 0 &&
subtract.compareTo(userRoundSubordinatedLp) == 0 && BigDecimal.ZERO.compareTo(userRemainingEarningsSubordinatedLp) == 0) {
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);

@ -154,8 +154,6 @@ public class TopicServiceImpl implements TopicService {
return new ResultEntity<List<String>>(HttpStatus.BAD_REQUEST, "请勿重复提交!");
}
int score = 0;
int ipoListedSectorScore = 0; //上市版块得分
int ipoListedConditionScore = 0; // 上市条件得分
String module = "";
for (TopicsWithBLOBs topic : topics) {
String userAnswer = topic.getUserAnswer();
@ -190,20 +188,32 @@ public class TopicServiceImpl implements TopicService {
// 答案正确
score = score + 1; // 设置得分为1或其他适当的值
if (module.equals(Constant.IPOTJ)) {
ipoListedConditionScore = ipoListedConditionScore + 1;
performanceScoreService.ipoUpdateScore("ipoListedConditionScore", 1, flowId);
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
byFlowId.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(byFlowId);
}
if (module.equals(Constant.IPOBK)) {
ipoListedSectorScore = ipoListedConditionScore + 1;
performanceScoreService.ipoUpdateScore("ipoListedSectorScore", 1, flowId);
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
byFlowId.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(byFlowId);
}
}
} else {
if (userAnswer.equals(rightAnswer)) {
score = score + 1;
if (module.equals(Constant.IPOTJ)) {
ipoListedConditionScore = ipoListedConditionScore + 1;
performanceScoreService.ipoUpdateScore("ipoListedConditionScore", 1, flowId);
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
byFlowId.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(byFlowId);
}
if (module.equals(Constant.IPOBK)) {
ipoListedSectorScore = ipoListedSectorScore + 1;
performanceScoreService.ipoUpdateScore("ipoListedSectorScore", 1, flowId);
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
byFlowId.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(byFlowId);
}
}
}
@ -225,6 +235,7 @@ public class TopicServiceImpl implements TopicService {
topicRecord.setModule(module);
topicRecord.setTopicType(topicType);
topicRecordMapper.insert(topicRecord);
}
if (score >= 5) {
@ -244,18 +255,7 @@ public class TopicServiceImpl implements TopicService {
if (module.equals(Constant.XMGZTK)) {
performanceScoreService.calculateScoreByModule("projectValuationScore", score, flowId);
}
if (module.equals(Constant.IPOBK)) {
performanceScoreService.calculateScoreByModule("ipoListedSectorScore", ipoListedSectorScore, flowId);
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
byFlowId.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(byFlowId);
}
if (module.equals(Constant.IPOTJ)) {
performanceScoreService.calculateScoreByModule("ipoListedConditionScore", ipoListedConditionScore, flowId);
PerformanceScore byFlowId = performanceScoreService.getByFlowId(flowId);
byFlowId.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(byFlowId);
}
return new ResultEntity<>(HttpStatus.OK, "提交成功!");
}

@ -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<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
* @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); //分页
PageHelper.startPage(index,size);
List<UserDto> studentScoreDetails = userMapper.getStudentScoreDetails(schoolId, classId, studentIdOrName);
PageInfo <UserDto>pageInfo =new PageInfo(studentScoreDetails);
return pageInfo;
}
/*
* @author xcj
* @Date 2023/11/27
@ -308,11 +330,11 @@ public class ClassScoreServiceImpl implements ClassScoreService {
} else {
projectValuationAbsolute = foundProject.getProjectValuationAbsolute();//绝对估值结论得分
}
foundProjectConclusion = foundProjectConclusion.replaceAll("[^a-zA-Z0-9]", "");
serviceDueDiligence = serviceDueDiligence.replaceAll("[^a-zA-Z0-9]", "");
financialDueDiligence = financialDueDiligence.replaceAll("[^a-zA-Z0-9]", "");
projectValuationRelative = projectValuationRelative.replaceAll("[^a-zA-Z0-9]", "");
projectValuationAbsolute = projectValuationAbsolute.replaceAll("[^a-zA-Z0-9]", "");
foundProjectConclusion = foundProjectConclusion.replaceAll("[^\\u4E00-\\u9FA5]", "");
serviceDueDiligence = serviceDueDiligence.replaceAll("[^\\u4E00-\\u9FA5]", "");
financialDueDiligence = financialDueDiligence.replaceAll("[^\\u4E00-\\u9FA5]", "");
projectValuationRelative = projectValuationRelative.replaceAll("[^\\u4E00-\\u9FA5]", "");
projectValuationAbsolute = projectValuationAbsolute.replaceAll("[^\\u4E00-\\u9FA5]", "");
PerformanceScoreExample performanceScoreExample2 = new PerformanceScoreExample();
performanceScoreExample2.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowId);
@ -365,22 +387,20 @@ public class ClassScoreServiceImpl implements ClassScoreService {
}
for (String flowIdByList : list) {
TrainingReportExample trainingReportExample = new TrainingReportExample();
trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowIdByList);
trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowIdByList).andStepEqualTo("投资报告");
PerformanceScore scoreByFlowId = performanceScoreService.getByFlowId(flowIdByList);
List<TrainingReport> trainingReports = trainingReportMapper.selectByExample(trainingReportExample);
List<TrainingReport> trainingReports = trainingReportMapper.selectByExampleWithBLOBs(trainingReportExample);
if (trainingReports.isEmpty()) {
continue;
}
String experience = "";
TrainingReport trainingReport = trainingReports.get(0);
if (trainingReport.getExperience() == null) {
if (scoreByFlowId.getExperienceScore() == null && StringUtils.isBlank(trainingReport.getExperience())) {
performanceScoreService.updateScore("experienceScore", 0, flowIdByList);
trainingReport.setExperienceScore(BigDecimal.ZERO);
} else {
experience = trainingReport.getExperience();
}
//实训心得
if (scoreByFlowId.getExperienceScore() == null) {
if (scoreByFlowId.getExperienceScore() == null && StringUtils.isNotBlank(trainingReport.getExperience())) {
String experience = trainingReport.getExperience();
if (experience.length() < 100) {
performanceScoreService.updateScore("experienceScore", 1, flowIdByList);
trainingReport.setExperienceScore(BigDecimal.ONE);
@ -409,6 +429,15 @@ public class ClassScoreServiceImpl implements ClassScoreService {
return new ResultEntity<>(HttpStatus.NOT_FOUND);
}
public static void main(String[] args) {
String projectValuationAbsolute = "12312,./,/@#$好好好好好好好好好好好好好好好好AFGGGS好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好好";
projectValuationAbsolute = projectValuationAbsolute.replaceAll("[^\\u4E00-\\u9FA5]", "");
System.out.println(projectValuationAbsolute);
int length = projectValuationAbsolute.length();
System.out.println(length);
}
/*
* @author xcj
* @Date 2023/11/29

@ -390,4 +390,45 @@
login_type = #{loginType,jdbcType=INTEGER}
where userid = #{userid,jdbcType=VARCHAR}
</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>
Loading…
Cancel
Save