修复团长取消拼团不完善的问题及其拼团下单的一个小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