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
915bf517
Commit
915bf517
authored
Mar 06, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into quanku_v1.9
parents
382963e7
fb1db89e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
14 deletions
+29
-14
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributionOrderServiceImpl.java
...ch/wx/impl/distribution/DistributionOrderServiceImpl.java
+7
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+19
-11
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
...pi/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
+3
-3
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributionOrderServiceImpl.java
View file @
915bf517
...
...
@@ -285,6 +285,12 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
if
(
stock
<=
0
)
{
return
Result
.
failed
(
"商品库存不足"
);
}
//1.查询购买者对该商品的历史购买记录
List
<
DistributionOrder
>
distributionOrders
=
distributionOrderDao
.
findValidOrderOfItemIdByBuyerId
(
dto
.
getBuyerId
(),
itemId
);
if
(!
CollectionUtils
.
isEmpty
(
distributionOrders
))
{
return
Result
.
failed
(
"限购一件"
);
}
String
distributionOrderId
=
IdUtils
.
getOrderNumber
(
DISTRIBUTION_ORDER_PREFIX
);
DistributionOrderRequestDto
prePayDto
=
new
DistributionOrderRequestDto
();
prePayDto
.
setDistributionOrderId
(
distributionOrderId
);
...
...
@@ -296,6 +302,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
if
(!
prePayResult
.
getSuccess
())
{
return
Result
.
failed
(
"预下单失败"
);
}
String
prepayId
=
(
String
)
prePayResult
.
getData
();
DistributionOrder
distributionOrder
=
new
DistributionOrder
();
distributionOrder
.
setItemId
(
itemId
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
915bf517
...
...
@@ -105,21 +105,29 @@ public class SupplierItemServiceImpl implements SupplierItemService {
public
Result
findDetail
(
SupplierItemRequestDto
dto
)
{
try
{
String
shareRecordId
=
dto
.
getShareRecordId
();
DistributorShareRecord
distributorShareRecord
=
null
;
long
itemId
=
0
;
if
(
dto
.
getId
()
!=
null
)
{
itemId
=
dto
.
getId
();
}
else
if
(
StringUtils
.
isEmpty
(
shareRecordId
)
&&
dto
.
getId
()
==
null
)
{
DistributorShareRecord
distributorShareRecord
=
new
DistributorShareRecord
();
Long
itemId
;
if
(
StringUtils
.
isEmpty
(
shareRecordId
)
&&
dto
.
getId
()
==
null
)
{
return
Result
.
failed
(
"商品信息为空"
);
}
else
{
distributorShareRecord
=
distributorShareRecordDao
.
findById
(
shareRecordId
);
if
(
distributorShareRecord
==
null
||
!
distributorShareRecord
.
getEnabled
())
{
return
Result
.
failed
(
"该商品已下架"
);
}
else
if
(
StringUtils
.
hasLength
(
shareRecordId
))
{
if
(!
shareRecordId
.
contains
(
SYSTEM_ACCOUNT
.
toString
()))
{
distributorShareRecord
=
distributorShareRecordDao
.
findById
(
shareRecordId
);
if
(
distributorShareRecord
==
null
||
!
distributorShareRecord
.
getEnabled
())
{
return
Result
.
failed
(
"该商品已下架"
);
}
else
{
itemId
=
distributorShareRecord
.
getItemId
();
}
}
else
{
itemId
=
d
istributorShareRecord
.
getItem
Id
();
itemId
=
d
to
.
get
Id
();
}
}
else
{
itemId
=
dto
.
getId
();
}
if
(
itemId
==
null
)
{
logger
.
error
(
"商品详情分享id和商品id参数全为空,查询失败"
);
return
Result
.
failed
(
"商品信息为空"
);
}
SupplierItemVo
supplierItemVo
=
new
SupplierItemVo
();
//用户点击链接进入详情页需要记录
if
(!
dto
.
getIsShop
())
{
...
...
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
View file @
915bf517
...
...
@@ -89,12 +89,12 @@ public class WxPayServiceTest {
@Test
public
void
refund
()
{
List
<
String
>
list
=
Arrays
.
asList
(
"DA240
2241539558250270
"
);
List
<
String
>
list
=
Arrays
.
asList
(
"DA240
3061107510927305"
,
"DA2403061103288138522
"
);
list
.
forEach
(
orderId
->{
DistributionOrderRequestDto
dto
=
new
DistributionOrderRequestDto
();
dto
.
setDistributionOrderId
(
orderId
);
dto
.
setAmount
(
"
12
.8"
);
dto
.
setRefundPrice
(
"
12
.8"
);
dto
.
setAmount
(
"
6
.8"
);
dto
.
setRefundPrice
(
"
6
.8"
);
Result
result
=
wxPayServiceApi
.
refund
(
dto
);
logger
.
info
(
"申请微信支付退款:{}"
,
result
);
});
...
...
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