Commit 224ed2bb authored by pchxue's avatar pchxue

迁移问题处理

parent 16eab8bb
package com.yonde.dcs.common.vo;
import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.time.LocalDateTime;
import java.util.ArrayList;
import cn.hutool.core.convert.Convert;
import com.yonde.dex.basedata.entity.annotation.XmlElementProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.annotation.JsonUnwrapped;
import lombok.ToString;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.math.BigInteger;
import org.springframework.data.annotation.Transient;
import lombok.experimental.Delegate;
import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAttribute;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.DexEmbedded;
import com.yonde.dex.basedata.entity.annotation.ReferenceProperty;
import com.yonde.dex.basedata.entity.annotation.RelationProperty;
import com.yonde.dex.basedata.entity.annotation.VersionProperty;
import com.yonde.dex.basedata.entity.xmladapters.LocalDateTimeXmlAdapter;
import lombok.Data;
import com.yonde.dex.basedata.entity.annotation.*;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import com.yonde.dex.basedata.entity.vo.IdOnlyVO;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.TypeReference;
import com.yonde.dex.basedata.entity.data.VersionRelationType;
import com.yonde.dcs.common.vo.ExtInterfaceVO;
import com.yonde.dex.basedata.entity.vo.DxIdVOEmbeddable;
import com.yonde.dex.basedata.entity.vo.IdOnlyVO;
import com.yonde.dex.basedata.entity.vo.IdVO;
import com.yonde.dex.dfs.objfilelink.plugin.common.entity.DxObjFileLinkVOEmbeddable;
import com.yonde.dex.context.plugin.common.entity.DxContextVOEmbeddable;
import com.yonde.dex.dfs.objfilelink.plugin.common.entity.DxObjFileLinkVOHolder;
import com.yonde.dex.lcycle.plugin.common.entity.DxLifecycleManageBaseVOEmbeddable;
import com.yonde.dex.context.plugin.common.entity.DxContextVOHolder;
import com.yonde.dex.container.folder.plugin.common.entity.DxObjFolderVOEmbeddable;
import com.yonde.dex.version.plugin.common.entity.DxIterationVOEmbeddable;
import com.yonde.dex.basedata.entity.users.DxUserVO;
import com.yonde.dcs.common.vo.ExtApplicantLinkVO;
import com.yonde.dex.lcycle.plugin.common.entity.DxLifecycleManageBaseVOHolder;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOEmbeddable;
import com.yonde.dex.lcycle.plugin.common.entity.DxLifecycleManageBaseVOEmbeddable;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOHolder;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOEmbeddable;
import com.yonde.dex.basedata.entity.vo.IdVO;
import com.yonde.dex.user.common.vo.DxOrganizationVO;
import com.yonde.dex.version.plugin.common.entity.DxIterationVOEmbeddable;
import com.yonde.dex.container.folder.plugin.common.entity.DxObjFolderVOHolder;
import com.yonde.dex.dfs.objfilelink.plugin.common.entity.DxObjFileLinkVOEmbeddable;
import com.yonde.dex.version.plugin.common.entity.DxIterationVOHolder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.time.LocalDateTime;
import java.util.List;
/**
* @description: ExtApplicant-VO
* @author: dexadmin
* @version: V
* @date: 2024-7-15 15:32:39
**/
* @description: ExtApplicant-VO
* @author: dexadmin
* @version: V
* @date: 2024-8-15 16:14:30
**/
@JsonTypeInfo( use = JsonTypeInfo.Id.CLASS, property = "dxClassname", visible = true, defaultImpl = ExtApplicantVO.class)
@EqualsAndHashCode(callSuper = true)
@Data
@ToString(callSuper = true)
public class ExtApplicantVO extends IdOnlyVO implements IdVO ,DxLifecycleManageBaseVOHolder ,DxObjFileLinkVOHolder ,DxIterationVOHolder<ExtApplicantVO> ,DxLogicDeleteVOHolder{
public class ExtApplicantVO extends IdOnlyVO implements IdVO ,DxContextVOHolder ,DxLifecycleManageBaseVOHolder ,DxObjFileLinkVOHolder ,DxObjFolderVOHolder ,DxIterationVOHolder<ExtApplicantVO> ,DxLogicDeleteVOHolder{
public static final String DX_CONTEXT_EMBEDDABLE_PROP_NAME = "dxContextEmbeddable";
public static final String DX_OBJ_FILE_LINK_EMBEDDABLE_PROP_NAME = "dxObjFileLinkEmbeddable";
public static final String DX_OBJ_FOLDER_EMBEDDABLE_PROP_NAME = "dxObjFolderEmbeddable";
public static final String DX_LIFECYCLE_MANAGE_BASE_EMBEDDABLE_PROP_NAME = "dxLifecycleManageBaseEmbeddable";
public static final String DX_ID_EMBEDDABLE_PROP_NAME = "dxIdEmbeddable";
public static final String DX_LOGIC_DELETE_EMBEDDABLE_PROP_NAME = "dxLogicDeleteEmbeddable";
......@@ -55,6 +80,13 @@ public class ExtApplicantVO extends IdOnlyVO implements IdVO ,DxLifecycleManageB
public static final String TARGET_EXT_APPLICANT_LINK_PROP_NAME = "targetExtApplicantLink";
public static final String TYPE_PROP_NAME = "type";
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxContextVOEmbeddable dxContextEmbeddable;
/**
* 扩展VO属性
*/
......@@ -62,6 +94,13 @@ public class ExtApplicantVO extends IdOnlyVO implements IdVO ,DxLifecycleManageB
@JsonIgnore
private DxObjFileLinkVOEmbeddable dxObjFileLinkEmbeddable;
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxObjFolderVOEmbeddable dxObjFolderEmbeddable;
/**
* 扩展VO属性
*/
......
package com.yonde.dcs.common.vo;
import javax.validation.constraints.NotBlank;
import java.util.Date;
import java.time.LocalDateTime;
import java.util.ArrayList;
import cn.hutool.core.convert.Convert;
import com.yonde.dex.basedata.entity.annotation.XmlElementProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.annotation.JsonUnwrapped;
import lombok.ToString;
import com.fasterxml.jackson.annotation.JsonIgnore;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.math.BigInteger;
import org.springframework.data.annotation.Transient;
import lombok.experimental.Delegate;
import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAttribute;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotNull;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.DexEmbedded;
import com.yonde.dex.basedata.entity.annotation.ReferenceProperty;
import com.yonde.dex.basedata.entity.annotation.RelationProperty;
import com.yonde.dex.basedata.entity.annotation.VersionProperty;
import com.yonde.dex.basedata.entity.xmladapters.LocalDateTimeXmlAdapter;
import lombok.Data;
import com.yonde.dex.basedata.entity.annotation.*;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import com.yonde.dex.basedata.entity.vo.IdOnlyVO;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.TypeReference;
import com.yonde.dex.basedata.entity.data.VersionRelationType;
import com.yonde.dex.basedata.entity.vo.DxIdVOEmbeddable;
import com.yonde.dex.basedata.entity.vo.IdOnlyVO;
import com.yonde.dex.basedata.entity.vo.IdVO;
import com.yonde.dex.dfs.objfilelink.plugin.common.entity.DxObjFileLinkVOEmbeddable;
import com.yonde.dex.context.plugin.common.entity.DxContextVOEmbeddable;
import com.yonde.dex.dfs.objfilelink.plugin.common.entity.DxObjFileLinkVOHolder;
import com.yonde.dex.lcycle.plugin.common.entity.DxLifecycleManageBaseVOEmbeddable;
import com.yonde.dex.context.plugin.common.entity.DxContextVOHolder;
import com.yonde.dex.container.folder.plugin.common.entity.DxObjFolderVOEmbeddable;
import com.yonde.dex.version.plugin.common.entity.DxIterationVOEmbeddable;
import com.yonde.dex.basedata.entity.users.DxUserVO;
import com.yonde.dex.lcycle.plugin.common.entity.DxLifecycleManageBaseVOHolder;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOEmbeddable;
import com.yonde.dcs.common.vo.ExtInterfaceDocLinkVO;
import com.yonde.dex.lcycle.plugin.common.entity.DxLifecycleManageBaseVOEmbeddable;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOHolder;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOEmbeddable;
import com.yonde.dex.basedata.entity.vo.IdVO;
import com.yonde.dcs.common.vo.ExtApplicantVO;
import com.yonde.dcs.common.vo.ExtAuditInterfLinkVO;
import com.yonde.dex.user.common.vo.DxOrganizationVO;
import com.yonde.dex.container.folder.plugin.common.entity.DxObjFolderVOHolder;
import com.yonde.dex.user.common.vo.DxUserInfoVO;
import com.yonde.dex.version.plugin.common.entity.DxIterationVOEmbeddable;
import com.yonde.dex.dfs.objfilelink.plugin.common.entity.DxObjFileLinkVOEmbeddable;
import com.yonde.dex.version.plugin.common.entity.DxIterationVOHolder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.time.LocalDateTime;
import java.util.List;
/**
* @description: ExtInterface-VO
* @author: dexadmin
* @version: V
* @date: 2024-7-15 15:32:39
**/
* @description: ExtInterface-VO
* @author: dexadmin
* @version: V
* @date: 2024-8-15 16:08:09
**/
@JsonTypeInfo( use = JsonTypeInfo.Id.CLASS, property = "dxClassname", visible = true, defaultImpl = ExtInterfaceVO.class)
@EqualsAndHashCode(callSuper = true)
@Data
@ToString(callSuper = true)
public class ExtInterfaceVO extends IdOnlyVO implements DxIterationVOHolder<ExtInterfaceVO> ,IdVO ,DxLifecycleManageBaseVOHolder ,DxObjFileLinkVOHolder ,DxLogicDeleteVOHolder{
public class ExtInterfaceVO extends IdOnlyVO implements DxIterationVOHolder<ExtInterfaceVO> ,IdVO ,DxContextVOHolder ,DxLifecycleManageBaseVOHolder ,DxObjFileLinkVOHolder ,DxObjFolderVOHolder ,DxLogicDeleteVOHolder{
public static final String DX_CONTEXT_EMBEDDABLE_PROP_NAME = "dxContextEmbeddable";
public static final String DX_OBJ_FILE_LINK_EMBEDDABLE_PROP_NAME = "dxObjFileLinkEmbeddable";
public static final String DX_OBJ_FOLDER_EMBEDDABLE_PROP_NAME = "dxObjFolderEmbeddable";
public static final String DX_LIFECYCLE_MANAGE_BASE_EMBEDDABLE_PROP_NAME = "dxLifecycleManageBaseEmbeddable";
public static final String DX_ID_EMBEDDABLE_PROP_NAME = "dxIdEmbeddable";
public static final String DX_LOGIC_DELETE_EMBEDDABLE_PROP_NAME = "dxLogicDeleteEmbeddable";
......@@ -66,6 +92,13 @@ public class ExtInterfaceVO extends IdOnlyVO implements DxIterationVOHolder<ExtI
public static final String PROVIDER_ORG_ID_TYPE_PROP_NAME = "providerOrgIdType";
public static final String TZRQ_PROP_NAME = "tzrq";
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxContextVOEmbeddable dxContextEmbeddable;
/**
* 扩展VO属性
*/
......@@ -73,6 +106,13 @@ public class ExtInterfaceVO extends IdOnlyVO implements DxIterationVOHolder<ExtI
@JsonIgnore
private DxObjFileLinkVOEmbeddable dxObjFileLinkEmbeddable;
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxObjFolderVOEmbeddable dxObjFolderEmbeddable;
/**
* 扩展VO属性
*/
......
......@@ -163,6 +163,11 @@
<groupId>com.yonde.dex</groupId>
<artifactId>dex-wfc-common</artifactId>
</dependency>
<dependency>
<groupId>com.luhuiguo</groupId>
<artifactId>aspose-words</artifactId>
<version>23.1</version>
</dependency>
</dependencies>
</project>
......@@ -10,12 +10,18 @@ import com.yonde.dcs.core.service.ExtSendFormLinkService;
import com.yonde.dcs.core.util.ExtDocUtil;
import com.yonde.dcs.core.util.ExtWfcUtil;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.esign.plugin.message.WfcSignMessage;
import com.yonde.dcs.plan.common.vo.ExtPlanVO;
import com.yonde.dex.basedata.entity.api.ApiResult;
import com.yonde.dex.basedata.entity.vo.IdVO;
import com.yonde.dex.taskmonitor.api.data.TaskMessage;
import com.yonde.dex.taskmonitor.api.data.TaskMessageContext;
import com.yonde.dex.taskmonitor.api.data.TaskMessageStatus;
import com.yonde.dex.taskmonitor.api.interfaces.TaskMessageBuilder;
import com.yonde.dex.taskmonitor.api.interfaces.TaskMessagePusher;
import com.yonde.dex.wfc.common.vo.DxWfProcessSearchVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessVO;
import com.yonde.dex.wfc.common.vo.DxWfTaskContext;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -26,8 +32,8 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.Date;
import java.util.Map;
import java.time.LocalDateTime;
import java.util.*;
/**
* @program: service
......@@ -70,14 +76,29 @@ public class ExtAutoTaskController {
pboKey = "doc";
signNode = "Activity_0st1yf8";
}
// DxWfTaskContext dxWfTaskContext = new DxWfTaskContext(dxWfProcessVO.getBusinessKey(), dxWfProcessVO.getId(), dxWfProcessVO.getProcessDef().getId(), signNode, null, (Map) null);
//todo 在4.1中未找到WfcSignMessage 注释了71-74行
// WfcSignMessage wfcSignMessage = new WfcSignMessage(new HashMap());
// wfcSignMessage.setWfTaskContext(dxWfTaskContext);
// TODO: WfcSignMessageBuilder不存在,根据2.1代码 new TaskMessage();
// WfTaskContext wfTaskContext = new WfTaskContext(wfProcessInstVO.getBusinessKey(), wfProcessInstVO.getId(), wfProcessInstVO.getProcessDef().getId(), signNode, null, (Map) null);
// WfcSignMessage wfcSignMessage = new WfcSignMessage(new HashMap());
// wfcSignMessage.setWfTaskContext(wfTaskContext);
// wfcSignMessage.setSignType(pboKey);
// TaskMessage taskMessage = (new WfcSignMessageBuilder()).newTasks(wfcSignMessage);
// this.taskMessagePusher.sendMessage(taskMessage);
this.taskMessagePusher.sendMessage(null);
DxWfTaskContext dxWfTaskContext = new DxWfTaskContext();
dxWfTaskContext.setPboKey(dxWfProcessVO.getBusinessKey());
dxWfTaskContext.setProcessId(dxWfProcessVO.getId());
dxWfTaskContext.setProcessDefId( dxWfProcessVO.getProcDefId());
dxWfTaskContext.setCurrentActivityId(signNode);
WfcSignMessage wfcSignMessage = new WfcSignMessage(new HashMap<>());
wfcSignMessage.setWfTaskContext(dxWfTaskContext);
wfcSignMessage.setSignType(pboKey);
TaskMessage taskMessage = new TaskMessage();
taskMessage.setStartTime(LocalDateTime.now());
taskMessage.setFunKey("sign");
taskMessage.setDetails((List<Map<String, Object>>) wfcSignMessage.getContext());
taskMessage.setProcessKey(TaskMessageStatus.START.name());
taskMessage.setStatus(TaskMessageStatus.START);
taskMessage.setUpdateTime(taskMessage.getStartTime());
this.taskMessagePusher.sendMessage(taskMessage);
return ApiResult.ok("重新发送电子签名请求成功!");
} else {
return ApiResult.ok("该对象未走签审流程!");
......
package com.yonde.dcs.core.factory;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.yonde.dcs.core.constants.Constants;
import com.yonde.dcs.core.constants.SignConstants;
import com.yonde.dcs.core.service.ExtDocService;
import com.yonde.dcs.core.word.ImportWordService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dex.dfs.vo.ObjFileLinkVO;
import com.yonde.dex.wfc.common.vo.DxWfActivityVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author xfchai
* @ClassName ContactListUtils.java
* @Description 技术联系单填充业务数据类
* @createTime 2021/11/22 14:20:00
*/
@Component
public class ContactListUtils {
@Autowired
private ExtDocService extDocService;
@Autowired
private ImportWordService importWordService;
/**
* 填充数据
*
* @param
* @return
*/
public void settingData(DxDocumentVO v, DxWfProcessInfoVO wfProcessInfoVO) {
String path = Constants.MTEMPLATE_ABSOLUTE_PATH;
String file = v.getSubTypeName();
String outFilePath = Constants.MERGER_FILE_ABSOLUTE_PATH + v.getSubTypeName() + "\\" + v.getNumber() + "\\";
//生成特定的文档目录,保存生成的word文件
FileUtil.mkdir(outFilePath);
//获取动态属性
Map<String, Object> dynamicAttrs = v.getDynamicAttrs();
String category = Objects.isNull(dynamicAttrs.get("category")) ? "" : (String) dynamicAttrs.get("category");
String content = Objects.isNull(dynamicAttrs.get("content")) ? "" : (String) dynamicAttrs.get("content");
String recipient = Objects.isNull(dynamicAttrs.get("recipient")) ? "" : (String) dynamicAttrs.get("recipient");
JSONObject jsonObject = new JSONObject();
//密级
String secretCode = v.getSecretCode();
jsonObject.put("SecretCode", extDocService.searchDictDataByDictCode(Constants.SECRET_CODE, secretCode));
//项目代号
String projectCode = ObjectUtils.isEmpty(v.getDxDocumentExpand().getProjectCode()) ? "" : v.getDxDocumentExpand().getProjectCode();
jsonObject.put("projectCode", projectCode);
//类别
jsonObject.put("category", extDocService.searchDictDataByDictCode(Constants.CATEGORY, category));
//技术联系单编号
jsonObject.put("number", ObjectUtils.isEmpty(v.getNumber()) ? "" : v.getNumber());
//技术联系单名称
jsonObject.put("name", ObjectUtils.isEmpty(v.getName()) ? "" : v.getName());
//页数
jsonObject.put("pages", v.getDxDocumentExpand().getAttachPages());
//判断类型为:内部外部
String type = (String) dynamicAttrs.get("type");
//拼接字符
if (Constants.INTER_CONTACT.equals(type)) {
List<String> proposingUnit = (ArrayList) dynamicAttrs.get("proposingUnit");
//内部-提出单位
jsonObject.put("proposingUnit", JoinUnitStr(proposingUnit));
List<String> interReceiveUnit = (ArrayList) dynamicAttrs.get("interReceiveUnit");
//内部-收件人单位
jsonObject.put("recipUnit", JoinUnitStr(interReceiveUnit));
} else {
//外部-提出单位
jsonObject.put("proposingUnit", "清华大学核研院");
//外部-收件人单位
jsonObject.put("recipUnit", this.generateProposer((String) dynamicAttrs.get("extReceiveUnit")));
}
//收件人
jsonObject.put("recipient", recipient);
//内容
jsonObject.put("content", content);
//备注
jsonObject.put("remark", ObjectUtils.isEmpty(v.getNote()) ? "" : v.getNote());
//校验技术联系单是否有内容附件
this.checkObjFileLinks(jsonObject, v.getObjFileLinks(), "");
//获取参与者
List<DxWfActivityVO> activities = wfProcessInfoVO.getActivityInfo();
if (!CollectionUtils.isEmpty(activities)) {
//写入签名数据
jsonObject.put("bz_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("bz_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("sh_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_SH));
jsonObject.put("sh_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_SH));
//分系统总师审核
jsonObject.put("fxtsh_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_FXTZSSH));
jsonObject.put("fxtsh_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_FXTZSSH));
jsonObject.put("pz_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_APPROVED));
jsonObject.put("pz_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_APPROVED));
//总体室审核
jsonObject.put("zts_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_ZTSSH));
jsonObject.put("zts_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_ZTSSH));
}
//模板名称
importWordService.getWordAllTable(jsonObject, path + file + ".docx", outFilePath + "outFile.docx");
}
/**
* 校验是否有内容附件
*
* @param jsonObject
* @param objFileLinks
* @param attach
*/
private void checkObjFileLinks(JSONObject jsonObject, List<ObjFileLinkVO> objFileLinks, String attach) {
if (CollectionUtils.isEmpty(objFileLinks)) {
//对号
jsonObject.put("noselect", "\u0052");
//方框
jsonObject.put("select", "\u00A3");
} else {
List<ObjFileLinkVO> collect = objFileLinks.stream().filter(item ->
Constants.CONTACT_CONTENT_ATTACH.equals(item.getContentType())
).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(collect)) {
jsonObject.put("noselect", "\u00A3");
jsonObject.put("select", "\u0052");
} else {
//对号
jsonObject.put("noselect", "\u0052");
//方框
jsonObject.put("select", "\u00A3");
}
}
}
/**
* 获取内部技术联系单类型
*
* @param proposingUnit
* @return
*/
private String JoinUnitStr(List<String> proposingUnit) {
StringJoiner joiner = new StringJoiner(",");
if (!CollectionUtils.isEmpty(proposingUnit)) {
proposingUnit.stream().forEach(item -> {
joiner.add(item);
});
}
return joiner.toString();
}
/**
* 获取外部收文单位
*
* @param proposer
* @return
*/
private String generateProposer(String proposer) {
if (StringUtils.isEmpty(proposer)) {
return "";
}
//根据提出方获取提出方单位
String[] split = proposer.split(",");
//拼接字符
StringJoiner joiner = new StringJoiner(",");
for (String proSplit : split) {
if (proSplit.length() > 0) {
//字典为外单位
String s = extDocService.searchDictDataByDictCode(Constants.NCR_SUPPLIER, proSplit);
joiner.add(s);
}
}
return joiner.toString();
}
}
package com.yonde.dcs.core.factory;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.yonde.dcs.common.vo.ExtAtlasDrawingLinkVO;
import com.yonde.dcs.common.vo.ExtRelatedDenLinkVO;
import com.yonde.dcs.core.constants.Constants;
import com.yonde.dcs.core.constants.SignConstants;
import com.yonde.dcs.core.service.ExtAtlasDrawingLinkService;
import com.yonde.dcs.core.service.ExtDocService;
import com.yonde.dcs.core.util.DateUtils;
import com.yonde.dcs.core.word.ImportWordService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.document.feign.DocCenterFeignService;
import com.yonde.dcs.entity.excel.DENPojo;
import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.dao.service.util.DxPageUtils;
import com.yonde.dex.dfs.vo.ObjFileLinkVO;
import com.yonde.dex.wfc.common.vo.DxWfActivityVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.StringJoiner;
import java.util.stream.Collectors;
/**
* @author xfchai
* @ClassName DENUtils.java
* @Description 设计澄清单签名属性
* @createTime 2022/01/19 17:34:00
*/
@Component
public class DENUtils {
@Autowired
private ExtDocService extDocService;
@Autowired
private ImportWordService importWordService;
@Resource
DocCenterFeignService docCenterFeignService;
@Autowired
private ExtAtlasDrawingLinkService atlasDrawingLinkService;
/**
* 填充数据
*
* @param
* @return
*/
public JSONObject settingData(DxDocumentVO v, DxWfProcessInfoVO wfProcessInfoVO) {
String path = Constants.MTEMPLATE_ABSOLUTE_PATH;
String file = v.getSubTypeName();
String outFilePath = Constants.MERGER_FILE_ABSOLUTE_PATH + v.getSubTypeName() + "\\" + v.getNumber() + "\\";
//生成特定的文档目录,保存生成的word文件
FileUtil.mkdir(outFilePath);
//获取动态属性
Map<String, Object> dynamicAttrs = v.getDynamicAttrs();
JSONObject jsonObject = new JSONObject();
//申请单位
jsonObject.put("applicant", (String) dynamicAttrs.get("applicant"));
//项目代号
jsonObject.put("projectCode", v.getDxDocumentExpand().getProjectCode());
jsonObject.put("number", v.getNumber());
jsonObject.put("name", v.getName());
//DEN编号
//对号
jsonObject.put("selectnumber", "\u0052");
//文件属性List(CAA附件)
List<ObjFileLinkVO> objFileLinks = v.getObjFileLinks();
List<DENPojo> denPojoList = this.getDenPojoList(v);
jsonObject.put("denFileLists", denPojoList);
//澄清说明
jsonObject.put("clarification", (String) dynamicAttrs.get("clarification"));
//提出方(proposer)
jsonObject.put("approver", this.generateProposer((String) dynamicAttrs.get("proposer")));
//收件人
jsonObject.put("recipient", (String) dynamicAttrs.get("recipient"));
//收件单位
jsonObject.put("foreignUnit", this.generateProposer((String) dynamicAttrs.get("foreignUnit")));
//需澄清事项描述
jsonObject.put("clarifyDescrip", (String) dynamicAttrs.get("clarifyDescrip"));
jsonObject.put("remark", (String) dynamicAttrs.get("remark"));
//页数
jsonObject.put("pages",v.getDxDocumentExpand().getAttachPages());
List<DxWfActivityVO> activities = wfProcessInfoVO.getActivityInfo();
if (!CollectionUtils.isEmpty(activities)) {
//写入签名数据
jsonObject.put("bz_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("bz_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("sh_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_SH));
jsonObject.put("sh_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_SH));
jsonObject.put("pz_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_APPROVED));
jsonObject.put("pz_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_APPROVED));
}
//模板名称
importWordService.getWordAllTable(jsonObject, path + file + ".docx", outFilePath + "outFile.docx");
return jsonObject;
}
/**
* 获取提出方
*
* @param proposer
* @return
*/
private String generateProposer(String proposer) {
if (StringUtils.isEmpty(proposer)) {
return "";
}
//根据提出方获取提出方单位
String[] split = proposer.split(",");
//拼接字符
StringJoiner joiner = new StringJoiner(",");
for (String proSplit : split) {
if (proSplit.length() > 0) {
//字典为外单位
String s = extDocService.searchDictDataByDictCode(Constants.NCR_SUPPLIER, proSplit);
joiner.add(s);
}
}
return joiner.toString();
}
/**
* 获取CAA附件数据
*
* @param v
* @return
*/
private List<DENPojo> getDenPojoList(DxDocumentVO v) {
List<ExtRelatedDenLinkVO> sourceRelatedDenLink = null;
if (StringUtils.isEmpty(v.getId())) {
//新增
// TODO: 2024/8/15 getSourceRelatedDenLink不存在
// sourceRelatedDenLink = v.getSourceRelatedDenLink();
} else {
//修改
//查询CAA附件
DxDocumentVO docOpenProps = this.findDocOpenProps(v.getId());
if (ObjectUtils.isEmpty(docOpenProps)) {
return null;
}
// TODO: 2024/8/15 getSourceRelatedDenLink不存在
// sourceRelatedDenLink = docOpenProps.getSourceRelatedDenLink();
}
List<DxDocumentVO> denTarget = new ArrayList<>();
List<DxDocumentVO> sourceAtlasDrawingLinkS = new ArrayList<>();
//CAA附件判断是否为空
if (!CollectionUtils.isEmpty(sourceRelatedDenLink)) {
sourceRelatedDenLink.stream().forEach(item -> denTarget.add(item.getTarget()));
}
//denTarget对应的是图纸,需要查询该图纸下的图册
if (!CollectionUtils.isEmpty(denTarget)) {
denTarget.stream().forEach(target -> {
Long versionId = target.getVersionId();
ExtAtlasDrawingLinkVO atlasDrawingLink = this.findAtlasDrawingLink(versionId);
if (!ObjectUtils.isEmpty(atlasDrawingLink)) {
DxDocumentVO source = atlasDrawingLink.getSource();
sourceAtlasDrawingLinkS.add(source);
}
});
}
List<DxDocumentVO> collect = new ArrayList<>();
//过滤相同集合数据
if (!CollectionUtils.isEmpty(sourceAtlasDrawingLinkS)) {
collect = sourceAtlasDrawingLinkS.stream().distinct().collect(Collectors.toList());
}
//当前状态
String state = v.getState();
List<DENPojo> denPojoList = new ArrayList<>();
if (!CollectionUtils.isEmpty(collect)) {
for (int i = 0; i < collect.size(); i++) {
DENPojo denPojo = new DENPojo();
DxDocumentVO dxDocumentVO = collect.get(i);
denPojo.setSnumber(Integer.toString(i + 1));
denPojo.setFileName(dxDocumentVO.getName());
denPojo.setFileNumber(dxDocumentVO.getNumber());
//转换成字典值
denPojo.setState("已发布");
denPojo.setPublishDate(DateUtils.converLocalDateToString(dxDocumentVO.getModifyTime()));
denPojo.setVersion(dxDocumentVO.getDisplayVersion());
//todo:先不做当前状态的判断
/* switch(state){
case Constants.RELEASED: denPojo.setDcq("√"); break;
}
if(state.equals("pendingReview")){
}*/
denPojoList.add(denPojo);
}
}
return denPojoList;
}
/**
* 通过id查询文档附件
*
* @param id
* @return
*/
private DxDocumentVO findDocOpenProps(Long id) {
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("sourceRelatedDenLink").openProp(SearchQueryCondition.builder().name("target").build()).build())
.openProp(SearchQueryCondition.builder().name("objFileLinks").openProp(SearchQueryCondition.builder().name("target").build()).build())
.searchItems(SearchItems.builder().item(new SearchItem("id", SearchItem.Operator.EQ,
id, null)).item(new SearchItem("latest", SearchItem.Operator.EQ,
true, null)).operator(SearchItems.BooleanOperator.AND).build()).build();
//通过id查询文档
DxPageImpl<DxDocumentVO> recursion = docCenterFeignService.findRecursion(queryDoc);
if (!CollectionUtils.isEmpty(recursion.getContent())) {
DxDocumentVO dxDocumentVO = DxPageUtils.getFirst(recursion);
return dxDocumentVO;
}
return null;
}
/**
* 通过targetId获取图册信息
*
* @param targetId
* @return
*/
private ExtAtlasDrawingLinkVO findAtlasDrawingLink(Long targetId) {
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("source").build())
.searchItems(SearchItems.builder().item(new SearchItem("targetId", SearchItem.Operator.EQ,
targetId, null)).operator(SearchItems.BooleanOperator.AND).build()).build();
//通过id查询文档
DxPageImpl<ExtAtlasDrawingLinkVO> recursion = atlasDrawingLinkService.findRecursion(queryDoc);
if (!CollectionUtils.isEmpty(recursion.getContent())) {
ExtAtlasDrawingLinkVO atlasDrawingLinkVO = DxPageUtils.getFirst(recursion);
return atlasDrawingLinkVO;
}
return null;
}
}
package com.yonde.dcs.core.factory;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.yonde.dcs.common.vo.ExtAtlasDrawingLinkVO;
import com.yonde.dcs.common.vo.ExtRelatedDcrLinkVO;
import com.yonde.dcs.core.constants.Constants;
import com.yonde.dcs.core.constants.DictConstants;
import com.yonde.dcs.core.constants.SignConstants;
import com.yonde.dcs.core.service.ExtAtlasDrawingLinkService;
import com.yonde.dcs.core.service.ExtDocService;
import com.yonde.dcs.core.service.ExtRelatedDcrLinkService;
import com.yonde.dcs.core.util.DateUtils;
import com.yonde.dcs.core.word.ImportWordService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.entity.excel.DENPojo;
import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.dao.service.util.DxPageUtils;
import com.yonde.dex.wfc.common.vo.DxWfActivityVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author xfchai
* @ClassName DesignChangeUtils.java
* @Description 设计变更
* @createTime 2021/11/23 09:24:00
*/
@Component
public class DesignChangeUtils {
@Autowired
private ExtDocService extDocService;
@Autowired
private ImportWordService importWordService;
@Autowired
private ExtRelatedDcrLinkService relatedDcrLinkService;
@Autowired
private ExtAtlasDrawingLinkService atlasDrawingLinkService;
/**
* 填充数据
* DOC_PDF_FILE,ATTACH_FILE
*
* @param
* @return
*/
public Map<String, Object> settingData(DxDocumentVO v, DxWfProcessInfoVO wfProcessInfoVO) {
String path = Constants.MTEMPLATE_ABSOLUTE_PATH;
String file = v.getSubTypeName();
String outFilePath = Constants.MERGER_FILE_ABSOLUTE_PATH + v.getSubTypeName() + "\\" + v.getNumber() + "\\";
//生成特定的文档目录,保存生成的word文件
FileUtil.mkdir(outFilePath);
//获取动态属性
Map<String, Object> dynamicAttrs = v.getDynamicAttrs();
String category = Objects.isNull(dynamicAttrs.get("category")) ? "" : (String) dynamicAttrs.get("category");
String content = Objects.isNull(dynamicAttrs.get("content")) ? "" : (String) dynamicAttrs.get("content");
String recipient = Objects.isNull(dynamicAttrs.get("recipient")) ? "" : (String) dynamicAttrs.get("recipient");
String proposer = Objects.isNull(dynamicAttrs.get("proposer")) ? "" : (String) dynamicAttrs.get("proposer");
String recipientUnit = Objects.isNull(dynamicAttrs.get("recipientUnit")) ? "" : (String) dynamicAttrs.get("recipientUnit");
JSONObject jsonObject = new JSONObject();
//项目代号
String projectCode = ObjectUtils.isEmpty(v.getDxDocumentExpand().getProjectCode()) ? "" : v.getDxDocumentExpand().getProjectCode();
//对号(DCR编号)
jsonObject.put("selectdcrnumber", "\u0052");
jsonObject.put("dcrNumber", v.getNumber());
jsonObject.put("projectCode", projectCode);
//类别
jsonObject.put("category", extDocService.searchDictDataByDictCode(Constants.CATEGORY, category));
//技术联系单编号
jsonObject.put("number", ObjectUtils.isEmpty(v.getNumber()) ? "" : v.getNumber());
//技术联系单名称
jsonObject.put("name", ObjectUtils.isEmpty(v.getName()) ? "" : v.getName());
//提出方(proposer: "design,afterSales")
jsonObject.put("proposer", this.generateProposer(proposer));
//收件人
jsonObject.put("recipient", recipient);
//收件单位
jsonObject.put("recipientUnit", this.generateProposer(recipientUnit));
//内容
jsonObject.put("content", content);
//备注
jsonObject.put("remark", ObjectUtils.isEmpty(v.getNote()) ? "" : v.getNote());
//答复方
jsonObject.put("respondents", (String) dynamicAttrs.get("respondents"));
//设计接口描述
jsonObject.put("invInterDescript", (String) dynamicAttrs.get("invInterDescript"));
//进度影响分析
jsonObject.put("impactAnalysis", (String) dynamicAttrs.get("impactAnalysis"));
//更改内容
jsonObject.put("clarification", (String) dynamicAttrs.get("changeContent"));
//更改答复说明
jsonObject.put("changeReplyDescript", (String) dynamicAttrs.get("changeReplyDescript"));
//更改原因
String changeReason = (String) dynamicAttrs.get("changeReason");
this.checkChangeReason(jsonObject, changeReason);
//建议更改(变更)方案
String changeScenario = (String) dynamicAttrs.get("changeScenario");
this.checkChangeReason(jsonObject, changeScenario);
//设计更改(变更)程度:
String degreeChange = (String) dynamicAttrs.get("degreeChange");
this.checkChangeReason(jsonObject, degreeChange);
List<DENPojo> denPojoList = this.searchRelateDcrLink(v);
jsonObject.put("denFileLists", denPojoList);
//页数
jsonObject.put("pages",v.getDxDocumentExpand().getAttachPages());
//CAA附件(是否)
Long versionId = v.getVersionId();
List<ExtRelatedDcrLinkVO> searchRelateDcrLink = this.findSearchRelateDcrLink(versionId);
if (CollectionUtils.isEmpty(searchRelateDcrLink)) {
//对号
jsonObject.put("noselect1", "\u0052");
//方框
jsonObject.put("select1", "\u00A3");
} else {
//对号
jsonObject.put("select1", "\u0052");
//方框
jsonObject.put("noselect1", "\u00A3");
}
//获取参与者
List<DxWfActivityVO> activities = wfProcessInfoVO.getActivityInfo();
if (!CollectionUtils.isEmpty(activities)) {
//写入签名数据
jsonObject.put("bz_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("bz_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("sh_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_SH));
jsonObject.put("sh_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_SH));
//总体室审核
// jsonObject.put("zts_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_ZTSSH));
// jsonObject.put("zts_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_ZTSSH));
jsonObject.put("pz_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_APPROVED));
jsonObject.put("pz_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_APPROVED));
}
//模板名称
importWordService.getWordAllTable(jsonObject, path + file + ".docx", outFilePath + "outFile.docx");
return jsonObject;
}
/**
* 更改原因填值
*
* @param jsonObject
* @param changeReason
*/
private void checkChangeReason(JSONObject jsonObject, String changeReason) {
switch (changeReason) {
case DictConstants.DESIGN_CHANGES:
//对号
jsonObject.put("desuch", "\u0052");
jsonObject.put("Interfacech", "\u00A3");
jsonObject.put("Materiarep", "\u00A3");
jsonObject.put("others", "\u00A3");
break;
case DictConstants.INTERFACE_CHANGE:
jsonObject.put("desuch", "\u00A3");
jsonObject.put("Interfacech", "\u0052");
jsonObject.put("Materiarep", "\u00A3");
jsonObject.put("others", "\u00A3");
break;
case DictConstants.MATERIAL_SUBSTITUT:
jsonObject.put("desuch", "\u00A3");
jsonObject.put("Interfacech", "\u00A3");
jsonObject.put("Materiarep", "\u0052");
jsonObject.put("others", "\u00A3");
break;
case DictConstants.OTHERS:
jsonObject.put("desuch", "\u00A3");
jsonObject.put("Interfacech", "\u00A3");
jsonObject.put("Materiarep", "\u00A3");
jsonObject.put("others", "\u0052");
break;
//设计更改(变更)程度
case DictConstants.CLASS_ONE:
jsonObject.put("deg1", "\u0052");
jsonObject.put("deg2a", "\u00A3");
jsonObject.put("deg2b", "\u00A3");
break;
case DictConstants.CLASS_TWOA:
jsonObject.put("deg1", "\u00A3");
jsonObject.put("deg2a", "\u0052");
jsonObject.put("deg2b", "\u00A3");
break;
case DictConstants.CLASS_TWOB:
jsonObject.put("deg1", "\u00A3");
jsonObject.put("deg2a", "\u00A3");
jsonObject.put("deg2b", "\u0052");
break;
//建议更改方案
case DictConstants.SuggestChangePlan_CHANGE_DESIGN:
jsonObject.put("desuinneedtc", "\u0052");
jsonObject.put("dedocdrwinneedtc", "\u00A3");
jsonObject.put("reworkonsite", "\u00A3");
jsonObject.put("others1", "\u00A3");
break;
case DictConstants.SuggestChangePlan_CHANGE_DESIGN_DOC:
jsonObject.put("desuinneedtc", "\u00A3");
jsonObject.put("dedocdrwinneedtc", "\u0052");
jsonObject.put("reworkonsite", "\u00A3");
jsonObject.put("others1", "\u00A3");
break;
case DictConstants.SuggestChangePlan_REWORK:
jsonObject.put("desuinneedtc", "\u00A3");
jsonObject.put("dedocdrwinneedtc", "\u00A3");
jsonObject.put("reworkonsite", "\u0052");
jsonObject.put("others1", "\u00A3");
break;
case DictConstants.SuggestChangePlan_OTHER:
jsonObject.put("desuinneedtc", "\u00A3");
jsonObject.put("dedocdrwinneedtc", "\u00A3");
jsonObject.put("reworkonsite", "\u00A3");
jsonObject.put("others1", "\u0052");
break;
}
}
/**
* 获取提出方
*
* @param proposer
* @return
*/
private String generateProposer(String proposer) {
if (StringUtils.isEmpty(proposer)) {
return "";
}
//根据提出方获取提出方单位
String[] split = proposer.split(",");
//拼接字符
StringJoiner joiner = new StringJoiner(",");
for (String proSplit : split) {
if (proSplit.length() > 0) {
//字典为外单位
String s = extDocService.searchDictDataByDictCode(Constants.NCR_SUPPLIER, proSplit);
joiner.add(s);
}
}
return joiner.toString();
}
/**
* 查询CAA文件列表
*/
private List<DENPojo> searchRelateDcrLink(DxDocumentVO documentVO) {
Long versionId = documentVO.getVersionId();
List<ExtRelatedDcrLinkVO> searchRelateDcrLink = this.findSearchRelateDcrLink(versionId);
List<DENPojo> denPojoList = new ArrayList<>();
//searchRelateDcrLink对应的是图纸,需要查询该图纸下的图册
List<DxDocumentVO> denTarget = new ArrayList<>();
List<DxDocumentVO> sourceAtlasDrawingLinkS = new ArrayList<>();
//CAA附件判断是否为空
if (!CollectionUtils.isEmpty(searchRelateDcrLink)) {
searchRelateDcrLink.stream().forEach(item -> denTarget.add(item.getTarget()));
}
//denTarget对应的是图纸,需要查询该图纸下的图册
if (!CollectionUtils.isEmpty(denTarget)) {
denTarget.stream().forEach(target -> {
//查询图册
ExtAtlasDrawingLinkVO atlasDrawingLink = this.findAtlasDrawingLink(target.getVersionId());
if (!ObjectUtils.isEmpty(atlasDrawingLink)) {
DxDocumentVO source = atlasDrawingLink.getSource();
sourceAtlasDrawingLinkS.add(source);
}
});
}
List<DxDocumentVO> collectAtlasDrawingList = new ArrayList<>();
//过滤相同图册数据
if (!CollectionUtils.isEmpty(sourceAtlasDrawingLinkS)) {
collectAtlasDrawingList = sourceAtlasDrawingLinkS.stream().distinct().collect(Collectors.toList());
}
if (!CollectionUtils.isEmpty(collectAtlasDrawingList)) {
for (int i = 0; i < collectAtlasDrawingList.size(); i++) {
DENPojo denPojo = new DENPojo();
DxDocumentVO dxDocumentVO = collectAtlasDrawingList.get(i);
denPojo.setSnumber(Integer.toString(i + 1));
if (ObjectUtils.isEmpty(dxDocumentVO)) {
denPojo.setFileName(null);
denPojo.setFileNumber(null);
} else {
denPojo.setFileName(dxDocumentVO.getName());
denPojo.setFileNumber(dxDocumentVO.getNumber());
//转换成字典值
denPojo.setPublishDate(DateUtils.converLocalDateToString(dxDocumentVO.getModifyTime()));
denPojo.setVersion(dxDocumentVO.getDisplayVersion());
}
//转换成字典值
denPojo.setState("已发布");
denPojoList.add(denPojo);
}
}
return denPojoList;
}
/**
* 通过id查询文档附件
*
* @param versionId
* @return
*/
private List<ExtRelatedDcrLinkVO> findSearchRelateDcrLink(Long versionId) {
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("target").build())
.searchItems(SearchItems.builder().item(new SearchItem("sourceId", SearchItem.Operator.EQ,
versionId, null)).operator(SearchItems.BooleanOperator.AND).build()).build();
//通过id查询文档
DxPageImpl<ExtRelatedDcrLinkVO> recursion = relatedDcrLinkService.findRecursion(queryDoc);
List<ExtRelatedDcrLinkVO> content = recursion.getContent();
return content;
}
/**
* 通过targetId获取图册信息
*
* @param targetId
* @return
*/
private ExtAtlasDrawingLinkVO findAtlasDrawingLink(Long targetId) {
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("source").build())
.searchItems(SearchItems.builder().item(new SearchItem("targetId", SearchItem.Operator.EQ,
targetId, null)).operator(SearchItems.BooleanOperator.AND).build()).build();
//通过id查询文档
DxPageImpl<ExtAtlasDrawingLinkVO> recursion = atlasDrawingLinkService.findRecursion(queryDoc);
if (!CollectionUtils.isEmpty(recursion.getContent())) {
ExtAtlasDrawingLinkVO atlasDrawingLinkVO = DxPageUtils.getFirst(recursion);
return atlasDrawingLinkVO;
}
return null;
}
}
package com.yonde.dcs.core.factory;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.yonde.dcs.common.vo.ExtSendFormLinkVO;
import com.yonde.dcs.core.constants.Constants;
import com.yonde.dcs.core.constants.SignConstants;
import com.yonde.dcs.core.service.ExtDocService;
import com.yonde.dcs.core.service.ExtSendFormLinkService;
import com.yonde.dcs.core.util.DateUtils;
import com.yonde.dcs.core.util.WorkFlowUtil;
import com.yonde.dcs.core.word.ImportWordService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.entity.excel.DesignDocAppPojo;
import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.user.feign.DxUserInfoFeign;
import com.yonde.dex.wfc.common.vo.DxWfActivityVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import java.util.*;
/**
* @author xfchai
* @ClassName DesignDocApplicatUtils.java
* @Description 设计文件需求申请表
* @createTime 2021/11/24 13:47:00
*/
@Component
public class DesignDocApplicatUtils {
@Autowired
private ExtDocService extDocService;
@Autowired
private ImportWordService importWordService;
@Autowired
ExtSendFormLinkService sendFormLinkService;
@Autowired
private WorkFlowUtil workFlowUtil;
@Autowired
private DxUserInfoFeign userService;
/**
* 填充数据
*
* @param
* @return
*/
public JSONObject settingData(DxDocumentVO v, DxWfProcessInfoVO wfProcessInfoVO) {
String path = Constants.MTEMPLATE_ABSOLUTE_PATH;
String file = v.getSubTypeName();
String outFilePath = Constants.MERGER_FILE_ABSOLUTE_PATH + v.getSubTypeName() + "\\" + v.getNumber() + "\\";
//生成特定的文档目录,保存生成的word文件
FileUtil.mkdir(outFilePath);
//获取动态属性
Map<String, Object> dynamicAttrs = v.getDynamicAttrs();
String applicantUnit = Objects.isNull(dynamicAttrs.get("applicantUnit")) ? "" : (String) dynamicAttrs.get("applicantUnit");
String applicantor = Objects.isNull(dynamicAttrs.get("applicantor")) ? "" : (String) dynamicAttrs.get("applicantor");
String applicatReason = Objects.isNull(dynamicAttrs.get("applicatReason")) ? "" : (String) dynamicAttrs.get("applicatReason");
String handleSituation = Objects.isNull(dynamicAttrs.get("handleSituation")) ? "" : (String) dynamicAttrs.get("handleSituation");
String applicationDate = Objects.isNull(dynamicAttrs.get("applicationDate")) ? "" : (String) dynamicAttrs.get("applicationDate");
//经办人
// Long managerId = Objects.isNull(dynamicAttrs.get("managerId")) ? null : (Long) dynamicAttrs.get("managerId");
String manager = Objects.isNull(dynamicAttrs.get("manager")) ? null : (String) dynamicAttrs.get("manager");
String processDate = Objects.isNull(dynamicAttrs.get("processDate")) ? null : (String) dynamicAttrs.get("processDate");
//收件人
String recipient = Objects.isNull(dynamicAttrs.get("recipient")) ? "" : (String) dynamicAttrs.get("recipient");
JSONObject jsonObject = new JSONObject();
//密级
jsonObject.put("SecretCode", extDocService.searchDictDataByDictCode(Constants.SECRET_CODE, v.getSecretCode()));
//申请单位
jsonObject.put("applicationUnit", applicantUnit);
//申请人
jsonObject.put("applicantor", applicantor);
//申请日期
jsonObject.put("applicationDate", DateUtils.conversionDate(applicationDate));
//申请理由
jsonObject.put("applicatReason", applicatReason);
//处理情况
jsonObject.put("handleSituation", handleSituation);
//收件人
jsonObject.put("recipient", recipient);
//收件单位
jsonObject.put("recipientUnit", this.generateProposer((String) dynamicAttrs.get("recipientUnit")));
//编号
jsonObject.put("number", ObjectUtils.isEmpty(v.getNumber()) ? "" : v.getNumber());
//需求文件明细表
List<DesignDocAppPojo> designDocAppPojos = this.searchSendFormLink(v);
jsonObject.put("appFileLists", designDocAppPojos);
//获取参与者
List<DxWfActivityVO> activities = wfProcessInfoVO.getActivityInfo();
Map<String, List<DxWfProcessTaskVO>> wfInfo = workFlowUtil.getWfInfo(v);
if (!CollectionUtils.isEmpty(activities)) {
//写入签名数据
//部门负责人
jsonObject.put("bmfzr_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("bmfzr_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("sh_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_TSSH));
jsonObject.put("sh_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_TSSH));
//特殊处理
if (!CollectionUtils.isEmpty(wfInfo)) {
jsonObject.put("zts_photo", workFlowUtil.getHandler(wfInfo, SignConstants.SIGN_KEY_ZTS));
}
jsonObject.put("pz_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_APPROVED));
jsonObject.put("pz_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_APPROVED));
}
/* if (!Objects.isNull(managerId)) {
UserVO userVO = userService.get(managerId);
String userAccount = userVO.getUserAccount();
//经办人
jsonObject.put("jbr_photo", userAccount + ".png");
jsonObject.put("jbrdate", DateUtils.conversionDate(processDate));
}*/
jsonObject.put("jbr_photo", manager);
jsonObject.put("jbr_date", DateUtils.conversionDate(processDate));
//模板名称
importWordService.getWordAllTable(jsonObject, path + file + ".docx", outFilePath + "outFile.docx");
return jsonObject;
}
/**
* 查询需求文件列表
*/
private List<DesignDocAppPojo> searchSendFormLink(DxDocumentVO documentVO) {
Map<String, Object> docDynamicAttrs = documentVO.getDynamicAttrs();
//载体类型
String carrierType = (String) docDynamicAttrs.get("carrierType");
Long versionId = documentVO.getVersionId();
List<ExtSendFormLinkVO> searchSendFormLink = this.findSearchSendFormLink(versionId);
List<DesignDocAppPojo> sendFormTarget = new ArrayList<>();
if (!CollectionUtils.isEmpty(searchSendFormLink)) {
for (int i = 0; i < searchSendFormLink.size(); i++) {
DesignDocAppPojo designDocAppPojo = new DesignDocAppPojo();
ExtSendFormLinkVO sendFormLink = searchSendFormLink.get(i);
designDocAppPojo.setSnumber(Integer.toString(i + 1));
designDocAppPojo.setFileName(sendFormLink.getFormName());
designDocAppPojo.setFileNumber(sendFormLink.getFormNumber());
//转换成字典值
designDocAppPojo.setState("已发布");
//份数
designDocAppPojo.setCopies(sendFormLink.getCopies());
//载体类型
designDocAppPojo.setCarrierType(extDocService.searchDictDataByDictCode(Constants.CARRIER_TYPE, carrierType));
DxDocumentVO target = sendFormLink.getTarget();
if (!ObjectUtils.isEmpty(target)) {
designDocAppPojo.setVersion(target.getDisplayVersion());
designDocAppPojo.setRemark(target.getNote());
//密级
// String secret = Objects.isNull(dynamicAttrs.get("secret")) ? "" : (String) dynamicAttrs.get("secret");
String secretCode = target.getSecretCode();
//查询密级字典
designDocAppPojo.setSecret(extDocService.searchDictDataByDictCode(Constants.SECRET_CODE, secretCode));
}
sendFormTarget.add(designDocAppPojo);
}
}
return sendFormTarget;
}
/**
* 通过id查询文档附件
*
* @param versionId
* @return
*/
private List<ExtSendFormLinkVO> findSearchSendFormLink(Long versionId) {
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("target").build())
.searchItems(SearchItems.builder().item(new SearchItem("sourceId", SearchItem.Operator.EQ,
versionId, null)).operator(SearchItems.BooleanOperator.AND).build()).build();
//通过id查询文档
DxPageImpl<ExtSendFormLinkVO> recursion = sendFormLinkService.findRecursion(queryDoc);
List<ExtSendFormLinkVO> content = recursion.getContent();
return content;
}
/**
* 获取提出单位
*
* @param proposer
* @return
*/
private String generateProposer(String proposer) {
if (StringUtils.isEmpty(proposer)) {
return "";
}
//根据提出方获取提出方单位
String[] split = proposer.split(",");
//拼接字符
StringJoiner joiner = new StringJoiner(",");
for (String proSplit : split) {
if (proSplit.length() > 0) {
//字典为外单位
String s = extDocService.searchDictDataByDictCode(Constants.NCR_SUPPLIER, proSplit);
joiner.add(s);
}
}
return joiner.toString();
}
}
package com.yonde.dcs.core.factory;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.yonde.dcs.core.constants.Constants;
import com.yonde.dcs.core.constants.SignConstants;
import com.yonde.dcs.core.service.ExtDocService;
import com.yonde.dcs.core.word.ImportWordService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dex.wfc.common.vo.DxWfActivityVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @author xfchai
* @ClassName DesignInputUtils.java
* @Description 设计输入资料单
* @createTime 2021/11/24 14:35:00
*/
@Component
public class DesignEnterUtils {
@Autowired
private ExtDocService extDocService;
@Autowired
private ImportWordService importWordService;
/**
* 填充数据
*
* @param
* @return
*/
public Map<String, Object> settingData(DxDocumentVO v, DxWfProcessInfoVO wfProcessInfoVO) {
String path = Constants.MTEMPLATE_ABSOLUTE_PATH;
String file = v.getSubTypeName();
String outFilePath = Constants.MERGER_FILE_ABSOLUTE_PATH + v.getSubTypeName() + "\\" + v.getNumber() + "\\";
//生成特定的文档目录,保存生成的word文件
FileUtil.mkdir(outFilePath);
//获取动态属性
Map<String, Object> dynamicAttrs = v.getDynamicAttrs();
String content = Objects.isNull(dynamicAttrs.get("content")) ? "" : (String) dynamicAttrs.get("content");
String designPhase = Objects.isNull(dynamicAttrs.get("designPhase")) ? "" : (String) dynamicAttrs.get("designPhase");
JSONObject jsonObject = new JSONObject();
//项目代号
String projectCode = ObjectUtils.isEmpty(v.getDxDocumentExpand().getProjectCode()) ? "" : v.getDxDocumentExpand().getProjectCode();
// jsonObject.put("projectCode", extDocService.searchDictDataByDictCode(Constants.PROJECT_CODE, projectCode));
jsonObject.put("projectCode", projectCode);
//设计阶段
jsonObject.put("designPhase", extDocService.searchDictDataByDictCode(Constants.DESIGN_STAGE, designPhase));
//编号
jsonObject.put("number", ObjectUtils.isEmpty(v.getNumber()) ? "" : v.getNumber());
//设计输入名称
jsonObject.put("name", ObjectUtils.isEmpty(v.getName()) ? "" : v.getName());
//内容
jsonObject.put("content", content);
//备注
jsonObject.put("remark", ObjectUtils.isEmpty(v.getNote()) ? "" : v.getNote());
//页数
jsonObject.put("pages",v.getDxDocumentExpand().getAttachPages());
//获取参与者
List<DxWfActivityVO> activities = wfProcessInfoVO.getActivityInfo();
if (!CollectionUtils.isEmpty(activities)) {
//写入签名数据
jsonObject.put("bz_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("bz_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("sh_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_SH));
jsonObject.put("sh_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_SH));
//总体室审核
jsonObject.put("zts_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_ZTSSH));
jsonObject.put("zts_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_ZTSSH));
jsonObject.put("pz_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_APPROVED));
jsonObject.put("pz_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_APPROVED));
}
//模板名称
importWordService.getWordAllTable(jsonObject, path + file + ".docx", outFilePath + "outFile.docx");
return jsonObject;
}
}
package com.yonde.dcs.core.factory;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.yonde.dcs.common.vo.ExtRelatedDrawingLinkVO;
import com.yonde.dcs.common.vo.ExtTechStandardLinkVO;
import com.yonde.dcs.core.constants.Constants;
import com.yonde.dcs.core.constants.SignConstants;
import com.yonde.dcs.core.service.ExtDocService;
import com.yonde.dcs.core.util.DateUtils;
import com.yonde.dcs.core.word.ImportWordService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.document.feign.DocCenterFeignService;
import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.dao.service.util.DxPageUtils;
import com.yonde.dex.dfs.vo.ObjFileLinkVO;
import com.yonde.dex.wfc.common.vo.DxWfActivityVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.StringJoiner;
import java.util.stream.Collectors;
/**
* @author xfchai
* @ClassName NCRUtils.java
* @Description 不符合项处理单
* @createTime 2021/12/13 16:28:00
*/
@Component
public class NCRUtils {
@Autowired
private ExtDocService extDocService;
@Resource
DocCenterFeignService docCenterFeignService;
@Autowired
private ImportWordService importWordService;
/**
* 填充数据
*
* @param
* @return
*/
public JSONObject settingData(DxDocumentVO v, DxWfProcessInfoVO wfProcessInfoVO) {
String path = Constants.MTEMPLATE_ABSOLUTE_PATH;
String file = v.getSubTypeName();
String outFilePath = Constants.MERGER_FILE_ABSOLUTE_PATH + v.getSubTypeName() + "\\" + v.getNumber() + "\\";
//生成特定的文档目录,保存生成的word文件
FileUtil.mkdir(outFilePath);
//获取动态属性
Map<String, Object> dynamicAttrs = v.getDynamicAttrs();
//合同号
String contractNo = Objects.isNull(dynamicAttrs.get("contractNo")) ? "" : (String) dynamicAttrs.get("contractNo");
//供方
String supplier = Objects.isNull(dynamicAttrs.get("supplier")) ? "" : (String) dynamicAttrs.get("supplier");
String noConformDescript = Objects.isNull(dynamicAttrs.get("noConformDescript")) ? "" : (String) dynamicAttrs.get("noConformDescript");
String treatSuggestion = Objects.isNull(dynamicAttrs.get("treatSuggestion")) ? "" : (String) dynamicAttrs.get("treatSuggestion");
String tempMeasures = Objects.isNull(dynamicAttrs.get("tempMeasures")) ? "" : (String) dynamicAttrs.get("tempMeasures");
String inetDecide = Objects.isNull(dynamicAttrs.get("inetDecide")) ? "" : (String) dynamicAttrs.get("inetDecide");
String finalDecision = Objects.isNull(dynamicAttrs.get("finalDecision")) ? "" : (String) dynamicAttrs.get("finalDecision");
String inspectReport = Objects.isNull(dynamicAttrs.get("inspectReport")) ? "" : (String) dynamicAttrs.get("inspectReport");
String implementDate = Objects.isNull(dynamicAttrs.get("implementDate")) ? "" : (String) dynamicAttrs.get("implementDate");
JSONObject jsonObject = new JSONObject();
//展开objFileLink、sourceRelatedDrawingLink、sourceTechStandardLink
if (StringUtils.isEmpty(v.getId())) {
//新增
if (!ObjectUtils.isEmpty(v)) {
//相关图号
// TODO: 2024/8/15 getSourceRelatedDrawingLink属性不存在
// List<ExtRelatedDrawingLinkVO> sourceRelatedDrawingLink = v.getSourceRelatedDrawingLink();
//相关技术标准
// TODO: 2024/8/15 getSourceTechStandardLink属性不存在
// List<ExtTechStandardLinkVO> sourceTechStandardLink = v.getSourceTechStandardLink();
//获取图号 docNumber
// jsonObject.put("docNumber", CollectionUtils.isEmpty(sourceRelatedDrawingLink) ? "" : sourceRelatedDrawingLink.get(0).getDocNumber());
// 相应技术标准 techStandard
// jsonObject.put("techStandard", CollectionUtils.isEmpty(sourceTechStandardLink) ? "" : sourceTechStandardLink.get(0).getDocNumber());
}
//纠正措施附件 inspectAttach
List<ObjFileLinkVO> objFileLinks = v.getObjFileLinks();
if (!CollectionUtils.isEmpty(objFileLinks)) {
List<ObjFileLinkVO> collect = objFileLinks.stream().filter(item ->
"INSPECT_REPORT_FILE".equals(item.getContentType())
).collect(Collectors.toList());
jsonObject.put("inspectAttach", CollectionUtils.isEmpty(collect) ? "" : collect.get(0).getTarget().getOriginalFileName());
} else {
jsonObject.put("inspectAttach", "");
}
//不符合项描述附件
if (!CollectionUtils.isEmpty(objFileLinks)) {
List<ObjFileLinkVO> collect = objFileLinks.stream().filter(item ->
"NCR_DECR_ATTACH".equals(item.getContentType())
).collect(Collectors.toList());
jsonObject.put("attach", CollectionUtils.isEmpty(collect) ? "" : collect.get(0).getTarget().getOriginalFileName());
}
} else {
//修改
DxDocumentVO docOpenProps = this.findDocOpenProps(v.getId());
if (!ObjectUtils.isEmpty(docOpenProps)) {
//相关图号
// TODO: 2024/8/15 getSourceRelatedDrawingLink属性不存在
// List<ExtRelatedDrawingLinkVO> sourceRelatedDrawingLink = docOpenProps.getSourceRelatedDrawingLink();
//相关技术标准
// TODO: 2024/8/15 getSourceTechStandardLink属性不存在
// List<ExtTechStandardLinkVO> sourceTechStandardLink = docOpenProps.getSourceTechStandardLink();
//获取图号 docNumber
// jsonObject.put("docNumber", CollectionUtils.isEmpty(sourceRelatedDrawingLink) ? "" : sourceRelatedDrawingLink.get(0).getDocNumber());
// 相应技术标准 techStandard
// jsonObject.put("techStandard", CollectionUtils.isEmpty(sourceTechStandardLink) ? "" : sourceTechStandardLink.get(0).getDocNumber());
}
//纠正措施附件 inspectAttach
List<ObjFileLinkVO> objFileLinks = docOpenProps.getObjFileLinks();
if (!CollectionUtils.isEmpty(objFileLinks)) {
List<ObjFileLinkVO> collect = objFileLinks.stream().filter(item ->
"INSPECT_REPORT_FILE".equals(item.getContentType())
).collect(Collectors.toList());
jsonObject.put("inspectAttach", CollectionUtils.isEmpty(collect) ? "" : collect.get(0).getTarget().getOriginalFileName());
} else {
jsonObject.put("inspectAttach", "");
}
//不符合项描述附件
if (!CollectionUtils.isEmpty(objFileLinks)) {
List<ObjFileLinkVO> collect = objFileLinks.stream().filter(item ->
"NCR_DECR_ATTACH".equals(item.getContentType())
).collect(Collectors.toList());
jsonObject.put("attach", CollectionUtils.isEmpty(collect) ? "" : collect.get(0).getTarget().getOriginalFileName());
}
}
//项目代号
String projectCode = ObjectUtils.isEmpty(v.getDxDocumentExpand().getProjectCode()) ? "" : v.getDxDocumentExpand().getProjectCode();
jsonObject.put("projectCode", projectCode);
//设计阶段
jsonObject.put("treatSuggestion", extDocService.searchDictDataByDictCode(Constants.NCR_SUGGEST, treatSuggestion));
//不符合处理单编号
jsonObject.put("number", ObjectUtils.isEmpty(v.getNumber()) ? "" : v.getNumber());
//不符合处理单版次
jsonObject.put("version", ObjectUtils.isEmpty(v.getVersionKey()) ? "" : v.getVersionKey());
//申请方
jsonObject.put("contractNo", contractNo);
//不符合项描述
jsonObject.put("noConformDescript", noConformDescript);
//临时处理措施
jsonObject.put("tempMeasures", tempMeasures);
//核研院决定
jsonObject.put("inetDecide", inetDecide);
jsonObject.put("finalDecision", finalDecision);
jsonObject.put("inspectReport", inspectReport);
//供方
jsonObject.put("supplier", this.generateSupplier(supplier));
//填充多选框的值
this.selectData(v, jsonObject);
//实施日期
jsonObject.put("implementDate", DateUtils.conversionDate(implementDate));
//页数
jsonObject.put("pages", v.getDxDocumentExpand().getAttachPages());
//获取参与者
List<DxWfActivityVO> activities = wfProcessInfoVO.getActivityInfo();
if (!CollectionUtils.isEmpty(activities)) {
//写入签名数据
jsonObject.put("bz_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("bz_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("sh_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_TSSH));
jsonObject.put("sh_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_TSSH));
jsonObject.put("pz_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_APPROVED));
jsonObject.put("pz_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_APPROVED));
//核研院决定签字(编制不符合项处理单处理决定任务)
jsonObject.put("hyy_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_CLJD));
jsonObject.put("hyy_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_CLJD));
//最终决定签字(编制不符合项处理单实物验证项任务)
jsonObject.put("zzjd_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_SWYZ));
jsonObject.put("zzjd_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_SWYZ));
}
//模板名称
importWordService.getWordAllTable(jsonObject, path + file + ".docx", outFilePath + "outFile.docx");
return jsonObject;
}
/**
* 填充多选框的值
*
* @param v
* @param jsonObject
*/
private void selectData(DxDocumentVO v, JSONObject jsonObject) {
//获取动态属性
Map<String, Object> dynamicAttrs = v.getDynamicAttrs();
String classify = Objects.isNull(dynamicAttrs.get("classify")) ? "" : (String) dynamicAttrs.get("classify");
if ("C2".equals(classify)) {
//分类
jsonObject.put("C3", "\u00A3");
jsonObject.put("C2", "\u0052");
}
if ("C3".equals(classify)) {
jsonObject.put("C3", "\u0052");
jsonObject.put("C2", "\u00A3");
}
String grade = Objects.isNull(dynamicAttrs.get("grade")) ? "" : (String) dynamicAttrs.get("grade");
if ("Major".equals(grade)) {
//分级
jsonObject.put("major", "\u0052");
jsonObject.put("bigger", "\u00A3");
}
if ("Bigger".equals(grade)) {
jsonObject.put("bigger", "\u0052");
jsonObject.put("major", "\u00A3");
}
//检查验证(Receiver:接收,Reject:拒收)
String checkVerificat = Objects.isNull(dynamicAttrs.get("checkVerificat")) ? "" : (String) dynamicAttrs.get("checkVerificat");
if ("Receiver".equals(checkVerificat)) {
jsonObject.put("JCReceive", "\u0052");
jsonObject.put("JCReject", "\u00A3");
}
if ("Reject".equals(checkVerificat)) {
jsonObject.put("JCReject", "\u0052");
jsonObject.put("JCReceive", "\u00A3");
}
//纠正措施(true、false)
String correctAction = Objects.isNull(dynamicAttrs.get("correctAction")) ? "" : String.valueOf(dynamicAttrs.get("correctAction"));
if ("true".equals(correctAction)) {
jsonObject.put("have", "\u0052");
jsonObject.put("nohave", "\u00A3");
}
if ("false".equals(correctAction)) {
jsonObject.put("nohave", "\u0052");
jsonObject.put("have", "\u00A3");
}
//核研院处理结论
String inetConclusion = Objects.isNull(dynamicAttrs.get("inetConclusion")) ? "" : (String) dynamicAttrs.get("inetConclusion");
switch (inetConclusion) {
case "Receive":
jsonObject.put("Recive", "\u0052");
jsonObject.put("rework", "\u00A3");
jsonObject.put("repair", "\u00A3");
jsonObject.put("Scrapped", "\u00A3");
break;
case "Rework":
jsonObject.put("Recive", "\u00A3");
jsonObject.put("rework", "\u0052");
jsonObject.put("repair", "\u00A3");
jsonObject.put("Scrapped", "\u00A3");
break;
case "Repair":
jsonObject.put("Recive", "\u00A3");
jsonObject.put("rework", "\u00A3");
jsonObject.put("repair", "\u0052");
jsonObject.put("Scrapped", "\u00A3");
break;
case "Scrapped":
jsonObject.put("Recive", "\u00A3");
jsonObject.put("rework", "\u00A3");
jsonObject.put("repair", "\u00A3");
jsonObject.put("Scrapped", "\u0052");
break;
}
}
/**
* 通过id查询文档附件
*
* @param id
* @return
*/
private DxDocumentVO findDocOpenProps(Long id) {
SearchQueryCondition queryDoc = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("sourceRelatedDrawingLink").build())
.openProp(SearchQueryCondition.builder().name("sourceTechStandardLink").build())
.openProp(SearchQueryCondition.builder().name("objFileLinks").openProp(SearchQueryCondition.builder().name("target").build()).build())
.searchItems(SearchItems.builder().item(new SearchItem("id", SearchItem.Operator.EQ,
id, null)).item(new SearchItem("latest", SearchItem.Operator.EQ,
true, null)).operator(SearchItems.BooleanOperator.AND).build()).build();
//通过id查询文档
DxPageImpl<DxDocumentVO> recursion = docCenterFeignService.findRecursion(queryDoc);
if (CollectionUtils.isEmpty(recursion.getContent())) {
return null;
}
DxDocumentVO dxDocumentVO = DxPageUtils.getFirst(recursion);
return dxDocumentVO;
}
/**
* 获取提出方
*
* @param supplier
* @return
*/
private String generateSupplier(String supplier) {
if (StringUtils.isEmpty(supplier)) {
return "";
}
//根据提出方获取提出方单位
String[] split = supplier.split(",");
StringJoiner stringJoiner = new StringJoiner(",");
for (String proSplit : split) {
if (proSplit.length() > 0) {
//字典为外单位
String s = extDocService.searchDictDataByDictCode(Constants.NCR_SUPPLIER, proSplit);
stringJoiner.add(s);
}
}
return stringJoiner.toString();
}
}
package com.yonde.dcs.core.factory;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.yonde.dcs.core.constants.Constants;
import com.yonde.dcs.core.constants.SignConstants;
import com.yonde.dcs.core.service.ExtDocService;
import com.yonde.dcs.core.util.DateUtils;
import com.yonde.dcs.core.word.ImportWordService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dex.wfc.common.vo.DxWfActivityVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @author xfchai
* @ClassName WorkContactListUtils.java
* @Description 工作联系单
* @createTime 2021/11/22 15:15:00
*/
@Component
public class WorkContactListUtils {
@Autowired
private ExtDocService extDocService;
@Autowired
private ImportWordService importWordService;
/**
* 填充数据
*
* @param
* @return
*/
public JSONObject settingData(DxDocumentVO v, DxWfProcessInfoVO wfProcessInfoVO) {
String path = Constants.MTEMPLATE_ABSOLUTE_PATH;
String file = v.getSubTypeName();
String outFilePath = Constants.MERGER_FILE_ABSOLUTE_PATH + v.getSubTypeName() + "\\" + v.getNumber() + "\\";
//生成特定的文档目录,保存生成的word文件
FileUtil.mkdir(outFilePath);
//获取动态属性
Map<String, Object> dynamicAttrs = v.getDynamicAttrs();
String recipientFaxNo = Objects.isNull(dynamicAttrs.get("recipientFaxNo")) ? "" : (String) dynamicAttrs.get("recipientFaxNo");
String sender = Objects.isNull(dynamicAttrs.get("sender")) ? "" : (String) dynamicAttrs.get("sender");
String senderPeople = Objects.isNull(dynamicAttrs.get("senderPeople")) ? "" : (String) dynamicAttrs.get("senderPeople");
String senderPhone = Objects.isNull(dynamicAttrs.get("senderPhone")) ? "" : (String) dynamicAttrs.get("senderPhone");
String faxNumber = Objects.isNull(dynamicAttrs.get("faxNumber")) ? "" : (String) dynamicAttrs.get("faxNumber");
String content = Objects.isNull(dynamicAttrs.get("content")) ? "" : (String) dynamicAttrs.get("content");
String recipient = Objects.isNull(dynamicAttrs.get("recipient")) ? "" : (String) dynamicAttrs.get("recipient");
String recipientPhone = Objects.isNull(dynamicAttrs.get("recipientPhone")) ? "" : (String) dynamicAttrs.get("recipientPhone");
String sendTo = Objects.isNull(dynamicAttrs.get("sentTo")) ? "" : (String) dynamicAttrs.get("sentTo");
//是否需要回复
String needReply = Objects.isNull(dynamicAttrs.get("needReply")) ? "" : (String) dynamicAttrs.get("needReply");
String secretCode = v.getSecretCode();
JSONObject jsonObject = new JSONObject();
if ("false".equals(needReply)) {
//对号
jsonObject.put("noselect", "\u0052");
//方框
jsonObject.put("select", "\u00A3");
jsonObject.put("urgent", "\u00A3");
} else if ("true".equals(needReply)) {
//对号
jsonObject.put("select", "\u0052");
//方框
jsonObject.put("noselect", "\u00A3");
jsonObject.put("urgent", "\u00A3");
} else {
//对号
jsonObject.put("urgent", "\u0052");
//方框
jsonObject.put("noselect", "\u00A3");
jsonObject.put("select", "\u00A3");
}
//密级
jsonObject.put("SecretCode", extDocService.searchDictDataByDictCode(Constants.SECRET_CODE, secretCode));
//发出方
jsonObject.put("sender", sender);
//发出人
jsonObject.put("senderPeople", senderPeople);
//发出人联系电话
jsonObject.put("senderPhone", senderPhone);
//传真号码
jsonObject.put("faxNumber", faxNumber);
//工作联系单编号
jsonObject.put("number", ObjectUtils.isEmpty(v.getNumber()) ? "" : v.getNumber());
//发至
jsonObject.put("sentToName", extDocService.searchDictDataByDictCode(Constants.NCR_SUPPLIER, sendTo));
//接收人、联系人
jsonObject.put("recipient", recipient);
//联系电话
jsonObject.put("recipientPhone", recipientPhone);
//发送时间
jsonObject.put("sendDate", DateUtils.converLocalDateToString(v.getCreateTime()));
//传真号
jsonObject.put("recipientFaxNo", recipientFaxNo);
//内容
jsonObject.put("content", content);
//备注
jsonObject.put("remark", ObjectUtils.isEmpty(v.getNote()) ? "" : v.getNote());
//页数
jsonObject.put("pages", v.getDxDocumentExpand().getAttachPages());
//获取参与者
List<DxWfActivityVO> activities = wfProcessInfoVO.getActivityInfo();
if (!CollectionUtils.isEmpty(activities)) {
//写入签名数据
jsonObject.put("bz_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("bz_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_PREPARED));
jsonObject.put("sh_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_SH));
jsonObject.put("sh_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_SH));
jsonObject.put("qf_photo", extDocService.getSignImage(activities, SignConstants.SIGN_KEY_QF));
jsonObject.put("qf_date", extDocService.getEndDate(activities, SignConstants.SIGN_KEY_QF));
}
//模板名称
importWordService.getWordAllTable(jsonObject, path + file + ".docx", outFilePath + "outFile.docx");
return jsonObject;
}
}
......@@ -13,9 +13,7 @@ import com.yonde.dcs.core.constants.Constants;
import com.yonde.dcs.core.constants.SignConstants;
import com.yonde.dcs.core.events.DocBeforeCreateEvent;
import com.yonde.dcs.core.events.ProcessDataUtils;
import com.yonde.dcs.core.factory.NCRSCUtils;
import com.yonde.dcs.core.factory.OutdatedDocNotifyUtils;
import com.yonde.dcs.core.factory.TechnicalFileUtils;
import com.yonde.dcs.core.factory.*;
import com.yonde.dcs.core.service.*;
import com.yonde.dcs.core.util.*;
import com.yonde.dcs.core.word.ImportWordService;
......@@ -28,6 +26,7 @@ import com.yonde.dcs.plan.feign.ExtPlanDocLinkServiceFeign;
import com.yonde.dcs.plan.feign.ExtPlanServiceFeign;
import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryBuilder;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.api.CustomMultipartFile;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
......@@ -41,10 +40,10 @@ import com.yonde.dex.dfs.objfilelink.service.ObjFileLinkService;
import com.yonde.dex.dfs.vo.ObjFileLinkVO;
import com.yonde.dex.dfs.vo.RepoFileVO;
import com.yonde.dex.user.common.vo.DxOrganizationVO;
import com.yonde.dex.user.common.vo.DxPostMemberLinkVO;
import com.yonde.dex.user.common.vo.DxPostVO;
import com.yonde.dex.user.common.vo.DxUserInfoVO;
import com.yonde.dex.user.feign.DxOrganizationFeign;
import com.yonde.dex.user.feign.DxUserInfoFeign;
import com.yonde.dex.user.feign.SwitchUserService;
import com.yonde.dex.user.feign.*;
import com.yonde.dex.utils.common.utils.DxFileUtils;
import com.yonde.dex.version.plugin.common.entity.DxIterationVOHolder;
import com.yonde.dex.wfc.common.enums.TaskStateEnum;
......@@ -99,8 +98,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@Autowired
private ExtDistributeRecordServiceFeign distributeRecordService;
@Autowired
private WfcProcessFeign wfInstanceService;
private WfcProcessFeign wfcProcessFeign;
@Autowired
private WfcActivityFeign wfcActivityFeign;
@Autowired
......@@ -108,15 +106,17 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@Autowired
private ExtAtlasDrawingLinkService atlasDrawingLinkService;
@Autowired
private DxUserInfoFeign userService;
private DxUserInfoFeign<DxUserInfoVO> userService;
@Autowired
private DxOrganizationFeign dxOrganizationFeign;
@Autowired
private DxPostMemberLinkFeign<DxPostMemberLinkVO> dxPostMemberLinkFeign;
@Resource
private ExtPlanDocLinkServiceFeign planDocLinkService;
@Autowired
private ExtPlanServiceFeign extPlanService;
@Autowired
private WfcTaskFeign taskService;
private WfcTaskFeign wfcTaskFeign;
@Autowired
private SwitchUserService switchUserService;
@Autowired
......@@ -127,7 +127,6 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
private FileManagerFeignService fileManagerFeignService;
@Autowired
private ObjFileLinkService objFileLinkService;
@Autowired
private ExtDocUtil extDocUtil;
@Autowired
......@@ -145,7 +144,6 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
ExtApplicantService extApplicantService;
@Autowired
ExtInterfaceService extInterfaceService;
@Autowired
ExtAuditInterfLinkService extAuditInterfLinkService;
......@@ -262,9 +260,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
* @return
*/
private ExtPlanDocLinkVO searchExtPlanDocLink(Long masterId) {
SearchQueryCondition condition = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("source").build())
.searchItems(SearchItems.builder().item(new SearchItem("targetId", SearchItem.Operator.EQ, masterId, null)).build()).build();
SearchQueryCondition condition = SearchQueryCondition.builder().openProp(SearchQueryCondition.builder().name("source").build()).searchItems(SearchItems.builder().item(new SearchItem("targetId", SearchItem.Operator.EQ, masterId, null)).build()).build();
DxPageImpl<ExtPlanDocLinkVO> recursion = planDocLinkService.findRecursion(condition);
if (!CollectionUtils.isEmpty(recursion.getContent())) {
return DxPageUtils.getFirst(recursion);
......@@ -309,10 +305,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
* @return
*/
private List<ExtInterfaceReplaceLinkVO> searchSourceInterfaceReplaceLink(Long versionId) {
SearchQueryCondition condition = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("target").build())
.searchItems(SearchItems.builder()
.item(new SearchItem("sourceId", SearchItem.Operator.EQ, versionId, null)).build()).build();
SearchQueryCondition condition = SearchQueryCondition.builder().openProp(SearchQueryCondition.builder().name("target").build()).searchItems(SearchItems.builder().item(new SearchItem("sourceId", SearchItem.Operator.EQ, versionId, null)).build()).build();
DxPageImpl recursion = interfaceReplaceLinkService.findRecursion(condition);
if (!ObjectUtils.isEmpty(recursion)) {
return recursion.getContent();
......@@ -327,13 +320,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
* @return
*/
private List<ExtReviewDocComLinkVO> searchSourceExtReviewDocComLink(Long versionId) {
SearchQueryCondition condition = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("target")
.openProp(SearchQueryCondition.builder().name("sourceExtComDocLink")
.openProp(SearchQueryCondition.builder().name("target").build())
.build()).build())
.searchItems(SearchItems.builder()
.item(new SearchItem("sourceId", SearchItem.Operator.EQ, versionId, null)).build()).build();
SearchQueryCondition condition = SearchQueryCondition.builder().openProp(SearchQueryCondition.builder().name("target").openProp(SearchQueryCondition.builder().name("sourceExtComDocLink").openProp(SearchQueryCondition.builder().name("target").build()).build()).build()).searchItems(SearchItems.builder().item(new SearchItem("sourceId", SearchItem.Operator.EQ, versionId, null)).build()).build();
DxPageImpl recursion = extReviewDocComLinkService.findRecursion(condition);
if (!ObjectUtils.isEmpty(recursion)) {
return recursion.getContent();
......@@ -466,7 +453,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
Map<String, Object> varMap = new HashMap(1);
String join = StringUtils.join(value, ",", users.get(0));
varMap.put(key, join);
this.wfInstanceService.setProcessVariables(processInstId, varMap);
this.wfcProcessFeign.setProcessVariables(processInstId, varMap);
}
}
} else {
......@@ -478,7 +465,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
Map<String, Object> varMap = new HashMap(1);
String join = StringUtils.join(users.get(0));
varMap.put(key, join);
this.wfInstanceService.setProcessVariables(processInstId, varMap);
this.wfcProcessFeign.setProcessVariables(processInstId, varMap);
}
}
}
......@@ -500,7 +487,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
});
Map<String, Object> varMap = new HashMap(1);
varMap.put(varKey, joiner.toString());
this.wfInstanceService.setProcessVariables(processInstId, varMap);
this.wfcProcessFeign.setProcessVariables(processInstId, varMap);
}
/**
......@@ -509,11 +496,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
* @param id
*/
private List<ExtAtlasDrawingLinkVO> recursionAtlasDoc(Long id) {
SearchQueryCondition condition = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("target")
.openProp(SearchQueryCondition.builder().name("objFileLinks").build()).build())
.searchItems(SearchItems.builder()
.item(new SearchItem("sourceId", SearchItem.Operator.EQ, id, null)).build()).build();
SearchQueryCondition condition = SearchQueryCondition.builder().openProp(SearchQueryCondition.builder().name("target").openProp(SearchQueryCondition.builder().name("objFileLinks").build()).build()).searchItems(SearchItems.builder().item(new SearchItem("sourceId", SearchItem.Operator.EQ, id, null)).build()).build();
DxPageImpl recursion = atlasDrawingLinkService.findRecursion(condition);
if (!ObjectUtils.isEmpty(recursion)) {
return recursion.getContent();
......@@ -538,7 +521,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
Map<String, Object> taskMap = new HashMap<>();
taskMap.put("participantList", taskParticipant);
taskMap.put("routeSelect", "pass");
this.taskService.setTaskVars(taskId, taskMap);
this.wfcTaskFeign.setTaskVars(taskId, taskMap);
}
/**
......@@ -550,19 +533,24 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
*/
@Override
public void getProcessSelectionInfo(String taskId, DxDocumentVO documentVO) {
// TODO: xpc taskService.getTaskSelectionInfo(taskId)此方法不存在
// TODO: xpc taskService.getTaskSelectionInfo(taskId)此方法不存在,改为wfInstanceService.getProcessTeamParticipantList(taskId)
// WfTaskSelectionVo taskSelectionInfo = this.taskService.getTaskSelectionInfo(taskId);
// Map<String, Object> participantList = taskSelectionInfo.getParticipantList();
// Long[] review = (Long[]) participantList.get("wf_act_TeamRole_review_userList");
// Long[] approver = (Long[]) participantList.get("wf_act_TeamRole_Approver_userList");
// Long[] verifier = (Long[]) participantList.get("wf_act_teamrole_approve_userlist");
// //更新pbo属性
// Map<String, Object> dynamicAttrs = documentVO.getDynamicAttrs();
// dynamicAttrs.put("review", review.toString());
// dynamicAttrs.put("approver", approver.toString());
// dynamicAttrs.put("verifier", verifier.toString());
// documentVO.setOperator(OperatorType.MODIFY);
// documentService.saveRecursion(documentVO);
List<DxWfParticipantInfoVO> processTeamParticipantList = wfcProcessFeign.getProcessTeamParticipantList(taskId);
Map<String, List<String>> participantList = new HashMap<>();
for (DxWfParticipantInfoVO dxWfParticipantInfoVO : processTeamParticipantList) {
participantList.put(dxWfParticipantInfoVO.getParticipantInfoExtVO().getPluginContent(), dxWfParticipantInfoVO.getParticipantList());
}
//更新pbo属性
Map<String, Object> dynamicAttrs = documentVO.getDynamicAttrs();
dynamicAttrs.put("review", participantList.get("wf_act_TeamRole_review_userList"));
dynamicAttrs.put("approver", participantList.get("wf_act_TeamRole_Approver_userList"));
dynamicAttrs.put("verifier", participantList.get("wf_act_teamrole_approve_userlist"));
documentVO.setOperator(OperatorType.MODIFY);
documentService.saveRecursion(documentVO);
}
/**
......@@ -649,12 +637,13 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
String fileInputName = Constants.BEFORE_MERGER_PATH + documentVO.getSubTypeName() + "/" + documentVO.getNumber() + "/" + Constants.MERGER_TARGET + "/" + Constants.MERGER_FILE_NAME;
List<ExtInterfaceInfoLinkVO> interfaceInfoLinkVOS = this.recursionInterfaceInfoLinks(documentVO.getVersionId());
DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// TODO: xpc dexWorkFlowService.getProcessInstDetailById方法不存在
// TODO: xpc dexWorkFlowService.getProcessInstDetailById方法不存在,自己封装workFlowUtil.getProcessInstDetail(wfProcessInstVO)
// WfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
DxWfProcessInfoVO wfProcessInfoVO = workFlowUtil.getProcessInstDetail(wfProcessInstVO);
if (!CollectionUtils.isEmpty(interfaceInfoLinkVOS)) {
//1、先根据提资记录生成多个文档
interfaceInfoLinkVOS.stream().forEach(item -> {
// docBeforeCreateEvent.generateAutoInterFaceWord(docObjFile, item, wfProcessInfoVO);
docBeforeCreateEvent.generateAutoInterFaceWord(docObjFile, item, wfProcessInfoVO);
});
try {
//2、合并生成好的文档
......@@ -688,8 +677,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void operateFile(DxDocumentVO documentVo, InputStream inputStreamDoc) throws Exception {
//上传文件到文件服务器
MultipartFile multipartFile = new MockMultipartFile("file", documentVo.getName() + ".doc",
Constants.CONTENT_TYPE_DOC, inputStreamDoc);
MultipartFile multipartFile = new MockMultipartFile("file", documentVo.getName() + ".doc", Constants.CONTENT_TYPE_DOC, inputStreamDoc);
RepoFileVO field = fileManagerFeignService.uploadFile(multipartFile, Long.valueOf(Constants.BUCKET_NAME));
......@@ -751,13 +739,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
* @param id
*/
private List<ExtInterfaceInfoLinkVO> recursionInterfaceInfoLinks(Long id) {
SearchQueryCondition condition = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("target")
.openProp(SearchQueryCondition.builder().name("targetInterfaceInfoLink").build())
.openProp(SearchQueryCondition.builder().name("objFileLinks")
.openProp(SearchQueryCondition.builder().name("target").build()).build()).build())
.searchItems(SearchItems.builder()
.item(new SearchItem("sourceId", SearchItem.Operator.EQ, id, null)).build()).build();
SearchQueryCondition condition = SearchQueryCondition.builder().openProp(SearchQueryCondition.builder().name("target").openProp(SearchQueryCondition.builder().name("targetInterfaceInfoLink").build()).openProp(SearchQueryCondition.builder().name("objFileLinks").openProp(SearchQueryCondition.builder().name("target").build()).build()).build()).searchItems(SearchItems.builder().item(new SearchItem("sourceId", SearchItem.Operator.EQ, id, null)).build()).build();
DxPageImpl recursion = interfaceInfoLinkService.findRecursion(condition);
if (!ObjectUtils.isEmpty(recursion)) {
return recursion.getContent();
......@@ -855,11 +837,9 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
//上传文件到文件服务器
MultipartFile multipartFile = null;
if (StringUtils.isNotBlank(fileName)) {
multipartFile = new MockMultipartFile("file", fileName + ".pdf",
Constants.CONTENT_TYPE_DOC, inputStreamDoc);
multipartFile = new MockMultipartFile("file", fileName + ".pdf", Constants.CONTENT_TYPE_DOC, inputStreamDoc);
} else {
multipartFile = new MockMultipartFile("file", documentVO.getName() + ".pdf",
Constants.CONTENT_TYPE_DOC, inputStreamDoc);
multipartFile = new MockMultipartFile("file", documentVO.getName() + ".pdf", Constants.CONTENT_TYPE_DOC, inputStreamDoc);
}
RepoFileVO field = fileManagerFeignService.uploadFile(multipartFile, Long.valueOf(Constants.BUCKET_NAME));
if (field == null) {
......@@ -882,36 +862,37 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
DxDocumentVO documentVO = extDocUtil.findDocObjFileLinks(documentId);
log.info("自动任务======生成word签名开始");
DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// TODO: xpc 此方法不存在 getProcessInstDetailById(processId)
// TODO: xpc dexWorkFlowService.getProcessInstDetailById方法不存在,自己封装workFlowUtil.getProcessInstDetail(wfProcessInstVO)
// WfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
DxWfProcessInfoVO wfProcessInfoVO = workFlowUtil.getProcessInstDetail(wfProcessInstVO);
String subTypeName = documentVO.getSubTypeName();
log.info("自动任务======生成word签名进行中,文档SubTypeName:{}", subTypeName);
// switch (subTypeName) {
// case Constants.CONTACTLIST:
// extDocService.generateDocWordSign(documentVO, ContactListUtils.class, wfProcessInfoVO, fileName);
// break;
// case Constants.WORK_CONTACTLIST:
// extDocService.generateDocWordSign(documentVO, WorkContactListUtils.class, wfProcessInfoVO, "");
// break;
// case Constants.DESIGN_ENTER:
// extDocService.generateDocWordSign(documentVO, DesignEnterUtils.class, wfProcessInfoVO, "");
// break;
// case Constants.NCR:
// extDocService.generateDocWordSign(documentVO, NCRUtils.class, wfProcessInfoVO, "");
// break;
// case Constants.INTERNAL_INTERFACE:
// this.generateInterfaceSignWord(documentVO, wfProcessInfoVO);
// break;
// case Constants.DESIGN_CHANGE:
// extDocService.generateDocWordSign(documentVO, DesignChangeUtils.class, wfProcessInfoVO, "");
// break;
// case Constants.DESIGN_APPLICATION:
// extDocService.generateDocWordSign(documentVO, DesignDocApplicatUtils.class, wfProcessInfoVO, "");
// break;
// case Constants.DEN:
// extDocService.generateDocWordSign(documentVO, DENUtils.class, wfProcessInfoVO, "");
// break;
// }
switch (subTypeName) {
case Constants.CONTACTLIST:
extDocService.generateDocWordSign(documentVO, ContactListUtils.class, wfProcessInfoVO, fileName);
break;
case Constants.WORK_CONTACTLIST:
extDocService.generateDocWordSign(documentVO, WorkContactListUtils.class, wfProcessInfoVO, "");
break;
case Constants.DESIGN_ENTER:
extDocService.generateDocWordSign(documentVO, DesignEnterUtils.class, wfProcessInfoVO, "");
break;
case Constants.NCR:
extDocService.generateDocWordSign(documentVO, NCRUtils.class, wfProcessInfoVO, "");
break;
case Constants.INTERNAL_INTERFACE:
this.generateInterfaceSignWord(documentVO, wfProcessInfoVO);
break;
case Constants.DESIGN_CHANGE:
extDocService.generateDocWordSign(documentVO, DesignChangeUtils.class, wfProcessInfoVO, "");
break;
case Constants.DESIGN_APPLICATION:
extDocService.generateDocWordSign(documentVO, DesignDocApplicatUtils.class, wfProcessInfoVO, "");
break;
case Constants.DEN:
extDocService.generateDocWordSign(documentVO, DENUtils.class, wfProcessInfoVO, "");
break;
}
//保存附件
documentService.saveRecursion(documentVO);
log.info("自动任务======生成word签名完成");
......@@ -1055,21 +1036,23 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
DxDocumentVO documentVO = extDocUtil.findDocObjFileLinks(documentId);
if ((Constants.TECHNICAL_FILE.equals(documentVO.getDxDocumentExpand().getOneLevCategory()))) {
DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVO);
// TODO: xpc 不存在这个方法getProcessInstDetailById
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
// //深度查询展开objFileLink
// DxDocumentVO dxDocumentVO = extDocUtil.findDocObjFileLinks(documentVO.getId());
// //生成QH技术文件签审页
// this.generateQHTechDocWord(dxDocumentVO, wfProcessInfoVO);
// //如果是原理图和布置图,生成三个pdf
// technicalFileUtils.operateDrawingDoc(null, dxDocumentVO, wfProcessInfoVO);
// documentService.saveRecursion(dxDocumentVO);
// //生成图册下图纸的pdf
// if (Constants.DESIGN_ATLAS.equals(dxDocumentVO.getSubTypeName()) || Constants.INSTALL_ATLAS.equals(dxDocumentVO.getSubTypeName())) {
// technicalFileUtils.settingAtlasDrawingData(documentVO, wfProcessInfoVO);
// }
// TODO: xpc dexWorkFlowService.getProcessInstDetailById方法不存在,自己封装workFlowUtil.getProcessInstDetail(wfProcessInstVO)
// WfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
DxWfProcessInfoVO wfProcessInfoVO = workFlowUtil.getProcessInstDetail(wfProcessInstVO);
//深度查询展开objFileLink
DxDocumentVO dxDocumentVO = extDocUtil.findDocObjFileLinks(documentVO.getId());
//生成QH技术文件签审页
this.generateQHTechDocWord(dxDocumentVO, wfProcessInfoVO);
//如果是原理图和布置图,生成三个pdf
technicalFileUtils.operateDrawingDoc(null, dxDocumentVO, wfProcessInfoVO);
documentService.saveRecursion(dxDocumentVO);
//生成图册下图纸的pdf
if (Constants.DESIGN_ATLAS.equals(dxDocumentVO.getSubTypeName()) || Constants.INSTALL_ATLAS.equals(dxDocumentVO.getSubTypeName())) {
technicalFileUtils.settingAtlasDrawingData(documentVO, wfProcessInfoVO);
}
// //生成过时文件通知单
// this.generateOutNotify(documentVO, wfProcessInfoVO);
this.generateOutNotify(documentVO, wfProcessInfoVO);
}
}
......@@ -1136,7 +1119,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(iterationObject);
if (Objects.nonNull(wfProcessInstVO)) {
// TODO: xpc endProcessInst()不存在,改为stopProcess()
wfInstanceService.stopProcess(wfProcessInstVO.getId());
wfcProcessFeign.stopProcess(wfProcessInstVO.getId());
}
}
......@@ -1154,10 +1137,11 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
DxDocumentVO source = item.getSource();
if (!ObjectUtils.isEmpty(source)) {
DxWfProcessVO wfProcessInstVO = workFlowUtil.getWfProcessInst(source);
// TODO: xpc 这个方法不存在getProcessInstDetailById
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
// extDocService.generateDocWordSign(documentVO, OutdatedDocNotifyUtils.class, wfProcessInfoVO, "");
// } else {
// TODO: xpc dexWorkFlowService.getProcessInstDetailById方法不存在,自己封装workFlowUtil.getProcessInstDetail(wfProcessInstVO)
// WfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
DxWfProcessInfoVO wfProcessInfoVO = workFlowUtil.getProcessInstDetail(wfProcessInstVO);
extDocService.generateDocWordSign(documentVO, OutdatedDocNotifyUtils.class, wfProcessInfoVO, "");
} else {
log.error("更新pdf失败,生成过时文件通知单失败!");
}
});
......@@ -1249,7 +1233,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
//TODO xpc getProcessInstSimpleDetailById方法不存在,改为getHisTaskList()
// DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstSimpleDetailById(processId);
// List<DxWfProcessTaskVO> activities = wfProcessInfoVO.getHistoryInfo();
List<DxWfProcessTaskVO> activities = taskService.getHisTaskList(processId, null, 1, Integer.MAX_VALUE).getContent();
List<DxWfProcessTaskVO> activities = wfcTaskFeign.getHisTaskList(processId, null, 1, Integer.MAX_VALUE).getContent();
String dateStr = "";
HashMap<String, String> signMap = CloneUtils.cloneObject(SignConstants.SignNodeMap);
for (Map.Entry<String, String> entry : signMap.entrySet()) {
......@@ -1305,7 +1289,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
return null;
}
//获取用户的id resolver.getAssigneeName() 用户的名称
//Long userId = Long.valueOf(resolver.getAssignee());
// Long userId = Long.valueOf(resolver.getAssignee());
return resolver.getAssigneeName();
}
......@@ -1318,8 +1302,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
@Transactional(rollbackFor = Exception.class)
public RepoFileVO savePDFToMinio(String pdfPath) throws IOException {
String pdfName = pdfPath.substring(pdfPath.lastIndexOf("/") + 1);
MultipartFile multipartFile = new MockMultipartFile("file", pdfName,
ContentType.MULTIPART.toString(), new FileInputStream(pdfPath));
MultipartFile multipartFile = new MockMultipartFile("file", pdfName, ContentType.MULTIPART.toString(), new FileInputStream(pdfPath));
RepoFileVO field = fileManagerFeignService.uploadFile(multipartFile, Long.valueOf(Constants.BUCKET_NAME));
if (field == null) {
log.error(">>> 接口单pdf >>> 文件上传失败!");
......@@ -1360,8 +1343,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
* @return
*/
private DxWfProcessTaskVO getResolver(List<DxWfProcessTaskVO> activities, String activityName) {
DxWfProcessTaskVO resolver = activities.stream()
.filter(wfProcessTaskVO -> wfProcessTaskVO.getName().equals(activityName) && ("通过".equals(wfProcessTaskVO.getResult()) || "提交审阅".equals(wfProcessTaskVO.getResult()) || "提交签审".equalsIgnoreCase(wfProcessTaskVO.getResult()))).findFirst().orElse(null);
DxWfProcessTaskVO resolver = activities.stream().filter(wfProcessTaskVO -> wfProcessTaskVO.getName().equals(activityName) && ("通过".equals(wfProcessTaskVO.getResult()) || "提交审阅".equals(wfProcessTaskVO.getResult()) || "提交签审".equalsIgnoreCase(wfProcessTaskVO.getResult()))).findFirst().orElse(null);
return resolver;
}
......@@ -1378,15 +1360,15 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
SearchQueryCondition queryCondition = SearchUtil.buildQueryWithOpenAttr("id", SearchItem.Operator.EQ, extInterfaceId, "objFileLinks.target");
DxPageImpl<ExtInterfaceVO> recursion = extInterfaceService.findRecursion(queryCondition);
ExtInterfaceVO extInterfaceVO = recursion.getContent().get(0);
//TODO 申请内容节点信息
// 申请内容节点信息
ExtApplicantVO applicantVO = (ExtApplicantVO) extApplicantService.get(extInterfaceVO.getExtApplicantId());
Map<String, String> taskMap = ExtWfcUtil.getProcessTeam(ExtApplicantVO.class, applicantVO.getVersionId(), SignConstants.SignNodeMap);
//TODO 接口单接点信息
// 接口单接点信息
Map<String, String> interFaceMap = ExtWfcUtil.getProcessTeam(ExtInterfaceVO.class, extInterfaceVO.getVersionId(), SignConstants.InterfaceSignNodeMap);
if (MapUtils.isNotEmpty(interFaceMap)) {
taskMap.putAll(interFaceMap);
}
//TODO 将签字后的pdf挂到接口单上面
// 将签字后的pdf挂到接口单上面
RepoFileVO papersVO = ObjFileLinkUtil.getAppointTypeFile(extInterfaceVO, Constants.MASTER_FILE).get(0);
String temDir = DxFileUtils.createRandomTemp("interface");
String interFacePath = downPaperToLocal(papersVO, temDir);
......@@ -1397,7 +1379,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
//删除旧文件,增加新文件
ObjFileLinkUtil.removeFile(extInterfaceVO, Constants.MASTER_FILE);
papersVO = savePDFToMinio(interFacePath);//上传到minio
//TODO 附件上传待指定
// 附件上传待指定
ObjFileLinkUtil.addFile(extInterfaceVO, papersVO, Constants.MASTER_FILE);
extInterfaceService.saveRecursion(extInterfaceVO);
FileUtils.deleteDirectory(temDir);
......@@ -1414,7 +1396,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
SearchQueryCondition queryCondition = SearchUtil.buildQueryWithOpenAttr("sourceId", SearchItem.Operator.EQ, auditObjectVO.getId(), "target");
DxPageImpl<ExtAuditInterfLinkVO> recursion = extAuditInterfLinkService.findRecursion(queryCondition);
if (CollectionUtil.isNotEmpty(recursion.getContent())) {
//TODO 设置接口单状态为终止
// 设置接口单状态为终止
List<ExtAuditInterfLinkVO> content = recursion.getContent();
for (ExtAuditInterfLinkVO linkVO : content) {
ExtInterfaceVO interfaceVO = linkVO.getTarget();
......@@ -1450,8 +1432,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
//TODO 设置提资人ID 取组织下面 岗位为 主设人 的用户
Long userId = getUserByOrg(organizationVO);
extInterfaceVO.setDxClassname(extInterfaceVO.getDxClassname());
//TODO xpc setDxContextId这个属性不存在,可能是因为没勾选上下文插件
// extInterfaceVO.setDxContextId(applicantVO.getDxContextId());
extInterfaceVO.setDxContextId(applicantVO.getDxContextId());
extInterfaceVO.setExtApplicant(applicantVO);
extInterfaceVO.setProviderId(userId);
extInterfaceVO.setExtApplicantId(applicantVO.getId());
......@@ -1483,7 +1464,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
var.put("taskPerformer", JsonUtils.toJsonStr(taskPerformerVO));
startVO.setProcessVar(var);
//TODO 手动启动流程
wfInstanceService.startProcess(startVO);
wfcProcessFeign.startProcess(startVO);
//废弃版
//dexWorkFlowService.startProcessByKey("ExtInterface", extInterfaceVO);
}
......@@ -1512,8 +1493,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
ExtApplicantVO applicantVO = (ExtApplicantVO) extApplicantService.get(extInterfaceVO.getExtApplicantId());
applicantVO.setOperator(OperatorType.NO_CHANGE);
newInterFace.setPreviousId(extInterfaceVO.getId());
//TODO xpc setDxContextId这个属性不存在,可能是因为没勾选上下文插件
// newInterFace.setDxContextId(applicantVO.getDxContextId());
newInterFace.setDxContextId(applicantVO.getDxContextId());
newInterFace.setProviderId(extInterfaceVO.getProviderId());
newInterFace.setProviderIdType(extInterfaceVO.getProviderIdType());
newInterFace.setApplicatDate(extInterfaceVO.getApplicatDate());
......@@ -1552,7 +1532,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
var.put("taskPerformer", JsonUtils.toJsonStr(taskPerformerVO));
startVO.setProcessVar(var);
//TODO 手动启动流程
wfInstanceService.startProcess(startVO);
wfcProcessFeign.startProcess(startVO);
} catch (Exception e) {
throw new DxBusinessException("-1 切换用户失败", e.getMessage());
} finally {
......@@ -1567,10 +1547,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
*/
@Override
public void stopAllExtApplicantFaceFlow(ExtInterfaceVO extInterfaceVO) {
SearchQueryCondition condition = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("extInterfaces").build())
.searchItems(SearchItems.builder()
.item(new SearchItem("id", SearchItem.Operator.EQ, extInterfaceVO.getExtApplicantId(), null)).build()).build();
SearchQueryCondition condition = SearchQueryCondition.builder().openProp(SearchQueryCondition.builder().name("extInterfaces").build()).searchItems(SearchItems.builder().item(new SearchItem("id", SearchItem.Operator.EQ, extInterfaceVO.getExtApplicantId(), null)).build()).build();
List<ExtApplicantVO> recursions = extApplicantService.findRecursion(condition).getContent();
if (!CollectionUtil.isEmpty(recursions)) {
Optional<ExtApplicantVO> first = recursions.stream().findFirst();
......@@ -1608,15 +1585,28 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
* @return
*/
public Long getUserByOrg(DxOrganizationVO organizationVO) {
//TODO xpc userGroupRefService.getUserRefByOrgId()不存在
//TODO xpc userGroupRefService.getUserRefByOrgId()不存在,修改为获取组织下面用户ids,根据用户ids获取DxPostMemberLinkVO
// List<UserGroupRefVO> userRefByOrgId = this.userGroupRefService.getUserRefByOrgId(organizationVO.getId());
// if (CollectionUtil.isEmpty(userRefByOrgId)) {
// return null;
// }
// Optional<UserGroupRefVO> first = userRefByOrgId.stream().filter(o -> "主设人".equalsIgnoreCase(o.getPostName())).findFirst();
// return first.map(userGroupRefVO -> Long.valueOf(userGroupRefVO.getUserId())).orElse(null);
//获取组织下面用户ids
List<Long> organizationMemberList = dxOrganizationFeign.getOrganizationMemberList(organizationVO.getCreatorId());
if (CollectionUtil.isEmpty(organizationMemberList)) {
return null;
}
//根据用户ids获取DxPostMemberLinkVO
SearchQueryCondition query = SearchQueryCondition.builder()
.openProp(SearchQueryCondition.builder().name("source").build())
.searchItems(SearchItems.builder()
.item(new SearchItem("targetId", SearchItem.Operator.IN, organizationMemberList))
.build()).build();
DxPageImpl<DxPostMemberLinkVO> recursion = dxPostMemberLinkFeign.findRecursion(query);
Optional<DxPostMemberLinkVO> first = recursion.getContent().stream().filter(o -> "主设人".equalsIgnoreCase(o.getSource().getPostName())).findFirst();
return first.map(DxPostMemberLinkVO::getTargetId).orElse(null);
}
}
......@@ -319,7 +319,7 @@ public class ExtDocServiceImpl implements ExtDocService {
newVersionVo.setMasterId(sourceDoc.getMasterId());
newVersionVo.setPredecessorId(sourceDoc.getId());
newVersionVo = (DxVersionVO) versionService.save((IdVO) newVersionVo, true);
// TODO: xpc DxIterationVO不存在,听同事说此方法已被弃用
// TODO: xpc DcsBuilder不存在,听同事说此方法已被弃用
// newViewDoc = DcsBuilder.of(newViewDoc).with(IdVO::setSubTypeName, sourceDoc.getSubTypeName())
// .with(DxIterationVO::setMaster, sourceDoc.getMaster())
// .with(DxIterationVO::setLatest, true)
......
......@@ -41,7 +41,7 @@ public class ExtDxDocumentServiceImpl<V extends DxDocumentVO> extends DocumentSe
super.beforeSave(target);
}
}
package com.yonde.dcs.document.core.util;
package com.yonde.dcs.core.util;
import com.aspose.words.*;
import com.aspose.words.ParagraphAlignment;
......
......@@ -7,10 +7,8 @@ import com.yonde.dex.user.common.vo.DxUserInfoVO;
import com.yonde.dex.user.feign.DxUserInfoFeign;
import com.yonde.dex.version.plugin.common.entity.DxIterationVOHolder;
import com.yonde.dex.wfc.common.enums.TaskStateEnum;
import com.yonde.dex.wfc.common.vo.DxWfActivityVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessSearchVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessVO;
import com.yonde.dex.wfc.common.vo.*;
import com.yonde.dex.wfc.feign.api.WfcActivityFeign;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import com.yonde.dex.wfc.feign.api.WfcTaskFeign;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -18,6 +16,7 @@ import org.springframework.data.domain.Page;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PathVariable;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -33,7 +32,9 @@ import java.util.stream.Collectors;
public class WorkFlowUtil {
@Autowired
private WfcProcessFeign instanceService;
private WfcProcessFeign wfcProcessFeign;
@Autowired
private WfcActivityFeign wfcActivityFeign;
@Autowired
private WfcTaskFeign wfcTaskFeign;
@Autowired
......@@ -55,7 +56,7 @@ public class WorkFlowUtil {
DxWfProcessSearchVO dxWfProcessSearchVO = new DxWfProcessSearchVO();
dxWfProcessSearchVO.setPboClass(iterationVO.getClass().getName());
dxWfProcessSearchVO.setPboId(iterationVO.getVersionId());
Page<DxWfProcessVO> processList = instanceService.getProcessList(dxWfProcessSearchVO, 1, 10);
Page<DxWfProcessVO> processList = wfcProcessFeign.getProcessList(dxWfProcessSearchVO, 1, 10);
if (!CollectionUtils.isEmpty(processList.getContent())) {
return processList.getContent().get(0);
}
......@@ -78,7 +79,7 @@ public class WorkFlowUtil {
DxWfProcessSearchVO dxWfProcessSearchVO = new DxWfProcessSearchVO();
dxWfProcessSearchVO.setPboClass(DxDocumentVO.class.getName());
dxWfProcessSearchVO.setPboId(doc.getVersionId());
Page<DxWfProcessVO> processList = instanceService.getProcessList(dxWfProcessSearchVO, 1, 10);
Page<DxWfProcessVO> processList = wfcProcessFeign.getProcessList(dxWfProcessSearchVO, 1, 10);
if (!CollectionUtils.isEmpty(processList.getContent())) {
return processList.getContent().get(0);
}
......@@ -213,4 +214,15 @@ public class WorkFlowUtil {
}
return date;
}
//根据流程实例id获取组装信息
public DxWfProcessInfoVO getProcessInstDetail(DxWfProcessVO dxWfProcessVO) {
DxWfProcessInfoVO processInfoVO = new DxWfProcessInfoVO();
processInfoVO.setProcessVO(wfcProcessFeign.getProcessDetail(dxWfProcessVO.getId()));
processInfoVO.setActivityInfo(wfcActivityFeign.getActivities(dxWfProcessVO.getId(),dxWfProcessVO.getProcDefId()));
processInfoVO.setHistoryInfo(wfcTaskFeign.getHisTaskList(dxWfProcessVO.getId(),null, 1, Integer.MAX_VALUE).getContent());
return processInfoVO;
}
}
......@@ -23,31 +23,41 @@ import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.yonde.dex.lcycle.plugin.entities.DxLifecycleManageBaseEmbeddable;
import com.yonde.dex.dao.entity.base.IdEntity;
import javax.persistence.Column;
import com.yonde.dex.container.folder.plugin.entities.DxObjFolderEmbeddable;
import com.yonde.dex.context.plugin.entities.DxContextHolder;
import com.yonde.dex.dfs.objfilelink.plugin.entities.DxObjFileLinkHolder;
import com.yonde.dex.dfs.objfilelink.plugin.entities.DxObjFileLinkEmbeddable;
import com.yonde.dex.lcycle.plugin.entities.DxLifecycleManageBaseHolder;
import com.yonde.dex.dao.entity.base.DxIdEntityEmbeddable;
import com.yonde.dex.context.plugin.entities.DxContextEmbeddable;
import com.yonde.dex.dao.entity.base.IdOnlyEntity;
import com.yonde.dex.version.plugin.entities.DxIterationHolder;
import com.yonde.dex.logicdelete.plugin.entities.DxLogicDeleteHolder;
import com.yonde.dex.container.folder.plugin.entities.DxObjFolderHolder;
import com.yonde.dex.dao.entity.base.IdEntity;
import javax.persistence.Column;
import com.yonde.dex.lcycle.plugin.entities.DxLifecycleManageBaseHolder;
import com.yonde.dex.dao.entity.base.DxIdEntityEmbeddable;
import com.yonde.dex.logicdelete.plugin.entities.DxLogicDeleteEmbeddable;
import com.yonde.dex.version.plugin.entities.DxIterationEmbeddable;
/**
* @description: ExtApplicant-PO实体
* @author: dexadmin
* @version: V
* @date: 2024-8-2 15:26:37
**/
* @description: ExtApplicant-PO实体
* @author: dexadmin
* @version: V
* @date: 2024-8-15 16:14:30
**/
@Entity
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@Data
@Table(name = "EXT_APPLICANT")
public class ExtApplicant extends IdOnlyEntity implements DxObjFileLinkHolder ,DxLifecycleManageBaseHolder ,IdEntity ,DxLogicDeleteHolder ,DxIterationHolder{
public class ExtApplicant extends IdOnlyEntity implements DxContextHolder ,DxObjFileLinkHolder ,DxObjFolderHolder ,DxLifecycleManageBaseHolder ,IdEntity ,DxLogicDeleteHolder ,DxIterationHolder{
/**
* 扩展PO属性
*/
@DexEmbedded()
@Embedded()
private DxContextEmbeddable dxContextEmbeddable;
/**
* 扩展PO属性
*/
......@@ -59,6 +69,12 @@ public class ExtApplicant extends IdOnlyEntity implements DxObjFileLinkHolder ,D
*/
@DexEmbedded()
@Embedded()
private DxObjFolderEmbeddable dxObjFolderEmbeddable;
/**
* 扩展PO属性
*/
@DexEmbedded()
@Embedded()
private DxLifecycleManageBaseEmbeddable dxLifecycleManageBaseEmbeddable;
/**
* dao扩展对象
......
......@@ -23,31 +23,41 @@ import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Table;
import com.yonde.dex.lcycle.plugin.entities.DxLifecycleManageBaseEmbeddable;
import com.yonde.dex.dao.entity.base.IdEntity;
import javax.persistence.Column;
import com.yonde.dex.container.folder.plugin.entities.DxObjFolderEmbeddable;
import com.yonde.dex.context.plugin.entities.DxContextHolder;
import com.yonde.dex.dfs.objfilelink.plugin.entities.DxObjFileLinkHolder;
import com.yonde.dex.dfs.objfilelink.plugin.entities.DxObjFileLinkEmbeddable;
import com.yonde.dex.lcycle.plugin.entities.DxLifecycleManageBaseHolder;
import com.yonde.dex.dao.entity.base.DxIdEntityEmbeddable;
import com.yonde.dex.context.plugin.entities.DxContextEmbeddable;
import com.yonde.dex.dao.entity.base.IdOnlyEntity;
import com.yonde.dex.version.plugin.entities.DxIterationHolder;
import com.yonde.dex.logicdelete.plugin.entities.DxLogicDeleteHolder;
import com.yonde.dex.container.folder.plugin.entities.DxObjFolderHolder;
import com.yonde.dex.dao.entity.base.IdEntity;
import javax.persistence.Column;
import com.yonde.dex.lcycle.plugin.entities.DxLifecycleManageBaseHolder;
import com.yonde.dex.dao.entity.base.DxIdEntityEmbeddable;
import com.yonde.dex.logicdelete.plugin.entities.DxLogicDeleteEmbeddable;
import com.yonde.dex.version.plugin.entities.DxIterationEmbeddable;
/**
* @description: ExtInterface-PO实体
* @author: dexadmin
* @version: V
* @date: 2024-8-2 15:26:37
**/
* @description: ExtInterface-PO实体
* @author: dexadmin
* @version: V
* @date: 2024-8-15 16:08:09
**/
@Entity
@EqualsAndHashCode(callSuper = true)
@NoArgsConstructor
@Data
@Table(name = "EXT_INTERFACE")
public class ExtInterface extends IdOnlyEntity implements DxObjFileLinkHolder ,DxLifecycleManageBaseHolder ,IdEntity ,DxLogicDeleteHolder ,DxIterationHolder{
public class ExtInterface extends IdOnlyEntity implements DxContextHolder ,DxObjFileLinkHolder ,DxObjFolderHolder ,DxLifecycleManageBaseHolder ,IdEntity ,DxLogicDeleteHolder ,DxIterationHolder{
/**
* 扩展PO属性
*/
@DexEmbedded()
@Embedded()
private DxContextEmbeddable dxContextEmbeddable;
/**
* 扩展PO属性
*/
......@@ -59,6 +69,12 @@ public class ExtInterface extends IdOnlyEntity implements DxObjFileLinkHolder ,D
*/
@DexEmbedded()
@Embedded()
private DxObjFolderEmbeddable dxObjFolderEmbeddable;
/**
* 扩展PO属性
*/
@DexEmbedded()
@Embedded()
private DxLifecycleManageBaseEmbeddable dxLifecycleManageBaseEmbeddable;
/**
* dao扩展对象
......
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