|
|
|
@@ -239,6 +239,8 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService { |
|
|
|
return new ResultData(result); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = {Exception.class}) |
|
|
|
@Override |
|
|
|
public void updateGroupStatus(WxOrderGroup wxOrderGroup) { |
|
|
|
Long id = wxOrderGroup.getId(); |
|
|
|
WxOrderGroup group = wxOrderGroupMapper.selectByPrimaryKey(id); |
|
|
|
@@ -258,6 +260,11 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<WxOrderGroup> findList(WxOrderGroup group) { |
|
|
|
return wxOrderGroupMapper.select(group); |
|
|
|
} |
|
|
|
|
|
|
|
public void returnMoney(WxOrderGroup group) { |
|
|
|
//券失效或拼团超时 修改 拼团的状态 |
|
|
|
wxOrderGroupMapper.updateByPrimaryKeySelective(group); |
|
|
|
@@ -277,9 +284,12 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService { |
|
|
|
wxOrder.setOrderGroupId(group.getId()); |
|
|
|
List<WxOrder> list = wxOrderMapper.findList(wxOrder); |
|
|
|
for (WxOrder temp : list) { |
|
|
|
if (!temp.getOrderStatus().equals(EnumOrderStatus.ORDER_STATUS_REFUND_SUCCESS.getCode())) { |
|
|
|
if (temp.getOrderStatus().equals(EnumOrderStatus.ORDER_STATUS_COOPERATING_OVERTIME.getCode()) |
|
|
|
|| temp.getOrderStatus().equals(EnumOrderStatus.ORDER_STATUS_COOPERATING_CANCEL.getCode())) { |
|
|
|
ResultData resultData = WxRefundOrderService.returnMoney(appinfo, temp.getId()); |
|
|
|
logger.info("拼团不成功时的退款返回信息:" + resultData + "resultData.code == ResultData.SUCCESS" + (resultData.code == ResultData.SUCCESS)); |
|
|
|
if (resultData.code == ResultData.SUCCESS) { |
|
|
|
logger.info("修改订单的状态为已退款"); |
|
|
|
temp.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PENDING_REFUND.getCode()); |
|
|
|
wxOrderMapper.updateByPrimaryKeySelective(order); |
|
|
|
} |
|
|
|
|