|
|
|
@@ -72,21 +72,21 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { |
|
|
|
@Override |
|
|
|
public PageInfo<WxCouponSendVo> listAsPage(WxCouponSend record, Integer pageIndex, Integer pageSize) { |
|
|
|
PageInfo<WxCouponSendVo> pageInfo; |
|
|
|
/** |
|
|
|
* 设置商户购买券数 |
|
|
|
* 前端排序:时间、商户总库存、商户已发数、商户剩余 |
|
|
|
*/ |
|
|
|
/** |
|
|
|
* 设置商户购买券数 |
|
|
|
* 前端排序:时间、商户总库存、商户已发数、商户剩余 |
|
|
|
*/ |
|
|
|
if (Objects.equals(EnumCouponSendSendType.MERCHANT.getCode(), record.getSendType())) { |
|
|
|
String sortStr = null; |
|
|
|
if (Objects.equals(record.getSortColumn(), WxCouponSend.SORT_MERCHANT_LNVENTORY) || |
|
|
|
Objects.equals(record.getSortColumn(), WxCouponSend.SORT_MERCHANT_SEND) || |
|
|
|
if (Objects.equals(record.getSortColumn(), WxCouponSend.SORT_MERCHANT_LNVENTORY) || |
|
|
|
Objects.equals(record.getSortColumn(), WxCouponSend.SORT_MERCHANT_SEND) || |
|
|
|
Objects.equals(record.getSortColumn(), WxCouponSend.SORT_REMAIN)) { |
|
|
|
sortStr = record.getSortColumn() + " " + record.getSortOrder(); |
|
|
|
} else if (Objects.equals(record.getSortColumn(), "createDate")) { |
|
|
|
sortStr = "create_date" + " " + record.getSortOrder(); |
|
|
|
} |
|
|
|
record.setSortColumn(null); |
|
|
|
record.setSortCol(sortStr); |
|
|
|
record.setSortColumn(null); |
|
|
|
record.setSortCol(sortStr); |
|
|
|
pageInfo = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCouponSendMapper.findListVoByValidType(record)); |
|
|
|
for (WxCouponSendVo cs : pageInfo.getList()) { |
|
|
|
JSONObject jo = JSONObject.parseObject(cs.getConditions()); |
|
|
|
@@ -375,7 +375,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { |
|
|
|
if (couponOrder != null) { |
|
|
|
bRet = true; |
|
|
|
|
|
|
|
wxCouponActionLogService.addOne(couponOrder, send.getCouponId(), couponOrder.getId(), type.getCode(), send.getId()); |
|
|
|
wxCouponActionLogService.addOne(couponOrder, send.getCouponId(), couponOrder.getId(), type.getCode(), send.getId(),0L); |
|
|
|
|
|
|
|
// 发送消息 |
|
|
|
if (couponOrder != null) { |
|
|
|
@@ -430,8 +430,8 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { |
|
|
|
List<WxAppinfo> appList = wxAppinfoService.getList(appinfoQ); |
|
|
|
appName = appList.get(0).getName(); |
|
|
|
}else { |
|
|
|
WxAppinfo appInfo = wxAppinfoService.getCAppInfo(tenantEntity,payw); |
|
|
|
appName = appInfo.getName(); |
|
|
|
WxAppinfo appInfo = wxAppinfoService.getCAppInfo(tenantEntity,payw); |
|
|
|
appName = appInfo.getName(); |
|
|
|
} |
|
|
|
Map<String, String> msgReplaceMap = new HashMap(); |
|
|
|
msgReplaceMap.put("title", title); |
|
|
|
@@ -628,7 +628,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) |
|
|
|
public void handSel(WxCouponSend wxCouponSend, Long cUserId,EnumPayWay payWay) { |
|
|
|
public void handSel(WxCouponSend wxCouponSend, Long cUserId,EnumPayWay payWay,Long bUserId) { |
|
|
|
|
|
|
|
WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoMapper.selectById(cUserId,wxCouponSend.getFinalTenantId()); |
|
|
|
if (Objects.isNull(wxCUserBasicInfo)) { |
|
|
|
@@ -643,7 +643,7 @@ public class WxCouponSendServiceImpl implements WxCouponSendService { |
|
|
|
// 发放免费券 |
|
|
|
WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cUserId,cs, cs.getCouponId(), cs,payWay); |
|
|
|
if (couponOrder != null) { |
|
|
|
wxCouponActionLogService.addOne(couponOrder, cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); |
|
|
|
wxCouponActionLogService.addOne(couponOrder, cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId(),bUserId); |
|
|
|
sendMsgForSendCoupon(couponOrder, cs, couponOrder, wxCUserBasicInfo); |
|
|
|
} else { |
|
|
|
logger.warn("handSel couponOrder is null"); |
|
|
|
|