修复团长取消拼团不完善的问题及其拼团下单的一个小bug

This commit is contained in:
hupeng
2019-11-22 20:38:26 +08:00
parent 19c1b912f7
commit 1218de3ca1
7 changed files with 52 additions and 12 deletions

View File

@ -56,6 +56,7 @@ public class YxStoreCombinationServiceImpl extends BaseServiceImpl<YxStoreCombin
* @param combinationId
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void decStockIncSales(int num, int combinationId) {
yxStoreCombinationMapper.decStockIncSales(num,combinationId);
}

View File

@ -95,12 +95,41 @@ public class YxStorePinkServiceImpl extends BaseServiceImpl<YxStorePinkMapper, Y
throw new ErrorRequestException("拼团已完成,无法取消");
}
//如果团长取消拼团,团队还有人,就把后面的人作为下一任团长
YxStorePink nextPinkT = pinkAll.get(0);
//先退团长的money
RefundParam param = new RefundParam();
param.setUni(pinkT.getOrderId());
param.setText("拼团取消开团");
storeOrderService.orderApplyRefund(param,pinkT.getUid());
orderPinkFailAfter(pinkT.getUid(),pinkT.getId());
if(ObjectUtil.isNotNull(nextPinkT)){
QueryWrapper<YxStorePink> wrapperO = new QueryWrapper<>();
YxStorePink storePinkO = new YxStorePink();
storePinkO.setKId(0);
storePinkO.setStatus(1);
storePinkO.setStopTime(OrderUtil.getSecondTimestampTwo()+"");
storePinkO.setId(nextPinkT.getId());
yxStorePinkMapper.updateById(storePinkO);
//原有团长的数据变更成新团长下面
wrapperO.eq("k_id",pinkT.getId());
YxStorePink storePinkT = new YxStorePink();
storePinkT.setKId(nextPinkT.getId());
yxStorePinkMapper.update(storePinkT,wrapperO);
//update order
YxStoreOrder storeOrder = new YxStoreOrder();
storeOrder.setPinkId(nextPinkT.getId());
storeOrder.setId(nextPinkT.getId());
storeOrderService.updateById(storeOrder);
}
}
/**

View File

@ -137,6 +137,8 @@ public class YxStoreOrderServiceImpl extends BaseServiceImpl<YxStoreOrderMapper,
@Autowired
private DelayJobService delayJobService;
@Autowired
private YxStoreCombinationService combinationService;
@Autowired

View File

@ -5,10 +5,10 @@ spring:
type: com.alibaba.druid.pool.DruidDataSource
#driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
url: jdbc:p6spy:mysql://106.12.82.39:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
url: jdbc:p6spy:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
#url: jdbc:log4jdbc:mysql://localhost:3306/yxshop?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false
username: root
password: Admin@123
password: root
# 初始化配置
initial-size: 3
@ -47,7 +47,7 @@ spring:
database: 0
host: 127.0.0.1
port: 6379
password: root
password:
#连接超时时间
timeout: 5000

View File

@ -59,7 +59,7 @@ wx:
pay:
appId: wxc061dee8806ff712
mchId:
mchKey:
mchKey: dayouqiantuhupeng8638004yixiangt
subAppId:
subMchId:
keyPath: