Commit a1c718dc authored by fangxinjiang's avatar fangxinjiang

消息提现

parent b0ebd752
apiVersion: apps/v1 # 指定api版本,此值必须在kubectl api-versions中
kind: Deployment # 指定创建资源的角色/类型
metadata: # 资源的元数据/属性
name: yifu-msg # 资源的名字,在同一个namespace中必须唯一
namespace: qas-mvp # 部署在哪个namespace中
spec: # 资源规范字段
selector: # 选择器
matchLabels: # 匹配标签
app: yifu-msg
replicas: 2 # 声明副本数目
#revisionHistoryLimit: 3 # 保留历史版本
#strategy: # 策略
# rollingUpdate: # 滚动更新
# maxSurge: 30% # 最大额外可以存在的副本数,可以为百分比,也可以为整数
# maxUnavailable: 30% # 示在更新过程中能够进入不可用状态的 Pod 的最大值,可以为百分比,也可以为整数
# type: RollingUpdate # 滚动更新策略
template: # 模版
metadata: # 模版
labels: # 设定资源的标签
app: yifu-msg
annotations:
dapr.io/enabled: "true" #设定此参数为 true 注入Dapr sidecar到pod
dapr.io/app-id: "yifu-msg" #应用程序唯一 ID。 用于服务发现、状态封装 和 发布/订阅 消费者ID
dapr.io/app-port: "5026" #这个参数告诉Dapr你的应用程序正在监听哪个端口。
#dapr.io/log-level: "debug" #为 Dapr sidecar设置日志级别。 允许的值是debug,info,warn,error。 默认是 info
#dapr.io/log-as-json: "false" #将此参数设置为true以JSON格式输出日志。 默认值为 false.
#dapr.io/config: file #告诉 Dapr 要使用哪个配置 CRD
dapr.io/app-protocol: "http" #告诉 Dapr 你的应用程序正在使用哪种协议。 有效选项是 http and grpc。 Default is http
#dapr.io/app-max-concurrency: "20" #限制应用程序的并发量。 有效的数值是大于 0
#dapr.io/app-ssl: "false" #告诉Dapr通过不安全的SSL连接调用应用程序。 同时适用于HTTP和gRPC。 Traffic between your app and the Dapr sidecar is encrypted with a certificate issued by a non-trusted certificate authority, which is considered insecure. 默认值为 false.
dapr.io/metrics-port: "9090" #设置 sidecar 度量服务器的端口。 默认值为 9090
#dapr.io/sidecar-cpu-limit: 2 #Dapr sidecar可以使用的最大CPU数量。 默认情况下未设置
#dapr.io/sidecar-memory-limit: "800Mi" #Dapr sidecar可以使用的最大内存量。默认情况下未设置 请参阅 https://kubernetes.io/docs/tasks/administer-cluster/manage-resources/quota-memory-cpu-namespace/ 的有效值。
#dapr.io/sidecar-cpu-request: 1 #Dapr sidecar要求的 CPU 数量
#dapr.io/sidecar-memory-request #Dapr sidecar 请求的内存数量
dapr.io/http-max-request-size: "100" #增加http和grpc服务器请求正文参数的最大大小,单位为MB,以处理大文件的上传。 默认值为 4 MB
dapr.io/http-read-buffer-size: "16" #Dapr has a default limit of 4KB for the http header read buffer size. When sending http headers that are bigger than the default 4KB, you can increase this value. Otherwise, you may encounter a Too big request header
dapr.io/sidecar-listen-addresses: "0.0.0.0"
# 更多dapr配置请参考 https://www.bookstack.cn/read/dapr-1.5-zh/cc77b74e2cc2f4d4.md
spec: # 资源规范字段
nodeSelector: # node 选择器
node-type: worker # node标签
kubernetes.io/hostname: yfmaster1
containers: # 容器
- name: yifu-msg # 容器的名字
#image: 192.168.1.110:5500/qas-mvp/yifu-msg-biz:1.0.0 # 容器镜像地址
image: hub.worfu.com/qas-mvp/yifu-msg-biz:1.0.0 #临时地址
imagePullPolicy: Always # 每次Pod启动拉取镜像策略,三个选择 Always、Never、IfNotPresent
# Always,每次都检查;Never,每次都不检查(不管本地是否有);IfNotPresent,如果本地有就不检查,如果没有就拉取(手动测试时,
# 已经打好镜像存在docker容器中时,使用存在不检查级别,
# 默认为每次都检查,然后会进行拉取新镜像,因镜像仓库不存在,导致部署失败)
ports:
- containerPort: 5026 # 容器端口
env: # 启动环境配置信息 active and timeZone set
- name: SPRING_PROFILES_ACTIVE
value: test
- name: TZ
value: Asia/Shanghai
resources: #资源配置限制
limits: # 最大使用
memory: "4096Mi"
#cpu: 300m # CPU,1核心 = 1000m
requests: # 容器运行时,最低资源需求,也就是说最少需要多少资源容器才能正常运行
#cpu: 100m
memory: "500Mi"
#livenessProbe: # pod 内部健康检查的设置
# httpGet: # 通过httpget检查健康,返回200-399之间,则认为容器正常
# path: /healthCheck # URI地址
# port: 8080 # 端口
# scheme: HTTP # 协议
# # host: 127.0.0.1 # 主机地址
# initialDelaySeconds: 30 # 表明第一次检测在容器启动后多长时间后开始
# timeoutSeconds: 5 # 检测的超时时间
# periodSeconds: 30 # 检查间隔时间
# successThreshold: 1 # 成功门槛
# failureThreshold: 5 # 失败门槛,连接失败5次,pod杀掉,重启一个新的pod
# readinessProbe: # Pod 准备服务健康检查设置
# httpGet:
# path: /healthCheck
# port: 8080
# scheme: HTTP
# initialDelaySeconds: 30
# timeoutSeconds: 5
# periodSeconds: 10
# successThreshold: 1
# failureThreshold: 5
#也可以用这种方法
#exec: 执行命令的方法进行监测,如果其退出码不为0,则认为容器正常
# command:
# - cat
# - /tmp/health
#也可以用这种方法
#tcpSocket: # 通过tcpSocket检查健康
# port: number
#ports:
# - name: http # 名称
# containerPort: 8080 # 容器开发对外的端口
# protocol: TCP # 协议
imagePullSecrets: # 镜像仓库拉取密钥
- name: login
#affinity: # 亲和性调试
# nodeAffinity: # 节点亲和力
# requiredDuringSchedulingIgnoredDuringExecution: # pod 必须部署到满足条件的节点上
# nodeSelectorTerms: # 节点满足任何一个条件就可以
# - matchExpressions: # 有多个选项,则只有同时满足这些逻辑选项的节点才能运行 pod
# - key: beta.kubernetes.io/arch
# operator: In
# values:
# - amd64
\ No newline at end of file
apiVersion: v1 # 指定api版本,此值必须在kubectl api-versions中
kind: Service # 指定创建资源的角色/类型
metadata: # 资源的元数据/属性
labels: # 设定资源的标签
app: yifu-msg # 资源的名字,在同一个namespace中必须唯一
name: yifu-msg # 资源的名字,在同一个namespace中必须唯一
namespace: qas-mvp # 部署在哪个namespace中
spec: # 资源规范字段
ports:
- port: 5026 # service 端口
protocol: TCP # 协议
targetPort: 5026 # 容器暴露的端口
name: http-social # 端口名称
- port: 3500 # service 端口
protocol: TCP # 协议
targetPort: 3500 # 容器暴露的端口
name: http-social-dapr
selector: # 选择器
app: yifu-msg # 资源名称
type: ClusterIP # ClusterIP 类型
\ No newline at end of file
......@@ -17,7 +17,6 @@
package com.yifu.cloud.plus.v1.msg.entity;
import cn.hutool.core.date.DateTime;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......
FROM moxm/java:1.8-full
RUN mkdir -p /yifu-mes-biz
RUN mkdir -p /yifu-msg-biz
WORKDIR yifu-mes-biz
WORKDIR yifu-msg-biz
ARG JAR_FILE=target/yifu-mes-biz.jar
ARG JAR_FILE=target/yifu-msg-biz.jar
COPY ${JAR_FILE} app.jar
EXPOSE 5022
EXPOSE 5026
ENV TZ=Asia/Shanghai JAVA_OPTS="-Xms128m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
......
......@@ -22,46 +22,42 @@
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-seata</artifactId>
</dependency>
<!-- email -->
<!--选配: orm 模块-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<!--必备:安全模块-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-security</artifactId>
</dependency>
<!--必备:日志处理-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-log</artifactId>
</dependency>
<!--必备:swagger-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-swagger</artifactId>
</dependency>
<!--必备:undertow容器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
<version>2.6.7</version>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<!--必备: 依赖api模块-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-mail-api</artifactId>
<version>1.0.0</version>
</dependency>
<!--必备:安全模块-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-security</artifactId>
</dependency>
<!--必备:日志处理-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-log</artifactId>
</dependency>
<!--必备:swagger-->
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-swagger</artifactId>
</dependency>
<!--必备:undertow容器-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-msg-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-msg-api</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
......
......@@ -60,6 +60,7 @@ public class MsgInfoController {
public R<IPage<MsgInfo>> getMsgInfoPage(Page<MsgInfo> page, MsgInfo msgInfo) {
return new R<>(msgInfoService.getMsgInfoPage(page,msgInfo));
}
/**
* @Author fxj
* @Description 触发消息提醒--EKP调用接口
......
......@@ -41,7 +41,9 @@ public interface MsgInfoMapper extends BaseMapper<MsgInfo> {
*/
IPage<MsgInfo> getMsgInfoPage(Page<MsgInfo> page, @Param("msgInfo") MsgInfo msgInfo);
/*MsgInfo getMsgByOrderId(@Param("orderId")String orderId);
MsgInfo getMsgByOrderId(@Param("orderId")String orderId);
List<MsgInfo> getMsgByTask();*/
List<MsgInfo> getMsgByTask();
List<MsgInfo> getMsgInfo(@Param("msgInfo") MsgInfo msgInfo);
}
......@@ -24,6 +24,8 @@ import com.yifu.cloud.plus.v1.msg.entity.MsgInfo;
import com.yifu.cloud.plus.v1.msg.vo.EkpAlertVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import java.util.List;
/**
*
*
......@@ -37,6 +39,7 @@ public interface MsgInfoService extends IService<MsgInfo> {
* @return
*/
IPage<MsgInfo> getMsgInfoPage(Page<MsgInfo> page, MsgInfo msgInfo);
List<MsgInfo> getMsgInfo(MsgInfo msgInfo);
R<Boolean> createMsg(EkpAlertVo vo);
......
......@@ -16,7 +16,6 @@
*/
package com.yifu.cloud.plus.v1.msg.service.impl;
import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -53,6 +52,11 @@ public class MsgInfoServiceImpl extends ServiceImpl<MsgInfoMapper, MsgInfo> impl
return baseMapper.getMsgInfoPage(page,msgInfo);
}
@Override
public List<MsgInfo> getMsgInfo(MsgInfo msgInfo) {
return baseMapper.getMsgInfo(msgInfo);
}
/**
* @Author fxj
* @Description 生成 待办 变更 提醒数据
......@@ -74,7 +78,7 @@ public class MsgInfoServiceImpl extends ServiceImpl<MsgInfoMapper, MsgInfo> impl
if (CommonConstants.ZERO_STRING.equals(vo.getItem())){
// 接单提醒
if (CommonConstants.ZERO_STRING.equals(vo.getType())){
//save = baseMapper.getMsgByOrderId(vo.getOrderId());
save = baseMapper.getMsgByOrderId(vo.getOrderId());
if (Common.isNotNull(save)){
save.setCreateTime(LocalDateTime.now());
save.setUrl(MesConstants.orderUrl+vo.getOrderId());
......@@ -83,7 +87,7 @@ public class MsgInfoServiceImpl extends ServiceImpl<MsgInfoMapper, MsgInfo> impl
}
// 变更提醒
if (CommonConstants.TWO_STRING.equals(vo.getType())){
//save = baseMapper.getMsgByOrderId(vo.getOrderId());
save = baseMapper.getMsgByOrderId(vo.getOrderId());
if (Common.isNotNull(save)){
save.setCreateTime(LocalDateTime.now());
save.setUrl(MesConstants.orderUrl+save.getOrderId());
......@@ -106,7 +110,7 @@ public class MsgInfoServiceImpl extends ServiceImpl<MsgInfoMapper, MsgInfo> impl
**/
@Override
public void updateOverTimeMsg() {
List<MsgInfo> msgInfos =null; //= baseMapper.getMsgByTask();
List<MsgInfo> msgInfos = baseMapper.getMsgByTask();
if (Common.isNotNull(msgInfos)){
//1.先删除
baseMapper.delete(Wrappers.<MsgInfo>query().lambda().eq(MsgInfo::getAlertType,CommonConstants.ONE_STRING));
......
......@@ -9,32 +9,17 @@ spring:
redis:
host: 127.0.0.1
password: '@yf_2017'
mail:
host: smtp.exmail.qq.com
port: 465
username: information@wanxin-holdings.com
password: QmdCaQSPmCAQEddd
protocol: smtp
default-encoding: UTF-8
properties:
mail.smtp.auth: true
mail.smtp.starttls.enable: true
mail.smtp.starttls.required: true
mail.smtp.socketFactory.port: 465
mail.smtp.socketFactory.class: javax.net.ssl.SSLSocketFactory
mail.smtp.socketFactory.fallback: false
datasource:
type: com.zaxxer.hikari.HikariDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: ll_mysql
url: jdbc:mysql://192.168.1.106:22306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
url: jdbc:mysql://192.168.1.106:23306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
pool-name: AmytangHikariCP
minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size: 12 # 连接池最大连接数,默认是10
......@@ -52,4 +37,4 @@ security:
- /v3/api-docs
- /actuator/**
- /swagger-ui/**
- /sendMail/**
\ No newline at end of file
- /msg/**
\ No newline at end of file
......@@ -15,18 +15,17 @@ spring:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: ll_mysql
url: jdbc:mysql://192.168.1.106:22306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
pool-name: AmytangHikariCP
minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size: 12 # 连接池最大连接数,默认是10
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
url: jdbc:mysql://192.168.1.106:23306/ekp?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowMultiQueries=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
hikari:
driver-class-name: ${spring.datasource.driver-class-name}
jdbc-url: ${spring.datasource.url}
username: ${spring.datasource.username}
password: ${spring.datasource.password}
minimum-idle: 10 # 最小空闲连接数量
idle-timeout: 60000 # 空闲连接存活最大时间,默认600000(10分钟)
maximum-pool-size: 12 # 连接池最大连接数,默认是10
auto-commit: true #此属性控制从池返回的连接的默认自动提交行为,默认值:true
max-lifetime: 0 #此属性控制池中连接的最长生命周期,值0表示无限生命周期,默认1800000即30分钟
## spring security 配置
security:
oauth2:
......
......@@ -81,9 +81,17 @@
<include refid="msgInfo_where"/>
</where>
</select>
<select id="getMsgInfo" resultMap="msgInfoMap">
SELECT
<include refid="Base_Column_List"/>
FROM msg_info a
<where>
1=1
<include refid="msgInfo_where"/>
</where>
</select>
<!--
<select id="getMsgByOrderId" resultType="com.yifu.cloud.plus.v1.msg.entity.MsgInfo">
<select id="getMsgByOrderId" resultMap="msgInfoMap">
SELECT
p.fd_name alertUser,
a.fd_3ac901c5184274 orderNo,
......@@ -96,8 +104,9 @@
a.ORDER_ID = #{orderId} limit 1
</select>
<select id="getMsgByTask" resultType="com.yifu.cloud.plus.v1.msg.entity.MsgInfo">
<select id="getMsgByTask" resultMap="msgInfoMap">
select
<!-- 加急(2-3小时)|1 紧急(3-5小时)|4 常规(5-8小时)|7 -->
o.fd_name alertUser,
b1.fd_3ac901c5184274 orderNo,
b1.fd_id orderId,
......@@ -110,5 +119,5 @@
where
e.fd_fact_node_id='N5' and b1.fd_id is not null;
and DATE_ADD(NOW(),INTERVAL 30 MINUTE) > IF(b1.fd_3b779ba2168eea=1,DATE_ADD(a.fd_start_date,INTERVAL 3 HOUR),IF(b1.fd_3b779ba2168eea=4,DATE_ADD(a.fd_start_date,INTERVAL 5 HOUR),DATE_ADD(a.fd_start_date,INTERVAL 8 HOUR)))
</select>-->
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment