Commit d26089a2 authored by 侯彦文's avatar 侯彦文

删除合同内容

parent 4fc4c212
package com.yonde.dcs.core.event;
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.core.factory.TechnicalFileUtils;
import com.yonde.dcs.document.core.service.ExtDocService;
import com.yonde.dcs.document.common.vo.ExtIncomeDetailVO;
/*import com.yonde.dcs.document.common.vo.ExtIncomeDetailVO;*/
import com.yonde.dcs.document.common.vo.ExtInterfaceInfoLinkVO;
import com.yonde.dcs.document.core.constants.Constants;
import com.yonde.dcs.document.core.factory.InternalInterfaceUtils;
......@@ -16,8 +16,9 @@ import com.yonde.dcs.document.core.util.Word2PdfJacobUtil;
import com.yonde.dcs.document.core.word.ImportWordService;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.document.core.service.DocumentService;
import com.yonde.dcs.plan.common.vo.ExtIncomeDetailVO;
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.dex.basedata.entity.vo.IdVO;
import com.yonde.dex.basedata.exception.DxBusinessException;
......@@ -83,6 +84,10 @@ public class DocumentEvent {
@Autowired
DocumentService documentService;
/*
@Autowired
private ExtIncomeContractServiceFeign extIncomeContractService;
*/
@Autowired
private ExtSpendingContractServiceFeign extSpendingContractService;
@Autowired
......@@ -289,7 +294,39 @@ public class DocumentEvent {
}
@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 == POST_CREATE || 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);*/
}
/**
* 刷新支出合同金额
......@@ -303,7 +340,26 @@ public class DocumentEvent {
extSpendingContractService.calculateSpending(contractId);
}
public void onEvent(BaseService.DataChangeEvent event) {
if (event.operationType.equals(POST_CREATE) || event.operationType.equals(POST_UPDATE)) {
/*extValidateSecret(event.eventTargets);*/
}
}
/* @Transactional(rollbackFor = {Exception.class, Error.class})
<P extends DxContextVOHolder & DxSecretVOHolder & IdVO> void extValidateSecret(Iterable<?> objects) {
for (Object data : objects) {
log.info(">>>>>extValidateSecret data:" + data);
log.info(">>>>>extValidateSecret data.getClass:" + data.getClass());
//校验项目中心相关对象密级和计划密级
if (data instanceof DxContextVOHolder && data instanceof DxSecretVOHolder && data instanceof IdVO) {
String checkResultStr = checkDxObjectSecret((P) data);
if (!StringUtils.isEmpty(checkResultStr)) {
throw new DxBusinessException("500", checkResultStr);
}
}
}
}*/
/**
* 校验计划、收入合同、支出合同密级与项目的关系
......
......@@ -19,6 +19,8 @@ import com.yonde.dcs.document.core.constants.Constants;
import com.yonde.dcs.document.core.constants.SignConstants;
import com.yonde.dcs.document.common.entity.vo.DxDocumentVO;
import com.yonde.dcs.plan.common.vo.ExtDisReocredLinkVO;
import com.yonde.dcs.plan.common.vo.ExtDistributeRecordVO;
import com.yonde.dcs.plan.common.vo.ExtPlanDocLinkVO;
import com.yonde.dcs.plan.common.vo.ExtPlanVO;
import com.yonde.dcs.plan.feign.ExtDistributeRecordServiceFeign;
......@@ -378,7 +380,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
* @param code
*/
private void generateDistributeRecord(DxDocumentVO documentVO, String userId, String distributeType, String boTitle, String code) {
List<ExtDisReocredLinkVO> list = new ArrayList<>();
/* List<ExtDisReocredLinkVO> list = new ArrayList<>();
//创建分发记录对象
ExtDistributeRecordVO recordVO = new ExtDistributeRecordVO();
//分发类型
......@@ -420,7 +422,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
list.add(disReocredLinkVO);
recordVO.setSourceDisReocredLink(list);
recordVO.setOperator(OperatorType.ADD);
distributeRecordService.saveRecursion(recordVO);
distributeRecordService.saveRecursion(recordVO);*/
}
/**
......
package com.yonde.dcs.core.event;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.springframework.test.context.junit4.SpringRunner;
//@SpringBootTest
@RunWith(SpringRunner.class)
public class DocumentEventTest {
@Mock
DocumentEvent documentEvent;
}
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