Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-zx-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
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
Jobs
Commits
Open sidebar
项目统一框架
一体化_户用光伏项目代码
amos-boot-zx-biz
Commits
d86a5271
Commit
d86a5271
authored
Jun 27, 2024
by
hezhuozhi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
26854 【智信户用(管理端)】迁移工作台相关代码
parent
c05bc689
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
705 additions
and
526 deletions
+705
-526
FlowKeyTodoEnum.java
...ejoin/amos/boot/module/hygf/api/Enum/FlowKeyTodoEnum.java
+36
-0
WorkflowResultDto.java
...join/amos/boot/module/hygf/api/dto/WorkflowResultDto.java
+20
-5
BasicGridAcceptanceServiceImpl.java
...hygf/biz/service/impl/BasicGridAcceptanceServiceImpl.java
+100
-117
CommonServiceImpl.java
.../boot/module/hygf/biz/service/impl/CommonServiceImpl.java
+74
-89
FinancingInfoServiceImpl.java
...odule/hygf/biz/service/impl/FinancingInfoServiceImpl.java
+26
-60
SurveyInformationServiceImpl.java
...e/hygf/biz/service/impl/SurveyInformationServiceImpl.java
+59
-42
UnitInfoServiceImpl.java
...oot/module/hygf/biz/service/impl/UnitInfoServiceImpl.java
+210
-207
WorkFlowService.java
...os/boot/module/hygf/biz/service/impl/WorkFlowService.java
+147
-6
urlInfo.json
...boot-module-hygf-biz/src/main/resources/json/urlInfo.json
+33
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/Enum/FlowKeyTodoEnum.java
0 → 100644
View file @
d86a5271
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
Enum
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
* 此处是为了待办提供的流程状态 提供流程Key对应此时流程的状态名称
*/
@Getter
@AllArgsConstructor
public
enum
FlowKeyTodoEnum
{
TSRZ
(
1001
,
"待推送"
,
"AbarbeitungWaitPush"
,
"推送融资"
),
JXSZG
(
1002
,
"待整改"
,
"WaitAbarbeitung"
,
"经销商整改"
),
RZSH
(
1003
,
"待审核"
,
"FinancingAudit"
,
"融资审核"
),
XXFK
(
1004
,
"待放款"
,
"AuditPass"
,
"线下放款"
),
JXSGLYSH
(
1005
,
"待经销商管理员审核"
,
"jxs_03"
,
"经销商管理员审核"
),
;
private
final
int
code
;
private
final
String
dealName
;
private
final
String
flowNodeKey
;
private
final
String
flowNodeName
;
public
static
FlowKeyTodoEnum
getEumByFlowNodeKey
(
String
flowNodeKey
)
{
for
(
FlowKeyTodoEnum
statusEnum
:
FlowKeyTodoEnum
.
values
())
{
if
(
statusEnum
.
getFlowNodeKey
().
equals
(
flowNodeKey
))
{
return
statusEnum
;
}
}
return
null
;
}
}
\ No newline at end of file
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/WorkflowResultDto.java
View file @
d86a5271
...
...
@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.hygf.api.dto;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
WorkflowResultDto
{
...
...
@@ -11,11 +13,6 @@ public class WorkflowResultDto {
*/
String
instanceId
;
// /**
// * 执行人角色
// */
// String nextExecutorIds;
String
executorId
;
...
...
@@ -49,4 +46,22 @@ public class WorkflowResultDto {
String
nextNodeKey
;
/**
* 任务发起人id 不变 第一次提交的人
* 从业务表中 created_uesr_id
*/
private
String
startUserId
;
/**
* 任务发起人名称 不变
* 名字
*/
private
String
startUser
;
/**
* 任务发起人所在单位 不变
*/
private
String
startUserCompanyName
;
/**
* 任务发起人发起时间 不变
*/
private
Date
startDate
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/BasicGridAcceptanceServiceImpl.java
View file @
d86a5271
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.StringUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.*
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.*
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAcceptanceDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.WorkflowResultDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.*
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IBasicGridAcceptanceService
;
import
com.yeejoin.amos.boot.module.hygf.api.util.NumberUtil
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.utils.DateUtil
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.*
;
...
...
@@ -25,18 +29,18 @@ import java.util.*;
@Slf4j
@Service
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
class
BasicGridAcceptanceServiceImpl
extends
BaseService
<
BasicGridAcceptanceDto
,
BasicGridAcceptance
,
BasicGridAcceptanceMapper
>
implements
IBasicGridAcceptanceService
{
public
class
BasicGridAcceptanceServiceImpl
extends
BaseService
<
BasicGridAcceptanceDto
,
BasicGridAcceptance
,
BasicGridAcceptanceMapper
>
implements
IBasicGridAcceptanceService
{
private
final
String
OK
=
"0"
;
private
final
String
PASS
=
"5"
;
@Autowired
BasicGridAcceptanceMapper
basicGridAcceptanceMapper
;
@Autowired
HygfOnGridMapper
onGridMapper
;
@Autowired
PersonnelBusinessMapper
personnelBusinessMapper
;
@Autowired
WorkflowImpl
workflow
;
//
@Autowired
//
WorkflowImpl workflow;
@Autowired
AcceptanceCheckItemMapper
acceptanceCheckItemMapper
;
@Autowired
...
...
@@ -45,18 +49,14 @@ public class BasicGridAcceptanceServiceImpl
RegionalCompaniesMapper
regionalCompaniesMapper
;
@Autowired
WorkOrderMapper
workOrderMapper
;
@Autowired
PeasantHouseholdMapper
peasantHouseholdMapper
;
@Autowired
private
WorkFlowService
workFlowService
;
@Autowired
private
CommonServiceImpl
commonService
;
private
final
String
OK
=
"0"
;
private
final
String
PASS
=
"5"
;
public
Page
<
BasicGridAcceptanceDto
>
selectPage
(
Long
regionCompanyId
,
Long
amosDealerId
,
int
current
,
int
size
,
String
projectAddress
,
String
powerStationCode
,
String
ownersName
,
String
gridStatus
,
String
gridConnectionTime
,
String
formType
)
throws
Exception
{
public
Page
<
BasicGridAcceptanceDto
>
selectPage
(
Long
regionCompanyId
,
Long
amosDealerId
,
int
current
,
int
size
,
String
projectAddress
,
String
powerStationCode
,
String
ownersName
,
String
gridStatus
,
String
gridConnectionTime
,
String
formType
)
throws
Exception
{
PageHelper
.
startPage
(
current
,
size
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Date
date
=
null
;
...
...
@@ -94,35 +94,47 @@ public class BasicGridAcceptanceServiceImpl
@GlobalTransactional
public
HygfOnGrid
saveAndCommit
(
HygfOnGrid
grid
,
String
userId
)
{
BasicGridAcceptance
basicGridAcceptance
=
basicGridAcceptanceMapper
.
selectOne
(
new
LambdaQueryWrapper
<
BasicGridAcceptance
>()
.
eq
(
BasicGridAcceptance:
:
getWorkOrderPowerStationId
,
grid
.
getWorkOrderPowerStationId
()));
BasicGridAcceptance
basicGridAcceptance
=
basicGridAcceptanceMapper
.
selectOne
(
new
LambdaQueryWrapper
<
BasicGridAcceptance
>().
eq
(
BasicGridAcceptance:
:
getWorkOrderPowerStationId
,
grid
.
getWorkOrderPowerStationId
()));
basicGridAcceptance
.
setGridStatus
(
GridStatusEnum
.
DSH
.
getCode
());
List
<
ProcessTaskDTO
>
processTaskDTOS
=
new
ArrayList
<>();
if
(
grid
.
getType
()
!=
null
&&
"1"
.
equals
(
grid
.
getType
()))
{
// 执行工作流
StandardDto
standardDto
=
new
StandardDto
();
standardDto
.
setTaskId
(
basicGridAcceptance
.
getNextTaskId
());
workflow
.
standard
(
basicGridAcceptance
,
standardDto
,
userId
);
// // 执行工作流
// StandardDto standardDto = new StandardDto();
// standardDto.setTaskId(basicGridAcceptance.getNextTaskId());
// workflow.standard(basicGridAcceptance, standardDto, userId);
//执行流程
TaskResultDTO
task
=
new
TaskResultDTO
();
task
.
setTaskId
(
basicGridAcceptance
.
getNextTaskId
());
ProcessTaskDTO
processTaskDTO
=
workFlowService
.
standard
(
basicGridAcceptance
,
task
,
userId
);
processTaskDTOS
.
add
(
processTaskDTO
);
}
else
{
// 调用工作流执行第一个节点
ProcessDto
processDto
=
new
ProcessDto
();
processDto
.
setProcessDefinitionKey
(
"hygf_bwys"
);
processDto
.
setBusinessKey
(
String
.
valueOf
(
basicGridAcceptance
.
getSequenceNbr
()));
StartProcessDto
startProcessDto
=
new
StartProcessDto
();
List
<
ProcessDto
>
process
=
new
ArrayList
<>();
process
.
add
(
processDto
);
startProcessDto
.
setProcess
(
process
);
workflow
.
startProcess
(
basicGridAcceptance
,
startProcessDto
,
userId
);
// ProcessDto processDto = new ProcessDto();
// processDto.setProcessDefinitionKey("hygf_bwys");
// processDto.setBusinessKey(String.valueOf(basicGridAcceptance.getSequenceNbr()));
// StartProcessDto startProcessDto = new StartProcessDto();
// List<ProcessDto> process = new ArrayList<>();
// process.add(processDto);
// startProcessDto.setProcess(process);
// workflow.startProcess(basicGridAcceptance, startProcessDto, userId);
//开启工作流 并执行一步
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
BusinessTypeEnum
.
HYGF_BWYS
.
getCode
());
dto
.
setBusinessKey
(
String
.
valueOf
(
basicGridAcceptance
.
getSequenceNbr
()));
dto
.
setCompleteFirstTask
(
true
);
list
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
list
);
processTaskDTOS
=
workFlowService
.
startBatch
(
actWorkflowBatchDTO
);
basicGridAcceptance
=
workFlowService
.
getBasicGridAcceptance
(
basicGridAcceptance
,
processTaskDTOS
,
userId
);
// 线上验收
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
并网中
.
getCode
());
long
idsk
=
basicGridAcceptance
.
getPeasantHouseholdId
();
up
.
eq
(
PeasantHousehold:
:
getSequenceNbr
,
idsk
);
peasantHouseholdMapper
.
update
(
null
,
up
);
}
if
(
grid
.
getSequenceNbr
()
!=
null
)
{
onGridMapper
.
updateById
(
grid
);
...
...
@@ -130,41 +142,13 @@ public class BasicGridAcceptanceServiceImpl
onGridMapper
.
insert
(
grid
);
}
basicGridAcceptanceMapper
.
updateById
(
basicGridAcceptance
);
//发起待办
// commonService.buildTaskModel(buildBWYSTaskModel(grid, basicGridAcceptance));
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
processTaskDTOS
);
commonService
.
buildTaskModel
(
commonService
.
buildTaskModelDto
(
basicGridAcceptance
,
workflowResultDtos
.
get
(
0
),
BusinessTypeEnum
.
HYGF_BWYS
));
return
grid
;
}
private
List
<
TaskModelDto
>
buildBWYSTaskModel
(
HygfOnGrid
grid
,
BasicGridAcceptance
basicGridAcceptance
)
{
List
<
TaskModelDto
>
taskModelDtoList
=
new
ArrayList
<>();
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
taskModelDto
.
setFlowCode
(
basicGridAcceptance
.
getNextTaskId
());
taskModelDto
.
setFlowCreateDate
(
new
Date
());
taskModelDto
.
setFlowStatus
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
taskModelDto
.
setFlowStatusLabel
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
taskModelDto
.
setPageType
(
null
);
taskModelDto
.
setExecuteUserIds
(
basicGridAcceptance
.
getNextExecuteUserIds
());
taskModelDto
.
setModel
(
grid
);
taskModelDto
.
setRelationId
(
basicGridAcceptance
.
getInstanceId
());
taskModelDto
.
setRoutePath
(
null
);
taskModelDto
.
setStartUserId
(
basicGridAcceptance
.
getRecUserId
());
taskModelDto
.
setStartUser
(
basicGridAcceptance
.
getRecUserName
());
taskModelDto
.
setStartDate
(
basicGridAcceptance
.
getRecDate
());
taskModelDto
.
setStartUserCompanyName
(
null
);
taskModelDto
.
setTaskName
(
basicGridAcceptance
.
getNextNodeName
());
taskModelDto
.
setTaskCode
(
String
.
valueOf
(
basicGridAcceptance
.
getWorkOrderId
()));
taskModelDto
.
setTaskType
(
BusinessTypeEnum
.
HYGF_BWYS
.
getCode
());
taskModelDto
.
setTaskTypeLabel
(
BusinessTypeEnum
.
HYGF_BWYS
.
getName
());
taskModelDto
.
setTaskStatus
(
TaskStatusEnum
.
UNDERWAY
.
getValue
());
taskModelDto
.
setTaskStatusLabel
(
TaskStatusEnum
.
UNDERWAY
.
getName
());
// taskModelDto.setTaskDesc();
// taskModelDto.setTaskContent();
taskModelDto
.
setNextExecuteUser
(
basicGridAcceptance
.
getNextExecutorIds
());
taskModelDtoList
.
add
(
taskModelDto
);
return
taskModelDtoList
;
}
public
HygfOnGrid
modifyEntity
(
HygfOnGrid
grid
)
{
onGridMapper
.
updateById
(
grid
);
...
...
@@ -180,9 +164,7 @@ public class BasicGridAcceptanceServiceImpl
for
(
HygfOnGrid
x
:
grids
)
{
x
.
setIsDelete
(
true
);
int
num
=
onGridMapper
.
updateById
(
x
);
BasicGridAcceptance
acceptance
=
basicGridAcceptanceMapper
.
selectOne
(
new
LambdaQueryWrapper
<
BasicGridAcceptance
>()
.
eq
(
BasicGridAcceptance:
:
getWorkOrderPowerStationId
,
x
.
getWorkOrderPowerStationId
()));
BasicGridAcceptance
acceptance
=
basicGridAcceptanceMapper
.
selectOne
(
new
LambdaQueryWrapper
<
BasicGridAcceptance
>().
eq
(
BasicGridAcceptance:
:
getWorkOrderPowerStationId
,
x
.
getWorkOrderPowerStationId
()));
acceptance
.
setIsDelete
(
true
);
int
count
=
basicGridAcceptanceMapper
.
updateById
(
acceptance
);
if
(
0
==
num
||
0
==
count
)
{
...
...
@@ -216,8 +198,7 @@ public class BasicGridAcceptanceServiceImpl
}
else
{
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
}
}
else
{
...
...
@@ -226,17 +207,12 @@ public class BasicGridAcceptanceServiceImpl
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
}
// 投融/法务/工程/线下验收审核不通过
else
if
(
BasicGridAcceptancEnum
.
管理端投融审核
.
getCode
().
equals
(
nextNodeKey
)
||
BasicGridAcceptancEnum
.
管理端法务审核
.
getCode
().
equals
(
nextNodeKey
)
||
BasicGridAcceptancEnum
.
管理端工程审核
.
getCode
().
equals
(
nextNodeKey
)
||
BasicGridAcceptancEnum
.
管理端工程线下验
.
getCode
().
equals
(
nextNodeKey
))
{
else
if
(
BasicGridAcceptancEnum
.
管理端投融审核
.
getCode
().
equals
(
nextNodeKey
)
||
BasicGridAcceptancEnum
.
管理端法务审核
.
getCode
().
equals
(
nextNodeKey
)
||
BasicGridAcceptancEnum
.
管理端工程审核
.
getCode
().
equals
(
nextNodeKey
)
||
BasicGridAcceptancEnum
.
管理端工程线下验
.
getCode
().
equals
(
nextNodeKey
))
{
AcceptanceRectificationOrder
rectificationOrder
=
new
AcceptanceRectificationOrder
();
try
{
WorkOrder
workOrder
=
workOrderMapper
.
selectById
(
basicGridAcceptanc
.
getWorkOrderId
());
RegionalCompanies
regionalCompanies
=
regionalCompaniesMapper
.
selectRegionName
(
workOrder
.
getRegionCompanyId
());
String
code
=
NumberUtil
.
getCode
(
CodeEnum
.
整改单
.
getCode
(),
regionalCompanies
.
getCompanyCode
(),
regionalCompanies
.
getRegionalAddress
());
RegionalCompanies
regionalCompanies
=
regionalCompaniesMapper
.
selectRegionName
(
workOrder
.
getRegionCompanyId
());
String
code
=
NumberUtil
.
getCode
(
CodeEnum
.
整改单
.
getCode
(),
regionalCompanies
.
getCompanyCode
(),
regionalCompanies
.
getRegionalAddress
());
rectificationOrder
.
setRectificationOrderCode
(
code
);
rectificationOrder
.
setWorkOrderId
(
basicGridAcceptanc
.
getWorkOrderId
());
rectificationOrder
.
setWorkOrderPowerStationId
(
basicGridAcceptanc
.
getWorkOrderPowerStationId
());
...
...
@@ -247,11 +223,9 @@ public class BasicGridAcceptanceServiceImpl
throw
new
RuntimeException
(
e
);
}
acceptanceRectificationOrderMapper
.
insert
(
rectificationOrder
);
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
}
else
{
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
}
}
...
...
@@ -262,19 +236,30 @@ public class BasicGridAcceptanceServiceImpl
acceptanceCheckItemMapper
.
insert
(
dto
);
}
// 执行工作流
StandardDto
standardDto
=
new
StandardDto
();
standardDto
.
setComment
(
dto
.
getComment
());
standardDto
.
setResult
(
dto
.
getApprovalStatus
());
standardDto
.
setTaskId
(
basicGridAcceptanc
.
getNextTaskId
());
VariableDto
variable
=
new
VariableDto
();
variable
.
setApprovalStatus
(
dto
.
getApprovalStatus
());
variable
.
setComment
(
dto
.
getComment
());
variable
.
setOperationTime
(
dto
.
getOperationTime
());
variable
.
setOperator
(
dto
.
getOperator
());
standardDto
.
setVariable
(
variable
);
BasicGridAcceptance
workBasicGridAcceptance
=
workflow
.
standard
(
basicGridAcceptanc
,
standardDto
,
userId
);
if
(
workBasicGridAcceptance
.
getNextNodeKey
().
equals
(
BasicGridAcceptancEnum
.
管理端工程线下验
.
getCode
()))
{
// StandardDto standardDto = new StandardDto();
// standardDto.setComment(dto.getComment());
// standardDto.setResult(dto.getApprovalStatus());
// standardDto.setTaskId(basicGridAcceptanc.getNextTaskId());
// VariableDto variable = new VariableDto();
// variable.setApprovalStatus(dto.getApprovalStatus());
// variable.setComment(dto.getComment());
// variable.setOperationTime(dto.getOperationTime());
// variable.setOperator(dto.getOperator());
// standardDto.setVariable(variable);
// BasicGridAcceptance workBasicGridAcceptance = workflow.standard(basicGridAcceptanc, standardDto, userId);
// 执行流程
TaskResultDTO
taskResultDTO
=
new
TaskResultDTO
();
taskResultDTO
.
setComment
(
dto
.
getComment
());
taskResultDTO
.
setResult
(
dto
.
getApprovalStatus
());
taskResultDTO
.
setTaskId
(
basicGridAcceptanc
.
getNextTaskId
());
HashMap
<
String
,
Object
>
variableMap
=
new
HashMap
<>();
variableMap
.
put
(
"approvalStatus"
,
dto
.
getApprovalStatus
());
variableMap
.
put
(
"comment"
,
dto
.
getComment
());
variableMap
.
put
(
"operationTime"
,
dto
.
getOperationTime
());
variableMap
.
put
(
"operator"
,
dto
.
getOperator
());
taskResultDTO
.
setVariable
(
variableMap
);
ProcessTaskDTO
processTaskDTO
=
workFlowService
.
standard
(
basicGridAcceptanc
,
taskResultDTO
,
userId
);
if
(
basicGridAcceptanc
.
getNextNodeKey
().
equals
(
BasicGridAcceptancEnum
.
管理端工程线下验
.
getCode
()))
{
// 线下验收
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
线下验收
.
getCode
());
...
...
@@ -284,10 +269,10 @@ public class BasicGridAcceptanceServiceImpl
}
// 验收完成
System
.
out
.
println
(
"验收完成==============================="
+
workBasicGridAcceptance
.
getNextTaskId
());
System
.
out
.
println
(
"验收完成888888==============================="
+
workBasicGridAcceptance
.
getAcceptanceStatus
());
System
.
out
.
println
(
"验收完成==============================="
+
basicGridAcceptanc
.
getNextTaskId
());
System
.
out
.
println
(
"验收完成888888==============================="
+
basicGridAcceptanc
.
getAcceptanceStatus
());
if
(
"10"
.
equals
(
workBasicGridAcceptance
.
getAcceptanceStatus
()))
{
if
(
"10"
.
equals
(
basicGridAcceptanc
.
getAcceptanceStatus
()))
{
// 更新状态
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
验收完成
.
getCode
());
...
...
@@ -297,27 +282,25 @@ public class BasicGridAcceptanceServiceImpl
}
basicGridAcceptanceMapper
.
updateById
(
workBasicGridAcceptance
);
basicGridAcceptanceMapper
.
updateById
(
basicGridAcceptanc
);
//更新待办
// commonService.updateTaskModelNew(buildBWYSUpdateTaskModel(basicGridAcceptanc,dto
));
updateBasicGridAcceptanceTask
(
basicGridAcceptanc
,
workFlowService
.
buildWorkFlowInfo
(
CollectionUtil
.
newArrayList
(
processTaskDTO
)).
get
(
0
));
}
private
Map
<
String
,
Object
>
buildBWYSUpdateTaskModel
(
BasicGridAcceptance
basicGridAcceptance
,
AcceptanceCheckItem
acceptanceCheckItem
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
OK
.
equals
(
acceptanceCheckItem
.
getApprovalStatus
()))
{
map
.
put
(
"flowStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
map
.
put
(
"flowStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
map
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
map
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
}
else
{
map
.
put
(
"flowStatus"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
map
.
put
(
"flowStatusLabel"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
map
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
map
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
}
map
.
put
(
"model"
,
acceptanceCheckItem
);
map
.
put
(
"relationId"
,
basicGridAcceptance
.
getInstanceId
());
return
map
;
/**
* 此处先更新完成待办然后在新增待办
* @param basicGridAcceptance
* @param workflowResultDto
*/
private
void
updateBasicGridAcceptanceTask
(
BasicGridAcceptance
basicGridAcceptance
,
WorkflowResultDto
workflowResultDto
)
{
Map
<
String
,
Object
>
updateTaskParam
=
new
HashMap
<>();
updateTaskParam
.
put
(
"flowStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
updateTaskParam
.
put
(
"flowStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
updateTaskParam
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
updateTaskParam
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
updateTaskParam
.
put
(
"model"
,
basicGridAcceptance
);
updateTaskParam
.
put
(
"relationId"
,
workflowResultDto
.
getInstanceId
());
commonService
.
updateTaskModel
(
updateTaskParam
);
commonService
.
buildTaskModel
((
commonService
.
buildTaskModelDto
(
basicGridAcceptance
,
workflowResultDto
,
BusinessTypeEnum
.
HYGF_BWYS
)));
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/CommonServiceImpl.java
View file @
d86a5271
...
...
@@ -2,16 +2,20 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.FlowKeyTodoEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.TaskModelDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.WorkflowResultDto
;
import
com.yeejoin.amos.boot.module.hygf.api.util.JsonUtils
;
import
com.yeejoin.amos.boot.module.hygf.biz.feign.TaskV2FeignService
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.feign.systemctl.model.TaskV2Model
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -43,6 +47,8 @@ public class CommonServiceImpl {
private
RedisUtils
redisUtils
;
@Value
(
"classpath:/json/urlInfo.json"
)
private
Resource
urlInfo
;
@Autowired
private
AmosRequestContext
amosRequestContext
;
private
static
String
toQueryParams2
(
JSONObject
jsonObject
)
{
StringBuilder
sb
=
new
StringBuilder
();
...
...
@@ -54,9 +60,7 @@ public class CommonServiceImpl {
}
try
{
if
(
value
!=
null
&&
!
""
.
equals
(
value
))
{
sb
.
append
(
URLEncoder
.
encode
(
key
,
"UTF-8"
))
.
append
(
'='
)
.
append
(
URLEncoder
.
encode
(
value
.
toString
(),
"UTF-8"
));
sb
.
append
(
URLEncoder
.
encode
(
key
,
"UTF-8"
)).
append
(
'='
).
append
(
URLEncoder
.
encode
(
value
.
toString
(),
"UTF-8"
));
}
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
...
...
@@ -65,6 +69,38 @@ public class CommonServiceImpl {
return
sb
.
toString
();
}
public
List
<
TaskModelDto
>
buildTaskModelDto
(
Object
model
,
WorkflowResultDto
workflowResultDto
,
BusinessTypeEnum
businessType
)
{
List
<
TaskModelDto
>
taskModelDtoList
=
new
ArrayList
<>();
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
FlowKeyTodoEnum
flowKeyTodoEnum
=
FlowKeyTodoEnum
.
getEumByFlowNodeKey
(
workflowResultDto
.
getNextNodeKey
());
if
(!
Objects
.
isNull
(
flowKeyTodoEnum
))
{
taskModelDto
.
setFlowStatus
(
flowKeyTodoEnum
.
getCode
());
taskModelDto
.
setFlowStatusLabel
(
flowKeyTodoEnum
.
getDealName
());
}
taskModelDto
.
setRoutePath
(
null
);
taskModelDto
.
setFlowCode
(
workflowResultDto
.
getNextTaskId
());
taskModelDto
.
setFlowCreateDate
(
new
Date
());
taskModelDto
.
setPageType
(
null
);
taskModelDto
.
setExecuteUserIds
(
workflowResultDto
.
getNextExecuteUserIds
());
taskModelDto
.
setModel
(
model
);
taskModelDto
.
setRelationId
(
workflowResultDto
.
getInstanceId
());
taskModelDto
.
setStartUserId
(
workflowResultDto
.
getStartUserId
());
taskModelDto
.
setStartUser
(
workflowResultDto
.
getStartUser
());
taskModelDto
.
setStartDate
(
workflowResultDto
.
getStartDate
());
taskModelDto
.
setStartUserCompanyName
(
workflowResultDto
.
getStartUserCompanyName
());
taskModelDto
.
setTaskName
(
workflowResultDto
.
getNextNodeName
());
taskModelDto
.
setTaskCode
(
workflowResultDto
.
getNextNodeKey
());
taskModelDto
.
setTaskType
(
businessType
.
getCode
());
taskModelDto
.
setTaskTypeLabel
(
businessType
.
getName
());
taskModelDto
.
setTaskStatus
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
taskModelDto
.
setTaskStatusLabel
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
// taskModelDto.setTaskDesc();
// taskModelDto.setTaskContent();
taskModelDto
.
setNextExecuteUser
(
workflowResultDto
.
getNextExecutorIds
());
taskModelDtoList
.
add
(
taskModelDto
);
return
taskModelDtoList
;
}
public
void
deleteTaskModel
(
String
id
)
{
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
id
).
getResult
();
if
(!
result
.
isEmpty
())
{
...
...
@@ -78,20 +114,27 @@ public class CommonServiceImpl {
* 待办新增接口
**/
public
void
buildTaskModel
(
List
<
TaskModelDto
>
list
)
{
//执行人为空使用系统机器人账号
if
(
StrUtil
.
isEmpty
(
RequestContext
.
getExeUserId
()))
{
RequestContext
.
setExeUserId
(
amosRequestContext
.
getUserId
());
RequestContext
.
setToken
(
amosRequestContext
.
getToken
());
RequestContext
.
setAgencyCode
(
"JXIOP"
);
}
List
<
TaskV2Model
>
taskV2Models
=
new
ArrayList
<>();
for
(
TaskModelDto
obj
:
list
)
{
// 判断是否是暂存 新增若无下一节点执行人即为暂存
boolean
flag
=
StringUtils
.
isEmpty
(
obj
.
getNextExecuteUser
());
if
(
flag
)
{
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
obj
.
getRelationId
()).
getResult
();
if
(
CollectionUtil
.
isNotEmpty
(
result
)
&&
!
result
.
isEmpty
()
)
{
if
(
CollectionUtil
.
isNotEmpty
(
result
))
{
break
;
}
}
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
//处理开始流程人员为空的问题
dealStartUser
(
obj
);
TaskV2Model
model
=
new
TaskV2Model
();
BeanUtil
.
copyProperties
(
obj
,
model
);
String
urlParams
=
""
;
String
urlParams
=
"
&formType=edit
"
;
try
{
urlParams
=
"&"
+
toQueryParams
(
obj
.
getModel
());
}
catch
(
UnsupportedEncodingException
e
)
{
...
...
@@ -99,19 +142,18 @@ public class CommonServiceImpl {
}
List
<
Map
>
urlList
=
JsonUtils
.
getResourceList
(
urlInfo
);
for
(
Map
map
:
urlList
)
{
// 获取暂存的可编辑页面url
if
(
flag
&&
map
.
get
(
"type"
).
equals
(
obj
.
getTaskType
())
&&
map
.
get
(
"pageType"
).
equals
(
"draft"
))
{
if
(
map
.
get
(
"type"
).
equals
(
obj
.
getTaskCode
()))
{
model
.
setRoutePath
(
map
.
get
(
"url"
).
toString
()
+
urlParams
);
break
;
}
// 其他逻辑均按详情页面获取
else
if
(
map
.
get
(
"type"
).
equals
(
obj
.
getTaskType
())
&&
map
.
get
(
"pageType"
).
equals
(
null
==
obj
.
getPageType
()
?
"look"
:
obj
.
getPageType
()))
{
model
.
setRoutePath
(
map
.
get
(
"url"
).
toString
().
replace
(
"{roleIds}"
,
obj
.
getNextExecuteUser
())
+
urlParams
+
"&nextExecuteUserIds="
+
model
.
getExecuteUserIds
());
break
;
}
}
// 是true则为暂存 除公共部分统一处理
if
(
flag
)
{
Object
redisUserInfo
=
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
()));
if
(
Objects
.
isNull
(
redisUserInfo
))
{
break
;
}
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUserInfo
.
toString
(),
ReginParams
.
class
);
model
.
setFlowStatus
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getCode
());
model
.
setFlowStatusLabel
(
FlowStatusEnum
.
TO_BE_SUBMITTED
.
getName
());
model
.
setStartUserId
(
RequestContext
.
getExeUserId
());
...
...
@@ -142,6 +184,22 @@ public class CommonServiceImpl {
taskV2FeignService
.
batchAdd
(
taskV2Models
);
}
private
void
dealStartUser
(
TaskModelDto
obj
)
{
if
(
StrUtil
.
isEmpty
(
obj
.
getStartUser
()))
{
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
obj
.
getRelationId
()).
getResult
();
if
(
CollectionUtil
.
isNotEmpty
(
result
))
{
List
<
TaskV2Model
>
collect
=
result
.
stream
().
filter
(
item
->
item
.
getStartUser
()
!=
null
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtil
.
isNotEmpty
(
collect
))
{
TaskV2Model
taskV2Model
=
collect
.
get
(
0
);
obj
.
setStartUserId
(
taskV2Model
.
getStartUserId
());
obj
.
setStartUser
(
taskV2Model
.
getStartUser
());
obj
.
setStartDate
(
taskV2Model
.
getStartDate
());
obj
.
setStartUserCompanyName
(
taskV2Model
.
getStartUserCompanyName
());
}
}
}
}
/**
* 待办编辑接口
* 参数
...
...
@@ -165,16 +223,9 @@ public class CommonServiceImpl {
collect
.
get
(
0
).
setTaskStatusLabel
(
params
.
get
(
"taskStatusLabel"
).
toString
());
collect
.
get
(
0
).
setEndUserId
(
exeUserId
);
collect
.
get
(
0
).
setEndDate
(
new
Date
());
// String[] roleIds = model.getRoutePath().split("roleIds=");
// String[] userIds = roleIds[1].split("&userId");
// String url = roleIds[0]+"roleIds="+"55555"+"&userId"+ userIds[1];
// String tarUrl = url.replaceFirst("&executeUserIds=", "");
// tarUrl+"&executeUserIds="
// model.setRoutePath( roleIds[0]+"roleIds="+"55555"+"&userId"+userIds[1]);
// 当流程完成时将所有待办状态统一修改为已完成
String
urlParams
=
"&formType=detail"
;
if
(
collect
.
get
(
0
).
getFlowStatusLabel
().
equals
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()))
{
String
urlParams
=
""
;
try
{
urlParams
=
"&"
+
toQueryParams
(
params
.
get
(
"model"
));
}
catch
(
UnsupportedEncodingException
e
)
{
...
...
@@ -182,8 +233,8 @@ public class CommonServiceImpl {
}
List
<
Map
>
urlList
=
JsonUtils
.
getResourceList
(
urlInfo
);
for
(
Map
map
:
urlList
)
{
if
(
map
.
get
(
"type"
).
equals
(
collect
.
get
(
0
).
getTask
Type
())
&&
map
.
get
(
"pageType"
).
equals
(
"look"
))
{
urlParams
=
map
.
get
(
"url"
).
toString
()
.
replace
(
"{roleIds}"
,
""
)
+
urlParams
+
"&taskStatus"
+
collect
.
get
(
0
).
getTaskStatus
()
+
"&nextExecuteUserIds="
;
if
(
map
.
get
(
"type"
).
equals
(
collect
.
get
(
0
).
getTask
Code
()
))
{
urlParams
=
map
.
get
(
"url"
).
toString
()
+
urlParams
;
break
;
}
}
...
...
@@ -209,72 +260,6 @@ public class CommonServiceImpl {
return
collect
.
get
(
0
);
}
/**
* 待办编辑接口 【如果没有代办直接返回空,业务判断】 ---- 在用,误删
* 参数
* taskStatus
* taskStatusLabel 操作名称 1驳回 2通过 3重新提交
* flowStatusLabel 任务状态枚举code
* 流程实例id instanceId
* flowCode 任务id
**/
public
TaskV2Model
updateTaskModelNew
(
Map
<
String
,
Object
>
params
)
{
String
exeUserId
=
RequestContext
.
getExeUserId
();
List
<
TaskV2Model
>
result
=
taskV2FeignService
.
selectListByRelationId
(
params
.
get
(
"relationId"
).
toString
()).
getResult
();
// TaskV2Model model = result.stream().filter(e->e.getFlowCode().equals(params.get("flowCode").toString())).sorted((r1, r2) -> r2.getSequenceNbr().compareTo(r2.getSequenceNbr())) // 按时间降序排序
// .findFirst()
// .orElse(null);
List
<
TaskV2Model
>
collect
=
result
.
stream
().
sorted
((
r1
,
r2
)
->
r2
.
getSequenceNbr
().
compareTo
(
r1
.
getSequenceNbr
())).
collect
(
Collectors
.
toList
());
if
(
null
==
collect
||
collect
.
size
()
==
0
)
{
TaskV2Model
model
=
new
TaskV2Model
();
model
.
setFlowStatus
(
Integer
.
valueOf
(
params
.
get
(
"flowStatus"
).
toString
()));
model
.
setFlowStatusLabel
(
params
.
get
(
"flowStatusLabel"
).
toString
());
model
.
setTaskStatus
(
Integer
.
valueOf
(
params
.
get
(
"taskStatus"
).
toString
()));
model
.
setTaskStatusLabel
(
params
.
get
(
"taskStatusLabel"
).
toString
());
return
model
;
}
collect
.
get
(
0
).
setFlowStatus
(
Integer
.
valueOf
(
params
.
get
(
"flowStatus"
).
toString
()));
collect
.
get
(
0
).
setFlowStatusLabel
(
params
.
get
(
"flowStatusLabel"
).
toString
());
collect
.
get
(
0
).
setTaskStatus
(
Integer
.
valueOf
(
params
.
get
(
"taskStatus"
).
toString
()));
collect
.
get
(
0
).
setTaskStatusLabel
(
params
.
get
(
"taskStatusLabel"
).
toString
());
collect
.
get
(
0
).
setEndUserId
(
exeUserId
);
collect
.
get
(
0
).
setEndDate
(
new
Date
());
// 当流程完成时将所有待办状态统一修改为已完成
if
(
collect
.
get
(
0
).
getFlowStatusLabel
().
equals
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()))
{
String
urlParams
=
""
;
try
{
urlParams
=
"&"
+
toQueryParams
(
params
.
get
(
"model"
));
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
List
<
Map
>
urlList
=
JsonUtils
.
getResourceList
(
urlInfo
);
for
(
Map
map
:
urlList
)
{
if
(
map
.
get
(
"type"
).
equals
(
collect
.
get
(
0
).
getTaskType
())
&&
map
.
get
(
"pageType"
).
equals
(
"look"
))
{
urlParams
=
map
.
get
(
"url"
).
toString
().
replace
(
"{roleIds}"
,
""
)
+
urlParams
+
"&nextExecuteUserIds="
;
break
;
}
}
collect
.
get
(
0
).
setRoutePath
(
urlParams
);
for
(
TaskV2Model
taskV2Model
:
collect
)
{
taskV2Model
.
setTaskStatusLabel
((
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
taskV2Model
.
setTaskStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
taskV2Model
.
setFlowStatusLabel
((
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
()));
taskV2Model
.
setFlowStatus
(
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
}
taskV2FeignService
.
batchUpdate
(
collect
);
}
else
{
collect
.
get
(
0
).
setRoutePath
(
collect
.
get
(
0
).
getRoutePath
().
replace
(
"roleIds="
,
"roleIds=55555&fq="
));
taskV2FeignService
.
update
(
collect
.
get
(
0
),
collect
.
get
(
0
).
getSequenceNbr
());
}
collect
.
get
(
0
).
setEndUserId
(
null
);
collect
.
get
(
0
).
setTaskStatus
(
null
);
collect
.
get
(
0
).
setEndDate
(
null
);
collect
.
get
(
0
).
setSequenceNbr
(
null
);
collect
.
get
(
0
).
setCreateDate
(
new
Date
());
collect
.
get
(
0
).
setStartDate
(
new
Date
());
return
collect
.
get
(
0
);
}
/**
* 待办 撤回
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/FinancingInfoServiceImpl.java
View file @
d86a5271
...
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.core.toolkit.ObjectUtils
;
...
...
@@ -17,11 +16,9 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.FinancingAuditEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.TaskStatusEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserLimits
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.FinancingAuditingDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.FinancingInfoDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.TaskModelDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.WorkflowResultDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.FinancingAuditing
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.FinancingInfo
;
...
...
@@ -37,7 +34,6 @@ import io.seata.spring.annotation.GlobalTransactional;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
...
...
@@ -51,7 +47,6 @@ import java.util.*;
*/
@Service
public
class
FinancingInfoServiceImpl
extends
BaseService
<
FinancingInfoDto
,
FinancingInfo
,
FinancingInfoMapper
>
implements
IFinancingInfoService
{
private
static
String
PROCESSKEY
=
"StationFinancing"
;
@Autowired
RedisUtils
redisUtils
;
/**
...
...
@@ -61,8 +56,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
private
FinancingInfoMapper
financingInfoMapper
;
@Autowired
private
WorkFlowService
workFlowService
;
@Autowired
private
WorkflowImpl
workflow
;
//
@Autowired
//
private WorkflowImpl workflow;
@Autowired
private
FinancingAuditingServiceImpl
financingAuditingService
;
@Autowired
...
...
@@ -145,7 +140,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
PROCESSKEY
);
dto
.
setProcessDefinitionKey
(
BusinessTypeEnum
.
HYGF_DZTRRZ
.
getCode
()
);
Date
date
=
new
Date
();
dto
.
setBusinessKey
(
String
.
valueOf
(
date
.
getTime
()));
dto
.
setCompleteFirstTask
(
true
);
...
...
@@ -164,44 +159,16 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
financingAuditingDto
.
setPromoter
(
RequestContext
.
getExeUserId
());
financingAuditingService
.
createWithModel
(
financingAuditingDto
);
//发起待办
// commonService.buildTaskModel(buildDZTRZTaskModel(model, workflowResultDto, date));
FinancingInfo
newFinancingInfo
=
new
FinancingInfo
();
BeanUtils
.
copyProperties
(
model
,
newFinancingInfo
);
newFinancingInfo
.
setStatus
(
FinancingAuditEnum
.
待融资审核
.
getName
());
commonService
.
buildTaskModel
(
commonService
.
buildTaskModelDto
(
newFinancingInfo
,
workflowResultDto
,
BusinessTypeEnum
.
HYGF_DZTRRZ
));
});
return
model
;
}
private
List
<
TaskModelDto
>
buildDZTRZTaskModel
(
FinancingInfoDto
model
,
WorkflowResultDto
workflowResultDto
,
Date
startDate
)
{
ReginParams
reginParams
=
JSONObject
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
List
<
TaskModelDto
>
taskModelDtoList
=
new
ArrayList
<>();
TaskModelDto
taskModelDto
=
new
TaskModelDto
();
taskModelDto
.
setFlowCode
(
workflowResultDto
.
getNextTaskId
());
taskModelDto
.
setFlowCreateDate
(
new
Date
());
taskModelDto
.
setFlowStatus
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
taskModelDto
.
setFlowStatusLabel
(
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
taskModelDto
.
setPageType
(
null
);
taskModelDto
.
setExecuteUserIds
(
workflowResultDto
.
getNextExecuteUserIds
());
taskModelDto
.
setModel
(
model
);
taskModelDto
.
setRelationId
(
workflowResultDto
.
getInstanceId
());
taskModelDto
.
setRoutePath
(
null
);
taskModelDto
.
setStartUserId
(
reginParams
.
getUserModel
().
getUserId
());
taskModelDto
.
setStartUser
(
reginParams
.
getUserModel
().
getUserName
());
taskModelDto
.
setStartDate
(
startDate
);
taskModelDto
.
setStartUserCompanyName
(
null
);
taskModelDto
.
setTaskName
(
workflowResultDto
.
getNextNodeName
());
taskModelDto
.
setTaskCode
(
workflowResultDto
.
getNextNodeCode
());
taskModelDto
.
setTaskType
(
BusinessTypeEnum
.
HYGF_DZTRRZ
.
getCode
());
taskModelDto
.
setTaskTypeLabel
(
BusinessTypeEnum
.
HYGF_DZTRRZ
.
getName
());
taskModelDto
.
setTaskStatus
(
TaskStatusEnum
.
UNDERWAY
.
getValue
());
taskModelDto
.
setTaskStatusLabel
(
TaskStatusEnum
.
UNDERWAY
.
getName
());
// taskModelDto.setTaskDesc();
// taskModelDto.setTaskContent();
taskModelDto
.
setNextExecuteUser
(
workflowResultDto
.
getNextExecutorIds
());
taskModelDtoList
.
add
(
taskModelDto
);
return
taskModelDtoList
;
}
@Override
@GlobalTransactional
public
void
rollback
(
String
processId
,
String
peasantHouseholdId
)
{
...
...
@@ -219,7 +186,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
this
.
updateById
(
financingInfo
);
}
//停止流程
// commonService.rollbackTask(
);
commonService
.
deleteTaskModel
(
processId
);
}
@Override
...
...
@@ -267,6 +234,7 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
financingAuditingDto
.
setPromoter
(
financingAuditing
.
getPromoter
());
if
(
null
==
financingAuditingDto
.
getInstanceId
())
{
financingAuditingDto
.
setInstanceId
(
financingAuditing
.
getInstanceId
());
workflowResultDto
.
setInstanceId
(
financingAuditing
.
getInstanceId
());
}
financingAuditingDto
.
setStatus
(
params
.
getOrDefault
(
"comments"
,
""
).
toString
());
financingAuditingDto
.
setNodeRouting
(
FinancingAuditEnum
.
getNodeByCode
(
workflowResultDto
.
getNextNodeKey
()));
...
...
@@ -288,7 +256,8 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
financingInfo
.
setStatus
(
statusName
);
}
this
.
updateById
(
financingInfo
);
//更新待办
updateFinancingInfoTask
(
financingInfo
,
workflowResultDto
);
//节点为待整改时生成整改单
if
(
params
.
containsKey
(
"isFlag"
)
&&
params
.
get
(
"isFlag"
).
equals
(
"1"
)
&&
workflowResultDto
.
getNextNodeKey
().
equals
(
FinancingAuditEnum
.
待整改
.
getCode
()))
{
...
...
@@ -316,27 +285,24 @@ public class FinancingInfoServiceImpl extends BaseService<FinancingInfoDto, Fina
financingRectificationOrder
.
setResponsibleUserPhone
(
params
.
getOrDefault
(
"responsibleUserPhone"
,
""
).
toString
());
financingRectificationOrderService
.
save
(
financingRectificationOrder
);
}
//更新待办
// commonService.updateTaskModelNew(buildDZTRZUpdateTaskParams(params,financingAuditing));
}
private
Map
<
String
,
Object
>
buildDZTRZUpdateTaskParams
(
Map
<
String
,
Object
>
params
,
FinancingAuditing
financingAuditing
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
"0"
.
equals
(
params
.
get
(
"approvalStatus"
)))
{
map
.
put
(
"flowStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
map
.
put
(
"flowStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
map
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
map
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
}
else
{
map
.
put
(
"flowStatus"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
map
.
put
(
"flowStatusLabel"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
map
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
map
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
}
map
.
put
(
"model"
,
financingAuditing
);
map
.
put
(
"relationId"
,
financingAuditing
.
getInstanceId
());
return
map
;
/**
* 此处先更新完成待办然后在新增待办
* @param financingInfo
* @param workflowResultDto
*/
private
void
updateFinancingInfoTask
(
FinancingInfo
financingInfo
,
WorkflowResultDto
workflowResultDto
)
{
Map
<
String
,
Object
>
updateTaskParam
=
new
HashMap
<>();
updateTaskParam
.
put
(
"flowStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
updateTaskParam
.
put
(
"flowStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
updateTaskParam
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
updateTaskParam
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
updateTaskParam
.
put
(
"model"
,
financingInfo
);
updateTaskParam
.
put
(
"relationId"
,
workflowResultDto
.
getInstanceId
());
commonService
.
updateTaskModel
(
updateTaskParam
);
commonService
.
buildTaskModel
((
commonService
.
buildTaskModelDto
(
financingInfo
,
workflowResultDto
,
BusinessTypeEnum
.
HYGF_DZTRRZ
)));
}
public
List
<
Map
<
String
,
Object
>>
selectOrgList
()
{
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/SurveyInformationServiceImpl.java
View file @
d86a5271
...
...
@@ -3,7 +3,6 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
...
...
@@ -24,6 +23,10 @@ import com.yeejoin.amos.component.robot.AmosRequestContext;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
io.seata.spring.annotation.GlobalTransactional
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.ObjectUtils
;
...
...
@@ -32,15 +35,12 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.component.emq.EmqKeeper
;
import
org.typroject.tyboot.core.foundation.exception.BaseException
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
* 勘察信息服务实现类
...
...
@@ -54,30 +54,28 @@ public class SurveyInformationServiceImpl
extends
BaseService
<
SurveyInformationDto
,
SurveyInformation
,
SurveyInformationMapper
>
implements
ISurveyInformationService
{
private
static
final
String
regionRedis
=
"app_region_redis"
;
private
static
final
String
OPERATION_TYPE_SUBMIT
=
"submit"
;
private
static
final
String
OPERATION_TYPE_APPLY
=
"apply"
;
private
static
final
String
IDX_REQUEST_STATE
=
"200"
;
@Autowired
protected
EmqKeeper
emqKeeper
;
@Autowired
SurveyDetailsServiceImpl
surveyDetailsService
;
@Autowired
InformationServiceImpl
informationService
;
@Autowired
ExtendedInformationServiceImpl
extendedInformationService
;
@Autowired
CommercialServiceImpl
commercialService
;
@Autowired
PeasantHouseholdServiceImpl
peasantHouseholdServiceImpl
;
@Autowired
DesignInformationServiceImpl
designInformationService
;
@Autowired
WorkflowFeignClient
workflowFeignClient
;
@Autowired
RedisUtils
redisUtils
;
@Autowired
IdxFeginService
idxFeginService
;
@Autowired
...
...
@@ -88,22 +86,10 @@ public class SurveyInformationServiceImpl
ToDoTasksMapper
toDoTasksMapper
;
@Autowired
UserMessageMapper
userMessageMapper
;
@Value
(
"${power.station.examine.pageId}"
)
private
long
pageId
;
@Autowired
protected
EmqKeeper
emqKeeper
;
@Value
(
"${power.station.examine.planId}"
)
private
String
planId
;
private
static
final
String
regionRedis
=
"app_region_redis"
;
private
static
final
String
OPERATION_TYPE_SUBMIT
=
"submit"
;
private
static
final
String
OPERATION_TYPE_APPLY
=
"apply"
;
private
static
final
String
IDX_REQUEST_STATE
=
"200"
;
@Autowired
PersonnelBusinessMapper
personnelBusinessMapper
;
@Autowired
PeasantHouseholdMapper
peasantHouseholdMapper
;
@Autowired
WorkOrderMapper
workOrderMapper
;
@Autowired
...
...
@@ -114,7 +100,6 @@ public class SurveyInformationServiceImpl
ConstructionRecordsMapper
constructionRecordsMapper
;
@Autowired
BasicGridAcceptanceMapper
basicGridAcceptanceMapper
;
@Autowired
SurveyInformationMapper
surveyInformationMapper
;
@Autowired
...
...
@@ -125,9 +110,16 @@ public class SurveyInformationServiceImpl
WorkOrderPowerStationMapper
workOrderPowerStationMapper
;
@Autowired
AmosRequestContext
requestContext
;
// @Autowired
// WorkflowImpl workflow;
@Autowired
WorkflowImpl
workflow
;
CommonServiceImpl
commonService
;
@Autowired
WorkFlowService
workFlowService
;
@Value
(
"${power.station.examine.pageId}"
)
private
long
pageId
;
@Value
(
"${power.station.examine.planId}"
)
private
String
planId
;
/**
* 分页查询
...
...
@@ -313,28 +305,50 @@ public class SurveyInformationServiceImpl
try
{
BasicGridAcceptance
basicGridAcceptance
=
new
BasicGridAcceptance
();
List
<
ProcessTaskDTO
>
processTaskDTOS
=
new
ArrayList
();
if
(
ObjectUtils
.
isNotEmpty
(
powerStation
))
{
// 工作流执行一步
// taskId = powerStation.getTaskId();
StandardDto
standardDto
=
new
StandardDto
();
standardDto
.
setResult
(
"0"
);
standardDto
.
setTaskId
(
powerStation
.
getFlowTaskId
());
VariableDto
variable
=
new
VariableDto
();
variable
.
setApprovalStatus
(
"0"
);
standardDto
.
setVariable
(
variable
);
workflow
.
standard
(
basicGridAcceptance
,
standardDto
,
requestContext
.
getUserId
());
// StandardDto standardDto = new StandardDto();
// standardDto.setResult("0");
// standardDto.setTaskId(powerStation.getFlowTaskId());
// VariableDto variable = new VariableDto();
// variable.setApprovalStatus("0");
// standardDto.setVariable(variable);
// workflow.standard(basicGridAcceptance, standardDto, requestContext.getUserId());
//执行流程
TaskResultDTO
taskResultDTO
=
new
TaskResultDTO
();
taskResultDTO
.
setResult
(
"0"
);
taskResultDTO
.
setTaskId
(
powerStation
.
getFlowTaskId
());
HashMap
<
String
,
Object
>
variableMap
=
new
HashMap
<>();
variableMap
.
put
(
"approvalStatus"
,
"0"
);
taskResultDTO
.
setVariable
(
variableMap
);
ProcessTaskDTO
processTaskDTO
=
workFlowService
.
standard
(
basicGridAcceptance
,
taskResultDTO
,
requestContext
.
getUserId
());
processTaskDTOS
.
add
(
processTaskDTO
);
}
else
{
// 第一步启动工作流
// 发起工作流
// 调用工作流执行第一个节点
ProcessDto
processDto
=
new
ProcessDto
();
processDto
.
setBusinessKey
(
String
.
valueOf
(
peasantHousehold
.
getSequenceNbr
()));
processDto
.
setProcessDefinitionKey
(
"hygf_10001"
);
StartProcessDto
startProcessDto
=
new
StartProcessDto
();
List
<
ProcessDto
>
process
=
new
ArrayList
<>();
process
.
add
(
processDto
);
startProcessDto
.
setProcess
(
process
);
workflow
.
startProcess
(
basicGridAcceptance
,
startProcessDto
,
requestContext
.
getUserId
());
// ProcessDto processDto = new ProcessDto();
// processDto.setBusinessKey(String.valueOf(peasantHousehold.getSequenceNbr()));
// processDto.setProcessDefinitionKey("hygf_10001");
// StartProcessDto startProcessDto = new StartProcessDto();
// List<ProcessDto> process = new ArrayList<>();
// process.add(processDto);
// startProcessDto.setProcess(process);
// workflow.startProcess(basicGridAcceptance, startProcessDto, requestContext.getUserId());
//开启工作流 并执行一步
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
BusinessTypeEnum
.
HYGF_DZ_SH
.
getCode
());
dto
.
setBusinessKey
(
String
.
valueOf
(
peasantHousehold
.
getSequenceNbr
()));
dto
.
setCompleteFirstTask
(
true
);
list
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
list
);
processTaskDTOS
=
workFlowService
.
startBatch
(
actWorkflowBatchDTO
);
basicGridAcceptance
=
workFlowService
.
getBasicGridAcceptance
(
basicGridAcceptance
,
processTaskDTOS
,
requestContext
.
getUserId
());
powerStation
=
new
PowerStation
();
}
peasantHousehold
.
setSurveyOrNot
(
2
);
...
...
@@ -366,6 +380,8 @@ public class SurveyInformationServiceImpl
long
idsk
=
peasantHousehold
.
getSequenceNbr
();
up
.
eq
(
PeasantHousehold:
:
getSequenceNbr
,
idsk
);
peasantHouseholdMapper
.
update
(
null
,
up
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
processTaskDTOS
);
commonService
.
buildTaskModel
(
commonService
.
buildTaskModelDto
(
powerStation
,
workflowResultDtos
.
get
(
0
),
BusinessTypeEnum
.
HYGF_DZ_SH
));
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
@@ -420,6 +436,7 @@ public class SurveyInformationServiceImpl
// }
}
public
SurveyInfoAllDto
querySurveyInfo
(
String
surveyInformationId
,
String
peasantHouseholdId
,
String
processInstanceId
,
AgencyUserModel
userInfo
)
{
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/UnitInfoServiceImpl.java
View file @
d86a5271
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
c
om.alibaba.fastjson.JSON
;
import
c
n.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
...
@@ -10,7 +9,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.BusinessTypeEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.DealerReviewEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.*
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService
;
...
...
@@ -28,7 +29,10 @@ import com.yeejoin.amos.feign.privilege.model.CompanyModel;
import
com.yeejoin.amos.feign.privilege.model.RoleModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.model.RegionModel
;
import
com.yeejoin.amos.feign.systemctl.model.SmsRecordModel
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowBatchDTO
;
import
com.yeejoin.amos.feign.workflow.model.ActWorkflowStartDTO
;
import
com.yeejoin.amos.feign.workflow.model.ProcessTaskDTO
;
import
com.yeejoin.amos.feign.workflow.model.TaskResultDTO
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -53,22 +57,21 @@ import java.util.stream.Stream;
* @date 2023-07-07
*/
@Service
public
class
UnitInfoServiceImpl
extends
BaseService
<
UnitInfoDto
,
UnitInfo
,
UnitInfoMapper
>
implements
IUnitInfoService
{
public
class
UnitInfoServiceImpl
extends
BaseService
<
UnitInfoDto
,
UnitInfo
,
UnitInfoMapper
>
implements
IUnitInfoService
{
private
static
final
String
regionRedis
=
"app_region_redis"
;
private
static
final
String
OPERATION_TYPE_SUBMIT
=
"submit"
;
private
static
final
String
OPERATION_TYPE_APPLY
=
"apply"
;
private
static
final
String
IDX_REQUEST_STATE
=
"200"
;
private
static
final
String
VERIFY_RESULT_YES
=
"0"
;
private
static
final
String
VERIFY_RESULT_NO
=
"1"
;
private
static
final
String
SMSTEMPCODENO
=
"SMS_HYGF_0003"
;
private
static
final
String
SMSTEMPCODEYES
=
"SMS_HYGF_0004"
;
String
COMPANY_TREE_REDIS_KEY
=
"REGULATOR_UNIT_TREE"
;
@Value
(
"${regulator.unit.code}"
)
private
String
code
;
@Value
(
"${dealer.appcode}"
)
private
String
appCodes
;
@Autowired
RedisUtils
redisUtil
;
@Autowired
PrivilegeFeginService
privilegeFeginService
;
@Autowired
CommerceInfoServiceImpl
commerceInfoService
;
@Autowired
...
...
@@ -85,55 +88,57 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
PublicAgencyUserMapper
publicAgencyUserMapper
;
@Autowired
IDealerReviewService
dealerReviewService
;
@Value
(
"${hygf.user.group.id}"
)
private
long
userGroupId
;
@Value
(
"${regionalCompanies.company.seq}"
)
private
Long
regionalCompanies
;
@Autowired
IdxFeginService
idxFeginService
;
private
static
final
String
regionRedis
=
"app_region_redis"
;
private
static
final
String
OPERATION_TYPE_SUBMIT
=
"submit"
;
private
static
final
String
OPERATION_TYPE_APPLY
=
"apply"
;
private
static
final
String
IDX_REQUEST_STATE
=
"200"
;
private
static
final
String
VERIFY_RESULT_YES
=
"0"
;
private
static
final
String
VERIFY_RESULT_NO
=
"1"
;
@Autowired
DealerReviewMapper
dealerReviewMapper
;
@Autowired
AmosRequestContext
amosRequestContext
;
@Autowired
PersonnelBusinessMapper
personnelBusinessMapper
;
@Autowired
WorkflowImpl
workflow
;
@Autowired
WorkFlowService
workFlowService
;
@Autowired
CommonServiceImpl
commonService
;
@Autowired
UserEmpowerMapper
userEmpowerMapper
;
@Value
(
"${regulator.unit.code}"
)
private
String
code
;
@Value
(
"${dealer.appcode}"
)
private
String
appCodes
;
@Value
(
"${hygf.user.group.id}"
)
private
long
userGroupId
;
@Value
(
"${regionalCompanies.company.seq}"
)
private
Long
regionalCompanies
;
@Value
(
"${power.station.examine.pageId}"
)
private
long
pageId
;
@Autowired
AmosRequestContext
requestContext
;
@Value
(
"${unitInfo.station.examine.planId}"
)
private
String
planId
;
@Value
(
"${amos.system.user.product}"
)
private
String
AMOS_STUDIO_WEB
;
@Value
(
"${amos.system.user.app-key}"
)
private
String
AMOS_STUDIO
;
// @Value("${amos.system.user.product}")
// private String AMOS_STUDIO_WEB;
// @Value("${amos.system.user.app-key}")
// private String AMOS_STUDIO;
@Value
(
"${hygf.sms.tempCodeJXS}"
)
private
String
smsTempCode
;
@Value
(
"${dealer.managementUnitId}"
)
private
String
managementUnitId
;
@Value
(
"${dealer.roleId}"
)
private
String
roleId
;
@Autowired
PersonnelBusinessMapper
personnelBusinessMapper
;
@Autowired
WorkflowImpl
workflow
;
@Autowired
UserEmpowerMapper
userEmpowerMapper
;
private
static
final
String
SMSTEMPCODENO
=
"SMS_HYGF_0003"
;
private
static
List
<
LinkedHashMap
>
findNodesByCondition
(
List
<
LinkedHashMap
>
nodes
,
String
conditionName
,
String
condition
,
String
childName
)
{
return
nodes
.
stream
()
.
flatMap
(
node
->
Stream
.
concat
(
node
.
get
(
conditionName
).
equals
(
condition
)
?
Stream
.
of
(
node
)
:
Stream
.
empty
(),
node
.
get
(
childName
)
!=
null
?
findNodesByCondition
((
List
<
LinkedHashMap
>)
node
.
get
(
childName
),
conditionName
,
condition
,
condition
).
stream
()
:
Stream
.
empty
()
))
.
collect
(
Collectors
.
toList
());
}
private
static
final
String
SMSTEMPCODEYES
=
"SMS_HYGF_0004"
;
/**
* 分页查询
*/
...
...
@@ -145,7 +150,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
* 列表查询 示例
*/
public
List
<
UnitInfoDto
>
queryForUnitInfoList
()
{
return
this
.
queryForList
(
""
,
false
);
return
this
.
queryForList
(
""
,
false
);
}
@Override
...
...
@@ -179,7 +184,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
commerceInfo
.
setUnitSeq
(
regUnitInfo
.
getSequenceNbr
());
commerceInfo
=
commerceInfoService
.
createWithModel
(
commerceInfo
);
List
<
RegionalCompanies
>
regionalCompanies
=
regUnitInfo
.
getRegionalCompanies
();
List
<
RegionalCompanies
>
regionalCompanies
=
regUnitInfo
.
getRegionalCompanies
();
for
(
RegionalCompanies
regionalCompany
:
regionalCompanies
)
{
regionalCompany
.
setUnitId
(
regUnitInfo
.
getAmosCompanySeq
());
regionalCompany
.
setUnitInfoId
(
regUnitInfo
.
getSequenceNbr
());
...
...
@@ -231,20 +236,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
return
model
;
}
private
static
List
<
LinkedHashMap
>
findNodesByCondition
(
List
<
LinkedHashMap
>
nodes
,
String
conditionName
,
String
condition
,
String
childName
)
{
return
nodes
.
stream
()
.
flatMap
(
node
->
Stream
.
concat
(
node
.
get
(
conditionName
).
equals
(
condition
)
?
Stream
.
of
(
node
)
:
Stream
.
empty
(),
node
.
get
(
childName
)
!=
null
?
findNodesByCondition
((
List
<
LinkedHashMap
>)
node
.
get
(
childName
),
conditionName
,
condition
,
condition
).
stream
()
:
Stream
.
empty
()
))
.
collect
(
Collectors
.
toList
());
}
private
List
<
LinkedHashMap
>
creatTree
()
{
FeignClientResult
tree
=
privilegeFeginService
.
tree
(
RequestContext
.
getToken
(),
RequestContext
.
getAppKey
(),
RequestContext
.
getProduct
());
FeignClientResult
tree
=
privilegeFeginService
.
tree
(
RequestContext
.
getToken
(),
RequestContext
.
getAppKey
(),
RequestContext
.
getProduct
());
List
<
LinkedHashMap
>
result
=
(
List
<
LinkedHashMap
>)
tree
.
getResult
();
List
<
LinkedHashMap
>
treeData
=
deleteRegulatorTreeData
(
result
);
List
<
LinkedHashMap
>
supervisionTree
=
treeData
.
stream
().
filter
(
e
->
code
.
equals
(
e
.
get
(
"orgCode"
))).
collect
(
Collectors
.
toList
());
...
...
@@ -320,8 +313,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
companyInfo
.
setLandlinePhone
(
regUnitInfo
.
getHeadPhone
());
FeignClientResult
<
CompanyModel
>
companyResult
=
Privilege
.
companyClient
.
create
(
companyInfo
);
if
(
companyResult
==
null
||
companyResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"单位注册失败!"
+
companyResult
.
getDevMessage
());
if
(
companyResult
==
null
||
companyResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"单位注册失败!"
+
companyResult
.
getDevMessage
());
}
String
adminUserName
=
regUnitInfo
.
getAdminUserName
();
...
...
@@ -357,8 +350,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqMap
);
userResult
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
);
if
(
userResult
==
null
||
userResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"单位注册失败!"
+
userResult
.
getDevMessage
());
if
(
userResult
==
null
||
userResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"单位注册失败!"
+
userResult
.
getDevMessage
());
}
regUnitInfo
.
setAdminUserId
(
userResult
.
getResult
().
getUserId
());
regUnitInfo
.
setAmosCompanySeq
(
companyInfo
.
getSequenceNbr
());
...
...
@@ -403,8 +396,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
companyInfo
.
setLandlinePhone
(
regUnitInfo
.
getHeadPhone
());
FeignClientResult
<
CompanyModel
>
companyResult
=
Privilege
.
companyClient
.
create
(
companyInfo
);
if
(
companyResult
==
null
||
companyResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"单位注册失败!"
+
companyResult
.
getDevMessage
());
if
(
companyResult
==
null
||
companyResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"单位注册失败!"
+
companyResult
.
getDevMessage
());
}
String
adminUserName
=
regUnitInfo
.
getAdminUserName
();
...
...
@@ -440,8 +433,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
agencyUserModel
.
setOrgRoleSeqs
(
roleSeqMap
);
userResult
=
Privilege
.
agencyUserClient
.
create
(
agencyUserModel
);
if
(
userResult
==
null
||
userResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"单位注册失败!"
+
userResult
.
getDevMessage
());
if
(
userResult
==
null
||
userResult
.
getStatus
()
!=
200
)
{
throw
new
BadRequest
(
"单位注册失败!"
+
userResult
.
getDevMessage
());
}
regUnitInfo
.
setAdminUserId
(
userResult
.
getResult
().
getUserId
());
regUnitInfo
.
setAmosCompanySeq
(
companyInfo
.
getSequenceNbr
());
...
...
@@ -465,20 +458,17 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
}
public
UnitInfoDto
createWithModelnew
(
UnitInfoDto
regUnitInfo
)
{
public
UnitInfoDto
createWithModelnew
(
UnitInfoDto
regUnitInfo
)
{
regUnitInfo
.
setBlacklist
(
1
);
regUnitInfo
.
setAuditStatus
(
1
);
regUnitInfo
.
setManagementUnit
(
"经销商事业部"
);
regUnitInfo
=
this
.
createWithModel
(
regUnitInfo
);
regUnitInfo
=
this
.
createWithModel
(
regUnitInfo
);
//添加上下文
this
.
submitExamine
(
regUnitInfo
);
return
regUnitInfo
;
}
private
void
submitExamine
(
UnitInfoDto
regUnitInfo
)
{
private
void
submitExamine
(
UnitInfoDto
regUnitInfo
)
{
String
taskId
=
null
;
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>(
1
);
objectMap
.
put
(
"describe"
,
"经销商已上传信息"
);
...
...
@@ -489,15 +479,27 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
//发起工作流
// 调用工作流执行第一个节点
ProcessDto
processDto
=
new
ProcessDto
();
processDto
.
setBusinessKey
(
String
.
valueOf
(
regUnitInfo
.
getSequenceNbr
()));
processDto
.
setProcessDefinitionKey
(
"JXS_SH"
);
StartProcessDto
startProcessDto
=
new
StartProcessDto
();
List
<
ProcessDto
>
process
=
new
ArrayList
<>();
process
.
add
(
processDto
);
startProcessDto
.
setProcess
(
process
);
BasicGridAcceptance
basicGridAcceptance
=
new
BasicGridAcceptance
();
workflow
.
startProcessnew
(
AMOS_STUDIO
,
AMOS_STUDIO_WEB
,
requestContext
.
getToken
(),
basicGridAcceptance
,
startProcessDto
,
requestContext
.
getUserId
());
// ProcessDto processDto = new ProcessDto();
// processDto.setBusinessKey(String.valueOf(regUnitInfo.getSequenceNbr()));
// processDto.setProcessDefinitionKey(BusinessTypeEnum.HYGF_JXS_SH.getCode());
// StartProcessDto startProcessDto = new StartProcessDto();
// List<ProcessDto> process = new ArrayList<>();
// process.add(processDto);
// startProcessDto.setProcess(process);
BasicGridAcceptance
basicGridAcceptance
=
new
BasicGridAcceptance
();
// workflow.startProcessnew(AMOS_STUDIO, AMOS_STUDIO_WEB, requestContext.getToken(), basicGridAcceptance, startProcessDto, requestContext.getUserId());
//开启工作流 并执行一步
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
list
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
BusinessTypeEnum
.
HYGF_JXS_SH
.
getCode
());
dto
.
setBusinessKey
(
String
.
valueOf
(
regUnitInfo
.
getSequenceNbr
()));
dto
.
setCompleteFirstTask
(
true
);
list
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
list
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
workFlowService
.
startBatchNew
(
amosRequestContext
.
getAppKey
(),
amosRequestContext
.
getProduct
(),
amosRequestContext
.
getToken
(),
actWorkflowBatchDTO
);
workFlowService
.
getBasicGridAcceptance
(
basicGridAcceptance
,
processTaskDTOS
,
amosRequestContext
.
getUserId
());
// 插入记录表
dealerReview
.
setPlanInstanceId
(
planId
);
dealerReview
.
setUnitInfoId
(
regUnitInfo
.
getSequenceNbr
());
...
...
@@ -506,15 +508,17 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
dealerReview
.
setFlowTaskId
(
basicGridAcceptance
.
getNextTaskId
());
dealerReview
.
setNodeRole
(
basicGridAcceptance
.
getNextExecutorIds
());
dealerReview
.
setNextProcessNode
(
DealerReviewEnum
.
经销商管理员审核
.
getCode
());
dealerReviewService
.
saveDealerReview
(
dealerReview
,
true
,
false
,
regUnitInfo
.
getName
(),
"任务明细:经销商已上传信息"
);
dealerReviewService
.
saveDealerReview
(
dealerReview
,
true
,
false
,
regUnitInfo
.
getName
(),
"任务明细:经销商已上传信息"
);
//添加待办
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
processTaskDTOS
);
commonService
.
buildTaskModel
(
commonService
.
buildTaskModelDto
(
dealerReview
,
workflowResultDtos
.
get
(
0
),
BusinessTypeEnum
.
HYGF_JXS_SH
));
}
catch
(
Exception
e
){
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
//
// String taskId = null;
// Map<String, Object> objectMap = new HashMap<>(1);
...
...
@@ -554,18 +558,17 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
}
@Override
@Transactional
public
String
powerStationExamine
(
long
pageId
,
String
nodeCode
,
String
stationId
,
String
taskId
,
String
planInstanceId
,
Map
<
String
,
Object
>
kv
)
{
// 2.更新审核记录表
UnitInfo
unitInfo
=
null
;
try
{
DealerReview
dealerReview
=
dealerReviewMapper
.
selectOne
(
new
QueryWrapper
<
DealerReview
>().
eq
(
"unit_info_id"
,
stationId
));
unitInfo
=
this
.
getById
(
stationId
);
UnitInfo
unitInfo
=
null
;
try
{
DealerReview
dealerReview
=
dealerReviewMapper
.
selectOne
(
new
QueryWrapper
<
DealerReview
>().
eq
(
"unit_info_id"
,
stationId
));
unitInfo
=
this
.
getById
(
stationId
);
DealerReviewEnum
nodeByCode
=
DealerReviewEnum
.
getNodeByCode
(
nodeCode
);
String
approvalStatue
=
""
;
String
approvalStatue
=
""
;
if
(
DealerReviewEnum
.
经销商管理员审核
.
getCode
().
equals
(
nodeCode
))
{
String
result
=
String
.
valueOf
(
kv
.
get
(
"approvalStatus"
));
if
(
VERIFY_RESULT_NO
.
equals
(
result
))
{
...
...
@@ -574,41 +577,41 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
//发送断线
Boolean
flag
=
true
;
HashMap
<
String
,
String
>
params
=
new
HashMap
<>(
3
);
String
meg
=
String
.
valueOf
(
kv
.
get
(
"approveInfo"
));
params
.
put
(
"code"
,
"不通过"
);
params
.
put
(
"mobile"
,
unitInfo
.
getAdminPhone
());
String
meg
=
String
.
valueOf
(
kv
.
get
(
"approveInfo"
));
params
.
put
(
"code"
,
"不通过"
);
params
.
put
(
"mobile"
,
unitInfo
.
getAdminPhone
());
params
.
put
(
"smsCode"
,
SMSTEMPCODENO
);
approvalStatue
=
"任务明细:"
+
DealerReviewEnum
.
经销商管理员审核
.
getName
()+
"审核不通过"
;
approvalStatue
=
"任务明细:"
+
DealerReviewEnum
.
经销商管理员审核
.
getName
()
+
"审核不通过"
;
// FeignClientResult<SmsRecordModel> date= Systemctl.smsClient.sendCommonSms(params);
// System.out.println("短信通知============================"+JSON.toJSONString(date));
}
else
{
}
else
{
// 1. 更新经销商状态
unitInfo
.
setAuditStatus
(
2
);
unitInfo
.
setBlacklist
(
0
);
this
.
createCompanyAndUsernew
(
unitInfo
);
PublicAgencyUser
publicAgencyUser
=
new
PublicAgencyUser
();
PublicAgencyUser
publicAgencyUser
=
new
PublicAgencyUser
();
publicAgencyUser
.
setAmosUserId
(
unitInfo
.
getAdminUserId
());
publicAgencyUser
.
setAmosUserName
(
unitInfo
.
getAdminLoginName
());
publicAgencyUser
.
setRealName
(
unitInfo
.
getAdminLoginName
());
publicAgencyUser
.
setRole
(
"["
+
unitInfo
.
getRoleId
()+
"]"
);
publicAgencyUser
.
setRole
(
"["
+
unitInfo
.
getRoleId
()
+
"]"
);
publicAgencyUser
.
setEmergencyTelephone
(
unitInfo
.
getAdminPhone
());
publicAgencyUser
.
setLockStatus
(
"UNLOCK"
);
publicAgencyUserMapper
.
insert
(
publicAgencyUser
);
List
<
String
>
lis
=
new
ArrayList
<>();
List
<
String
>
lis
=
new
ArrayList
<>();
// lis.add(unitInfo.getAmosCompanyCode());
LambdaQueryWrapper
<
RegionalCompanies
>
queryWrapper
=
new
LambdaQueryWrapper
<
RegionalCompanies
>();
queryWrapper
.
eq
(
RegionalCompanies:
:
getUnitInfoId
,
unitInfo
.
getSequenceNbr
());
List
<
RegionalCompanies
>
list
=
regionalCompaniesMapper
.
selectList
(
queryWrapper
);
List
<
RegionalCompanies
>
list
=
regionalCompaniesMapper
.
selectList
(
queryWrapper
);
for
(
RegionalCompanies
companies
:
list
)
{
companies
.
setUnitId
(
unitInfo
.
getAmosCompanySeq
());
lis
.
add
(
companies
.
getRegionalCompaniesCode
());
}
regionalCompaniesService
.
saveOrUpdateBatch
(
list
);
PersonnelBusiness
re
=
new
PersonnelBusiness
();
PersonnelBusiness
re
=
new
PersonnelBusiness
();
re
.
setAmosDealerId
(
unitInfo
.
getAmosCompanySeq
());
re
.
setAmosUnitId
(
unitInfo
.
getAmosCompanySeq
());
re
.
setAmosUnitName
(
unitInfo
.
getName
());
...
...
@@ -618,14 +621,14 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
personnelBusinessMapper
.
insert
(
re
);
//管理员绑定角色权限
StdUserEmpower
stdUserEmpower
=
new
StdUserEmpower
();
StdUserEmpower
stdUserEmpower
=
new
StdUserEmpower
();
stdUserEmpower
.
setAmosUserId
(
unitInfo
.
getAdminUserId
());
stdUserEmpower
.
setAmosOrgCode
(
lis
);
stdUserEmpower
.
setPermissionType
(
"HYGF"
);
userEmpowerMapper
.
insert
(
stdUserEmpower
);
// Privilege.agencyUserClient.unlockUsers(unitInfo.getAdminUserId());
approvalStatue
=
"任务明细:"
+
DealerReviewEnum
.
经销商管理员审核
.
getName
()+
"审核通过"
;
approvalStatue
=
"任务明细:"
+
DealerReviewEnum
.
经销商管理员审核
.
getName
()
+
"审核通过"
;
// HashMap<String, String> params = new HashMap<>(3);
// params.put("code","通过");
// params.put("mobile",unitInfo.getAdminPhone());
...
...
@@ -640,29 +643,43 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
// 3. 工作流执行
//执行工作流
BasicGridAcceptance
basicGridAcceptance
=
new
BasicGridAcceptance
();
StandardDto
standardDto
=
new
StandardDto
();
standardDto
.
setComment
(
kv
.
get
(
"approvalInfo"
)!=
null
?
String
.
valueOf
(
kv
.
get
(
"approvalInfo"
)):
""
);
standardDto
.
setResult
(
String
.
valueOf
(
kv
.
get
(
"approvalStatus"
)));
standardDto
.
setTaskId
(
dealerReview
.
getFlowTaskId
());
VariableDto
variable
=
new
VariableDto
();
variable
.
setApprovalStatus
(
String
.
valueOf
(
kv
.
get
(
"approvalStatus"
)));
variable
.
setComment
(
kv
.
get
(
"approvalInfo"
)!=
null
?
String
.
valueOf
(
kv
.
get
(
"approvalInfo"
)):
""
);
variable
.
setOperationTime
(
String
.
valueOf
(
kv
.
get
(
"approveDate"
)));
variable
.
setOperator
(
String
.
valueOf
(
kv
.
get
(
"approveName"
)));
standardDto
.
setVariable
(
variable
);
BasicGridAcceptance
workBasicGridAcceptance
=
workflow
.
standard
(
basicGridAcceptance
,
standardDto
,
requestContext
.
getUserId
());
BasicGridAcceptance
basicGridAcceptance
=
new
BasicGridAcceptance
();
// StandardDto standardDto = new StandardDto();
// standardDto.setComment(kv.get("approvalInfo") != null ? String.valueOf(kv.get("approvalInfo")) : "");
// standardDto.setResult(String.valueOf(kv.get("approvalStatus")));
// standardDto.setTaskId(dealerReview.getFlowTaskId());
// VariableDto variable = new VariableDto();
// variable.setApprovalStatus(String.valueOf(kv.get("approvalStatus")));
// variable.setComment(kv.get("approvalInfo") != null ? String.valueOf(kv.get("approvalInfo")) : "");
// variable.setOperationTime(String.valueOf(kv.get("approveDate")));
// variable.setOperator(String.valueOf(kv.get("approveName")));
// standardDto.setVariable(variable);
// BasicGridAcceptance workBasicGridAcceptance = workflow.standard(basicGridAcceptance, standardDto, requestContext.getUserId());
//执行工作流
TaskResultDTO
taskResultDTO
=
new
TaskResultDTO
();
taskResultDTO
.
setComment
(
kv
.
get
(
"approvalInfo"
)
!=
null
?
String
.
valueOf
(
kv
.
get
(
"approvalInfo"
))
:
""
);
taskResultDTO
.
setResult
(
String
.
valueOf
(
kv
.
get
(
"approvalStatus"
)));
taskResultDTO
.
setTaskId
(
dealerReview
.
getFlowTaskId
());
HashMap
<
String
,
Object
>
variableMap
=
new
HashMap
<>();
variableMap
.
put
(
"approvalStatus"
,
String
.
valueOf
(
kv
.
get
(
"approvalStatus"
)));
variableMap
.
put
(
"comment"
,
kv
.
get
(
"approvalInfo"
)
!=
null
?
String
.
valueOf
(
kv
.
get
(
"approvalInfo"
))
:
""
);
variableMap
.
put
(
"operationTime"
,
String
.
valueOf
(
kv
.
get
(
"approveDate"
)));
variableMap
.
put
(
"operator"
,
String
.
valueOf
(
kv
.
get
(
"approveName"
)));
taskResultDTO
.
setVariable
(
variableMap
);
ProcessTaskDTO
processTaskDTO
=
workFlowService
.
standard
(
basicGridAcceptance
,
taskResultDTO
,
amosRequestContext
.
getUserId
());
dealerReview
.
setFlowTaskId
(
basicGridAcceptance
.
getNextTaskId
());
dealerReviewService
.
saveDealerReview
(
dealerReview
,
false
,
true
,
unitInfo
.
getName
(),
approvalStatue
);
dealerReviewService
.
saveDealerReview
(
dealerReview
,
false
,
true
,
unitInfo
.
getName
(),
approvalStatue
);
this
.
saveOrUpdate
(
unitInfo
);
//更新待办
// commonService.updateTaskModelNew(buildJXSSHUpdateTaskModel(basicGridAcceptance, unitInfo, kv));
WorkflowResultDto
workflowResultDto
=
workFlowService
.
buildWorkFlowInfo
(
CollectionUtil
.
newArrayList
(
processTaskDTO
)).
get
(
0
);
workflowResultDto
.
setInstanceId
(
planInstanceId
);
updateUnitInfoTask
(
dealerReview
,
workflowResultDto
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
if
(!
ObjectUtils
.
isEmpty
(
unitInfo
.
getAmosCompanySeq
()))
{
FeignClientResult
<
CompanyModel
>
feignClientResult
=
Privilege
.
companyClient
...
...
@@ -683,13 +700,11 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
e
.
printStackTrace
();
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
// // 2.更新审核记录表
// UnitInfo unitInfo=null;
// try{
...
...
@@ -800,28 +815,22 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
return
code
;
}
private
Map
<
String
,
Object
>
buildJXSSHUpdateTaskModel
(
BasicGridAcceptance
basicGridAcceptance
,
UnitInfo
unitInfo
,
Map
<
String
,
Object
>
params
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
if
(
"0"
.
equals
(
params
.
get
(
"approvalStatus"
)))
{
map
.
put
(
"flowStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
map
.
put
(
"flowStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
map
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
map
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
}
else
{
map
.
put
(
"flowStatus"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
map
.
put
(
"flowStatusLabel"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
map
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getCode
());
map
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_PROCESSED
.
getName
());
}
map
.
put
(
"model"
,
unitInfo
);
map
.
put
(
"relationId"
,
basicGridAcceptance
.
getInstanceId
());
return
map
;
private
void
updateUnitInfoTask
(
DealerReview
dealerReview
,
WorkflowResultDto
workflowResultDto
)
{
Map
<
String
,
Object
>
updateTaskParam
=
new
HashMap
<>();
updateTaskParam
.
put
(
"flowStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
updateTaskParam
.
put
(
"flowStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
updateTaskParam
.
put
(
"taskStatus"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getCode
());
updateTaskParam
.
put
(
"taskStatusLabel"
,
FlowStatusEnum
.
TO_BE_FINISHED
.
getName
());
updateTaskParam
.
put
(
"model"
,
dealerReview
);
updateTaskParam
.
put
(
"relationId"
,
workflowResultDto
.
getInstanceId
());
commonService
.
updateTaskModel
(
updateTaskParam
);
commonService
.
buildTaskModel
((
commonService
.
buildTaskModelDto
(
dealerReview
,
workflowResultDto
,
BusinessTypeEnum
.
HYGF_JXS_SH
)));
}
@Override
public
IPage
<
CompanyDto
>
getCompanyDto
(
CompanyDto
dto
)
{
//列表数据组装
IPage
<
CompanyDto
>
pag
=
unitInfoMapper
.
getCompanyDto
(
dto
);
IPage
<
CompanyDto
>
pag
=
unitInfoMapper
.
getCompanyDto
(
dto
);
// List<CompanyDto> pag = unitInfoMapper.getCompanyDto( (page.getCurrent()-1)*page.getSize(),page.getSize(),dto);
//// Map<String,Integer> count = unitInfoMapper.getCompanyDtoCount(dto);
//// page.setTotal(count.get("num"));
...
...
@@ -830,66 +839,63 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
}
//单位详情
public
UnitDataDto
getUnitDataDto
(
Long
id
){
public
UnitDataDto
getUnitDataDto
(
Long
id
)
{
LambdaQueryWrapper
<
UnitInfo
>
queryWrapper
=
new
LambdaQueryWrapper
<
UnitInfo
>();
queryWrapper
.
eq
(
UnitInfo:
:
getAmosCompanySeq
,
id
);
UnitInfo
unitInfo
=
unitInfoMapper
.
selectOne
(
queryWrapper
);
UnitInfo
unitInfo
=
unitInfoMapper
.
selectOne
(
queryWrapper
);
LambdaQueryWrapper
<
CommerceInfo
>
queryWrapper1
=
new
LambdaQueryWrapper
<
CommerceInfo
>();
queryWrapper1
.
eq
(
CommerceInfo:
:
getUnitSeq
,
unitInfo
.
getSequenceNbr
());
CommerceInfo
commerceInfo
=
commerceInfoMapper
.
selectOne
(
queryWrapper1
);
CommerceInfo
commerceInfo
=
commerceInfoMapper
.
selectOne
(
queryWrapper1
);
//单位管理
UnitInformation
unitInformation
=
new
UnitInformation
();
UnitInformation
unitInformation
=
new
UnitInformation
();
//工商信息
CommerceDto
commerceDto
=
new
CommerceDto
();
CommerceDto
commerceDto
=
new
CommerceDto
();
//管理员账号
Account
cccount
=
new
Account
();
BeanUtils
.
copyProperties
(
unitInfo
,
unitInformation
);
Account
cccount
=
new
Account
();
BeanUtils
.
copyProperties
(
unitInfo
,
unitInformation
);
unitInformation
.
setHeadCardPhotoBack
(
unitInformation
.
getHeadCardPhotoBack
());
unitInformation
.
setHeadCardPhotoFront
(
unitInformation
.
getHeadCardPhotoFront
());
unitInformation
.
setRegisterPcdCode
((
unitInformation
.
getRegisterPcdCode
()
!=
null
&&!
""
.
equals
(
unitInformation
.
getRegisterPcdCode
()))?
unitInformation
.
getRegisterPcdCode
():
null
);
unitInformation
.
setWorkPcdCode
((
unitInformation
.
getWorkPcdCode
()
!=
null
&&!
""
.
equals
(
unitInformation
.
getWorkPcdCode
()))?
unitInformation
.
getWorkPcdCode
():
null
);
BeanUtils
.
copyProperties
(
commerceInfo
,
commerceDto
);
unitInformation
.
setRegisterPcdCode
((
unitInformation
.
getRegisterPcdCode
()
!=
null
&&
!
""
.
equals
(
unitInformation
.
getRegisterPcdCode
()))
?
unitInformation
.
getRegisterPcdCode
()
:
null
);
unitInformation
.
setWorkPcdCode
((
unitInformation
.
getWorkPcdCode
()
!=
null
&&
!
""
.
equals
(
unitInformation
.
getWorkPcdCode
()))
?
unitInformation
.
getWorkPcdCode
()
:
null
);
BeanUtils
.
copyProperties
(
commerceInfo
,
commerceDto
);
commerceDto
.
setBusinessLicensePhoto
(
commerceDto
.
getBusinessLicensePhoto
());
commerceDto
.
setLegalPersonCardPhotoBack
(
commerceDto
.
getLegalPersonCardPhotoBack
());
commerceDto
.
setLegalPersonCardPhotoFront
(
commerceDto
.
getLegalPersonCardPhotoFront
());
BeanUtils
.
copyProperties
(
unitInfo
,
cccount
);
UnitDataDto
unitDataDt
=
new
UnitDataDto
(
unitInformation
,
commerceDto
,
cccount
);
BeanUtils
.
copyProperties
(
unitInfo
,
cccount
);
UnitDataDto
unitDataDt
=
new
UnitDataDto
(
unitInformation
,
commerceDto
,
cccount
);
return
unitDataDt
;
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
updateUnitDataDto
(
UnitDataDto
unitDataDto
){
public
Boolean
updateUnitDataDto
(
UnitDataDto
unitDataDto
)
{
//验证二维码
UnitInfo
unitInfo
=
new
UnitInfo
();
unitInfo
=
unitInfoMapper
.
selectById
(
unitDataDto
.
getUnitInformation
().
getSequenceNbr
());
UnitInformation
unitInformation
=
unitDataDto
.
getUnitInformation
();
List
<
Long
>
dis
=
unitInformation
.
getRegionalCompaniesSeq
();
UnitInfo
unitInfo
=
new
UnitInfo
();
unitInfo
=
unitInfoMapper
.
selectById
(
unitDataDto
.
getUnitInformation
().
getSequenceNbr
());
UnitInformation
unitInformation
=
unitDataDto
.
getUnitInformation
();
List
<
Long
>
dis
=
unitInformation
.
getRegionalCompaniesSeq
();
//区域公司
LambdaQueryWrapper
<
RegionalCompanies
>
qu
=
new
LambdaQueryWrapper
<>();
qu
.
eq
(
RegionalCompanies:
:
getUnitId
,
unitInfo
.
getAmosCompanySeq
());
LambdaQueryWrapper
<
RegionalCompanies
>
qu
=
new
LambdaQueryWrapper
<>();
qu
.
eq
(
RegionalCompanies:
:
getUnitId
,
unitInfo
.
getAmosCompanySeq
());
List
<
RegionalCompanies
>
oldList
=
regionalCompaniesMapper
.
selectList
(
qu
);
List
<
String
>
oldDisString
=
oldList
.
stream
().
map
((
regionalCompanies
)
->
regionalCompanies
.
getRegionalCompaniesSeq
().
toString
()).
collect
(
Collectors
.
toList
());
List
<
String
>
newDisString
=
dis
.
stream
().
map
((
regionalCompaniesSeq
)
->
regionalCompaniesSeq
.
toString
()).
collect
(
Collectors
.
toList
());
for
(
String
item:
oldDisString
)
{
if
(!
newDisString
.
contains
(
item
))
{
for
(
String
item
:
oldDisString
)
{
if
(!
newDisString
.
contains
(
item
))
{
throw
new
BadRequest
(
"所属区域公司只能增加, 不能删除"
);
}
}
List
<
String
>
lisk
=
new
ArrayList
<>();
List
<
String
>
lisk
=
new
ArrayList
<>();
JSONArray
regionName
=
getRegionName
();
List
<
RegionModel
>
list
=
JSONArray
.
parseArray
(
regionName
.
toJSONString
(),
RegionModel
.
class
);
List
<
Integer
>
regist
=
unitInformation
.
getRegisterPcdCodeList
();
List
<
Integer
>
workP
=
unitInformation
.
getWorkPcdCodeList
();
List
<
Integer
>
regist
=
unitInformation
.
getRegisterPcdCodeList
();
List
<
Integer
>
workP
=
unitInformation
.
getWorkPcdCodeList
();
//注册地址
if
(
regist
!=
null
&&!
regist
.
isEmpty
())
{
StringBuilder
codenameRegi
=
new
StringBuilder
();
if
(
regist
!=
null
&&
!
regist
.
isEmpty
())
{
StringBuilder
codenameRegi
=
new
StringBuilder
();
for
(
int
i
=
0
,
len
=
regist
.
size
();
i
<
len
;
i
++)
{
for
(
RegionModel
regionModel
:
list
)
{
if
(
regionModel
.
getRegionCode
().
intValue
()
==
regist
.
get
(
i
).
intValue
())
{
...
...
@@ -900,12 +906,13 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
}
}
}
unitInformation
.
setRegisterPcd
(
codenameRegi
!=
null
&&!
""
.
equals
(
codenameRegi
.
toString
())?
codenameRegi
.
toString
():
null
);
unitInformation
.
setRegisterPcd
(
codenameRegi
!=
null
&&
!
""
.
equals
(
codenameRegi
.
toString
())
?
codenameRegi
.
toString
()
:
null
);
}
//办公地址
if
(
workP
!=
null
&&!
workP
.
isEmpty
()){
StringBuilder
codenamework
=
new
StringBuilder
();;
if
(
workP
!=
null
&&
!
workP
.
isEmpty
())
{
StringBuilder
codenamework
=
new
StringBuilder
();
;
for
(
int
i
=
0
,
len
=
workP
.
size
();
i
<
len
;
i
++)
{
for
(
RegionModel
regionModel
:
list
)
{
if
(
regionModel
.
getRegionCode
().
intValue
()
==
workP
.
get
(
i
).
intValue
())
{
...
...
@@ -916,7 +923,7 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
}
}
}
unitInformation
.
setWorkPcd
(
codenamework
!=
null
&&!
""
.
equals
(
codenamework
.
toString
())?
codenamework
.
toString
():
null
);
unitInformation
.
setWorkPcd
(
codenamework
!=
null
&&
!
""
.
equals
(
codenamework
.
toString
())
?
codenamework
.
toString
()
:
null
);
}
unitInformation
.
setHeadCardPhotoBackUrl
(
unitInformation
.
getHeadCardPhotoBackUrl
());
unitInformation
.
setHeadCardPhotoFrontUrl
(
unitInformation
.
getHeadCardPhotoFrontUrl
());
...
...
@@ -924,15 +931,15 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
unitInformation
.
setWorkPcdCodeList
(
unitInformation
.
getWorkPcdCodeList
());
List
<
String
>
disST
=
dis
.
stream
().
map
(
x
->
x
+
""
).
collect
(
Collectors
.
toList
());
BeanUtils
.
copyProperties
(
unitInformation
,
unitInfo
);
CommerceInfo
commerceInfo
=
new
CommerceInfo
();
commerceInfo
=
commerceInfoMapper
.
selectById
(
unitDataDto
.
getCommerceDto
().
getSequenceNbr
());
CommerceDto
commerceDto
=
unitDataDto
.
getCommerceDto
();
List
<
String
>
disST
=
dis
.
stream
().
map
(
x
->
x
+
""
).
collect
(
Collectors
.
toList
());
BeanUtils
.
copyProperties
(
unitInformation
,
unitInfo
);
CommerceInfo
commerceInfo
=
new
CommerceInfo
();
commerceInfo
=
commerceInfoMapper
.
selectById
(
unitDataDto
.
getCommerceDto
().
getSequenceNbr
());
CommerceDto
commerceDto
=
unitDataDto
.
getCommerceDto
();
commerceDto
.
setBusinessLicensePhotoUrl
(
commerceDto
.
getBusinessLicensePhotoUrl
());
commerceDto
.
setLegalPersonCardPhotoBackUrl
(
commerceDto
.
getLegalPersonCardPhotoBackUrl
());
commerceDto
.
setLegalPersonCardPhotoFrontUrl
(
commerceDto
.
getLegalPersonCardPhotoFrontUrl
());
BeanUtils
.
copyProperties
(
commerceDto
,
commerceInfo
);
BeanUtils
.
copyProperties
(
commerceDto
,
commerceInfo
);
unitInfo
.
setRegionalCompaniesSeq
(
disST
);
unitInfoMapper
.
updateById
(
unitInfo
);
...
...
@@ -942,12 +949,10 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
regionalCompaniesMapper
.
delete
(
qu
);
List
<
RegionalCompanies
>
regionalComp
=
new
ArrayList
<>();
FeignClientResult
<
Collection
<
CompanyModel
>>
feignClientResult
=
Privilege
.
companyClient
.
querySubAgencyTree
(
regionalCompanies
);
List
<
CompanyModel
>
companyModel
=
(
List
<
CompanyModel
>)
feignClientResult
.
getResult
();
List
<
String
>
lisd
=
unitInfo
.
getRegionalCompaniesSeq
();
List
<
RegionalCompanies
>
regionalComp
=
new
ArrayList
<>();
FeignClientResult
<
Collection
<
CompanyModel
>>
feignClientResult
=
Privilege
.
companyClient
.
querySubAgencyTree
(
regionalCompanies
);
List
<
CompanyModel
>
companyModel
=
(
List
<
CompanyModel
>)
feignClientResult
.
getResult
();
List
<
String
>
lisd
=
unitInfo
.
getRegionalCompaniesSeq
();
if
(
oldList
==
null
)
{
...
...
@@ -1000,22 +1005,20 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
}
public
JSONArray
getRegionName
(){
public
JSONArray
getRegionName
()
{
JSONArray
jsonArray
=
new
JSONArray
();
if
(
redisUtil
.
hasKey
(
regionRedis
))
{
jsonArray
=
JSONArray
.
parseArray
(
redisUtil
.
get
(
regionRedis
).
toString
());
}
else
{
jsonArray
=
JSONArray
.
parseArray
(
redisUtil
.
get
(
regionRedis
).
toString
());
}
else
{
Collection
<
RegionModel
>
regionChild
=
new
ArrayList
<>();
RegionModel
regionModel1
=
new
RegionModel
();
regionChild
.
add
(
regionModel1
);
FeignClientResult
<
Collection
<
RegionModel
>>
collectionFeignClientResult
=
Systemctl
.
regionClient
.
queryForTreeParent
(
610000L
);
Collection
<
RegionModel
>
result
=
collectionFeignClientResult
.
getResult
();
for
(
RegionModel
regionModel
:
result
)
{
if
(
null
!=
regionModel
&&
null
!=
regionModel
.
getChildren
())
{
if
(
null
!=
regionModel
&&
null
!=
regionModel
.
getChildren
())
{
for
(
RegionModel
child
:
regionModel
.
getChildren
())
{
if
(
null
!=
child
&&
null
!=
child
.
getChildren
())
{
if
(
null
!=
child
&&
null
!=
child
.
getChildren
())
{
for
(
RegionModel
childChild
:
child
.
getChildren
())
{
jsonArray
.
add
(
childChild
);
}
...
...
@@ -1028,23 +1031,22 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
}
}
redisUtil
.
set
(
regionRedis
,
jsonArray
);
redisUtil
.
set
(
regionRedis
,
jsonArray
);
}
return
jsonArray
;
}
public
Page
<
PeasantHousehold
>
getPeasantHouseholdData
(
Long
unitInfoId
,
public
Page
<
PeasantHousehold
>
getPeasantHouseholdData
(
Long
unitInfoId
,
Long
regionalCompaniesSeq
,
int
pageNum
,
int
pageSize
,
String
peasantHouseholdNo
,
String
ownersName
,
String
ids
)
{
UnitInfo
unitInfo
=
unitInfoMapper
.
selectById
(
unitInfoId
);
String
ids
)
{
UnitInfo
unitInfo
=
unitInfoMapper
.
selectById
(
unitInfoId
);
PageHelper
.
startPage
(
pageNum
,
pageSize
);
List
<
PeasantHousehold
>
list
=
peasantHouseholdMapper
.
selectPeasantHouseholdList
(
unitInfo
.
getAmosCompanySeq
(),
regionalCompaniesSeq
,
peasantHouseholdNo
,
ownersName
,
ids
);
List
<
PeasantHousehold
>
list
=
peasantHouseholdMapper
.
selectPeasantHouseholdList
(
unitInfo
.
getAmosCompanySeq
(),
regionalCompaniesSeq
,
peasantHouseholdNo
,
ownersName
,
ids
);
PageInfo
<
PeasantHousehold
>
page
=
new
PageInfo
(
list
);
Page
<
PeasantHousehold
>
pagenew
=
new
Page
<
PeasantHousehold
>();
pagenew
.
setCurrent
(
pageNum
);
...
...
@@ -1053,15 +1055,16 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
pagenew
.
setRecords
(
page
.
getList
());
return
pagenew
;
}
public
Page
<
PeasantHousehold
>
selectPeasantHouseholdListsg
(
Long
unitInfoId
,
public
Page
<
PeasantHousehold
>
selectPeasantHouseholdListsg
(
Long
unitInfoId
,
Long
regionalCompaniesSeq
,
int
pageNum
,
int
pageSize
,
String
peasantHouseholdNo
,
String
ownersName
,
String
ids
)
{
String
ids
)
{
PageHelper
.
startPage
(
pageNum
,
pageSize
);
List
<
PeasantHousehold
>
list
=
peasantHouseholdMapper
.
selectPeasantHouseholdListsg
(
unitInfoId
,
regionalCompaniesSeq
,
peasantHouseholdNo
,
ownersName
,
ids
);
List
<
PeasantHousehold
>
list
=
peasantHouseholdMapper
.
selectPeasantHouseholdListsg
(
unitInfoId
,
regionalCompaniesSeq
,
peasantHouseholdNo
,
ownersName
,
ids
);
PageInfo
<
PeasantHousehold
>
page
=
new
PageInfo
(
list
);
Page
<
PeasantHousehold
>
pagenew
=
new
Page
<
PeasantHousehold
>();
pagenew
.
setCurrent
(
pageNum
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/WorkFlowService.java
View file @
d86a5271
...
...
@@ -2,10 +2,10 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.WorkflowResultDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.BasicGridAcceptance
;
import
com.yeejoin.amos.boot.module.hygf.biz.feign.WorkFlowFeignService
;
import
com.yeejoin.amos.component.feign.utils.FeignUtil
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.
workflow.Workflow
;
import
com.yeejoin.amos.feign.
privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.workflow.model.*
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -13,7 +13,9 @@ import org.springframework.stereotype.Service;
import
org.springframework.util.CollectionUtils
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
...
...
@@ -39,12 +41,27 @@ public class WorkFlowService {
return
processTasks
;
}
/***
* 开启并执行一步 支持批量
*
* */
public
List
<
ProcessTaskDTO
>
startBatchNew
(
String
appKey
,
String
product
,
String
token
,
ActWorkflowBatchDTO
params
)
{
List
<
ProcessTaskDTO
>
processTasks
;
try
{
log
.
info
(
"开始前请求工作流启动接口:/start/batch,appKey:{},product:{},token:{}请求请求参数:{}"
,
appKey
,
product
,
token
,
JSONObject
.
toJSONString
(
params
));
processTasks
=
workFlowFeignService
.
startForBatchNew
(
appKey
,
product
,
token
,
params
).
getResult
();
}
catch
(
Exception
e
)
{
log
.
error
(
"调用工作流批量启动失败"
,
e
);
throw
new
RuntimeException
(
"调用工作流批量启动失败"
);
}
return
processTasks
;
}
public
ProcessInstanceDTO
stopProcess
(
String
processInstanceId
)
{
ProcessInstanceDTO
processInstanceDTO
;
ProcessInstanceDTO
processInstanceDTO
;
try
{
log
.
info
(
"开始前请求工作流停止接口:stopProcess,请求参数:{}"
,
processInstanceId
);
processInstanceDTO
=
workFlowFeignService
.
stopProcess
(
processInstanceId
,
null
).
getResult
();
processInstanceDTO
=
workFlowFeignService
.
stopProcess
(
processInstanceId
,
null
).
getResult
();
}
catch
(
Exception
e
)
{
log
.
error
(
"调用工作流批量停止失败"
,
e
);
throw
new
RuntimeException
(
"调用工作流批量停止失败"
);
...
...
@@ -53,6 +70,18 @@ public class WorkFlowService {
}
public
ProcessTaskDTO
standard
(
BasicGridAcceptance
basicGridAcceptance
,
TaskResultDTO
taskResultDTO
,
String
userid
)
{
ProcessTaskDTO
processTaskDTO
;
if
(
taskResultDTO
.
getResult
()
!=
null
)
{
taskResultDTO
.
setResultCode
(
"approvalStatus"
);
processTaskDTO
=
complete
(
taskResultDTO
.
getTaskId
(),
taskResultDTO
);
}
else
{
processTaskDTO
=
complete
(
taskResultDTO
.
getTaskId
(),
taskResultDTO
);
}
this
.
getBasicGridAcceptanceone
(
basicGridAcceptance
,
processTaskDTO
,
userid
);
return
processTaskDTO
;
}
/***
* 执行
*
...
...
@@ -70,12 +99,11 @@ public class WorkFlowService {
}
public
List
<
WorkflowResultDto
>
buildWorkFlowInfo
(
List
<
ProcessTaskDTO
>
processTaskDTOS
)
{
List
<
WorkflowResultDto
>
workflowResultDtoList
=
new
ArrayList
<>();
processTaskDTOS
.
forEach
(
item
->
{
WorkflowResultDto
workflowResultDto
=
new
WorkflowResultDto
();
if
(
null
!=
item
.
getProcessInstance
()){
if
(
null
!=
item
.
getProcessInstance
())
{
workflowResultDto
.
setInstanceId
(
item
.
getProcessInstance
().
getId
());
}
// workflowResultDto.setNextExecutorIds(String.join(",", item.getCandidateGroups()));
...
...
@@ -92,8 +120,121 @@ public class WorkFlowService {
String
nextUserIdsString
=
String
.
join
(
","
,
nextUserIds
);
workflowResultDto
.
setNextExecuteUserIds
(
nextUserIdsString
);
}
if
(!
Objects
.
isNull
(
item
.
getStartUser
()))
{
workflowResultDto
.
setStartDate
(
new
Date
());
workflowResultDto
.
setStartUserId
(
item
.
getStartUser
().
getUserId
());
workflowResultDto
.
setStartUser
(
item
.
getStartUser
().
getUserName
());
List
<
CompanyModel
>
companys
=
item
.
getStartUser
().
getCompanys
();
if
(!
CollectionUtils
.
isEmpty
(
companys
)
&&
companys
.
size
()
>=
1
)
{
workflowResultDto
.
setStartUserCompanyName
(
companys
.
get
(
0
).
getCompanyName
());
}
}
workflowResultDtoList
.
add
(
workflowResultDto
);
});
return
workflowResultDtoList
;
}
public
BasicGridAcceptance
getBasicGridAcceptance
(
BasicGridAcceptance
basicGridAcceptance
,
List
<
ProcessTaskDTO
>
processTaskDTOList
,
String
userid
)
{
ProcessTaskDTO
listco
=
processTaskDTOList
.
isEmpty
()
?
null
:
processTaskDTOList
.
get
(
0
);
if
(
listco
!=
null
)
{
// 当前节点执行任务id
basicGridAcceptance
.
setPromoter
(
userid
);
//流程实例
basicGridAcceptance
.
setInstanceId
(
listco
.
getProcessInstance
().
getId
());
// 流程下一节点id
if
(
listco
.
getNextTask
()
!=
null
&&
!
listco
.
getNextTask
().
isEmpty
())
{
basicGridAcceptance
.
setNextTaskId
(
listco
.
getNextTask
().
get
(
0
).
getId
());
//下个节点名称
basicGridAcceptance
.
setNextNodeName
(
listco
.
getNextTask
().
get
(
0
).
getName
());
//下个节点key
basicGridAcceptance
.
setNextNodeKey
(
listco
.
getNextTask
().
get
(
0
).
getKey
());
}
/// 下一个节点角色权限
if
(
listco
.
getNextCandidateGroups
()
!=
null
)
{
List
<
String
>
ld
=
listco
.
getNextCandidateGroups
().
get
(
basicGridAcceptance
.
getNextTaskId
());
StringBuffer
sbf
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<=
ld
.
size
()
-
1
;
i
++)
{
if
(
i
<
ld
.
size
()
-
1
)
{
sbf
.
append
(
ld
.
get
(
i
)
+
","
);
}
else
{
sbf
.
append
(
ld
.
get
(
i
));
}
}
basicGridAcceptance
.
setNextExecutorIds
(
sbf
.
toString
());
}
//下一节点可执行人逗号分割 0 0
if
(
listco
.
getNextTaskExecutor
()
!=
null
)
{
List
<
AgencyUserModel
>
li
=
listco
.
getNextTaskExecutor
().
get
(
basicGridAcceptance
.
getNextTaskId
());
if
(
li
!=
null
&&
!
li
.
isEmpty
())
{
StringBuffer
sbf
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<=
li
.
size
()
-
1
;
i
++)
{
if
(
i
<
li
.
size
()
-
1
)
{
sbf
.
append
(
li
.
get
(
i
).
getUserId
()
+
","
);
}
else
{
sbf
.
append
(
li
.
get
(
i
).
getUserId
());
}
}
basicGridAcceptance
.
setNextExecuteUserIds
(
sbf
.
toString
());
}
}
//工作流发起人id
basicGridAcceptance
.
setCreateUserId
(
listco
.
getStartUser
().
getUserId
());
}
else
{
throw
new
RuntimeException
(
"工作流异常"
);
}
return
basicGridAcceptance
;
}
public
void
getBasicGridAcceptanceone
(
BasicGridAcceptance
basicGridAcceptance
,
ProcessTaskDTO
processTaskDTO
,
String
userid
)
{
if
(
processTaskDTO
!=
null
)
{
// 当前节点执行任务id
basicGridAcceptance
.
setPromoter
(
userid
);
// 流程下一节点id
if
(
processTaskDTO
.
getNextTask
()
!=
null
&&
!
processTaskDTO
.
getNextTask
().
isEmpty
())
{
basicGridAcceptance
.
setNextTaskId
(
processTaskDTO
.
getNextTask
().
get
(
0
).
getId
());
//下个节点名称
basicGridAcceptance
.
setNextNodeName
(
processTaskDTO
.
getNextTask
().
get
(
0
).
getName
());
//下个节点key
basicGridAcceptance
.
setNextNodeKey
(
processTaskDTO
.
getNextTask
().
get
(
0
).
getKey
());
}
else
{
return
;
}
/// 下一个节点角色权限
if
(
processTaskDTO
.
getNextCandidateGroups
()
!=
null
)
{
List
<
String
>
ld
=
processTaskDTO
.
getNextCandidateGroups
().
get
(
basicGridAcceptance
.
getNextTaskId
());
StringBuffer
sbf
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<=
ld
.
size
()
-
1
;
i
++)
{
if
(
i
<
ld
.
size
()
-
1
)
{
sbf
.
append
(
ld
.
get
(
i
)
+
","
);
}
else
{
sbf
.
append
(
ld
.
get
(
i
));
}
}
basicGridAcceptance
.
setNextExecutorIds
(
sbf
.
toString
());
}
//下一节点可执行人逗号分割 0 0
if
(
processTaskDTO
.
getNextTaskExecutor
()
!=
null
)
{
List
<
AgencyUserModel
>
li
=
processTaskDTO
.
getNextTaskExecutor
().
get
(
basicGridAcceptance
.
getNextTaskId
());
if
(
li
!=
null
&&
!
li
.
isEmpty
())
{
StringBuffer
sbf
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<=
li
.
size
()
-
1
;
i
++)
{
if
(
i
<
li
.
size
()
-
1
)
{
sbf
.
append
(
li
.
get
(
i
).
getUserId
()
+
","
);
}
else
{
sbf
.
append
(
li
.
get
(
i
).
getUserId
());
}
}
basicGridAcceptance
.
setNextExecuteUserIds
(
sbf
.
toString
());
}
}
}
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/resources/json/urlInfo.json
0 → 100644
View file @
d86a5271
[
{
"type"
:
"AbarbeitungWaitPush"
,
"pageType"
:
""
,
"name"
:
"推送融资"
,
"url"
:
"/mixuap?appId=1678340647909617665&id=1774627124162859009"
},
{
"type"
:
"WaitAbarbeitung"
,
"pageType"
:
""
,
"name"
:
"经销商整改"
,
"url"
:
"/mixuap?appId=1678340647909617665&id=1806150815363108865"
},
{
"type"
:
"FinancingAudit"
,
"pageType"
:
""
,
"name"
:
"融资审核"
,
"url"
:
"/mixuap?appId=1678340647909617665&id=1775075407041662977"
},
{
"type"
:
"AuditPass"
,
"pageType"
:
""
,
"name"
:
"线下放款"
,
"url"
:
"/mixuap?appId=1678340647909617665&id=1805852764345995265"
},
{
"type"
:
"jxs_03"
,
"pageType"
:
""
,
"name"
:
"经销商管理员审核"
,
"url"
:
"/mixuap?appId=1678340647909617665&id=1686219644483956738"
}
]
\ 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