From 70facfe86b1a7c7ab47a9aa1cd87675d14b183bf Mon Sep 17 00:00:00 2001
From: alwaysfrin <39822157+alwaysfrin@users.noreply.github.com>
Date: Mon, 29 Oct 2018 14:58:40 +0800
Subject: [PATCH 1/2] =?UTF-8?q?pom=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
modules/i3plus-core-api/pom.xml | 6 +--
.../core/api/iservice/busi/ILogOperateService.java | 1 -
modules/i3plus-core-apiservice/pom.xml | 37 ++----------------
pom.xml | 44 ++++------------------
4 files changed, 14 insertions(+), 74 deletions(-)
diff --git a/modules/i3plus-core-api/pom.xml b/modules/i3plus-core-api/pom.xml
index bc1be0a..6763680 100644
--- a/modules/i3plus-core-api/pom.xml
+++ b/modules/i3plus-core-api/pom.xml
@@ -21,11 +21,9 @@
i3plus.pojo
i3plus-pojo-mes
-
-
- org.apache.shiro
- shiro-core
+ i3plus.pojo
+ i3plus-pojo-wms
diff --git a/modules/i3plus-core-api/src/main/java/cn/estsh/i3plus/core/api/iservice/busi/ILogOperateService.java b/modules/i3plus-core-api/src/main/java/cn/estsh/i3plus/core/api/iservice/busi/ILogOperateService.java
index 452e650..61fe9d1 100644
--- a/modules/i3plus-core-api/src/main/java/cn/estsh/i3plus/core/api/iservice/busi/ILogOperateService.java
+++ b/modules/i3plus-core-api/src/main/java/cn/estsh/i3plus/core/api/iservice/busi/ILogOperateService.java
@@ -1,7 +1,6 @@
package cn.estsh.i3plus.core.api.iservice.busi;
import cn.estsh.i3plus.pojo.platform.bean.LogOperate;
-import cn.estsh.i3plus.pojo.platform.bean.LogOperate;
import java.util.List;
diff --git a/modules/i3plus-core-apiservice/pom.xml b/modules/i3plus-core-apiservice/pom.xml
index 1955290..91c8706 100644
--- a/modules/i3plus-core-apiservice/pom.xml
+++ b/modules/i3plus-core-apiservice/pom.xml
@@ -23,7 +23,10 @@
i3plus.pojo
i3plus-pojo-base
-
+
+ i3plus.pojo
+ i3plus-pojo-wms
+
@@ -57,43 +60,11 @@
commons-lang3
-
-
- org.apache.shiro
- shiro-core
-
-
- org.apache.shiro
- shiro-spring
-
-
- org.apache.shiro
- shiro-web
-
-
- org.apache.shiro
- shiro-ehcache
-
-
com.alibaba
fastjson
-
-
-
- net.sf.ehcache
- ehcache-core
-
-
- i3plus.pojo
- i3plus-pojo-mes
-
-
- org.slf4j
- slf4j-api
-
diff --git a/pom.xml b/pom.xml
index 160703c..c78e118 100644
--- a/pom.xml
+++ b/pom.xml
@@ -44,12 +44,6 @@
-
-
- i3plus.pojo
- i3plus-pojo-wms
- ${project.version}
-
@@ -63,6 +57,12 @@
i3plus.pojo
+ i3plus-pojo-base
+ ${project.version}
+
+
+
+ i3plus.pojo
i3plus-pojo-model
${project.version}
@@ -97,7 +97,7 @@
i3plus.pojo
- i3plus-pojo-mes
+ i3plus-pojo-wms
${project.version}
@@ -115,28 +115,6 @@
3.8.1
-
-
- org.apache.shiro
- shiro-core
- 1.4.0
-
-
- org.apache.shiro
- shiro-web
- 1.4.0
-
-
- org.apache.shiro
- shiro-spring
- 1.4.0
-
-
- org.apache.shiro
- shiro-ehcache
- 1.4.0
-
-
com.alibaba
@@ -153,9 +131,6 @@
-
-
-
@@ -180,9 +155,6 @@
-
-
-
@@ -216,7 +188,7 @@
prod
true
- http://git.evun.cn/GCDC-MES-SERVICE/PLATFORM_PROD_EXEC.git
+ http://git.estsh.com/i3-IMPP/i3plus-core.git
v@{project.version}
From 35a204ea314b74809a06f4a5312aa2ff7035ab23 Mon Sep 17 00:00:00 2001
From: alwaysfrin <39822157+alwaysfrin@users.noreply.github.com>
Date: Mon, 29 Oct 2018 17:30:48 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E8=B7=A8=E5=9F=9F=E6=8F=90=E4=BA=A4=20mq?=
=?UTF-8?q?=E5=8F=91=E9=80=81=E9=82=AE=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../core/apiservice/mq/I3CoreQueueConfig.java | 31 ++++++++++--------
.../core/apiservice/mq/I3CoreQueueReceiver.java | 38 +++++++++++++++++++++-
.../src/main/resources/application-dev.properties | 2 --
3 files changed, 55 insertions(+), 16 deletions(-)
diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/mq/I3CoreQueueConfig.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/mq/I3CoreQueueConfig.java
index 2a733fa..cc9017d 100644
--- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/mq/I3CoreQueueConfig.java
+++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/mq/I3CoreQueueConfig.java
@@ -17,43 +17,48 @@ import org.springframework.context.annotation.Configuration;
public class I3CoreQueueConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(I3CoreQueueConfig.class);
- public static final String DEMO_STR_QUEUE = "demo_str_queue";
-
- public static final String DEMO_OBJ_QUEUE = "demo_obj_queue";
+ public static final String IMPP_MESSAGE_QUEUE = "IMPP_MESSAGE_QUEUE";
+ @Bean
+ public Queue getImppMessageQueue() {
+ LOGGER.info("【开启平台消息队列】");
+ return new Queue(IMPP_MESSAGE_QUEUE);
+ }
- public static final String DEMO_HANDLE_QUEUE = "demo_handle_queue";
- public static final String DEMO_ACK_QUEUE = "ack_queue";
-
- public static final String DEMO_RETURN_QUEUE = "return_queue";
+ /*********** 队列demo ***********/
+ public static final String DEMO_STR_QUEUE = "demo_str_queue";
@Bean
public Queue getStrQueue() {
//LOGGER.info("【DEMO_STR_QUEUE队列】");
return new Queue(DEMO_STR_QUEUE);
}
+ public static final String DEMO_OBJ_QUEUE = "demo_obj_queue";
@Bean
public Queue getObjQueue() throws Exception {
//LOGGER.info("【DEMO_OBJ_QUEUE队列】");
return new Queue(DEMO_OBJ_QUEUE);
}
+ public static final String DEMO_HANDLE_QUEUE = "demo_handle_queue";
@Bean
public Queue getHandleQueue() throws Exception {
//LOGGER.info("【DEMO_HANDLE_QUEUE队列】");
return new Queue(DEMO_HANDLE_QUEUE);
}
- @Bean
- public Queue getReturnQueue() throws Exception {
- //LOGGER.info("【DEMO_RETURN_QUEUE队列】");
- return new Queue(DEMO_RETURN_QUEUE);
- }
-
+ public static final String DEMO_ACK_QUEUE = "ack_queue";
@Bean
public Queue getAckQueue() throws Exception {
LOGGER.info("【DEMO_ACK_QUEUE队列】");
return new Queue(DEMO_ACK_QUEUE);
}
+
+ public static final String DEMO_RETURN_QUEUE = "return_queue";
+ @Bean
+ public Queue getReturnQueue() throws Exception {
+ //LOGGER.info("【DEMO_RETURN_QUEUE队列】");
+ return new Queue(DEMO_RETURN_QUEUE);
+ }
}
diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/mq/I3CoreQueueReceiver.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/mq/I3CoreQueueReceiver.java
index ff31534..c2a4f97 100644
--- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/mq/I3CoreQueueReceiver.java
+++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/mq/I3CoreQueueReceiver.java
@@ -1,6 +1,10 @@
package cn.estsh.i3plus.core.apiservice.mq;
+import cn.estsh.i3plus.core.apiservice.controller.DemoRestController;
+import cn.estsh.i3plus.pojo.platform.bean.SysMessage;
import com.rabbitmq.client.Channel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;
@@ -16,6 +20,36 @@ import java.io.IOException;
**/
@Component
public class I3CoreQueueReceiver {
+ private static final Logger LOGGER = LoggerFactory.getLogger(I3CoreQueueReceiver.class);
+
+ /**
+ * 系统邮件处理队列
+ * @param msg
+ * @param channel
+ * @param message
+ * 发送:rabbitTemplate.convertAndSend(I3CoreQueueConfig.IMPP_MESSAGE_QUEUE, new SysMessage(....));
+ */
+ @RabbitListener(queues = I3CoreQueueConfig.IMPP_MESSAGE_QUEUE)
+ public void processImppMessage(SysMessage msg, Channel channel, Message message) {
+ try {
+ LOGGER.info("【MQ-IMPP_MESSAGE_QUEUE】数据接收成功:{}",msg);
+
+ //信息已处理
+ channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
+ } catch (IOException e) {
+ LOGGER.error("【MQ-IMPP_MESSAGE_QUEUE】处理出错:{}",e.getMessage(),e);
+ //丢弃这条消息
+ try {
+ // 未成功处理,重新发送
+ channel.basicNack(message.getMessageProperties().getDeliveryTag(),false,true);
+ } catch (IOException e1) {
+ e1.printStackTrace();
+ }
+ }
+ }
+
+
+ /********************* 消息队列处理demo *******************/
/*@RabbitListener(queues = I3CoreQueueConfig.DEMO_STR_QUEUE)
public void getObjQueue(String data) {
@@ -71,10 +105,12 @@ public class I3CoreQueueReceiver {
//在队列删掉 不会再发了 否则消息服务器以为这条消息没处理掉 后续还会在发
channel.basicAck(message.getMessageProperties().getDeliveryTag(),false);
} catch (IOException e) {
- e.printStackTrace(); //丢弃这条消息
+ e.printStackTrace();
+ //丢弃这条消息
// channel.basicNack(message.getMessageProperties().getDeliveryTag(), false,false);
// System.out.println("receiver fail");
try {
+ //
channel.basicNack(message.getMessageProperties().getDeliveryTag(),false,true);
} catch (IOException e1) {
e1.printStackTrace();
diff --git a/modules/i3plus-core-apiservice/src/main/resources/application-dev.properties b/modules/i3plus-core-apiservice/src/main/resources/application-dev.properties
index 1c52958..02cfe38 100644
--- a/modules/i3plus-core-apiservice/src/main/resources/application-dev.properties
+++ b/modules/i3plus-core-apiservice/src/main/resources/application-dev.properties
@@ -14,8 +14,6 @@ filter.shiro.saadmin.filteruri = /saoperate/*
#是否允许前端跨域提交
impp.web.cross = true
-#允许前端跨域提交ip地址,多个以逗号分隔
-impp.web.cross.hosts = http://127.0.0.1,http://localhost
################ 主数据源 ################
# mysql