# Conflicts:
#	src/main/java/com/sztzjy/digital_credit/controller/tch/TchConceptTechnologyAchievement.java
#	src/main/java/com/sztzjy/digital_credit/service/impl/StuEnterPriseByInfoEntryServiceImpl.java
master
@t2652009480 9 months ago
commit ae31443617

@ -57,10 +57,9 @@ public class StuConceptBlockController {
@ApiOperation("区块链学习资源查看") @ApiOperation("区块链学习资源查看")
@PostMapping("/getBlockResources") @GetMapping("/getBlockResources")
@AnonymousAccess @AnonymousAccess
public ResultDataEntity<StuResources> getBlockResources(@RequestBody JSONObject jsonObject) { public ResultDataEntity<StuResources> getBlockResources(String module) {
String module = jsonObject.getString("module");
if (module.isEmpty()) { if (module.isEmpty()) {
return new ResultDataEntity(HttpStatus.NO_CONTENT, "参数为空"); return new ResultDataEntity(HttpStatus.NO_CONTENT, "参数为空");
} }

@ -96,16 +96,16 @@ public class StuEnterPriseByInfoEntryController {
@PostMapping("/importFinancialStatements") // @PostMapping("/importFinancialStatements")
@ApiOperation("批量导入财务报表") // @ApiOperation("批量导入财务报表")
@AnonymousAccess // @AnonymousAccess
public ResultEntity importFinancialStatements(@RequestParam(required = false) @RequestPart MultipartFile file, // public ResultEntity importFinancialStatements(@RequestParam(required = false) @RequestPart MultipartFile file,
@ApiParam("资产负债表/现金流量表/利润表") @RequestParam(required = false) String module) { // @ApiParam("资产负债表/现金流量表/利润表") @RequestParam(required = false) String module) {
//
//
return infoEntryService.importFinancialStatements(file,module); // return infoEntryService.importFinancialStatements(file,module);
//
} // }
@ApiOperation("查询财务报表") @ApiOperation("查询财务报表")

@ -62,14 +62,14 @@ public interface StuEnterPriseByInfoEntryService {
ResultEntity subCreditRecordsBaseInfo(StuCreditRecords creditRecords); ResultEntity subCreditRecordsBaseInfo(StuCreditRecords creditRecords);
/** // /**
* // * 批量导入财务报表
* @param file // * @param file
* @param module // * @param module
* @return // * @return
*/ // */
//
ResultEntity importFinancialStatements(MultipartFile file, String module); // ResultEntity importFinancialStatements(MultipartFile file, String module);

@ -7,25 +7,34 @@ 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.util.MyExcelListenerImport; import com.sztzjy.digital_credit.service.StuRateService;
import com.sztzjy.digital_credit.util.ConvertUtil;
import com.sztzjy.digital_credit.util.ResultEntity; import com.sztzjy.digital_credit.util.ResultEntity;
import com.sztzjy.digital_credit.util.excel.MyExcelListener ; 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;
@ -37,10 +46,6 @@ 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;
@ -63,15 +68,14 @@ 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
@ -191,7 +195,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());
@ -204,7 +208,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());
} }
@ -245,7 +249,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.getUserId()); creditRecordsExample.createCriteria().andUserIdEqualTo(creditRecords.getId());
List<StuCreditRecords> stuCreditRecordsList = creditRecordsMapper.selectByExample(creditRecordsExample); List<StuCreditRecords> stuCreditRecordsList = creditRecordsMapper.selectByExample(creditRecordsExample);
if (!stuCreditRecordsList.isEmpty()){ if (!stuCreditRecordsList.isEmpty()){
@ -309,7 +313,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()));
@ -324,7 +328,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());
@ -339,20 +343,20 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
* @return * @return
*/ */
@Override // @Override
public ResultEntity importFinancialStatements(MultipartFile file, String module) { // public ResultEntity importFinancialStatements(MultipartFile file, String module) {
//
//
try { // try {
//获取文件的输入流 // //获取文件的输入流
EasyExcel.read(file.getInputStream(), StuFinancialStatements.class, new MyExcelListenerImport(financialStatementsMapper,module)).sheet().doRead(); // EasyExcel.read(file.getInputStream(), StuFinancialStatements.class, new MyExcelListener(financialStatementsMapper,module)).sheet().doRead();
//
return new ResultEntity(HttpStatus.OK,"导入成功!"); // return new ResultEntity(HttpStatus.OK,"导入成功!");
//
}catch (IOException exception){ // }catch (IOException exception){
return new ResultEntity(HttpStatus.BAD_REQUEST,"导入失败!"); // return new ResultEntity(HttpStatus.BAD_REQUEST,"导入失败!");
} // }
} // }
/** /**
* *
@ -488,7 +492,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());
@ -502,7 +506,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());
} }
@ -578,7 +582,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 {
@ -589,7 +593,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());
} }
@ -663,7 +667,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());
@ -676,7 +680,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());
} }
@ -756,7 +760,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()));
@ -770,7 +774,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());
} }
} }
@ -846,7 +850,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());
@ -859,7 +863,7 @@ 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());
} }
} }
@ -958,6 +962,9 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
public ResultEntity getFinancialDuPontAnalysisSelect(String userId) { public ResultEntity getFinancialDuPontAnalysisSelect(String userId) {
StuDuPontAnalysisExample duPontAnalysisExample = new StuDuPontAnalysisExample(); StuDuPontAnalysisExample duPontAnalysisExample = new StuDuPontAnalysisExample();
duPontAnalysisExample.createCriteria().andUserIdEqualTo(userId); duPontAnalysisExample.createCriteria().andUserIdEqualTo(userId);
List<StuDuPontAnalysis> duPontAnalysisList = duPontAnalysisMapper.selectByExample(duPontAnalysisExample); List<StuDuPontAnalysis> duPontAnalysisList = duPontAnalysisMapper.selectByExample(duPontAnalysisExample);
if (duPontAnalysisList.isEmpty()) if (duPontAnalysisList.isEmpty())
{ {

Loading…
Cancel
Save