wanghb 1 year ago
commit d274faf3e8

@ -3,8 +3,10 @@ package com.sztzjy.fund_investment.controller;
import com.github.pagehelper.PageInfo;
import com.sztzjy.fund_investment.annotation.AnonymousAccess;
import com.sztzjy.fund_investment.entity.FoundProject;
import com.sztzjy.fund_investment.entity.PerformanceScore;
import com.sztzjy.fund_investment.entity.ProjectPool;
import com.sztzjy.fund_investment.mapper.FoundProjectMapper;
import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper;
import com.sztzjy.fund_investment.service.ISysFoundProjectService;
import com.sztzjy.fund_investment.service.ISysProjectPoolService;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
@ -24,6 +26,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.nio.file.Paths;
import java.util.Date;
//yz
@RestController
@ -40,6 +43,8 @@ public class FoundProjectController {
ISysFoundProjectService foundProjectService;
@Autowired
PerformanceScoreService scoreService;
@Autowired
PerformanceScoreMapper performanceScoreMapper;
@GetMapping("getProjectPoolList")
@ApiOperation("寻找项目数据展示")
@ -92,6 +97,9 @@ public class FoundProjectController {
scoreService.calculateScoreByModule("projectSearchReportScore",0,foundProject.getFlowId());
}
scoreService.calculateScoreByModule("projectSearchScore",3,foundProject.getFlowId());
PerformanceScore performanceScore = scoreService.getByFlowId(foundProject.getFlowId());
performanceScore.setProjectSearchTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity(HttpStatus.OK,"立项成功");
}

@ -3,6 +3,7 @@ package com.sztzjy.fund_investment.controller;
import com.sztzjy.fund_investment.entity.Fundraising;
import com.sztzjy.fund_investment.entity.PerformanceScore;
import com.sztzjy.fund_investment.mapper.FundraisingMapper;
import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper;
import com.sztzjy.fund_investment.service.ISysFundraisingService;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
import com.sztzjy.fund_investment.util.ResultEntity;
@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.Date;
import java.util.UUID;
//yz
@ -30,6 +32,8 @@ public class FundraisingController {
FundraisingMapper fundraisingMapper;
@Autowired
PerformanceScoreService performanceScoreService;
@Autowired
PerformanceScoreMapper performanceScoreMapper;
@GetMapping("getFundraising")
@ApiOperation("资金募资回显")
@ -44,7 +48,7 @@ public class FundraisingController {
@ApiParam("自有资金") @RequestParam BigDecimal ownFunds,
@ApiParam("银行借款") @RequestParam (required = false)BigDecimal bankLoan,
@ApiParam("优先级LP") @RequestParam BigDecimal priorityLP,
@ApiParam("劣后级LP") @RequestParam(required = false) BigDecimal subordinatedLP,
@ApiParam("劣后级LP") @RequestParam(required = false) BigDecimal subordinatedLp,
@ApiParam("基金募资金额(为前面四个参数之和)") @RequestParam BigDecimal fundraisingAmount) {
if (ownFunds.add(priorityLP).compareTo(BigDecimal.valueOf(1000000))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
@ -55,60 +59,60 @@ public class FundraisingController {
}
Fundraising fundraising = new Fundraising();
//判断基金募集类型 1:自有资金/优先级LP、2:自有资金/优先级LP/劣后级LP、3:自有资金/优先级LP/银行借款、4:自有资金/优先级LP/劣后级LP/银行借款
if(subordinatedLP!=null){
if(bankLoan!=null){
if(subordinatedLp.compareTo(BigDecimal.ZERO)!=0){
if(bankLoan.compareTo(BigDecimal.ZERO)!=0){
fundraising.setType(4);
BigDecimal totalFunds = priorityLP.add(ownFunds).add(subordinatedLP).add(bankLoan);
if(ownFunds.divide(totalFunds).compareTo(new BigDecimal("0.05"))>0){
BigDecimal totalFunds = priorityLP.add(ownFunds).add(subordinatedLp).add(bankLoan);
if(ownFunds.divide(totalFunds,4,BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal("0.05"))>0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型4,自有资金不能超过总资金的5%");
}
if(priorityLP.divide(totalFunds).compareTo(new BigDecimal("0.6"))<0){
if(priorityLP.divide(totalFunds,4,BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal("0.6"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型4,优先级LP不能低于总资金的60%");
}
if(subordinatedLP.divide(totalFunds).compareTo(new BigDecimal("0.3"))<0){
if(subordinatedLp.divide(totalFunds,4,BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal("0.3"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型4,劣后级LP不能低于总资金的30%");
}
if(bankLoan.divide(totalFunds).compareTo(new BigDecimal("0.05"))<0){
if(bankLoan.divide(totalFunds,4,BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal("0.05"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型4,银行借款不能低于总资金的5%");
}
}else {
BigDecimal totalFunds = priorityLP.add(ownFunds).add(subordinatedLP);
if(ownFunds.divide(totalFunds).compareTo(new BigDecimal("0.1"))>0){
BigDecimal totalFunds = priorityLP.add(ownFunds).add(subordinatedLp);
if(ownFunds.divide(totalFunds,4,BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal("0.1"))>0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型2,自有资金不能超过总资金的10%");
}
if(priorityLP.divide(totalFunds).compareTo(new BigDecimal("0.6"))<0){
if(priorityLP.divide(totalFunds,4,BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal("0.6"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型2,优先级LP不能低于总资金的60%");
}
if(subordinatedLP.divide(totalFunds).compareTo(new BigDecimal("0.3"))<0){
if(subordinatedLp.divide(totalFunds,4,BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal("0.3"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型2,劣后级LP不能低于总资金的30%");
}
fundraising.setType(2);
}
}else {
if(bankLoan!=null){
if(bankLoan.compareTo(BigDecimal.ZERO)!=0){
BigDecimal totalFunds = priorityLP.add(ownFunds).add(bankLoan);
if(ownFunds.divide(totalFunds).compareTo(new BigDecimal("0.1"))>0){
if(ownFunds.divide(totalFunds,4,BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal("0.1"))>0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型3,自有资金不能超过总资金的10%");
}
if(priorityLP.divide(totalFunds).compareTo(new BigDecimal("0.6"))<0){
if(priorityLP.divide(totalFunds,4,BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal("0.6"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型3,优先级LP不能低于总资金的60%");
}
if(bankLoan.divide(totalFunds).compareTo(new BigDecimal("0.3"))<0){
if(bankLoan.divide(totalFunds,4,BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal("0.3"))<0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型3,银行借款不能低于总资金的30%");
}
fundraising.setType(3);
}else {
if(ownFunds.divide(priorityLP.add(ownFunds)).compareTo(new BigDecimal("0.1"))>0){
if(ownFunds.divide(priorityLP.add(ownFunds),4,BigDecimal.ROUND_HALF_UP).compareTo(new BigDecimal("0.1"))>0){
performanceScoreService.calculateScoreByModule("fundraisingScore",0,flowId);
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败,类型1,自有资金不能超过总资金的10%");
}
@ -120,12 +124,15 @@ public class FundraisingController {
fundraising.setOwnFunds(ownFunds);
fundraising.setBankLoan(bankLoan);
fundraising.setPriorityLp(priorityLP);
fundraising.setSubordinatedLp(subordinatedLP);
fundraising.setSubordinatedLp(subordinatedLp);
fundraising.setFundraisingAmount(fundraisingAmount);
Boolean aBoolean = fundraisingService.insertFundraising(fundraising);
if(aBoolean){
//新增成功 增加分数 如果之前分数为零 则不进行加分
performanceScoreService.calculateScoreByModule("fundraisingScore",5,flowId);
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
performanceScore.setFundraisingTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity(HttpStatus.OK,"资金募资新增成功",fundraising);
}else {
return new ResultEntity(HttpStatus.BAD_REQUEST,"新增基金募资失败");

@ -1,6 +1,7 @@
package com.sztzjy.fund_investment.controller;
import com.sztzjy.fund_investment.annotation.AnonymousAccess;
import com.sztzjy.fund_investment.entity.Fundraising;
import com.sztzjy.fund_investment.entity.ProfitDistribution;
import com.sztzjy.fund_investment.service.ISysFundraisingService;
import com.sztzjy.fund_investment.service.ProfitDistributionService;
@ -42,8 +43,11 @@ public class ProfitDistributionController {
@PostMapping("/getType")
@ApiOperation("返回基金募集的类型")
public Integer submit(@RequestParam String flowId) {
return fundraisingService.selectByFlowId(flowId).getType();
Fundraising fundraising = fundraisingService.selectByFlowId(flowId);
if (fundraising!=null) {
return fundraising.getType();
}
return null;
}
}

@ -12,6 +12,8 @@ import com.sztzjy.fund_investment.annotation.AnonymousAccess;
import com.sztzjy.fund_investment.entity.*;
import com.sztzjy.fund_investment.entity.treeSelect.TreeSelect;
import com.sztzjy.fund_investment.mapper.FoundProjectMapper;
import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper;
import com.sztzjy.fund_investment.mapper.ProFinancialIndexDetailUserMapper;
import com.sztzjy.fund_investment.mapper.ProjectPoolMapper;
import com.sztzjy.fund_investment.service.ISysProjectDueDiligenceService;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
@ -27,6 +29,7 @@ import org.apache.poi.ss.formula.functions.T;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.awt.*;
import java.io.BufferedInputStream;
@ -55,6 +58,10 @@ public class ProjectDueDiligenceController {
private IFileUtil fileUtil;
@Autowired
PerformanceScoreService scoreService;
@Autowired
PerformanceScoreMapper performanceScoreMapper;
@Autowired
ProFinancialIndexDetailUserMapper proFinancialIndexDetailUserMapper;
//*************公司业务尽职调查
@ -191,7 +198,7 @@ public class ProjectDueDiligenceController {
return new ResultEntity(HttpStatus.BAD_REQUEST, "业务尽调结论为空");
}
projectDueDiligenceService.updateServiceDueDiligence(foundProject);
scoreService.calculateScoreByModule("projectDueDiligenceBusinessReportScore",2,foundProject.getFlowId());
scoreService.calculateScoreByModule("projectDueDiligenceBusinessReportScore", 2, foundProject.getFlowId());
return new ResultEntity(HttpStatus.OK, "业务尽调结论保存成功");
}
@ -231,18 +238,37 @@ public class ProjectDueDiligenceController {
@ApiOperation("财务指标查询")
@AnonymousAccess
public ResultEntity<PageInfo<ProFinancialIndexDetail>> selectProFinancialIndexDetailList(@ApiParam("节点id的集合List") @RequestBody List<String> proFinancialIndexIdList,
@ApiParam("流程ID") @RequestParam String flowId,
@ApiParam("条数") @RequestParam Integer size,
@ApiParam("页数") @RequestParam Integer index) {
@ApiParam("流程ID") @RequestParam String flowId,
@ApiParam("条数") @RequestParam Integer size,
@ApiParam("页数") @RequestParam Integer index) {
PageInfo<ProFinancialIndexDetail> pageInfo = projectDueDiligenceService.selectProFinancialIndexDetailList(proFinancialIndexIdList, flowId, size, index);
return new ResultEntity(HttpStatus.OK, "财务指标查询成功", pageInfo);
}
@GetMapping("selectFinancialIndexDetailListHistory")
@ApiOperation("财务指标历史查询")
@AnonymousAccess
public ResultEntity<List<String>> selectFinancialIndexDetailListHistory(@ApiParam("流程ID") @RequestParam String flowId) {
List<String> ids=new ArrayList<>();
ProFinancialIndexDetailUserExample example = new ProFinancialIndexDetailUserExample();
ProFinancialIndexDetailUserExample.Criteria criteria = example.createCriteria();
criteria.andFlowIdEqualTo(flowId).andLastYearValueNotEqualTo("0");
List<ProFinancialIndexDetailUser> proFinancialIndexDetailUsers = proFinancialIndexDetailUserMapper.selectByExample(example);
if(proFinancialIndexDetailUsers.isEmpty()){
return new ResultEntity(HttpStatus.OK, "财务指标历史查询为空", ids);
}else {
for (int i = 0; i < proFinancialIndexDetailUsers.size(); i++) {
ids.add(proFinancialIndexDetailUsers.get(i).getFinancialIndexId());
}
return new ResultEntity(HttpStatus.OK, "财务指标历史查询成功", ids);
}
}
@PostMapping("insertProFinancialIndexDetailUserList")
@ApiOperation("财务指标保存")
@AnonymousAccess
public ResultEntity insertProFinancialIndexDetailUserList(@ApiParam("保存的对象") @RequestBody List<ProFinancialIndexDetail> proFinancialIndexDetailList,
@ApiParam("流程ID") @RequestParam String flowId) {
@ApiParam("流程ID") @RequestParam String flowId) {
ResultEntity resultEntity = projectDueDiligenceService.insertProFinancialIndexDetailUserList(proFinancialIndexDetailList, flowId);
return resultEntity;
}
@ -251,9 +277,9 @@ public class ProjectDueDiligenceController {
@ApiOperation("财务报表查询")
@AnonymousAccess
public ResultEntity<PageInfo<ProFinancialStatementDetail>> selectProFinancialStatementDetailList(@ApiParam("节点id的集合List") @RequestBody List<String> proFinancialStatementIdList,
@ApiParam("流程ID") @RequestParam String flowId,
@ApiParam("条数") @RequestParam Integer size,
@ApiParam("页数") @RequestParam Integer index) {
@ApiParam("流程ID") @RequestParam String flowId,
@ApiParam("条数") @RequestParam Integer size,
@ApiParam("页数") @RequestParam Integer index) {
PageInfo<ProFinancialStatementDetail> pageInfo = projectDueDiligenceService.selectProFinancialStatementDetailList(proFinancialStatementIdList, flowId, size, index);
return new ResultEntity(HttpStatus.OK, "财务报表查询成功", pageInfo);
}
@ -262,8 +288,8 @@ public class ProjectDueDiligenceController {
@ApiOperation("财务指标选取导出")
@AnonymousAccess
public void exportProFinancialIndexDetailList(@ApiParam("HttpServletResponse") HttpServletResponse response,
@ApiParam("节点id的集合List") @RequestParam List<String> proFinancialIndexIdList,
@ApiParam("流程ID") @RequestParam String flowId) {
@ApiParam("节点id的集合List") @RequestParam List<String> proFinancialIndexIdList,
@ApiParam("流程ID") @RequestParam String flowId) {
//导出的表名
String title = IdUtil.simpleUUID();
//表中第一行表头字段
@ -320,7 +346,10 @@ public class ProjectDueDiligenceController {
return new ResultEntity(HttpStatus.BAD_REQUEST, "财务尽调结论为空");
}
projectDueDiligenceService.updateServiceDueDiligence(foundProject);
scoreService.calculateScoreByModule("projectDueDiligenceFinanceReportScore",2,foundProject.getFlowId());
scoreService.calculateScoreByModule("projectDueDiligenceFinanceReportScore", 2, foundProject.getFlowId());
PerformanceScore performanceScore = scoreService.getByFlowId(foundProject.getFlowId());
performanceScore.setProjectDueDiligenceTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity(HttpStatus.OK, "财务尽调结论保存成功");
}
@ -341,8 +370,8 @@ public class ProjectDueDiligenceController {
@ApiOperation("财务尽调生成报告")
@AnonymousAccess
public void exportFinanceDueDiligencePDF(HttpServletResponse response,
@ApiParam("流程ID") @RequestParam String flowId) throws IOException, DocumentException {
String projectPoolName=getProjectPoolNameByFlowId(flowId); //公司名称
@ApiParam("流程ID") @RequestParam String flowId) throws IOException, DocumentException {
String projectPoolName = getProjectPoolNameByFlowId(flowId); //公司名称
Document document = new Document();
// 创建 PdfWriter 对象 第一个参数是对文档对象的引用,第二个参数是文件的实际名称,在该名称中还会给出其输出路径。
@ -351,12 +380,12 @@ public class ProjectDueDiligenceController {
PdfWriter writer = PdfWriter.getInstance(document, response.getOutputStream());
writer.setPageEvent(new HeaderAndFooterEvent());
document.open();
HeaderAndFooterEvent.tpl=writer.getDirectContent().createTemplate(500,500);
HeaderAndFooterEvent.tpl = writer.getDirectContent().createTemplate(500, 500);
HeaderAndFooterEvent.PAGE_NUMBER = true;//实现页眉跟页脚
HeaderAndFooterEvent.HeaderLeft = "";//左上角
HeaderAndFooterEvent.HeaderRight = "";//右上角
HeaderAndFooterEvent.FooterLeft = "";//左下角
HeaderAndFooterEvent.FooterRight= "深圳市天择教育科技有限公司";//右下角
HeaderAndFooterEvent.FooterRight = "深圳市天择教育科技有限公司";//右下角
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "宋体", 25, Font.BOLD);
//添加一个空段落来占位五个参数分别为内容对齐方式1为居中0为居左2为居右段后空行数段前空行数行间距
document.add(HeaderAndFooterEvent.AddParagraph(" ", 1, 200, 0, 1.5f));
@ -431,28 +460,28 @@ public class ProjectDueDiligenceController {
document.add(HeaderAndFooterEvent.AddParagraph("工商信息:", 0, 1.5f));//工商信息
ProBusinessInfoShareholder proBusinessInfoShareholder = projectDueDiligenceService.getBusinessInfoShareholderListByFlowId(flowId).get(0);
ProBusinessInfo proBusinessInfo = projectDueDiligenceService.getBusinessInfoList(flowId).get(0);
TreeMap<String,String> treeMap=new TreeMap<>();
treeMap.put("企业名称",projectPoolName);
treeMap.put("法定代表人",proBusinessInfoShareholder.getLegalPerson());
treeMap.put("股东",proBusinessInfoShareholder.getShareholder1());
treeMap.put("持股比例",proBusinessInfoShareholder.getValue1());
treeMap.put("注册资本",proBusinessInfo.getRegisteredCapital());
treeMap.put("经营状态",proBusinessInfo.getOperatingState());
treeMap.put("统一社会信用代码",proBusinessInfo.getCreditCode());
treeMap.put("纳税人识别号",proBusinessInfo.getIdentificationNumber());
treeMap.put("营业期限",proBusinessInfo.getBusinessTerm());
treeMap.put("实缴资本",proBusinessInfo.getPaidinCapital());
treeMap.put("参保人数",proBusinessInfo.getInsuranceNum());
treeMap.put("成立日期",proBusinessInfo.getCreateDate());
treeMap.put("工商注册号",proBusinessInfo.getRegistrationNum());
treeMap.put("组织机构代码",proBusinessInfo.getOrgaStruCode());
treeMap.put("公司类型",proBusinessInfo.getCompanyType());
treeMap.put("行业",proBusinessInfo.getIndustry());
treeMap.put("核准日期",proBusinessInfo.getApprovalDate());
treeMap.put("人员规模",proBusinessInfo.getStaffSize());
treeMap.put("登记机关",proBusinessInfo.getRegistrar());
treeMap.put("注册地址",proBusinessInfo.getRegisteredAddress());
treeMap.put("经营范围",proBusinessInfo.getBusinessScope());
TreeMap<String, String> treeMap = new TreeMap<>();
treeMap.put("企业名称", projectPoolName);
treeMap.put("法定代表人", proBusinessInfoShareholder.getLegalPerson());
treeMap.put("股东", proBusinessInfoShareholder.getShareholder1());
treeMap.put("持股比例", proBusinessInfoShareholder.getValue1());
treeMap.put("注册资本", proBusinessInfo.getRegisteredCapital());
treeMap.put("经营状态", proBusinessInfo.getOperatingState());
treeMap.put("统一社会信用代码", proBusinessInfo.getCreditCode());
treeMap.put("纳税人识别号", proBusinessInfo.getIdentificationNumber());
treeMap.put("营业期限", proBusinessInfo.getBusinessTerm());
treeMap.put("实缴资本", proBusinessInfo.getPaidinCapital());
treeMap.put("参保人数", proBusinessInfo.getInsuranceNum());
treeMap.put("成立日期", proBusinessInfo.getCreateDate());
treeMap.put("工商注册号", proBusinessInfo.getRegistrationNum());
treeMap.put("组织机构代码", proBusinessInfo.getOrgaStruCode());
treeMap.put("公司类型", proBusinessInfo.getCompanyType());
treeMap.put("行业", proBusinessInfo.getIndustry());
treeMap.put("核准日期", proBusinessInfo.getApprovalDate());
treeMap.put("人员规模", proBusinessInfo.getStaffSize());
treeMap.put("登记机关", proBusinessInfo.getRegistrar());
treeMap.put("注册地址", proBusinessInfo.getRegisteredAddress());
treeMap.put("经营范围", proBusinessInfo.getBusinessScope());
PdfPTable table = returnPdfPTable(treeMap);
document.add(table);
@ -463,12 +492,12 @@ public class ProjectDueDiligenceController {
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 14, Font.BOLD);
document.add(HeaderAndFooterEvent.AddParagraph("司法风险:", 0, 1.5f));
ProJudicialRisk proJudicialRisk = projectDueDiligenceService.getProJudicialRiskListByFlowId(flowId).get(0);
TreeMap<String,String> treeMap2=new TreeMap<>();
treeMap2.put("开庭日期",proJudicialRisk.getLawfulDay());
treeMap2.put("案号",proJudicialRisk.getCaseCode());
treeMap2.put("案由",proJudicialRisk.getCause());
treeMap2.put("公诉人/原告",proJudicialRisk.getPlaintiff());
treeMap2.put("被告人",proJudicialRisk.getDefendant());
TreeMap<String, String> treeMap2 = new TreeMap<>();
treeMap2.put("开庭日期", proJudicialRisk.getLawfulDay());
treeMap2.put("案号", proJudicialRisk.getCaseCode());
treeMap2.put("案由", proJudicialRisk.getCause());
treeMap2.put("公诉人/原告", proJudicialRisk.getPlaintiff());
treeMap2.put("被告人", proJudicialRisk.getDefendant());
PdfPTable table2 = returnPdfPTable(treeMap2);
document.add(table2);
@ -479,13 +508,13 @@ public class ProjectDueDiligenceController {
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 14, Font.BOLD);
document.add(HeaderAndFooterEvent.AddParagraph("经营风险:", 0, 1.5f));
ProBusinessRisk proBusinessRisk = projectDueDiligenceService.getProBusinessRiskListByFlowId(flowId).get(0);
TreeMap<String,String> treeMap3=new TreeMap<>();
treeMap3.put("列入日期 ",proBusinessRisk.getIncludedDate());
treeMap3.put("列入经营异常名录原因",proBusinessRisk.getIncludedCause());
treeMap3.put("列入机关 ",proBusinessRisk.getIncludedOrganization());
treeMap3.put("移出日期",proBusinessRisk.getRemovedDate());
treeMap3.put("移出经营异常名录原因",proBusinessRisk.getRemovedCause());
treeMap3.put("移出决定机关 ",proBusinessRisk.getRemovedOrganization());
TreeMap<String, String> treeMap3 = new TreeMap<>();
treeMap3.put("列入日期 ", proBusinessRisk.getIncludedDate());
treeMap3.put("列入经营异常名录原因", proBusinessRisk.getIncludedCause());
treeMap3.put("列入机关 ", proBusinessRisk.getIncludedOrganization());
treeMap3.put("移出日期", proBusinessRisk.getRemovedDate());
treeMap3.put("移出经营异常名录原因", proBusinessRisk.getRemovedCause());
treeMap3.put("移出决定机关 ", proBusinessRisk.getRemovedOrganization());
PdfPTable table3 = returnPdfPTable(treeMap3);
document.add(table3);
@ -496,39 +525,38 @@ public class ProjectDueDiligenceController {
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 14, Font.BOLD);
document.add(HeaderAndFooterEvent.AddParagraph("核心团队:", 0, 1.5f));
ProCoreTeam proCoreTeam = projectDueDiligenceService.getProCoreTeamListByFlowId(flowId).get(0);
TreeMap<String,String> treeMap4=new TreeMap<>();
treeMap4.put("姓名",proCoreTeam.getName());
treeMap4.put("职位",proCoreTeam.getDuty());
treeMap4.put("简介",proCoreTeam.getIntroduction());
TreeMap<String, String> treeMap4 = new TreeMap<>();
treeMap4.put("姓名", proCoreTeam.getName());
treeMap4.put("职位", proCoreTeam.getDuty());
treeMap4.put("简介", proCoreTeam.getIntroduction());
PdfPTable table4 = returnPdfPTable(treeMap4);
document.add(table4);
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 14, Font.BOLD);
document.add(HeaderAndFooterEvent.AddParagraph("核心业务:", 0, 1.5f));
ProCoreBusiness proCoreBusiness = projectDueDiligenceService.getProCoreBusinessListByFlowId(flowId).get(0);
TreeMap<String,String> treeMap42=new TreeMap<>();
treeMap42.put("产品名称",proCoreBusiness.getProductnameName());
treeMap42.put("行业",proCoreBusiness.getIndustry());
treeMap42.put("产品介绍",proCoreBusiness.getProductIntroduction());
TreeMap<String, String> treeMap42 = new TreeMap<>();
treeMap42.put("产品名称", proCoreBusiness.getProductnameName());
treeMap42.put("行业", proCoreBusiness.getIndustry());
treeMap42.put("产品介绍", proCoreBusiness.getProductIntroduction());
PdfPTable table42 = returnPdfPTable(treeMap42);
document.add(table42);
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 14, Font.BOLD);
document.add(HeaderAndFooterEvent.AddParagraph("相关竞品:", 0, 1.5f));
ProCoreCompPro proCoreCompPro = projectDueDiligenceService.getProCoreCompProListByFlowId(flowId).get(0);
TreeMap<String,String> treeMap43=new TreeMap<>();
treeMap43.put("竞品名称",proCoreCompPro.getCompProName());
treeMap43.put("地区",proCoreCompPro.getIndustry());
treeMap43.put("当前融资轮次",proCoreCompPro.getArea());
treeMap43.put("行业",proCoreCompPro.getIndustry());
treeMap43.put("业务",proCoreCompPro.getBusiness());
treeMap43.put("成立时间",proCoreCompPro.getCreateDate());
treeMap43.put("估值",proCoreCompPro.getValuation());
TreeMap<String, String> treeMap43 = new TreeMap<>();
treeMap43.put("竞品名称", proCoreCompPro.getCompProName());
treeMap43.put("地区", proCoreCompPro.getIndustry());
treeMap43.put("当前融资轮次", proCoreCompPro.getArea());
treeMap43.put("行业", proCoreCompPro.getIndustry());
treeMap43.put("业务", proCoreCompPro.getBusiness());
treeMap43.put("成立时间", proCoreCompPro.getCreateDate());
treeMap43.put("估值", proCoreCompPro.getValuation());
PdfPTable table43 = returnPdfPTable(treeMap43);
document.add(table43);
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 16, Font.BOLD);
Paragraph p15 = HeaderAndFooterEvent.AddParagraph("五、经营状况", 0, 1.5f);
document.add(p15);
@ -536,44 +564,44 @@ public class ProjectDueDiligenceController {
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 14, Font.BOLD);
document.add(HeaderAndFooterEvent.AddParagraph("公司招聘:", 0, 1.5f));
ProManaSituRecruit proManaSituRecruit = projectDueDiligenceService.getProManaSituRecruitListByFlowId(flowId).get(0);
TreeMap<String,String> treeMap51=new TreeMap<>();
treeMap51.put("发布日期",proManaSituRecruit.getReleaseDate());
treeMap51.put("招聘职位",proManaSituRecruit.getDuty());
treeMap51.put("月薪",proManaSituRecruit.getSalary());
treeMap51.put("学历",proManaSituRecruit.getDegrees());
treeMap51.put("工作经验",proManaSituRecruit.getExperience());
treeMap51.put("地区",proManaSituRecruit.getArea());
TreeMap<String, String> treeMap51 = new TreeMap<>();
treeMap51.put("发布日期", proManaSituRecruit.getReleaseDate());
treeMap51.put("招聘职位", proManaSituRecruit.getDuty());
treeMap51.put("月薪", proManaSituRecruit.getSalary());
treeMap51.put("学历", proManaSituRecruit.getDegrees());
treeMap51.put("工作经验", proManaSituRecruit.getExperience());
treeMap51.put("地区", proManaSituRecruit.getArea());
PdfPTable table51 = returnPdfPTable(treeMap51);
document.add(table51);
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 14, Font.BOLD);
document.add(HeaderAndFooterEvent.AddParagraph("抽查检查:", 0, 1.5f));
ProManaSituCheck proManaSituCheck = projectDueDiligenceService.getProManaSituCheckListByFlowId(flowId).get(0);
TreeMap<String,String> treeMap52=new TreeMap<>();
treeMap52.put("日期",proManaSituCheck.getCheckDate());
treeMap52.put("类型",proManaSituCheck.getCheckType());
treeMap52.put("结果",proManaSituCheck.getConsequence());
treeMap52.put("检查实施机关",proManaSituCheck.getOrganization());
TreeMap<String, String> treeMap52 = new TreeMap<>();
treeMap52.put("日期", proManaSituCheck.getCheckDate());
treeMap52.put("类型", proManaSituCheck.getCheckType());
treeMap52.put("结果", proManaSituCheck.getConsequence());
treeMap52.put("检查实施机关", proManaSituCheck.getOrganization());
PdfPTable table52 = returnPdfPTable(treeMap52);
document.add(table52);
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 14, Font.BOLD);
document.add(HeaderAndFooterEvent.AddParagraph("行政许可:", 0, 1.5f));
ProManaSituLicense proManaSituLicense = projectDueDiligenceService.getProManaSituLicenseListByFlowId(flowId).get(0);
TreeMap<String,String> treeMap53=new TreeMap<>();
treeMap53.put("行政许可文书号",proManaSituLicense.getWrittenDecisionNum());
treeMap53.put("许可决定机关",proManaSituLicense.getOrganization());
treeMap53.put("许可决定日期",proManaSituLicense.getLicenseDate());
TreeMap<String, String> treeMap53 = new TreeMap<>();
treeMap53.put("行政许可文书号", proManaSituLicense.getWrittenDecisionNum());
treeMap53.put("许可决定机关", proManaSituLicense.getOrganization());
treeMap53.put("许可决定日期", proManaSituLicense.getLicenseDate());
PdfPTable table53 = returnPdfPTable(treeMap53);
document.add(table53);
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 14, Font.BOLD);
document.add(HeaderAndFooterEvent.AddParagraph("招投标:", 0, 1.5f));
ProManaSituTenderingBidding proManaSituTenderingBidding = projectDueDiligenceService.getProManaSituTenderingBiddingListByFlowId(flowId).get(0);
TreeMap<String,String> treeMap54=new TreeMap<>();
treeMap54.put("发布日期",proManaSituTenderingBidding.getReleaseDate());
treeMap54.put("标题",proManaSituTenderingBidding.getTitle());
treeMap54.put("采购人",proManaSituTenderingBidding.getPurchaser());
TreeMap<String, String> treeMap54 = new TreeMap<>();
treeMap54.put("发布日期", proManaSituTenderingBidding.getReleaseDate());
treeMap54.put("标题", proManaSituTenderingBidding.getTitle());
treeMap54.put("采购人", proManaSituTenderingBidding.getPurchaser());
PdfPTable table54 = returnPdfPTable(treeMap54);
document.add(table54);
@ -584,23 +612,23 @@ public class ProjectDueDiligenceController {
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 14, Font.BOLD);
document.add(HeaderAndFooterEvent.AddParagraph("专利信息:", 0, 1.5f));
ProIntelPropertyPatentinfo proIntelPropertyPatentinfo = projectDueDiligenceService.getProIntelPropertyPatentInfoListByFlowId(flowId).get(0);
TreeMap<String,String> treeMap61=new TreeMap<>();
treeMap61.put("申请公布日",proIntelPropertyPatentinfo.getPublishDate());
treeMap61.put("专利名称",proIntelPropertyPatentinfo.getPatentName());
treeMap61.put("申请号",proIntelPropertyPatentinfo.getApplicationNum());
treeMap61.put("申请公布号",proIntelPropertyPatentinfo.getApplicationPubNum());
treeMap61.put("专利类型",proIntelPropertyPatentinfo.getPatentType());
TreeMap<String, String> treeMap61 = new TreeMap<>();
treeMap61.put("申请公布日", proIntelPropertyPatentinfo.getPublishDate());
treeMap61.put("专利名称", proIntelPropertyPatentinfo.getPatentName());
treeMap61.put("申请号", proIntelPropertyPatentinfo.getApplicationNum());
treeMap61.put("申请公布号", proIntelPropertyPatentinfo.getApplicationPubNum());
treeMap61.put("专利类型", proIntelPropertyPatentinfo.getPatentType());
PdfPTable table61 = returnPdfPTable(treeMap61);
document.add(table61);
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 14, Font.BOLD);
document.add(HeaderAndFooterEvent.AddParagraph("网站备案:", 0, 1.5f));
ProIntelPropertyWebsiteRecord proIntelPropertyWebsiteRecord = projectDueDiligenceService.getProIntelPropertyWebsiteRecordListByFlowId(flowId).get(0);
TreeMap<String,String> treeMap62=new TreeMap<>();
treeMap62.put("审核日期",proIntelPropertyWebsiteRecord.getReviewDate());
treeMap62.put("网站名称",proIntelPropertyWebsiteRecord.getWebsiteName());
treeMap62.put("IP地址",proIntelPropertyWebsiteRecord.getIpAddress());
treeMap62.put("域名信息",proIntelPropertyWebsiteRecord.getDomainNameInfo());
TreeMap<String, String> treeMap62 = new TreeMap<>();
treeMap62.put("审核日期", proIntelPropertyWebsiteRecord.getReviewDate());
treeMap62.put("网站名称", proIntelPropertyWebsiteRecord.getWebsiteName());
treeMap62.put("IP地址", proIntelPropertyWebsiteRecord.getIpAddress());
treeMap62.put("域名信息", proIntelPropertyWebsiteRecord.getDomainNameInfo());
PdfPTable table62 = returnPdfPTable(treeMap62);
document.add(table62);
@ -611,13 +639,13 @@ public class ProjectDueDiligenceController {
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 14, Font.BOLD);
document.add(HeaderAndFooterEvent.AddParagraph("行政处罚:", 0, 1.5f));
ProAdminiPenalty proAdminiPenalty = projectDueDiligenceService.getProAdminiPenaltyListByFlowId(flowId).get(0);
TreeMap<String,String> treeMap7=new TreeMap<>();
treeMap7.put("公司名称",projectPoolName);
treeMap7.put("决定日期",proAdminiPenalty.getDecisionDate());
treeMap7.put("决定书文号",proAdminiPenalty.getWrittenDecisionNum());
treeMap7.put("处罚事由",proAdminiPenalty.getPunishmentCause());
treeMap7.put("处罚结果",proAdminiPenalty.getPunishmentResult());
treeMap7.put("处罚机关",proAdminiPenalty.getPunishmentOrganization());
TreeMap<String, String> treeMap7 = new TreeMap<>();
treeMap7.put("公司名称", projectPoolName);
treeMap7.put("决定日期", proAdminiPenalty.getDecisionDate());
treeMap7.put("决定书文号", proAdminiPenalty.getWrittenDecisionNum());
treeMap7.put("处罚事由", proAdminiPenalty.getPunishmentCause());
treeMap7.put("处罚结果", proAdminiPenalty.getPunishmentResult());
treeMap7.put("处罚机关", proAdminiPenalty.getPunishmentOrganization());
PdfPTable table7 = returnPdfPTable(treeMap7);
document.add(table7);
@ -636,7 +664,7 @@ public class ProjectDueDiligenceController {
PdfPTable table8 = new PdfPTable(4);
table8.setWidthPercentage(100);//设置表格宽度占用百分比
List<String> headList1=new ArrayList<>();
List<String> headList1 = new ArrayList<>();
headList1.add("项目");
headList1.add("2022-12-31");
headList1.add("2021-12-31");
@ -644,12 +672,12 @@ public class ProjectDueDiligenceController {
PdfPTable table8return = setPdfPTableHead(table8, headList1);
for (int i = 0; i < financialIndexDetailList.size(); i++) {
ProFinancialIndexDetail proFinancialIndexDetail = financialIndexDetailList.get(i);
List<String> headList2=new ArrayList<>();
List<String> headList2 = new ArrayList<>();
headList2.add(proFinancialIndexDetail.getName());
headList2.add(proFinancialIndexDetail.getLastYearValue());
headList2.add(proFinancialIndexDetail.getLastTowYearValue());
headList2.add(proFinancialIndexDetail.getLastThreeYearValue());
table8return=setPdfPTableHead(table8return, headList2);
table8return = setPdfPTableHead(table8return, headList2);
}
document.add(table8return);
@ -673,12 +701,12 @@ public class ProjectDueDiligenceController {
PdfPTable table82return = setPdfPTableHead(table82, headList1);
for (int i = 0; i < financialStatementDetailList.size(); i++) {
ProFinancialStatementDetail proFinancialStatementDetail = financialStatementDetailList.get(i);
List<String> headList82=new ArrayList<>();
List<String> headList82 = new ArrayList<>();
headList82.add(proFinancialStatementDetail.getName());
headList82.add(proFinancialStatementDetail.getLastYearValue());
headList82.add(proFinancialStatementDetail.getLastTowYearValue());
headList82.add(proFinancialStatementDetail.getLastThreeYearValue());
table82return=setPdfPTableHead(table82return, headList82);
table82return = setPdfPTableHead(table82return, headList82);
}
document.add(table82return);
@ -704,12 +732,12 @@ public class ProjectDueDiligenceController {
PdfPTable table83return = setPdfPTableHead(table83, headList1);
for (int i = 0; i < financialStatementDetailList83.size(); i++) {
ProFinancialStatementDetail proFinancialStatementDetail = financialStatementDetailList83.get(i);
List<String> headList83=new ArrayList<>();
List<String> headList83 = new ArrayList<>();
headList83.add(proFinancialStatementDetail.getName());
headList83.add(proFinancialStatementDetail.getLastYearValue());
headList83.add(proFinancialStatementDetail.getLastTowYearValue());
headList83.add(proFinancialStatementDetail.getLastThreeYearValue());
table83return=setPdfPTableHead(table83return, headList83);
table83return = setPdfPTableHead(table83return, headList83);
}
document.add(table83return);
@ -735,20 +763,20 @@ public class ProjectDueDiligenceController {
PdfPTable table84return = setPdfPTableHead(table84, headList1);
for (int i = 0; i < financialStatementDetailList84.size(); i++) {
ProFinancialStatementDetail proFinancialStatementDetail = financialStatementDetailList84.get(i);
List<String> headList84=new ArrayList<>();
List<String> headList84 = new ArrayList<>();
headList84.add(proFinancialStatementDetail.getName());
headList84.add(proFinancialStatementDetail.getLastYearValue());
headList84.add(proFinancialStatementDetail.getLastTowYearValue());
headList84.add(proFinancialStatementDetail.getLastThreeYearValue());
table84return=setPdfPTableHead(table84return, headList84);
table84return = setPdfPTableHead(table84return, headList84);
}
document.add(table84return);
document.close();
}
public PdfPTable returnPdfPTable(TreeMap<String,String> treeMap){
PdfPTable table =new PdfPTable(2); //两列
public PdfPTable returnPdfPTable(TreeMap<String, String> treeMap) {
PdfPTable table = new PdfPTable(2); //两列
table.setWidthPercentage(100);//设置表格宽度占用百分比
for (Map.Entry<String, String> entry : treeMap.entrySet()) {
String key = entry.getKey();
@ -767,7 +795,7 @@ public class ProjectDueDiligenceController {
return table;
}
public PdfPTable setPdfPTableHead(PdfPTable table,List<String> list){
public PdfPTable setPdfPTableHead(PdfPTable table, List<String> list) {
for (int i = 0; i < list.size(); i++) {
HeaderAndFooterEvent.SetFont(BaseColor.BLACK, "黑体", 12, Font.NORMAL);
PdfPCell cell_data1 = new PdfPCell(HeaderAndFooterEvent.AddParagraph(list.get(i), 0, 1.5f));

@ -11,6 +11,7 @@ import com.sztzjy.fund_investment.entity.*;
import com.sztzjy.fund_investment.entity.dto.DDMDto;
import com.sztzjy.fund_investment.entity.dto.FCFFFCFEDto;
import com.sztzjy.fund_investment.mapper.FoundProjectMapper;
import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper;
import com.sztzjy.fund_investment.mapper.ProjectPoolMapper;
import com.sztzjy.fund_investment.service.*;
import com.sztzjy.fund_investment.util.ResultEntity;
@ -28,10 +29,8 @@ import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.*;
import java.util.List;
import java.util.TreeMap;
//yz
@RestController
@ -56,6 +55,8 @@ public class ProjectValuationController {
PerformanceScoreService scoreService;
@Autowired
ISysProjectDueDiligenceService projectDueDiligenceService;
@Autowired
PerformanceScoreMapper performanceScoreMapper;
@GetMapping("getPE")
@ApiOperation("相对估值法-PE市盈率法")
@ -166,11 +167,14 @@ public class ProjectValuationController {
if (StringUtils.isBlank(foundProject.getFlowId())) {
return new ResultEntity(HttpStatus.BAD_REQUEST, "流程ID为空");
}
if (StringUtils.isBlank(foundProject.getProjectValuationRelative())) {
if (StringUtils.isBlank(foundProject.getProjectValuationAbsolute())) {
return new ResultEntity(HttpStatus.BAD_REQUEST, "绝对估值结论为空");
}
projectDueDiligenceService.updateServiceDueDiligence(foundProject);
scoreService.calculateScoreByModule("projectValuationRelativeScore",2,foundProject.getFlowId());
PerformanceScore performanceScore = scoreService.getByFlowId(foundProject.getFlowId());
performanceScore.setProjectValuationTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity(HttpStatus.OK, "绝对估值结论保存成功");
}

@ -15,7 +15,6 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@ -54,7 +53,7 @@ public class TopicController {
@AnonymousAccess
public ResultEntity<Integer> getRandomTopic(@ApiParam("导入的文件") @RequestParam MultipartFile file,
@ApiParam("学校ID") @RequestParam String schoolId,
@ApiParam("知识测评题库,项目尽调题库,项目估值题库,IPO上市板块题目,IPO上市条件题目") @RequestParam String module) {
@ApiParam("知识测评题库,项目尽调题库,项目估值题库,上市板块相关题库,上市条件相关题库") @RequestParam String module) {
return new ResultEntity<Integer>(topicService.importFile(file, schoolId, module));
}
@ -111,7 +110,7 @@ public class TopicController {
/*
* @author xcj
* @Date 2023/11/21
* @Date 2023/11/21``
*/
@GetMapping("getAllScore")
@ApiOperation("页面回显得分通用接口")
@ -124,13 +123,13 @@ public class TopicController {
}
@GetMapping("getIPOTopicOne")
@ApiOperation("IPO弹窗1")
@AnonymousAccess
public ResultEntity<TopicsWithBLOBs> getIPOTopicOne() {
TopicsWithBLOBs topics = topicsMapper.selectByPrimaryKey(Constant.NINE);
return new ResultEntity<TopicsWithBLOBs>(topics);
}
// @GetMapping("getIPOTopicOne")
// @ApiOperation("IPO弹窗1")
// @AnonymousAccess
// public ResultEntity<TopicsWithBLOBs> getIPOTopicOne() {
// TopicsWithBLOBs topics = topicsMapper.selectByPrimaryKey(Constant.NINE);
// return new ResultEntity<TopicsWithBLOBs>(topics);
// }
@AnonymousAccess

@ -78,7 +78,7 @@ public class ClassScoreController {
@AnonymousAccess
@GetMapping("/importExcel")
@ApiOperation("成绩管理/导出")
@ApiOperation("成绩管理/导出") //目前只导出提交了报告的学生的数据
public void importExcel(HttpServletResponse response, @RequestParam String schoolId) {
classScoreService.importExcel(response, schoolId);
}
@ -167,15 +167,9 @@ public class ClassScoreController {
@AnonymousAccess
@GetMapping("/getClassNameBySchoolId")
@ApiOperation("成绩管理&互动答疑/班级下拉框")
public ResultEntity<List<String>> getClassNameBySchoolId(@RequestParam String schoolId) {
UserExample userTableExample = new UserExample();
userTableExample.createCriteria().andSchoolIdEqualTo(schoolId);
List<User> userTables = userMapper.selectByExample(userTableExample);
List<String> list = new ArrayList<>();
for (User userTable : userTables) {
list.add(userTable.getClassName());
}
return new ResultEntity<List<String>>(list);
public ResultEntity<List<Map<String,String>>> getClassNameBySchoolId(@RequestParam String schoolId) {
List<Map<String,String>> nameAndId = userMapper.selectClassNameBySchoolId(schoolId);
return new ResultEntity<>(nameAndId);
}

@ -1,5 +1,6 @@
package com.sztzjy.fund_investment.controller.tea;
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageInfo;
import com.sztzjy.fund_investment.annotation.AnonymousAccess;
import com.sztzjy.fund_investment.entity.QuestionAnswerWithBLOBs;
@ -17,6 +18,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import java.sql.Timestamp;
import java.util.Date;
import java.util.List;
/**
* @Author xcj
* @Date 2023/12/1
@ -48,10 +53,10 @@ public class TeaTopicManageController {
@GetMapping("/getTopicsBySchoolId")
@ApiOperation("试题管理/页面搜索展示")
public ResultEntity<PageInfo<TopicsWithBLOBs>> getTopicsBySchoolId(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam String schoolId,
@ApiParam("module值同导入功能模块") @RequestParam String module,
@ApiParam("搜索框/题干") @RequestParam(required = false) String topicContent) {
@RequestParam Integer size,
@RequestParam String schoolId,
@ApiParam("module值同导入功能模块") @RequestParam String module,
@ApiParam("搜索框/题干") @RequestParam(required = false) String topicContent) {
return new ResultEntity<PageInfo<TopicsWithBLOBs>>(teaTopicManageService.getTopicsBySchoolId(index, size, schoolId, module, topicContent));
}
@ -82,9 +87,9 @@ public class TeaTopicManageController {
public ResultEntity<PageInfo<QuestionAnswerDto>> getQuestionAnswer(@RequestParam Integer index,
@RequestParam Integer size,
@RequestParam String schoolId,
@ApiParam("班级下拉框") @RequestParam(required = false) String className,
@ApiParam("班级下拉框") @RequestParam(required = false) String classId,
@ApiParam("姓名/学号") @RequestParam(required = false) String keyWord) {
return new ResultEntity<>(teaTopicManageService.getQuestionAnswer(index, size, schoolId, className, keyWord));
return new ResultEntity<>(teaTopicManageService.getQuestionAnswer(index, size, schoolId, classId, keyWord));
}
@AnonymousAccess
@ -97,16 +102,30 @@ public class TeaTopicManageController {
return new ResultEntity(HttpStatus.BAD_REQUEST, "请输入回复内容!");
}
questionAnswerWithBLOBs.setReplyContent(content);
questionAnswerMapper.updateByPrimaryKey(questionAnswerWithBLOBs);
questionAnswerMapper.updateByPrimaryKeyWithBLOBs(questionAnswerWithBLOBs);
return new ResultEntity(HttpStatus.OK, "回复成功!");
}
@AnonymousAccess
@GetMapping("/getQuestionById")
@ApiOperation("互动答疑/获取单互动数据")
@ApiOperation("互动答疑/获取单互动数据")
public ResultEntity<QuestionAnswerWithBLOBs> getQuestionById(@ApiParam("展示接口中的id字段") @RequestParam String questionId) {
return new ResultEntity<QuestionAnswerWithBLOBs>(questionAnswerMapper.selectByPrimaryKey(questionId));
}
@AnonymousAccess
@PostMapping("/addQuestion")
@ApiOperation("互动答疑/学生提问")
public ResultEntity<String> getQuestionById(@ApiParam("传flowId,提问内容,学校ID") @RequestBody QuestionAnswerWithBLOBs questionAnswerWithBLOBs) {
questionAnswerWithBLOBs.setId(IdUtil.simpleUUID());
questionAnswerWithBLOBs.setQuestionTime(new Date());
try {
questionAnswerMapper.insert(questionAnswerWithBLOBs);
}catch (Exception e){
return new ResultEntity<>(HttpStatus.BAD_REQUEST,"提问失败,数据缺失!");
}
return new ResultEntity<>(HttpStatus.OK,"提问成功!");
}
}

@ -45,6 +45,9 @@ public class ProFinancialIndexDetailUser {
this.lastThreeYearValue=proFinancialIndexDetail.getLastThreeYearValue();
}
public ProFinancialIndexDetailUser() {
}
public String getId() {
return id;
}

@ -2,7 +2,6 @@ package com.sztzjy.fund_investment.entity;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
public class QuestionAnswerExample {
@ -106,32 +105,6 @@ public class QuestionAnswerExample {
criteria.add(new Criterion(condition, value1, value2));
}
protected void addCriterionForJDBCDate(String condition, Date value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value.getTime()), property);
}
protected void addCriterionForJDBCDate(String condition, List<Date> values, String property) {
if (values == null || values.size() == 0) {
throw new RuntimeException("Value list for " + property + " cannot be null or empty");
}
List<java.sql.Date> dateList = new ArrayList<>();
Iterator<Date> iter = values.iterator();
while (iter.hasNext()) {
dateList.add(new java.sql.Date(iter.next().getTime()));
}
addCriterion(condition, dateList, property);
}
protected void addCriterionForJDBCDate(String condition, Date value1, Date value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
addCriterion(condition, new java.sql.Date(value1.getTime()), new java.sql.Date(value2.getTime()), property);
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
@ -353,52 +326,52 @@ public class QuestionAnswerExample {
}
public Criteria andQuestionTimeEqualTo(Date value) {
addCriterionForJDBCDate("question_time =", value, "questionTime");
addCriterion("question_time =", value, "questionTime");
return (Criteria) this;
}
public Criteria andQuestionTimeNotEqualTo(Date value) {
addCriterionForJDBCDate("question_time <>", value, "questionTime");
addCriterion("question_time <>", value, "questionTime");
return (Criteria) this;
}
public Criteria andQuestionTimeGreaterThan(Date value) {
addCriterionForJDBCDate("question_time >", value, "questionTime");
addCriterion("question_time >", value, "questionTime");
return (Criteria) this;
}
public Criteria andQuestionTimeGreaterThanOrEqualTo(Date value) {
addCriterionForJDBCDate("question_time >=", value, "questionTime");
addCriterion("question_time >=", value, "questionTime");
return (Criteria) this;
}
public Criteria andQuestionTimeLessThan(Date value) {
addCriterionForJDBCDate("question_time <", value, "questionTime");
addCriterion("question_time <", value, "questionTime");
return (Criteria) this;
}
public Criteria andQuestionTimeLessThanOrEqualTo(Date value) {
addCriterionForJDBCDate("question_time <=", value, "questionTime");
addCriterion("question_time <=", value, "questionTime");
return (Criteria) this;
}
public Criteria andQuestionTimeIn(List<Date> values) {
addCriterionForJDBCDate("question_time in", values, "questionTime");
addCriterion("question_time in", values, "questionTime");
return (Criteria) this;
}
public Criteria andQuestionTimeNotIn(List<Date> values) {
addCriterionForJDBCDate("question_time not in", values, "questionTime");
addCriterion("question_time not in", values, "questionTime");
return (Criteria) this;
}
public Criteria andQuestionTimeBetween(Date value1, Date value2) {
addCriterionForJDBCDate("question_time between", value1, value2, "questionTime");
addCriterion("question_time between", value1, value2, "questionTime");
return (Criteria) this;
}
public Criteria andQuestionTimeNotBetween(Date value1, Date value2) {
addCriterionForJDBCDate("question_time not between", value1, value2, "questionTime");
addCriterion("question_time not between", value1, value2, "questionTime");
return (Criteria) this;
}
}

@ -7,7 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
* topic_record
*/
public class TopicRecord {
private String id;
private Integer id;
@ApiModelProperty("题目ID")
private String topicId;
@ -41,12 +41,12 @@ public class TopicRecord {
@ApiModelProperty("正确答案")
private String answer;
public String getId() {
public Integer getId() {
return id;
}
public void setId(String id) {
this.id = id == null ? null : id.trim();
public void setId(Integer id) {
this.id = id;
}
public String getTopicId() {

@ -114,62 +114,52 @@ public class TopicRecordExample {
return (Criteria) this;
}
public Criteria andIdEqualTo(String value) {
public Criteria andIdEqualTo(Integer value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(String value) {
public Criteria andIdNotEqualTo(Integer value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(String value) {
public Criteria andIdGreaterThan(Integer value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(String value) {
public Criteria andIdGreaterThanOrEqualTo(Integer value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(String value) {
public Criteria andIdLessThan(Integer value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(String value) {
public Criteria andIdLessThanOrEqualTo(Integer value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdLike(String value) {
addCriterion("id like", value, "id");
return (Criteria) this;
}
public Criteria andIdNotLike(String value) {
addCriterion("id not like", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<String> values) {
public Criteria andIdIn(List<Integer> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<String> values) {
public Criteria andIdNotIn(List<Integer> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(String value1, String value2) {
public Criteria andIdBetween(Integer value1, Integer value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(String value1, String value2) {
public Criteria andIdNotBetween(Integer value1, Integer value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}

@ -50,5 +50,5 @@ public class ClassAVGScoreVo {
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
@ApiModelProperty("最早得分日期")
private Date startTime;
private List<Date> startTime;
}

@ -1,7 +1,9 @@
package com.sztzjy.fund_investment.entity.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@ -20,6 +22,7 @@ public class QuestionAnswerDto {
@ApiModelProperty("学校ID")
private String schoolid;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
@ApiModelProperty("提问时间")
private Date questionTime;

@ -6,6 +6,8 @@ import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface PerformanceScoreMapper {
long countByExample(PerformanceScoreExample example);
@ -29,4 +31,7 @@ public interface PerformanceScoreMapper {
int updateByPrimaryKeySelective(PerformanceScore record);
int updateByPrimaryKey(PerformanceScore record);
@Select("select class_id from performance_score group By class_id")
List<String> selectClassId();
}

@ -12,7 +12,7 @@ public interface TopicRecordMapper {
int deleteByExample(TopicRecordExample example);
int deleteByPrimaryKey(String id);
int deleteByPrimaryKey(Integer id);
int insert(TopicRecord record);
@ -20,7 +20,7 @@ public interface TopicRecordMapper {
List<TopicRecord> selectByExample(TopicRecordExample example);
TopicRecord selectByPrimaryKey(String id);
TopicRecord selectByPrimaryKey(Integer id);
int updateByExampleSelective(@Param("record") TopicRecord record, @Param("example") TopicRecordExample example);

@ -3,9 +3,12 @@ package com.sztzjy.fund_investment.mapper;
import com.sztzjy.fund_investment.entity.User;
import com.sztzjy.fund_investment.entity.UserExample;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
@Mapper
public interface UserMapper {
long countByExample(UserExample example);
@ -29,4 +32,7 @@ public interface UserMapper {
int updateByPrimaryKeySelective(User record);
int updateByPrimaryKey(User record);
@Select("select distinct(class_id),class_name from wx_user where school_id = #{schoolId}")
List<Map<String,String>> selectClassNameBySchoolId(@Param("schoolId") String schoolId);
}

@ -2,10 +2,13 @@ package com.sztzjy.fund_investment.service.serviceImpl;
import cn.hutool.core.util.IdUtil;
import com.sztzjy.fund_investment.config.Constant;
import com.sztzjy.fund_investment.entity.PerformanceScore;
import com.sztzjy.fund_investment.entity.TrainingReport;
import com.sztzjy.fund_investment.entity.TrainingReportExample;
import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper;
import com.sztzjy.fund_investment.mapper.TrainingReportMapper;
import com.sztzjy.fund_investment.service.InvestmentReportService;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
import com.sztzjy.fund_investment.util.ResultEntity;
import com.sztzjy.fund_investment.util.file.IFileUtil;
import org.apache.commons.lang3.StringUtils;
@ -27,8 +30,11 @@ public class InvestmentReportServiceImpl implements InvestmentReportService {
@Autowired
private IFileUtil fileUtil;
@Autowired
TrainingReportMapper trainingReportMapper;
private TrainingReportMapper trainingReportMapper;
@Autowired
private PerformanceScoreService performanceScoreService;
@Autowired
private PerformanceScoreMapper performanceScoreMapper;
/**
*
@ -58,6 +64,10 @@ public class InvestmentReportServiceImpl implements InvestmentReportService {
trainingReport.setUploadtime(new Date());
trainingReport.setStep(Constant.TZBG);
trainingReportMapper.updateByPrimaryKeySelective(trainingReport);
//记录时间
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
performanceScore.setInvestmentReportTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity<>(HttpStatus.OK, "报告上传成功!");
}
} else { //没上传报告没提交心得的情况
@ -70,6 +80,10 @@ public class InvestmentReportServiceImpl implements InvestmentReportService {
trainingReport.setUploadtime(new Date());
trainingReport.setStep(Constant.TZBG);
trainingReportMapper.insert(trainingReport);
//记录时间
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
performanceScore.setInvestmentReportTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity<>(HttpStatus.OK, "报告上传成功!");
}
}

@ -28,9 +28,13 @@ public class PerformanceScoreServiceImpl implements PerformanceScoreService {
public void calculateScoreByModule(String methodName, Integer score, String flowId) {
PerformanceScore performanceScore = getByFlowId(flowId);
Object o = performanceScore.get(methodName);
if (o==null){
if (o == null) {
performanceScore.set(methodName, BigDecimal.valueOf(score));
performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score)));
if (performanceScore.getTotalScore()== null) {
performanceScore.setTotalScore(BigDecimal.valueOf(score));
} else {
performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score)));
}
performanceScoreMapper.updateByPrimaryKey(performanceScore);
}
}
@ -39,13 +43,13 @@ public class PerformanceScoreServiceImpl implements PerformanceScoreService {
public void calculateScoreByModule2(String methodName, Integer score, String flowId) {
PerformanceScore performanceScore = getByFlowId(flowId);
Object o = performanceScore.get(methodName);
if(o==null){
if (o == null) {
performanceScore.set(methodName, BigDecimal.valueOf(score));
performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score)));
performanceScoreMapper.updateByPrimaryKey(performanceScore);
}else {
BigDecimal bigDecimal=(BigDecimal) performanceScore.get(methodName);
if(bigDecimal.compareTo(BigDecimal.valueOf(score))<0){
} else {
BigDecimal bigDecimal = (BigDecimal) performanceScore.get(methodName);
if (bigDecimal.compareTo(BigDecimal.valueOf(score)) < 0) {
performanceScore.set(methodName, BigDecimal.valueOf(score));
performanceScore.setTotalScore(performanceScore.getTotalScore().add(BigDecimal.valueOf(score)).subtract(bigDecimal));
performanceScoreMapper.updateByPrimaryKey(performanceScore);

@ -1,10 +1,8 @@
package com.sztzjy.fund_investment.service.serviceImpl;
import com.sztzjy.fund_investment.entity.ExitTime;
import com.sztzjy.fund_investment.entity.Fundraising;
import com.sztzjy.fund_investment.entity.ProfitDistribution;
import com.sztzjy.fund_investment.entity.ProfitDistributionExample;
import com.sztzjy.fund_investment.entity.*;
import com.sztzjy.fund_investment.mapper.ExitTimeMapper;
import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper;
import com.sztzjy.fund_investment.mapper.ProfitDistributionMapper;
import com.sztzjy.fund_investment.service.ISysFundraisingService;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
@ -16,6 +14,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
/**
@ -32,8 +31,8 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
private ExitTimeMapper exitTimeMapper;
@Autowired
private PerformanceScoreService performanceScoreService;
@Autowired
private PerformanceScoreMapper performanceScoreMapper;
/*
* @author xcj
* @Date 2023/12/11
@ -231,6 +230,10 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
twoRightOwnFunds.compareTo(userRemainingOwnFunds) == 0 && twoRightFundraisingAmount.compareTo(userRemainingEarningsPreferredLp) == 0) {
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
performanceScore.setProfitDistributionTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
} else if (type == 2) { //2:自有资金/优先级LP/劣后级LP
if (profitDistribution.getUserRemainingEarningsSubordinatedLp() == null || profitDistribution.getUserRoundSubordinatedLp() == null) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请填写劣后级LP分配金额");
@ -303,6 +306,10 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
userRoundSubordinatedLp.compareTo(subordinatedLp) == 0 && userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) {
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
performanceScore.setProfitDistributionTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
} else if (type == 3) { //3:银行借款/自有资金/优先级LP
if (profitDistribution.getUserRoundBankLoan() == null) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请填写银行借款分配金额!");
@ -372,6 +379,10 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
rightBankLoan.compareTo(userRoundBankLoan) == 0) {
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
performanceScore.setProfitDistributionTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
} else { //4:银行借款/优先级LP/劣后级LP/自有资金
if (profitDistribution.getUserRemainingEarningsSubordinatedLp() == null || profitDistribution.getUserRoundSubordinatedLp() == null) {
return new ResultEntity<>(HttpStatus.BAD_REQUEST, "请填写劣后级LP分配金额");
@ -470,8 +481,11 @@ public class ProfitDistributionServiceImpl implements ProfitDistributionService
userRemainingEarningsSubordinatedLp.compareTo(twoRightSubordinatedLp) == 0) {
performanceScoreService.calculateScoreByModule("profitDistributionScore", 4, flowId);
}
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
performanceScore.setProfitDistributionTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return new ResultEntity<>(HttpStatus.OK, "分配完成!");
}
return null;
}

@ -1,9 +1,11 @@
package com.sztzjy.fund_investment.service.serviceImpl;
import com.sztzjy.fund_investment.entity.ExitTime;
import com.sztzjy.fund_investment.entity.PerformanceScore;
import com.sztzjy.fund_investment.entity.ProfitManagement;
import com.sztzjy.fund_investment.entity.ProfitManagementExample;
import com.sztzjy.fund_investment.mapper.ExitTimeMapper;
import com.sztzjy.fund_investment.mapper.PerformanceScoreMapper;
import com.sztzjy.fund_investment.mapper.ProfitManagementMapper;
import com.sztzjy.fund_investment.service.PerformanceScoreService;
import com.sztzjy.fund_investment.service.ProfitManagementService;
@ -14,6 +16,7 @@ import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
/**
@ -28,7 +31,8 @@ public class ProfitManagementServiceImpl implements ProfitManagementService {
private PerformanceScoreService performanceScoreService;
@Autowired
private ExitTimeMapper exitTimeMapper;
@Autowired
private PerformanceScoreMapper performanceScoreMapper;
/* 线
* @author xcj
@ -95,6 +99,9 @@ public class ProfitManagementServiceImpl implements ProfitManagementService {
} else {
ExitTime exitTime = new ExitTime();
List<ProfitManagement> profitManagementList = getLineChart(flowId);
if (profitManagementList.isEmpty()){
return null;
}
ProfitManagement profitManagement = profitManagementList.get(0);
exitTime.setFlowId(flowId);
exitTime.setProjectName(profitManagement.getProjectName());
@ -142,6 +149,10 @@ public class ProfitManagementServiceImpl implements ProfitManagementService {
} else {
performanceScoreService.calculateScoreByModule("profitManagementMarketValueExitScore", 3, flowId);
}
//标记页面完成时间
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
performanceScore.setProfitManagementTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
return null;
}
}

@ -251,14 +251,17 @@ public class SysProjectDueDiligenceServiceImpl implements ISysProjectDueDiligenc
criteria.andFlowIdEqualTo(flowId);
List<ProFinancialIndexDetailUser> indexDetailUsers = proFinancialIndexDetailUserMapper.selectByExample(example);
List<ProFinancialIndexDetail> list = pageInfo.getList();
for (int j = 0; j < list.size(); j++) {
list.get(j).setLastYearValue("0");
if (indexDetailUsers.isEmpty()) {
continue;
if(indexDetailUsers.isEmpty()){
for (int i = 0; i < list.size(); i++) {
list.get(i).setLastYearValue("0");
}
for (int i = 0; i < indexDetailUsers.size(); i++) {
if (list.get(j).getFinancialIndexId().equals(indexDetailUsers.get(i))) {
list.get(j).setLastYearValue(indexDetailUsers.get(i).getLastYearValue());
}else {
for (int j = 0; j < list.size(); j++) {
for (int i = 0; i < indexDetailUsers.size(); i++) {
if (list.get(j).getFinancialIndexId().equals(indexDetailUsers.get(i).getFinancialIndexId())) {
list.get(j).setLastYearValue(indexDetailUsers.get(i).getLastYearValue());
}
}
}
}

@ -132,7 +132,7 @@ public class SysProjectValuationServiceImpl implements ISysProjectValuationServi
BigDecimal marketPrice = valuation.getMarketPrice(); //对比公司 每股市价
BigDecimal netWorth = valuation.getNetWorth();//对比公司 每股净资产
BigDecimal netInterest = valuation.getNetInterest();//对比公司 权益净利率
flag = flag.add(marketPrice.divide(netWorth).divide(netInterest));
flag = flag.add(marketPrice.divide(netWorth,2,BigDecimal.ROUND_HALF_UP).divide(netInterest,2,BigDecimal.ROUND_HALF_UP));
}
BigDecimal avg = flag.divide(BigDecimal.valueOf(3)); //平均数
BigDecimal answer = avg.multiply(netWorth1).multiply(netInterest1).setScale(2,BigDecimal.ROUND_HALF_UP);

@ -154,7 +154,6 @@ public class TopicServiceImpl implements TopicService {
return new ResultEntity<List<String>>(HttpStatus.BAD_REQUEST, "请勿重复提交!");
}
int score = 0;
List<String> list = new ArrayList<>();
String module = "";
for (TopicsWithBLOBs topic : topics) {
String userAnswer = topic.getUserAnswer();
@ -195,8 +194,6 @@ public class TopicServiceImpl implements TopicService {
}
//添加到答题记录表
TopicRecord topicRecord = new TopicRecord();
String recordId = IdUtil.simpleUUID();
topicRecord.setId(recordId);
topicRecord.setTopicId(topicId);
topicRecord.setUserAnswer(userAnswer);
topicRecord.setAnswer(rightAnswer);
@ -213,7 +210,6 @@ public class TopicServiceImpl implements TopicService {
topicRecord.setModule(module);
topicRecord.setTopicType(topicType);
topicRecordMapper.insert(topicRecord);
list.add(recordId);
}
PerformanceScore performanceScore = performanceScoreService.getByFlowId(flowId);
@ -223,10 +219,10 @@ public class TopicServiceImpl implements TopicService {
}
// 调用计分方法
if (module.equals(Constant.ZSCETK)) {
performanceScoreService.calculateScoreByModule("knowledgeAssessmentScore", score, flowId);
//标记完成时间
performanceScore.setKnowledgeAssessmentTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
performanceScoreService.calculateScoreByModule("knowledgeAssessmentScore", score, flowId);
}
if (module.equals(Constant.XMJDTK)) {
performanceScoreService.calculateScoreByModule("projectDueDiligenceScore", score, flowId);
@ -235,12 +231,16 @@ public class TopicServiceImpl implements TopicService {
performanceScoreService.calculateScoreByModule("projectValuationScore", score, flowId);
}
if (module.equals(Constant.IPOBK)) {
performanceScore.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
performanceScoreService.calculateScoreByModule("ipoListedSectorScore", score, flowId);
}
if (module.equals(Constant.IPOTJ)) {
performanceScore.setIpoTime(new Date());
performanceScoreMapper.updateByPrimaryKey(performanceScore);
performanceScoreService.calculateScoreByModule("ipoListedConditionScore", score, flowId);
}
return new ResultEntity<>(list);
return new ResultEntity<>(HttpStatus.OK,"提交成功!");
}
@ -314,7 +314,9 @@ public class TopicServiceImpl implements TopicService {
public List<TopicRecord> getTopicRecord(String flowId, String module) {
TopicRecordExample example = new TopicRecordExample();
example.createCriteria().andModuleEqualTo(module).andFlowIdEqualTo(flowId);
return topicRecordMapper.selectByExample(example);
example.setOrderByClause("id");
List<TopicRecord> list = topicRecordMapper.selectByExample(example);
return list;
}
@ -329,7 +331,6 @@ public class TopicServiceImpl implements TopicService {
if (!(IPOBKList.isEmpty()) || !(IPOTJList.isEmpty())) {
return null;
}
int topicCountPerModule = 3;
TopicQuery topicQuery = new TopicQuery();
topicQuery.setCount(3);
topicQuery.setModule(Constant.IPOBK);

@ -65,20 +65,21 @@ public class ClassScoreServiceImpl implements ClassScoreService {
if (list.isEmpty()) {
continue;
}
TeaClassScore teaClassScore = list.get(0);
vo.setStartTime(teaClassScore.getStartTime());
List<BigDecimal> scoreList = new ArrayList();
List<Date> dateList = new ArrayList<>();
for (TeaClassScore classScore : list) {
scoreList.add(classScore.getClassAverageScore());
dateList.add(classScore.getStartTime());
}
vo.setClassAverageScore(scoreList);
vo.setStartTime(dateList);
voList.add(vo);
}
return voList;
}
/*
/*
* @author xcj
* @Date 2023/11/24
*/
@ -95,7 +96,7 @@ public class ClassScoreServiceImpl implements ClassScoreService {
int schoolGeneralCount = 0;
int schoolFailCount = 0;
BigDecimal maxScoreBySchoolId = BigDecimal.ZERO;
BigDecimal minScoreBySchoolId = null;
BigDecimal minScoreBySchoolId = BigDecimal.ZERO;
BigDecimal avgScoreBySchoolId = BigDecimal.ZERO;
for (TeaClassScore teaClassScore : teaClassScores) {
schoolExcellentCount = schoolExcellentCount + teaClassScore.getExcellentCount();
@ -104,13 +105,19 @@ public class ClassScoreServiceImpl implements ClassScoreService {
schoolFailCount = schoolFailCount + teaClassScore.getFailCount();
BigDecimal maxScore = teaClassScore.getClassMaxScore();
if (maxScore == null) {
maxScore = BigDecimal.ZERO;
}
BigDecimal minScore = teaClassScore.getClassMinScore();
if (minScore == null) {
minScore = BigDecimal.ZERO;
}
// 计算最高分
if (maxScore.compareTo(maxScoreBySchoolId) >= 0) {
maxScoreBySchoolId = maxScore;
}
// 计算最低分
if (minScoreBySchoolId == null || minScore.compareTo(minScoreBySchoolId) <= 0) {
if (minScoreBySchoolId.compareTo(BigDecimal.ZERO) == 0 || minScore.compareTo(minScoreBySchoolId) <= 0) {
minScoreBySchoolId = minScore;
}
//所有班级平均分累加
@ -146,6 +153,7 @@ public class ClassScoreServiceImpl implements ClassScoreService {
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 {
@ -171,11 +179,12 @@ public class ClassScoreServiceImpl implements ClassScoreService {
List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
if (!performanceScores.isEmpty()) {
PerformanceScore performanceScore = performanceScores.get(0);
if (!trainingReports.isEmpty()) {
for (TrainingReport trainingReport : trainingReports) {
userDto.setReportId(trainingReport.getId());
userDto.setReportName(trainingReport.getReportName());
}
if (trainingReports.isEmpty()) {
continue;
}
for (TrainingReport trainingReport : trainingReports) {
userDto.setReportId(trainingReport.getId());
userDto.setReportName(trainingReport.getReportName());
}
userDto.setFlowId(flowId);
userDto.setScore(performanceScore.getTotalScore());
@ -198,7 +207,7 @@ public class ClassScoreServiceImpl implements ClassScoreService {
@Override
public void importExcel(HttpServletResponse response, String schoolId) {
UserExample userTableExample = new UserExample();
userTableExample.createCriteria().andSchoolIdEqualTo(schoolId);
userTableExample.createCriteria().andSchoolIdEqualTo(schoolId).andRoleIdEqualTo(4);
List<User> userTables = userMapper.selectByExample(userTableExample);
List<UserDto> userDtoList = new ArrayList<>();
for (User userTable : userTables) {
@ -252,16 +261,45 @@ public class ClassScoreServiceImpl implements ClassScoreService {
PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
performanceScoreExample.createCriteria().andSchoolIdEqualTo(schoolId);
List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
List<String> list = new ArrayList();
if (!performanceScores.isEmpty()) {
for (PerformanceScore performanceScore : performanceScores) {
String flowId = performanceScore.getFlowId();
list.add(flowId);
FoundProject foundProject = foundProjectMapper.selectByPrimaryKey(flowId);
String foundProjectConclusion = foundProject.getFoundProjectConclusion(); // 寻找项目结论
String serviceDueDiligence = foundProject.getServiceDueDiligence(); // 业务尽调结论
String financialDueDiligence = foundProject.getFinancialDueDiligence(); //财务尽调结论
String projectValuationRelative = foundProject.getProjectValuationRelative();//相对估值结论得分
String projectValuationAbsolute = foundProject.getProjectValuationAbsolute();//绝对估值结论得分
if (foundProject == null) {
continue;
}
String serviceDueDiligence = "";
String financialDueDiligence = "";
String projectValuationRelative = "";
String projectValuationAbsolute = "";
String foundProjectConclusion = "";
if (foundProject.getFoundProjectConclusion() == null) {
performanceScoreService.calculateScoreByModule("projectSearchReportScore", 0, flowId);
} else {
foundProjectConclusion = foundProject.getFoundProjectConclusion(); // 寻找项目结论
}
if (foundProject.getServiceDueDiligence() == null) {
performanceScoreService.calculateScoreByModule("projectDueDiligenceBusinessReportScore", 0, flowId);
} else {
serviceDueDiligence = foundProject.getServiceDueDiligence(); // 业务尽调结论
}
if (foundProject.getFinancialDueDiligence() == null) {
performanceScoreService.calculateScoreByModule("projectDueDiligenceFinanceReportScore", 0, flowId);
} else {
financialDueDiligence = foundProject.getFinancialDueDiligence(); //财务尽调结论
}
if (foundProject.getProjectValuationRelative() == null) {
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 0, flowId);
} else {
projectValuationRelative = foundProject.getProjectValuationRelative();//相对估值结论得分
}
if (foundProject.getProjectValuationAbsolute() == null) {
performanceScoreService.calculateScoreByModule("projectValuationAbsoluteScore", 0, flowId);
} 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]", "");
@ -277,21 +315,18 @@ public class ClassScoreServiceImpl implements ClassScoreService {
//未超过30结论报告是必填项到这里就给1分没有0
performanceScoreService.calculateScoreByModule("projectSearchReportScore", 1, flowId);
}
// 业务尽调结论
if (serviceDueDiligence.length() >= 30) {
performanceScoreService.calculateScoreByModule("projectDueDiligenceBusinessReportScore", 2, flowId);
} else {
performanceScoreService.calculateScoreByModule("projectDueDiligenceBusinessReportScore", 1, flowId);
}
//财务尽调结论
if (financialDueDiligence.length() >= 30) {
performanceScoreService.calculateScoreByModule("projectDueDiligenceFinanceReportScore", 2, flowId);
} else {
performanceScoreService.calculateScoreByModule("projectDueDiligenceFinanceReportScore", 1, flowId);
}
//项目相对估值结论
if (projectValuationRelative.length() >= 30) {
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 2, flowId);
@ -304,38 +339,46 @@ public class ClassScoreServiceImpl implements ClassScoreService {
} else {
performanceScoreService.calculateScoreByModule("projectValuationAbsoluteScore", 1, flowId);
}
}
for (String flowIdByList : list) {
TrainingReportExample trainingReportExample = new TrainingReportExample();
trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowId);
trainingReportExample.createCriteria().andSchoolIdEqualTo(schoolId).andFlowIdEqualTo(flowIdByList);
List<TrainingReport> trainingReports = trainingReportMapper.selectByExample(trainingReportExample);
if (!trainingReports.isEmpty()) {
TrainingReport trainingReport = trainingReports.get(0);
String experience = trainingReport.getExperience();
String url = trainingReport.getUrl();
String reportName = trainingReport.getReportName();
experience = experience.replaceAll("[^a-zA-Z0-9]", "");
url = url.replaceAll("[^a-zA-Z0-9]", "");
reportName = reportName.replaceAll("[^a-zA-Z0-9]", "");
//实训心得
if (experience.length() < 100) {
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 1, flowId); //todo 需要修改
trainingReport.setExperienceScore(BigDecimal.ONE);
}
if (experience.length() >= 100 && experience.length() < 300) {
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 2, flowId);//todo 需要修改
trainingReport.setExperienceScore(BigDecimal.valueOf(2));
}
if (experience.length() >= 300) {
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 3, flowId);//todo 需要修改
trainingReport.setExperienceScore(BigDecimal.valueOf(3));
}
//实验报告,未上传 0 分 上传得两分
if (!(url.isEmpty()) && !(reportName.isEmpty())) {
performanceScoreService.calculateScoreByModule("investmentReportScore", 2, flowId);//todo 需要修改
trainingReport.setReportScore(BigDecimal.valueOf(2));
}
trainingReportMapper.updateByPrimaryKey(trainingReport);
if (trainingReports.isEmpty()) {
continue;
}
String experience = "";
TrainingReport trainingReport = trainingReports.get(0);
if (trainingReport.getExperience() == null) {
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 0, flowIdByList);
trainingReport.setExperienceScore(BigDecimal.ZERO);
} else {
experience = trainingReport.getExperience();
}
//实训心得
if (experience.length() < 100) {
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 1, flowIdByList);
trainingReport.setExperienceScore(BigDecimal.ONE);
}
if (experience.length() >= 100 && experience.length() < 300) {
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 2, flowIdByList);
trainingReport.setExperienceScore(BigDecimal.valueOf(2));
}
if (experience.length() >= 300) {
performanceScoreService.calculateScoreByModule("projectValuationRelativeScore", 3, flowIdByList);
trainingReport.setExperienceScore(BigDecimal.valueOf(3));
}
//实验报告,未上传 0 分 上传得两分
if (trainingReport.getUrl() == null && trainingReport.getReportName() == null) {
performanceScoreService.calculateScoreByModule("investmentReportScore", 0, flowIdByList);//todo 需要修改
trainingReport.setReportScore(BigDecimal.ZERO);
}
if (!(trainingReport.getUrl().isEmpty()) && !(trainingReport.getReportName().isEmpty())) {
performanceScoreService.calculateScoreByModule("investmentReportScore", 2, flowIdByList);//todo 需要修改
trainingReport.setReportScore(BigDecimal.valueOf(2));
}
trainingReportMapper.updateByPrimaryKey(trainingReport);
}
return new ResultEntity<>(HttpStatus.OK);
}
@ -438,10 +481,7 @@ public class ClassScoreServiceImpl implements ClassScoreService {
}
/*
* @author xcj
* @Date 2023/11/29
*/
// 实训成绩
@Override
public PerformanceTrainingScoreDto getStuTrainingScore(String flowId) {
PerformanceScoreExample example = new PerformanceScoreExample();
@ -453,43 +493,61 @@ public class ClassScoreServiceImpl implements ClassScoreService {
PerformanceScore performanceScore = performanceScores.get(0);
PerformanceTrainingScoreDto performanceTrainingScoreDto = new PerformanceTrainingScoreDto();
performanceTrainingScoreDto.setFlowId(performanceScore.getFlowId());
performanceTrainingScoreDto.setPracticalCognitionScore(performanceScore.getPracticalCognitionScore());
performanceTrainingScoreDto.setKnowledgeAssessmentScore(performanceScore.getKnowledgeAssessmentScore());
performanceTrainingScoreDto.setFundraisingScore(performanceScore.getFundraisingScore());
performanceTrainingScoreDto.setProjectSearchScore(performanceScore.getProjectSearchScore().add(performanceScore.getProjectSearchReportScore()));
performanceTrainingScoreDto.setProjectDueDiligenceScore(performanceScore.getProjectDueDiligenceScore()
.add(performanceScore.getProjectDueDiligenceFinanceReportScore()
.add(performanceScore.getProjectDueDiligenceBusinessReportScore()
.add(performanceScore.getProjectValuationEstimationRiskScore()))));
performanceTrainingScoreDto.setProjectValuationScore(performanceScore.getProjectValuationRelativeScore()
.add(performanceScore.getProjectValuationScore()
.add(performanceScore.getProjectValuationAbsoluteScore()
.add(performanceScore.getProjectUseValuationAbsoluteScore()
.add(performanceScore.getProjectUseValuationRelativeScore())))));
performanceTrainingScoreDto.setInvestmentSigningScore(performanceScore.getInvestmentSigningVlauationReportScore()
.add(performanceScore.getInvestmentSigningDiligenceReportScore()
.add(performanceScore.getInvestmentSigningInvestScore()
.add(performanceScore.getInvestmentSigningScore()))));
performanceTrainingScoreDto.setIpoScore(performanceScore.getIpoFlowScore().add(performanceScore.getIpoListedConditionScore()
.add(performanceScore.getIpoListedSectorScore())));
performanceTrainingScoreDto.setPricingIssuanceScore(performanceScore.getNewPricingIssuanceScore()
.add(performanceScore.getPricingIssuanceConfirmScore().add(performanceScore.getInitPricingIssuanceScore()
.add(performanceScore.getPricingIssuanceEnteringScore()))));
performanceTrainingScoreDto.setProfitManagementScore(performanceScore.getProfitManagementMarketValueScore()
.add(performanceScore.getProfitManagementFundScore()
.add(performanceScore.getProfitManagementFundExitScore()
.add(performanceScore.getProfitManagementMarketValueExitScore()))));
performanceTrainingScoreDto.setProfitDistributionScore(performanceScore.getProfitDistributionScore());
performanceTrainingScoreDto.setInvestmentReportScore(performanceScore.getInvestmentReportScore().add(performanceScore.getExperienceScore()));
performanceTrainingScoreDto.setTotalScore(performanceScore.getTotalScore());
performanceTrainingScoreDto.setPracticalCognitionScore(Optional.ofNullable(performanceScore.getPracticalCognitionScore()).orElse(BigDecimal.ZERO));
performanceTrainingScoreDto.setKnowledgeAssessmentScore(Optional.ofNullable(performanceScore.getKnowledgeAssessmentScore()).orElse(BigDecimal.ZERO));
performanceTrainingScoreDto.setFundraisingScore(Optional.ofNullable(performanceScore.getFundraisingScore()).orElse(BigDecimal.ZERO));
performanceTrainingScoreDto.setProjectSearchScore(Optional.ofNullable(performanceScore.getProjectSearchScore()).map(score -> score.add(Optional.ofNullable(performanceScore.getProjectSearchReportScore()).orElse(BigDecimal.ZERO))).orElse(BigDecimal.ZERO));
performanceTrainingScoreDto.setProjectDueDiligenceScore(
Optional.ofNullable(performanceScore.getProjectDueDiligenceScore()).map(score ->
score.add(Optional.ofNullable(performanceScore.getProjectDueDiligenceFinanceReportScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getProjectDueDiligenceBusinessReportScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getProjectValuationEstimationRiskScore()).orElse(BigDecimal.ZERO))
).orElse(BigDecimal.ZERO)
);
performanceTrainingScoreDto.setProjectValuationScore(
Optional.ofNullable(performanceScore.getProjectValuationRelativeScore()).orElse(BigDecimal.ZERO)
.add(Optional.ofNullable(performanceScore.getProjectValuationScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getProjectValuationAbsoluteScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getProjectUseValuationAbsoluteScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getProjectUseValuationRelativeScore()).orElse(BigDecimal.ZERO))
);
performanceTrainingScoreDto.setInvestmentSigningScore(
Optional.ofNullable(performanceScore.getInvestmentSigningVlauationReportScore()).orElse(BigDecimal.ZERO)
.add(Optional.ofNullable(performanceScore.getInvestmentSigningDiligenceReportScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getInvestmentSigningInvestScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getInvestmentSigningScore()).orElse(BigDecimal.ZERO))
);
performanceTrainingScoreDto.setIpoScore(
Optional.ofNullable(performanceScore.getIpoFlowScore()).orElse(BigDecimal.ZERO)
.add(Optional.ofNullable(performanceScore.getIpoListedConditionScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getIpoListedSectorScore()).orElse(BigDecimal.ZERO))
);
performanceTrainingScoreDto.setPricingIssuanceScore(
Optional.ofNullable(performanceScore.getNewPricingIssuanceScore()).orElse(BigDecimal.ZERO)
.add(Optional.ofNullable(performanceScore.getPricingIssuanceConfirmScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getInitPricingIssuanceScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getPricingIssuanceEnteringScore()).orElse(BigDecimal.ZERO))
);
performanceTrainingScoreDto.setProfitManagementScore(
Optional.ofNullable(performanceScore.getProfitManagementMarketValueScore()).orElse(BigDecimal.ZERO)
.add(Optional.ofNullable(performanceScore.getProfitManagementFundScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getProfitManagementFundExitScore()).orElse(BigDecimal.ZERO))
.add(Optional.ofNullable(performanceScore.getProfitManagementMarketValueExitScore()).orElse(BigDecimal.ZERO))
);
performanceTrainingScoreDto.setProfitDistributionScore(Optional.ofNullable(performanceScore.getProfitDistributionScore()).orElse(BigDecimal.ZERO));
performanceTrainingScoreDto.setInvestmentReportScore(Optional.ofNullable(performanceScore.getInvestmentReportScore()).orElse(BigDecimal.ZERO).add(Optional.ofNullable(performanceScore.getExperienceScore()).orElse(BigDecimal.ZERO)));
performanceTrainingScoreDto.setTotalScore(Optional.ofNullable(performanceScore.getTotalScore()).orElse(BigDecimal.ZERO));
return performanceTrainingScoreDto;
}
/*
* @author xcj
* @Date 2023/11/30

@ -1,5 +1,6 @@
package com.sztzjy.fund_investment.service.serviceImpl.tea;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sztzjy.fund_investment.entity.*;
import com.sztzjy.fund_investment.entity.dto.QuestionAnswerDto;
@ -83,8 +84,9 @@ public class TeaTopicManageServiceImpl implements TeaTopicManageService {
*/
@Override
public PageInfo<TopicsWithBLOBs> getTopicsBySchoolId(Integer index, Integer size, String schoolId, String module, String topicContent) {
PageHelper.startPage(index, size);
List<TopicsWithBLOBs> topics = topicsMapper.getTopicsByCondition(schoolId, module, topicContent);
PageInfo pageInfo = PageUtil.pageHelper(topics, index, size);
PageInfo<TopicsWithBLOBs> pageInfo = new PageInfo<>(topics);
return pageInfo;
}
@ -96,16 +98,16 @@ public class TeaTopicManageServiceImpl implements TeaTopicManageService {
* @Date 2023/12/1
*/
@Override
public PageInfo<QuestionAnswerDto> getQuestionAnswer(Integer index, Integer size, String schoolId, String className, String keyWord) {
public PageInfo<QuestionAnswerDto> getQuestionAnswer(Integer index, Integer size, String schoolId, String classId, String keyWord) {
QuestionAnswerExample questionAnswerExample = new QuestionAnswerExample();
questionAnswerExample.createCriteria().andSchoolidEqualTo(schoolId);
List<QuestionAnswer> questionAnswers = questionAnswerMapper.selectByExample(questionAnswerExample);
List<QuestionAnswerWithBLOBs> questionAnswers = questionAnswerMapper.selectByExampleWithBLOBs(questionAnswerExample);
UserExample userTableExample = new UserExample();
UserExample.Criteria criteria = userTableExample.createCriteria();
UserExample.Criteria or = userTableExample.createCriteria();
criteria.andSchoolIdEqualTo(schoolId);
if (StringUtils.isNotBlank(className)) {
criteria.andClassNameEqualTo(className);
criteria.andSchoolIdEqualTo(schoolId).andRoleIdEqualTo(4);
if (StringUtils.isNotBlank(classId)) {
criteria.andClassIdEqualTo(classId);
}
if (StringUtils.isNotBlank(keyWord)) {
criteria.andStudentIdEqualTo(keyWord);

@ -5,6 +5,8 @@ import com.sztzjy.fund_investment.entity.TopicsWithBLOBs;
import com.sztzjy.fund_investment.entity.dto.QuestionAnswerDto;
import com.sztzjy.fund_investment.util.ResultEntity;
import java.util.List;
/**
* @Author xcj
* @Date 2023/12/1
@ -12,8 +14,8 @@ import com.sztzjy.fund_investment.util.ResultEntity;
public interface TeaTopicManageService {
ResultEntity<String> insertTopics(TopicsWithBLOBs topics);
PageInfo<TopicsWithBLOBs> getTopicsBySchoolId(Integer index, Integer size,String schoolId, String module,String topicContent);
PageInfo<TopicsWithBLOBs> getTopicsBySchoolId(Integer index, Integer size, String schoolId, String module, String topicContent);
PageInfo<QuestionAnswerDto> getQuestionAnswer(Integer index, Integer size,String schoolId, String className, String keyWord);
PageInfo<QuestionAnswerDto> getQuestionAnswer(Integer index, Integer size,String schoolId, String classId, String keyWord);
}

@ -38,14 +38,7 @@ public class Task {
// 查到单个班级下所有的已经在投资报告页面提交过的学生的总成绩
// 算平均值,存表
//查出所有数据
PerformanceScoreExample performanceScoreExample = new PerformanceScoreExample();
List<PerformanceScore> performanceScores = performanceScoreMapper.selectByExample(performanceScoreExample);
List<String> classIdList = new ArrayList<>();
for (PerformanceScore performanceScore : performanceScores) {
//查询classID相同的所有数据
String classId = performanceScore.getClassId();
classIdList.add(classId);
}
List<String> classIdList = performanceScoreMapper.selectClassId();
for (String classId : classIdList) {
BigDecimal avgScore = BigDecimal.ZERO;
BigDecimal count = BigDecimal.ZERO;
@ -70,6 +63,7 @@ public class Task {
schoolId = score.getSchoolId();
//没提交报告的 算0分跳过
if (score.getInvestmentReportScore() == null || score.getInvestmentReportScore().equals(BigDecimal.ZERO)) {
classMinScore = BigDecimal.ZERO;
continue;
}
@ -102,6 +96,7 @@ public class Task {
Date date = Date.from(currentDate.atStartOfDay(ZoneId.systemDefault()).toInstant());
teaClassScore.setSchoolId(schoolId);
teaClassScore.setStartTime(date);
System.out.println(new Date());
teaClassScore.setId(IdUtil.simpleUUID());
teaClassScore.setClassMaxScore(classMaxScore);
teaClassScore.setClassMinScore(classMinScore);
@ -111,7 +106,7 @@ public class Task {
teaClassScore.setFailCount(gradeCounts.get("fail"));
teaClassScore.setClassId(classId);
UserExample userTableExample =new UserExample();
userTableExample.createCriteria().andSchoolIdEqualTo(schoolId).andClassIdEqualTo(classId);
userTableExample.createCriteria().andSchoolIdEqualTo(schoolId).andClassIdEqualTo(classId).andRoleIdEqualTo(4);
List<User> userTables = userMapper.selectByExample(userTableExample);
User userTable = userTables.get(0);
teaClassScore.setClassName(userTable.getClassName());
@ -124,5 +119,6 @@ public class Task {
teaClassScoreMapper.insert(teaClassScore);
}
}
}

@ -41,7 +41,8 @@ public class HeaderAndFooterEvent extends PdfPageEventHelper {
@SneakyThrows
public static void SetFont(BaseColor color, String fontName, float size, int style) {
BaseFont baseFont;
String FONT_PATH="C:/Windows/Fonts/";
// String FONT_PATH="C:/Windows/Fonts/";
String FONT_PATH="/usr/share/fonts/";
switch (fontName) {
case "黑体":
// baseFont = BaseFont.createFont("SIMHEI.TTF", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);

@ -5,7 +5,7 @@
<id column="id" jdbcType="VARCHAR" property="id" />
<result column="flow_id" jdbcType="VARCHAR" property="flowId" />
<result column="schoolId" jdbcType="VARCHAR" property="schoolid" />
<result column="question_time" jdbcType="DATE" property="questionTime" />
<result column="question_time" jdbcType="TIMESTAMP" property="questionTime" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.sztzjy.fund_investment.entity.QuestionAnswerWithBLOBs">
<result column="question_content" jdbcType="LONGVARCHAR" property="questionContent" />
@ -128,7 +128,7 @@
question_time, question_content, reply_content
)
values (#{id,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR}, #{schoolid,jdbcType=VARCHAR},
#{questionTime,jdbcType=DATE}, #{questionContent,jdbcType=LONGVARCHAR}, #{replyContent,jdbcType=LONGVARCHAR}
#{questionTime,jdbcType=TIMESTAMP}, #{questionContent,jdbcType=LONGVARCHAR}, #{replyContent,jdbcType=LONGVARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.QuestionAnswerWithBLOBs">
@ -164,7 +164,7 @@
#{schoolid,jdbcType=VARCHAR},
</if>
<if test="questionTime != null">
#{questionTime,jdbcType=DATE},
#{questionTime,jdbcType=TIMESTAMP},
</if>
<if test="questionContent != null">
#{questionContent,jdbcType=LONGVARCHAR},
@ -193,7 +193,7 @@
schoolId = #{record.schoolid,jdbcType=VARCHAR},
</if>
<if test="record.questionTime != null">
question_time = #{record.questionTime,jdbcType=DATE},
question_time = #{record.questionTime,jdbcType=TIMESTAMP},
</if>
<if test="record.questionContent != null">
question_content = #{record.questionContent,jdbcType=LONGVARCHAR},
@ -211,7 +211,7 @@
set id = #{record.id,jdbcType=VARCHAR},
flow_id = #{record.flowId,jdbcType=VARCHAR},
schoolId = #{record.schoolid,jdbcType=VARCHAR},
question_time = #{record.questionTime,jdbcType=DATE},
question_time = #{record.questionTime,jdbcType=TIMESTAMP},
question_content = #{record.questionContent,jdbcType=LONGVARCHAR},
reply_content = #{record.replyContent,jdbcType=LONGVARCHAR}
<if test="_parameter != null">
@ -223,7 +223,7 @@
set id = #{record.id,jdbcType=VARCHAR},
flow_id = #{record.flowId,jdbcType=VARCHAR},
schoolId = #{record.schoolid,jdbcType=VARCHAR},
question_time = #{record.questionTime,jdbcType=DATE}
question_time = #{record.questionTime,jdbcType=TIMESTAMP}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -238,7 +238,7 @@
schoolId = #{schoolid,jdbcType=VARCHAR},
</if>
<if test="questionTime != null">
question_time = #{questionTime,jdbcType=DATE},
question_time = #{questionTime,jdbcType=TIMESTAMP},
</if>
<if test="questionContent != null">
question_content = #{questionContent,jdbcType=LONGVARCHAR},
@ -253,7 +253,7 @@
update question_answer
set flow_id = #{flowId,jdbcType=VARCHAR},
schoolId = #{schoolid,jdbcType=VARCHAR},
question_time = #{questionTime,jdbcType=DATE},
question_time = #{questionTime,jdbcType=TIMESTAMP},
question_content = #{questionContent,jdbcType=LONGVARCHAR},
reply_content = #{replyContent,jdbcType=LONGVARCHAR}
where id = #{id,jdbcType=VARCHAR}
@ -262,7 +262,7 @@
update question_answer
set flow_id = #{flowId,jdbcType=VARCHAR},
schoolId = #{schoolid,jdbcType=VARCHAR},
question_time = #{questionTime,jdbcType=DATE}
question_time = #{questionTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sztzjy.fund_investment.mapper.TopicRecordMapper">
<resultMap id="BaseResultMap" type="com.sztzjy.fund_investment.entity.TopicRecord">
<id column="id" jdbcType="VARCHAR" property="id" />
<id column="id" jdbcType="INTEGER" property="id" />
<result column="topic_id" jdbcType="VARCHAR" property="topicId" />
<result column="flow_id" jdbcType="VARCHAR" property="flowId" />
<result column="module" jdbcType="VARCHAR" property="module" />
@ -75,7 +75,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, topic_id, flow_id, module, topic_content, topic_type, choicesA, choicesB, choicesC,
id, topic_id, flow_id, module, topic_content, topic_type, choicesA, choicesB, choicesC,
choicesD, choicesE, user_answer, answer
</sql>
<select id="selectByExample" parameterType="com.sztzjy.fund_investment.entity.TopicRecordExample" resultMap="BaseResultMap">
@ -92,15 +92,15 @@
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from topic_record
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from topic_record
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="com.sztzjy.fund_investment.entity.TopicRecordExample">
delete from topic_record
@ -109,16 +109,16 @@
</if>
</delete>
<insert id="insert" parameterType="com.sztzjy.fund_investment.entity.TopicRecord">
insert into topic_record (id, topic_id, flow_id,
module, topic_content, topic_type,
choicesA, choicesB, choicesC,
choicesD, choicesE, user_answer,
answer)
values (#{id,jdbcType=VARCHAR}, #{topicId,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR},
#{module,jdbcType=VARCHAR}, #{topicContent,jdbcType=VARCHAR}, #{topicType,jdbcType=VARCHAR},
#{choicesa,jdbcType=VARCHAR}, #{choicesb,jdbcType=VARCHAR}, #{choicesc,jdbcType=VARCHAR},
#{choicesd,jdbcType=VARCHAR}, #{choicese,jdbcType=VARCHAR}, #{userAnswer,jdbcType=VARCHAR},
#{answer,jdbcType=VARCHAR})
insert into topic_record (id, topic_id, flow_id,
module, topic_content, topic_type,
choicesA, choicesB, choicesC,
choicesD, choicesE, user_answer,
answer)
values (#{id,jdbcType=INTEGER}, #{topicId,jdbcType=VARCHAR}, #{flowId,jdbcType=VARCHAR},
#{module,jdbcType=VARCHAR}, #{topicContent,jdbcType=VARCHAR}, #{topicType,jdbcType=VARCHAR},
#{choicesa,jdbcType=VARCHAR}, #{choicesb,jdbcType=VARCHAR}, #{choicesc,jdbcType=VARCHAR},
#{choicesd,jdbcType=VARCHAR}, #{choicese,jdbcType=VARCHAR}, #{userAnswer,jdbcType=VARCHAR},
#{answer,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sztzjy.fund_investment.entity.TopicRecord">
insert into topic_record
@ -165,7 +165,7 @@
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
#{id,jdbcType=INTEGER},
</if>
<if test="topicId != null">
#{topicId,jdbcType=VARCHAR},
@ -215,7 +215,7 @@
update topic_record
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=VARCHAR},
id = #{record.id,jdbcType=INTEGER},
</if>
<if test="record.topicId != null">
topic_id = #{record.topicId,jdbcType=VARCHAR},
@ -260,19 +260,19 @@
</update>
<update id="updateByExample" parameterType="map">
update topic_record
set id = #{record.id,jdbcType=VARCHAR},
topic_id = #{record.topicId,jdbcType=VARCHAR},
flow_id = #{record.flowId,jdbcType=VARCHAR},
module = #{record.module,jdbcType=VARCHAR},
topic_content = #{record.topicContent,jdbcType=VARCHAR},
topic_type = #{record.topicType,jdbcType=VARCHAR},
choicesA = #{record.choicesa,jdbcType=VARCHAR},
choicesB = #{record.choicesb,jdbcType=VARCHAR},
choicesC = #{record.choicesc,jdbcType=VARCHAR},
choicesD = #{record.choicesd,jdbcType=VARCHAR},
choicesE = #{record.choicese,jdbcType=VARCHAR},
user_answer = #{record.userAnswer,jdbcType=VARCHAR},
answer = #{record.answer,jdbcType=VARCHAR}
set id = #{record.id,jdbcType=INTEGER},
topic_id = #{record.topicId,jdbcType=VARCHAR},
flow_id = #{record.flowId,jdbcType=VARCHAR},
module = #{record.module,jdbcType=VARCHAR},
topic_content = #{record.topicContent,jdbcType=VARCHAR},
topic_type = #{record.topicType,jdbcType=VARCHAR},
choicesA = #{record.choicesa,jdbcType=VARCHAR},
choicesB = #{record.choicesb,jdbcType=VARCHAR},
choicesC = #{record.choicesc,jdbcType=VARCHAR},
choicesD = #{record.choicesd,jdbcType=VARCHAR},
choicesE = #{record.choicese,jdbcType=VARCHAR},
user_answer = #{record.userAnswer,jdbcType=VARCHAR},
answer = #{record.answer,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -317,22 +317,22 @@
answer = #{answer,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="com.sztzjy.fund_investment.entity.TopicRecord">
update topic_record
set topic_id = #{topicId,jdbcType=VARCHAR},
flow_id = #{flowId,jdbcType=VARCHAR},
module = #{module,jdbcType=VARCHAR},
topic_content = #{topicContent,jdbcType=VARCHAR},
topic_type = #{topicType,jdbcType=VARCHAR},
choicesA = #{choicesa,jdbcType=VARCHAR},
choicesB = #{choicesb,jdbcType=VARCHAR},
choicesC = #{choicesc,jdbcType=VARCHAR},
choicesD = #{choicesd,jdbcType=VARCHAR},
choicesE = #{choicese,jdbcType=VARCHAR},
user_answer = #{userAnswer,jdbcType=VARCHAR},
answer = #{answer,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
flow_id = #{flowId,jdbcType=VARCHAR},
module = #{module,jdbcType=VARCHAR},
topic_content = #{topicContent,jdbcType=VARCHAR},
topic_type = #{topicType,jdbcType=VARCHAR},
choicesA = #{choicesa,jdbcType=VARCHAR},
choicesB = #{choicesb,jdbcType=VARCHAR},
choicesC = #{choicesc,jdbcType=VARCHAR},
choicesD = #{choicesd,jdbcType=VARCHAR},
choicesE = #{choicese,jdbcType=VARCHAR},
user_answer = #{userAnswer,jdbcType=VARCHAR},
answer = #{answer,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER}
</update>
</mapper>
Loading…
Cancel
Save