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