|
@@ -325,41 +325,47 @@ public class ProjectImplementEarlyService extends CrudService<ProjectImplementEa
|
|
@Transactional(readOnly = false)
|
|
@Transactional(readOnly = false)
|
|
public void storFollow(ProjectFollowReport projectFollowReport) throws Exception {
|
|
public void storFollow(ProjectFollowReport projectFollowReport) throws Exception {
|
|
projectFollowReport.setStatus(ProjectStatusEnum.TSTORE.getValue());
|
|
projectFollowReport.setStatus(ProjectStatusEnum.TSTORE.getValue());
|
|
- //查询项目报告号前缀
|
|
|
|
- String projectNumPrefix = monthlyConsultationReportDao.getProjectNum(projectFollowReport.getProject().getId());
|
|
|
|
- projectNumPrefix += "-ZX-";
|
|
|
|
|
|
|
|
- //获取最后一个报告号数据信息
|
|
|
|
- ReportNum reportNum = new ReportNum();
|
|
|
|
- reportNum.setNum(projectNumPrefix);
|
|
|
|
- ReportNum lastReportNum = projectReportNumDao.getLastReportNum(reportNum);
|
|
|
|
- //判断是否是新的报告号
|
|
|
|
- if (null != lastReportNum){
|
|
|
|
- //不是
|
|
|
|
- lastReportNum.getNum().lastIndexOf("-");
|
|
|
|
- //截取最后四位流水号
|
|
|
|
- String substring = lastReportNum.getNum().substring(lastReportNum.getNum().lastIndexOf("-")+1, lastReportNum.getNum().length());
|
|
|
|
- //转换为数字并递增
|
|
|
|
- Integer substringInteger = Integer.parseInt(substring)+1;
|
|
|
|
- //生成新的流水号
|
|
|
|
- StringBuffer newSerialNum = new StringBuffer();
|
|
|
|
- for(int x = 0; x < (4 - substringInteger.toString().length()); x++) {
|
|
|
|
- newSerialNum.append("0");
|
|
|
|
- }
|
|
|
|
- newSerialNum.append(substringInteger);
|
|
|
|
- reportNum.setNum(reportNum.getNum()+newSerialNum);
|
|
|
|
- }else{
|
|
|
|
- //是则在后面添加0001初始报告号
|
|
|
|
- reportNum.setNum(reportNum.getNum()+"0001");
|
|
|
|
- }
|
|
|
|
- reportNum.preInsert();
|
|
|
|
- //报告号进行新增操作
|
|
|
|
- projectReportNumDao.insert(reportNum);
|
|
|
|
- projectFollowReport.setProjectFollowId(reportNum.getNum());
|
|
|
|
|
|
|
|
//跟踪咨询报告信息进行新增操作
|
|
//跟踪咨询报告信息进行新增操作
|
|
- projectFollowReport.preInsert();
|
|
|
|
- projectFollowReportDao.insertFollow(projectFollowReport);
|
|
|
|
|
|
+ if(StringUtils.isNotBlank(projectFollowReport.getId())){
|
|
|
|
+ projectFollowReport.preUpdate();
|
|
|
|
+ projectFollowReportDao.update(projectFollowReport);
|
|
|
|
+ }else{
|
|
|
|
+ //查询项目报告号前缀
|
|
|
|
+ String projectNumPrefix = monthlyConsultationReportDao.getProjectNum(projectFollowReport.getProject().getId());
|
|
|
|
+ projectNumPrefix += "-ZX-";
|
|
|
|
+
|
|
|
|
+ //获取最后一个报告号数据信息
|
|
|
|
+ ReportNum reportNum = new ReportNum();
|
|
|
|
+ reportNum.setNum(projectNumPrefix);
|
|
|
|
+ ReportNum lastReportNum = projectReportNumDao.getLastReportNum(reportNum);
|
|
|
|
+ //判断是否是新的报告号
|
|
|
|
+ if (null != lastReportNum){
|
|
|
|
+ //不是
|
|
|
|
+ lastReportNum.getNum().lastIndexOf("-");
|
|
|
|
+ //截取最后四位流水号
|
|
|
|
+ String substring = lastReportNum.getNum().substring(lastReportNum.getNum().lastIndexOf("-")+1, lastReportNum.getNum().length());
|
|
|
|
+ //转换为数字并递增
|
|
|
|
+ Integer substringInteger = Integer.parseInt(substring)+1;
|
|
|
|
+ //生成新的流水号
|
|
|
|
+ StringBuffer newSerialNum = new StringBuffer();
|
|
|
|
+ for(int x = 0; x < (4 - substringInteger.toString().length()); x++) {
|
|
|
|
+ newSerialNum.append("0");
|
|
|
|
+ }
|
|
|
|
+ newSerialNum.append(substringInteger);
|
|
|
|
+ reportNum.setNum(reportNum.getNum()+newSerialNum);
|
|
|
|
+ }else{
|
|
|
|
+ //是则在后面添加0001初始报告号
|
|
|
|
+ reportNum.setNum(reportNum.getNum()+"0001");
|
|
|
|
+ }
|
|
|
|
+ reportNum.preInsert();
|
|
|
|
+ //报告号进行新增操作
|
|
|
|
+ projectReportNumDao.insert(reportNum);
|
|
|
|
+ projectFollowReport.setProjectFollowId(reportNum.getNum());
|
|
|
|
+ projectFollowReport.preInsert();
|
|
|
|
+ projectFollowReportDao.insertFollow(projectFollowReport);
|
|
|
|
+ }
|
|
//保存月报基本信息
|
|
//保存月报基本信息
|
|
ProjectContentData projectContentData = projectFollowReport.getProjectContentData();
|
|
ProjectContentData projectContentData = projectFollowReport.getProjectContentData();
|
|
//保存依据资料信息
|
|
//保存依据资料信息
|