|
|
|
@ -10,15 +10,14 @@ 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.PageInfo;
|
|
|
|
|
import com.sztzjy.digital_credit.config.Constant;
|
|
|
|
|
import com.sztzjy.digital_credit.entity.*;
|
|
|
|
|
import com.sztzjy.digital_credit.entity.dto.StuFinancialIndexDTO;
|
|
|
|
|
import com.sztzjy.digital_credit.mapper.StuBaseInfoMapper;
|
|
|
|
|
import com.sztzjy.digital_credit.mapper.StuCreditRecordsMapper;
|
|
|
|
|
import com.sztzjy.digital_credit.mapper.StuDuPontAnalysisMapper;
|
|
|
|
|
import com.sztzjy.digital_credit.mapper.StuFinancialStatementsMapper;
|
|
|
|
|
import com.sztzjy.digital_credit.mapper.*;
|
|
|
|
|
import com.sztzjy.digital_credit.service.StuEnterPriseByInfoEntryService;
|
|
|
|
|
import com.sztzjy.digital_credit.util.ConvertUtil;
|
|
|
|
|
import com.sztzjy.digital_credit.util.MyExcelListener;
|
|
|
|
@ -53,6 +52,20 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
|
|
|
|
|
@Autowired
|
|
|
|
|
private StuDuPontAnalysisMapper duPontAnalysisMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private StuProfitAbilityMapper profitAbilityMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private StuGrowthAbilityMapper growthAbilityMapper;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private StuOperatingCapacityMapper operatingCapacityMapper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private StuSolvencyMapper solvencyMapper;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 基本信息查询
|
|
|
|
|
* @param userId
|
|
|
|
@ -266,7 +279,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
StuCreditRecordsExample creditRecordsExample = new StuCreditRecordsExample();
|
|
|
|
|
creditRecordsExample.createCriteria().andUserIdEqualTo(creditRecords.getId());
|
|
|
|
|
creditRecordsExample.createCriteria().andUserIdEqualTo(creditRecords.getUserId());
|
|
|
|
|
|
|
|
|
|
List<StuCreditRecords> stuCreditRecordsList = creditRecordsMapper.selectByExample(creditRecordsExample);
|
|
|
|
|
if (!stuCreditRecordsList.isEmpty()){
|
|
|
|
@ -367,8 +380,609 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,financialIndexDTO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 财务指标盈利能力
|
|
|
|
|
* @param profitAbility
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultEntity getFinancialProfitAbilityByAuto(StuProfitAbility profitAbility) {
|
|
|
|
|
|
|
|
|
|
//传过来用户未提交数据,根据提交状态进行判断,如果已经提交不修改
|
|
|
|
|
|
|
|
|
|
StuProfitAbilityExample profitAbilityExample = new StuProfitAbilityExample();
|
|
|
|
|
profitAbilityExample.createCriteria().andUserIdEqualTo(profitAbility.getUserId());
|
|
|
|
|
List<StuProfitAbility> profitAbilityList = profitAbilityMapper.selectByExample(profitAbilityExample);
|
|
|
|
|
if (!profitAbilityList.isEmpty()){
|
|
|
|
|
StuProfitAbility info = profitAbilityList.get(0);
|
|
|
|
|
|
|
|
|
|
//防止前端传id为null
|
|
|
|
|
|
|
|
|
|
Integer id = info.getId();
|
|
|
|
|
|
|
|
|
|
if (info.getSubState() == null)
|
|
|
|
|
{
|
|
|
|
|
info.setSubState(0);
|
|
|
|
|
}
|
|
|
|
|
//有已提交用户数据
|
|
|
|
|
if (info.getSubState() == 1)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//不做任何修改
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//未提交,但是有数据,同步最新数据
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(profitAbility,info);
|
|
|
|
|
|
|
|
|
|
info.setId(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
profitAbilityMapper.updateByPrimaryKeySelective(info);
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!");
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
|
|
//第一次保存没有用户数据
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
profitAbility.setId((int) IdUtil.getSnowflakeNextId());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
profitAbilityMapper.insertSelective(profitAbility);
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 财务指标盈利能力提交算分
|
|
|
|
|
* @param profitAbility
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultEntity getFinancialProfitAbilityBySub(StuProfitAbility profitAbility) {
|
|
|
|
|
//判断是否为第一次提交
|
|
|
|
|
StuProfitAbilityExample profitAbilityExample = new StuProfitAbilityExample();
|
|
|
|
|
profitAbilityExample.createCriteria().andUserIdEqualTo(profitAbility.getUserId());
|
|
|
|
|
List<StuProfitAbility> profitAbilityList = profitAbilityMapper.selectByExample(profitAbilityExample);
|
|
|
|
|
if (!profitAbilityList.isEmpty()){
|
|
|
|
|
//有已提交用户数据
|
|
|
|
|
if (profitAbilityList.get(0).getSubState() == 1) {
|
|
|
|
|
//不做任何修改
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//用户已经有了数据只能更新不能插入
|
|
|
|
|
|
|
|
|
|
//首次提交判断输入数据是否则正确
|
|
|
|
|
profitAbility = FinancialProfitAbilityCheck(profitAbility);
|
|
|
|
|
profitAbility.setId(profitAbilityList.get(0).getId());
|
|
|
|
|
profitAbilityMapper.updateByPrimaryKeySelective(profitAbility);
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!",profitAbility.getErrorNumber());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
//首次提交判断输入数据是否则正确
|
|
|
|
|
profitAbility = FinancialProfitAbilityCheck(profitAbility);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//插入数据库
|
|
|
|
|
profitAbilityMapper.insertSelective(profitAbility);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!",profitAbility.getErrorNumber());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 财务指标偿债能力自动保存
|
|
|
|
|
* @param solvency
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
public ResultEntity getFinancialSolvencyByAuto(StuSolvency solvency) {
|
|
|
|
|
//查询有无数据,有数据就更新,没有数据就保存
|
|
|
|
|
StuSolvencyExample solvencyExample = new StuSolvencyExample();
|
|
|
|
|
solvencyExample.createCriteria().andUserIdEqualTo(solvency.getUserId());
|
|
|
|
|
|
|
|
|
|
List<StuSolvency> stuSolvencyList = solvencyMapper.selectByExample(solvencyExample);
|
|
|
|
|
if (!stuSolvencyList.isEmpty()){
|
|
|
|
|
//更新数据
|
|
|
|
|
|
|
|
|
|
StuSolvency stuSolvency = stuSolvencyList.get(0);
|
|
|
|
|
Integer id = stuSolvency.getId();
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(solvency,stuSolvency);
|
|
|
|
|
stuSolvency.setId(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
solvencyMapper.updateByPrimaryKeySelective(stuSolvency);
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!");
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
//创建数据
|
|
|
|
|
solvency.setSubState(0);
|
|
|
|
|
solvency.setErrorNumber(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
solvencyMapper.insertSelective(solvency);
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 财务指标偿债能力提交算分
|
|
|
|
|
* @param solvency
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultEntity getFinancialSolvencyBySub(StuSolvency solvency) {
|
|
|
|
|
StuSolvencyExample solvencyExample = new StuSolvencyExample();
|
|
|
|
|
solvencyExample.createCriteria().andUserIdEqualTo(solvency.getUserId());
|
|
|
|
|
|
|
|
|
|
List<StuSolvency> stuSolvencyList = solvencyMapper.selectByExample(solvencyExample);
|
|
|
|
|
if (!stuSolvencyList.isEmpty()){
|
|
|
|
|
|
|
|
|
|
//已提交
|
|
|
|
|
if (stuSolvencyList.get(0).getSubState() == 1){
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//用户已经有了数据、更新
|
|
|
|
|
|
|
|
|
|
//判断结果(错误次数)
|
|
|
|
|
|
|
|
|
|
solvency = resultCheckByFinancialSolvency(solvency);
|
|
|
|
|
solvency.setId(stuSolvencyList.get(0).getId());
|
|
|
|
|
solvencyMapper.updateByPrimaryKeySelective(solvency);
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!",solvency.getErrorNumber());
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
//首次提交插入数据
|
|
|
|
|
|
|
|
|
|
solvency = resultCheckByFinancialSolvency(solvency);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
solvencyMapper.insertSelective(solvency);
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!",solvency.getErrorNumber());
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 财务指标营运能力自动保存
|
|
|
|
|
* @param operatingCapacity
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultEntity getFinancialOperatingCapacityByAuto(StuOperatingCapacity operatingCapacity) {
|
|
|
|
|
//查询有无数据,有数据就更新,没有数据就保存
|
|
|
|
|
StuOperatingCapacityExample operatingCapacityExample = new StuOperatingCapacityExample();
|
|
|
|
|
operatingCapacityExample.createCriteria().andUserIdEqualTo(operatingCapacity.getUserId());
|
|
|
|
|
|
|
|
|
|
List<StuOperatingCapacity> operatingCapacityList = operatingCapacityMapper.selectByExample(operatingCapacityExample);
|
|
|
|
|
if (!operatingCapacityList.isEmpty()){
|
|
|
|
|
//更新数据
|
|
|
|
|
|
|
|
|
|
StuOperatingCapacity stuOperatingCapacity = operatingCapacityList.get(0);
|
|
|
|
|
Integer id = stuOperatingCapacity.getId();
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(operatingCapacity,stuOperatingCapacity);
|
|
|
|
|
stuOperatingCapacity.setId(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
operatingCapacityMapper.updateByPrimaryKeySelective(stuOperatingCapacity);
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!");
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
//创建数据
|
|
|
|
|
operatingCapacity.setSubState(0);
|
|
|
|
|
operatingCapacity.setErrorNumber(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
operatingCapacityMapper.insertSelective(operatingCapacity);
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 财务指标营运能力提交算分
|
|
|
|
|
* @param operatingCapacity
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultEntity financialOperatingCapacityBySub(StuOperatingCapacity operatingCapacity) {
|
|
|
|
|
|
|
|
|
|
//判断是否为第一次提交
|
|
|
|
|
StuOperatingCapacityExample operatingCapacityExample = new StuOperatingCapacityExample();
|
|
|
|
|
operatingCapacityExample.createCriteria().andUserIdEqualTo(operatingCapacity.getUserId());
|
|
|
|
|
|
|
|
|
|
List<StuOperatingCapacity> operatingCapacityList = operatingCapacityMapper.selectByExample(operatingCapacityExample);
|
|
|
|
|
if (!operatingCapacityList.isEmpty()){
|
|
|
|
|
//有已提交用户数据
|
|
|
|
|
if (operatingCapacityList.get(0).getSubState() == 1) {
|
|
|
|
|
//不做任何修改
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//用户已经有了数据只能更新不能插入
|
|
|
|
|
|
|
|
|
|
//首次提交判断输入数据是否则正确
|
|
|
|
|
operatingCapacity = financialOperatingCapacityCheck(operatingCapacity);
|
|
|
|
|
operatingCapacity.setId(operatingCapacityList.get(0).getId());
|
|
|
|
|
operatingCapacityMapper.updateByPrimaryKeySelective(operatingCapacity);
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!",operatingCapacity.getErrorNumber());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
//首次提交判断输入数据是否则正确
|
|
|
|
|
operatingCapacity = financialOperatingCapacityCheck(operatingCapacity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//插入数据库
|
|
|
|
|
operatingCapacityMapper.insertSelective(operatingCapacity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!",operatingCapacity.getErrorNumber());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 财务指标成长能力自动保存
|
|
|
|
|
* @param growthAbility
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultEntity getFinancialGrowthAbilityByAuto(StuGrowthAbility growthAbility) {
|
|
|
|
|
|
|
|
|
|
StuGrowthAbilityExample growthAbilityExample = new StuGrowthAbilityExample();
|
|
|
|
|
growthAbilityExample.createCriteria().andUserIdEqualTo(growthAbility.getUserId());
|
|
|
|
|
|
|
|
|
|
List<StuGrowthAbility> growthAbilityList = growthAbilityMapper.selectByExample(growthAbilityExample);
|
|
|
|
|
if (!growthAbilityList.isEmpty()){
|
|
|
|
|
//更新数据
|
|
|
|
|
|
|
|
|
|
StuGrowthAbility stuGrowthAbility = growthAbilityList.get(0);
|
|
|
|
|
Integer id = stuGrowthAbility.getId();
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(growthAbility,stuGrowthAbility);
|
|
|
|
|
stuGrowthAbility.setId(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
growthAbilityMapper.updateByPrimaryKeySelective(stuGrowthAbility);
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!");
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
//创建数据
|
|
|
|
|
growthAbility.setSubState(0);
|
|
|
|
|
growthAbility.setErrorNumber(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
growthAbilityMapper.insertSelective(growthAbility);
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 财务指标成长能力提交算分
|
|
|
|
|
* @param growthAbility
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultEntity getFinancialGrowthAbilityBySub(StuGrowthAbility growthAbility) {
|
|
|
|
|
|
|
|
|
|
//判断是否为第一次提交
|
|
|
|
|
StuGrowthAbilityExample growthAbilityExample = new StuGrowthAbilityExample();
|
|
|
|
|
growthAbilityExample.createCriteria().andUserIdEqualTo(growthAbility.getUserId());
|
|
|
|
|
|
|
|
|
|
List<StuGrowthAbility> growthAbilityList = growthAbilityMapper.selectByExample(growthAbilityExample);
|
|
|
|
|
if (!growthAbilityList.isEmpty()){
|
|
|
|
|
//有已提交用户数据
|
|
|
|
|
if (growthAbilityList.get(0).getSubState() == 1) {
|
|
|
|
|
//不做任何修改
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//用户已经有了数据只能更新不能插入
|
|
|
|
|
|
|
|
|
|
//首次提交判断输入数据是否则正确
|
|
|
|
|
growthAbility = financialGrowthAbilityCheck(growthAbility);
|
|
|
|
|
growthAbility.setId(growthAbilityList.get(0).getId());
|
|
|
|
|
growthAbilityMapper.updateByPrimaryKeySelective(growthAbility);
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!",growthAbility.getErrorNumber());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
//首次提交判断输入数据是否则正确
|
|
|
|
|
growthAbility = financialGrowthAbilityCheck(growthAbility);
|
|
|
|
|
|
|
|
|
|
//插入数据库
|
|
|
|
|
growthAbilityMapper.insertSelective(growthAbility);
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!",growthAbility.getErrorNumber());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 财务指标杜邦分析自动保存
|
|
|
|
|
* @param duPontAnalysis
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultEntity getFinancialDuPontAnalysisByAuto(StuDuPontAnalysis duPontAnalysis) {
|
|
|
|
|
|
|
|
|
|
StuDuPontAnalysisExample duPontAnalysisExample = new StuDuPontAnalysisExample();
|
|
|
|
|
duPontAnalysisExample.createCriteria().andUserIdEqualTo(duPontAnalysis.getUserId());
|
|
|
|
|
|
|
|
|
|
List<StuDuPontAnalysis> duPontAnalysisList = duPontAnalysisMapper.selectByExample(duPontAnalysisExample);
|
|
|
|
|
if (!duPontAnalysisList.isEmpty()){
|
|
|
|
|
//更新数据
|
|
|
|
|
|
|
|
|
|
StuDuPontAnalysis stuDuPontAnalysis = duPontAnalysisList.get(0);
|
|
|
|
|
Integer id = stuDuPontAnalysis.getId();
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(duPontAnalysis,stuDuPontAnalysis);
|
|
|
|
|
stuDuPontAnalysis.setId(id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
duPontAnalysisMapper.updateByPrimaryKeySelective(stuDuPontAnalysis);
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!");
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
//创建数据
|
|
|
|
|
duPontAnalysis.setSubState(0);
|
|
|
|
|
duPontAnalysis.setErrorNumber(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
duPontAnalysisMapper.insertSelective(duPontAnalysis);
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 财务指标杜邦分析提交算分
|
|
|
|
|
* @param duPontAnalysis
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public ResultEntity getFinancialDuPontAnalysisBySub(StuDuPontAnalysis duPontAnalysis) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断是否为第一次提交
|
|
|
|
|
StuDuPontAnalysisExample duPontAnalysisExample = new StuDuPontAnalysisExample();
|
|
|
|
|
duPontAnalysisExample.createCriteria().andUserIdEqualTo(duPontAnalysis.getUserId());
|
|
|
|
|
|
|
|
|
|
List<StuDuPontAnalysis> duPontAnalysisList = duPontAnalysisMapper.selectByExample(duPontAnalysisExample);
|
|
|
|
|
if (!duPontAnalysisList.isEmpty()){
|
|
|
|
|
//有已提交用户数据
|
|
|
|
|
if (duPontAnalysisList.get(0).getSubState() == 1) {
|
|
|
|
|
//不做任何修改
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//用户已经有了数据只能更新不能插入
|
|
|
|
|
|
|
|
|
|
//首次提交判断输入数据是否则正确
|
|
|
|
|
duPontAnalysis = financialDuPontAnalysisCheck(duPontAnalysis);
|
|
|
|
|
duPontAnalysis.setId(duPontAnalysisList.get(0).getId());
|
|
|
|
|
duPontAnalysisMapper.updateByPrimaryKeySelective(duPontAnalysis);
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!",duPontAnalysis.getErrorNumber());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
//首次提交判断输入数据是否则正确
|
|
|
|
|
duPontAnalysis = financialDuPontAnalysisCheck(duPontAnalysis);
|
|
|
|
|
|
|
|
|
|
//插入数据库
|
|
|
|
|
duPontAnalysisMapper.insertSelective(duPontAnalysis);
|
|
|
|
|
|
|
|
|
|
return new ResultEntity<>(HttpStatus.OK,"保存成功!",duPontAnalysis.getErrorNumber());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//财务指标杜邦分析提交算分
|
|
|
|
|
private StuDuPontAnalysis financialDuPontAnalysisCheck(StuDuPontAnalysis duPontAnalysis) {
|
|
|
|
|
int sum = 0;
|
|
|
|
|
|
|
|
|
|
//总资产净利率
|
|
|
|
|
if (!"0.05".equals(duPontAnalysis.getNetPrifitMarginTotalAsset())){
|
|
|
|
|
sum = sum +2;
|
|
|
|
|
}
|
|
|
|
|
//权益净利率
|
|
|
|
|
if (!"0.16".equals(duPontAnalysis.getReturnEquity())){
|
|
|
|
|
sum = sum +2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
duPontAnalysis.setSubState(1);
|
|
|
|
|
duPontAnalysis.setErrorNumber(sum);
|
|
|
|
|
return duPontAnalysis;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//财务指标成长能力提交算分
|
|
|
|
|
private StuGrowthAbility financialGrowthAbilityCheck(StuGrowthAbility growthAbility) {
|
|
|
|
|
|
|
|
|
|
int sum = 0;
|
|
|
|
|
if (!"0.09".equals(growthAbility.getYearGrowth())){
|
|
|
|
|
sum ++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
growthAbility.setErrorNumber(sum);
|
|
|
|
|
growthAbility.setSubState(1);
|
|
|
|
|
return growthAbility;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//财务指标营运能力提交算分
|
|
|
|
|
private StuOperatingCapacity financialOperatingCapacityCheck(StuOperatingCapacity operatingCapacity) {
|
|
|
|
|
|
|
|
|
|
int sum = 0;
|
|
|
|
|
|
|
|
|
|
//总资产周转率
|
|
|
|
|
if (!"1.01".equals(operatingCapacity.getTotalAssetTurnover()))
|
|
|
|
|
{
|
|
|
|
|
sum = sum + 2;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//流动资产周转率
|
|
|
|
|
if (!"3.57".equals(operatingCapacity.getCurrentAssetTurnover()))
|
|
|
|
|
{
|
|
|
|
|
sum = sum + 2;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//应收账款周转率
|
|
|
|
|
if (!"14.48".equals(operatingCapacity.getAccountsReceivalTurnoverRate()))
|
|
|
|
|
{
|
|
|
|
|
sum = sum + 2;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//存货周转率
|
|
|
|
|
if (!"10.58".equals(operatingCapacity.getInventoryTurnoverRate()))
|
|
|
|
|
{
|
|
|
|
|
sum = sum + 2;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
operatingCapacity.setErrorNumber(sum);
|
|
|
|
|
|
|
|
|
|
operatingCapacity.setSubState(1);
|
|
|
|
|
|
|
|
|
|
return operatingCapacity;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//财务指标偿债能力提交算分
|
|
|
|
|
private StuSolvency resultCheckByFinancialSolvency(StuSolvency solvency) {
|
|
|
|
|
|
|
|
|
|
int sum = 0 ;
|
|
|
|
|
|
|
|
|
|
if (!solvency.getCurrentRatio().equals("0.47")){
|
|
|
|
|
sum ++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!solvency.getAssetLiabilityRatio().equals("0.7")){
|
|
|
|
|
sum ++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!solvency.getEquityRatio().equals("2.34")){
|
|
|
|
|
sum ++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!solvency.getEquityMultiplier().equals("3.34")){
|
|
|
|
|
sum = sum + 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!solvency.getQuickRatio().equals("0.28")){
|
|
|
|
|
sum ++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!solvency.getCashRatio().equals("0.15")){
|
|
|
|
|
sum ++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
solvency.setSubState(1);
|
|
|
|
|
solvency.setErrorNumber(sum);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return solvency;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//盈利能力计算分数
|
|
|
|
|
private StuProfitAbility FinancialProfitAbilityCheck(StuProfitAbility profitAbility){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int sum = 0;
|
|
|
|
|
|
|
|
|
|
if (!profitAbility.getGrossMargin().equals("0.35")) {
|
|
|
|
|
|
|
|
|
|
sum ++;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (!profitAbility.getReturnAssetRoa().equals("0.05")) {
|
|
|
|
|
|
|
|
|
|
sum = sum +2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!profitAbility.getReturnEquityRoe().equals("0.16")) {
|
|
|
|
|
|
|
|
|
|
sum = sum +2;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!profitAbility.getNetOperatProfitMargin().equals("0.05")) {
|
|
|
|
|
|
|
|
|
|
sum = sum +2;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
profitAbility.setErrorNumber(sum);
|
|
|
|
|
profitAbility.setSubState(1);
|
|
|
|
|
|
|
|
|
|
return profitAbility;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//信贷记录判断结果
|
|
|
|
|
//信贷记录计算分数
|
|
|
|
|
private StuCreditRecords resultCheckByCreditRecords(StuCreditRecords creditRecords) {
|
|
|
|
|
int sum = 0;
|
|
|
|
|
|
|
|
|
@ -462,7 +1076,7 @@ public class StuEnterPriseByInfoEntryServiceImpl implements StuEnterPriseByInfoE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//基本信息
|
|
|
|
|
//基本信息计算分数
|
|
|
|
|
private StuBaseInfo resultCheck(StuBaseInfo stuBaseInfo) {
|
|
|
|
|
|
|
|
|
|
int sum = 0;
|
|
|
|
|