Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9cf9c5d5
由
LN
编写于
2021-12-30 09:55:40 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
料盒操作需要空格+-数量。料盒数据结构修改。
1 个父辈
76d9a30f
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
99 行增加
和
48 行删除
src/main/java/com/neotel/smfcore/core/barcode/rest/bean/dto/BarcodeDto.java
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/XLCBoxHandler.java
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialBoxController.java
src/main/java/com/neotel/smfcore/core/storage/rest/query/StoragePosQueryCriteria.java
src/main/java/com/neotel/smfcore/core/system/rest/TaskController.java
src/main/java/com/neotel/smfcore/core/barcode/rest/bean/dto/BarcodeDto.java
查看文件 @
9cf9c5d
...
@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
...
@@ -5,6 +5,7 @@ import com.google.common.collect.Lists;
import
com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS
;
import
com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.enums.SOLDER_STATUS
;
import
com.neotel.smfcore.core.barcode.enums.SOLDER_STATUS
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.Setter
;
...
@@ -13,10 +14,7 @@ import org.springframework.data.annotation.Transient;
...
@@ -13,10 +14,7 @@ import org.springframework.data.annotation.Transient;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.text.DateFormat
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.*
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
@Getter
@Getter
@Setter
@Setter
...
@@ -218,10 +216,15 @@ public class BarcodeDto implements Serializable {
...
@@ -218,10 +216,15 @@ public class BarcodeDto implements Serializable {
return
(
""
+
plateSize
+
"X"
+
height
);
return
(
""
+
plateSize
+
"X"
+
height
);
}
}
/**
// /**
* 料箱中的物料信息
// * 料箱中的物料信息
*/
// */
private
Map
<
String
,
BarcodeDto
>
subCodeMap
;
// private Map<String, BarcodeDto> subCodeMap;
@ApiModelProperty
(
"料盒内所有物料条码"
)
private
List
<
Barcode
>
subCodeList
;
public
String
getPutInTimeStr
()
{
public
String
getPutInTimeStr
()
{
if
(
putInTime
==
-
1
)
{
if
(
putInTime
==
-
1
)
{
...
...
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
查看文件 @
9cf9c5d
...
@@ -163,10 +163,14 @@ public class Barcode extends BasePo implements Serializable {
...
@@ -163,10 +163,14 @@ public class Barcode extends BasePo implements Serializable {
*/
*/
@Transient
@Transient
private
List
<
String
>
relationCodes
;
private
List
<
String
>
relationCodes
;
// /**
// * 料盒条码:料盒内所有物料条码,key=barcode
// */
// private Map<String, Barcode> subCodeMap;
/**
/**
* 料盒条码:料盒内所有物料条码
,key=barcode
* 料盒条码:料盒内所有物料条码
*/
*/
private
Map
<
String
,
Barcode
>
subCodeMap
;
private
List
<
Barcode
>
subCodeList
;
/**
/**
* 是否是锡膏
* 是否是锡膏
...
@@ -401,12 +405,38 @@ public class Barcode extends BasePo implements Serializable {
...
@@ -401,12 +405,38 @@ public class Barcode extends BasePo implements Serializable {
}
}
// public Barcode getSubCode(String pnStr) {
// if (subCodeMap == null) {
// return null;
// }
// for (Barcode barcode :subCodeMap.values()
// ) {
// if (barcode.getPartNumber().equals(pnStr)) {
// return barcode;
// }
// }
// return null;
// }
//
// public void UpdateSubCode(Barcode barcode) {
//
// if (subCodeMap == null) {
// subCodeMap = new HashMap<>();
// }
// if (barcode.getAmount() <= 0) {
// if (subCodeMap.containsKey(barcode.getBarcode())) {
// subCodeMap.remove(barcode.getBarcode());
// }
// } else {
// subCodeMap.put(barcode.getBarcode(), barcode);
// }
// }
public
Barcode
getSubCode
(
String
pnStr
)
{
public
Barcode
getSubCode
(
String
pnStr
)
{
if
(
subCode
Map
==
null
)
{
if
(
subCode
List
==
null
)
{
return
null
;
return
null
;
}
}
for
(
Barcode
barcode
:
subCodeMap
.
values
()
for
(
Barcode
barcode
:
subCodeList
)
{
)
{
if
(
barcode
.
getPartNumber
().
equals
(
pnStr
))
{
if
(
barcode
.
getPartNumber
().
equals
(
pnStr
))
{
return
barcode
;
return
barcode
;
}
}
...
@@ -416,15 +446,26 @@ public class Barcode extends BasePo implements Serializable {
...
@@ -416,15 +446,26 @@ public class Barcode extends BasePo implements Serializable {
public
void
UpdateSubCode
(
Barcode
barcode
)
{
public
void
UpdateSubCode
(
Barcode
barcode
)
{
if
(
subCode
Map
==
null
)
{
if
(
subCode
List
==
null
)
{
subCode
Map
=
new
HashMap
<>
();
subCode
List
=
Lists
.
newArrayList
();
}
}
if
(
barcode
.
getAmount
()
<=
0
)
{
int
index
=-
1
;
if
(
subCodeMap
.
containsKey
(
barcode
.
getBarcode
()))
{
for
(
int
i
=
0
;
i
<
subCodeList
.
size
();
i
++){
subCodeMap
.
remove
(
barcode
.
getBarcode
());
if
(
subCodeList
.
get
(
i
).
getBarcode
().
equals
(
barcode
.
barcode
)){
index
=
i
;
break
;
}
}
}
if
(
barcode
.
getAmount
()
<=
0
)
{
if
(
index
>=
0
){
subCodeList
.
remove
(
index
);
}
}
else
{
}
else
{
subCodeMap
.
put
(
barcode
.
getBarcode
(),
barcode
);
if
(
index
>=
0
){
subCodeList
.
set
(
index
,
barcode
);
}
else
{
subCodeList
.
add
(
barcode
);
}
}
}
}
}
}
}
src/main/java/com/neotel/smfcore/core/device/handler/impl/XLCBoxHandler.java
查看文件 @
9cf9c5d
...
@@ -92,26 +92,27 @@ public class XLCBoxHandler extends BaseDeviceHandler {
...
@@ -92,26 +92,27 @@ public class XLCBoxHandler extends BaseDeviceHandler {
boolean
isEx
=
pos
.
isExpandPos
();
boolean
isEx
=
pos
.
isExpandPos
();
if
((!
pos
.
isExpandPos
())
&&
(
pos
.
getBarcode
()
!=
null
))
{
if
((!
pos
.
isExpandPos
())
&&
(
pos
.
getBarcode
()
!=
null
))
{
List
<
XLCPosBarcodeDto
>
list
=
new
ArrayList
<>();
List
<
XLCPosBarcodeDto
>
list
=
new
ArrayList
<>();
if
(
pos
.
getBarcode
().
getSubCodeMap
()
!=
null
)
{
if
(
pos
.
getBarcode
().
getSubCodeList
()
!=
null
)
{
// Set<String> keys = pos.getBarcode().getSubCodeMap().keySet();
Set
<
String
>
keys
=
pos
.
getBarcode
().
getSubCodeMap
().
keySet
();
for
(
Barcode
barcode
:
for
(
String
key
:
pos
.
getBarcode
().
getSubCodeList
())
{
keys
)
{
// Barcode barcode = pos.getBarcode().getSubCodeMap().get(key);
Barcode
barcode
=
pos
.
getBarcode
().
getSubCodeMap
().
get
(
key
);
list
.
add
(
toPosBarcodeDto
(
barcode
));
list
.
add
(
toPosBarcodeDto
(
barcode
));
}
}
}
}
if
(
list
.
size
()<=
0
)
{
// if(list.size()<=0) {
Random
r
=
new
Random
();
// Random r = new Random();
int
num
=
r
.
nextInt
(
10
)
;
// int num = r.nextInt(10) ;
for
(
int
i
=
1
;
i
<=
num
;
i
++)
{
// if(num>=3){
XLCPosBarcodeDto
dto1
=
toPosBarcodeDto
(
pos
.
getBarcode
());
// for (int i = 1; i <= num; i++) {
dto1
.
setBarcode
(
i
+
dto1
.
getBarcode
());
// XLCPosBarcodeDto dto1 = toPosBarcodeDto(pos.getBarcode());
dto1
.
setAmount
(
i
*
1111
);
// dto1.setBarcode(i * 1111 + "-" + dto1.getBarcode());
list
.
add
(
dto1
);
// dto1.setPartNumber(i * 1111 + "-" + dto1.getPartNumber());
}
// dto1.setAmount(i * 1111);
}
// list.add(dto1);
// }
// }
// }
XLCPosBarcodeDto
barcodeDto
=
toPosBarcodeDto
(
pos
.
getBarcode
());
XLCPosBarcodeDto
barcodeDto
=
toPosBarcodeDto
(
pos
.
getBarcode
());
barcodeDto
.
setSubCodeList
(
list
);
barcodeDto
.
setSubCodeList
(
list
);
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialBoxController.java
查看文件 @
9cf9c5d
...
@@ -83,8 +83,11 @@ public class MaterialBoxController {
...
@@ -83,8 +83,11 @@ public class MaterialBoxController {
}
}
BarcodeDto
barcodeDto
=
barcodeMapper
.
toDto
(
barcode
);
BarcodeDto
barcodeDto
=
barcodeMapper
.
toDto
(
barcode
);
if
(
barcodeDto
.
getSubCodeMap
()==
null
){
// if(barcodeDto.getSubCodeMap()==null){
barcodeDto
.
setSubCodeMap
(
new
HashMap
<>());
// barcodeDto.setSubCodeMap(new HashMap<>());
// }
if
(
barcodeDto
.
getSubCodeList
()==
null
){
barcodeDto
.
setSubCodeList
(
new
ArrayList
<>());
}
}
return
barcodeDto
;
return
barcodeDto
;
}
}
...
@@ -154,11 +157,11 @@ public class MaterialBoxController {
...
@@ -154,11 +157,11 @@ public class MaterialBoxController {
//料盒不存在
//料盒不存在
throw
new
ValidateException
(
"smfcore.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
throw
new
ValidateException
(
"smfcore.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
}
}
if
(
barcode
.
getSubCode
Map
()==
null
||
barcode
.
getSubCodeMap
().
size
()<=
0
){
if
(
barcode
.
getSubCode
List
()==
null
||
barcode
.
getSubCodeList
().
size
()<=
0
){
//料盒中未找到对应物料
//料盒中未找到对应物料
throw
new
ValidateException
(
"smfcore.materialBox.boxNoReel"
,
"料盒中无物料"
);
throw
new
ValidateException
(
"smfcore.materialBox.boxNoReel"
,
"料盒中无物料"
);
}
}
List
<
Barcode
>
barcodes
=
new
ArrayList
<>(
barcode
.
getSubCode
Map
().
values
()
)
;
List
<
Barcode
>
barcodes
=
new
ArrayList
<>(
barcode
.
getSubCode
List
()
)
;
for
(
Barcode
subBarcode
:
for
(
Barcode
subBarcode
:
barcodes
)
{
barcodes
)
{
...
@@ -182,30 +185,29 @@ public class MaterialBoxController {
...
@@ -182,30 +185,29 @@ public class MaterialBoxController {
DataLog
currentTask
=
null
;
DataLog
currentTask
=
null
;
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
code
);
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
code
);
if
(
barcode
==
null
){
if
(
barcode
==
null
){
throw
new
ValidateException
(
"smfcore.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
throw
new
ValidateException
(
"smfcore.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
}
}
//用+或-分割,如果最后几位是数量,按手动输入处理
//用+或-分割,如果最后几位是数量,按手动输入处理
String
[]
codeArray
=
operageStr
.
split
(
"-"
);
String
[]
codeArray
=
operageStr
.
split
(
"
-"
);
String
pnStr
=
""
;
String
pnStr
=
""
;
int
opQty
=
0
;
int
opQty
=
0
;
int
opType
=
OP
.
NON_OP
;
int
opType
=
OP
.
NON_OP
;
if
(
codeArray
.
length
==
2
){
if
(
codeArray
.
length
==
2
){
try
{
try
{
opQty
=
Integer
.
valueOf
(
codeArray
[
1
]);
opQty
=
Integer
.
valueOf
(
codeArray
[
1
]
.
trim
()
);
pnStr
=
codeArray
[
0
];
pnStr
=
codeArray
[
0
]
.
trim
()
;
opType
=
OP
.
CHECKOUT
;
opType
=
OP
.
CHECKOUT
;
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
}
}
}
}
if
(
opType
==
OP
.
NON_OP
){
if
(
opType
==
OP
.
NON_OP
){
codeArray
=
operageStr
.
split
(
"\\+"
);
codeArray
=
operageStr
.
split
(
"
\\+"
);
if
(
codeArray
.
length
==
2
){
if
(
codeArray
.
length
==
2
){
try
{
try
{
opQty
=
Integer
.
valueOf
(
codeArray
[
1
]);
opQty
=
Integer
.
valueOf
(
codeArray
[
1
]
.
trim
()
);
pnStr
=
codeArray
[
0
];
pnStr
=
codeArray
[
0
]
.
trim
()
;
opType
=
OP
.
PUT_IN
;
opType
=
OP
.
PUT_IN
;
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/query/StoragePosQueryCriteria.java
查看文件 @
9cf9c5d
...
@@ -11,7 +11,7 @@ import java.util.List;
...
@@ -11,7 +11,7 @@ import java.util.List;
@Data
@Data
public
class
StoragePosQueryCriteria
{
public
class
StoragePosQueryCriteria
{
@QueryCondition
(
blurry
=
"barcode.partNumber,barcode.barcode,posName"
)
@QueryCondition
(
blurry
=
"barcode.partNumber,barcode.barcode,posName
,barcode.subCodeList.barcode,barcode.subCodeList.partNumber
"
)
private
String
blurry
;
private
String
blurry
;
@QueryCondition
(
type
=
QueryCondition
.
Type
.
BETWEEN
,
propName
=
"updateDate"
)
@QueryCondition
(
type
=
QueryCondition
.
Type
.
BETWEEN
,
propName
=
"updateDate"
)
...
...
src/main/java/com/neotel/smfcore/core/system/rest/TaskController.java
查看文件 @
9cf9c5d
...
@@ -156,6 +156,10 @@ public class TaskController {
...
@@ -156,6 +156,10 @@ public class TaskController {
@PreAuthorize
(
"@el.check('taskLog')"
)
@PreAuthorize
(
"@el.check('taskLog')"
)
public
ResponseEntity
<
Object
>
cancel
(
@RequestBody
Set
<
String
>
ids
){
public
ResponseEntity
<
Object
>
cancel
(
@RequestBody
Set
<
String
>
ids
){
for
(
String
taskId
:
ids
)
{
for
(
String
taskId
:
ids
)
{
DataLog
task
=
dataLogManager
.
get
(
taskId
);
if
(
task
.
isCancel
()||
task
.
isFinished
()||
task
.
isEnd
()){
throw
new
ValidateException
(
"smfcore.taskHasEnd"
,
"任务{0}已取消或已结束"
,
new
String
[]{
task
.
getPosName
()}
);
}
taskService
.
cancelTask
(
taskId
);
taskService
.
cancelTask
(
taskId
);
}
}
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论