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
1d0d1069
Commit
1d0d1069
authored
Aug 26, 2024
by
chenzhao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
并网优化
parent
0e2d4438
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
155 additions
and
70 deletions
+155
-70
GlobalExceptionHandler.java
...s/boot/module/hygf/api/config/GlobalExceptionHandler.java
+2
-0
BasicGridRecordDto.java
...oin/amos/boot/module/hygf/api/dto/BasicGridRecordDto.java
+2
-0
BasicGridRecord.java
...oin/amos/boot/module/hygf/api/entity/BasicGridRecord.java
+5
-0
CommonResponseNewUtil.java
...amos/boot/module/hygf/api/util/CommonResponseNewUtil.java
+9
-0
BasicGridAcceptanceMapper.xml
...main/resources/mapper/mysql/BasicGridAcceptanceMapper.xml
+7
-7
BasicGridAcceptanceController.java
...le/hygf/biz/controller/BasicGridAcceptanceController.java
+33
-18
HygfRectificationOrderController.java
...hygf/biz/controller/HygfRectificationOrderController.java
+3
-3
WorkOrderController.java
.../boot/module/hygf/biz/controller/WorkOrderController.java
+2
-1
BasicGridAcceptanceServiceImpl.java
...hygf/biz/service/impl/BasicGridAcceptanceServiceImpl.java
+92
-41
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/config/GlobalExceptionHandler.java
View file @
1d0d1069
...
...
@@ -56,6 +56,8 @@ public class GlobalExceptionHandler {
String
stackTrace
=
sw
.
toString
();
response
.
setDevMessage
(
stackTrace
);
response
.
setMessage
(
stackTrace
);
System
.
err
.
println
(
e
.
getMessage
());
log
.
debug
(
"Exception stack trace (debug mode): {}"
,
stackTrace
);
}
else
{
response
.
setDevMessage
(
e
.
getMessage
());
response
.
setMessage
(
e
.
getMessage
());
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/dto/BasicGridRecordDto.java
View file @
1d0d1069
...
...
@@ -71,4 +71,6 @@ public class BasicGridRecordDto extends BaseDto {
private
String
isAudit
;
private
Date
gridTime
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/entity/BasicGridRecord.java
View file @
1d0d1069
...
...
@@ -81,4 +81,9 @@ public class BasicGridRecord extends BaseEntity {
@TableField
(
"rectification_status"
)
private
String
rectificationStatus
;
/**
* 验收时间
*/
@TableField
(
"grid_time"
)
private
Date
gridTime
;
}
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/java/com/yeejoin/amos/boot/module/hygf/api/util/CommonResponseNewUtil.java
View file @
1d0d1069
...
...
@@ -47,6 +47,15 @@ public class CommonResponseNewUtil
return
res
;
}
public
static
ResponseModel
failureMessage
(
String
message
)
{
ResponseModel
res
=
new
ResponseModel
();
res
.
setDevMessage
(
message
);
res
.
setMessage
(
message
);
res
.
setStatus
(
HttpStatus
.
INTERNAL_SERVER_ERROR
.
value
());
return
res
;
}
public
static
ResponseModel
failure
(
Object
obj
,
String
message
)
{
ResponseModel
res
=
new
ResponseModel
();
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/BasicGridAcceptanceMapper.xml
View file @
1d0d1069
...
...
@@ -21,6 +21,7 @@
hbga.work_order_power_station_id workOrderPowerStationId,
hbga.peasant_household_id peasantHouseholdId,
hbga.basic_grid_node basicGridNode,
hbga.grid_time gridTime,
hbga.power_station_area_status powerStationAreaStatus,
hbga.power_station_design_status powerStationDesignStatus,
hbga.rectification_status rectificationStatus,
...
...
@@ -62,8 +63,11 @@
<if
test=
"map.projectAddress != null and map.projectAddress!=''"
>
AND hph.project_address_name LIKE concat(concat('%', #{map.projectAddress}), '%')
</if>
<if
test=
"map.powerStationCode != null and map.powerStationCode !=''"
>
AND hph.peasant_household_no LIKE concat(concat('%', #{map.powerStationCode}), '%')
<if
test=
"map.basicGridNodes != null and map.basicGridNodes.size()>0 and map.type != null"
>
AND hbga.grid_node IN
<foreach
collection=
"map.basicGridNodes"
item=
"item"
open=
"("
close=
")"
separator=
","
>
#{item}
</foreach>
</if>
<if
test=
"map.ownersName != null and map.ownersName !=''"
>
AND hph.owners_name LIKE concat(concat('%', #{map.ownersName}), '%')
...
...
@@ -75,10 +79,6 @@
AND DATE_FORMAT(hogaa.grid_connection_time, '%Y-%m-%d') = #{map.gridConnectionTime}
</if>
</where>
ORDER BY
FIELD(hbga.grid_status, '1', '2', '4', '3'),
hogaa.grid_connection_time desc, hbga.sequence_nbr desc
ORDER BY hbga.sequence_nbr desc
</select>
</mapper>
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/BasicGridAcceptanceController.java
View file @
1d0d1069
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
controller
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.module.hygf.api.config.UserLimits
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAcceptanceDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridRecordDto
;
...
...
@@ -15,6 +18,7 @@ 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.biz.service.impl.BasicGridAcceptanceServiceImpl
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.WorkflowImpl
;
import
com.yeejoin.amos.component.robot.BadRequest
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -26,10 +30,7 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
/**
*
...
...
@@ -83,6 +84,7 @@ public class BasicGridAcceptanceController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save/commit"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
@Transactional
public
ResponseModel
saveAndCommit
(
@RequestBody
HygfOnGrid
dto
)
{
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
saveAndCommit
(
dto
,
getUserId
()));
}
...
...
@@ -145,14 +147,17 @@ public class BasicGridAcceptanceController extends BaseController {
@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
{
//当前登录人所属场站
// UserUnitInformationDto userUnitInformationDto=personnelBusinessMapper.getUserUnitInformationDto( getUserInfo().getUserId());
ReginParams
reginParams
=
getSelectedOrgInfo
();
List
<
String
>
basicGridNodes
=
new
ArrayList
<>();
List
<
Long
>
roleIds
=
new
ArrayList
<>();
for
(
Long
aLong
:
reginParams
.
getUserModel
().
getOrgRoleSeqs
().
keySet
())
{
List
<
Long
>
longs
=
reginParams
.
getUserModel
().
getOrgRoleSeqs
().
get
(
aLong
);
roleIds
.
addAll
(
longs
);
if
(
longs
.
contains
(
areaId
))
{
basicGridNodes
.
add
(
"bw-area"
);
}
...
...
@@ -162,13 +167,18 @@ public class BasicGridAcceptanceController extends BaseController {
if
(
longs
.
contains
(
designId
))
{
basicGridNodes
.
add
(
"bw-design"
);
}
if
(
longs
.
contains
(
delerAdminId
))
{
basicGridNodes
.
add
(
"bw-design"
);
basicGridNodes
.
add
(
"bw-engineering"
);
basicGridNodes
.
add
(
"bw-area"
);
}
}
Page
<
BasicGridRecordDto
>
page
=
basicGridAcceptanceServiceImpl
.
selectPage
(
null
,
null
,
current
,
size
,
projectAddress
,
powerStationCode
,
ownersName
,
gridStatus
,
gridConnectionTime
,
""
);
Page
<
BasicGridRecordDto
>
page
=
basicGridAcceptanceServiceImpl
.
selectPage
(
null
,
null
,
current
,
size
,
projectAddress
,
powerStationCode
,
ownersName
,
gridStatus
,
gridConnectionTime
,
""
,
basicGridNodes
,
type
);
//根据角色及当前节点判断是否有操作权限
if
(
basicGridNodes
!=
null
){
for
(
BasicGridRecordDto
e
:
page
.
getRecords
())
{
for
(
String
g
:
basicGridNodes
)
{
if
(
null
!=
e
.
getBasicGridNode
()
&&
e
.
getBasicGridNode
().
contains
(
g
)){
if
(
null
!=
e
.
getBasicGridNode
()
&&
e
.
getBasicGridNode
().
contains
(
g
)
&&
(
roleIds
.
contains
(
areaId
)
||
roleIds
.
contains
(
designId
)
||
roleIds
.
contains
(
engineeringId
))
){
e
.
setIsAudit
(
"0"
);
break
;
}
else
{
...
...
@@ -176,7 +186,6 @@ public class BasicGridAcceptanceController extends BaseController {
}
}
}
}
return
ResponseHelper
.
buildResponse
(
page
);
}
...
...
@@ -201,7 +210,7 @@ public class BasicGridAcceptanceController extends BaseController {
@RequestParam
(
required
=
false
,
value
=
"gridConnectionTime"
)
String
gridConnectionTime
)
throws
Exception
{
//当前登录人所属场站
Page
<
BasicGridRecordDto
>
page
=
basicGridAcceptanceServiceImpl
.
selectPage
(
null
,
null
,
current
,
size
,
projectAddress
,
powerStationCode
,
ownersName
,
gridStatus
,
gridConnectionTime
,
"check"
);
Page
<
BasicGridRecordDto
>
page
=
basicGridAcceptanceServiceImpl
.
selectPage
(
null
,
null
,
current
,
size
,
projectAddress
,
powerStationCode
,
ownersName
,
gridStatus
,
gridConnectionTime
,
"check"
,
null
,
null
);
return
ResponseHelper
.
buildResponse
(
page
);
}
...
...
@@ -238,6 +247,7 @@ public class BasicGridAcceptanceController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"完工自审-经销商管理"
,
notes
=
"完工自审经销商管理"
)
@PostMapping
(
value
=
"/completeAdminAudit"
)
@Transactional
public
ResponseModel
completeAdminAudit
(
@RequestBody
Map
<
String
,
String
>
kv
)
{
basicGridAcceptanceServiceImpl
.
completeAdminAudit
(
kv
);
return
ResponseHelper
.
buildResponse
(
null
);
...
...
@@ -246,27 +256,31 @@ public class BasicGridAcceptanceController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"完工自审管理审核"
,
notes
=
"完工自审管理审核"
)
@PostMapping
(
value
=
"/completeAudit"
)
@Transactional
public
ResponseModel
completeAudit
(
@RequestBody
Map
<
String
,
String
>
kv
)
{
basicGridAcceptanceServiceImpl
.
completeAudit
(
kv
);
return
ResponseHelper
.
buildResponse
(
null
);
return
basicGridAcceptanceServiceImpl
.
completeAudit
(
kv
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"整改单下发"
,
notes
=
"整改单下发"
)
@PostMapping
(
value
=
"/addRectification"
)
@Transactional
public
ResponseModel
addRectification
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
basicGridAcceptanceServiceImpl
.
addRectification
(
hygfReplenishment
);
return
ResponseHelper
.
buildResponse
(
null
);
return
basicGridAcceptanceServiceImpl
.
addRectification
(
hygfReplenishment
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"整改单添加信息"
,
notes
=
"整改单添加信息"
)
@PostMapping
(
value
=
"/nextTaskExcute"
)
@Transactional
public
ResponseModel
nextTaskExcute
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
basicGridAcceptanceServiceImpl
.
nextTaskExcute
(
hygfReplenishment
);
return
ResponseHelper
.
buildResponse
(
null
);
return
basicGridAcceptanceServiceImpl
.
nextTaskExcute
(
hygfReplenishment
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
...
...
@@ -275,17 +289,18 @@ public class BasicGridAcceptanceController extends BaseController {
@Transactional
public
ResponseModel
nextTaskAduit
(
@RequestBody
HygfRectificationOrder
hygfReplenishment
)
{
basicGridAcceptanceServiceImpl
.
nextTaskAduit
(
hygfReplenishment
);
return
ResponseHelper
.
buildResponse
(
null
);
return
basicGridAcceptanceServiceImpl
.
nextTaskAduit
(
hygfReplenishment
);
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"整改单作废"
,
notes
=
"整改单作废"
)
@PutMapping
(
value
=
"/rollback"
)
@Transactional
public
ResponseModel
rollback
(
@RequestParam
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
basicGridAcceptanceServiceImpl
.
rollback
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
null
);
return
basicGridAcceptanceServiceImpl
.
rollback
(
sequenceNbr
);
}
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/HygfRectificationOrderController.java
View file @
1d0d1069
...
...
@@ -202,11 +202,11 @@ public class HygfRectificationOrderController extends BaseController {
for
(
Long
aLong
:
reginParams
.
getUserModel
().
getOrgRoleSeqs
().
keySet
())
{
List
<
Long
>
longs
=
reginParams
.
getUserModel
().
getOrgRoleSeqs
().
get
(
aLong
);
page
.
getRecords
().
forEach
(
e
->{
if
(
longs
.
contains
(
areaId
)
&&
e
.
getRectificationSource
().
equals
(
"bw-area"
)){
if
(
longs
.
contains
(
areaId
)
&&
e
.
getRectificationSource
().
equals
(
"bw-area"
)
&&
e
.
getRectificationSource
().
equals
(
rectificationSource
)
){
e
.
setIsAudit
(
"0"
);
}
else
if
(
longs
.
contains
(
engineeringId
)
&&
e
.
getRectificationSource
().
equals
(
"bw-engineering"
)){
}
else
if
(
longs
.
contains
(
engineeringId
)
&&
e
.
getRectificationSource
().
equals
(
"bw-engineering"
)
&&
e
.
getRectificationSource
().
equals
(
rectificationSource
)
){
e
.
setIsAudit
(
"0"
);
}
else
if
(
longs
.
contains
(
designId
)
&&
e
.
getRectificationSource
().
equals
(
"bw-design"
)){
}
else
if
(
longs
.
contains
(
designId
)
&&
e
.
getRectificationSource
().
equals
(
"bw-design"
)
&&
e
.
getRectificationSource
().
equals
(
rectificationSource
)
){
e
.
setIsAudit
(
"0"
);
}
else
if
(
longs
.
contains
(
delerKfId
)){
e
.
setIsAudit
(
"0"
);
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/WorkOrderController.java
View file @
1d0d1069
...
...
@@ -201,7 +201,7 @@ public class WorkOrderController extends BaseController {
List
<
Long
>
roleIds
=
new
ArrayList
<>();
for
(
Long
aLong
:
reginParams
.
getUserModel
().
getOrgRoleSeqs
().
keySet
())
{
List
<
Long
>
longs
=
reginParams
.
getUserModel
().
getOrgRoleSeqs
().
get
(
aLong
);
roleIds
.
addAll
(
roleIds
);
if
(
longs
.
contains
(
areaId
))
{
workOrderPowerStationNodes
.
add
(
"area"
);
}
...
...
@@ -216,6 +216,7 @@ public class WorkOrderController extends BaseController {
workOrderPowerStationNodes
.
add
(
"engineering"
);
workOrderPowerStationNodes
.
add
(
"area"
);
}
roleIds
.
addAll
(
longs
);
}
if
(
workOrder
.
getType
().
equals
(
"3"
)
&&
workOrderPowerStationNodes
!=
null
){
workOrder
.
setWorkOrderPowerStationNodes
(
workOrderPowerStationNodes
);
...
...
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 @
1d0d1069
...
...
@@ -12,6 +12,7 @@ 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.mapper.*
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IBasicGridAcceptanceService
;
import
com.yeejoin.amos.boot.module.hygf.api.util.CommonResponseNewUtil
;
import
com.yeejoin.amos.boot.module.hygf.api.util.NumberUtil
;
import
com.yeejoin.amos.boot.module.hygf.api.util.RedisLockUtil
;
import
com.yeejoin.amos.component.robot.BadRequest
;
...
...
@@ -28,6 +29,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
javax.annotation.Resource
;
import
java.util.*
;
...
...
@@ -74,13 +76,15 @@ public class BasicGridAcceptanceServiceImpl
BasicGridAuditingServiceImpl
basicGridAuditingService
;
@Autowired
BasicGridRecordServiceImpl
basicGridRecordService
;
@Autowired
AcceptanceCheckServiceImpl
acceptanceCheckService
;
private
final
String
OK
=
"0"
;
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
)
throws
Exception
{
String
gridConnectionTime
,
String
formType
,
List
<
String
>
basicGridNodes
,
String
type
)
throws
Exception
{
PageHelper
.
startPage
(
current
,
size
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Date
date
=
null
;
...
...
@@ -95,6 +99,8 @@ public class BasicGridAcceptanceServiceImpl
map
.
put
(
"formType"
,
formType
);
map
.
put
(
"regionCompanyId"
,
regionCompanyId
);
map
.
put
(
"amosDealerId"
,
amosDealerId
);
map
.
put
(
"basicGridNodes"
,
basicGridNodes
);
map
.
put
(
"type"
,
type
);
List
<
BasicGridRecordDto
>
list
=
basicGridAcceptanceMapper
.
selectPageList
(
map
);
PageInfo
<
BasicGridRecordDto
>
page
=
new
PageInfo
(
list
);
Page
<
BasicGridRecordDto
>
pageNew
=
new
Page
<>();
...
...
@@ -172,7 +178,6 @@ public class BasicGridAcceptanceServiceImpl
}
@Transactional
public
synchronized
HygfOnGrid
saveAndCommit
(
HygfOnGrid
grid
,
String
userId
)
{
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
()
...
...
@@ -480,7 +485,7 @@ public class BasicGridAcceptanceServiceImpl
public
void
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"
);
...
...
@@ -500,10 +505,27 @@ public class BasicGridAcceptanceServiceImpl
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"
)
&&
!
basicGridRecord
.
getRectificationStatus
()
.
contains
(
"bw-engineering"
)
)
{
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-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"
)
)
{
...
...
@@ -522,7 +544,7 @@ public class BasicGridAcceptanceServiceImpl
}
}
else
if
(
null
!=
basicGridRecord
.
getPowerStationEngineeringStatus
()
&&
basicGridRecord
.
getPowerStationEngineeringStatus
().
equals
(
"驳回"
)){
throw
new
BadRequest
(
"该流程已被工程人员审核驳回,请刷新列表"
);
return
CommonResponseNewUtil
.
failureMessage
(
"该流程已被工程人员审核驳回,请刷新列表"
);
}
else
{
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
);
}
...
...
@@ -533,10 +555,26 @@ public class BasicGridAcceptanceServiceImpl
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
YWC
.
getCode
());
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
);
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"all"
);
}
else
if
(
null
==
basicGridRecord
.
getPowerStationDesignStatus
()
&&
approvalStatus
.
equals
(
"0"
)
&&
!
basicGridRecord
.
getRectificationStatus
().
contains
(
"bw-bw-design"
)
)
{
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-bw-design"
))
))
{
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-design"
);
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
if
(
null
==
basicGridRecord
.
getPowerStationDesignStatus
()
&&
approvalStatus
.
equals
(
"0"
)
&&
basicGridRecord
.
getRectificationStatus
().
contains
(
"bw-bw-design"
)
)
{
}
else
if
(
null
==
basicGridRecord
.
getPowerStationDesignStatus
()
&&
approvalStatus
.
equals
(
"0"
)
&&
!
Objects
.
isNull
(
basicGridRecord
.
getRectificationStatus
())
&&
basicGridRecord
.
getRectificationStatus
().
contains
(
"bw-bw-design"
)
)
{
up
.
set
(
BasicGridRecord:
:
getBasicGridNode
,
"bw-design"
);
LambdaQueryWrapper
<
HygfRectificationOrder
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
HygfRectificationOrder:
:
getPeasantHouseholeId
,
basicGridRecord
.
getPeasantHouseholdId
());
...
...
@@ -551,7 +589,7 @@ public class BasicGridAcceptanceServiceImpl
up
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ZGDSH
.
getCode
());
}
}
else
if
(
null
!=
basicGridRecord
.
getPowerStationDesignStatus
()
&&
basicGridRecord
.
getPowerStationDesignStatus
().
equals
(
"驳回"
)){
throw
new
BadRequest
(
"该流程已被设计人员审核驳回,请刷新列表"
);
return
CommonResponseNewUtil
.
failureMessage
(
"该流程已被设计人员审核驳回,请刷新列表"
);
}
else
{
this
.
wofkflowExcute
(
instanceId
,
approvalStatus
,
comment
);
}
...
...
@@ -568,40 +606,56 @@ public class BasicGridAcceptanceServiceImpl
up
.
eq
(
BaseEntity:
:
getSequenceNbr
,
sequenceNbr
);
basicGridRecordService
.
getBaseMapper
().
update
(
null
,
up
);
}
return
CommonResponseNewUtil
.
success
();
}
public
void
addRectification
(
HygfRectificationOrder
hygfRectificationOrder
)
{
public
ResponseModel
addRectification
(
HygfRectificationOrder
hygfRectificationOrder
)
{
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
(
"当前农户存在其他进行中的整改单,不可重新发起"
);
}
}
//查询当前并网数据
LambdaQueryWrapper
<
BasicGridRecord
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
().
selectOne
(
wrapper
);
if
(!
Objects
.
isNull
(
basicGridRecord
)&&!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
())){
throw
new
BadRequest
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
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
());
}
else
if
(
null
==
basicGridRecord
.
getRectificationStatus
()
)
{
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"
)){
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
DZG
.
getCode
());
basicGridRecordService
.
update
(
null
,
qu
);
}
rectificationOrderAuditingService
.
addRectification
(
hygfRectificationOrder
);
qu
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
basicGridRecordService
.
update
(
null
,
qu
);
return
CommonResponseNewUtil
.
success
();
}
public
void
nextTaskExcute
(
HygfRectificationOrder
hygfRectificationOrder
)
{
public
ResponseModel
nextTaskExcute
(
HygfRectificationOrder
hygfRectificationOrder
)
{
//查询当前并网数据
LambdaQueryWrapper
<
BasicGridRecord
>
wrapper
=
new
LambdaQueryWrapper
<>();
wrapper
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
...
...
@@ -609,7 +663,7 @@ public class BasicGridAcceptanceServiceImpl
if
(!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
())){
hygfRectificationOrder
.
setRectificationStatus
(
WorkOrderEnum
.
整改中
.
getCode
());
rectificationOrderAuditingService
.
addRectification
(
hygfRectificationOrder
);
throw
new
BadRequest
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
return
CommonResponseNewUtil
.
failureMessage
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
}
if
(
hygfRectificationOrder
.
getAddorSubmit
().
equals
(
"0"
)
)
{
...
...
@@ -623,9 +677,10 @@ public class BasicGridAcceptanceServiceImpl
hygfRectificationOrder
.
setRectificationStatus
(
WorkOrderEnum
.
整改中
.
getCode
());
}
rectificationOrderAuditingService
.
nextTaskExcute
(
hygfRectificationOrder
);
return
CommonResponseNewUtil
.
success
();
}
public
void
nextTaskAduit
(
HygfRectificationOrder
hygfRectificationOrder
)
{
public
ResponseModel
nextTaskAduit
(
HygfRectificationOrder
hygfRectificationOrder
)
{
String
auditResult
=
hygfRectificationOrder
.
getAuditResult
();
//查询当前并网数据
...
...
@@ -634,7 +689,7 @@ public class BasicGridAcceptanceServiceImpl
BasicGridRecord
basicGridRecord
=
basicGridRecordService
.
getBaseMapper
().
selectOne
(
wrapper
);
if
(!
basicGridRecord
.
getBasicGridNode
().
contains
(
hygfRectificationOrder
.
getRectificationSource
())){
throw
new
BadRequest
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
return
CommonResponseNewUtil
.
failureMessage
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
}
//修改整改单状态
...
...
@@ -663,7 +718,6 @@ public class BasicGridAcceptanceServiceImpl
status
.
remove
(
hygfRectificationOrder
.
getRectificationSource
());
if
(
status
.
size
()<
1
){
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
null
);
basicGridRecord
.
setRectificationStatus
(
null
);
}
else
{
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
String
.
join
(
","
,
status
));
}
...
...
@@ -671,11 +725,12 @@ public class BasicGridAcceptanceServiceImpl
//若两者状态都为空 说明均为审核 若某一审核状态为空 则审核状态修改为为空审核节点
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
()
)
&&
Objects
.
isNull
(
basicGridRecord
.
getPowerStationEngineeringStatus
())){
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
ROLESDSH
.
getCode
());
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ROLESDSH
.
getCode
());
}
else
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
()
)
){
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
SJDSH
.
getCode
());
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
{
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
GCDSH
.
getCode
());
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
GCDSH
.
getCode
());
}
}
else
{
List
<
String
>
collect
=
list
.
stream
().
map
(
HygfRectificationOrder:
:
getRectificationStatus
).
collect
(
Collectors
.
toList
());
...
...
@@ -695,42 +750,39 @@ public class BasicGridAcceptanceServiceImpl
}
basicGridRecordService
.
update
(
null
,
qu
);
}
return
CommonResponseNewUtil
.
success
();
}
public
void
rollback
(
Long
sequenceNbr
)
{
public
ResponseModel
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
(
"当前流程发生变化,暂时无法操作,请刷新再试"
);
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
())){
rectificationOrderAuditingService
.
rollback
(
sequenceNbr
);
LambdaUpdateWrapper
<
BasicGridRecord
>
qu
=
new
LambdaUpdateWrapper
();
qu
.
eq
(
BasicGridRecord:
:
getPeasantHouseholdId
,
hygfRectificationOrder
.
getPeasantHouseholeId
());
List
<
String
>
status
=
new
ArrayList
<>(
Arrays
.
asList
(
basicGridRecord
.
getRectificationStatus
().
split
(
","
)));
status
.
remove
(
hygfRectificationOrder
.
getRectificationSource
());
if
(
status
.
size
()<
1
){
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
null
);
basicGridRecord
.
setRectificationStatus
(
null
);
}
else
{
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
String
.
join
(
","
,
status
));
qu
.
set
(
BasicGridRecord:
:
getRectificationStatus
,
String
.
join
(
","
,
status
));
basicGridRecordService
.
getBaseMapper
().
update
(
null
,
qu
);
}
basicGridRecordService
.
getBaseMapper
().
update
(
null
,
qu
);
}
else
{
throw
new
BadRequest
(
"仅单据状态为待提交或待整改时方可作废"
);
return
CommonResponseNewUtil
.
failureMessage
(
"仅单据状态为待提交或待整改时方可作废"
);
}
if
(
hygfRectificationOrder
.
getRectificationSource
().
equals
(
"bw-area"
)){
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
PQYYDSH
.
getCode
());
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
PQYYDSH
.
getCode
());
}
else
{
//查询是否还有其它类型待整改的整改单存在 若存在后置节点为当前并网状态
...
...
@@ -744,21 +796,20 @@ public class BasicGridAcceptanceServiceImpl
//若两者状态都为空 说明均为审核 若某一审核状态为空 则审核状态修改为为空审核节点
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
()
)
&&
Objects
.
isNull
(
basicGridRecord
.
getPowerStationEngineeringStatus
())){
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
ROLESDSH
.
getCode
());
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
ROLESDSH
.
getCode
());
}
else
if
(
Objects
.
isNull
(
basicGridRecord
.
getPowerStationDesignStatus
()
)
){
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
SJDSH
.
getCode
());
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
GridStatusEnum
.
SJDSH
.
getCode
());
}
else
{
basicGridRecord
.
setGridStatus
(
GridStatusEnum
.
GCDSH
.
getCode
());
qu
.
set
(
BasicGridRecord:
:
getGridStatus
,
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
);
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