Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3be0048e
由
zshaohui
编写于
2023-11-22 14:46:07 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
工单出库逻辑修改
1 个父辈
8fde5746
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
19 个修改的文件
包含
210 行增加
和
69 行删除
src/main/java/com/neotel/smfcore/SmfCoreApplication.java
src/main/java/com/neotel/smfcore/common/init/MainTimer.java
src/main/java/com/neotel/smfcore/common/utils/Constants.java
src/main/java/com/neotel/smfcore/common/utils/HttpHelper.java
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
src/main/java/com/neotel/smfcore/core/order/service/po/LiteOrderItem.java
src/main/java/com/neotel/smfcore/core/system/rest/SettingsController.java
src/main/java/com/neotel/smfcore/core/system/rest/bean/LineConfig.java
src/main/java/com/neotel/smfcore/core/system/rest/bean/dto/SysSettingsDto.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenController.java
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/InnerBoxRestController.java
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/PrinterRestController.java
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/util/PreWarningItemCache.java
src/main/java/com/neotel/smfcore/custom/lizhen/kafka/service/KafkaService.java
src/main/java/com/neotel/smfcore/custom/lizhen/report/inner/InnerReportController.java
src/main/java/com/neotel/smfcore/custom/lizhen/third/maicheng/util/StationStatusCache.java
src/main/resources/config/application.yml
src/main/java/com/neotel/smfcore/SmfCoreApplication.java
查看文件 @
3be0048
...
@@ -15,7 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
...
@@ -15,7 +15,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
//@EnableAsync
//@EnableAsync
@EnableScheduling
//
@EnableScheduling
@EnableKafka
@EnableKafka
@RestController
@RestController
@SpringBootApplication
@SpringBootApplication
...
...
src/main/java/com/neotel/smfcore/common/init/MainTimer.java
查看文件 @
3be0048
...
@@ -46,7 +46,7 @@ public class MainTimer {
...
@@ -46,7 +46,7 @@ public class MainTimer {
public
void
run
()
{
public
void
run
()
{
timerTask
();
timerTask
();
}
}
},
5
,
1
0
,
TimeUnit
.
SECONDS
);
},
5
,
3
0
,
TimeUnit
.
SECONDS
);
//log.info("如果是人工叫料,则每2分钟执行一次");
//log.info("如果是人工叫料,则每2分钟执行一次");
scheduledThreadPool
.
scheduleAtFixedRate
(
new
Runnable
()
{
scheduledThreadPool
.
scheduleAtFixedRate
(
new
Runnable
()
{
...
@@ -72,18 +72,11 @@ public class MainTimer {
...
@@ -72,18 +72,11 @@ public class MainTimer {
}
}
private
void
timerTask
()
{
private
void
timerTask
()
{
if
(!
preGenerateTaskTime
())
{
return
;
}
lastPreGenerateTaskTime
=
System
.
currentTimeMillis
();
try
{
try
{
log
.
info
(
"生成缺料预警任务"
);
//log.info("生成缺料预警任务");
//PreWarningItemCache.runTimer(0);
PreWarningItemCache
.
runTimer
();
PreWarningItemCache
.
runTimer
(
1
);
//liteOrderCache.runTimer(0);
//设备状态判断
//设备状态判断
DevicesStatusUtil
.
runTimer
();
DevicesStatusUtil
.
runTimer
();
//其他设备状态判断
//其他设备状态判断
EquipStatusUtil
.
runTimer
();
EquipStatusUtil
.
runTimer
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
src/main/java/com/neotel/smfcore/common/utils/Constants.java
查看文件 @
3be0048
...
@@ -175,4 +175,14 @@ public class Constants {
...
@@ -175,4 +175,14 @@ public class Constants {
* 工单生成个数
* 工单生成个数
*/
*/
public
static
final
String
CACHE_preGenerateTask_Times
=
"preGenerateTask_times"
;
public
static
final
String
CACHE_preGenerateTask_Times
=
"preGenerateTask_times"
;
/**
* 线体配置
*/
public
static
final
String
CACHE_lineConfigList
=
"CACHE_lineConfigList"
;
/**
* 迈征配置分钟
*/
public
static
final
String
CACHE_maiZhengMinute
=
"maiZhengMinute"
;
}
}
src/main/java/com/neotel/smfcore/common/utils/HttpHelper.java
查看文件 @
3be0048
...
@@ -46,24 +46,36 @@ public class HttpHelper {
...
@@ -46,24 +46,36 @@ public class HttpHelper {
ObjectMapper
mapper
=
new
ObjectMapper
();
ObjectMapper
mapper
=
new
ObjectMapper
();
try
{
try
{
String
requestBody
=
mapper
.
writeValueAsString
(
object
);
String
requestBody
=
mapper
.
writeValueAsString
(
object
);
httpPost
.
setEntity
(
new
StringEntity
(
requestBody
,
CONTENT_CHARSET
));
httpPost
.
setEntity
(
new
StringEntity
(
requestBody
,
CONTENT_CHARSET
));
}
catch
(
JsonProcessingException
e
)
{
}
catch
(
JsonProcessingException
e
)
{
throw
new
ApiException
(
"Request params to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
throw
new
ApiException
(
"Request params to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
ApiException
(
"Request params to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
throw
new
ApiException
(
"Request params to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
}
}
}
}
try
{
CloseableHttpClient
httpClient
=
null
;
CloseableHttpClient
httpClient
=
HttpClients
.
createDefault
();
CloseableHttpResponse
response
=
null
;
CloseableHttpResponse
response
=
httpClient
.
execute
(
httpPost
);
try
{
httpClient
=
HttpClients
.
createDefault
();
response
=
httpClient
.
execute
(
httpPost
);
//System.out.println(response.getStatusLine().getStatusCode() + "\n");
//System.out.println(response.getStatusLine().getStatusCode() + "\n");
HttpEntity
entity
=
response
.
getEntity
();
HttpEntity
entity
=
response
.
getEntity
();
String
responseContent
=
EntityUtils
.
toString
(
entity
,
CONTENT_CHARSET
);
String
responseContent
=
EntityUtils
.
toString
(
entity
,
CONTENT_CHARSET
);
response
.
close
();
httpClient
.
close
();
return
responseContent
;
return
responseContent
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
ApiException
(
"Request to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
throw
new
ApiException
(
"Request to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
}
finally
{
try
{
if
(
response
!=
null
)
{
response
.
close
();
}
if
(
httpClient
!=
null
)
{
httpClient
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
...
@@ -76,24 +88,37 @@ public class HttpHelper {
...
@@ -76,24 +88,37 @@ public class HttpHelper {
ObjectMapper
mapper
=
new
ObjectMapper
();
ObjectMapper
mapper
=
new
ObjectMapper
();
try
{
try
{
String
requestBody
=
mapper
.
writeValueAsString
(
params
);
String
requestBody
=
mapper
.
writeValueAsString
(
params
);
httpPost
.
setEntity
(
new
StringEntity
(
requestBody
,
CONTENT_CHARSET
));
httpPost
.
setEntity
(
new
StringEntity
(
requestBody
,
CONTENT_CHARSET
));
}
catch
(
JsonProcessingException
e
)
{
}
catch
(
JsonProcessingException
e
)
{
throw
new
ApiException
(
"Request params to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
throw
new
ApiException
(
"Request params to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
ApiException
(
"Request params to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
throw
new
ApiException
(
"Request params to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
}
}
}
}
try
{
CloseableHttpClient
httpClient
=
null
;
CloseableHttpClient
httpClient
=
HttpClients
.
createDefault
();
CloseableHttpResponse
response
=
null
;
CloseableHttpResponse
response
=
httpClient
.
execute
(
httpPost
);
try
{
httpClient
=
HttpClients
.
createDefault
();
response
=
httpClient
.
execute
(
httpPost
);
//System.out.println(response.getStatusLine().getStatusCode() + "\n");
//System.out.println(response.getStatusLine().getStatusCode() + "\n");
HttpEntity
entity
=
response
.
getEntity
();
HttpEntity
entity
=
response
.
getEntity
();
String
responseContent
=
EntityUtils
.
toString
(
entity
,
CONTENT_CHARSET
);
String
responseContent
=
EntityUtils
.
toString
(
entity
,
CONTENT_CHARSET
);
response
.
close
();
response
.
close
();
httpClient
.
close
();
httpClient
.
close
();
return
responseContent
;
return
responseContent
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
ApiException
(
"Request to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
throw
new
ApiException
(
"Request to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
}
finally
{
try
{
if
(
response
!=
null
)
{
response
.
close
();
}
if
(
httpClient
!=
null
)
{
httpClient
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
...
@@ -122,15 +147,16 @@ public class HttpHelper {
...
@@ -122,15 +147,16 @@ public class HttpHelper {
params
.
add
(
new
BasicNameValuePair
(
entry
.
getKey
(),
value
));
params
.
add
(
new
BasicNameValuePair
(
entry
.
getKey
(),
value
));
}
}
}
}
CloseableHttpClient
httpClient
=
null
;
CloseableHttpResponse
response
=
null
;
try
{
try
{
URI
uri
=
new
URIBuilder
(
url
).
setParameters
(
params
).
build
();
URI
uri
=
new
URIBuilder
(
url
).
setParameters
(
params
).
build
();
log
.
info
(
"执行MES请求:"
+
uri
.
toString
());
log
.
info
(
"执行MES请求:"
+
uri
.
toString
());
HttpPost
httpPost
=
new
HttpPost
(
uri
);
HttpPost
httpPost
=
new
HttpPost
(
uri
);
httpPost
.
addHeader
(
"Content-Type"
,
"application/json;charset=utf-8"
);
httpPost
.
addHeader
(
"Content-Type"
,
"application/json;charset=utf-8"
);
// httpPost.setEntity(new UrlEncodedFormEntity(params, CONTENT_CHARSET));
// httpPost.setEntity(new UrlEncodedFormEntity(params, CONTENT_CHARSET));
CloseableHttpClient
httpClient
=
HttpClients
.
createDefault
();
httpClient
=
HttpClients
.
createDefault
();
CloseableHttpResponse
response
=
httpClient
.
execute
(
httpPost
);
response
=
httpClient
.
execute
(
httpPost
);
HttpEntity
entity
=
response
.
getEntity
();
HttpEntity
entity
=
response
.
getEntity
();
String
responseContent
=
EntityUtils
.
toString
(
entity
,
CONTENT_CHARSET
);
String
responseContent
=
EntityUtils
.
toString
(
entity
,
CONTENT_CHARSET
);
response
.
close
();
response
.
close
();
...
@@ -138,6 +164,17 @@ public class HttpHelper {
...
@@ -138,6 +164,17 @@ public class HttpHelper {
return
responseContent
;
return
responseContent
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
ApiException
(
"Request params to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
throw
new
ApiException
(
"Request params to ["
+
url
+
"] failed:"
+
e
.
getMessage
());
}
finally
{
try
{
if
(
response
!=
null
)
{
response
.
close
();
}
if
(
httpClient
!=
null
)
{
httpClient
.
close
();
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
...
@@ -156,9 +193,10 @@ public class HttpHelper {
...
@@ -156,9 +193,10 @@ public class HttpHelper {
.
setConnectTimeout
(
5000
)
.
setConnectTimeout
(
5000
)
.
setConnectionRequestTimeout
(
5000
).
build
();
.
setConnectionRequestTimeout
(
5000
).
build
();
httpget
.
setConfig
(
build
);
httpget
.
setConfig
(
build
);
CloseableHttpClient
httpClient
=
null
;
CloseableHttpResponse
response
=
null
;
CloseableHttpResponse
response
=
null
;
try
{
try
{
CloseableHttpClient
httpClient
=
HttpClients
.
createDefault
();
httpClient
=
HttpClients
.
createDefault
();
response
=
httpClient
.
execute
(
httpget
);
response
=
httpClient
.
execute
(
httpget
);
}
catch
(
IOException
e1
)
{
}
catch
(
IOException
e1
)
{
e1
.
printStackTrace
();
e1
.
printStackTrace
();
...
@@ -173,7 +211,12 @@ public class HttpHelper {
...
@@ -173,7 +211,12 @@ public class HttpHelper {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
finally
{
}
finally
{
try
{
try
{
response
.
close
();
if
(
httpClient
!=
null
){
httpClient
.
close
();
}
if
(
response
!=
null
)
{
response
.
close
();
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
3be0048
...
@@ -23,6 +23,7 @@ import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
...
@@ -23,6 +23,7 @@ import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.bean.OrderSetting
;
import
com.neotel.smfcore.core.system.bean.OrderSetting
;
import
com.neotel.smfcore.core.system.rest.bean.LineConfig
;
import
com.neotel.smfcore.core.system.service.dao.ICacheItemDao
;
import
com.neotel.smfcore.core.system.service.dao.ICacheItemDao
;
import
com.neotel.smfcore.core.system.service.dao.ISettingsDao
;
import
com.neotel.smfcore.core.system.service.dao.ISettingsDao
;
import
com.neotel.smfcore.core.system.service.po.CacheItem
;
import
com.neotel.smfcore.core.system.service.po.CacheItem
;
...
@@ -709,4 +710,16 @@ public class DataCache {
...
@@ -709,4 +710,16 @@ public class DataCache {
}
}
return
0
;
return
0
;
}
}
public
int
getLineConfigMinute
(
String
line
)
{
List
<
LineConfig
>
lineConfigList
=
getCache
(
Constants
.
CACHE_lineConfigList
);
if
(
lineConfigList
!=
null
&&
!
lineConfigList
.
isEmpty
()){
for
(
LineConfig
lineConfig
:
lineConfigList
)
{
if
(
lineConfig
.
getLine
().
equals
(
line
)){
return
lineConfig
.
getMinute
();
}
}
}
return
0
;
}
}
}
src/main/java/com/neotel/smfcore/core/order/service/po/LiteOrderItem.java
查看文件 @
3be0048
...
@@ -219,6 +219,9 @@ public class LiteOrderItem extends BasePo implements Serializable ,Comparable<Li
...
@@ -219,6 +219,9 @@ public class LiteOrderItem extends BasePo implements Serializable ,Comparable<Li
*/
*/
private
Date
issuanceDate
;
private
Date
issuanceDate
;
private
Date
receiveDate
;
/**
/**
* 出库是否满足要求,已出库数量大于需求数量
* 出库是否满足要求,已出库数量大于需求数量
*/
*/
...
...
src/main/java/com/neotel/smfcore/core/system/rest/SettingsController.java
查看文件 @
3be0048
...
@@ -13,6 +13,7 @@ import com.neotel.smfcore.core.language.service.po.LanguageMsg;
...
@@ -13,6 +13,7 @@ import com.neotel.smfcore.core.language.service.po.LanguageMsg;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.system.bean.OrderSetting
;
import
com.neotel.smfcore.core.system.bean.OrderSetting
;
import
com.neotel.smfcore.core.system.rest.bean.LineConfig
;
import
com.neotel.smfcore.core.system.rest.bean.dto.SettingsDto
;
import
com.neotel.smfcore.core.system.rest.bean.dto.SettingsDto
;
import
com.neotel.smfcore.core.system.rest.bean.dto.SysSettingsDto
;
import
com.neotel.smfcore.core.system.rest.bean.dto.SysSettingsDto
;
import
com.neotel.smfcore.core.system.rest.bean.mapstruct.SettingsMapper
;
import
com.neotel.smfcore.core.system.rest.bean.mapstruct.SettingsMapper
;
...
@@ -76,6 +77,9 @@ public class SettingsController {
...
@@ -76,6 +77,9 @@ public class SettingsController {
String
permissionPassword
=
dataCache
.
getCache
(
Constants
.
CACHE_permissionPassword
);
String
permissionPassword
=
dataCache
.
getCache
(
Constants
.
CACHE_permissionPassword
);
String
floor
=
dataCache
.
getCache
(
Constants
.
CACHE_floor
);
String
floor
=
dataCache
.
getCache
(
Constants
.
CACHE_floor
);
Integer
preGenerateTaskTimes
=
dataCache
.
getCache
(
Constants
.
CACHE_preGenerateTask_Times
);
Integer
preGenerateTaskTimes
=
dataCache
.
getCache
(
Constants
.
CACHE_preGenerateTask_Times
);
List
<
LineConfig
>
lineConfigList
=
dataCache
.
getCache
(
Constants
.
CACHE_lineConfigList
);
Integer
maiZhengMinute
=
dataCache
.
getCache
(
Constants
.
CACHE_maiZhengMinute
);
SysSettingsDto
dto
=
new
SysSettingsDto
();
SysSettingsDto
dto
=
new
SysSettingsDto
();
dto
.
setStartJob
(
startJob
);
dto
.
setStartJob
(
startJob
);
dto
.
setStopOut
(
stopOut
);
dto
.
setStopOut
(
stopOut
);
...
@@ -84,6 +88,8 @@ public class SettingsController {
...
@@ -84,6 +88,8 @@ public class SettingsController {
dto
.
setPermissionPassword
(
permissionPassword
);
dto
.
setPermissionPassword
(
permissionPassword
);
dto
.
setFloor
(
floor
);
dto
.
setFloor
(
floor
);
dto
.
setPreGenerateTaskTimes
(
preGenerateTaskTimes
);
dto
.
setPreGenerateTaskTimes
(
preGenerateTaskTimes
);
dto
.
setLineConfigList
(
lineConfigList
);
dto
.
setMaiZhengMinute
(
maiZhengMinute
);
return
dto
;
return
dto
;
}
}
...
@@ -98,12 +104,24 @@ public class SettingsController {
...
@@ -98,12 +104,24 @@ public class SettingsController {
dataCache
.
updateCache
(
Constants
.
CACHE_permissionPassword
,
sysSettingsDto
.
getPermissionPassword
());
dataCache
.
updateCache
(
Constants
.
CACHE_permissionPassword
,
sysSettingsDto
.
getPermissionPassword
());
dataCache
.
updateCache
(
Constants
.
CACHE_floor
,
sysSettingsDto
.
getFloor
());
dataCache
.
updateCache
(
Constants
.
CACHE_floor
,
sysSettingsDto
.
getFloor
());
dataCache
.
updateCache
(
Constants
.
CACHE_preGenerateTask_Times
,
sysSettingsDto
.
getPreGenerateTaskTimes
());
dataCache
.
updateCache
(
Constants
.
CACHE_preGenerateTask_Times
,
sysSettingsDto
.
getPreGenerateTaskTimes
());
List
<
LineConfig
>
lineConfigList
=
sysSettingsDto
.
getLineConfigList
();
if
(
lineConfigList
==
null
){
lineConfigList
=
new
ArrayList
<>();
}
dataCache
.
updateCache
(
Constants
.
CACHE_lineConfigList
,
lineConfigList
);
if
(
sysSettingsDto
.
getMaiZhengMinute
()
!=
null
)
{
dataCache
.
updateCache
(
Constants
.
CACHE_maiZhengMinute
,
sysSettingsDto
.
getMaiZhengMinute
());
}
log
.
info
(
"更改系统设置:stopout="
+
sysSettingsDto
.
isStopOut
()
+
",stopjob="
+
sysSettingsDto
.
isStartJob
()
log
.
info
(
"更改系统设置:stopout="
+
sysSettingsDto
.
isStopOut
()
+
",stopjob="
+
sysSettingsDto
.
isStartJob
()
+
",backUpMonth="
+
sysSettingsDto
.
getBackUpMonth
()
+
",backUpMonth="
+
sysSettingsDto
.
getBackUpMonth
()
+
",preGenerateTask="
+
sysSettingsDto
.
getPreGenerateTask
()
+
",preGenerateTask="
+
sysSettingsDto
.
getPreGenerateTask
()
+
",permissionPassword="
+
sysSettingsDto
.
getPermissionPassword
()
+
",permissionPassword="
+
sysSettingsDto
.
getPermissionPassword
()
+
",floor="
+
sysSettingsDto
.
getFloor
()
+
",floor="
+
sysSettingsDto
.
getFloor
()
+
",preGenerateTaskTimes="
+
sysSettingsDto
.
getPreGenerateTaskTimes
()
+
",preGenerateTaskTimes="
+
sysSettingsDto
.
getPreGenerateTaskTimes
()
+
",lineConfigList="
+
sysSettingsDto
.
getLineConfigList
()
+
",maiZhengMinute="
+
sysSettingsDto
.
getMaiZhengMinute
()
);
);
return
ResultBean
.
newOkResult
(
"保存成功"
);
return
ResultBean
.
newOkResult
(
"保存成功"
);
}
}
...
...
src/main/java/com/neotel/smfcore/core/system/rest/bean/LineConfig.java
0 → 100644
查看文件 @
3be0048
package
com
.
neotel
.
smfcore
.
core
.
system
.
rest
.
bean
;
import
lombok.Data
;
@Data
public
class
LineConfig
{
private
String
line
;
private
int
minute
;
}
src/main/java/com/neotel/smfcore/core/system/rest/bean/dto/SysSettingsDto.java
查看文件 @
3be0048
package
com
.
neotel
.
smfcore
.
core
.
system
.
rest
.
bean
.
dto
;
package
com
.
neotel
.
smfcore
.
core
.
system
.
rest
.
bean
.
dto
;
import
com.neotel.smfcore.core.system.rest.bean.LineConfig
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.Setter
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
@Getter
@Getter
@Setter
@Setter
public
class
SysSettingsDto
implements
Serializable
{
public
class
SysSettingsDto
implements
Serializable
{
...
@@ -30,4 +34,12 @@ public class SysSettingsDto implements Serializable {
...
@@ -30,4 +34,12 @@ public class SysSettingsDto implements Serializable {
@ApiModelProperty
(
"楼层信息"
)
@ApiModelProperty
(
"楼层信息"
)
private
String
floor
=
""
;
private
String
floor
=
""
;
@ApiModelProperty
(
"线体配置"
)
private
List
<
LineConfig
>
lineConfigList
;
@ApiModelProperty
(
"迈征配置时间"
)
private
Integer
maiZhengMinute
;
}
}
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
3be0048
...
@@ -540,7 +540,10 @@ public class TaskService {
...
@@ -540,7 +540,10 @@ public class TaskService {
if
(
outTask
!=
null
)
{
if
(
outTask
!=
null
)
{
log
.
info
(
outTask
.
getSourceName
()+
"barcode为:"
+
outTask
.
getBarcode
()+
"面别为:"
+
outTask
.
getSide
());
log
.
info
(
outTask
.
getSourceName
()+
"barcode为:"
+
outTask
.
getBarcode
()+
"面别为:"
+
outTask
.
getSide
());
exportMap
.
put
(
cid
,
outTask
.
getSide
());
if
(
StringUtils
.
isNotBlank
(
outTask
.
getSide
()))
{
exportMap
.
put
(
cid
,
outTask
.
getSide
());
}
}
}
return
outTask
;
return
outTask
;
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
查看文件 @
3be0048
...
@@ -517,7 +517,7 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -517,7 +517,7 @@ public class LizhenApi extends DefaultSmfApiListener {
}
}
}
}
if
(
items
!=
null
&&
!
items
.
isEmpty
())
{
if
(
items
!=
null
&&
!
items
.
isEmpty
())
{
return
PreWarningItemCache
.
createAndExecuteLiteOrder
(
items
,
2
,
false
);
return
PreWarningItemCache
.
createAndExecuteLiteOrder
(
items
,
false
);
}
}
}
}
return
null
;
return
null
;
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenController.java
查看文件 @
3be0048
...
@@ -232,7 +232,12 @@ public class LizhenController {
...
@@ -232,7 +232,12 @@ public class LizhenController {
item
.
setPartnumber
(
data
.
get
(
"PARTNUMBER"
));
item
.
setPartnumber
(
data
.
get
(
"PARTNUMBER"
));
item
.
setLine
(
data
.
get
(
"LINE"
));
item
.
setLine
(
data
.
get
(
"LINE"
));
item
.
setItemId
(
data
.
get
(
"ID"
));
item
.
setItemId
(
data
.
get
(
"ID"
));
item
.
setPriority
(
Integer
.
valueOf
(
data
.
get
(
"PRIORITY"
)));
try
{
item
.
setPriority
(
Integer
.
valueOf
(
data
.
get
(
"PRIORITY"
)));
}
catch
(
NumberFormatException
e
)
{
e
.
printStackTrace
();
item
.
setPriority
(
0
);
}
item
.
setReel
(
data
.
get
(
"REEL"
));
item
.
setReel
(
data
.
get
(
"REEL"
));
item
.
setBrand
(
data
.
get
(
"VENDOR"
));
item
.
setBrand
(
data
.
get
(
"VENDOR"
));
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/InnerBoxRestController.java
查看文件 @
3be0048
...
@@ -94,7 +94,7 @@ public class InnerBoxRestController {
...
@@ -94,7 +94,7 @@ public class InnerBoxRestController {
String
hSerial
=
request
.
getParameter
(
"hSerial"
);
//工单序号
String
hSerial
=
request
.
getParameter
(
"hSerial"
);
//工单序号
String
outlet
=
request
.
getParameter
(
"outlet"
);
//出口位置
String
outlet
=
request
.
getParameter
(
"outlet"
);
//出口位置
String
boxSide
=
request
.
getParameter
(
"boxSide"
);
//料箱隔口
String
boxSide
=
request
.
getParameter
(
"boxSide"
);
//料箱隔口
log
.
info
(
"IA 出库更新任务状态--barcode:{},status:{},loc:{},hSerial:{},outlet:{},boxSide:{}
"
,
code
,
status
,
loc
,
hSerial
,
outlet
,
boxSide
);
log
.
info
(
"IA 出库更新任务状态--barcode:{},status:{},loc:{},hSerial:{},outlet:{},boxSide:{}
,cid:{},outlet:{}"
,
code
,
status
,
loc
,
hSerial
,
outlet
,
boxSide
,
cid
,
outlet
);
CodeBean
codeBean
=
codeResolve
.
resolveSingleCode
(
code
);
CodeBean
codeBean
=
codeResolve
.
resolveSingleCode
(
code
);
Barcode
barcode
=
codeBean
.
getBarcode
();
Barcode
barcode
=
codeBean
.
getBarcode
();
...
@@ -121,7 +121,7 @@ public class InnerBoxRestController {
...
@@ -121,7 +121,7 @@ public class InnerBoxRestController {
return
ResultBean
.
newErrorResult
(
304
,
"smfcore.task.hasEnd"
,
"任务已完成"
);
return
ResultBean
.
newErrorResult
(
304
,
"smfcore.task.hasEnd"
,
"任务已完成"
);
}
}
status
=
status
.
toUpperCase
();
status
=
status
.
toUpperCase
();
log
.
info
(
"更新任务状态:{}-->{}"
,
opTask
.
getStatus
(),
status
);
//
log.info("更新任务状态:{}-->{}", opTask.getStatus(), status);
//调用此接口的肯定是料盘已出仓位的
//调用此接口的肯定是料盘已出仓位的
if
(
opTask
.
isExecuting
()){
if
(
opTask
.
isExecuting
()){
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/PrinterRestController.java
查看文件 @
3be0048
...
@@ -61,6 +61,8 @@ public class PrinterRestController {
...
@@ -61,6 +61,8 @@ public class PrinterRestController {
String
code
=
paramMap
.
get
(
"code"
);
String
code
=
paramMap
.
get
(
"code"
);
log
.
info
(
"补打印标签:"
+
code
);
CodeBean
codeBean
=
codeResolve
.
resolveSingleCode
(
code
);
CodeBean
codeBean
=
codeResolve
.
resolveSingleCode
(
code
);
Barcode
barcode
=
codeBean
.
getBarcode
();
Barcode
barcode
=
codeBean
.
getBarcode
();
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/util/PreWarningItemCache.java
查看文件 @
3be0048
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/custom/lizhen/kafka/service/KafkaService.java
查看文件 @
3be0048
...
@@ -19,7 +19,11 @@ import org.springframework.scheduling.annotation.Scheduled;
...
@@ -19,7 +19,11 @@ import org.springframework.scheduling.annotation.Scheduled;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.concurrent.ListenableFuture
;
import
org.springframework.util.concurrent.ListenableFuture
;
import
javax.annotation.PostConstruct
;
import
java.util.*
;
import
java.util.*
;
import
java.util.concurrent.Executors
;
import
java.util.concurrent.ScheduledExecutorService
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
//@Async
//@Async
...
@@ -37,10 +41,21 @@ public class KafkaService {
...
@@ -37,10 +41,21 @@ public class KafkaService {
Map
<
String
,
String
>
statusMap
=
Maps
.
newConcurrentMap
();
Map
<
String
,
String
>
statusMap
=
Maps
.
newConcurrentMap
();
ScheduledExecutorService
scheduledThreadPool
=
Executors
.
newScheduledThreadPool
(
1
);
@PostConstruct
void
init
(){
scheduledThreadPool
.
scheduleAtFixedRate
(
()
->
{
setMachineStatus
();
setHeartbeat
();
},
5
,
60
,
TimeUnit
.
SECONDS
);
}
/**
/**
* 设备状态发送
* 设备状态发送
*/
*/
@Scheduled
(
fixedRate
=
1000
*
60
*
1
)
//@Scheduled(fixedRate = 1000 * 60 * 2
)
public
void
setMachineStatus
()
{
public
void
setMachineStatus
()
{
log
.
info
(
"发送设备状态开始"
);
log
.
info
(
"发送设备状态开始"
);
Collection
<
Storage
>
storages
=
dataCache
.
getAllStorage
().
values
();
Collection
<
Storage
>
storages
=
dataCache
.
getAllStorage
().
values
();
...
@@ -111,7 +126,7 @@ public class KafkaService {
...
@@ -111,7 +126,7 @@ public class KafkaService {
/**
/**
* 心跳数据发送
* 心跳数据发送
*/
*/
@Scheduled
(
fixedRate
=
1000
*
60
*
5
)
//
@Scheduled(fixedRate = 1000 * 60 * 5)
public
void
setHeartbeat
()
{
public
void
setHeartbeat
()
{
log
.
info
(
"发送心跳开始"
);
log
.
info
(
"发送心跳开始"
);
//根据machineId,找到设备状态,是否正常
//根据machineId,找到设备状态,是否正常
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/report/inner/InnerReportController.java
查看文件 @
3be0048
...
@@ -328,6 +328,7 @@ public class InnerReportController {
...
@@ -328,6 +328,7 @@ public class InnerReportController {
resultMap
.
put
(
"料号"
,
dto
.
getPn
()
==
null
?
""
:
dto
.
getPn
());
resultMap
.
put
(
"料号"
,
dto
.
getPn
()
==
null
?
""
:
dto
.
getPn
());
resultMap
.
put
(
"需求卷"
,
dto
.
getNeedReelCount
());
resultMap
.
put
(
"需求卷"
,
dto
.
getNeedReelCount
());
resultMap
.
put
(
"实发卷"
,
dto
.
getOutReelCount
());
resultMap
.
put
(
"实发卷"
,
dto
.
getOutReelCount
());
resultMap
.
put
(
"创建时间"
,
dto
.
getCreateDate
());
results
.
add
(
resultMap
);
results
.
add
(
resultMap
);
}
}
try
{
try
{
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/third/maicheng/util/StationStatusCache.java
查看文件 @
3be0048
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
.
third
.
maicheng
.
util
;
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
.
third
.
maicheng
.
util
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Lists
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.custom.lizhen.third.maicheng.api.MaiZhengApi
;
import
com.neotel.smfcore.custom.lizhen.third.maicheng.api.MaiZhengApi
;
import
com.neotel.smfcore.custom.lizhen.third.maicheng.bean.StationStatus
;
import
com.neotel.smfcore.custom.lizhen.third.maicheng.bean.StationStatus
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.CopyOnWriteArrayList
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
...
@@ -24,10 +23,13 @@ public class StationStatusCache {
...
@@ -24,10 +23,13 @@ public class StationStatusCache {
@Autowired
@Autowired
private
DataCache
dataCache
;
private
DataCache
dataCache
;
public
static
final
String
MAI
CHENG_STATIONSTATUS_CACHE
=
"MaiChengStationStatusCache
"
;
public
static
final
String
MAI
ZHENG_STATIONSTATUS_CACHE_Map
=
"MaiZhengStationStatusCacheMap
"
;
p
rivate
static
List
<
StationStatus
>
stationStatusList
=
Lists
.
newCopyOnWriteArrayList
()
;
p
ublic
static
final
String
MAIZHENG_STATIONSTATUS_CACHE_Line_List
=
"MaiZhengStationStatusCacheLineList"
;
public
static
List
<
String
>
stationStatusLineList
=
new
CopyOnWriteArrayList
<>();
private
static
Map
<
String
,
String
>
stationStatusMap
=
Maps
.
newConcurrentMap
();
@PostConstruct
@PostConstruct
public
void
init
()
{
public
void
init
()
{
...
@@ -36,9 +38,13 @@ public class StationStatusCache {
...
@@ -36,9 +38,13 @@ public class StationStatusCache {
if
(
statusList
!=
null
&&
!
statusList
.
isEmpty
())
{
if
(
statusList
!=
null
&&
!
statusList
.
isEmpty
())
{
updateStatusList
(
statusList
);
updateStatusList
(
statusList
);
}
else
{
}
else
{
List
<
StationStatus
>
statusCacheList
=
dataCache
.
getCache
(
MAICHENG_STATIONSTATUS_CACHE
);
Map
<
String
,
String
>
cacheMap
=
dataCache
.
getCache
(
MAIZHENG_STATIONSTATUS_CACHE_Map
);
if
(
statusCacheList
!=
null
&&
!
statusCacheList
.
isEmpty
())
{
if
(
cacheMap
!=
null
)
{
updateStatusList
(
statusCacheList
);
stationStatusMap
.
putAll
(
cacheMap
);
}
List
<
String
>
cacheLineList
=
dataCache
.
getCache
(
MAIZHENG_STATIONSTATUS_CACHE_Line_List
);
if
(
cacheLineList
!=
null
)
{
stationStatusLineList
.
addAll
(
cacheLineList
);
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -47,30 +53,39 @@ public class StationStatusCache {
...
@@ -47,30 +53,39 @@ public class StationStatusCache {
}
}
public
void
updateStatusList
(
List
<
StationStatus
>
statusList
)
{
public
void
updateStatusList
(
List
<
StationStatus
>
statusList
)
{
stationStatusList
.
clear
();
stationStatusMap
.
clear
();
stationStatusList
.
addAll
(
statusList
);
stationStatusLineList
.
clear
();
dataCache
.
updateCache
(
MAICHENG_STATIONSTATUS_CACHE
,
stationStatusList
);
for
(
StationStatus
stationStatus
:
statusList
)
{
}
String
station
=
stationStatus
.
getSTATION
();
String
partnumber
=
stationStatus
.
getPARTNUMBER
();
String
slot
=
stationStatus
.
getSLOT
();
String
line
=
stationStatus
.
getLINE
();
String
side
=
stationStatus
.
getSIDE
();
String
key
=
station
+
"_"
+
partnumber
+
"_"
+
slot
+
"_"
+
line
+
"_"
+
side
;
stationStatusMap
.
put
(
key
,
key
);
public
List
<
StationStatus
>
getAllStationStatus
()
{
List
<
StationStatus
>
statusList
=
new
ArrayList
<>();
String
trackNumber
=
""
;
if
(
stationStatusList
==
null
||
stationStatusList
.
isEmpty
())
{
if
(
StringUtils
.
isNotBlank
(
station
))
{
stationStatusList
=
dataCache
.
getCache
(
MAICHENG_STATIONSTATUS_CACHE
);
trackNumber
=
station
.
substring
(
station
.
length
()
-
1
);
}
if
(
stationStatusList
!=
null
&&
!
stationStatusList
.
isEmpty
())
{
for
(
StationStatus
status
:
stationStatusList
)
{
String
station
=
status
.
getSTATION
();
if
(
StringUtils
.
isNotBlank
(
station
))
{
String
trackNumber
=
station
.
substring
(
station
.
length
()
-
1
);
status
.
setTrackNumber
(
trackNumber
);
}
statusList
.
add
(
status
);
}
}
String
cacheLine
=
line
+
"_"
+
side
+
"_"
+
trackNumber
;
stationStatusLineList
.
add
(
cacheLine
);
}
}
dataCache
.
updateCache
(
MAIZHENG_STATIONSTATUS_CACHE_Map
,
stationStatusMap
);
if
(
statusList
!=
null
&&
!
statusList
.
isEmpty
()){
if
(
stationStatusLineList
!=
null
&&
!
stationStatusLineList
.
isEmpty
()){
statusList
=
statusList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
stationStatusLineList
=
stationStatusLineList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
dataCache
.
updateCache
(
MAIZHENG_STATIONSTATUS_CACHE_Line_List
,
stationStatusLineList
);
}
}
return
statusList
;
}
public
static
Map
<
String
,
String
>
getStationStatusMap
()
{
return
stationStatusMap
;
}
public
static
List
<
String
>
getStationStatusLineList
()
{
return
stationStatusLineList
;
}
}
}
}
src/main/resources/config/application.yml
查看文件 @
3be0048
...
@@ -13,7 +13,7 @@ api:
...
@@ -13,7 +13,7 @@ api:
fetchGRUrl
:
#http://10.42.25.199:8082/api/wcs/fetchGR #gr标签
fetchGRUrl
:
#http://10.42.25.199:8082/api/wcs/fetchGR #gr标签
brandQtyUrl
:
#http://172.30.170.199:8082/api/wcs/brandQty #gr标签满卷数
brandQtyUrl
:
#http://172.30.170.199:8082/api/wcs/brandQty #gr标签满卷数
importUrl
:
#http://10.42.222.52:8001/smf-core/ext/forward/getDataLogs #内仓导入外仓picking虚拟仓数据
importUrl
:
#http://10.42.222.52:8001/smf-core/ext/forward/getDataLogs #内仓导入外仓picking虚拟仓数据
checkReelMeasure
:
#http://10.190.25.1
49
:8001/Sct/CheckReelMeasure #散料量测接口
checkReelMeasure
:
#http://10.190.25.1
24
:8001/Sct/CheckReelMeasure #散料量测接口
plant
:
2810
plant
:
2810
werks
:
2810
werks
:
2810
outerFactory
:
outerFactory
:
...
@@ -40,7 +40,7 @@ lizhen:
...
@@ -40,7 +40,7 @@ lizhen:
url
:
http://172.30.97.63:8001/smf-core/api/Mes/machineCallMaterial
url
:
http://172.30.97.63:8001/smf-core/api/Mes/machineCallMaterial
F4
:
F4
:
name
:
4F
name
:
4F
line
:
B03-4FSMT-11,B03-4FSMT-01,B03-4FSMT-13,B03-4FSMT-03,B03-4FSMT-14
line
:
B03-4FSMT-11,B03-4FSMT-01,B03-4FSMT-13,B03-4FSMT-03,B03-4FSMT-14
,B03-4FSMT-04
url
:
http://172.25.252.12:8001/smf-core/api/Mes/machineCallMaterial
url
:
http://172.25.252.12:8001/smf-core/api/Mes/machineCallMaterial
...
@@ -102,6 +102,5 @@ app:
...
@@ -102,6 +102,5 @@ app:
type
:
"
"
type
:
"
"
menu
:
menu
:
show
:
meInventory,meExpiredReport,meChangeReport,meprohibitedReport
show
:
#innerMaterial
hide
:
hide
:
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论