Commit 4d064ad2 authored by 侯彦文's avatar 侯彦文

Merge remote-tracking branch 'origin/master'

parents 71819bde 42b39220
......@@ -234,7 +234,7 @@ public class IEDPlanExcelListenner extends AnalysisEventListener<ExtIEDPlanExcel
errorString.append("解析到数据第" + excelDataRow + "行,更新IED计划的文件编号:" + extIEDPlanExcelVO.getFileNumber() + "已完成的计划不能更新!");
errorList.add(errorString);
}
//如果更新时,计划是未完成状态且不是待审阅状态时,不允许更新
//如果更新时,计划是未完成状态且文档不是待审阅状态时,不允许更新
if (Constants.UNFINISHED.equals(iedPlan.getState())) {
DxDocumentVO dxDocumentVO = getDocmentVoByPlanId(iedPlan.getId());
if (!Constants.PENDING_REVIEW.equals(dxDocumentVO.getState())) {
......
......@@ -30,6 +30,8 @@ import com.yonde.dex.basedata.entity.api.CustomMultipartFile;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.basic.feign.expand.ExtDxContextProjectServiceFeign;
import com.yonde.dex.context.common.vo.DxContextProjectVO;
import com.yonde.dex.context.common.vo.DxContextVO;
import com.yonde.dex.dfs.feign.FileManagerFeignService;
import com.yonde.dex.systemfile.feign.SystemFileFeignService;
......@@ -76,6 +78,8 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
private ExtDxDocumentServiceFeign<DxDocumentVO> extDxDocumentServiceFeign;
@Autowired
private ExtIEDPlanDocLinkService extIEDPlanDocLinkService;
@Autowired
private ExtDxContextProjectServiceFeign extDxContextProjectServiceFeign;
@Override
......@@ -146,8 +150,8 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
extIEDPlanExcelVO.setFileNumber(extIEDPlanVO.getFileNumber());
extIEDPlanExcelVO.setFileCode(extIEDPlanVO.getFileCode());
extIEDPlanExcelVO.setFileName(extIEDPlanVO.getFileName());
extIEDPlanExcelVO.setSystemNumber(extIEDPlanVO.getSystemNumber());
extIEDPlanExcelVO.setDeviceNumber(extIEDPlanVO.getDeviceNumber());
extIEDPlanExcelVO.setSystemNumber(extIEDPlanVO.getSystemNumber() == null ? "":extIEDPlanVO.getSystemNumber());
extIEDPlanExcelVO.setDeviceNumber(extIEDPlanVO.getDeviceNumber() == null ? "":extIEDPlanVO.getDeviceNumber());
extIEDPlanExcelVO.setPhase(extIEDPlanVO.getPhase());
if (!ObjectUtil.isEmpty(extIEDPlanVO.getAuditTime())) {
extIEDPlanExcelVO.setAuditTime(extIEDPlanVO.getAuditTime().format(DateTimeFormatter.ISO_DATE));
......@@ -155,15 +159,25 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
if (!ObjectUtil.isEmpty(extIEDPlanVO.getFileSubmitTime())) {
extIEDPlanExcelVO.setFileSubmitTime(extIEDPlanVO.getFileSubmitTime().format(DateTimeFormatter.ISO_DATE));
}
extIEDPlanExcelVO.setEditor(String.valueOf(extIEDPlanVO.getDynamicAttrs().get("editorName")));
extIEDPlanExcelVO.setChecker(String.valueOf(extIEDPlanVO.getDynamicAttrs().get("checkerName")));
extIEDPlanExcelVO.setAuditor(String.valueOf(extIEDPlanVO.getDynamicAttrs().get("auditorName")));
extIEDPlanExcelVO.setInvestigator(String.valueOf(extIEDPlanVO.getDynamicAttrs().get("investigatorName")));
extIEDPlanExcelVO.setRatifier(String.valueOf(extIEDPlanVO.getDynamicAttrs().get("ratifierName")));
extIEDPlanExcelVO.setNote(extIEDPlanVO.getNote());
Object editorName = extIEDPlanVO.getDynamicAttrs().get("editorName");
extIEDPlanExcelVO.setEditor(ObjectUtils.isEmpty(editorName)?"":editorName.toString());
Object checkerName = extIEDPlanVO.getDynamicAttrs().get("checkerName");
extIEDPlanExcelVO.setChecker(ObjectUtils.isEmpty(checkerName)?"":checkerName.toString());
Object auditorName = extIEDPlanVO.getDynamicAttrs().get("auditorName");
extIEDPlanExcelVO.setAuditor(ObjectUtils.isEmpty(auditorName)?"":auditorName.toString());
Object investigatorName = extIEDPlanVO.getDynamicAttrs().get("investigatorName");
extIEDPlanExcelVO.setInvestigator(ObjectUtils.isEmpty(investigatorName)?"":investigatorName.toString());
Object ratifierName = extIEDPlanVO.getDynamicAttrs().get("ratifierName");
extIEDPlanExcelVO.setRatifier(ObjectUtils.isEmpty(ratifierName)?"":ratifierName.toString());
extIEDPlanExcelVO.setNote(extIEDPlanVO.getNote() == null ? "":extIEDPlanVO.getNote());
//获取密级code
String secretCode = CommonUtils.searchDictDataValueByDictCode(Constants.SECRET_CODE, extIEDPlanVO.getSecretCode());
extIEDPlanExcelVO.setSecretCode(secretCode);
extIEDPlanExcelVO.setSecretCode(secretCode == null ? "":secretCode);
extIEDPlanExcelVOList.add(extIEDPlanExcelVO);
}
return extIEDPlanExcelVOList;
......@@ -218,11 +232,10 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
dxDocumentVO.setDynamicAttrs(dynamicAttrs);
//创建时间
dxDocumentVO.setCreateTime(LocalDateTime.now());
//文档扩展类的设备号;
dxDocumentVO.setOwnedEquipment(extIEDPlanVO.getDeviceNumber());
//todo wq 设备号和项目代号需要产品解决,暂时注释
//文档扩展类的设备号
dxDocumentVO.setProjectCode(extIEDPlanVO.getDxContext().getNumber());
//文档扩展类的项目代号
//文档扩展类的项目群的代号
dxDocumentVO.setProjectCode(getProgramProjectCodeByProjectId(extIEDPlanVO.getDxContext()));
//设置扩展属性
dxDocumentVO.setOperator(OperatorType.ADD);
DxDocumentVO dxDocumentVOForDB = extDxDocumentServiceFeign.saveRecursion(dxDocumentVO);
......@@ -295,6 +308,34 @@ public class ExtIEDPlanServiceImpl<V extends ExtIEDPlanVO> implements ExtIEDPlan
return fileName;
}
/**
* 根据项目或子项id查询项目群的项目代号
* @return
*/
public String getProgramProjectCodeByProjectId(DxContextVO dxContextVO){
//project_class = 项目群:program 项目:project 子项:childProject
if("childProject".equals(dxContextVO.getProjectClass())){
//如果是子项,需要查询两次查项目群 --下面是查询项目
SearchQueryCondition searchProject = SearchUtil.buildQuery("parentId", SearchItem.Operator.EQ, dxContextVO.getParentId());
DxPageImpl projectDxPage = extDxContextProjectServiceFeign.findRecursion(searchProject);
DxContextProjectVO project = (DxContextProjectVO)projectDxPage.getContent().get(0);
//根据项目查询项目群
SearchQueryCondition searchProgram = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, project.getParentId());
DxPageImpl programDxPage = extDxContextProjectServiceFeign.findRecursion(searchProgram);
DxContextProjectVO program = (DxContextProjectVO)programDxPage.getContent().get(0);
return program.getNumber();
}else {
//如果是项目,就查询一次查到项目群
SearchQueryCondition searchProgram = SearchUtil.buildQuery("id", SearchItem.Operator.EQ, dxContextVO.getParentId());
DxPageImpl programDxPage = extDxContextProjectServiceFeign.findRecursion(searchProgram);
DxContextProjectVO program = (DxContextProjectVO)programDxPage.getContent().get(0);
return program.getNumber();
}
}
}
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