Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
c1a70020
Commit
c1a70020
authored
Mar 25, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
详情查询对应商品所属标签
parent
eb27168b
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
80 additions
and
8 deletions
+80
-8
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
...src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
+5
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/CollectionItemsRelationDaoImpl.java
.../db/impl/distribution/CollectionItemsRelationDaoImpl.java
+2
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+72
-4
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SupplierItemController.java
...m/wwdz/ch/wx/web/distribution/SupplierItemController.java
+1
-4
No files found.
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
View file @
c1a70020
...
@@ -230,4 +230,9 @@ public class SupplierItemVo implements Entity {
...
@@ -230,4 +230,9 @@ public class SupplierItemVo implements Entity {
* 当前用户是否已分享过
* 当前用户是否已分享过
*/
*/
private
Boolean
isShared
;
private
Boolean
isShared
;
/**
* 商品所属标签id
*/
private
List
<
Long
>
bookIdList
;
}
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/CollectionItemsRelationDaoImpl.java
View file @
c1a70020
...
@@ -40,6 +40,7 @@ public class CollectionItemsRelationDaoImpl implements CollectionItemsRelationDa
...
@@ -40,6 +40,7 @@ public class CollectionItemsRelationDaoImpl implements CollectionItemsRelationDa
CollectionItemsRelationExample
example
=
new
CollectionItemsRelationExample
();
CollectionItemsRelationExample
example
=
new
CollectionItemsRelationExample
();
CollectionItemsRelationExample
.
Criteria
criteria
=
example
.
createCriteria
();
CollectionItemsRelationExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andItemIdEqualTo
(
itemId
);
criteria
.
andItemIdEqualTo
(
itemId
);
criteria
.
andIsDeletedEqualTo
(
false
);
return
collectionItemsRelationMapper
.
selectByExample
(
example
);
return
collectionItemsRelationMapper
.
selectByExample
(
example
);
}
}
...
@@ -50,6 +51,7 @@ public class CollectionItemsRelationDaoImpl implements CollectionItemsRelationDa
...
@@ -50,6 +51,7 @@ public class CollectionItemsRelationDaoImpl implements CollectionItemsRelationDa
CollectionItemsRelationExample
.
Criteria
criteria
=
example
.
createCriteria
();
CollectionItemsRelationExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andCollectionBookIdEqualTo
(
bookId
);
criteria
.
andCollectionBookIdEqualTo
(
bookId
);
criteria
.
andItemIdEqualTo
(
itemId
);
criteria
.
andItemIdEqualTo
(
itemId
);
criteria
.
andIsDeletedEqualTo
(
false
);
return
collectionItemsRelationMapper
.
countByExample
(
example
)
>
0
;
return
collectionItemsRelationMapper
.
countByExample
(
example
)
>
0
;
}
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
c1a70020
...
@@ -372,9 +372,24 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -372,9 +372,24 @@ public class SupplierItemServiceImpl implements SupplierItemService {
}
else
{
}
else
{
itemId
=
dto
.
getId
();
itemId
=
dto
.
getId
();
}
}
//保存浏览记录
if
(!
dto
.
getIsShop
())
{
//做浏览记录
boolean
flag
=
userRecentBrowseDao
.
isExisted
(
dto
.
getUserId
(),
distributorShareRecord
.
getDistributorId
());
if
(!
flag
)
{
UserRecentBrowse
newRecord
=
new
UserRecentBrowse
();
newRecord
.
setShareRecordId
(
dto
.
getShareRecordId
());
newRecord
.
setSharerId
(
distributorShareRecord
.
getDistributorId
());
newRecord
.
setUserId
(
dto
.
getUserId
());
newRecord
.
setCreateTime
(
new
Date
());
newRecord
.
setUpdateTime
(
new
Date
());
newRecord
.
setType
(
DistributionEnum
.
UserBrowseTypeEnum
.
PLATFORM_ITEM
.
getCode
());
userRecentBrowseDao
.
insert
(
newRecord
);
}
}
//查询商品竞拍信息
//查询商品竞拍信息
AuctionConfig
auctionConfig
=
auctionConfigDao
.
findByItemId
(
itemId
);
AuctionConfig
auctionConfig
=
auctionConfigDao
.
findByItemId
(
itemId
);
//查询商品竞拍记录
//查询商品竞拍记录
AuctionRecordRequestDto
auctionRecordRequestDto
=
new
AuctionRecordRequestDto
();
AuctionRecordRequestDto
auctionRecordRequestDto
=
new
AuctionRecordRequestDto
();
auctionRecordRequestDto
.
setItemId
(
itemId
);
auctionRecordRequestDto
.
setItemId
(
itemId
);
...
@@ -642,6 +657,10 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -642,6 +657,10 @@ public class SupplierItemServiceImpl implements SupplierItemService {
//查询藏品被收藏的次数
//查询藏品被收藏的次数
long
countNum
=
itemCollectedRecordDao
.
countByItemId
(
dto
.
getId
());
long
countNum
=
itemCollectedRecordDao
.
countByItemId
(
dto
.
getId
());
supplierItemVo
.
setCollectedNum
((
int
)
countNum
);
supplierItemVo
.
setCollectedNum
((
int
)
countNum
);
//查询商品所属标签
List
<
CollectionItemsRelation
>
collectionItemsRelations
=
collectionItemsRelationDao
.
findByItemId
(
itemId
);
List
<
Long
>
bookIds
=
collectionItemsRelations
.
stream
().
map
(
CollectionItemsRelation:
:
getCollectionBookId
).
collect
(
Collectors
.
toList
());
supplierItemVo
.
setBookIdList
(
bookIds
);
return
Result
.
success
(
supplierItemVo
);
return
Result
.
success
(
supplierItemVo
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询上传的藏品详情 error : {}"
,
e
);
logger
.
error
(
"查询上传的藏品详情 error : {}"
,
e
);
...
@@ -733,6 +752,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -733,6 +752,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
searchDto
.
setLimit
(
dto
.
getLimit
());
searchDto
.
setLimit
(
dto
.
getLimit
());
List
<
SupplierItem
>
supplierItemList
=
supplierItemDao
.
findForHomePage
(
searchDto
);
List
<
SupplierItem
>
supplierItemList
=
supplierItemDao
.
findForHomePage
(
searchDto
);
PageInfo
<
SupplierItem
>
pageInfo
=
new
PageInfo
(
supplierItemList
);
PageInfo
<
SupplierItem
>
pageInfo
=
new
PageInfo
(
supplierItemList
);
Date
now
=
new
Date
();
supplierItemList
.
forEach
(
supplierItem
->
{
supplierItemList
.
forEach
(
supplierItem
->
{
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
EntityMapper
.
copyAttribute
(
supplierItem
,
supplierItemVo
);
EntityMapper
.
copyAttribute
(
supplierItem
,
supplierItemVo
);
...
@@ -741,14 +761,62 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -741,14 +761,62 @@ public class SupplierItemServiceImpl implements SupplierItemService {
supplierItemVo
.
setShareId
(
map
.
get
(
supplierItem
.
getId
())==
null
?
""
:
map
.
get
(
supplierItem
.
getId
()).
getShareId
());
supplierItemVo
.
setShareId
(
map
.
get
(
supplierItem
.
getId
())==
null
?
""
:
map
.
get
(
supplierItem
.
getId
()).
getShareId
());
//竞拍商品需要展示当前价
//竞拍商品需要展示当前价
if
(
supplierItem
.
getType
()
==
DistributionEnum
.
DistributionTypeEnum
.
AUCTION
.
getCode
())
{
if
(
supplierItem
.
getType
()
==
DistributionEnum
.
DistributionTypeEnum
.
AUCTION
.
getCode
())
{
AuctionRecord
auction
Record
=
auctionRecordDao
.
findLastedRecord
(
supplierItem
.
getId
());
AuctionRecord
lasted
Record
=
auctionRecordDao
.
findLastedRecord
(
supplierItem
.
getId
());
if
(
auctionRecord
!=
null
&&
auction
Record
.
getPrice
()
!=
null
)
{
if
(
lastedRecord
!=
null
&&
lasted
Record
.
getPrice
()
!=
null
)
{
supplierItemVo
.
setCurrentPrice
(
PriceUtil
.
convertPriceFenToYuan
(
auction
Record
.
getPrice
()));
supplierItemVo
.
setCurrentPrice
(
PriceUtil
.
convertPriceFenToYuan
(
lasted
Record
.
getPrice
()));
}
else
{
}
else
{
supplierItemVo
.
setCurrentPrice
(
"0"
);
supplierItemVo
.
setCurrentPrice
(
"0"
);
}
}
AuctionConfig
auctionConfig
=
auctionConfigDao
.
findByItemId
(
supplierItem
.
getId
());
AuctionConfig
auctionConfig
=
auctionConfigDao
.
findByItemId
(
supplierItem
.
getId
());
supplierItemVo
.
setRealEndTime
(
auctionConfig
.
getRealEndTime
());
supplierItemVo
.
setRealEndTime
(
auctionConfig
.
getRealEndTime
());
DistributionOrder
distributionOrder
=
distributionOrderDao
.
findByItemId
(
supplierItem
.
getId
());
if
(
now
.
before
(
auctionConfig
.
getStartTime
()))
{
supplierItemVo
.
setState
(
DistributionEnum
.
AuctionStateEnum
.
NOT_START
.
getCode
());
supplierItemVo
.
setStateName
(
DistributionEnum
.
AuctionStateEnum
.
NOT_START
.
getDes
());
}
else
if
(
now
.
after
(
auctionConfig
.
getRealEndTime
()))
{
supplierItemVo
.
setState
(
DistributionEnum
.
AuctionStateEnum
.
END
.
getCode
());
supplierItemVo
.
setStateName
(
DistributionEnum
.
AuctionStateEnum
.
END
.
getDes
());
supplierItemVo
.
setUserState
(
DistributionEnum
.
AuctionUserStateEnum
.
END
.
getCode
());
supplierItemVo
.
setUserStateName
(
DistributionEnum
.
AuctionUserStateEnum
.
END
.
getDes
());
//如果当前时间已经超过截拍时间,并且竞拍配置还未改成无效,则进行修改
if
(
auctionConfig
.
getIsValid
())
{
auctionConfigDao
.
setEnd
(
supplierItem
.
getId
());
}
if
(
lastedRecord
!=
null
)
{
//如果是该用户竞拍成功,还没生成订单则用户状态为立即支付
if
(
lastedRecord
.
getUserId
().
longValue
()
==
dto
.
getUserId
().
longValue
())
{
//竞拍结束后未生成订单
if
(
distributionOrder
==
null
||
distributionOrder
.
getPayTime
()
==
null
)
{
supplierItemVo
.
setUserState
(
DistributionEnum
.
AuctionUserStateEnum
.
PRE_PAY
.
getCode
());
supplierItemVo
.
setUserStateName
(
DistributionEnum
.
AuctionUserStateEnum
.
PRE_PAY
.
getDes
());
//检查是否超时未支付
if
(
distributionOrder
!=
null
)
{
Date
createOrderTime
=
distributionOrder
.
getCreateTime
();
Instant
createInstant
=
createOrderTime
.
toInstant
().
plus
(
Duration
.
ofHours
(
24
));
Date
time
=
Date
.
from
(
createInstant
);
if
(
now
.
after
(
time
))
{
supplierItemVo
.
setUserState
(
DistributionEnum
.
AuctionUserStateEnum
.
END
.
getCode
());
supplierItemVo
.
setUserStateName
(
DistributionEnum
.
AuctionUserStateEnum
.
END
.
getDes
());
}
}
}
else
{
//竞拍结束页生成了订单并支付过了就显示竞拍结束
supplierItemVo
.
setUserState
(
DistributionEnum
.
AuctionUserStateEnum
.
END
.
getCode
());
supplierItemVo
.
setUserStateName
(
DistributionEnum
.
AuctionUserStateEnum
.
END
.
getDes
());
}
}
}
}
else
{
if
(
supplierItemVo
!=
null
)
{
if
(
lastedRecord
.
getUserId
().
longValue
()
==
dto
.
getUserId
().
longValue
())
{
supplierItemVo
.
setUserState
(
DistributionEnum
.
AuctionUserStateEnum
.
LEAD
.
getCode
());
supplierItemVo
.
setUserStateName
(
DistributionEnum
.
AuctionUserStateEnum
.
LEAD
.
getDes
());
}
}
supplierItemVo
.
setState
(
DistributionEnum
.
AuctionStateEnum
.
IN_AUCTION
.
getCode
());
supplierItemVo
.
setStateName
(
DistributionEnum
.
AuctionStateEnum
.
IN_AUCTION
.
getDes
());
}
}
}
supplierItemVos
.
add
(
supplierItemVo
);
supplierItemVos
.
add
(
supplierItemVo
);
});
});
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SupplierItemController.java
View file @
c1a70020
...
@@ -135,10 +135,7 @@ public class SupplierItemController {
...
@@ -135,10 +135,7 @@ public class SupplierItemController {
@ApiOperation
(
value
=
"查询主页列表"
)
@ApiOperation
(
value
=
"查询主页列表"
)
@PostMapping
(
"/findHomePage"
)
@PostMapping
(
"/findHomePage"
)
public
Result
findHomePage
(
@RequestBody
SupplierItemRequestDto
dto
)
{
public
Result
findHomePage
(
@RequestBody
SupplierItemRequestDto
dto
)
{
logger
.
info
(
"删除用户查询主页列表藏品,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
logger
.
info
(
"查询主页列表,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
dto
.
getId
()
==
null
)
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
}
return
supplierItemService
.
findHomePage
(
dto
);
return
supplierItemService
.
findHomePage
(
dto
);
}
}
}
}
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