Browse Source

适配进销存接口 增加p6spy日志

zyh
Loki 3 years ago
parent
commit
e6b21e3a49
  1. 6
      yudao-server/pom.xml
  2. 19
      yudao-server/src/main/resources/application-local.yaml
  3. 2
      yudao-server/src/main/resources/application.yaml
  4. 24
      yudao-server/src/main/resources/spy.properties
  5. 2
      zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Function.java
  6. 2
      zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InventorySeason.java
  7. 2
      zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Material.java
  8. 2
      zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCurrentStock.java
  9. 2
      zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialExtend.java
  10. 2
      zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialInitialStock.java
  11. 2
      zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SystemConfig.java

6
yudao-server/pom.xml

@ -85,6 +85,12 @@
<artifactId>yudao-spring-boot-starter-protection</artifactId>
</dependency>
<dependency>
<groupId>p6spy</groupId>
<artifactId>p6spy</artifactId>
<version>3.9.1</version>
</dependency>
</dependencies>
<build>

19
yudao-server/src/main/resources/application-local.yaml

@ -44,31 +44,32 @@ spring:
datasource:
master:
name: ruoyi-vue-pro
url: jdbc:mysql://192.168.10.250:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:p6spy:mysql://192.168.10.250:3306/${spring.datasource.dynamic.datasource.master.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
# driver-class-name: com.mysql.jdbc.Driver
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
username: root
password: root
slave: # 模拟从库,可根据自己需要修改
name: ruoyi-vue-pro
url: jdbc:mysql://192.168.10.250:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:p6spy:mysql://192.168.10.250:3306/${spring.datasource.dynamic.datasource.slave.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
username: root
password: root
bxg: # 农场数据源
name: bxg
url: jdbc:mysql://192.168.10.250:3306/${spring.datasource.dynamic.datasource.bxg.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:p6spy:mysql://192.168.10.250:3306/${spring.datasource.dynamic.datasource.bxg.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
username: root
password: root
erp: # 进销存
name: erp
url: jdbc:mysql://192.168.10.250:3306/${spring.datasource.dynamic.datasource.erp.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
driver-class-name: com.mysql.jdbc.Driver
url: jdbc:p6spy:mysql://192.168.10.250:3306/${spring.datasource.dynamic.datasource.erp.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
username: root
password: root
# farm: # 农场数据源
# name: zsw-farm
# url: jdbc:mysql://192.168.10.129:3306/${spring.datasource.dynamic.datasource.farm.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
# url: jdbc:p6spy:mysql://192.168.10.129:3306/${spring.datasource.dynamic.datasource.farm.name}?useSSL=false&allowPublicKeyRetrieval=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=CTT
# driver-class-name: com.mysql.jdbc.Driver
# username: root
# password: root

2
yudao-server/src/main/resources/application.yaml

@ -127,6 +127,8 @@ yudao:
- infra_job_log
- infra_job_log
- yx_system_city
- jsh_sequence
- jsh_material_property
sms-code: # 短信验证码相关的配置项
expire-times: 10m
send-frequency: 1m

24
yudao-server/src/main/resources/spy.properties

@ -0,0 +1,24 @@
#3.2.1以上使用
modulelist=com.baomidou.mybatisplus.extension.p6spy.MybatisPlusLogFactory,com.p6spy.engine.outage.P6OutageFactory
#3.2.1以下使用或者不配置
#modulelist=com.p6spy.engine.logging.P6LogFactory,com.p6spy.engine.outage.P6OutageFactory
# 自定义日志打印
logMessageFormat=com.baomidou.mybatisplus.extension.p6spy.P6SpyLogger
#日志输出到控制台
appender=com.baomidou.mybatisplus.extension.p6spy.StdoutLogger
# 使用日志系统记录 sql
#appender=com.p6spy.engine.spy.appender.Slf4JLogger
# 设置 p6spy driver 代理
deregisterdrivers=true
# 取消JDBC URL前缀
useprefix=true
# 配置记录 Log 例外,可去掉的结果集有error,info,batch,debug,statement,commit,rollback,result,resultset.
excludecategories=info,debug,result,commit,resultset
# 日期格式
dateformat=yyyy-MM-dd HH:mm:ss
# 实际驱动可多个
#driverlist=org.h2.Driver
# 是否开启慢SQL记录
outagedetection=true
# 慢SQL记录标准 2 秒
outagedetectioninterval=2

2
zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Function.java

@ -1,7 +1,9 @@
package com.zsw.erp.datasource.entities;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
@TableName("jsh_function")
public class Function {
@TableId(type = IdType.AUTO)
private Long id;

2
zsw-erp/src/main/java/com/zsw/erp/datasource/entities/InventorySeason.java

@ -3,11 +3,13 @@ package com.zsw.erp.datasource.entities;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.time.LocalDateTime;
@Data
@TableName("jsh_inventory_season")
public class InventorySeason {
@TableId(type = IdType.AUTO)

2
zsw-erp/src/main/java/com/zsw/erp/datasource/entities/Material.java

@ -3,11 +3,13 @@ package com.zsw.erp.datasource.entities;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.math.BigDecimal;
@Data
@TableName("jsh_material")
public class Material {
@TableId(type = IdType.AUTO)

2
zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialCurrentStock.java

@ -1,5 +1,6 @@
package com.zsw.erp.datasource.entities;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -8,6 +9,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
@Data
@TableName("jsh_material_current_stock")
public class MaterialCurrentStock {
@TableId(type = IdType.AUTO)
private Long id;

2
zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialExtend.java

@ -1,5 +1,6 @@
package com.zsw.erp.datasource.entities;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
@Data
@TableName("jsh_material_extend")
public class MaterialExtend {
@TableId(type = IdType.AUTO)
private Long id;

2
zsw-erp/src/main/java/com/zsw/erp/datasource/entities/MaterialInitialStock.java

@ -1,6 +1,7 @@
package com.zsw.erp.datasource.entities;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -9,6 +10,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
@Data
@TableName("jsh_material_initial_stock")
public class MaterialInitialStock {
@TableId(type = IdType.AUTO)
private Long id;

2
zsw-erp/src/main/java/com/zsw/erp/datasource/entities/SystemConfig.java

@ -2,9 +2,11 @@ package com.zsw.erp.datasource.entities;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@Data
@TableName("jsh_system_config")
public class SystemConfig {
@TableId(type = IdType.AUTO)
private Long id;

Loading…
Cancel
Save