Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
ed69e2b5
Commit
ed69e2b5
authored
Jan 11, 2024
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移装告知 部分优化
parent
269d0da3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
49 deletions
+61
-49
JgTransferNoticeServiceImpl.java
...dule/jg/biz/service/impl/JgTransferNoticeServiceImpl.java
+61
-49
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgTransferNoticeServiceImpl.java
View file @
ed69e2b5
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.date.DateUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
...
...
@@ -379,13 +378,30 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
if
(
CollectionUtils
.
isEmpty
(
responseModel
.
getResult
()))
{
return
;
}
// 启动工作流并返回信息
List
<
WorkflowResultDto
>
workflowResultList
=
workFlowInfo
(
submitType
,
deviceList
);
List
<
JgTransferNotice
>
list
=
new
ArrayList
<>();
List
<
JgTransferNoticeEq
>
equipList
=
new
ArrayList
<>();
//业务数据组装等
businessData
(
submitType
,
reginParams
,
model
,
deviceList
,
responseModel
,
workflowResultList
,
list
,
equipList
);
jgTransferNoticeMapper
.
insertBatchSomeColumn
(
list
);
// 如果为保存并提交,则创建代办
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
buildTask
(
list
,
workflowResultList
);
}
List
<
JgTransferNoticeEq
>
jgRelationEquipList
=
equipList
.
stream
().
map
(
jgRelationEquip
->
{
List
<
JgTransferNotice
>
collect
=
list
.
stream
().
filter
(
JgTransferNotice
->
jgRelationEquip
.
getEquipTransferId
().
equals
(
JgTransferNotice
.
getApplyNo
())).
collect
(
Collectors
.
toList
());
Long
sequenceNbr
=
collect
.
get
(
0
).
getSequenceNbr
();
return
jgRelationEquip
.
setEquipTransferId
(
String
.
valueOf
(
sequenceNbr
));
}).
collect
(
Collectors
.
toList
());
jgTransferNoticeEqMapper
.
insertBatchSomeColumn
(
jgRelationEquipList
);
}
/**
* 组装业务数据
*/
private
void
businessData
(
String
submitType
,
ReginParams
reginParams
,
JgTransferNoticeDto
model
,
List
<
Map
<
String
,
Object
>>
deviceList
,
ResponseModel
<
List
<
String
>>
responseModel
,
List
<
WorkflowResultDto
>
workflowResultList
,
List
<
JgTransferNotice
>
list
,
List
<
JgTransferNoticeEq
>
equipList
)
{
deviceList
.
forEach
(
obj
->
{
JgTransferNoticeEq
jgRelationEquip
=
new
JgTransferNoticeEq
();
JgTransferNotice
dto
=
new
JgTransferNotice
();
...
...
@@ -419,20 +435,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
list
.
add
(
dto
);
equipList
.
add
(
jgRelationEquip
);
});
jgTransferNoticeMapper
.
insertBatchSomeColumn
(
list
);
// 如果为保存并提交,则创建代办
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
buildTask
(
list
,
workflowResultList
);
}
List
<
JgTransferNoticeEq
>
jgRelationEquipList
=
equipList
.
stream
().
map
(
jgRelationEquip
->
{
List
<
JgTransferNotice
>
collect
=
list
.
stream
().
filter
(
JgTransferNotice
->
jgRelationEquip
.
getEquipTransferId
().
equals
(
JgTransferNotice
.
getApplyNo
())).
collect
(
Collectors
.
toList
());
Long
sequenceNbr
=
collect
.
get
(
0
).
getSequenceNbr
();
return
jgRelationEquip
.
setEquipTransferId
(
String
.
valueOf
(
sequenceNbr
));
}).
collect
(
Collectors
.
toList
());
jgTransferNoticeEqMapper
.
insertBatchSomeColumn
(
jgRelationEquipList
);
}
...
...
@@ -465,6 +467,12 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
commonService
.
buildTaskModel
(
taskModelDtoList
);
}
/**
* 工作流启动并执行
* @param submitType 是否提交
* @param deviceList 设备信息
* @return 工作流返回相关数据
*/
private
List
<
WorkflowResultDto
>
workFlowInfo
(
String
submitType
,
List
<
Map
<
String
,
Object
>>
deviceList
)
{
if
(
SUBMIT_TYPE_FLOW
.
equals
(
submitType
))
{
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
...
...
@@ -477,9 +485,7 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
list
.
add
(
dto
);
});
actWorkflowBatchDTO
.
setProcess
(
list
);
System
.
out
.
println
(
"============== "
+
DateUtil
.
now
());
List
<
ProcessTaskDTO
>
processTaskDTOS
=
iCmWorkflowService
.
startBatch
(
actWorkflowBatchDTO
);
System
.
out
.
println
(
"============== "
+
DateUtil
.
now
());
// 组装工作流返回的数据
return
commonService
.
buildWorkFlowInfo
(
processTaskDTOS
);
}
...
...
@@ -487,6 +493,9 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
/**
* 页面数据转换
*/
private
void
convertField
(
JgTransferNoticeDto
model
)
{
// 处理图片
if
(!
ValidationUtil
.
isEmpty
(
model
.
getConstructionContractList
()))
{
...
...
@@ -495,7 +504,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
if
(!
ValidationUtil
.
isEmpty
(
model
.
getPowerOfAttorneyList
()))
{
model
.
setPowerOfAttorney
(
JSON
.
toJSONString
(
model
.
getPowerOfAttorneyList
()));
}
// 分割省市区字段
String
province
=
model
.
getProvince
();
if
(!
ObjectUtils
.
isEmpty
(
province
))
{
...
...
@@ -505,7 +513,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
model
.
setProvinceName
(
provinceList
[
1
]);
}
}
String
city
=
model
.
getCity
();
if
(!
ObjectUtils
.
isEmpty
(
city
))
{
String
[]
cityList
=
city
.
split
(
"_"
);
...
...
@@ -514,7 +521,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
model
.
setCityName
(
cityList
[
1
]);
}
}
String
county
=
model
.
getCounty
();
if
(!
ObjectUtils
.
isEmpty
(
county
))
{
String
[]
countyList
=
county
.
split
(
"_"
);
...
...
@@ -523,7 +529,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
model
.
setCountyName
(
countyList
[
1
]);
}
}
// 分割单位
String
useUnitId
=
model
.
getUseUnitCreditCode
();
if
(!
ObjectUtils
.
isEmpty
(
useUnitId
))
{
...
...
@@ -533,7 +538,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
model
.
setUseUnitName
(
useUnitList
[
1
]);
}
}
String
receiveOrgId
=
model
.
getReceiveOrgCode
();
if
(!
ObjectUtils
.
isEmpty
(
receiveOrgId
))
{
String
[]
receiveOrgIdList
=
receiveOrgId
.
split
(
"_"
);
...
...
@@ -588,26 +592,8 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
catch
(
ParseException
e
)
{
log
.
error
(
"日期转换失败:{}"
,
e
);
}
ProcessTaskDTO
processTaskDTO
=
new
ProcessTaskDTO
();
WorkflowResultDto
workflowResultDto
=
new
WorkflowResultDto
();
// 只调用执行API,返回下个节点信息,用于填充业务字段
//组装信息
TaskResultDTO
workDto
=
new
TaskResultDTO
();
workDto
.
setResultCode
(
"approvalStatus"
);
workDto
.
setTaskId
(
jgTransferNotice
.
getNextTaskId
());
HashMap
<
String
,
Object
>
commMap
=
new
HashMap
<>();
if
(
jgTransferNotice
.
getNoticeStatus
().
equals
(
"6614"
)
||
jgTransferNotice
.
getNoticeStatus
().
equals
(
"6615"
))
{
commMap
.
put
(
"approvalStatus"
,
"提交"
);
}
else
{
commMap
.
put
(
"approvalStatus"
,
op
);
}
workDto
.
setVariable
(
commMap
);
workDto
.
setComment
(
opinion
);
processTaskDTO
=
iCmWorkflowService
.
complete
(
jgTransferNotice
.
getNextTaskId
(),
workDto
);
// 提取节点等信息
workflowResultDto
=
commonService
.
buildWorkFlowInfo
(
Collections
.
singletonList
(
processTaskDTO
)).
get
(
0
);
// 执行工作流并返回组装好的工作流信息
WorkflowResultDto
workflowResultDto
=
getWorkflowResultDto
(
op
,
opinion
,
jgTransferNotice
);
jgTransferNotice
.
setPromoter
(
reginParams
.
getUserModel
().
getUserId
());
TaskV2Model
taskV2Model
=
new
TaskV2Model
();
...
...
@@ -620,10 +606,6 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
queryWrapper2
.
eq
(
RegistrationInfo:
:
getRecord
,
jgTransferNoticeEq
.
getEquId
());
RegistrationInfo
tzsJgRegistrationInfo
=
tzsJgRegistrationInfoMapper
.
selectOne
(
queryWrapper2
);
stringBuffer
.
append
(
tzsJgRegistrationInfo
.
getEquCategory
()).
append
(
jgTransferNotice
.
getCity
()).
append
(
ym
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"cityCode"
,
jgTransferNotice
.
getCity
());
map
.
put
(
"countyCode"
,
jgTransferNotice
.
getCounty
());
map
.
put
(
"equCategory"
,
tzsJgRegistrationInfo
.
getEquCategory
());
jgTransferNotice
.
setPromoter
(
""
);
jgTransferNotice
.
setHandleDate
(
new
Date
());
jgTransferNotice
.
setNoticeStatus
(
String
.
valueOf
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
()));
...
...
@@ -683,4 +665,33 @@ public class JgTransferNoticeServiceImpl extends BaseService<JgTransferNoticeDto
}
/**
* 执行工作流并返回组装好的工作流信息
* @param op 是否通过
* @param opinion 备注信息
* @param jgTransferNotice 业务信息
* @return 返回组装好的工作流信息
*/
private
WorkflowResultDto
getWorkflowResultDto
(
String
op
,
String
opinion
,
JgTransferNotice
jgTransferNotice
)
{
ProcessTaskDTO
processTaskDTO
=
new
ProcessTaskDTO
();
WorkflowResultDto
workflowResultDto
=
new
WorkflowResultDto
();
// 只调用执行API,返回下个节点信息,用于填充业务字段
//组装信息
TaskResultDTO
workDto
=
new
TaskResultDTO
();
workDto
.
setResultCode
(
"approvalStatus"
);
workDto
.
setTaskId
(
jgTransferNotice
.
getNextTaskId
());
HashMap
<
String
,
Object
>
commMap
=
new
HashMap
<>();
if
(
jgTransferNotice
.
getNoticeStatus
().
equals
(
"6614"
)
||
jgTransferNotice
.
getNoticeStatus
().
equals
(
"6615"
))
{
commMap
.
put
(
"approvalStatus"
,
"提交"
);
}
else
{
commMap
.
put
(
"approvalStatus"
,
op
);
}
workDto
.
setVariable
(
commMap
);
workDto
.
setComment
(
opinion
);
processTaskDTO
=
iCmWorkflowService
.
complete
(
jgTransferNotice
.
getNextTaskId
(),
workDto
);
// 提取节点等信息
workflowResultDto
=
commonService
.
buildWorkFlowInfo
(
Collections
.
singletonList
(
processTaskDTO
)).
get
(
0
);
return
workflowResultDto
;
}
}
\ No newline at end of file
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