Commit 50792df12212ec17551a1cbb6000c9bfb04305c9

Authored by 肖超群
2 parents 8834e010 181ee77a

Merge branch 'develop4' of http://www.huahengrobot.com:90/wms/wms4 into develop4

ant-design-vue-jeecg/pom.xml
@@ -10,5 +10,4 @@ @@ -10,5 +10,4 @@
10 </parent> 10 </parent>
11 11
12 <artifactId>ant-design-vue-jeecg</artifactId> 12 <artifactId>ant-design-vue-jeecg</artifactId>
13 - <packaging>jar</packaging>  
14 </project> 13 </project>
huaheng-wms-core/pom.xml
@@ -59,9 +59,59 @@ @@ -59,9 +59,59 @@
59 <dependency> 59 <dependency>
60 <groupId>org.jeecgframework.boot</groupId> 60 <groupId>org.jeecgframework.boot</groupId>
61 <artifactId>jeecg-boot-base-core</artifactId> 61 <artifactId>jeecg-boot-base-core</artifactId>
62 - <version>3.1.0</version>  
63 </dependency> 62 </dependency>
64 </dependencies> 63 </dependencies>
  64 +
  65 + <build>
  66 + <plugins>
  67 + <!--<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> 指定JDK编译版本 -->
  68 + <plugin>
  69 + <groupId>org.apache.maven.plugins</groupId>
  70 + <artifactId>maven-compiler-plugin</artifactId>
  71 + <configuration>
  72 + <source>1.8</source>
  73 + <target>1.8</target>
  74 + <encoding>UTF-8</encoding>
  75 + </configuration>
  76 + </plugin>
  77 + <!-- 打包跳过测试 -->
  78 + <plugin>
  79 + <groupId>org.apache.maven.plugins</groupId>
  80 + <artifactId>maven-surefire-plugin</artifactId>
  81 + <configuration>
  82 + <skipTests>true</skipTests>
  83 + </configuration>
  84 + </plugin>
  85 + <!-- 避免font文件的二进制文件格式压缩破坏 -->
  86 + <plugin>
  87 + <groupId>org.apache.maven.plugins</groupId>
  88 + <artifactId>maven-resources-plugin</artifactId>
  89 + <configuration>
  90 + <nonFilteredFileExtensions>
  91 + <nonFilteredFileExtension>woff</nonFilteredFileExtension>
  92 + <nonFilteredFileExtension>woff2</nonFilteredFileExtension>
  93 + <nonFilteredFileExtension>eot</nonFilteredFileExtension>
  94 + <nonFilteredFileExtension>ttf</nonFilteredFileExtension>
  95 + <nonFilteredFileExtension>svg</nonFilteredFileExtension>
  96 + </nonFilteredFileExtensions>
  97 + </configuration>
  98 + </plugin>
  99 + </plugins>
  100 + <resources>
  101 + <resource>
  102 + <directory>src/main/resources</directory>
  103 + <filtering>true</filtering>
  104 + </resource>
  105 + <resource>
  106 + <directory>src/main/java</directory>
  107 + <includes>
  108 + <include>**/*.xml</include>
  109 + <include>**/*.json</include>
  110 + <include>**/*.ftl</include>
  111 + </includes>
  112 + </resource>
  113 + </resources>
  114 + </build>
65 115
66 <!-- 环境 --> 116 <!-- 环境 -->
67 <profiles> 117 <profiles>
huaheng-wms-core/src/main/java/org/jeecg/JeecgSystemApplication.java
1 package org.jeecg; 1 package org.jeecg;
2 2
3 -import lombok.extern.slf4j.Slf4j;  
4 -import org.apache.catalina.Context;  
5 -import org.apache.tomcat.util.scan.StandardJarScanner; 3 +import java.net.InetAddress;
  4 +import java.net.UnknownHostException;
  5 +
6 import org.jeecg.common.util.oConvertUtils; 6 import org.jeecg.common.util.oConvertUtils;
7 import org.springframework.boot.SpringApplication; 7 import org.springframework.boot.SpringApplication;
8 //import org.springframework.boot.autoconfigure.EnableAutoConfiguration; 8 //import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
@@ -10,14 +10,11 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -10,14 +10,11 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
10 import org.springframework.boot.autoconfigure.SpringBootApplication; 10 import org.springframework.boot.autoconfigure.SpringBootApplication;
11 import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; 11 import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration;
12 import org.springframework.boot.builder.SpringApplicationBuilder; 12 import org.springframework.boot.builder.SpringApplicationBuilder;
13 -import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;  
14 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 13 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
15 import org.springframework.context.ConfigurableApplicationContext; 14 import org.springframework.context.ConfigurableApplicationContext;
16 -import org.springframework.context.annotation.Bean;  
17 import org.springframework.core.env.Environment; 15 import org.springframework.core.env.Environment;
18 16
19 -import java.net.InetAddress;  
20 -import java.net.UnknownHostException; 17 +import lombok.extern.slf4j.Slf4j;
21 18
22 /** 19 /**
23 * 单体启动类(采用此类启动为单体模式) 20 * 单体启动类(采用此类启动为单体模式)
@@ -37,14 +34,15 @@ public class JeecgSystemApplication extends SpringBootServletInitializer { @@ -37,14 +34,15 @@ public class JeecgSystemApplication extends SpringBootServletInitializer {
37 Environment env = application.getEnvironment(); 34 Environment env = application.getEnvironment();
38 String ip = InetAddress.getLocalHost().getHostAddress(); 35 String ip = InetAddress.getLocalHost().getHostAddress();
39 String port = env.getProperty("server.port"); 36 String port = env.getProperty("server.port");
  37 + String profiles = env.getProperty("spring.profiles.active");
40 String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path")); 38 String path = oConvertUtils.getString(env.getProperty("server.servlet.context-path"));
41 log.info("\n----------------------------------------------------------\n\t" + 39 log.info("\n----------------------------------------------------------\n\t" +
42 "Application HUAHENG-WMS4 is running! Access URLs:\n\t" + 40 "Application HUAHENG-WMS4 is running! Access URLs:\n\t" +
43 "Local: \t\thttp://localhost:" + port + path + "/\n\t" + 41 "Local: \t\thttp://localhost:" + port + path + "/\n\t" +
44 "External: \thttp://" + ip + ":" + port + path + "/\n\t" + 42 "External: \thttp://" + ip + ":" + port + path + "/\n\t" +
45 - "Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n" + 43 + "Swagger文档: \thttp://" + ip + ":" + port + path + "/doc.html\n\t" +
  44 + "The following profiles are active: "+ profiles + "\n" +
46 "----------------------------------------------------------"); 45 "----------------------------------------------------------");
47 -  
48 } 46 }
49 47
50 } 48 }
51 \ No newline at end of file 49 \ No newline at end of file
huaheng-wms-core/src/main/java/org/jeecg/modules/message/job/SendMsgJob.java
@@ -13,6 +13,7 @@ import org.quartz.JobExecutionContext; @@ -13,6 +13,7 @@ import org.quartz.JobExecutionContext;
13 import org.quartz.JobExecutionException; 13 import org.quartz.JobExecutionException;
14 import org.springframework.beans.factory.annotation.Autowired; 14 import org.springframework.beans.factory.annotation.Autowired;
15 15
  16 +import com.alibaba.fastjson.JSON;
16 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 17 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
17 18
18 import lombok.extern.slf4j.Slf4j; 19 import lombok.extern.slf4j.Slf4j;
@@ -28,46 +29,45 @@ public class SendMsgJob implements Job { @@ -28,46 +29,45 @@ public class SendMsgJob implements Job {
28 private ISysMessageService sysMessageService; 29 private ISysMessageService sysMessageService;
29 30
30 @Override 31 @Override
31 - public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { 32 + public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
32 33
33 - log.info(String.format(" Jeecg-Boot 发送消息任务 SendMsgJob ! 时间:" + DateUtils.getTimestamp())); 34 + log.info(String.format("Jeecg-Boot 发送消息任务 SendMsgJob!时间:" + DateUtils.getTimestamp()));
34 35
35 - // 1.读取消息中心数据,只查询未发送的和发送失败不超过次数的  
36 - QueryWrapper<SysMessage> queryWrapper = new QueryWrapper<SysMessage>();  
37 - queryWrapper.eq("es_send_status", SendMsgStatusEnum.WAIT.getCode())  
38 - .or(i -> i.eq("es_send_status", SendMsgStatusEnum.FAIL.getCode()).lt("es_send_num", 6));  
39 - List<SysMessage> sysMessages = sysMessageService.list(queryWrapper);  
40 - System.out.println(sysMessages);  
41 - // 2.根据不同的类型走不通的发送实现类  
42 - for (SysMessage sysMessage : sysMessages) {  
43 - ISendMsgHandle sendMsgHandle = null;  
44 - try {  
45 - if (sysMessage.getEsType().equals(SendMsgTypeEnum.EMAIL.getType())) {  
46 - sendMsgHandle = (ISendMsgHandle) Class.forName(SendMsgTypeEnum.EMAIL.getImplClass()).newInstance();  
47 - } else if (sysMessage.getEsType().equals(SendMsgTypeEnum.SMS.getType())) {  
48 - sendMsgHandle = (ISendMsgHandle) Class.forName(SendMsgTypeEnum.SMS.getImplClass()).newInstance();  
49 - } else if (sysMessage.getEsType().equals(SendMsgTypeEnum.WX.getType())) {  
50 - sendMsgHandle = (ISendMsgHandle) Class.forName(SendMsgTypeEnum.WX.getImplClass()).newInstance();  
51 - }  
52 - } catch (Exception e) {  
53 - log.error(e.getMessage(),e);  
54 - }  
55 - Integer sendNum = sysMessage.getEsSendNum();  
56 - try {  
57 - sendMsgHandle.SendMsg(sysMessage.getEsReceiver(), sysMessage.getEsTitle(),  
58 - sysMessage.getEsContent().toString());  
59 - // 发送消息成功  
60 - sysMessage.setEsSendStatus(SendMsgStatusEnum.SUCCESS.getCode());  
61 - } catch (Exception e) {  
62 - e.printStackTrace();  
63 - // 发送消息出现异常  
64 - sysMessage.setEsSendStatus(SendMsgStatusEnum.FAIL.getCode());  
65 - }  
66 - sysMessage.setEsSendNum(++sendNum);  
67 - // 发送结果回写到数据库  
68 - sysMessageService.updateById(sysMessage);  
69 - }  
70 -  
71 - } 36 + // 1.读取消息中心数据,只查询未发送的和发送失败不超过次数的
  37 + QueryWrapper<SysMessage> queryWrapper = new QueryWrapper<SysMessage>();
  38 + queryWrapper.eq("es_send_status", SendMsgStatusEnum.WAIT.getCode())
  39 + .or(i -> i.eq("es_send_status", SendMsgStatusEnum.FAIL.getCode()).lt("es_send_num", 6));
  40 + List<SysMessage> sysMessages = sysMessageService.list(queryWrapper);
  41 + log.info("Jeecg-Boot 发送消息任务 sysMessages:{}", JSON.toJSONString(sysMessages));
  42 + // 2.根据不同的类型走不通的发送实现类
  43 + for (SysMessage sysMessage : sysMessages) {
  44 + ISendMsgHandle sendMsgHandle = null;
  45 + try {
  46 + if (sysMessage.getEsType().equals(SendMsgTypeEnum.EMAIL.getType())) {
  47 + sendMsgHandle = (ISendMsgHandle)Class.forName(SendMsgTypeEnum.EMAIL.getImplClass()).newInstance();
  48 + } else if (sysMessage.getEsType().equals(SendMsgTypeEnum.SMS.getType())) {
  49 + sendMsgHandle = (ISendMsgHandle)Class.forName(SendMsgTypeEnum.SMS.getImplClass()).newInstance();
  50 + } else if (sysMessage.getEsType().equals(SendMsgTypeEnum.WX.getType())) {
  51 + sendMsgHandle = (ISendMsgHandle)Class.forName(SendMsgTypeEnum.WX.getImplClass()).newInstance();
  52 + }
  53 + } catch (Exception e) {
  54 + log.error(e.getMessage(), e);
  55 + }
  56 + Integer sendNum = sysMessage.getEsSendNum();
  57 + try {
  58 + sendMsgHandle.SendMsg(sysMessage.getEsReceiver(), sysMessage.getEsTitle(), sysMessage.getEsContent().toString());
  59 + // 发送消息成功
  60 + sysMessage.setEsSendStatus(SendMsgStatusEnum.SUCCESS.getCode());
  61 + } catch (Exception e) {
  62 + log.error(e.getMessage(), e);
  63 + // 发送消息出现异常
  64 + sysMessage.setEsSendStatus(SendMsgStatusEnum.FAIL.getCode());
  65 + }
  66 + sysMessage.setEsSendNum(++sendNum);
  67 + // 发送结果回写到数据库
  68 + sysMessageService.updateById(sysMessage);
  69 + }
  70 + log.info(String.format("Jeecg-Boot 发送消息任务 SendMsgJob 结束"));
  71 + }
72 72
73 } 73 }
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/api/mes/controller/MesController.java
@@ -95,6 +95,4 @@ public class MesController extends HuahengBaseController { @@ -95,6 +95,4 @@ public class MesController extends HuahengBaseController {
95 Result result = mesService.shipmentMaterial(mesShipmentMaterial, warehouseCode); 95 Result result = mesService.shipmentMaterial(mesShipmentMaterial, warehouseCode);
96 return result; 96 return result;
97 } 97 }
98 -  
99 -  
100 } 98 }
huaheng-wms-core/src/main/java/org/jeecg/modules/wms/framework/controller/HuahengBaseController.java
@@ -29,8 +29,8 @@ public class HuahengBaseController { @@ -29,8 +29,8 @@ public class HuahengBaseController {
29 Result<?> result = null; 29 Result<?> result = null;
30 Boolean isLocked = null; 30 Boolean isLocked = null;
31 synchronized (taskKey.intern()) { 31 synchronized (taskKey.intern()) {
32 - isLocked = MapUtils.getBoolean(runningTaskMap, taskKey);  
33 - if (isLocked == null) { 32 + isLocked = MapUtils.getBoolean(runningTaskMap, taskKey, false);
  33 + if (isLocked == false) {
34 multiProcessMap.put(taskKey, true); 34 multiProcessMap.put(taskKey, true);
35 } 35 }
36 } 36 }
@@ -57,8 +57,8 @@ public class HuahengBaseController { @@ -57,8 +57,8 @@ public class HuahengBaseController {
57 long startTime = System.currentTimeMillis(); 57 long startTime = System.currentTimeMillis();
58 while (true) { 58 while (true) {
59 synchronized (taskKey.intern()) { 59 synchronized (taskKey.intern()) {
60 - isLocked = MapUtils.getBoolean(multiProcessMap, taskKey);  
61 - if (isLocked == null) { 60 + isLocked = MapUtils.getBoolean(multiProcessMap, taskKey, false);
  61 + if (isLocked == false) {
62 multiProcessMap.put(taskKey, true); 62 multiProcessMap.put(taskKey, true);
63 } 63 }
64 } 64 }
@@ -41,54 +41,4 @@ @@ -41,54 +41,4 @@
41 </repository> 41 </repository>
42 </repositories> 42 </repositories>
43 43
44 - <build>  
45 - <plugins>  
46 - <!--<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> 指定JDK编译版本 -->  
47 - <plugin>  
48 - <groupId>org.apache.maven.plugins</groupId>  
49 - <artifactId>maven-compiler-plugin</artifactId>  
50 - <configuration>  
51 - <source>1.8</source>  
52 - <target>1.8</target>  
53 - <encoding>UTF-8</encoding>  
54 - </configuration>  
55 - </plugin>  
56 - <!-- 打包跳过测试 -->  
57 - <plugin>  
58 - <groupId>org.apache.maven.plugins</groupId>  
59 - <artifactId>maven-surefire-plugin</artifactId>  
60 - <configuration>  
61 - <skipTests>true</skipTests>  
62 - </configuration>  
63 - </plugin>  
64 - <!-- 避免font文件的二进制文件格式压缩破坏 -->  
65 - <plugin>  
66 - <groupId>org.apache.maven.plugins</groupId>  
67 - <artifactId>maven-resources-plugin</artifactId>  
68 - <configuration>  
69 - <nonFilteredFileExtensions>  
70 - <nonFilteredFileExtension>woff</nonFilteredFileExtension>  
71 - <nonFilteredFileExtension>woff2</nonFilteredFileExtension>  
72 - <nonFilteredFileExtension>eot</nonFilteredFileExtension>  
73 - <nonFilteredFileExtension>ttf</nonFilteredFileExtension>  
74 - <nonFilteredFileExtension>svg</nonFilteredFileExtension>  
75 - </nonFilteredFileExtensions>  
76 - </configuration>  
77 - </plugin>  
78 - </plugins>  
79 - <resources>  
80 - <resource>  
81 - <directory>src/main/resources</directory>  
82 - <filtering>true</filtering>  
83 - </resource>  
84 - <resource>  
85 - <directory>src/main/java</directory>  
86 - <includes>  
87 - <include>**/*.xml</include>  
88 - <include>**/*.json</include>  
89 - <include>**/*.ftl</include>  
90 - </includes>  
91 - </resource>  
92 - </resources>  
93 - </build>  
94 </project> 44 </project>