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 38ad1eed
authored
May 20, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
开发试驾数据
1 parent
1c47c72b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
55 deletions
src/main/java/cn/com/glsx/admin/modules/controller/TrialDriveReportController.java
src/main/java/cn/com/glsx/admin/modules/model/param/TrialDriveReportSearch.java
src/main/java/cn/com/glsx/admin/modules/service/TrialDriveReportService.java
src/main/resources/mapper/TrialDriveReportMapper.xml
src/main/java/cn/com/glsx/admin/modules/controller/TrialDriveReportController.java
View file @
38ad1ee
...
...
@@ -62,7 +62,7 @@ public class TrialDriveReportController {
data
.
put
(
"totalElements"
,
total
);
return
R
.
ok
().
data
(
data
);
}
return
R
.
error
(
);
return
R
.
ok
().
data
(
"没有查询到任何数据"
);
}
@GetMapping
(
value
=
"/export"
)
...
...
src/main/java/cn/com/glsx/admin/modules/model/param/TrialDriveReportSearch.java
View file @
38ad1ee
...
...
@@ -5,15 +5,16 @@ import lombok.Data;
import
lombok.experimental.Accessors
;
import
java.util.List
;
import
java.util.Set
;
@Data
@Accessors
(
chain
=
true
)
public
class
TrialDriveReportSearch
extends
Page
{
/**
*
勾选的i
d
*
组织下用户的I
d
*/
private
List
<
String
>
i
dList
;
private
Set
<
Long
>
userI
dList
;
/**
* 限制展示的车辆
...
...
@@ -21,11 +22,6 @@ public class TrialDriveReportSearch extends Page {
private
List
<
String
>
splitList
;
/**
* 广本分组ID
*/
private
Integer
guangBenClassId
;
/**
* sn 号
*/
private
String
sn
;
...
...
@@ -49,5 +45,4 @@ public class TrialDriveReportSearch extends Page {
* 特约店名称
*/
private
String
shopName
;
}
src/main/java/cn/com/glsx/admin/modules/service/TrialDriveReportService.java
View file @
38ad1ee
...
...
@@ -11,7 +11,6 @@ import com.glsx.plat.context.utils.PropertiesUtils;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
...
...
@@ -30,22 +29,16 @@ public class TrialDriveReportService {
public
List
<
TrialDriveReportExport
>
search
(
TrialDriveReportSearch
search
)
{
String
needToShowVehicleTypeList
=
PropertiesUtils
.
getProperty
(
"glsx.effectivetestdrive.needtoshow"
);
Integer
guangBenClassId
=
Integer
.
parseInt
(
PropertiesUtils
.
getProperty
(
"glsx.effectivetestdrive.guangBenClassId"
));
String
[]
splitArr
=
needToShowVehicleTypeList
.
split
(
","
);
List
<
String
>
splitList
=
Arrays
.
asList
(
splitArr
);
search
.
setSplitList
(
splitList
);
search
.
setGuangBenClassId
(
guangBenClassId
);
Integer
rolePermissionType
=
ShieldContextHolder
.
getRolePermissionType
();
//非管理员 并且 数据权限不是全部 的需要加上用户权限涉及的全部用户id
if
(!
ShieldContextHolder
.
isSuperAdmin
()
&&
!
UserConstants
.
RolePermitCastType
.
all
.
getCode
().
equals
(
rolePermissionType
))
{
boolean
superAdminFlag
=
ShieldContextHolder
.
isSuperAdmin
();
if
(!
superAdminFlag
&&
!
UserConstants
.
RolePermitCastType
.
all
.
getCode
().
equals
(
rolePermissionType
))
{
Set
<
Long
>
userIdList
=
ShieldContextHolder
.
getVisibleCreatorIds
();
if
(
org
.
apache
.
commons
.
collections4
.
CollectionUtils
.
isNotEmpty
(
userIdList
))
{
//ShieldContextHolder.getVisibleCreatorIds()
}
else
{
}
search
.
setUserIdList
(
userIdList
);
}
return
trialDriveReportMapper
.
getTestDrivePageList
(
search
);
...
...
src/main/resources/mapper/TrialDriveReportMapper.xml
View file @
38ad1ee
...
...
@@ -29,32 +29,35 @@
parameterType=
"cn.com.glsx.admin.modules.model.param.TrialDriveReportSearch"
resultMap=
"PageBaseMap"
>
SELECT
tu.
username
shopCode,
tu.user
Remark
shopName,
tu.
account
shopCode,
tu.user
name
shopName,
tefs.sn,
tefs.
standno
,
tv
ts.vehicle_type
_name vehicleTypeName
tefs.
vin
,
tv
.model
_name vehicleTypeName
from t_electric_fence_sns tefs
inner join t_electric_fence tef on tef.id = tefs.fenceId
left join t_user tu on tu.d_LoginUserId = tef.loginUserId
left join t_vehicle tv on tv.standno = tefs.standno
left join t_vehicle_type_standno tvts on tvts.standno = tv.standno
left join t_class tc on tv.classId = tc.classid
where tefs.fenceId = tef.id
and tef.bizFenceType = 1
inner join t_electric_fence tef on tef.id = tefs.fence_id
left join t_user tu on tu.id = tef.created_by
left join t_vehicle tv on tv.vin = tefs.vin
where tefs.fence_id = tef.id
and tef.biz_fence_type = 1
<if
test=
"shopCode!=null and shopCode!=''"
>
and tu.
username
like '%${shopCode}%'
and tu.
account
like '%${shopCode}%'
</if>
<if
test=
"shopName!=null and shopName!=''"
>
and tu.user
Remark
like '%${shopName}%'
and tu.user
name
like '%${shopName}%'
</if>
<if
test=
"guangBenClassId != null and guangBenClassId != '' "
>
and tc.vehicleGroupId = #{guangBenClassId,jdbcType=INTEGER}
<if
test=
"userIdList != null"
>
and tc.id IN
<foreach
collection=
"userIdList"
item=
"userId"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{userId}
</foreach>
</if>
<if
test=
"splitList != null"
>
and tv.model_name IN
<foreach
collection=
"splitList"
item=
"vehicleTypeName"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{vehicleTypeName}
</foreach>
</if>
and tvts.vehicle_type_name IN
<foreach
collection=
"splitList"
item=
"vehicleTypeName"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{vehicleTypeName}
</foreach>
order by tef.id
</select>
...
...
@@ -63,18 +66,16 @@
resultMap=
"BaseResultMap"
>
SELECT tall.shopCode, tall.shopName, tall.vehicleTypeName, tall.sn, tall.standno, left(tall.statDate,7)
statDate, tall.cnt, day(tall.statDate) dayCount , sum(cnt) cnttotal FROM
(select tu.
username shopCode, tu.userRemark shopName, tvts.vehicle_type
_name vehicleTypeName,
tefdd.sn,
t
v.standno, DATE_FORMAT(tefdd.journey_time,'%Y-%m-%d') statDate, sum(case when tefdd.percent >= 80 t
hen 1 else 0
(select tu.
account shopCode, tu.username shopName, tv.model
_name vehicleTypeName,
tefdd.sn,
tv.standno, DATE_FORMAT(tefdd.journey_time,'%Y-%m-%d') statDate, sum(case when tefdd.percent >= 80
then 1 else 0
end) cnt
from t_electric_fence_drive defdd
left join t_electric_fence def on tef.id = tefdd.fence_id
left join t_track_info dti on tti.sn = tefdd.sn
left join t_vehicle dv on tv.vehicleId = tti.vehicleId
left join t_vehicle_type_standno tvts on tvts.standno = tv.standno
left join t_user du on tu.d_LoginUserId = tef.loginUserId
from t_electric_fence_drive tefdd
left join t_electric_fence tef on tef.id = tefdd.fence_id
left join t_vehicle_device tvv on tvv.sn = tefdd.sn
left join t_vehicle tv on tv.id = tvv.vehicle_id
left join t_user tu on tu.id = tef.created_by
<where>
<choose>
<when
test=
"year != null and year != '' and month != null and month != '' "
>
left(tefdd.journey_time,7) = CONCAT(#{year,jdbcType=VARCHAR},'-',#{month,jdbcType=VARCHAR})
...
...
@@ -90,20 +91,22 @@
</choose>
<if
test=
"shopCode !=null and shopCode != ''"
>
and tu.
username
like '%${shopCode}%'
and tu.
account
like '%${shopCode}%'
</if>
<if
test=
"shopName !=null and shopName != ''"
>
and tu.user
Remark
like '%${shopName}%'
and tu.user
name
like '%${shopName}%'
</if>
<if
test=
"sn !=null and sn != ''"
>
and tefdd.sn = #{sn,jdbcType=VARCHAR}
</if>
and tvts.vehicle_type_name IN
<foreach
collection=
"splitList"
item=
"vehicleTypeName"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{vehicleTypeName}
</foreach>
<if
test=
"splitList != null"
>
and tv.model_name IN
<foreach
collection=
"splitList"
item=
"vehicleTypeName"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{vehicleTypeName}
</foreach>
</if>
</where>
GROUP BY tefdd.sn,tefdd.fence_id,statDate order by tu.
username
) tall GROUP BY tall.shopCode, tall.sn,
GROUP BY tefdd.sn,tefdd.fence_id,statDate order by tu.
account
) tall GROUP BY tall.shopCode, tall.sn,
tall.statDate ORDER BY tall.shopCode
</select>
...
...
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