From f46687ac5de2f79a277efba1f3c1f9e224cbf623 Mon Sep 17 00:00:00 2001
From: 44323 <443237572@qq.com>
Date: 星期二, 30 一月 2024 16:43:05 +0800
Subject: [PATCH] 修改附近方圆报错

---
 guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/HousingDemandServiceImpl.java |   35 ++++++++++++++++++++---------------
 1 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/HousingDemandServiceImpl.java b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/HousingDemandServiceImpl.java
index 8a649e7..a0205b8 100644
--- a/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/HousingDemandServiceImpl.java
+++ b/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/HousingDemandServiceImpl.java
@@ -101,6 +101,11 @@
             housingDemand.setSaleAmount("0-500");
         }
         if (req.getType()==2){
+            this.insertOrUpdate(housingDemand);
+        }else{
+            this.insertOrUpdate(housingDemand);
+        }
+        if (req.getType()==2){
             if (StringUtils.hasLength(req.getWechatQRCode()))appUser.setWechatQrCode1(req.getWechatQRCode());
             if (StringUtils.hasLength(req.getWatchApp()))appUser.setWatchApp1(req.getWatchApp());
             if (StringUtils.hasLength(req.getPhone()))appUser.setPhone1(req.getPhone());
@@ -111,8 +116,10 @@
             try {
                 String url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + accessToken;
                 Map<String, Object> param = new HashMap<>();
-                param.put("path", "pages/home/home");
-//            param.put("page", "pages/index/index"); // 路径 如果没有默认跳转到首页面微信小程序发布后才可以使用不能添加参数
+                param.put("scene","id="+housingDemand.getId());
+                param.put("page", "pageA/housingDetails");
+                param.put("check_path", false);
+                param.put("env_version", "trial");
                 param.put("width", 200); //二维码尺寸
                 param.put("is_hyaline", true); // 是否需要透明底色, is_hyaline 为true时,生成透明底色的小程序码 参数仅对小程序码生效
                 param.put("auto_color", true); // 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 参数仅对小程序码生效
@@ -139,6 +146,7 @@
                 //获取文件的URl地址
                 String imgUrl = ossService.getImgUrl(objectName);
                 housingDemand.setQrCode(imgUrl);
+                this.baseMapper.updateById(housingDemand);
                 System.err.println("看看文件路径" + imgUrl);
             } catch (Exception e) {
                 System.err.println("调用小程序生成微信永久小程序码URL接口异常" + e);
@@ -160,9 +168,6 @@
                     return null;
                 }
             }
-            this.insertOrUpdate(housingDemand);
-        }else{
-            this.insertOrUpdate(housingDemand);
         }
         List<HousingDemandDistrict> list = new ArrayList<>();
         if(ToolUtil.isNotEmpty(req.getDistrict())){
@@ -185,9 +190,9 @@
         if(list.size() > 0){
             housingDemandDistrictService.insertBatch(list);
         }
+
         return ResultUtil.success();
     }
-
 
     /**
      * 搜索求房源列表数据
@@ -417,7 +422,7 @@
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
         HousingDemand housingDemand = this.selectById(id);
         HousingDemandInfoRes housingDemandInfoRes = new HousingDemandInfoRes();
-        AppUser appUser = appUserService.getAppUser();
+//        AppUser appUser = appUserService.getAppUser();
         housingDemandInfoRes.setId(id);
         housingDemandInfoRes.setDataType(housingDemand.getDataType());
         housingDemandInfoRes.setQrCode(housingDemand.getQrCode());
@@ -525,15 +530,15 @@
         int collectionTimes = collectionHousingDemandService.selectCount(new EntityWrapper<CollectionHousingDemand>().eq("housing_demand_id", id));
         housingDemandInfoRes.setCollectionTimes(collectionTimes);
         housingDemandInfoRes.setCollection(0);
-        if(null != appUser){
-            int collection = collectionHousingDemandService
-                    .selectCount(new EntityWrapper<CollectionHousingDemand>()
-                            .eq("housing_demand_id", id)
-                            .eq("app_user_id", appUser.getId()));
-            housingDemandInfoRes.setCollection(0 == collection ? 0 : 1);
-        }
+//        if(null != appUser){
+//            int collection = collectionHousingDemandService
+//                    .selectCount(new EntityWrapper<CollectionHousingDemand>()
+//                            .eq("housing_demand_id", id)
+//                            .eq("app_user_id", appUser.getId()));
+//            housingDemandInfoRes.setCollection(0 == collection ? 0 : 1);
+//        }
         //添加访问次数记录
-        addViewsNumber(housingDemand);
+//        addViewsNumber(housingDemand);
         return housingDemandInfoRes;
     }
 

--
Gitblit v1.7.1