Merge remote-tracking branch 'origin/dev' into test

yun-zuoyi
jenkins 6 years ago
commit 1194828efa

@ -1,14 +1,19 @@
package cn.estsh.i3plus.core.apiservice.controller;
import cn.estsh.i3plus.core.api.iservice.busi.ISysLogExceptionService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysLogSystemService;
import cn.estsh.i3plus.icloud.core.sdk.ICoreDemoCloud;
import cn.estsh.i3plus.icloud.wms.sdk.IWmsDemoCloud;
import cn.estsh.i3plus.pojo.base.bean.BaseModelBean;
import cn.estsh.i3plus.pojo.base.bean.BaseResultBean;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
import cn.estsh.i3plus.pojo.platform.bean.SysRole;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogException;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogSystem;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
@ -52,4 +57,68 @@ public class DemoExceptionController {
return ResultBean.fail(busExcep);
}
}
@Autowired
private ISysLogExceptionService sysLogExceptionService;
@GetMapping(value = "/query")
@ApiOperation(value = "异常日志复杂查询,分页,排序",notes = "异常日志复杂查询,分页,排序")
public ResultBean querySysLogExceptionByPager(SysLogException sysLogException, Pager pager){
try {
System.out.println("1===============");
ListPager logExceptionList = sysLogExceptionService.querySysLogExceptionByPager(sysLogException, pager);
System.out.println(logExceptionList.getObjectList().size());
System.out.println("===============pager:" + pager);
return ResultBean.success("查询成功").setListPager(logExceptionList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
return ResultBean.fail(busExcep);
}catch(Exception e){
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
@Autowired
private ISysLogSystemService syslogSystemService;
@GetMapping(value = "/query-logSystem")
@ApiOperation(value = "异常日志复杂查询,分页,排序",notes = "异常日志复杂查询,分页,排序")
public ResultBean querySysLogSystemByPager(SysLogSystem sysLog, Pager pager){
try {
System.out.println("2===============");
ListPager logSystemList = syslogSystemService.querySysLogSystemByPager(sysLog,pager);
System.out.println(logSystemList.getObjectList().size());
System.out.println("===============pager:" + pager);
return ResultBean.success("查询成功").setListPager(logSystemList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
return ResultBean.fail(busExcep);
}catch(Exception e){
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
@GetMapping(value = "/query-logSystemtest2")
@ApiOperation(value = "异常日志复杂查询,分页,排序",notes = "异常日志复杂查询,分页,排序")
public ResultBean querySysLogSystemTest(){
try {
Pager pager = new Pager();
pager.setStartRow(0);
pager.setPageSize(10);
SysLogSystem logSystem = new SysLogSystem();
System.out.println("2===============");
ListPager logSystemList = syslogSystemService.querySysLogSystemByPager(logSystem,pager);
System.out.println(logSystemList.getObjectList().size());
System.out.println("===============pager:" + pager);
return ResultBean.success("查询成功").setListPager(logSystemList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
return ResultBean.fail(busExcep);
}catch(Exception e){
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
}

@ -79,6 +79,7 @@ public class SysDictionaryController extends CoreBaseController{
// 条件验证
ValidatorBean.beginValid(sysDictionary)
.notNull("id",sysDictionary.getId())
.notNull("name",sysDictionary.getName())
.notNull("dictionarySoftType",sysDictionary.getDictionarySoftType())
.notNull("dictionaryCode",sysDictionary.getDictionaryCode())

@ -362,7 +362,7 @@ public class SysOrderNoRuleController extends CoreBaseController {
@GetMapping(value = "/get-order-no/{code}")
@ApiOperation(value = "根据单号规则代码,生成单号")
public ResultBean getOrderNo(@PathVariable("code") String code) {
public synchronized ResultBean getOrderNo(@PathVariable("code") String code) {
try {
ValidatorBean.checkNotNull(code, "code不能为空");

@ -113,6 +113,7 @@ public class CoreReportController extends CoreBaseController {
public BaseResultBean<ClassModel> listClzModel() {
LOGGER.info("【类路径:{}】",pojoPackagePath);
List<String> clzNameList = ClassTool.getClassName(pojoPackagePath, true);
LOGGER.info("【类信息:{}】",clzNameList);
List<ClassModel> clzList = new ArrayList<>(clzNameList.size());
for(String clzName : clzNameList){
ClassModel model = getClassModel(clzName);
@ -168,6 +169,7 @@ public class CoreReportController extends CoreBaseController {
private ClassModel getClassModel(String clzName){
try {
LOGGER.info("【获取类信息:{}】",clzName);
//注册类
Class tmpClz = Class.forName(clzName);
ClassModel classModel = new ClassModel();

@ -1,6 +1,7 @@
package cn.estsh.i3plus.core.apiservice.mq;
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.*;
@ -71,4 +72,29 @@ public class I3CoreQueueConfig {
//LOGGER.info("【DEMO_CLOUD_WMS】");
return new Queue(DEMO_CLOUD_WMS);
}
@Bean
public Queue getQueueIMPP_MESSAGE_LETTER_QUEUE() throws Exception {
return new Queue(PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE);
}
@Bean
public Queue getQueueIMPP_MESSAGE_LETTER_QUEUE_BAK() throws Exception {
return new Queue(PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE_BAK);
}
@Bean
public Queue getQueueIMPP_MESSAGE_MAIL_QUEUE() throws Exception {
return new Queue(PlatformConstWords.IMPP_MESSAGE_MAIL_QUEUE);
}
@Bean
public Queue getQueueSWEB_NOTICE_QUEUE() throws Exception {
return new Queue(PlatformConstWords.SWEB_NOTICE_QUEUE);
}
@Bean
public Queue getQueueIMPP_SCHEDULE_QUEUE() throws Exception {
return new Queue(PlatformConstWords.IMPP_SCHEDULE_QUEUE);
}
}

@ -4,6 +4,7 @@ import cn.estsh.i3plus.core.api.iservice.busi.IPersonnelService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysMessageService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysUserService;
import cn.estsh.i3plus.core.apiservice.websocket.MessageWebSocket;
import cn.estsh.i3plus.platform.common.tool.JsonUtilTool;
import cn.estsh.i3plus.platform.common.tool.StringTool;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
@ -12,6 +13,7 @@ import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SysMessage;
import cn.estsh.i3plus.pojo.platform.bean.SysRefUserMessage;
import cn.estsh.i3plus.pojo.platform.bean.SysUser;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.rabbitmq.client.Channel;
import org.apache.commons.lang3.StringUtils;
@ -57,14 +59,15 @@ public class MessageLetterQueueReceiver {
/**
*
*
* @param msg
* @param data
* @param channel
* @param message rabbitTemplate.convertAndSend(I3CoreQueueConfig.IMPP_MESSAGE_QUEUE, new SysMessage(....));
*/
@RabbitListener(queues = PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE)
public void processImppMessage(SysMessage msg, Channel channel, Message message) {
LOGGER.info("【MQ-{}】 数据接收成功:{}", PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE, msg);
public void processImppMessage(String data, Channel channel, Message message) {
LOGGER.info("【MQ-{}】 数据接收成功:{}", PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE, data);
try {
SysMessage msg = JsonUtilTool.decode(data, SysMessage.class);
msg = sysMessageService.insertSysMessage(msg);
if (!StringUtils.isBlank(msg.getMessageReceiversId())) {
@ -110,7 +113,7 @@ public class MessageLetterQueueReceiver {
msg, message.getMessageProperties().getDeliveryTag());
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
} catch (IOException e) {
printErrorMessage(e, Exception.class, msg);
printErrorMessage(e, Exception.class, data);
try {
// 未成功处理,重新发送
@ -121,7 +124,7 @@ public class MessageLetterQueueReceiver {
}
}
private void printErrorMessage(Exception e, Class zlass, SysMessage msg) {
private void printErrorMessage(Exception e, Class zlass, String msg) {
Long time = System.currentTimeMillis();
LOGGER.error("【MQ-{}】{} 异常代码:{} 消息内容{},处理出错:{}", PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE, time, zlass, msg, e.getMessage());
e.printStackTrace();
@ -136,7 +139,7 @@ public class MessageLetterQueueReceiver {
sysMessage.setIsSystem(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
sysMessage.setMessageReceiverType(ImppEnumUtil.MESSAGE_RECEIVER_TYPE.EXTERNAL.getValue());
sysMessage.setMessageReceiversNameRdd("yunhao.wang@estsh.com,wei.peng@estsh.com");
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_MAIL_QUEUE, sysMessage);
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_MAIL_QUEUE, JSON.toJSONString(sysMessage));
}

@ -4,6 +4,7 @@ import cn.estsh.i3plus.core.api.iservice.busi.ISysConfigService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysMessageService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysUserService;
import cn.estsh.i3plus.core.apiservice.util.MailUtil;
import cn.estsh.i3plus.platform.common.tool.JsonUtilTool;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
@ -11,8 +12,10 @@ import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SysMessage;
import cn.estsh.i3plus.pojo.platform.bean.SysRefUserMessage;
import cn.estsh.i3plus.pojo.platform.bean.SysUser;
import com.alibaba.fastjson.JSON;
import com.rabbitmq.client.Channel;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.core.util.JsonUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
@ -47,13 +50,14 @@ public class MessageMailQueueReceiver {
/**
*
*
* @param msg
* @param data
* @param channel
* @param message
*/
@RabbitListener(queues = PlatformConstWords.IMPP_MESSAGE_MAIL_QUEUE)
public void processImppMail(SysMessage msg, Channel channel, Message message) {
public void processImppMail(String data, Channel channel, Message message) {
try {
SysMessage msg = JsonUtilTool.decode(data, SysMessage.class);
LOGGER.info("【MQ-IMPP_MESSAGE_MAIL_QUEUE】数据接收成功{}", msg);
if (msg.getMessageSendTime() == null) {
msg.setMessageSendTime(TimeTool.getNowTime(true));

@ -4,6 +4,7 @@ import cn.estsh.i3plus.core.api.iservice.busi.ISysFileAttachService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysFileService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysMessageService;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.platform.common.tool.JsonUtilTool;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
@ -52,15 +53,16 @@ public class MessageSWebNoticeQueueReceiver {
/**
* SWEB
*
* @param msg
* @param data
* @param channel
* @param message
*/
@RabbitListener(queues = PlatformConstWords.SWEB_NOTICE_QUEUE)
public void processImppMail(SysMessage msg, Channel channel, Message message) {
LOGGER.info("【MQ-{}】 数据接收成功:{}", PlatformConstWords.SWEB_NOTICE_QUEUE, msg);
public void processImppMail(String data, Channel channel, Message message) {
LOGGER.info("【MQ-{}】 数据接收成功:{}", PlatformConstWords.SWEB_NOTICE_QUEUE, data);
try {
// 添加消息
SysMessage msg = JsonUtilTool.decode(data, SysMessage.class);
msg = sysMessageService.insertSysMessage(msg);
// 添加附件信息

@ -2,6 +2,7 @@ package cn.estsh.i3plus.core.apiservice.mq;
import cn.estsh.i3plus.core.api.iservice.busi.ISysTaskPlanService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysUserService;
import cn.estsh.i3plus.platform.common.tool.JsonUtilTool;
import cn.estsh.i3plus.platform.common.tool.StringTool;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
@ -10,6 +11,7 @@ import cn.estsh.i3plus.pojo.base.enumutil.ImppEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SysMessage;
import cn.estsh.i3plus.pojo.platform.bean.SysTaskPlan;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogTaskTime;
import com.alibaba.fastjson.JSON;
import com.rabbitmq.client.Channel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -48,13 +50,14 @@ public class ScheduleQueueReceiver {
/**
*
*
* @param logTaskTime
* @param data
* @param channel
* @param message
*/
@RabbitListener(queues = PlatformConstWords.IMPP_SCHEDULE_QUEUE)
public void processSchedule(SysLogTaskTime logTaskTime, Channel channel, Message message) {
public void processSchedule(String data, Channel channel, Message message) {
try {
SysLogTaskTime logTaskTime = JsonUtilTool.decode(data, SysLogTaskTime.class);
LOGGER.info("【MQ-IMPP_SCHEDULE_QUEUE】数据接收成功{}", logTaskTime);
// 跟新最后执行时间 及 任务状态
SysTaskPlan taskPlan = sysTaskPlanService.getSysTaskPlanByNameAndGroup(logTaskTime.getName(), logTaskTime.getGroupName());
@ -105,9 +108,9 @@ public class ScheduleQueueReceiver {
// 发送到对应处理队列
if (taskPlan.getNoticeMethod() != null && ImppEnumUtil.MESSAGE_TYPE.MAIL.getValue() == taskPlan.getNoticeMethod().intValue()) {
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_MAIL_QUEUE, sysMessage);
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_MAIL_QUEUE, JSON.toJSONString(sysMessage));
} else {
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE, sysMessage);
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE, JSON.toJSONString(sysMessage));
}
}
}

@ -19,6 +19,7 @@ import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ImppRedis;
import com.alibaba.fastjson.JSON;
import com.netflix.discovery.converters.Auto;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
@ -157,13 +158,16 @@ public class SysMessageService implements ISysMessageService {
@ApiOperation(value = "添加消息并发送")
public void doSendSysMessage(SysMessage sysMessage) {
// 判断消息类型推送到对应的队列
// 邮件
if(ImppEnumUtil.MESSAGE_TYPE.MAIL.getValue() == sysMessage.getMessageTypeValue()){
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_MAIL_QUEUE,sysMessage);
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_MAIL_QUEUE, JSON.toJSONString(sysMessage));
// 站内信
}else if(ImppEnumUtil.MESSAGE_TYPE.LETTER.getValue() == sysMessage.getMessageTypeValue()){
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE,sysMessage);
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE_BAK,sysMessage);
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE,JSON.toJSONString(sysMessage));
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE_BAK,JSON.toJSONString(sysMessage));
// SWEB通知
} else if(ImppEnumUtil.MESSAGE_TYPE.SWEB_NOTICE.getValue() == sysMessage.getMessageTypeValue()){
rabbitTemplate.convertAndSend(PlatformConstWords.SWEB_NOTICE_QUEUE,sysMessage);
rabbitTemplate.convertAndSend(PlatformConstWords.SWEB_NOTICE_QUEUE,JSON.toJSONString(sysMessage));
} else {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())

@ -96,14 +96,14 @@ public class SysOrderNoRuleService implements ISysOrderNoRuleService {
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_DATA_NOT_EXIT.getCode())
.setErrorDetail("规则代码不存在存在")
.setErrorDetail("[" + code + "]规则代码不存在存在")
.setErrorSolution("请重新输入规则代码")
.build();
}else if(sysOrderNoRule.getOrderNoRuleStatus() == CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()){
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
.setErrorDetail("单号规则已禁用")
.setErrorDetail("[" + code + "]单号规则已禁用")
.setErrorSolution("请重新输入规则代码")
.build();
}else {

@ -14,6 +14,7 @@ import cn.estsh.i3plus.pojo.platform.bean.SysFile;
import cn.estsh.i3plus.pojo.platform.bean.SysMessage;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFRow;
@ -438,7 +439,7 @@ public class ExcelUtil {
sysMessage.setIsSystem(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
sysMessage.setMessageReceiversId(String.valueOf(userId));
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE,sysMessage);
rabbitTemplate.convertAndSend(PlatformConstWords.IMPP_MESSAGE_LETTER_QUEUE, JSON.toJSONString(sysMessage));
}
}

@ -0,0 +1,184 @@
#项目端口
server.port=8100
#本机ip
impp.server.ip=imppcore
#console控制台服务zipkin追踪全路径
impp.console.ip=http://console:8010
################ 功能配置1 ################
#若无法连接注册中心,是否需要一直检测加入
impp.cluster.fetch=true
#服务注册中心
impp.cluster.regist.center=http://register:8000/eureka/
#多注册中心
#impp.cluster.regist.center=http://192.168.1.20:8000/eureka/,http://192.168.1.20:8001/eureka/
################ 功能配置2 ################
#是否允许前端跨域提交impp.web.cross.hosts
impp.web.cross = true
################ 授权过滤配置 ################
#用户登陆路径
filter.shiro.user.loginuri = /login
#系统管理员登陆路径
filter.shiro.admin.loginuri = /salogin
#运维人员登陆路径
filter.shiro.saadmin.loginuri = /salogin
#用户授权过滤路径
filter.shiro.user.filteruri = /impp/operate/**
#用户授权过滤路径
filter.shiro.admin.filteruri = /impp/adoperate/*
#用户授权过滤路径
filter.shiro.saadmin.filteruri = /impp/saoperate/*
################ 云配置 以projectName作为应用名 ################
#是否开启微服
eureka.client.enabled=true
#(参数配置)注册中心地址 -》 i3plus-ics多个用逗号分隔
eureka.client.service-url.defaultZone=${impp.cluster.regist.center}
#区域源码中包含defaultZone所以默认使用defaultZone
#eureka.client.region=estsh
#eureka.client.service-url.estsh:http://192.168.1.20:8000/eureka/,http://192.168.1.20:8001/eureka/
################ 本机微服配置 ################
#本服务主机ip若多个网卡则需要设置本服务ip
eureka.instance.ip-address=${impp.server.ip}
#本服务实例ID
eureka.instance.instance-id=${impp.server.ip}:${server.port}
#本服务主机名
eureka.instance.hostname=${impp.server.ip}
#本服务状态页面
eureka.instance.status-page-url=http://${impp.server.ip}:${server.port}/swagger-ui.html
#将自己的IP注册到Eureka Server。若不配置或设置为false表示注册微服务所在操作系统的hostname到Eureka Server
eureka.instance.prefer-ip-address=true
#是否进行健康检查
eureka.client.healthcheck.enabled=true
################ 检测机制 ################
#心跳间隔周期宕机限制30秒没反应视为宕机
eureka.instance.lease-expiration-duration-in-seconds=30
#心跳周期
eureka.instance.lease-renewal-interval-in-seconds=20
#打开feign的熔断
feign.hystrix.enabled=true
#重试
ribbon.maxAutoRetries=2
#读取数据时长
ribbon.ReadTimeout=10000
#连接时长
ribbon.ConnectTimeout=10000
#响应超过时长,进行熔断(熔断超时需要大于读取时长及连接时长)
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=15000
#集群名
eureka.instance.metadata-map.cluster=impp_cluster
################ 链路追踪 ################
#使用web方式传输信息
spring.zipkin.sender.type=web
#链路追踪服务的地址
spring.zipkin.base-url=${impp.console.ip}
#追踪深度百分比1是全部
spring.sleuth.sampler.probability=1.0
################ 日志据源 ################
spring.data.mongodb.database=mongoDBSource
spring.data.mongodb.uri=mongodb:27017
spring.data.mongodb.username=sa
spring.data.mongodb.password=i3plus
spring.data.mongodb.port=27017
################ 主数据源 ################
# mysql
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.url=jdbc:mysql://localhost:3306/i3wms
##Sql-server##
#spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
#spring.datasource.url=jdbc:sqlserver://127.0.0.1:1433;databaseName=i3wms
##oracle##
#spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
#spring.datasource.url=jdbc:oracle:thin:@127.0.0.1:1521:i3wms
#spring.datasource.username=root
#spring.datasource.password=123456
##主数据源,读写
#impp.write.datasource.type=com.zaxxer.hikari.HikariDataSource
impp.write.datasource.driver-class-name=com.mysql.jdbc.Driver
impp.write.datasource.jdbc-url=jdbc:mysql://dbmaster:3306/impp_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8
impp.write.datasource.username=root
impp.write.datasource.password=estsh123
##辅数据源,只读
#impp.read.datasource.type=com.zaxxer.hikari.HikariDataSource
impp.read.datasource.driver-class-name=com.mysql.jdbc.Driver
impp.read.datasource.jdbc-url=jdbc:mysql://dbslave:3306/impp_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8
impp.read.datasource.username=root
impp.read.datasource.password=estsh123
##############定时任务持久化##############
impp.schedule.open=true
impp.schedule.datasource.driver-class-name=com.mysql.jdbc.Driver
impp.schedule.datasource.jdbc-url=jdbc:mysql://dbmaster:3306/impp_i3_schedule?autoReconnect=true&useSSL=false&characterEncoding=utf-8
impp.schedule.datasource.username=root
impp.schedule.datasource.password=estsh123
impp.schedule.datasource.max-connections=20
#定时任务在服务启动后多少秒执行
impp.schedule.start.after-second=20
#是否集群部署
impp.schedule.datasource.is-clustered=true
#执行检测(毫秒),若宕机由其他定时器执行
impp.schedule.datasource.cluster-checkin-interval=30000
#线程数
impp.schedule.thread-count=10
#线程优先级1-10默认为5
impp.schedule.thread-priority=5
################ 数据池设置 ################
spring.datasource.maximum-pool-size=10
spring.datasource.max-active=3
spring.datasource.max-idle=3
spring.datasource.min-idle=1
spring.datasource.initial-size=1
spring.datasource.max-wait=10000
spring.datasource.validation-query=SELECT 1
spring.datasource.test-on-borrow=false
spring.datasource.test-while-idle=true
spring.datasource.time-between-eviction-runs-millis=18800
################ JPA设置设置 ################
# mysql
spring.jpa.database=MYSQL
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
##Sql-server##
#spring.jpa.database=sql_server
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServerDialect
##oracle##
#spring.jpa.database=oracle
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
# mysql
spring.datasource.validationQuery=SELECT 1
##Sql-server##
# spring.datasource.validationQuery=SELECT 1
##oracle##
# spring.datasource.validationQuery=SELECT 1 FROM DUAL
#ImprovedNamingStrategy / physical_naming_strategy java属性映射到数据库字段时命名规则
# spring.jpa.properties.hibernate.physical_naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy/org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
#表关系create,create-drop,update,validate
spring.jpa.properties.hibernate.hbm2ddl.auto=update
#是否显示sql
spring.jpa.show-sql=true
################ MQ队列处理 ################
# 站内信
impp.mq.queue.letter = true
# 邮件
impp.mq.queue.mail = true
# 定时任务
impp.mq.queue.schedule = true
# SWEB通知处理队列
impp.mq.queue.sweb.notice = true

@ -0,0 +1,66 @@
package test.cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.core.api.iservice.busi.ISysLogExceptionService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysLogSystemService;
import cn.estsh.i3plus.core.apiservice.serviceimpl.busi.TestBase;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogException;
import cn.estsh.i3plus.pojo.platform.platbean.SysLogSystem;
import com.alibaba.fastjson.JSON;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import javax.transaction.Transactional;
import java.util.List;
/**
* @Description :
* @Reference :
* @Author : alwaysfrin
* @CreateDate : 2019-04-09 14:38
* @Modify:
**/
public class TestMongoDb extends TestBase {
@Autowired
private ISysLogExceptionService sysLogExceptionService;
@Autowired
private ISysLogSystemService syslogSystemService;
/**
*
*/
@Test
@Transactional
public void testListSysConfig() {
Pager pager = new Pager();
pager.setStartRow(0);
pager.setPageSize(10);
SysLogException sysLogException = new SysLogException();
ListPager logExceptionList = sysLogExceptionService.querySysLogExceptionByPager(sysLogException, pager);
System.out.println(logExceptionList);
}
@Test
@Transactional
public void testListSysLogSystem() {
Pager pager = new Pager();
pager.setStartRow(0);
pager.setPageSize(10);
SysLogSystem logSystem = new SysLogSystem();
logSystem.setLogLevel(1);
logSystem.setLogModuleId(1);
System.out.println("2===============");
ListPager logSystemList = syslogSystemService.querySysLogSystemByPager(logSystem,pager);
System.out.println(logSystemList.getObjectList().size());
System.out.println("===============pager:" + pager);
}
}
Loading…
Cancel
Save