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
5caa6483
Commit
5caa6483
authored
Aug 13, 2024
by
xuzhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[feat][DOC]迁移类缺失问题修改
parent
1cb95188
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
633 additions
and
636 deletions
+633
-636
DocBeforeCreateEvent.java
.../java/com/yonde/dcs/core/events/DocBeforeCreateEvent.java
+256
-256
DocTransactionEvent.java
...n/java/com/yonde/dcs/core/events/DocTransactionEvent.java
+88
-88
ProcessDataUtils.java
...main/java/com/yonde/dcs/core/events/ProcessDataUtils.java
+135
-135
ValidateSecretListener.java
...ava/com/yonde/dcs/core/events/ValidateSecretListener.java
+138
-138
ExtAutoTaskServiceImpl.java
...m/yonde/dcs/core/service/impl/ExtAutoTaskServiceImpl.java
+16
-19
No files found.
dcs-doc-expand-core/src/main/java/com/yonde/dcs/core/events/DocBeforeCreateEvent.java
View file @
5caa6483
This diff is collapsed.
Click to expand it.
dcs-doc-expand-core/src/main/java/com/yonde/dcs/core/events/DocTransactionEvent.java
View file @
5caa6483
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);
//
}
//
}
dcs-doc-expand-core/src/main/java/com/yonde/dcs/core/events/ProcessDataUtils.java
View file @
5caa6483
This diff is collapsed.
Click to expand it.
dcs-doc-expand-core/src/main/java/com/yonde/dcs/core/events/ValidateSecretListener.java
View file @
5caa6483
This diff is collapsed.
Click to expand it.
dcs-doc-expand-core/src/main/java/com/yonde/dcs/core/service/impl/ExtAutoTaskServiceImpl.java
View file @
5caa6483
...
...
@@ -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);
}
/**
...
...
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