|
|
|
@@ -160,7 +160,25 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageInfo<Map<String, Object>> queryOrderGroup(WxOrder wxOrder, Integer pageIndex, Integer pageSize) { |
|
|
|
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxOrderGroupMapper.queryOrderGroup(wxOrder)); |
|
|
|
PageHelper.startPage(pageIndex, pageSize); |
|
|
|
List<Map<String, Object>> result = wxOrderGroupMapper.queryOrderGroup(wxOrder); |
|
|
|
//更新状态 |
|
|
|
updateOrderGroupStatus(result); |
|
|
|
PageHelper.startPage(pageIndex, pageSize); |
|
|
|
result = wxOrderGroupMapper.queryOrderGroup(wxOrder); |
|
|
|
PageInfo<Map<String, Object>> pageInfo = new PageInfo<>(result); |
|
|
|
return pageInfo; |
|
|
|
} |
|
|
|
|
|
|
|
private void updateOrderGroupStatus(List<Map<String, Object>> result) { |
|
|
|
for (Map<String, Object> group : result) { |
|
|
|
WxOrderGroup wxOrderGroup = new WxOrderGroup(); |
|
|
|
wxOrderGroup.setId((Long) group.get("orderGroupId")); |
|
|
|
wxOrderGroup.setTenantId(group.get("tenantId").toString()); |
|
|
|
wxOrderGroup.setCouponId((Long) group.get("couponId")); |
|
|
|
wxOrderGroup.setOrderId((Long) group.get("orderId")); |
|
|
|
updateGroupStatus(wxOrderGroup); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@@ -204,6 +222,11 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public ResultData queryOrderGroupStatus(WxOrderGroup wxOrderGroup) { |
|
|
|
updateGroupStatus(wxOrderGroup); |
|
|
|
return toOrderGroup(wxOrderGroup); |
|
|
|
} |
|
|
|
|
|
|
|
public void updateGroupStatus(WxOrderGroup wxOrderGroup) { |
|
|
|
Long id = wxOrderGroup.getId(); |
|
|
|
WxOrderGroup group = wxOrderGroupMapper.selectByPrimaryKey(id); |
|
|
|
WxCoupon wxCoupon = wxCouponMapper.selectByPrimaryKey(wxOrderGroup.getCouponId()); |
|
|
|
@@ -218,7 +241,6 @@ public class WxOrderGroupServiceImpl implements WxOrderGroupService { |
|
|
|
group.setStatus(EnumOrderStatus.ORDER_STATUS_COOPERATING_OVERTIME.getCode()); |
|
|
|
returnMoney(group); |
|
|
|
} |
|
|
|
return toOrderGroup(wxOrderGroup); |
|
|
|
} |
|
|
|
|
|
|
|
public void returnMoney(WxOrderGroup group) { |
|
|
|
|