|
|
|
@@ -12,6 +12,8 @@ import com.iformall.domain.po.WxCampaign; |
|
|
|
import com.iformall.domain.po.WxCouponChannel; |
|
|
|
import com.iformall.domain.po.WxScreenAd; |
|
|
|
import com.iformall.domain.vo.WxCouponCVo; |
|
|
|
import com.iformall.enums.EnumCouponChannelType; |
|
|
|
import com.iformall.enums.EnumCouponType; |
|
|
|
import com.iformall.enums.EnumScreenAdType; |
|
|
|
import com.iformall.mapper.WxCampaignMapper; |
|
|
|
import com.iformall.mapper.WxCouponChannelMapper; |
|
|
|
@@ -143,6 +145,7 @@ public class WxScreenAdServiceImpl implements WxScreenAdService { |
|
|
|
try { |
|
|
|
record.setQrcode(getQrcode(record.getTargetId(), |
|
|
|
record.getType().intValue(), |
|
|
|
record.getSubType().intValue(), |
|
|
|
wxAppinfoService.getCAppInfo(record.getTenantId()))); |
|
|
|
}catch (Exception e) { |
|
|
|
logger.error("QRCODE set Error:"+e.getMessage()); |
|
|
|
@@ -157,8 +160,9 @@ public class WxScreenAdServiceImpl implements WxScreenAdService { |
|
|
|
|
|
|
|
private static String QRCODE_JUMP_CMD_HOME = "JH"; |
|
|
|
private static String QRCODE_JUMP_CMD_COUPON = "JC"; |
|
|
|
private static String QRCODE_JUMP_CMD_GROUP = "JG"; |
|
|
|
private static String QRCODE_JUMP_CMD_CAMPGIN = "JB"; |
|
|
|
private byte[] getQrcode(Long id, int type, WxAppinfo appInfo) throws Exception { |
|
|
|
private byte[] getQrcode(Long id, int type, int subType, WxAppinfo appInfo) throws Exception { |
|
|
|
if(appInfo == null) { |
|
|
|
logger.error("QRCODE get error: appinfo is null"); |
|
|
|
return null; |
|
|
|
@@ -166,8 +170,13 @@ public class WxScreenAdServiceImpl implements WxScreenAdService { |
|
|
|
WxMaService wxMaService = MaUtil.getWeappService(appInfo); |
|
|
|
|
|
|
|
String scene = ""; |
|
|
|
if (EnumScreenAdType.COUPON.getCode().equals(type)) |
|
|
|
scene = QRCODE_JUMP_CMD_COUPON+":"+id.toString(); |
|
|
|
if (EnumScreenAdType.COUPON.getCode().equals(type)) { |
|
|
|
if (EnumCouponChannelType.COUPON_CHANNEL_ID_ORDER_GROUP.getCode().equals(subType)) { |
|
|
|
scene = QRCODE_JUMP_CMD_GROUP + ":" + id.toString(); |
|
|
|
} else { |
|
|
|
scene = QRCODE_JUMP_CMD_COUPON + ":" + id.toString(); |
|
|
|
} |
|
|
|
} |
|
|
|
else if (EnumScreenAdType.CAMPAIGN.getCode().equals(type)) |
|
|
|
scene = QRCODE_JUMP_CMD_CAMPGIN+":"+id.toString(); |
|
|
|
else |
|
|
|
|