Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dcs-plan
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-plan
Commits
70313efc
Commit
70313efc
authored
Sep 28, 2024
by
wei
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询科研类收入合同
parent
9b6e9463
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
211 additions
and
60 deletions
+211
-60
ExtInComeContractController.java
...dcs/plan/core/controller/ExtInComeContractController.java
+37
-15
AutoTaskService.java
...java/com/yonde/dcs/plan/core/service/AutoTaskService.java
+2
-0
ExtExpenditureContractService.java
.../dcs/plan/core/service/ExtExpenditureContractService.java
+1
-1
ExtInComeContractService.java
...yonde/dcs/plan/core/service/ExtInComeContractService.java
+13
-5
AutoTaskServiceImpl.java
...yonde/dcs/plan/core/service/impl/AutoTaskServiceImpl.java
+20
-1
ExtExpenditureContractServiceImpl.java
.../core/service/impl/ExtExpenditureContractServiceImpl.java
+53
-38
ExtInComeContractServiceImpl.java
.../plan/core/service/impl/ExtInComeContractServiceImpl.java
+61
-0
WorkFlowUtil.java
.../main/java/com/yonde/dcs/plan/core/util/WorkFlowUtil.java
+24
-0
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/controller/ExtInComeContractController.java
View file @
70313efc
package
com
.
yonde
.
dcs
.
plan
.
core
.
controller
;
package
com
.
yonde
.
dcs
.
plan
.
core
.
controller
;
import
org.springframework.stereotype.Controller
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.validation.annotation.Validated
;
import
java.util.List
;
import
com.yonde.dcs.plan.common.vo.ExtInComeContractVO
;
import
com.yonde.dcs.plan.common.vo.ExtInComeContractVO
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
com.yonde.dcs.plan.core.controller.shadow.ExtInComeContractControllerShadow
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.yonde.dcs.plan.core.service.AutoTaskService
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.*
;
import
com.yonde.dcs.plan.core.service.ExtInComeContractService
;
import
com.yonde.dcs.plan.core.service.ExtInComeContractService
;
import
com.yonde.dex.basedata.entity.api.ApiResult
;
import
com.yonde.dex.basedata.entity.api.ApiResult
;
import
com.yonde.dcs.plan.core.controller.shadow.ExtInComeContractControllerShadow
;
import
io.swagger.annotations.Api
;
import
javax.annotation.Resource
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
/**
/**
* @description: ExtInComeContract-Controller
* @description: ExtInComeContract-Controller
* @author: dexadmin
* @author: dexadmin
* @version: V
* @version: V
* @date: 2024-9-24 16:48:58
* @date: 2024-9-24 16:48:58
**/
**/
@Api
(
tags
=
"ExtInComeContract管理服务"
)
@Api
(
tags
=
"ExtInComeContract管理服务"
)
@RequestMapping
(
"/ExtInComeContract"
)
@RequestMapping
(
"/ExtInComeContract"
)
@ResponseBody
()
@ResponseBody
()
@Controller
(
ExtInComeContractController
.
BEAN_NAME
)
@Controller
(
ExtInComeContractController
.
BEAN_NAME
)
public
class
ExtInComeContractController
<
V
extends
ExtInComeContractVO
,
S
extends
ExtInComeContractService
<
V
>>
extends
ExtInComeContractControllerShadow
<
V
,
S
>
{
public
class
ExtInComeContractController
<
V
extends
ExtInComeContractVO
,
S
extends
ExtInComeContractService
<
V
>>
extends
ExtInComeContractControllerShadow
<
V
,
S
>
{
@Autowired
private
ExtInComeContractService
extInComeContractService
;
@Autowired
private
AutoTaskService
autoTaskService
;
@ApiOperation
(
"发起审批流程"
)
@PostMapping
({
"startWorkflow"
})
public
ApiResult
startWorkflow
(
@RequestParam
(
"id"
)
Long
id
)
{
return
ApiResult
.
ok
(
extInComeContractService
.
startWorkflow
(
id
),
"操作完成"
);
}
@ApiOperation
(
value
=
"生成word签字"
,
notes
=
"生成word签字"
,
httpMethod
=
"POST"
)
@PostMapping
(
value
=
"/generateContractWordSign"
)
public
void
generateContractWordSign
(
@RequestParam
(
"documentId"
)
Long
contractId
,
@RequestParam
(
"fileName"
)
String
fileName
)
{
autoTaskService
.
generateInComeContractWordSign
(
contractId
,
fileName
);
}
@ApiOperation
(
"查询科研类收入合同"
)
@PostMapping
({
"getResearchCategory"
})
public
ApiResult
getResearchCategory
(
@RequestParam
(
value
=
"subTypeName"
,
defaultValue
=
"ExtDtIncomeContract"
)
String
subTypeName
)
{
return
ApiResult
.
ok
(
extInComeContractService
.
getResearchCategory
(
subTypeName
),
"查询成功"
);
}
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/AutoTaskService.java
View file @
70313efc
...
@@ -21,4 +21,6 @@ public interface AutoTaskService {
...
@@ -21,4 +21,6 @@ public interface AutoTaskService {
* @param fileName
* @param fileName
*/
*/
void
generateContractWordSign
(
Long
contractId
,
String
fileName
);
void
generateContractWordSign
(
Long
contractId
,
String
fileName
);
void
generateInComeContractWordSign
(
Long
contractId
,
String
fileName
);
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/ExtExpenditureContractService.java
View file @
70313efc
...
@@ -22,7 +22,7 @@ public interface ExtExpenditureContractService<V extends ExtExpenditureContractV
...
@@ -22,7 +22,7 @@ public interface ExtExpenditureContractService<V extends ExtExpenditureContractV
ExtExpenditureContractVO
findExpenditureContractObjFileLinks
(
Long
contractId
);
ExtExpenditureContractVO
findExpenditureContractObjFileLinks
(
Long
contractId
);
void
generateContractWordSign
(
ExtExpenditureContractVO
expenditureContractVO
,
Class
<
ContractUtils
>
contractUtilsClass
,
void
generateContractWordSign
(
Object
object
,
Class
<
ContractUtils
>
contractUtilsClass
,
DxWfProcessInfoVO
wfProcessInfoVO
,
String
fileName
);
DxWfProcessInfoVO
wfProcessInfoVO
,
String
fileName
);
/**
/**
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/ExtInComeContractService.java
View file @
70313efc
...
@@ -2,12 +2,20 @@ package com.yonde.dcs.plan.core.service;
...
@@ -2,12 +2,20 @@ package com.yonde.dcs.plan.core.service;
import
com.yonde.dcs.plan.common.vo.ExtInComeContractVO
;
import
com.yonde.dcs.plan.common.vo.ExtInComeContractVO
;
import
com.yonde.dcs.plan.core.service.shadow.ExtInComeContractServiceShadow
;
import
com.yonde.dcs.plan.core.service.shadow.ExtInComeContractServiceShadow
;
import
java.util.List
;
/**
/**
* @description: ExtInComeContract-service
* @description: ExtInComeContract-service
* @author: dexadmin
* @author: dexadmin
* @version: V
* @version: V
* @date: 2024-9-24 16:48:58
* @date: 2024-9-24 16:48:58
**/
**/
public
interface
ExtInComeContractService
<
V
extends
ExtInComeContractVO
>
extends
ExtInComeContractServiceShadow
<
V
>
{
public
interface
ExtInComeContractService
<
V
extends
ExtInComeContractVO
>
extends
ExtInComeContractServiceShadow
<
V
>
{
ExtInComeContractVO
startWorkflow
(
Long
id
);
ExtInComeContractVO
findExtInComeContractObjFileLinks
(
Long
contractId
);
List
<
ExtInComeContractVO
>
getResearchCategory
(
String
subTypeName
);
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/AutoTaskServiceImpl.java
View file @
70313efc
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
.
impl
;
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
.
impl
;
import
com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO
;
import
com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO
;
import
com.yonde.dcs.plan.common.vo.ExtInComeContractVO
;
import
com.yonde.dcs.plan.core.factory.ContractUtils
;
import
com.yonde.dcs.plan.core.factory.ContractUtils
;
import
com.yonde.dcs.plan.core.service.AutoTaskService
;
import
com.yonde.dcs.plan.core.service.AutoTaskService
;
import
com.yonde.dcs.plan.core.service.ExtExpenditureContractService
;
import
com.yonde.dcs.plan.core.service.ExtExpenditureContractService
;
import
com.yonde.dcs.plan.core.service.ExtInComeContractService
;
import
com.yonde.dcs.plan.core.service.ExtPlanService
;
import
com.yonde.dcs.plan.core.service.ExtPlanService
;
import
com.yonde.dcs.plan.core.util.WorkFlowUtil
;
import
com.yonde.dcs.plan.core.util.WorkFlowUtil
;
import
com.yonde.dex.user.common.vo.DxOrganizationVO
;
import
com.yonde.dex.user.common.vo.DxOrganizationVO
;
...
@@ -25,7 +27,6 @@ import java.util.List;
...
@@ -25,7 +27,6 @@ import java.util.List;
@Slf4j
@Slf4j
public
class
AutoTaskServiceImpl
implements
AutoTaskService
{
public
class
AutoTaskServiceImpl
implements
AutoTaskService
{
@Autowired
@Autowired
private
ExtPlanService
extPlanService
;
private
ExtPlanService
extPlanService
;
...
@@ -35,6 +36,9 @@ public class AutoTaskServiceImpl implements AutoTaskService {
...
@@ -35,6 +36,9 @@ public class AutoTaskServiceImpl implements AutoTaskService {
@Autowired
@Autowired
private
ExtExpenditureContractService
extExpenditureContractService
;
private
ExtExpenditureContractService
extExpenditureContractService
;
@Autowired
private
ExtInComeContractService
extInComeContractService
;
/**
/**
* 通过userId获取组织名
* 通过userId获取组织名
*
*
...
@@ -61,5 +65,20 @@ public class AutoTaskServiceImpl implements AutoTaskService {
...
@@ -61,5 +65,20 @@ public class AutoTaskServiceImpl implements AutoTaskService {
log
.
info
(
"自动任务======生成word签名完成"
);
log
.
info
(
"自动任务======生成word签名完成"
);
}
}
@Override
public
void
generateInComeContractWordSign
(
Long
contractId
,
String
fileName
)
{
//深度查询展开ObjLink
ExtInComeContractVO
extInComeContractVO
=
extInComeContractService
.
findExtInComeContractObjFileLinks
(
contractId
);
log
.
info
(
"自动任务======生成word签名开始"
);
DxWfProcessVO
wfProcessInstVO
=
workFlowUtil
.
getWfProcessInst
(
extInComeContractVO
);
DxWfProcessInfoVO
wfProcessInfoVO
=
workFlowUtil
.
getProcessInstDetail
(
wfProcessInstVO
);
String
subTypeName
=
extInComeContractVO
.
getSubTypeName
();
log
.
info
(
"自动任务======生成word签名进行中,文档SubTypeName:{}"
,
subTypeName
);
extExpenditureContractService
.
generateContractWordSign
(
extInComeContractVO
,
ContractUtils
.
class
,
wfProcessInfoVO
,
fileName
);
//保存附件
extExpenditureContractService
.
saveRecursion
(
extInComeContractVO
);
log
.
info
(
"自动任务======生成word签名完成"
);
}
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtExpenditureContractServiceImpl.java
View file @
70313efc
...
@@ -3,10 +3,12 @@ package com.yonde.dcs.plan.core.service.impl;
...
@@ -3,10 +3,12 @@ package com.yonde.dcs.plan.core.service.impl;
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.google.common.collect.Lists
;
import
com.yonde.dcs.plan.common.constants.Constants
;
import
com.yonde.dcs.plan.common.constants.Constants
;
import
com.yonde.dcs.plan.common.constants.SignConstants
;
import
com.yonde.dcs.plan.common.constants.SignConstants
;
import
com.yonde.dcs.plan.common.utils.FileUtils
;
import
com.yonde.dcs.plan.common.utils.FileUtils
;
import
com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO
;
import
com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO
;
import
com.yonde.dcs.plan.common.vo.ExtInComeContractVO
;
import
com.yonde.dcs.plan.core.factory.ContractUtils
;
import
com.yonde.dcs.plan.core.factory.ContractUtils
;
import
com.yonde.dcs.plan.core.repository.ExtExpenditureContractRepository
;
import
com.yonde.dcs.plan.core.repository.ExtExpenditureContractRepository
;
import
com.yonde.dcs.plan.core.service.ExtExpenditureContractService
;
import
com.yonde.dcs.plan.core.service.ExtExpenditureContractService
;
...
@@ -98,15 +100,31 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
...
@@ -98,15 +100,31 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
return
this
.
changeStatus
(
extExpenditureContractVO
.
getId
(),
"submitReviewing"
,
true
);
return
this
.
changeStatus
(
extExpenditureContractVO
.
getId
(),
"submitReviewing"
,
true
);
}
}
public
void
generateContractWordSign
(
ExtExpenditureContractVO
expenditureContractVO
,
Class
classType
,
public
void
generateContractWordSign
(
Object
obj
,
Class
classType
,
DxWfProcessInfoVO
wfProcessInfoVO
,
String
fileName
)
{
DxWfProcessInfoVO
wfProcessInfoVO
,
String
fileName
)
{
String
outFilePath
=
Constants
.
MERGER_FILE_ABSOLUTE_PATH
;
String
sPath
=
Constants
.
MERGER_FILE_ABSOLUTE_PATH
;
try
{
try
{
Class
<?>
clazz
=
Class
.
forName
(
"com.yonde.dcs.plan.core.factory.ContractUtils"
);
if
(
obj
instanceof
ExtExpenditureContractVO
)
{
Method
settingDataMethod
=
clazz
.
getMethod
(
"settingData"
,
ExtExpenditureContractVO
.
class
,
DxWfProcessInfoVO
.
class
);
ExtExpenditureContractVO
expenditureContractVO
=
(
ExtExpenditureContractVO
)
obj
;
settingDataMethod
.
invoke
(
SpringUtil
.
getBean
(
classType
),
expenditureContractVO
,
wfProcessInfoVO
);
Class
<?>
clazz
=
Class
.
forName
(
"com.yonde.dcs.plan.core.factory.ContractUtils"
);
log
.
info
(
"签名----生成word文件内容结束===="
);
Method
settingDataMethod
=
clazz
.
getMethod
(
"settingData"
,
ExtExpenditureContractVO
.
class
,
DxWfProcessInfoVO
.
class
);
settingDataMethod
.
invoke
(
SpringUtil
.
getBean
(
classType
),
expenditureContractVO
,
wfProcessInfoVO
);
outFilePath
=
outFilePath
+
expenditureContractVO
.
getSubTypeName
()
+
"\\"
+
expenditureContractVO
.
getNumber
()
+
"\\"
;
sPath
=
sPath
+
expenditureContractVO
.
getSubTypeName
()
+
"\\"
+
expenditureContractVO
.
getNumber
();
}
else
if
(
obj
instanceof
ExtInComeContractVO
)
{
ExtInComeContractVO
extInComeContractVO
=
(
ExtInComeContractVO
)
obj
;
Class
<?>
clazz
=
Class
.
forName
(
"com.yonde.dcs.plan.core.factory.ContractUtils"
);
// TODO 改
Method
settingDataMethod
=
clazz
.
getMethod
(
"settingData"
,
ExtInComeContractVO
.
class
,
DxWfProcessInfoVO
.
class
);
settingDataMethod
.
invoke
(
SpringUtil
.
getBean
(
classType
),
extInComeContractVO
,
wfProcessInfoVO
);
outFilePath
=
outFilePath
+
extInComeContractVO
.
getSubTypeName
()
+
"\\"
+
extInComeContractVO
.
getNumber
()
+
"\\"
;
sPath
=
sPath
+
extInComeContractVO
.
getSubTypeName
()
+
"\\"
+
extInComeContractVO
.
getNumber
();
}
else
{
log
.
error
(
"签名----没有合同相关类型===="
);
return
;
}
log
.
info
(
"签名----获取生成的word文件内容结束===="
);
//按照目录获取生成的pdf和word
//按照目录获取生成的pdf和word
String
outFilePath
=
Constants
.
MERGER_FILE_ABSOLUTE_PATH
+
expenditureContractVO
.
getSubTypeName
()
+
"\\"
+
expenditureContractVO
.
getNumber
()
+
"\\"
;
//获取文件夹的所有文件--绝对路径
//获取文件夹的所有文件--绝对路径
List
<
String
>
fileList
=
new
ArrayList
<>();
List
<
String
>
fileList
=
new
ArrayList
<>();
File
[]
files
=
FileUtil
.
ls
(
outFilePath
);
File
[]
files
=
FileUtil
.
ls
(
outFilePath
);
...
@@ -116,12 +134,14 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
...
@@ -116,12 +134,14 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
if
(
CollectionUtils
.
isEmpty
(
fileList
))
{
if
(
CollectionUtils
.
isEmpty
(
fileList
))
{
log
.
error
(
"签名----生成的word文件目录内容为空===="
);
log
.
error
(
"签名----生成的word文件目录内容为空===="
);
}
else
{
}
else
{
// PDF
String
pdfFilePath
=
fileList
.
stream
().
filter
(
item
->
item
.
endsWith
(
".pdf"
)).
findFirst
().
get
();
String
pdfFilePath
=
fileList
.
stream
().
filter
(
item
->
item
.
endsWith
(
".pdf"
)).
findFirst
().
get
();
this
.
extractedAttachFile
(
expenditureContractVO
,
new
FileInputStream
(
pdfFilePath
),
fileName
,
Constants
.
ATTACH_FILE
);
this
.
extractedAttachFile
(
obj
,
new
FileInputStream
(
pdfFilePath
),
fileName
,
Constants
.
ATTACH_FILE
);
log
.
info
(
"签名----获取生成的word文件内容结束===="
);
log
.
info
(
"签名----获取生成的word文件内容结束===="
);
}
}
//删除生成后的临时文件
//删除生成后的临时文件
FileUtils
.
deleteDirectory
(
Constants
.
MERGER_FILE_ABSOLUTE_PATH
+
expenditureContractVO
.
getSubTypeName
()
+
"\\"
+
expenditureContractVO
.
getNumber
()
);
FileUtils
.
deleteDirectory
(
sPath
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"签名----通过不同的合同类型生成不同word错误:{}"
+
e
.
getMessage
());
log
.
error
(
"签名----通过不同的合同类型生成不同word错误:{}"
+
e
.
getMessage
());
}
}
...
@@ -130,29 +150,31 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
...
@@ -130,29 +150,31 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
/**
/**
* 上传附件(事件专用上传附件)
* 上传附件(事件专用上传附件)
*
*
* @param
expenditureContractVO
* @param
obj
* @param inputStreamPdf
* @param inputStreamPdf
* @param fileName
* @param fileName
* @throws IOException
* @throws IOException
*/
*/
public
void
extractedAttachFile
(
ExtExpenditureContractVO
expenditureContractVO
,
InputStream
inputStreamPdf
,
public
void
extractedAttachFile
(
Object
obj
,
InputStream
inputStreamPdf
,
String
fileName
,
String
docFileType
)
throws
IOException
{
String
fileName
,
String
docFileType
)
throws
IOException
{
String
originalFileName
=
StringUtils
.
isEmpty
(
fileName
)
?
expenditureContractVO
.
getName
()
:
fileName
;
String
originalFileName
=
""
;
String
secretCode
=
CommonUtils
.
getSecretCode
(
expenditureContractVO
.
getSecretCode
());
String
secretCode
=
""
;
List
<
ObjFileLinkVO
>
objFileLinks
=
Lists
.
newArrayList
();
if
(
obj
instanceof
ExtExpenditureContractVO
)
{
ExtExpenditureContractVO
expenditureContractVO
=
(
ExtExpenditureContractVO
)
obj
;
originalFileName
=
StringUtils
.
isEmpty
(
fileName
)
?
expenditureContractVO
.
getName
()
:
fileName
;
secretCode
=
CommonUtils
.
getSecretCode
(
expenditureContractVO
.
getSecretCode
());
objFileLinks
=
expenditureContractVO
.
getObjFileLinks
();
}
else
if
(
obj
instanceof
ExtInComeContractVO
)
{
ExtInComeContractVO
extInComeContractVO
=
(
ExtInComeContractVO
)
obj
;
originalFileName
=
StringUtils
.
isEmpty
(
fileName
)
?
extInComeContractVO
.
getName
()
:
fileName
;
secretCode
=
CommonUtils
.
getSecretCode
(
extInComeContractVO
.
getSecretCode
());
objFileLinks
=
extInComeContractVO
.
getObjFileLinks
();
}
originalFileName
=
originalFileName
+
"("
+
secretCode
+
")"
;
originalFileName
=
originalFileName
+
"("
+
secretCode
+
")"
;
//上传文件到文件服务器
//上传文件到文件服务器
MultipartFile
multipartFile
=
null
;
MultipartFile
multipartFile
=
null
;
multipartFile
=
new
MockMultipartFile
(
"file"
,
originalFileName
+
".pdf"
,
Constants
.
CONTENT_TYPE_PDF
,
inputStreamPdf
);
multipartFile
=
new
MockMultipartFile
(
"file"
,
originalFileName
+
".pdf"
,
Constants
.
CONTENT_TYPE_PDF
,
inputStreamPdf
);
// if (StringUtils.isEmpty(fileName)) {
// //如果等于空,默认文件名称为getName.pdf
// multipartFile = new MockMultipartFile("file", documentVo.getName() + ".pdf",
// Constants.CONTENT_TYPE_PDF, inputStreamPdf);
// } else {
// //如果不等于空,默认文件名称为name.pdf
// multipartFile = new MockMultipartFile("file", fileName + ".pdf",
// Constants.CONTENT_TYPE_PDF, inputStreamPdf);
// }
RepoFileVO
field
=
fileManagerService
.
uploadFile
(
multipartFile
,
getBucketId
());
RepoFileVO
field
=
fileManagerService
.
uploadFile
(
multipartFile
,
getBucketId
());
if
(
field
==
null
)
{
if
(
field
==
null
)
{
log
.
error
(
"文件上传失败!"
);
log
.
error
(
"文件上传失败!"
);
...
@@ -162,28 +184,21 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
...
@@ -162,28 +184,21 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
//根据docId查询文件对象
//根据docId查询文件对象
RepoFileVO
fileVO
=
fileManagerFeignService
.
findFileInfoById
(
field
.
getId
());
RepoFileVO
fileVO
=
fileManagerFeignService
.
findFileInfoById
(
field
.
getId
());
//上传到DOC_PDF_FILE为了浏览(Constants.PDF_FILE)
//上传到DOC_PDF_FILE为了浏览(Constants.PDF_FILE)
this
.
doProcessContract
(
expenditureContractVO
,
fileVO
,
docFileType
);
}
/**
* 更新主内容或附件
*
* @param expenditureContractVO
* @param fileVO
* @param fileType
*/
private
void
doProcessContract
(
ExtExpenditureContractVO
expenditureContractVO
,
RepoFileVO
fileVO
,
String
fileType
)
{
// DxObjFileUtils.removeFile(documentVo, fileType);
List
<
ObjFileLinkVO
>
objFileLinks
=
expenditureContractVO
.
getObjFileLinks
();
//删除逻辑
//删除逻辑
if
(!
CollectionUtils
.
isEmpty
(
objFileLinks
))
{
if
(!
CollectionUtils
.
isEmpty
(
objFileLinks
))
{
objFileLinks
.
stream
().
forEach
(
item
->
{
objFileLinks
.
forEach
(
item
->
{
if
(
item
.
getContentType
().
equals
(
f
ileType
)
&&
item
.
getTarget
().
getOriginalFileName
().
equals
(
fileVO
.
getOriginalFileName
()))
{
if
(
item
.
getContentType
().
equals
(
docF
ileType
)
&&
item
.
getTarget
().
getOriginalFileName
().
equals
(
fileVO
.
getOriginalFileName
()))
{
item
.
setOperator
(
OperatorType
.
REMOVE
);
item
.
setOperator
(
OperatorType
.
REMOVE
);
}
}
});
});
}
}
DxObjFileUtils
.
addFile
(
expenditureContractVO
,
fileVO
,
fileType
);
if
(
obj
instanceof
ExtExpenditureContractVO
)
{
ExtExpenditureContractVO
expenditureContractVO
=
(
ExtExpenditureContractVO
)
obj
;
DxObjFileUtils
.
addFile
(
expenditureContractVO
,
fileVO
,
docFileType
);
}
else
if
(
obj
instanceof
ExtInComeContractVO
)
{
ExtInComeContractVO
extInComeContractVO
=
(
ExtInComeContractVO
)
obj
;
DxObjFileUtils
.
addFile
(
extInComeContractVO
,
fileVO
,
docFileType
);
}
}
}
public
Long
getBucketId
()
{
public
Long
getBucketId
()
{
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtInComeContractServiceImpl.java
View file @
70313efc
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
.
impl
;
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
.
impl
;
import
com.google.common.collect.Lists
;
import
com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO
;
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.data.DxPageImpl
;
import
com.yonde.dex.basedata.exception.DxBusinessException
;
import
com.yonde.dex.dao.service.util.DxPageUtils
;
import
com.yonde.dex.wfc.feign.api.WfcProcessFeign
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
com.yonde.dcs.plan.common.vo.ExtInComeContractVO
;
import
com.yonde.dcs.plan.common.vo.ExtInComeContractVO
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.beans.factory.annotation.Qualifier
;
...
@@ -29,6 +41,55 @@ public class ExtInComeContractServiceImpl<V extends ExtInComeContractVO> impleme
...
@@ -29,6 +41,55 @@ public class ExtInComeContractServiceImpl<V extends ExtInComeContractVO> impleme
@Autowired
@Autowired
ExtInComeContractRepository
<
ExtInComeContract
>
extInComeContractRepository
;
ExtInComeContractRepository
<
ExtInComeContract
>
extInComeContractRepository
;
@Autowired
private
WfcProcessFeign
wfcProcessFeign
;
@Override
public
ExtInComeContractVO
startWorkflow
(
Long
id
)
{
ExtInComeContractVO
extInComeContractVO
=
this
.
get
(
id
);
if
(
extInComeContractVO
==
null
)
{
throw
new
DxBusinessException
(
"500"
,
"获取不到对象"
);
}
if
(!
extInComeContractVO
.
getState
().
equals
(
"edit"
))
{
throw
new
DxBusinessException
(
"500"
,
"该对象不是编制状态"
);
}
wfcProcessFeign
.
startProcessByKey
(
"ExtInComeContractWF"
,
extInComeContractVO
);
return
this
.
changeStatus
(
extInComeContractVO
.
getId
(),
"submitReviewing"
,
true
);
}
@Override
public
ExtInComeContractVO
findExtInComeContractObjFileLinks
(
Long
id
)
{
SearchQueryCondition
query
=
SearchQueryCondition
.
builder
()
.
openProp
(
SearchQueryCondition
.
builder
().
name
(
"creator"
).
build
())
.
openProp
(
SearchQueryCondition
.
builder
().
name
(
"modifier"
).
build
())
.
openProp
(
SearchQueryCondition
.
builder
().
name
(
"objFileLinks"
).
openProp
(
SearchQueryCondition
.
builder
().
name
(
"target"
).
build
()).
build
())
.
searchItems
(
SearchItems
.
builder
().
item
(
new
SearchItem
(
"id"
,
SearchItem
.
Operator
.
EQ
,
id
,
null
)).
item
(
new
SearchItem
(
"latest"
,
SearchItem
.
Operator
.
EQ
,
true
,
null
)).
operator
(
SearchItems
.
BooleanOperator
.
AND
).
build
()).
build
();
//通过id查询文档
DxPageImpl
<
V
>
dexPage
=
this
.
findRecursion
(
query
);
if
(!
org
.
apache
.
commons
.
collections
.
CollectionUtils
.
isEmpty
(
dexPage
.
getContent
()))
{
return
DxPageUtils
.
getFirst
(
dexPage
);
}
return
null
;
}
@Override
public
List
<
ExtInComeContractVO
>
getResearchCategory
(
String
subTypeName
)
{
SearchQueryCondition
query
=
SearchQueryCondition
.
builder
()
.
openProp
(
SearchQueryCondition
.
builder
().
name
(
"sourceTopicContractLink"
)
.
openProp
(
SearchQueryCondition
.
builder
().
name
(
"target"
).
build
()).
build
())
.
searchItems
(
SearchItems
.
builder
()
.
item
(
new
SearchItem
(
"subTypeName"
,
SearchItem
.
Operator
.
EQ
,
subTypeName
,
null
))
.
item
(
new
SearchItem
(
"latest"
,
SearchItem
.
Operator
.
EQ
,
true
,
null
))
.
operator
(
SearchItems
.
BooleanOperator
.
AND
).
build
()).
build
();
DxPageImpl
<
V
>
dexPage
=
this
.
findRecursion
(
query
);
if
(
CollectionUtils
.
isNotEmpty
(
dexPage
.
getContent
()))
{
return
(
List
<
ExtInComeContractVO
>)
dexPage
.
getContent
();
}
return
Lists
.
newArrayList
();
}
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/util/WorkFlowUtil.java
View file @
70313efc
...
@@ -4,6 +4,7 @@ package com.yonde.dcs.plan.core.util;
...
@@ -4,6 +4,7 @@ package com.yonde.dcs.plan.core.util;
import
com.yonde.dcs.document.common.entity.vo.DxDocumentVO
;
import
com.yonde.dcs.document.common.entity.vo.DxDocumentVO
;
import
com.yonde.dcs.plan.common.constants.SignConstants
;
import
com.yonde.dcs.plan.common.constants.SignConstants
;
import
com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO
;
import
com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO
;
import
com.yonde.dcs.plan.common.vo.ExtInComeContractVO
;
import
com.yonde.dex.user.common.vo.DxUserInfoVO
;
import
com.yonde.dex.user.common.vo.DxUserInfoVO
;
import
com.yonde.dex.user.feign.DxUserInfoFeign
;
import
com.yonde.dex.user.feign.DxUserInfoFeign
;
import
com.yonde.dex.version.plugin.common.entity.DxIterationVOHolder
;
import
com.yonde.dex.version.plugin.common.entity.DxIterationVOHolder
;
...
@@ -86,6 +87,29 @@ public class WorkFlowUtil {
...
@@ -86,6 +87,29 @@ public class WorkFlowUtil {
return
null
;
return
null
;
}
}
/**
* 获取流程实例
*
* @param extInComeContractVO
* @return
*/
// TODO: xpc WfProcessInstVO不存在改为DxWfProcessVO
public
DxWfProcessVO
getWfProcessInst
(
ExtInComeContractVO
extInComeContractVO
)
{
// TODO: getProcessInstList方法不存在改为getProcessList
// WfProcessInstSearchVO wfProcessInstSearchVO = new WfProcessInstSearchVO();
// wfProcessInstSearchVO.setPboClass(DxDocumentVO.class.getName());
// wfProcessInstSearchVO.setPboId(doc.getVersionId());
// Page<WfProcessInstVO> wfProcessInstVOPage = this.instanceService.getProcessInstList(wfProcessInstSearchVO, 1, 10);
DxWfProcessSearchVO
dxWfProcessSearchVO
=
new
DxWfProcessSearchVO
();
dxWfProcessSearchVO
.
setPboClass
(
ExtExpenditureContractVO
.
class
.
getName
());
dxWfProcessSearchVO
.
setPboId
(
extInComeContractVO
.
getVersionId
());
Page
<
DxWfProcessVO
>
processList
=
wfcProcessFeign
.
getProcessList
(
dxWfProcessSearchVO
,
1
,
10
);
if
(!
CollectionUtils
.
isEmpty
(
processList
.
getContent
()))
{
return
processList
.
getContent
().
get
(
0
);
}
return
null
;
}
/**
/**
* 获取流程实例
* 获取流程实例
*
*
...
...
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