ソースを参照

优化springboot func

wuxw 4 年 前
親
コミット
0a52cc1a35
共有36 個のファイルを変更した、307 個の追加 と 423 個の削除を含む
  1. 78 0
      java110-boot/pom.xml
  2. 15 0
      java110-boot/src/main/java/com/java110/acct/AcctServiceApplicationStart.java
  3. 20 0
      java110-boot/src/main/java/com/java110/common/CommonServiceApplicationStart.java
  4. 20 0
      java110-boot/src/main/java/com/java110/community/CommunityServiceApplicationStart.java
  5. 5 0
      java110-boot/src/main/java/com/java110/dev/DevServiceApplicationStart.java
  6. 5 0
      java110-boot/src/main/java/com/java110/fee/FeeServiceApplicationStart.java
  7. 5 0
      java110-boot/src/main/java/com/java110/job/JobServiceApplication.java
  8. 19 0
      java110-boot/src/main/java/com/java110/oa/OaServiceApplicationStart.java
  9. 22 0
      java110-boot/src/main/java/com/java110/order/OrderServiceApplicationStart.java
  10. 6 0
      java110-boot/src/main/java/com/java110/report/ReportServiceApplicationStart.java
  11. 22 0
      java110-boot/src/main/java/com/java110/store/StoreServiceApplicationStart.java
  12. 5 0
      java110-boot/src/main/java/com/java110/user/UserServiceApplicationStart.java
  13. 1 1
      java110-interface/src/main/java/com/java110/intf/acct/IAccountWithdrawalApplyInnerServiceSMO.java
  14. 1 1
      java110-interface/src/main/java/com/java110/intf/community/IMenuInnerServiceSMO.java
  15. 1 1
      java110-interface/src/main/java/com/java110/intf/store/purchase/IPurchaseApi.java
  16. 1 0
      pom.xml
  17. 1 1
      service-acct/src/main/java/com/java110/acct/bmo/accountWithdrawalApply/impl/GetAccountWithdrawalApplyBMOImpl.java
  18. 3 1
      service-acct/src/main/java/com/java110/acct/smo/impl/AccountWithdrawalApplyInnerServiceSMOImpl.java
  19. 1 1
      service-dev/src/main/java/com/java110/dev/dao/impl/DevServiceDAOImpl.java
  20. 3 3
      service-job/src/main/java/com/java110/job/task/groupBuy/GeneratorGroupBuyBatchTemplate.java
  21. BIN
      springboot/.DS_Store
  22. 10 0
      springboot/pom.xml
  23. 27 7
      springboot/src/main/java/com/java110/boot/BootApplicationStart.java
  24. 0 49
      springboot/src/main/java/com/java110/boot/components/AddPrivilegeGroupComponent.java
  25. 0 40
      springboot/src/main/java/com/java110/boot/components/DeletePrivilegeGroupComponent.java
  26. 0 49
      springboot/src/main/java/com/java110/boot/components/EditPrivilegeGroupComponent.java
  27. 0 43
      springboot/src/main/java/com/java110/boot/components/PrivilegeComponent.java
  28. 0 46
      springboot/src/main/java/com/java110/boot/components/PrivilegeGroupComponent.java
  29. 0 56
      springboot/src/main/java/com/java110/boot/components/privilege/AddPrivilegeComponent.java
  30. 0 39
      springboot/src/main/java/com/java110/boot/components/privilege/DeletePrivilegeComponent.java
  31. 0 39
      springboot/src/main/java/com/java110/boot/components/privilege/StaffPrivilegeComponent.java
  32. 12 10
      springboot/src/main/java/com/java110/boot/smo/DefaultAbstractComponentSMO.java
  33. 1 1
      springboot/src/main/java/com/java110/boot/smo/privilege/impl/PrivilegeSMOImpl.java
  34. 3 13
      springboot/src/main/resources/application-dev.yml
  35. 2 22
      springboot/src/main/resources/dataSource.yml
  36. 18 0
      springboot/src/main/resources/wechatAuth.properties

+ 78 - 0
java110-boot/pom.xml

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>MicroCommunity</artifactId>
+        <groupId>com.java110</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>java110-boot</artifactId>
+
+    <name>java110-boot</name>
+    <!-- FIXME change it to the project's website -->
+    <url>http://www.example.com</url>
+
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <maven.compiler.source>1.7</maven.compiler.source>
+        <maven.compiler.target>1.7</maven.compiler.target>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.11</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
+            <plugins>
+                <!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
+                <plugin>
+                    <artifactId>maven-clean-plugin</artifactId>
+                    <version>3.1.0</version>
+                </plugin>
+                <!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
+                <plugin>
+                    <artifactId>maven-resources-plugin</artifactId>
+                    <version>3.0.2</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-compiler-plugin</artifactId>
+                    <version>3.8.0</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-surefire-plugin</artifactId>
+                    <version>2.22.1</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-jar-plugin</artifactId>
+                    <version>3.0.2</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-install-plugin</artifactId>
+                    <version>2.5.2</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-deploy-plugin</artifactId>
+                    <version>2.8.2</version>
+                </plugin>
+                <!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
+                <plugin>
+                    <artifactId>maven-site-plugin</artifactId>
+                    <version>3.7.1</version>
+                </plugin>
+                <plugin>
+                    <artifactId>maven-project-info-reports-plugin</artifactId>
+                    <version>3.0.0</version>
+                </plugin>
+            </plugins>
+        </pluginManagement>
+    </build>
+</project>

+ 15 - 0
java110-boot/src/main/java/com/java110/acct/AcctServiceApplicationStart.java

@@ -0,0 +1,15 @@
+package com.java110.acct;
+
+
+/**
+ * spring boot 初始化启动类
+ *
+ * @version v0.1
+ * @auther com.java110.wuxw
+ * @mail 928255095@qq.com
+ * @date 2016年8月6日
+ * @tag
+ */
+public class AcctServiceApplicationStart {
+
+}

+ 20 - 0
java110-boot/src/main/java/com/java110/common/CommonServiceApplicationStart.java

@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common;
+
+public class CommonServiceApplicationStart {
+
+}

+ 20 - 0
java110-boot/src/main/java/com/java110/community/CommunityServiceApplicationStart.java

@@ -0,0 +1,20 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.community;
+
+public class CommunityServiceApplicationStart {
+
+}

+ 5 - 0
java110-boot/src/main/java/com/java110/dev/DevServiceApplicationStart.java

@@ -0,0 +1,5 @@
+package com.java110.dev;
+
+public class DevServiceApplicationStart {
+
+}

+ 5 - 0
java110-boot/src/main/java/com/java110/fee/FeeServiceApplicationStart.java

@@ -0,0 +1,5 @@
+package com.java110.fee;
+
+public class FeeServiceApplicationStart {
+
+}

+ 5 - 0
java110-boot/src/main/java/com/java110/job/JobServiceApplication.java

@@ -0,0 +1,5 @@
+package com.java110.job;
+
+public class JobServiceApplication {
+
+}

+ 19 - 0
java110-boot/src/main/java/com/java110/oa/OaServiceApplicationStart.java

@@ -0,0 +1,19 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.oa;
+public class OaServiceApplicationStart {
+
+}

+ 22 - 0
java110-boot/src/main/java/com/java110/order/OrderServiceApplicationStart.java

@@ -0,0 +1,22 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.order;
+
+
+public class OrderServiceApplicationStart {
+
+
+}

+ 6 - 0
java110-boot/src/main/java/com/java110/report/ReportServiceApplicationStart.java

@@ -0,0 +1,6 @@
+package com.java110.report;
+
+public class ReportServiceApplicationStart {
+
+
+}

+ 22 - 0
java110-boot/src/main/java/com/java110/store/StoreServiceApplicationStart.java

@@ -0,0 +1,22 @@
+/*
+ * Copyright 2017-2020 吴学文 and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.store;
+
+
+public class StoreServiceApplicationStart {
+
+
+}

+ 5 - 0
java110-boot/src/main/java/com/java110/user/UserServiceApplicationStart.java

@@ -0,0 +1,5 @@
+package com.java110.user;
+
+public class UserServiceApplicationStart {
+
+}

+ 1 - 1
java110-interface/src/main/java/com/java110/intf/acct/IAccountWithdrawalApplyInnerServiceSMO.java

@@ -60,7 +60,7 @@ public interface IAccountWithdrawalApplyInnerServiceSMO {
      * @return AccountWithdrawalApplyDto 对象数据
      */
     @RequestMapping(value = "/listStateWithdrawalApplys", method = RequestMethod.POST)
-    List<AccountWithdrawalApplyDto> listStateWithdrawalApplys(@RequestParam String [] states, int page, int row);
+    List<AccountWithdrawalApplyDto> listStateWithdrawalApplys(@RequestParam String [] states);
     /**
      * 查询<p>小区楼</p>总记录数
      *

+ 1 - 1
java110-interface/src/main/java/com/java110/intf/community/IMenuInnerServiceSMO.java

@@ -180,6 +180,6 @@ public interface IMenuInnerServiceSMO {
     @RequestMapping(value = "/deleteMenu", method = RequestMethod.POST)
     int deleteMenu(@RequestBody MenuDto routeDto);
 
-
+    @RequestMapping(value = "/hasPrivilege", method = RequestMethod.POST)
     List<HasPrivilegeDto> hasPrivilege(@RequestBody HasPrivilegeDto hasPrivilegeDto);
 }

+ 1 - 1
java110-interface/src/main/java/com/java110/intf/store/purchase/IPurchaseApi.java

@@ -1,4 +1,4 @@
-package com.java110.intf.store.purchase;
+package com.java110.intf.store;
 
 
 import com.java110.config.feign.FeignConfiguration;

+ 1 - 0
pom.xml

@@ -29,6 +29,7 @@
         <module>service-oa</module>
         <module>service-dev</module>
         <module>springboot</module>
+        <module>java110-boot</module>
 
     </modules>
 

+ 1 - 1
service-acct/src/main/java/com/java110/acct/bmo/accountWithdrawalApply/impl/GetAccountWithdrawalApplyBMOImpl.java

@@ -49,7 +49,7 @@ public class GetAccountWithdrawalApplyBMOImpl implements IGetAccountWithdrawalAp
 
         List<AccountWithdrawalApplyDto> accountWithdrawalApplyDtos = null;
         if (count > 0) {
-            accountWithdrawalApplyDtos = accountWithdrawalApplyInnerServiceSMOImpl.listStateWithdrawalApplys(states, page, row);
+            accountWithdrawalApplyDtos = accountWithdrawalApplyInnerServiceSMOImpl.listStateWithdrawalApplys(states);
         } else {
             accountWithdrawalApplyDtos = new ArrayList<>();
         }

+ 3 - 1
service-acct/src/main/java/com/java110/acct/smo/impl/AccountWithdrawalApplyInnerServiceSMOImpl.java

@@ -78,9 +78,11 @@ public class AccountWithdrawalApplyInnerServiceSMOImpl extends BaseServiceSMO im
         return accountWithdrawalApplyServiceDaoImpl.queryAccountWithdrawalApplysCount(BeanConvertUtil.beanCovertMap(accountWithdrawalApplyDto));    }
 
     @Override
-    public List<AccountWithdrawalApplyDto> listStateWithdrawalApplys(@RequestParam String[] states, int page, int row) {
+    public List<AccountWithdrawalApplyDto> listStateWithdrawalApplys(@RequestParam String[] states) {
 
         //校验是否传了 分页信息
+        int page =1;
+        int row = 10;
 
         if (page != PageDto.DEFAULT_PAGE) {
             page = ((page - 1) * row);

+ 1 - 1
service-dev/src/main/java/com/java110/dev/dao/impl/DevServiceDAOImpl.java

@@ -18,7 +18,7 @@ import java.util.Map;
  * 中心服务 数据操作类
  * Created by wuxw on 2018/4/14.
  */
-@Service("centerServiceDAOImpl")
+@Service("devServiceDAOImpl")
 @Transactional
 public class DevServiceDAOImpl extends BaseServiceDao implements IDevServiceDAO {
 

+ 3 - 3
service-job/src/main/java/com/java110/job/task/groupBuy/GeneratorGroupBuyBatchTemplate.java

@@ -35,13 +35,13 @@ public class GeneratorGroupBuyBatchTemplate extends TaskSystemQuartz {
 
     private static final int EXPIRE_IN = 7200;
 
-    @Autowired
+    @Autowired(required = false)
     private IGroupBuySettingInnerServiceSMO groupBuySettingInnerServiceSMOImpl;
 
-    @Autowired
+    @Autowired(required = false)
     private IGroupBuyBatchInnerServiceSMO groupBuyBatchInnerServiceSMOImpl;
 
-    @Autowired
+    @Autowired(required = false)
     private IGroupBuyProductInnerServiceSMO groupBuyProductInnerServiceSMOImpl;
 
 

BIN
springboot/.DS_Store


+ 10 - 0
springboot/pom.xml

@@ -23,6 +23,11 @@
     </properties>
 
     <dependencies>
+        <dependency>
+            <groupId>com.java110</groupId>
+            <artifactId>java110-boot</artifactId>
+            <version>${hc.version}</version>
+        </dependency>
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
@@ -79,6 +84,11 @@
             <artifactId>service-user</artifactId>
             <version>${hc.version}</version>
         </dependency>
+        <dependency>
+            <groupId>com.java110</groupId>
+            <artifactId>service-order</artifactId>
+            <version>${hc.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-websocket</artifactId>

+ 27 - 7
springboot/src/main/java/com/java110/boot/BootApplicationStart.java

@@ -33,6 +33,7 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
 import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
+import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration;
 import org.springframework.boot.web.client.RestTemplateBuilder;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.client.loadbalancer.LoadBalanced;
@@ -58,7 +59,22 @@ import java.util.concurrent.TimeUnit;
  * 这个服务是将 系统部署为spring boot版
  * 如果是spring cloud 微服务部署 不用启动这个类
  *
- *
+ * excludeName = {
+ "com.java110.intf.acct",
+ "com.java110.intf.code",
+ "com.java110.intf.common",
+ "com.java110.intf.community",
+ "com.java110.intf.demo",
+ "com.java110.intf.dev",
+ "com.java110.intf.fee",
+ "com.java110.intf.goods",
+ "com.java110.intf.job",
+ "com.java110.intf.oa",
+ "com.java110.intf.order",
+ "com.java110.intf.report",
+ "com.java110.intf.store",
+ "com.java110.intf.user"
+ }
  * @version v0.1
  * @auther com.java110.wuxw
  * @mail 928255095@qq.com
@@ -66,8 +82,8 @@ import java.util.concurrent.TimeUnit;
  * @tag
  */
 @SpringBootApplication(scanBasePackages = {
-        "com.java110.service.configuration",
-        "com.java110.service.init",
+        "com.java110.service",
+        "com.java110.db",
         "com.java110.core",
         "com.java110.config.properties.code",
         "com.java110.acct",
@@ -81,7 +97,13 @@ import java.util.concurrent.TimeUnit;
         "com.java110.report",
         "com.java110.store",
         "com.java110.user",
-})
+        "com.java110.boot"
+},
+        exclude = {LiquibaseAutoConfiguration.class,
+                org.activiti.spring.boot.SecurityAutoConfiguration.class,
+                org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration.class}
+
+)
 @Java110CmdDiscovery(cmdPublishClass = ServiceCmdEventPublishing.class,
         basePackages = {
                 "com.java110.acct.cmd",
@@ -96,8 +118,6 @@ import java.util.concurrent.TimeUnit;
                 "com.java110.store.cmd",
                 "com.java110.user.cmd"
         })
-@EnableDiscoveryClient
-@EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class})
 @EnableAsync
 public class BootApplicationStart {
 
@@ -121,7 +141,7 @@ public class BootApplicationStart {
     @Bean
     @ConditionalOnBean(Java110FeignClientInterceptor.class)
     public okhttp3.OkHttpClient okHttpClient(@Autowired
-                                                     Java110FeignClientInterceptor okHttpLoggingInterceptor){
+                                                     Java110FeignClientInterceptor okHttpLoggingInterceptor) {
         okhttp3.OkHttpClient.Builder ClientBuilder = new okhttp3.OkHttpClient.Builder()
                 .readTimeout(30, TimeUnit.SECONDS) //读取超时
                 .connectTimeout(10, TimeUnit.SECONDS) //连接超时

+ 0 - 49
springboot/src/main/java/com/java110/boot/components/AddPrivilegeGroupComponent.java

@@ -1,49 +0,0 @@
-package com.java110.boot.components;
-
-import com.java110.boot.smo.IPrivilegeServiceSMO;
-import com.java110.core.context.IPageData;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Component;
-
-/**
- * 添加权限组组件
- * <p>
- * add by wuxw
- * 2019-04-08
- */
-
-@Component("addPrivilegeGroup")
-public class AddPrivilegeGroupComponent {
-
-    @Autowired
-    private IPrivilegeServiceSMO privilegeServiceSMOImpl;
-
-
-    /**
-     * 保存权限组信息
-     *
-     * @param pd
-     * @return
-     */
-    public ResponseEntity<String> savePrivilegeGroupInfo(IPageData pd) {
-        ResponseEntity<String> responseEntity = null;
-        try {
-            responseEntity = privilegeServiceSMOImpl.savePrivilegeGroup(pd);
-        } catch (Exception e) {
-            responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
-        } finally {
-        }
-        return responseEntity;
-    }
-
-
-    public IPrivilegeServiceSMO getPrivilegeServiceSMOImpl() {
-        return privilegeServiceSMOImpl;
-    }
-
-    public void setPrivilegeServiceSMOImpl(IPrivilegeServiceSMO privilegeServiceSMOImpl) {
-        this.privilegeServiceSMOImpl = privilegeServiceSMOImpl;
-    }
-}

+ 0 - 40
springboot/src/main/java/com/java110/boot/components/DeletePrivilegeGroupComponent.java

@@ -1,40 +0,0 @@
-package com.java110.boot.components;
-
-import com.java110.boot.smo.IPrivilegeServiceSMO;
-import com.java110.core.context.IPageData;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Component;
-
-@Component("deletePrivilegeGroup")
-public class DeletePrivilegeGroupComponent {
-
-    @Autowired
-    private IPrivilegeServiceSMO privilegeServiceSMOImpl;
-
-    /**
-     * 删除权限组
-     *
-     * @param pd
-     * @return
-     */
-    public ResponseEntity<String> delete(IPageData pd) {
-        ResponseEntity<String> responseEntity = null;
-        try {
-            responseEntity = privilegeServiceSMOImpl.deletePrivilegeGroup(pd);
-        } catch (Exception e) {
-            responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
-        } finally {
-        }
-        return responseEntity;
-    }
-
-    public IPrivilegeServiceSMO getPrivilegeServiceSMOImpl() {
-        return privilegeServiceSMOImpl;
-    }
-
-    public void setPrivilegeServiceSMOImpl(IPrivilegeServiceSMO privilegeServiceSMOImpl) {
-        this.privilegeServiceSMOImpl = privilegeServiceSMOImpl;
-    }
-}

+ 0 - 49
springboot/src/main/java/com/java110/boot/components/EditPrivilegeGroupComponent.java

@@ -1,49 +0,0 @@
-package com.java110.boot.components;
-
-import com.java110.boot.smo.IPrivilegeServiceSMO;
-import com.java110.core.context.IPageData;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Component;
-
-/**
- * 添加权限组组件
- * <p>
- * add by wuxw
- * 2019-04-08
- */
-
-@Component("editPrivilegeGroup")
-public class EditPrivilegeGroupComponent {
-
-    @Autowired
-    private IPrivilegeServiceSMO privilegeServiceSMOImpl;
-
-
-    /**
-     * 保存权限组信息
-     *
-     * @param pd
-     * @return
-     */
-    public ResponseEntity<String> editPrivilegeGroupInfo(IPageData pd) {
-        ResponseEntity<String> responseEntity = null;
-        try {
-            responseEntity = privilegeServiceSMOImpl.editPrivilegeGroup(pd);
-        } catch (Exception e) {
-            responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
-        } finally {
-        }
-        return responseEntity;
-    }
-
-
-    public IPrivilegeServiceSMO getPrivilegeServiceSMOImpl() {
-        return privilegeServiceSMOImpl;
-    }
-
-    public void setPrivilegeServiceSMOImpl(IPrivilegeServiceSMO privilegeServiceSMOImpl) {
-        this.privilegeServiceSMOImpl = privilegeServiceSMOImpl;
-    }
-}

+ 0 - 43
springboot/src/main/java/com/java110/boot/components/PrivilegeComponent.java

@@ -1,43 +0,0 @@
-package com.java110.boot.components;
-
-
-import com.java110.boot.smo.IPrivilegeServiceSMO;
-import com.java110.core.context.IPageData;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Component;
-
-@Component("privilege")
-public class PrivilegeComponent {
-
-
-    @Autowired
-    private IPrivilegeServiceSMO privilegeServiceSMOImpl;
-
-    /**
-     * 查询权限
-     *
-     * @param pd
-     * @return
-     */
-    public ResponseEntity<String> listPrivilege(IPageData pd) {
-        ResponseEntity<String> responseEntity = null;
-        try {
-            responseEntity = privilegeServiceSMOImpl.loadListPrivilege(pd);
-        } catch (Exception e) {
-            responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
-        }
-        return responseEntity;
-        
-
-    }
-
-    public IPrivilegeServiceSMO getPrivilegeServiceSMOImpl() {
-        return privilegeServiceSMOImpl;
-    }
-
-    public void setPrivilegeServiceSMOImpl(IPrivilegeServiceSMO privilegeServiceSMOImpl) {
-        this.privilegeServiceSMOImpl = privilegeServiceSMOImpl;
-    }
-}

+ 0 - 46
springboot/src/main/java/com/java110/boot/components/PrivilegeGroupComponent.java

@@ -1,46 +0,0 @@
-package com.java110.boot.components;
-
-import com.java110.boot.smo.IPrivilegeServiceSMO;
-import com.java110.core.context.IPageData;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Component;
-
-/**
- * 权限组
- */
-
-@Component("privilegeGroup")
-public class PrivilegeGroupComponent {
-
-    @Autowired
-    private IPrivilegeServiceSMO privilegeServiceSMOImpl;
-
-    /**
-     * 查询权限组
-     *
-     * @param pd 页面
-     * @return
-     */
-    public ResponseEntity<String> listPrivilegeGroup(IPageData pd) {
-
-        ResponseEntity<String> responseEntity = null;
-        try {
-            responseEntity = privilegeServiceSMOImpl.listPrivilegeGroup(pd);
-        } catch (Exception e) {
-            responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
-        }
-        
-        return responseEntity;
-    }
-
-
-    public IPrivilegeServiceSMO getPrivilegeServiceSMOImpl() {
-        return privilegeServiceSMOImpl;
-    }
-
-    public void setPrivilegeServiceSMOImpl(IPrivilegeServiceSMO privilegeServiceSMOImpl) {
-        this.privilegeServiceSMOImpl = privilegeServiceSMOImpl;
-    }
-}

+ 0 - 56
springboot/src/main/java/com/java110/boot/components/privilege/AddPrivilegeComponent.java

@@ -1,56 +0,0 @@
-package com.java110.boot.components.privilege;
-
-import com.java110.boot.smo.IPrivilegeServiceSMO;
-import com.java110.core.context.IPageData;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Component;
-
-/**
- * 权限组 添加权限
- */
-@Component("addPrivilege")
-public class AddPrivilegeComponent {
-
-    @Autowired
-    private IPrivilegeServiceSMO privilegeServiceSMOImpl;
-
-
-    /**
-     * 查询未被绑定权限
-     *
-     * @param pd
-     * @return
-     */
-    public ResponseEntity<String> listNoAddPrivilege(IPageData pd) {
-        ResponseEntity<String> responseEntity = null;
-        try {
-            responseEntity = privilegeServiceSMOImpl.listNoAddPrivilege(pd);
-        } catch (Exception e) {
-            responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
-        } finally {
-        }
-        return responseEntity;
-    }
-
-    public ResponseEntity<String> addPrivilegeToPrivilegeGroup(IPageData pd) {
-        ResponseEntity<String> responseEntity = null;
-        try {
-            responseEntity = privilegeServiceSMOImpl.addPrivilegeToPrivilegeGroup(pd);
-        } catch (Exception e) {
-            responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
-        } finally {
-        }
-        return responseEntity;
-    }
-
-    public IPrivilegeServiceSMO getPrivilegeServiceSMOImpl() {
-        return privilegeServiceSMOImpl;
-    }
-
-    public void setPrivilegeServiceSMOImpl(IPrivilegeServiceSMO privilegeServiceSMOImpl) {
-        this.privilegeServiceSMOImpl = privilegeServiceSMOImpl;
-    }
-}
-

+ 0 - 39
springboot/src/main/java/com/java110/boot/components/privilege/DeletePrivilegeComponent.java

@@ -1,39 +0,0 @@
-package com.java110.boot.components.privilege;
-
-import com.java110.boot.smo.IPrivilegeServiceSMO;
-import com.java110.core.context.IPageData;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Component;
-
-/**
- * 权限组 删除权限
- */
-@Component("deletePrivilege")
-public class DeletePrivilegeComponent {
-
-    @Autowired
-    private IPrivilegeServiceSMO privilegeServiceSMOImpl;
-
-
-    public ResponseEntity<String> delete(IPageData pd) {
-        ResponseEntity<String> responseEntity = null;
-        try {
-            responseEntity = privilegeServiceSMOImpl.deletePrivilegeFromPrivilegeGroup(pd);
-        } catch (Exception e) {
-            responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
-        } finally {
-        }
-        return responseEntity;
-    }
-
-    public IPrivilegeServiceSMO getPrivilegeServiceSMOImpl() {
-        return privilegeServiceSMOImpl;
-    }
-
-    public void setPrivilegeServiceSMOImpl(IPrivilegeServiceSMO privilegeServiceSMOImpl) {
-        this.privilegeServiceSMOImpl = privilegeServiceSMOImpl;
-    }
-}
-

+ 0 - 39
springboot/src/main/java/com/java110/boot/components/privilege/StaffPrivilegeComponent.java

@@ -1,39 +0,0 @@
-package com.java110.boot.components.privilege;
-
-import com.java110.boot.smo.IPrivilegeServiceSMO;
-import com.java110.core.context.IPageData;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.stereotype.Component;
-
-@Component("staffPrivilege")
-public class StaffPrivilegeComponent {
-
-    @Autowired
-    private IPrivilegeServiceSMO privilegeServiceSMOImpl;
-
-    /**
-     * @param pd
-     * @return
-     */
-    public ResponseEntity<String> listStaffPrivileges(IPageData pd) {
-        ResponseEntity<String> responseEntity = null;
-        try {
-            responseEntity = privilegeServiceSMOImpl.listStaffPrivileges(pd);
-        } catch (Exception e) {
-            responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
-        } finally {
-        }
-        return responseEntity;
-    }
-
-
-    public IPrivilegeServiceSMO getPrivilegeServiceSMOImpl() {
-        return privilegeServiceSMOImpl;
-    }
-
-    public void setPrivilegeServiceSMOImpl(IPrivilegeServiceSMO privilegeServiceSMOImpl) {
-        this.privilegeServiceSMOImpl = privilegeServiceSMOImpl;
-    }
-}

+ 12 - 10
springboot/src/main/java/com/java110/boot/smo/DefaultAbstractComponentSMO.java

@@ -11,6 +11,7 @@ import com.java110.dto.basePrivilege.BasePrivilegeDto;
 import com.java110.dto.store.StoreDto;
 import com.java110.dto.user.UserDto;
 import com.java110.entity.component.ComponentValidateResult;
+import com.java110.intf.community.IMenuInnerServiceSMO;
 import com.java110.intf.user.IUserInnerServiceSMO;
 import com.java110.utils.cache.PrivilegeCache;
 import com.java110.utils.constant.CommonConstant;
@@ -62,6 +63,10 @@ public class DefaultAbstractComponentSMO extends AbstractComponentSMO {
     private static final String WECHAT_SERVICE_MCH_ID = "SERVICE_MCH_ID";
 
 
+    @Autowired
+    private IMenuInnerServiceSMO menuInnerServiceSMOImpl;
+
+
     /**
      * 调用中心服务
      *
@@ -334,7 +339,6 @@ public class DefaultAbstractComponentSMO extends AbstractComponentSMO {
         if (basePrivilegeDtos == null || basePrivilegeDtos.size() < 1) {
             return;
         }
-        String tmpResource = null;
         boolean hasPrivilege = false;
         for (BasePrivilegeDto privilegeDto : basePrivilegeDtos) {
             if (resource.equals(privilegeDto.getResource())) {
@@ -345,20 +349,18 @@ public class DefaultAbstractComponentSMO extends AbstractComponentSMO {
             return;
         }
 
-        ResultVo resultVo = null;
-        if (resultVo == null ||
-                resultVo.getCode() != ResultVo.CODE_OK) {
-            throw new UnsupportedOperationException("用户没有权限操作");
-        }
-        JSONArray privileges = JSONArray.parseArray(resultVo.getMsg());
+        BasePrivilegeDto basePrivilegeDto = new BasePrivilegeDto();
+        basePrivilegeDto.setResource(resource);
+        basePrivilegeDto.setUserId(pd.getUserId());
+        List<Map> privileges = menuInnerServiceSMOImpl.checkUserHasResource(basePrivilegeDto);
 
-        hasPrivilege = false;
         if (privileges == null || privileges.size() < 1) {
             throw new UnsupportedOperationException("用户没有权限操作");
         }
+
+        hasPrivilege = false;
         for (int privilegeIndex = 0; privilegeIndex < privileges.size(); privilegeIndex++) {
-            tmpResource = privileges.getJSONObject(privilegeIndex).getString("resource");
-            if (resource.equals(tmpResource)) {
+            if (resource.equals(privileges.get(privilegeIndex).get("resource"))) {
                 hasPrivilege = true;
                 break;
             }

+ 1 - 1
springboot/src/main/java/com/java110/boot/smo/privilege/impl/PrivilegeSMOImpl.java

@@ -7,7 +7,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.web.client.RestTemplate;
 
 @Service
-public class PrivilegeSMOImpl extends DefaultAbstractComponentSMO implements IPrivilegeSMO {
+public class BootPrivilegeSMOImpl extends DefaultAbstractComponentSMO implements IPrivilegeSMO {
 
 
 

+ 3 - 13
springboot/src/main/resources/application-dev.yml

@@ -7,18 +7,8 @@ jedis:
     host: dev.redis.java110.com
     port: 6379
     timeout: 3000
-    password: hc
+    password: hc12345678
 
-eureka:
-  instance:
-    leaseRenewalIntervalInSeconds: 10
-    leaseExpirationDurationInSeconds: 30
-    preferIpAddress: true
-    instanceId: ${spring.cloud.client.ip-address}:${server.port}
-  client:
-    serviceUrl:
-      defaultZone: http://dev.java110.com:8761/eureka/
-      #defaultZone: http://localhost:8761/eureka/
 server:
   port: 8008
   tomcat:
@@ -45,12 +35,12 @@ spring:
       enabled: true
       force: true
   application:
-    name: community-service
+    name: boot-service
   redis:
     database: 0
     host: dev.redis.java110.com
     port: 6379
-    password: hc
+    password: hc12345678
     pool:
       max-active: 300
       max-wait: 10000

+ 2 - 22
springboot/src/main/resources/dataSource.yml

@@ -3,44 +3,24 @@ dataSources:
     driverClassName: com.mysql.cj.jdbc.Driver
     url: jdbc:mysql://dev.db.java110.com:3306/hc_community?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
     username: hc_community
-    password: hc_community@12345678
+    password: hc12345678
     minIdle: 5
     validationQuery: SELECT 1 FROM DUAL
     initialSize: 5
     maxWait: 60000
     filters: stat,wall,log4j
     poolPreparedStatements: true
-#  ds0_slave0: !!com.alibaba.druid.pool.DruidDataSource
-#    driverClassName: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://dev.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8
-#    username: TT
-#    password: TT@12345678
-#    connectionTimeoutMilliseconds: 30000
-#    idleTimeoutMilliseconds: 60000
-#    maxPoolSize: 50
-#    minPoolSize: 1
-#    maintenanceIntervalMilliseconds: 30000
   ds1: !!com.alibaba.druid.pool.DruidDataSource
     driverClassName: com.mysql.cj.jdbc.Driver
     url: jdbc:mysql://dev.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
     username: TT
-    password: TT@12345678
+    password: hc12345678
     minIdle: 5
     validationQuery: SELECT 1 FROM DUAL
     initialSize: 5
     maxWait: 60000
     filters: stat,wall,log4j
     poolPreparedStatements: true
-#  ds1_slave0: !!com.alibaba.druid.pool.DruidDataSource
-#    driverClassName: com.mysql.jdbc.Driver
-#    url: jdbc:mysql://dev.db.java110.com:3306/TT?useUnicode=true&characterEncoding=utf-8
-#    username: TT
-#    password: TT@12345678
-#    connectionTimeoutMilliseconds: 30000
-#    idleTimeoutMilliseconds: 60000
-#    maxPoolSize: 50
-#    minPoolSize: 1
-#    maintenanceIntervalMilliseconds: 30000
 
 shardingRule:
   tables:

+ 18 - 0
springboot/src/main/resources/wechatAuth.properties

@@ -0,0 +1,18 @@
+java110.auth.wechat.sessionHost=https://api.weixin.qq.com/sns/jscode2session
+java110.auth.wechat.appId=wxf83d66b0e9f5964d
+java110.auth.wechat.secret=cc
+java110.auth.wechat.grantType=authorization_code
+java110.auth.wechat.key=key
+java110.auth.wechat.mchId=mchId
+java110.auth.wechat.wxPayUnifiedOrder=https://api.mch.weixin.qq.com/pay/unifiedorder
+java110.auth.wechat.wxNotifyUrl=http://www.vipwuye.com/app/payment/notify
+java110.auth.wechat.rentingNotifyUrl=http://www.vipwuye.com/app/payment/rentingNotify
+java110.auth.wechat.goodsNotifyUrl=http://www.vipwuye.com/goods/notify
+java110.auth.wechat.oweFeeNotifyUrl=http://www.vipwuye.com/app/payment/oweFeeNotify
+java110.auth.wechat.tempCarFeeNotifyUrl=http://www.vipwuye.com/app/payment/tempCarFeeNotifyUrl
+
+# ¹«ÖÚºÅÐÅÏ¢
+java110.auth.wechat.wechatAppId=key
+java110.auth.wechat.wechatAppSecret=mchId
+
+