Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
ccb42772
Commit
ccb42772
authored
Aug 30, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'jrz_dev' into base-modify
parents
22693ca9
0a18d50b
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
75 additions
and
32 deletions
+75
-32
RandomListDto.java
...c/main/java/com/xxfc/platform/uccn/dto/RandomListDto.java
+10
-0
ArticleBiz.java
.../src/main/java/com/xxfc/platform/uccn/biz/ArticleBiz.java
+11
-8
RandomListBiz.java
...c/main/java/com/xxfc/platform/uccn/biz/RandomListBiz.java
+2
-2
ArticleMapper.java
...ain/java/com/xxfc/platform/uccn/mapper/ArticleMapper.java
+4
-2
ArticleController.java
...n/java/com/xxfc/platform/uccn/rest/ArticleController.java
+9
-4
RandomListController.java
...ava/com/xxfc/platform/uccn/rest/RandomListController.java
+1
-1
VehicleModelController.java
...a/com/xxfc/platform/uccn/rest/VehicleModelController.java
+22
-15
ArticleMapper.xml
...x-uccn-server/src/main/resources/mapper/ArticleMapper.xml
+6
-0
VModelDetailVO.java
...n/java/com/xxfc/platform/vehicle/pojo/VModelDetailVO.java
+5
-0
VehicleModelVo.java
...n/java/com/xxfc/platform/vehicle/pojo/VehicleModelVo.java
+3
-0
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+2
-0
No files found.
xx-uccn/xx-uccn-api/src/main/java/com/xxfc/platform/uccn/dto/RandomListDto.java
View file @
ccb42772
...
...
@@ -20,4 +20,14 @@ public class RandomListDto {
*/
private
Integer
location
;
/**
* 新闻类型
*/
private
Integer
newsType
;
/**
* 新闻id
*/
private
Integer
newsId
;
}
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/ArticleBiz.java
View file @
ccb42772
...
...
@@ -44,7 +44,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
*/
public
PageInfo
getArticleList
(
Integer
page
,
Integer
limit
,
Integer
type
)
{
PageHelper
.
startPage
(
page
,
limit
);
List
articleList
=
mapper
.
getArticleList
(
type
,
null
);
List
articleList
=
mapper
.
getArticleList
(
type
,
null
,
null
);
return
PageInfo
.
of
(
articleList
);
}
...
...
@@ -71,21 +71,24 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
/**
* 随机获取三条连续的文章
*
*
*
* @param type
* @param id
* @return
*/
public
List
getThree
(
Integer
type
)
{
List
<
Article
>
articleList
=
mapper
.
getArticleList
(
type
,
null
);
public
List
getThree
(
Integer
type
,
Integer
number
,
Integer
id
)
{
number
=
number
==
null
?
RANDOM_NUMBER
:
number
;
List
<
Article
>
articleList
=
mapper
.
getArticleList
(
type
,
null
,
id
);
if
(!
Objects
.
isNull
(
articleList
))
{
int
size
=
articleList
.
size
();
if
(
RANDOM_NUMBER
>=
size
)
{
if
(
number
>=
size
)
{
return
articleList
;
}
else
{
Random
random
=
new
Random
();
int
r
=
random
.
nextInt
(
size
-
RANDOM_NUMBER
+
1
);
int
r
=
random
.
nextInt
(
size
-
number
+
1
);
List
<
Article
>
result
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
RANDOM_NUMBER
.
intValue
();
i
++)
{
for
(
int
i
=
0
;
i
<
number
.
intValue
();
i
++)
{
int
index
=
i
+
r
;
result
.
add
(
articleList
.
get
(
index
));
}
...
...
@@ -103,7 +106,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
* @return
*/
public
List
getHomePageArticle
(
Integer
type
)
{
List
<
Article
>
articleList
=
mapper
.
getArticleList
(
type
,
HOME_PAGE_NUMBER
);
List
<
Article
>
articleList
=
mapper
.
getArticleList
(
type
,
HOME_PAGE_NUMBER
,
null
);
// if (Objects.isNull(articleList)) {
// return new ArrayList();
// } else {
...
...
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/RandomListBiz.java
View file @
ccb42772
...
...
@@ -37,7 +37,7 @@ public class RandomListBiz {
* @param number 随机数,默认是2
* @return
*/
public
ObjectRestResponse
getRandomList
(
Integer
type
,
Integer
number
,
Integer
location
)
{
public
ObjectRestResponse
getRandomList
(
Integer
type
,
Integer
number
,
Integer
location
,
Integer
id
,
Integer
newsType
)
{
if
(
type
!=
null
)
{
number
=
number
==
null
?
2
:
number
;
switch
(
TypeEnum
.
getByValue
(
type
))
{
...
...
@@ -50,7 +50,7 @@ public class RandomListBiz {
case
ACTIVITY:
return
ObjectRestResponse
.
succ
(
summitActivityBiz
.
getHostWithSummitActivity
(
number
,
location
));
case
NEWS:
return
ObjectRestResponse
.
succ
(
articleBiz
.
getThree
(
type
,
number
,
id
));
}
}
return
ObjectRestResponse
.
succ
();
...
...
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/mapper/ArticleMapper.java
View file @
ccb42772
...
...
@@ -11,9 +11,11 @@ import java.util.List;
*/
public
interface
ArticleMapper
extends
Mapper
<
Article
>
{
/**
*
根据网站类型查询文章
*
获取获取文章信息
* @param type
* @param limit 已使用分业插件传null值即可,不要重复传
* @param id 当前文章id ,无就传null
* @return
*/
List
<
Article
>
getArticleList
(
@Param
(
"type"
)
Integer
type
,
@Param
(
"limit"
)
Integer
limit
);
List
<
Article
>
getArticleList
(
@Param
(
"type"
)
Integer
type
,
@Param
(
"limit"
)
Integer
limit
,
@Param
(
"id"
)
Integer
id
);
}
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/ArticleController.java
View file @
ccb42772
...
...
@@ -36,11 +36,16 @@ public class ArticleController extends BaseController<ArticleBiz, Article> {
return
ObjectRestResponse
.
succ
(
baseBiz
.
getOne
(
id
,
urlType
));
}
@GetMapping
(
"/app/unauth/three/{type}"
)
/**
*
* @param type
* @param id 当前文章id
* @return
*/
@GetMapping
(
"/app/unauth/three/{type}/{id}"
)
@ApiOperation
(
value
=
"随机获取三条数据"
)
public
ObjectRestResponse
randomAccessToThreeData
(
@PathVariable
Integer
type
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
getThree
(
type
));
public
ObjectRestResponse
randomAccessToThreeData
(
@PathVariable
Integer
type
,
@PathVariable
Integer
id
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
getThree
(
type
,
id
));
}
@GetMapping
(
"/app/unauth/homePage/{type}"
)
...
...
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/RandomListController.java
View file @
ccb42772
...
...
@@ -19,7 +19,7 @@ public class RandomListController {
if
(
randomListDto
==
null
)
{
return
ObjectRestResponse
.
paramIsEmpty
();
}
return
randomListBiz
.
getRandomList
(
randomListDto
.
getType
(),
randomListDto
.
getNumber
(),
randomListDto
.
getLocation
());
return
randomListBiz
.
getRandomList
(
randomListDto
.
getType
(),
randomListDto
.
getNumber
(),
randomListDto
.
getLocation
()
,
randomListDto
.
getNewsId
(),
randomListDto
.
getNewsType
()
);
}
}
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/VehicleModelController.java
View file @
ccb42772
...
...
@@ -47,9 +47,11 @@ public class VehicleModelController extends CommonBaseController {
@RequestMapping
(
value
=
"/detail/{name}"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
public
ObjectRestResponse
<
VModelDetailVO
>
detail
(
@PathVariable
(
"name"
)
@ApiParam
(
"车型名称"
)
String
name
)
{
return
vehicleFeign
.
detailByParam
(
BeanUtil
.
beanToMap
(
new
VehicleModel
(){{
ObjectRestResponse
<
VModelDetailVO
>
objectRestResponse
=
vehicleFeign
.
detailByParam
(
BeanUtil
.
beanToMap
(
new
VehicleModel
(){{
setName
(
name
);
}},
false
,
true
));
objectRestResponse
.
getData
().
setUccnCataList
(
initUccnCataCollect
(
objectRestResponse
.
getData
().
getConfig
()));
return
objectRestResponse
;
}
/**
...
...
@@ -65,11 +67,18 @@ public class VehicleModelController extends CommonBaseController {
ObjectRestResponse
<
PageDataVO
<
VehicleModelVo
>>
objectRestResponse
=
vehicleFeign
.
findVehicleModelPageUnauthfind
(
vmqc
);
PageDataVO
<
VehicleModelVo
>
pageDataVOs
=
objectRestResponse
.
getData
();
pageDataVOs
.
getData
().
forEach
(
v
->
{
List
<
VehiclePlatCata
>
vehiclePlatCataList
=
vehicleFeign
.
getCatasByIds
(
v
.
getConfig
()).
getData
();
StrUtil
.
splitToInt
(
"14,7,11"
,
","
);
v
.
setUccnCataList
(
vehiclePlatCataList
.
parallelStream
().
filter
(
v1
->
{
return
ArrayUtil
.
contains
(
StrUtil
.
splitToInt
(
"14,7,11"
,
","
),
v1
.
getParentId
());}).
sorted
(
Comparator
.
comparing
(
VehiclePlatCata:
:
getParentId
,
(
x
,
y
)
->
{
int
xx
=
0
,
yy
=
0
;
v
.
setUccnCataList
(
initUccnCataCollect
(
v
.
getConfig
()));
});
return
objectRestResponse
;
}
private
List
<
VehiclePlatCata
>
initUccnCataCollect
(
String
modelConfig
)
{
List
<
VehiclePlatCata
>
vehiclePlatCataList
=
vehicleFeign
.
getCatasByIds
(
modelConfig
).
getData
();
int
[]
array
=
StrUtil
.
splitToInt
(
"14,7,11"
,
","
);
return
vehiclePlatCataList
.
parallelStream
()
.
filter
(
v1
->
{
return
ArrayUtil
.
contains
(
array
,
v1
.
getParentId
());})
.
sorted
(
Comparator
.
comparing
(
VehiclePlatCata:
:
getParentId
,
(
x
,
y
)
->
{
int
xx
=
0
,
yy
=
0
;
for
(
int
i
=
0
;
i
<
array
.
length
;
i
++)
{
if
(
x
==
array
[
i
])
{
xx
=
i
;
...
...
@@ -78,8 +87,6 @@ public class VehicleModelController extends CommonBaseController {
}
}
return
(
xx
-
yy
);
})).
collect
(
Collectors
.
toList
()));
});
return
objectRestResponse
;
})).
collect
(
Collectors
.
toList
());
}
}
xx-uccn/xx-uccn-server/src/main/resources/mapper/ArticleMapper.xml
View file @
ccb42772
...
...
@@ -8,12 +8,18 @@
where
is_del=0
and status=1
<if
test=
"id != null"
>
and id != #{id}
</if>
and (type=#{type} or type=0)
order by
weight ASC ,add_time DESC
<if
test=
"limit != null"
>
limit #{limit}
</if>
</select>
</mapper>
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VModelDetailVO.java
View file @
ccb42772
...
...
@@ -19,4 +19,9 @@ public class VModelDetailVO extends VehicleModel {
@ApiModelProperty
(
"会员列表"
)
List
<
BaseUserMemberLevel
>
userMemberLevel
;
/**
* 官网需要显示的配置列表
*/
List
<
VehiclePlatCata
>
UccnCataList
;
}
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehicleModelVo.java
View file @
ccb42772
...
...
@@ -48,6 +48,9 @@ public class VehicleModelVo extends VehicleModel implements Serializable {
@ApiModelProperty
(
value
=
"品牌"
)
private
String
brandName
;
/**
* 官网需要显示的配置列表
*/
List
<
VehiclePlatCata
>
UccnCataList
;
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
ccb42772
...
...
@@ -677,6 +677,8 @@
and v.is_del = 0
and v.status != 3
and v.use_type = 1
and bc.is_del = 0
and bc.is_show = 1
</where>
</sql>
...
...
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