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
725fad7c
Commit
725fad7c
authored
Apr 12, 2024
by
韩桐桐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(jg):安装告知添加列别字段的排序功能支持
parent
09912c76
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
84 additions
and
11 deletions
+84
-11
JgInstallationNoticeMapper.java
...boot/module/jg/api/mapper/JgInstallationNoticeMapper.java
+6
-1
IJgInstallationNoticeService.java
...t/module/jg/api/service/IJgInstallationNoticeService.java
+1
-1
SortVo.java
...n/java/com/yeejoin/amos/boot/module/jg/api/vo/SortVo.java
+14
-0
JgInstallationNoticeMapper.xml
.../src/main/resources/mapper/JgInstallationNoticeMapper.xml
+4
-1
JgInstallationNoticeController.java
...ule/jg/biz/controller/JgInstallationNoticeController.java
+7
-3
CommonServiceImpl.java
...os/boot/module/jg/biz/service/impl/CommonServiceImpl.java
+42
-0
JgInstallationNoticeServiceImpl.java
.../jg/biz/service/impl/JgInstallationNoticeServiceImpl.java
+10
-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/mapper/JgInstallationNoticeMapper.java
View file @
725fad7c
...
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jg.api.mapper;
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
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
org.apache.ibatis.annotations.MapKey
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -24,7 +25,11 @@ public interface JgInstallationNoticeMapper extends CustomBaseMapper<JgInstallat
* @param type 类型:enterprise-企业端、supervision-监管端
* @return 安装告知列表
*/
Page
<
Map
<
String
,
Object
>>
queryForPage
(
Page
<
JgInstallationNotice
>
page
,
@Param
(
"param"
)
JgInstallationNoticeDto
model
,
@Param
(
"type"
)
String
type
,
@Param
(
"orgCode"
)
String
orgCode
);
Page
<
Map
<
String
,
Object
>>
queryForPage
(
Page
<
JgInstallationNotice
>
page
,
@Param
(
"param"
)
JgInstallationNoticeDto
model
,
@Param
(
"type"
)
String
type
,
@Param
(
"sort"
)
SortVo
sort
,
@Param
(
"orgCode"
)
String
orgCode
);
/**
* 根据安装告知编号查询设备、设计、制造等信息
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/service/IJgInstallationNoticeService.java
View file @
725fad7c
...
...
@@ -44,7 +44,7 @@ public interface IJgInstallationNoticeService extends IService<JgInstallationNot
* @param type 类型:enterprise-企业端、supervision-监管端
* @return 安装告知列表
*/
Page
<
Map
<
String
,
Object
>>
queryForJgInstallationNoticePage
(
Page
<
JgInstallationNotice
>
page
,
JgInstallationNoticeDto
model
,
String
type
,
ReginParams
reginParams
);
Page
<
Map
<
String
,
Object
>>
queryForJgInstallationNoticePage
(
Page
<
JgInstallationNotice
>
page
,
JgInstallationNoticeDto
model
,
String
type
,
String
sort
,
ReginParams
reginParams
);
/**
* 批量删除
...
...
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/java/com/yeejoin/amos/boot/module/jg/api/vo/SortVo.java
0 → 100644
View file @
725fad7c
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jg
.
api
.
vo
;
import
lombok.Builder
;
import
lombok.Data
;
/**
* @description: 排序对象
**/
@Data
@Builder
public
class
SortVo
{
String
field
;
String
sortType
;
}
amos-boot-system-tzs/amos-boot-module-jg/amos-boot-module-jg-api/src/main/resources/mapper/JgInstallationNoticeMapper.xml
View file @
725fad7c
...
...
@@ -106,7 +106,10 @@
</if>
</where>
ORDER BY
isn.create_date DESC
<if
test=
"sort != null"
>
isn.${sort.field} ${sort.sortType},
</if>
isn.create_date DESC
</select>
<select
id=
"queryEquipInformation"
resultType=
"java.util.Map"
>
...
...
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 @
725fad7c
...
...
@@ -138,16 +138,20 @@ public class JgInstallationNoticeController extends BaseController {
@PostMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"安装告知分页查询"
,
notes
=
"安装告知分页查询"
)
public
ResponseModel
<
Page
<
Map
<
String
,
Object
>>>
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
=
"当前页码"
,
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
,
@ApiParam
(
value
=
"排序字段"
,
required
=
false
)
@RequestParam
(
value
=
"sort"
,
required
=
false
)
String
sort
,
@RequestBody
(
required
=
false
)
JgInstallationNoticeDto
model
)
{
Page
<
JgInstallationNotice
>
page
=
new
Page
<>(
current
,
size
);
ReginParams
reginParams
=
getSelectedOrgInfo
();
type
=
(
String
)
iJgInstallationNoticeService
.
getCompanyType
().
get
(
"companyLevel"
);
return
ResponseHelper
.
buildResponse
(
iJgInstallationNoticeService
.
queryForJgInstallationNoticePage
(
page
,
model
,
type
,
reginParams
));
return
ResponseHelper
.
buildResponse
(
iJgInstallationNoticeService
.
queryForJgInstallationNoticePage
(
page
,
model
,
type
,
sort
,
reginParams
));
}
/**
...
...
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/CommonServiceImpl.java
View file @
725fad7c
...
...
@@ -34,6 +34,7 @@ import com.yeejoin.amos.boot.module.jg.api.service.IJgChangeRegistrationTransfer
import
com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgMaintainNoticeService
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgTransferNoticeService
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICommonService
;
...
...
@@ -1688,6 +1689,47 @@ public class CommonServiceImpl implements ICommonService {
}
return
result
;
}
/**
* 驼峰转下划线
*
* @param str
* @return
*/
public
static
String
convertToUnderline
(
String
str
)
{
StringBuilder
sb
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
str
.
length
();
i
++)
{
char
c
=
str
.
charAt
(
i
);
if
(
Character
.
isUpperCase
(
c
))
{
sb
.
append
(
"_"
).
append
(
Character
.
toLowerCase
(
c
));
}
else
{
sb
.
append
(
c
);
}
}
return
sb
.
toString
();
}
/**
* 排序 :页面列表排序功能支持,将 "字段,ascend" 或 "字段,descend" 转化为对应JSONObject
* @param sort "字段,ascend" 或 "字段,descend"
* @return JSONObject
*/
public
SortVo
sortFieldConversion
(
String
sort
)
{
Optional
<
String
>
optionalSort
=
Optional
.
ofNullable
(
sort
);
Optional
<
SortVo
>
optionalSortMap
=
optionalSort
.
filter
(
s
->
!
s
.
isEmpty
())
.
map
(
s
->
{
String
[]
sortParts
=
s
.
split
(
","
);
if
(
sortParts
.
length
==
2
)
{
String
field
=
sortParts
[
0
];
String
sortSituation
=
sortParts
[
1
].
contains
(
"asc"
)
?
"ASC"
:
"DESC"
;
return
SortVo
.
builder
()
.
field
(
convertToUnderline
(
field
))
.
sortType
(
sortSituation
)
.
build
();
}
return
null
;
});
return
optionalSortMap
.
orElse
(
null
);
}
@Override
public
void
fightUseFlagGenerate
(
UseFlagParamDto
useFlagParamDto
,
HttpServletResponse
response
)
{
...
...
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 @
725fad7c
...
...
@@ -24,6 +24,7 @@ import com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeEqMapper;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgInstallationNoticeMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.JgUseRegistrationMapper
;
import
com.yeejoin.amos.boot.module.jg.api.service.IJgInstallationNoticeService
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jg.biz.feign.TzsServiceFeignClient
;
import
com.yeejoin.amos.boot.module.jg.biz.service.ICmWorkflowService
;
import
com.yeejoin.amos.boot.module.jg.biz.service.IIdxBizJgConstructionInfoService
;
...
...
@@ -381,12 +382,16 @@ public class JgInstallationNoticeServiceImpl extends BaseService<JgInstallationN
* @return 安装告知列表
*/
@Override
public
Page
<
Map
<
String
,
Object
>>
queryForJgInstallationNoticePage
(
Page
<
JgInstallationNotice
>
page
,
JgInstallationNoticeDto
model
,
String
type
,
ReginParams
reginParams
)
{
String
orgCode
;
orgCode
=
reginParams
.
getCompany
().
getCompanyCode
();
public
Page
<
Map
<
String
,
Object
>>
queryForJgInstallationNoticePage
(
Page
<
JgInstallationNotice
>
page
,
JgInstallationNoticeDto
model
,
String
type
,
String
sort
,
ReginParams
reginParams
)
{
String
orgCode
=
reginParams
.
getCompany
().
getCompanyCode
();
SortVo
sortMap
=
commonService
.
sortFieldConversion
(
sort
);
model
.
setTransferToUserIds
(
reginParams
.
getUserModel
().
getUserId
());
Page
<
Map
<
String
,
Object
>>
noticePage
=
jgInstallationNoticeMapper
.
queryForPage
(
page
,
model
,
type
,
orgCode
);
Page
<
Map
<
String
,
Object
>>
noticePage
=
jgInstallationNoticeMapper
.
queryForPage
(
page
,
model
,
type
,
sortMap
,
orgCode
);
List
<
Map
<
String
,
Object
>>
mappedRecords
=
noticePage
.
getRecords
().
stream
().
peek
(
notice
->
{
Optional
<
Long
>
noticeStatusOpt
=
Optional
.
ofNullable
((
String
)
notice
.
get
(
"noticeStatus"
)).
map
(
Long:
:
valueOf
);
noticeStatusOpt
.
ifPresent
(
status
->
{
...
...
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