Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 1b95f712
由
zshaohui
编写于
2024-07-31 12:11:26 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
sorting提交
1 个父辈
7587335d
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
160 行增加
和
2 行删除
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/TicketController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/TicketSortingController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BoxHandleUtil.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
1b95f71
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/TicketController.java
查看文件 @
1b95f71
...
...
@@ -150,7 +150,19 @@ public class TicketController {
liteOrder
=
liteOrderManager
.
createWithItems
(
liteOrder
);
liteOrderCache
.
addOrderToMap
(
liteOrder
);
}
String
result
=
liteOrderCache
.
checkOutLiteOrderOut
(
ticket
,
false
,
null
);
String
result
=
""
;
boolean
sorting
=
false
;
if
(
sorting
)
{
log
.
info
(
ticket
+
"是SortIng出库:"
+
sorting
);
result
=
liteOrderCache
.
ticketOutBySorting
(
ticket
);
}
else
{
log
.
info
(
ticket
+
"不是SortIng出库:"
+
sorting
);
result
=
liteOrderCache
.
ticketOutByNoSorting
(
ticket
);
}
if
(
StringUtils
.
isNotEmpty
(
result
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
MessageUtils
.
getText
(
result
,
new
Locale
(
SecurityUtils
.
getCurrentUserLanguage
()),
result
));
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/TicketSortingController.java
0 → 100644
查看文件 @
1b95f71
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
rawstor
.
controller
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Api
(
tags
=
"单据sorting"
)
@RestController
@RequestMapping
(
"/ticketSortIng"
)
public
class
TicketSortingController
{
@Autowired
private
CodeResolve
codeResolve
;
@Autowired
private
IStoragePosManager
storagePosManager
;
@Autowired
private
IBarcodeManager
barcodeManager
;
@ApiOperation
(
"获取料箱信息"
)
@RequestMapping
(
"/boxInfo"
)
@AnonymousAccess
public
ResultBean
boxInfo
(
String
boxStr
)
{
if
(
StringUtils
.
isEmpty
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料箱信息"
});
}
boxStr
=
boxStr
.
toUpperCase
(
Locale
.
ROOT
);
//如果不是C07,C13,C15开头的 报错
if
(!
boxStr
.
startsWith
(
"C07"
)
&&
!
boxStr
.
startsWith
(
"C13"
)
&&
!
boxStr
.
startsWith
(
"C15"
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"不是有效的料箱条码"
);
}
//如果不是以A/B结尾的,则提示
if
(!
boxStr
.
endsWith
(
"A"
)
&&
!
boxStr
.
endsWith
(
"B"
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"请输入完整的料箱条码"
);
}
Barcode
barcode
=
codeResolve
.
resolveCode
(
boxStr
);
if
(
barcode
!=
null
)
{
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
if
(
pos
!=
null
)
{
barcode
=
pos
.
getBarcode
();
barcode
.
setStatus
(
BARCODE_STATUS
.
OUT_NORMAL
);
//设置成 不在库
barcodeManager
.
save
(
barcode
);
pos
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
pos
);
}
}
Map
<
String
,
Long
>
allCountMap
=
new
HashMap
<>();
Map
<
String
,
Long
>
needOutCountMap
=
new
HashMap
<>();
Map
<
String
,
String
>
pnMap
=
new
HashMap
<>();
//获取料箱要出库的集合
List
<
Barcode
>
subCodeList
=
barcode
.
getSubCodeList
();
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
//隔口对应的数量
allCountMap
=
subCodeList
.
stream
().
collect
(
Collectors
.
groupingBy
(
Barcode:
:
getPosName
,
Collectors
.
counting
()));
//隔口需要对应的出库数量
List
<
Barcode
>
outSubCodeList
=
subCodeList
.
stream
().
filter
(
s
->
s
.
isOut
()).
collect
(
Collectors
.
toList
());
if
(
outSubCodeList
!=
null
&&
!
outSubCodeList
.
isEmpty
())
{
needOutCountMap
=
outSubCodeList
.
stream
().
collect
(
Collectors
.
groupingBy
(
Barcode:
:
getPosName
,
Collectors
.
counting
()));
}
//对应的pn
for
(
Barcode
subCode
:
subCodeList
)
{
pnMap
.
put
(
subCode
.
getPosName
(),
subCode
.
getPartNumber
());
}
}
List
<
List
<
Object
>>
boxInfoList
=
new
ArrayList
<>();
String
box
=
barcode
.
getBarcode
();
for
(
int
i
=
1
;
i
<
7
;
i
++)
{
List
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
BoxHandleUtil
.
getCountByPartition
(
allCountMap
,
box
+
"-0"
+
i
));
//隔口总的数量
list
.
add
(
BoxHandleUtil
.
getCountByPartition
(
needOutCountMap
,
box
+
"-0"
+
i
));
//隔口出库的数量
String
pn
=
pnMap
.
get
(
box
+
"-0"
+
i
)
==
null
?
""
:
pnMap
.
get
(
box
+
"-0"
+
i
);
//隔口pn
list
.
add
(
pn
);
list
.
add
(
i
);
//隔口号
boxInfoList
.
add
(
list
);
}
if
(
boxStr
.
startsWith
(
"C07"
))
{
if
(
boxStr
.
endsWith
(
"A"
))
{
boxInfoList
.
add
(
boxInfoList
.
get
(
1
));
boxInfoList
.
add
(
boxInfoList
.
get
(
3
));
boxInfoList
.
add
(
boxInfoList
.
get
(
5
));
boxInfoList
.
add
(
boxInfoList
.
get
(
0
));
boxInfoList
.
add
(
boxInfoList
.
get
(
2
));
boxInfoList
.
add
(
boxInfoList
.
get
(
4
));
}
else
{
boxInfoList
.
add
(
boxInfoList
.
get
(
4
));
boxInfoList
.
add
(
boxInfoList
.
get
(
2
));
boxInfoList
.
add
(
boxInfoList
.
get
(
0
));
boxInfoList
.
add
(
boxInfoList
.
get
(
5
));
boxInfoList
.
add
(
boxInfoList
.
get
(
3
));
boxInfoList
.
add
(
boxInfoList
.
get
(
1
));
}
}
else
if
(
boxStr
.
startsWith
(
"C13"
))
{
if
(
boxStr
.
endsWith
(
"A"
))
{
boxInfoList
.
add
(
boxInfoList
.
get
(
0
));
boxInfoList
.
add
(
boxInfoList
.
get
(
1
));
boxInfoList
.
add
(
boxInfoList
.
get
(
2
));
}
else
{
boxInfoList
.
add
(
boxInfoList
.
get
(
2
));
boxInfoList
.
add
(
boxInfoList
.
get
(
1
));
boxInfoList
.
add
(
boxInfoList
.
get
(
0
));
}
}
else
if
(
boxStr
.
startsWith
(
"C15"
))
{
if
(
boxStr
.
endsWith
(
"A"
))
{
boxInfoList
.
add
(
boxInfoList
.
get
(
0
));
boxInfoList
.
add
(
boxInfoList
.
get
(
1
));
boxInfoList
.
add
(
boxInfoList
.
get
(
2
));
}
else
{
boxInfoList
.
add
(
boxInfoList
.
get
(
2
));
boxInfoList
.
add
(
boxInfoList
.
get
(
1
));
boxInfoList
.
add
(
boxInfoList
.
get
(
0
));
}
}
return
ResultBean
.
newOkResult
(
boxInfoList
);
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BoxHandleUtil.java
查看文件 @
1b95f71
...
...
@@ -520,7 +520,7 @@ public class BoxHandleUtil {
return
resultMap
;
}
p
rivate
static
int
getCountByPartition
(
Map
<
String
,
Long
>
paramMap
,
String
partition
)
{
p
ublic
static
int
getCountByPartition
(
Map
<
String
,
Long
>
paramMap
,
String
partition
)
{
return
paramMap
.
get
(
partition
)
==
null
?
0
:
paramMap
.
get
(
partition
).
intValue
();
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论