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
69fe08bc
Commit
69fe08bc
authored
Sep 03, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询交换商品信息
parent
285a2302
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
5 deletions
+47
-5
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/ExchangeServiceImpl.java
...com/wwdz/ch/wx/impl/distribution/ExchangeServiceImpl.java
+23
-5
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/ExchangeService.java
.../com/wwdz/ch/wx/service/distribution/ExchangeService.java
+7
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/ExchangeController.java
...a/com/wwdz/ch/wx/web/distribution/ExchangeController.java
+17
-0
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/ExchangeServiceImpl.java
View file @
69fe08bc
...
@@ -164,9 +164,8 @@ public class ExchangeServiceImpl implements ExchangeService {
...
@@ -164,9 +164,8 @@ public class ExchangeServiceImpl implements ExchangeService {
list
.
add
(
supplierItemVo
);
list
.
add
(
supplierItemVo
);
}
}
logger
.
info
(
"查询用户标签下的藏品数目:{}"
,
list
.
size
());
logger
.
info
(
"查询用户标签下的藏品数目:{}"
,
list
.
size
());
//查询交换的商品
//查询交换的商品
SupplierItem
supplierItem
=
supplierItemDao
.
findById
(
dto
.
getExchangeItemId
());
/*
SupplierItem supplierItem = supplierItemDao.findById(dto.getExchangeItemId());
SupplierItemVo supplierItemVo = new SupplierItemVo();
SupplierItemVo supplierItemVo = new SupplierItemVo();
EntityMapper.copyAttribute(supplierItem, supplierItemVo);
EntityMapper.copyAttribute(supplierItem, supplierItemVo);
supplierItemVo.setItemId(supplierItem.getId());
supplierItemVo.setItemId(supplierItem.getId());
...
@@ -177,14 +176,33 @@ public class ExchangeServiceImpl implements ExchangeService {
...
@@ -177,14 +176,33 @@ public class ExchangeServiceImpl implements ExchangeService {
supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
supplierItemVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
Map<String, Object> map = new HashMap<>();
Map<String, Object> map = new HashMap<>();
map.put("itemList", PageSearchResult.of(pageInfo, list));
map.put("itemList", PageSearchResult.of(pageInfo, list));
map
.
put
(
"exchangeItem"
,
supplierItemVo
);
map.put("exchangeItem", supplierItemVo);
*/
return
Result
.
success
(
map
);
return
Result
.
success
(
PageSearchResult
.
of
(
pageInfo
,
list
)
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询用户可交换的藏品失败 error: {}"
,
e
);
logger
.
error
(
"查询用户可交换的藏品失败 error: {}"
,
e
);
}
}
return
Result
.
failed
();
return
Result
.
failed
();
}
}
@Override
public
Result
findExchangeItem
(
ExchangeRequestDto
dto
)
{
try
{
SupplierItem
supplierItem
=
supplierItemDao
.
findById
(
dto
.
getExchangeItemId
());
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
EntityMapper
.
copyAttribute
(
supplierItem
,
supplierItemVo
);
supplierItemVo
.
setItemId
(
supplierItem
.
getId
());
supplierItemVo
.
setItemNum
(
dto
.
getExchangeItemNum
());
supplierItemVo
.
setSupplyPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getSupplyPrice
()));
supplierItemVo
.
setDistributionPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getDistributionPrice
()));
supplierItemVo
.
setOfficialEstimatedPrice
(
PriceUtil
.
convertPriceFenToYuan
(
supplierItem
.
getOfficialEstimatedPrice
()));
supplierItemVo
.
setHomePageImage
(
MediaUtil
.
getHomePageImage
(
supplierItem
.
getImages
(),
supplierItem
.
getVideos
()));
return
Result
.
success
(
supplierItemVo
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询交换的藏品失败 error: {}"
,
e
);
}
return
Result
.
failed
();
}
@Transactional
@Transactional
@Override
@Override
public
Result
exchange
(
ExchangeRequestDto
dto
)
{
public
Result
exchange
(
ExchangeRequestDto
dto
)
{
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/ExchangeService.java
View file @
69fe08bc
...
@@ -21,6 +21,13 @@ public interface ExchangeService {
...
@@ -21,6 +21,13 @@ public interface ExchangeService {
*/
*/
Result
findItemList
(
ExchangeRequestDto
dto
);
Result
findItemList
(
ExchangeRequestDto
dto
);
/**
* 查询交换商品信息
* @param dto
* @return
*/
Result
findExchangeItem
(
ExchangeRequestDto
dto
);
/**
/**
* 以物换物
* 以物换物
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/ExchangeController.java
View file @
69fe08bc
...
@@ -75,6 +75,23 @@ public class ExchangeController {
...
@@ -75,6 +75,23 @@ public class ExchangeController {
}
}
@ApiOperation
(
value
=
"查询交换商品信息"
)
@PostMapping
(
"/findExchangeItem"
)
public
Result
findExchangeItem
(
@RequestBody
ExchangeRequestDto
dto
)
{
logger
.
info
(
"查询交换商品信息,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"exchangeItemId"
,
"被交换的商品id"
).
must
().
number
()
.
set
(
"exchangeItemNum"
,
"被交换的商品数量"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
exchangeService
.
findExchangeItem
(
dto
);
}
@ApiOperation
(
value
=
"用户换藏发货"
)
@ApiOperation
(
value
=
"用户换藏发货"
)
@PostMapping
(
"/delivery"
)
@PostMapping
(
"/delivery"
)
public
Result
delivery
(
@RequestBody
DistributionOrderRequestDto
dto
)
{
public
Result
delivery
(
@RequestBody
DistributionOrderRequestDto
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