Commit 3521142f authored by xuzhang's avatar xuzhang

feat[doc]代码迁移

parent ad463bea
Manifest-Version: 1.0
Main-Class: com.yonde.dcs.document.server.ServerApplication
......@@ -616,6 +616,20 @@ public class DxDocumentVO extends IdOnlyVO implements DxIterationVOHolder<DxDocu
@DexEmbedded()
private DxDocumentVOExpand<DxDocumentVO> dxDocumentExpand;
/**
* 一级分类
*/
private String oneLevCategory;
/**
* 二级分类
*/
private String twoLevCategory;
/**
* 三级分类
*/
private String threeLevCategory;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.ModelConfigProperty;
import com.yonde.dex.basedata.entity.annotation.ReferenceProperty;
import com.yonde.dex.basedata.entity.vo.IdOnlyVO;
import com.yonde.dex.basedata.entity.vo.IdVO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Map;
/**
* @description:
* @version: 0
* @date: 2022-02-24 04:32:14
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExpectPayDetailsVO.class
)
@ModelConfigProperty(syncES = true)
public class ExpectPayDetailsVO extends IdOnlyVO implements IdVO {
/**
* 金额
*/
private BigDecimal amount;
/**
* 收入合同
*/
@ReferenceProperty(baseProperty = "extIncomeContractId")
private ExtIncomeContractVO extIncomeContract;
/**
* 年份
*/
private String years;
/**
* extIncomeContract对应的属性
*/
private Long extIncomeContractId;
/**
* extIncomeContractId对应的类型
*/
private String extIncomeContractIdType;
private Map<String, Object> dynamicAttrs;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.ModelConfigProperty;
import com.yonde.dex.basedata.entity.annotation.ReferenceProperty;
import com.yonde.dex.lcycle.baseentity.vo.DxObjectVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Map;
/**
* @description:
* @version: 1
* @date: 2022-02-24 03:07:53
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExtContractExpensesVO.class
)
@ModelConfigProperty(syncES = true)
public class ExtContractExpensesVO extends DxObjectVo {
/**
* 收入合同
*/
@ReferenceProperty(baseProperty = "extIncomeContractId")
private ExtIncomeContractVO extIncomeContract;
/**
* extIncomeContract对应的属性
*/
private Long extIncomeContractId;
/**
* extIncomeContractId对应的类型
*/
private String extIncomeContractIdType;
/**
* 条目内容
*/
private String content;
/**
* 金额
*/
private BigDecimal itemAmount;
private Map<String, Object> dynamicAttrs;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.*;
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.linkdata.plugin.common.DxLinkDataVOEmbeddable;
import com.yonde.dex.linkdata.plugin.common.DxLinkDataVOHolder;
import com.yonde.dex.linkdata.plugin.entities.DxLinkDataHolder;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOEmbeddable;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOHolder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Map;
/**
* @description:
* @version: 0
* @date: 2022-04-06 03:50:21
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExtContractLinkVO.class
)
@ModelConfigProperty(syncES = true)
public class ExtContractLinkVO extends IdOnlyVO implements IdVO,DxLinkDataVOHolder<DxDocumentVO, DxDocumentVO>, DxLogicDeleteVOHolder {
public static final String DX_ID_EMBEDDABLE_PROP_NAME = "dxIdEmbeddable";
public static final String DX_LOGIC_DELETE_EMBEDDABLE_PROP_NAME = "dxLogicDeleteEmbeddable";
public static final String DX_LINK_DATA_EMBEDDABLE_PROP_NAME = "dxLinkDataEmbeddable";
public static final String LINK_DESCRIPT_PROP_NAME = "linkDescript";
/**
* dao扩展对象
*/
@DexEmbedded()
@JsonIgnore
private DxIdVOEmbeddable dxIdEmbeddable;
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxLogicDeleteVOEmbeddable dxLogicDeleteEmbeddable;
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxLinkDataVOEmbeddable<DxDocumentVO, DxDocumentVO> dxLinkDataEmbeddable;
/**
* 支出合同
*/
@ReferenceProperty(baseProperty = "targetId")
private ExtSpendingContractVO target;
/**
* 收入合同
*/
@ReferenceProperty(baseProperty = "sourceId")
private ExtIncomeContractVO source;
/**
* target对应的属性
*/
private Long targetId;
/**
* targetId对应的类型
*/
private String targetIdType;
/**
* source对应的属性
*/
private Long sourceId;
/**
* sourceId对应的类型
*/
private String sourceIdType;
private Map<String, Object> dynamicAttrs;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.ModelConfigProperty;
import com.yonde.dex.basedata.entity.annotation.ReferenceProperty;
import com.yonde.dex.basedata.entity.vo.IdVO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Map;
/**
* @author xfchai
* @description: 分发记录关联VO
* @description:
* @version: 0
* @date: 2021-09-14 11:08:37
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExtDisReocredLinkVO.class
)
@ModelConfigProperty(syncES = true)
public class ExtDisReocredLinkVO extends IdVO implements LinkData<ExtDistributeRecordVO, DxObjectVo> {
/**
* DxObject
*/
@ReferenceProperty(baseProperty = "targetId")
private DxObjectVo target;
/**
* 分发记录
*/
@ReferenceProperty(baseProperty = "sourceId")
private ExtDistributeRecordVO source;
/**
* target对应的属性
*/
private Long targetId;
/**
* targetId对应的类型
*/
private String targetIdType;
/**
* source对应的属性
*/
private Long sourceId;
/**
* sourceId对应的类型
*/
private String sourceIdType;
private Map<String, Object> dynamicAttrs;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.DexEmbedded;
import com.yonde.dex.basedata.entity.annotation.ModelConfigProperty;
import com.yonde.dex.basedata.entity.annotation.ReferenceProperty;
import com.yonde.dex.basedata.entity.annotation.RelationProperty;
import com.yonde.dex.basedata.entity.users.DxUserVO;
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.vo.ObjFileLinkVO;
import com.yonde.dex.linkdata.plugin.common.DxLinkDataVOEmbeddable;
import com.yonde.dex.linkdata.plugin.common.DxLinkDataVOHolder;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOEmbeddable;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOHolder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author xfchai
* @description: 分发记录实体VO
* @version: 1
* @date: 2021-09-14 11:11:01
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExtDistributeRecordVO.class
)
@ModelConfigProperty(syncES = true)
public class ExtDistributeRecordVO extends IdOnlyVO implements IdVO, DxLinkDataVOHolder<DxDocumentVO, DxDocumentVO>, DxLogicDeleteVOHolder {
public static final String DX_ID_EMBEDDABLE_PROP_NAME = "dxIdEmbeddable";
public static final String DX_LOGIC_DELETE_EMBEDDABLE_PROP_NAME = "dxLogicDeleteEmbeddable";
public static final String DX_LINK_DATA_EMBEDDABLE_PROP_NAME = "dxLinkDataEmbeddable";
public static final String LINK_DESCRIPT_PROP_NAME = "linkDescript";
/**
* dao扩展对象
*/
@DexEmbedded()
@JsonIgnore
private DxIdVOEmbeddable dxIdEmbeddable;
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxLogicDeleteVOEmbeddable dxLogicDeleteEmbeddable;
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxLinkDataVOEmbeddable<DxDocumentVO, DxDocumentVO> dxLinkDataEmbeddable;
/**
* 分发记录对象Link模型集合
*/
@RelationProperty(refProperty = "source")
private List<ExtDisReocredLinkVO> sourceDisReocredLink;
/**
* 分发类型
*/
private String distributeType;
/**
* 操作时间
*/
private Date operationTime;
/**
* 工作说明
*/
private String workDesc;
/**
* 接收备注
*/
private String receiveRemark;
/**
* 完成接收任务时间
*/
private Date comReceiveTime;
/**
* 分发人
*/
@ReferenceProperty(baseProperty = "senderId")
private DxUserVO sender;
/**
* 显示名称
*/
private String boTitle;
/**
* 是否处理
*/
private Boolean completed;
/**
* 截止时间
*/
private Date dueTime;
/**
* 关联附件集合
*/
@RelationProperty(refProperty = "source")
private List<ObjFileLinkVO> objFileLinks;
/**
* 分发单位
*/
private String distributDepart;
/**
* 分发时间
*/
private Date distributTime;
/**
* 发送人
*/
@ReferenceProperty(baseProperty = "handlerId")
private DxUserVO handler;
/**
* 分发备注
*/
private String distributeRemark;
/**
* 分发是否需回复
*/
private String replyDistribute;
/**
* 要求回复日期
*/
private Date replyDate;
/**
* 接收单位
*/
private String receiver;
/**
* 接收任务类型
*/
private String receiveTaskType;
/**
* 接收时间
*/
private Date receiveTime;
/**
* 接收类型
*/
private String receiveType;
/**
* 发送人对应的属性
*/
private Long senderId;
/**
* 发送人对应的类型
*/
private String senderIdType;
/**
* 接收人对应的属性
*/
private Long handlerId;
/**
* 接收人对应的类型
*/
private String handlerIdType;
/**
* 外单位(收)
*/
private String foreignUnitReceive;
/**
* 外单位(发)
*/
private String foreignUnitIssued;
/**
* 发送任务是否结束
*/
private Boolean sendFinish;
/**
* 分发编号
*/
private String disNumber;
private Map<String, Object> dynamicAttrs;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.ModelConfigProperty;
import com.yonde.dex.basedata.entity.annotation.ReferenceProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;
/**
* @description:
* @version: 3
* @date: 2022-02-24 03:26:09
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExtIncomeBillInfoVO.class
)
@ModelConfigProperty(syncES = true)
public class ExtIncomeBillInfoVO extends DxObjectVo {
/**
* 收入明细
*/
@ReferenceProperty(baseProperty = "extIncomeDetailId")
private ExtIncomeDetailVO extIncomeDetail;
/**
* 票据号码
*/
private String ticketNumber;
/**
* 票据金额
*/
private BigDecimal ticketAmount;
/**
* 开具时间
*/
private Date issuingTime;
/**
* 税率
*/
private Float taxRate;
/**
* extIncomeDetail对应的属性
*/
private Long extIncomeDetailId;
/**
* extIncomeDetailId对应的类型
*/
private String extIncomeDetailIdType;
/**
* 票据类型
*/
private String billType;
private Map<String, Object> dynamicAttrs;
/**
* 备注
*/
private String remark;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.ModelConfigProperty;
import com.yonde.dex.basedata.entity.annotation.RelationProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author: xfchai
* @description: 收入合同实体VO
* @version: 1
* @date: 2021-09-03 03:41:00
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExtIncomeContractVO.class
)
@ModelConfigProperty(syncES = true)
public class ExtIncomeContractVO extends DxObjectVo {
/**
* 项目属性
*/
private String itemProperties;
/**
* 项目名称
*/
private String itemName;
/**
* 项目来源
*/
private String itemOrigin;
/**
* 合同编号
*/
private String contractNo;
/**
* 合同名称
*/
private String contractName;
/**
* 合同生效时间
*/
private Date startTime;
/**
* 合同结束时间
*/
private Date endTime;
/**
* 校内科研代码
*/
private String researchCode;
/**
* 校内财务代码
*/
private String financialCode;
/**
* 执行财务规定
*/
private String financialRegul;
/**
* 合同价款类型
*/
private String contractPriceType;
/**
* 合同额
*/
private BigDecimal contractPrice;
/**
* 审价额
*/
private BigDecimal trialPrice;
/**
* 项目编号
*/
private String itemNumber;
/**
* 合同经费构成
*/
private String contractfunding;
/**
* 支付时间
*/
private Date payTime;
/**
* 支付金额
*/
private BigDecimal payPrice;
/**
* 到款情况
*/
private String paymentSituat;
/**
* 票据开具情况
*/
private String billStatus;
/**
* 票据开具时间
*/
private Date issuanceTime;
/**
* 票据号码
*/
private String billNumber;
/**
* 票据类型
*/
private String billType;
/**
* 税率
*/
private String tariff;
/**
* 票据金额
*/
private BigDecimal billAmount;
/**
* 收入明细集合
*/
@RelationProperty(refProperty = "extIncomeContract")
private List<ExtIncomeDetailVO> extIncomeDetails;
/**
* 合同经费条目构成集合
*/
@RelationProperty(refProperty = "extIncomeContract")
private List<ExtContractExpensesVO> contractExpensess;
/**
* 已到款
*/
private BigDecimal paid;
/**
* 预计到款明细集合
*/
@RelationProperty(refProperty = "extIncomeContract")
private List<ExpectPayDetailsVO> expectPayDetailss;
/**
* 到款明细集合
*/
@RelationProperty(refProperty = "extIncomeContract")
private List<ExtPaymentDetailsVO> paymentDetailss;
/**
* 待拨付
*/
private BigDecimal toBedisbursed;
private Map<String, Object> dynamicAttrs;
/**
* 合同link集合
*/
@RelationProperty(refProperty = "source")
private List<ExtContractLinkVO> sourceContractLink;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.ModelConfigProperty;
import com.yonde.dex.basedata.entity.annotation.ReferenceProperty;
import com.yonde.dex.basedata.entity.annotation.RelationProperty;
import com.yonde.dex.lcycle.baseentity.vo.DxObjectVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @description:
* @version: 1
* @date: 2022-02-24 02:58:51
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExtIncomeDetailVO.class
)
@ModelConfigProperty(syncES = true)
public class ExtIncomeDetailVO extends DxObjectVo {
/**
* IncomeBillInfo集合
*/
@RelationProperty(refProperty = "extIncomeDetail")
private List<ExtIncomeBillInfoVO> IncomeBillInfos;
/**
* 收入合同
*/
@ReferenceProperty(baseProperty = "extIncomeContractId")
private ExtIncomeContractVO extIncomeContract;
/**
* 支付进度安排时间
*/
private Date payTime;
/**
* 到款情况
*/
private String paySituation;
/**
* 票据开具
*/
private String billing;
/**
* 支付进度安排金额
*/
private BigDecimal payAmount;
/**
* 到账时间
*/
private Date arrivalTime;
/**
* extIncomeContract对应的属性
*/
private Long extIncomeContractId;
/**
* extIncomeContractId对应的类型
*/
private String extIncomeContractIdType;
private Map<String, Object> dynamicAttrs;
/**
* 金额
*/
private BigDecimal amount;
/**
* 时间
*/
private Date incomeTime;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.DexEmbedded;
import com.yonde.dex.basedata.entity.annotation.ModelConfigProperty;
import com.yonde.dex.basedata.entity.annotation.ReferenceProperty;
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.linkdata.plugin.common.DxLinkDataVOEmbeddable;
import com.yonde.dex.linkdata.plugin.common.DxLinkDataVOHolder;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOEmbeddable;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOHolder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Map;
/**
* @description:
* @version: 0
* @date: 2022-02-24 04:30:52
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExtPaymentDetailsVO.class
)
@ModelConfigProperty(syncES = true)
public class ExtPaymentDetailsVO extends IdOnlyVO implements IdVO, DxLinkDataVOHolder<DxDocumentVO, DxDocumentVO>, DxLogicDeleteVOHolder {
/**
* dao扩展对象
*/
@DexEmbedded()
@JsonIgnore
private DxIdVOEmbeddable dxIdEmbeddable;
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxLogicDeleteVOEmbeddable dxLogicDeleteEmbeddable;
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxLinkDataVOEmbeddable<DxDocumentVO, DxDocumentVO> dxLinkDataEmbeddable;
/**
* 收入合同
*/
@ReferenceProperty(baseProperty = "extIncomeContractId")
private ExtIncomeContractVO extIncomeContract;
/**
* 年份
*/
private String years;
/**
* 金额
*/
private BigDecimal amount;
/**
* extIncomeContract对应的属性
*/
private Long extIncomeContractId;
/**
* extIncomeContractId对应的类型
*/
private String extIncomeContractIdType;
private Map<String, Object> dynamicAttrs;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.DexEmbedded;
import com.yonde.dex.basedata.entity.annotation.ModelConfigProperty;
import com.yonde.dex.basedata.entity.annotation.ReferenceProperty;
import com.yonde.dex.basedata.entity.annotation.VersionProperty;
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.linkdata.plugin.common.DxLinkDataVOEmbeddable;
import com.yonde.dex.linkdata.plugin.common.DxLinkDataVOHolder;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOEmbeddable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Map;
/**
* @author: xfchai
* @description: 计划文档关系实体VO
* @version: 1
* @date: 2021-09-03 04:42:12
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExtPlanDocLinkVO.class
)
@ModelConfigProperty(syncES = true)
public class ExtPlanDocLinkVO extends IdOnlyVO implements IdVO, DxLinkDataVOHolder<DxDocumentVO, DxDocumentVO> {
/**
* dao扩展对象
*/
@DexEmbedded()
@JsonIgnore
private DxIdVOEmbeddable dxIdEmbeddable;
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxLogicDeleteVOEmbeddable dxLogicDeleteEmbeddable;
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxLinkDataVOEmbeddable<DxDocumentVO, DxDocumentVO> dxLinkDataEmbeddable;
/**
* 文档
*/
@ReferenceProperty(baseProperty = "targetId")
@VersionProperty(curVersion = VersionRelationType.NONE, refVersion = VersionRelationType.MASTER)
private DxDocumentVO target;
/**
* 计划
*/
@ReferenceProperty(baseProperty = "sourceId")
@VersionProperty(curVersion = VersionRelationType.NONE, refVersion = VersionRelationType.MASTER)
private ExtPlanVO source;
/**
* target对应的属性
*/
private Long targetId;
/**
* targetId对应的类型
*/
private String targetIdType;
/**
* source对应的属性
*/
private Long sourceId;
/**
* sourceId对应的类型
*/
private String sourceIdType;
private Map<String, Object> dynamicAttrs;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.*;
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.dfs.vo.ObjFileLinkVO;
import com.yonde.dex.linkdata.plugin.common.DxLinkDataVOEmbeddable;
import com.yonde.dex.linkdata.plugin.common.DxLinkDataVOHolder;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOEmbeddable;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOHolder;
import com.yonde.dex.secretcode.plugin.common.entity.DxSecretVOEmbeddable;
import com.yonde.dex.secretcode.plugin.common.entity.DxSecretVOHolder;
import com.yonde.dex.version.plugin.common.entity.DxIterationVOEmbeddable;
import com.yonde.dex.version.plugin.common.entity.DxIterationVOHolder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author: xfchai
* @description: 计划实体
* @version: 2
* @date: 2021-09-03 02:32:41
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExtPlanVO.class
)
@ModelConfigProperty(syncES = true)
public class ExtPlanVO extends IdOnlyVO implements DxIterationVOHolder<ExtPlanVO>, DxLogicDeleteVOHolder, DxSecretVOHolder {
/**
* dao扩展对象
*/
@DexEmbedded()
@JsonIgnore
private DxIdVOEmbeddable dxIdEmbeddable;
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxLogicDeleteVOEmbeddable dxLogicDeleteEmbeddable;
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxLinkDataVOEmbeddable<ExtPlanVO, ExtPlanVO> dxLinkDataEmbeddable;
/**
* 扩展VO属性
*/
@DexEmbedded()
@JsonIgnore
private DxIterationVOEmbeddable<ExtPlanVO> dxIterationEmbeddable;
/**
* 业务计划类型
*/
private String businessPlanType;
/**
* 反馈类型
*/
private String feedbackType;
/**
* 开始时间
*/
private Date startTime;
/**
* 关联附件集合
*/
@RelationProperty(refProperty = "source")
private List<ObjFileLinkVO> objFileLinks;
/**
* 父Id
*/
private Long parentId;
/**
* 子集合
*/
private List<ExtPlanVO> children;
/**
* 父集合
*/
private List<ExtPlanVO> parentList;
/**
* 工期
*/
private String constructPeriod;
/**
* 是否产生计划任务
*/
private Boolean hasPlanTasks;
/**
* 合同编号
*/
private String contractNo;
/**
* 计划执行人
*/
private String planExecutor;
/**
* 上级计划编码
*/
private String superPlanCode;
/**
* 完成时间
*/
private Date completeTime;
/**
* 计划文档关系集合
*/
@RelationProperty(refProperty = "source")
@VersionProperty(curVersion = VersionRelationType.MASTER, refVersion = VersionRelationType.NONE)
private List<ExtPlanDocLinkVO> sourcePlanDocLink;
private Map<String, Object> dynamicAttrs;
/**
* 操作
*/
private String operate;
/**
* 实际开始时间
*/
private Date actualStartTime;
/**
* 实际完成时间
*/
private Date actualComplateTime;
/**
* 文件分类
*/
private String fileType;
/**
* 文件名称
*/
private String fileName;
/**
* 文件编号
*/
private String fileNumber;
/**
* 文件代号
*/
private String fileCode;
/**
* 项目代号
*/
private String projectCode;
/**
* 管理信息系统编码
*/
private String systemCode;
/**
* 审核者
*/
private String review;
/**
* 批准者
*/
private String approver;
/**
* 审定者
*/
private String verifier;
/**
* 完成情况
*/
private String completion;
/**
* 未完成情况
*/
private String unfinishSituat;
/**
* 反馈情况说明
*/
private String feedbackDescript;
/**
* 阶段状态
*/
private String phaseState;
/**
* 计划级别
*/
private String planLevel;
/**
* 任务完成状态
*/
@DictProperty(baseProperty = "taskState", dictType = "TaskState")
private String taskState;
@Override
public DxSecretVOEmbeddable getDxSecretEmbeddable() {
return null;
}
@Override
public void setDxSecretEmbeddable(DxSecretVOEmbeddable dxSecretVOEmbeddable) {
}
}
package com.yonde.dcs.document.common.vo;
import lombok.Data;
/**
* @author xfchai
* @ClassName ReviseVersionVO.java
* @Description 升版变更VO
* @createTime 2021/09/26 10:10:00
*/
@Data
public class ExtReviseVersionVO {
/**
* 阶段
*/
private String phaseState;
/**
* 原因说明
*/
private String causeDescript;
/**
* 更改原因
*/
private String changeReason;
}
package com.yonde.dcs.document.common.vo;
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 lombok.*;
/**
* @program: service
* @description: 系统流水码VO
* @author: dang wei
* @create: 2021-05-31 14:14
*/
@Data
public class ExtSerialNumberVO extends IdOnlyVO implements IdVO {
private Long contextId;
private String contextIdType;
private String className;
private String subTypeName;
private Long maxNumber;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.ModelConfigProperty;
import com.yonde.dex.basedata.entity.annotation.ReferenceProperty;
import com.yonde.dex.lcycle.baseentity.vo.DxObjectVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.util.Date;
import java.util.Map;
/**
* @description:
* @version: 1
* @date: 2022-02-24 03:26:49
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExtSpendingBillInfoVO.class
)
@ModelConfigProperty(syncES = true)
public class ExtSpendingBillInfoVO extends DxObjectVo {
/**
* 支出明细
*/
@ReferenceProperty(baseProperty = "extSpendingDetailId")
private ExtSpendingDetailVO extSpendingDetail;
/**
* 开具时间
*/
private Date issuingTime;
/**
* 开具单位
*/
private String issuingUnit;
/**
* 发票内容
*/
private String invoiceContent;
/**
* 规格型号
*/
private String specifications;
/**
* 单位
*/
private String unit;
/**
* 开具金额发票类型
*/
private String amountInvoiceType;
/**
* 数量
*/
private Integer amounts;
/**
* 发票号码
*/
private String invoiceNumber;
/**
* 税率
*/
private Float taxRate;
/**
* extSpendingDetail对应的属性
*/
private Long extSpendingDetailId;
/**
* extSpendingDetailId对应的类型
*/
private String extSpendingDetailIdType;
private Map<String, Object> dynamicAttrs;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.ModelConfigProperty;
import com.yonde.dex.basedata.entity.annotation.RelationProperty;
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.linkdata.plugin.common.DxLinkDataVOEmbeddable;
import com.yonde.dex.linkdata.plugin.common.DxLinkDataVOHolder;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOEmbeddable;
import com.yonde.dex.logicdelete.plugin.common.entity.DxLogicDeleteVOHolder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author: xfchai
* @description: 支出合同VO
* @version: 1
* @date: 2021-09-03 03:43:35
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExtSpendingContractVO.class
)
@ModelConfigProperty(syncES = true)
public class ExtSpendingContractVO extends IdOnlyVO implements IdVO , DxLinkDataVOHolder<DxDocumentVO, DxDocumentVO>, DxLogicDeleteVOHolder {
/**
* 支出明细集合
*/
@RelationProperty(refProperty = "extSpendingContract")
private List<ExtSpendingDetailVO> extSpendingDetails;
/**
* 合同link集合
*/
@RelationProperty(refProperty = "target")
private List<ExtContractLinkVO> targetContractLink;
/**
* 合同编号
*/
private String contractNumber;
/**
* 审批日期
*/
private Date approvalDate;
/**
* 预计结算额
*/
private BigDecimal perSettleAmount;
/**
* 所属课题
*/
private String subject;
/**
* 合同成果
*/
private String contractOutcome;
/**
* 支付申请
*/
private String payApplication;
/**
* 已付金额
*/
private BigDecimal paidAmount;
/**
* 付款比例
*/
private String paymentRatio;
/**
* 费用大类
*/
private String expenseCategory;
/**
* 合同名称
*/
private String contractName;
/**
* 合作方
*/
private String partner;
/**
* 合同工期
*/
private Date contractDur;
/**
* 合同金额
*/
private BigDecimal contractAmount;
/**
* 技术负责人
*/
private String techLeader;
/**
* 合同内容
*/
private String contractContent;
/**
* 支付节点
*/
private String payNode;
/**
* 验收方法
*/
private String acceptMethod;
/**
* 未付金额
*/
private BigDecimal unpaidAmount;
/**
* 备注
*/
private String remark;
/**
* 费用小类
*/
private String feeSubCategory;
/**
* 结算额
*/
private BigDecimal settleAmount;
/**
* 收入合同编号
*/
private String revContractNo;
/**
* 签订部门
*/
private String signDepar;
/**
* 合同结束工期
*/
private Date contractEndDur;
private Map<String, Object> dynamicAttrs;
}
package com.yonde.dcs.document.common.vo;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.yonde.dex.basedata.entity.annotation.ModelConfigProperty;
import com.yonde.dex.basedata.entity.annotation.ReferenceProperty;
import com.yonde.dex.basedata.entity.annotation.RelationProperty;
import com.yonde.dex.lcycle.baseentity.vo.DxObjectVo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author: xfchai
* @description: 支出明细VO
* @version: 1
* @date: 2021-09-03 03:44:53
**/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@JsonTypeInfo(
use = JsonTypeInfo.Id.CLASS,
property = "dxClassname",
defaultImpl = ExtSpendingDetailVO.class
)
@ModelConfigProperty(syncES = true)
public class ExtSpendingDetailVO extends DxObjectVo {
/**
* 支出合同
*/
@ReferenceProperty(baseProperty = "extSpendingContractId")
private ExtSpendingContractVO extSpendingContract;
/**
* 付款次数
*/
private Integer payments;
/**
* 时间
*/
private Date payTime;
/**
* 凭证号
*/
private String voucherNumber;
/**
* 金额
*/
private BigDecimal amount;
/**
* 支出合同发票信息集合
*/
@RelationProperty(refProperty = "extSpendingDetail")
private List<ExtSpendingBillInfoVO> spendingBillInfos;
/**
* extSpendingContract对应的属性
*/
private Long extSpendingContractId;
/**
* extSpendingContractId对应的类型
*/
private String extSpendingContractIdType;
private Map<String, Object> dynamicAttrs;
}
package com.yonde.dcs.document.core.constants;
/**
* @author xfchai
* @ClassName DictConstants.java
* @Description 关于字典的通用变量
* @createTime 2022/01/25 16:06:00
*/
public class DictConstants {
/**
* DCR更改原因字典
*/
//设计方案更改
public static final String DESIGN_CHANGES = "DesignChanges";
//接口变更
public static final String INTERFACE_CHANGE = "InterfaceChange";
//材料代换
public static final String MATERIAL_SUBSTITUT = "MaterialSubstitut";
//其他
public static final String OTHERS = "Others";
/**
* DCR更改答复字典
*/
//同意
public static final String AGREE = "agree";
//不同意
public static final String DISAGREE = "disagree";
/**
* 更改类型
*/
//1类
public static final String CLASS_ONE = "classOne";
//2a类
public static final String CLASS_TWOA = "classTwoA";
//2b类
public static final String CLASS_TWOB = "classTwoB";
/**
* 建议更改方案
*/
//需要改设计方案
public static final String SuggestChangePlan_CHANGE_DESIGN = "changeDesign";
//需要更改设计文件/图样
public static final String SuggestChangePlan_CHANGE_DESIGN_DOC = "changeDesignDoc";
//需现场返工
public static final String SuggestChangePlan_REWORK = "reworkSite";
//其他
public static final String SuggestChangePlan_OTHER = "other";
/**
* 校核内容
*/
public static final String CheckContent = "CheckContent";
/**
* (校核)标准化审查内容
*/
public static final String CheckStandardReview = "CheckStandardReview";
/**
* 审核内容
*/
public static final String ReviewContent = "ReviewContent";
/**
* (审核)标准化审查内容
*/
public static final String ReviewContentStandardReview = "ReviewContentStandardReview";
/**
* 审定内容
*/
public static final String verifierContent = "verifierContent";
}
package com.yonde.dcs.document.core.constants;
import java.util.Arrays;
import java.util.List;
/**
* @author xfchai
* @ClassName SignConstants.java
* @Description 常量属性
* @createTime 2021/09/02 14:42:00
*/
public final class SignConstants {
//签名取值
public static final String SIGN_KEY_PREPARED = "编制";
public static final String SIGN_KEY_TSSH = "同室审核";
public static final String SIGN_KEY_FXTZSSH = "分系统总师审核";
public static final String SIGN_KEY_GY = "工艺";
public static final String SIGN_KEY_QF = "签发";
public static final String SIGN_KEY_ZTSSH = "总体室审核";
public static final String SIGN_KEY_APPROVED = "批准";
public static final String SIGN_KEY_STANDARD = "标准化";
public static final String SIGN_KEY_ZTS = "总体室";
public static final String SIGN_KEY_ZTSQS = "总体室签审";
public static final String SIGN_KEY_TZSH = "提资审核";
public static final String SIGN_KEY_SH = "审核";
public static final String SIGN_KEY_CLJD = "编制不符合项处理单处理决定任务";
public static final String SIGN_KEY_SWYZ = "编制不符合项处理单实物验证项任务";
public static final String SIGN_KEY_SQSH = "申请审核";
public static final String SIGN_KEY_CHECKER = "校核";
public static final String SIGN_KEY_SD = "审定";
public static final String SIGN_KEY_JKHQ = "接口会签";
public static final String SIGN_KEY_CGB = "采购部会签";
public static final String SIGN_KEY_SCB = "市场部会签";
public static final String SIGN_KEY_CPYF = "产品研发部复核";
public static final String SIGN_KEY_PBB = "品保部";
public static final String SIGN_ZBB = "质保部签审";
public static final String SIGN_SJX = "设计项签审";
public static final String SIGN_ZTS = "总体室签审";
public static final String SIGN_GCB = "工程部签审";
public static final String SIGN_SD = "审定";
public static final String SIGN_KEY_ZTSJKSC = "总体室接口审查";
public static final String SIGN_KEY_ZXSC = "专项审查";
public static final String SIGN_KEY_JKHQSC = "接口会签审查";
//NCR审查单模板变量(质保部签审)
public static final String ZBBprocessName = "ZBBprocessName";
public static final String ZBBremark = "ZBBremark";
public static final String ZBBfzr_photo = "ZBBfzr_photo";
public static final String ZBBfzr_date = "ZBBfzr_date";
//NCR审查单模板变量(设计项签审)
public static final String SJXprocessName = "SJXprocessName";
public static final String SJXremark = "SJXremark";
public static final String SJXfzr_photo = "SJXfzr_photo";
public static final String SJXfzr_date = "SJXfzr_date";
//NCR审查单模板变量(总体室签审)
public static final String ZTSprocessName = "ZTSprocessName";
public static final String ZTSremark = "ZTSremark";
public static final String ZTSfzr_photo = "ZTSfzr_photo";
public static final String ZTSfzr_date = "ZTSfzr_date";
//NCR审查单模板变量(工程部签审)
public static final String GCBprocessName = "GCBprocessName";
public static final String GCBremark = "GCBremark";
public static final String GCBfzr_photo = "GCBfzr_photo";
public static final String GCBfzr_date = "GCBfzr_date";
/**
* 定义流程判断节点常量
*/
public final static List WfResultList = Arrays.asList("通过", "提交签审", "提交审阅", "提交", "提交提资审阅", "不需要总体室会签", "外协采购单位(过工程部)", "设计协同单位及其他");
/**
* 定义NCR审查单流程节点常量
*/
public final static List NCRSignTaskList = Arrays.asList(SignConstants.SIGN_ZBB, SignConstants.SIGN_GCB, SignConstants.SIGN_SJX, SignConstants.SIGN_ZTS, SignConstants.SIGN_KEY_APPROVED);
/**
* 定义总体室签审节点名称
*/
public final static List ZTSSignTaskList = Arrays.asList(SIGN_KEY_ZTS, SIGN_ZTS, SIGN_KEY_ZTSJKSC);
/**
* 定义流程路由常量
*/
public final static List WfRoutingList = Arrays.asList("通过", "提交");
}
\ No newline at end of file
package com.yonde.dcs.document.core.constants;
/**
* @author xfchai
* @ClassName TemplateConstants.java
* @Description 各个模板名称
* @createTime 2021/11/15 14:50:00
*/
public class TemplateConstants {
/**
* 内部接口模板名称
*/
public static final String INTERFACE_TEMPLATE = "InterfaceTemplate.ftl";
/**
* 技术联系单模板名称
*/
public static final String CONTACTLIST_TEMPLATE = "ContactListTemplate.ftl";
/**
* 工作联系单模板名称
*/
public static final String WORK_CONTACTLIST_TEMPLATE = "WorkContactListTemplate.ftl";
/**
* 设计变更模板名称
*/
public static final String DESIGN_CHANGE_TEMPLATE = "DesignChangeTemplate.ftl";
/**
* 过时文件通知单模板名称
*/
public static final String OUTDATED_NOTIFY_TEMPLATE = "OutdatedDocNotifyTemplate.ftl";
/**
* 设计文件需求申请单
*/
public static final String DESIGN_DOC_APPLICATION_TEMPLATE = "DesignDocApplicatTemplate.ftl";
/**
* 设计输入资料单
*/
public static final String DESIGN_ENTER_TEMPLATE = "DesignEnterTemplate.ftl";
/**
* 设计输入资料单
*/
public static final String NCR_TEMPLATE = "NCRTemplate.ftl";
/**
* NCR审查模板
*/
public static final String NCR_REVIEW_TEMPLATE = "NCRReviewTemplate.ftl";
}
package com.yonde.dcs.document.core.controller;
import cn.hutool.core.collection.CollectionUtil;
import com.yonde.dcs.document.common.vo.DxDocumentVO;
import com.yonde.dcs.document.core.constants.Constants;
import com.yonde.dcs.document.core.service.ExtAutoTaskService;
import com.yonde.dcs.document.core.service.ExtSendFormLinkService;
import com.yonde.dcs.document.core.util.ExtDocUtil;
import com.yonde.dex.basedata.entity.api.ApiResult;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.entity.vo.IdVO;
import com.yonde.dex.taskmonitor.api.data.TaskMessage;
import com.yonde.dex.taskmonitor.api.interfaces.TaskMessagePusher;
import com.yonde.dex.wfc.common.vo.DxWfProcessJobSearchVO;
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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;
import java.util.HashMap;
import java.util.Map;
/**
* @program: service
* @description: 自动任务服务接口
* @author: dang wei
* @create: 2021-07-13 10:01
*/
@RestController
@RequestMapping("/task")
@Api(tags = "自动任务服务接口")
public class ExtAutoTaskController {
@Autowired
WfcProcessFeign wfcProcessFeign;
@Autowired
TaskMessagePusher taskMessagePusher;
@Autowired
private ExtAutoTaskService autoTaskService;
@Autowired
private ExtDocUtil extDocUtil;
@Autowired
private ExtSendFormLinkService sendFormLinkService;
@ApiOperation("电子签名")
@PostMapping({"/esign"})
public ApiResult esign(@RequestBody IdVO entity) {
DxWfProcessSearchVO dxWfProcessSearchVO = new DxWfProcessSearchVO();
dxWfProcessSearchVO.setPboClass(entity.getDxClassname());
dxWfProcessSearchVO.setPboId(entity.getId());
Page<DxWfProcessVO> dxWfProcessVODxPage = this.wfcProcessFeign.getProcessList(dxWfProcessSearchVO, 1, 1);
if (CollectionUtil.isNotEmpty(dxWfProcessVODxPage.getContent())) {
DxWfProcessVO dxWfProcessVO = dxWfProcessVODxPage.getContent().get(0);
String pboKey = "";
String signNode = "";
if (DxDocumentVO.class.getName().equals(entity.getDxClassname())) {
pboKey = "doc";
signNode = "Activity_0st1yf8";
}
DxWfTaskContext dxWfTaskContext = new DxWfTaskContext(dxWfProcessVO.getBusinessKey(), dxWfProcessVO.getId(), dxWfProcessVO.getProcessDef().getId(), signNode, null, (Map) null);
WfcSignMessage wfcSignMessage = new WfcSignMessage(new HashMap());
wfcSignMessage.setWfTaskContext(dxWfTaskContext);
wfcSignMessage.setSignType(pboKey);
TaskMessage taskMessage = (new WfcSignMessageBuilder()).newTasks(wfcSignMessage);
this.taskMessagePusher.sendMessage(taskMessage);
return ApiResult.ok("重新发送电子签名请求成功!");
} else {
return ApiResult.ok("该对象未走签审流程!");
}
}
@ApiOperation(value = "更新PDF", notes = "更新PDF", httpMethod = "GET")
@GetMapping(value = "/updatePdf/{id}")
public ApiResult updatePdf(@PathVariable Long id) {
DxDocumentVO documentVO = extDocUtil.findDocObjFileLinks(id);
//重新生成设计图册签名
autoTaskService.generateQHTechDoc(documentVO, null);
if (Constants.OUTDATED_NOTIFY.equals(documentVO.getSubTypeName())) {
//特殊处理过时文件通知单
autoTaskService.generateOutdatedDocNotify(documentVO);
} else {
//重新生成单据签名
autoTaskService.generateDocWordSign(documentVO, null, "二");
}
return ApiResult.ok("更新成功!");
}
}
package com.yonde.dcs.document.core.controller;
import com.yonde.dcs.document.core.service.ExtContextService;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.api.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @description:
* @author: Mr.Kent
* @create: 2020-10-23
**/
@Api(tags = "[克制化上下文] 密级查询接口")
@RestController
@RequestMapping("/DxContext")
public class ExtContextController {
@Autowired
ExtContextService extContextService;
@ApiOperation("密级查询")
@PostMapping("/search/secret")
public ApiResult searchSecretCode(@RequestBody SearchQueryCondition searchQueryCondition) {
return ApiResult.ok(extContextService.searchSecretCode(searchQueryCondition));
}
}
package com.yonde.dcs.document.core.controller;
import com.yonde.dcs.document.common.vo.ExtDistributeRecordVO;
import com.yonde.dcs.document.core.controller.shadow.ExtDenDescriptLinkControllerShadow;
import com.yonde.dcs.document.core.controller.shadow.ExtDistributeRecordControllerShadow;
import com.yonde.dcs.document.core.service.ExtAutoTaskService;
import com.yonde.dcs.document.core.service.ExtDenDescriptLinkService;
import com.yonde.dcs.document.core.service.ExtDistributeRecordService;
import com.yonde.dex.basedata.entity.api.ApiResult;
import com.yonde.dex.baseweb.AbstractBaseController;
import com.yonde.dex.user.common.vo.DxOrganizationVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @description: DistributeRecord控制层接口
* @version: 1
* @date: 2021-09-14 11:11:01
**/
@RestController
@RequestMapping("/DistributeRecord")
public class ExtDistributeRecordController<V extends ExtDistributeRecordVO, S extends ExtDistributeRecordService<V>> extends ExtDistributeRecordControllerShadow<V, S> {
@Autowired
private ExtDistributeRecordService distributeRecordService;
@Autowired
private ExtAutoTaskService autoTaskService;
/**
* 收发记录接口
*
* @param id
* @return
*/
@ApiOperation("获取收发记录接口")
@GetMapping("/getDisRecord")
public ApiResult getDisRecord(@RequestParam("id") Long id) {
List<ExtDistributeRecordVO> disRecord = distributeRecordService.getDisRecord(id);
return ApiResult.ok(disRecord, "查询成功");
}
/**
* 通过用户id和code查询组织
*
* @param userId
* @param code
* @return
*/
@ApiOperation("通过用户id和code查询组织")
@GetMapping("/searchOrgByUserId")
public ApiResult searchOrgByUserId(@RequestParam("userId") Long userId, @RequestParam("code") String code) {
List<DxOrganizationVO> organizationVOS = autoTaskService.searchOrgNameByUserId(userId, code);
return ApiResult.ok(organizationVOS, "查询成功");
}
}
package com.yonde.dcs.document.core.controller;
import com.yonde.dcs.document.common.vo.DxDocumentVO;
import com.yonde.dcs.document.common.vo.ExtReviseVersionVO;
import com.yonde.dcs.document.core.service.ExtDocService;
import com.yonde.dcs.document.entity.po.ExtAtlasDrawingLink;
import com.yonde.dex.basedata.entity.api.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* @program: inet-pdm-service
* @description: 客制化文档接口
* @author: dang wei
* @create: 2021-09-18 13:38
*/
@Api(tags = {"客制化文档信息接口"})
@RestController
@RequestMapping({"/DxDocument/ext"})
//@BasePermission("DCS-DOC:Doc")
public class ExtDocController {
@Autowired
private ExtDocService extDocService;
/**
* 版本升级
*
* @param id
* @param reviseVersionVO
* @return
*/
@ApiOperation("版本升级")
@PostMapping({"/version/{id}/revise"})
// @SubPermission({"versionRevise"})
public ApiResult reviseDocVersion(@PathVariable Long id, @RequestBody ExtReviseVersionVO reviseVersionVO) {
DxDocumentVO dxDocumentVO = extDocService.reviseDocVersion(id, reviseVersionVO);
return ApiResult.ok(dxDocumentVO, "升版成功");
}
/**
* 内部接口提交审阅按钮业务
*
* @param id
* @return
*/
@ApiOperation("内部接口提交审阅按钮")
@PostMapping("/submitProcess/{id}")
public ApiResult submitReview(@PathVariable Long id) {
DxDocumentVO dxDocumentVO = extDocService.submitReview(id);
return ApiResult.ok(dxDocumentVO, "提交审阅成功!");
}
/**
* 批量下载图册
*
* @param response
* @param id
* @throws IOException
*/
@ApiOperation(value = "批量下载", notes = "批量下载", httpMethod = "GET")
@GetMapping(value = "/batchDownloadDoc")
public void batchDownloadDoc(HttpServletResponse response, @RequestParam("id") Long id) throws IOException {
extDocService.batchDownloadDoc(response, id);
}
/**
* 校验图册图纸
*
* @param drawingLinkList
*/
@ApiOperation(value = "校验图册图纸", notes = "校验图册图纸", httpMethod = "POST")
@PostMapping(value = "/checkAtlas")
public ApiResult checkAtlas(@RequestBody List<ExtAtlasDrawingLink> drawingLinkList) {
String message = extDocService.checkAtlas(drawingLinkList);
return ApiResult.ok(message);
}
/**
* 更新文件申请及相关单据
*
* @param documentVO
* @return
*/
@ApiOperation(value = "更新文件申请及相关单据", notes = "更新文件申请及相关单据", httpMethod = "POST")
@PostMapping(value = "/updateDocApplication")
public ApiResult updateDocApplication(@RequestBody DxDocumentVO documentVO) {
DxDocumentVO dxDocumentVO = extDocService.updateDocApplication(documentVO);
return ApiResult.ok(dxDocumentVO);
}
@ApiOperation(value = "获取升版的图册图纸", notes = "获取升版的图册图纸", httpMethod = "POST")
@PostMapping(value = "/upgradeAtlasDrawing")
public ApiResult getUpgradeAtlasDrawingList(@RequestBody DxDocumentVO documentVO) {
List<DxDocumentVO> atlasDrawingList = extDocService.getUpgradeAtlasDrawingList(documentVO);
return ApiResult.ok(atlasDrawingList);
}
}
package com.yonde.dcs.document.core.controller;
import com.yonde.dcs.document.common.vo.ExtIncomeContractVO;
import com.yonde.dcs.document.core.service.ExtIncomeContractService;
import com.yonde.dex.basedata.entity.api.ApiResult;
import com.yonde.dex.baseweb.AbstractBaseController;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/**
* @author xfchai
* @description: 收入合同控制层接口
* @description: ExtIncomeContract
* @version: 1
* @date: 2021-09-03 03:41:00
**/
@RestController
@RequestMapping("/ExtIncomeContract")
public class ExtIncomeContractController extends AbstractBaseController<ExtIncomeContractVO, ExtIncomeContractService<ExtIncomeContractVO>> {
@Autowired
private ExtIncomeContractService extIncomeContractService;
@Override
protected ExtIncomeContractService getService() {
return extIncomeContractService;
}
@ApiOperation(value = "合同收入计算", notes = "合同收入计算", httpMethod = "GET")
@GetMapping("/calculateIncome/{id}")
public ApiResult calculateIncome(@PathVariable Long id) {
//通过收入基本属性id获取多个收入信息
ExtIncomeContractVO extIncomeContract = extIncomeContractService.calculateIncome(id);
return ApiResult.ok(extIncomeContract);
}
@ApiOperation(value = "xxx年到款计算", notes = "xxx年到款计算", httpMethod = "GET")
@GetMapping("/calculateIncome")
public ApiResult calculateIncomeByYear(@RequestParam Long id, String year) {
ExtIncomeContractVO extIncomeContractVO = extIncomeContractService.findRecursionExtIncomeContractVO(id);
//通过收入基本属性id获取多个收入信息
extIncomeContractService.calculateIncomeByYear(id, year,extIncomeContractVO);
return ApiResult.ok(extIncomeContractVO);
}
}
package com.yonde.dcs.document.core.controller;
import com.yonde.dcs.document.common.vo.ExtIncomeDetailVO;
import com.yonde.dcs.document.core.service.ExtIncomeDetailService;
import com.yonde.dex.baseweb.AbstractBaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @description: ExtIncomeDetail控制层接口
* @version: 1
* @date: 2022-02-24 02:58:51
**/
@RestController
@RequestMapping("/ExtIncomeDetail")
public class ExtIncomeDetailController extends AbstractBaseController<ExtIncomeDetailVO, ExtIncomeDetailService<ExtIncomeDetailVO>> {
@Autowired
private ExtIncomeDetailService extIncomeDetailService;
}
......@@ -29,6 +29,12 @@ import org.springframework.stereotype.Controller;
@BasePermission("dcs-doc:ExtInforming")
public class ExtInformingController<V extends ExtInformingVO, S extends ExtInformingService<V>> extends ExtInformingControllerShadow<V, S> {
@ApiOperation("获取接口提资信息")
@GetMapping(value = "/getInforming")
public ApiResult getInforming(@RequestParam("id") Long id) {
List informing = getService().getInforming(id);
return ApiResult.ok(informing, "查询成功");
}
}
......
package com.yonde.dcs.document.core.controller;
import com.yonde.dcs.document.common.vo.ExtPlanVO;
import com.yonde.dcs.document.common.vo.ExtRefContractDocVO;
import com.yonde.dcs.document.core.controller.shadow.ExtPlanControllerShadow;
import com.yonde.dcs.document.core.controller.shadow.ExtRefContractDocControllerShadow;
import com.yonde.dcs.document.core.service.ExtPlanService;
import com.yonde.dcs.document.core.service.ExtRefContractDocService;
import com.yonde.dex.basedata.entity.api.ApiResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* @author xfchai
* @description: 计划实体
* @description: ExtPlan控制层接口
* @version: 2
* @date: 2021-09-03 02:32:41
**/
@RestController
@RequestMapping("/ExtPlan")
public class ExtPlanController<V extends ExtPlanVO, S extends ExtPlanService<V>> extends ExtPlanControllerShadow<V, S> {
@Autowired
private ExtPlanService extPlanService;
@ApiOperation("下载计划模板")
@GetMapping(value = "/downloadTemplate")
public void downloadTemplate(HttpServletResponse response, @RequestParam(value = "name", required = false) String name) throws IOException {
extPlanService.downloadTemplate(response, name);
}
/**
* 新增计划
*
* @param uploadFile
* @return
* @throws IOException
*/
@ApiOperation("新增计划")
@PostMapping(value = "/insertPlan/{projectId}")
public ApiResult insertPlan(@RequestParam("file") MultipartFile uploadFile,
@PathVariable("projectId") Long projectId) throws IOException {
ApiResult apiResult = extPlanService.insertPlan(uploadFile, projectId);
return apiResult;
}
/**
* 修改计划状态
*
* @param state
* @param ids
* @return
*/
@ApiOperation("计划驱动编制任务")
@GetMapping(value = "/changeState")
public ApiResult changeState(@RequestParam String state, @RequestParam List<Long> ids) {
extPlanService.extChangeState(state, ids);
return ApiResult.ok("启动计划成功");
}
/**
* 校验计划答复状态
*
* @param id
* @return
*/
@ApiOperation("校验计划答复状态")
@GetMapping(value = "/checkReplayState")
public ApiResult checkReplayState(@RequestParam Long id) {
return extPlanService.checkReplayState(id);
}
/**
* 导出计划
*
* @param response
* @param ids
* @throws IOException
*/
@ApiOperation(value = "导出计划", notes = "导出计划", httpMethod = "GET")
@GetMapping(value = "/exportPlan")
public void exportPlan(HttpServletResponse response, @RequestParam("ids") List<Long> ids) {
extPlanService.exportPlan(response, ids);
}
}
......@@ -3,6 +3,8 @@ package com.yonde.dcs.document.core.controller;
import org.springframework.stereotype.Controller;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import java.io.IOException;
import java.util.List;
import com.yonde.dcs.document.common.vo.ExtReviewDocLinkVO;
import org.springframework.beans.factory.annotation.Qualifier;
......@@ -13,6 +15,8 @@ import com.yonde.dcs.document.core.service.ExtReviewDocLinkService;
import com.yonde.dex.basedata.entity.api.ApiResult;
import com.yonde.dcs.document.core.controller.shadow.ExtReviewDocLinkControllerShadow;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.yonde.dex.basedata.auth.annos.BasePermission;
import org.springframework.stereotype.Controller;
......@@ -29,7 +33,22 @@ import org.springframework.stereotype.Controller;
@Controller(ExtReviewDocLinkController.BEAN_NAME)
public class ExtReviewDocLinkController<V extends ExtReviewDocLinkVO, S extends ExtReviewDocLinkService<V>> extends ExtReviewDocLinkControllerShadow<V, S> {
@Autowired
private ReviewDocLinkService reviewDocLinkService;
/**
* 导出主审文件清单
* ”评审”类文件给出“导出主审文件清单”、“导出副审文件清单”功能
*
* @param response
* @param id (versionId)
* @throws IOException
*/
@ApiOperation(value = "导出主审副审文件清单", notes = "导出主审副审文件清单", httpMethod = "GET")
@GetMapping(value = "/exportMainReviewFileList")
public void exportMainReviewFileList(HttpServletResponse response, @RequestParam("id") Long id) throws IOException {
reviewDocLinkService.exportMainAndSubReviewFileList(response, id);
}
}
package com.yonde.dcs.document.core.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import com.inet.pdm.entity.vo.AuditlogSecrectVo;
import com.inet.pdm.service.ExtPlanService;
import com.yonde.dcs.document.feign.DocCenterFeignService;
import com.yonde.dcs.xbom.core.service.DxPartService;
import com.yonde.dex.basedata.data.search.SearchItem;
import com.yonde.dex.basedata.data.search.SearchQueryCondition;
import com.yonde.dex.basedata.entity.api.ApiResult;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.context.common.vo.DxContextVO;
import com.yonde.dex.context.core.service.ContextService;
import com.yonde.dex.context.core.util.SearchQueryBuilder;
import com.yonde.dex.dao.service.BaseIdEntityService;
import com.yonde.dex.dao.service.util.ApplicationContextUtil;
import com.yonde.dex.dict.feign.DictService;
import com.yonde.dex.dict.service.vo.DictDataVO;
import com.yonde.dex.lcycle.baseentity.vo.DxObjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.lang.reflect.Field;
import java.util.*;
import java.util.stream.Collectors;
/**
* @program: service
* @description: 密级数据统计查询接口
* @author: dang wei
* @create: 2021-07-13 10:01
*/
@RestController
@RequestMapping("/AuditLogThreshold")
@Api(tags = "密级数据统计查询")
public class ExtSecretController {
@Autowired
DictService dictService;
@ApiOperation("统计查询接口")
@PostMapping({"/getSecretCodeData"})
public ApiResult count(@RequestParam(required = false) Date startTime, @RequestParam(required = false) Date endTime) {
// public ApiResult count(@RequestBody(required = false) List<LocalDateTime> createTime) {
// LocalDateTime startTime = null;
// LocalDateTime endTime = null;
// if (CollectionUtil.isNotEmpty(createTime)) {
// startTime = createTime.get(0);
// endTime = createTime.get(1);
// }
// LinkedHashMap<String, Long> result = new LinkedHashMap<>();
List<AuditlogSecrectVo> result = new ArrayList<>();
String secretKey = "SecretCode";
List<DictDataVO> dictData = dictService.getDictDatas(secretKey);
//升序排序
Collections.sort(dictData, new Comparator<DictDataVO>() {
@Override
public int compare(DictDataVO p1, DictDataVO p2) {
return Integer.compare(p1.getDictSeq(), p2.getDictSeq()); // 按年龄(age)属性进行升序排序
}
});
//key:是英文 value是中文显示名称
// Map<String, String> dictMap = dictData.stream().collect(Collectors.toMap(o -> o.getDictKey(), o -> o.getDictValue()));
//密级数据:项目、收入合同、支出合同、计划、文档、部件
//项目
Map<String, Long> projectList = getData(startTime, endTime, ContextService.class);
//计划
Map<String, Long> planList = getData(startTime, endTime, ExtPlanService.class);
//文档
Map<String, Long> docList = getData(startTime, endTime, DocCenterFeignService.class);
//部件
Map<String, Long> partList = getData(startTime, endTime, DxPartService.class);
//收入合同
// Map<String, Long> incomeList = getData(startTime, endTime, ExtIncomeContractService.class);
//支出合同
// Map<String, Long> spendList = getData(startTime, endTime, ExtSpendingContractService.class);
for (DictDataVO dict : dictData) {
Long proSize = projectList.get(dict.getDictKey());
Long planSize = planList.get(dict.getDictKey());
Long docSize = docList.get(dict.getDictKey());
Long partSize = partList.get(dict.getDictKey());
// Long incomeSize = incomeList.get(dict.getDictKey());
// Long spendSize = spendList.get(dict.getDictKey());
// Long count = proSize + planSize + docSize + partSize + incomeSize + spendSize;
Long count = 0L;
if (!Objects.isNull(proSize)) {
count = count + proSize;
}
if (!Objects.isNull(planSize)) {
count = count + planSize;
}
if (!Objects.isNull(docSize)) {
count = count + docSize;
}
if (!Objects.isNull(partSize)) {
count = count + partSize;
}
// result.put(dict.getDictValue(), count);
AuditlogSecrectVo single = new AuditlogSecrectVo();
single.setName(dict.getDictValue());
single.setNumber(count);
result.add(single);
}
AuditlogSecrectVo single = new AuditlogSecrectVo();
single.setName("合计");
single.setNumber(result.stream().mapToLong(AuditlogSecrectVo::getNumber).sum());
result.add(single);
return ApiResult.ok(result);
}
/**
* 获取数据
*
* @param startTime
* @param endTime
* @param clsServer
* @return
*/
@SneakyThrows
public Map<String, Long> getData(Date startTime, Date endTime, Class clsServer) {
Map<String, Long> resultMap = new LinkedHashMap<>();
BaseIdEntityService baseIdEntityService = (BaseIdEntityService) ApplicationContextUtil.getBean(clsServer);
SearchQueryCondition queryCondition = SearchQueryBuilder.openBuild()
.openFilterBuilder()
.setItem("deleted", SearchItem.Operator.EQ, 0)
.builder().build();
if (ObjectUtil.isAllNotEmpty(startTime, endTime)) {
queryCondition = SearchQueryBuilder.openBuild()
.openFilterBuilder()
.setItem("deleted", SearchItem.Operator.EQ, 0)
.setItem("createTime", SearchItem.Operator.GTE, DateUtil.toLocalDateTime(startTime))
.setItem("createTime", SearchItem.Operator.LTE, DateUtil.toLocalDateTime(endTime))
.builder().build();
}
DxPageImpl recursion = baseIdEntityService.findRecursion(queryCondition);
if (CollectionUtil.isNotEmpty(recursion.getContent())) {
//TODO 如果是 项目 也就是上下文,因为没有继承DxObject 特殊处理 故此处使用反射分组
if (ContextService.class.equals(clsServer)) {
List<Object> data = recursion.getContent();
resultMap = groupByAttr(data);
} else {
List<DxObjectVo> data = recursion.getContent();
resultMap = data.stream().collect(Collectors.groupingBy(DxObjectVo::getSecretCode, Collectors.counting()));
}
}
return resultMap;
}
public Map<String, Long> groupByAttr(List<Object> data) {
Map<String, Long> result = new HashMap<>();
for (Object o : data) {
String key = getAttrValue(o, "secretCode");
if (result.containsKey(key)) {
result.put(key, result.get(key) + 1);
} else {
result.put(key, 1L);
}
}
return result;
}
@SneakyThrows
public String getAttrValue(Object obj, String attr) {
Field declaredField = DxContextVO.class.getDeclaredField(attr);
declaredField.setAccessible(true);
Object value = declaredField.get(obj);
return String.valueOf(value);
}
}
package com.yonde.dcs.document.core.controller;
import com.inet.pdm.entity.vo.SignWfInfoVO;
import com.inet.pdm.service.SignWfInfoService;
import com.yonde.dex.basedata.entity.api.ApiResult;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author xfchai
* @ClassName SignWfInfoController.java
* @Description 客制化签名工作流信息Controller
* @createTime 2022/02/22 09:50:00
*/
@RestController
@RequestMapping("/SignWfInfo")
public class ExtSignWfInfoController {
@Autowired
private SignWfInfoService signWfInfoService;
@ApiOperation(value = "保存流程选人信息组", notes = "保存流程选人信息组", httpMethod = "POST")
@PostMapping("/saveInfo")
public ApiResult saveInfo(@RequestBody SignWfInfoVO signWfInfoVO) {
SignWfInfoVO save = signWfInfoService.save(signWfInfoVO);
return ApiResult.ok(save, "新增成功");
}
}
package com.yonde.dcs.document.core.controller;
import com.inet.pdm.entity.vo.ExtSpendingContractVO;
import com.inet.pdm.service.ExtSpendingContractService;
import com.yonde.dex.basedata.entity.api.ApiResult;
import com.yonde.dex.baseweb.AbstractBaseController;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author: xfchai
* @description: 支出合同控制层接口
* @version: 1
* @date: 2021-09-03 03:43:35
**/
@RestController
@RequestMapping("/ExtSpendingContract")
public class ExtSpendingContractController extends AbstractBaseController<ExtSpendingContractVO, ExtSpendingContractService<ExtSpendingContractVO>> {
@Autowired
private ExtSpendingContractService extSpendingContractService;
@Override
protected ExtSpendingContractService getService() {
return extSpendingContractService;
}
@ApiOperation(value = "支出合同金额计算", notes = "支出合同金额计算", httpMethod = "GET")
@GetMapping("/calculateSpending/{id}")
public ApiResult calculateSpending(@PathVariable Long id) {
//通过收入基本属性id获取付款明细
ExtSpendingContractVO extSpendingContractVO = extSpendingContractService.calculateSpending(id);
return ApiResult.ok(extSpendingContractVO);
}
}
package com.yonde.dcs.document.core.controller.shadow;
import com.yonde.dcs.document.common.vo.ExtDenDescriptLinkVO;
import com.yonde.dcs.document.common.vo.ExtDistributeRecordVO;
import com.yonde.dcs.document.core.service.ExtDenDescriptLinkService;
import com.yonde.dcs.document.core.service.ExtDistributeRecordService;
import com.yonde.dcs.document.core.service.impl.ExtDenDescriptLinkServiceImpl;
import com.yonde.dcs.document.core.service.impl.ExtDistributeRecordServiceImpl;
import com.yonde.dex.baseweb.AbstractBaseController;
import com.yonde.dex.linkdata.plugin.core.controller.DxLinkDataController;
import javax.annotation.Resource;
public class ExtDistributeRecordControllerShadow<V extends ExtDistributeRecordVO, S extends ExtDistributeRecordService<V>> implements AbstractBaseController<V, S>, DxLinkDataController<V, S> {
public static final String BEAN_NAME = "extDistributeRecordController";
/**
* 注入
*/
@Resource(name = ExtDistributeRecordServiceImpl.BEAN_NAME)
private ExtDistributeRecordService<V> extDenDescriptLinkService;
/**
* getService
*/
@Override
public S getService() {
return (S) this.extDenDescriptLinkService;
}
}
package com.yonde.dcs.document.core.controller.shadow;
import com.yonde.dcs.document.common.vo.ExtDistributeRecordVO;
import com.yonde.dcs.document.common.vo.ExtPlanVO;
import com.yonde.dcs.document.core.service.ExtDistributeRecordService;
import com.yonde.dcs.document.core.service.ExtPlanService;
import com.yonde.dcs.document.core.service.impl.ExtDistributeRecordServiceImpl;
import com.yonde.dex.baseweb.AbstractBaseController;
import com.yonde.dex.linkdata.plugin.core.controller.DxLinkDataController;
import javax.annotation.Resource;
public class ExtPlanControllerShadow<V extends ExtPlanVO, S extends ExtPlanService<V>> implements AbstractBaseController<V, S>, DxLinkDataController<V, S> {
public static final String BEAN_NAME = "extPlanController";
/**
* 注入
*/
@Resource(name = ExtDistributeRecordServiceImpl.BEAN_NAME)
private ExtPlanService<V> extPlanService;
/**
* getService
*/
@Override
public S getService() {
return (S) this.extPlanService;
}
}
}
package com.yonde.dcs.document.core.event;
import com.yonde.dex.dao.events.BusinessEventType;
import com.yonde.dex.dao.events.DxEvent;
import com.yonde.dex.dao.events.DxEventListener;
import com.yonde.dex.dao.events.DxEventWrap;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* @author xfchai
* @ClassName ContractEvent.java
* @Description TODO
* @createTime 2022/03/03 19:01:00
*/
@Component
@Slf4j
@DxEvent
public class ContractEvent {
@Autowired
private ExtIncomeContractService extIncomeContractService;
@Autowired
private ExtSpendingContractService extSpendingContractService;
@DxEventListener(value = ExtIncomeDetailVO.class, eventType = BusinessEventType.POST_CREATE, order = 1)
public void incomeDetailPostCreateListener(List<DxEventWrap<ExtIncomeDetailVO>> events) {
events.forEach(e -> {
ExtIncomeDetailVO extIncomeDetailVO = e.getTarget();
this.refreshInContractAmount(extIncomeDetailVO.getExtIncomeContractId());
});
//刷新收入合同相关金额
}
@DxEventListener(value = ExtIncomeDetailVO.class, eventType = BusinessEventType.POST_UPDATE, order = 1)
public void incomeDetailPostUpdateListener(List<DxEventWrap<ExtIncomeDetailVO>> events) {
events.forEach(e -> {
ExtIncomeDetailVO extIncomeDetailVO = e.getTarget();
this.refreshInContractAmount(extIncomeDetailVO.getExtIncomeContractId());
});
}
@DxEventListener(value = ExtIncomeDetailVO.class, eventType = BusinessEventType.POST_DELETE, order = 1)
public void incomeDetailPostDeleteListener(List<DxEventWrap<ExtIncomeDetailVO>> events) {
events.forEach(e -> {
ExtIncomeDetailVO extIncomeDetailVO = e.getTarget();
this.refreshInContractAmount(extIncomeDetailVO.getExtIncomeContractId());
});
}
@DxEventListener(value = ExtSpendingDetailVO.class, eventType = BusinessEventType.POST_CREATE, order = 1)
public void spendingDetailPostCreateListener(List<DxEventWrap<ExtSpendingDetailVO>> events) {
events.forEach(e -> {
ExtSpendingDetailVO extSpendingDetailVO = e.getTarget();
this.refreshSpeContractAmount(extSpendingDetailVO.getExtSpendingContractId());
});
//刷新收入合同相关金额
}
@DxEventListener(value = ExtSpendingDetailVO.class, eventType = BusinessEventType.POST_UPDATE, order = 1)
public void spendingDetailPostUpdateListener(List<DxEventWrap<ExtSpendingDetailVO>> events) {
events.forEach(e -> {
ExtSpendingDetailVO extSpendingDetailVO = e.getTarget();
this.refreshSpeContractAmount(extSpendingDetailVO.getExtSpendingContractId());
});
}
@DxEventListener(value = ExtSpendingDetailVO.class, eventType = BusinessEventType.POST_DELETE, order = 1)
public void spendingDetailPostDeleteListener(List<DxEventWrap<ExtSpendingDetailVO>> events) {
events.forEach(e -> {
ExtSpendingDetailVO extSpendingDetailVO = e.getTarget();
this.refreshSpeContractAmount(extSpendingDetailVO.getExtSpendingContractId());
});
}
/**
* 刷新收入合同金额
*
* @param contractId
*/
private void refreshInContractAmount(Long contractId) {
//已到款
//待拨付
extIncomeContractService.calculateIncome(contractId);
//XXX年到款
extIncomeContractService.reCalculIncomeById(contractId);
}
/**
* 刷新支出合同金额
*
* @param contractId
*/
private void refreshSpeContractAmount(Long contractId) {
//已付金额
//未付金额
//付款比例
extSpendingContractService.calculateSpending(contractId);
}
}
package com.yonde.dcs.document.core.event;
import com.inet.pdm.entity.vo.ExtIncomeDetailVO;
import com.inet.pdm.entity.vo.ExtSpendingDetailVO;
import com.inet.pdm.service.ExtDocService;
import com.inet.pdm.service.ExtIncomeContractService;
import com.inet.pdm.service.ExtSpendingContractService;
import com.inet.pdm.util.ExtDocUtil;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.document.convert.service.DocConvertService;
import com.yonde.dcs.document.core.service.DocumentService;
import com.yonde.dex.dao.service.BaseService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import org.springframework.transaction.event.TransactionPhase;
import org.springframework.transaction.event.TransactionalEventListener;
/**
* @program: inet-pdm-service
* @description: 文档事务事件
* @author: dang wei
* @create: 2021-11-23 14:23
*/
@Component
@Slf4j
public class DocTransactionEvent {
@Autowired
private ExtDocService extDocService;
@Autowired
@Qualifier("documentServiceImpl")
DocumentService documentService;
@Autowired
DocConvertService docConvertService;
@Autowired
private ExtIncomeContractService extIncomeContractService;
@Autowired
private ExtSpendingContractService extSpendingContractService;
@Autowired
private ExtDocUtil extDocUtil;
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
public void afterCommit(BaseService.DataChangeEvent event) {
final String eventType = event.getEventType();
final BaseService.ChangeType changeType = BaseService.ChangeType.valueOf(eventType);
if (changeType == BaseService.ChangeType.POST_CREATE || changeType == BaseService.ChangeType.POST_UPDATE || changeType == BaseService.ChangeType.POST_DELETE) {
event.getEventTargets().forEach(t -> {
DxDocumentVO doc = new DxDocumentVO();
if (t instanceof ExtIncomeDetailVO) {
//刷新收入合同相关金额
ExtIncomeDetailVO extIncomeDetailVO = (ExtIncomeDetailVO) t;
this.refreshInContractAmount(extIncomeDetailVO.getExtIncomeContractId());
} else if (t instanceof ExtSpendingDetailVO) {
//刷新支出合同相关金额
ExtSpendingDetailVO spendingDetailVO = (ExtSpendingDetailVO) t;
this.refreshSpeContractAmount(spendingDetailVO.getExtSpendingContractId());
}
});
}
}
/**
* 刷新收入合同金额
*
* @param contractId
*/
private void refreshInContractAmount(Long contractId) {
//已到款
//待拨付
extIncomeContractService.calculateIncome(contractId);
//XXX年到款
extIncomeContractService.reCalculIncomeById(contractId);
}
/**
* 刷新支出合同金额
*
* @param contractId
*/
private void refreshSpeContractAmount(Long contractId) {
//已付金额
//未付金额
//付款比例
extSpendingContractService.calculateSpending(contractId);
}
}
package com.yonde.dcs.document.core.event;
import cn.hutool.core.io.FileUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.fastjson.JSONObject;
import com.yonde.dcs.document.common.vo.DxDocumentVO;
import com.yonde.dcs.document.common.vo.ExtInterfaceInfoLinkVO;
import com.yonde.dcs.document.core.constants.Constants;
import com.yonde.dcs.document.core.factory.*;
import com.yonde.dcs.document.core.service.ExtDocService;
import com.yonde.dcs.document.core.util.ExtDocUtil;
import com.yonde.dcs.document.core.util.FileUtils;
import com.yonde.dcs.document.core.util.WorkFlowUtil;
import com.yonde.dcs.document.core.word.ImportWordService;
import com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.io.File;
import java.io.FileInputStream;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @author xfchai
* @ClassName ProcessDataUtils.java
* @Description 数据处理工具类
* @createTime 2022/02/23 16:11:00
*/
@Component
@Slf4j
public class ProcessDataUtils {
//word模板路径
public static final String PATH = Constants.MTEMPLATE_ABSOLUTE_PATH;
@Autowired
private ExtDocService extDocService;
@Autowired
private ImportWordService importWordService;
@Autowired
private ExtDocUtil extDocUtil;
@Autowired
private WorkFlowUtil workFlowUtil;
@Autowired
private DexWorkFlowService dexWorkFlowService;
/**
* 单独处理过时文件通知单数据
*/
public void processOutdatedDocNotify(DxDocumentVO documentVo) {
extDocService.getDocWord(documentVo, OutdatedDocNotifyUtils.class, new WfProcessInfoVO(), "");
}
/**
* 处理单据word数据
*
* @param documentVo
*/
public void processData(DxDocumentVO documentVo) {
String subTypeName = documentVo.getSubTypeName();
WfProcessInstVO wfProcessInstVO = workFlowUtil.getWfProcessInst(documentVo);
DxWfProcessInfoVO wfProcessInfoVO = dexWorkFlowService.getProcessInstDetailById(wfProcessInstVO.getId());
switch (subTypeName) {
case Constants.INTERNAL_INTERFACE:
this.generateInterFaceWord(documentVo, new ExtInterfaceInfoLinkVO(), wfProcessInfoVO);
break;
case Constants.CONTACTLIST:
extDocService.getDocWord(documentVo, ContactListUtils.class, wfProcessInfoVO, "一");
break;
case Constants.WORK_CONTACTLIST:
extDocService.getDocWord(documentVo, WorkContactListUtils.class, wfProcessInfoVO, "");
break;
case Constants.DESIGN_CHANGE:
extDocService.getDocWord(documentVo, DesignChangeUtils.class, wfProcessInfoVO, "");
break;
case Constants.DESIGN_APPLICATION:
extDocService.getDocWord(documentVo, DesignDocApplicatUtils.class, wfProcessInfoVO, "");
break;
case Constants.DESIGN_ENTER:
extDocService.getDocWord(documentVo, DesignEnterUtils.class, wfProcessInfoVO, "");
break;
case Constants.NCR:
extDocService.getDocWord(documentVo, NCRUtils.class, wfProcessInfoVO, "");
break;
case Constants.DEN:
//根据模板生成两张不同澄清单
extDocService.getDocWord(documentVo, DENUtils.class, wfProcessInfoVO, "");
break;
}
}
/**
* 新建内部接口文档-生成内部接口的word
*
* @param documentVo
* @param infoLinkVO 提资人信息
*/
public void generateInterFaceWord(DxDocumentVO documentVo, ExtInterfaceInfoLinkVO infoLinkVO, DxWfProcessInfoVO wfProcessInfoVO) {
try {
String file = documentVo.getSubTypeName();
String outWordFilePath = Constants.MERGER_FILE_ABSOLUTE_PATH + documentVo.getSubTypeName() + "\\" + documentVo.getNumber() + "\\";
//生成特定的文档目录,保存生成的word文件
FileUtil.mkdir(outWordFilePath);
Class<?> clazz = Class.forName("com.inet.pdm.factory.InternalInterfaceUtils");
Method settingDataMethod = clazz.getMethod("settingData", DxDocumentVO.class, ExtInterfaceInfoLinkVO.class, DxWfProcessInfoVO.class);
JSONObject jsonObject = (JSONObject) settingDataMethod.invoke(SpringUtil.getBean(InternalInterfaceUtils.class), documentVo, infoLinkVO, wfProcessInfoVO);
//生成word文件方法
importWordService.getWordAllTable(jsonObject, PATH + file + ".docx", outWordFilePath + "outFile.docx");
log.info("生成word文件内容结束====");
//获取文件夹的所有文件--绝对路径
List<String> fileList = new ArrayList<>();
File[] files = FileUtil.ls(outWordFilePath);
Arrays.stream(files).forEach(item -> {
fileList.add(item.getAbsolutePath());
});
if (CollectionUtils.isEmpty(fileList)) {
log.error("生成的word文件目录内容为空====");
} else {
// String filePath = fileList.stream().filter(item -> item.endsWith(".docx")).findFirst().get();
String pdfFilePath = fileList.stream().filter(item -> item.endsWith(".pdf")).findFirst().get();
//将pdf上传到附件中
extDocService.extractedAttachFile(documentVo, new FileInputStream(pdfFilePath), "", Constants.ATTACH_FILE);
log.info("获取生成的word文件内容结束====");
}
//删除生成后的临时文件
FileUtils.deleteDirectory(Constants.MERGER_FILE_ABSOLUTE_PATH + documentVo.getSubTypeName() + "\\" + documentVo.getNumber());
} catch (Exception e) {
log.error("新建内部接口文档-生成内部接口的word错误:{}" + e.getMessage());
}
}
}
package com.yonde.dcs.document.core.event;
import com.ctrip.framework.apollo.core.utils.StringUtils;
import com.inet.pdm.entity.vo.ExtIncomeContractVO;
import com.inet.pdm.entity.vo.ExtPlanVO;
import com.inet.pdm.entity.vo.ExtSpendingContractVO;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.context.common.vo.DxContextVO;
import com.yonde.dex.context.feign.ContextServiceFeign;
import com.yonde.dex.dao.service.BaseService;
import com.yonde.dex.dao.service.listener.AbstractEventListener;
import com.yonde.dex.dict.service.service.IDictDataService;
import com.yonde.dex.dict.service.vo.DictDataVO;
import com.yonde.dex.lcycle.baseentity.vo.DxObjectVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Service
@Slf4j
public class ValidateSecretListener extends AbstractEventListener<BaseService.DataChangeEvent> {
@Autowired
private IDictDataService dictDataService;
@Autowired
private ContextServiceFeign contextServiceFeign;
@Override
public void onAsynEvent(BaseService.DataChangeEvent event) {
}
@Override
public void onEvent(BaseService.DataChangeEvent event) {
// 页面资源变更的时候
switch (event.operationType) {
case POST_CREATE:
extValidateSecret(event.eventTargets);
break;
case POST_UPDATE:
extValidateSecret(event.eventTargets);
break;
case POST_DELETE:
break;
default:
break;
}
}
@Transactional(rollbackFor = {Exception.class, Error.class})
void extValidateSecret(Iterable<?> objects) {
for (Object data : objects) {
log.info(">>>>>extValidateSecret data:" + data);
log.info(">>>>>extValidateSecret data.getClass:" + data.getClass());
//校验项目中心相关对象密级和计划密级
if (data instanceof DxObjectVo) {
String checkResultStr = checkDxObjectSecret((DxObjectVo) data);
if (!StringUtils.isEmpty(checkResultStr)) {
throw new DxBusinessException("500", checkResultStr);
}
}
}
}
/**
* 校验计划、收入合同、支出合同密级与项目的关系
*
* @param dxObjectVo
* @return
*/
private String checkDxObjectSecret(DxObjectVo dxObjectVo) {
String checkResultStr = "";
Boolean checkResult = true;
if (dxObjectVo instanceof ExtPlanVO) {
checkResult = checkDxObjectVoSecret(dxObjectVo);
checkResultStr = "计划密级不能高于项目密级!";
}
if (dxObjectVo instanceof ExtIncomeContractVO) {
checkResult = checkDxObjectVoSecret(dxObjectVo);
checkResultStr = "收入合同密级不能高于项目密级!";
}
if (dxObjectVo instanceof ExtSpendingContractVO) {
checkResult = checkDxObjectVoSecret(dxObjectVo);
checkResultStr = "支出合同密级不能高于项目密级!";
}
if (checkResult) {
checkResultStr = "";
}
return checkResultStr;
}
/**
* 校验计划、收入合同、支出合同密级与项目的关系
*
* @return
*/
private Boolean checkDxObjectVoSecret(DxObjectVo dxObjectVo) {
if (StringUtils.isBlank(dxObjectVo.getSecretCode())) {
return true;
}
DxContextVO dxContextVO = contextServiceFeign.get(dxObjectVo.getDxContextId());
return checkTargetSecret(dxContextVO.getSecretCode(), dxObjectVo.getSecretCode());
}
/**
* 校验密级信息
*
* @param sourceSecret
* @param targetSecret
* @return
*/
private Boolean checkTargetSecret(String sourceSecret, String targetSecret) {
DictDataVO docSecretCodeDict;
if (StringUtils.isEmpty(sourceSecret)) {
//密级为空则获取默认密级
docSecretCodeDict = dictDataService.getMarkDictData("SecretCode");
} else {
docSecretCodeDict = dictDataService.getDictCode("SecretCode", sourceSecret);
}
List<DictDataVO> secretCodeDictList = dictDataService.getDictDatas("SecretCode");
if (CollectionUtils.isNotEmpty(secretCodeDictList)) {
Set<String> enableSecretCodeSet = secretCodeDictList.stream()
.filter(x -> x.getDictSeq() <= docSecretCodeDict.getDictSeq())
.map(DictDataVO::getDictKey)
.collect(Collectors.toSet());
if (enableSecretCodeSet != null && enableSecretCodeSet.contains(targetSecret)) {
return true;
}
}
return false;
}
}
package com.yonde.dcs.document.core.factory;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.inet.pdm.constants.Constants;
import com.inet.pdm.constants.SignConstants;
import com.inet.pdm.service.ExtDocService;
import com.inet.pdm.word.ImportWordService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dex.valut.vo.ObjFileLinkVO;
import com.yonde.dex.wfc.common.vo.WfProcessInfoVO;
import com.yonde.dex.wfc.common.vo.WfTaskDefinitionVO;
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, WfProcessInfoVO 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.getProjectCode()) ? "" : v.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.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<WfTaskDefinitionVO> 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.document.core.factory;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.inet.pdm.constants.Constants;
import com.inet.pdm.constants.SignConstants;
import com.inet.pdm.service.ExtDocService;
import com.inet.pdm.word.ImportWordService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dex.wfc.common.vo.WfProcessInfoVO;
import com.yonde.dex.wfc.common.vo.WfTaskDefinitionVO;
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, WfProcessInfoVO 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.getProjectCode()) ? "" : v.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.getAttachPages());
//获取参与者
List<WfTaskDefinitionVO> 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.document.core.factory;
import cn.hutool.core.io.FileUtil;
import com.alibaba.fastjson.JSONObject;
import com.inet.pdm.constants.Constants;
import com.inet.pdm.constants.SignConstants;
import com.inet.pdm.service.ExtDocService;
import com.inet.pdm.util.DateUtils;
import com.inet.pdm.util.WorkFlowUtil;
import com.inet.pdm.word.ImportWordService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dex.wfc.common.vo.WfProcessInfoVO;
import com.yonde.dex.wfc.common.vo.WfTaskDefinitionVO;
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 OutdatedDocNotifyUtils.java
* @Description 过时文件通知
* @createTime 2021/11/23 09:54:00
*/
@Component
public class OutdatedDocNotifyUtils {
@Autowired
private ExtDocService extDocService;
@Autowired
private ImportWordService importWordService;
@Autowired
private WorkFlowUtil workFlowUtil;
/**
* 填充数据
*
* @param
* @return
*/
public JSONObject settingData(DxDocumentVO v, WfProcessInfoVO 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 distributNumber = Objects.isNull(dynamicAttrs.get("distributNumber")) ? "" : (String) dynamicAttrs.get("distributNumber");
String obsoletedDocNo = Objects.isNull(dynamicAttrs.get("obsoletedDocNo")) ? "" : (String) dynamicAttrs.get("obsoletedDocNo");
String obsoleteDocVer = Objects.isNull(dynamicAttrs.get("obsoleteDocVer")) ? "" : (String) dynamicAttrs.get("obsoleteDocVer");
String obsoleteDocName = Objects.isNull(dynamicAttrs.get("obsoleteDocName")) ? "" : (String) dynamicAttrs.get("obsoleteDocName");
String copies = Objects.isNull(dynamicAttrs.get("copies")) ? "" : (String) dynamicAttrs.get("copies");
Integer pages = Objects.isNull(dynamicAttrs.get("pages")) ? 0 : (Integer) dynamicAttrs.get("pages");
String distributDate = Objects.isNull(dynamicAttrs.get("distributDate")) ? "" : (String) dynamicAttrs.get("distributDate");
JSONObject jsonObject = new JSONObject();
//文件分发号
jsonObject.put("disNumber", distributNumber);
//文件编号
jsonObject.put("obsoDocNo", obsoletedDocNo);
//过时文件通知单编号
jsonObject.put("number", ObjectUtils.isEmpty(v.getNumber()) ? "" : v.getNumber());
//版本
jsonObject.put("version", obsoleteDocVer);
//文件名称
jsonObject.put("docName", obsoleteDocName);
//分发日期
jsonObject.put("disDate", DateUtils.conversionDate(distributDate));
//份数
jsonObject.put("copies", copies);
//页数
jsonObject.put("page", pages);
//获取参与者
List<WfTaskDefinitionVO> activities = wfProcessInfoVO.getActivityInfo();
if (!CollectionUtils.isEmpty(activities)) {
//写入签名数据(总体室)
jsonObject.put("bmfzr_photo", workFlowUtil.getSignImage(activities, SignConstants.ZTSSignTaskList));
jsonObject.put("bmfzr_date", workFlowUtil.getEndDate(activities, SignConstants.ZTSSignTaskList));
}
//模板名称
importWordService.getWordAllTable(jsonObject, path + file + ".docx", outFilePath + "outFile.docx");
return jsonObject;
}
}
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