Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d1d1cd0f
由
LN
编写于
2021-07-13 10:13:02 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加po类及对应的dao接口和实现类,utils中增加Constants,DateUtil,PLATE_SIZE,StorageConstants
1 个父辈
93e6eae8
隐藏空白字符变更
内嵌
并排
正在显示
43 个修改的文件
包含
3422 行增加
和
0 行删除
src/main/java/com/neotel/smfcore/common/utils/Constants.java
src/main/java/com/neotel/smfcore/common/utils/DateUtil.java
src/main/java/com/neotel/smfcore/common/utils/PLATE_SIZE.java
src/main/java/com/neotel/smfcore/common/utils/StorageConstants.java
src/main/java/com/neotel/smfcore/security/service/dao/IAlarmInfoDao.java
src/main/java/com/neotel/smfcore/security/service/dao/IBarcodeDao.java
src/main/java/com/neotel/smfcore/security/service/dao/IComponentDao.java
src/main/java/com/neotel/smfcore/security/service/dao/IDataLogDao.java
src/main/java/com/neotel/smfcore/security/service/dao/IHumitureDao.java
src/main/java/com/neotel/smfcore/security/service/dao/ILiteOrderDao.java
src/main/java/com/neotel/smfcore/security/service/dao/ILiteOrderItemDao.java
src/main/java/com/neotel/smfcore/security/service/dao/IMaintenanceDao.java
src/main/java/com/neotel/smfcore/security/service/dao/ISettingsDao.java
src/main/java/com/neotel/smfcore/security/service/dao/IStorageDao.java
src/main/java/com/neotel/smfcore/security/service/dao/IStoragePosDao.java
src/main/java/com/neotel/smfcore/security/service/dao/impl/AlarmInfoDaoImpl.java
src/main/java/com/neotel/smfcore/security/service/dao/impl/BarcodeDaoImpl.java
src/main/java/com/neotel/smfcore/security/service/dao/impl/ComponentDaoImpl.java
src/main/java/com/neotel/smfcore/security/service/dao/impl/DataLogDaoImpl.java
src/main/java/com/neotel/smfcore/security/service/dao/impl/HumitureDaoImpl.java
src/main/java/com/neotel/smfcore/security/service/dao/impl/LiteOrderDaoImpl.java
src/main/java/com/neotel/smfcore/security/service/dao/impl/LiteOrderItemDaoImpl.java
src/main/java/com/neotel/smfcore/security/service/dao/impl/MaintenanceDaoImpl.java
src/main/java/com/neotel/smfcore/security/service/dao/impl/SettingsDaoImpl.java
src/main/java/com/neotel/smfcore/security/service/dao/impl/StorageDaoImpl.java
src/main/java/com/neotel/smfcore/security/service/po/AlarmInfo.java
src/main/java/com/neotel/smfcore/security/service/po/Barcode.java
src/main/java/com/neotel/smfcore/security/service/po/Component.java
src/main/java/com/neotel/smfcore/security/service/po/DataLog.java
src/main/java/com/neotel/smfcore/security/service/po/Humiture.java
src/main/java/com/neotel/smfcore/security/service/po/LiteOrder.java
src/main/java/com/neotel/smfcore/security/service/po/LiteOrderItem.java
src/main/java/com/neotel/smfcore/security/service/po/Maintenance.java
src/main/java/com/neotel/smfcore/security/service/po/Settings.java
src/main/java/com/neotel/smfcore/security/service/po/Storage.java
src/main/java/com/neotel/smfcore/security/service/po/StoragePos.java
src/main/java/com/neotel/smfcore/security/service/po/data/DeviceStatusBean.java
src/main/java/com/neotel/smfcore/security/service/po/data/InactionTaskSet.java
src/main/java/com/neotel/smfcore/security/service/po/data/PlateSizeBean.java
src/main/java/com/neotel/smfcore/security/service/po/data/PreWareHousing.java
src/main/java/com/neotel/smfcore/security/service/po/data/ProviderPattern.java
src/main/java/com/neotel/smfcore/security/service/po/data/TaskSet.java
src/main/java/com/neotel/smfcore/security/service/po/data/UsageItem.java
src/main/java/com/neotel/smfcore/common/utils/Constants.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
common
.
utils
;
public
class
Constants
{
private
Constants
()
{
// hide me
}
//~ Static fields/initializers =============================================
/**
* Assets Version constant
*/
public
static
final
String
ASSETS_VERSION
=
"assetsVersion"
;
/**
* The name of the ResourceBundle used in this application
*/
public
static
final
String
BUNDLE_KEY
=
"ApplicationResources"
;
/**
* File separator from System properties
*/
public
static
final
String
FILE_SEP
=
System
.
getProperty
(
"file.separator"
);
/**
* User home from System properties
*/
public
static
final
String
USER_HOME
=
System
.
getProperty
(
"user.home"
)
+
FILE_SEP
;
/**
* The name of the configuration hashmap stored in application scope.
*/
public
static
final
String
CONFIG
=
"appConfig"
;
/**
* Session scope attribute that holds the locale set by the user. By setting this key
* to the same one that Struts uses, we get synchronization in Struts w/o having
* to do extra work or have two session-level variables.
*/
public
static
final
String
PREFERRED_LOCALE_KEY
=
"PREFERRED_LOCALE"
;
/**
* The request scope attribute under which an editable user form is stored
*/
public
static
final
String
USER_KEY
=
"userForm"
;
/**
* The request scope attribute that holds the user list
*/
public
static
final
String
USER_LIST
=
"userList"
;
/**
* The request scope attribute for indicating a newly-registered user
*/
public
static
final
String
REGISTERED
=
"registered"
;
/**
* The name of the Administrator role, as specified in web.xml
*/
// public static final String ADMIN_ROLE = "ROLE_ADMIN";
//
// /**
// * The name of the User role, as specified in web.xml
// */
// public static final String USER_ROLE = "ROLE_USER";
/**
* The name of the user's role list, a request-scoped attribute
* when adding/editing a user.
*/
public
static
final
String
USER_ROLES
=
"userRoles"
;
/**
* The name of the available roles list, a request-scoped attribute
* when adding/editing a user.
*/
public
static
final
String
AVAILABLE_ROLES
=
"availableRoles"
;
/**
* The name of the CSS Theme setting.
* @deprecated No longer used to set themes.
*/
public
static
final
String
CSS_THEME
=
"csstheme"
;
}
src/main/java/com/neotel/smfcore/common/utils/DateUtil.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
common
.
utils
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
public
class
DateUtil
{
private
static
Log
log
=
LogFactory
.
getLog
(
DateUtil
.
class
);
private
static
final
String
TIME_PATTERN
=
"HH:mm"
;
/**
* Checkstyle rule: utility classes should not have public constructor
*/
private
DateUtil
()
{
}
/**
* Return default datePattern (MM/dd/yyyy)
*
* @return a string representing the date pattern on the UI
*/
public
static
String
getDatePattern
()
{
Locale
locale
=
LocaleContextHolder
.
getLocale
();
String
defaultDatePattern
;
try
{
defaultDatePattern
=
ResourceBundle
.
getBundle
(
Constants
.
BUNDLE_KEY
,
locale
)
.
getString
(
"date.format"
);
}
catch
(
MissingResourceException
mse
)
{
defaultDatePattern
=
"MM/dd/yyyy"
;
}
return
defaultDatePattern
;
}
public
static
String
getDateTimePattern
()
{
return
DateUtil
.
getDatePattern
()
+
" HH:mm:ss"
;
}
public
static
String
toDateTimeString
(
Date
aDate
)
{
return
toDateString
(
aDate
,
getDateTimePattern
());
}
public
static
String
toDateString
(
Date
aDate
)
{
return
toDateString
(
aDate
,
getDatePattern
());
}
public
static
String
toDateString
(
long
time
,
String
aMask
){
return
toDateString
(
new
Date
(
time
),
aMask
);
}
public
static
String
toDateString
(
Date
aDate
,
String
aMask
)
{
SimpleDateFormat
df
=
null
;
String
returnValue
=
""
;
if
(
aDate
==
null
)
{
log
.
warn
(
"aDate is null!"
);
}
else
{
df
=
new
SimpleDateFormat
(
aMask
);
returnValue
=
df
.
format
(
aDate
);
}
return
(
returnValue
);
}
public
static
Date
toDate
(
final
String
strDate
)
throws
ParseException
{
return
toDate
(
strDate
,
getDatePattern
());
}
public
static
Date
toDate
(
String
strDate
,
String
aMask
)
throws
ParseException
{
SimpleDateFormat
df
;
Date
date
;
df
=
new
SimpleDateFormat
(
aMask
);
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"converting '"
+
strDate
+
"' to date with mask '"
+
aMask
+
"'"
);
}
try
{
date
=
df
.
parse
(
strDate
);
}
catch
(
ParseException
pe
)
{
//log.error("ParseException: " + pe);
throw
new
ParseException
(
pe
.
getMessage
(),
pe
.
getErrorOffset
());
}
return
(
date
);
}
/**
* 获取距离今天dayFromToday 天的不带时间的日期(今天是0,昨天是-1,明天是1)
*/
public
static
Date
getNoTimeFromToday
(
int
dayFromToday
){
Calendar
c
=
noTimeCalendar
();
c
.
add
(
Calendar
.
DAY_OF_YEAR
,
dayFromToday
);
return
c
.
getTime
();
}
private
static
Calendar
noTimeCalendar
(){
Calendar
c
=
Calendar
.
getInstance
();
c
.
set
(
Calendar
.
HOUR
,
0
);
c
.
set
(
Calendar
.
MINUTE
,
0
);
c
.
set
(
Calendar
.
SECOND
,
0
);
c
.
set
(
Calendar
.
MILLISECOND
,
0
);
return
c
;
}
/**
* 获取本周的第一天
*/
public
static
Date
getFirstDayOfThisWeek
(){
Calendar
c
=
noTimeCalendar
();
c
.
set
(
Calendar
.
DAY_OF_WEEK
,
Calendar
.
MONDAY
);
return
c
.
getTime
();
}
/**
* 将日期添加一天,时间设置为00:00:00
*/
public
static
Date
addOneDayNoTime
(
Date
date
){
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
date
);
c
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
c
.
set
(
Calendar
.
MINUTE
,
0
);
c
.
set
(
Calendar
.
SECOND
,
0
);
c
.
set
(
Calendar
.
MILLISECOND
,
0
);
c
.
add
(
Calendar
.
DAY_OF_YEAR
,
1
);
return
c
.
getTime
();
}
/**
* 日期+天数
* @param date
* @param days
* @return
*/
public
static
Date
addDays
(
Date
date
,
int
days
){
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
date
);
c
.
add
(
Calendar
.
DAY_OF_YEAR
,
days
);
return
c
.
getTime
();
}
public
static
Date
getMinDate
(
Date
date0
,
Date
date1
){
return
date0
.
before
(
date1
)?
date0
:
date1
;
}
public
static
Date
getMaxDate
(
Date
date0
,
Date
date1
){
return
date0
.
after
(
date1
)?
date0
:
date1
;
}
public
static
class
Req
{
private
String
seq
;
private
int
op
;
private
int
step
;
private
Map
<
String
,
String
>
data
;
public
String
getSeq
()
{
return
seq
;
}
public
void
setSeq
(
String
seq
)
{
this
.
seq
=
seq
;
}
public
int
getOp
()
{
return
op
;
}
public
void
setOp
(
int
op
)
{
this
.
op
=
op
;
}
public
int
getStep
()
{
return
step
;
}
public
void
setStep
(
int
step
)
{
this
.
step
=
step
;
}
public
Map
<
String
,
String
>
getData
()
{
return
data
;
}
public
void
setData
(
Map
<
String
,
String
>
data
)
{
this
.
data
=
data
;
}
}
public
static
void
main
(
String
args
[])
throws
Exception
{
// Req req = new Req();
// req.setSeq("111");
// req.setOp(1);
// req.setStep(1);
// Map<String,String> codeMap = Maps.newHashMap();
// codeMap.put("CODEBBB","0");
// req.setData(codeMap);
//
// ObjectMapper mapper = new ObjectMapper();
// String json = mapper.writeValueAsString(req);
// System.out.println(json);
// CsvWriter csvWriter = new CsvWriter("/Volumes/SSD/code/storage/def.csv");
// csvWriter.writeRecord(new String[]{"AE","B","C","D"});
// csvWriter.flush();
// csvWriter.close();
String
doors
=
"3-2|"
;
List
<
String
>
theDoorOpened
=
Lists
.
newArrayList
(
doors
.
split
(
"\\|"
));
if
(
theDoorOpened
.
contains
(
"3-2"
)){
System
.
out
.
println
(
"------"
);
};
}
}
src/main/java/com/neotel/smfcore/common/utils/PLATE_SIZE.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
common
.
utils
;
import
com.google.common.collect.Lists
;
import
lombok.Getter
;
import
lombok.Setter
;
import
java.util.List
;
public
class
PLATE_SIZE
{
/**
* 7英寸 x 8毫米
*/
public
static
PLATE_SIZE
R7_H8
=
new
PLATE_SIZE
(
7
,
8
);
public
static
PLATE_SIZE
R7_H15
=
new
PLATE_SIZE
(
7
,
12
);
public
static
PLATE_SIZE
R13_H8
=
new
PLATE_SIZE
(
13
,
8
);
public
static
PLATE_SIZE
R13_H12
=
new
PLATE_SIZE
(
13
,
12
);
public
static
PLATE_SIZE
R13_H16
=
new
PLATE_SIZE
(
13
,
16
);
public
static
PLATE_SIZE
R13_H24
=
new
PLATE_SIZE
(
13
,
24
);
public
static
PLATE_SIZE
R13_H32
=
new
PLATE_SIZE
(
13
,
32
);
//TRAY盘
public
static
PLATE_SIZE
TRAY13_H75
=
new
PLATE_SIZE
(
""
,
320
,
75
);
public
static
PLATE_SIZE
TRAY13_H105
=
new
PLATE_SIZE
(
""
,
320
,
105
);
public
static
PLATE_SIZE
R15_H16
=
new
PLATE_SIZE
(
15
,
16
);
public
static
PLATE_SIZE
R15_H24
=
new
PLATE_SIZE
(
15
,
24
);
public
static
PLATE_SIZE
R15_H32
=
new
PLATE_SIZE
(
15
,
32
);
//管状料 宽500 高70
public
static
PLATE_SIZE
W500_H70
=
new
PLATE_SIZE
(
""
,
500
,
70
);
/**
* 自宝义
*/
public
static
PLATE_SIZE
CUSTOMER
=
new
PLATE_SIZE
(
"自定义"
,
-
1
,
-
1
);
private
static
List
<
PLATE_SIZE
>
all
=
Lists
.
newArrayList
(
R7_H8
,
R7_H15
,
R13_H12
,
R13_H16
,
R13_H24
,
R13_H32
,
TRAY13_H75
,
TRAY13_H105
,
R15_H16
,
R15_H16
,
R15_H24
,
R15_H32
,
W500_H70
,
CUSTOMER
);
public
static
List
<
PLATE_SIZE
>
values
()
{
return
all
;
}
PLATE_SIZE
(){
}
PLATE_SIZE
(
int
w
,
int
h
)
{
this
.
w
=
w
;
this
.
h
=
h
;
}
PLATE_SIZE
(
String
name
,
int
w
,
int
h
)
{
this
.
w
=
w
;
this
.
h
=
h
;
this
.
name
=
name
;
}
public
static
PLATE_SIZE
fromWH
(
int
w
,
int
h
)
{
for
(
PLATE_SIZE
ps
:
PLATE_SIZE
.
values
())
{
if
(
ps
.
getW
()
==
w
&&
ps
.
getH
()
==
h
)
{
return
ps
;
}
}
return
CUSTOMER
;
}
private
String
name
=
""
;
/**
* 用于统计料仓使用情况
*/
@Getter
@Setter
private
boolean
used
=
false
;
/**
* 尺寸(几寸盘)
*/
@Getter
@Setter
private
int
w
;
/**
* 盘高度
*/
@Getter
@Setter
private
int
h
;
public
String
getSizeStr
(){
return
w
+
"x"
+
h
;
}
/**
* 展示
*/
public
String
getShowStr
()
{
if
(
CUSTOMER
.
equals
(
this
)){
return
name
;
}
return
name
+
" "
+
w
+
" x "
+
h
;
}
}
src/main/java/com/neotel/smfcore/common/utils/StorageConstants.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
common
.
utils
;
import
com.google.common.collect.Lists
;
import
java.util.Collection
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
public
class
StorageConstants
{
public
final
static
String
COMPONENT
=
"component"
;
public
final
static
String
COMPONENT_SEARCH_VIEW
=
"redirect:/component/componentSearch.html"
;
public
final
static
String
BARCODE_TYPE
=
"barcode"
;
public
final
static
String
BARCODE_SEARCH_VIEW
=
"redirect:/barcode/barcodeSearch.html"
;
public
final
static
String
STORAGE_TYPE
=
"storage"
;
public
final
static
String
STORAGE_UPDATE_VIEW
=
"redirect:storageUpdate.html"
;
// public final static int STA_PUT_IN_FINISHED = 3;
// public final static int STA_CHECKOUT_FINISHED = 4;
// public final static int STA_REST = 5;
public
final
static
String
SAVE
=
"save"
;
public
final
static
String
ADD
=
"add"
;
public
final
static
String
DELETE
=
"delete"
;
public
final
static
String
REMOVE
=
"remove"
;
public
final
static
String
FETCH
=
"fetch"
;
public
final
static
int
DEFAULT_HEIGHT
=
20
;
/**
* /// <summary>
/// 操作码(0无操作(发送料仓状态给服务器),1扫码入库(扫码成功后发送给服务器),2 出库(服务器发送) )
/// </summary>
*/
public
static
class
OP
{
/**
* 0无操作
*/
public
final
static
int
NON_OP
=
0
;
/**
* 1扫码入库
*/
public
final
static
int
PUT_IN
=
1
;
/**
* 2 出库
*/
public
final
static
int
CHECKOUT
=
2
;
/**
* 3 有错误消息
*/
public
final
static
int
ERROR
=
3
;
/**
* 4扫码
*/
public
final
static
int
SCAN_CODE
=
4
;
/**
* 5获取报警温湿度值
*/
public
final
static
int
ALARM_DATA
=
5
;
/**
* 6 锡膏回温取料
*/
public
final
static
int
REWARM_TAKING
=
6
;
/**
* 7 锡膏回温放料
*/
public
final
static
int
REWARM_PUTTING
=
7
;
/**
* 8 锡膏搅拌
*/
public
final
static
int
MIX
=
8
;
}
/// 整体料仓状态
/// 1=正常运行中
/// 2=急停中
/// 3=故障(气压检测不到等,用msg发送详细故障说明)
/// 4=警告(用msg发送提醒,如出库到达工位但是没有工人操作)
public
static
class
STATUS
{
/**
* 1=正常运行中
*/
public
final
static
int
READY
=
1
;
/**
* 2=急停中
*/
public
final
static
int
EMERGENCY
=
2
;
/**
* 3=故障(气压检测不到等,用msg发送详细故障说明)
*/
public
final
static
int
PROBLEM
=
3
;
/**
* 4=警告(用msg发送提醒,如出库到达工位但是没有工人操作)
*/
public
final
static
int
WARNING
=
4
;
/**
* 999=离线
*/
public
final
static
int
OFFLINE
=
999
;
}
/// <summary>
/// 单台BOX状态
/// 1=正常运行中
/// 2=急停,3=故障,4=警告,5=调试中
/// 6入库执行中,7入仓位完成,8入库失败
/// 9出库执行中,10出仓位完成,11出库失败
/// </summary>
public
static
class
BOX_STATUS
{
/**
* 1=准备就绪
*/
public
final
static
int
READY
=
1
;
/**
* 2=急停
*/
public
final
static
int
EMERGENCY
=
2
;
/**
* 3=故障
*/
public
final
static
int
PROBLEM
=
3
;
/**
* 4=警告(用msg发送提醒,如出库到达工位但是没有工人操作)
*/
public
final
static
int
WARNING
=
4
;
/**
* 5=调试中
*/
public
final
static
int
DEBUG
=
5
;
/**
* 6入库执行中
*/
public
final
static
int
PUTIN
=
6
;
/**
* 7入仓位完成,
*/
public
final
static
int
IN_FINISHED
=
7
;
/**
* 8入库失败
*/
public
final
static
int
IN_FAILED
=
8
;
/**
*9出库执行中,
*/
public
final
static
int
CHECKOUT
=
9
;
/**
* 10出仓位完成
*/
public
final
static
int
OUT_FINISHED
=
10
;
/**
* 11出库完成
*/
public
final
static
int
OUT_END
=
11
;
/**
* 12出库移栽中
*/
public
final
static
int
OUT_MOVING
=
12
;
/**
* 13原点返回中
*/
public
final
static
int
RESET
=
13
;
/**
* 14 回温取料中
*/
public
final
static
int
REWARM_TAKING
=
14
;
/**
* 15 回温取料完成
*/
public
final
static
int
REWARM_TAKING_END
=
15
;
/**
* 16 回温放料中
*/
public
final
static
int
REWARM_PUTTING
=
16
;
/**
* 17 回温放料完成
*/
public
final
static
int
REWARM_PUTTING_END
=
17
;
/**
* 18 搅拌取料中
*/
public
final
static
int
MIX_TAKING
=
18
;
/**
* 19 等待搅拌
*/
public
final
static
int
WAIT_MIX
=
19
;
/**
* 20 搅拌执行中
*/
public
final
static
int
MIXING
=
20
;
/**
* 21 搅拌完成回仓
*/
public
final
static
int
MIX_PUTTING
=
21
;
/**
* 22 搅拌完成放回原来的仓中
*/
public
final
static
int
MIX_END
=
22
;
}
/**
* 料仓类型:0单台自动料仓,1手动料仓2流水线料仓
*/
public
static
enum
TYPE
{
/**
*0单台自动料仓
*/
AUTO
(
"storage.type.auto"
),
/**
* 1手动料仓
*/
MANUAL
(
"storage.type.manual"
),
/**
* 2流水线料仓
*/
LINE
(
"storage.type.line"
),
/**
* 3 虚拟料仓
*/
VIRTUAL
(
"storage.type.virtual"
),
/**
* 4 在线料仓(上下层两个 BOX)
*/
ONLINE
(
"storage.type.online"
),
/**
* 5批量上下料料仓
*/
BATCH
(
"storage.type.batch"
),
/**
* 6智能料架
*/
SHELF
(
"storage.type.shelf"
),
/**
* 7 料柜
*/
CABINET
(
"storage.type.cabinet"
),
/**
* 8 料架
*/
ACCSHELF
(
"storage.type.accShelf"
),
/**
* 9 新料架,支持合并库位确认
*/
NEWSHELF
(
"storage.type.newShelf"
),
/**
* 9 扫码料架
*/
CODESHELF
(
"storage.type.codeShelf"
),
/**
* 10 锡膏料仓
*/
SOLDERPASTE
(
"storage.type.solderPaste"
),
/**
* 11 垂直货柜
*/
VERTICALBOX
(
"storage.type.smdVl"
),
/**
* 12 SMD-XL(方仓)
*/
SMD_XL
(
"storage.type.smdXl"
),
/**
* 13 SMD-DUO(DUO料仓)
*/
SMD_DUO
(
"storage.type.smdDuo"
)
;
private
String
key
;
TYPE
(
String
key
)
{
this
.
key
=
key
;
}
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
String
getName
(){
return
name
();
}
public
static
List
<
TYPE
>
availableTypeList
(){
return
Lists
.
newArrayList
(
AUTO
,
LINE
,
BATCH
,
ACCSHELF
,
CODESHELF
,
SOLDERPASTE
,
VERTICALBOX
,
SMD_XL
,
SMD_DUO
);
}
}
/**
* 操作状态
*/
public
enum
OP_STATUS
{
/**
* 无状态
*/
NONE
,
/**
* 等待
*/
WAIT
,
/**
* 正在执行
*/
EXECUTING
,
/**
* 已暂停
*/
PAUSE
,
/**
* 已完成
*/
FINISHED
,
/**
* 已取消
*/
CANCEL
,
/**
* 已结束
*/
END
;
}
/**
* 任务来源:1=Feeder
*/
public
static
enum
TASK_SOURCE
{
/**
* 站位列表
*/
FEEDER
,
/**
* 指定批次
*/
BATCH
,
/**
* 呆滞物料出库
*/
INACTION
;
}
public
static
class
ALARM_TYPE_MSG
{
private
static
Map
<
String
,
String
>
msgMap
=
new
HashMap
<>();
static
{
msgMap
.
put
(
"0-1"
,
"原点返回"
);
msgMap
.
put
(
"0-2"
,
"复位"
);
msgMap
.
put
(
"1-1"
,
"急停"
);
msgMap
.
put
(
"1-2"
,
"无气压信号"
);
msgMap
.
put
(
"1-3"
,
"托盘错乱"
);
msgMap
.
put
(
"2-1"
,
"旋转轴错误"
);
msgMap
.
put
(
"2-2"
,
"上下轴错误"
);
msgMap
.
put
(
"2-3"
,
"前进轴错误"
);
msgMap
.
put
(
"2-4"
,
"压紧轴错误"
);
msgMap
.
put
(
"2-5"
,
"上下电缸错误"
);
}
public
static
String
getMsg
(
String
type
,
String
detail
){
String
key
=
type
+
"-"
+
detail
;
return
getMsg
(
key
);
}
public
static
String
getMsg
(
String
detailType
){
// String msg = msgMap.get(detailType);
// if(Strings.isNullOrEmpty(msg)){
// msg = detailType;
// }
// return msg;
return
detailType
;
}
}
/**
* 出库策略 效率优先/严格先进先出/尾料优先/先过期先出/先生产先出
*/
public
static
enum
CHECKOUT_TYPE
{
EFFICIENCY
,
FIFO
,
USED_FIRST
,
EXPIRE_FIRST
,
PRODUCE_DATE
;
}
/**
* 物料类型
*/
public
static
class
COMPONENT_TYPE
{
public
static
final
int
COMPONENT
=
0
;
/** 锡膏 */
public
static
final
int
SOLDERPASTE
=
1
;
/** PCB板 */
public
static
final
int
PCB
=
2
;
/** 其他物料*/
public
static
final
int
OTHERS
=
3
;
/** 夹具 */
public
static
final
int
FIXTURE
=
4
;
}
/**
* 二维码类型,用于在界面上展示对应的图片
*/
public
static
enum
CODE_TYPE
{
COMPONENT
,
PCB
,
OTHERS
,
PCB_FIXTURE
,
SOLDER_FIXTURE
,
FIXTURE
,
/**
* 管装锡膏
*/
TUBE_SOLDER
,
/**
* 罐装锡膏
*/
CAN_SOLDER
;
public
static
CODE_TYPE
fromComponentType
(
int
type
){
switch
(
type
){
case
COMPONENT_TYPE
.
COMPONENT
:
return
COMPONENT
;
case
COMPONENT_TYPE
.
FIXTURE
:
return
FIXTURE
;
case
COMPONENT_TYPE
.
OTHERS
:
return
OTHERS
;
case
COMPONENT_TYPE
.
PCB
:
return
PCB
;
}
return
null
;
}
}
/**
* 图表展示方式
*/
public
static
enum
CHART_SHOW_TYPE
{
YEAR
,
MONTH
,
DAY
}
/**
* 夹具类型
*/
public
enum
PACKAGE_TYPE
{
PCB_FIXTURE
(
"PCB 夹具"
,
420
,
45
,
"PCB_FIXTURE"
),
SOLDER_FIXTURE
(
"锡膏夹具"
,
325
,
65
,
"SOLDER_FIXTURE"
);
private
String
showStr
;
/**
* 可放物料数量,用于验证
*/
private
String
code
;
private
int
count
=
1
;
private
int
w
;
private
int
h
;
public
static
PACKAGE_TYPE
fromWH
(
int
w
,
int
h
){
for
(
PACKAGE_TYPE
type
:
PACKAGE_TYPE
.
values
()){
if
(
type
.
w
==
w
&&
type
.
h
==
h
){
return
type
;
}
}
return
null
;
}
PACKAGE_TYPE
(
String
showStr
,
int
width
,
int
height
,
String
code
)
{
this
.
showStr
=
showStr
;
this
.
w
=
width
;
this
.
h
=
height
;
this
.
code
=
code
;
}
PACKAGE_TYPE
(
String
showStr
,
int
width
,
int
height
,
int
count
)
{
this
.
showStr
=
showStr
;
this
.
w
=
width
;
this
.
h
=
height
;
this
.
count
=
count
;
this
.
code
=
code
;
}
public
String
getShowStr
()
{
return
showStr
;
}
public
void
setShowStr
(
String
showStr
)
{
this
.
showStr
=
showStr
;
}
public
int
getW
()
{
return
w
;
}
public
void
setW
(
int
w
)
{
this
.
w
=
w
;
}
public
int
getH
()
{
return
h
;
}
public
void
setH
(
int
h
)
{
this
.
h
=
h
;
}
public
int
getCount
()
{
return
count
;
}
public
void
setCount
(
int
count
)
{
this
.
count
=
count
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
}
public
static
class
BARCODE_STATUS
{
/**
*-1新建
*/
public
static
int
NEW
=
-
1
;
/**
* 0在库
*/
public
static
int
IN_STORE
=
0
;
/**
* 1已出库正常
*/
public
static
int
OUT_NORMAL
=
1
;
/**
* 2已出库且已过期
*/
public
static
int
OUT_EXPIRED
=
2
;
}
/**
* 兼容类型:0=完全匹配,1=完全兼容,2=同尺寸兼容
*/
public
static
enum
COMPATIBLE_TYPE
{
/**
* 完全匹配
*/
EXACT_MATCH
(
"storage.match.exactMatch"
),
/**
* 完全兼容
*/
FULLY_COMPATIBLE
(
"storage.match.fullyCompatible"
),
/**
* 同尺寸兼容
*/
SIZE_COMPATIBLE
(
"storage.match.sizeCompatible"
);
COMPATIBLE_TYPE
(
String
key
)
{
this
.
key
=
key
;
}
private
String
key
;
public
String
getKey
()
{
return
key
;
}
public
void
setKey
(
String
key
)
{
this
.
key
=
key
;
}
public
String
getName
(){
return
name
();
}
}
public
static
class
CABINET_STEP
{
/**
* 0=等待刷卡;1=等待开门;2=门已打开,等待关闭;
*/
public
static
int
WAIT_CARD
=
0
;
/**
* 0=等待刷卡;1=等待开门;2=门已打开,等待关闭;
*/
public
static
int
WAIT_OPEN_DOOR
=
1
;
/**
* 0=等待刷卡;1=等待开门;2=门已打开,等待关闭;
*/
public
static
int
WAIT_CLOSE_DOOR
=
2
;
}
/**
* 轻工单执行状态
*/
public
static
class
LITEORDER_STATUS
{
/**新建的工单*/
public
static
int
NEW
=
0
;
/**首套料正在执行*/
public
static
int
BOM
=
1
;
/**首盘料已结束,等待出尾料*/
public
static
int
BOM_FINISHED
=
2
;
/**正在出尾料*/
public
static
int
TAILS
=
3
;
/**尾料已完成*/
public
static
int
TAILS_FINISHED
=
4
;
/**正在补料*/
public
static
int
ONE
=
5
;
/**补料已完成*/
public
static
int
ONE_FINISHED
=
6
;
}
/**
*
锡膏状态:
冷藏中
回温中 (从冷藏中取出,未达到回温时间)
待搅拌 (回温完成或二次入库重新搅拌,等待搅拌)
搅拌中 (搅拌动作执行中)
待出库 (已回温完成,搅拌完成或不需要搅拌,等待出库)
出库中 (出库动作执行中)
退库存储 (二次入库存储在暂存区,使用时可直接出库,与待出库状态一样)
*/
public
static
class
SOLDER_STATUS
{
public
static
int
NONE
=
0
;
/**
* 冷藏中
*/
public
static
int
UNDER_REFRIGERATION
=
1
;
/**
* 回温中 (从冷藏中取出,未达到回温时间)
*/
public
static
int
REWARMING
=
2
;
/**
* 待搅拌 (回温完成或二次入库重新搅拌,等待搅拌)
*/
public
static
int
TO_BE_MIXED
=
3
;
/**
* 搅拌中 (搅拌动作执行中)
*/
public
static
int
MIXING
=
4
;
/**
* 待出库 (已回温完成,搅拌完成或不需要搅拌,等待出库)
*/
public
static
int
TO_BE_OUT
=
5
;
/**
* 出库中 (出库动作执行中)
*/
public
static
int
OUTING
=
6
;
/**
* 退库存储 (二次入库存储在暂存区,使用时可直接出库,与待出库状态一样)
*/
public
static
int
RETREAT_STORAGE
=
7
;
}
private
static
int
currentColorIndex
=
-
1
;
/**
* 工单颜色, 入库绿色,出库红色,库位检查使用黄色, 其他颜色用于工单出库颜色
*/
public
enum
ORDER_COLOR
{
//magenta,cyan,firebrick,purple,skyblue,pink,forestgreen,lightblue,indianred,darkgreen
//洋红,青色,砖红色,紫色,天蓝色,粉色,森林绿,浅蓝色,印度红,深绿色
BLUE
(
"0000FF"
),
MAGENTA
(
"FF00FF"
),
CYAN
(
"00FFFF"
),
FIREBRICK
(
"B22222"
),
PURPLE
(
"A020F0"
),
SKYBLUE
(
"6CA6CD"
),
PINK
(
"FF1493"
),
FORESTGREEN
(
"228B22"
),
LIGHTBLUE
(
"8470FF"
),
INDIANRED
(
"8B3A3A"
),
DARKGREEN
(
"556B2F"
);
private
String
rgb
;
ORDER_COLOR
(
String
rgb
){
this
.
rgb
=
rgb
;
}
public
String
getRgb
()
{
return
rgb
;
}
public
void
setRgb
(
String
rgb
)
{
this
.
rgb
=
rgb
;
}
public
static
ORDER_COLOR
fromRgb
(
String
rgb
){
for
(
ORDER_COLOR
order_color
:
values
())
{
if
(
order_color
.
getRgb
().
equals
(
rgb
)){
return
order_color
;
}
}
return
null
;
}
public
static
ORDER_COLOR
nextColor
(
Collection
<
String
>
excludeColors
){
ORDER_COLOR
[]
allColors
=
values
();
if
(
excludeColors
.
size
()
>=
allColors
.
length
){
return
null
;
}
int
nextColorIndex
=
(
currentColorIndex
+
1
)
%
allColors
.
length
;
for
(
ORDER_COLOR
color
:
allColors
)
{
if
(!
excludeColors
.
contains
(
color
.
getRgb
())
&&
color
.
ordinal
()
>=
nextColorIndex
){
currentColorIndex
=
color
.
ordinal
();
return
color
;
}
}
return
null
;
}
}
}
src/main/java/com/neotel/smfcore/security/service/dao/IAlarmInfoDao.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
;
import
com.neotel.smfcore.common.base.IBaseDao
;
public
interface
IAlarmInfoDao
extends
IBaseDao
{
}
src/main/java/com/neotel/smfcore/security/service/dao/IBarcodeDao.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
;
import
com.neotel.smfcore.common.base.IBaseDao
;
public
interface
IBarcodeDao
extends
IBaseDao
{
}
src/main/java/com/neotel/smfcore/security/service/dao/IComponentDao.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
;
import
com.neotel.smfcore.common.base.IBaseDao
;
import
com.neotel.smfcore.security.service.po.Component
;
import
java.util.List
;
public
interface
IComponentDao
extends
IBaseDao
{
List
<
Component
>
findByType
(
int
type
);
List
<
String
>
distinctPcbFamily
();
}
src/main/java/com/neotel/smfcore/security/service/dao/IDataLogDao.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
;
import
com.neotel.smfcore.common.base.IBaseDao
;
public
interface
IDataLogDao
extends
IBaseDao
{
}
src/main/java/com/neotel/smfcore/security/service/dao/IHumitureDao.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
;
import
com.neotel.smfcore.common.base.IBaseDao
;
public
interface
IHumitureDao
extends
IBaseDao
{
}
src/main/java/com/neotel/smfcore/security/service/dao/ILiteOrderDao.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
;
import
com.neotel.smfcore.common.base.IBaseDao
;
public
interface
ILiteOrderDao
extends
IBaseDao
{
}
src/main/java/com/neotel/smfcore/security/service/dao/ILiteOrderItemDao.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
;
import
com.neotel.smfcore.common.base.IBaseDao
;
import
com.neotel.smfcore.security.service.po.LiteOrderItem
;
import
java.util.List
;
public
interface
ILiteOrderItemDao
extends
IBaseDao
{
List
<
LiteOrderItem
>
findByOrderNo
(
String
orderNo
);
}
src/main/java/com/neotel/smfcore/security/service/dao/IMaintenanceDao.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
;
import
com.neotel.smfcore.common.base.IBaseDao
;
import
com.neotel.smfcore.security.service.po.Maintenance
;
public
interface
IMaintenanceDao
extends
IBaseDao
{
Maintenance
findByCid
(
String
cid
);
}
src/main/java/com/neotel/smfcore/security/service/dao/ISettingsDao.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
;
import
com.neotel.smfcore.common.base.IBaseDao
;
public
interface
ISettingsDao
extends
IBaseDao
{
}
src/main/java/com/neotel/smfcore/security/service/dao/IStorageDao.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
;
import
com.neotel.smfcore.common.base.IBaseDao
;
public
interface
IStorageDao
extends
IBaseDao
{
}
src/main/java/com/neotel/smfcore/security/service/dao/IStoragePosDao.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
;
import
com.neotel.smfcore.common.base.IBaseDao
;
public
interface
IStoragePosDao
extends
IBaseDao
{
}
src/main/java/com/neotel/smfcore/security/service/dao/impl/AlarmInfoDaoImpl.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
.
impl
;
import
com.neotel.smfcore.common.base.AbstractBaseDao
;
import
com.neotel.smfcore.security.service.dao.IAlarmInfoDao
;
import
com.neotel.smfcore.security.service.po.AlarmInfo
;
public
class
AlarmInfoDaoImpl
extends
AbstractBaseDao
implements
IAlarmInfoDao
{
@Override
public
Class
getEntityClass
()
{
return
AlarmInfo
.
class
;
}
}
src/main/java/com/neotel/smfcore/security/service/dao/impl/BarcodeDaoImpl.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
.
impl
;
import
com.neotel.smfcore.common.base.AbstractBaseDao
;
import
com.neotel.smfcore.security.service.dao.IBarcodeDao
;
import
com.neotel.smfcore.security.service.po.Barcode
;
public
class
BarcodeDaoImpl
extends
AbstractBaseDao
implements
IBarcodeDao
{
@Override
public
Class
getEntityClass
()
{
return
Barcode
.
class
;
}
}
src/main/java/com/neotel/smfcore/security/service/dao/impl/ComponentDaoImpl.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
.
impl
;
import
com.neotel.smfcore.common.base.AbstractBaseDao
;
import
com.neotel.smfcore.security.service.dao.IComponentDao
;
import
com.neotel.smfcore.security.service.po.Component
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
java.util.List
;
public
class
ComponentDaoImpl
extends
AbstractBaseDao
implements
IComponentDao
{
@Override
public
Class
getEntityClass
()
{
return
Component
.
class
;
}
@Override
public
List
<
Component
>
findByType
(
int
type
)
{
Criteria
c
=
Criteria
.
where
(
"type"
).
is
(
type
);
return
findByQuery
(
new
Query
(
c
));
}
@Override
public
List
<
String
>
distinctPcbFamily
()
{
return
null
;
}
}
src/main/java/com/neotel/smfcore/security/service/dao/impl/DataLogDaoImpl.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
.
impl
;
import
com.neotel.smfcore.common.base.AbstractBaseDao
;
import
com.neotel.smfcore.security.service.dao.IDataLogDao
;
import
com.neotel.smfcore.security.service.po.DataLog
;
public
class
DataLogDaoImpl
extends
AbstractBaseDao
implements
IDataLogDao
{
@Override
public
Class
getEntityClass
()
{
return
DataLog
.
class
;
}
}
src/main/java/com/neotel/smfcore/security/service/dao/impl/HumitureDaoImpl.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
.
impl
;
import
com.neotel.smfcore.common.base.AbstractBaseDao
;
import
com.neotel.smfcore.security.service.dao.IHumitureDao
;
import
com.neotel.smfcore.security.service.po.Humiture
;
public
class
HumitureDaoImpl
extends
AbstractBaseDao
implements
IHumitureDao
{
@Override
public
Class
getEntityClass
()
{
return
Humiture
.
class
;
}
}
src/main/java/com/neotel/smfcore/security/service/dao/impl/LiteOrderDaoImpl.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
.
impl
;
import
com.neotel.smfcore.common.base.AbstractBaseDao
;
import
com.neotel.smfcore.security.service.dao.ILiteOrderDao
;
import
com.neotel.smfcore.security.service.po.LiteOrder
;
public
class
LiteOrderDaoImpl
extends
AbstractBaseDao
implements
ILiteOrderDao
{
@Override
public
Class
getEntityClass
()
{
return
LiteOrder
.
class
;
}
}
src/main/java/com/neotel/smfcore/security/service/dao/impl/LiteOrderItemDaoImpl.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
.
impl
;
import
com.neotel.smfcore.common.base.AbstractBaseDao
;
import
com.neotel.smfcore.security.service.dao.ILiteOrderItemDao
;
import
com.neotel.smfcore.security.service.po.LiteOrderItem
;
import
java.util.List
;
public
class
LiteOrderItemDaoImpl
extends
AbstractBaseDao
implements
ILiteOrderItemDao
{
@Override
public
Class
getEntityClass
()
{
return
LiteOrderItem
.
class
;
}
@Override
public
List
<
LiteOrderItem
>
findByOrderNo
(
String
orderNo
)
{
return
findListByCondition
(
new
String
[]{
"orderNo"
},
new
String
[]{
orderNo
});
}
}
src/main/java/com/neotel/smfcore/security/service/dao/impl/MaintenanceDaoImpl.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
.
impl
;
import
com.neotel.smfcore.common.base.AbstractBaseDao
;
import
com.neotel.smfcore.security.service.dao.IMaintenanceDao
;
import
com.neotel.smfcore.security.service.po.Maintenance
;
import
org.springframework.stereotype.Service
;
@Service
public
class
MaintenanceDaoImpl
extends
AbstractBaseDao
implements
IMaintenanceDao
{
@Override
public
Class
getEntityClass
()
{
return
Maintenance
.
class
;
}
@Override
public
Maintenance
findByCid
(
String
cid
)
{
return
super
.
findOneByCondition
(
new
String
[]
{
"storageCid"
},
new
String
[]
{
cid
});
}
}
src/main/java/com/neotel/smfcore/security/service/dao/impl/SettingsDaoImpl.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
.
impl
;
import
com.neotel.smfcore.common.base.AbstractBaseDao
;
import
com.neotel.smfcore.security.service.dao.ISettingsDao
;
import
com.neotel.smfcore.security.service.po.Settings
;
import
org.springframework.stereotype.Service
;
@Service
public
class
SettingsDaoImpl
extends
AbstractBaseDao
implements
ISettingsDao
{
@Override
public
Class
getEntityClass
()
{
return
Settings
.
class
;
}
}
src/main/java/com/neotel/smfcore/security/service/dao/impl/StorageDaoImpl.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
dao
.
impl
;
import
com.neotel.smfcore.common.base.AbstractBaseDao
;
import
com.neotel.smfcore.security.service.dao.IStorageDao
;
import
com.neotel.smfcore.security.service.po.Storage
;
public
class
StorageDaoImpl
extends
AbstractBaseDao
implements
IStorageDao
{
@Override
public
Class
getEntityClass
()
{
return
Storage
.
class
;
}
}
src/main/java/com/neotel/smfcore/security/service/po/AlarmInfo.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
;
import
com.neotel.smfcore.common.base.BasePo
;
import
lombok.Data
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.io.Serializable
;
import
java.util.Date
;
@Data
@Document
public
class
AlarmInfo
extends
BasePo
implements
Serializable
{
/**
* 料仓名称
*/
private
String
storageName
;
/// <summary>
/// 料仓ID,0表示流水线
/// </summary>
private
String
boxId
;
/// <summary>
/// 报警类型,
/// </summary>
private
String
alarmType
;
/// <summary>
/// 报警详情
/// </summary>
private
String
alarmDetail
;
/// <summary>
/// 报警消息
/// </summary>
private
String
alarmMsg
;
/// <summary>
/// 报警消息(英文)
/// </summary>
private
String
alarmMsgEn
;
/// <summary>
/// 0,1=入库,2=出库
/// </summary>
private
String
inOutStatus
;
/**
* 开始时间
*/
private
Date
startTime
;
/**
* 结束时间
*/
private
Date
endTime
;
}
src/main/java/com/neotel/smfcore/security/service/po/Barcode.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
;
import
com.google.common.collect.Lists
;
import
com.neotel.smfcore.common.base.BasePo
;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
lombok.Data
;
import
org.springframework.data.annotation.Transient
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
@Data
@Document
public
class
Barcode
extends
BasePo
implements
Serializable
{
private
String
barcode
;
/**
* 物料类型:PCB,锡膏,或其他
*/
private
int
type
=
StorageConstants
.
COMPONENT_TYPE
.
COMPONENT
;
//锡膏回温时间,小于回温时间不可出库
private
int
warmTime
=
0
;
/**
* 搅拌时间(分钟)
*/
private
int
mixTime
=
0
;
private
float
maxStorageTime
=
0
;
/**
* 过期时间(入库时间+最大存储时间)
*/
private
Date
expTime
;
/**
* 过期状态,-1未入库0在库,1已出库正常,2已出库且已过期
*/
private
int
status
=
StorageConstants
.
BARCODE_STATUS
.
NEW
;
/**
* 锡膏状态
*/
private
int
solderStatus
=
StorageConstants
.
SOLDER_STATUS
.
NONE
;
/**
* 锡膏指定时间出库
*/
private
Date
needOutDate
;
//private int componentType = 0;
private
String
partNumber
;
//"供应商编号"
private
String
providerNumber
;
private
int
initialAmount
;
private
int
amount
;
/**
* 标签解析出来的数量,用于判断条码是否是重新打印的,重新打印的条码需要重新设置数量
*/
private
int
labelAmount
=
0
;
private
int
plateSize
;
private
int
height
;
private
String
provider
;
private
String
batch
;
private
String
msl
;
//备用字段1(配套单号))或 family
private
String
otherField1
;
//备用字段2 (产品型号)
private
String
otherField2
;
//备用字段3 (组件型号)
private
String
otherField3
;
//备用字段4 (元器件型号)
private
String
otherField4
;
//备用字段5 (检验编号)
private
String
otherField5
;
//备用字段5 (备注)
private
String
otherField6
;
/**
* 包装上带的过期时间
*/
private
Date
expireDate
;
private
boolean
used
=
false
;
//备注信息
private
String
memo
;
/**
* 库位信息
*/
private
String
posName
;
/**
* 只能单盘出库
*/
private
boolean
onlySingleOut
=
false
;
/**
* 贴片机补料信息
*/
private
String
nextBarcode
;
/**
* 第一次入库时间戳
*/
private
long
putInTime
=
-
1
;
/**
* 开始回温时间
*/
private
long
startWarmTime
=
-
1
;
/**
* 入库时间
*/
private
Date
putInDate
;
/**
* 入库操作人
*/
private
String
inOpor
;
/**
* 出库操作人
*/
private
String
outOpor
;
/**
* 最后一次出库的时间
*/
private
Date
checkOutDate
;
/**
* 关联条码,夹具时关联相关的物料,用于入库完成时插入相关物料
*/
@Transient
private
List
<
String
>
relationCodes
;
/**
* 是否是锡膏
*/
public
boolean
isSolder
(){
return
type
==
StorageConstants
.
COMPONENT_TYPE
.
SOLDERPASTE
;
}
public
List
<
String
>
getRelationCodes
()
{
if
(
relationCodes
==
null
)
{
return
Lists
.
newArrayList
();
}
return
relationCodes
;
}
/**
* 上次使用时间(出入库时更改)
*/
private
Date
usedDate
;
/**
* 使用次数(入库后+1)
*/
private
int
usedCount
=
0
;
/**
* 生产日期
*/
private
Date
produceDate
;
/**
* 锁定ID(目前只有指定批次会锁定)
*/
private
String
lockId
;
/**
* 添加相关联条码
*
* @param relationCode
*/
public
void
addRelationCode
(
String
relationCode
)
{
if
(
relationCodes
==
null
)
{
relationCodes
=
Lists
.
newArrayList
();
}
relationCodes
.
add
(
relationCode
);
}
public
long
getPutInTime
()
{
return
putInTime
;
}
public
void
setPutInTime
(
long
putInTime
)
{
if
(
this
.
putInTime
==
-
1
){
this
.
putInTime
=
putInTime
;
this
.
putInDate
=
new
Date
(
putInTime
);
}
status
=
StorageConstants
.
BARCODE_STATUS
.
IN_STORE
;
updateExpTime
();
}
public
Date
getPutInDate
()
{
return
putInDate
;
}
public
String
getPutInDateStr
(){
if
(
putInDate
==
null
){
return
""
;
}
return
DateUtil
.
toDateTimeString
(
putInDate
);
}
public
void
setPutInDate
(
Date
putInDate
)
{
this
.
putInDate
=
putInDate
;
}
private
void
updateExpTime
(){
if
(
expTime
==
null
&&
maxStorageTime
!=
0
F
&&
putInTime
!=
-
1
){
Float
maxStorageTimeMill
=
maxStorageTime
*
60
*
60
*
1000
;
expTime
=
new
Date
(
putInTime
+
maxStorageTimeMill
.
longValue
());
if
(
expireDate
!=
null
){
//如果是在包装上的过期时间之前,使用包装上的过期时间
if
(
expireDate
.
getTime
()<
expTime
.
getTime
()){
expTime
=
expireDate
;
}
}
}
}
/**
* 到达回温的时间
*/
public
long
getReachWarmTime
(){
long
reachWarmTime
=
System
.
currentTimeMillis
();
if
(
StorageConstants
.
COMPONENT_TYPE
.
SOLDERPASTE
==
type
&&
putInTime
!=
-
1
){
reachWarmTime
=
putInTime
+
warmTime
*
60
*
60
*
1000
;
}
return
reachWarmTime
;
}
/**
* 是否达到回温时间,只有锡膏才需要判定
*/
public
boolean
isReachedWarmTime
(){
return
getReachWarmTime
()
<=
System
.
currentTimeMillis
();
}
public
long
getInStoreHour
(){
if
(
putInTime
!=
-
1
){
return
(
System
.
currentTimeMillis
()
-
putInTime
)
/
60
/
60
/
1000
;
}
return
0
;
}
public
long
getInStoreMiniute
(){
if
(
putInTime
!=
-
1
){
long
minutes
=
(
System
.
currentTimeMillis
()
-
getPutInTime
())
/
60000
%
60
;
if
(
minutes
==
0
){
if
(
getInStoreHour
()
==
0
){
minutes
=
1
;
}
}
return
minutes
;
}
return
0
;
}
public
void
setCheckOutDate
(
Date
checkOutDate
,
String
opor
)
{
this
.
checkOutDate
=
checkOutDate
;
this
.
outOpor
=
opor
;
if
(
checkOutDate
!=
null
){
//出库时判断是否过期
updateExpTime
();
if
(
expTime
!=
null
&&
checkOutDate
.
after
(
expTime
)){
//过期时间小于出库时间,说明出库的时候已经过期了
status
=
StorageConstants
.
BARCODE_STATUS
.
OUT_EXPIRED
;
}
else
{
status
=
StorageConstants
.
BARCODE_STATUS
.
OUT_NORMAL
;
}
}
}
public
void
setInOpor
(
String
inOpor
)
{
if
(
putInTime
==
-
1
){
this
.
inOpor
=
inOpor
;
}
}
public
int
getSolderStatus
()
{
if
(
solderStatus
==
StorageConstants
.
SOLDER_STATUS
.
REWARMING
){
//如果状态是回温中,且回温时间已经大于warmTime,修改状态为待搅拌
long
now
=
System
.
currentTimeMillis
();
if
(
startWarmTime
-
now
>
warmTime
*
60
*
60
*
1000
){
solderStatus
=
StorageConstants
.
SOLDER_STATUS
.
TO_BE_MIXED
;
}
}
return
solderStatus
;
}
public
String
getNeedOutDateStr
(){
if
(
needOutDate
==
null
){
return
""
;
}
return
DateUtil
.
toDateTimeString
(
needOutDate
);
}
public
String
getExpireDateStr
(){
if
(
expireDate
!=
null
){
return
DateUtil
.
toDateString
(
expireDate
);
}
return
""
;
}
/**
* 是否已过期
*/
public
boolean
isExpired
(){
if
(
expireDate
!=
null
){
return
expireDate
.
before
(
new
Date
());
}
return
false
;
}
/**
* 是否即将(3天内)过期,已过期后,此字段变为false
*/
public
boolean
isWillExpired
(){
if
(
isExpired
()){
return
false
;
}
if
(
expireDate
!=
null
){
return
expireDate
.
before
(
DateUtil
.
addDays
(
new
Date
(),
3
));
}
return
false
;
}
}
src/main/java/com/neotel/smfcore/security/service/po/Component.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
;
import
com.neotel.smfcore.common.base.BasePo
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
com.sun.istack.internal.NotNull
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.io.Serializable
;
@Data
@Document
@NoArgsConstructor
public
class
Component
extends
BasePo
implements
Serializable
{
/**
* 产品类型:0元器件,1锡膏2PCB3其他4夹具
*/
private
int
type
=
StorageConstants
.
COMPONENT_TYPE
.
COMPONENT
;
/**
* 产品型号
*/
private
String
model
;
//元器件型号
private
String
productionType
;
//"封装"/组件型号
private
String
encapsulation
;
/**
* 冰箱存储条件
*/
private
int
storageCondition
;
/**
* 室温最多存储时间
*/
private
int
maxStorageTime
;
/**
* 回温时间
*/
private
int
warmTime
;
/**
* 搅拌时间(分钟)
*/
private
int
mixTime
;
/**
* 夹具编号
*/
private
String
fixtureNumber
;
/**
* 名称 用户输入文本
锡膏类型(productionType) 有铅/无铅 选择
型号 文本输入
包装方式(encapsulation) 罐装/管装 选择
冰箱存储条件 默认单位是摄氏度,仅作输入显示
室温最多存储时间 用户输入数字,单位为小时,此时间为锡膏在料仓内最大存储时间,报警提示
回温时间 用户输入数字,单位为小时,达到回温时间按才能出库
开封后可以保存时间 室温最多存储时间-回温时间,第一次出库,就认为是开封
*/
//名称
private
String
name
;
//料号
//@NotEmpty(message = "{component.partNumber.empty}")
// @NotEmpty(message = "{component.partNumber.empty}")
@NotNull
private
String
partNumber
;
/**
* 供应商PN,用于扫码贴标机转换PN
*/
// private String supplierPn;
//uid
private
String
uid
;
//物料描述
private
String
description
;
//单耗
private
String
unitCost
;
//"MSL等级"
private
String
msl
;
//"单位"
private
String
unit
;
//"厂商"
private
String
producer
;
//"厂商编号"
private
String
producerNumber
;
//"供应商"
private
String
provider
;
//"供应商编号"
private
String
providerNumber
;
private
int
amount
;
/**
* 报警值,与贴片机连机时使用,值小于1时为初始数量amount百分比,大于等于1时为数量,小于此值时会根据贴片机信息自动出料
*/
private
float
alarmValue
=
0.5f
;
private
int
plateSize
;
private
int
height
;
/**
* 单台料仓可存储此种物料的最大数量
*/
private
int
maxStoreNum
=
999999999
;
/**
* 单台料仓存储此种物料的最小数量
*/
private
int
minStoreNum
=
0
;
/**
* 出库时是否需要授权
*/
private
boolean
needAuth
=
false
;
/**
* 展示的图片
*/
private
String
showImg
=
""
;
/**
* 有效时长(生产日期+此天数为过期日期),设置默认有效期为2年
*/
private
int
validDay
=
0
;
public
String
getPSize
(){
if
(
plateSize
==
0
||
height
==
0
){
return
""
;
}
if
(
type
==
StorageConstants
.
COMPONENT_TYPE
.
FIXTURE
){
return
plateSize
+
"x"
+
height
+
"x"
+
partNumber
;
}
return
plateSize
+
"x"
+
height
;
}
public
int
getAlarmAmount
(){
if
(
alarmValue
<
1
){
return
Float
.
valueOf
(
getAmount
()
*
alarmValue
).
intValue
();
}
else
{
return
Float
.
valueOf
(
alarmValue
).
intValue
();
}
}
/**
* 是否是锡膏
*/
public
boolean
isSolder
(){
return
type
==
StorageConstants
.
COMPONENT_TYPE
.
SOLDERPASTE
;
}
}
src/main/java/com/neotel/smfcore/security/service/po/DataLog.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
;
import
com.google.common.base.Strings
;
import
com.google.common.collect.Lists
;
import
com.neotel.smfcore.common.base.BasePo
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
lombok.Data
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
@Document
public
class
DataLog
extends
BasePo
implements
Serializable
{
/**
* 是否是单盘出库(联电指出库项目,默认为false即默认批量出库)
*/
private
boolean
singleOut
=
false
;
/**
* 所属料仓
*/
private
String
storageName
;
/**
* 料仓 cid
*/
private
String
cid
;
/**
* 料仓 ID
*/
private
String
storageId
;
/**
* 仓位 ID
*/
private
String
posId
;
/**
* 仓位名称
*/
private
String
posName
;
//二维码(Reel ID)
private
String
barcode
;
/**
* 物料编号
*/
private
String
partNumber
;
/**
*数量(从 barCode 中读取)
*/
private
int
num
;
/**
* 类型:入库StorageConstants.OP.PUT_IN,出库StorageConstants.OP.CHECKOUT
*/
private
int
type
;
/**
* 状态:StorageConstants.OP_STATUS
*/
private
String
status
;
/**
* 指定批次Id
*/
private
String
batchId
;
/**
* 批次显示内容
*/
private
String
batchInfo
;
/**
* 指令来源:站位列表 指定订单工单 MES
*/
private
String
sourceType
;
/**
* 来源 id,
*/
private
String
sourceId
;
/**
* 来源名称
*/
private
String
sourceName
;
/**
* 子来源 ID(单个站位)
*/
private
String
subSourceId
;
/**
* 子来源名称
*/
private
String
subSourceInfo
;
/**
* 创建人
*/
private
String
creator
;
/**
* 操作人
*/
private
String
operator
;
/**
* 关联条码,夹具时关联相关的物料,用于入库完成时插入相关物料
*/
private
List
<
String
>
relationCodes
;
private
String
memo
;
/**
* 搅拌时间(锡膏搅拌任务使用)
*/
private
int
mixTime
;
/**
* 亮灯料架颜色
*/
private
String
lightColor
=
"FF0000"
;
public
String
getBarcode
()
{
if
(
barcode
==
null
){
return
""
;
}
return
barcode
;
}
public
String
getStorageId
()
{
if
(
storageId
==
null
){
return
""
;
}
return
storageId
;
}
public
String
getPosId
()
{
if
(
posId
==
null
){
return
""
;
}
return
posId
;
}
/**
* 是否被取消
*/
public
boolean
isCancel
(){
return
StorageConstants
.
OP_STATUS
.
CANCEL
.
name
().
equals
(
status
);
}
public
boolean
isExecuting
(){
return
StorageConstants
.
OP_STATUS
.
EXECUTING
.
name
().
equals
(
status
);
}
public
boolean
isFinished
(){
return
StorageConstants
.
OP_STATUS
.
FINISHED
.
name
().
equals
(
status
);
}
public
boolean
isWait
(){
return
StorageConstants
.
OP_STATUS
.
WAIT
.
name
().
equals
(
status
);
}
public
boolean
isEnd
(){
return
StorageConstants
.
OP_STATUS
.
END
.
name
().
equals
(
status
);
}
/**
* 是否是入库任务
*/
public
boolean
isPutInTask
(){
return
StorageConstants
.
OP
.
PUT_IN
==
type
;
}
/**
* 是否是回温取料任务
*/
public
boolean
isRewarmTakingTask
(){
return
StorageConstants
.
OP
.
REWARM_TAKING
==
type
;
}
/**
* 是否是搅拌任务
*/
public
boolean
isMixTask
(){
return
StorageConstants
.
OP
.
MIX
==
type
;
}
/**
* 是否是回温放料任务
*/
public
boolean
isRewarmPuttingTask
(){
return
StorageConstants
.
OP
.
REWARM_PUTTING
==
type
;
}
/**
* 是否是出库任务
*/
public
boolean
isCheckOutTask
(){
return
StorageConstants
.
OP
.
CHECKOUT
==
type
;
}
/**
* 超过5分钟的已完成,已取消的任务都不再
*/
public
boolean
needRemoveFromCache
(){
if
(
isFinished
()
||
isCancel
()){
if
(
System
.
currentTimeMillis
()
-
super
.
getUpdateDate
().
getTime
()
>
3
*
60
*
1000
){
return
true
;
}
}
return
false
;
}
/**
* 超过5秒的任务不再显示
* @return
*/
public
boolean
needRemoveFromShow
(){
if
(
isFinished
()
||
isCancel
()){
if
(
System
.
currentTimeMillis
()
-
super
.
getUpdateDate
().
getTime
()
>
25
*
1000
){
return
true
;
}
}
return
false
;
}
/**
* 正在执行的出库任务,如果60秒还未完成,再次发送到客户端
*/
public
boolean
needReSendToClient
(){
if
(
isCheckOutTask
()
&&
isExecuting
()){
return
System
.
currentTimeMillis
()
-
super
.
getUpdateDate
().
getTime
()
>=
60
*
1000
;
}
return
false
;
}
public
String
getSourceStr
(){
String
sourceStr
=
""
;
if
(!
Strings
.
isNullOrEmpty
(
sourceName
)){
sourceStr
=
sourceName
;
if
(!
Strings
.
isNullOrEmpty
(
subSourceInfo
)){
sourceStr
=
sourceName
+
"【"
+
subSourceInfo
+
"】"
;
}
}
return
sourceStr
;
}
public
String
getPosStr
(){
return
storageName
+
"["
+
posName
+
"]"
;
}
/**
* 任务展示字符串
*/
public
String
getShowStr
(){
String
msg
=
""
;
if
(
isPutInTask
()){
//入库
msg
=
"物料["
+
partNumber
+
"] 入库到"
+
getPosStr
();
}
else
{
String
sourceInfo
=
""
;
if
(!
Strings
.
isNullOrEmpty
(
subSourceInfo
)){
sourceInfo
=
"站位 ["
+
subSourceInfo
+
"] 的"
;
}
if
(!
Strings
.
isNullOrEmpty
(
storageName
)){
msg
=
sourceInfo
+
"物料["
+
partNumber
+
"] 从"
+
getPosStr
()
+
"出库"
;
}
else
{
msg
=
sourceInfo
+
"物料["
+
partNumber
+
"] 出库"
;
}
}
return
msg
;
}
/**
* 是否是站位列表任务
*/
public
boolean
isFeederTask
(){
return
StorageConstants
.
TASK_SOURCE
.
FEEDER
.
name
().
equals
(
getSourceType
());
}
/**
* 是否是呆滞料出库任务
*/
public
boolean
isInactionTask
(){
return
StorageConstants
.
TASK_SOURCE
.
INACTION
.
name
().
equals
(
getSourceType
());
}
@Override
public
boolean
equals
(
Object
o
)
{
boolean
eq
=
super
.
equals
(
o
);
if
(!
eq
&&
o
!=
null
){
if
(
o
instanceof
DataLog
){
return
((
DataLog
)
o
).
getId
().
equals
(
this
.
getId
());
}
}
return
eq
;
}
@Override
public
int
hashCode
()
{
return
getId
().
hashCode
();
}
public
List
<
String
>
getRelationCodes
()
{
return
relationCodes
;
}
public
void
setRelationCodes
(
List
<
String
>
relationCodes
)
{
this
.
relationCodes
=
relationCodes
;
}
public
void
addRelationCode
(
String
relationCode
){
if
(
relationCodes
==
null
){
relationCodes
=
Lists
.
newArrayList
();
}
relationCodes
.
add
(
relationCode
);
}
}
src/main/java/com/neotel/smfcore/security/service/po/Humiture.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
;
import
com.neotel.smfcore.common.base.BasePo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
Humiture
extends
BasePo
implements
Serializable
{
/**
* 料仓号
*/
private
String
cid
;
/**
* BOX 的 ID
*/
private
Integer
boxId
;
/**
* 温度
*/
private
String
temperature
;
/**
* 湿度
*/
private
String
humidity
;
public
String
getBoxKey
(){
return
cid
+
"-"
+
boxId
;
}
}
src/main/java/com/neotel/smfcore/security/service/po/LiteOrder.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
;
import
com.neotel.smfcore.common.base.BasePo
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
lombok.Data
;
import
org.springframework.data.annotation.Transient
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
@Document
public
class
LiteOrder
extends
BasePo
implements
Serializable
{
public
LiteOrder
()
{
}
public
LiteOrder
(
String
orderNo
,
List
<
LiteOrderItem
>
orderItems
)
{
this
.
orderItems
=
orderItems
;
this
.
orderNo
=
orderNo
;
}
/**
* 订单号
*/
private
String
orderNo
;
/**
* 当前任务盘数
*/
private
int
taskReelCount
=
0
;
/**
* 当前任务已完成盘数
*/
private
int
finishedReelCount
=
0
;
/**
* 订单状态
*/
private
int
status
=
StorageConstants
.
LITEORDER_STATUS
.
NEW
;
/**
* 出库状态, 2表示已完成
*/
private
boolean
closed
=
false
;
/**
* 工单来源
*/
private
String
source
=
""
;
/**
* 任务完成时间(用于关闭页面显示)
*/
@Transient
private
long
taskFinishedTime
=
-
1
;
/**
* 套(倍)数
*/
private
float
orderTimes
=
1
f
;
/**
* 订单的详细信息
*/
@Transient
private
List
<
LiteOrderItem
>
orderItems
;
/**
* 结束当前的任务
*/
public
void
finishedTasks
(){
if
(
isOutOne
()){
setStatus
(
StorageConstants
.
LITEORDER_STATUS
.
ONE_FINISHED
);
}
else
if
(
isOutBom
()){
setStatus
(
StorageConstants
.
LITEORDER_STATUS
.
BOM_FINISHED
);
}
else
if
(
isOutTails
()){
setStatus
(
StorageConstants
.
LITEORDER_STATUS
.
TAILS_FINISHED
);
}
setTaskFinishedTime
(
System
.
currentTimeMillis
());
}
/**
* 是否正在出首套料
* @return
*/
public
boolean
isOutBom
(){
return
status
==
StorageConstants
.
LITEORDER_STATUS
.
BOM
;
}
/**
* 是否是未执行过的工单
*/
public
boolean
isNew
(){
return
status
==
StorageConstants
.
LITEORDER_STATUS
.
NEW
;
}
public
boolean
isOutOne
(){
return
status
==
StorageConstants
.
LITEORDER_STATUS
.
ONE
;
}
/**
* 补料任务完成
* @return
*/
public
boolean
isOutOneFinished
(){
return
status
==
StorageConstants
.
LITEORDER_STATUS
.
ONE_FINISHED
;
}
/**
* 是否正在出尾料
*/
public
boolean
isOutTails
(){
return
status
==
StorageConstants
.
LITEORDER_STATUS
.
TAILS
;
}
/**
* 任务料盘是否已出完
*/
public
boolean
isTaskFinished
(){
return
status
==
StorageConstants
.
LITEORDER_STATUS
.
BOM_FINISHED
||
status
==
StorageConstants
.
LITEORDER_STATUS
.
TAILS_FINISHED
||
status
==
StorageConstants
.
LITEORDER_STATUS
.
ONE_FINISHED
;
}
public
void
setTaskReelCount
(
int
taskReelCount
)
{
if
(
taskReelCount
<
0
)
taskReelCount
=
0
;
this
.
taskReelCount
=
taskReelCount
;
}
/**
* 是否需要展示(已完成的,过20 秒自动清除)
*/
public
boolean
needToShow
(){
if
(
isTaskFinished
()){
if
(
taskFinishedTime
!=
-
1
){
long
now
=
System
.
currentTimeMillis
();
return
now
-
taskFinishedTime
<=
20
*
1000
;
}
}
return
true
;
}
public
float
getOrderTimes
()
{
if
(
orderTimes
==
0
){
orderTimes
=
1
f
;
}
return
orderTimes
;
}
}
src/main/java/com/neotel/smfcore/security/service/po/LiteOrderItem.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
;
import
com.neotel.smfcore.common.base.BasePo
;
import
lombok.Data
;
import
org.springframework.data.annotation.Transient
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.io.Serializable
;
@Data
@Document
public
class
LiteOrderItem
extends
BasePo
implements
Serializable
{
//物料编号
private
String
pn
;
//需求数量
private
int
needNum
=
0
;
//已出数量
private
int
outNum
=
0
;
//已出盘数
private
int
outReelCount
=
0
;
/**
* 订单信息
*/
private
String
orderNo
=
""
;
/**
* 站位信息
*/
private
String
feederInfo
=
""
;
/**
* 库存信息
*/
@Transient
private
int
inventoryNum
=
0
;
/**
* 出库是否满足要求,已出库数量大于需求数量
*/
public
boolean
isOutFinished
(){
return
outNum
-
needNum
>=
0
;
}
}
src/main/java/com/neotel/smfcore/security/service/po/Maintenance.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
;
import
com.google.common.collect.Maps
;
import
com.neotel.smfcore.common.base.BasePo
;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.security.service.po.data.DeviceStatusBean
;
import
lombok.Data
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Map
;
@Data
@Document
public
class
Maintenance
extends
BasePo
implements
Serializable
{
/**
* 料仓CID
*/
private
String
storageCid
;
/**
* 料仓名称
*/
private
String
storageName
;
/**
* 下次维护时间
*/
private
Date
nextTime
;
/**
* 提前多少小时邮件通知
*/
private
int
hoursInAdvance
=
10
;
/**
* 邮件地址
*/
private
String
emails
=
""
;
/**
* 设备运行信息,key为设备名称,设备状态
*/
private
Map
<
String
,
DeviceStatusBean
>
deviceData
=
Maps
.
newHashMap
();
public
String
getNextTimeStr
(){
if
(
nextTime
!=
null
){
return
DateUtil
.
toDateString
(
nextTime
);
}
return
""
;
}
/**
* 更新设备的运行状态,返回值表示是否需要保存到数据库
*/
public
boolean
updateDeviceStatus
(
String
device
,
int
status
){
boolean
needSaveToDb
=
false
;
DeviceStatusBean
deviceInfo
=
deviceData
.
get
(
device
);
if
(
deviceInfo
==
null
){
deviceInfo
=
new
DeviceStatusBean
();
deviceInfo
.
setDeviceName
(
device
);
needSaveToDb
=
true
;
}
long
now
=
System
.
currentTimeMillis
();
//状态改变
if
(
status
!=
deviceInfo
.
getStatus
()){
//如果当前状态是0(即上一状态是运动,现在是停止),更新轴运行时间, 同时要满足上次更新时间小于5秒,即设备在线
if
(
status
==
0
){
if
(
now
-
deviceInfo
.
getStatusUpdateTime
()
<
5000
){
long
runTime
=
now
-
deviceInfo
.
getStatusStartTime
();
deviceInfo
.
setRunTimes
(
deviceInfo
.
getRunTimes
()
+
runTime
);
needSaveToDb
=
true
;
}
}
deviceInfo
.
setStatus
(
status
);
deviceInfo
.
setStatusStartTime
(
now
);
}
deviceInfo
.
setStatusUpdateTime
(
now
);
deviceData
.
put
(
device
,
deviceInfo
);
return
needSaveToDb
;
}
}
src/main/java/com/neotel/smfcore/security/service/po/Settings.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
;
import
com.google.common.collect.Lists
;
import
com.neotel.smfcore.common.base.BasePo
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
@Data
public
class
Settings
extends
BasePo
implements
Serializable
{
/**
* 脱机调试
*/
private
boolean
debugTest
=
false
;
/**
* 指定软件是为哪个客户单独定制的
*/
private
String
productCustom
=
""
;
/**
* 出库方式
*/
private
String
outType
;
/**
* 打印条码的纸张宽度(条码为方形,大小是长宽中最小的)
*/
private
int
pageWidth
=
500
;
/**
* 打印条码的纸张高度
*/
private
int
pageHeight
=
160
;
/**
* 最低温度
*/
private
float
minTemperature
=
22.0
F
;
/**
* 仪表显示最低温度
*/
private
float
minTemperatureShow
=
20.0
F
;
/**
* 最高温度
*/
private
float
maxTemperature
=
38.0
F
;
/**
* 仪表显示最高温度
*/
private
float
maxTemperatureShow
=
30.0
F
;
/**
* 最低湿度值
*/
private
float
minHumidity
=
0.0
F
;
/**
* 仪表显示最低湿度值
*/
private
float
minHumidityShow
=
0.0
F
;
/**
* 湿度值
*/
private
float
maxHumidity
=
100.0
F
;
/**
* 仪表显示最高湿度值
*/
private
float
maxHumidityShow
=
15.0
F
;
/**
* 条码规则,可用字段有: PN为物料编号即 PartNumber, RI 为唯一码即ReelId, QTY 为数量,SP 为供应商,SPC供应商代码,BATCH 为批次,xx或空为无对应的字段其中必须含有PN和 RI, QTY为空时使用输入产器时的封装数量
* 1@2@3@PN@5@6@7@8@9@10@11@12@13@14@15@16@RI@18@19@20@21@22@23@24
* [)>@06@12S0002@P5292001000@1P1690215@31P1690215@12V527973628@10VCHN-YANTAI@2P@20P@6D20170626@14D20171223@30PY@ZN@K0@16K0@V815@3SB370000000EZZ@Q500GRM000@20T1@1TMT72543954@2T@1Z@@'
*/
@Deprecated
private
String
codeRule
=
""
;
/**
* 多条条码规则
*/
private
List
<
String
>
codeRuleList
=
Lists
.
newArrayList
();
/**
* 打印条码纸张的页边距
*/
private
int
pageSpace
=
5
;
/**
* 打印条码时的字体大小
*/
private
int
fontSize
=
18
;
/**
* 条码检查 API
*/
private
String
reelCheckApi
;
/**
* 呆滞物料提醒时间(天)
*/
private
int
inactionDay
=
0
;
/**
* 入库通知api地址
*/
private
String
inNotifyApi
;
/**
* 出库通知api地址
*/
private
String
outNotifyApi
;
/**
* PCB 过期提醒提前天数
*/
private
int
pcbExpireDay
=
0
;
/**
* PCB 过期提醒邮件地址
*/
private
String
pcbExpireEmail
;
/**
* 备份路径
*/
private
String
backupPath
=
""
;
/**
* 备份周期
*/
private
int
backupHours
=
0
;
/**
* 维护周期
*/
private
int
maintenanceDays
=
60
;
/**
* 维护通知邮件地址
*/
private
String
maintenanceEmail
;
/**
* PCB 过期提醒时间(0-23)
*/
private
int
pcbExpireTime
=
0
;
/**
* 过期 PCB 上次检测时间
*/
private
Date
lastPcbCheckDate
;
/**
* 订单文件的路径
*/
private
String
orderFileDir
;
}
src/main/java/com/neotel/smfcore/security/service/po/Storage.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
;
import
com.neotel.smfcore.common.base.BasePo
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
com.neotel.smfcore.security.service.po.data.PlateSizeBean
;
import
com.neotel.smfcore.security.service.po.data.UsageItem
;
import
com.sun.istack.internal.NotNull
;
import
lombok.Data
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
@Data
@Document
public
class
Storage
extends
BasePo
implements
Serializable
{
// @NotEmpty(message = "{storage.name.empty}")
@NotNull
private
String
name
;
/**
* 程序路径
*/
private
String
sourcePath
;
// @NotEmpty(message = "{storage.cid.empty}")
@NotNull
private
String
cid
;
private
int
totalSlots
;
private
int
emptySlots
;
/**
* 兼容类型:完全匹配,完全兼容,同尺寸兼容
*/
private
StorageConstants
.
COMPATIBLE_TYPE
compatibleType
=
StorageConstants
.
COMPATIBLE_TYPE
.
EXACT_MATCH
;
/**
* 料仓类型:单台自动料仓,手动料仓流水线料仓
*/
private
String
type
=
StorageConstants
.
TYPE
.
AUTO
.
name
();
//包含料仓 Box数量
private
Integer
boxCount
=
1
;
public
Integer
getBoxCount
()
{
if
(
boxCount
==
null
){
boxCount
=
1
;
}
return
boxCount
;
}
/**
* 使用情况
*/
private
Map
<
String
,
UsageItem
>
usageMap
=
new
ConcurrentHashMap
<>();
private
boolean
available
=
true
;
/**
* 是否是上下层的在线料仓
* @return
*/
public
boolean
isOnlineStorage
(){
return
StorageConstants
.
TYPE
.
ONLINE
.
name
().
equals
(
type
);
}
/**
* 是否是指上下料的料仓
* @return
*/
public
boolean
isBatchStorage
(){
return
StorageConstants
.
TYPE
.
BATCH
.
name
().
equals
(
type
);
}
/**
* 是否是单台自动仓
*/
public
boolean
isAuto
(){
return
StorageConstants
.
TYPE
.
AUTO
.
name
().
equals
(
type
);
}
/**
* 是否是虚拟仓
*/
public
boolean
isVirtual
(){
return
StorageConstants
.
TYPE
.
VIRTUAL
.
name
().
equals
(
type
);
}
/**
* 是否是流水线料仓
*/
public
boolean
isLine
()
{
return
StorageConstants
.
TYPE
.
LINE
.
name
().
equals
(
type
);
}
/**
* 是否是智能料架
*/
public
boolean
isShelf
()
{
return
StorageConstants
.
TYPE
.
SHELF
.
name
().
equals
(
type
);
}
/**
* 是否是ACC智能料架
*/
public
boolean
isAccShelf
()
{
return
StorageConstants
.
TYPE
.
ACCSHELF
.
name
().
equals
(
type
);
}
/**
* 是否是扫码料架
*/
public
boolean
isCodeShelf
()
{
return
StorageConstants
.
TYPE
.
CODESHELF
.
name
().
equals
(
type
);
}
/**
* 是否是垂直货柜
*/
public
boolean
isVerticalBox
(){
return
StorageConstants
.
TYPE
.
VERTICALBOX
.
name
().
equals
(
type
);
}
/**
* 是否是锡膏料仓
*/
public
boolean
isSolderPaste
(){
return
StorageConstants
.
TYPE
.
SOLDERPASTE
.
name
().
equals
(
type
);
}
/**
* 是否是料柜
*/
public
boolean
isCabinet
()
{
return
StorageConstants
.
TYPE
.
CABINET
.
name
().
equals
(
type
);
}
/**
* 是否是方仓
*/
public
boolean
isSmdXl
()
{
return
StorageConstants
.
TYPE
.
SMD_XL
.
name
().
equals
(
type
);
}
/**
* 是否是Duo料仓
*/
public
boolean
isSmdDuo
()
{
return
StorageConstants
.
TYPE
.
SMD_DUO
.
name
().
equals
(
type
);
}
public
boolean
canPutInPos
(
int
w
,
int
h
,
int
PosW
,
int
posH
){
if
(
compatibleType
==
StorageConstants
.
COMPATIBLE_TYPE
.
EXACT_MATCH
){
//完全匹配
if
(
w
==
PosW
&&
h
==
posH
){
return
true
;
}
}
else
if
(
compatibleType
==
StorageConstants
.
COMPATIBLE_TYPE
.
FULLY_COMPATIBLE
){
//完全兼容
if
(
w
<=
PosW
&&
h
<=
posH
){
return
true
;
}
}
else
if
(
compatibleType
==
StorageConstants
.
COMPATIBLE_TYPE
.
SIZE_COMPATIBLE
){
//同尺寸兼容
if
(
w
==
PosW
&&
h
<=
posH
){
return
true
;
}
}
return
false
;
}
/**
* 判断料盘是否能够放入该仓库: 0=完全匹配,1=完全兼容,2=同尺寸兼容
*/
public
boolean
canPutIn
(
int
w
,
int
h
){
if
(
usageMap
!=
null
){
for
(
UsageItem
usageItem
:
usageMap
.
values
())
{
if
(
canPutInPos
(
w
,
h
,
usageItem
.
getW
(),
usageItem
.
getH
())){
return
true
;
}
}
}
return
false
;
}
public
Map
<
String
,
UsageItem
>
getUsageMap
()
{
return
usageMap
;
}
public
void
setUsageMap
(
Map
<
String
,
UsageItem
>
usageMap
)
{
this
.
usageMap
=
usageMap
;
}
/**
* 使用一个仓位,更新使用情况
*/
public
void
useOnePos
(
StoragePos
pos
){
if
(
usageMap
!=
null
){
String
sizeStr
=
pos
.
getSizeStr
();
UsageItem
usageItem
=
usageMap
.
get
(
sizeStr
);
if
(
usageItem
!=
null
){
this
.
emptySlots
=
this
.
emptySlots
-
1
;
int
usedCount
=
usageItem
.
getUsedCount
();
usageItem
.
setUsedCount
(
usedCount
+
1
);
usageMap
.
put
(
sizeStr
,
usageItem
);
}
}
}
public
void
emptyOnePos
(
StoragePos
pos
){
if
(
usageMap
!=
null
){
String
sizeStr
=
pos
.
getSizeStr
();
UsageItem
usageItem
=
usageMap
.
get
(
sizeStr
);
if
(
usageItem
!=
null
){
this
.
emptySlots
=
this
.
emptySlots
+
1
;
int
usedCount
=
usageItem
.
getUsedCount
();
usageItem
.
setUsedCount
(
usedCount
-
1
);
usageMap
.
put
(
sizeStr
,
usageItem
);
}
}
}
public
void
initUsage
(
List
<
PlateSizeBean
>
plateSizeBeanList
){
usageMap
=
new
ConcurrentHashMap
<>();
int
totalPosCount
=
0
;
int
emptyPosCount
=
0
;
for
(
PlateSizeBean
plateSizeBean
:
plateSizeBeanList
)
{
String
sizeStr
=
plateSizeBean
.
getSizeStr
();
UsageItem
usageItem
=
usageMap
.
get
(
sizeStr
);
if
(
usageItem
==
null
){
usageItem
=
new
UsageItem
();
usageItem
.
setW
(
plateSizeBean
.
getPlateSize
().
getW
());
usageItem
.
setH
(
plateSizeBean
.
getPlateSize
().
getH
());
}
if
(
plateSizeBean
.
getPlateSize
().
isUsed
()){
int
usedCount
=
plateSizeBean
.
getCount
();
usageItem
.
setUsedCount
(
usedCount
);
usageItem
.
setTotalCount
(
usedCount
+
usageItem
.
getTotalCount
());
}
else
{
//未使用的数量
int
idleCount
=
plateSizeBean
.
getCount
();
usageItem
.
setTotalCount
(
idleCount
+
usageItem
.
getTotalCount
());
emptyPosCount
=
emptyPosCount
+
idleCount
;
}
totalPosCount
=
totalPosCount
+
plateSizeBean
.
getCount
();
usageMap
.
put
(
sizeStr
,
usageItem
);
}
this
.
setEmptySlots
(
emptyPosCount
);
this
.
setTotalSlots
(
totalPosCount
);
}
}
src/main/java/com/neotel/smfcore/security/service/po/StoragePos.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
;
import
com.google.common.base.Strings
;
import
com.neotel.smfcore.common.base.BasePo
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
@Data
public
class
StoragePos
extends
BasePo
implements
Serializable
{
private
String
storageId
;
private
Barcode
barcode
;
private
String
posName
;
/**
* 扩展库位的主库位
*/
private
String
hostPosId
;
/**
* 该仓位是否限制物编,虚拟仓使用
*/
private
List
<
String
>
limitPnList
;
//进料优先级,数字越大优先级越高,例:1-1的优先级为100 仓1-2的优先级200,那么入仓时就会优先进入1-2仓
private
double
priority
=
0
f
;
//高度
private
int
h
;
//是否可用了
private
boolean
enabled
=
true
;
//是否使用了
private
boolean
used
=
false
;
/**
* 是否是回温库位,条码第一次入库是入库到冷藏库位,回温或二次入库时才入到回温库位
*/
private
boolean
warmPos
=
false
;
//Width
private
int
w
;
//可出库时间,类型的锡膏时,可出库时间为最新放入的锡膏的可出库时间
private
long
canCheckOutTime
=
0
;
/**
* 并联的其他库位,合并入主库位的库位
*/
private
List
<
String
>
mergePosList
;
public
String
getLabelStr
(){
String
posNameLabel
=
posName
;
int
index
=
posNameLabel
.
lastIndexOf
(
":"
);
if
(
index
>
0
){
posNameLabel
=
posNameLabel
.
substring
(
0
,
index
);
}
return
posNameLabel
;
}
public
int
getLabelIndex
(){
int
index
=
posName
.
lastIndexOf
(
":"
);
if
(
index
>
0
){
String
posIndex
=
posName
.
substring
(
index
+
1
);
try
{
return
Integer
.
valueOf
(
posIndex
);
}
catch
(
Exception
e
){
}
}
return
1
;
}
public
boolean
isEnabled
()
{
return
enabled
;
}
public
boolean
isUsed
()
{
return
used
;
}
public
boolean
isLocked
(){
return
getBarcode
()
!=
null
&&
!
Strings
.
isNullOrEmpty
(
getBarcode
().
getLockId
());
}
@Override
public
boolean
equals
(
Object
o
)
{
boolean
eq
=
super
.
equals
(
o
);
if
(!
eq
&&
o
!=
null
){
if
(
o
instanceof
StoragePos
){
return
((
StoragePos
)
o
).
getId
().
equals
(
this
.
getId
());
}
}
return
eq
;
}
@Override
public
int
hashCode
()
{
return
getId
().
hashCode
();
}
/**
* 在库分钟数
*/
public
long
getInStoreMiniute
(){
if
(
barcode
!=
null
){
return
barcode
.
getInStoreMiniute
();
}
return
0
;
}
/**
* 在库小时数
*/
public
long
getInStoreHour
(){
if
(
barcode
!=
null
){
return
barcode
.
getInStoreHour
();
}
return
0
;
}
/**
* 是否达到回温时间(只有锡膏需要判断)
*/
public
boolean
isReachedWarmTime
(){
if
(
barcode
!=
null
){
return
barcode
.
isReachedWarmTime
();
}
return
true
;
}
public
String
getSizeStr
(){
return
w
+
"x"
+
h
;
}
public
boolean
isWarmPos
()
{
return
warmPos
;
}
public
boolean
isExpandPos
(){
return
!
Strings
.
isNullOrEmpty
(
hostPosId
);
}
}
src/main/java/com/neotel/smfcore/security/service/po/data/DeviceStatusBean.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
.
data
;
import
lombok.Data
;
@Data
public
class
DeviceStatusBean
{
/**
* 设备名称
*/
private
String
deviceName
;
/**
* 当前状态
*/
private
int
status
;
/**
* 状态开始时间
*/
private
long
statusStartTime
;
/**
* 状态更新时间(用于判断设备是否离线)
*/
private
long
statusUpdateTime
;
/**
* 运行时长
*/
private
long
runTimes
;
}
src/main/java/com/neotel/smfcore/security/service/po/data/InactionTaskSet.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
.
data
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
lombok.Data
;
import
org.springframework.data.mongodb.core.mapping.Document
;
@Data
@Document
public
class
InactionTaskSet
extends
TaskSet
{
public
static
InactionTaskSet
create
(
String
areaId
,
int
day
){
InactionTaskSet
inactionTaskSet
=
new
InactionTaskSet
();
inactionTaskSet
.
setName
(
day
+
"天前呆滞物料出库"
);
inactionTaskSet
.
setStatus
(
StorageConstants
.
OP_STATUS
.
WAIT
.
name
());
inactionTaskSet
.
setId
(
"-1"
);
inactionTaskSet
.
setDay
(
day
);
return
inactionTaskSet
;
}
/**
* 总共的物料数量
*/
private
int
totalOp
;
/**
* 几天前的呆滞料
*/
private
int
day
;
/**
* 返回总任务数
* @return
*/
@Override
public
int
getOpNum
()
{
return
totalOp
;
}
@Override
public
StorageConstants
.
TASK_SOURCE
getTaskSource
()
{
return
StorageConstants
.
TASK_SOURCE
.
INACTION
;
}
@Override
public
String
getTitle
()
{
return
getName
();
}
}
src/main/java/com/neotel/smfcore/security/service/po/data/PlateSizeBean.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
.
data
;
import
com.neotel.smfcore.common.utils.PLATE_SIZE
;
import
lombok.Getter
;
import
lombok.Setter
;
public
class
PlateSizeBean
{
@Getter
private
PLATE_SIZE
plateSize
;
@Getter
@Setter
private
int
count
;
public
String
getSizeStr
(){
return
plateSize
.
getSizeStr
();
}
}
src/main/java/com/neotel/smfcore/security/service/po/data/PreWareHousing.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
.
data
;
import
com.neotel.smfcore.common.base.BasePo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
PreWareHousing
extends
BasePo
implements
Serializable
{
private
String
storageId
;
private
String
barcodeId
;
private
int
amount
;
}
src/main/java/com/neotel/smfcore/security/service/po/data/ProviderPattern.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
.
data
;
import
com.neotel.smfcore.common.base.BasePo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
ProviderPattern
extends
BasePo
implements
Serializable
{
private
String
provider
;
private
String
providerNumber
;
private
String
regex
;
}
src/main/java/com/neotel/smfcore/security/service/po/data/TaskSet.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
.
data
;
import
com.neotel.smfcore.common.base.BasePo
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
lombok.Data
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.io.Serializable
;
@Data
@Document
public
abstract
class
TaskSet
extends
BasePo
implements
Serializable
{
/**
* 显示的任务集合名称
*/
private
String
name
;
/**
* 操作出库的站位数量
*/
private
int
opNum
;
/**
* 已完成出库的站位数量
*/
private
int
finishOpNum
;
/**
* 任务创建人
*/
private
String
creator
;
/**
* 状态
*/
private
String
status
=
StorageConstants
.
OP_STATUS
.
NONE
.
name
();
public
abstract
StorageConstants
.
TASK_SOURCE
getTaskSource
();
public
abstract
String
getTitle
();
public
String
getKey
(){
return
getTaskSource
().
name
()
+
getId
();
}
public
boolean
isFeeder
(){
return
StorageConstants
.
TASK_SOURCE
.
FEEDER
.
name
().
equals
(
getTaskSource
().
name
());
}
/**
* 是否被取消
*/
public
boolean
isCancel
(){
return
StorageConstants
.
OP_STATUS
.
CANCEL
.
name
().
equals
(
getStatus
());
}
public
boolean
isEnd
(){
return
StorageConstants
.
OP_STATUS
.
END
.
name
().
equals
(
getStatus
());
}
public
boolean
isExecuting
(){
return
StorageConstants
.
OP_STATUS
.
EXECUTING
.
name
().
equals
(
getStatus
());
}
public
boolean
isFinished
(){
return
StorageConstants
.
OP_STATUS
.
FINISHED
.
name
().
equals
(
getStatus
());
}
public
boolean
isWait
(){
return
StorageConstants
.
OP_STATUS
.
WAIT
.
name
().
equals
(
getStatus
());
}
public
boolean
isPause
(){
return
StorageConstants
.
OP_STATUS
.
PAUSE
.
name
().
equals
(
getStatus
());
}
public
String
getCreator
()
{
return
creator
;
}
public
void
setCreator
(
String
creator
)
{
this
.
creator
=
creator
;
}
/**
* 没有操作过的才可以删除
*/
public
boolean
isCanRemove
(){
return
StorageConstants
.
OP_STATUS
.
NONE
.
name
().
equals
(
getStatus
())
&&
getOpNum
()
==
0
&&
getFinishOpNum
()
==
0
;
}
@Override
public
boolean
equals
(
Object
o
)
{
boolean
eq
=
super
.
equals
(
o
);
if
(!
eq
&&
o
!=
null
){
if
(
o
instanceof
TaskSet
){
eq
=
((
TaskSet
)
o
).
getId
().
equals
(
this
.
getId
());
}
}
return
eq
;
}
}
src/main/java/com/neotel/smfcore/security/service/po/data/UsageItem.java
0 → 100644
查看文件 @
d1d1cd0
package
com
.
neotel
.
smfcore
.
security
.
service
.
po
.
data
;
import
lombok.Data
;
@Data
public
class
UsageItem
{
/**
* 直径
*/
private
int
w
;
/**
* 高度
*/
private
int
h
;
/**
* 使用仓位数
*/
private
int
usedCount
;
/**
* 总仓位数
*/
private
int
totalCount
;
public
String
getSizeStr
(){
return
w
+
"x"
+
h
;
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论