Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
6a51fbca
Commit
6a51fbca
authored
Jan 17, 2024
by
KeYong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
620e153a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
103 additions
and
33 deletions
+103
-33
BasicGridAcceptanceMapper.xml
...main/resources/mapper/mysql/BasicGridAcceptanceMapper.xml
+9
-11
BasicGridAcceptanceController.java
...le/hygf/biz/controller/BasicGridAcceptanceController.java
+24
-18
BasicGridAcceptanceServiceImpl.java
...hygf/biz/service/impl/BasicGridAcceptanceServiceImpl.java
+70
-4
No files found.
amos-boot-system-jxiop/amos-boot-module-hygf-api/src/main/resources/mapper/mysql/BasicGridAcceptanceMapper.xml
View file @
6a51fbca
...
...
@@ -14,15 +14,15 @@
<select
id=
"selectPageList"
resultType=
"com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAcceptanceDto"
>
SELECT
hbga.sequence_nbr sequenceNbr,
hbga.work_order_id workOrderId,
hbga.work_order_power_station_id workOrderPowerStationId,
hbga.peasant_household_id peasantHouseholdId,
hbga.acceptance_rec_date acceptanceRecDate,
hbga.instance_id instanceId,
hbga.next_executor_ids nextExecutorIds,
hbga.next_node_key,
hph.owners_name AS ownersName,
hbga.sequence_nbr sequenceNbr,
hbga.work_order_id workOrderId,
hbga.work_order_power_station_id workOrderPowerStationId,
hbga.peasant_household_id peasantHouseholdId,
hbga.acceptance_rec_date acceptanceRecDate,
hbga.instance_id instanceId,
hbga.next_executor_ids nextExecutorIds,
hbga.next_node_key,
hph.owners_name AS ownersName,
hph.peasant_household_no peasantHouseholdNo,
hph.project_address_name projectAddressName,
DATE_FORMAT(hogaa.grid_connection_time, '%Y-%m-%d') AS gridConnectionTime,
...
...
@@ -30,7 +30,6 @@
WHEN hbga.grid_status = '2' THEN '待审核'
WHEN hbga.grid_status = '3' THEN '已完成'
ELSE '未通过' END AS gridStatus
FROM
hygf_basic_grid_acceptance hbga
LEFT JOIN hygf_peasant_household hph ON hph.sequence_nbr = hbga.peasant_household_id
...
...
@@ -38,7 +37,6 @@
LEFT JOIN hygf_work_order ON hygf_work_order.sequence_nbr = hbga.work_order_id
<where>
hbga.is_delete = 0
<if
test=
"map.amosDealerId!=null and map.amosDealerId!=''"
>
and hygf_work_order.amos_dealer_id = #{map.amosDealerId}
</if>
...
...
amos-boot-system-jxiop/amos-boot-module-hygf-biz/src/main/java/com/yeejoin/amos/boot/module/hygf/biz/controller/BasicGridAcceptanceController.java
View file @
6a51fbca
...
...
@@ -3,6 +3,8 @@ package com.yeejoin.amos.boot.module.hygf.biz.controller;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.GridStatusEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.ProcessDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.StartProcessDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.UserUnitInformationDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.BasicGridAcceptance
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HygfOnGrid
;
...
...
@@ -10,6 +12,7 @@ import com.yeejoin.amos.boot.module.hygf.api.entity.PeasantHousehold;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAcceptanceMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.HygfOnGridMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.PersonnelBusinessMapper
;
import
com.yeejoin.amos.boot.module.hygf.biz.service.impl.WorkflowImpl
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -50,13 +53,13 @@ public class BasicGridAcceptanceController extends BaseController {
BasicGridAcceptanceMapper
basicGridAcceptanceMapper
;
@Autowired
HygfOnGridMapper
onGridMapper
;
@Autowired
PersonnelBusinessMapper
personnelBusinessMapper
;
@Autowired
WorkflowImpl
workflow
;
/**
* 新增
* 新增
保存
*
* @return
*/
...
...
@@ -65,18 +68,20 @@ public class BasicGridAcceptanceController extends BaseController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
save
(
@RequestBody
Map
<
String
,
HygfOnGrid
>
model
)
{
HygfOnGrid
dto
=
model
.
get
(
"HygfOnGridInfo"
);
HygfOnGrid
onGrid
=
new
HygfOnGrid
();
BeanUtils
.
copyProperties
(
dto
,
onGrid
);
onGridMapper
.
insert
(
onGrid
);
// PeasantHousehold household = basicGridAcceptanceMapper.getStationInfoById(dto.getWorkOrderPowerStationId());
BasicGridAcceptance
basicGridAcceptance
=
basicGridAcceptanceMapper
.
selectOne
(
new
LambdaQueryWrapper
<
BasicGridAcceptance
>().
eq
(
BasicGridAcceptance:
:
getWorkOrderPowerStationId
,
dto
.
getWorkOrderPowerStationId
()));
basicGridAcceptance
.
setGridStatus
(
GridStatusEnum
.
DDJ
.
getCode
());
BasicGridAcceptanceDto
basicDto
=
new
BasicGridAcceptanceDto
();
BeanUtils
.
copyProperties
(
basicGridAcceptance
,
basicDto
);
// 调用工作流执行第一个节点
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
saveEntity
(
dto
));
}
BasicGridAcceptanceDto
basicGridAcceptanceDto
=
basicGridAcceptanceServiceImpl
.
updateWithModel
(
basicDto
);
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceDto
);
/**
* 新增保存
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save/commit"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增"
,
notes
=
"新增"
)
public
ResponseModel
saveAndCommit
(
@RequestBody
Map
<
String
,
HygfOnGrid
>
model
)
{
HygfOnGrid
dto
=
model
.
get
(
"HygfOnGridInfo"
);
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
saveAndCommit
(
dto
));
}
/**
...
...
@@ -88,9 +93,10 @@ public class BasicGridAcceptanceController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新"
,
notes
=
"根据sequenceNbr更新"
)
public
ResponseModel
<
BasicGridAcceptanceDto
>
updateBySequenceNbrBasicGridAcceptance
(
@RequestBody
BasicGridAcceptanceDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
public
ResponseModel
updateBySequenceNbrBasicGridAcceptance
(
@RequestBody
HygfOnGrid
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
updateWithModel
(
model
));
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
modifyEntity
(
model
));
}
/**
...
...
@@ -102,8 +108,8 @@ public class BasicGridAcceptanceController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@DeleteMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"DELETE"
,
value
=
"根据sequenceNbr删除"
,
notes
=
"根据sequenceNbr删除"
)
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
){
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
removeById
(
sequenceNbr
));
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
@RequestParam
(
"sequenceNbrs"
)
Long
[]
sequenceNbrs
){
return
ResponseHelper
.
buildResponse
(
basicGridAcceptanceServiceImpl
.
deleteForBatch
(
sequenceNbrs
));
}
/**
...
...
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 @
6a51fbca
package
com
.
yeejoin
.
amos
.
boot
.
module
.
hygf
.
biz
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.yeejoin.amos.boot.module.hygf.api.Enum.GridStatusEnum
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.BasicGridAcceptanceDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.ProcessDto
;
import
com.yeejoin.amos.boot.module.hygf.api.dto.StartProcessDto
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.BasicGridAcceptance
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.HygfOnGrid
;
import
com.yeejoin.amos.boot.module.hygf.api.entity.WorkOrder
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.BasicGridAcceptanceMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.HygfOnGridMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.mapper.PersonnelBusinessMapper
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IBasicGridAcceptanceService
;
import
com.yeejoin.amos.boot.module.hygf.api.service.IHygfOnGridService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.*
;
@Slf4j
@Service
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
class
BasicGridAcceptanceServiceImpl
extends
BaseService
<
BasicGridAcceptanceDto
,
BasicGridAcceptance
,
BasicGridAcceptanceMapper
>
implements
IBasicGridAcceptanceService
{
@Autowired
BasicGridAcceptanceMapper
basicGridAcceptanceMapper
;
@Autowired
HygfOnGridMapper
onGridMapper
;
@Autowired
PersonnelBusinessMapper
personnelBusinessMapper
;
@Autowired
WorkflowImpl
workflow
;
public
Page
<
BasicGridAcceptanceDto
>
selectPage
(
Long
regionCompanyId
,
Long
amosDealerId
,
int
current
,
int
size
,
String
projectAddress
,
String
powerStationCode
,
String
ownersName
,
String
gridStatus
,
Date
gridConnectionTime
,
String
formType
)
{
PageHelper
.
startPage
(
current
,
size
);
...
...
@@ -45,4 +60,55 @@ public class BasicGridAcceptanceServiceImpl extends BaseService<BasicGridAccepta
pageNew
.
setRecords
(
page
.
getList
());
return
pageNew
;
}
public
HygfOnGrid
saveEntity
(
HygfOnGrid
grid
)
{
HygfOnGrid
onGrid
=
new
HygfOnGrid
();
BeanUtils
.
copyProperties
(
grid
,
onGrid
);
onGridMapper
.
insert
(
onGrid
);
BasicGridAcceptance
basicGridAcceptance
=
basicGridAcceptanceMapper
.
selectOne
(
new
LambdaQueryWrapper
<
BasicGridAcceptance
>().
eq
(
BasicGridAcceptance:
:
getWorkOrderPowerStationId
,
grid
.
getWorkOrderPowerStationId
()));
basicGridAcceptance
.
setGridStatus
(
GridStatusEnum
.
DDJ
.
getCode
());
basicGridAcceptanceMapper
.
updateById
(
basicGridAcceptance
);
return
onGrid
;
}
public
HygfOnGrid
saveAndCommit
(
HygfOnGrid
grid
)
{
HygfOnGrid
onGrid
=
new
HygfOnGrid
();
BeanUtils
.
copyProperties
(
grid
,
onGrid
);
onGridMapper
.
insert
(
onGrid
);
BasicGridAcceptance
basicGridAcceptance
=
basicGridAcceptanceMapper
.
selectOne
(
new
LambdaQueryWrapper
<
BasicGridAcceptance
>().
eq
(
BasicGridAcceptance:
:
getWorkOrderPowerStationId
,
grid
.
getWorkOrderPowerStationId
()));
basicGridAcceptance
.
setGridStatus
(
GridStatusEnum
.
DSH
.
getCode
());
// 调用工作流执行第一个节点
ProcessDto
processDto
=
new
ProcessDto
();
processDto
.
setBusinessKey
(
String
.
valueOf
(
basicGridAcceptance
.
getSequenceNbr
()));
StartProcessDto
startProcessDto
=
new
StartProcessDto
();
startProcessDto
.
setProcess
(
processDto
);
BasicGridAcceptance
workBasicGridAcceptance
=
workflow
.
startProcess
(
basicGridAcceptance
,
startProcessDto
);
BeanUtils
.
copyProperties
(
workBasicGridAcceptance
,
basicGridAcceptance
);
basicGridAcceptanceMapper
.
updateById
(
basicGridAcceptance
);
return
onGrid
;
}
public
HygfOnGrid
modifyEntity
(
HygfOnGrid
grid
)
{
onGridMapper
.
updateById
(
grid
);
return
grid
;
}
public
Boolean
deleteForBatch
(
Long
[]
sequenceNbrs
)
{
if
(
Objects
.
isNull
(
sequenceNbrs
)
||
sequenceNbrs
.
length
==
0
)
{
return
false
;
}
Boolean
bool
=
Boolean
.
TRUE
;
Collection
<
HygfOnGrid
>
grids
=
onGridMapper
.
selectBatchIds
(
Arrays
.
asList
(
sequenceNbrs
));
for
(
HygfOnGrid
x
:
grids
)
{
x
.
setIsDelete
(
true
);
int
num
=
onGridMapper
.
updateById
(
x
);
if
(
0
==
num
)
{
bool
=
Boolean
.
FALSE
;
break
;
}
}
return
bool
;
}
}
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