顾绍勇 5 år sedan
förälder
incheckning
109c6b1ea6

+ 2
- 0
src/main/java/com/huiju/estateagents/entity/TaMiniappQrcode.java Visa fil

@@ -55,4 +55,6 @@ public class TaMiniappQrcode implements Serializable {
55 55
      */
56 56
     private String qrCode;
57 57
 
58
+    private Integer targetId;
59
+
58 60
 }

+ 13
- 3
src/main/java/com/huiju/estateagents/service/impl/MiniAppServiceImpl.java Visa fil

@@ -335,15 +335,21 @@ public class MiniAppServiceImpl implements IMiniAppService {
335 335
         String scene = params.getString("scene");
336 336
         String page = StringUtils.ifNull(params.getString("page"), "");
337 337
         Integer width = params.getInteger("width");
338
-        if (null == width) width = 430;
338
+        if (null == width) {
339
+            width = 430;
340
+        }
339 341
 
340 342
         Boolean autoColor = params.getBoolean("auto_color");
341
-        if (null == autoColor) autoColor = false;
343
+        if (null == autoColor) {
344
+            autoColor = false;
345
+        }
342 346
 
343 347
         String lineColorStr = StringUtils.ifNull(params.getString("line_color"), "{\"r\":0,\"g\":0,\"b\":0}");
344 348
         WxMaCodeLineColor lineColor = JSONObject.parseObject(lineColorStr, WxMaCodeLineColor.class);
345 349
         Boolean isHyaline = params.getBoolean("is_hyaline");
346
-        if (null == isHyaline) isHyaline = true;
350
+        if (null == isHyaline) {
351
+            isHyaline = true;
352
+        }
347 353
 
348 354
         try {
349 355
 
@@ -352,6 +358,10 @@ public class MiniAppServiceImpl implements IMiniAppService {
352 358
             taQrcode.setCreateDate(LocalDateTime.now());
353 359
             taQrcode.setExpireDate(LocalDateTime.now().plusDays(7));
354 360
             taQrcode.setQrParams(paramsStr);
361
+            JSONObject sceneObj = JSONObject.parseObject(scene);
362
+            if (!StringUtils.isEmpty(sceneObj.getString("qrCodeId"))) {
363
+                taQrcode.setTargetId(Integer.parseInt(sceneObj.getString("qrCodeId")));
364
+            }
355 365
 
356 366
             boolean success = taMiniappQrcodeMapper.insert(taQrcode) > 0;
357 367
             if (!success) {