merge conflict origin/master
This commit is contained in:
commit
4dc183cdf5
@ -154,14 +154,11 @@ public class StockUpdateExecute implements OrderStatusChangeEvent {
|
|||||||
* @param stocks
|
* @param stocks
|
||||||
*/
|
*/
|
||||||
private void checkStocks(List<Integer> stocks, OrderDetailVO order) {
|
private void checkStocks(List<Integer> stocks, OrderDetailVO order) {
|
||||||
for (int i = 0; i < stocks.size(); i++) {
|
if (order.getOrderItems().size() == stocks.size()) {
|
||||||
if (null == stocks.get(i)) {
|
return;
|
||||||
initSkuCache(order.getOrderItems());
|
|
||||||
initPromotionCache(order.getOrderItems());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
initSkuCache(order.getOrderItems());
|
||||||
|
initPromotionCache(order.getOrderItems());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -165,6 +165,12 @@
|
|||||||
<artifactId>jasypt-spring-boot-starter</artifactId>
|
<artifactId>jasypt-spring-boot-starter</artifactId>
|
||||||
<version>${jasypt-version}</version>
|
<version>${jasypt-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.redisson</groupId>
|
||||||
|
<artifactId>redisson</artifactId>
|
||||||
|
<version>${redisson}</version>
|
||||||
|
</dependency>
|
||||||
<!-- 阿里云核心包-->
|
<!-- 阿里云核心包-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.aliyun</groupId>
|
<groupId>com.aliyun</groupId>
|
||||||
|
@ -19,6 +19,8 @@ import cn.lili.modules.wallet.entity.dto.MemberWalletUpdateDTO;
|
|||||||
import cn.lili.modules.wallet.entity.enums.DepositServiceTypeEnum;
|
import cn.lili.modules.wallet.entity.enums.DepositServiceTypeEnum;
|
||||||
import cn.lili.modules.wallet.service.MemberWalletService;
|
import cn.lili.modules.wallet.service.MemberWalletService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.redisson.api.RLock;
|
||||||
|
import org.redisson.api.RedissonClient;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@ -57,9 +59,11 @@ public class WalletPlugin implements Payment {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private CashierSupport cashierSupport;
|
private CashierSupport cashierSupport;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private RedissonClient redisson;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResultMessage<Object> h5pay(HttpServletRequest request, HttpServletResponse response, PayParam payParam) {
|
public ResultMessage<Object> h5pay(HttpServletRequest request, HttpServletResponse response, PayParam payParam) {
|
||||||
|
|
||||||
savePaymentLog(payParam);
|
savePaymentLog(payParam);
|
||||||
return ResultUtil.success(ResultCode.PAY_SUCCESS);
|
return ResultUtil.success(ResultCode.PAY_SUCCESS);
|
||||||
}
|
}
|
||||||
@ -113,9 +117,18 @@ public class WalletPlugin implements Payment {
|
|||||||
* @param payParam 支付参数
|
* @param payParam 支付参数
|
||||||
*/
|
*/
|
||||||
private void savePaymentLog(PayParam payParam) {
|
private void savePaymentLog(PayParam payParam) {
|
||||||
//获取支付收银参数
|
//同一个会员如果在不同的客户端使用预存款支付,会存在同时支付,无法保证预存款的正确性,所以对会员加锁
|
||||||
CashierParam cashierParam = cashierSupport.cashierParam(payParam);
|
RLock lock = redisson.getLock(UserContext.getCurrentUser().getId() + "");
|
||||||
this.callBack(payParam, cashierParam);
|
lock.lock();
|
||||||
|
try {
|
||||||
|
//获取支付收银参数
|
||||||
|
CashierParam cashierParam = cashierSupport.cashierParam(payParam);
|
||||||
|
this.callBack(payParam, cashierParam);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw e;
|
||||||
|
} finally {
|
||||||
|
lock.unlock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package cn.lili.controller.sms;
|
package cn.lili.controller.sms;
|
||||||
|
|
||||||
|
import cn.lili.common.aop.annotation.DemoSite;
|
||||||
import cn.lili.common.enums.ResultUtil;
|
import cn.lili.common.enums.ResultUtil;
|
||||||
import cn.lili.common.vo.PageVO;
|
import cn.lili.common.vo.PageVO;
|
||||||
import cn.lili.common.vo.ResultMessage;
|
import cn.lili.common.vo.ResultMessage;
|
||||||
@ -29,21 +30,24 @@ public class SmsTemplateManagerController {
|
|||||||
|
|
||||||
@ApiOperation(value = "新增短信模板")
|
@ApiOperation(value = "新增短信模板")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
|
@DemoSite
|
||||||
public ResultMessage<SmsTemplate> save(@Valid SmsTemplate smsTemplate) {
|
public ResultMessage<SmsTemplate> save(@Valid SmsTemplate smsTemplate) {
|
||||||
smsTemplateService.addSmsTemplate(smsTemplate);
|
smsTemplateService.addSmsTemplate(smsTemplate);
|
||||||
return ResultUtil.success();
|
return ResultUtil.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "删除短信模板")
|
@ApiOperation(value = "删除短信模板")
|
||||||
@ApiImplicitParam(name = "id", value = "短信模板ID", required = true, paramType = "path")
|
@ApiImplicitParam(name = "templateCode", value = "短信模板CODE", required = true, paramType = "query")
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping
|
||||||
public ResultMessage<SmsTemplate> delete(@PathVariable("id") String id) {
|
@DemoSite
|
||||||
smsTemplateService.deleteSmsTemplate(id);
|
public ResultMessage<SmsTemplate> delete(String templateCode) {
|
||||||
|
smsTemplateService.deleteSmsTemplate(templateCode);
|
||||||
return ResultUtil.success();
|
return ResultUtil.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "查询短信模板状态")
|
@ApiOperation(value = "查询短信模板状态")
|
||||||
@PutMapping("/querySmsSign")
|
@PutMapping("/querySmsSign")
|
||||||
|
@DemoSite
|
||||||
public ResultMessage<SmsTemplate> querySmsSign() {
|
public ResultMessage<SmsTemplate> querySmsSign() {
|
||||||
smsTemplateService.querySmsTemplate();
|
smsTemplateService.querySmsTemplate();
|
||||||
return ResultUtil.success();
|
return ResultUtil.success();
|
||||||
@ -51,6 +55,7 @@ public class SmsTemplateManagerController {
|
|||||||
|
|
||||||
@ApiOperation(value = "修改短信模板")
|
@ApiOperation(value = "修改短信模板")
|
||||||
@PutMapping("/modifySmsTemplate")
|
@PutMapping("/modifySmsTemplate")
|
||||||
|
@DemoSite
|
||||||
public ResultMessage<SmsTemplate> modifySmsTemplate(@Valid SmsTemplate smsTemplate) {
|
public ResultMessage<SmsTemplate> modifySmsTemplate(@Valid SmsTemplate smsTemplate) {
|
||||||
smsTemplateService.modifySmsTemplate(smsTemplate);
|
smsTemplateService.modifySmsTemplate(smsTemplate);
|
||||||
return ResultUtil.success();
|
return ResultUtil.success();
|
||||||
|
@ -50,10 +50,11 @@ class SeckillTest {
|
|||||||
System.out.println(setting);
|
System.out.println(setting);
|
||||||
SeckillSetting seckillSetting = new Gson().fromJson(setting.getSettingValue(), SeckillSetting.class);
|
SeckillSetting seckillSetting = new Gson().fromJson(setting.getSettingValue(), SeckillSetting.class);
|
||||||
System.out.println(seckillSetting);
|
System.out.println(seckillSetting);
|
||||||
Seckill seckill = new Seckill(SeckillService.PRE_CREATION, seckillSetting.getHours(), seckillSetting.getSeckillRule());
|
boolean result = true;
|
||||||
System.out.println(seckill);
|
for (int i = 1; i <= SeckillService.PRE_CREATION; i++) {
|
||||||
boolean result = seckillService.savePromotions(seckill);
|
Seckill seckill = new Seckill(i, seckillSetting.getHours(), seckillSetting.getSeckillRule());
|
||||||
System.out.println(result);
|
seckillService.savePromotions(seckill);
|
||||||
|
}
|
||||||
Assertions.assertTrue(result);
|
Assertions.assertTrue(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
pom.xml
4
pom.xml
@ -31,6 +31,10 @@
|
|||||||
<jasypt-version>3.0.4</jasypt-version>
|
<jasypt-version>3.0.4</jasypt-version>
|
||||||
<neetl-version>2.9.10</neetl-version>
|
<neetl-version>2.9.10</neetl-version>
|
||||||
<lombok-version>1.18.22</lombok-version>
|
<lombok-version>1.18.22</lombok-version>
|
||||||
|
<redisson>3.5.5</redisson>
|
||||||
|
<aliyun-version>4.5.18</aliyun-version>
|
||||||
|
<aliyun-sdk-oss-version>3.11.1</aliyun-sdk-oss-version>
|
||||||
|
<aliyun-sdk-dysms-version>2.0.8</aliyun-sdk-dysms-version>
|
||||||
<aliyun-version>4.6.0</aliyun-version>
|
<aliyun-version>4.6.0</aliyun-version>
|
||||||
<aliyun-sdk-oss-version>3.14.0</aliyun-sdk-oss-version>
|
<aliyun-sdk-oss-version>3.14.0</aliyun-sdk-oss-version>
|
||||||
<aliyun-sdk-dysms-version>2.0.9</aliyun-sdk-dysms-version>
|
<aliyun-sdk-dysms-version>2.0.9</aliyun-sdk-dysms-version>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user