|
@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
|
|
+import com.jeeplus.flowable.service.FlowTaskService;
|
|
import com.jeeplus.sys.service.dto.DictValueDTO;
|
|
import com.jeeplus.sys.service.dto.DictValueDTO;
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
import com.jeeplus.sys.utils.DictUtils;
|
|
import com.jeeplus.sys.utils.DictUtils;
|
|
@@ -35,6 +36,7 @@ import com.jeeplus.test.workContract.service.WorkContractService;
|
|
import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
|
|
import com.jeeplus.test.workContract.service.dto.WorkAttachmentDto;
|
|
import com.jeeplus.test.workContract.service.dto.WorkContractInfoDto;
|
|
import com.jeeplus.test.workContract.service.dto.WorkContractInfoDto;
|
|
import org.apache.commons.compress.utils.Lists;
|
|
import org.apache.commons.compress.utils.Lists;
|
|
|
|
+import org.flowable.bpmn.model.FlowNode;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.beans.BeanUtils;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -75,6 +77,9 @@ public class ProjectListService {
|
|
@Resource
|
|
@Resource
|
|
private ProofreadIssuedService proofreadIssuedService;
|
|
private ProofreadIssuedService proofreadIssuedService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private FlowTaskService flowTaskService;
|
|
|
|
+
|
|
public String save(ProjectListDto dto,String tabType) throws Exception{
|
|
public String save(ProjectListDto dto,String tabType) throws Exception{
|
|
if (StringUtils.isNotEmpty(dto.getId())) {
|
|
if (StringUtils.isNotEmpty(dto.getId())) {
|
|
return update(dto);
|
|
return update(dto);
|
|
@@ -88,7 +93,21 @@ public class ProjectListService {
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
// 保存项目管理列表主表信息
|
|
// 保存项目管理列表主表信息
|
|
BeanUtils.copyProperties(dto, info);
|
|
BeanUtils.copyProperties(dto, info);
|
|
|
|
+ String reportNo = "";
|
|
String id = UUID.randomUUID().toString().replace("-", "");
|
|
String id = UUID.randomUUID().toString().replace("-", "");
|
|
|
|
+ if (dto.getGenerateReportNumber().equals("true")) {
|
|
|
|
+ if(StringUtils.isNotBlank(info.getReportType())){
|
|
|
|
+ if (info.getReportType().equals("1")){
|
|
|
|
+ reportNo = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ProgramReportNoDto.BIZ_CODE);
|
|
|
|
+ } else if (info.getReportType().equals("2")) {
|
|
|
|
+ reportNo = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ProgramReportNoDto.BIZ_CODE_);
|
|
|
|
+ }
|
|
|
|
+ ProgramReportNo programReportNo = new ProgramReportNo();
|
|
|
|
+ programReportNo.setProgramId(id);
|
|
|
|
+ programReportNo.setReportNo(reportNo);
|
|
|
|
+ programReportNoMapper.insert(programReportNo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
//合同编号生成
|
|
//合同编号生成
|
|
String no = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ProjectListDto.BIZ_CODE);
|
|
String no = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ProjectListDto.BIZ_CODE);
|
|
//项目立项号生成
|
|
//项目立项号生成
|
|
@@ -187,7 +206,9 @@ public class ProjectListService {
|
|
}
|
|
}
|
|
|
|
|
|
public String saveFormArchive(ProgramArchiveDto programArchiveDto) {
|
|
public String saveFormArchive(ProgramArchiveDto programArchiveDto) {
|
|
- ProgramArchive programArchive = ProgramArchiveWrapper.INSTANCE.toEntity(programArchiveDto);
|
|
|
|
|
|
+// ProgramArchive programArchive = ProgramArchiveWrapper.INSTANCE.toEntity(programArchiveDto);
|
|
|
|
+ ProgramArchive programArchive = new ProgramArchive();
|
|
|
|
+ BeanUtils.copyProperties(programArchiveDto, programArchive);
|
|
if (StringUtils.isNotBlank(programArchive.getId())){
|
|
if (StringUtils.isNotBlank(programArchive.getId())){
|
|
programArchiveMapper.updateById(programArchive);
|
|
programArchiveMapper.updateById(programArchive);
|
|
}else{
|
|
}else{
|
|
@@ -203,9 +224,35 @@ public class ProjectListService {
|
|
return programArchive.getId();
|
|
return programArchive.getId();
|
|
}
|
|
}
|
|
|
|
|
|
- public String saveFormThree(ProgramAuditDto programAuditDto) {
|
|
|
|
|
|
+ public String saveFormThree(ProgramAuditDto programAuditDto) throws Exception {
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
ProgramAudit programAudit = ProgramAuditWrapper.INSTANCE.toEntity(programAuditDto);
|
|
ProgramAudit programAudit = ProgramAuditWrapper.INSTANCE.toEntity(programAuditDto);
|
|
|
|
+ //生成项目报告号
|
|
|
|
+ ProgramProjectListInfo projectListInfo = projectListMapper.getById(programAuditDto.getProgramId());
|
|
|
|
+ String reportNo = "";
|
|
|
|
+ if (StringUtils.isNotEmpty(programAuditDto.getProcInsId())) {
|
|
|
|
+ FlowNode currentTask = flowTaskService.getCurrentTask(programAuditDto.getProcInsId());
|
|
|
|
+ if(null != currentTask && StringUtils.isNotBlank(currentTask.getName())) {
|
|
|
|
+ if ("项目三级校审".equals(currentTask.getName())) {
|
|
|
|
+ if (programAuditDto.getStatus().equals("5")) {
|
|
|
|
+ if (projectListInfo.getGenerateReportNumber().equals("false")) {
|
|
|
|
+ if(StringUtils.isNotBlank(projectListInfo.getReportType())){
|
|
|
|
+ if (projectListInfo.getReportType().equals("1")){
|
|
|
|
+ reportNo = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ProgramReportNoDto.BIZ_CODE);
|
|
|
|
+ } else if (projectListInfo.getReportType().equals("2")) {
|
|
|
|
+ reportNo = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ProgramReportNoDto.BIZ_CODE_);
|
|
|
|
+ }
|
|
|
|
+ ProgramReportNo programReportNo = new ProgramReportNo();
|
|
|
|
+ programReportNo.setProgramId(projectListInfo.getId());
|
|
|
|
+ programReportNo.setReportNo(reportNo);
|
|
|
|
+ programReportNoMapper.insert(programReportNo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
if (StringUtils.isNotBlank(programAudit.getId())){
|
|
if (StringUtils.isNotBlank(programAudit.getId())){
|
|
programAuditMapper.updateById(programAudit);
|
|
programAuditMapper.updateById(programAudit);
|
|
}else{
|
|
}else{
|
|
@@ -238,6 +285,24 @@ public class ProjectListService {
|
|
info.setUpdateDate(new Date());
|
|
info.setUpdateDate(new Date());
|
|
info.setDelFlag(0);
|
|
info.setDelFlag(0);
|
|
projectListMapper.updateById(info);
|
|
projectListMapper.updateById(info);
|
|
|
|
+ String reportNo = "";
|
|
|
|
+ if (dto.getGenerateReportNumber().equals("true")) {
|
|
|
|
+ ProgramReportNo programReportNo = programReportNoMapper.selectByProgramId(info.getId());
|
|
|
|
+ if (null == programReportNo) {
|
|
|
|
+ if(StringUtils.isNotBlank(info.getReportType())){
|
|
|
|
+ if (info.getReportType().equals("1")){
|
|
|
|
+ reportNo = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ProgramReportNoDto.BIZ_CODE);
|
|
|
|
+ } else if (info.getReportType().equals("2")) {
|
|
|
|
+ reportNo = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), ProgramReportNoDto.BIZ_CODE_);
|
|
|
|
+ }
|
|
|
|
+ programReportNo = new ProgramReportNo();
|
|
|
|
+ programReportNo.setProgramId(info.getId());
|
|
|
|
+ programReportNo.setReportNo(reportNo);
|
|
|
|
+ programReportNoMapper.insert(programReportNo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
// 修改联系人信息(先删除原有数据,再保存)
|
|
// 修改联系人信息(先删除原有数据,再保存)
|
|
projectLinkMapper.deleteByInfoId(dto.getId());
|
|
projectLinkMapper.deleteByInfoId(dto.getId());
|
|
if (CollectionUtils.isNotEmpty(dto.getLinks())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getLinks())) {
|