Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 5d34280e
由
zshaohui
编写于
2025-01-14 15:27:05 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
其他设备 功能提交
1 个父辈
4d57acc7
隐藏空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
207 行增加
和
10 行删除
src/main/java/com/neotel/smfcore/common/init/MenuInit.java
src/main/java/com/neotel/smfcore/core/equipment/enums/EquipmentType.java
src/main/java/com/neotel/smfcore/core/equipment/rest/EquipCommunicationController.java
src/main/java/com/neotel/smfcore/core/equipment/rest/EquipmentController.java
src/main/java/com/neotel/smfcore/core/equipment/rest/dto/EquipmentDto.java
src/main/java/com/neotel/smfcore/core/equipment/rest/mapstruct/EquipmentMapper.java
src/main/java/com/neotel/smfcore/core/equipment/rest/query/EquipmentQueryCriteria.java
src/main/java/com/neotel/smfcore/core/equipment/service/manager/IEquipmentManager.java
src/main/java/com/neotel/smfcore/core/equipment/service/manager/impl/EquipmentManagerImpl.java
src/main/resources/messages.properties
src/main/resources/messages_en_US.properties
src/main/resources/messages_ja_JP.properties
src/main/resources/messages_zh_CN.properties
src/main/resources/messages_zh_TW.properties
src/main/java/com/neotel/smfcore/common/init/MenuInit.java
查看文件 @
5d34280
...
@@ -233,6 +233,7 @@ public class MenuInit {
...
@@ -233,6 +233,7 @@ public class MenuInit {
addDefaultFunctionMenu
(
105
,
poutSet
,
"资源翻译"
,
"translation"
,
"system/translation/index"
,
"translation"
);
addDefaultFunctionMenu
(
105
,
poutSet
,
"资源翻译"
,
"translation"
,
"system/translation/index"
,
"translation"
);
// Menu orderSet = new Menu(, "orderSetting", "工单设置", "orderSetting", "system/orderSetting/index", "sysSet");
// Menu orderSet = new Menu(, "orderSetting", "工单设置", "orderSetting", "system/orderSetting/index", "sysSet");
addDefaultFunctionMenu
(
106
,
poutSet
,
"料架设置"
,
"shelfSetting"
,
"system/shelfSetting/index"
,
"translation"
,
NL_SHOW_MENU
);
addDefaultFunctionMenu
(
106
,
poutSet
,
"料架设置"
,
"shelfSetting"
,
"system/shelfSetting/index"
,
"translation"
,
NL_SHOW_MENU
);
addDefaultFunctionMenu
(
107
,
poutSet
,
"其他设备"
,
"storageOther"
,
"storage/storageOther/index"
,
"storageOther"
);
Menu
helpAbout
=
Menu
.
CreatePMenu
(
"帮助"
,
9999
,
"help"
,
"help"
,
null
);
Menu
helpAbout
=
Menu
.
CreatePMenu
(
"帮助"
,
9999
,
"help"
,
"help"
,
null
);
addDefaultFunctionMenu
(
99991
,
helpAbout
,
"说明书"
,
"instruction"
,
"system/instruction/index"
,
"aboutBook"
);
addDefaultFunctionMenu
(
99991
,
helpAbout
,
"说明书"
,
"instruction"
,
"system/instruction/index"
,
"aboutBook"
);
...
...
src/main/java/com/neotel/smfcore/core/equipment/enums/EquipmentType.java
查看文件 @
5d34280
package
com
.
neotel
.
smfcore
.
core
.
equipment
.
enums
;
package
com
.
neotel
.
smfcore
.
core
.
equipment
.
enums
;
import
com.google.common.collect.Lists
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
java.util.List
;
/**
/**
* 设备类型(非料仓)
* 设备类型(非料仓)
*/
*/
...
@@ -55,5 +60,10 @@ public enum EquipmentType {
...
@@ -55,5 +60,10 @@ public enum EquipmentType {
/**
/**
* NEXIM
* NEXIM
*/
*/
NEXIM
()
NEXIM
();
public
static
List
<
EquipmentType
>
availableTypeList
(){
return
Lists
.
newArrayList
(
AUTO
,
NEOSCAN
,
NS200
,
COUNTING
,
NEOSTATION
,
FUJINEOLINK
,
PANACIMNEOLINK
,
AGV
,
HANWHA
,
NEXIM
);
}
}
}
src/main/java/com/neotel/smfcore/core/equipment/rest/EquipCommunicationController.java
查看文件 @
5d34280
...
@@ -47,13 +47,15 @@ public class EquipCommunicationController {
...
@@ -47,13 +47,15 @@ public class EquipCommunicationController {
String
name
=
statusBean
.
getName
();
String
name
=
statusBean
.
getName
();
Equipment
equipment
=
equipmentCache
.
getEquipment
(
cid
);
Equipment
equipment
=
equipmentCache
.
getEquipment
(
cid
);
if
(
equipment
==
null
)
{
if
(
equipment
==
null
)
{
equipment
=
equipmentCache
.
autoCreateEquip
(
name
,
cid
,
statusBean
.
getType
());
/*
equipment = equipmentCache.autoCreateEquip(name,cid, statusBean.getType());
if (equipment != null) {
if (equipment != null) {
log.error("设备cid: [" + cid + "]不存在,自动创建设备完成");
log.error("设备cid: [" + cid + "]不存在,自动创建设备完成");
} else {
} else {
log.error("设备cid: [" + cid + "]不存在,自动创建设备失败");
log.error("设备cid: [" + cid + "]不存在,自动创建设备失败");
return null;
return null;
}
}*/
log
.
info
(
"设备cid: ["
+
cid
+
"]不存在"
);
return
null
;
}
else
{
}
else
{
if
(
StringUtils
.
isNotBlank
(
name
))
{
if
(
StringUtils
.
isNotBlank
(
name
))
{
if
(!
name
.
equals
(
equipment
.
getName
()))
{
if
(!
name
.
equals
(
equipment
.
getName
()))
{
...
...
src/main/java/com/neotel/smfcore/core/equipment/rest/EquipmentController.java
查看文件 @
5d34280
package
com
.
neotel
.
smfcore
.
core
.
equipment
.
rest
;
package
com
.
neotel
.
smfcore
.
core
.
equipment
.
rest
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.equipment.enums.EquipmentType
;
import
com.neotel.smfcore.core.equipment.rest.dto.EquipmentDto
;
import
com.neotel.smfcore.core.equipment.rest.mapstruct.EquipmentMapper
;
import
com.neotel.smfcore.core.equipment.rest.query.EquipmentQueryCriteria
;
import
com.neotel.smfcore.core.equipment.service.manager.IEquipmentManager
;
import
com.neotel.smfcore.core.equipment.service.po.Equipment
;
import
com.neotel.smfcore.core.equipment.util.EquipmentCache
;
import
com.neotel.smfcore.core.storage.rest.dto.StorageDto
;
import
com.neotel.smfcore.core.storage.rest.query.StorageQueryCriteria
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Set
;
@Slf4j
@Slf4j
@RestController
@RestController
...
@@ -12,4 +39,117 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -12,4 +39,117 @@ import org.springframework.web.bind.annotation.RestController;
@Api
(
tags
=
"设备管理(非料仓)"
)
@Api
(
tags
=
"设备管理(非料仓)"
)
@RequestMapping
(
"api/equipment"
)
@RequestMapping
(
"api/equipment"
)
public
class
EquipmentController
{
public
class
EquipmentController
{
@Autowired
private
IEquipmentManager
equipmentManager
;
@Autowired
private
EquipmentMapper
equipmentMapper
;
@Autowired
private
EquipmentCache
equipmentCache
;
@ApiOperation
(
"查询非料仓设备"
)
@GetMapping
//@AnonymousAccess
public
PageData
<
EquipmentDto
>
query
(
EquipmentQueryCriteria
criteria
,
Pageable
pageable
){
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
PageData
<
Equipment
>
pages
=
equipmentManager
.
findByPage
(
query
,
pageable
);
List
<
EquipmentDto
>
equipmentDtos
=
equipmentMapper
.
toDto
(
pages
.
getContent
());
return
new
PageData
(
equipmentDtos
,
pages
.
getTotalElements
());
}
@ApiOperation
(
"新增非料仓"
)
@PostMapping
//@AnonymousAccess
public
ResponseEntity
<
Object
>
create
(
@Validated
@RequestBody
EquipmentDto
equipmentDto
)
{
Equipment
equipment
=
equipmentMapper
.
toEntity
(
equipmentDto
);
if
(
StringUtils
.
isEmpty
(
equipment
.
getName
())){
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"name"
}
);
}
if
(
StringUtils
.
isEmpty
(
equipment
.
getCid
())){
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"cid"
}
);
}
if
(
StringUtils
.
isEmpty
(
equipment
.
getType
())){
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"type"
}
);
}
for
(
Equipment
equ
:
equipmentCache
.
getAllEquipment
().
values
())
{
if
(!
equipment
.
getId
().
equals
(
equ
.
getId
())){
if
(
equipment
.
getName
().
equals
(
equ
.
getName
())){
throw
new
ValidateException
(
"smfcore.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"name"
,
equipment
.
getName
()});
}
if
(
equipment
.
getCid
().
equals
(
equ
.
getCid
())){
throw
new
ValidateException
(
"smfcore.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"cid"
,
equipment
.
getCid
()});
}
}
}
equipment
=
equipmentManager
.
save
(
equipment
);
equipmentCache
.
reloadEquipment
(
equipment
,
equipment
.
getCid
());
return
new
ResponseEntity
<>(
HttpStatus
.
CREATED
);
}
@ApiOperation
(
"修改非料仓"
)
@PutMapping
//@AnonymousAccess
public
ResponseEntity
<
Object
>
update
(
@Validated
@RequestBody
EquipmentDto
equipmentDto
)
{
Equipment
equipment
=
equipmentMapper
.
toEntity
(
equipmentDto
);
if
(
StringUtils
.
isEmpty
(
equipment
.
getId
()))
{
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
if
(
StringUtils
.
isEmpty
(
equipment
.
getName
())){
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"name"
}
);
}
if
(
StringUtils
.
isEmpty
(
equipment
.
getCid
())){
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"cid"
}
);
}
if
(
StringUtils
.
isEmpty
(
equipment
.
getType
())){
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"type"
}
);
}
for
(
Equipment
equ
:
equipmentCache
.
getAllEquipment
().
values
())
{
if
(!
equipment
.
getId
().
equals
(
equ
.
getId
())){
if
(
equipment
.
getName
().
equals
(
equ
.
getName
())){
throw
new
ValidateException
(
"smfcore.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"name"
,
equipment
.
getName
()});
}
if
(
equipment
.
getCid
().
equals
(
equ
.
getCid
())){
throw
new
ValidateException
(
"smfcore.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"cid"
,
equipment
.
getCid
()});
}
}
}
equipmentManager
.
save
(
equipment
);
equipmentCache
.
reloadEquipment
(
equipment
,
equipment
.
getCid
());
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
}
@ApiOperation
(
"删除非料仓设备"
)
@DeleteMapping
//@AnonymousAccess
public
ResponseEntity
<
Object
>
delete
(
@RequestBody
Set
<
String
>
ids
)
{
for
(
String
id
:
ids
)
{
if
(
id
==
null
)
{
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
}
for
(
String
id
:
ids
)
{
Equipment
equipment
=
equipmentManager
.
get
(
id
);
if
(
equipment
==
null
){
continue
;
}
equipmentManager
.
deleteById
(
id
);
log
.
info
(
SecurityUtils
.
getLoginUsername
()+
"手动删除设备[{}]"
,
equipment
.
getName
());
}
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
}
@ApiOperation
(
"返回所有非料仓类型"
)
@GetMapping
(
value
=
"/typeList"
)
//@AnonymousAccess
public
List
<
String
>
typeList
()
{
List
<
EquipmentType
>
availableTypeList
=
EquipmentType
.
availableTypeList
();
List
<
String
>
allList
=
new
ArrayList
<>();
for
(
EquipmentType
type
:
availableTypeList
)
{
allList
.
add
(
type
.
name
());
}
return
allList
;
}
}
}
src/main/java/com/neotel/smfcore/core/equipment/rest/dto/EquipmentDto.java
查看文件 @
5d34280
...
@@ -20,4 +20,6 @@ public class EquipmentDto {
...
@@ -20,4 +20,6 @@ public class EquipmentDto {
@ApiModelProperty
(
"是否可用"
)
@ApiModelProperty
(
"是否可用"
)
private
boolean
available
=
true
;
private
boolean
available
=
true
;
private
String
id
;
}
}
src/main/java/com/neotel/smfcore/core/equipment/rest/mapstruct/EquipmentMapper.java
0 → 100644
查看文件 @
5d34280
package
com
.
neotel
.
smfcore
.
core
.
equipment
.
rest
.
mapstruct
;
import
com.neotel.smfcore.common.base.BaseMapper
;
import
com.neotel.smfcore.core.equipment.rest.dto.EquipmentDto
;
import
com.neotel.smfcore.core.equipment.service.po.Equipment
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.ReportingPolicy
;
@Mapper
(
componentModel
=
"spring"
,
unmappedTargetPolicy
=
ReportingPolicy
.
IGNORE
)
public
interface
EquipmentMapper
extends
BaseMapper
<
EquipmentDto
,
Equipment
>
{
}
src/main/java/com/neotel/smfcore/core/equipment/rest/query/EquipmentQueryCriteria.java
0 → 100644
查看文件 @
5d34280
package
com
.
neotel
.
smfcore
.
core
.
equipment
.
rest
.
query
;
import
com.neotel.smfcore.common.annotation.QueryCondition
;
import
com.neotel.smfcore.common.bean.BetweenData
;
import
lombok.Data
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.util.Date
;
@Data
public
class
EquipmentQueryCriteria
{
@QueryCondition
(
blurry
=
"name,cid"
)
private
String
blurry
;
@QueryCondition
(
type
=
QueryCondition
.
Type
.
BETWEEN
,
propName
=
"updateDate"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd"
)
private
BetweenData
<
Date
>
createDate
;
}
src/main/java/com/neotel/smfcore/core/equipment/service/manager/IEquipmentManager.java
查看文件 @
5d34280
package
com
.
neotel
.
smfcore
.
core
.
equipment
.
service
.
manager
;
package
com
.
neotel
.
smfcore
.
core
.
equipment
.
service
.
manager
;
import
com.neotel.smfcore.common.base.IBaseManager
;
import
com.neotel.smfcore.common.base.IBaseManager
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.core.equipment.service.po.Equipment
;
import
com.neotel.smfcore.core.equipment.service.po.Equipment
;
import
java.util.List
;
import
java.util.List
;
public
interface
IEquipmentManager
extends
IBaseManager
<
Equipment
>
{
public
interface
IEquipmentManager
extends
IBaseManager
<
Equipment
>
{
List
<
Equipment
>
findAll
();
List
<
Equipment
>
findAll
();
void
deleteById
(
String
id
);
}
}
src/main/java/com/neotel/smfcore/core/equipment/service/manager/impl/EquipmentManagerImpl.java
查看文件 @
5d34280
...
@@ -50,4 +50,9 @@ public class EquipmentManagerImpl implements IEquipmentManager {
...
@@ -50,4 +50,9 @@ public class EquipmentManagerImpl implements IEquipmentManager {
public
List
<
Equipment
>
findAll
(){
public
List
<
Equipment
>
findAll
(){
return
equipmentDao
.
findAll
();
return
equipmentDao
.
findAll
();
}
}
@Override
public
void
deleteById
(
String
id
)
{
equipmentDao
.
removeOneById
(
id
);
}
}
}
src/main/resources/messages.properties
查看文件 @
5d34280
...
@@ -401,4 +401,5 @@ smfcore.storagePos.available=\u662F\u5426\u53EF\u7528
...
@@ -401,4 +401,5 @@ smfcore.storagePos.available=\u662F\u5426\u53EF\u7528
smfcore.storagePos.yes=
\u
662F
smfcore.storagePos.yes=
\u
662F
smfcore.storagePos.no
=
\u5426
smfcore.storagePos.no
=
\u5426
smfcore.dashBoard
=
\u
4EEA
\u8868\u
76D8
smfcore.dashBoard
=
\u
4EEA
\u8868\u
76D8
smfcore.spHumiture
=
\u
6E29
\u
6E7F
\u
5EA6
\ No newline at end of file
\ No newline at end of file
smfcore.spHumiture
=
\u
6E29
\u
6E7F
\u
5EA6
smfcore.storageOther
=
\u5176\u
4ED6
\u
8BBE
\u5907
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_en_US.properties
查看文件 @
5d34280
...
@@ -392,4 +392,5 @@ smfcore.storagePos.available=Available
...
@@ -392,4 +392,5 @@ smfcore.storagePos.available=Available
smfcore.storagePos.yes
=
Yes
smfcore.storagePos.yes
=
Yes
smfcore.storagePos.no
=
No
smfcore.storagePos.no
=
No
smfcore.dashBoard
=
Dashboard
smfcore.dashBoard
=
Dashboard
smfcore.spHumiture
=
Temperature & Humidity
\ No newline at end of file
\ No newline at end of file
smfcore.spHumiture
=
Temperature & Humidity
smfcore.storageOther
=
Other Devices
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_ja_JP.properties
查看文件 @
5d34280
...
@@ -388,4 +388,5 @@ smfcore.storagePos.available=\u5229\u7528\u53EF\u5426
...
@@ -388,4 +388,5 @@ smfcore.storagePos.available=\u5229\u7528\u53EF\u5426
smfcore.storagePos.yes=
\u
662F
smfcore.storagePos.yes=
\u
662F
smfcore.storagePos.no
=
\u5426
smfcore.storagePos.no
=
\u5426
smfcore.dashBoard
=
\u
30C0
\u
30C3
\u
30B7
\u
30E5
\u
30DC
\u
30FC
\u
30C9
smfcore.dashBoard
=
\u
30C0
\u
30C3
\u
30B7
\u
30E5
\u
30DC
\u
30FC
\u
30C9
smfcore.spHumiture
=
\u
6E29
\u
6E7F
\u
5EA6
\ No newline at end of file
\ No newline at end of file
smfcore.spHumiture
=
\u
6E29
\u
6E7F
\u
5EA6
smfcore.storageOther
=
\u
305D
\u
306E
\u
4ED6
\u
6A5F
\u5668
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_zh_CN.properties
查看文件 @
5d34280
...
@@ -388,4 +388,5 @@ smfcore.storagePos.available=\u662F\u5426\u53EF\u7528
...
@@ -388,4 +388,5 @@ smfcore.storagePos.available=\u662F\u5426\u53EF\u7528
smfcore.storagePos.yes
=
\u
662F
smfcore.storagePos.yes
=
\u
662F
smfcore.storagePos.no
=
\u5426
smfcore.storagePos.no
=
\u5426
smfcore.dashBoard=
\u
4EEA
\u8868\u
76D8
smfcore.dashBoard=
\u
4EEA
\u8868\u
76D8
smfcore.spHumiture
=
\u
6E29
\u
6E7F
\u
5EA6
\ No newline at end of file
\ No newline at end of file
smfcore.spHumiture
=
\u
6E29
\u
6E7F
\u
5EA6
smfcore.storageOther
=
\u5176\u
4ED6
\u
8BBE
\u5907
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_zh_TW.properties
查看文件 @
5d34280
...
@@ -388,4 +388,5 @@ smfcore.storagePos.available=\u662F\u5426\u53EF\u7528
...
@@ -388,4 +388,5 @@ smfcore.storagePos.available=\u662F\u5426\u53EF\u7528
smfcore.storagePos.yes
=
\u
662F
smfcore.storagePos.yes
=
\u
662F
smfcore.storagePos.no
=
\u5426
smfcore.storagePos.no
=
\u5426
smfcore.dashBoard=SP
\u5100\u9336\u
76E4
smfcore.dashBoard=SP
\u5100\u9336\u
76E4
smfcore.spHumiture
=
\u
6E29
\u
6E7F
\u
5EA6
\ No newline at end of file
\ No newline at end of file
smfcore.spHumiture
=
\u
6E29
\u
6E7F
\u
5EA6
smfcore.storageOther
=
\u5176\u
4ED6
\u
8A2D
\u5099
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论