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
a8b1de4d
Commit
a8b1de4d
authored
Jan 26, 2024
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改工作流
parent
dfb525ab
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
392 additions
and
57 deletions
+392
-57
PowerStationEnum.java
...join/amos/boot/module/hygf/api/Enum/PowerStationEnum.java
+66
-0
NumberUtil.java
...om/yeejoin/amos/boot/module/hygf/api/util/NumberUtil.java
+4
-1
PowerStationServiceImpl.java
...module/hygf/biz/service/impl/PowerStationServiceImpl.java
+129
-26
UnitInfoServiceImpl.java
...oot/module/hygf/biz/service/impl/UnitInfoServiceImpl.java
+193
-30
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/Enum/PowerStationEnum.java
0 → 100644
View file @
a8b1de4d
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
api
.
Enum
;
import
lombok.AllArgsConstructor
;
import
lombok.Getter
;
/**
* @description: 验收状态枚举
*/
@Getter
@AllArgsConstructor
@SuppressWarnings
(
"ALL"
)
public
enum
PowerStationEnum
{
经销商确认
(
"经销商确认"
,
"1"
,
"hygf_02"
,
""
),
设计审核
(
"设计审核"
,
"2"
,
"hygf_03"
,
"hygf/Sjsh"
),
投融审核
(
"投融审核"
,
"3"
,
"hygf_05"
,
"hygf/Sjsh"
),
法务审核
(
"法务审核"
,
"4"
,
"hygf_07"
,
"hygf/Sjsh"
),
设计上传典型图纸
(
"设计上传典型图纸"
,
"5"
,
"hygf_09"
,
"hygf/Trsh"
),
经销商设计上传设计图纸
(
"经销商设计上传设计图纸"
,
"6"
,
"hygf_10"
,
"hygf/Fwsh"
),
设计图纸审核
(
"设计图纸审核"
,
"7"
,
"hygf_11"
,
"hygf/Sjsh"
),
完成
(
"完成"
,
"11"
,
"hygf_13"
,
""
);
/**
* 名称,描述
*/
private
final
String
name
;
/**
* 编码
*/
private
final
String
code
;
//节点key
private
final
String
key
;
//路由r
private
final
String
routing
;
public
static
PowerStationEnum
getNodeByCode
(
String
code
)
{
PowerStationEnum
acceptanceStatusEnum
=
null
;
for
(
PowerStationEnum
type
:
PowerStationEnum
.
values
())
{
if
(
code
.
equals
(
type
.
getCode
()))
{
acceptanceStatusEnum
=
type
;
break
;
}
}
return
acceptanceStatusEnum
;
}
public
static
String
getNodeByKey
(
String
Key
)
{
PowerStationEnum
acceptanceStatusEnum
=
null
;
for
(
PowerStationEnum
type
:
PowerStationEnum
.
values
())
{
if
(
type
.
getKey
().
contains
(
Key
))
{
acceptanceStatusEnum
=
type
;
break
;
}
}
return
acceptanceStatusEnum
.
getRouting
();
}
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/util/NumberUtil.java
View file @
a8b1de4d
...
...
@@ -40,13 +40,16 @@ public class NumberUtil {
needQueryResProductList
.
put
(
"num"
,
num
);
return
num
;
}
else
{
int
num
=
1000
+
rand
.
nextInt
(
1
00
)
+
1
;
int
num
=
rand
.
nextInt
(
90
00
)
+
1
;
needQueryResProductList
.
put
(
"num"
,
num
);
return
num
;
}
}
public
static
String
getCode
(
String
type
,
String
code
,
String
address
){
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/service/impl/PowerStationServiceImpl.java
View file @
a8b1de4d
...
...
@@ -8,22 +8,19 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.HouseholdContractEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationNodeEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.PowerStationProcessStateEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.TaskTypeStationEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.PowerStationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.WorkDto
;
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.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.fegin.IdxFeginService
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.*
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IPowerStationService
;
import
com.yeejoin.amos.boot.module.hygf.biz.feign.WorkflowFeignClient
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.robot.AmosRequestContext
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.poi.ss.formula.functions.T
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -81,7 +78,10 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
UserMessageMapper
userMessageMapper
;
@Autowired
PowerStationMapper
powerStationMapper
;
@Autowired
AmosRequestContext
requestContext
;
@Autowired
WorkflowImpl
workflow
;
public
Page
<
PowerStationDto
>
queryForPowerStationUserRoles
(
Page
<
PowerStationDto
>
page
,
String
powerStationCode
,
String
ownersName
,
AgencyUserModel
userInfo
){
String
serviceAgent
=
null
;
...
...
@@ -152,13 +152,13 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
public
boolean
savePowerStation
(
PowerStation
powerStation
,
boolean
flag
,
String
name
,
String
meg
)
{
try
{
//流程节点code
if
(
flag
)
{
String
flowTaskIdnext
=
this
.
getTaskNoAuth
(
powerStation
.
getProcessInstanceId
());
WorkDto
workDto
=
this
.
getNodeInfoCode
(
flowTaskIdnext
);
powerStation
.
setNextProcessNode
(
workDto
.
getNextProcessNode
());
powerStation
.
setNodeRole
(
workDto
.
getNodeRole
());
powerStation
.
setNodeRouting
(
workDto
.
getNodeRouting
());
}
//
if (flag) {
//
String flowTaskIdnext = this.getTaskNoAuth(powerStation.getProcessInstanceId());
//
WorkDto workDto=this.getNodeInfoCode(flowTaskIdnext);
//
powerStation.setNextProcessNode(workDto.getNextProcessNode());
//
powerStation.setNodeRole(workDto.getNodeRole());
//
powerStation.setNodeRouting(workDto.getNodeRouting());
//
}
powerStation
.
setRecDate
(
new
Date
());
...
...
@@ -271,17 +271,39 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
String
code
=
null
;
try
{
// 3. 工作流执行
FeignClientResult
<
String
>
submit
=
idxFeginService
.
submit
(
pageId
,
taskId
,
planInstanceId
,
null
,
null
,
null
,
kv
);
if
(
IDX_REQUEST_STATE
.
equals
(
String
.
valueOf
(
submit
.
getStatus
())))
{
code
=
submit
.
getResult
();
log
.
info
(
"流程执行成功:{}"
,
code
);
//
FeignClientResult<String> submit = idxFeginService.submit(pageId, taskId, planInstanceId, null, null, null, kv);
//
if (IDX_REQUEST_STATE.equals(String.valueOf(submit.getStatus()))) {
//
code = submit.getResult();
//
log.info("流程执行成功:{}", code);
// 获取流程信息
FeignClientResult
<
JSONObject
>
record
=
idxFeginService
.
getRecord
(
code
);
if
(
IDX_REQUEST_STATE
.
equals
(
String
.
valueOf
(
record
.
getStatus
())))
{
JSONObject
resultObj
=
record
.
getResult
();
String
flowTaskId
=
String
.
valueOf
(
resultObj
.
get
(
"flowTaskId"
));
powerStation
.
setFlowTaskId
(
flowTaskId
);
}
// FeignClientResult<JSONObject> record = idxFeginService.getRecord(code);
// if (IDX_REQUEST_STATE.equals(String.valueOf(record.getStatus()))) {
// JSONObject resultObj = record.getResult();
// String flowTaskId = String.valueOf(resultObj.get("flowTaskId"));
//
// }
//执行工作流
BasicGridAcceptance
basicGridAcceptance
=
new
BasicGridAcceptance
();
StandardDto
standardDto
=
new
StandardDto
();
standardDto
.
setComment
(
String
.
valueOf
(
kv
.
get
(
"approveInfo"
)));
standardDto
.
setResult
(
String
.
valueOf
(
kv
.
get
(
"approvalStatus"
)));
standardDto
.
setTaskId
(
powerStation
.
getFlowTaskId
());
VariableDto
variable
=
new
VariableDto
();
variable
.
setApprovalStatus
(
String
.
valueOf
(
kv
.
get
(
"approvalStatus"
)));
variable
.
setComment
(
String
.
valueOf
(
kv
.
get
(
"approveInfo"
)));
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
());
powerStation
.
setFlowTaskId
(
basicGridAcceptance
.
getNextTaskId
());
powerStation
.
setNodeRole
(
basicGridAcceptance
.
getNextExecutorIds
());
powerStation
.
setNodeRouting
(
PowerStationEnum
.
getNodeByKey
(
basicGridAcceptance
.
getNextNodeKey
()));
powerStationService
.
savePowerStation
(
powerStation
,
flag
,
powerStation
.
getOwnersName
(),
meg
);
if
(!
flag
){
//更新农户状态
...
...
@@ -290,12 +312,93 @@ public class PowerStationServiceImpl extends BaseService<PowerStationDto, PowerS
peasantHousehold
.
setSurveyOrNot
(
3
);
peasantHouseholdService
.
saveOrUpdate
(
peasantHousehold
);
}
}
//
}
}
catch
(
Exception
e
){
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
return
code
;
// String meg="";
// // 1. 业务相关数据落表
// PowerStation powerStation = this.baseMapper.selectById(stationId);
// PowerStationNodeEnum nodeByCode = PowerStationNodeEnum.getNodeByCode(nodeCode);
// String result = String.valueOf(kv.get("approvalStatus"));
// boolean flag = true;
// if (PowerStationNodeEnum.设计上传图纸.getCode().equals(nodeCode)||PowerStationNodeEnum.经销商上传图纸.getCode().equals(nodeCode)) {
//
// powerStation.setProcessStatus(PowerStationProcessStateEnum.进行中.getName());
//
// this.updateSeve(nodeCode,powerStation.getPeasantHouseholdId(),kv);
// } else {
//
// if (VERIFY_RESULT_NO.equals(result)) {
// powerStation.setProcessStatus(PowerStationProcessStateEnum.不通过.getName());
// }
// PowerStationProcessStateEnum resultObj = PowerStationProcessStateEnum.getStateByResult(result);
// switch (nodeByCode) {
// case 设计审核:
// powerStation.setTechnologyStatus(resultObj.getName());
// break;
// case 投融审核:
// powerStation.setDesignStatus(resultObj.getName());
// break;
// case 法务审核:
// powerStation.setBusinessStatus(resultObj.getName());
//
// if (VERIFY_RESULT_YES.equals(result)) {
// LambdaUpdateWrapper<HouseholdContract> lambdaUw = new LambdaUpdateWrapper<>();
// lambdaUw.eq(HouseholdContract::getPeasantHouseholdId, powerStation.getPeasantHouseholdId());
// lambdaUw.set(HouseholdContract::getSurveyStatus, HouseholdContractEnum.勘察状态_已勘察.getCode());
// householdContractServiceImpl.update(lambdaUw);
// }
//
// break;
// case 文件审核:
// if (VERIFY_RESULT_YES.equals(result)) {
// flag = false;
// powerStation.setProcessStatus(PowerStationProcessStateEnum.完成.getName());
// }
// powerStation.setDrawingReview(resultObj.getName());
// break;
// default:
// break;
// }
// }
// meg="任务明细:"+nodeByCode+(VERIFY_RESULT_YES.equals(result)?"通过":"不通过");
// // 2. 更新流程状态
// String code = null;
// try{
// // 3. 工作流执行
// FeignClientResult<String> submit = idxFeginService.submit(pageId, taskId, planInstanceId, null, null, null, kv);
// if (IDX_REQUEST_STATE.equals(String.valueOf(submit.getStatus()))) {
// code = submit.getResult();
// log.info("流程执行成功:{}", code);
// // 获取流程信息
// FeignClientResult<JSONObject> record = idxFeginService.getRecord(code);
// if (IDX_REQUEST_STATE.equals(String.valueOf(record.getStatus()))) {
// JSONObject resultObj = record.getResult();
// String flowTaskId = String.valueOf(resultObj.get("flowTaskId"));
// powerStation.setFlowTaskId(flowTaskId);
// }
// powerStationService.savePowerStation(powerStation, flag,powerStation.getOwnersName(),meg);
// if(!flag){
// //更新农户状态
// String peasantHouseholdId = powerStation.getPeasantHouseholdId();
// PeasantHousehold peasantHousehold = peasantHouseholdService.getBaseMapper().selectById(Long.valueOf(peasantHouseholdId));
// peasantHousehold.setSurveyOrNot(3);
// peasantHouseholdService.saveOrUpdate(peasantHousehold);
// }
// }
// }catch (Exception e){
// throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!");
//
// }
// return code;
}
...
...
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 @
a8b1de4d
...
...
@@ -124,6 +124,8 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
@Autowired
PersonnelBusinessMapper
personnelBusinessMapper
;
@Autowired
WorkflowImpl
workflow
;
@Autowired
UserEmpowerMapper
userEmpowerMapper
;
...
...
@@ -468,6 +470,9 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
private
void
submitExamine
(
UnitInfoDto
regUnitInfo
)
{
String
taskId
=
null
;
Map
<
String
,
Object
>
objectMap
=
new
HashMap
<>(
1
);
objectMap
.
put
(
"describe"
,
"经销商已上传信息"
);
...
...
@@ -475,34 +480,71 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
DealerReview
dealerReview
=
new
DealerReview
();
// 保存并审核
try
{
FeignClientResult
<
String
>
submit
=
idxFeginService
.
tokenSubmit
(
AMOS_STUDIO
,
AMOS_STUDIO_WEB
,
requestContext
.
getToken
(),
pageId
,
taskId
,
planId
,
null
,
"DEALER_EXAMINE"
,
null
,
objectMap
);
System
.
out
.
println
(
"经销商注册发起"
+
AMOS_STUDIO
+
"@"
+
AMOS_STUDIO_WEB
+
"@"
+
requestContext
.
getToken
());
if
(
IDX_REQUEST_STATE
.
equals
(
String
.
valueOf
(
submit
.
getStatus
())))
{
String
code
=
submit
.
getResult
();
//发起工作流
// 调用工作流执行第一个节点
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
.
startProcess
(
basicGridAcceptance
,
startProcessDto
,
requestContext
.
getUserId
());
// 插入记录表
dealerReview
.
setPlanInstanceId
(
planId
);
dealerReview
.
setUnitInfoId
(
regUnitInfo
.
getSequenceNbr
());
// 获取流程信息
FeignClientResult
<
JSONObject
>
record
=
idxFeginService
.
getRecordtoken
(
AMOS_STUDIO
,
AMOS_STUDIO_WEB
,
requestContext
.
getToken
(),
code
);
if
(
IDX_REQUEST_STATE
.
equals
(
String
.
valueOf
(
record
.
getStatus
())))
{
JSONObject
resultObj
=
record
.
getResult
();
String
taskIdNew
=
String
.
valueOf
(
resultObj
.
get
(
"taskId"
));
String
processInstanceId
=
String
.
valueOf
(
resultObj
.
get
(
"processInstanceId"
));
String
flowTaskId
=
String
.
valueOf
(
resultObj
.
get
(
"flowTaskId"
));
dealerReview
.
setTaskId
(
taskIdNew
);
dealerReview
.
setProcessInstanceId
(
processInstanceId
);
dealerReview
.
setFlowTaskId
(
flowTaskId
);
dealerReview
.
setTaskId
(
basicGridAcceptance
.
getNextTaskId
());
dealerReview
.
setProcessInstanceId
(
basicGridAcceptance
.
getInstanceId
());
dealerReview
.
setFlowTaskId
(
basicGridAcceptance
.
getNextTaskId
());
dealerReview
.
setNodeRole
(
basicGridAcceptance
.
getNextExecutorIds
());
dealerReview
.
setNextProcessNode
(
DealerReviewEnum
.
经销商管理员审核
.
getCode
());
}
dealerReviewService
.
saveDealerReview
(
dealerReview
,
true
,
false
,
regUnitInfo
.
getName
(),
"任务明细:经销商已上传信息"
);
}
else
{
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
}
catch
(
Exception
e
){
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
//
// String taskId = null;
// Map<String, Object> objectMap = new HashMap<>(1);
// objectMap.put("describe", "经销商已上传信息");
// // 第一步启动工作流
// DealerReview dealerReview = new DealerReview();
// // 保存并审核
// try {
// FeignClientResult<String> submit = idxFeginService.tokenSubmit(AMOS_STUDIO, AMOS_STUDIO_WEB,requestContext.getToken(),pageId, taskId, planId, null, "DEALER_EXAMINE", null, objectMap);
//
//
// System.out.println("发起"+AMOS_STUDIO+"@"+AMOS_STUDIO_WEB+"@"+requestContext.getToken());
// if (IDX_REQUEST_STATE.equals(String.valueOf(submit.getStatus()))) {
// String code = submit.getResult();
// // 插入记录表
// dealerReview.setPlanInstanceId(planId);
// dealerReview.setUnitInfoId(regUnitInfo.getSequenceNbr());
// // 获取流程信息
// FeignClientResult<JSONObject> record = idxFeginService.getRecordtoken(AMOS_STUDIO, AMOS_STUDIO_WEB,requestContext.getToken(),code);
// if (IDX_REQUEST_STATE.equals(String.valueOf(record.getStatus()))) {
// JSONObject resultObj = record.getResult();
// String taskIdNew = String.valueOf(resultObj.get("taskId"));
// String processInstanceId = String.valueOf(resultObj.get("processInstanceId"));
// String flowTaskId = String.valueOf(resultObj.get("flowTaskId"));
// dealerReview.setTaskId(taskIdNew);
// dealerReview.setProcessInstanceId(processInstanceId);
// dealerReview.setFlowTaskId(flowTaskId);
// dealerReview.setNextProcessNode(DealerReviewEnum.经销商管理员审核.getCode());
// }
// dealerReviewService.saveDealerReview(dealerReview,true,false,regUnitInfo.getName(),"任务明细:经销商已上传信息");
// }else{
// throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!");
// }
// } catch (Exception e){
// throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!");
// }
}
...
...
@@ -581,18 +623,28 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
// 2. 更新流程状态
String
code
=
null
;
// 3. 工作流执行
FeignClientResult
<
String
>
submit
=
idxFeginService
.
submit
(
pageId
,
taskId
,
planInstanceId
,
null
,
"DEALER_EXAMINE"
,
null
,
kv
);
if
(
IDX_REQUEST_STATE
.
equals
(
String
.
valueOf
(
submit
.
getStatus
())))
{
code
=
submit
.
getResult
();
// 获取流程信息
FeignClientResult
<
JSONObject
>
record
=
idxFeginService
.
getRecord
(
code
);
if
(
IDX_REQUEST_STATE
.
equals
(
String
.
valueOf
(
record
.
getStatus
())))
{
JSONObject
resultObj
=
record
.
getResult
();
String
flowTaskId
=
String
.
valueOf
(
resultObj
.
get
(
"flowTaskId"
));
dealerReview
.
setFlowTaskId
(
flowTaskId
);
}
//执行工作流
BasicGridAcceptance
basicGridAcceptance
=
new
BasicGridAcceptance
();
StandardDto
standardDto
=
new
StandardDto
();
standardDto
.
setComment
(
String
.
valueOf
(
kv
.
get
(
"approveInfo"
)));
standardDto
.
setResult
(
String
.
valueOf
(
kv
.
get
(
"approvalStatus"
)));
standardDto
.
setTaskId
(
dealerReview
.
getFlowTaskId
());
VariableDto
variable
=
new
VariableDto
();
variable
.
setApprovalStatus
(
String
.
valueOf
(
kv
.
get
(
"approvalStatus"
)));
variable
.
setComment
(
String
.
valueOf
(
kv
.
get
(
"approveInfo"
)));
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
());
dealerReview
.
setFlowTaskId
(
basicGridAcceptance
.
getNextTaskId
());
dealerReviewService
.
saveDealerReview
(
dealerReview
,
false
,
true
,
unitInfo
.
getName
(),
approvalStatue
);
}
this
.
saveOrUpdate
(
unitInfo
);
}
catch
(
Exception
e
){
...
...
@@ -618,6 +670,117 @@ public class UnitInfoServiceImpl extends BaseService<UnitInfoDto,UnitInfo,UnitIn
throw
new
BaseException
(
"获取工作流节点失败!"
,
"400"
,
"获取工作流节点失败!"
);
}
// // 2.更新审核记录表
// 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="";
// if (DealerReviewEnum.经销商管理员审核.getCode().equals(nodeCode)) {
// String result = String.valueOf(kv.get("approvalStatus"));
// if (VERIFY_RESULT_NO.equals(result)) {
// // 1. 更新经销商状态
// unitInfo.setAuditStatus(3);
// //发送断线
// 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());
// params.put("smsCode", smsTempCode);
// approvalStatue="任务明细:"+DealerReviewEnum.经销商管理员审核.getName()+"审核不通过";
// FeignClientResult<SmsRecordModel> date= Systemctl.smsClient.sendCommonSms(params);
// }else{
// // 1. 更新经销商状态
// unitInfo.setAuditStatus(2);
// unitInfo.setBlacklist(0);
//
//
// this.createCompanyAndUsernew(unitInfo);
// PublicAgencyUser publicAgencyUser=new PublicAgencyUser();
// publicAgencyUser.setAmosUserId(unitInfo.getAdminUserId());
// publicAgencyUser.setAmosUserName(unitInfo.getAdminLoginName());
// publicAgencyUser.setRealName(unitInfo.getAdminLoginName());
// publicAgencyUser.setRole("["+unitInfo.getRoleId()+"]");
// publicAgencyUser.setEmergencyTelephone(unitInfo.getAdminPhone());
// publicAgencyUser.setLockStatus("UNLOCK");
// publicAgencyUserMapper.insert(publicAgencyUser);
//
// 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);
// for (RegionalCompanies companies : list) {
// companies.setUnitId(unitInfo.getAmosCompanySeq());
// lis.add(companies.getRegionalCompaniesCode());
// }
// regionalCompaniesService.saveOrUpdateBatch(list);
//
// PersonnelBusiness re=new PersonnelBusiness();
// re.setAmosDealerId(unitInfo.getAmosCompanySeq());
// re.setAmosUnitId(unitInfo.getAmosCompanySeq());
// re.setAmosUnitName(unitInfo.getName());
// re.setAmosUnitOrgCode(unitInfo.getAmosCompanyCode());
// re.setFoundationId(publicAgencyUser.getSequenceNbr());
// re.setUserType("2");
// personnelBusinessMapper.insert(re);
//
// //管理员绑定角色权限
// StdUserEmpower stdUserEmpower=new StdUserEmpower();
// stdUserEmpower.setAmosUserId(unitInfo.getAdminUserId());
// stdUserEmpower.setAmosOrgCode(lis);
// userEmpowerMapper.insert(stdUserEmpower);
//
// // Privilege.agencyUserClient.unlockUsers(unitInfo.getAdminUserId());
// approvalStatue="任务明细:"+DealerReviewEnum.经销商管理员审核.getName()+"审核通过";
// }
// }
// // 2. 更新流程状态
// String code = null;
// // 3. 工作流执行
// FeignClientResult<String> submit = idxFeginService.submit(pageId, taskId, planInstanceId, null, "DEALER_EXAMINE", null, kv);
// if (IDX_REQUEST_STATE.equals(String.valueOf(submit.getStatus()))) {
// code = submit.getResult();
// // 获取流程信息
// FeignClientResult<JSONObject> record = idxFeginService.getRecord(code);
// if (IDX_REQUEST_STATE.equals(String.valueOf(record.getStatus()))) {
// JSONObject resultObj = record.getResult();
// String flowTaskId = String.valueOf(resultObj.get("flowTaskId"));
// dealerReview.setFlowTaskId(flowTaskId);
// }
// dealerReviewService.saveDealerReview(dealerReview,false,true,unitInfo.getName(),approvalStatue);
// }
// this.saveOrUpdate(unitInfo);
// }catch (Exception e){
//
// if (!ObjectUtils.isEmpty(unitInfo.getAmosCompanySeq())) {
// FeignClientResult<CompanyModel> feignClientResult = Privilege.companyClient
// .seleteOne(unitInfo.getAmosCompanySeq());
// if (feignClientResult != null) {
// Privilege.companyClient.deleteCompany(unitInfo.getAmosCompanySeq().toString());
// }
// }
// // 失败后回滚:删除已经创建的管理员账号
// if (StringUtils.isNotEmpty(unitInfo.getAdminUserId())) {
// FeignClientResult<AgencyUserModel> feignClientResult = Privilege.agencyUserClient
// .queryByUserId(unitInfo.getAdminUserId());
// if (feignClientResult != null) {
// Privilege.agencyUserClient.multDeleteUser(unitInfo.getAdminUserId());
// }
// }
//
//
//
//
// throw new BaseException("获取工作流节点失败!","400","获取工作流节点失败!");
//
// }
return
code
;
}
...
...
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