From 8e85fbc2fd01ff3a057ebb0b90505fe433c355f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=BA=86=E5=90=89?= <51312040@qq.com> Date: Fri, 14 May 2021 09:28:23 +0800 Subject: [PATCH 01/25] =?UTF-8?q?=E4=BF=AE=E6=94=B9sim=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sim.yaml | 116 ++++++++++++++++ src/main/resources/application-sim.yml | 181 +++++++++++++++++++++++++ src/main/resources/application.yml | 2 +- 3 files changed, 298 insertions(+), 1 deletion(-) create mode 100644 sim.yaml create mode 100644 src/main/resources/application-sim.yml diff --git a/sim.yaml b/sim.yaml new file mode 100644 index 0000000..3496368 --- /dev/null +++ b/sim.yaml @@ -0,0 +1,116 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: biz-service-ebtp-extend #[1] Deployment名称,可填写微服务名称 + namespace: default + labels: + app: biz-service-ebtp-extend + +spec: + replicas: 3 + strategy: + rollingUpdate: + maxSurge: 1 + maxUnavailable: 1 + selector: + matchLabels: + app: biz-service-ebtp-extend #[2] 选择器匹配时标签名称,可填写微服务名称 + template: + metadata: + labels: + app: biz-service-ebtp-extend #[3] 模板名称,可填写微服务名称 + annotations: + prometheus.io/port: '18018' + prometheus.io/jl-pod: 'true' + spec: + volumes: + - name: log + persistentVolumeClaim: + claimName: log-pvc + readOnly: false + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - biz-service-ebtp-extend + topologyKey: "kubernetes.io/hostname" + containers: + - name: biz-service-ebtp-extend #[6] 必选,容器名称,可填写微服务名称 + image: harbor.dcos.guangzhou.unicom.local/eshop/biz-service-ebtp-extend:latest #[7] 镜像名称,请把biz-service-ebtp-extend替换为服务名称 + args: ["java","-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)", "-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-Dspring.profiles.active=sim", "-jar", "/app.jar"] + volumeMounts: + - name: log + mountPath: /log + ports: + - containerPort: 18018 #[8] 容器需要监听的端口号,与配置文件中的server.port参数相同,与参数[4]相同 + #livenessProbe: + # failureThreshold: 3 + # httpGet: + # port: 18018 #[11] pod存活检测端口,修改为该微服务配置文件中server.port的端口号,与参数[5]相同 + # path: /actuator/prometheus + # scheme: HTTP + # initialDelaySeconds: 300 + # periodSeconds: 60 + # successThreshold: 1 + # timeoutSeconds: 2 + #readinessProbe: + # failureThreshold: 1 + # httpGet: + # port: 18018 #[12] pod就绪检测端口,修改为该微服务配置文件中server.port的端口号,与参数[5]相同 + # path: /actuator/prometheus + # scheme: HTTP + # periodSeconds: 5 + # successThreshold: 2 + # timeoutSeconds: 2 + resources: + requests: + cpu: 1000m + memory: 2Gi + limits: + cpu: 3000m + memory: 6Gi + env: + - name: APP_NAME + value: biz_ebtp_extend + - name: AGENT_LICENCE + value: 527BFA7B28577578 + - name: APOLLO_CONFIGSERVICE + value: http://apollo-configservice:8080 + - name: MY_POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: JAVA_TOOL_OPTIONS + value: + -XX:+UnlockExperimentalVMOptions + -XX:+UseContainerSupport + -XX:+UseCGroupMemoryLimitForHeap + -XX:InitialRAMPercentage=40.0 + -XX:MinRAMPercentage=20.0 + -XX:MaxRAMPercentage=80.0 +--- +kind: Service +apiVersion: v1 +metadata: + name: biz-service-ebtp-extend-svc # [11] service的名字,格式为“服务名-svc” + namespace: default + labels: + service: biz-service-ebtp-extend-svc # [12] service的标签,可与参数[11]相同 + annotations: + prometheus.io/port: '18018' #[13] prometheus自动发现service的端口,也是该微服务所使用的端口,与参数[4]相同 + prometheus.io/jl-svc: 'true' + +spec: + ports: + - port: 18018 #[15] 与参数4相同 + targetPort: 18018 #[16] 与参数4相同 + selector: + app: biz-service-ebtp-extend #[17] 该service对应Deployment的名字,与参数[1]相同 +--- + + + diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml new file mode 100644 index 0000000..84c8591 --- /dev/null +++ b/src/main/resources/application-sim.yml @@ -0,0 +1,181 @@ +server: + port: 18018 + servlet: + context-path: / + +seata: + service: + vgroup-mapping: + biz-service-ebtp-extend-service-group: seata-server-jl + registry: + type: eureka + eureka: + serviceUrl: http://eureka-1-svc:8080/eureka,http://eureka-2-svc:8080/eureka,http://eureka-3-svc:8080/eureka + +# 对应 apollo 配置中心的应用名 +app: + id: biz-service-ebtp-extend + +# Apollo 配置信息 +apollo: + meta: http://10.242.31.54:6002/ + bootstrap: + namespace: application + enabled: true + eagerLoad: + enabled: true + +spring: + aop: + auto: true #开启spring的aop配置 + proxy-target-class: true + + application: + name: biz-service-ebtp-extend + + shardingsphere: + datasource: + names: ds0 + ds0: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + username: mall + password: unicom + jdbc-url: jdbc:mysql://10.125.160.44:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://10.125.160.44:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + filters: stat,wall,log4j + maxActive: 20 + initialSize: 1 + maxWait: 60000 + minIdle: 1 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + connection-properties: druid.stat.merggSql=ture;druid.stat.slowSqlMillis=5000 + props: + sql: + show: true + + jackson: + date-format: yyyy-MM-dd HH:mm:ss + time-zone: GMT+8 + serialization: + write-dates-as-timestamps: false + + # 天宫Kafka增加了安全认证,需要配置安全属性 + kafka: + bootstrap-servers: 10.125.164.24:32002,10.125.164.192:32096,10.125.164.89:32002 + template: + default-topic: jl_eshop + + # 生产者配置参数 + producer: + client-id: core-service-ebtp-crypt + properties: + security.protocol: SASL_PLAINTEXT + sasl.mechanism: SCRAM-SHA-256 + sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="eshop-kafka" password="Unicom#135"; + + # 消费者配置参数 + consumer: + group-id: core-service-ebtp-crypt-consumer + auto-offset-reset: latest + properties: + security.protocol: SASL_PLAINTEXT + sasl.mechanism: SCRAM-SHA-256 + sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="eshop-kafka" password="Unicom#135"; + + # 生产区 redis 配置 + redis: + sentinel: + master: 10.125.164.23:32516 + nodes: 10.125.164.24:32510,10.125.164.90:32515,10.125.164.89:32516 + password: Unicom#135 + +# 天宫Eureka配置 +eureka: + client: + service-url: + defaultZone: http://eureka-1-svc:8080/eureka,http://eureka-2-svc:8080/eureka,http://eureka-3-svc:8080/eureka + instance: + prefer-ip-address: true + instance-ip: ${spring.cloud.client.ip-address}:${server.port} + +mybatis-plus: + configuration: + # 是否开启自动驼峰命名规则映射:从数据库列名到Java属性驼峰命名的类似映射 + map-underscore-to-camel-case: true + auto-mapping-behavior: full + # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用 + log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + mapper-locations: classpath*:com/chinaunicom/mall/ebtp/**/mapper/*Mapper.xml + global-config: + # 逻辑删除配置 + db-config: + # logic-delete-field: flag # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2) @TableLogic + logic-delete-value: deleted # 逻辑已删除值 + logic-not-delete-value: normal # 逻辑未删除值 + +# --------------feign ------------ +feign: + httpclient: + enabled: false + okhttp: + enabled: true + client: + config: + default: + connect-timeout: 20000 + read-timeout: 20000 + +hystrix: + command: + default: + execution: + timeout: + enabled: true + isolation: + strategy: SEMAPHORE + thread: + timeoutInMilliseconds: 200000 #熔断超时时间 + circuitBreaker: + sleepWindowInMilliseconds: 20000 + forceClosed: true + +ribbon: + ReadTimeout: 20000 #请求处理的超时时间 + ConnectTimeout: 20000 #请求连接超时时间 + MaxAutoRetries: 0 #对当前实例的重试次数 + MaxAutoRetriesNextServer: 1 #切换实例的重试次数 1 + +mconfig: + workerId: 1 + datacenterId: 1 + # 服务名 + feign: + name: + open: biz-service-ebtp-opening #开标大厅服务 + process: biz-service-ebtp-process #评审流程服务 + project: biz-service-ebtp-project #项目服务 + resps: biz-service-ebtp-resps #应答结构化服务 + rsms: biz-service-ebtp-rsms #评审结构化服务 + tender: biz-service-ebtp-tender #投标服务 + documentcenter: core-service-document-center #文档中心 + +document: + clientHttpUrl: http://10.238.25.112:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749 + +# 用户暴露给 prometheus 的健康数据 +management: + endpoints: + web: + exposure: + include: "*" + cors: + allowed-origins: "*" + allowed-methods: "*" diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index f2b90d5..bd2fba5 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,3 +1,3 @@ spring: profiles: - active: uat \ No newline at end of file + active: sim \ No newline at end of file From 4fe1d2814b4288fe818a16655b55cd07fa3bfe9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Fri, 14 May 2021 14:44:23 +0800 Subject: [PATCH 02/25] Update application-sim.yml --- src/main/resources/application-sim.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml index 84c8591..3e8aaa6 100644 --- a/src/main/resources/application-sim.yml +++ b/src/main/resources/application-sim.yml @@ -18,7 +18,7 @@ app: # Apollo 配置信息 apollo: - meta: http://10.242.31.54:6002/ + meta: http://10.242.31.54:6001 bootstrap: namespace: application enabled: true @@ -41,8 +41,8 @@ spring: driver-class-name: com.mysql.cj.jdbc.Driver username: mall password: unicom - jdbc-url: jdbc:mysql://10.125.160.44:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true - url: jdbc:mysql://10.125.160.44:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + jdbc-url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true filters: stat,wall,log4j maxActive: 20 initialSize: 1 @@ -79,7 +79,7 @@ spring: properties: security.protocol: SASL_PLAINTEXT sasl.mechanism: SCRAM-SHA-256 - sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="eshop-kafka" password="Unicom#135"; + sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="eshop-kafka-sim" password="Unicom#135"; # 消费者配置参数 consumer: @@ -88,12 +88,12 @@ spring: properties: security.protocol: SASL_PLAINTEXT sasl.mechanism: SCRAM-SHA-256 - sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="eshop-kafka" password="Unicom#135"; + sasl.jaas.config: org.apache.kafka.common.security.scram.ScramLoginModule required username="eshop-kafka-sim" password="Unicom#135"; # 生产区 redis 配置 redis: sentinel: - master: 10.125.164.23:32516 + master: eshop-redis-sim nodes: 10.125.164.24:32510,10.125.164.90:32515,10.125.164.89:32516 password: Unicom#135 @@ -168,7 +168,7 @@ mconfig: documentcenter: core-service-document-center #文档中心 document: - clientHttpUrl: http://10.238.25.112:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749 + clientHttpUrl: http://10.242.31.54:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749 # 用户暴露给 prometheus 的健康数据 management: From e8319836b59668a047343d4509e4c20d4c6c51dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Wed, 26 May 2021 18:01:41 +0800 Subject: [PATCH 03/25] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=8C=82=E5=9C=A8=E5=8D=B7=E4=BD=8D=E7=BD=AE=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0k8s=E6=8E=A2=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sim.yaml | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/sim.yaml b/sim.yaml index 3496368..d507c81 100644 --- a/sim.yaml +++ b/sim.yaml @@ -22,11 +22,11 @@ spec: annotations: prometheus.io/port: '18018' prometheus.io/jl-pod: 'true' - spec: + spec: volumes: - - name: log - persistentVolumeClaim: - claimName: log-pvc + - name: log + hostPath: + path: /var/lib/docker/log/349553515466-preprod/default-group/all readOnly: false affinity: podAntiAffinity: @@ -41,31 +41,31 @@ spec: containers: - name: biz-service-ebtp-extend #[6] 必选,容器名称,可填写微服务名称 image: harbor.dcos.guangzhou.unicom.local/eshop/biz-service-ebtp-extend:latest #[7] 镜像名称,请把biz-service-ebtp-extend替换为服务名称 - args: ["java","-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)", "-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-Dspring.profiles.active=sim", "-jar", "/app.jar"] + args: ["java","-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)", "-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-jar", "/app.jar"] volumeMounts: - name: log mountPath: /log ports: - - containerPort: 18018 #[8] 容器需要监听的端口号,与配置文件中的server.port参数相同,与参数[4]相同 - #livenessProbe: - # failureThreshold: 3 - # httpGet: - # port: 18018 #[11] pod存活检测端口,修改为该微服务配置文件中server.port的端口号,与参数[5]相同 - # path: /actuator/prometheus - # scheme: HTTP - # initialDelaySeconds: 300 - # periodSeconds: 60 - # successThreshold: 1 - # timeoutSeconds: 2 - #readinessProbe: - # failureThreshold: 1 - # httpGet: - # port: 18018 #[12] pod就绪检测端口,修改为该微服务配置文件中server.port的端口号,与参数[5]相同 - # path: /actuator/prometheus - # scheme: HTTP - # periodSeconds: 5 - # successThreshold: 2 - # timeoutSeconds: 2 + - containerPort: 18018 + livenessProbe: + failureThreshold: 3 + httpGet: + port: 18018 + path: /actuator/health + scheme: HTTP + initialDelaySeconds: 300 + periodSeconds: 60 + successThreshold: 1 + timeoutSeconds: 2 + readinessProbe: + failureThreshold: 1 + httpGet: + port: 18018 + path: /actuator/health + scheme: HTTP + periodSeconds: 5 + successThreshold: 2 + timeoutSeconds: 2 resources: requests: cpu: 1000m From cef21c5ea653dbd187a9baf129bd7cf38ff25287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Wed, 26 May 2021 18:37:09 +0800 Subject: [PATCH 04/25] =?UTF-8?q?=E6=97=A5=E5=BF=97=E5=8D=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sim.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/sim.yaml b/sim.yaml index d507c81..956d715 100644 --- a/sim.yaml +++ b/sim.yaml @@ -27,7 +27,6 @@ spec: - name: log hostPath: path: /var/lib/docker/log/349553515466-preprod/default-group/all - readOnly: false affinity: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution: From 95d75ea89f2c56eaca60c2e75292991609d5c5ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Wed, 26 May 2021 21:50:01 +0800 Subject: [PATCH 05/25] Update application-sim.yml --- src/main/resources/application-sim.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml index 3e8aaa6..d50584c 100644 --- a/src/main/resources/application-sim.yml +++ b/src/main/resources/application-sim.yml @@ -50,16 +50,6 @@ spring: minIdle: 1 timeBetweenEvictionRunsMillis: 60000 minEvictableIdleTimeMillis: 300000 - validationQuery: select 'x' - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - poolPreparedStatements: true - maxOpenPreparedStatements: 20 - connection-properties: druid.stat.merggSql=ture;druid.stat.slowSqlMillis=5000 - props: - sql: - show: true jackson: date-format: yyyy-MM-dd HH:mm:ss From 4a5e3cb897d5d6a7e9bb42a2f2a99ea643b5bc93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Wed, 26 May 2021 21:55:43 +0800 Subject: [PATCH 06/25] Update application-sim.yml --- src/main/resources/application-sim.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml index d50584c..a802dcc 100644 --- a/src/main/resources/application-sim.yml +++ b/src/main/resources/application-sim.yml @@ -50,6 +50,13 @@ spring: minIdle: 1 timeBetweenEvictionRunsMillis: 60000 minEvictableIdleTimeMillis: 300000 + validationQuery: select 1 + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + connection-properties: druid.stat.merggSql=ture;druid.stat.slowSqlMillis=5000 jackson: date-format: yyyy-MM-dd HH:mm:ss From ad2083b041737fc61b028dd41e750bbfee0fbb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Wed, 26 May 2021 22:13:14 +0800 Subject: [PATCH 07/25] Update sim.yaml --- sim.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim.yaml b/sim.yaml index 956d715..cdcc1b8 100644 --- a/sim.yaml +++ b/sim.yaml @@ -40,7 +40,7 @@ spec: containers: - name: biz-service-ebtp-extend #[6] 必选,容器名称,可填写微服务名称 image: harbor.dcos.guangzhou.unicom.local/eshop/biz-service-ebtp-extend:latest #[7] 镜像名称,请把biz-service-ebtp-extend替换为服务名称 - args: ["java","-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)", "-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-jar", "/app.jar"] + args: ["java", "-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)","-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-Dspring.profiles.active=sim", "-jar", "/app.jar"] volumeMounts: - name: log mountPath: /log From 384fdd67b7c6447144ff7215c129abb8ad62fd58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Wed, 26 May 2021 22:19:58 +0800 Subject: [PATCH 08/25] Update application-sim.yml --- src/main/resources/application-sim.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml index a802dcc..83a97c2 100644 --- a/src/main/resources/application-sim.yml +++ b/src/main/resources/application-sim.yml @@ -50,7 +50,7 @@ spring: minIdle: 1 timeBetweenEvictionRunsMillis: 60000 minEvictableIdleTimeMillis: 300000 - validationQuery: select 1 + validationQuery: SELECT 1 testWhileIdle: true testOnBorrow: false testOnReturn: false From 570e9beeb527fdc34c4c85660682525ef858581d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Wed, 26 May 2021 22:23:05 +0800 Subject: [PATCH 09/25] Update application-sim.yml --- src/main/resources/application-sim.yml | 28 +++++--------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml index 83a97c2..0527d73 100644 --- a/src/main/resources/application-sim.yml +++ b/src/main/resources/application-sim.yml @@ -35,29 +35,11 @@ spring: shardingsphere: datasource: - names: ds0 - ds0: - type: com.alibaba.druid.pool.DruidDataSource - driver-class-name: com.mysql.cj.jdbc.Driver - username: mall - password: unicom - jdbc-url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true - url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true - filters: stat,wall,log4j - maxActive: 20 - initialSize: 1 - maxWait: 60000 - minIdle: 1 - timeBetweenEvictionRunsMillis: 60000 - minEvictableIdleTimeMillis: 300000 - validationQuery: SELECT 1 - testWhileIdle: true - testOnBorrow: false - testOnReturn: false - poolPreparedStatements: true - maxOpenPreparedStatements: 20 - connection-properties: druid.stat.merggSql=ture;druid.stat.slowSqlMillis=5000 - + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + username: mall + password: unicomurl: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 From 8a7f1b45987b0b75c53e19e9551bbef4148db224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Wed, 26 May 2021 22:26:33 +0800 Subject: [PATCH 10/25] Update application-sim.yml --- src/main/resources/application-sim.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml index 0527d73..8d664ae 100644 --- a/src/main/resources/application-sim.yml +++ b/src/main/resources/application-sim.yml @@ -38,7 +38,8 @@ spring: type: com.alibaba.druid.pool.DruidDataSource driver-class-name: com.mysql.cj.jdbc.Driver username: mall - password: unicomurl: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + password: unicom + url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true jackson: date-format: yyyy-MM-dd HH:mm:ss From 6699dee8c11880d078cab5c60ada26dfc12e0e4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Wed, 26 May 2021 22:30:03 +0800 Subject: [PATCH 11/25] Update application-sim.yml --- src/main/resources/application-sim.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml index 8d664ae..976e529 100644 --- a/src/main/resources/application-sim.yml +++ b/src/main/resources/application-sim.yml @@ -35,11 +35,13 @@ spring: shardingsphere: datasource: - type: com.alibaba.druid.pool.DruidDataSource - driver-class-name: com.mysql.cj.jdbc.Driver - username: mall - password: unicom - url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + names: ds0 + ds0: + type: com.alibaba.druid.pool.DruidDataSource + driver-class-name: com.mysql.cj.jdbc.Driver + username: mall + password: unicom + url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true jackson: date-format: yyyy-MM-dd HH:mm:ss From 203aff83551f97df8876e5a854a2d8fb8fb7219e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Wed, 26 May 2021 22:41:57 +0800 Subject: [PATCH 12/25] Update application-sim.yml --- src/main/resources/application-sim.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml index 976e529..1ca4e5e 100644 --- a/src/main/resources/application-sim.yml +++ b/src/main/resources/application-sim.yml @@ -41,7 +41,7 @@ spring: driver-class-name: com.mysql.cj.jdbc.Driver username: mall password: unicom - url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8 jackson: date-format: yyyy-MM-dd HH:mm:ss From 0366b47cdf9350c4df14be182bfe8ca13a4f255b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E5=AE=B8=E8=88=9C?= Date: Wed, 26 May 2021 23:12:42 +0800 Subject: [PATCH 13/25] Update application-sim.yml --- src/main/resources/application-sim.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml index 1ca4e5e..df8001f 100644 --- a/src/main/resources/application-sim.yml +++ b/src/main/resources/application-sim.yml @@ -41,8 +41,23 @@ spring: driver-class-name: com.mysql.cj.jdbc.Driver username: mall password: unicom - url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8 - + jdbc-url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + url: jdbc:mysql://10.125.160.37:3306/ebtp_mall_extend?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + filters: stat,wall,log4j + maxActive: 20 + initialSize: 1 + maxWait: 60000 + minIdle: 1 + timeBetweenEvictionRunsMillis: 60000 + minEvictableIdleTimeMillis: 300000 + validationQuery: select 'x' + testWhileIdle: true + testOnBorrow: false + testOnReturn: false + poolPreparedStatements: true + maxOpenPreparedStatements: 20 + connection-properties: druid.stat.merggSql=ture;druid.stat.slowSqlMillis=5000 + jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 From 2230ec9549e37d68bef03f4eafc033c1ec8ca858 Mon Sep 17 00:00:00 2001 From: ajaxfan <909938737@qq.com> Date: Wed, 26 May 2021 23:23:04 +0800 Subject: [PATCH 14/25] =?UTF-8?q?=E8=B0=83=E8=AF=95shardingjdbc=E7=9A=84?= =?UTF-8?q?=E5=81=A5=E5=BA=B7=E7=9B=91=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rceHealthContributorAutoConfiguration.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/main/java/com/chinaunicom/mall/ebtp/extend/ExtendDataSourceHealthContributorAutoConfiguration.java diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/ExtendDataSourceHealthContributorAutoConfiguration.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/ExtendDataSourceHealthContributorAutoConfiguration.java new file mode 100644 index 0000000..ebe5c0d --- /dev/null +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/ExtendDataSourceHealthContributorAutoConfiguration.java @@ -0,0 +1,27 @@ +package com.chinaunicom.mall.ebtp.extend; + +import java.util.Map; + +import javax.sql.DataSource; + +import org.springframework.beans.factory.ObjectProvider; +import org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthContributorAutoConfiguration; +import org.springframework.boot.actuate.health.AbstractHealthIndicator; +import org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator; +import org.springframework.boot.jdbc.metadata.DataSourcePoolMetadataProvider; +import org.springframework.context.annotation.Configuration; + +@Configuration +public class ExtendDataSourceHealthContributorAutoConfiguration extends DataSourceHealthContributorAutoConfiguration { + + public ExtendDataSourceHealthContributorAutoConfiguration(Map dataSources, + ObjectProvider metadataProviders) { + super(dataSources, metadataProviders); + } + + @Override + protected AbstractHealthIndicator createIndicator(DataSource source) { + return new DataSourceHealthIndicator(source, "select 1"); + } + +} From cfc46b12ebca572a0663f6a7adce538bcc678fc9 Mon Sep 17 00:00:00 2001 From: ajaxfan <909938737@qq.com> Date: Wed, 26 May 2021 23:28:15 +0800 Subject: [PATCH 15/25] =?UTF-8?q?=E5=B0=86shardingjdbc=E5=81=A5=E5=BA=B7?= =?UTF-8?q?=E7=9B=91=E6=B5=8B=E4=BB=A3=E7=A0=81=E7=A7=BB=E5=8A=A8=E5=88=B0?= =?UTF-8?q?=E8=84=9A=E6=89=8B=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...rceHealthContributorAutoConfiguration.java | 27 ------------------- 1 file changed, 27 deletions(-) delete mode 100644 src/main/java/com/chinaunicom/mall/ebtp/extend/ExtendDataSourceHealthContributorAutoConfiguration.java diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/ExtendDataSourceHealthContributorAutoConfiguration.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/ExtendDataSourceHealthContributorAutoConfiguration.java deleted file mode 100644 index ebe5c0d..0000000 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/ExtendDataSourceHealthContributorAutoConfiguration.java +++ /dev/null @@ -1,27 +0,0 @@ -package com.chinaunicom.mall.ebtp.extend; - -import java.util.Map; - -import javax.sql.DataSource; - -import org.springframework.beans.factory.ObjectProvider; -import org.springframework.boot.actuate.autoconfigure.jdbc.DataSourceHealthContributorAutoConfiguration; -import org.springframework.boot.actuate.health.AbstractHealthIndicator; -import org.springframework.boot.actuate.jdbc.DataSourceHealthIndicator; -import org.springframework.boot.jdbc.metadata.DataSourcePoolMetadataProvider; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class ExtendDataSourceHealthContributorAutoConfiguration extends DataSourceHealthContributorAutoConfiguration { - - public ExtendDataSourceHealthContributorAutoConfiguration(Map dataSources, - ObjectProvider metadataProviders) { - super(dataSources, metadataProviders); - } - - @Override - protected AbstractHealthIndicator createIndicator(DataSource source) { - return new DataSourceHealthIndicator(source, "select 1"); - } - -} From 92a558004d8ec90a9f32cacea7fdea1855b35e95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=BA=86=E5=90=89?= <51312040@qq.com> Date: Thu, 27 May 2021 09:06:53 +0800 Subject: [PATCH 16/25] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sim.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim.yaml b/sim.yaml index cdcc1b8..20efd36 100644 --- a/sim.yaml +++ b/sim.yaml @@ -40,7 +40,7 @@ spec: containers: - name: biz-service-ebtp-extend #[6] 必选,容器名称,可填写微服务名称 image: harbor.dcos.guangzhou.unicom.local/eshop/biz-service-ebtp-extend:latest #[7] 镜像名称,请把biz-service-ebtp-extend替换为服务名称 - args: ["java", "-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)","-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-Dspring.profiles.active=sim", "-jar", "/app.jar"] + args: ["java", "-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)","-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-jar", "/app.jar"] volumeMounts: - name: log mountPath: /log From fc578072743a51e5fb8f21290452667776225800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=BA=86=E5=90=89?= <51312040@qq.com> Date: Mon, 12 Jul 2021 10:11:39 +0800 Subject: [PATCH 17/25] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deployment-master.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment-master.yaml b/deployment-master.yaml index 04c5d8d..2f68fa5 100644 --- a/deployment-master.yaml +++ b/deployment-master.yaml @@ -53,7 +53,7 @@ spec: containers: - name: biz-service-ebtp-extend image: harbor.dcos.xixian.unicom.local/eshop/biz-service-ebtp-extend:latest - args: ["java", "-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)","-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE_DEV)", "-jar", "/app.jar"] + args: ["java", "-Djava.security.egd=file:/dev/./urandom", "-javaagent:/pinpoint/tianyan-springboot-agent/pinpoint-bootstrap-1.8.0.jar", "-Dpinpoint.agentId=$(MY_POD_IP)","-Dpinpoint.applicationName=$(APP_NAME)", "-Dpinpoint.licence=$(AGENT_LICENCE)", "-jar", "/app.jar"] volumeMounts: - name: log mountPath: /log From 1d64577634788e4dd88a2274a99367ed316c7143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=BA=86=E5=90=89?= <51312040@qq.com> Date: Fri, 16 Jul 2021 11:32:32 +0800 Subject: [PATCH 18/25] =?UTF-8?q?=E4=BF=AE=E6=94=B9post?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BizMessageConsumerController.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/controller/BizMessageConsumerController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/controller/BizMessageConsumerController.java index 55b6124..22ac44a 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/controller/BizMessageConsumerController.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/controller/BizMessageConsumerController.java @@ -5,12 +5,7 @@ import java.util.Optional; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.PageDTO; import com.chinaunicom.mall.ebtp.extend.bizmessage.mybatis.IBizMessagePage; @@ -40,7 +35,7 @@ public class BizMessageConsumerController { * @return */ @ApiOperation("消息概要清单.") - @GetMapping("describeSiteMsg") + @PostMapping("describeSiteMsg") @ResponseStatus(code = HttpStatus.OK) public IBizMessagePage describeSiteMsg( @ApiParam(value = "分页参数", required = false) @RequestBody(required = false) PageDTO page) { From c0db0332e733d41d6fb682fee9baf187130bfc12 Mon Sep 17 00:00:00 2001 From: zhangqinbin <181961702@qq.com> Date: Fri, 16 Jul 2021 14:13:40 +0800 Subject: [PATCH 19/25] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=88=B3=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../timeService/TimeServiceConstant.java | 103 +++++++++++++----- 1 file changed, 76 insertions(+), 27 deletions(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java index d88c289..412992f 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java @@ -9,6 +9,7 @@ import com.chinaunicom.mall.ebtp.extend.timeService.tsa.SystemTime; import com.chinaunicom.mall.ebtp.extend.timeService.tsa.TtsAgent; import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.binary.Base64; +import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.ClassPathResource; import java.io.InputStream; @@ -16,12 +17,19 @@ import java.text.SimpleDateFormat; import java.util.Calendar; import java.util.Date; import java.util.Properties; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; @Slf4j public class TimeServiceConstant { public static TSAClient client; + @Value("${spring.redis.sentinel.master}") + private String redis="eshop-redis"; + public TimeServiceConstant(){ try{ Properties prop = new Properties(); @@ -44,7 +52,11 @@ public class TimeServiceConstant { * @return 时间戳加密原文 */ public String signTimeStamp(String data){ + if(redis.equals("eshop-redis-sim")){ + return ""; + } try{ + data = data!=null&&!"".equals(data)?data:"system"; //第三步:申请时间戳,向时间戳服务器发起申请时间戳请求,返回时间戳结果 TSASignedResult result = client.signTimeStamp("SHA1", data.getBytes("UTF-8")); @@ -57,7 +69,7 @@ public class TimeServiceConstant { }catch (Exception e){ log.error("申请时间戳异常", e); } - return null; + return ""; } /** * 解析时间戳 @@ -65,21 +77,28 @@ public class TimeServiceConstant { * @return 时间戳对象 */ public TtsAgent.TtsParseResult verifyTimeStamp2(String timestamp){ + String systemtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); + TtsAgent.TtsParseResult ttsParseResult = new TtsAgent.TtsParseResult(systemtime,"",""); + if(redis.equals("eshop-redis-sim")){ + return ttsParseResult; + } try{ + log.info("timestamp -->"+timestamp); TSAVerifyResult verifyResult = this.verifyTimeStamp(timestamp); String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(verifyResult.getSignedTime()); - TtsAgent.TtsParseResult ttsParseResult = new TtsAgent.TtsParseResult(time, HelperUtil.bytesToHexString(verifyResult.getData()), + ttsParseResult = new TtsAgent.TtsParseResult(time, HelperUtil.bytesToHexString(verifyResult.getData()), verifyResult.getSignerSubject()); - return ttsParseResult; }catch (Exception e){ log.error("解析时间戳", e); } - return null; + return ttsParseResult; } private TSAVerifyResult verifyTimeStamp(String timestamp){ + try{ + log.info("timestamp -->"+timestamp); TSAVerifyResult verifyResult = client.verifyTimeStamp(Base64.decodeBase64(timestamp)); return verifyResult; @@ -95,14 +114,19 @@ public class TimeServiceConstant { * @return 时间戳对象 */ public TtsAgent.TtsParseResult getServiceTimeObj(String data){ - try{ - String timestamp = this.signTimeStamp(data); - TtsAgent.TtsParseResult ttsParseResult = this.verifyTimeStamp2(timestamp); + String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); + TtsAgent.TtsParseResult ttsParseResult = new TtsAgent.TtsParseResult(time,"",""); + if(redis.equals("eshop-redis-sim")){ return ttsParseResult; + } + try{ + + String timestamp = this.signTimeStamp(data); + ttsParseResult = this.verifyTimeStamp2(timestamp); }catch (Exception e){ log.error("获取时间戳异常", e); } - return null; + return ttsParseResult; } /** @@ -111,16 +135,19 @@ public class TimeServiceConstant { * @return 时间 */ public String getServiceTime(String data){ + String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); + if(redis.equals("eshop-redis-sim")){ + return time; + } try{ + String timestamp = this.signTimeStamp(data); TSAVerifyResult verifyResult = this.verifyTimeStamp(timestamp); - String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(verifyResult.getSignedTime()); - - return time; + time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(verifyResult.getSignedTime()); }catch (Exception e){ log.error("获取时间戳异常", e); } - return null; + return time; } @@ -130,7 +157,11 @@ public class TimeServiceConstant { * @return date时间 */ public Date getServiceDate(String data){ + if(redis.equals("eshop-redis-sim")){ + return new Date(); + } try{ + String timestamp = this.signTimeStamp(data); TSAVerifyResult verifyResult = this.verifyTimeStamp(timestamp); Date date = verifyResult.getSignedTime(); @@ -138,7 +169,7 @@ public class TimeServiceConstant { }catch (Exception e){ log.error("获取时间戳异常", e); } - return null; + return new Date(); } /** * 获取年月日时分秒分割存储对象 @@ -146,11 +177,9 @@ public class TimeServiceConstant { * @return SystemTime */ public SystemTime getServiceSystemTime(String data){ - try{ - String timestamp = this.signTimeStamp(data); - TSAVerifyResult verifyResult = this.verifyTimeStamp(timestamp); - Date date = verifyResult.getSignedTime(); - SystemTime systemTime = new SystemTime() + Date date = new Date(); + if(redis.equals("eshop-redis-sim")){ + return new SystemTime() .setYear(date.getYear()+1900) .setMonth(date.getMonth()+1) .setDate(date.getDate()) @@ -158,20 +187,40 @@ public class TimeServiceConstant { .setMinute(date.getMinutes()) .setSecond(date.getSeconds()) .setTimestamp(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date)); - return systemTime; + } + try{ + + String timestamp = this.signTimeStamp(data); + TSAVerifyResult verifyResult = this.verifyTimeStamp(timestamp); + date = verifyResult.getSignedTime(); + }catch (Exception e){ log.error("获取时间戳异常", e); } - return null; + SystemTime systemTime = new SystemTime() + .setYear(date.getYear()+1900) + .setMonth(date.getMonth()+1) + .setDate(date.getDate()) + .setHour(date.getHours()) + .setMinute(date.getMinutes()) + .setSecond(date.getSeconds()) + .setTimestamp(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(date)); + return systemTime; } public static void main(String arge[]){ - Date date = new Date(); - System.out.println("-----------"+(date.getYear()+1900)); - System.out.println("-----------"+(date.getMonth()+1)); - System.out.println("-----------"+date.getDate()); - System.out.println("-----------"+date.getHours()); - System.out.println("-----------"+date.getMinutes()); - System.out.println("-----------"+date.getSeconds()); + try{ + + Date date = new Date(); + System.out.println("-----------"+(date.getYear()+1900)); + System.out.println("-----------"+(date.getMonth()+1)); + System.out.println("-----------"+date.getDate()); + System.out.println("-----------"+date.getHours()); + System.out.println("-----------"+date.getMinutes()); + System.out.println("-----------"+date.getSeconds()); + + }catch (Exception e){ + e.printStackTrace(); + } } } From 4f3863f36ca66a1db4c91bd47dfe5381f369b8e3 Mon Sep 17 00:00:00 2001 From: zhangqinbin <181961702@qq.com> Date: Fri, 16 Jul 2021 14:22:05 +0800 Subject: [PATCH 20/25] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=88=B3=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../timeService/TimeServiceConstant.java | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java index 412992f..4235139 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java @@ -14,13 +14,8 @@ import org.springframework.core.io.ClassPathResource; import java.io.InputStream; import java.text.SimpleDateFormat; -import java.util.Calendar; import java.util.Date; import java.util.Properties; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; @Slf4j public class TimeServiceConstant { @@ -28,7 +23,7 @@ public class TimeServiceConstant { public static TSAClient client; @Value("${spring.redis.sentinel.master}") - private String redis="eshop-redis"; + private String redis; public TimeServiceConstant(){ try{ @@ -52,7 +47,7 @@ public class TimeServiceConstant { * @return 时间戳加密原文 */ public String signTimeStamp(String data){ - if(redis.equals("eshop-redis-sim")){ + if(redis!=null&&redis.equals("eshop-redis-sim")){ return ""; } try{ @@ -79,7 +74,7 @@ public class TimeServiceConstant { public TtsAgent.TtsParseResult verifyTimeStamp2(String timestamp){ String systemtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); TtsAgent.TtsParseResult ttsParseResult = new TtsAgent.TtsParseResult(systemtime,"",""); - if(redis.equals("eshop-redis-sim")){ + if(redis!=null&&redis.equals("eshop-redis-sim")){ return ttsParseResult; } try{ @@ -116,7 +111,7 @@ public class TimeServiceConstant { public TtsAgent.TtsParseResult getServiceTimeObj(String data){ String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); TtsAgent.TtsParseResult ttsParseResult = new TtsAgent.TtsParseResult(time,"",""); - if(redis.equals("eshop-redis-sim")){ + if(redis!=null&&redis.equals("eshop-redis-sim")){ return ttsParseResult; } try{ @@ -135,8 +130,9 @@ public class TimeServiceConstant { * @return 时间 */ public String getServiceTime(String data){ + log.info("-------------------redis-"+redis); String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()); - if(redis.equals("eshop-redis-sim")){ + if(redis!=null&&redis.equals("eshop-redis-sim")){ return time; } try{ @@ -157,7 +153,7 @@ public class TimeServiceConstant { * @return date时间 */ public Date getServiceDate(String data){ - if(redis.equals("eshop-redis-sim")){ + if(redis!=null&&redis.equals("eshop-redis-sim")){ return new Date(); } try{ @@ -178,7 +174,7 @@ public class TimeServiceConstant { */ public SystemTime getServiceSystemTime(String data){ Date date = new Date(); - if(redis.equals("eshop-redis-sim")){ + if(redis!=null&&redis.equals("eshop-redis-sim")){ return new SystemTime() .setYear(date.getYear()+1900) .setMonth(date.getMonth()+1) From 80e7867b2424a4391a9637e7844474c52b9920f5 Mon Sep 17 00:00:00 2001 From: zhangqinbin <181961702@qq.com> Date: Fri, 16 Jul 2021 15:04:01 +0800 Subject: [PATCH 21/25] =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=88=B3=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../timeService/TimeServiceConstant.java | 2 ++ .../controller/TimeServiceController.java | 28 +++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java index 4235139..45a6fde 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/TimeServiceConstant.java @@ -11,6 +11,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.codec.binary.Base64; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.ClassPathResource; +import org.springframework.stereotype.Service; import java.io.InputStream; import java.text.SimpleDateFormat; @@ -18,6 +19,7 @@ import java.util.Date; import java.util.Properties; @Slf4j +@Service public class TimeServiceConstant { public static TSAClient client; diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/controller/TimeServiceController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/controller/TimeServiceController.java index 3720306..75c48e8 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/controller/TimeServiceController.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/timeService/controller/TimeServiceController.java @@ -2,6 +2,7 @@ package com.chinaunicom.mall.ebtp.extend.timeService.controller; import cn.com.jit.tsa.client.TSAVerifyResult; import com.chinaunicom.mall.ebtp.common.base.entity.BaseResponse; +import com.chinaunicom.mall.ebtp.extend.templatewarehouse.sevice.BizBidTemplateWarehouseService; import com.chinaunicom.mall.ebtp.extend.timeService.TimeServiceConstant; import com.chinaunicom.mall.ebtp.extend.timeService.tsa.SystemTime; import com.chinaunicom.mall.ebtp.extend.timeService.tsa.TtsAgent; @@ -11,6 +12,7 @@ import io.swagger.annotations.ApiParam; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; @@ -21,6 +23,8 @@ import java.util.Date; @RequestMapping("/v1/timeService") public class TimeServiceController { + @Resource + private TimeServiceConstant timeServiceConstant; /** * 申请时间戳 * @param data 待申请时间戳的原文 @@ -29,8 +33,8 @@ public class TimeServiceController { @ApiOperation("申请时间戳") @GetMapping(value = "/signTimeStamp") public BaseResponse signTimeStamp(@ApiParam(value = "待申请时间戳的原文", required = false) @RequestParam(name = "data",required = false) String data) { - TimeServiceConstant constant = new TimeServiceConstant(); - return BaseResponse.success(constant.signTimeStamp(data)); + //TimeServiceConstant constant = new TimeServiceConstant(); + return BaseResponse.success(timeServiceConstant.signTimeStamp(data)); } /** @@ -41,8 +45,8 @@ public class TimeServiceController { @ApiOperation("解析时间戳加密原文") @PostMapping(value = "/verifyTimeStamp") public BaseResponse verifyTimeStamp(@ApiParam(value = "时间戳加密原文", required = true) @RequestBody String timestamp) { - TimeServiceConstant constant = new TimeServiceConstant(); - return BaseResponse.success(constant.verifyTimeStamp2(timestamp)); + //TimeServiceConstant constant = new TimeServiceConstant(); + return BaseResponse.success(timeServiceConstant.verifyTimeStamp2(timestamp)); } /** @@ -53,8 +57,8 @@ public class TimeServiceController { @ApiOperation("直接获取时间戳对象(内涵日期)") @GetMapping(value = "/getServiceTimeObj") public BaseResponse getServiceTimeObj(@ApiParam(value = "待申请时间戳的原文", required = false) @RequestParam(name = "data",required = false) String data) { - TimeServiceConstant constant = new TimeServiceConstant(); - return BaseResponse.success(constant.getServiceTimeObj(data)); + //TimeServiceConstant constant = new TimeServiceConstant(); + return BaseResponse.success(timeServiceConstant.getServiceTimeObj(data)); } /** * 直接获取获取时间戳 @@ -64,8 +68,8 @@ public class TimeServiceController { @ApiOperation("直接获取日期字符串") @GetMapping(value = "/getServiceTime") public BaseResponse getServiceTime(@ApiParam(value = "待申请时间戳的原文", required = false) @RequestParam(name = "data",required = false) String data) { - TimeServiceConstant constant = new TimeServiceConstant(); - return BaseResponse.success(constant.getServiceTime(data)); + //TimeServiceConstant constant = new TimeServiceConstant(); + return BaseResponse.success(timeServiceConstant.getServiceTime(data)); } /** * 获取年月日时分秒分割存储对象 @@ -75,8 +79,8 @@ public class TimeServiceController { @ApiOperation("获取日期对象SystemTime") @GetMapping(value = "/getServiceSystemTime") public BaseResponse getServiceSystemTime(@ApiParam(value = "待申请时间戳的原文", required = false) @RequestParam(name = "data",required = false) String data) { - TimeServiceConstant constant = new TimeServiceConstant(); - return BaseResponse.success(constant.getServiceSystemTime(data)); + //TimeServiceConstant constant = new TimeServiceConstant(); + return BaseResponse.success(timeServiceConstant.getServiceSystemTime(data)); } /** * 获取开标剩余时间倒数 @@ -88,9 +92,9 @@ public class TimeServiceController { public BaseResponse getDescOpenRoomTime(@RequestParam(name = "openTime",required = true) String openTime){ try { SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - TimeServiceConstant constant = new TimeServiceConstant(); + //TimeServiceConstant constant = new TimeServiceConstant(); - Date now = constant.getServiceDate("getDescOpenRoomTime");;//当前时间 + Date now = timeServiceConstant.getServiceDate("getDescOpenRoomTime");;//当前时间 Date date = df.parse(openTime);//过去 long l = date.getTime()-now.getTime(); long day = l / (24 * 60 * 60 * 1000); From ceab4ff32f1c9c9495ebda07fe181d8dd272052b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=BA=86=E5=90=89?= <51312040@qq.com> Date: Fri, 16 Jul 2021 15:44:03 +0800 Subject: [PATCH 22/25] =?UTF-8?q?=E4=BF=AE=E6=94=B9post?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BizMessageConsumerController.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/controller/BizMessageConsumerController.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/controller/BizMessageConsumerController.java index 55b6124..22ac44a 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/controller/BizMessageConsumerController.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/bizmessage/controller/BizMessageConsumerController.java @@ -5,12 +5,7 @@ import java.util.Optional; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseStatus; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import com.chinaunicom.mall.ebtp.extend.bizmessage.dto.PageDTO; import com.chinaunicom.mall.ebtp.extend.bizmessage.mybatis.IBizMessagePage; @@ -40,7 +35,7 @@ public class BizMessageConsumerController { * @return */ @ApiOperation("消息概要清单.") - @GetMapping("describeSiteMsg") + @PostMapping("describeSiteMsg") @ResponseStatus(code = HttpStatus.OK) public IBizMessagePage describeSiteMsg( @ApiParam(value = "分页参数", required = false) @RequestBody(required = false) PageDTO page) { From 73d2d2e80793d280e13bf94f65434ae4481ec8e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=BA=86=E5=90=89?= <51312040@qq.com> Date: Wed, 4 Aug 2021 13:59:01 +0800 Subject: [PATCH 23/25] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-sim.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/resources/application-sim.yml b/src/main/resources/application-sim.yml index df8001f..aa507b5 100644 --- a/src/main/resources/application-sim.yml +++ b/src/main/resources/application-sim.yml @@ -163,6 +163,7 @@ mconfig: rsms: biz-service-ebtp-rsms #评审结构化服务 tender: biz-service-ebtp-tender #投标服务 documentcenter: core-service-document-center #文档中心 + usercenter: core-service-usercenter-public #用户中心 document: clientHttpUrl: http://10.242.31.54:8100/auth/oauth/token?grant_type=client_credentials&client_id=bVS46ElU&client_secret=58ea04ba02475c8da2321cc99849d2a10f15b749 From 8f69b8edbe09243f6ee992f7a9d3ef371b12dba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=BA=86=E5=90=89?= <51312040@qq.com> Date: Fri, 27 Aug 2021 11:04:38 +0800 Subject: [PATCH 24/25] =?UTF-8?q?=E6=89=93=E5=88=86=E6=B1=87=E6=80=BB?= =?UTF-8?q?=E8=A1=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extend/export/service/impl/DfhzExportServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/DfhzExportServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/DfhzExportServiceImpl.java index 50639d4..854ade2 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/DfhzExportServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/DfhzExportServiceImpl.java @@ -218,9 +218,11 @@ public class DfhzExportServiceImpl implements ExportService { BidEvalDetailSummaryVO detailSummary = detailScore.stream().filter(f -> f.getSupplierRegisterId().equals(vo.getId())).findFirst().orElseGet(BidEvalDetailSummaryVO::new); Map memberScoreMap = detailSummary.getScoreMap(); for (JuryPrintVO memberVO : memberAll) { - if (memberScoreMap.containsKey(memberVO.getUserId())) { + if (memberScoreMap != null && memberScoreMap.containsKey(memberVO.getUserId())) { BigDecimal score = memberScoreMap.get(memberVO.getUserId()).getScore(); this.createCell(row, cellIndex++, cellStyle, score == null ? "" : String.valueOf(score)); + }else { + this.createCell(row, cellIndex++, cellStyle, ""); } } } From 3716e2ca816b00855bbc411807f033b95cfc6d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=98=E5=BA=86=E5=90=89?= <51312040@qq.com> Date: Fri, 27 Aug 2021 11:11:42 +0800 Subject: [PATCH 25/25] =?UTF-8?q?=E6=89=93=E5=88=86=E6=B1=87=E6=80=BB?= =?UTF-8?q?=E8=A1=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ebtp/extend/export/service/impl/DfhzExportServiceImpl.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/DfhzExportServiceImpl.java b/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/DfhzExportServiceImpl.java index 854ade2..5f368ac 100644 --- a/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/DfhzExportServiceImpl.java +++ b/src/main/java/com/chinaunicom/mall/ebtp/extend/export/service/impl/DfhzExportServiceImpl.java @@ -221,8 +221,6 @@ public class DfhzExportServiceImpl implements ExportService { if (memberScoreMap != null && memberScoreMap.containsKey(memberVO.getUserId())) { BigDecimal score = memberScoreMap.get(memberVO.getUserId()).getScore(); this.createCell(row, cellIndex++, cellStyle, score == null ? "" : String.valueOf(score)); - }else { - this.createCell(row, cellIndex++, cellStyle, ""); } } }