Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 8a298d4b
authored
May 26, 2021
by
zhouhaibao
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
[+]试驾服务
1 parent
06b4c1c7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
4 deletions
src/main/java/cn/com/glsx/admin/modules/service/ApprovalService.java
src/main/java/cn/com/glsx/admin/modules/service/VehicleDocService.java
src/main/resources/mapper/ApprovalMapper.xml
src/main/resources/mapper/VehicleDocMapper.xml
src/main/java/cn/com/glsx/admin/modules/service/ApprovalService.java
View file @
8a298d4
...
...
@@ -14,14 +14,20 @@ import cn.com.glsx.admin.modules.model.param.ApprovalSearch;
import
cn.com.glsx.admin.modules.model.param.FenceApproSearch
;
import
cn.com.glsx.admin.modules.model.param.VehicleApproSearch
;
import
cn.com.glsx.auth.utils.ShieldContextHolder
;
import
cn.com.glsx.usercenter.api.dto.response.Organization
;
import
cn.com.glsx.usercenter.api.feign.OrganizationService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.core.web.R
;
import
com.google.gson.reflect.TypeToken
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.lang.reflect.Type
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -41,6 +47,9 @@ public class ApprovalService {
@Autowired
private
ApprovalHistoryService
approvalHistoryService
;
@Autowired
private
OrganizationService
organizationService
;
/**
* 保存审批信息
*
...
...
@@ -137,6 +146,17 @@ public class ApprovalService {
public
PageInfo
<
VehicleApproDto
>
searchVehiclelicApp
(
VehicleApproSearch
vehicleApproSearch
)
{
PageHelper
.
startPage
(
vehicleApproSearch
.
getPageNumber
(),
vehicleApproSearch
.
getPageSize
());
List
<
VehicleApproDto
>
vehicleDtoPageInfo
=
approvalMapper
.
searchVehiclelicApp
(
vehicleApproSearch
);
Type
type
=
new
TypeToken
<
List
<
Organization
>>()
{
}.
getType
();
vehicleDtoPageInfo
.
forEach
(
efd
->
{
R
<
List
<
Organization
>>
listR
=
organizationService
.
getSuperiorsBySubId
(
ShieldContextHolder
.
getDepartmentId
());
List
<
Organization
>
orgList
=
listR
.
getDataList
(
type
);
if
(
CollectionUtils
.
isNotEmpty
(
orgList
))
{
efd
.
setArea
(
orgList
.
get
(
1
).
getOrgName
());
efd
.
setProvince
(
orgList
.
get
(
2
).
getOrgName
());
efd
.
setCity
(
orgList
.
get
(
3
).
getOrgName
());
}
});
return
new
PageInfo
<>(
vehicleDtoPageInfo
);
}
...
...
@@ -149,6 +169,17 @@ public class ApprovalService {
public
PageInfo
<
FenceApproDto
>
searchFenceApp
(
FenceApproSearch
fenceApproSearch
)
{
PageHelper
.
startPage
(
fenceApproSearch
.
getPageNumber
(),
fenceApproSearch
.
getPageSize
());
List
<
FenceApproDto
>
fenceApproDtoList
=
approvalMapper
.
searchFenceApp
(
fenceApproSearch
);
Type
type
=
new
TypeToken
<
List
<
Organization
>>()
{
}.
getType
();
fenceApproDtoList
.
forEach
(
efd
->
{
R
<
List
<
Organization
>>
listR
=
organizationService
.
getSuperiorsBySubId
(
ShieldContextHolder
.
getDepartmentId
());
List
<
Organization
>
orgList
=
listR
.
getDataList
(
type
);
if
(
CollectionUtils
.
isNotEmpty
(
orgList
))
{
efd
.
setArea
(
orgList
.
get
(
1
).
getOrgName
());
efd
.
setProvince
(
orgList
.
get
(
2
).
getOrgName
());
efd
.
setCity
(
orgList
.
get
(
3
).
getOrgName
());
}
});
return
new
PageInfo
<>(
fenceApproDtoList
);
}
}
src/main/java/cn/com/glsx/admin/modules/service/VehicleDocService.java
View file @
8a298d4
...
...
@@ -8,8 +8,12 @@ import cn.com.glsx.admin.modules.model.VehicleApproDto;
import
cn.com.glsx.admin.modules.model.VehicleDocDto
;
import
cn.com.glsx.admin.modules.model.param.*
;
import
cn.com.glsx.auth.utils.ShieldContextHolder
;
import
cn.com.glsx.usercenter.api.dto.response.Organization
;
import
cn.com.glsx.usercenter.api.feign.OrganizationService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.glsx.plat.core.web.R
;
import
com.google.gson.reflect.TypeToken
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -17,6 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.lang.reflect.Type
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
...
...
@@ -38,6 +43,9 @@ public class VehicleDocService {
@Autowired
private
ApprovalService
approvalService
;
@Autowired
private
OrganizationService
organizationService
;
/**
* 批量新增或者修改车辆资料
*
...
...
@@ -98,6 +106,17 @@ public class VehicleDocService {
public
PageInfo
<
VehicleApproDto
>
search
(
VehicleApproSearch
vehicleDocSearch
)
{
PageHelper
.
startPage
(
vehicleDocSearch
.
getPageNumber
(),
vehicleDocSearch
.
getPageSize
());
List
<
VehicleApproDto
>
vehicleDtoPageInfo
=
vehicleDocMapper
.
search
(
vehicleDocSearch
);
Type
type
=
new
TypeToken
<
List
<
Organization
>>()
{
}.
getType
();
vehicleDtoPageInfo
.
forEach
(
efd
->
{
R
<
List
<
Organization
>>
listR
=
organizationService
.
getSuperiorsBySubId
(
ShieldContextHolder
.
getDepartmentId
());
List
<
Organization
>
orgList
=
listR
.
getDataList
(
type
);
if
(
org
.
apache
.
commons
.
collections4
.
CollectionUtils
.
isNotEmpty
(
orgList
))
{
efd
.
setArea
(
orgList
.
get
(
1
).
getOrgName
());
efd
.
setProvince
(
orgList
.
get
(
2
).
getOrgName
());
efd
.
setCity
(
orgList
.
get
(
3
).
getOrgName
());
}
});
return
new
PageInfo
<>(
vehicleDtoPageInfo
);
}
...
...
src/main/resources/mapper/ApprovalMapper.xml
View file @
8a298d4
...
...
@@ -86,6 +86,7 @@
LEFT JOIN t_vehicle_device t2 ON t1.id = t2.vehicle_id
LEFT JOIN t_electric_fence_sns t3 ON t2.sn = t3.sn
LEFT JOIN t_trial_drive_shop t4 ON t3.fence_id = t4.fence_id
left join t_electric_fence t7 on t4.fence_id=t7.id
LEFT JOIN t_dict_data t6 ON t5.biz_type = t6.dict_value
AND t6.dict_type = 'approval_status'
WHERE
...
...
@@ -101,7 +102,7 @@
<if
test=
"search.keywords !=null and search.keywords != ''"
>
and (t4.shop_name like concat('%',#{search.keywords},'%')
or t4.shop_code like concat('%',#{search.keywords},'%')
or t
4.shop_cod
e like concat('%',#{search.keywords},'%')
or t
7.fence_nam
e like concat('%',#{search.keywords},'%')
)
</if>
...
...
@@ -124,11 +125,11 @@
left join t_trial_drive_shop shop on tvd.id=shop.fence_id
left join t_dict_data td on app.status=td.dict_value and td.dict_type='approval_status'
where app.del_flag = 0 and app.status in (1,2,3)
AND APP.biz_type=1
AND APP.biz_type=1
and shop_name is not null
<if
test=
"search.keywords !=null and search.keywords != ''"
>
and (t4.shop_name like concat('%',#{search.keywords},'%')
or t4.shop_code like concat('%',#{search.keywords},'%')
or t
4.shop_cod
e like concat('%',#{search.keywords},'%')
or t
vd.fence_nam
e like concat('%',#{search.keywords},'%')
)
</if>
</select>
...
...
src/main/resources/mapper/VehicleDocMapper.xml
View file @
8a298d4
...
...
@@ -58,6 +58,7 @@
LEFT JOIN t_vehicle_device t2 ON t1.id = t2.vehicle_id
LEFT JOIN t_electric_fence_sns t3 ON t2.sn = t3.sn
LEFT JOIN t_trial_drive_shop t4 ON t3.fence_id = t4.fence_id
left join t_electric_fence t7 on t4.fence_id=t7.id
LEFT JOIN t_approval t5 ON t1.ID = t5.biz_id
LEFT JOIN t_dict_data t6 ON t5.biz_type = t6.dict_value
AND t6.dict_type = 'approval_status'
...
...
@@ -77,7 +78,7 @@
<if
test=
"search.keywords !=null and search.keywords != ''"
>
and (t4.shop_name like concat('%',#{search.keywords},'%')
or t4.shop_code like concat('%',#{search.keywords},'%')
or t
4.shop_cod
e like concat('%',#{search.keywords},'%')
or t
7.fence_nam
e like concat('%',#{search.keywords},'%')
)
</if>
GROUP BY
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment