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
30cfcea3
Commit
30cfcea3
authored
Mar 27, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
参数校验
parent
31b6fec7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+7
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SupplierItemController.java
...m/wwdz/ch/wx/web/distribution/SupplierItemController.java
+5
-6
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
30cfcea3
...
@@ -796,13 +796,19 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -796,13 +796,19 @@ public class SupplierItemServiceImpl implements SupplierItemService {
supplierItemVo
.
setItemId
(
supplierItem
.
getId
());
supplierItemVo
.
setItemId
(
supplierItem
.
getId
());
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
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
lastedRecord
=
auctionRecordDao
.
findLastedRecord
(
supplierItem
.
getId
());
AuctionRecord
lastedRecord
=
auctionRecordDao
.
findLastedRecord
(
supplierItem
.
getId
());
if
(
lastedRecord
!=
null
&&
lastedRecord
.
getPrice
()
!=
null
)
{
if
(
lastedRecord
!=
null
&&
lastedRecord
.
getPrice
()
!=
null
)
{
supplierItemVo
.
setCurrentPrice
(
PriceUtil
.
convertPriceFenToYuan
(
lastedRecord
.
getPrice
()));
supplierItemVo
.
setCurrentPrice
(
PriceUtil
.
convertPriceFenToYuan
(
lastedRecord
.
getPrice
()));
supplierItemVo
.
setUserState
(
DistributionEnum
.
AuctionUserStateEnum
.
END
.
getCode
());
supplierItemVo
.
setUserStateName
(
DistributionEnum
.
AuctionUserStateEnum
.
END
.
getDes
());
}
else
{
}
else
{
supplierItemVo
.
setCurrentPrice
(
"0"
);
supplierItemVo
.
setCurrentPrice
(
"0"
);
supplierItemVo
.
setUserState
(
DistributionEnum
.
AuctionUserStateEnum
.
PROCESS
.
getCode
());
supplierItemVo
.
setUserStateName
(
DistributionEnum
.
AuctionUserStateEnum
.
PROCESS
.
getDes
());
}
}
AuctionConfig
auctionConfig
=
auctionConfigDao
.
findByItemId
(
supplierItem
.
getId
());
AuctionConfig
auctionConfig
=
auctionConfigDao
.
findByItemId
(
supplierItem
.
getId
());
supplierItemVo
.
setRealEndTime
(
auctionConfig
.
getRealEndTime
());
supplierItemVo
.
setRealEndTime
(
auctionConfig
.
getRealEndTime
());
...
@@ -819,7 +825,6 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -819,7 +825,6 @@ public class SupplierItemServiceImpl implements SupplierItemService {
if
(
auctionConfig
.
getIsValid
())
{
if
(
auctionConfig
.
getIsValid
())
{
auctionConfigDao
.
setEnd
(
supplierItem
.
getId
());
auctionConfigDao
.
setEnd
(
supplierItem
.
getId
());
}
}
if
(
lastedRecord
!=
null
)
{
if
(
lastedRecord
!=
null
)
{
//如果是该用户竞拍成功,还没生成订单则用户状态为立即支付
//如果是该用户竞拍成功,还没生成订单则用户状态为立即支付
if
(
lastedRecord
.
getUserId
().
longValue
()
==
dto
.
getUserId
().
longValue
())
{
if
(
lastedRecord
.
getUserId
().
longValue
()
==
dto
.
getUserId
().
longValue
())
{
...
@@ -845,7 +850,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
...
@@ -845,7 +850,7 @@ public class SupplierItemServiceImpl implements SupplierItemService {
}
}
}
}
}
else
{
}
else
{
if
(
lastedRecord
!=
null
)
{
if
(
lastedRecord
!=
null
&&
lastedRecord
.
getPrice
()
!=
null
)
{
if
(
lastedRecord
.
getUserId
().
longValue
()
==
dto
.
getUserId
().
longValue
())
{
if
(
lastedRecord
.
getUserId
().
longValue
()
==
dto
.
getUserId
().
longValue
())
{
supplierItemVo
.
setUserState
(
DistributionEnum
.
AuctionUserStateEnum
.
LEAD
.
getCode
());
supplierItemVo
.
setUserState
(
DistributionEnum
.
AuctionUserStateEnum
.
LEAD
.
getCode
());
supplierItemVo
.
setUserStateName
(
DistributionEnum
.
AuctionUserStateEnum
.
LEAD
.
getDes
());
supplierItemVo
.
setUserStateName
(
DistributionEnum
.
AuctionUserStateEnum
.
LEAD
.
getDes
());
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/SupplierItemController.java
View file @
30cfcea3
...
@@ -86,12 +86,11 @@ public class SupplierItemController {
...
@@ -86,12 +86,11 @@ public class SupplierItemController {
@PostMapping
(
"/upload"
)
@PostMapping
(
"/upload"
)
public
Result
upload
(
@RequestBody
SupplierItemRequestDto
dto
)
{
public
Result
upload
(
@RequestBody
SupplierItemRequestDto
dto
)
{
logger
.
info
(
"上传藏品,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
logger
.
info
(
"上传藏品,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
if
(
StringUtils
.
isEmpty
(
dto
.
getName
()))
{
validator
.
set
(
"name"
,
"商品名称"
).
must
().
string
()
return
Result
.
failed
(
"商品名称必填"
);
.
set
(
"images"
,
"图片"
).
must
().
string
()
}
.
end
();
if
(
StringUtils
.
isEmpty
(
dto
.
getImages
()))
{
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
"至少上传一张图片"
);
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
}
return
supplierItemService
.
create
(
dto
);
return
supplierItemService
.
create
(
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