|
@@ -220,38 +220,6 @@ public class MiniAppServiceImpl implements IMiniAppService {
|
220
|
220
|
return taMiniappList;
|
221
|
221
|
}
|
222
|
222
|
|
223
|
|
- @Override
|
224
|
|
- public TaMiniappQrcode createActivityQrcode(String miniappId) {
|
225
|
|
-
|
226
|
|
- TaMiniappQrcode taQrcode = new TaMiniappQrcode();
|
227
|
|
- taQrcode.setAppid(miniappId);
|
228
|
|
- taQrcode.setCreateDate(LocalDateTime.now());
|
229
|
|
- taQrcode.setExpireDate(LocalDateTime.now().plusDays(7));
|
230
|
|
- taMiniappQrcodeMapper.insert(taQrcode);
|
231
|
|
- // 使用serialNo作为场景值替换当前的ID
|
232
|
|
- String replace = CommConstant.ACTIVITY_QRCODE.replace("#0",String.valueOf(taQrcode.getSerialNo())).replace("#1","activity");
|
233
|
|
-
|
234
|
|
- WxMaService wxService = wxUtils.getMiniApp(miniappId);
|
235
|
|
- JSONObject params = JSONObject.parseObject(replace);
|
236
|
|
- String scene = params.getString("scene");
|
237
|
|
- String page = StringUtils.ifNull(params.getString("page"), "");
|
238
|
|
- String lineColorStr = StringUtils.ifNull(params.getString("line_color"), "{\"r\":0,\"g\":0,\"b\":0}");
|
239
|
|
- WxMaCodeLineColor lineColor = JSONObject.parseObject(lineColorStr, WxMaCodeLineColor.class);
|
240
|
|
- try {
|
241
|
|
-
|
242
|
|
- File qrFile = wxService.getQrcodeService().createWxaCodeUnlimit(scene, page, 430, true, lineColor, true);
|
243
|
|
- String qrcode = AliOSSUtils.putObject(qrFile, CommConstant.ALIOSS_DEFAULT_UPLOAD);
|
244
|
|
- taQrcode.setQrParams(replace);
|
245
|
|
- taQrcode.setQrCode(qrcode);
|
246
|
|
- taMiniappQrcodeMapper.updateById(taQrcode);
|
247
|
|
- return taQrcode;
|
248
|
|
- }catch (Exception e) {
|
249
|
|
- e.printStackTrace();
|
250
|
|
- log.error("活动二维码生成失败", e);
|
251
|
|
- }
|
252
|
|
- return taQrcode;
|
253
|
|
- }
|
254
|
|
-
|
255
|
223
|
private void sendMessage(String tplName, TaPerson toUser, String link, List<WxMaTemplateData> data) {
|
256
|
224
|
String appid = toUser.getMiniappId();
|
257
|
225
|
if (StringUtils.isEmpty(appid)) {
|