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
f33d4e17
Commit
f33d4e17
authored
Aug 22, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
并网优化
parent
c288c153
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
465 additions
and
24 deletions
+465
-24
MyBatisPlusCodeGenerator.java
.../amos/boot/biz/common/utils/MyBatisPlusCodeGenerator.java
+4
-4
GridStatusEnum.java
...eejoin/amos/boot/module/hygf/api/Enum/GridStatusEnum.java
+8
-4
BasicGridAcceptanceController.java
...le/hygf/biz/controller/BasicGridAcceptanceController.java
+63
-0
BasicGridAcceptanceServiceImpl.java
...hygf/biz/service/impl/BasicGridAcceptanceServiceImpl.java
+390
-16
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/MyBatisPlusCodeGenerator.java
View file @
f33d4e17
...
@@ -103,12 +103,12 @@ public class MyBatisPlusCodeGenerator {
...
@@ -103,12 +103,12 @@ public class MyBatisPlusCodeGenerator {
gc
.
setActiveRecord
(
false
);
gc
.
setActiveRecord
(
false
);
// 数据源配置
// 数据源配置
DataSourceConfig
dsc
=
new
DataSourceConfig
();
DataSourceConfig
dsc
=
new
DataSourceConfig
();
dsc
.
setUrl
(
"jdbc:mysql://47.92.234.253:3306/amos_project?serverTimezone=GMT%2B8"
);
dsc
.
setUrl
(
"jdbc:mysql://47.92.234.253:
1
3306/amos_project?serverTimezone=GMT%2B8"
);
// dsc.setSchemaName("public");
// dsc.setSchemaName("public");
// dsc.setDriverName("com.mysql.jdbc.Driver");
// dsc.setDriverName("com.mysql.jdbc.Driver");
dsc
.
setDriverName
(
"com.mysql.cj.jdbc.Driver"
);
dsc
.
setDriverName
(
"com.mysql.cj.jdbc.Driver"
);
dsc
.
setUsername
(
"root"
);
dsc
.
setUsername
(
"root"
);
dsc
.
setPassword
(
"Yeejoin
@2020
"
);
dsc
.
setPassword
(
"Yeejoin
_1234
"
);
dsc
.
setTypeConvert
(
new
ITypeConvert
()
{
dsc
.
setTypeConvert
(
new
ITypeConvert
()
{
@Override
@Override
...
@@ -130,7 +130,7 @@ public class MyBatisPlusCodeGenerator {
...
@@ -130,7 +130,7 @@ public class MyBatisPlusCodeGenerator {
// 包配置
// 包配置
final
PackageConfig
pc
=
new
PackageConfig
();
final
PackageConfig
pc
=
new
PackageConfig
();
// 填写对应模块
// 填写对应模块
pc
.
setModuleName
(
projectShortName
);
pc
.
setModuleName
(
projectShortName
1
);
// 实体路径
// 实体路径
pc
.
setParent
(
"com.yeejoin.amos.boot.module"
);
pc
.
setParent
(
"com.yeejoin.amos.boot.module"
);
pc
.
setEntity
(
"api.entity"
);
pc
.
setEntity
(
"api.entity"
);
...
@@ -294,7 +294,7 @@ public class MyBatisPlusCodeGenerator {
...
@@ -294,7 +294,7 @@ public class MyBatisPlusCodeGenerator {
strategy
.
setTablePrefix
();
strategy
.
setTablePrefix
();
//去除表名前缀
//去除表名前缀
strategy
.
setTablePrefix
(
"tz_"
+
projectShortName1
+
"_"
,
"t_"
,
"tb_"
,
"sys_"
,
"other_"
,
"rpm_"
,
"s_"
,
"tcb_"
,
strategy
.
setTablePrefix
(
"tz_"
+
projectShortName1
+
"_"
,
"t_"
,
"tb_"
,
"sys_"
,
"other_"
,
"rpm_"
,
"s_"
,
"tcb_"
,
"cb_"
,
"tz_"
,
"jc_"
,
"jcb_"
,
"flc_"
);
"cb_"
,
"tz_"
,
"jc_"
,
"jcb_"
,
"flc_"
,
"hygf_"
);
// 设置父级Controller
// 设置父级Controller
strategy
.
setSuperControllerClass
(
"com.yeejoin.amos.boot.biz.common.controller.BaseController"
);
strategy
.
setSuperControllerClass
(
"com.yeejoin.amos.boot.biz.common.controller.BaseController"
);
autoGenerator
.
setStrategy
(
strategy
);
autoGenerator
.
setStrategy
(
strategy
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/Enum/GridStatusEnum.java
View file @
f33d4e17
...
@@ -14,12 +14,16 @@ public enum GridStatusEnum {
...
@@ -14,12 +14,16 @@ public enum GridStatusEnum {
DDJ
(
"待登记"
,
"1"
),
DDJ
(
"待登记"
,
"1"
),
JXSGLYDSH
(
"经销商管理员待审核"
,
"2"
),
DSH
(
"待审核"
,
"2"
),
YWC
(
"已完成"
,
"3"
),
YWC
(
"已完成"
,
"3"
),
WTG
(
"未通过"
,
"4"
),
ZGDSH
(
"整改待审核"
,
"5"
),
PQYYDSH
(
"片区运营待审核"
,
"6"
),
GCDSH
(
"工程待审核"
,
"7"
),
SJDSH
(
"设计待审核"
,
"8"
),
DZG
(
"待整改"
,
"9"
),
ROLESDSH
(
"设计待审核/工程待审核"
,
"10"
);
WTG
(
"未通过"
,
"4"
);
/**
/**
* 名称,描述
* 名称,描述
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/BasicGridAcceptanceController.java
View file @
f33d4e17
...
@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAcceptanceDto;
...
@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAcceptanceDto;
import
com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.AcceptanceCheckItem
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.AcceptanceCheckItem
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HygfOnGrid
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HygfOnGrid
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HygfRectificationOrder
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAcceptanceMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAcceptanceMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.HygfOnGridMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.HygfOnGridMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.PersonnelBusinessMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.PersonnelBusinessMapper
;
...
@@ -23,6 +24,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
...
@@ -23,6 +24,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
*
*
...
@@ -190,6 +192,67 @@ public class BasicGridAcceptanceController extends BaseController {
...
@@ -190,6 +192,67 @@ public class BasicGridAcceptanceController extends BaseController {
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"完工自审管理审核"
,
notes
=
"完工自审管理审核"
)
@PostMapping
(
value
=
"/completeAudit"
)
public
ResponseModel
completeAudit
(
@RequestBody
Map
<
String
,
String
>
kv
)
{
basicGridAcceptanceServiceImpl
.
completeAudit
(
kv
);
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"整改单下发"
,
notes
=
"整改单下发"
)
@PostMapping
(
value
=
"/addRectification"
)
public
ResponseModel
addRectification
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
basicGridAcceptanceServiceImpl
.
addRectification
(
hygfReplenishment
);
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"整改单添加信息"
,
notes
=
"整改单添加信息"
)
@PostMapping
(
value
=
"/nextTaskExcute"
)
public
ResponseModel
nextTaskExcute
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
basicGridAcceptanceServiceImpl
.
nextTaskExcute
(
hygfReplenishment
);
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"整改单审核"
,
notes
=
"整改单审核"
)
@PostMapping
(
value
=
"/nextTaskAduit"
)
public
ResponseModel
nextTaskAduit
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
basicGridAcceptanceServiceImpl
.
nextTaskAduit
(
hygfReplenishment
);
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"整改单作废"
,
notes
=
"整改单作废"
)
@PutMapping
(
value
=
"/rollback"
)
public
ResponseModel
rollback
(
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
basicGridAcceptanceServiceImpl
.
rollback
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/test1"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"执行工作流"
,
notes
=
"执行工作流"
)
public
ResponseModel
test
()
{
basicGridAcceptanceServiceImpl
.
testKAIQI
();
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/test2"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"执行工作流"
,
notes
=
"执行工作流"
)
public
ResponseModel
test
(
String
approvalStatus
,
String
comment
)
{
basicGridAcceptanceServiceImpl
.
zhixing
(
approvalStatus
,
comment
);
return
ResponseHelper
.
buildResponse
(
null
);
}
}
}
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 @
f33d4e17
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
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.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.*
;
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.*
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.*
;
...
@@ -13,16 +15,23 @@ import com.yeejoin.amos.boot.module.hygf.api.service.IBasicGridAcceptanceService
...
@@ -13,16 +15,23 @@ import com.yeejoin.amos.boot.module.hygf.api.service.IBasicGridAcceptanceService
import
com.yeejoin.amos.boot.module.hygf.api.util.NumberUtil
;
import
com.yeejoin.amos.boot.module.hygf.api.util.NumberUtil
;
import
com.yeejoin.amos.boot.module.hygf.api.util.RedisLockUtil
;
import
com.yeejoin.amos.boot.module.hygf.api.util.RedisLockUtil
;
import
com.yeejoin.amos.component.robot.BadRequest
;
import
com.yeejoin.amos.component.robot.BadRequest
;
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
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.BooleanUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.
utils.DateUtil
;
import
org.typroject.tyboot.core.foundation.
context.RequestContext
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Slf4j
@Slf4j
@Service
@Service
...
@@ -36,6 +45,8 @@ public class BasicGridAcceptanceServiceImpl
...
@@ -36,6 +45,8 @@ public class BasicGridAcceptanceServiceImpl
@Autowired
@Autowired
HygfOnGridMapper
onGridMapper
;
HygfOnGridMapper
onGridMapper
;
@Autowired
@Autowired
private
WorkFlowService
workFlowService
;
@Autowired
HygfOnGridServiceImpl
hygfOnGridServiceImpl
;
HygfOnGridServiceImpl
hygfOnGridServiceImpl
;
@Autowired
@Autowired
PersonnelBusinessMapper
personnelBusinessMapper
;
PersonnelBusinessMapper
personnelBusinessMapper
;
...
@@ -55,13 +66,21 @@ public class BasicGridAcceptanceServiceImpl
...
@@ -55,13 +66,21 @@ public class BasicGridAcceptanceServiceImpl
PeasantHouseholdMapper
peasantHouseholdMapper
;
PeasantHouseholdMapper
peasantHouseholdMapper
;
@Autowired
@Autowired
private
CommonServiceImpl
commonService
;
private
CommonServiceImpl
commonService
;
@Autowired
RectificationOrderAuditingServiceImpl
rectificationOrderAuditingService
;
@Autowired
HygfRectificationOrderServiceImpl
rectificationOrderService
;
@Autowired
BasicGridAuditingServiceImpl
basicGridAuditingService
;
@Autowired
BasicGridRecordServiceImpl
basicGridRecordService
;
private
final
String
OK
=
"0"
;
private
final
String
OK
=
"0"
;
private
final
String
PASS
=
"5"
;
private
final
String
PASS
=
"5"
;
public
Page
<
BasicGridAcceptanceDto
>
selectPage
(
Long
regionCompanyId
,
Long
amosDealerId
,
int
current
,
int
size
,
public
Page
<
BasicGridAcceptanceDto
>
selectPage
(
Long
regionCompanyId
,
Long
amosDealerId
,
int
current
,
int
size
,
String
projectAddress
,
String
powerStationCode
,
String
ownersName
,
String
gridStatus
,
String
projectAddress
,
String
powerStationCode
,
String
ownersName
,
String
gridStatus
,
String
gridConnectionTime
,
String
formType
)
throws
Exception
{
String
gridConnectionTime
,
String
formType
)
throws
Exception
{
PageHelper
.
startPage
(
current
,
size
);
PageHelper
.
startPage
(
current
,
size
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Date
date
=
null
;
Date
date
=
null
;
...
@@ -93,13 +112,71 @@ public class BasicGridAcceptanceServiceImpl
...
@@ -93,13 +112,71 @@ public class BasicGridAcceptanceServiceImpl
return
grid
;
return
grid
;
}
}
public
void
testKAIQI
(){
//开启工作流 并执行一步
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
params
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
dto
.
setProcessDefinitionKey
(
"BINGWANGTEST"
);
dto
.
setBusinessKey
(
String
.
valueOf
(
new
Date
().
getTime
()));
dto
.
setCompleteFirstTask
(
true
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"approvalStatus"
,
"0"
);
dto
.
setVariables
(
map
);
params
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
params
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
workFlowService
.
startBatch
(
actWorkflowBatchDTO
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
processTaskDTOS
);
WorkflowResultDto
workflowResultDto
=
workflowResultDtos
.
get
(
0
);
BasicGridAuditingDto
basicGridAuditingDto
=
new
BasicGridAuditingDto
();
BeanUtils
.
copyProperties
(
workflowResultDto
,
basicGridAuditingDto
);
basicGridAuditingDto
.
setPeasantHouseholdId
(
20248001107L
);
basicGridAuditingDto
.
setPromoter
(
RequestContext
.
getExeUserId
());
basicGridAuditingService
.
createWithModel
(
basicGridAuditingDto
);
}
public
void
zhixing
(
String
approvalStatus
,
String
comment
){
LambdaQueryWrapper
<
BasicGridAuditing
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
BasicGridAuditing:
:
getPeasantHouseholdId
,
20248001107L
);
query
.
orderByDesc
(
BaseEntity:
:
getRecDate
);
query
.
last
(
"limit 1"
);
BasicGridAuditing
basicGridAuditing
=
basicGridAuditingService
.
getBaseMapper
().
selectOne
(
query
);
//组装信息
TaskResultDTO
task
=
new
TaskResultDTO
();
task
.
setTaskId
(
basicGridAuditing
.
getNextTaskId
());
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
BasicGridAuditingDto
basicGridAuditingDto
=
new
BasicGridAuditingDto
();
task
.
setResultCode
(
"approvalStatus"
);
map
.
put
(
"approvalStatus"
,
approvalStatus
);
task
.
setComment
(
comment
==
null
?
""
:
comment
);
task
.
setVariable
(
map
);
//执行流程
ProcessTaskDTO
processTaskDTO
=
workFlowService
.
complete
(
basicGridAuditing
.
getNextTaskId
(),
task
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
CollectionUtil
.
newArrayList
(
processTaskDTO
));
WorkflowResultDto
workflowResultDto
=
workflowResultDtos
.
get
(
0
);
BeanUtils
.
copyProperties
(
workflowResultDto
,
basicGridAuditingDto
);
basicGridAuditingDto
.
setPeasantHouseholdId
(
basicGridAuditing
.
getPeasantHouseholdId
());
basicGridAuditingDto
.
setPromoter
(
basicGridAuditing
.
getPromoter
());
basicGridAuditingDto
.
setStatus
(
approvalStatus
);
if
(
null
==
basicGridAuditingDto
.
getInstanceId
())
{
basicGridAuditingDto
.
setInstanceId
(
basicGridAuditing
.
getInstanceId
());
}
basicGridAuditingService
.
createWithModel
(
basicGridAuditingDto
);
}
@Transactional
@Transactional
public
synchronized
HygfOnGrid
saveAndCommit
(
HygfOnGrid
grid
,
String
userId
)
{
public
synchronized
HygfOnGrid
saveAndCommit
(
HygfOnGrid
grid
,
String
userId
)
{
BasicGridAcceptance
basicGridAcceptance
=
basicGridAcceptanceMapper
BasicGridAcceptance
basicGridAcceptance
=
basicGridAcceptanceMapper
.
selectOne
(
new
LambdaQueryWrapper
<
BasicGridAcceptance
>()
.
selectOne
(
new
LambdaQueryWrapper
<
BasicGridAcceptance
>()
.
eq
(
BasicGridAcceptance:
:
getWorkOrderPowerStationId
,
grid
.
getWorkOrderPowerStationId
()));
.
eq
(
BasicGridAcceptance:
:
getWorkOrderPowerStationId
,
grid
.
getWorkOrderPowerStationId
()));
basicGridAcceptance
.
setGridStatus
(
GridStatusEnum
.
DSH
.
getCode
());
basicGridAcceptance
.
setGridStatus
(
GridStatusEnum
.
JXSGLY
DSH
.
getCode
());
if
(
grid
.
getType
()
!=
null
&&
"1"
.
equals
(
grid
.
getType
()))
{
if
(
grid
.
getType
()
!=
null
&&
"1"
.
equals
(
grid
.
getType
()))
{
// 执行工作流
// 执行工作流
...
@@ -108,15 +185,27 @@ public class BasicGridAcceptanceServiceImpl
...
@@ -108,15 +185,27 @@ public class BasicGridAcceptanceServiceImpl
workflow
.
standard
(
basicGridAcceptance
,
standardDto
,
userId
);
workflow
.
standard
(
basicGridAcceptance
,
standardDto
,
userId
);
}
else
{
}
else
{
// 调用工作流执行第一个节点
//开启工作流 并执行一步
ProcessDto
processDto
=
new
ProcessDto
();
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
processDto
.
setProcessDefinitionKey
(
"hygf_bwys"
);
List
<
ActWorkflowStartDTO
>
params
=
new
ArrayList
<>();
processDto
.
setBusinessKey
(
String
.
valueOf
(
basicGridAcceptance
.
getSequenceNbr
()));
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
StartProcessDto
startProcessDto
=
new
StartProcessDto
();
dto
.
setProcessDefinitionKey
(
"GridConnected"
);
List
<
ProcessDto
>
process
=
new
ArrayList
<>();
dto
.
setBusinessKey
(
String
.
valueOf
(
new
Date
().
getTime
()));
process
.
add
(
processDto
);
dto
.
setCompleteFirstTask
(
true
);
startProcessDto
.
setProcess
(
process
);
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
workflow
.
startProcess
(
basicGridAcceptance
,
startProcessDto
,
userId
);
map
.
put
(
"approvalStatus"
,
"0"
);
dto
.
setVariables
(
map
);
params
.
add
(
dto
);
actWorkflowBatchDTO
.
setProcess
(
params
);
List
<
ProcessTaskDTO
>
processTaskDTOS
=
workFlowService
.
startBatch
(
actWorkflowBatchDTO
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
processTaskDTOS
);
WorkflowResultDto
workflowResultDto
=
workflowResultDtos
.
get
(
0
);
BasicGridAuditingDto
basicGridAuditingDto
=
new
BasicGridAuditingDto
();
BeanUtils
.
copyProperties
(
workflowResultDto
,
basicGridAuditingDto
);
basicGridAuditingDto
.
setPeasantHouseholdId
(
grid
.
getPeasantHouseholdId
());
basicGridAuditingDto
.
setPromoter
(
RequestContext
.
getExeUserId
());
basicGridAuditingService
.
createWithModel
(
basicGridAuditingDto
);
// 线上验收
// 线上验收
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
...
@@ -126,7 +215,7 @@ public class BasicGridAcceptanceServiceImpl
...
@@ -126,7 +215,7 @@ public class BasicGridAcceptanceServiceImpl
peasantHouseholdMapper
.
update
(
null
,
up
);
peasantHouseholdMapper
.
update
(
null
,
up
);
}
}
//防止重复提交
//防止重复提交
// if (grid.getSequenceNbr() != null) {
// if (grid.getSequenceNbr() != null) {
// onGridMapper.updateById(grid);
// onGridMapper.updateById(grid);
...
@@ -136,9 +225,12 @@ public class BasicGridAcceptanceServiceImpl
...
@@ -136,9 +225,12 @@ public class BasicGridAcceptanceServiceImpl
LambdaQueryWrapper
<
HygfOnGrid
>
hog
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
HygfOnGrid
>
hog
=
new
LambdaQueryWrapper
<>();
hog
.
eq
(
HygfOnGrid:
:
getPeasantHouseholdId
,
grid
.
getPeasantHouseholdId
());
hog
.
eq
(
HygfOnGrid:
:
getPeasantHouseholdId
,
grid
.
getPeasantHouseholdId
());
hygfOnGridServiceImpl
.
saveOrUpdate
(
grid
,
hog
);
hygfOnGridServiceImpl
.
saveOrUpdate
(
grid
,
hog
);
basicGridAcceptanceMapper
.
updateById
(
basicGridAcceptance
);
basicGridAcceptanceMapper
.
updateById
(
basicGridAcceptance
);
BasicGridRecord
basicGridRecord
=
new
BasicGridRecord
();
BeanUtils
.
copyProperties
(
basicGridAcceptance
,
basicGridRecord
);
basicGridRecord
.
setBasicGridNode
(
"jxsAdmin"
);
basicGridRecordService
.
saveOrUpdate
(
basicGridRecord
);
//发起待办
//发起待办
// commonService.buildTaskModel(buildBWYSTaskModel(grid, basicGridAcceptance));
// commonService.buildTaskModel(buildBWYSTaskModel(grid, basicGridAcceptance));
return
grid
;
return
grid
;
...
@@ -333,4 +425,286 @@ public class BasicGridAcceptanceServiceImpl
...
@@ -333,4 +425,286 @@ public class BasicGridAcceptanceServiceImpl
}
}
}
}
// 工作流执行一步
public
void
wofkflowExcute
(
String
instanceId
,
String
approvalStatus
,
String
comment
)
{
LambdaQueryWrapper
<
BasicGridAuditing
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
BasicGridAuditing:
:
getInstanceId
,
instanceId
);
query
.
orderByDesc
(
BaseEntity:
:
getRecDate
);
query
.
last
(
"limit 1"
);
BasicGridAuditing
basicGridAuditing
=
basicGridAuditingService
.
getBaseMapper
().
selectOne
(
query
);
//组装信息
TaskResultDTO
task
=
new
TaskResultDTO
();
task
.
setTaskId
(
basicGridAuditing
.
getNextTaskId
());
HashMap
<
String
,
Object
>
map
=
new
HashMap
<>();
BasicGridAuditingDto
basicGridAuditingDto
=
new
BasicGridAuditingDto
();
task
.
setResultCode
(
"approvalStatus"
);
map
.
put
(
"approvalStatus"
,
approvalStatus
);
task
.
setComment
(
comment
==
null
?
""
:
comment
);
task
.
setVariable
(
map
);
//执行流程
ProcessTaskDTO
processTaskDTO
=
workFlowService
.
complete
(
basicGridAuditing
.
getNextTaskId
(),
task
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
CollectionUtil
.
newArrayList
(
processTaskDTO
));
WorkflowResultDto
workflowResultDto
=
workflowResultDtos
.
get
(
0
);
BeanUtils
.
copyProperties
(
workflowResultDto
,
basicGridAuditingDto
);
basicGridAuditingDto
.
setPeasantHouseholdId
(
basicGridAuditing
.
getPeasantHouseholdId
());
basicGridAuditingDto
.
setPromoter
(
basicGridAuditing
.
getPromoter
());
basicGridAuditingDto
.
setStatus
(
approvalStatus
);
if
(
null
==
basicGridAuditingDto
.
getInstanceId
())
{
basicGridAuditingDto
.
setInstanceId
(
basicGridAuditing
.
getInstanceId
());
}
basicGridAuditingService
.
createWithModel
(
basicGridAuditingDto
);
}
public
void
completeAdminAudit
(
Map
<
String
,
String
>
kv
)
{
String
instanceId
=
kv
.
get
(
"instanceId"
);
String
sequenceNbr
=
kv
.
get
(
"sequenceNbr"
);
String
comment
=
kv
.
get
(
"comment"
);
String
approvalStatus
=
kv
.
get
(
"approvalStatus"
);
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
().
selectById
(
sequenceNbr
);
//执行工作流
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
);
//修改并网数据状态
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
PQYYDSH
.
getCode
());
basicGridRecord
.
setBasicGridNode
(
"bw-area"
);
basicGridRecordService
.
updateById
(
basicGridRecord
);
}
public
void
completeAudit
(
Map
<
String
,
String
>
kv
)
{
String
instanceId
=
kv
.
get
(
"instanceId"
);
String
sequenceNbr
=
kv
.
get
(
"sequenceNbr"
);
String
comment
=
kv
.
get
(
"comment"
);
String
status
=
kv
.
get
(
"status"
);
String
approvalStatus
=
kv
.
get
(
"approvalStatus"
);
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
().
selectById
(
sequenceNbr
);
LambdaUpdateWrapper
<
BasicGridRecord
>
up
=
new
LambdaUpdateWrapper
<>();
switch
(
status
){
case
"bw-area"
:
up
.
set
(
BasicGridRecord:
:
getPowerStationAreaStatus
,
approvalStatus
.
equals
(
"0"
)?
"通过"
:
"驳回"
);
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-design,bw-engineering"
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ROLESDSH
.
getCode
());
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
);
break
;
case
"bw-design"
:
up
.
set
(
BasicGridRecord:
:
getPowerStationDesignStatus
,
approvalStatus
.
equals
(
"0"
)?
"通过"
:
"驳回"
);
if
(
basicGridRecord
.
getPowerStationEngineeringStatus
()
!=
null
&&
basicGridRecord
.
getPowerStationEngineeringStatus
().
equals
(
"通过"
)&&
approvalStatus
.
equals
(
"0"
)
){
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
YWC
.
getCode
());
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
);
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"all"
);
}
else
if
(
null
==
basicGridRecord
.
getPowerStationEngineeringStatus
()
&&
approvalStatus
.
equals
(
"0"
)
)
{
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-engineering"
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
GCDSH
.
getCode
());
}
else
if
(
basicGridRecord
.
getPowerStationEngineeringStatus
().
equals
(
"驳回"
)){
throw
new
BadRequest
(
"该流程已被工程人员审核驳回,请刷新列表"
);
}
break
;
default
:
up
.
set
(
BasicGridRecord:
:
getPowerStationEngineeringStatus
,
approvalStatus
.
equals
(
"0"
)?
"通过"
:
"驳回"
);
if
(
basicGridRecord
.
getPowerStationDesignStatus
()
!=
null
&&
basicGridRecord
.
getPowerStationEngineeringStatus
().
equals
(
"通过"
)&&
approvalStatus
.
equals
(
"0"
)
){
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
YWC
.
getCode
());
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
);
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"all"
);
}
else
if
(
null
==
basicGridRecord
.
getPowerStationEngineeringStatus
()
&&
approvalStatus
.
equals
(
"0"
)
)
{
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-design"
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
if
(
basicGridRecord
.
getPowerStationEngineeringStatus
().
equals
(
"驳回"
)){
throw
new
BadRequest
(
"该流程已被设计人员审核驳回,请刷新列表"
);
}
break
;
}
if
(
approvalStatus
.
equals
(
"1"
)
){
up
.
eq
(
BaseEntity:
:
getSequenceNbr
,
sequenceNbr
);
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
null
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
WTG
.
getCode
());
basicGridRecordService
.
getBaseMapper
().
update
(
null
,
up
);
}
//修改并网数据状态
if
(
StringUtils
.
isNotEmpty
(
sequenceNbr
)){
up
.
eq
(
BaseEntity:
:
getSequenceNbr
,
sequenceNbr
);
basicGridRecordService
.
getBaseMapper
().
update
(
null
,
up
);
}
}
public
void
addRectification
(
HygfRectificationOrder
hygfRectificationOrder
)
{
//查询当前并网数据
LambdaQueryWrapper
<
BasicGridRecord
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
().
selectOne
(
wrapper
);
if
(!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
())){
hygfRectificationOrder
.
setRectificationStatus
(
WorkOrderEnum
.
待提交
.
getCode
());
rectificationOrderAuditingService
.
addRectification
(
hygfRectificationOrder
);
throw
new
BadRequest
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
}
String
addorSubmit
=
hygfRectificationOrder
.
getAddorSubmit
();;
LambdaUpdateWrapper
<
BasicGridRecord
>
qu
=
new
LambdaUpdateWrapper
();
if
(
basicGridRecord
.
getRectificationStatus
()
!=
null
){
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
basicGridRecord
.
getRectificationStatus
()+
","
+
hygfRectificationOrder
.
getRectificationSource
());
}
else
{
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
hygfRectificationOrder
.
getRectificationSource
());
}
//修改状态
if
(
addorSubmit
.
equals
(
"0"
)){
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
DZG
.
getCode
());
}
qu
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
basicGridRecordService
.
update
(
null
,
qu
);
}
public
void
nextTaskExcute
(
HygfRectificationOrder
hygfRectificationOrder
)
{
//查询当前并网数据
LambdaQueryWrapper
<
BasicGridRecord
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
().
selectOne
(
wrapper
);
if
(!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
())){
hygfRectificationOrder
.
setRectificationStatus
(
WorkOrderEnum
.
整改中
.
getCode
());
rectificationOrderAuditingService
.
addRectification
(
hygfRectificationOrder
);
throw
new
BadRequest
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
}
if
(
hygfRectificationOrder
.
getAddorSubmit
().
equals
(
"0"
)
)
{
LambdaUpdateWrapper
<
BasicGridRecord
>
up
=
new
LambdaUpdateWrapper
<>();
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ZGDSH
.
getCode
());
up
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
basicGridRecordService
.
update
(
null
,
up
);
hygfRectificationOrder
.
setRectificationStatus
(
WorkOrderEnum
.
待审核
.
getCode
());
}
else
{
hygfRectificationOrder
.
setRectificationStatus
(
WorkOrderEnum
.
整改中
.
getCode
());
}
rectificationOrderAuditingService
.
nextTaskExcute
(
hygfRectificationOrder
);
}
public
void
nextTaskAduit
(
HygfRectificationOrder
hygfRectificationOrder
)
{
String
auditResult
=
hygfRectificationOrder
.
getAuditResult
();
//查询当前并网数据
LambdaQueryWrapper
<
BasicGridRecord
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
().
selectOne
(
wrapper
);
if
(!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
())){
throw
new
BadRequest
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
}
//修改整改单状态
hygfRectificationOrder
.
setRectificationStatus
(
auditResult
.
equals
(
"通过"
)?
WorkOrderEnum
.
已完成
.
getCode
():
WorkOrderEnum
.
待整改
.
getCode
());
rectificationOrderAuditingService
.
nextTaskAduit
(
hygfRectificationOrder
);
//查询是否还有其它类型待整改的整改单存在 若存在后置节点为当前并网状态
LambdaQueryWrapper
<
HygfRectificationOrder
>
wr
=
new
LambdaQueryWrapper
<>();
wr
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
wr
.
notIn
(
HygfRectificationOrder:
:
getRectificationStatus
,
Arrays
.
asList
(
"待提交"
,
"已作废"
,
"已完成"
));
wr
.
ne
(
BaseEntity:
:
getSequenceNbr
,
hygfRectificationOrder
.
getSequenceNbr
());
List
<
HygfRectificationOrder
>
list
=
rectificationOrderService
.
getBaseMapper
().
selectList
(
wr
);
//修改并网状态
//片区不存在并行 无需复杂判断 工程与设计并行 需要做额外逻辑判断
if
(
auditResult
.
equals
(
"通过"
)){
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
"bw_area"
)){
LambdaUpdateWrapper
<
BasicGridRecord
>
qu
=
new
LambdaUpdateWrapper
();
qu
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
PQYYDSH
.
getCode
());
basicGridRecordService
.
update
(
null
,
qu
);
}
else
{
if
(
CollectionUtil
.
isEmpty
(
list
))
{
//若两者状态都为空 说明均为审核 若某一审核状态为空 则审核状态修改为为空审核节点
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
()
)
&&
Objects
.
isNull
(
basicGridRecord
.
getPowerStationEngineeringStatus
())){
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
ROLESDSH
.
getCode
());
}
else
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
()
)
){
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
{
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
GCDSH
.
getCode
());
}
}
else
{
List
<
String
>
collect
=
list
.
stream
().
map
(
HygfRectificationOrder:
:
getRectificationStatus
).
collect
(
Collectors
.
toList
());
LambdaUpdateWrapper
<
BasicGridRecord
>
qu
=
new
LambdaUpdateWrapper
();
qu
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
collect
.
contains
(
WorkOrderEnum
.
整改待审核
.
getCode
())?
GridStatusEnum
.
ZGDSH
.
getCode
():
GridStatusEnum
.
DZG
.
getCode
());
basicGridRecordService
.
update
(
null
,
qu
);
}
}
}
else
{
//驳回的时候 也需根据 工程或者设计 整改单状态修改并网状态
LambdaUpdateWrapper
<
BasicGridRecord
>
qu
=
new
LambdaUpdateWrapper
();
qu
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
if
(
CollectionUtil
.
isEmpty
(
list
))
{
List
<
String
>
collect
=
list
.
stream
().
map
(
HygfRectificationOrder:
:
getRectificationStatus
).
collect
(
Collectors
.
toList
());
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
collect
.
contains
(
WorkOrderEnum
.
整改待审核
.
getCode
())?
GridStatusEnum
.
ZGDSH
.
getCode
():
GridStatusEnum
.
DZG
.
getCode
());
}
else
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
DZG
.
getCode
());
}
basicGridRecordService
.
update
(
null
,
qu
);
}
}
public
void
rollback
(
Long
sequenceNbr
)
{
HygfRectificationOrder
hygfRectificationOrder
=
rectificationOrderService
.
getBaseMapper
().
selectById
(
sequenceNbr
);
//查询当前并网数据
LambdaQueryWrapper
<
BasicGridRecord
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
().
selectOne
(
wrapper
);
if
(!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
())){
throw
new
BadRequest
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
}
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
WorkOrderEnum
.
待提交
.
getCode
())
||
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
WorkOrderEnum
.
待整改
.
getCode
())){
rectificationOrderAuditingService
.
rollback
(
sequenceNbr
);
}
else
{
throw
new
BadRequest
(
"仅单据状态为待提交或待整改时方可作废"
);
}
if
(
hygfRectificationOrder
.
getRectificationSource
().
equals
(
"bw_area"
)){
basicGridRecord
.
setBasicGridNode
(
GridStatusEnum
.
PQYYDSH
.
getCode
());
}
else
{
//查询是否还有其它类型待整改的整改单存在 若存在后置节点为当前并网状态
LambdaQueryWrapper
<
HygfRectificationOrder
>
wr
=
new
LambdaQueryWrapper
<>();
wr
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
wr
.
notIn
(
HygfRectificationOrder:
:
getRectificationStatus
,
Arrays
.
asList
(
"待提交"
,
"已作废"
,
"已完成"
));
wr
.
ne
(
BaseEntity:
:
getSequenceNbr
,
hygfRectificationOrder
.
getSequenceNbr
());
List
<
HygfRectificationOrder
>
list
=
rectificationOrderService
.
getBaseMapper
().
selectList
(
wr
);
if
(
CollectionUtil
.
isEmpty
(
list
))
{
//若两者状态都为空 说明均为审核 若某一审核状态为空 则审核状态修改为为空审核节点
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
()
)
&&
Objects
.
isNull
(
basicGridRecord
.
getPowerStationEngineeringStatus
())){
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
ROLESDSH
.
getCode
());
}
else
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
()
)
){
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
{
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
GCDSH
.
getCode
());
}
}
else
{
List
<
String
>
collect
=
list
.
stream
().
map
(
HygfRectificationOrder:
:
getRectificationStatus
).
collect
(
Collectors
.
toList
());
LambdaUpdateWrapper
<
BasicGridRecord
>
qu
=
new
LambdaUpdateWrapper
();
qu
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
collect
.
contains
(
WorkOrderEnum
.
整改待审核
.
getCode
())?
GridStatusEnum
.
ZGDSH
.
getCode
():
GridStatusEnum
.
DZG
.
getCode
());
basicGridRecordService
.
update
(
null
,
qu
);
}
}
basicGridRecordService
.
updateById
(
basicGridRecord
);
}
}
}
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