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
590a4f66
Commit
590a4f66
authored
Sep 29, 2024
by
wei
🎱
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
word模板生成
parent
400aad38
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
108 additions
and
21 deletions
+108
-21
ExtExpenditureContractController.java
...lan/core/controller/ExtExpenditureContractController.java
+1
-1
ExpenditureContractUtils.java
...yonde/dcs/plan/core/factory/ExpenditureContractUtils.java
+3
-7
InComeContractUtils.java
.../com/yonde/dcs/plan/core/factory/InComeContractUtils.java
+95
-0
AutoTaskService.java
...java/com/yonde/dcs/plan/core/service/AutoTaskService.java
+1
-1
ExtExpenditureContractService.java
.../dcs/plan/core/service/ExtExpenditureContractService.java
+2
-2
AutoTaskServiceImpl.java
...yonde/dcs/plan/core/service/impl/AutoTaskServiceImpl.java
+4
-4
ExtExpenditureContractServiceImpl.java
.../core/service/impl/ExtExpenditureContractServiceImpl.java
+2
-6
No files found.
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/controller/ExtExpenditureContractController.java
View file @
590a4f66
...
@@ -42,7 +42,7 @@ public class ExtExpenditureContractController<V extends ExtExpenditureContractVO
...
@@ -42,7 +42,7 @@ public class ExtExpenditureContractController<V extends ExtExpenditureContractVO
@PostMapping
(
value
=
"/generateContractWordSign"
)
@PostMapping
(
value
=
"/generateContractWordSign"
)
public
void
generateContractWordSign
(
@RequestParam
(
"documentId"
)
Long
contractId
,
public
void
generateContractWordSign
(
@RequestParam
(
"documentId"
)
Long
contractId
,
@RequestParam
(
"fileName"
)
String
fileName
)
{
@RequestParam
(
"fileName"
)
String
fileName
)
{
autoTaskService
.
generate
Contract
WordSign
(
contractId
,
fileName
);
autoTaskService
.
generate
Expenditure
WordSign
(
contractId
,
fileName
);
}
}
}
}
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/factory/ContractUtils.java
→
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/factory/
Expenditure
ContractUtils.java
View file @
590a4f66
...
@@ -2,7 +2,6 @@ package com.yonde.dcs.plan.core.factory;
...
@@ -2,7 +2,6 @@ package com.yonde.dcs.plan.core.factory;
import
cn.hutool.core.io.FileUtil
;
import
cn.hutool.core.io.FileUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
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.vo.ExtExpenditureContractVO
;
import
com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO
;
...
@@ -13,20 +12,17 @@ import com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO;
...
@@ -13,20 +12,17 @@ import com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
/**
/**
* @author weihongda
* @author weihongda
* @ClassName ContractUtils.java
* @ClassName
Expenditure
ContractUtils.java
* @Description 合同
* @Description
支出
合同
* @createTime 2022/02/22 14:35:00
* @createTime 2022/02/22 14:35:00
*/
*/
@Component
@Component
public
class
ContractUtils
{
public
class
Expenditure
ContractUtils
{
@Autowired
@Autowired
private
ExtExpenditureContractService
extExpenditureContractService
;
private
ExtExpenditureContractService
extExpenditureContractService
;
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/factory/InComeContractUtils.java
0 → 100644
View file @
590a4f66
package
com
.
yonde
.
dcs
.
plan
.
core
.
factory
;
import
cn.hutool.core.io.FileUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yonde.dcs.plan.common.constants.Constants
;
import
com.yonde.dcs.plan.common.constants.SignConstants
;
import
com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO
;
import
com.yonde.dcs.plan.common.vo.ExtInComeContractVO
;
import
com.yonde.dcs.plan.core.service.ExtExpenditureContractService
;
import
com.yonde.dcs.plan.core.word.ImportWordService
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Objects
;
/**
* @author weihongda
* @ClassName InComeContractUtils.java
* @Description 收入合同
* @createTime 2022/02/22 14:35:00
*/
@Component
public
class
InComeContractUtils
{
@Autowired
private
ExtExpenditureContractService
extExpenditureContractService
;
@Autowired
private
ImportWordService
importWordService
;
/**
* 填充评审会议资料数据
*
* @param
* @return
*/
public
JSONObject
settingDocData
(
ExtInComeContractVO
inComeContractVO
,
DxWfProcessInfoVO
wfProcessInfoVO
)
{
String
path
=
Constants
.
MTEMPLATE_ABSOLUTE_PATH
;
String
file
=
inComeContractVO
.
getSubTypeName
();
String
outFilePath
=
Constants
.
MERGER_FILE_ABSOLUTE_PATH
+
inComeContractVO
.
getSubTypeName
()
+
"\\"
+
inComeContractVO
.
getNumber
()
+
"\\"
;
//生成特定的文档目录,保存生成的word文件
FileUtil
.
mkdir
(
outFilePath
);
//获取动态属性
/*Map<String, Object> dynamicAttrs = expenditureContractVO.getDynamicAttrs();
String content = Objects.isNull(dynamicAttrs.get("content")) ? "" : (String) dynamicAttrs.get("content");
String designPhase = Objects.isNull(dynamicAttrs.get("designPhase")) ? "" : (String) dynamicAttrs.get("designPhase");*/
JSONObject
jsonObject
=
(
JSONObject
)
JSONObject
.
toJSON
(
inComeContractVO
);
//项目代号
/*String projectCode = ObjectUtils.isEmpty(v.getDxDocumentExpand().getProjectCode()) ? "" : v.getDxDocumentExpand().getProjectCode();
jsonObject.put("projectCode", extDocService.searchDictDataByDictCode(Constants.PROJECT_CODE, projectCode));
jsonObject.put("projectCode", projectCode);*/
//合同名称
//合同乙方
//合同编号
//合同金额
//合同密级
//合同乙方保密资质等级
//合同类型
//学校/院归口管理部门
//合同成果形式
//成果交付地点(样机存放地方)
//起止时间
//承办部门
//经办人
//
//页数
//jsonObject.put("pages",v.getDxDocumentExpand().getAttachPages());
//获取参与者
List
<
DxWfProcessTaskVO
>
activities
=
wfProcessInfoVO
.
getHistoryInfo
();
if
(!
CollectionUtils
.
isEmpty
(
activities
))
{
//写入签名数据
jsonObject
.
put
(
"bz_photo"
,
extExpenditureContractService
.
getSignImage
(
activities
,
SignConstants
.
SIGN_KEY_PREPARED
));
jsonObject
.
put
(
"bz_date"
,
extExpenditureContractService
.
getEndDate
(
activities
,
SignConstants
.
SIGN_KEY_PREPARED
));
jsonObject
.
put
(
"sh_photo"
,
extExpenditureContractService
.
getSignImage
(
activities
,
SignConstants
.
SIGN_KEY_SH
));
jsonObject
.
put
(
"sh_date"
,
extExpenditureContractService
.
getEndDate
(
activities
,
SignConstants
.
SIGN_KEY_SH
));
//总体室审核
jsonObject
.
put
(
"zts_photo"
,
extExpenditureContractService
.
getSignImage
(
activities
,
SignConstants
.
SIGN_KEY_ZTSSH
));
jsonObject
.
put
(
"zts_date"
,
extExpenditureContractService
.
getEndDate
(
activities
,
SignConstants
.
SIGN_KEY_ZTSSH
));
jsonObject
.
put
(
"pz_photo"
,
extExpenditureContractService
.
getSignImage
(
activities
,
SignConstants
.
SIGN_KEY_APPROVED
));
jsonObject
.
put
(
"pz_date"
,
extExpenditureContractService
.
getEndDate
(
activities
,
SignConstants
.
SIGN_KEY_APPROVED
));
}
//模板名称
importWordService
.
getWordAllTable
(
jsonObject
,
path
+
file
+
".docx"
,
outFilePath
+
"outFile.docx"
);
return
jsonObject
;
}
}
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/AutoTaskService.java
View file @
590a4f66
...
@@ -20,7 +20,7 @@ public interface AutoTaskService {
...
@@ -20,7 +20,7 @@ public interface AutoTaskService {
* @param contractId
* @param contractId
* @param fileName
* @param fileName
*/
*/
void
generate
Contract
WordSign
(
Long
contractId
,
String
fileName
);
void
generate
Expenditure
WordSign
(
Long
contractId
,
String
fileName
);
void
generateInComeContractWordSign
(
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 @
590a4f66
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
;
package
com
.
yonde
.
dcs
.
plan
.
core
.
service
;
import
com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO
;
import
com.yonde.dcs.plan.common.vo.ExtExpenditureContractVO
;
import
com.yonde.dcs.plan.core.factory.ContractUtils
;
import
com.yonde.dcs.plan.core.factory.
InCome
ContractUtils
;
import
com.yonde.dcs.plan.core.service.shadow.ExtExpenditureContractServiceShadow
;
import
com.yonde.dcs.plan.core.service.shadow.ExtExpenditureContractServiceShadow
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessInfoVO
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO
;
import
com.yonde.dex.wfc.common.vo.DxWfProcessTaskVO
;
...
@@ -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
(
Object
object
,
Class
<
ContractUtils
>
contractUtilsClass
,
void
generateContractWordSign
(
Object
object
,
Class
<
InCome
ContractUtils
>
contractUtilsClass
,
DxWfProcessInfoVO
wfProcessInfoVO
,
String
fileName
);
DxWfProcessInfoVO
wfProcessInfoVO
,
String
fileName
);
/**
/**
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/AutoTaskServiceImpl.java
View file @
590a4f66
...
@@ -2,7 +2,7 @@ package com.yonde.dcs.plan.core.service.impl;
...
@@ -2,7 +2,7 @@ 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.common.vo.ExtInComeContractVO
;
import
com.yonde.dcs.plan.core.factory.ContractUtils
;
import
com.yonde.dcs.plan.core.factory.
InCome
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.ExtInComeContractService
;
...
@@ -51,7 +51,7 @@ public class AutoTaskServiceImpl implements AutoTaskService {
...
@@ -51,7 +51,7 @@ public class AutoTaskServiceImpl implements AutoTaskService {
}
}
@Override
@Override
public
void
generate
Contract
WordSign
(
Long
contractId
,
String
fileName
)
{
public
void
generate
Expenditure
WordSign
(
Long
contractId
,
String
fileName
)
{
//深度查询展开ObjLink
//深度查询展开ObjLink
ExtExpenditureContractVO
expenditureContractVO
=
extExpenditureContractService
.
findExpenditureContractObjFileLinks
(
contractId
);
ExtExpenditureContractVO
expenditureContractVO
=
extExpenditureContractService
.
findExpenditureContractObjFileLinks
(
contractId
);
log
.
info
(
"自动任务======生成word签名开始"
);
log
.
info
(
"自动任务======生成word签名开始"
);
...
@@ -59,7 +59,7 @@ public class AutoTaskServiceImpl implements AutoTaskService {
...
@@ -59,7 +59,7 @@ public class AutoTaskServiceImpl implements AutoTaskService {
DxWfProcessInfoVO
wfProcessInfoVO
=
workFlowUtil
.
getProcessInstDetail
(
wfProcessInstVO
);
DxWfProcessInfoVO
wfProcessInfoVO
=
workFlowUtil
.
getProcessInstDetail
(
wfProcessInstVO
);
String
subTypeName
=
expenditureContractVO
.
getSubTypeName
();
String
subTypeName
=
expenditureContractVO
.
getSubTypeName
();
log
.
info
(
"自动任务======生成word签名进行中,文档SubTypeName:{}"
,
subTypeName
);
log
.
info
(
"自动任务======生成word签名进行中,文档SubTypeName:{}"
,
subTypeName
);
extExpenditureContractService
.
generateContractWordSign
(
expenditureContractVO
,
ContractUtils
.
class
,
wfProcessInfoVO
,
fileName
);
extExpenditureContractService
.
generateContractWordSign
(
expenditureContractVO
,
ExtExpenditureContractVO
.
class
,
wfProcessInfoVO
,
fileName
);
//保存附件
//保存附件
extExpenditureContractService
.
saveRecursion
(
expenditureContractVO
);
extExpenditureContractService
.
saveRecursion
(
expenditureContractVO
);
log
.
info
(
"自动任务======生成word签名完成"
);
log
.
info
(
"自动任务======生成word签名完成"
);
...
@@ -74,7 +74,7 @@ public class AutoTaskServiceImpl implements AutoTaskService {
...
@@ -74,7 +74,7 @@ public class AutoTaskServiceImpl implements AutoTaskService {
DxWfProcessInfoVO
wfProcessInfoVO
=
workFlowUtil
.
getProcessInstDetail
(
wfProcessInstVO
);
DxWfProcessInfoVO
wfProcessInfoVO
=
workFlowUtil
.
getProcessInstDetail
(
wfProcessInstVO
);
String
subTypeName
=
extInComeContractVO
.
getSubTypeName
();
String
subTypeName
=
extInComeContractVO
.
getSubTypeName
();
log
.
info
(
"自动任务======生成word签名进行中,文档SubTypeName:{}"
,
subTypeName
);
log
.
info
(
"自动任务======生成word签名进行中,文档SubTypeName:{}"
,
subTypeName
);
extExpenditureContractService
.
generateContractWordSign
(
extInComeContractVO
,
ContractUtils
.
class
,
wfProcessInfoVO
,
fileName
);
extExpenditureContractService
.
generateContractWordSign
(
extInComeContractVO
,
InCome
ContractUtils
.
class
,
wfProcessInfoVO
,
fileName
);
//保存附件
//保存附件
extExpenditureContractService
.
saveRecursion
(
extInComeContractVO
);
extExpenditureContractService
.
saveRecursion
(
extInComeContractVO
);
log
.
info
(
"自动任务======生成word签名完成"
);
log
.
info
(
"自动任务======生成word签名完成"
);
...
...
dcs-plan-core/src/main/java/com/yonde/dcs/plan/core/service/impl/ExtExpenditureContractServiceImpl.java
View file @
590a4f66
...
@@ -9,7 +9,6 @@ import com.yonde.dcs.plan.common.constants.SignConstants;
...
@@ -9,7 +9,6 @@ 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.common.vo.ExtInComeContractVO
;
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
;
import
com.yonde.dcs.plan.core.util.CommonUtils
;
import
com.yonde.dcs.plan.core.util.CommonUtils
;
...
@@ -84,9 +83,6 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
...
@@ -84,9 +83,6 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
@Autowired
@Autowired
private
DxUserInfoFeign
userService
;
private
DxUserInfoFeign
userService
;
@Autowired
private
ContractUtils
contractUtils
;
@Override
@Override
public
ExtExpenditureContractVO
startWorkflow
(
Long
id
)
{
public
ExtExpenditureContractVO
startWorkflow
(
Long
id
)
{
ExtExpenditureContractVO
extExpenditureContractVO
=
this
.
get
(
id
);
ExtExpenditureContractVO
extExpenditureContractVO
=
this
.
get
(
id
);
...
@@ -107,14 +103,14 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
...
@@ -107,14 +103,14 @@ public class ExtExpenditureContractServiceImpl<V extends ExtExpenditureContractV
try
{
try
{
if
(
obj
instanceof
ExtExpenditureContractVO
)
{
if
(
obj
instanceof
ExtExpenditureContractVO
)
{
ExtExpenditureContractVO
expenditureContractVO
=
(
ExtExpenditureContractVO
)
obj
;
ExtExpenditureContractVO
expenditureContractVO
=
(
ExtExpenditureContractVO
)
obj
;
Class
<?>
clazz
=
Class
.
forName
(
"com.yonde.dcs.plan.core.factory.ContractUtils"
);
Class
<?>
clazz
=
Class
.
forName
(
"com.yonde.dcs.plan.core.factory.
Expenditure
ContractUtils"
);
Method
settingDataMethod
=
clazz
.
getMethod
(
"settingData"
,
ExtExpenditureContractVO
.
class
,
DxWfProcessInfoVO
.
class
);
Method
settingDataMethod
=
clazz
.
getMethod
(
"settingData"
,
ExtExpenditureContractVO
.
class
,
DxWfProcessInfoVO
.
class
);
settingDataMethod
.
invoke
(
SpringUtil
.
getBean
(
classType
),
expenditureContractVO
,
wfProcessInfoVO
);
settingDataMethod
.
invoke
(
SpringUtil
.
getBean
(
classType
),
expenditureContractVO
,
wfProcessInfoVO
);
outFilePath
=
outFilePath
+
expenditureContractVO
.
getSubTypeName
()
+
"\\"
+
expenditureContractVO
.
getNumber
()
+
"\\"
;
outFilePath
=
outFilePath
+
expenditureContractVO
.
getSubTypeName
()
+
"\\"
+
expenditureContractVO
.
getNumber
()
+
"\\"
;
sPath
=
sPath
+
expenditureContractVO
.
getSubTypeName
()
+
"\\"
+
expenditureContractVO
.
getNumber
();
sPath
=
sPath
+
expenditureContractVO
.
getSubTypeName
()
+
"\\"
+
expenditureContractVO
.
getNumber
();
}
else
if
(
obj
instanceof
ExtInComeContractVO
)
{
}
else
if
(
obj
instanceof
ExtInComeContractVO
)
{
ExtInComeContractVO
extInComeContractVO
=
(
ExtInComeContractVO
)
obj
;
ExtInComeContractVO
extInComeContractVO
=
(
ExtInComeContractVO
)
obj
;
Class
<?>
clazz
=
Class
.
forName
(
"com.yonde.dcs.plan.core.factory.
ContractUtils"
);
// TODO 改
Class
<?>
clazz
=
Class
.
forName
(
"com.yonde.dcs.plan.core.factory.
InComeContractUtils"
);
Method
settingDataMethod
=
clazz
.
getMethod
(
"settingData"
,
ExtInComeContractVO
.
class
,
DxWfProcessInfoVO
.
class
);
Method
settingDataMethod
=
clazz
.
getMethod
(
"settingData"
,
ExtInComeContractVO
.
class
,
DxWfProcessInfoVO
.
class
);
settingDataMethod
.
invoke
(
SpringUtil
.
getBean
(
classType
),
extInComeContractVO
,
wfProcessInfoVO
);
settingDataMethod
.
invoke
(
SpringUtil
.
getBean
(
classType
),
extInComeContractVO
,
wfProcessInfoVO
);
outFilePath
=
outFilePath
+
extInComeContractVO
.
getSubTypeName
()
+
"\\"
+
extInComeContractVO
.
getNumber
()
+
"\\"
;
outFilePath
=
outFilePath
+
extInComeContractVO
.
getSubTypeName
()
+
"\\"
+
extInComeContractVO
.
getNumber
()
+
"\\"
;
...
...
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