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
39682821
Commit
39682821
authored
Oct 31, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
查询用户发布商品的权限,售卖按钮是否可用
parent
9a0a7c54
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
65 additions
and
5 deletions
+65
-5
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributorProfitServiceImpl.java
...ch/wx/impl/distribution/DistributorProfitServiceImpl.java
+2
-2
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/openShop/OpenShopServiceImpl.java
...ava/com/wwdz/ch/wx/impl/openShop/OpenShopServiceImpl.java
+37
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/openShop/OpenShopService.java
...java/com/wwdz/ch/wx/service/openShop/OpenShopService.java
+9
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/openShop/OpenShopController.java
.../java/com/wwdz/ch/wx/web/openShop/OpenShopController.java
+14
-0
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/DistributorProfitServiceImpl.java
View file @
39682821
...
@@ -85,13 +85,13 @@ public class DistributorProfitServiceImpl implements DistributorProfitService {
...
@@ -85,13 +85,13 @@ public class DistributorProfitServiceImpl implements DistributorProfitService {
try
{
try
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"introduceRebate"
,
"2%"
);
map
.
put
(
"introduceRebate"
,
"2%"
);
double
channelServiceRebate
=
0.0
3
;
double
channelServiceRebate
=
0.0
1
;
CollectorWhiteList
collectorWhiteList
=
collectorWhiteListDao
.
findById
(
supplierItemRequestDto
.
getUserId
());
CollectorWhiteList
collectorWhiteList
=
collectorWhiteListDao
.
findById
(
supplierItemRequestDto
.
getUserId
());
if
(
collectorWhiteList
!=
null
)
{
if
(
collectorWhiteList
!=
null
)
{
channelServiceRebate
=
PriceUtil
.
convertToDivide
(
collectorWhiteList
.
getChannelCostRebate
()).
doubleValue
();
channelServiceRebate
=
PriceUtil
.
convertToDivide
(
collectorWhiteList
.
getChannelCostRebate
()).
doubleValue
();
map
.
put
(
"channelServiceRebate"
,
collectorWhiteList
.
getChannelCostRebate
().
intValue
()
+
"%"
);
map
.
put
(
"channelServiceRebate"
,
collectorWhiteList
.
getChannelCostRebate
().
intValue
()
+
"%"
);
}
else
{
}
else
{
map
.
put
(
"channelServiceRebate"
,
"
3
%"
);
map
.
put
(
"channelServiceRebate"
,
"
1
%"
);
}
}
Long
itemPrice
=
PriceUtil
.
convertPriceFromStr
(
supplierItemRequestDto
.
getDistributionPrice
());
Long
itemPrice
=
PriceUtil
.
convertPriceFromStr
(
supplierItemRequestDto
.
getDistributionPrice
());
long
channelServiceCost
=
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
itemPrice
.
doubleValue
()
*
channelServiceRebate
));
long
channelServiceCost
=
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
itemPrice
.
doubleValue
()
*
channelServiceRebate
));
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/openShop/OpenShopServiceImpl.java
View file @
39682821
package
com.wwdz.ch.wx.impl.openShop
;
package
com.wwdz.ch.wx.impl.openShop
;
import
com.drew.metadata.adobe.AdobeJpegDescriptor
;
import
com.wwdz.ch.core.api.wxpay.WxPayServiceApi
;
import
com.wwdz.ch.core.api.wxpay.WxPayServiceApi
;
import
com.wwdz.ch.core.consts.CommConsts
;
import
com.wwdz.ch.core.consts.CommConsts
;
import
com.wwdz.ch.core.consts.CommonEnum
;
import
com.wwdz.ch.core.consts.CommonEnum
;
...
@@ -270,4 +271,40 @@ public class OpenShopServiceImpl implements OpenShopService {
...
@@ -270,4 +271,40 @@ public class OpenShopServiceImpl implements OpenShopService {
}
}
return
Result
.
failed
();
return
Result
.
failed
();
}
}
@Override
public
Result
checkUploadItemPermission
(
OpenShopApplyOrderRequestDto
dto
)
{
try
{
long
userId
=
dto
.
getUserId
();
Date
now
=
new
Date
();
Map
<
String
,
Boolean
>
map
=
new
HashMap
<>();
CollectorWhiteList
collectorWhiteList
=
collectorWhiteListDao
.
findById
(
userId
);
if
(
collectorWhiteList
!=
null
&&
collectorWhiteList
.
getEndValidTime
().
after
(
now
))
{
map
.
put
(
"isCollector"
,
true
);
map
.
put
(
"openShop"
,
true
);
map
.
put
(
"guaranteeMoney"
,
true
);
return
Result
.
success
(
map
);
}
else
{
map
.
put
(
"isCollector"
,
false
);
}
//不是藏家时,判断是否开店审核通过
OpenShopApplyOrder
openShopApplyOrder
=
openShopApplyOrderDao
.
findByUserId
(
userId
);
if
(
openShopApplyOrder
!=
null
)
{
if
(
openShopApplyOrder
.
getState
()
==
OpenShopApplyOrderEnum
.
StateEnum
.
PASSED
.
getCode
())
{
map
.
put
(
"openShop"
,
true
);
}
else
{
map
.
put
(
"openShop"
,
false
);
}
map
.
put
(
"guaranteeMoney"
,
false
);
}
else
{
map
.
put
(
"openShop"
,
false
);
map
.
put
(
"guaranteeMoney"
,
false
);
}
return
Result
.
success
(
map
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询用户发布商品的权限 error : {}"
,
e
);
}
return
Result
.
failed
();
}
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/openShop/OpenShopService.java
View file @
39682821
...
@@ -44,4 +44,13 @@ public interface OpenShopService {
...
@@ -44,4 +44,13 @@ public interface OpenShopService {
* @return
* @return
*/
*/
Result
findOpenShopApplyOrder
(
OpenShopApplyOrderRequestDto
dto
);
Result
findOpenShopApplyOrder
(
OpenShopApplyOrderRequestDto
dto
);
/**
* 查询用户发布商品的权限
* 发布商品页面,可售卖按钮是否可用
* @param dto
* @return
*/
Result
checkUploadItemPermission
(
OpenShopApplyOrderRequestDto
dto
);
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/openShop/OpenShopController.java
View file @
39682821
...
@@ -109,4 +109,18 @@ public class OpenShopController {
...
@@ -109,4 +109,18 @@ public class OpenShopController {
}
}
@ApiOperation
(
value
=
"查询用户发布商品的权限"
)
@PostMapping
(
"/checkUploadItemPermission"
)
public
Result
checkUploadItemPermission
(
@RequestBody
OpenShopApplyOrderRequestDto
dto
)
{
logger
.
info
(
"查询用户发布商品的权限,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
Validator
validator
=
new
Validator
(
FormHandler
.
ofEntity
(
dto
));
validator
.
set
(
"userId"
,
"用户id"
).
must
().
number
()
.
end
();
if
(!
validator
.
isValid
())
{
return
Result
.
failed
(
validator
.
getErrorInfo
());
}
return
openShopService
.
checkUploadItemPermission
(
dto
);
}
}
}
ch-wx-api/src/test/java/com/wwdz/ch/wx/api/WxPayServiceTest.java
View file @
39682821
...
@@ -89,12 +89,12 @@ public class WxPayServiceTest {
...
@@ -89,12 +89,12 @@ public class WxPayServiceTest {
@Test
@Test
public
void
refund
()
{
public
void
refund
()
{
List
<
String
>
list
=
Arrays
.
asList
(
"
OSC2410301513339847057"
,
"OSC241030163513121758
2"
);
List
<
String
>
list
=
Arrays
.
asList
(
"
GM241031155659149883
2"
);
list
.
forEach
(
orderId
->{
list
.
forEach
(
orderId
->{
DistributionOrderRequestDto
dto
=
new
DistributionOrderRequestDto
();
DistributionOrderRequestDto
dto
=
new
DistributionOrderRequestDto
();
dto
.
setDistributionOrderId
(
orderId
);
dto
.
setDistributionOrderId
(
orderId
);
dto
.
setAmount
(
"
100
"
);
dto
.
setAmount
(
"
0.01
"
);
dto
.
setRefundPrice
(
"
100
"
);
dto
.
setRefundPrice
(
"
0.01
"
);
Result
result
=
wxPayServiceApi
.
refund
(
dto
);
Result
result
=
wxPayServiceApi
.
refund
(
dto
);
logger
.
info
(
"申请微信支付退款:{}"
,
result
);
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