|
|
|
@ -2,10 +2,14 @@ package com.sztzjy.fund_investment.service.serviceImpl;
|
|
|
|
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.sztzjy.fund_investment.entity.AllotmentObject;
|
|
|
|
|
import com.sztzjy.fund_investment.entity.AllotmentObjectExample;
|
|
|
|
|
import com.sztzjy.fund_investment.entity.*;
|
|
|
|
|
import com.sztzjy.fund_investment.entity.dto.AllotmentObjectDTO;
|
|
|
|
|
import com.sztzjy.fund_investment.entity.dto.TrainingReportDTO;
|
|
|
|
|
import com.sztzjy.fund_investment.entity.dto.UserNameAndStudentIdDTO;
|
|
|
|
|
import com.sztzjy.fund_investment.mapper.AllotmentObjectMapper;
|
|
|
|
|
import com.sztzjy.fund_investment.mapper.FlowMapper;
|
|
|
|
|
import com.sztzjy.fund_investment.mapper.TrainingReportMapper;
|
|
|
|
|
import com.sztzjy.fund_investment.mapper.UserTableMapper;
|
|
|
|
|
import com.sztzjy.fund_investment.service.InquiryIssuanceService;
|
|
|
|
|
import com.sztzjy.fund_investment.util.ConvertUtil;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
@ -26,6 +30,12 @@ public class InquiryIssuanceServiceImpl implements InquiryIssuanceService {
|
|
|
|
|
AllotmentObjectMapper allotmentObjectMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
ConvertUtil convertUtil;
|
|
|
|
|
@Resource
|
|
|
|
|
TrainingReportMapper trainingReportMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
FlowMapper flowMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
UserTableMapper userTableMapper;
|
|
|
|
|
@Override
|
|
|
|
|
public PageInfo<AllotmentObjectDTO> queryInquiryInvestors(String flowId, Integer size, Integer index) {
|
|
|
|
|
//开启分页
|
|
|
|
@ -118,4 +128,151 @@ public class InquiryIssuanceServiceImpl implements InquiryIssuanceService {
|
|
|
|
|
allotmentObjectMapper.updateByPrimaryKey(allotmentObject);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<TrainingReportDTO> queryInitiatePreliminaryInquiry(String flowId) {
|
|
|
|
|
TrainingReportExample trainingReportExample = new TrainingReportExample();
|
|
|
|
|
trainingReportExample.createCriteria().andFlowIdEqualTo(flowId).andStepEqualTo("询价发行");
|
|
|
|
|
List<TrainingReport> trainingReports = trainingReportMapper.selectByExample(trainingReportExample);
|
|
|
|
|
List<TrainingReportDTO> trainingReportDTOS = convertUtil.entityToDTOList(trainingReports, TrainingReportDTO.class);
|
|
|
|
|
int a = 0, b = 0, c = 0, d = 0, e = 0;
|
|
|
|
|
if (trainingReportDTOS.size() > 0) {
|
|
|
|
|
for (int i = 0; i < trainingReportDTOS.size(); i++) {
|
|
|
|
|
if (trainingReportDTOS.get(i).getReportName().equals("投资价值分析报告")) {
|
|
|
|
|
trainingReportDTOS.get(i).setNumber(1);
|
|
|
|
|
trainingReportDTOS.get(i).setFileName("投资价值分析报告");
|
|
|
|
|
a++;
|
|
|
|
|
}
|
|
|
|
|
if (trainingReportDTOS.get(i).getReportName().equals("招股意向书")) {
|
|
|
|
|
trainingReportDTOS.get(i).setNumber(2);
|
|
|
|
|
trainingReportDTOS.get(i).setFileName("招股意向书");
|
|
|
|
|
b++;
|
|
|
|
|
}
|
|
|
|
|
if (trainingReportDTOS.get(i).getReportName().equals("初步询价公告")) {
|
|
|
|
|
trainingReportDTOS.get(i).setNumber(3);
|
|
|
|
|
trainingReportDTOS.get(i).setFileName("初步询价公告");
|
|
|
|
|
c++;
|
|
|
|
|
}
|
|
|
|
|
if (trainingReportDTOS.get(i).getReportName().equals("投资者需同意的承诺涵文件")) {
|
|
|
|
|
trainingReportDTOS.get(i).setNumber(4);
|
|
|
|
|
trainingReportDTOS.get(i).setFileName("投资者需同意的承诺涵文件");
|
|
|
|
|
d++;
|
|
|
|
|
}
|
|
|
|
|
if (trainingReportDTOS.get(i).getReportName().equals("其他文件")) {
|
|
|
|
|
trainingReportDTOS.get(i).setNumber(5);
|
|
|
|
|
trainingReportDTOS.get(i).setFileName("其他文件");
|
|
|
|
|
e++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(a==0){
|
|
|
|
|
TrainingReportDTO trainingReportDTO=new TrainingReportDTO();
|
|
|
|
|
trainingReportDTO.setNumber(1);
|
|
|
|
|
trainingReportDTO.setFileName("投资价值分析报告");
|
|
|
|
|
trainingReportDTO.setFlowId(flowId);
|
|
|
|
|
trainingReportDTOS.add(trainingReportDTO);
|
|
|
|
|
}
|
|
|
|
|
if(b==0){
|
|
|
|
|
TrainingReportDTO trainingReportDTO=new TrainingReportDTO();
|
|
|
|
|
trainingReportDTO.setNumber(2);
|
|
|
|
|
trainingReportDTO.setFileName("招股意向书");
|
|
|
|
|
trainingReportDTO.setFlowId(flowId);
|
|
|
|
|
trainingReportDTOS.add(trainingReportDTO);
|
|
|
|
|
}
|
|
|
|
|
if(c==0){
|
|
|
|
|
TrainingReportDTO trainingReportDTO=new TrainingReportDTO();
|
|
|
|
|
trainingReportDTO.setNumber(3);
|
|
|
|
|
trainingReportDTO.setFileName("初步询价公告");
|
|
|
|
|
trainingReportDTO.setFlowId(flowId);
|
|
|
|
|
trainingReportDTOS.add(trainingReportDTO);
|
|
|
|
|
}
|
|
|
|
|
if(d==0){
|
|
|
|
|
TrainingReportDTO trainingReportDTO=new TrainingReportDTO();
|
|
|
|
|
trainingReportDTO.setNumber(4);
|
|
|
|
|
trainingReportDTO.setFileName("投资者需同意的承诺涵文件");
|
|
|
|
|
trainingReportDTO.setFlowId(flowId);
|
|
|
|
|
trainingReportDTOS.add(trainingReportDTO);
|
|
|
|
|
}
|
|
|
|
|
if(e==0){
|
|
|
|
|
TrainingReportDTO trainingReportDTO=new TrainingReportDTO();
|
|
|
|
|
trainingReportDTO.setNumber(5);
|
|
|
|
|
trainingReportDTO.setFileName("其他文件");
|
|
|
|
|
trainingReportDTO.setFlowId(flowId);
|
|
|
|
|
trainingReportDTOS.add(trainingReportDTO);
|
|
|
|
|
}
|
|
|
|
|
return trainingReportDTOS;
|
|
|
|
|
}else {
|
|
|
|
|
TrainingReportDTO trainingReportDTO1=new TrainingReportDTO();
|
|
|
|
|
trainingReportDTO1.setNumber(1);
|
|
|
|
|
trainingReportDTO1.setFileName("投资价值分析报告");
|
|
|
|
|
trainingReportDTO1.setFlowId(flowId);
|
|
|
|
|
trainingReportDTOS.add(trainingReportDTO1);
|
|
|
|
|
|
|
|
|
|
TrainingReportDTO trainingReportDTO2=new TrainingReportDTO();
|
|
|
|
|
trainingReportDTO2.setNumber(2);
|
|
|
|
|
trainingReportDTO2.setFileName("招股意向书");
|
|
|
|
|
trainingReportDTO2.setFlowId(flowId);
|
|
|
|
|
trainingReportDTOS.add(trainingReportDTO2);
|
|
|
|
|
|
|
|
|
|
TrainingReportDTO trainingReportDTO3=new TrainingReportDTO();
|
|
|
|
|
trainingReportDTO3.setNumber(3);
|
|
|
|
|
trainingReportDTO3.setFileName("初步询价公告");
|
|
|
|
|
trainingReportDTO3.setFlowId(flowId);
|
|
|
|
|
trainingReportDTOS.add(trainingReportDTO3);
|
|
|
|
|
|
|
|
|
|
TrainingReportDTO trainingReportDTO4=new TrainingReportDTO();
|
|
|
|
|
trainingReportDTO4.setNumber(4);
|
|
|
|
|
trainingReportDTO4.setFileName("投资者需同意的承诺涵文件");
|
|
|
|
|
trainingReportDTO4.setFlowId(flowId);
|
|
|
|
|
trainingReportDTOS.add(trainingReportDTO4);
|
|
|
|
|
|
|
|
|
|
TrainingReportDTO trainingReportDTO5=new TrainingReportDTO();
|
|
|
|
|
trainingReportDTO5.setNumber(5);
|
|
|
|
|
trainingReportDTO5.setFileName("其他文件");
|
|
|
|
|
trainingReportDTO5.setFlowId(flowId);
|
|
|
|
|
trainingReportDTOS.add(trainingReportDTO5);
|
|
|
|
|
|
|
|
|
|
return trainingReportDTOS;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void uploadInitiatePreliminaryInquiry(String fileName,String flowId) {
|
|
|
|
|
TrainingReportExample trainingReportExample=new TrainingReportExample();
|
|
|
|
|
trainingReportExample.createCriteria().andFlowIdEqualTo(flowId)
|
|
|
|
|
.andStepEqualTo("询价发行").andReportNameEqualTo(fileName);
|
|
|
|
|
List<TrainingReport> trainingReports = trainingReportMapper.selectByExample(trainingReportExample);
|
|
|
|
|
if(trainingReports.isEmpty()){ //若为空则添加到数据库
|
|
|
|
|
TrainingReport trainingReport=new TrainingReport();
|
|
|
|
|
trainingReport.setReportName(fileName);
|
|
|
|
|
trainingReport.setVersion("1.0");
|
|
|
|
|
trainingReport.setFlowId(flowId);
|
|
|
|
|
trainingReport.setStep("询价发行");
|
|
|
|
|
trainingReport.setId(String.valueOf(UUID.randomUUID()));
|
|
|
|
|
trainingReport.setUploadtime(new Date());
|
|
|
|
|
//上传到数据库
|
|
|
|
|
trainingReportMapper.insert(trainingReport);
|
|
|
|
|
}else {
|
|
|
|
|
//若不为空 则修改版本号+1
|
|
|
|
|
String version = trainingReports.get(0).getVersion();
|
|
|
|
|
Double i = Double.valueOf(version);
|
|
|
|
|
Double number=i+1;
|
|
|
|
|
trainingReports.get(0).setVersion(String.valueOf(number));
|
|
|
|
|
trainingReportMapper.updateByPrimaryKey(trainingReports.get(0));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// @Override
|
|
|
|
|
// public UserNameAndStudentIdDTO queryUserNameAndStudentId(String flowId) {
|
|
|
|
|
// FlowExample flowExample=new FlowExample();
|
|
|
|
|
// flowExample.createCriteria().andFlowIdEqualTo(flowId);
|
|
|
|
|
// List<Flow> flows = flowMapper.selectByExample(flowExample);
|
|
|
|
|
// if(flows.size()>0){
|
|
|
|
|
// String userid = flows.get(0).getUserid();
|
|
|
|
|
// UserTable userTable = userTableMapper.selectByPrimaryKey(userid);
|
|
|
|
|
// UserNameAndStudentIdDTO userNameAndStudentIdDTO = convertUtil.entityToDTO(userTable, UserNameAndStudentIdDTO.class);
|
|
|
|
|
// return userNameAndStudentIdDTO;
|
|
|
|
|
// }else {
|
|
|
|
|
// throw new RuntimeException("请按流程操作");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|