|
|
|
@ -3,13 +3,12 @@ package com.sztzjy.digital_credit.service.impl;/**
|
|
|
|
|
* @date 2024-05-07 9:58
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.sztzjy.digital_credit.config.security.JwtUser;
|
|
|
|
|
import com.sztzjy.digital_credit.controller.tch.StuUserDto;
|
|
|
|
|
import com.sztzjy.digital_credit.entity.StuUser;
|
|
|
|
|
import com.sztzjy.digital_credit.entity.StuUserExample;
|
|
|
|
|
import com.sztzjy.digital_credit.entity.TchModuleWeith;
|
|
|
|
|
import com.sztzjy.digital_credit.entity.TchModuleWeithExample;
|
|
|
|
|
import com.sztzjy.digital_credit.entity.*;
|
|
|
|
|
import com.sztzjy.digital_credit.entity.tchdto.ScoreOverviewParametesDTO;
|
|
|
|
|
import com.sztzjy.digital_credit.entity.tchdto.TchGeneralViewDTO;
|
|
|
|
|
import com.sztzjy.digital_credit.entity.tchdto.TchGeneralViewWeightDTO;
|
|
|
|
@ -20,15 +19,14 @@ import com.sztzjy.digital_credit.mapper.TchModuleWeithMapper;
|
|
|
|
|
import com.sztzjy.digital_credit.service.StuUserService;
|
|
|
|
|
import com.sztzjy.digital_credit.util.PageUtil;
|
|
|
|
|
import com.sztzjy.digital_credit.util.ResultEntity;
|
|
|
|
|
import com.sztzjy.digital_credit.util.TzApi;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.Comparator;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
public class StuUserServiceImpl implements StuUserService {
|
|
|
|
@ -275,15 +273,15 @@ public class StuUserServiceImpl implements StuUserService {
|
|
|
|
|
List<StuUser> stuUsers = userMapper.selectByExample(example);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return stuUsers;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 手动评分
|
|
|
|
|
* @param manualRatingByTeacherDTO
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
* 手动评分
|
|
|
|
|
*
|
|
|
|
|
* @param manualRatingByTeacherDTO
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void manualRatingByTeacher(TchManualRatingByTeacherDTO manualRatingByTeacherDTO) {
|
|
|
|
@ -292,14 +290,14 @@ public class StuUserServiceImpl implements StuUserService {
|
|
|
|
|
StuUser stuUser = userMapper.selectByPrimaryKey(manualRatingByTeacherDTO.getUserId());
|
|
|
|
|
|
|
|
|
|
//将老师评分手动写入对应分数
|
|
|
|
|
if ("个人征信案例主观成绩".equals(manualRatingByTeacherDTO.getModule())){
|
|
|
|
|
if ("个人征信案例主观成绩".equals(manualRatingByTeacherDTO.getModule())) {
|
|
|
|
|
|
|
|
|
|
stuUser.setCasePersonalCreditSubScore(manualRatingByTeacherDTO.getScore());
|
|
|
|
|
|
|
|
|
|
stuUser.setCasePersonalCreditScore(manualRatingByTeacherDTO.getScore().add(stuUser.getCasePersonalCreditObjScore()));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ("企业征信案例主观成绩".equals(manualRatingByTeacherDTO.getModule())){
|
|
|
|
|
if ("企业征信案例主观成绩".equals(manualRatingByTeacherDTO.getModule())) {
|
|
|
|
|
|
|
|
|
|
stuUser.setCaseCorporateCreditSubScore(manualRatingByTeacherDTO.getScore());
|
|
|
|
|
|
|
|
|
@ -317,7 +315,7 @@ public class StuUserServiceImpl implements StuUserService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo<StuUserDto> getScoreReport(String schoolId, Integer index, Integer size, String module, String name, String studentId, String className, String keyWord) {
|
|
|
|
|
List<StuUserDto>userDtoList= stuUserDtoMapper.selectByCondition(name,studentId,className,module,keyWord,schoolId);
|
|
|
|
|
List<StuUserDto> userDtoList = stuUserDtoMapper.selectByCondition(name, studentId, className, module, keyWord, schoolId);
|
|
|
|
|
PageInfo<StuUserDto> pageInfo = PageUtil.pageHelper(userDtoList, index, size);
|
|
|
|
|
return pageInfo;
|
|
|
|
|
}
|
|
|
|
@ -325,8 +323,157 @@ public class StuUserServiceImpl implements StuUserService {
|
|
|
|
|
//班级下拉框
|
|
|
|
|
@Override
|
|
|
|
|
public List<String> getClassNameBySchoolId(String schoolId) {
|
|
|
|
|
return userMapper.getClassNameBySchoolId(schoolId);
|
|
|
|
|
return userMapper.getClassNameBySchoolId(schoolId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void insertAll(JwtUser user) {
|
|
|
|
|
List<Map<String, Object>> classList = TzApi.GetClassBySchoolIdForForeignExchangeTrading(user);
|
|
|
|
|
if (classList == null || classList.size() == 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
List<StuUser> users = new ArrayList<>();
|
|
|
|
|
Set<String> userIds = new HashSet<>();
|
|
|
|
|
String schoolId = String.valueOf(user.getSchoolId());
|
|
|
|
|
for (Map<String, Object> classes : classList) {
|
|
|
|
|
String classId = classes.get("id").toString();
|
|
|
|
|
List<Map<String, Object>> studentList = TzApi.GetStudentInfoByClassIdForForeignExchangeTrading(classId, user);
|
|
|
|
|
if (studentList == null || studentList.size() == 0) continue;
|
|
|
|
|
for (Map<String, Object> student : studentList) {
|
|
|
|
|
StuUser stuUser = new StuUser();
|
|
|
|
|
stuUser.setUserId(student.get("userId").toString());
|
|
|
|
|
if (student.get("userId").toString().equals("null") || student.get("userId").toString().equals("8184") || student.get("userId").toString().equals("8238") || student.get("userId").toString().equals("8258") || student.get("userId").toString().equals("8259") || student.get("userId").toString().equals("8260") || student.get("userId").toString().equals("8270")) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!userIds.add(stuUser.getUserId())) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
stuUser.setStudentId(student.get("studentId").toString());
|
|
|
|
|
stuUser.setStudentId(student.get("studentNo").toString());
|
|
|
|
|
stuUser.setSchoolName(student.get("schoolName").toString());
|
|
|
|
|
// stuUser.setMajor(student.get("majorName").toString());
|
|
|
|
|
stuUser.setName(student.get("name").toString());
|
|
|
|
|
stuUser.setClassId(classId);
|
|
|
|
|
stuUser.setClassName(classes.get("name").toString());
|
|
|
|
|
stuUser.setSchoolId(schoolId);
|
|
|
|
|
stuUser.setPassword("123qwe");
|
|
|
|
|
stuUser.setLoanCasesScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setPerSituationScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setRepaymentBehaviorScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setPerInfluenceFactorScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setPerCreditOptimizationSocre(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setPerCreditRatingSocre(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setEntInfluenceFactorSocre(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setEntCreditOptimizationSocre(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setEntCreditRatingSocre(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCaseUserProfileSocre(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCasePersonalCreditScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCaseCorporateCreditScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCaseCorporateCreditSubScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCaseCorporateCreditObjScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCasePersonalCreditSubScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCasePersonalCreditObjScore(BigDecimal.valueOf(0));
|
|
|
|
|
|
|
|
|
|
stuUser.setCreditPortraitScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setPersonalCreditScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCorporateCreditScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setComprehensiveCaseScore(BigDecimal.valueOf(0));
|
|
|
|
|
|
|
|
|
|
stuUser.setTotalScore(BigDecimal.valueOf(0));
|
|
|
|
|
users.add(stuUser);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
userMapper.batchInsertStudents(users);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//根据学校id 查询成绩总览权重表中是否有数据 有则不进行操作 没有则新增权重
|
|
|
|
|
TchModuleWeithExample resultsExample = new TchModuleWeithExample();
|
|
|
|
|
resultsExample.createCriteria().andSchoolIdEqualTo(schoolId);
|
|
|
|
|
List<TchModuleWeith> resultsWeights = tchModuleWeithMapper.selectByExample(resultsExample);
|
|
|
|
|
if (resultsWeights.isEmpty()) {
|
|
|
|
|
TchModuleWeith tchModuleWeith = new TchModuleWeith(schoolId);
|
|
|
|
|
|
|
|
|
|
tchModuleWeithMapper.insertSelective(tchModuleWeith);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* 开放接口,自动同步学生信息
|
|
|
|
|
*
|
|
|
|
|
* @param studentList
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void insertAllByAuto(List<ZYUserInfo> studentList) {
|
|
|
|
|
|
|
|
|
|
if (studentList.isEmpty()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
List<StuUser> users = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (ZYUserInfo student : studentList) {
|
|
|
|
|
StuUser stuUser = new StuUser();
|
|
|
|
|
//基本信息
|
|
|
|
|
stuUser.setUserId(student.getUserId().toString());
|
|
|
|
|
if (student.getUserId().equals("null") || student.getUserId().equals("8184")
|
|
|
|
|
|| student.getUserId().equals("8238")
|
|
|
|
|
|| student.getUserId().equals("8258") || student.getUserId().equals("8259")
|
|
|
|
|
|| student.getUserId().equals("8260") || student.getUserId().equals("8270")) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
stuUser.setName(student.getUsername());
|
|
|
|
|
stuUser.setPassword(student.getPassword());
|
|
|
|
|
stuUser.setRoleId(student.getRoleId());
|
|
|
|
|
stuUser.setSchoolId(student.getSchoolId().toString());
|
|
|
|
|
stuUser.setSchoolName(student.getSchoolName());
|
|
|
|
|
stuUser.setClassId(student.getClassId().toString());
|
|
|
|
|
stuUser.setClassName(student.getClassName());
|
|
|
|
|
|
|
|
|
|
stuUser.setLoanCasesScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setPerSituationScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setRepaymentBehaviorScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setPerInfluenceFactorScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setPerCreditOptimizationSocre(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setPerCreditRatingSocre(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setEntInfluenceFactorSocre(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setEntCreditOptimizationSocre(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setEntCreditRatingSocre(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCaseUserProfileSocre(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCasePersonalCreditScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCaseCorporateCreditScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCaseCorporateCreditSubScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCaseCorporateCreditObjScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCasePersonalCreditSubScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCasePersonalCreditObjScore(BigDecimal.valueOf(0));
|
|
|
|
|
|
|
|
|
|
stuUser.setCreditPortraitScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setPersonalCreditScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setCorporateCreditScore(BigDecimal.valueOf(0));
|
|
|
|
|
stuUser.setComprehensiveCaseScore(BigDecimal.valueOf(0));
|
|
|
|
|
|
|
|
|
|
stuUser.setTotalScore(BigDecimal.valueOf(0));
|
|
|
|
|
|
|
|
|
|
users.add(stuUser);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
userMapper.batchInsertStudents(users);
|
|
|
|
|
//根据学校id 查询成绩总览权重表中是否有数据 有则不进行操作 没有则新增权重
|
|
|
|
|
TchModuleWeithExample resultsExample = new TchModuleWeithExample();
|
|
|
|
|
resultsExample.createCriteria().andSchoolIdEqualTo(users.get(0).getSchoolId());
|
|
|
|
|
List<TchModuleWeith> resultsWeights = tchModuleWeithMapper.selectByExample(resultsExample);
|
|
|
|
|
if (resultsWeights.isEmpty()) {
|
|
|
|
|
TchModuleWeith tchModuleWeith = new TchModuleWeith(users.get(0).getSchoolId());
|
|
|
|
|
|
|
|
|
|
tchModuleWeithMapper.insertSelective(tchModuleWeith);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|