Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dcs-doc-expand
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
INET-TWO
server
dcs-doc-expand
Commits
d26089a2
Commit
d26089a2
authored
Sep 25, 2024
by
侯彦文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除合同内容
parent
4fc4c212
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
20 deletions
+63
-20
DocumentEvent.java
...java/com/yonde/dcs/document/core/event/DocumentEvent.java
+59
-3
ExtAutoTaskServiceImpl.java
...cs/document/core/service/impl/ExtAutoTaskServiceImpl.java
+4
-2
DocumentEventTest.java
.../com/yonde/dcs/document/core/event/DocumentEventTest.java
+0
-15
No files found.
dcs-doc-expand-core/src/main/java/com/yonde/dcs/document/core/event/DocumentEvent.java
View file @
d26089a2
package
com
.
yonde
.
dcs
.
core
.
event
;
package
com
.
yonde
.
dcs
.
document
.
core
.
event
;
import
cn.hutool.core.io.FileUtil
;
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.document.core.factory.TechnicalFileUtils
;
import
com.yonde.dcs.document.core.factory.TechnicalFileUtils
;
import
com.yonde.dcs.document.core.service.ExtDocService
;
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.common.vo.ExtInterfaceInfoLinkVO
;
import
com.yonde.dcs.document.core.constants.Constants
;
import
com.yonde.dcs.document.core.constants.Constants
;
import
com.yonde.dcs.document.core.factory.InternalInterfaceUtils
;
import
com.yonde.dcs.document.core.factory.InternalInterfaceUtils
;
...
@@ -16,8 +16,9 @@ import com.yonde.dcs.document.core.util.Word2PdfJacobUtil;
...
@@ -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.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
;
import
com.yonde.dcs.plan.common.vo.ExtIncomeDetailVO
;
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.basedata.entity.vo.IdVO
;
import
com.yonde.dex.basedata.entity.vo.IdVO
;
import
com.yonde.dex.basedata.exception.DxBusinessException
;
import
com.yonde.dex.basedata.exception.DxBusinessException
;
...
@@ -83,6 +84,10 @@ public class DocumentEvent {
...
@@ -83,6 +84,10 @@ public class DocumentEvent {
@Autowired
@Autowired
DocumentService
documentService
;
DocumentService
documentService
;
/*
@Autowired
private ExtIncomeContractServiceFeign extIncomeContractService;
*/
@Autowired
@Autowired
private
ExtSpendingContractServiceFeign
extSpendingContractService
;
private
ExtSpendingContractServiceFeign
extSpendingContractService
;
@Autowired
@Autowired
...
@@ -289,7 +294,39 @@ public class DocumentEvent {
...
@@ -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 {
...
@@ -303,7 +340,26 @@ public class DocumentEvent {
extSpendingContractService
.
calculateSpending
(
contractId
);
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);
}
}
}
}*/
/**
/**
* 校验计划、收入合同、支出合同密级与项目的关系
* 校验计划、收入合同、支出合同密级与项目的关系
...
...
dcs-doc-expand-core/src/main/java/com/yonde/dcs/document/core/service/impl/ExtAutoTaskServiceImpl.java
View file @
d26089a2
...
@@ -19,6 +19,8 @@ import com.yonde.dcs.document.core.constants.Constants;
...
@@ -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.core.constants.SignConstants
;
import
com.yonde.dcs.document.common.entity.vo.DxDocumentVO
;
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.ExtPlanDocLinkVO
;
import
com.yonde.dcs.plan.common.vo.ExtPlanVO
;
import
com.yonde.dcs.plan.common.vo.ExtPlanVO
;
import
com.yonde.dcs.plan.feign.ExtDistributeRecordServiceFeign
;
import
com.yonde.dcs.plan.feign.ExtDistributeRecordServiceFeign
;
...
@@ -378,7 +380,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
...
@@ -378,7 +380,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
* @param code
* @param code
*/
*/
private
void
generateDistributeRecord
(
DxDocumentVO
documentVO
,
String
userId
,
String
distributeType
,
String
boTitle
,
String
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();
ExtDistributeRecordVO recordVO = new ExtDistributeRecordVO();
//分发类型
//分发类型
...
@@ -420,7 +422,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
...
@@ -420,7 +422,7 @@ public class ExtAutoTaskServiceImpl implements ExtAutoTaskService {
list.add(disReocredLinkVO);
list.add(disReocredLinkVO);
recordVO.setSourceDisReocredLink(list);
recordVO.setSourceDisReocredLink(list);
recordVO.setOperator(OperatorType.ADD);
recordVO.setOperator(OperatorType.ADD);
distributeRecordService
.
saveRecursion
(
recordVO
);
distributeRecordService.saveRecursion(recordVO);
*/
}
}
/**
/**
...
...
dcs-doc-expand-core/src/test/java/com/yonde/dcs/document/core/event/DocumentEventTest.java
deleted
100644 → 0
View file @
4fc4c212
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
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment