Commit 9dfa2af4 authored by wangqiang's avatar wangqiang

ExtPlanController:业务代码迁入(2.x版本->4.1版本)--已全部编译通过

parent c41d2718
......@@ -50,6 +50,19 @@
<artifactId>dex-basic-service-common</artifactId>
<version>4.1-RELEASE</version>
</dependency>
<dependency>
<groupId>com.jacob</groupId>
<artifactId>jacob</artifactId>
<version>1.19</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/jacob.jar</systemPath>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
<version>2.0.24</version>
<scope>compile</scope>
</dependency>
</dependencies>
......
......@@ -2,17 +2,20 @@ package com.yonde.dcs.plan.common.utils;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.io.IoUtil;
import com.inet.pdm.constants.Constants;
import com.jacob.activeX.ActiveXComponent;
import com.jacob.com.Dispatch;
import com.jacob.com.Variant;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.plan.common.constants.Constants;
import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.entity.vo.IdVO;
import com.yonde.dex.valut.handler.ContentHolder;
import com.yonde.dex.valut.vo.ObjFileLinkVO;
import com.yonde.dex.dfs.handler.ContentHolder;
import com.yonde.dex.dfs.vo.ObjFileLinkVO;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.pdfbox.io.MemoryUsageSetting;
import org.apache.pdfbox.multipdf.PDFMergerUtility;
import org.springframework.util.CollectionUtils;
......
......@@ -269,6 +269,11 @@ public class ExtPlanVO extends IdOnlyVO implements IdVO ,DxTreeContextVOHolder<E
*/
private String verifier;
/**
* 密级
*/
private String secretCode;
}
......@@ -3,6 +3,7 @@ package com.yonde.dcs.plan.common.vo;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
/**
......@@ -63,13 +64,13 @@ public class PlanExcelVO implements Serializable {
/**
* 开始时间
*/
private Date startTime;
private LocalDateTime startTime;
/**
* 完成时间
*/
private Date completeTime;
private LocalDateTime completeTime;
/**
* 文件分类
......
......@@ -6,7 +6,9 @@ import com.yonde.dcs.plan.common.constants.Constants;
import com.yonde.dcs.plan.common.utils.ExcelUtils;
import com.yonde.dcs.plan.common.utils.FileUtils;
import com.yonde.dcs.plan.common.utils.ResourceHelper;
import com.yonde.dcs.plan.common.vo.ExtPlanDocLinkVO;
import com.yonde.dcs.plan.common.vo.PlanExcelVO;
import com.yonde.dcs.plan.core.service.ExtPlanDocLinkService;
import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
......@@ -18,6 +20,7 @@ import com.yonde.dex.dao.service.util.DxPageUtils;
import com.yonde.dex.dict.feign.DictDataFeignService;
import com.yonde.dex.dict.service.vo.DictDataVO;
import com.yonde.dex.user.common.vo.DxOrganizationVO;
import com.yonde.dex.version.plugin.core.deleteType.IterationDeleteVO;
import dm.jdbc.util.StringUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
......@@ -212,7 +215,7 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
extPlanVO.setState(Constants.PLAN_STATE_UNOPENED);
//todo wq:setDxContextId暂时注释,在2.0中DxContextId 属性在DxObjectVo类中,但在4.1中未找到
//extPlanVO.setDxContextId(projectId);
this.saveRecursion(extPlanVO);
this.saveRecursion((V) extPlanVO);
}
});
}
......@@ -385,7 +388,7 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
//设置Excel的值
BeanUtils.copyProperties(planExcelVO, checkout);
checkout.setOperator(OperatorType.MODIFY);
ExtPlanVO planVO = this.saveRecursion(checkout);
ExtPlanVO planVO = this.saveRecursion((V) checkout);
return planVO;
}
......@@ -444,73 +447,73 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
switch (extPlanVO.getState()) {
//未完成
case Constants.UNFINISHED:
if ("交付文件类".equals(extPlanVO.getFeedbackType()) && !CollectionUtils.isEmpty(extPlanVO.getSourcePlanDocLink())) {
for (PlanDocLinkVO planDocLink : extPlanVO.getSourcePlanDocLink()) {
if (!ObjectUtils.isEmpty(planDocLink.getTarget())) {
if (!extPlanVO.getNumber().equals(excelVO.getNumber())) {
stringBuffer.append(String.format("第%s行的计划编号不允许修改", i + 1) + "</br>");
}
if (!extPlanVO.getName().equals(excelVO.getName())) {
stringBuffer.append(String.format("第%s行的计划名称不允许修改", i + 1) + "</br>");
}
int compare = extPlanVO.getStartTime().compareTo(excelVO.getStartTime());
if (compare != 0) {
stringBuffer.append(String.format("第%s行的计划开始时间不允许修改", i + 1) + "</br>");
}
if (!extPlanVO.getFeedbackType().equals(excelVO.getFeedbackType())) {
stringBuffer.append(String.format("第%s行的计划反馈类型不允许修改", i + 1) + "</br>");
}
if (!extPlanVO.getPlanExecutor().equals(excelVO.getPlanExecutor())) {
stringBuffer.append(String.format("第%s行的计划执行人不允许修改", i + 1) + "</br>");
}
if (!StringUtil.equals(extPlanVO.getFileType(), excelVO.getFileType())) {
stringBuffer.append(String.format("第%s行的计划交付文件类型不允许修改", i + 1) + "</br>");
}
if (!StringUtil.equals(extPlanVO.getFileName(), excelVO.getFileName())) {
stringBuffer.append(String.format("第%s行的计划交付文件名称不允许修改", i + 1) + "</br>");
}
if (!StringUtil.equals(extPlanVO.getFileNumber(), excelVO.getFileNumber())) {
stringBuffer.append(String.format("第%s行的计划交付文件编号不允许修改", i + 1) + "</br>");
}
if (!StringUtil.equals(extPlanVO.getPhaseState(), excelVO.getPhaseState())) {
stringBuffer.append(String.format("第%s行的计划阶段状态不允许修改", i + 1) + "</br>");
}
DxDocumentVO doc = planDocLink.getTarget();
if (Constants.REVIEWING.equals(doc.getState())) {
if (!StringUtil.equals(extPlanVO.getBusinessPlanType(), excelVO.getBusinessPlanType())) {
stringBuffer.append(String.format("第%s行的计划业务计划类型不允许修改", i + 1) + "</br>");
}
if (!StringUtil.equals(extPlanVO.getContractNo(), excelVO.getContractNo())) {
stringBuffer.append(String.format("第%s行的计划合同编号不允许修改", i + 1) + "</br>");
}
if (!StringUtil.equals(extPlanVO.getSuperPlanCode(), excelVO.getSuperPlanCode())) {
stringBuffer.append(String.format("第%s行的计划父级计划编号不允许修改", i + 1) + "</br>");
}
if (!StringUtil.equals(extPlanVO.getFileCode(), excelVO.getFileCode())) {
stringBuffer.append(String.format("第%s行的计划文件代号不允许修改", i + 1) + "</br>");
}
if (!StringUtil.equals(extPlanVO.getProjectCode(), excelVO.getProjectCode())) {
stringBuffer.append(String.format("第%s行的计划项目代号不允许修改", i + 1) + "</br>");
}
if (!StringUtil.equals(extPlanVO.getSystemCode(), excelVO.getSystemCode())) {
stringBuffer.append(String.format("第%s行的计划管理信息系统编码不允许修改", i + 1) + "</br>");
}
if (!StringUtil.equals(extPlanVO.getReview(), excelVO.getReview())) {
stringBuffer.append(String.format("第%s行的计划审核者不允许修改", i + 1) + "</br>");
}
if (!StringUtil.equals(extPlanVO.getApprover(), excelVO.getApprover())) {
stringBuffer.append(String.format("第%s行的计划批准者不允许修改", i + 1) + "</br>");
}
if (!StringUtil.equals(extPlanVO.getVerifier(), excelVO.getVerifier())) {
stringBuffer.append(String.format("第%s行的计划审定者不允许修改", i + 1) + "</br>");
}
}
}
}
}
//todo wq: 2.0是使用extPlanVO.getSourcePlanDocLink,但是在4.0中获取方式?暂时将if前部注释
// if ("交付文件类".equals(extPlanVO.getFeedbackType()) && !CollectionUtils.isEmpty(extPlanVO.getSourcePlanDocLink())) {
// for (PlanDocLinkVO planDocLink : extPlanVO.getSourcePlanDocLink()) {
// if (!ObjectUtils.isEmpty(planDocLink.getTarget())) {
// if (!extPlanVO.getNumber().equals(excelVO.getNumber())) {
// stringBuffer.append(String.format("第%s行的计划编号不允许修改", i + 1) + "</br>");
// }
// if (!extPlanVO.getName().equals(excelVO.getName())) {
// stringBuffer.append(String.format("第%s行的计划名称不允许修改", i + 1) + "</br>");
// }
// int compare = extPlanVO.getStartTime().compareTo(excelVO.getStartTime());
// if (compare != 0) {
// stringBuffer.append(String.format("第%s行的计划开始时间不允许修改", i + 1) + "</br>");
// }
// if (!extPlanVO.getFeedbackType().equals(excelVO.getFeedbackType())) {
// stringBuffer.append(String.format("第%s行的计划反馈类型不允许修改", i + 1) + "</br>");
// }
// if (!extPlanVO.getPlanExecutor().equals(excelVO.getPlanExecutor())) {
// stringBuffer.append(String.format("第%s行的计划执行人不允许修改", i + 1) + "</br>");
// }
//
// if (!StringUtil.equals(extPlanVO.getFileType(), excelVO.getFileType())) {
// stringBuffer.append(String.format("第%s行的计划交付文件类型不允许修改", i + 1) + "</br>");
// }
// if (!StringUtil.equals(extPlanVO.getFileName(), excelVO.getFileName())) {
// stringBuffer.append(String.format("第%s行的计划交付文件名称不允许修改", i + 1) + "</br>");
// }
// if (!StringUtil.equals(extPlanVO.getFileNumber(), excelVO.getFileNumber())) {
// stringBuffer.append(String.format("第%s行的计划交付文件编号不允许修改", i + 1) + "</br>");
// }
// if (!StringUtil.equals(extPlanVO.getPhaseState(), excelVO.getPhaseState())) {
// stringBuffer.append(String.format("第%s行的计划阶段状态不允许修改", i + 1) + "</br>");
// }
//
// DxDocumentVO doc = planDocLink.getTarget();
// if (Constants.REVIEWING.equals(doc.getState())) {
// if (!StringUtil.equals(extPlanVO.getBusinessPlanType(), excelVO.getBusinessPlanType())) {
// stringBuffer.append(String.format("第%s行的计划业务计划类型不允许修改", i + 1) + "</br>");
// }
// if (!StringUtil.equals(extPlanVO.getContractNo(), excelVO.getContractNo())) {
// stringBuffer.append(String.format("第%s行的计划合同编号不允许修改", i + 1) + "</br>");
// }
// if (!StringUtil.equals(extPlanVO.getSuperPlanCode(), excelVO.getSuperPlanCode())) {
// stringBuffer.append(String.format("第%s行的计划父级计划编号不允许修改", i + 1) + "</br>");
// }
// if (!StringUtil.equals(extPlanVO.getFileCode(), excelVO.getFileCode())) {
// stringBuffer.append(String.format("第%s行的计划文件代号不允许修改", i + 1) + "</br>");
// }
// if (!StringUtil.equals(extPlanVO.getProjectCode(), excelVO.getProjectCode())) {
// stringBuffer.append(String.format("第%s行的计划项目代号不允许修改", i + 1) + "</br>");
// }
// if (!StringUtil.equals(extPlanVO.getSystemCode(), excelVO.getSystemCode())) {
// stringBuffer.append(String.format("第%s行的计划管理信息系统编码不允许修改", i + 1) + "</br>");
// }
// if (!StringUtil.equals(extPlanVO.getReview(), excelVO.getReview())) {
// stringBuffer.append(String.format("第%s行的计划审核者不允许修改", i + 1) + "</br>");
// }
// if (!StringUtil.equals(extPlanVO.getApprover(), excelVO.getApprover())) {
// stringBuffer.append(String.format("第%s行的计划批准者不允许修改", i + 1) + "</br>");
// }
// if (!StringUtil.equals(extPlanVO.getVerifier(), excelVO.getVerifier())) {
// stringBuffer.append(String.format("第%s行的计划审定者不允许修改", i + 1) + "</br>");
// }
// }
// }
// }
// }
break;
//已完成
case Constants.COMPLETED:
......@@ -538,9 +541,9 @@ public class ExtPlanServiceImpl<V extends ExtPlanVO> implements ExtPlanService<V
});
if (!CollectionUtils.isEmpty(list)) {
list.stream().forEach(x -> {
DeleteWrap deleteWrap = new DeleteWrap();
IterationDeleteVO deleteWrap = new IterationDeleteVO();
deleteWrap.setDeleteId(x);
deleteWrap.setDeleteType(DeleteWrap.DeleteType.MASTER_ITERATION);
deleteWrap.setDeleteType(IterationDeleteVO.DeleteType.MASTER_ITERATION);
//删除
this.deleteObjByType(deleteWrap);
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment