Commit cbb74ab8 by huluobin

Merge branch 'master' into 3.7

# Conflicts:
#	src/test/java/com/gogirl/Test.java
parents ecce9ece f9241e29
......@@ -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("次卡冲突");
}
......
......@@ -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
......@@ -703,4 +703,13 @@ public class Test {
marketService.orderAmountReCalc(13659);
}
/**
* 重算订单金额
*/
@org.junit.Test
public void calcOrderAmount() {
marketService.calcOrderAmount(13659);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment