Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
midjourney-proxy
Overview
Overview
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
徐少华
midjourney-proxy
Commits
ed328fe2
Commit
ed328fe2
authored
Jul 12, 2019
by
阮思源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改关键词应用作品增加统计的bug
parent
0b3e0250
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
24 deletions
+28
-24
BookGroupBizImpl.java
...java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
+28
-24
No files found.
pcloud-service-book/src/main/java/com/pcloud/book/group/biz/impl/BookGroupBizImpl.java
View file @
ed328fe2
...
...
@@ -2,6 +2,8 @@ package com.pcloud.book.group.biz.impl;
import
com.alibaba.fastjson.JSONObject
;
import
com.pcloud.appcenter.app.dto.AppDto
;
import
com.pcloud.appcenter.base.dto.AppPriceCacheDTO
;
import
com.pcloud.appcenter.cache.service.AppPriceCacheService
;
import
com.pcloud.audioapp.audioLesson.service.AudioLessonService
;
import
com.pcloud.book.base.exception.BookBizException
;
import
com.pcloud.book.book.biz.BookBiz
;
...
...
@@ -40,6 +42,7 @@ import com.pcloud.common.core.dto.SendNotifyDto;
import
com.pcloud.common.core.enums.NotifyOriginTypeEnum
;
import
com.pcloud.common.dto.ResponseDto
;
import
com.pcloud.common.entity.UploadResultInfo
;
import
com.pcloud.common.enums.AppTypeEnum
;
import
com.pcloud.common.exceptions.BizException
;
import
com.pcloud.common.page.PageBean
;
import
com.pcloud.common.page.PageBeanNew
;
...
...
@@ -149,6 +152,8 @@ public class BookGroupBizImpl implements BookGroupBiz {
private
ScheduleService
scheduleService
;
@Autowired
private
TimeTableService
timeTableService
;
@Autowired
private
AppPriceCacheService
appPriceCacheService
;
/**
...
...
@@ -910,57 +915,56 @@ public class BookGroupBizImpl implements BookGroupBiz {
List
<
ListKeywordVO
>
listKeywordVOS
=
bookKeywordDao
.
getKeywordsByClassifyIds
(
classifyIds
,
bookId
);
List
<
Long
>
appIds
=
listKeywordVOS
.
stream
().
filter
(
s
->
"APP"
.
equalsIgnoreCase
(
s
.
getServeType
())).
map
(
ListKeywordVO:
:
getServeId
).
collect
(
Collectors
.
toList
());
Map
<
Long
,
AppDto
>
appDtoMap
=
appConsr
.
mapByIds
(
appIds
);
Map
<
Long
,
Long
>
appIdToProductIdMap
=
new
HashMap
<>();
List
<
Long
>
appProductIds
=
new
ArrayList
<>();
List
<
AppPriceCacheDTO
>
appPriceCacheDTOS
=
new
ArrayList
<>();
for
(
Long
appId
:
appIds
)
{
if
(
appDtoMap
.
get
(
appId
)
!=
null
&&
appDtoMap
.
get
(
appId
).
getProductId
()
!=
null
)
{
appIdToProductIdMap
.
put
(
appId
,
appDtoMap
.
get
(
appId
).
getProductId
());
appProductIds
.
add
(
appDtoMap
.
get
(
appId
).
getProductId
());
if
(
appDtoMap
.
get
(
appId
)
!=
null
)
{
AppPriceCacheDTO
appPriceCacheDTO
=
new
AppPriceCacheDTO
();
appPriceCacheDTO
.
setAppId
(
appId
);
appPriceCacheDTO
.
setAppTypeEnum
(
AppTypeEnum
.
APP_TYPE_MAP
.
get
(
appDtoMap
.
get
(
appId
).
getTypeCode
()));
appPriceCacheDTOS
.
add
(
appPriceCacheDTO
);
}
}
Map
<
Long
,
BigDecimal
>
appPriceMap
=
ResponseHandleUtil
.
parseMapResponse
(
appPriceCacheService
.
getCaches
(
appPriceCacheDTOS
),
Long
.
class
,
BigDecimal
.
class
);
List
<
Long
>
productIds
=
listKeywordVOS
.
stream
().
filter
(
s
->
"PRODUCT"
.
equalsIgnoreCase
(
s
.
getServeType
())).
map
(
ListKeywordVO:
:
getServeId
).
collect
(
Collectors
.
toList
());
productIds
.
addAll
(
appProductIds
);
Map
<
Long
,
ProductDto
>
productDtoMap
=
productConsr
.
getProBasesByIds
(
productIds
);
Map
<
Long
,
Boolean
>
isSuperMap
=
productConsr
.
getIsSuperByProductIdList
(
productIds
);
for
(
ListKeywordVO
listKeywordVO
:
listKeywordVOS
)
{
if
(
ReplyTypeEnum
.
APP
.
value
.
equals
(
listKeywordVO
.
getReplyType
()))
{
Long
productId
=
0L
;
if
(
"APP"
.
equalsIgnoreCase
(
listKeywordVO
.
getServeType
()))
{
Long
appId
=
listKeywordVO
.
getServeId
();
AppDto
appDto
=
appDtoMap
.
get
(
appId
);
if
(
appDto
!=
null
)
{
listKeywordVO
.
setTypeCode
(
appDto
.
getTypeCode
());
}
productId
=
appIdToProductIdMap
.
get
(
appId
);
if
(
appPriceMap
!=
null
)
{
if
(
appPriceMap
.
get
(
appId
)
!=
null
)
{
listKeywordVO
.
setRetailPrice
(
appPriceMap
.
get
(
appId
).
doubleValue
());
listKeywordVO
.
setDealPrice
(
0
D
);
}
}
listKeywordVO
.
setApSource
(
"APP"
);
}
if
(
"PRODUCT"
.
equalsIgnoreCase
(
listKeywordVO
.
getServeType
()))
{
productId
=
listKeywordVO
.
getServeId
();
Long
productId
=
listKeywordVO
.
getServeId
();
ProductDto
productDto
=
productDtoMap
.
get
(
productId
);
if
(
productDto
!=
null
)
{
listKeywordVO
.
setTypeCode
(
productDto
.
getProductTypeCode
());
List
<
SpecificationDto
>
specificationDtos
=
productDto
.
getSpecification
();
if
(!
ListUtils
.
isEmpty
(
specificationDtos
))
{
SpecificationDto
specificationDto
=
specificationDtos
.
get
(
0
);
if
(
specificationDto
!=
null
)
{
listKeywordVO
.
setRetailPrice
(
specificationDto
.
getAdvisePrice
());
listKeywordVO
.
setDealPrice
(
specificationDto
.
getDealPrice
());
}
}
}
//判断是否为超级作者作品
if
(
isSuperMap
!=
null
&&
isSuperMap
.
get
(
productId
)
!=
null
&&
isSuperMap
.
get
(
productId
))
{
listKeywordVO
.
setApSource
(
"SUPER_PRODUCT"
);
}
else
{
}
else
{
listKeywordVO
.
setApSource
(
"PRODUCT"
);
}
}
ProductDto
productDto
=
null
;
if
(
productId
!=
null
)
{
productDto
=
productDtoMap
.
get
(
productId
);
}
if
(
productDto
!=
null
)
{
List
<
SpecificationDto
>
specificationDtos
=
productDto
.
getSpecification
();
if
(!
ListUtils
.
isEmpty
(
specificationDtos
))
{
SpecificationDto
specificationDto
=
specificationDtos
.
get
(
0
);
if
(
specificationDto
!=
null
)
{
listKeywordVO
.
setRetailPrice
(
specificationDto
.
getAdvisePrice
());
listKeywordVO
.
setDealPrice
(
specificationDto
.
getDealPrice
());
}
}
}
}
}
Map
<
Long
,
List
<
ListKeywordVO
>>
listMap
=
listKeywordVOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
ListKeywordVO:
:
getClassifyId
));
...
...
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