From 59f63a8ef0078b06f010d25abfef2772c944a56f Mon Sep 17 00:00:00 2001
From: luo <2855143437@qq.com>
Date: 星期二, 02 一月 2024 15:11:52 +0800
Subject: [PATCH] 1.2

---
 guns-management/src/main/java/com/stylefeng/guns/modular/system/service/impl/HouseResourceService.java |   10 ++-
 guns-management/pom.xml                                                                                |   66 ++++++++++++++++++++++
 guns-admin/pom.xml                                                                                     |   56 +++++++++---------
 3 files changed, 100 insertions(+), 32 deletions(-)

diff --git a/guns-admin/pom.xml b/guns-admin/pom.xml
index b738570..a3d0ca2 100644
--- a/guns-admin/pom.xml
+++ b/guns-admin/pom.xml
@@ -13,7 +13,7 @@
     <name>guns-admin</name>
     <description>guns 的spring boot版本</description>
 
-    <packaging>war</packaging>
+    <packaging>jar</packaging>
 
     <dependencies>
         <dependency>
@@ -268,39 +268,39 @@
 
     <build>
         <!--打包jar包方式-->
-        <!--<plugins>-->
-            <!--<plugin>-->
-                <!--<groupId>org.springframework.boot</groupId>-->
-                <!--<artifactId>spring-boot-maven-plugin</artifactId>-->
-                <!--<configuration>-->
-                    <!--<fork>true</fork>&lt;!&ndash; 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart &ndash;&gt;-->
-                <!--</configuration>-->
-            <!--</plugin>-->
-        <!--</plugins>-->
-
-        <!--打包war包引入本地jar的打包方式-->
         <plugins>
             <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-war-plugin</artifactId>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
                 <configuration>
-                    <!-- 设置成false,否则检查web.xml是否存在。因为springboot是没有web.xml的 -->
-                    <failOnMissingWebXml>false</failOnMissingWebXml>
-                    <!--打包后的项目名-->
-                    <!--<warName>example</warName>-->
-                    <webResources>
-                        <resource>
-                            <!--把本地lib里面的jar复制到lib-->
-                            <directory>${project.basedir}/lib</directory>
-                            <targetPath>WEB-INF/lib/</targetPath>
-                            <includes>
-                                <include>**/*.jar</include>
-                            </includes>
-                        </resource>
-                    </webResources>
+                    <fork>true</fork><!-- 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart -->
                 </configuration>
             </plugin>
         </plugins>
+
+        <!--打包war包引入本地jar的打包方式-->
+<!--        <plugins>-->
+<!--            <plugin>-->
+<!--                <groupId>org.apache.maven.plugins</groupId>-->
+<!--                <artifactId>maven-war-plugin</artifactId>-->
+<!--                <configuration>-->
+<!--                    &lt;!&ndash; 设置成false,否则检查web.xml是否存在。因为springboot是没有web.xml的 &ndash;&gt;-->
+<!--                    <failOnMissingWebXml>false</failOnMissingWebXml>-->
+<!--                    &lt;!&ndash;打包后的项目名&ndash;&gt;-->
+<!--                    &lt;!&ndash;<warName>example</warName>&ndash;&gt;-->
+<!--                    <webResources>-->
+<!--                        <resource>-->
+<!--                            &lt;!&ndash;把本地lib里面的jar复制到lib&ndash;&gt;-->
+<!--                            <directory>${project.basedir}/lib</directory>-->
+<!--                            <targetPath>WEB-INF/lib/</targetPath>-->
+<!--                            <includes>-->
+<!--                                <include>**/*.jar</include>-->
+<!--                            </includes>-->
+<!--                        </resource>-->
+<!--                    </webResources>-->
+<!--                </configuration>-->
+<!--            </plugin>-->
+<!--        </plugins>-->
         <resources>
             <resource>
                 <directory>src/main/webapp</directory>
diff --git a/guns-management/pom.xml b/guns-management/pom.xml
index a36149a..38772f6 100644
--- a/guns-management/pom.xml
+++ b/guns-management/pom.xml
@@ -279,8 +279,74 @@
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-data-mongodb</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.alipay.sdk</groupId>
+            <artifactId>alipay-sdk-java</artifactId>
+            <version>4.8.10.ALL</version>
+        </dependency>
     </dependencies>
 
+    <packaging>jar</packaging>
+
+    <build>
+<!--        打包jar包方式-->
+        <plugins>
+        <plugin>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-maven-plugin</artifactId>
+        <configuration>
+        <fork>true</fork><!-- 如果没有该项配置,肯呢个devtools不会起作用,即应用不会restart -->
+        </configuration>
+        </plugin>
+        </plugins>
+
+        <!--打包war包引入本地jar的打包方式-->
+<!--        <plugins>-->
+<!--            <plugin>-->
+<!--                <groupId>org.apache.maven.plugins</groupId>-->
+<!--                <artifactId>maven-war-plugin</artifactId>-->
+<!--                <configuration>-->
+<!--                    &lt;!&ndash; 设置成false,否则检查web.xml是否存在。因为springboot是没有web.xml的 &ndash;&gt;-->
+<!--                    <failOnMissingWebXml>false</failOnMissingWebXml>-->
+<!--                    &lt;!&ndash;打包后的项目名&ndash;&gt;-->
+<!--                    &lt;!&ndash;<warName>example</warName>&ndash;&gt;-->
+<!--                    <webResources>-->
+<!--                        <resource>-->
+<!--                            &lt;!&ndash;把本地lib里面的jar复制到lib&ndash;&gt;-->
+<!--                            <directory>${project.basedir}/lib</directory>-->
+<!--                            <targetPath>WEB-INF/lib/</targetPath>-->
+<!--                            <includes>-->
+<!--                                <include>**/*.jar</include>-->
+<!--                            </includes>-->
+<!--                        </resource>-->
+<!--                    </webResources>-->
+<!--                </configuration>-->
+<!--            </plugin>-->
+<!--        </plugins>-->
+        <resources>
+            <resource>
+                <directory>src/main/webapp</directory>
+            </resource>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+            <resource>
+                <directory>src/main/java</directory>
+                <includes>
+                    <include>**/*.xml</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>lib</directory>
+                <targetPath>BOOT-INF/lib/</targetPath>
+                <includes>
+                    <include>**/*.jar</include>
+                </includes>
+            </resource>
+        </resources>
+    </build>
+
     <groupId>com.management</groupId>
     <artifactId>guns-management</artifactId>
 
diff --git a/guns-management/src/main/java/com/stylefeng/guns/modular/system/service/impl/HouseResourceService.java b/guns-management/src/main/java/com/stylefeng/guns/modular/system/service/impl/HouseResourceService.java
index 75ca982..c90e436 100644
--- a/guns-management/src/main/java/com/stylefeng/guns/modular/system/service/impl/HouseResourceService.java
+++ b/guns-management/src/main/java/com/stylefeng/guns/modular/system/service/impl/HouseResourceService.java
@@ -392,10 +392,12 @@
         OutputStream outputStream = null;
         String accessToken = wxAppletTools.getAccessToken();
         try {
-            String url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=" + accessToken;
+            String url = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?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="+houseResource.getId());
+            param.put("page", "pageA/houseDetail");
+            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); // 自动配置线条颜色,如果颜色依然是黑色,则说明不建议配置主色调 参数仅对小程序码生效
@@ -422,7 +424,7 @@
             //获取文件的URl地址
             String imgUrl = ossService.getImgUrl(objectName);
             houseResource.setQrCode(imgUrl);
-            this.baseMapper.insert(houseResource);
+            this.baseMapper.updateById(houseResource);
             System.err.println("看看文件路径" + imgUrl);
         } catch (Exception e) {
             System.err.println("调用小程序生成微信永久小程序码URL接口异常" + e);

--
Gitblit v1.7.1