Commit 5caa6483 authored by xuzhang's avatar xuzhang

[feat][DOC]迁移类缺失问题修改

parent 1cb95188
package com.yonde.dcs.core.events;
import com.yonde.dcs.common.vo.ExtIncomeDetailVO;
import com.yonde.dcs.core.service.ExtDocService;
import com.yonde.dcs.core.util.ExtDocUtil;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.document.core.service.DocumentService;
import com.yonde.dcs.plan.common.vo.ExtSpendingDetailVO;
import com.yonde.dcs.plan.feign.ExtIncomeContractServiceFeign;
import com.yonde.dcs.plan.feign.ExtSpendingContractServiceFeign;
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
private ExtIncomeContractServiceFeign extIncomeContractService;
@Autowired
private ExtSpendingContractServiceFeign 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.core.events;
//
//
//import com.yonde.dcs.common.vo.ExtIncomeDetailVO;
//import com.yonde.dcs.core.service.ExtDocService;
//import com.yonde.dcs.core.util.ExtDocUtil;
//import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
//import com.yonde.dcs.document.core.service.DocumentService;
//import com.yonde.dcs.plan.common.vo.ExtSpendingDetailVO;
//import com.yonde.dcs.plan.feign.ExtIncomeContractServiceFeign;
//import com.yonde.dcs.plan.feign.ExtSpendingContractServiceFeign;
//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
// private ExtIncomeContractServiceFeign extIncomeContractService;
// @Autowired
// private ExtSpendingContractServiceFeign 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);
// }
//}
......@@ -7,13 +7,13 @@ import cn.hutool.core.io.FileUtil;
import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.fastjson.JSONObject;
import com.yonde.dcs.common.vo.*;
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.TechnicalFileUtils;
import com.yonde.dcs.core.service.*;
import com.yonde.dcs.core.util.*;
import com.yonde.dcs.core.util.ExtDocUtil;
import com.yonde.dcs.core.util.ExtWfcUtil;
import com.yonde.dcs.core.util.SearchUtil;
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.document.core.service.DocumentService;
......@@ -27,10 +27,8 @@ 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.SearchQueryCondition;
import com.yonde.dex.basedata.entity.api.CustomMultipartFile;
import com.yonde.dex.basedata.entity.data.DxPageImpl;
import com.yonde.dex.basedata.entity.data.OperatorType;
import com.yonde.dex.basedata.entity.jackson.JsonUtils;
import com.yonde.dex.basedata.exception.DxBusinessException;
import com.yonde.dex.basedata.utils.obj.DxEntityUtils;
import com.yonde.dex.dao.service.util.DxPageUtils;
......@@ -43,19 +41,16 @@ 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.utils.common.utils.DxFileUtils;
import com.yonde.dex.wfc.common.vo.*;
import com.yonde.dex.wfc.common.vo.DxWfParticipantInfoVO;
import com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO;
import com.yonde.dex.wfc.common.vo.DxWfTaskContext;
import com.yonde.dex.wfc.feign.api.WfcProcessFeign;
import com.yonde.dex.wfc.feign.api.WfcTaskFeign;
import feign.form.ContentType;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.utils.CloneUtils;
import org.joda.time.LocalDate;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
......@@ -66,7 +61,9 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.*;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStream;
import java.lang.reflect.Method;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
......@@ -115,8 +112,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
private SwitchUserService switchUserService;
@Autowired
private ExtInterfaceInfoLinkService interfaceInfoLinkService;
@Autowired
private DocBeforeCreateEvent docBeforeCreateEvent;
// @Autowired
// private DocBeforeCreateEvent docBeforeCreateEvent;
@Autowired
private FileManagerFeignService fileManagerFeignService;
@Autowired
......@@ -135,8 +132,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
private TechnicalFileUtils technicalFileUtils;
@Autowired
private WorkFlowUtil workFlowUtil;
@Autowired
private ProcessDataUtils processDataUtils;
// @Autowired
// private ProcessDataUtils processDataUtils;
@Autowired
ExtApplicantService extApplicantService;
@Autowired
......@@ -1026,8 +1023,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
*/
@Override
public void generateWordByAutoMethod(DxDocumentVO documentVo) {
DxDocumentVO dxDocumentVO = docBeforeCreateEvent.processCreateData(documentVo);
documentService.saveRecursion(dxDocumentVO);
// DxDocumentVO dxDocumentVO = docBeforeCreateEvent.processCreateData(documentVo);
// documentService.saveRecursion(dxDocumentVO);
}
/**
......
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