1
0

12 Ревизии 1dfed12b93 ... afc354df75

Автор SHA1 Съобщение Дата
  涂汝杰 1dfed12b93 Initial commit преди 2 години
  fangpy afc354df75 业务服务优化 преди 2 години
  fangpy 2cbb743a1a 业务服务优化 преди 2 години
  fangpy da26b6a3c4 业务服务优化 преди 2 години
  fangpengyuan 8c33c8e042 更新pom.xml преди 3 години
  guozhuang f3ebecf8cb Revert "初始化提交" преди 3 години
  guozhuang 403f1a8335 初始化提交 преди 3 години
  fangpy cd5f695702 业务服务优化 преди 4 години
  fangpy e100a3f5ff 业务服务规范标准初始化 преди 4 години
  fangpy 9e26510788 业务服务规范标准初始化 преди 4 години
  fangpy 3fb6c98574 业务服务规范标准初始化 преди 4 години
  fangpy 9a10508760 业务服务规范标准 преди 4 години

+ 13 - 0
.gitignore

@@ -0,0 +1,13 @@
+# Created by .ignore support plugin (hsz.mobi)
+.idea/.name
+.idea/compiler.xml
+.idea/encodings.xml
+.idea/libraries/
+.idea/misc.xml
+.idea/modules.xml
+.idea/vcs.xml
+business-common/business-common.iml
+business-entity/business-entity.iml
+business-server/business-server.iml
+business-server/src/test/
+rw-business.iml

+ 0 - 3
README.md

@@ -1,3 +0,0 @@
-# business-sever
-
-项目二开服务

+ 38 - 0
business-common/pom.xml

@@ -0,0 +1,38 @@
+<?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>rw-business</artifactId>
+        <groupId>com.rongwei</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>business-common</artifactId>
+
+    <properties>
+        <mysql.version>8.0.11</mysql.version>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.rongwei</groupId>
+            <artifactId>business-entity</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>com.baomidou</groupId>
+            <artifactId>mybatis-plus-generator</artifactId>
+            <version>3.1.2</version>
+        </dependency>
+
+        <dependency>
+            <groupId>mysql</groupId>
+            <artifactId>mysql-connector-java</artifactId>
+            <version>${mysql.version}</version>
+        </dependency>
+
+    </dependencies>
+</project>

+ 97 - 0
business-common/src/main/java/com/rongwei/bscommon/sys/utils/CodeGeneration.java

@@ -0,0 +1,97 @@
+package com.rongwei.bscommon.sys.utils;
+
+import com.baomidou.mybatisplus.annotation.DbType;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.generator.AutoGenerator;
+import com.baomidou.mybatisplus.generator.InjectionConfig;
+import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
+import com.baomidou.mybatisplus.generator.config.GlobalConfig;
+import com.baomidou.mybatisplus.generator.config.PackageConfig;
+import com.baomidou.mybatisplus.generator.config.StrategyConfig;
+import com.baomidou.mybatisplus.generator.config.po.TableFill;
+import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
+
+import java.util.ArrayList;
+
+/**
+ * @author admin
+ */
+public class CodeGeneration {
+
+    //main函数
+    public static void main(String[] args) {
+
+        AutoGenerator autoGenerator = new AutoGenerator();
+
+        //全局配置
+        GlobalConfig gc = new GlobalConfig();
+        String oPath = System.getProperty("user.dir");//得到当前项目的路径
+        gc.setOutputDir("C:\\Users\\admin\\Desktop");   //生成文件输出根目录
+        gc.setOpen(false);//生成完成后不弹出文件框
+        gc.setFileOverride(true);  //文件覆盖
+        gc.setActiveRecord(false);// 不需要ActiveRecord特性的请改为false
+        gc.setEnableCache(false);// XML 二级缓存
+        gc.setBaseResultMap(true);// XML ResultMap
+        gc.setBaseColumnList(false);// XML columList
+        gc.setAuthor("fpy");// 作者
+
+        // 自定义文件命名,注意 %s 会自动填充表实体属性!
+        gc.setControllerName("%sController");
+        gc.setServiceName("%sService");
+        gc.setServiceImplName("%sServiceImpl");
+        gc.setMapperName("%sMapper");
+        gc.setXmlName("%sMapper");
+        autoGenerator.setGlobalConfig(gc);
+
+        // 数据源配置
+        DataSourceConfig dsc = new DataSourceConfig();
+        dsc.setDbType(DbType.MYSQL);   //设置数据库类型,我是postgresql
+        dsc.setDriverName("com.mysql.cj.jdbc.Driver");
+        dsc.setUsername("root");
+        dsc.setPassword("Incontrol@Rgs!2021");
+        dsc.setUrl("jdbc:mysql://49.73.84.232:3306/rgs002268?characterEncoding=utf8&failOverReadOnly=false&autoReconnect=true&roundRobinLoadBalance=true&serverTimezone=GMT%2B8&useSSL=false");  //指定数据库
+        autoGenerator.setDataSource(dsc);
+
+        // 3、包的配置
+        PackageConfig pc = new PackageConfig();
+        // pc.setModuleName("blog"); // 生成到指定模块中
+        pc.setParent("cn.com");
+        pc.setEntity("entity");
+        pc.setMapper("mapper");
+        pc.setService("service");
+        pc.setController("controller");
+        autoGenerator.setPackageInfo(pc);
+
+        // 4、策略配置
+        StrategyConfig strategy = new StrategyConfig();
+        // 设置要映射的表名(重要,需要修改的地方)
+        strategy.setInclude("qc_models_material_type");
+        strategy.setNaming(NamingStrategy.underline_to_camel); // 自动转换表名的驼峰命名法
+        strategy.setColumnNaming(NamingStrategy.no_change); // 自动转换列名的驼峰命名法
+        strategy.setEntityLombokModel(true); // 是否使用lombox
+        strategy.setLogicDeleteFieldName("deleted"); // 配置逻辑删除字段
+        // 自动填充策略
+        TableFill gmtCreate =  new TableFill("create", FieldFill.INSERT);
+        TableFill gmtModified =  new TableFill("updated", FieldFill.INSERT);
+        ArrayList<TableFill> tableFills = new ArrayList<>();
+        tableFills.add(gmtCreate);
+        tableFills.add(gmtModified);
+//        strategy.setTableFillList(tableFills);
+        // 乐观锁
+        strategy.setVersionFieldName("version");
+
+        autoGenerator.setStrategy(strategy);
+
+        // 自定义配置
+        InjectionConfig cfg = new InjectionConfig() {
+            @Override
+            public void initMap() {
+                // to do nothing
+            }
+        };
+        autoGenerator.setCfg(cfg);
+
+        autoGenerator.execute(); // 执行
+    }
+
+}

+ 33 - 0
business-entity/pom.xml

@@ -0,0 +1,33 @@
+<?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>rw-business</artifactId>
+        <groupId>com.rongwei</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>business-entity</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.rongwei</groupId>
+            <artifactId>rw-common-config</artifactId>
+            <version>1.1-SNAPSHOT</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>com.rongwei</groupId>
+                    <artifactId>rw-common-license</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
+
+        <dependency>
+            <groupId>com.rongwei</groupId>
+            <artifactId>rw-common-utils</artifactId>
+            <version>1.1-SNAPSHOT</version>
+        </dependency>
+    </dependencies>
+</project>

+ 87 - 0
business-server/pom.xml

@@ -0,0 +1,87 @@
+<?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>rw-business</artifactId>
+        <groupId>com.rongwei</groupId>
+        <version>1.0-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>business-server</artifactId>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.rongwei</groupId>
+            <artifactId>business-common</artifactId>
+            <version>1.0-SNAPSHOT</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-actuator</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+
+        <!-- Spring Cloud Begin -->
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.alibaba.nacos</groupId>
+            <artifactId>nacos-client</artifactId>
+            <version>1.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-freemarker</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-jdbc</artifactId>
+        </dependency>
+
+        <!-- druid -->
+        <dependency>
+            <groupId>com.github.drtrang</groupId>
+            <artifactId>druid-spring-boot2-starter</artifactId>
+            <version>1.1.10</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.springframework.boot</groupId>
+                <artifactId>spring-boot-maven-plugin</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>

+ 21 - 0
business-server/src/main/java/com/rongwei/BusinessServerApplication.java

@@ -0,0 +1,21 @@
+package com.rongwei;
+
+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.scheduling.annotation.EnableAsync;
+
+@EnableAsync
+@SpringBootApplication
+@EnableDiscoveryClient
+@EnableFeignClients
+@MapperScan("com.rongwei.*.*.dao")
+public class BusinessServerApplication {
+
+    public static void main(String[] args) {
+        SpringApplication.run(BusinessServerApplication.class, args);
+    }
+
+}

+ 13 - 0
business-server/src/main/resources/bootstrap-dev.yml

@@ -0,0 +1,13 @@
+spring:
+  cloud:
+    nacos:
+      config:
+        file-extension: yaml
+        server-addr: 127.0.0.1:8848
+        namespace: cd047569-9470-4dfb-8663-b113d01cd30f
+        ext-config[0]:
+          data-id: common-config.yaml
+      discovery:
+        server-addr: 127.0.0.1:8848
+        namespace: cd047569-9470-4dfb-8663-b113d01cd30f
+

+ 10 - 0
business-server/src/main/resources/bootstrap-pro.yml

@@ -0,0 +1,10 @@
+spring:
+  cloud:
+    nacos:
+      config:
+        file-extension: yaml
+        server-addr: 127.0.0.1:8848
+        namespace: 75f91d9a-0dd2-4dd9-98f6-61a221d396f1
+      discovery:
+        server-addr: 127.0.0.1:8848
+        namespace: 75f91d9a-0dd2-4dd9-98f6-61a221d396f1

+ 53 - 0
business-server/src/main/resources/bootstrap.yml

@@ -0,0 +1,53 @@
+spring:
+  profiles:
+    active: dev
+  application:
+    name: rw-business-server
+  jta:
+    atomikos:
+      properties:
+        log-base-name: rwbusinesslog
+  servlet:
+    multipart:
+      max-file-size: 100MB
+      max-request-size: 1000MB
+server:
+  port: 9689
+
+management:
+  endpoints:
+    web:
+      exposure:
+        include: "*"
+feign:
+  client:
+    config:
+      default:
+        connectTimeout: 5000
+        readTimeout: 5000
+  sentinel:
+    enabled: true
+jwt:
+  token-header: Authorization
+  expire: 14400
+  rsa-secret: xx1WET12^%3^(WE45
+client:
+  id: ace-auth
+  secret: 123456
+  token-header: x-client-token
+  expire: 14400
+  rsa-secret: x2318^^(*WRYQWR(QW&T
+mybatis-plus:
+  configuration:
+    #    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
+    log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
+    map-underscore-to-camel-case: false
+  #basepackage: com.rongwei.rwadmin.system.dao
+  xmlLocation: classpath:mybatis/**/*Dao.xml
+  mapperLocations: "classpath:mybatis/**/*Dao.xml"
+  typeAliasesPackage: com.rongwei.bsentity.domain
+  global-config:
+    db-config:
+      logic-delete-value: 1
+      logic-not-delete-value: 0
+      column-like: true

+ 36 - 0
business-server/src/main/resources/logback-spring.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<configuration  scan="true" scanPeriod="60 seconds" debug="false">
+    <contextName>logback</contextName>
+    <!--输出到控制台-->
+    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d{HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>
+        </encoder>
+    </appender>
+
+    <!--按天生成日志-->
+    <appender name="logFile"  class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <Prudent>true</Prudent>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <FileNamePattern>
+                business-log/%d{yyyy-MM-dd}/%d{yyyy-MM-dd}.log
+            </FileNamePattern>
+        </rollingPolicy>
+        <layout class="ch.qos.logback.classic.PatternLayout">
+            <Pattern>
+                %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level -%msg%n
+            </Pattern>
+        </layout>
+    </appender>
+
+    <logger name="com.bootdo" additivity="false">
+        <appender-ref ref="console"/>
+        <appender-ref ref="logFile" />
+    </logger>
+
+    <root level="error">
+        <appender-ref ref="console"/>
+        <appender-ref ref="logFile" />
+    </root>
+
+</configuration>

+ 165 - 0
pom.xml

@@ -0,0 +1,165 @@
+<?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">
+    <modelVersion>4.0.0</modelVersion>
+
+    <groupId>com.rongwei</groupId>
+    <artifactId>rw-business</artifactId>
+    <version>1.0-SNAPSHOT</version>
+    <modules>
+        <module>business-server</module>
+        <module>business-common</module>
+        <module>business-entity</module>
+    </modules>
+
+    <!--<parent>
+        <groupId>org.springframework.boot</groupId>
+        <artifactId>spring-boot-starter-parent</artifactId>
+        <version>2.1.2.RELEASE</version>
+    </parent>-->
+
+    <parent>
+        <artifactId>InControl</artifactId>
+        <groupId>com.rongwei</groupId>
+        <version>1.1-SNAPSHOT</version>
+    </parent>
+
+    <properties>
+        <!--<docker.image.prefix>ag</docker.image.prefix>-->
+        <!--<docker.plugin.version>0.4.13</docker.plugin.version>-->
+        <mapper.version>3.4.0</mapper.version>
+        <maven.compile.source>1.8</maven.compile.source>
+        <maven.compile.target>1.8</maven.compile.target>
+        <fastjson.version>1.2.31</fastjson.version>
+        <!--<boot.admin.client>2.1.2</boot.admin.client>-->
+    </properties>
+
+    <packaging>pom</packaging>
+
+    <dependencies>
+        <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
+        <dependency>
+            <groupId>org.projectlombok</groupId>
+            <artifactId>lombok</artifactId>
+            <version>1.16.14</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>com.alibaba</groupId>
+            <artifactId>fastjson</artifactId>
+            <version>${fastjson.version}</version>
+        </dependency>
+    </dependencies>
+
+    <repositories>
+        <repository>
+            <id>oss</id>
+            <name>oss</name>
+            <url>https://oss.sonatype.org/content/groups/public</url>
+        </repository>
+        <repository>
+            <id>spring-milestones</id>
+            <name>Spring Milestones</name>
+            <url>https://repo.spring.io/libs-milestone</url>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </repository>
+        <repository>
+            <id>sonatype-nexus-snapshots</id>
+            <name>Sonatype Nexus Snapshots</name>
+            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
+        </repository>
+    </repositories>
+
+    <!--依赖管理,用于管理spring-cloud的依赖,其中Camden.SR3是版本号-->
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-dependencies</artifactId>
+                <version>Greenwich.RELEASE</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+            <dependency>
+                <groupId>com.alibaba</groupId>
+                <artifactId>fastjson</artifactId>
+                <version>1.2.33</version>
+            </dependency>
+            <dependency>
+                <groupId>org.springframework.cloud</groupId>
+                <artifactId>spring-cloud-alibaba-dependencies</artifactId>
+                <version>0.2.1.RELEASE</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+
+    <distributionManagement>
+        <snapshotRepository>
+            <id>ossrh</id>
+            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
+        </snapshotRepository>
+        <repository>
+            <id>ossrh</id>
+            <name>Maven Central Staging Repository</name>
+            <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
+        </repository>
+    </distributionManagement>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>versions-maven-plugin</artifactId>
+                <version>2.7</version>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-compiler-plugin</artifactId>
+                <version>${maven-compiler-plugin.version}</version>
+                <configuration>
+                    <source>${maven.compile.source}</source>
+                    <target>${maven.compile.target}</target>
+                    <encoding>${project.build.sourceEncoding}</encoding>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <version>2.4</version>
+                <executions>
+                    <execution>
+                        <id>attach-sources</id>
+                        <goals>
+                            <goal>jar-no-fork</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-deploy-plugin</artifactId>
+                <version>2.8.2</version>
+            </plugin>
+            <!--<plugin>-->
+            <!--<groupId>org.apache.maven.plugins</groupId>-->
+            <!--<artifactId>maven-javadoc-plugin</artifactId>-->
+            <!--<version>2.10.3</version>-->
+            <!--<executions>-->
+            <!--<execution>-->
+            <!--<id>attach-javadocs</id>-->
+            <!--<goals>-->
+            <!--<goal>jar</goal>-->
+            <!--</goals>-->
+            <!--</execution>-->
+            <!--</executions>-->
+            <!--</plugin>-->
+        </plugins>
+    </build>
+</project>