Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gogirl-miniapp-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huluobin
gogirl-miniapp-backend
Commits
cbb74ab8
Commit
cbb74ab8
authored
Jun 01, 2020
by
huluobin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 3.7
# Conflicts: # src/test/java/com/gogirl/Test.java
parents
ecce9ece
f9241e29
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
21 deletions
+40
-21
MarketServiceImpl.java
...irl/application/market/coupon/impl/MarketServiceImpl.java
+28
-19
OrderManageController.java
.../gogirl/interfaces/order/serve/OrderManageController.java
+3
-2
Test.java
src/test/java/com/gogirl/Test.java
+9
-0
No files found.
src/main/java/com/gogirl/application/market/coupon/impl/MarketServiceImpl.java
View file @
cbb74ab8
...
...
@@ -297,6 +297,15 @@ public class MarketServiceImpl implements MarketService {
timesCardUsedRecordList
.
forEach
(
timesCardUsedRecord
->
timesCardUsedRecord
.
setStatus
(
TimesCardUsedRecord
.
STATUS_USED
));
if
(
ListUtil
.
isNotEmpty
(
timesCardUsedRecordList
))
{
timesCardUsedRecordService
.
saveOrUpdateBatch
(
timesCardUsedRecordList
);
//更新使用次数
TimesCardCustomerRelevance
timesCardCustomerRelevance
=
timesCardCustomerRelevanceService
.
getById
(
timesCardUsedRecordList
.
stream
().
findAny
().
orElseThrow
(
NullPointerException:
:
new
).
getCardRelevanceCustomerId
());
timesCardCustomerRelevance
.
setUsedTimes
(
timesCardCustomerRelevance
.
getUsedTimes
()
+
1
);
if
(
timesCardCustomerRelevance
.
getUsedTimes
().
equals
(
timesCardCustomerRelevance
.
getSumTimes
()))
{
//次数用完
timesCardCustomerRelevance
.
setStatus
(
2
);
}
timesCardCustomerRelevanceService
.
updateById
(
timesCardCustomerRelevance
);
}
}
...
...
@@ -373,8 +382,8 @@ public class MarketServiceImpl implements MarketService {
if
(
orderServe
!=
null
)
{
BigDecimal
actualDiscountAmount
=
orderServe
.
getPayPrice
().
min
(
timesCardUsedRecord
.
getDiscountAmount
());
//更新次卡记录 已使用
timesCardUsedRecord
.
setStatus
(
TimesCardUsedRecord
.
STATUS_USED
);
//
//更新次卡记录 已使用
//
timesCardUsedRecord.setStatus(TimesCardUsedRecord.STATUS_USED);
//次卡对应订单服务的美甲师
timesCardUsedRecord
.
setTechnicianName
(
orderServe
.
getTechnicianName
());
//次卡店铺名称
...
...
@@ -408,15 +417,15 @@ public class MarketServiceImpl implements MarketService {
//业绩
orderServe
.
setAchievement
(
orderServe
.
getAchievement
().
subtract
(
actualDiscountAmount
).
add
(
timesCardUsedRecord
.
getPayAmount
()));
orderManage
.
addDiscountPrice
(
actualDiscountAmount
);
//更新使用次数
TimesCardCustomerRelevance
timesCardCustomerRelevance
=
timesCardCustomerRelevanceService
.
getById
(
timesCardUsedRecord
.
getCardRelevanceCustomerId
());
timesCardCustomerRelevance
.
setUsedTimes
(
timesCardCustomerRelevance
.
getUsedTimes
()
+
1
);
if
(
timesCardCustomerRelevance
.
getUsedTimes
().
equals
(
timesCardCustomerRelevance
.
getSumTimes
()))
{
//次数用完
timesCardCustomerRelevance
.
setStatus
(
2
);
}
timesCardCustomerRelevanceService
.
updateById
(
timesCardCustomerRelevance
);
//
//
//更新使用次数
//
TimesCardCustomerRelevance timesCardCustomerRelevance = timesCardCustomerRelevanceService.getById(timesCardUsedRecord.getCardRelevanceCustomerId());
//
timesCardCustomerRelevance.setUsedTimes(timesCardCustomerRelevance.getUsedTimes() + 1);
//
if (timesCardCustomerRelevance.getUsedTimes().equals(timesCardCustomerRelevance.getSumTimes())) {
//
//次数用完
//
timesCardCustomerRelevance.setStatus(2);
//
}
//
timesCardCustomerRelevanceService.updateById(timesCardCustomerRelevance);
}
else
{
throw
new
RRException
(
"次卡冲突"
);
}
...
...
@@ -1088,14 +1097,14 @@ public class MarketServiceImpl implements MarketService {
orderServe
.
setAchievement
(
orderServe
.
getAchievement
().
subtract
(
actualDiscountAmount
).
add
(
timesCardUsedRecord
.
getPayAmount
()));
orderManage
.
addDiscountPrice
(
actualDiscountAmount
);
//更新使用次数
TimesCardCustomerRelevance
timesCardCustomerRelevance
=
timesCardCustomerRelevanceService
.
getById
(
timesCardUsedRecord
.
getCardRelevanceCustomerId
());
timesCardCustomerRelevance
.
setUsedTimes
(
timesCardCustomerRelevance
.
getUsedTimes
()
+
1
);
if
(
timesCardCustomerRelevance
.
getUsedTimes
().
equals
(
timesCardCustomerRelevance
.
getSumTimes
()))
{
//次数用完
timesCardCustomerRelevance
.
setStatus
(
2
);
}
timesCardCustomerRelevanceService
.
updateById
(
timesCardCustomerRelevance
);
//
//更新使用次数
//
TimesCardCustomerRelevance timesCardCustomerRelevance = timesCardCustomerRelevanceService.getById(timesCardUsedRecord.getCardRelevanceCustomerId());
//
timesCardCustomerRelevance.setUsedTimes(timesCardCustomerRelevance.getUsedTimes() + 1);
//
if (timesCardCustomerRelevance.getUsedTimes().equals(timesCardCustomerRelevance.getSumTimes())) {
//
//次数用完
//
timesCardCustomerRelevance.setStatus(2);
//
}
//
timesCardCustomerRelevanceService.updateById(timesCardCustomerRelevance);
}
else
{
throw
new
RRException
(
"次卡冲突"
);
}
...
...
src/main/java/com/gogirl/interfaces/order/serve/OrderManageController.java
View file @
cbb74ab8
...
...
@@ -259,14 +259,14 @@ public class OrderManageController {
@ApiOperation
(
"重算业绩"
)
@GetMapping
(
"/technician/ordermanage/no_achievementReCalc/{orderId}"
)
public
JsonResult
<
Void
>
achievementReCalc
(
@PathVariable
Integer
orderId
)
{
marketService
.
achievementReCalc
(
orderId
);
//
marketService.achievementReCalc(orderId);
return
JsonResult
.
success
();
}
@ApiOperation
(
"重算订单金额"
)
@GetMapping
(
"/technician/ordermanage/no_calcOrderAmount/{orderId}"
)
public
JsonResult
<
Void
>
calcOrderAmount
(
@PathVariable
Integer
orderId
)
{
marketService
.
calcOrderAmount
(
orderId
);
//
marketService.calcOrderAmount(orderId);
return
JsonResult
.
success
();
}
}
\ No newline at end of file
src/test/java/com/gogirl/Test.java
View file @
cbb74ab8
...
...
@@ -703,4 +703,13 @@ public class Test {
marketService
.
orderAmountReCalc
(
13659
);
}
/**
* 重算订单金额
*/
@org
.
junit
.
Test
public
void
calcOrderAmount
()
{
marketService
.
calcOrderAmount
(
13659
);
}
}
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