Explorar o código

feature 代码提交

xiahan hai 4 meses
pai
achega
f2482fce97
Modificáronse 73 ficheiros con 350 adicións e 358 borrados
  1. 0 5
      zhsw-common/pom.xml
  2. 156 0
      zhsw-common/src/main/java/com/rongwei/zhsw/system/config/MybatisConfig.java
  3. 1 1
      zhsw-common/src/main/java/com/rongwei/zhsw/config/WeChatLoginApiPara.java
  4. 2 3
      zhsw-common/src/main/java/com/rongwei/zhsw/dao/CommonBusinessDao.java
  5. 2 2
      zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwBillManagementPaidDao.java
  6. 2 2
      zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwBillManagementUnpaidDao.java
  7. 2 2
      zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwBillingRecordDao.java
  8. 2 3
      zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwMeterReadingCorrectionDao.java
  9. 3 3
      zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwUserManagementDao.java
  10. 2 2
      zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwUserWechatDao.java
  11. 2 5
      zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwWaterUsageEntryDao.java
  12. 1 1
      zhsw-common/src/main/java/com/rongwei/zhsw/fegin/LoginAuth.java
  13. 1 1
      zhsw-common/src/main/java/com/rongwei/zhsw/fegin/LoginAuthImpl.java
  14. 1 1
      zhsw-common/src/main/java/com/rongwei/zhsw/fegin/TenantFeginService.java
  15. 1 1
      zhsw-common/src/main/java/com/rongwei/zhsw/fegin/TenantFeginServiceImpl.java
  16. 1 2
      zhsw-common/src/main/java/com/rongwei/zhsw/service/LoginLogicService.java
  17. 2 2
      zhsw-common/src/main/java/com/rongwei/zhsw/service/SwBillManagementPaidService.java
  18. 3 5
      zhsw-common/src/main/java/com/rongwei/zhsw/service/SwBillManagementUnpaidService.java
  19. 3 3
      zhsw-common/src/main/java/com/rongwei/zhsw/service/SwBillingRecordService.java
  20. 2 3
      zhsw-common/src/main/java/com/rongwei/zhsw/service/SwMeterReadingCorrectionService.java
  21. 2 2
      zhsw-common/src/main/java/com/rongwei/zhsw/service/SwUserManagementService.java
  22. 2 2
      zhsw-common/src/main/java/com/rongwei/zhsw/service/SwUserWechatService.java
  23. 2 2
      zhsw-common/src/main/java/com/rongwei/zhsw/service/SwWaterUsageEntryService.java
  24. 3 3
      zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/LoginLogicServiceImpl.java
  25. 4 4
      zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwBillManagementPaidServiceImpl.java
  26. 13 13
      zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwBillManagementUnpaidServiceImpl.java
  27. 17 16
      zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwBillingRecordServiceImpl.java
  28. 4 5
      zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwMeterReadingCorrectionServiceImpl.java
  29. 4 4
      zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwUserManagementServiceImpl.java
  30. 4 4
      zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwUserWechatServiceImpl.java
  31. 4 4
      zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwWaterUsageEntryServiceImpl.java
  32. 1 1
      zhsw-common/src/main/java/com/rongwei/zhsw/utils/SaveConstans.java
  33. 4 5
      zhsw-common/src/main/java/com/rongwei/zhsw/utils/WeChatUtils.java
  34. 2 1
      zhsw-common/src/main/java/com/rongwei/zhsw/utils/ZhswCommonUtils.java
  35. 2 2
      zhsw-common/src/main/java/com/rongwei/zhsw/wechat/AccountService.java
  36. 1 1
      zhsw-common/src/main/java/com/rongwei/zhsw/wechat/OwnerService.java
  37. 2 2
      zhsw-common/src/main/java/com/rongwei/zhsw/wechat/WeChatLoginService.java
  38. 9 9
      zhsw-common/src/main/java/com/rongwei/zhsw/wechat/impl/AccountServiceImpl.java
  39. 5 5
      zhsw-common/src/main/java/com/rongwei/zhsw/wechat/impl/OwnerServiceImpl.java
  40. 12 12
      zhsw-common/src/main/java/com/rongwei/zhsw/wechat/impl/WeChatLoginServiceImpl.java
  41. 0 12
      zhsw-common/src/main/resources/mybatis/SwUserManagementDao.xml
  42. 4 4
      zhsw-common/src/main/resources/mybatis/zhsw/CommonBusinessDao.xml
  43. 1 1
      zhsw-common/src/main/resources/mybatis/zhsw/SwBillManagementUnpaidDao.xml
  44. 3 3
      zhsw-common/src/main/resources/mybatis/zhsw/SwUserManagementDao.xml
  45. 2 2
      zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwBillManagementPaidDo.java
  46. 2 2
      zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwBillManagementUnpaidDo.java
  47. 2 2
      zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwBillingRecordDo.java
  48. 2 2
      zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwMeterReadingCorrectionDo.java
  49. 4 4
      zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwUserManagementDo.java
  50. 1 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwUserWechatDo.java
  51. 2 2
      zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwWaterUsageEntryDo.java
  52. 1 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/dto/MeterReadingCorrectionDTO.java
  53. 1 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/dto/PaymentRequestDTO.java
  54. 1 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/vo/AccountBindVo.java
  55. 1 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/vo/ChangeDefaultAccountVo.java
  56. 1 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/vo/CurrentWechatVo.java
  57. 1 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/vo/OwnerVo.java
  58. 2 2
      zhsw-entity/src/main/java/com/rongwe/zhsw/vo/SwUserManagementVo.java
  59. 1 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/vo/WeChatLoginReturnVo.java
  60. 1 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/vo/WeChatLoginVo.java
  61. 1 1
      zhsw-entity/src/main/java/com/rongwe/zhsw/vo/WeChatPickerVo.java
  62. 0 7
      zhsw-server/pom.xml
  63. 0 4
      zhsw-server/src/main/java/com/rongwei/ZHSWApplication.java
  64. 0 128
      zhsw-server/src/main/java/com/rongwei/zhsw/aspect/DynamicDataSourceAspect.java
  65. 2 2
      zhsw-server/src/main/java/com/rongwei/zhsw/controller/LoginLogicController.java
  66. 2 2
      zhsw-server/src/main/java/com/rongwei/zhsw/controller/OwnerController.java
  67. 3 4
      zhsw-server/src/main/java/com/rongwei/zhsw/controller/SwBillManagementPaidController.java
  68. 4 5
      zhsw-server/src/main/java/com/rongwei/zhsw/controller/SwBillManagementUnpaidController.java
  69. 5 3
      zhsw-server/src/main/java/com/rongwei/zhsw/controller/SwBillingRecordController.java
  70. 4 6
      zhsw-server/src/main/java/com/rongwei/zhsw/controller/SwMeterReadingCorrectionController.java
  71. 3 3
      zhsw-server/src/main/java/com/rongwei/zhsw/controller/weChat/AccountController.java
  72. 3 3
      zhsw-server/src/main/java/com/rongwei/zhsw/controller/weChat/LoginController.java
  73. 4 1
      zhsw-server/src/main/resources/bootstrap.yml

+ 0 - 5
zhsw-common/pom.xml

@@ -18,11 +18,6 @@
             <artifactId>mybatis-plus-generator</artifactId>
             <version>3.1.2</version>
         </dependency>
-        <dependency>
-            <groupId>com.rongwei</groupId>
-            <artifactId>rw-admin-common</artifactId>
-            <version>1.1-SNAPSHOT</version>
-        </dependency>
         <dependency>
             <groupId>com.rongwei</groupId>
             <artifactId>zhsw-entity</artifactId>

+ 156 - 0
zhsw-common/src/main/java/com/rongwei/zhsw/system/config/MybatisConfig.java

@@ -0,0 +1,156 @@
+package com.rongwei.zhsw.system.config;
+
+import com.baomidou.mybatisplus.core.parser.ISqlParser;
+import com.baomidou.mybatisplus.core.parser.ISqlParserFilter;
+import com.baomidou.mybatisplus.core.parser.SqlParserHelper;
+import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.PerformanceInterceptor;
+import com.baomidou.mybatisplus.extension.plugins.tenant.TenantHandler;
+import com.baomidou.mybatisplus.extension.plugins.tenant.TenantSqlParser;
+import com.rongwei.rwcommonconfig.config.interceptor.QuerySqlAdaptationInterceptor;
+import net.sf.jsqlparser.expression.Expression;
+import net.sf.jsqlparser.expression.LongValue;
+import org.apache.ibatis.mapping.MappedStatement;
+import org.apache.ibatis.reflection.MetaObject;
+import org.mybatis.spring.annotation.MapperScan;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.transaction.annotation.EnableTransactionManagement;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * Created by duyisong on 17/5/28.
+ */
+@EnableTransactionManagement
+@Configuration
+@MapperScan("com.rongwei.*.*.dao")
+public class MybatisConfig {
+
+    /**
+     * 自定义查询sql多数据库适配
+     * @return
+     */
+    @Bean
+    public QuerySqlAdaptationInterceptor querySqlAdaptationInterceptor(){
+        QuerySqlAdaptationInterceptor sqlAdaptation = new QuerySqlAdaptationInterceptor();
+        return sqlAdaptation;
+    }
+
+    /*
+     * 分页插件,自动识别数据库类型
+     * 多租户,请参考官网【插件扩展】
+     */
+    @Bean
+    public PaginationInterceptor paginationInterceptor() {
+        PaginationInterceptor paginationInterceptor = new PaginationInterceptor();
+        /*
+         * 【测试多租户】 SQL 解析处理拦截器<br>
+         * 这里固定写成住户 1 实际情况你可以从cookie读取,因此数据看不到 【 麻花藤 】 这条记录( 注意观察 SQL )<br>
+         */
+        List<ISqlParser> sqlParserList = new ArrayList<>();
+        TenantSqlParser tenantSqlParser = new TenantSqlParser();
+        tenantSqlParser.setTenantHandler(new TenantHandler() {
+            @Override
+            public Expression getTenantId() {
+                // 该 where 条件 3.2.0 版本开始添加的,用于分区是否为在 where 条件中使用
+                // 此判断用于支持返回多个租户 ID 场景,具体使用查看示例工程
+                // 查询redis缓存的租户ID
+                return new LongValue(1L);
+            }
+
+            @Override
+            public String getTenantIdColumn() {
+                return "TENANTID";
+            }
+
+            @Override
+            public boolean doTableFilter(String tableName) {
+                // 这里可以判断是否过滤表,true表示过滤、false不过滤
+                /*
+                if ("user".equals(tableName)) {
+                    return true;
+                }*/
+                return true;
+            }
+        });
+        //sqlParserList.add(tenantSqlParser);
+        paginationInterceptor.setSqlParserList(sqlParserList);
+        paginationInterceptor.setSqlParserFilter(new ISqlParserFilter() {
+            @Override
+            public boolean doFilter(MetaObject metaObject) {
+                MappedStatement ms = SqlParserHelper.getMappedStatement(metaObject);
+                // 过滤自定义查询此时无租户信息约束【 麻花藤 】出现
+                if ("com.rongwei.rwadmincommon.system.dao.getAll".equals(ms.getId())) {
+                    return true;
+                }
+                return false;
+            }
+        });
+        paginationInterceptor.setLimit(2000);
+        return paginationInterceptor;
+    }
+
+    /**
+     * 打印 sql
+     */
+    @Bean
+    public PerformanceInterceptor performanceInterceptor() {
+        PerformanceInterceptor performanceInterceptor = new PerformanceInterceptor();
+        //格式化sql语句
+        Properties properties = new Properties();
+        properties.setProperty("format", "true");
+        performanceInterceptor.setProperties(properties);
+        return performanceInterceptor;
+    }
+
+    /*@Bean
+    public MapperScannerConfigurer mapperScannerConfigurer() {
+        log.info("[config] 注册 tkMtBatis");
+        MapperScannerConfigurer mapperScannerConfigurer = new MapperScannerConfigurer();
+        mapperScannerConfigurer.setBasePackage("com.rongwei.rwadmin.system.dao");
+        Properties properties = new Properties();
+        properties.setProperty("markerInterface", "com.rongwei.rwadmin.common.mapper.BaseDao");
+        mapperScannerConfigurer.setProperties(properties);
+        return mapperScannerConfigurer;
+    }
+
+    @Bean
+    public PageHelper pageHelper(DataSource dataSource) {
+        log.info("[config] 注册 MyBatis分页插件PageHelper");
+        PageHelper pageHelper = new PageHelper();
+        Properties p = new Properties();
+        p.setProperty("offsetAsPageNum", "true");
+        p.setProperty("rowBoundsWithCount", "true");
+        p.setProperty("reasonable", "true");
+        pageHelper.setProperties(p);
+        return pageHelper;
+    }*/
+
+
+    // 配置sqlSessionFactory
+    /*@Bean(name = "sqlSessionFactory")
+    public SqlSessionFactory sqlSessionFactoryBean(DataSource dataSource
+            ,QuerySqlAdaptationInterceptor sqlAdaptation,PaginationInterceptor paginationInterceptor) {
+        SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
+        bean.setDataSource(dataSource);
+        if(StringUtils.isNotBlank(typeAliasesPackage)){
+            bean.setTypeAliasesPackage(typeAliasesPackage);
+        }
+
+        // 自定义的sql日志拦截器
+        Interceptor sqlLogInterceptor = new SqlLogInterceptor();
+        Interceptor[] plugins =  new Interceptor[]{ sqlLogInterceptor};
+        bean.setPlugins(plugins);
+        try {
+            bean.setMapperLocations(resolver.getResources(xmlLocation));
+            return bean.getObject();
+        } catch (Exception e) {
+            e.printStackTrace();
+            throw new RuntimeException(e);
+        }
+    }*/
+
+}

+ 1 - 1
zhsw-common/src/main/java/com/rongwei/zhsw/config/WeChatLoginApiPara.java

@@ -1,4 +1,4 @@
-package com.rongwei.zhsw.config;
+package com.rongwei.zhsw.system.config;
 
 import lombok.Data;
 import org.springframework.boot.context.properties.ConfigurationProperties;

+ 2 - 3
zhsw-common/src/main/java/com/rongwei/zhsw/dao/CommonBusinessDao.java

@@ -1,10 +1,9 @@
-package com.rongwei.zhsw.dao;
+package com.rongwei.zhsw.system.dao;
 
-import com.rongwe.zhsw.vo.OwnerVo;
+import com.rongwe.zhsw.system.vo.OwnerVo;
 import com.rongwei.rwcommonentity.commonservers.domain.TenantDo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
 
 import java.util.List;
 

+ 2 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwBillManagementPaidDao.java

@@ -1,8 +1,8 @@
-package com.rongwei.zhsw.dao;
+package com.rongwei.zhsw.system.dao;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.rongwe.zhsw.domain.SwBillManagementPaidDo;
+import com.rongwe.zhsw.system.domain.SwBillManagementPaidDo;
 import org.apache.ibatis.annotations.Mapper;
 
 /**

+ 2 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwBillManagementUnpaidDao.java

@@ -1,8 +1,8 @@
-package com.rongwei.zhsw.dao;
+package com.rongwei.zhsw.system.dao;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.rongwe.zhsw.domain.SwBillManagementUnpaidDo;
+import com.rongwe.zhsw.system.domain.SwBillManagementUnpaidDo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 

+ 2 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwBillingRecordDao.java

@@ -1,8 +1,8 @@
-package com.rongwei.zhsw.dao;
+package com.rongwei.zhsw.system.dao;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.rongwe.zhsw.domain.SwBillingRecordDo;
+import com.rongwe.zhsw.system.domain.SwBillingRecordDo;
 import org.apache.ibatis.annotations.Mapper;
 
 /**

+ 2 - 3
zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwMeterReadingCorrectionDao.java

@@ -1,9 +1,8 @@
-package com.rongwei.zhsw.sys.dao;
+package com.rongwei.zhsw.system.dao;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.rongwe.zhsw.domain.SwMeterReadingCorrectionDo;
-import com.rongwe.zhsw.domain.SwWaterUsageEntryDo;
+import com.rongwe.zhsw.system.domain.SwMeterReadingCorrectionDo;
 import org.apache.ibatis.annotations.Mapper;
 
 

+ 3 - 3
zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwUserManagementDao.java

@@ -1,9 +1,9 @@
-package com.rongwei.zhsw.dao;
+package com.rongwei.zhsw.system.dao;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.rongwe.zhsw.domain.SwUserManagementDo;
-import com.rongwe.zhsw.vo.SwUserManagementVo;
+import com.rongwe.zhsw.system.domain.SwUserManagementDo;
+import com.rongwe.zhsw.system.vo.SwUserManagementVo;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 

+ 2 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwUserWechatDao.java

@@ -1,7 +1,7 @@
-package com.rongwei.zhsw.dao;
+package com.rongwei.zhsw.system.dao;
 
-import com.rongwe.zhsw.domain.SwUserWechatDo;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.rongwe.zhsw.system.domain.SwUserWechatDo;
 import org.apache.ibatis.annotations.Mapper;
 
 /**

+ 2 - 5
zhsw-common/src/main/java/com/rongwei/zhsw/dao/SwWaterUsageEntryDao.java

@@ -1,13 +1,10 @@
-package com.rongwei.zhsw.sys.dao;
+package com.rongwei.zhsw.system.dao;
 
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.rongwe.zhsw.domain.SwBillManagementUnpaidDo;
-import com.rongwe.zhsw.domain.SwWaterUsageEntryDo;
+import com.rongwe.zhsw.system.domain.SwWaterUsageEntryDo;
 import org.apache.ibatis.annotations.Mapper;
 
-import java.util.List;
-
 /**
  * 抄表登记(SwWaterUsageEntry)表数据库访问层
  *

+ 1 - 1
zhsw-common/src/main/java/com/rongwei/zhsw/fegin/LoginAuth.java

@@ -1,4 +1,4 @@
-package com.rongwei.zhsw.fegin;
+package com.rongwei.zhsw.system.fegin;
 
 import com.rongwei.rwadmincommon.system.vo.JwtAuthenticationRequest;
 import org.springframework.cloud.openfeign.FeignClient;

+ 1 - 1
zhsw-common/src/main/java/com/rongwei/zhsw/fegin/LoginAuthImpl.java

@@ -1,4 +1,4 @@
-package com.rongwei.zhsw.fegin;
+package com.rongwei.zhsw.system.fegin;
 
 import com.rongwei.rwadmincommon.system.vo.JwtAuthenticationRequest;
 import org.springframework.stereotype.Component;

+ 1 - 1
zhsw-common/src/main/java/com/rongwei/zhsw/fegin/TenantFeginService.java

@@ -1,4 +1,4 @@
-package com.rongwei.zhsw.fegin;
+package com.rongwei.zhsw.system.fegin;
 
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommonentity.commonservers.domain.TenantDo;

+ 1 - 1
zhsw-common/src/main/java/com/rongwei/zhsw/fegin/TenantFeginServiceImpl.java

@@ -1,4 +1,4 @@
-package com.rongwei.zhsw.fegin;
+package com.rongwei.zhsw.system.fegin;
 
 import com.codingapi.txlcn.tc.support.DTXUserControls;
 import com.codingapi.txlcn.tracing.TracingContext;

+ 1 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/service/LoginLogicService.java

@@ -1,6 +1,5 @@
-package com.rongwei.zhsw.service;
+package com.rongwei.zhsw.system.service;
 
-import com.rongwe.zhsw.vo.WeChatLoginVo;
 import com.rongwei.rwadmincommon.system.domain.UserLoginVo;
 import com.rongwei.rwcommon.base.R;
 

+ 2 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/service/SwBillManagementPaidService.java

@@ -1,7 +1,7 @@
-package com.rongwei.zhsw.service;
+package com.rongwei.zhsw.system.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.rongwe.zhsw.domain.SwBillManagementPaidDo;
+import com.rongwe.zhsw.system.domain.SwBillManagementPaidDo;
 
 /**
  * 账单管理(按年分表)(已缴,退款)(SwBillManagementPaid)表服务接口

+ 3 - 5
zhsw-common/src/main/java/com/rongwei/zhsw/service/SwBillManagementUnpaidService.java

@@ -1,12 +1,10 @@
-package com.rongwei.zhsw.service;
+package com.rongwei.zhsw.system.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.rongwe.zhsw.domain.SwBillManagementUnpaidDo;
-import com.rongwe.zhsw.dto.MeterReadingCorrectionDTO;
+import com.rongwe.zhsw.system.domain.SwBillManagementUnpaidDo;
+import com.rongwe.zhsw.system.dto.MeterReadingCorrectionDTO;
 import com.rongwei.rwcommon.base.R;
 
-import java.math.BigDecimal;
-
 /**
  * 账单管理(按年分表)(预收,未缴)(SwBillManagementUnpaid)表服务接口
  *

+ 3 - 3
zhsw-common/src/main/java/com/rongwei/zhsw/service/SwBillingRecordService.java

@@ -1,10 +1,10 @@
-package com.rongwei.zhsw.service;
+package com.rongwei.zhsw.system.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.rongwe.zhsw.dto.PaymentRequestDTO;
+import com.rongwe.zhsw.system.domain.SwBillingRecordDo;
+import com.rongwe.zhsw.system.dto.PaymentRequestDTO;
 import com.rongwei.rwcommon.base.R;
-import com.rongwe.zhsw.domain.SwBillingRecordDo;
 
 /**
  * 缴费记录(SwBillingRecord)表服务接口

+ 2 - 3
zhsw-common/src/main/java/com/rongwei/zhsw/service/SwMeterReadingCorrectionService.java

@@ -1,8 +1,7 @@
-package com.rongwei.zhsw.sys.service;
+package com.rongwei.zhsw.system.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.rongwe.zhsw.domain.SwBillManagementUnpaidDo;
-import com.rongwe.zhsw.domain.SwMeterReadingCorrectionDo;
+import com.rongwe.zhsw.system.domain.SwMeterReadingCorrectionDo;
 /**
  * 抄表修正(SwMeterReadingCorrection)表服务接口
  *

+ 2 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/service/SwUserManagementService.java

@@ -1,8 +1,8 @@
-package com.rongwei.zhsw.service;
+package com.rongwei.zhsw.system.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.rongwe.zhsw.domain.SwUserManagementDo;
+import com.rongwe.zhsw.system.domain.SwUserManagementDo;
 
 import java.math.BigDecimal;
 

+ 2 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/service/SwUserWechatService.java

@@ -1,7 +1,7 @@
-package com.rongwei.zhsw.service;
+package com.rongwei.zhsw.system.service;
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.rongwe.zhsw.domain.SwUserWechatDo;
+import com.rongwe.zhsw.system.domain.SwUserWechatDo;
 
 /**
 * @author libai

+ 2 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/service/SwWaterUsageEntryService.java

@@ -1,8 +1,8 @@
-package com.rongwei.zhsw.sys.service;
+package com.rongwei.zhsw.system.service;
 
 
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.rongwe.zhsw.domain.SwWaterUsageEntryDo;
+import com.rongwe.zhsw.system.domain.SwWaterUsageEntryDo;
 
 /**
  * 抄表登记(SwWaterUsageEntry)表服务接口

+ 3 - 3
zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/LoginLogicServiceImpl.java

@@ -1,4 +1,4 @@
-package com.rongwei.zhsw.service.impl;
+package com.rongwei.zhsw.system.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.rongwei.commonservice.service.RedisService;
@@ -11,8 +11,8 @@ import com.rongwei.rwadmincommon.system.vo.SysUserVo;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.base.exception.CustomException;
 import com.rongwei.rwcommon.utils.SecurityUtil;
-import com.rongwei.zhsw.fegin.LoginAuth;
-import com.rongwei.zhsw.service.LoginLogicService;
+import com.rongwei.zhsw.system.fegin.LoginAuth;
+import com.rongwei.zhsw.system.service.LoginLogicService;
 import lombok.SneakyThrows;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;

+ 4 - 4
zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwBillManagementPaidServiceImpl.java

@@ -1,9 +1,9 @@
-package com.rongwei.zhsw.service.impl;
+package com.rongwei.zhsw.system.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.rongwei.zhsw.dao.SwBillManagementPaidDao;
-import com.rongwei.zhsw.service.SwBillManagementPaidService;
-import com.rongwe.zhsw.domain.SwBillManagementPaidDo;
+import com.rongwe.zhsw.system.domain.SwBillManagementPaidDo;
+import com.rongwei.zhsw.system.dao.SwBillManagementPaidDao;
+import com.rongwei.zhsw.system.service.SwBillManagementPaidService;
 import org.springframework.stereotype.Service;
 
 

+ 13 - 13
zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwBillManagementUnpaidServiceImpl.java

@@ -1,21 +1,21 @@
-package com.rongwei.zhsw.service.impl;
+package com.rongwei.zhsw.system.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.rongwe.zhsw.domain.SwBillManagementUnpaidDo;
-import com.rongwe.zhsw.domain.SwMeterReadingCorrectionDo;
-import com.rongwe.zhsw.domain.SwUserManagementDo;
-import com.rongwe.zhsw.domain.SwWaterUsageEntryDo;
-import com.rongwe.zhsw.dto.MeterReadingCorrectionDTO;
+import com.rongwe.zhsw.system.domain.SwBillManagementUnpaidDo;
+import com.rongwe.zhsw.system.domain.SwMeterReadingCorrectionDo;
+import com.rongwe.zhsw.system.domain.SwUserManagementDo;
+import com.rongwe.zhsw.system.domain.SwWaterUsageEntryDo;
+import com.rongwe.zhsw.system.dto.MeterReadingCorrectionDTO;
 import com.rongwei.rwadmincommon.system.vo.SysUserVo;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.utils.SecurityUtil;
-import com.rongwei.zhsw.dao.SwBillManagementUnpaidDao;
-import com.rongwei.zhsw.service.SwBillManagementUnpaidService;
-import com.rongwei.zhsw.service.SwUserManagementService;
-import com.rongwei.zhsw.sys.service.SwMeterReadingCorrectionService;
-import com.rongwei.zhsw.sys.service.SwWaterUsageEntryService;
-import com.rongwei.zhsw.utils.ZhswCommonUtils;
+import com.rongwei.zhsw.system.dao.SwBillManagementUnpaidDao;
+import com.rongwei.zhsw.system.service.SwBillManagementUnpaidService;
+import com.rongwei.zhsw.system.service.SwUserManagementService;
+import com.rongwei.zhsw.system.service.SwMeterReadingCorrectionService;
+import com.rongwei.zhsw.system.service.SwWaterUsageEntryService;
+import com.rongwei.zhsw.system.utils.ZhswCommonUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -23,7 +23,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.math.BigDecimal;
 import java.util.Date;
 
-import static com.rongwei.zhsw.utils.SaveConstans.billReccord.HAVEREVISEDSTATUS;
+import static com.rongwei.zhsw.system.utils.SaveConstans.billReccord.HAVEREVISEDSTATUS;
 
 /**
  * 账单管理(按年分表)(预收,未缴)(SwBillManagementUnpaid)表服务实现类

+ 17 - 16
zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwBillingRecordServiceImpl.java

@@ -1,35 +1,36 @@
-package com.rongwei.zhsw.service.impl;
+package com.rongwei.zhsw.system.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.rongwe.zhsw.domain.SwUserManagementDo;
-import com.rongwe.zhsw.dto.PaymentRequestDTO;
+import com.rongwe.zhsw.system.domain.SwBillManagementPaidDo;
+import com.rongwe.zhsw.system.domain.SwBillManagementUnpaidDo;
+import com.rongwe.zhsw.system.domain.SwBillingRecordDo;
+import com.rongwe.zhsw.system.domain.SwUserManagementDo;
+import com.rongwe.zhsw.system.dto.PaymentRequestDTO;
 import com.rongwei.rwadmincommon.system.vo.SysUserVo;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.utils.SecurityUtil;
-import com.rongwei.zhsw.dao.SwBillManagementUnpaidDao;
-import com.rongwei.zhsw.dao.SwBillingRecordDao;
-import com.rongwei.zhsw.service.SwBillManagementPaidService;
-import com.rongwei.zhsw.service.SwBillManagementUnpaidService;
-import com.rongwei.zhsw.service.SwBillingRecordService;
-import com.rongwe.zhsw.domain.SwBillManagementPaidDo;
-import com.rongwe.zhsw.domain.SwBillManagementUnpaidDo;
-import com.rongwe.zhsw.domain.SwBillingRecordDo;
-import com.rongwei.zhsw.service.SwUserManagementService;
-import com.rongwei.zhsw.utils.ZhswCommonUtils;
+import com.rongwei.zhsw.system.dao.SwBillManagementUnpaidDao;
+import com.rongwei.zhsw.system.dao.SwBillingRecordDao;
+import com.rongwei.zhsw.system.service.SwBillManagementPaidService;
+import com.rongwei.zhsw.system.service.SwBillManagementUnpaidService;
+import com.rongwei.zhsw.system.service.SwBillingRecordService;
+import com.rongwei.zhsw.system.service.SwUserManagementService;
+import com.rongwei.zhsw.system.utils.ZhswCommonUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
+
 import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
 
-import static com.rongwei.zhsw.utils.SaveConstans.billInfo.PAIDINSTATUS;
-import static com.rongwei.zhsw.utils.SaveConstans.billInfo.PENDINGSTATUS;
-import static com.rongwei.zhsw.utils.SaveConstans.billReccord.PAIDSTATUS;
+import static com.rongwei.zhsw.system.utils.SaveConstans.billInfo.PAIDINSTATUS;
+import static com.rongwei.zhsw.system.utils.SaveConstans.billInfo.PENDINGSTATUS;
+import static com.rongwei.zhsw.system.utils.SaveConstans.billReccord.PAIDSTATUS;
 
 /**
  * 缴费记录(SwBillingRecord)表服务实现类

+ 4 - 5
zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwMeterReadingCorrectionServiceImpl.java

@@ -1,11 +1,10 @@
-package com.rongwei.zhsw.sys.service.impl;
+package com.rongwei.zhsw.system.service.impl;
 
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.rongwe.zhsw.domain.SwMeterReadingCorrectionDo;
-
-import com.rongwei.zhsw.sys.dao.SwMeterReadingCorrectionDao;
-import com.rongwei.zhsw.sys.service.SwMeterReadingCorrectionService;
+import com.rongwe.zhsw.system.domain.SwMeterReadingCorrectionDo;
+import com.rongwei.zhsw.system.dao.SwMeterReadingCorrectionDao;
+import com.rongwei.zhsw.system.service.SwMeterReadingCorrectionService;
 import org.springframework.stereotype.Service;
 
 

+ 4 - 4
zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwUserManagementServiceImpl.java

@@ -1,9 +1,9 @@
-package com.rongwei.zhsw.service.impl;
+package com.rongwei.zhsw.system.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.rongwe.zhsw.domain.SwUserManagementDo;
-import com.rongwei.zhsw.dao.SwUserManagementDao;
-import com.rongwei.zhsw.service.SwUserManagementService;
+import com.rongwe.zhsw.system.domain.SwUserManagementDo;
+import com.rongwei.zhsw.system.dao.SwUserManagementDao;
+import com.rongwei.zhsw.system.service.SwUserManagementService;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;

+ 4 - 4
zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwUserWechatServiceImpl.java

@@ -1,9 +1,9 @@
-package com.rongwei.zhsw.service.impl;
+package com.rongwei.zhsw.system.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.rongwe.zhsw.domain.SwUserWechatDo;
-import com.rongwei.zhsw.dao.SwUserWechatDao;
-import com.rongwei.zhsw.service.SwUserWechatService;
+import com.rongwe.zhsw.system.domain.SwUserWechatDo;
+import com.rongwei.zhsw.system.dao.SwUserWechatDao;
+import com.rongwei.zhsw.system.service.SwUserWechatService;
 import org.springframework.stereotype.Service;
 
 /**

+ 4 - 4
zhsw-common/src/main/java/com/rongwei/zhsw/service/impl/SwWaterUsageEntryServiceImpl.java

@@ -1,9 +1,9 @@
-package com.rongwei.zhsw.sys.service.impl;
+package com.rongwei.zhsw.system.service.impl;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.rongwe.zhsw.domain.SwWaterUsageEntryDo;
-import com.rongwei.zhsw.sys.dao.SwWaterUsageEntryDao;
-import com.rongwei.zhsw.sys.service.SwWaterUsageEntryService;
+import com.rongwe.zhsw.system.domain.SwWaterUsageEntryDo;
+import com.rongwei.zhsw.system.dao.SwWaterUsageEntryDao;
+import com.rongwei.zhsw.system.service.SwWaterUsageEntryService;
 import org.springframework.stereotype.Service;
 
 import javax.annotation.Resource;

+ 1 - 1
zhsw-common/src/main/java/com/rongwei/zhsw/utils/SaveConstans.java

@@ -1,4 +1,4 @@
-package com.rongwei.zhsw.utils;
+package com.rongwei.zhsw.system.utils;
 
 public class SaveConstans {
 

+ 4 - 5
zhsw-common/src/main/java/com/rongwei/zhsw/utils/WeChatUtils.java

@@ -1,11 +1,10 @@
-package com.rongwei.zhsw.utils;
+package com.rongwei.zhsw.system.utils;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
-import com.rongwe.zhsw.vo.WeChatLoginReturnVo;
+import com.rongwe.zhsw.system.vo.WeChatLoginReturnVo;
 import com.rongwei.commonservice.service.RedisService;
 import com.rongwei.rwcommon.base.exception.CustomException;
-import com.rongwei.zhsw.config.WeChatLoginApiPara;
-import lombok.SneakyThrows;
+import com.rongwei.zhsw.system.config.WeChatLoginApiPara;
 import org.apache.http.HttpEntity;
 import org.apache.http.client.config.RequestConfig;
 import org.apache.http.client.methods.CloseableHttpResponse;
@@ -21,7 +20,7 @@ import org.springframework.stereotype.Component;
 import javax.annotation.PostConstruct;
 import java.io.IOException;
 
-import static com.rongwei.zhsw.utils.SaveConstans.REDIS_OWNER_KEY;
+import static com.rongwei.zhsw.system.utils.SaveConstans.REDIS_OWNER_KEY;
 
 /**
  * WeChatUtils class

+ 2 - 1
zhsw-common/src/main/java/com/rongwei/zhsw/utils/ZhswCommonUtils.java

@@ -1,4 +1,4 @@
-package com.rongwei.zhsw.utils;
+package com.rongwei.zhsw.system.utils;
 
 
 import com.rongwei.commonservice.service.RedisService;
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
+
 import javax.annotation.PostConstruct;
 import javax.servlet.http.HttpServletRequest;
 import java.util.Date;

+ 2 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/wechat/AccountService.java

@@ -1,6 +1,6 @@
-package com.rongwei.zhsw.wechat;
+package com.rongwei.zhsw.system.wechat;
 
-import com.rongwe.zhsw.vo.AccountBindVo;
+import com.rongwe.zhsw.system.vo.AccountBindVo;
 import com.rongwei.rwcommon.base.R;
 
 /**

+ 1 - 1
zhsw-common/src/main/java/com/rongwei/zhsw/wechat/OwnerService.java

@@ -1,4 +1,4 @@
-package com.rongwei.zhsw.wechat;
+package com.rongwei.zhsw.system.wechat;
 
 import com.rongwei.rwcommon.base.R;
 

+ 2 - 2
zhsw-common/src/main/java/com/rongwei/zhsw/wechat/WeChatLoginService.java

@@ -1,6 +1,6 @@
-package com.rongwei.zhsw.wechat;
+package com.rongwei.zhsw.system.wechat;
 
-import com.rongwe.zhsw.vo.WeChatLoginVo;
+import com.rongwe.zhsw.system.vo.WeChatLoginVo;
 import com.rongwei.rwcommon.base.R;
 
 /**

+ 9 - 9
zhsw-common/src/main/java/com/rongwei/zhsw/wechat/impl/AccountServiceImpl.java

@@ -1,16 +1,16 @@
-package com.rongwei.zhsw.wechat.impl;
+package com.rongwei.zhsw.system.wechat.impl;
 
-import com.rongwe.zhsw.domain.SwUserManagementDo;
-import com.rongwe.zhsw.domain.SwUserWechatDo;
-import com.rongwe.zhsw.vo.AccountBindVo;
-import com.rongwe.zhsw.vo.SwUserManagementVo;
+import com.rongwe.zhsw.system.domain.SwUserManagementDo;
+import com.rongwe.zhsw.system.domain.SwUserWechatDo;
+import com.rongwe.zhsw.system.vo.AccountBindVo;
+import com.rongwe.zhsw.system.vo.SwUserManagementVo;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.base.exception.CustomException;
 import com.rongwei.rwcommon.utils.SecurityUtil;
-import com.rongwei.zhsw.service.impl.SwUserManagementServiceImpl;
-import com.rongwei.zhsw.service.impl.SwUserWechatServiceImpl;
-import com.rongwei.zhsw.wechat.AccountService;
-import com.rongwei.zhsw.utils.WeChatUtils;
+import com.rongwei.zhsw.system.service.impl.SwUserManagementServiceImpl;
+import com.rongwei.zhsw.system.service.impl.SwUserWechatServiceImpl;
+import com.rongwei.zhsw.system.utils.WeChatUtils;
+import com.rongwei.zhsw.system.wechat.AccountService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

+ 5 - 5
zhsw-common/src/main/java/com/rongwei/zhsw/wechat/impl/OwnerServiceImpl.java

@@ -1,11 +1,11 @@
-package com.rongwei.zhsw.wechat.impl;
+package com.rongwei.zhsw.system.wechat.impl;
 
-import com.rongwe.zhsw.vo.OwnerVo;
+import com.rongwe.zhsw.system.vo.OwnerVo;
 import com.rongwei.commonservice.service.impl.RedisServiceImpl;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommonentity.commonservers.domain.TenantDo;
-import com.rongwei.zhsw.dao.CommonBusinessDao;
-import com.rongwei.zhsw.wechat.OwnerService;
+import com.rongwei.zhsw.system.dao.CommonBusinessDao;
+import com.rongwei.zhsw.system.wechat.OwnerService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -15,7 +15,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
-import static com.rongwei.zhsw.utils.SaveConstans.REDIS_OWNER_KEY;
+import static com.rongwei.zhsw.system.utils.SaveConstans.REDIS_OWNER_KEY;
 
 /**
  * OwnerService class

+ 12 - 12
zhsw-common/src/main/java/com/rongwei/zhsw/wechat/impl/WeChatLoginServiceImpl.java

@@ -1,20 +1,20 @@
-package com.rongwei.zhsw.wechat.impl;
+package com.rongwei.zhsw.system.wechat.impl;
 
-import com.rongwe.zhsw.vo.OwnerVo;
-import com.rongwe.zhsw.vo.SwUserManagementVo;
-import com.rongwe.zhsw.vo.WeChatLoginReturnVo;
-import com.rongwe.zhsw.vo.WeChatLoginVo;
+import com.rongwe.zhsw.system.vo.OwnerVo;
+import com.rongwe.zhsw.system.vo.SwUserManagementVo;
+import com.rongwe.zhsw.system.vo.WeChatLoginReturnVo;
+import com.rongwe.zhsw.system.vo.WeChatLoginVo;
 import com.rongwei.commonservice.service.RedisService;
 import com.rongwei.rwadmincommon.system.vo.JwtAuthenticationRequest;
 import com.rongwei.rwadmincommon.system.vo.SysUserVo;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.base.exception.CustomException;
 import com.rongwei.rwcommonentity.commonservers.domain.TenantDo;
-import com.rongwei.zhsw.fegin.LoginAuth;
-import com.rongwei.zhsw.dao.CommonBusinessDao;
-import com.rongwei.zhsw.service.impl.SwUserManagementServiceImpl;
-import com.rongwei.zhsw.wechat.WeChatLoginService;
-import com.rongwei.zhsw.utils.WeChatUtils;
+import com.rongwei.zhsw.system.dao.CommonBusinessDao;
+import com.rongwei.zhsw.system.fegin.LoginAuth;
+import com.rongwei.zhsw.system.service.impl.SwUserManagementServiceImpl;
+import com.rongwei.zhsw.system.utils.WeChatUtils;
+import com.rongwei.zhsw.system.wechat.WeChatLoginService;
 import org.apache.commons.lang.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -26,8 +26,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
-import static com.rongwei.zhsw.utils.SaveConstans.DEFAULT_OWNER_CACHE_SECONDS;
-import static com.rongwei.zhsw.utils.SaveConstans.REDIS_OWNER_KEY;
+import static com.rongwei.zhsw.system.utils.SaveConstans.DEFAULT_OWNER_CACHE_SECONDS;
+import static com.rongwei.zhsw.system.utils.SaveConstans.REDIS_OWNER_KEY;
 
 /**
  * WeChatLoginServiceImpl class

+ 0 - 12
zhsw-common/src/main/resources/mybatis/SwUserManagementDao.xml

@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE mapper
-        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.rongwei.zhsw.sys.dao.SwUserManagementMapper">
-
-    <update id="balanceAdd">
-        update sw_user_management set ACCOUNTBALANCE = ACCOUNTBALANCE + #{balanceAdd}
-        where  ID = #{id}
-    </update>
-</mapper>
-

+ 4 - 4
zhsw-common/src/main/resources/mybatis/zhsw/CommonBusinessDao.xml

@@ -2,9 +2,9 @@
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.rongwei.zhsw.dao.CommonBusinessDao">
+<mapper namespace="com.rongwei.zhsw.system.dao.CommonBusinessDao">
     <select id="getByIds" resultType="com.rongwei.rwcommonentity.commonservers.domain.TenantDo">
-        select * from zhsw_dev.sys_tenant where DELETED='0'
+        select * from incontrol.sys_tenant where DELETED='0'
         <if test="ids != null and !ids.isEmpty()">
             AND ID in
             <foreach collection="ids" item="id" open="(" close=")" separator=",">
@@ -13,12 +13,12 @@
         </if>
     </select>
     <select id="getById" resultType="com.rongwei.rwcommonentity.commonservers.domain.TenantDo">
-        select * from zhsw_dev.sys_tenant where DELETED='0'
+        select * from incontrol.sys_tenant where DELETED='0'
         <if test="id != null and id != ''">
             AND ID = #{id}
         </if>
     </select>
-    <select id="getOwnerInfoByDsId" resultType="com.rongwe.zhsw.vo.OwnerVo">
+    <select id="getOwnerInfoByDsId" resultType="com.rongwe.zhsw.system.vo.OwnerVo">
         select swm.ID as id ,suw.WECHATSIGN as weChatSign,#{dsId}as dsKey,swm.STATUS as status
         from ${dsId}.sw_user_management swm
             where swm.DELETED='0'

+ 1 - 1
zhsw-common/src/main/resources/mybatis/zhsw/SwBillManagementUnpaidDao.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.rongwei.zhsw.dao.SwBillManagementUnpaidDao">
+<mapper namespace="com.rongwei.zhsw.system.dao.SwBillManagementUnpaidDao">
 
     <delete id="deleteByIds">
 

+ 3 - 3
zhsw-common/src/main/resources/mybatis/zhsw/SwUserManagementDao.xml

@@ -2,14 +2,14 @@
 <!DOCTYPE mapper
         PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.rongwei.zhsw.dao.SwUserManagementDao">
+<mapper namespace="com.rongwei.zhsw.system.dao.SwUserManagementDao">
 
     <update id="balanceAdd">
         update sw_user_management
         set ACCOUNTBALANCE = ACCOUNTBALANCE + #{balanceAdd}
         where ID = #{id}
     </update>
-    <select id="getUserByDsKey" resultType="com.rongwe.zhsw.vo.SwUserManagementVo">
+    <select id="getUserByDsKey" resultType="com.rongwe.zhsw.system.vo.SwUserManagementVo">
         select * from
         <foreach collection="para" index="key" item="value" separator="union all" open="(" close=") A">
             select swm.*,#{key} as dsKey,ifnull(suw.DEFAULTACCOUNT,0) AS defaultAccount from ${key}.sw_user_management
@@ -28,7 +28,7 @@
         </foreach>
         order by defaultAccount
     </select>
-    <select id="getDataByAccountAndDsKey" resultType="com.rongwe.zhsw.domain.SwUserManagementDo">
+    <select id="getDataByAccountAndDsKey" resultType="com.rongwe.zhsw.system.domain.SwUserManagementDo">
         select * from ${deKey}.sw_user_management
         <where>
             DELETED='0'

+ 2 - 2
zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwBillManagementPaidDo.java

@@ -1,13 +1,13 @@
-package com.rongwe.zhsw.domain;
+package com.rongwe.zhsw.system.domain;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
-import java.io.Serializable;
 
 /**
  * 账单管理(按年分表)(已缴,退款)(SwBillManagementPaid)实体类

+ 2 - 2
zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwBillManagementUnpaidDo.java

@@ -1,13 +1,13 @@
-package com.rongwe.zhsw.domain;
+package com.rongwe.zhsw.system.domain;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
-import java.io.Serializable;
 
 /**
  * 账单管理(按年分表)(预收,未缴)(SwBillManagementUnpaid)实体类

+ 2 - 2
zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwBillingRecordDo.java

@@ -1,13 +1,13 @@
-package com.rongwe.zhsw.domain;
+package com.rongwe.zhsw.system.domain;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
-import java.io.Serializable;
 
 /**
  * 缴费记录(SwBillingRecord)实体类

+ 2 - 2
zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwMeterReadingCorrectionDo.java

@@ -1,13 +1,13 @@
-package com.rongwe.zhsw.domain;
+package com.rongwe.zhsw.system.domain;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
-import java.io.Serializable;
 
 @Data
 @EqualsAndHashCode(callSuper = false)

+ 4 - 4
zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwUserManagementDo.java

@@ -1,13 +1,13 @@
-package com.rongwe.zhsw.domain;
+package com.rongwe.zhsw.system.domain;
 
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
-import java.math.BigDecimal;
-import java.util.Date;
-
 import com.rongwei.rwcommon.base.BaseDo;
 import lombok.Data;
 
+import java.math.BigDecimal;
+import java.util.Date;
+
 /**
  * 用户管理
  * @TableName sw_user_management

+ 1 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwUserWechatDo.java

@@ -1,4 +1,4 @@
-package com.rongwe.zhsw.domain;
+package com.rongwe.zhsw.system.domain;
 
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;

+ 2 - 2
zhsw-entity/src/main/java/com/rongwe/zhsw/domain/SwWaterUsageEntryDo.java

@@ -1,13 +1,13 @@
-package com.rongwe.zhsw.domain;
+package com.rongwe.zhsw.system.domain;
 
 import com.baomidou.mybatisplus.annotation.TableName;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.experimental.Accessors;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
-import java.io.Serializable;
 
 /**
  * 抄表登记(SwWaterUsageEntry)实体类

+ 1 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/dto/MeterReadingCorrectionDTO.java

@@ -1,4 +1,4 @@
-package com.rongwe.zhsw.dto;
+package com.rongwe.zhsw.system.dto;
 
 import lombok.Data;
 

+ 1 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/dto/PaymentRequestDTO.java

@@ -1,4 +1,4 @@
-package com.rongwe.zhsw.dto;
+package com.rongwe.zhsw.system.dto;
 
 import lombok.Data;
 

+ 1 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/vo/AccountBindVo.java

@@ -1,4 +1,4 @@
-package com.rongwe.zhsw.vo;
+package com.rongwe.zhsw.system.vo;
 
 import lombok.Data;
 

+ 1 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/vo/ChangeDefaultAccountVo.java

@@ -1,4 +1,4 @@
-package com.rongwe.zhsw.vo;
+package com.rongwe.zhsw.system.vo;
 
 /**
  * ChangeDefaultAccountVo class

+ 1 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/vo/CurrentWechatVo.java

@@ -1,4 +1,4 @@
-package com.rongwe.zhsw.vo;
+package com.rongwe.zhsw.system.vo;
 
 import lombok.Data;
 

+ 1 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/vo/OwnerVo.java

@@ -1,4 +1,4 @@
-package com.rongwe.zhsw.vo;
+package com.rongwe.zhsw.system.vo;
 
 import lombok.Data;
 

+ 2 - 2
zhsw-entity/src/main/java/com/rongwe/zhsw/vo/SwUserManagementVo.java

@@ -1,6 +1,6 @@
-package com.rongwe.zhsw.vo;
+package com.rongwe.zhsw.system.vo;
 
-import com.rongwe.zhsw.domain.SwUserManagementDo;
+import com.rongwe.zhsw.system.domain.SwUserManagementDo;
 import lombok.Data;
 
 /**

+ 1 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/vo/WeChatLoginReturnVo.java

@@ -1,4 +1,4 @@
-package com.rongwe.zhsw.vo;
+package com.rongwe.zhsw.system.vo;
 
 import lombok.Data;
 

+ 1 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/vo/WeChatLoginVo.java

@@ -1,4 +1,4 @@
-package com.rongwe.zhsw.vo;
+package com.rongwe.zhsw.system.vo;
 
 import lombok.Data;
 

+ 1 - 1
zhsw-entity/src/main/java/com/rongwe/zhsw/vo/WeChatPickerVo.java

@@ -1,4 +1,4 @@
-package com.rongwe.zhsw.vo;
+package com.rongwe.zhsw.system.vo;
 
 import lombok.Data;
 

+ 0 - 7
zhsw-server/pom.xml

@@ -82,13 +82,6 @@
             <version>4.5.5</version>
         </dependency>
 
-        <!-- 分布式事务txlcn -->
-        <dependency>
-            <groupId>com.rongwei</groupId>
-            <artifactId>rw-txlcn-common</artifactId>
-            <version>1.1-SNAPSHOT</version>
-        </dependency>
-
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-mail</artifactId>

+ 0 - 4
zhsw-server/src/main/java/com/rongwei/ZHSWApplication.java

@@ -1,20 +1,16 @@
 package com.rongwei;
 
-import com.rongwei.rwcommonconfig.config.interceptor.BaseMetaObjectHandler;
 import org.mybatis.spring.annotation.MapperScan;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
 import org.springframework.cloud.openfeign.EnableFeignClients;
-import org.springframework.context.annotation.ComponentScan;
-import org.springframework.context.annotation.FilterType;
 import org.springframework.scheduling.annotation.EnableAsync;
 import org.springframework.scheduling.annotation.EnableScheduling;
 
 @SpringBootApplication
 @EnableDiscoveryClient
 @EnableFeignClients
-@MapperScan("com.rongwei.zhsw.dao")
 @MapperScan("com.rongwei.*.*.dao")
 @EnableAsync
 @EnableScheduling

+ 0 - 128
zhsw-server/src/main/java/com/rongwei/zhsw/aspect/DynamicDataSourceAspect.java

@@ -1,128 +0,0 @@
-package com.rongwei.zhsw.aspect;
-
-import com.rongwei.commonservice.service.RedisService;
-import com.rongwei.rwadmincommon.system.domain.SysUserDo;
-import com.rongwei.rwadmincommon.system.vo.SysUserVo;
-import com.rongwei.rwcommon.utils.StringUtils;
-import com.rongwei.rwcommonconfig.config.saas.DataSourceVo;
-import com.rongwei.rwcommonconfig.config.saas.DynamicDataSource;
-import com.rongwei.rwcommonentity.commonservers.domain.TenantDo;
-import jodd.util.StringUtil;
-import org.aspectj.lang.JoinPoint;
-import org.aspectj.lang.annotation.After;
-import org.aspectj.lang.annotation.Before;
-import org.aspectj.lang.annotation.Pointcut;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.web.context.request.RequestContextHolder;
-import org.springframework.web.context.request.ServletRequestAttributes;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-import java.util.Map;
-
-//@Aspect
-//@Component
-public class DynamicDataSourceAspect  {
-    private static final Logger logger = LoggerFactory.getLogger(DynamicDataSourceAspect.class);
-
-    // 租户模式 NONE:非租户模式;COLUMN:字段模式;SCHEMA:独立schema;DATASOURCE:独立数据源
-    @Value("${saas.tenantmode:NONE}")
-    private String saasmode;
-
-    @Autowired
-    private RedisService redisService;
-
-    private final String[] QUERY_PREFIX = {"select"};
-
-    @Pointcut("execution( * com.rongwei.zhsw.controller.*(..))" +
-            " || execution( * com.rongwei.zhsw.controller.weChat.*(..))")
-    public void daoAspect() {
-    }
-
-    @Before("daoAspect()")
-    public void switchDataSource(JoinPoint point) {
-        logger.info("Before开始...");
-        if("NONE".equals(saasmode) || StringUtils.isEmpty(saasmode)){
-            return;
-        }
-        ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
-        if(attributes == null){
-            logger.error("ServletRequestAttributes为null");
-            return;
-        }
-        HttpServletRequest request = attributes.getRequest();
-        if(request == null){
-            logger.error("HttpServletRequest为null");
-            return;
-        }
-        String token = request.getHeader("token");
-        if(token == null || "".equals(token)){
-            return;
-        }
-        // 用户
-        SysUserVo currUser = null;
-        if(StringUtil.isNotBlank(token)){
-            currUser = redisService.getLoginUser(token);
-        }
-
-        // 根据登录账号判断租户,然后根据租户切换相应的数据库
-        Map<String, List<SysUserDo>> allUsers = (Map<String,List<SysUserDo>>)redisService.getRedisCatchObj("allTenantUsers");
-        // 租户ID
-        String tenantId = null;
-        if(allUsers != null && allUsers.size()>0){
-            a: for(String key:allUsers.keySet()){
-                List<SysUserDo> users = allUsers.get(key);
-                if(users != null && users.size()>0){
-                    for(SysUserDo userDo:users){
-                        if(userDo.getAccount().equals(currUser.getAccount())){
-                            tenantId = key;
-                            break a;
-                        }
-                    }
-                }
-            }
-        }
-        if(tenantId != null){
-            List<TenantDo> tenantList = (List<TenantDo>)redisService.getRedisCatchObj("allTenants");
-            if(tenantList != null && tenantList.size()>0){
-                for(TenantDo tenantDo:tenantList){
-                    if(tenantDo.getId().equals(tenantId)){
-                        // 数据源key和当前数据源不一致时切换
-                        if(!tenantDo.getDskey().equals(DynamicDataSource.getDataSource())){
-                            DataSourceVo dataSourceVo = new DataSourceVo();
-                            dataSourceVo.setUrl(tenantDo.getDsurl());
-                            dataSourceVo.setUsername(tenantDo.getDsusername());
-                            dataSourceVo.setPassword(tenantDo.getDspassword());
-                            dataSourceVo.setDriverClassName(tenantDo.getDsdriverclassname());
-                            dataSourceVo.setDataBaseKey(tenantDo.getDskey());
-//                            SwitchDB.changeDataSource(dataSourceVo);
-                        }
-                    }
-                }
-            }
-        }
-    }
-
-    @After("daoAspect())")
-    public void restoreDataSource(JoinPoint point) {
-        logger.info("After开始...");
-        if("NONE".equals(saasmode) || StringUtils.isEmpty(saasmode)){
-            return;
-        }
-//        DynamicDataSource.clear();
-        logger.info("Restore DataSource to [{}] in Method [{}]",
-                DynamicDataSource.getDataSource(), point.getSignature());
-    }
-
-    private Boolean isQueryMethod(String methodName) {
-        for (String prefix : QUERY_PREFIX) {
-            if (methodName.startsWith(prefix)) {
-                return true;
-            }
-        }
-        return false;
-    }
-}

+ 2 - 2
zhsw-server/src/main/java/com/rongwei/zhsw/controller/LoginLogicController.java

@@ -1,9 +1,9 @@
-package com.rongwei.zhsw.controller;
+package com.rongwei.zhsw.system.controller;
 
 
 import com.rongwei.rwadmincommon.system.domain.UserLoginVo;
 import com.rongwei.rwcommon.base.R;
-import com.rongwei.zhsw.service.LoginLogicService;
+import com.rongwei.zhsw.system.service.LoginLogicService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

+ 2 - 2
zhsw-server/src/main/java/com/rongwei/zhsw/controller/OwnerController.java

@@ -1,7 +1,7 @@
-package com.rongwei.zhsw.controller;
+package com.rongwei.zhsw.system.controller;
 
 import com.rongwei.rwcommon.base.R;
-import com.rongwei.zhsw.wechat.OwnerService;
+import com.rongwei.zhsw.system.wechat.OwnerService;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

+ 3 - 4
zhsw-server/src/main/java/com/rongwei/zhsw/controller/SwBillManagementPaidController.java

@@ -1,9 +1,8 @@
-package com.rongwei.zhsw.controller;
+package com.rongwei.zhsw.system.controller;
 
 
-import org.springframework.web.bind.annotation.*;
-
-import javax.annotation.Resource;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 /**
  * 账单管理(按年分表)(已缴,退款)(SwBillManagementPaid)表控制层

+ 4 - 5
zhsw-server/src/main/java/com/rongwei/zhsw/controller/SwBillManagementUnpaidController.java

@@ -1,12 +1,11 @@
-package com.rongwei.zhsw.controller;
-import com.rongwe.zhsw.dto.MeterReadingCorrectionDTO;
+package com.rongwei.zhsw.system.controller;
+
+import com.rongwe.zhsw.system.dto.MeterReadingCorrectionDTO;
 import com.rongwei.rwcommon.base.R;
-import com.rongwei.zhsw.service.SwBillManagementUnpaidService;
+import com.rongwei.zhsw.system.service.SwBillManagementUnpaidService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
-import java.math.BigDecimal;
-
 /**
  * 账单管理(按年分表)(预收,未缴)(SwBillManagementUnpaid)表控制层
  *

+ 5 - 3
zhsw-server/src/main/java/com/rongwei/zhsw/controller/SwBillingRecordController.java

@@ -1,8 +1,10 @@
-package com.rongwei.zhsw.controller;
-import com.rongwe.zhsw.dto.PaymentRequestDTO;
+package com.rongwei.zhsw.system.controller;
+
+import com.rongwe.zhsw.system.dto.PaymentRequestDTO;
 import com.rongwei.rwcommon.base.R;
-import com.rongwei.zhsw.service.SwBillingRecordService;
+import com.rongwei.zhsw.system.service.SwBillingRecordService;
 import org.springframework.web.bind.annotation.*;
+
 import javax.annotation.Resource;
 
 /**

+ 4 - 6
zhsw-server/src/main/java/com/rongwei/zhsw/controller/SwMeterReadingCorrectionController.java

@@ -1,11 +1,9 @@
-package com.rongwei.zhsw.controller;
+package com.rongwei.zhsw.system.controller;
 
 
-import com.rongwei.zhsw.sys.service.SwMeterReadingCorrectionService;
-import org.springframework.data.domain.Page;
-import org.springframework.data.domain.PageRequest;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
+import com.rongwei.zhsw.system.service.SwMeterReadingCorrectionService;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 

+ 3 - 3
zhsw-server/src/main/java/com/rongwei/zhsw/controller/weChat/AccountController.java

@@ -1,8 +1,8 @@
-package com.rongwei.zhsw.controller.weChat;
+package com.rongwei.zhsw.system.controller.weChat;
 
-import com.rongwe.zhsw.vo.AccountBindVo;
+import com.rongwe.zhsw.system.vo.AccountBindVo;
 import com.rongwei.rwcommon.base.R;
-import com.rongwei.zhsw.wechat.impl.AccountServiceImpl;
+import com.rongwei.zhsw.system.wechat.impl.AccountServiceImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

+ 3 - 3
zhsw-server/src/main/java/com/rongwei/zhsw/controller/weChat/LoginController.java

@@ -1,8 +1,8 @@
-package com.rongwei.zhsw.controller.weChat;
+package com.rongwei.zhsw.system.controller.weChat;
 
-import com.rongwe.zhsw.vo.WeChatLoginVo;
+import com.rongwe.zhsw.system.vo.WeChatLoginVo;
 import com.rongwei.rwcommon.base.R;
-import com.rongwei.zhsw.wechat.impl.WeChatLoginServiceImpl;
+import com.rongwei.zhsw.system.wechat.impl.WeChatLoginServiceImpl;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;

+ 4 - 1
zhsw-server/src/main/resources/bootstrap.yml

@@ -1,3 +1,6 @@
+logging:
+  level:
+    org.mybatis: DEBUG
 spring:
   profiles:
     active: dev
@@ -43,7 +46,7 @@ mybatis-plus:
   basepackage: com.rongwei.*.dao
   xmlLocation: classpath:mybatis/**/*Dao.xml
   mapperLocations: "classpath:mybatis/**/*Dao.xml"
-  typeAliasesPackage: com.rongwei.zhsw.domain
+  typeAliasesPackage: com.rongwei.zhsw.**.domain
   global-config:
     db-config:
       logic-delete-value: 1