Commit 5caa6483 authored by xuzhang's avatar xuzhang

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

parent 1cb95188
package com.yonde.dcs.core.events; //package com.yonde.dcs.core.events;
//
//
import com.yonde.dcs.common.vo.ExtIncomeDetailVO; //import com.yonde.dcs.common.vo.ExtIncomeDetailVO;
import com.yonde.dcs.core.service.ExtDocService; //import com.yonde.dcs.core.service.ExtDocService;
import com.yonde.dcs.core.util.ExtDocUtil; //import com.yonde.dcs.core.util.ExtDocUtil;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO; //import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.document.core.service.DocumentService; //import com.yonde.dcs.document.core.service.DocumentService;
import com.yonde.dcs.plan.common.vo.ExtSpendingDetailVO; //import com.yonde.dcs.plan.common.vo.ExtSpendingDetailVO;
import com.yonde.dcs.plan.feign.ExtIncomeContractServiceFeign; //import com.yonde.dcs.plan.feign.ExtIncomeContractServiceFeign;
import com.yonde.dcs.plan.feign.ExtSpendingContractServiceFeign; //import com.yonde.dcs.plan.feign.ExtSpendingContractServiceFeign;
import com.yonde.dex.dao.service.BaseService; //import com.yonde.dex.dao.service.BaseService;
import lombok.extern.slf4j.Slf4j; //import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; //import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component; //import org.springframework.stereotype.Component;
import org.springframework.transaction.event.TransactionPhase; //import org.springframework.transaction.event.TransactionPhase;
import org.springframework.transaction.event.TransactionalEventListener; //import org.springframework.transaction.event.TransactionalEventListener;
//
/** ///**
* @program: inet-pdm-service // * @program: inet-pdm-service
* @description: 文档事务事件 // * @description: 文档事务事件
* @author: dang wei // * @author: dang wei
* @create: 2021-11-23 14:23 // * @create: 2021-11-23 14:23
*/ // */
@Component //@Component
@Slf4j //@Slf4j
public class DocTransactionEvent { //public class DocTransactionEvent {
//
@Autowired // @Autowired
private ExtDocService extDocService; // private ExtDocService extDocService;
//
@Autowired // @Autowired
@Qualifier("documentServiceImpl") // @Qualifier("documentServiceImpl")
DocumentService documentService; // DocumentService documentService;
@Autowired // @Autowired
private ExtIncomeContractServiceFeign extIncomeContractService; // private ExtIncomeContractServiceFeign extIncomeContractService;
@Autowired // @Autowired
private ExtSpendingContractServiceFeign extSpendingContractService; // private ExtSpendingContractServiceFeign extSpendingContractService;
@Autowired // @Autowired
private ExtDocUtil extDocUtil; // private ExtDocUtil extDocUtil;
//
@TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT) // @TransactionalEventListener(phase = TransactionPhase.AFTER_COMMIT)
public void afterCommit(BaseService.DataChangeEvent event) { // public void afterCommit(BaseService.DataChangeEvent event) {
final String eventType = event.getEventType(); // final String eventType = event.getEventType();
final BaseService.ChangeType changeType = BaseService.ChangeType.valueOf(eventType); // final BaseService.ChangeType changeType = BaseService.ChangeType.valueOf(eventType);
if (changeType == BaseService.ChangeType.POST_CREATE || changeType == BaseService.ChangeType.POST_UPDATE || changeType == BaseService.ChangeType.POST_DELETE) { // if (changeType == BaseService.ChangeType.POST_CREATE || changeType == BaseService.ChangeType.POST_UPDATE || changeType == BaseService.ChangeType.POST_DELETE) {
event.getEventTargets().forEach(t -> { // event.getEventTargets().forEach(t -> {
DxDocumentVO doc = new DxDocumentVO(); // DxDocumentVO doc = new DxDocumentVO();
if (t instanceof ExtIncomeDetailVO) { // if (t instanceof ExtIncomeDetailVO) {
//刷新收入合同相关金额 // //刷新收入合同相关金额
ExtIncomeDetailVO extIncomeDetailVO = (ExtIncomeDetailVO) t; // ExtIncomeDetailVO extIncomeDetailVO = (ExtIncomeDetailVO) t;
this.refreshInContractAmount(extIncomeDetailVO.getExtIncomeContractId()); // this.refreshInContractAmount(extIncomeDetailVO.getExtIncomeContractId());
} else if (t instanceof ExtSpendingDetailVO) { // } else if (t instanceof ExtSpendingDetailVO) {
//刷新支出合同相关金额 // //刷新支出合同相关金额
ExtSpendingDetailVO spendingDetailVO = (ExtSpendingDetailVO) t; // ExtSpendingDetailVO spendingDetailVO = (ExtSpendingDetailVO) t;
this.refreshSpeContractAmount(spendingDetailVO.getExtSpendingContractId()); // this.refreshSpeContractAmount(spendingDetailVO.getExtSpendingContractId());
} // }
}); // });
} // }
} // }
//
//
/** // /**
* 刷新收入合同金额 // * 刷新收入合同金额
* // *
* @param contractId // * @param contractId
*/ // */
private void refreshInContractAmount(Long contractId) { // private void refreshInContractAmount(Long contractId) {
//已到款 // //已到款
//待拨付 // //待拨付
extIncomeContractService.calculateIncome(contractId); // extIncomeContractService.calculateIncome(contractId);
//XXX年到款 // //XXX年到款
extIncomeContractService.reCalculIncomeById(contractId); // extIncomeContractService.reCalculIncomeById(contractId);
} // }
//
/** // /**
* 刷新支出合同金额 // * 刷新支出合同金额
* // *
* @param contractId // * @param contractId
*/ // */
private void refreshSpeContractAmount(Long contractId) { // private void refreshSpeContractAmount(Long contractId) {
//已付金额 // //已付金额
//未付金额 // //未付金额
//付款比例 // //付款比例
extSpendingContractService.calculateSpending(contractId); // extSpendingContractService.calculateSpending(contractId);
} // }
} //}
...@@ -7,13 +7,13 @@ import cn.hutool.core.io.FileUtil; ...@@ -7,13 +7,13 @@ import cn.hutool.core.io.FileUtil;
import cn.hutool.extra.spring.SpringUtil; import cn.hutool.extra.spring.SpringUtil;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yonde.dcs.common.vo.*; 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.NCRSCUtils;
import com.yonde.dcs.core.factory.TechnicalFileUtils; import com.yonde.dcs.core.factory.TechnicalFileUtils;
import com.yonde.dcs.core.service.*; 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.core.word.ImportWordService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO; import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.document.core.service.DocumentService; import com.yonde.dcs.document.core.service.DocumentService;
...@@ -27,10 +27,8 @@ import com.yonde.dcs.plan.feign.ExtPlanServiceFeign; ...@@ -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.SearchItem;
import com.yonde.dex.basedata.data.search.SearchItems; import com.yonde.dex.basedata.data.search.SearchItems;
import com.yonde.dex.basedata.data.search.SearchQueryCondition; 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.DxPageImpl;
import com.yonde.dex.basedata.entity.data.OperatorType; 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.exception.DxBusinessException;
import com.yonde.dex.basedata.utils.obj.DxEntityUtils; import com.yonde.dex.basedata.utils.obj.DxEntityUtils;
import com.yonde.dex.dao.service.util.DxPageUtils; import com.yonde.dex.dao.service.util.DxPageUtils;
...@@ -43,19 +41,16 @@ import com.yonde.dex.user.common.vo.DxUserInfoVO; ...@@ -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.DxOrganizationFeign;
import com.yonde.dex.user.feign.DxUserInfoFeign; import com.yonde.dex.user.feign.DxUserInfoFeign;
import com.yonde.dex.user.feign.SwitchUserService; import com.yonde.dex.user.feign.SwitchUserService;
import com.yonde.dex.utils.common.utils.DxFileUtils; import com.yonde.dex.wfc.common.vo.DxWfParticipantInfoVO;
import com.yonde.dex.wfc.common.vo.*; 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.WfcProcessFeign;
import com.yonde.dex.wfc.feign.api.WfcTaskFeign; import com.yonde.dex.wfc.feign.api.WfcTaskFeign;
import feign.form.ContentType;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; 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.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
...@@ -66,7 +61,9 @@ import org.springframework.transaction.annotation.Transactional; ...@@ -66,7 +61,9 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource; 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.lang.reflect.Method;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDateTime; import java.time.LocalDateTime;
...@@ -115,8 +112,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -115,8 +112,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
private SwitchUserService switchUserService; private SwitchUserService switchUserService;
@Autowired @Autowired
private ExtInterfaceInfoLinkService interfaceInfoLinkService; private ExtInterfaceInfoLinkService interfaceInfoLinkService;
@Autowired // @Autowired
private DocBeforeCreateEvent docBeforeCreateEvent; // private DocBeforeCreateEvent docBeforeCreateEvent;
@Autowired @Autowired
private FileManagerFeignService fileManagerFeignService; private FileManagerFeignService fileManagerFeignService;
@Autowired @Autowired
...@@ -135,8 +132,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -135,8 +132,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
private TechnicalFileUtils technicalFileUtils; private TechnicalFileUtils technicalFileUtils;
@Autowired @Autowired
private WorkFlowUtil workFlowUtil; private WorkFlowUtil workFlowUtil;
@Autowired // @Autowired
private ProcessDataUtils processDataUtils; // private ProcessDataUtils processDataUtils;
@Autowired @Autowired
ExtApplicantService extApplicantService; ExtApplicantService extApplicantService;
@Autowired @Autowired
...@@ -1026,8 +1023,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService { ...@@ -1026,8 +1023,8 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
*/ */
@Override @Override
public void generateWordByAutoMethod(DxDocumentVO documentVo) { public void generateWordByAutoMethod(DxDocumentVO documentVo) {
DxDocumentVO dxDocumentVO = docBeforeCreateEvent.processCreateData(documentVo); // DxDocumentVO dxDocumentVO = docBeforeCreateEvent.processCreateData(documentVo);
documentService.saveRecursion(dxDocumentVO); // 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