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
7287bb4f
Commit
7287bb4f
authored
Jun 05, 2025
by
刘林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(jg):验收添加排序功能
parent
b83d0441
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
129 additions
and
17 deletions
+129
-17
RescueStationMapper.java
.../boot/module/elevator/api/mapper/RescueStationMapper.java
+2
-1
IRescueStationService.java
...ot/module/elevator/api/service/IRescueStationService.java
+1
-1
SortVo.java
.../com/yeejoin/amos/boot/module/elevator/api/vo/SortVo.java
+14
-0
RescueStationMapper.xml
...333-api/src/main/resources/mapper/RescueStationMapper.xml
+5
-2
RescueStationController.java
...dule/elevator/biz/controller/RescueStationController.java
+3
-2
RescueStationServiceImpl.java
...e/elevator/biz/service/impl/RescueStationServiceImpl.java
+45
-3
JyjcInspectionResultMapper.java
...ot/module/jyjc/api/mapper/JyjcInspectionResultMapper.java
+2
-1
JyjcInspectionResultMapper.xml
.../src/main/resources/mapper/JyjcInspectionResultMapper.xml
+5
-1
JyjcInspectionResultController.java
...e/jyjc/biz/controller/JyjcInspectionResultController.java
+4
-4
CommonServiceImpl.java
.../boot/module/jyjc/biz/service/impl/CommonServiceImpl.java
+44
-0
JyjcInspectionResultServiceImpl.java
...yjc/biz/service/impl/JyjcInspectionResultServiceImpl.java
+4
-2
No files found.
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/java/com/yeejoin/amos/boot/module/elevator/api/mapper/RescueStationMapper.java
View file @
7287bb4f
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.RescueStationDto
;
import
com.yeejoin.amos.boot.module.elevator.api.dto.RescueStationDto
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.RescueStation
;
import
com.yeejoin.amos.boot.module.elevator.api.entity.RescueStation
;
import
com.yeejoin.amos.boot.module.elevator.api.vo.SortVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
...
@@ -27,7 +28,7 @@ public interface RescueStationMapper extends BaseMapper<RescueStation> {
...
@@ -27,7 +28,7 @@ public interface RescueStationMapper extends BaseMapper<RescueStation> {
List
<
RescueStationDto
>
selectExportData
(
@Param
(
"ids"
)
List
<
String
>
ids
);
List
<
RescueStationDto
>
selectExportData
(
@Param
(
"ids"
)
List
<
String
>
ids
);
IPage
<
RescueStation
>
getRescueStationList
(
@Param
(
"page"
)
IPage
<
RescueStation
>
page
,
@Param
(
"dto"
)
RescueStationDto
dto
);
IPage
<
RescueStation
>
getRescueStationList
(
@Param
(
"page"
)
IPage
<
RescueStation
>
page
,
@Param
(
"dto"
)
RescueStationDto
dto
,
@Param
(
"sort"
)
SortVo
sortMap
);
Map
<
String
,
Object
>
getDetailById
(
@Param
(
"id"
)
Long
id
);
Map
<
String
,
Object
>
getDetailById
(
@Param
(
"id"
)
Long
id
);
}
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/java/com/yeejoin/amos/boot/module/elevator/api/service/IRescueStationService.java
View file @
7287bb4f
...
@@ -31,7 +31,7 @@ public interface IRescueStationService extends IService<RescueStation> {
...
@@ -31,7 +31,7 @@ public interface IRescueStationService extends IService<RescueStation> {
List
<
RescueStationDto
>
selectExportData
(
String
exportId
);
List
<
RescueStationDto
>
selectExportData
(
String
exportId
);
IPage
<
RescueStation
>
getRescueStationList
(
IPage
<
RescueStation
>
page
,
RescueStationDto
rescueStationDto
);
IPage
<
RescueStation
>
getRescueStationList
(
IPage
<
RescueStation
>
page
,
RescueStationDto
rescueStationDto
,
String
sort
);
ResponseModel
<
Object
>
expertDataImport
(
MultipartFile
file
,
AgencyUserModel
userModel
);
ResponseModel
<
Object
>
expertDataImport
(
MultipartFile
file
,
AgencyUserModel
userModel
);
}
}
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-api/src/main/java/com/yeejoin/amos/boot/module/elevator/api/vo/SortVo.java
0 → 100644
View file @
7287bb4f
package
com
.
yeejoin
.
amos
.
boot
.
module
.
elevator
.
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-96333/amos-boot-module-96333-api/src/main/resources/mapper/RescueStationMapper.xml
View file @
7287bb4f
...
@@ -66,7 +66,6 @@
...
@@ -66,7 +66,6 @@
tcb_rescue_station trs
tcb_rescue_station trs
LEFT JOIN tz_base_enterprise_info ibei ON ibei.sequence_nbr = trs.affiliated_unit_id
LEFT JOIN tz_base_enterprise_info ibei ON ibei.sequence_nbr = trs.affiliated_unit_id
WHERE
WHERE
trs.is_delete = 'false'
trs.is_delete = 'false'
<if
test=
"dto.orgCode != '50*18667'"
>
<if
test=
"dto.orgCode != '50*18667'"
>
and ibei.supervise_org_code like concat(#{dto.orgCode},'%')
and ibei.supervise_org_code like concat(#{dto.orgCode},'%')
...
@@ -92,7 +91,11 @@
...
@@ -92,7 +91,11 @@
<if
test=
"dto.rescueLeaderPhone != null and dto.rescueLeaderPhone != ''"
>
<if
test=
"dto.rescueLeaderPhone != null and dto.rescueLeaderPhone != ''"
>
and trs.rescue_leader_phone = #{dto.rescueLeaderPhone}
and trs.rescue_leader_phone = #{dto.rescueLeaderPhone}
</if>
</if>
order by rec_date desc
order by
<if
test=
"sort != null"
>
trs.${sort.field} ${sort.sortType},
</if>
rec_date desc
</select>
</select>
<select
id=
"getDetailById"
resultType=
"java.util.Map"
>
<select
id=
"getDetailById"
resultType=
"java.util.Map"
>
select sequence_nbr as sequenceNbr,
select sequence_nbr as sequenceNbr,
...
...
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/controller/RescueStationController.java
View file @
7287bb4f
...
@@ -247,7 +247,8 @@ public class RescueStationController extends BaseController {
...
@@ -247,7 +247,8 @@ public class RescueStationController extends BaseController {
@RequestMapping
(
value
=
"/query_rescue_station_list"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/query_rescue_station_list"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询救援站信息"
,
notes
=
"分页查询救援站信息"
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"分页查询救援站信息"
,
notes
=
"分页查询救援站信息"
)
public
ResponseModel
<
IPage
<
RescueStationDto
>>
queryRescueStationList
(
String
pageNum
,
String
pageSize
,
public
ResponseModel
<
IPage
<
RescueStationDto
>>
queryRescueStationList
(
String
pageNum
,
String
pageSize
,
RescueStationDto
rescueStationDto
)
{
@RequestParam
(
value
=
"sort"
,
required
=
false
)
String
sort
,
RescueStationDto
rescueStationDto
)
{
RescueStation
rescueStation
=
BeanDtoVoUtils
.
convert
(
rescueStationDto
,
RescueStation
.
class
);
RescueStation
rescueStation
=
BeanDtoVoUtils
.
convert
(
rescueStationDto
,
RescueStation
.
class
);
List
<
CompanyModel
>
companyModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
companyClient
.
queryListByChild
(
RequestContext
.
getExeUserId
()));
List
<
CompanyModel
>
companyModels
=
FeignUtil
.
remoteCall
(()
->
Privilege
.
companyClient
.
queryListByChild
(
RequestContext
.
getExeUserId
()));
if
(
companyModels
.
isEmpty
())
{
if
(
companyModels
.
isEmpty
())
{
...
@@ -262,7 +263,7 @@ public class RescueStationController extends BaseController {
...
@@ -262,7 +263,7 @@ public class RescueStationController extends BaseController {
page
.
setSize
(
Integer
.
parseInt
(
pageSize
));
page
.
setSize
(
Integer
.
parseInt
(
pageSize
));
page
.
setCurrent
(
Integer
.
parseInt
(
pageNum
));
page
.
setCurrent
(
Integer
.
parseInt
(
pageNum
));
}
}
page
=
iRescueStationService
.
getRescueStationList
(
page
,
rescueStationDto
);
page
=
iRescueStationService
.
getRescueStationList
(
page
,
rescueStationDto
,
sort
);
IPage
<
RescueStationDto
>
rescueStationDtoIPage
=
ObjectUtils
.
isEmpty
(
page
)?
new
Page
<>():
BeanDtoVoUtils
.
iPageVoStream
(
page
,
RescueStationDto
.
class
);
IPage
<
RescueStationDto
>
rescueStationDtoIPage
=
ObjectUtils
.
isEmpty
(
page
)?
new
Page
<>():
BeanDtoVoUtils
.
iPageVoStream
(
page
,
RescueStationDto
.
class
);
return
ResponseHelper
.
buildResponse
(
rescueStationDtoIPage
);
return
ResponseHelper
.
buildResponse
(
rescueStationDtoIPage
);
}
}
...
...
amos-boot-system-tzs/amos-boot-module-96333/amos-boot-module-96333-biz/src/main/java/com/yeejoin/amos/boot/module/elevator/biz/service/impl/RescueStationServiceImpl.java
View file @
7287bb4f
...
@@ -15,6 +15,7 @@ import com.yeejoin.amos.boot.module.elevator.api.entity.RescueStation;
...
@@ -15,6 +15,7 @@ import com.yeejoin.amos.boot.module.elevator.api.entity.RescueStation;
import
com.yeejoin.amos.boot.module.elevator.api.mapper.RescueStationMapper
;
import
com.yeejoin.amos.boot.module.elevator.api.mapper.RescueStationMapper
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IRescueStationService
;
import
com.yeejoin.amos.boot.module.elevator.api.service.IRescueStationService
;
import
com.yeejoin.amos.boot.module.elevator.api.vo.RescueStationImportVo
;
import
com.yeejoin.amos.boot.module.elevator.api.vo.RescueStationImportVo
;
import
com.yeejoin.amos.boot.module.elevator.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.elevator.biz.utils.BeanDtoVoUtils
;
import
com.yeejoin.amos.boot.module.elevator.biz.utils.BeanDtoVoUtils
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
import
com.yeejoin.amos.feign.systemctl.Systemctl
;
...
@@ -50,7 +51,6 @@ public class RescueStationServiceImpl extends BaseService<RescueStationDto, Resc
...
@@ -50,7 +51,6 @@ public class RescueStationServiceImpl extends BaseService<RescueStationDto, Resc
IRescueStationService
iRescueStationService
;
IRescueStationService
iRescueStationService
;
@Autowired
@Autowired
TzBaseEnterpriseInfoServiceImpl
baseEnterpriseInfoService
;
TzBaseEnterpriseInfoServiceImpl
baseEnterpriseInfoService
;
private
final
String
excelErrorStr
=
"Excel 第[%s]行:%s"
;
private
final
String
excelErrorStr
=
"Excel 第[%s]行:%s"
;
@Override
@Override
...
@@ -69,11 +69,53 @@ public class RescueStationServiceImpl extends BaseService<RescueStationDto, Resc
...
@@ -69,11 +69,53 @@ public class RescueStationServiceImpl extends BaseService<RescueStationDto, Resc
}
}
@Override
@Override
public
IPage
<
RescueStation
>
getRescueStationList
(
IPage
<
RescueStation
>
page
,
RescueStationDto
dto
)
{
public
IPage
<
RescueStation
>
getRescueStationList
(
IPage
<
RescueStation
>
page
,
RescueStationDto
dto
,
String
sort
)
{
return
rescueStationMapper
.
getRescueStationList
(
page
,
dto
);
SortVo
sortMap
=
this
.
sortFieldConversion
(
sort
);
return
rescueStationMapper
.
getRescueStationList
(
page
,
dto
,
sortMap
);
}
}
/**
* 排序 :页面列表排序功能支持,将 "字段,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
);
}
/**
* 驼峰转下划线
*
* @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
();
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/java/com/yeejoin/amos/boot/module/jyjc/api/mapper/JyjcInspectionResultMapper.java
View file @
7287bb4f
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jyjc.api.mapper;
...
@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.jyjc.api.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.DPFilterParamDto
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult
;
import
com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel
;
import
com.yeejoin.amos.boot.module.jyjc.api.model.JyjcInspectionResultModel
;
...
@@ -22,7 +23,7 @@ public interface JyjcInspectionResultMapper extends BaseMapper<JyjcInspectionRes
...
@@ -22,7 +23,7 @@ public interface JyjcInspectionResultMapper extends BaseMapper<JyjcInspectionRes
Page
<
JyjcInspectionResultModel
>
selectJyjcInspectionResultpPage
(
@Param
(
"page"
)
Page
<
JyjcInspectionResultModel
>
page
,
@Param
(
"jyjcInspectionResultModel"
)
JyjcInspectionResultModel
jyjcInspectionResultModel
);
Page
<
JyjcInspectionResultModel
>
selectJyjcInspectionResultpPage
(
@Param
(
"page"
)
Page
<
JyjcInspectionResultModel
>
page
,
@Param
(
"jyjcInspectionResultModel"
)
JyjcInspectionResultModel
jyjcInspectionResultModel
);
Page
<
JyjcInspectionResultModel
>
selectForPage
(
@Param
(
"page"
)
Page
<
JyjcInspectionResultModel
>
page
,
@Param
(
"jyjcInspectionResultModel"
)
JyjcInspectionResultModel
jyjcInspectionResultModel
,
@Param
(
"identity"
)
String
identity
);
Page
<
JyjcInspectionResultModel
>
selectForPage
(
@Param
(
"page"
)
Page
<
JyjcInspectionResultModel
>
page
,
@Param
(
"jyjcInspectionResultModel"
)
JyjcInspectionResultModel
jyjcInspectionResultModel
,
@Param
(
"identity"
)
String
identity
,
@Param
(
"sort"
)
SortVo
sortMap
);
List
<
InspectionTimelinesDto
>
queryInspectionTimelinessTopXX
(
@Param
(
"top"
)
String
top
,
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"dto"
)
DPFilterParamDto
dpFilterParamDto
);
List
<
InspectionTimelinesDto
>
queryInspectionTimelinessTopXX
(
@Param
(
"top"
)
String
top
,
@Param
(
"orgCode"
)
String
orgCode
,
@Param
(
"dto"
)
DPFilterParamDto
dpFilterParamDto
);
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-api/src/main/resources/mapper/JyjcInspectionResultMapper.xml
View file @
7287bb4f
...
@@ -294,7 +294,11 @@
...
@@ -294,7 +294,11 @@
</choose>
</choose>
</where>
</where>
)
)
ORDER BY sequence_nbr DESC
ORDER BY
<if
test=
"sort != null"
>
res.${sort.field} ${sort.sortType},
</if>
sequence_nbr DESC
</select>
</select>
<select
id=
"queryInspectionTimelinessTopXX"
resultType=
"com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto"
>
<select
id=
"queryInspectionTimelinessTopXX"
resultType=
"com.yeejoin.amos.boot.module.jyjc.api.dto.InspectionTimelinesDto"
>
select
select
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/controller/JyjcInspectionResultController.java
View file @
7287bb4f
...
@@ -144,13 +144,13 @@ public class JyjcInspectionResultController extends BaseController {
...
@@ -144,13 +144,13 @@ public class JyjcInspectionResultController extends BaseController {
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
)
@PostMapping
(
value
=
"/page"
)
@PostMapping
(
value
=
"/page"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"列表页面(检验检测单位、使用单位共用)"
,
notes
=
"列表页面(检验检测单位、使用单位共用)"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"列表页面(检验检测单位、使用单位共用)"
,
notes
=
"列表页面(检验检测单位、使用单位共用)"
)
public
ResponseModel
<
Page
<
JyjcInspectionResultModel
>>
pageList
(
public
ResponseModel
<
Page
<
JyjcInspectionResultModel
>>
pageList
(
@RequestParam
int
current
,
@RequestParam
int
size
,
@RequestParam
int
current
,
@RequestParam
int
size
,
@RequestParam
(
value
=
"sort"
,
required
=
false
)
String
sort
,
@RequestBody
JyjcInspectionResultModel
model
)
{
@RequestBody
JyjcInspectionResultModel
model
)
{
Page
<
JyjcInspectionResultModel
>
page
=
new
Page
<>();
Page
<
JyjcInspectionResultModel
>
page
=
new
Page
<>();
page
.
setCurrent
(
current
);
page
.
setCurrent
(
current
);
page
.
setSize
(
size
);
page
.
setSize
(
size
);
return
ResponseHelper
.
buildResponse
(
jyjcInspectionResultServiceImpl
.
queryForPageList
(
page
,
model
));
return
ResponseHelper
.
buildResponse
(
jyjcInspectionResultServiceImpl
.
queryForPageList
(
page
,
model
,
sort
));
}
}
...
...
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/CommonServiceImpl.java
View file @
7287bb4f
...
@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
...
@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.entity.BaseEntity
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisKey
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.biz.common.utils.RedisUtils
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jyjc.api.enums.OpenBizTypeEnum
;
import
com.yeejoin.amos.boot.module.jyjc.api.enums.OpenBizTypeEnum
;
import
com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcBaseMapper
;
import
com.yeejoin.amos.boot.module.jyjc.api.mapper.JyjcBaseMapper
;
import
com.yeejoin.amos.boot.module.jyjc.api.model.InstanceRuntimeData
;
import
com.yeejoin.amos.boot.module.jyjc.api.model.InstanceRuntimeData
;
...
@@ -29,6 +30,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
...
@@ -29,6 +30,7 @@ import org.typroject.tyboot.core.foundation.context.RequestContext;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
/**
/**
* @author Administrator
* @author Administrator
...
@@ -208,4 +210,46 @@ public class CommonServiceImpl {
...
@@ -208,4 +210,46 @@ public class CommonServiceImpl {
return
result
.
getResult
();
return
result
.
getResult
();
}
}
/**
* 排序 :页面列表排序功能支持,将 "字段,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
);
}
/**
* 驼峰转下划线
*
* @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
();
}
}
}
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/JyjcInspectionResultServiceImpl.java
View file @
7287bb4f
...
@@ -21,6 +21,7 @@ import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
...
@@ -21,6 +21,7 @@ import com.yeejoin.amos.boot.module.common.api.dao.ESEquipmentCategory;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.common.api.dto.ESEquipmentCategoryDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.DynamicColumnDto
;
import
com.yeejoin.amos.boot.module.jg.api.dto.DynamicColumnDto
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper
;
import
com.yeejoin.amos.boot.module.jg.api.mapper.CommonMapper
;
import
com.yeejoin.amos.boot.module.jg.api.vo.SortVo
;
import
com.yeejoin.amos.boot.module.jyjc.api.common.StringUtil
;
import
com.yeejoin.amos.boot.module.jyjc.api.common.StringUtil
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionApplication
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult
;
import
com.yeejoin.amos.boot.module.jyjc.api.entity.JyjcInspectionResult
;
...
@@ -168,16 +169,17 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
...
@@ -168,16 +169,17 @@ public class JyjcInspectionResultServiceImpl extends BaseService<JyjcInspectionR
return
resultPage
;
return
resultPage
;
}
}
public
Page
<
JyjcInspectionResultModel
>
queryForPageList
(
Page
<
JyjcInspectionResultModel
>
page
,
JyjcInspectionResultModel
model
)
{
public
Page
<
JyjcInspectionResultModel
>
queryForPageList
(
Page
<
JyjcInspectionResultModel
>
page
,
JyjcInspectionResultModel
model
,
String
sort
)
{
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
ReginParams
reginParams
=
JSON
.
parseObject
(
redisUtils
.
get
(
RedisKey
.
buildReginKey
(
RequestContext
.
getExeUserId
(),
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
RequestContext
.
getToken
())).
toString
(),
ReginParams
.
class
);
SortVo
sortMap
=
commonService
.
sortFieldConversion
(
sort
);
if
(
ObjectUtils
.
isEmpty
(
model
))
{
if
(
ObjectUtils
.
isEmpty
(
model
))
{
model
=
new
JyjcInspectionResultModel
();
model
=
new
JyjcInspectionResultModel
();
}
}
// 判断当前登录人身份(报检机构、接收机构、即时报检又是接收机构、都不是(不存在此情况))
// 判断当前登录人身份(报检机构、接收机构、即时报检又是接收机构、都不是(不存在此情况))
String
identity
=
this
.
getCompanyIdentityByType
(
reginParams
.
getCompany
().
getCompanyType
());
String
identity
=
this
.
getCompanyIdentityByType
(
reginParams
.
getCompany
().
getCompanyType
());
model
.
setCompanyCode
(
reginParams
.
getCompany
().
getCompanyCode
());
model
.
setCompanyCode
(
reginParams
.
getCompany
().
getCompanyCode
());
Page
<
JyjcInspectionResultModel
>
resultPage
=
resultMapper
.
selectForPage
(
page
,
model
,
identity
);
Page
<
JyjcInspectionResultModel
>
resultPage
=
resultMapper
.
selectForPage
(
page
,
model
,
identity
,
sortMap
);
resultPage
.
getRecords
().
forEach
(
v
->
{
resultPage
.
getRecords
().
forEach
(
v
->
{
if
(
ResultStatusEnum
.
NO_RESULT
.
getCode
().
equals
(
v
.
getResultStatus
()))
{
if
(
ResultStatusEnum
.
NO_RESULT
.
getCode
().
equals
(
v
.
getResultStatus
()))
{
v
.
setResultStatusName
(
ResultStatusEnum
.
NO_RESULT
.
getName
());
v
.
setResultStatusName
(
ResultStatusEnum
.
NO_RESULT
.
getName
());
...
...
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