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
f0f5f181
Commit
f0f5f181
authored
Dec 14, 2023
by
李秀明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(jg): 安装告知-列表页面(企业、监管)-列表数据接口
parent
a85f9977
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
142 additions
and
65 deletions
+142
-65
JgInstallationNoticeDto.java
.../amos/boot/module/jg/api/dto/JgInstallationNoticeDto.java
+5
-2
JgInstallationNoticeMapper.java
...boot/module/jg/api/mapper/JgInstallationNoticeMapper.java
+6
-3
JgInstallationNoticeMapper.xml
.../src/main/resources/mapper/JgInstallationNoticeMapper.xml
+43
-0
JgInstallationNoticeController.java
...ule/jg/biz/controller/JgInstallationNoticeController.java
+58
-55
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+30
-5
No files found.
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/dto/JgInstallationNoticeDto.java
View file @
f0f5f181
...
...
@@ -8,7 +8,7 @@ import lombok.EqualsAndHashCode;
import
java.util.Date
;
/**
*
*
*
* @author system_generator
* @date 2023-12-12
...
...
@@ -27,9 +27,12 @@ public class JgInstallationNoticeDto extends BaseDto {
@ApiModelProperty
(
value
=
"设备种类"
)
private
String
equList
;
@ApiModelProperty
(
value
=
"告知状态"
)
@ApiModelProperty
(
value
=
"告知状态
编号
"
)
private
String
noticeStatus
;
@ApiModelProperty
(
value
=
"告知状态描述"
)
private
String
noticeStatusDesc
;
@ApiModelProperty
(
value
=
"设备数量"
)
private
Integer
deviceNum
;
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/mapper/JgInstallationNoticeMapper.java
View file @
f0f5f181
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
mapper
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
org.apache.ibatis.annotations.Param
;
/**
*
Mapper 接口
* Mapper 接口
*
* @author system_generator
* @date 2023-12-12
*/
public
interface
JgInstallationNoticeMapper
extends
BaseMapper
<
JgInstallationNotice
>
{
Page
<
JgInstallationNotice
>
queryForPage
(
Page
<
JgInstallationNotice
>
page
,
@Param
(
"param"
)
JgInstallationNoticeDto
model
,
@Param
(
"type"
)
String
type
);
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgInstallationNoticeMapper.xml
View file @
f0f5f181
...
...
@@ -2,4 +2,47 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper"
>
<select
id=
"queryForPage"
resultType=
"com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice"
>
select
isn.sequence_nbr AS sequenceNbr,
isn.apply_no AS applyNo,
isn.notice_date AS noticeDate,
isn.use_unit_id AS useUnitId,
isn.use_unit_name AS useUnitName,
isn.receive_org_id AS receiveOrgId,
isn.receive_org_name AS receiveOrgName,
isn.region_no AS regionNo,
isn.address AS address,
isn.notice_status AS noticeStatus,
isn.install_unit_id AS installUnitId,
isn.install_unit_name AS installUnitName
FROM
tzs_jg_installation_notice isn
<where>
isn.is_delete = false
<if
test=
"param != null "
>
<if
test=
"param.applyNo != null and param.applyNo != ''"
>
AND isn.apply_no LIKE CONCAT('%', #{param.applyNo}, '%')
</if>
<if
test=
"param.receiveOrgName != null and param.receiveOrgName != ''"
>
AND isn.receive_org_name LIKE CONCAT('%', #{param.receiveOrgName}, '%')
</if>
<if
test=
"param.useUnitName != null and param.useUnitName != ''"
>
AND isn.use_unit_name LIKE CONCAT('%', #{param.useUnitName}, '%')
</if>
<if
test=
"param.installUnitName != null and param.installUnitName != ''"
>
AND isn.install_unit_name LIKE CONCAT('%', #{param.installUnitName}, '%')
</if>
<if
test=
"param.noticeStatus != null and param.noticeStatus != ''"
>
AND isn.notice_status = #{param.noticeStatus}
</if>
</if>
<if
test=
"type == 'supervision'"
>
AND isn.notice_status in ('6612', '6613', '6614')
</if>
</where>
ORDER BY
isn.notice_date DESC
</select>
</mapper>
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/controller/JgInstallationNoticeController.java
View file @
f0f5f181
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
controller
;
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.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
java.util.List
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
com.yeejoin.amos.boot.module.jg.biz.service.impl.JgInstallationNoticeServiceImpl
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.servlet.http.HttpServletRequest
;
import
org.springframework.web.bind.annotation.*
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
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
javax.servlet.http.HttpServletRequest
;
import
java.util.List
;
/**
* 安装告知
...
...
@@ -37,28 +38,28 @@ public class JgInstallationNoticeController extends BaseController {
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增安装告知"
,
notes
=
"新增安装告知"
)
public
ResponseModel
<
JgInstallationNoticeDto
>
save
(
@RequestBody
JgInstallationNoticeDto
model
)
{
model
=
jgInstallationNoticeServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
@PostMapping
(
value
=
"/save"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"新增安装告知"
,
notes
=
"新增安装告知"
)
public
ResponseModel
<
JgInstallationNoticeDto
>
save
(
@RequestBody
JgInstallationNoticeDto
model
)
{
model
=
jgInstallationNoticeServiceImpl
.
createWithModel
(
model
);
return
ResponseHelper
.
buildResponse
(
model
);
}
/**
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新安装告知"
,
notes
=
"根据sequenceNbr更新安装告知"
)
public
ResponseModel
<
JgInstallationNoticeDto
>
updateBySequenceNbrJgInstallationNotice
(
@RequestBody
JgInstallationNoticeDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
updateWithModel
(
model
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PutMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"PUT"
,
value
=
"根据sequenceNbr更新安装告知"
,
notes
=
"根据sequenceNbr更新安装告知"
)
public
ResponseModel
<
JgInstallationNoticeDto
>
updateBySequenceNbrJgInstallationNotice
(
@RequestBody
JgInstallationNoticeDto
model
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
model
.
setSequenceNbr
(
sequenceNbr
);
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
updateWithModel
(
model
));
}
/**
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
...
...
@@ -67,50 +68,52 @@ public class JgInstallationNoticeController 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
){
public
ResponseModel
<
Boolean
>
deleteBySequenceNbr
(
HttpServletRequest
request
,
@PathVariable
(
value
=
"sequenceNbr"
)
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
removeById
(
sequenceNbr
));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr
主键
* @param sequenceNbr
主键
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个安装告知"
,
notes
=
"根据sequenceNbr查询单个安装告知"
)
public
ResponseModel
<
JgInstallationNoticeDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/{sequenceNbr}"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"根据sequenceNbr查询单个安装告知"
,
notes
=
"根据sequenceNbr查询单个安装告知"
)
public
ResponseModel
<
JgInstallationNoticeDto
>
selectOne
(
@PathVariable
Long
sequenceNbr
)
{
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
queryBySeq
(
sequenceNbr
));
}
/**
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@GetMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知分页查询"
,
notes
=
"安装告知分页查询"
)
public
ResponseModel
<
Page
<
JgInstallationNoticeDto
>>
queryForPage
(
@RequestParam
(
value
=
"current"
)
int
current
,
@RequestParam
(
value
=
"size"
)
int
size
)
{
Page
<
JgInstallationNoticeDto
>
page
=
new
Page
<
JgInstallationNoticeDto
>();
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
queryForJgInstallationNoticePage
(
page
));
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知分页查询"
,
notes
=
"安装告知分页查询"
)
public
ResponseModel
<
Page
<
JgInstallationNoticeDto
>>
queryForPage
(
@ApiParam
(
value
=
"当前页码"
,
required
=
true
)
@RequestParam
(
value
=
"current"
,
defaultValue
=
"1"
)
int
current
,
@ApiParam
(
value
=
"每页大小"
,
required
=
true
)
@RequestParam
(
value
=
"size"
,
defaultValue
=
"20"
)
int
size
,
@ApiParam
(
value
=
"类型:enterprise-企业端、supervision-监管端"
,
required
=
true
)
@RequestParam
(
value
=
"type"
,
defaultValue
=
"enterprise"
)
String
type
,
@RequestBody
(
required
=
false
)
JgInstallationNoticeDto
model
)
{
Page
<
JgInstallationNotice
>
page
=
new
Page
<>(
current
,
size
);
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
queryForJgInstallationNoticePage
(
page
,
model
,
type
));
}
/**
* 列表全部数据查询
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知列表全部数据查询"
,
notes
=
"安装告知列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
JgInstallationNoticeDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
queryForJgInstallationNoticeList
());
}
* @return
*/
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知列表全部数据查询"
,
notes
=
"安装告知列表全部数据查询"
)
@GetMapping
(
value
=
"/list"
)
public
ResponseModel
<
List
<
JgInstallationNoticeDto
>>
selectForList
()
{
return
ResponseHelper
.
buildResponse
(
jgInstallationNoticeServiceImpl
.
queryForJgInstallationNoticeList
());
}
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-biz/src/main/java/com/yeejoin/amos/boot/module/jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
View file @
f0f5f181
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
biz
.
service
.
impl
;
import
com.yeejoin.amos.boot.module.jg.api.entity.JgInstallationNotice
;
import
com.yeejoin.amos.boot.module.jg.api.enums.FlowStatusEnum
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService
;
import
com.yeejoin.amos.boot.module.jg.api.dto.JgInstallationNoticeDto
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.typroject.tyboot.core.rdbms.service.BaseService
;
import
org.springframework.stereotype.Service
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
java.util.List
;
import
java.util.Objects
;
/**
* 服务实现类
...
...
@@ -16,18 +21,37 @@ import java.util.List;
* @date 2023-12-12
*/
@Service
public
class
JgInstallationNoticeServiceImpl
extends
BaseService
<
JgInstallationNoticeDto
,
JgInstallationNotice
,
JgInstallationNoticeMapper
>
implements
IJgInstallationNoticeService
{
public
class
JgInstallationNoticeServiceImpl
extends
BaseService
<
JgInstallationNoticeDto
,
JgInstallationNotice
,
JgInstallationNoticeMapper
>
implements
IJgInstallationNoticeService
{
@Autowired
private
JgInstallationNoticeMapper
jgInstallationNoticeMapper
;
/**
* 分页查询
*/
public
Page
<
JgInstallationNoticeDto
>
queryForJgInstallationNoticePage
(
Page
<
JgInstallationNoticeDto
>
page
)
{
return
this
.
queryForPage
(
page
,
null
,
false
);
public
Page
<
JgInstallationNoticeDto
>
queryForJgInstallationNoticePage
(
Page
<
JgInstallationNotice
>
page
,
JgInstallationNoticeDto
model
,
String
type
)
{
Page
<
JgInstallationNotice
>
noticePage
=
jgInstallationNoticeMapper
.
queryForPage
(
page
,
model
,
type
);
// 将Page<JgInstallationNotice>转化为Page<JgInstallationNoticeDto>
Page
<
JgInstallationNoticeDto
>
noticeDtoPage
=
new
Page
<>();
BeanUtils
.
copyProperties
(
noticePage
,
noticeDtoPage
,
"records"
);
List
<
JgInstallationNoticeDto
>
records
=
noticePage
.
getRecords
().
stream
().
map
(
notice
->
{
JgInstallationNoticeDto
noticeDto
=
new
JgInstallationNoticeDto
();
BeanUtils
.
copyProperties
(
notice
,
noticeDto
);
if
(
Objects
.
nonNull
(
notice
.
getNoticeStatus
()))
{
String
noticeStatusDesc
=
FlowStatusEnum
.
getNameByType
(
Long
.
valueOf
(
notice
.
getNoticeStatus
()));
noticeDto
.
setNoticeStatusDesc
(
noticeStatusDesc
);
}
return
noticeDto
;
}).
collect
(
java
.
util
.
stream
.
Collectors
.
toList
());
noticeDtoPage
.
setRecords
(
records
);
return
noticeDtoPage
;
}
/**
* 列表查询 示例
*/
public
List
<
JgInstallationNoticeDto
>
queryForJgInstallationNoticeList
()
{
return
this
.
queryForList
(
""
,
false
);
public
List
<
JgInstallationNoticeDto
>
queryForJgInstallationNoticeList
()
{
return
this
.
queryForList
(
""
,
false
);
}
}
\ No newline at end of file
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