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
7c84d03b
Commit
7c84d03b
authored
Mar 06, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品详情-新增拍卖配置
parent
0199ee8d
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
0 deletions
+66
-0
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/SysSupplierItemServiceImpl.java
...va/com/wwdz/ch/admin/impl/SysSupplierItemServiceImpl.java
+22
-0
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
...src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
+27
-0
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/AuctionConfigDao.java
...ava/com/wwdz/ch/db/dao/distribution/AuctionConfigDao.java
+7
-0
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/AuctionConfigDaoImpl.java
...om/wwdz/ch/db/impl/distribution/AuctionConfigDaoImpl.java
+10
-0
No files found.
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/SysSupplierItemServiceImpl.java
View file @
7c84d03b
...
@@ -142,6 +142,14 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
...
@@ -142,6 +142,14 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
supplierItemVo
.
setSupplyPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getSupplyPrice
()));
supplierItemVo
.
setSupplyPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getSupplyPrice
()));
supplierItemVo
.
setDistributionPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getDistributionPrice
()));
supplierItemVo
.
setDistributionPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getDistributionPrice
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
//拍卖品需要查询拍卖配置信息
if
(
supplierItem
.
getType
()
==
DistributionEnum
.
DistributionTypeEnum
.
AUCTION
.
getCode
())
{
AuctionConfig
auctionConfig
=
auctionConfigDao
.
findByItemId
(
itemId
);
supplierItemVo
.
setAuctionStartTime
(
auctionConfig
.
getStartTime
());
supplierItemVo
.
setAuctionEndTime
(
auctionConfig
.
getEndTime
());
supplierItemVo
.
setStartPrice
(
PriceUtil
.
convertPriceFenToYuan
(
auctionConfig
.
getStartPrice
()));
supplierItemVo
.
setAddExtent
(
PriceUtil
.
convertPriceFenToYuan
(
auctionConfig
.
getAddExtent
()));
}
return
Result
.
success
(
supplierItemVo
);
return
Result
.
success
(
supplierItemVo
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"商品详情查询失败 error : {}"
,
e
);
logger
.
error
(
"商品详情查询失败 error : {}"
,
e
);
...
@@ -206,6 +214,16 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
...
@@ -206,6 +214,16 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
supplierItem
.
setId
(
dto
.
getId
());
supplierItem
.
setId
(
dto
.
getId
());
supplierItem
.
setIsOnSale
(
dto
.
getIsOnSale
());
supplierItem
.
setIsOnSale
(
dto
.
getIsOnSale
());
supplierItemDao
.
update
(
supplierItem
);
supplierItemDao
.
update
(
supplierItem
);
SupplierItem
oldItem
=
supplierItemDao
.
findById
(
dto
.
getId
());
//下架的是竞拍品需要把拍卖配置信息改为无效
if
(
oldItem
.
getType
()
==
DistributionEnum
.
DistributionTypeEnum
.
AUCTION
.
getCode
())
{
if
(!
dto
.
getIsOnSale
())
{
auctionConfigDao
.
setEnd
(
dto
.
getId
());
}
else
{
auctionConfigDao
.
setValid
(
dto
.
getId
());
}
}
return
Result
.
success
();
return
Result
.
success
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"商品上下架失败 error : {}"
,
e
);
logger
.
error
(
"商品上下架失败 error : {}"
,
e
);
...
@@ -216,6 +234,10 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
...
@@ -216,6 +234,10 @@ public class SysSupplierItemServiceImpl implements SysSupplierItemService {
@Override
@Override
public
Result
delete
(
SupplierItemRequestDto
dto
)
{
public
Result
delete
(
SupplierItemRequestDto
dto
)
{
try
{
try
{
SupplierItem
oldItem
=
supplierItemDao
.
findById
(
dto
.
getId
());
if
(
oldItem
.
getIsOnSale
())
{
return
Result
.
failed
(
"先下架商品"
);
}
SupplierItem
supplierItem
=
new
SupplierItem
();
SupplierItem
supplierItem
=
new
SupplierItem
();
supplierItem
.
setId
(
dto
.
getId
());
supplierItem
.
setId
(
dto
.
getId
());
supplierItem
.
setIsDeleted
(
true
);
supplierItem
.
setIsDeleted
(
true
);
...
...
ch-core/src/main/java/com/wwdz/ch/core/entity/SupplierItemVo.java
View file @
7c84d03b
...
@@ -122,5 +122,32 @@ public class SupplierItemVo implements Entity {
...
@@ -122,5 +122,32 @@ public class SupplierItemVo implements Entity {
*/
*/
private
Boolean
shopBought
;
private
Boolean
shopBought
;
/**
* 竞拍开始时间
*/
private
Date
auctionStartTime
;
/**
* 竞拍结束时间
*/
private
Date
auctionEndTime
;
/**
* 起拍价
* 单位元 需要转为分
*/
private
String
startPrice
;
/**
* 加价幅度
* 单位元 需要转为分
*/
private
String
addExtent
;
/**
* 实际竞拍结束时间
*/
private
Date
realEndTime
;
}
}
ch-dao/src/main/java/com/wwdz/ch/db/dao/distribution/AuctionConfigDao.java
View file @
7c84d03b
...
@@ -45,4 +45,11 @@ public interface AuctionConfigDao {
...
@@ -45,4 +45,11 @@ public interface AuctionConfigDao {
* @return
* @return
*/
*/
int
setEnd
(
long
itemId
);
int
setEnd
(
long
itemId
);
/**
* 拍卖配置更新为有效
* @param itemId
* @return
*/
int
setValid
(
long
itemId
);
}
}
ch-dao/src/main/java/com/wwdz/ch/db/impl/distribution/AuctionConfigDaoImpl.java
View file @
7c84d03b
...
@@ -56,4 +56,14 @@ public class AuctionConfigDaoImpl implements AuctionConfigDao {
...
@@ -56,4 +56,14 @@ public class AuctionConfigDaoImpl implements AuctionConfigDao {
return
auctionConfigMapper
.
updateByExampleSelective
(
auctionConfig
,
example
);
return
auctionConfigMapper
.
updateByExampleSelective
(
auctionConfig
,
example
);
}
}
@Override
public
int
setValid
(
long
itemId
)
{
AuctionConfigExample
example
=
new
AuctionConfigExample
();
AuctionConfigExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andItemIdEqualTo
(
itemId
);
AuctionConfig
auctionConfig
=
new
AuctionConfig
();
auctionConfig
.
setUpdateTime
(
new
Date
());
auctionConfig
.
setIsValid
(
true
);
return
auctionConfigMapper
.
updateByExampleSelective
(
auctionConfig
,
example
);
}
}
}
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