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
0fc23279
Commit
0fc23279
authored
Sep 12, 2024
by
wujiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加并网 验收 身份
parent
ce82fb58
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
477 additions
and
461 deletions
+477
-461
AcceptanceCheckController.java
...module/hygf/biz/controller/AcceptanceCheckController.java
+5
-4
BasicGridAcceptanceController.java
...le/hygf/biz/controller/BasicGridAcceptanceController.java
+108
-118
AcceptanceCheckServiceImpl.java
...ule/hygf/biz/service/impl/AcceptanceCheckServiceImpl.java
+2
-1
BasicGridAcceptanceServiceImpl.java
...hygf/biz/service/impl/BasicGridAcceptanceServiceImpl.java
+362
-338
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/AcceptanceCheckController.java
View file @
0fc23279
...
...
@@ -7,10 +7,10 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.AcceptanceCheck;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HygfRectificationOrder
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.Api
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.ArrayList
;
...
...
@@ -205,7 +205,8 @@ public class AcceptanceCheckController extends BaseController {
@RequestParam
(
required
=
false
,
value
=
"ownersName"
)
String
ownersName
,
@RequestParam
(
required
=
false
,
value
=
"acceptanceCheckStatus"
)
String
acceptanceCheckStatus
,
@RequestParam
(
required
=
false
,
value
=
"type"
)
String
type
,
@RequestParam
(
required
=
false
,
value
=
"acceptanceTime"
)
String
acceptanceTime
)
throws
Exception
{
@RequestParam
(
required
=
false
,
value
=
"acceptanceTime"
)
String
acceptanceTime
,
@RequestParam
(
required
=
false
,
value
=
"province"
)
String
province
)
throws
Exception
{
//当前登录人所属场站
// UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
...
...
@@ -234,7 +235,7 @@ public class AcceptanceCheckController extends BaseController {
basicGridNodes
.
add
(
"ys-zichan"
);
}
}
Page
<
AcceptanceCheckDto
>
page
=
acceptanceCheckServiceImpl
.
selectPage
(
null
,
null
,
current
,
size
,
projectAddress
,
powerStationCode
,
ownersName
,
acceptanceCheckStatus
,
acceptanceTime
,
""
,
basicGridNodes
,
type
);
Page
<
AcceptanceCheckDto
>
page
=
acceptanceCheckServiceImpl
.
selectPage
(
null
,
null
,
current
,
size
,
projectAddress
,
powerStationCode
,
ownersName
,
acceptanceCheckStatus
,
acceptanceTime
,
""
,
basicGridNodes
,
type
,
province
);
//根据角色及当前节点判断是否有操作权限
if
(
basicGridNodes
!=
null
){
for
(
AcceptanceCheckDto
e
:
page
.
getRecords
())
{
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/BasicGridAcceptanceController.java
View file @
0fc23279
...
...
@@ -43,14 +43,14 @@ import java.util.*;
@RequestMapping
(
value
=
"/basic-grid-acceptance"
)
public
class
BasicGridAcceptanceController
extends
BaseController
{
@Autowired
BasicGridAcceptanceServiceImpl
basicGridAcceptanceServiceImpl
;
@Autowired
BasicGridAcceptanceServiceImpl
basicGridAcceptanceServiceImpl
;
@Autowired
BasicGridAcceptanceMapper
basicGridAcceptanceMapper
;
@Autowired
HygfOnGridMapper
onGridMapper
;
@Autowired
PersonnelBusinessMapper
personnelBusinessMapper
;
@Autowired
PersonnelBusinessMapper
personnelBusinessMapper
;
@Autowired
WorkflowImpl
workflow
;
...
...
@@ -63,17 +63,17 @@ public class BasicGridAcceptanceController extends BaseController {
@Value
(
"${admin.delerAdmin.roleId}"
)
Long
delerAdminId
;
/**
* 新增保存
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
/**
* 新增保存
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
save
(
@RequestBody
HygfOnGrid
dto
)
{
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
saveEntity
(
dto
));
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
saveEntity
(
dto
));
}
/**
...
...
@@ -85,72 +85,74 @@ public class BasicGridAcceptanceController extends BaseController {
@PostMapping
(
value
=
"/save/commit"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@Transactional
public
ResponseModel
saveAndCommit
(
@RequestBody
HygfOnGrid
dto
)
{
public
ResponseModel
saveAndCommit
(
@RequestBody
HygfOnGrid
dto
)
{
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
saveAndCommit
(
dto
,
getSelectedOrgInfo
().
getUserModel
().
getRealName
()));
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
saveAndCommit
(
dto
,
getSelectedOrgInfo
().
getUserModel
().
getRealName
()));
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
updateBySequenceNbrBasicGridAcceptance
(
@RequestBody
HygfOnGrid
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
modifyEntity
(
model
));
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
modifyEntity
(
model
));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除"
,
notes
=
"根据sequenceNbr删除"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
@RequestParam
(
"sequenceNbrs"
)
Long
[]
sequenceNbrs
)
{
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
deleteForBatch
(
sequenceNbrs
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr
主键
* @return
*/
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除"
,
notes
=
"根据sequenceNbr删除"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
@RequestParam
(
"sequenceNbrs"
)
Long
[]
sequenceNbrs
)
{
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
deleteForBatch
(
sequenceNbrs
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个"
,
notes
=
"根据sequenceNbr查询单个"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个"
,
notes
=
"根据sequenceNbr查询单个"
)
public
ResponseModel
<
BasicGridAcceptanceDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
queryBySeq
(
sequenceNbr
));
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
* 经销商端列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
* 经销商端列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
@UserLimits
public
ResponseModel
<
Page
<
BasicGridRecordDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
required
=
false
,
value
=
"projectAddress"
)
String
projectAddress
,
@RequestParam
(
required
=
false
,
value
=
"powerStationCode"
)
String
powerStationCode
,
@RequestParam
(
required
=
false
,
value
=
"ownersName"
)
String
ownersName
,
@RequestParam
(
required
=
false
,
value
=
"gridStatus"
)
String
gridStatus
,
@RequestParam
(
required
=
false
,
value
=
"type"
)
String
type
,
@RequestParam
(
required
=
false
,
value
=
"gridConnectionTime"
)
String
gridConnectionTime
)
throws
Exception
{
//当前登录人所属场站
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
required
=
false
,
value
=
"projectAddress"
)
String
projectAddress
,
@RequestParam
(
required
=
false
,
value
=
"powerStationCode"
)
String
powerStationCode
,
@RequestParam
(
required
=
false
,
value
=
"ownersName"
)
String
ownersName
,
@RequestParam
(
required
=
false
,
value
=
"gridStatus"
)
String
gridStatus
,
@RequestParam
(
required
=
false
,
value
=
"type"
)
String
type
,
@RequestParam
(
required
=
false
,
value
=
"gridConnectionTime"
)
String
gridConnectionTime
,
@RequestParam
(
required
=
false
,
value
=
"province"
)
String
province
)
throws
Exception
{
// 当前登录人所属场站
// UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
ReginParams
reginParams
=
getSelectedOrgInfo
();
...
...
@@ -174,22 +176,24 @@ public class BasicGridAcceptanceController extends BaseController {
basicGridNodes
.
add
(
"bw-area"
);
}
}
Page
<
BasicGridRecordDto
>
page
=
basicGridAcceptanceServiceImpl
.
selectPage
(
null
,
null
,
current
,
size
,
projectAddress
,
powerStationCode
,
ownersName
,
gridStatus
,
gridConnectionTime
,
""
,
basicGridNodes
,
type
);
//根据角色及当前节点判断是否有操作权限
if
(
basicGridNodes
!=
null
){
Page
<
BasicGridRecordDto
>
page
=
basicGridAcceptanceServiceImpl
.
selectPage
(
null
,
null
,
current
,
size
,
projectAddress
,
powerStationCode
,
ownersName
,
gridStatus
,
gridConnectionTime
,
""
,
basicGridNodes
,
type
,
province
);
// 根据角色及当前节点判断是否有操作权限
if
(
basicGridNodes
!=
null
)
{
for
(
BasicGridRecordDto
e
:
page
.
getRecords
())
{
for
(
String
g
:
basicGridNodes
)
{
if
(
null
!=
e
.
getBasicGridNode
()
&&
e
.
getBasicGridNode
().
contains
(
g
)
&&
(
roleIds
.
contains
(
areaId
)
||
roleIds
.
contains
(
designId
)
||
roleIds
.
contains
(
engineeringId
))){
if
(
null
!=
e
.
getBasicGridNode
()
&&
e
.
getBasicGridNode
().
contains
(
g
)
&&
(
roleIds
.
contains
(
areaId
)
||
roleIds
.
contains
(
designId
)
||
roleIds
.
contains
(
engineeringId
)))
{
e
.
setIsAudit
(
"0"
);
break
;
}
else
{
}
else
{
e
.
setIsAudit
(
"1"
);
}
}
}
}
return
ResponseHelper
.
buildResponse
(
page
);
return
ResponseHelper
.
buildResponse
(
page
);
}
/**
...
...
@@ -201,112 +205,99 @@ public class BasicGridAcceptanceController extends BaseController {
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/check/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
@UserLimits
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询"
,
notes
=
"分页查询"
)
@UserLimits
public
ResponseModel
<
Page
<
BasicGridRecordDto
>>
queryForCheckPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
required
=
false
,
value
=
"projectAddress"
)
String
projectAddress
,
@RequestParam
(
required
=
false
,
value
=
"powerStationCode"
)
String
powerStationCode
,
@RequestParam
(
required
=
false
,
value
=
"ownersName"
)
String
ownersName
,
@RequestParam
(
required
=
false
,
value
=
"gridStatus"
)
String
gridStatus
,
@RequestParam
(
required
=
false
,
value
=
"gridConnectionTime"
)
String
gridConnectionTime
)
throws
Exception
{
//当前登录人所属场站
Page
<
BasicGridRecordDto
>
page
=
basicGridAcceptanceServiceImpl
.
selectPage
(
null
,
null
,
current
,
size
,
projectAddress
,
powerStationCode
,
ownersName
,
gridStatus
,
gridConnectionTime
,
"check"
,
null
,
null
);
@RequestParam
(
value
=
"size"
)
int
size
,
@RequestParam
(
required
=
false
,
value
=
"projectAddress"
)
String
projectAddress
,
@RequestParam
(
required
=
false
,
value
=
"powerStationCode"
)
String
powerStationCode
,
@RequestParam
(
required
=
false
,
value
=
"ownersName"
)
String
ownersName
,
@RequestParam
(
required
=
false
,
value
=
"gridStatus"
)
String
gridStatus
,
@RequestParam
(
required
=
false
,
value
=
"gridConnectionTime"
)
String
gridConnectionTime
,
@RequestParam
(
required
=
false
,
value
=
"province"
)
String
province
)
throws
Exception
{
// 当前登录人所属场站
Page
<
BasicGridRecordDto
>
page
=
basicGridAcceptanceServiceImpl
.
selectPage
(
null
,
null
,
current
,
size
,
projectAddress
,
powerStationCode
,
ownersName
,
gridStatus
,
gridConnectionTime
,
"check"
,
null
,
null
,
province
);
return
ResponseHelper
.
buildResponse
(
page
);
}
/**
* 列表全部数据查询
*
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表全部数据查询"
,
notes
=
"列表全部数据查询"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"列表全部数据查询"
,
notes
=
"列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
BasicGridAcceptanceDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
Collections
.
emptyList
());
return
ResponseHelper
.
buildResponse
(
Collections
.
emptyList
());
}
// 并网审核
//并网审核
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/execute"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"执行工作流"
,
notes
=
"执行工作流"
)
public
ResponseModel
execute
(
@RequestBody
AcceptanceCheckItem
dto
)
{
basicGridAcceptanceServiceImpl
.
execute
(
dto
,
getUserId
());
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/execute"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"执行工作流"
,
notes
=
"执行工作流"
)
public
ResponseModel
execute
(
@RequestBody
AcceptanceCheckItem
dto
)
{
basicGridAcceptanceServiceImpl
.
execute
(
dto
,
getUserId
());
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"完工自审-经销商管理"
,
notes
=
"完工自审经销商管理"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"完工自审-经销商管理"
,
notes
=
"完工自审经销商管理"
)
@PostMapping
(
value
=
"/completeAdminAudit"
)
@Transactional
public
ResponseModel
completeAdminAudit
(
@RequestBody
Map
<
String
,
String
>
kv
)
{
public
ResponseModel
completeAdminAudit
(
@RequestBody
Map
<
String
,
String
>
kv
)
{
basicGridAcceptanceServiceImpl
.
completeAdminAudit
(
kv
);
return
ResponseHelper
.
buildResponse
(
null
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"完工自审管理审核"
,
notes
=
"完工自审管理审核"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"完工自审管理审核"
,
notes
=
"完工自审管理审核"
)
@PostMapping
(
value
=
"/completeAudit"
)
@Transactional
public
ResponseModel
completeAudit
(
@RequestBody
Map
<
String
,
String
>
kv
)
{
return
basicGridAcceptanceServiceImpl
.
completeAudit
(
kv
);
public
ResponseModel
completeAudit
(
@RequestBody
Map
<
String
,
String
>
kv
)
{
return
basicGridAcceptanceServiceImpl
.
completeAudit
(
kv
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"整改单下发"
,
notes
=
"整改单下发"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"整改单下发"
,
notes
=
"整改单下发"
)
@PostMapping
(
value
=
"/addRectification"
)
@Transactional
public
ResponseModel
addRectification
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
public
ResponseModel
addRectification
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
return
basicGridAcceptanceServiceImpl
.
addRectification
(
hygfReplenishment
);
return
basicGridAcceptanceServiceImpl
.
addRectification
(
hygfReplenishment
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"整改单添加信息"
,
notes
=
"整改单添加信息"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"整改单添加信息"
,
notes
=
"整改单添加信息"
)
@PostMapping
(
value
=
"/nextTaskExcute"
)
@Transactional
public
ResponseModel
nextTaskExcute
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
public
ResponseModel
nextTaskExcute
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
return
basicGridAcceptanceServiceImpl
.
nextTaskExcute
(
hygfReplenishment
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"整改单审核"
,
notes
=
"整改单审核"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"整改单审核"
,
notes
=
"整改单审核"
)
@PostMapping
(
value
=
"/nextTaskAduit"
)
@Transactional
public
ResponseModel
nextTaskAduit
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
public
ResponseModel
nextTaskAduit
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
return
basicGridAcceptanceServiceImpl
.
nextTaskAduit
(
hygfReplenishment
);
return
basicGridAcceptanceServiceImpl
.
nextTaskAduit
(
hygfReplenishment
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"整改单作废"
,
notes
=
"整改单作废"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"整改单作废"
,
notes
=
"整改单作废"
)
@PutMapping
(
value
=
"/rollback"
)
@Transactional
public
ResponseModel
rollback
(
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
public
ResponseModel
rollback
(
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
basicGridAcceptanceServiceImpl
.
rollback
(
sequenceNbr
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/test1"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"执行工作流"
,
notes
=
"执行工作流"
)
...
...
@@ -318,10 +309,9 @@ public class BasicGridAcceptanceController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/test2"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"执行工作流"
,
notes
=
"执行工作流"
)
public
ResponseModel
test
(
String
approvalStatus
,
String
comment
)
{
basicGridAcceptanceServiceImpl
.
zhixing
(
approvalStatus
,
comment
);
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/AcceptanceCheckServiceImpl.java
View file @
0fc23279
...
...
@@ -73,7 +73,7 @@ public class AcceptanceCheckServiceImpl extends BaseService<AcceptanceCheckDto,A
public
Page
<
AcceptanceCheckDto
>
selectPage
(
Long
regionCompanyId
,
Long
amosDealerId
,
int
current
,
int
size
,
String
projectAddress
,
String
powerStationCode
,
String
ownersName
,
String
acceptanceCheckStatus
,
String
gridConnectionTime
,
String
formType
,
List
<
String
>
basicGridNodes
,
String
type
)
throws
Exception
{
String
gridConnectionTime
,
String
formType
,
List
<
String
>
basicGridNodes
,
String
type
,
String
province
)
throws
Exception
{
PageHelper
.
startPage
(
current
,
size
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Date
date
=
null
;
...
...
@@ -90,6 +90,7 @@ public class AcceptanceCheckServiceImpl extends BaseService<AcceptanceCheckDto,A
map
.
put
(
"amosDealerId"
,
amosDealerId
);
map
.
put
(
"basicGridNodes"
,
basicGridNodes
);
map
.
put
(
"type"
,
type
);
map
.
put
(
"province"
,
province
);
List
<
AcceptanceCheckDto
>
list
=
acceptanceCheckMapper
.
selectPageList
(
map
);
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
...
...
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 @
0fc23279
...
...
@@ -68,7 +68,7 @@ public class BasicGridAcceptanceServiceImpl
RegionalCompaniesMapper
regionalCompaniesMapper
;
@Autowired
WorkOrderMapper
workOrderMapper
;
@Resource
(
type
=
RedisLockUtil
.
class
)
@Resource
(
type
=
RedisLockUtil
.
class
)
private
RedisLockUtil
redisLockUtil
;
@Autowired
PeasantHouseholdMapper
peasantHouseholdMapper
;
...
...
@@ -93,8 +93,9 @@ public class BasicGridAcceptanceServiceImpl
private
final
String
PASS
=
"5"
;
public
Page
<
BasicGridRecordDto
>
selectPage
(
Long
regionCompanyId
,
Long
amosDealerId
,
int
current
,
int
size
,
String
projectAddress
,
String
powerStationCode
,
String
ownersName
,
String
gridStatus
,
String
gridConnectionTime
,
String
formType
,
List
<
String
>
basicGridNodes
,
String
type
)
throws
Exception
{
String
projectAddress
,
String
powerStationCode
,
String
ownersName
,
String
gridStatus
,
String
gridConnectionTime
,
String
formType
,
List
<
String
>
basicGridNodes
,
String
type
,
String
province
)
throws
Exception
{
PageHelper
.
startPage
(
current
,
size
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Date
date
=
null
;
...
...
@@ -109,8 +110,9 @@ public class BasicGridAcceptanceServiceImpl
map
.
put
(
"formType"
,
formType
);
map
.
put
(
"regionCompanyId"
,
regionCompanyId
);
map
.
put
(
"amosDealerId"
,
amosDealerId
);
map
.
put
(
"basicGridNodes"
,
basicGridNodes
);
map
.
put
(
"type"
,
type
);
map
.
put
(
"basicGridNodes"
,
basicGridNodes
);
map
.
put
(
"type"
,
type
);
map
.
put
(
"province"
,
province
);
List
<
BasicGridRecordDto
>
list
=
basicGridAcceptanceMapper
.
selectPageList
(
map
);
PageInfo
<
BasicGridRecordDto
>
page
=
new
PageInfo
(
list
);
Page
<
BasicGridRecordDto
>
pageNew
=
new
Page
<>();
...
...
@@ -118,11 +120,12 @@ public class BasicGridAcceptanceServiceImpl
pageNew
.
setTotal
(
page
.
getTotal
());
pageNew
.
setSize
(
size
);
if
(
page
.
getList
()
!=
null
&&
page
.
getList
().
size
()
>
0
)
{
if
(
page
.
getList
()
!=
null
&&
page
.
getList
().
size
()
>
0
)
{
page
.
getList
().
forEach
(
e
->
{
if
(
e
.
getPeasantHouseholdNo
()
!=
null
)
{
if
(
e
.
getPeasantHouseholdNo
()
!=
null
)
{
e
.
setScale
(
householdContractMapper
.
getHygfCommercialScale
(
e
.
getPeasantHouseholdNo
()));
e
.
setRealScale
(
powerStationEngineeringInfoMapper
.
getRealScaleByPeasantHouseholdNo
(
e
.
getPeasantHouseholdNo
()));
e
.
setRealScale
(
powerStationEngineeringInfoMapper
.
getRealScaleByPeasantHouseholdNo
(
e
.
getPeasantHouseholdNo
()));
}
});
}
...
...
@@ -134,12 +137,12 @@ public class BasicGridAcceptanceServiceImpl
public
synchronized
HygfOnGrid
saveEntity
(
HygfOnGrid
grid
)
{
LambdaQueryWrapper
<
HygfOnGrid
>
hog
=
new
LambdaQueryWrapper
<>();
hog
.
eq
(
HygfOnGrid:
:
getPeasantHouseholdId
,
grid
.
getPeasantHouseholdId
());
hygfOnGridServiceImpl
.
saveOrUpdate
(
grid
,
hog
);
hygfOnGridServiceImpl
.
saveOrUpdate
(
grid
,
hog
);
return
grid
;
}
public
void
testKAIQI
(){
//开启工作流 并执行一步
public
void
testKAIQI
()
{
//
开启工作流 并执行一步
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
params
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
...
...
@@ -154,7 +157,7 @@ public class BasicGridAcceptanceServiceImpl
List
<
ProcessTaskDTO
>
processTaskDTOS
=
workFlowService
.
startBatch
(
actWorkflowBatchDTO
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfos
(
processTaskDTOS
);
workflowResultDtos
.
forEach
(
e
->
{
workflowResultDtos
.
forEach
(
e
->
{
BasicGridAuditingDto
basicGridAuditingDto
=
new
BasicGridAuditingDto
();
BeanUtils
.
copyProperties
(
e
,
basicGridAuditingDto
);
basicGridAuditingDto
.
setPeasantHouseholdId
(
20248001107L
);
...
...
@@ -164,16 +167,15 @@ public class BasicGridAcceptanceServiceImpl
}
public
void
zhixing
(
String
approvalStatus
,
String
comment
){
public
void
zhixing
(
String
approvalStatus
,
String
comment
)
{
LambdaQueryWrapper
<
BasicGridAuditing
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
BasicGridAuditing:
:
getPeasantHouseholdId
,
20248001107L
);
query
.
eq
(
BasicGridAuditing:
:
getNextNodeKey
,
"gongchengshenhe"
);
query
.
eq
(
BasicGridAuditing:
:
getNextNodeKey
,
"gongchengshenhe"
);
query
.
orderByDesc
(
BaseEntity:
:
getRecDate
);
query
.
last
(
"limit 1"
);
BasicGridAuditing
basicGridAuditing
=
basicGridAuditingService
.
getBaseMapper
().
selectOne
(
query
);
//组装信息
//
组装信息
TaskResultDTO
task
=
new
TaskResultDTO
();
task
.
setTaskId
(
basicGridAuditing
.
getNextTaskId
());
...
...
@@ -181,11 +183,12 @@ public class BasicGridAcceptanceServiceImpl
BasicGridAuditingDto
basicGridAuditingDto
=
new
BasicGridAuditingDto
();
task
.
setResultCode
(
"approvalStatus"
);
map
.
put
(
"approvalStatus"
,
approvalStatus
);
task
.
setComment
(
comment
==
null
?
""
:
comment
);
task
.
setComment
(
comment
==
null
?
""
:
comment
);
task
.
setVariable
(
map
);
//执行流程
//
执行流程
ProcessTaskDTO
processTaskDTO
=
workFlowService
.
complete
(
basicGridAuditing
.
getNextTaskId
(),
task
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
CollectionUtil
.
newArrayList
(
processTaskDTO
));
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
CollectionUtil
.
newArrayList
(
processTaskDTO
));
WorkflowResultDto
workflowResultDto
=
workflowResultDtos
.
get
(
0
);
BeanUtils
.
copyProperties
(
workflowResultDto
,
basicGridAuditingDto
);
basicGridAuditingDto
.
setPeasantHouseholdId
(
basicGridAuditing
.
getPeasantHouseholdId
());
...
...
@@ -197,25 +200,23 @@ public class BasicGridAcceptanceServiceImpl
basicGridAuditingService
.
createWithModel
(
basicGridAuditingDto
);
}
public
synchronized
HygfOnGrid
saveAndCommit
(
HygfOnGrid
grid
,
String
realName
)
{
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
()
.
selectOne
(
new
LambdaQueryWrapper
<
BasicGridRecord
>()
.
eq
(
BasicGridRecord:
:
getWorkOrderPowerStationId
,
grid
.
getWorkOrderPowerStationId
()));
.
selectOne
(
new
LambdaQueryWrapper
<
BasicGridRecord
>().
eq
(
BasicGridRecord:
:
getWorkOrderPowerStationId
,
grid
.
getWorkOrderPowerStationId
()));
LambdaUpdateWrapper
<
BasicGridRecord
>
update
=
new
LambdaUpdateWrapper
<>();
update
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
JXSGLYDSH
.
getCode
());
update
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"jxsAdmin"
);
update
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
JXSGLYDSH
.
getCode
());
update
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"jxsAdmin"
);
if
(
grid
.
getType
()
!=
null
&&
"1"
.
equals
(
grid
.
getType
()))
{
// 执行工作流
this
.
wofkflowExcute
(
basicGridRecord
.
getInstanceId
(),
"0"
,
"重新登记"
,
BusinessWorkflowKey
.
并网登记
.
getCode
());
update
.
set
(
BasicGridRecord:
:
getPowerStationAreaStatus
,
null
);
update
.
set
(
BasicGridRecord:
:
getPowerStationDesignStatus
,
null
);
update
.
set
(
BasicGridRecord:
:
getPowerStationEngineeringStatus
,
null
);
this
.
wofkflowExcute
(
basicGridRecord
.
getInstanceId
(),
"0"
,
"重新登记"
,
BusinessWorkflowKey
.
并网登记
.
getCode
());
update
.
set
(
BasicGridRecord:
:
getPowerStationAreaStatus
,
null
);
update
.
set
(
BasicGridRecord:
:
getPowerStationDesignStatus
,
null
);
update
.
set
(
BasicGridRecord:
:
getPowerStationEngineeringStatus
,
null
);
}
else
{
//开启工作流 并执行一步
//
开启工作流 并执行一步
ActWorkflowBatchDTO
actWorkflowBatchDTO
=
new
ActWorkflowBatchDTO
();
List
<
ActWorkflowStartDTO
>
params
=
new
ArrayList
<>();
ActWorkflowStartDTO
dto
=
new
ActWorkflowStartDTO
();
...
...
@@ -236,7 +237,7 @@ public class BasicGridAcceptanceServiceImpl
basicGridAuditingDto
.
setPeasantHouseholdId
(
grid
.
getPeasantHouseholdId
());
basicGridAuditingDto
.
setPromoter
(
RequestContext
.
getExeUserId
());
basicGridAuditingService
.
createWithModel
(
basicGridAuditingDto
);
update
.
set
(
BasicGridRecord:
:
getInstanceId
,
basicGridAuditingDto
.
getInstanceId
());
update
.
set
(
BasicGridRecord:
:
getInstanceId
,
basicGridAuditingDto
.
getInstanceId
());
// 线上验收
LambdaUpdateWrapper
<
PeasantHousehold
>
up
=
new
LambdaUpdateWrapper
<>();
...
...
@@ -246,7 +247,7 @@ public class BasicGridAcceptanceServiceImpl
peasantHouseholdMapper
.
update
(
null
,
up
);
}
//防止重复提交
//
防止重复提交
// if (grid.getSequenceNbr() != null) {
// onGridMapper.updateById(grid);
// } else {
...
...
@@ -254,17 +255,16 @@ public class BasicGridAcceptanceServiceImpl
// }
LambdaQueryWrapper
<
HygfOnGrid
>
hog
=
new
LambdaQueryWrapper
<>();
hog
.
eq
(
HygfOnGrid:
:
getPeasantHouseholdId
,
grid
.
getPeasantHouseholdId
());
hygfOnGridServiceImpl
.
saveOrUpdate
(
grid
,
hog
);
update
.
eq
(
BaseEntity:
:
getSequenceNbr
,
basicGridRecord
.
getSequenceNbr
());
basicGridRecordService
.
update
(
null
,
update
);
hygfOnGridServiceImpl
.
saveOrUpdate
(
grid
,
hog
);
update
.
eq
(
BaseEntity:
:
getSequenceNbr
,
basicGridRecord
.
getSequenceNbr
());
basicGridRecordService
.
update
(
null
,
update
);
ConstructionGirdRecords
da
=
new
ConstructionGirdRecords
(
realName
,
"提交并网资料"
,
new
Date
(),
""
,
basicGridRecord
.
getSequenceNbr
(),
basicGridRecord
.
getWorkOrderPowerStationId
(),
ConstructionGirdRecords
da
=
new
ConstructionGirdRecords
(
realName
,
"提交并网资料"
,
new
Date
(),
""
,
basicGridRecord
.
getSequenceNbr
(),
basicGridRecord
.
getWorkOrderPowerStationId
(),
basicGridRecord
.
getPeasantHouseholdId
(),
""
);
constructionGirdRecords
.
save
(
da
);
//发起待办
//
发起待办
// commonService.buildTaskModel(buildBWYSTaskModel(grid, basicGridAcceptance));
return
grid
;
}
...
...
@@ -335,7 +335,8 @@ public class BasicGridAcceptanceServiceImpl
}
try
{
// 查询并网审批信息
BasicGridAcceptance
basicGridAcceptanc
=
basicGridAcceptanceMapper
.
selectById
(
dto
.
getBasicGridAcceptanceId
());
BasicGridAcceptance
basicGridAcceptanc
=
basicGridAcceptanceMapper
.
selectById
(
dto
.
getBasicGridAcceptanceId
());
String
beforeAcceptanceStatus
=
basicGridAcceptanc
.
getAcceptanceStatus
();
String
nextNodeKey
=
basicGridAcceptanc
.
getNextNodeKey
();
if
(
OK
.
equals
(
dto
.
getApprovalStatus
()))
{
...
...
@@ -355,19 +356,21 @@ public class BasicGridAcceptanceServiceImpl
peasantHouseholdMapper
.
update
(
null
,
up
);
}
else
{
AcceptanceStatusEnum
acceptanceStatus
=
AcceptanceStatusEnum
.
getAcceptanceStatusByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
());
AcceptanceStatusEnum
acceptanceStatus
=
AcceptanceStatusEnum
.
getAcceptanceStatusByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
());
if
(
acceptanceStatus
==
null
)
{
// 说明工作流节点状态执行错误
throw
new
BadRequest
(
"其他用户正在操作,请刷新后再试!"
);
}
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
}
}
else
{
if
(
BasicGridAcceptancEnum
.
并网管理端工程审核
.
getCode
().
equals
(
nextNodeKey
))
{
basicGridAcceptanc
.
setGridStatus
(
GridStatusEnum
.
WTG
.
getCode
());
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
}
// 投融/法务/工程/线下验收审核不通过
else
if
(
BasicGridAcceptancEnum
.
管理端投融审核
.
getCode
().
equals
(
nextNodeKey
)
...
...
@@ -386,21 +389,23 @@ public class BasicGridAcceptanceServiceImpl
rectificationOrder
.
setWorkOrderPowerStationId
(
basicGridAcceptanc
.
getWorkOrderPowerStationId
());
rectificationOrder
.
setPeasantHouseholdId
(
basicGridAcceptanc
.
getPeasantHouseholdId
());
rectificationOrder
.
setProblemDescription
(
dto
.
getComment
());
rectificationOrder
.
setRectificationStatus
(
String
.
valueOf
(
RectificationStatusEnum
.
待整改
.
getCode
()));
rectificationOrder
.
setRectificationStatus
(
String
.
valueOf
(
RectificationStatusEnum
.
待整改
.
getCode
()));
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
acceptanceRectificationOrderMapper
.
insert
(
rectificationOrder
);
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
}
else
{
AcceptanceStatusEnum
acceptanceStatus
=
AcceptanceStatusEnum
.
getAcceptanceStatusByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
());
AcceptanceStatusEnum
acceptanceStatus
=
AcceptanceStatusEnum
.
getAcceptanceStatusByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
());
if
(
acceptanceStatus
==
null
)
{
// 说明工作流节点状态执行错误
throw
new
BadRequest
(
"其他用户正在操作,请刷新后再试!"
);
}
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
basicGridAcceptanc
.
setAcceptanceStatus
(
AcceptanceStatusEnum
.
getNodeByKey
(
nextNodeKey
,
dto
.
getApprovalStatus
()));
}
}
...
...
@@ -440,7 +445,8 @@ public class BasicGridAcceptanceServiceImpl
// 验收完成
System
.
out
.
println
(
"验收完成==============================="
+
workBasicGridAcceptance
.
getNextTaskId
());
System
.
out
.
println
(
"验收完成888888==============================="
+
workBasicGridAcceptance
.
getAcceptanceStatus
());
System
.
out
.
println
(
"验收完成888888==============================="
+
workBasicGridAcceptance
.
getAcceptanceStatus
());
if
(
"10"
.
equals
(
workBasicGridAcceptance
.
getAcceptanceStatus
()))
{
// 更新状态
...
...
@@ -458,18 +464,18 @@ public class BasicGridAcceptanceServiceImpl
}
}
//
工作流执行一步
public
void
wofkflowExcute
(
String
instanceId
,
String
approvalStatus
,
String
comment
,
String
taskKey
)
{
//
工作流执行一步
public
void
wofkflowExcute
(
String
instanceId
,
String
approvalStatus
,
String
comment
,
String
taskKey
)
{
LambdaQueryWrapper
<
BasicGridAuditing
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
BasicGridAuditing:
:
getInstanceId
,
instanceId
);
query
.
orderByDesc
(
BaseEntity:
:
getRecDate
);
query
.
last
(
"limit 1"
);
BasicGridAuditing
basicGridAuditing
=
basicGridAuditingService
.
getBaseMapper
().
selectOne
(
query
);
if
(!
taskKey
.
contains
(
basicGridAuditing
.
getNextNodeKey
())){
if
(!
taskKey
.
contains
(
basicGridAuditing
.
getNextNodeKey
()))
{
throw
new
BadRequest
(
"无可执行任务"
);
}
//组装信息
//
组装信息
TaskResultDTO
task
=
new
TaskResultDTO
();
task
.
setTaskId
(
basicGridAuditing
.
getNextTaskId
());
...
...
@@ -477,11 +483,12 @@ public class BasicGridAcceptanceServiceImpl
BasicGridAuditingDto
basicGridAuditingDto
=
new
BasicGridAuditingDto
();
task
.
setResultCode
(
"approvalStatus"
);
map
.
put
(
"approvalStatus"
,
approvalStatus
);
task
.
setComment
(
comment
==
null
?
""
:
comment
);
task
.
setComment
(
comment
==
null
?
""
:
comment
);
task
.
setVariable
(
map
);
//执行流程
//
执行流程
ProcessTaskDTO
processTaskDTO
=
workFlowService
.
complete
(
basicGridAuditing
.
getNextTaskId
(),
task
);
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
CollectionUtil
.
newArrayList
(
processTaskDTO
));
List
<
WorkflowResultDto
>
workflowResultDtos
=
workFlowService
.
buildWorkFlowInfo
(
CollectionUtil
.
newArrayList
(
processTaskDTO
));
WorkflowResultDto
workflowResultDto
=
workflowResultDtos
.
get
(
0
);
BeanUtils
.
copyProperties
(
workflowResultDto
,
basicGridAuditingDto
);
basicGridAuditingDto
.
setPeasantHouseholdId
(
basicGridAuditing
.
getPeasantHouseholdId
());
...
...
@@ -493,28 +500,26 @@ public class BasicGridAcceptanceServiceImpl
basicGridAuditingService
.
createWithModel
(
basicGridAuditingDto
);
}
public
void
completeAdminAudit
(
Map
<
String
,
String
>
kv
)
{
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
,
BusinessWorkflowKey
.
经销商管理员审核
.
getCode
());
//修改并网数据状态
basicGridRecord
.
setGridStatus
(
approvalStatus
.
equals
(
"0"
)?
GridStatusEnum
.
PQYYDSH
.
getCode
():
GridStatusEnum
.
WTG
.
getCode
());
basicGridRecord
.
setBasicGridNode
(
approvalStatus
.
equals
(
"0"
)?
"bw-area"
:
null
);
// 执行工作流
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
,
BusinessWorkflowKey
.
经销商管理员审核
.
getCode
());
// 修改并网数据状态
basicGridRecord
.
setGridStatus
(
approvalStatus
.
equals
(
"0"
)
?
GridStatusEnum
.
PQYYDSH
.
getCode
()
:
GridStatusEnum
.
WTG
.
getCode
());
basicGridRecord
.
setBasicGridNode
(
approvalStatus
.
equals
(
"0"
)
?
"bw-area"
:
null
);
basicGridRecordService
.
updateById
(
basicGridRecord
);
// 增加操作日志
ConstructionGirdRecords
da
=
new
ConstructionGirdRecords
();
da
.
setOperationTime
(
new
Date
());
da
.
setOperationContent
(
"并网管理-经销商管理员审核-"
+(
approvalStatus
.
equals
(
"0"
)?
"通过"
:
"驳回"
));
da
.
setOperationContent
(
"并网管理-经销商管理员审核-"
+
(
approvalStatus
.
equals
(
"0"
)
?
"通过"
:
"驳回"
));
da
.
setOperator
(
kv
.
get
(
"operator"
));
da
.
setOperationResults
(
approvalStatus
.
equals
(
"0"
)
?
"通过"
:
"驳回"
);
da
.
setOperationResults
(
approvalStatus
.
equals
(
"0"
)
?
"通过"
:
"驳回"
);
da
.
setGridId
(
basicGridRecord
.
getSequenceNbr
());
da
.
setWorkOrderPowerStationId
(
basicGridRecord
.
getWorkOrderPowerStationId
());
da
.
setPeasantHouseholdId
(
basicGridRecord
.
getPeasantHouseholdId
());
...
...
@@ -522,10 +527,7 @@ public class BasicGridAcceptanceServiceImpl
constructionGirdRecords
.
save
(
da
);
}
public
ResponseModel
completeAudit
(
Map
<
String
,
String
>
kv
)
{
public
ResponseModel
completeAudit
(
Map
<
String
,
String
>
kv
)
{
String
instanceId
=
kv
.
get
(
"instanceId"
);
String
sequenceNbr
=
kv
.
get
(
"sequenceNbr"
);
String
comment
=
kv
.
get
(
"comment"
);
...
...
@@ -536,146 +538,156 @@ public class BasicGridAcceptanceServiceImpl
ConstructionGirdRecords
da
=
new
ConstructionGirdRecords
();
LambdaUpdateWrapper
<
BasicGridRecord
>
up
=
new
LambdaUpdateWrapper
<>();
switch
(
status
){
case
"bw-area"
:
up
.
set
(
BasicGridRecord:
:
getPowerStationAreaStatus
,
approvalStatus
.
equals
(
"0"
)?
"通过"
:
"驳回"
);
if
(
approvalStatus
.
equals
(
"0"
)){
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-design,bw-engineering"
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ROLESDSH
.
getCode
());
int
num
=
0
;
//如果历史有未完成的整改单则片区审核完成的时候改变主流程状态为整改单的状态
LambdaQueryWrapper
<
HygfRectificationOrder
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
basicGridRecord
.
getPeasantHouseholdId
());
query
.
in
(
HygfRectificationOrder:
:
getRectificationStatus
,
Arrays
.
asList
(
"待整改"
,
"待审核"
));
query
.
in
(
HygfRectificationOrder:
:
getRectificationSource
,
Arrays
.
asList
(
"bw-design"
,
"bw-engineering"
));
List
<
HygfRectificationOrder
>
hygfRectificationOrders
=
rectificationOrderService
.
getBaseMapper
().
selectList
(
query
);
for
(
HygfRectificationOrder
hygfRectificationOrder
:
hygfRectificationOrders
)
{
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
"待审核"
)){
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ZGDSH
.
getCode
());
num
=
1
;
break
;
}
}
if
(
CollUtil
.
isNotEmpty
(
hygfRectificationOrders
)
&&
num
==
0
){
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
DZG
.
getCode
());
switch
(
status
)
{
case
"bw-area"
:
up
.
set
(
BasicGridRecord:
:
getPowerStationAreaStatus
,
approvalStatus
.
equals
(
"0"
)
?
"通过"
:
"驳回"
);
if
(
approvalStatus
.
equals
(
"0"
))
{
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-design,bw-engineering"
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ROLESDSH
.
getCode
());
int
num
=
0
;
// 如果历史有未完成的整改单则片区审核完成的时候改变主流程状态为整改单的状态
LambdaQueryWrapper
<
HygfRectificationOrder
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
basicGridRecord
.
getPeasantHouseholdId
());
query
.
in
(
HygfRectificationOrder:
:
getRectificationStatus
,
Arrays
.
asList
(
"待整改"
,
"待审核"
));
query
.
in
(
HygfRectificationOrder:
:
getRectificationSource
,
Arrays
.
asList
(
"bw-design"
,
"bw-engineering"
));
List
<
HygfRectificationOrder
>
hygfRectificationOrders
=
rectificationOrderService
.
getBaseMapper
()
.
selectList
(
query
);
for
(
HygfRectificationOrder
hygfRectificationOrder
:
hygfRectificationOrders
)
{
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
"待审核"
))
{
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ZGDSH
.
getCode
());
num
=
1
;
break
;
}
}
if
(
CollUtil
.
isNotEmpty
(
hygfRectificationOrders
)
&&
num
==
0
)
{
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
DZG
.
getCode
());
}
da
.
setOperationContent
(
"并网验收-片区运营审核-"
+
(
approvalStatus
.
equals
(
"0"
)?
"通过"
:
"驳回"
));
}
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
,
BusinessWorkflowKey
.
片区运营审核
.
getCode
()
);
break
;
case
"bw-design"
:
up
.
set
(
BasicGridRecord:
:
getPowerStationDesignStatus
,
approvalStatus
.
equals
(
"0"
)?
"通过"
:
"驳回"
);
da
.
setOperationContent
(
"并网验收-设计审核-"
+
(
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
,
BusinessWorkflowKey
.
设计审核
.
getCode
()
);
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"all"
);
up
.
set
(
BasicGridRecord:
:
getGridTime
,
new
Date
());
LambdaUpdateWrapper
<
PeasantHousehold
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
并网完成
.
getCode
());
wrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
basicGridRecord
.
getPeasantHouseholdId
());
peasantHouseholdMapper
.
update
(
null
,
wrapper
);
AcceptanceCheck
acceptanceCheck
=
new
AcceptanceCheck
();
BeanUtils
.
copyProperties
(
basicGridRecord
,
acceptanceCheck
);
acceptanceCheck
.
setSequenceNbr
(
null
);
acceptanceCheck
.
setRectificationStatus
(
null
);
acceptanceCheck
.
setBasicGridNode
(
null
);
acceptanceCheck
.
setInstanceId
(
null
);
acceptanceCheck
.
setPowerStationAreaStatus
(
null
);
acceptanceCheck
.
setAcceptanceCheckStatus
(
GridStatusEnum
.
DTJYS
.
getCode
());
acceptanceCheckService
.
saveOrUpdate
(
acceptanceCheck
);
}
else
if
(
null
==
basicGridRecord
.
getPowerStationEngineeringStatus
()
&&
approvalStatus
.
equals
(
"0"
)
&&
(
Objects
.
isNull
(
basicGridRecord
.
getRectificationStatus
())||(!
basicGridRecord
.
getRectificationStatus
().
contains
(
"bw-engineering"
))
)
)
{
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-engineering"
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
GCDSH
.
getCode
());
}
else
if
(
null
==
basicGridRecord
.
getPowerStationEngineeringStatus
()
&&
approvalStatus
.
equals
(
"0"
)
&&
basicGridRecord
.
getRectificationStatus
().
contains
(
"bw-engineering"
)
)
{
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-engineering"
);
LambdaQueryWrapper
<
HygfRectificationOrder
>
query2
=
new
LambdaQueryWrapper
<>();
query2
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
basicGridRecord
.
getPeasantHouseholdId
());
query2
.
in
(
HygfRectificationOrder:
:
getRectificationStatus
,
Arrays
.
asList
(
"待整改"
,
"待审核"
,
"待提交"
));
query2
.
eq
(
HygfRectificationOrder:
:
getRectificationSource
,
"bw-engineering"
);
HygfRectificationOrder
hygfRectificationOrder
=
rectificationOrderService
.
getBaseMapper
().
selectOne
(
query2
);
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
"待提交"
)){
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
"待整改"
)){
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
DZG
.
getCode
());
}
else
{
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ZGDSH
.
getCode
());
}
}
else
if
(
null
!=
basicGridRecord
.
getPowerStationEngineeringStatus
()
&&
basicGridRecord
.
getPowerStationEngineeringStatus
().
equals
(
"驳回"
)){
return
CommonResponseNewUtil
.
failureMessage
(
"该流程已被工程人员审核驳回,请刷新列表"
);
}
else
{
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
,
BusinessWorkflowKey
.
设计审核
.
getCode
()
);
da
.
setOperationContent
(
"并网验收-片区运营审核-"
+
(
approvalStatus
.
equals
(
"0"
)
?
"通过"
:
"驳回"
));
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
,
BusinessWorkflowKey
.
片区运营审核
.
getCode
());
break
;
case
"bw-design"
:
up
.
set
(
BasicGridRecord:
:
getPowerStationDesignStatus
,
approvalStatus
.
equals
(
"0"
)
?
"通过"
:
"驳回"
);
da
.
setOperationContent
(
"并网验收-设计审核-"
+
(
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
,
BusinessWorkflowKey
.
设计审核
.
getCode
());
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"all"
);
up
.
set
(
BasicGridRecord:
:
getGridTime
,
new
Date
());
LambdaUpdateWrapper
<
PeasantHousehold
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
并网完成
.
getCode
());
wrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
basicGridRecord
.
getPeasantHouseholdId
());
peasantHouseholdMapper
.
update
(
null
,
wrapper
);
AcceptanceCheck
acceptanceCheck
=
new
AcceptanceCheck
();
BeanUtils
.
copyProperties
(
basicGridRecord
,
acceptanceCheck
);
acceptanceCheck
.
setSequenceNbr
(
null
);
acceptanceCheck
.
setRectificationStatus
(
null
);
acceptanceCheck
.
setBasicGridNode
(
null
);
acceptanceCheck
.
setInstanceId
(
null
);
acceptanceCheck
.
setPowerStationAreaStatus
(
null
);
acceptanceCheck
.
setAcceptanceCheckStatus
(
GridStatusEnum
.
DTJYS
.
getCode
());
acceptanceCheckService
.
saveOrUpdate
(
acceptanceCheck
);
}
else
if
(
null
==
basicGridRecord
.
getPowerStationEngineeringStatus
()
&&
approvalStatus
.
equals
(
"0"
)
&&
(
Objects
.
isNull
(
basicGridRecord
.
getRectificationStatus
())
||
(!
basicGridRecord
.
getRectificationStatus
().
contains
(
"bw-engineering"
))))
{
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-engineering"
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
GCDSH
.
getCode
());
}
else
if
(
null
==
basicGridRecord
.
getPowerStationEngineeringStatus
()
&&
approvalStatus
.
equals
(
"0"
)
&&
basicGridRecord
.
getRectificationStatus
().
contains
(
"bw-engineering"
))
{
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-engineering"
);
LambdaQueryWrapper
<
HygfRectificationOrder
>
query2
=
new
LambdaQueryWrapper
<>();
query2
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
basicGridRecord
.
getPeasantHouseholdId
());
query2
.
in
(
HygfRectificationOrder:
:
getRectificationStatus
,
Arrays
.
asList
(
"待整改"
,
"待审核"
,
"待提交"
));
query2
.
eq
(
HygfRectificationOrder:
:
getRectificationSource
,
"bw-engineering"
);
HygfRectificationOrder
hygfRectificationOrder
=
rectificationOrderService
.
getBaseMapper
()
.
selectOne
(
query2
);
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
"待提交"
))
{
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
"待整改"
))
{
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
DZG
.
getCode
());
}
else
{
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ZGDSH
.
getCode
());
}
break
;
default
:
up
.
set
(
BasicGridRecord:
:
getPowerStationEngineeringStatus
,
approvalStatus
.
equals
(
"0"
)?
"通过"
:
"驳回"
);
da
.
setOperationContent
(
"并网验收-工程审核-"
+
(
approvalStatus
.
equals
(
"0"
)?
"通过"
:
"驳回"
));
if
(
basicGridRecord
.
getPowerStationDesignStatus
()
!=
null
&&
basicGridRecord
.
getPowerStationDesignStatus
().
equals
(
"通过"
)&&
approvalStatus
.
equals
(
"0"
)
){
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
YWC
.
getCode
());
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
,
BusinessWorkflowKey
.
工程审核
.
getCode
()
);
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"all"
);
up
.
set
(
BasicGridRecord:
:
getGridTime
,
new
Date
());
LambdaUpdateWrapper
<
PeasantHousehold
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
并网完成
.
getCode
());
wrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
basicGridRecord
.
getPeasantHouseholdId
());
peasantHouseholdMapper
.
update
(
null
,
wrapper
);
AcceptanceCheck
acceptanceCheck
=
new
AcceptanceCheck
();
BeanUtils
.
copyProperties
(
basicGridRecord
,
acceptanceCheck
);
acceptanceCheck
.
setSequenceNbr
(
null
);
acceptanceCheck
.
setRectificationStatus
(
null
);
acceptanceCheck
.
setBasicGridNode
(
null
);
acceptanceCheck
.
setPowerStationAreaStatus
(
null
);
acceptanceCheck
.
setInstanceId
(
null
);
acceptanceCheck
.
setAcceptanceCheckStatus
(
GridStatusEnum
.
DTJYS
.
getCode
());
acceptanceCheckService
.
saveOrUpdate
(
acceptanceCheck
);
}
else
if
(
null
==
basicGridRecord
.
getPowerStationDesignStatus
()
&&
approvalStatus
.
equals
(
"0"
)
&&
(
Objects
.
isNull
(
basicGridRecord
.
getRectificationStatus
())||(!
basicGridRecord
.
getRectificationStatus
().
contains
(
"bw-design"
))
))
{
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-design"
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
if
(
null
==
basicGridRecord
.
getPowerStationDesignStatus
()
&&
approvalStatus
.
equals
(
"0"
)
&&
!
Objects
.
isNull
(
basicGridRecord
.
getRectificationStatus
())
&&
basicGridRecord
.
getRectificationStatus
().
contains
(
"bw-design"
)
)
{
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-design"
);
}
else
if
(
null
!=
basicGridRecord
.
getPowerStationEngineeringStatus
()
&&
basicGridRecord
.
getPowerStationEngineeringStatus
().
equals
(
"驳回"
))
{
return
CommonResponseNewUtil
.
failureMessage
(
"该流程已被工程人员审核驳回,请刷新列表"
);
}
else
{
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
,
BusinessWorkflowKey
.
设计审核
.
getCode
());
}
break
;
default
:
up
.
set
(
BasicGridRecord:
:
getPowerStationEngineeringStatus
,
approvalStatus
.
equals
(
"0"
)
?
"通过"
:
"驳回"
);
da
.
setOperationContent
(
"并网验收-工程审核-"
+
(
approvalStatus
.
equals
(
"0"
)
?
"通过"
:
"驳回"
));
if
(
basicGridRecord
.
getPowerStationDesignStatus
()
!=
null
&&
basicGridRecord
.
getPowerStationDesignStatus
().
equals
(
"通过"
)
&&
approvalStatus
.
equals
(
"0"
))
{
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
YWC
.
getCode
());
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
,
BusinessWorkflowKey
.
工程审核
.
getCode
());
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"all"
);
up
.
set
(
BasicGridRecord:
:
getGridTime
,
new
Date
());
LambdaUpdateWrapper
<
PeasantHousehold
>
wrapper
=
new
LambdaUpdateWrapper
<>();
wrapper
.
set
(
PeasantHousehold:
:
getConstructionState
,
ArrivalStateeEnum
.
并网完成
.
getCode
());
wrapper
.
eq
(
BaseEntity:
:
getSequenceNbr
,
basicGridRecord
.
getPeasantHouseholdId
());
peasantHouseholdMapper
.
update
(
null
,
wrapper
);
AcceptanceCheck
acceptanceCheck
=
new
AcceptanceCheck
();
BeanUtils
.
copyProperties
(
basicGridRecord
,
acceptanceCheck
);
acceptanceCheck
.
setSequenceNbr
(
null
);
acceptanceCheck
.
setRectificationStatus
(
null
);
acceptanceCheck
.
setBasicGridNode
(
null
);
acceptanceCheck
.
setPowerStationAreaStatus
(
null
);
acceptanceCheck
.
setInstanceId
(
null
);
acceptanceCheck
.
setAcceptanceCheckStatus
(
GridStatusEnum
.
DTJYS
.
getCode
());
acceptanceCheckService
.
saveOrUpdate
(
acceptanceCheck
);
}
else
if
(
null
==
basicGridRecord
.
getPowerStationDesignStatus
()
&&
approvalStatus
.
equals
(
"0"
)
&&
(
Objects
.
isNull
(
basicGridRecord
.
getRectificationStatus
())
||
(!
basicGridRecord
.
getRectificationStatus
().
contains
(
"bw-design"
))))
{
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-design"
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
if
(
null
==
basicGridRecord
.
getPowerStationDesignStatus
()
&&
approvalStatus
.
equals
(
"0"
)
&&
!
Objects
.
isNull
(
basicGridRecord
.
getRectificationStatus
())
&&
basicGridRecord
.
getRectificationStatus
().
contains
(
"bw-design"
))
{
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-design"
);
LambdaQueryWrapper
<
HygfRectificationOrder
>
query1
=
new
LambdaQueryWrapper
<>();
query1
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
basicGridRecord
.
getPeasantHouseholdId
());
query1
.
in
(
HygfRectificationOrder:
:
getRectificationStatus
,
Arrays
.
asList
(
"待整改"
,
"待审核"
,
"待提交"
));
query1
.
eq
(
HygfRectificationOrder:
:
getRectificationSource
,
"bw-design"
);
HygfRectificationOrder
hygfRectificationOrder
=
rectificationOrderService
.
getBaseMapper
().
selectOne
(
query1
);
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
"待提交"
)){
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
"待整改"
)){
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
DZG
.
getCode
());
}
else
{
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ZGDSH
.
getCode
());
}
}
else
if
(
null
!=
basicGridRecord
.
getPowerStationDesignStatus
()
&&
basicGridRecord
.
getPowerStationDesignStatus
().
equals
(
"驳回"
)){
return
CommonResponseNewUtil
.
failureMessage
(
"该流程已被设计人员审核驳回,请刷新列表"
);
}
else
{
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
,
BusinessWorkflowKey
.
工程审核
.
getCode
()
);
query1
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
basicGridRecord
.
getPeasantHouseholdId
());
query1
.
in
(
HygfRectificationOrder:
:
getRectificationStatus
,
Arrays
.
asList
(
"待整改"
,
"待审核"
,
"待提交"
));
query1
.
eq
(
HygfRectificationOrder:
:
getRectificationSource
,
"bw-design"
);
HygfRectificationOrder
hygfRectificationOrder
=
rectificationOrderService
.
getBaseMapper
()
.
selectOne
(
query1
);
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
"待提交"
))
{
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
"待整改"
))
{
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
DZG
.
getCode
());
}
else
{
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ZGDSH
.
getCode
());
}
break
;
}
else
if
(
null
!=
basicGridRecord
.
getPowerStationDesignStatus
()
&&
basicGridRecord
.
getPowerStationDesignStatus
().
equals
(
"驳回"
))
{
return
CommonResponseNewUtil
.
failureMessage
(
"该流程已被设计人员审核驳回,请刷新列表"
);
}
else
{
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
,
BusinessWorkflowKey
.
工程审核
.
getCode
());
}
break
;
}
if
(
approvalStatus
.
equals
(
"1"
)
)
{
up
.
eq
(
BaseEntity:
:
getSequenceNbr
,
sequenceNbr
);
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
null
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
WTG
.
getCode
());
if
(
approvalStatus
.
equals
(
"1"
)
)
{
up
.
eq
(
BaseEntity:
:
getSequenceNbr
,
sequenceNbr
);
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
null
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
WTG
.
getCode
());
}
//修改并网数据状态
if
(
StringUtils
.
isNotEmpty
(
sequenceNbr
)){
up
.
eq
(
BaseEntity:
:
getSequenceNbr
,
sequenceNbr
);
basicGridRecordService
.
getBaseMapper
().
update
(
null
,
up
);
//
修改并网数据状态
if
(
StringUtils
.
isNotEmpty
(
sequenceNbr
))
{
up
.
eq
(
BaseEntity:
:
getSequenceNbr
,
sequenceNbr
);
basicGridRecordService
.
getBaseMapper
().
update
(
null
,
up
);
}
da
.
setOperationTime
(
new
Date
());
da
.
setOperator
(
kv
.
get
(
"operator"
));
da
.
setOperationResults
(
approvalStatus
.
equals
(
"0"
)
?
"通过"
:
"驳回"
);
da
.
setOperationResults
(
approvalStatus
.
equals
(
"0"
)
?
"通过"
:
"驳回"
);
da
.
setGridId
(
basicGridRecord
.
getSequenceNbr
());
da
.
setWorkOrderPowerStationId
(
basicGridRecord
.
getWorkOrderPowerStationId
());
da
.
setPeasantHouseholdId
(
basicGridRecord
.
getPeasantHouseholdId
());
...
...
@@ -684,116 +696,118 @@ public class BasicGridAcceptanceServiceImpl
return
CommonResponseNewUtil
.
success
();
}
public
ResponseModel
addRectification
(
HygfRectificationOrder
hygfRectificationOrder
)
{
if
(
Objects
.
isNull
(
hygfRectificationOrder
.
getRectificationSource
())
)
{
return
CommonResponseNewUtil
.
failureMessage
(
"多角色用户发起整改单,发起人角色不可为空"
);
if
(
Objects
.
isNull
(
hygfRectificationOrder
.
getRectificationSource
()))
{
return
CommonResponseNewUtil
.
failureMessage
(
"多角色用户发起整改单,发起人角色不可为空"
);
}
if
(
hygfRectificationOrder
.
getAddorSubmit
().
equals
(
"0"
)
&&
Objects
.
isNull
(
hygfRectificationOrder
.
getRectificationIdea
())){
return
CommonResponseNewUtil
.
failureMessage
(
"整改类型及整改项不可为空"
);
if
(
hygfRectificationOrder
.
getAddorSubmit
().
equals
(
"0"
)
&&
Objects
.
isNull
(
hygfRectificationOrder
.
getRectificationIdea
()))
{
return
CommonResponseNewUtil
.
failureMessage
(
"整改类型及整改项不可为空"
);
}
if
(
hygfRectificationOrder
.
getAddorSubmit
().
equals
(
"0"
)
&&
!
Objects
.
isNull
(
hygfRectificationOrder
.
getRectificationIdea
())){
if
(
hygfRectificationOrder
.
getAddorSubmit
().
equals
(
"0"
)
&&
!
Objects
.
isNull
(
hygfRectificationOrder
.
getRectificationIdea
()))
{
List
<
Object
>
rectificationIdea
=
hygfRectificationOrder
.
getRectificationIdea
();
for
(
Object
item
:
rectificationIdea
)
{
JSONObject
jsonObject
=
JSON
.
parseObject
(
JSON
.
toJSONString
(
item
));
Collection
<
Object
>
values
=
jsonObject
.
values
();
if
(
values
.
size
()
<
2
){
return
CommonResponseNewUtil
.
failureMessage
(
"整改类型及整改项不可为空"
);
if
(
values
.
size
()
<
2
)
{
return
CommonResponseNewUtil
.
failureMessage
(
"整改类型及整改项不可为空"
);
}
if
(
jsonObject
.
containsKey
(
"type"
)){
if
(
null
==
jsonObject
.
get
(
"type"
)){
return
CommonResponseNewUtil
.
failureMessage
(
"整改类型及整改项不可为空"
);
if
(
jsonObject
.
containsKey
(
"type"
))
{
if
(
null
==
jsonObject
.
get
(
"type"
))
{
return
CommonResponseNewUtil
.
failureMessage
(
"整改类型及整改项不可为空"
);
}
}
if
(
jsonObject
.
containsKey
(
"items"
)){
if
(
jsonObject
.
containsKey
(
"items"
))
{
JSONArray
item1
=
jsonObject
.
getJSONArray
(
"items"
);
for
(
Object
o
:
item1
)
{
if
(!
JSON
.
parseObject
(
JSON
.
toJSONString
(
o
)).
containsKey
(
"value"
)){
return
CommonResponseNewUtil
.
failureMessage
(
"整改类型及整改项不可为空"
);
if
(!
JSON
.
parseObject
(
JSON
.
toJSONString
(
o
)).
containsKey
(
"value"
))
{
return
CommonResponseNewUtil
.
failureMessage
(
"整改类型及整改项不可为空"
);
}
}
}
}
}
if
(
hygfRectificationOrder
.
getSequenceNbr
()
!=
null
)
{
LambdaQueryWrapper
<
HygfRectificationOrder
>
wr
=
new
LambdaQueryWrapper
<>();
wr
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
wr
.
notIn
(
HygfRectificationOrder:
:
getRectificationStatus
,
Arrays
.
asList
(
"已作废"
,
"已完成"
));
wr
.
eq
(
HygfRectificationOrder:
:
getRectificationSource
,
hygfRectificationOrder
.
getRectificationSource
());
wr
.
ne
(
BaseEntity:
:
getSequenceNbr
,
hygfRectificationOrder
.
getSequenceNbr
());
if
(
hygfRectificationOrder
.
getSequenceNbr
()
!=
null
)
{
LambdaQueryWrapper
<
HygfRectificationOrder
>
wr
=
new
LambdaQueryWrapper
<>();
wr
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
wr
.
notIn
(
HygfRectificationOrder:
:
getRectificationStatus
,
Arrays
.
asList
(
"已作废"
,
"已完成"
));
wr
.
eq
(
HygfRectificationOrder:
:
getRectificationSource
,
hygfRectificationOrder
.
getRectificationSource
());
wr
.
ne
(
BaseEntity:
:
getSequenceNbr
,
hygfRectificationOrder
.
getSequenceNbr
());
List
<
HygfRectificationOrder
>
list
=
rectificationOrderService
.
getBaseMapper
().
selectList
(
wr
);
if
(
CollectionUtil
.
isNotEmpty
(
list
)){
return
CommonResponseNewUtil
.
failureMessage
(
"当前农户存在其他进行中的整改单,不可重新发起"
);
if
(
CollectionUtil
.
isNotEmpty
(
list
))
{
return
CommonResponseNewUtil
.
failureMessage
(
"当前农户存在其他进行中的整改单,不可重新发起"
);
}
}
//查询当前并网数据
//
查询当前并网数据
LambdaQueryWrapper
<
BasicGridRecord
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
().
selectOne
(
wrapper
);
if
(!
Objects
.
isNull
(
basicGridRecord
)&&!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
())){
return
CommonResponseNewUtil
.
failureMessage
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
if
(!
Objects
.
isNull
(
basicGridRecord
)
&&
!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
()))
{
return
CommonResponseNewUtil
.
failureMessage
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
}
String
addorSubmit
=
hygfRectificationOrder
.
getAddorSubmit
();
LambdaUpdateWrapper
<
BasicGridRecord
>
qu
=
new
LambdaUpdateWrapper
();
qu
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
if
(!
Objects
.
isNull
(
basicGridRecord
)
&&
null
!=
basicGridRecord
.
getRectificationStatus
()
&&
!
basicGridRecord
.
getRectificationStatus
().
contains
(
hygfRectificationOrder
.
getRectificationSource
())){
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
basicGridRecord
.
getRectificationStatus
()+
","
+
hygfRectificationOrder
.
getRectificationSource
());
basicGridRecordService
.
update
(
null
,
qu
);
}
else
if
(!
Objects
.
isNull
(
basicGridRecord
)
&&
null
==
basicGridRecord
.
getRectificationStatus
()
)
{
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
hygfRectificationOrder
.
getRectificationSource
());
basicGridRecordService
.
update
(
null
,
qu
);
if
(!
Objects
.
isNull
(
basicGridRecord
)
&&
null
!=
basicGridRecord
.
getRectificationStatus
()
&&
!
basicGridRecord
.
getRectificationStatus
().
contains
(
hygfRectificationOrder
.
getRectificationSource
()))
{
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
basicGridRecord
.
getRectificationStatus
()
+
","
+
hygfRectificationOrder
.
getRectificationSource
());
basicGridRecordService
.
update
(
null
,
qu
);
}
else
if
(!
Objects
.
isNull
(
basicGridRecord
)
&&
null
==
basicGridRecord
.
getRectificationStatus
())
{
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
hygfRectificationOrder
.
getRectificationSource
());
basicGridRecordService
.
update
(
null
,
qu
);
}
//修改状态
if
(
addorSubmit
.
equals
(
"0"
)){
//如果历史有未完成的整改单则片区审核完成的时候改变主流程状态为整改单的状态
//
修改状态
if
(
addorSubmit
.
equals
(
"0"
))
{
//
如果历史有未完成的整改单则片区审核完成的时候改变主流程状态为整改单的状态
int
num
=
0
;
LambdaQueryWrapper
<
HygfRectificationOrder
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
basicGridRecord
.
getPeasantHouseholdId
());
query
.
in
(
HygfRectificationOrder:
:
getRectificationStatus
,
Arrays
.
asList
(
"待整改"
,
"待提交"
,
"待审核"
));
query
.
in
(
HygfRectificationOrder:
:
getRectificationSource
,
Arrays
.
asList
(
"bw-design"
,
"bw-engineering"
));
List
<
HygfRectificationOrder
>
hygfRectificationOrders
=
rectificationOrderService
.
getBaseMapper
().
selectList
(
query
);
query
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
basicGridRecord
.
getPeasantHouseholdId
());
query
.
in
(
HygfRectificationOrder:
:
getRectificationStatus
,
Arrays
.
asList
(
"待整改"
,
"待提交"
,
"待审核"
));
query
.
in
(
HygfRectificationOrder:
:
getRectificationSource
,
Arrays
.
asList
(
"bw-design"
,
"bw-engineering"
));
List
<
HygfRectificationOrder
>
hygfRectificationOrders
=
rectificationOrderService
.
getBaseMapper
()
.
selectList
(
query
);
for
(
HygfRectificationOrder
hygfRectificationOrderO
:
hygfRectificationOrders
)
{
if
(
hygfRectificationOrderO
.
getRectificationStatus
().
equals
(
"待审核"
)){
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ZGDSH
.
getCode
());
if
(
hygfRectificationOrderO
.
getRectificationStatus
().
equals
(
"待审核"
))
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ZGDSH
.
getCode
());
num
=
1
;
break
;
}
}
if
(
num
==
0
){
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
DZG
.
getCode
());
if
(
num
==
0
)
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
DZG
.
getCode
());
}
basicGridRecordService
.
update
(
null
,
qu
);
basicGridRecordService
.
update
(
null
,
qu
);
}
rectificationOrderAuditingService
.
addRectification
(
hygfRectificationOrder
);
return
CommonResponseNewUtil
.
success
();
return
CommonResponseNewUtil
.
success
();
}
public
ResponseModel
nextTaskExcute
(
HygfRectificationOrder
hygfRectificationOrder
)
{
//查询当前并网数据
//
查询当前并网数据
LambdaQueryWrapper
<
BasicGridRecord
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
().
selectOne
(
wrapper
);
if
(!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
())){
if
(!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
()))
{
hygfRectificationOrder
.
setRectificationStatus
(
WorkOrderEnum
.
整改中
.
getCode
());
rectificationOrderAuditingService
.
addRectification
(
hygfRectificationOrder
);
return
CommonResponseNewUtil
.
failureMessage
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
return
CommonResponseNewUtil
.
failureMessage
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
}
if
(
hygfRectificationOrder
.
getAddorSubmit
().
equals
(
"0"
)
)
{
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
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ZGDSH
.
getCode
());
up
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
basicGridRecordService
.
update
(
null
,
up
);
hygfRectificationOrder
.
setRectificationStatus
(
WorkOrderEnum
.
待审核
.
getCode
());
}
else
{
}
else
{
hygfRectificationOrder
.
setRectificationStatus
(
WorkOrderEnum
.
整改中
.
getCode
());
}
rectificationOrderAuditingService
.
nextTaskExcute
(
hygfRectificationOrder
);
...
...
@@ -803,133 +817,143 @@ public class BasicGridAcceptanceServiceImpl
public
ResponseModel
nextTaskAduit
(
HygfRectificationOrder
hygfRectificationOrder
)
{
String
auditResult
=
hygfRectificationOrder
.
getAuditResult
();
//查询当前并网数据
//
查询当前并网数据
LambdaQueryWrapper
<
BasicGridRecord
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
().
selectOne
(
wrapper
);
if
(!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
())){
return
CommonResponseNewUtil
.
failureMessage
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
if
(!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
()))
{
return
CommonResponseNewUtil
.
failureMessage
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
}
//修改整改单状态
hygfRectificationOrder
.
setRectificationStatus
(
auditResult
.
equals
(
"通过"
)?
WorkOrderEnum
.
已完成
.
getCode
():
WorkOrderEnum
.
待整改
.
getCode
());
// 修改整改单状态
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
());
//
查询是否还有其它类型待整改的整改单存在 若存在后置节点为当前并网状态
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
.
getRectificationSource
().
equals
(
"bw-area"
)){
//
修改并网状态
//
片区不存在并行 无需复杂判断
工程与设计并行 需要做额外逻辑判断
if
(
auditResult
.
equals
(
"通过"
))
{
if
(
hygfRectificationOrder
.
getRectificationSource
().
equals
(
"bw-area"
))
{
LambdaUpdateWrapper
<
BasicGridRecord
>
qu
=
new
LambdaUpdateWrapper
();
qu
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
PQYYDSH
.
getCode
());
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
null
);
basicGridRecordService
.
update
(
null
,
qu
);
}
else
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
PQYYDSH
.
getCode
());
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
null
);
basicGridRecordService
.
update
(
null
,
qu
);
}
else
{
LambdaUpdateWrapper
<
BasicGridRecord
>
qu
=
new
LambdaUpdateWrapper
();
qu
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
List
<
String
>
status
=
new
ArrayList
<>(
Arrays
.
asList
(
basicGridRecord
.
getRectificationStatus
().
split
(
","
)));
List
<
String
>
status
=
new
ArrayList
<>(
Arrays
.
asList
(
basicGridRecord
.
getRectificationStatus
().
split
(
","
)));
status
.
remove
(
hygfRectificationOrder
.
getRectificationSource
());
if
(
status
.
size
()<
1
)
{
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
null
);
}
else
{
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
String
.
join
(
","
,
status
));
if
(
status
.
size
()
<
1
)
{
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
null
);
}
else
{
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
String
.
join
(
","
,
status
));
}
if
(
CollectionUtil
.
isEmpty
(
list
))
{
//若两者状态都为空 说明均为审核 若某一审核状态为空 则审核状态修改为为空审核节点
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
()
)
&&
Objects
.
isNull
(
basicGridRecord
.
getPowerStationEngineeringStatus
())){
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ROLESDSH
.
getCode
());
}
else
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
()
)
){
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
GCDSH
.
getCode
());
}
}
else
{
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
());
// 若两者状态都为空 说明均为审核 若某一审核状态为空 则审核状态修改为为空审核节点
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
())
&&
Objects
.
isNull
(
basicGridRecord
.
getPowerStationEngineeringStatus
()))
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ROLESDSH
.
getCode
());
}
else
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
()))
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
GCDSH
.
getCode
());
}
}
else
{
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
());
}
basicGridRecordService
.
update
(
null
,
qu
);
basicGridRecordService
.
update
(
null
,
qu
);
}
}
else
{
//驳回的时候 也需根据 工程或者设计 整改单状态修改并网状态
}
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
());
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
);
basicGridRecordService
.
update
(
null
,
qu
);
}
return
CommonResponseNewUtil
.
success
();
return
CommonResponseNewUtil
.
success
();
}
public
ResponseModel
rollback
(
Long
sequenceNbr
)
{
HygfRectificationOrder
hygfRectificationOrder
=
rectificationOrderService
.
getBaseMapper
().
selectById
(
sequenceNbr
);
//查询当前并网数据
HygfRectificationOrder
hygfRectificationOrder
=
rectificationOrderService
.
getBaseMapper
()
.
selectById
(
sequenceNbr
);
// 查询当前并网数据
LambdaQueryWrapper
<
BasicGridRecord
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
().
selectOne
(
wrapper
);
if
(!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
())){
return
CommonResponseNewUtil
.
failureMessage
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
if
(!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
()))
{
return
CommonResponseNewUtil
.
failureMessage
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
}
LambdaUpdateWrapper
<
BasicGridRecord
>
qu
=
new
LambdaUpdateWrapper
();
qu
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
WorkOrderEnum
.
待提交
.
getCode
())
||
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
WorkOrderEnum
.
待整改
.
getCode
()))
{
if
(
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
WorkOrderEnum
.
待提交
.
getCode
())
||
hygfRectificationOrder
.
getRectificationStatus
().
equals
(
WorkOrderEnum
.
待整改
.
getCode
()))
{
rectificationOrderAuditingService
.
rollback
(
sequenceNbr
);
List
<
String
>
status
=
new
ArrayList
<>(
Arrays
.
asList
(
basicGridRecord
.
getRectificationStatus
().
split
(
","
)));
status
.
remove
(
hygfRectificationOrder
.
getRectificationSource
());
if
(
status
.
size
()<
1
)
{
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
null
);
}
else
{
if
(
status
.
size
()
<
1
)
{
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
null
);
}
else
{
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
String
.
join
(
","
,
status
));
basicGridRecordService
.
getBaseMapper
().
update
(
null
,
qu
);
}
}
else
{
return
CommonResponseNewUtil
.
failureMessage
(
"仅单据状态为待提交或待整改时方可作废"
);
}
else
{
return
CommonResponseNewUtil
.
failureMessage
(
"仅单据状态为待提交或待整改时方可作废"
);
}
if
(
hygfRectificationOrder
.
getRectificationSource
().
equals
(
"bw-area"
))
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
PQYYDSH
.
getCode
());
}
else
{
if
(
hygfRectificationOrder
.
getRectificationSource
().
equals
(
"bw-area"
)){
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
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
());
// 查询是否还有其它类型待整改的整改单存在 若存在后置节点为当前并网状态
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
())){
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ROLESDSH
.
getCode
());
}
else
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
()
)
)
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
GCDSH
.
getCode
());
//
若两者状态都为空 说明均为审核 若某一审核状态为空 则审核状态修改为为空审核节点
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
())
&&
Objects
.
isNull
(
basicGridRecord
.
getPowerStationEngineeringStatus
()))
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ROLESDSH
.
getCode
());
}
else
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
()))
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
{
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
GCDSH
.
getCode
());
}
}
else
{
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
{
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
());
}
}
basicGridRecordService
.
update
(
null
,
qu
);
return
CommonResponseNewUtil
.
success
();
basicGridRecordService
.
update
(
null
,
qu
);
return
CommonResponseNewUtil
.
success
();
}
}
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