浏览代码

modify_定时任务

zhangjie 2 年之前
父节点
当前提交
9eb215cb82

+ 32 - 13
build.gradle

@@ -81,17 +81,23 @@ project(':common'){
             exclude module: 'spring-core'
             exclude module: 'spring-web'
         }
-        compile 'org.apache.logging.log4j:log4j-api:2.17.2'
+        compile ('org.apache.logging.log4j:log4j-api:2.17.2'){
+            force = true
+        }
         compile 'org.apache.logging.log4j:log4j-core:2.17.2'
         compile 'org.apache.logging.log4j:log4j-web:2.17.2'
         compile 'org.apache.logging.log4j:log4j-1.2-api:2.17.2'
         compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.2'
         compile 'com.sun.xml.bind:jaxb-impl:3.0.2'
-        compile 'org.apache.commons:commons-lang3:3.12.0'
+        compile ('org.apache.commons:commons-lang3:3.12.0'){
+            force = true
+        }
         // https://mvnrepository.com/artifact/ognl/ognl
-        compile 'ognl:ognl:3.1.12'
+        compile 'ognl:ognl:3.1.29'
         // https://mvnrepository.com/artifact/org.freemarker/freemarker
-        compile 'org.freemarker:freemarker:2.3.23'
+        compile ('org.freemarker:freemarker:2.3.23'){
+            force = true
+        }
 
 
         compileOnly "javax.servlet:javax.servlet-api:3.1.0"
@@ -102,6 +108,7 @@ project(':common'){
         compile.exclude module: 'servlet-api'
         compile.exclude module: 'log4j'
         compile.exclude module: 'slf4j-log4j12'
+        compile.exclude module: 'commons-io'
     }
 
     configurations.compile.resolutionStrategy{
@@ -131,11 +138,15 @@ project(':web-cluster'){
         compile 'org.apache.logging.log4j:log4j-1.2-api:2.17.2'
         compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.2'
         compile 'com.sun.xml.bind:jaxb-impl:3.0.2'
-        compile 'org.apache.commons:commons-lang3:3.12.0'
+        compile ('org.apache.commons:commons-lang3:3.12.0'){
+            force = true
+        }
         // https://mvnrepository.com/artifact/ognl/ognl
-        compile 'ognl:ognl:3.1.12'
+        compile 'ognl:ognl:3.1.29'
         // https://mvnrepository.com/artifact/org.freemarker/freemarker
-        compile 'org.freemarker:freemarker:2.3.23'
+        compile ('org.freemarker:freemarker:2.3.23'){
+            force = true
+        }
 
 
         compileOnly "javax.servlet:javax.servlet-api:3.1.0"
@@ -173,11 +184,15 @@ project(':web-clis'){
         compile 'org.apache.logging.log4j:log4j-1.2-api:2.17.2'
         compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.2'
         compile 'com.sun.xml.bind:jaxb-impl:3.0.2'
-        compile 'org.apache.commons:commons-lang3:3.12.0'
+        compile ('org.apache.commons:commons-lang3:3.12.0'){
+            force = true
+        }
         // https://mvnrepository.com/artifact/ognl/ognl
-        compile 'ognl:ognl:3.1.12'
+        compile 'ognl:ognl:3.1.29'
         // https://mvnrepository.com/artifact/org.freemarker/freemarker
-        compile 'org.freemarker:freemarker:2.3.23'
+        compile ('org.freemarker:freemarker:2.3.23'){
+            force = true
+        }
 
 
         compileOnly "javax.servlet:javax.servlet-api:3.1.0"
@@ -215,11 +230,15 @@ project(':web-edi'){
         compile 'org.apache.logging.log4j:log4j-1.2-api:2.17.2'
         compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.17.2'
         compile 'com.sun.xml.bind:jaxb-impl:3.0.2'
-        compile 'org.apache.commons:commons-lang3:3.12.0'
+        compile ('org.apache.commons:commons-lang3:3.12.0'){
+            force = true
+        }
         // https://mvnrepository.com/artifact/ognl/ognl
-        compile 'ognl:ognl:3.1.12'
+        compile 'ognl:ognl:3.1.29'
         // https://mvnrepository.com/artifact/org.freemarker/freemarker
-        compile 'org.freemarker:freemarker:2.3.23'
+        compile ('org.freemarker:freemarker:2.3.23'){
+            force = true
+        }
 
 
         compileOnly "javax.servlet:javax.servlet-api:3.1.0"

+ 5 - 5
common/src/main/java/com/behosoft/lis/common/subscriber/BsOmsDeliveryOutboundFeedbackSubscriber.java

@@ -55,7 +55,7 @@ import com.wondersgroup.saas.util.JSONUtil;
  * @author (lastest modification by  )
  * @since 1.0
  */
-public class BsOmsDeliveryOutboundFeedbackSubscriber extends AbstractDataSubscriber<WrappedMessage> {
+public class BsOmsDeliveryOutboundFeedbackSubscriber{
 	private final Log logger = LogFactory.getLog(this.getClass());
 	
 	@Autowired
@@ -76,10 +76,10 @@ public class BsOmsDeliveryOutboundFeedbackSubscriber extends AbstractDataSubscri
 	@Autowired
 	private DeliverDocumentService deliverDocumentService;
 	
-	@Override
-	public void receive(WrappedMessage param) {
-		List<Serializable> serializables = ((SerializableMessage) param).getFilteredObjects();
-		Date date = (Date) serializables.get(0);
+//	@Override
+	public void receive() {
+//		List<Serializable> serializables = ((SerializableMessage) param).getFilteredObjects();
+//		Date date = (Date) serializables.get(0);
 //		logger.info("enter BsOmsDeliveryOutboundFeedbackSubscriber get date is:" + date);
 		
 		List<AccountConfig> accountConfigList = accountConfigService.getValueByKey("BS_CUSTOMER_CODE");

+ 5 - 5
common/src/main/java/com/behosoft/lis/common/subscriber/BsOmsPickInboundFeedbackSubscriber.java

@@ -53,7 +53,7 @@ import com.wondersgroup.saas.util.JSONUtil;
  * @author (lastest modification by )
  * @since 1.0
  */
-public class BsOmsPickInboundFeedbackSubscriber extends AbstractDataSubscriber<WrappedMessage> {
+public class BsOmsPickInboundFeedbackSubscriber {
 
 	private final Log logger = LogFactory.getLog(this.getClass());
 
@@ -72,10 +72,10 @@ public class BsOmsPickInboundFeedbackSubscriber extends AbstractDataSubscriber<W
 	@Autowired
 	private OmsPickInboundService omsPickInboundService;
 	
-	@Override
-	public void receive(WrappedMessage param) {
-		List<Serializable> serializables = ((SerializableMessage) param).getFilteredObjects();
-		Date date = (Date) serializables.get(0);
+//	@Override
+	public void receive() {
+//		List<Serializable> serializables = ((SerializableMessage) param).getFilteredObjects();
+//		Date date = new Date();
 //		logger.info("enter BsOmsPickInboundFeedbackSubscriber get date is:" + date);
 		
 		List<AccountConfig> accountConfigList = accountConfigService.getValueByKey("BS_CUSTOMER_CODE");

+ 30 - 13
web-clis/src/main/resources/config/lis/applicationContext.xml

@@ -3,13 +3,14 @@
 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
 	xmlns:aop="http://www.springframework.org/schema/aop" xmlns:context="http://www.springframework.org/schema/context"
 	xmlns:jee="http://www.springframework.org/schema/jee" xmlns:p="http://www.springframework.org/schema/p"
-	xmlns:util="http://www.springframework.org/schema/util"
+	xmlns:util="http://www.springframework.org/schema/util" xmlns:task="http://www.springframework.org/schema/task"
 	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
 	http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
 	http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
 	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
 	http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd
-	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
+	http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd">
 
 	<util:properties id="fileConfig" location="classpath:config\lis\filepath.properties" /> 
 
@@ -29,17 +30,33 @@
 	<import resource="classpath:config/framework/framework.xml" />
 	<context:component-scan base-package="com.behosoft.lis"></context:component-scan>
 
-<!--  
-	<context:component-scan base-package="com.behosoft.lis"
-		use-default-filters="false">
-		<context:include-filter expression="org.springframework.stereotype.Controller"
-			type="annotation" />
-	</context:component-scan>
-	<context:component-scan base-package="com.behosoft.lis">
-		<context:exclude-filter expression="org.springframework.stereotype.Controller"
-			type="annotation" />
-	</context:component-scan>
--->
+
+	<!--<context:component-scan base-package="com.behosoft.lis.common.subscriber" />-->
+	<!--采购入库反馈-->
+	<task:scheduled-tasks>
+		<task:scheduled ref="BsOmsPickInboundFeedbackSubscriberBean" method="receive" cron="0 0/10 * * * ?" />
+	</task:scheduled-tasks>
+	<bean id="BsOmsPickInboundFeedbackSubscriberBean" class="com.behosoft.lis.common.subscriber.BsOmsPickInboundFeedbackSubscriber"/>
+	<!--销售出库反馈-->
+	<task:scheduled-tasks>
+		<task:scheduled ref="BsOmsDeliveryOutboundFeedbackSubscriberBean" method="receive" cron="0 0/5 * * * ?" />
+	</task:scheduled-tasks>
+	<bean id="BsOmsDeliveryOutboundFeedbackSubscriberBean" class="com.behosoft.lis.common.subscriber.BsOmsDeliveryOutboundFeedbackSubscriber"/>
+
+
+
+
+	<!--
+        <context:component-scan base-package="com.behosoft.lis"
+            use-default-filters="false">
+            <context:include-filter expression="org.springframework.stereotype.Controller"
+                type="annotation" />
+        </context:component-scan>
+        <context:component-scan base-package="com.behosoft.lis">
+            <context:exclude-filter expression="org.springframework.stereotype.Controller"
+                type="annotation" />
+        </context:component-scan>
+    -->
 
 	<import resource="classpath:config/lis/behosoft-ds.xml" />
 	<import resource="classpath:config/lis/behosoft-lisserivce.xml" />