数字征信--增加大模块

master
@t2652009480 9 months ago
parent 75f10496c9
commit cdb0375504

@ -74,16 +74,16 @@ public class TchConceptTechnologyAchievement {
@GetMapping("/getGradeDetails") @GetMapping("/getGradeDetails")
@AnonymousAccess @AnonymousAccess
@ApiOperation("成绩详情") @ApiOperation("成绩详情")
public ResultEntity getGradeDetails(@RequestParam String userId, @RequestParam String module, @RequestParam String schoolId) { public ResultEntity getGradeDetails(@RequestParam String userId, @RequestParam String module, @RequestParam String schoolId,@RequestParam String ascription) {
StuScoreDetailsExample example = new StuScoreDetailsExample(); StuScoreDetailsExample example = new StuScoreDetailsExample();
example.createCriteria().andUserIdEqualTo(userId).andModuleEqualTo(module); example.createCriteria().andUserIdEqualTo(userId).andModuleEqualTo(module).andAscriptionEqualTo(ascription);
List<StuScoreDetails> stuScoreDetails = stuScoreDetailsMapper.selectByExample(example); List<StuScoreDetails> stuScoreDetails = stuScoreDetailsMapper.selectByExample(example);
TchPublicResourceWeightExample weightExample = new TchPublicResourceWeightExample(); TchPublicResourceWeightExample weightExample = new TchPublicResourceWeightExample();
weightExample.createCriteria().andSchoolIdEqualTo(schoolId).andModuleEqualTo(module); weightExample.createCriteria().andSchoolIdEqualTo(schoolId).andModuleEqualTo(module).andAscriptionEqualTo(ascription);
List<TchPublicResourceWeight> tchPublicResourceWeightList = tchPublicResourceWeightMapper.selectByExample(weightExample); List<TchPublicResourceWeight> tchPublicResourceWeightList = tchPublicResourceWeightMapper.selectByExample(weightExample);
if (tchPublicResourceWeightList.isEmpty()){ if (tchPublicResourceWeightList.isEmpty()){
TchPublicResourceWeight tchPublicResourceWeight = new TchPublicResourceWeight(schoolId, module); TchPublicResourceWeight tchPublicResourceWeight = new TchPublicResourceWeight(schoolId, module,ascription);
tchPublicResourceWeightMapper.insertSelective(tchPublicResourceWeight); tchPublicResourceWeightMapper.insertSelective(tchPublicResourceWeight);
tchPublicResourceWeightList.add(tchPublicResourceWeight); tchPublicResourceWeightList.add(tchPublicResourceWeight);
} }

@ -7,33 +7,25 @@ package com.sztzjy.digital_credit.service.impl;
import cn.hutool.core.convert.Convert; import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.sztzjy.digital_credit.config.Constant; import com.sztzjy.digital_credit.config.Constant;
import com.sztzjy.digital_credit.entity.*; import com.sztzjy.digital_credit.entity.*;
import com.sztzjy.digital_credit.entity.dto.StuFinancialIndexDTO; import com.sztzjy.digital_credit.entity.dto.StuFinancialIndexDTO;
import com.sztzjy.digital_credit.mapper.*; import com.sztzjy.digital_credit.mapper.*;
import com.sztzjy.digital_credit.service.PublicMethodsService;
import com.sztzjy.digital_credit.service.StuEnterPriseByInfoEntryService; import com.sztzjy.digital_credit.service.StuEnterPriseByInfoEntryService;
import com.sztzjy.digital_credit.service.StuPersonalCreditService; import com.sztzjy.digital_credit.service.StuPersonalCreditService;
import com.sztzjy.digital_credit.service.StuRateService; import com.sztzjy.digital_credit.util.MyExcelListenerImport;
import com.sztzjy.digital_credit.util.ConvertUtil;
import com.sztzjy.digital_credit.util.MyExcelListener;
import com.sztzjy.digital_credit.util.ResultEntity; import com.sztzjy.digital_credit.util.ResultEntity;
import com.sztzjy.digital_credit.util.excel.MyExcelListener ;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.annotation.Id;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Date; import java.util.Date;
@ -45,6 +37,10 @@ import java.util.List;
public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoEntryService { public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoEntryService {
@Resource
private StuPersonalCreditService stuPersonalCreditService;
@Autowired @Autowired
private StuBaseInfoMapper stuBaseInfoMapper; private StuBaseInfoMapper stuBaseInfoMapper;
@ -67,14 +63,15 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
@Autowired @Autowired
private StuOperatingCapacityMapper operatingCapacityMapper; private StuOperatingCapacityMapper operatingCapacityMapper;
@Autowired
private StuPersonalCreditService stuPersonalCreditService;
@Autowired @Autowired
private StuSolvencyMapper solvencyMapper; private StuSolvencyMapper solvencyMapper;
/** /**
* *
* @param userId * @param userId
@ -194,7 +191,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
stuBaseInfoMapper.updateByPrimaryKeySelective(stuBaseInfo); stuBaseInfoMapper.updateByPrimaryKeySelective(stuBaseInfo);
//计算分数写入用户表 //计算分数写入用户表
stuPersonalCreditService.scoreEntry(stuBaseInfo.getUserId(),"基本信息", BigDecimal.valueOf(24-stuBaseInfo.getErrorNumber())); stuPersonalCreditService.scoreEntry(stuBaseInfo.getUserId(),"企业征信", BigDecimal.valueOf(24-stuBaseInfo.getErrorNumber()));
return new ResultEntity<>(HttpStatus.OK,"保存成功!",stuBaseInfo.getErrorNumber()); return new ResultEntity<>(HttpStatus.OK,"保存成功!",stuBaseInfo.getErrorNumber());
@ -207,7 +204,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
//插入数据库 //插入数据库
stuBaseInfoMapper.insertSelective(stuBaseInfo); stuBaseInfoMapper.insertSelective(stuBaseInfo);
stuPersonalCreditService.scoreEntry(stuBaseInfo.getUserId(),"基本信息", BigDecimal.valueOf(24-stuBaseInfo.getErrorNumber())); stuPersonalCreditService.scoreEntry(stuBaseInfo.getUserId(),"企业征信", BigDecimal.valueOf(24-stuBaseInfo.getErrorNumber()));
return new ResultEntity<>(HttpStatus.OK,"保存成功!",stuBaseInfo.getErrorNumber()); return new ResultEntity<>(HttpStatus.OK,"保存成功!",stuBaseInfo.getErrorNumber());
} }
@ -248,7 +245,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
public ResultEntity saveCreditRecordsInfoByAuto(StuCreditRecords creditRecords) { public ResultEntity saveCreditRecordsInfoByAuto(StuCreditRecords creditRecords) {
//查询有无数据,有数据就更新,没有数据就保存 //查询有无数据,有数据就更新,没有数据就保存
StuCreditRecordsExample creditRecordsExample = new StuCreditRecordsExample(); StuCreditRecordsExample creditRecordsExample = new StuCreditRecordsExample();
creditRecordsExample.createCriteria().andUserIdEqualTo(creditRecords.getId()); creditRecordsExample.createCriteria().andUserIdEqualTo(creditRecords.getUserId());
List<StuCreditRecords> stuCreditRecordsList = creditRecordsMapper.selectByExample(creditRecordsExample); List<StuCreditRecords> stuCreditRecordsList = creditRecordsMapper.selectByExample(creditRecordsExample);
if (!stuCreditRecordsList.isEmpty()){ if (!stuCreditRecordsList.isEmpty()){
@ -312,7 +309,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
creditRecordsMapper.updateByPrimaryKeySelective(creditRecords); creditRecordsMapper.updateByPrimaryKeySelective(creditRecords);
//计算分数写入用户表 //计算分数写入用户表
stuPersonalCreditService.scoreEntry(creditRecords.getUserId(),"贷记录", BigDecimal.valueOf(16-creditRecords.getErrorNumber())); stuPersonalCreditService.scoreEntry(creditRecords.getUserId(),"企业征信", BigDecimal.valueOf(16-creditRecords.getErrorNumber()));
@ -327,7 +324,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
creditRecords.setCreateTime(new Date()); creditRecords.setCreateTime(new Date());
creditRecordsMapper.insertSelective(creditRecords); creditRecordsMapper.insertSelective(creditRecords);
//计算分数写入用户表 //计算分数写入用户表
stuPersonalCreditService.scoreEntry(creditRecords.getUserId(),"贷记录", BigDecimal.valueOf(16-creditRecords.getErrorNumber())); stuPersonalCreditService.scoreEntry(creditRecords.getUserId(),"企业征信", BigDecimal.valueOf(16-creditRecords.getErrorNumber()));
return new ResultEntity<>(HttpStatus.OK,"保存成功!",creditRecords.getErrorNumber()); return new ResultEntity<>(HttpStatus.OK,"保存成功!",creditRecords.getErrorNumber());
@ -348,7 +345,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
try { try {
//获取文件的输入流 //获取文件的输入流
EasyExcel.read(file.getInputStream(), StuFinancialStatements.class, new MyExcelListener(financialStatementsMapper,module)).sheet().doRead(); EasyExcel.read(file.getInputStream(), StuFinancialStatements.class, new MyExcelListenerImport(financialStatementsMapper,module)).sheet().doRead();
return new ResultEntity(HttpStatus.OK,"导入成功!"); return new ResultEntity(HttpStatus.OK,"导入成功!");
@ -491,7 +488,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
profitAbilityMapper.updateByPrimaryKeySelective(profitAbility); profitAbilityMapper.updateByPrimaryKeySelective(profitAbility);
//计算分数写入用户表 //计算分数写入用户表
stuPersonalCreditService.scoreEntry(profitAbility.getUserId(),"盈利能力", BigDecimal.valueOf(7-profitAbility.getErrorNumber())); stuPersonalCreditService.scoreEntry(profitAbility.getUserId(),"企业征信", BigDecimal.valueOf(7-profitAbility.getErrorNumber()));
return new ResultEntity<>(HttpStatus.OK,"保存成功!",profitAbility.getErrorNumber()); return new ResultEntity<>(HttpStatus.OK,"保存成功!",profitAbility.getErrorNumber());
@ -505,7 +502,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
//插入数据库 //插入数据库
profitAbilityMapper.insertSelective(profitAbility); profitAbilityMapper.insertSelective(profitAbility);
//计算分数写入用户表 //计算分数写入用户表
stuPersonalCreditService.scoreEntry(profitAbility.getUserId(),"盈利能力", BigDecimal.valueOf(7-profitAbility.getErrorNumber())); stuPersonalCreditService.scoreEntry(profitAbility.getUserId(),"企业征信", BigDecimal.valueOf(7-profitAbility.getErrorNumber()));
return new ResultEntity<>(HttpStatus.OK,"保存成功!",profitAbility.getErrorNumber()); return new ResultEntity<>(HttpStatus.OK,"保存成功!",profitAbility.getErrorNumber());
} }
@ -581,7 +578,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
//计算分数写入用户表 //计算分数写入用户表
stuPersonalCreditService.scoreEntry(solvency.getUserId(),"偿债能力", BigDecimal.valueOf(7-solvency.getErrorNumber())); stuPersonalCreditService.scoreEntry(solvency.getUserId(),"企业征信", BigDecimal.valueOf(7-solvency.getErrorNumber()));
return new ResultEntity<>(HttpStatus.OK,"保存成功!",solvency.getErrorNumber()); return new ResultEntity<>(HttpStatus.OK,"保存成功!",solvency.getErrorNumber());
}else { }else {
@ -592,7 +589,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
solvencyMapper.insertSelective(solvency); solvencyMapper.insertSelective(solvency);
//计算分数写入用户表 //计算分数写入用户表
stuPersonalCreditService.scoreEntry(solvency.getUserId(),"偿债能力", BigDecimal.valueOf(7-solvency.getErrorNumber())); stuPersonalCreditService.scoreEntry(solvency.getUserId(),"企业征信", BigDecimal.valueOf(7-solvency.getErrorNumber()));
return new ResultEntity<>(HttpStatus.OK,"保存成功!",solvency.getErrorNumber()); return new ResultEntity<>(HttpStatus.OK,"保存成功!",solvency.getErrorNumber());
} }
@ -666,7 +663,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
operatingCapacity.setId(operatingCapacityList.get(0).getId()); operatingCapacity.setId(operatingCapacityList.get(0).getId());
operatingCapacityMapper.updateByPrimaryKeySelective(operatingCapacity); operatingCapacityMapper.updateByPrimaryKeySelective(operatingCapacity);
//计算分数写入用户表 //计算分数写入用户表
stuPersonalCreditService.scoreEntry(operatingCapacity.getUserId(),"营运能力", BigDecimal.valueOf(8-operatingCapacity.getErrorNumber())); stuPersonalCreditService.scoreEntry(operatingCapacity.getUserId(),"企业征信", BigDecimal.valueOf(8-operatingCapacity.getErrorNumber()));
return new ResultEntity<>(HttpStatus.OK,"保存成功!",operatingCapacity.getErrorNumber()); return new ResultEntity<>(HttpStatus.OK,"保存成功!",operatingCapacity.getErrorNumber());
@ -679,7 +676,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
//插入数据库 //插入数据库
operatingCapacityMapper.insertSelective(operatingCapacity); operatingCapacityMapper.insertSelective(operatingCapacity);
//计算分数写入用户表 //计算分数写入用户表
stuPersonalCreditService.scoreEntry(operatingCapacity.getUserId(),"营运能力", BigDecimal.valueOf(8-operatingCapacity.getErrorNumber())); stuPersonalCreditService.scoreEntry(operatingCapacity.getUserId(),"企业征信", BigDecimal.valueOf(8-operatingCapacity.getErrorNumber()));
return new ResultEntity<>(HttpStatus.OK,"保存成功!",operatingCapacity.getErrorNumber()); return new ResultEntity<>(HttpStatus.OK,"保存成功!",operatingCapacity.getErrorNumber());
} }
@ -759,7 +756,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
growthAbilityMapper.updateByPrimaryKeySelective(growthAbility); growthAbilityMapper.updateByPrimaryKeySelective(growthAbility);
//计算分数写入用户表 //计算分数写入用户表
stuPersonalCreditService.scoreEntry(growthAbility.getUserId(),"成长能力", BigDecimal.valueOf(1-growthAbility.getErrorNumber())); stuPersonalCreditService.scoreEntry(growthAbility.getUserId(),"企业征信", BigDecimal.valueOf(1-growthAbility.getErrorNumber()));
@ -773,7 +770,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
//插入数据库 //插入数据库
growthAbilityMapper.insertSelective(growthAbility); growthAbilityMapper.insertSelective(growthAbility);
//计算分数写入用户表 //计算分数写入用户表
stuPersonalCreditService.scoreEntry(growthAbility.getUserId(),"成长能力", BigDecimal.valueOf(1-growthAbility.getErrorNumber())); stuPersonalCreditService.scoreEntry(growthAbility.getUserId(),"企业征信", BigDecimal.valueOf(1-growthAbility.getErrorNumber()));
return new ResultEntity<>(HttpStatus.OK,"保存成功!",growthAbility.getErrorNumber()); return new ResultEntity<>(HttpStatus.OK,"保存成功!",growthAbility.getErrorNumber());
} }
} }
@ -849,7 +846,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
duPontAnalysisMapper.updateByPrimaryKeySelective(duPontAnalysis); duPontAnalysisMapper.updateByPrimaryKeySelective(duPontAnalysis);
//计算分数写入用户表 //计算分数写入用户表
stuPersonalCreditService.scoreEntry(duPontAnalysis.getUserId(),"杜邦分析", BigDecimal.valueOf(4-duPontAnalysis.getErrorNumber())); stuPersonalCreditService.scoreEntry(duPontAnalysis.getUserId(),"企业征信", BigDecimal.valueOf(4-duPontAnalysis.getErrorNumber()));
return new ResultEntity<>(HttpStatus.OK,"保存成功!",duPontAnalysis.getErrorNumber()); return new ResultEntity<>(HttpStatus.OK,"保存成功!",duPontAnalysis.getErrorNumber());
@ -862,11 +859,116 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
//插入数据库 //插入数据库
duPontAnalysisMapper.insertSelective(duPontAnalysis); duPontAnalysisMapper.insertSelective(duPontAnalysis);
//计算分数写入用户表 //计算分数写入用户表
stuPersonalCreditService.scoreEntry(duPontAnalysis.getUserId(),"杜邦分析", BigDecimal.valueOf(4-duPontAnalysis.getErrorNumber())); stuPersonalCreditService.scoreEntry(duPontAnalysis.getUserId(),"企业征信", BigDecimal.valueOf(4-duPontAnalysis.getErrorNumber()));
return new ResultEntity<>(HttpStatus.OK,"保存成功!",duPontAnalysis.getErrorNumber()); return new ResultEntity<>(HttpStatus.OK,"保存成功!",duPontAnalysis.getErrorNumber());
} }
} }
/**
*
* @param userId
* @return
*/
@Override
public ResultEntity getFinancialProfitAbilitySelect(String userId) {
StuProfitAbilityExample profitAbilityExample = new StuProfitAbilityExample();
profitAbilityExample.createCriteria().andUserIdEqualTo(userId);
List<StuProfitAbility> profitAbilityList = profitAbilityMapper.selectByExample(profitAbilityExample);
if (profitAbilityList.isEmpty())
{
return new ResultEntity<>(HttpStatus.OK);
}else {
return new ResultEntity<>(HttpStatus.OK,profitAbilityList.get(0));
}
}
/**
*
* @param userId
* @return
*/
@Override
public ResultEntity getFinancialSolvencySelect(String userId) {
StuSolvencyExample solvencyExample = new StuSolvencyExample();
solvencyExample.createCriteria().andUserIdEqualTo(userId);
List<StuSolvency> stuSolvencyList = solvencyMapper.selectByExample(solvencyExample);
if (stuSolvencyList.isEmpty())
{
return new ResultEntity<>(HttpStatus.OK);
}else {
return new ResultEntity<>(HttpStatus.OK,stuSolvencyList.get(0));
}
}
/**
*
* @param userId
* @return
*/
@Override
public ResultEntity getFinancialOperatingCapacitySelect(String userId) {
//查询有无数据,有数据就更新,没有数据就保存
StuOperatingCapacityExample operatingCapacityExample = new StuOperatingCapacityExample();
operatingCapacityExample.createCriteria().andUserIdEqualTo(userId);
List<StuOperatingCapacity> operatingCapacityList = operatingCapacityMapper.selectByExample(operatingCapacityExample);
if (operatingCapacityList.isEmpty())
{
return new ResultEntity<>(HttpStatus.OK);
}else {
return new ResultEntity<>(HttpStatus.OK,operatingCapacityList.get(0));
}
}
/**
*
* @param userId
* @return
*/
@Override
public ResultEntity getFinancialGrowthAbilitySelect(String userId) {
StuGrowthAbilityExample growthAbilityExample = new StuGrowthAbilityExample();
growthAbilityExample.createCriteria().andUserIdEqualTo(userId);
List<StuGrowthAbility> growthAbilityList = growthAbilityMapper.selectByExample(growthAbilityExample);
if (growthAbilityList.isEmpty())
{
return new ResultEntity<>(HttpStatus.OK);
}else {
return new ResultEntity<>(HttpStatus.OK,growthAbilityList.get(0));
}
}
/**
*
* @param userId
* @return
*/
@Override
public ResultEntity getFinancialDuPontAnalysisSelect(String userId) {
StuDuPontAnalysisExample duPontAnalysisExample = new StuDuPontAnalysisExample();
duPontAnalysisExample.createCriteria().andUserIdEqualTo(userId);
List<StuDuPontAnalysis> duPontAnalysisList = duPontAnalysisMapper.selectByExample(duPontAnalysisExample);
if (duPontAnalysisList.isEmpty())
{
return new ResultEntity<>(HttpStatus.OK);
}else {
return new ResultEntity<>(HttpStatus.OK,duPontAnalysisList.get(0));
}
}
//财务指标杜邦分析提交算分 //财务指标杜邦分析提交算分
private StuDuPontAnalysis financialDuPontAnalysisCheck(StuDuPontAnalysis duPontAnalysis) { private StuDuPontAnalysis financialDuPontAnalysisCheck(StuDuPontAnalysis duPontAnalysis) {
int sum = 0; int sum = 0;

Loading…
Cancel
Save