Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 5cf67429
由
LN
编写于
2022-12-16 13:11:46 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
20031料仓修改。
1 个父辈
71ec535e
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
151 行增加
和
2 行删除
src/main/java/com/neotel/smfcore/common/csv/CsvReader.java
src/main/java/com/neotel/smfcore/core/solder/rest/SpBoxController.java
src/main/java/com/neotel/smfcore/core/storage/rest/StorageController.java
src/main/java/com/neotel/smfcore/custom/micron20031/MicronController.java
src/main/java/com/neotel/smfcore/custom/micron20031/bean/PosRowDto.java
src/main/java/com/neotel/smfcore/common/csv/CsvReader.java
查看文件 @
5cf6742
...
...
@@ -271,6 +271,13 @@ public class CsvReader {
}
return
index
;
}
public
int
getHasCsvIndex
(
String
titleName
,
String
titleNameEn
){
int
index
=
getIndex
(
titleName
,
titleNameEn
);
if
(
index
==
-
1
){
log
.
info
(
"未包含【"
+
titleName
+
"】或【"
+
titleNameEn
+
"】列"
);
}
return
index
;
}
/**
* Gets whether leading and trailing whitespace characters are being trimmed
* from non-textqualified column data. Default is true.
...
...
src/main/java/com/neotel/smfcore/core/solder/rest/SpBoxController.java
查看文件 @
5cf6742
...
...
@@ -159,7 +159,7 @@ public class SpBoxController {
/**
* 取消锡膏定时出库
*/
@RequestMapping
(
"/
service/store/solder/
clearOutDate"
)
@RequestMapping
(
"/clearOutDate"
)
@ResponseBody
public
ResultBean
clearOutDate
(
HttpServletRequest
request
){
String
pid
=
request
.
getParameter
(
"pid"
);
...
...
@@ -174,6 +174,7 @@ public class SpBoxController {
try
{
Barcode
barcode
=
pos
.
getBarcode
();
barcode
.
setSolderStatus
(
SOLDER_STATUS
.
UNDER_REFRIGERATION
.
name
());
barcode
.
setNeedOutDate
(
null
);
barcodeManager
.
save
(
barcode
);
pos
.
setBarcode
(
barcode
);
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/StorageController.java
查看文件 @
5cf6742
...
...
@@ -393,7 +393,8 @@ public class StorageController {
int
priIndex
=
csvRead
.
getCsvIndex
(
"优先级"
,
"pri"
);
int
hIndex
=
csvRead
.
getCsvIndex
(
"高度"
,
"h"
);
int
wIndex
=
csvRead
.
getCsvIndex
(
"宽度"
,
"w"
);
int
warmPosIndex
=
csvRead
.
getCsvIndex
(
"回温库位"
,
"warmPos"
);
int
warmPosIndex
=
csvRead
.
getHasCsvIndex
(
"回温库位"
,
"warmPos"
);
int
areaIndex
=
csvRead
.
getHasCsvIndex
(
"区域"
,
"area"
);
int
row
=
1
;
...
...
@@ -410,6 +411,7 @@ public class StorageController {
Integer
priority
=
0
;
Integer
height
=
0
;
Integer
width
=
0
;
String
labelName
=
""
;
try
{
priority
=
Integer
.
parseInt
(
lineValues
[
priIndex
])
;
height
=
Integer
.
parseInt
(
lineValues
[
hIndex
]);
...
...
@@ -418,6 +420,10 @@ public class StorageController {
String
warmPosStr
=
lineValues
[
warmPosIndex
];
isWarmPos
=
Boolean
.
valueOf
(
warmPosStr
);
}
if
(
areaIndex
>=
0
){
String
areaStr
=
lineValues
[
areaIndex
];
labelName
=
areaStr
.
trim
();
}
}
catch
(
Exception
ex
){
log
.
warn
(
"第"
+
row
+
"行中有空白内容,此行忽略"
);
continue
;
...
...
@@ -429,9 +435,11 @@ public class StorageController {
}
// StoragePos posInfo = storagePosManager.getByPosName(posName);
StoragePos
posInfo
=
findFormList
(
storagePosList
,
posName
);
if
(
posInfo
==
null
){
posInfo
=
new
StoragePos
(
storageId
,
posName
,
height
,
width
,
priority
);
posInfo
.
setWarmPos
(
isWarmPos
);
posInfo
.
setLabelName
(
labelName
);
newRowCount
++;
newList
.
add
(
posInfo
);
}
else
{
...
...
@@ -446,6 +454,10 @@ public class StorageController {
needUpdate
=
true
;
}
}
if
(!
posInfo
.
getLabelName
().
equals
(
labelName
)){
posInfo
.
setLabelName
(
labelName
);
needUpdate
=
true
;
}
if
(
needUpdate
){
updateRowCount
++;
storagePosManager
.
save
(
posInfo
);
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/MicronController.java
0 → 100644
查看文件 @
5cf6742
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.custom.micron20031.bean.PosRowDto
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@RestController
@RequestMapping
(
"/rest/micron"
)
public
class
MicronController
{
@Autowired
private
IStoragePosManager
storagePosManager
;
@ApiOperation
(
"获取库位使用列表"
)
@GetMapping
(
"/posUsedData"
)
@AnonymousAccess
public
Map
<
String
,
List
<
PosRowDto
>>
posUsedData
(
String
storageId
)
{
if
(
ObjectUtil
.
isEmpty
(
storageId
)){
return
new
HashMap
<>();
}
Query
query
=
new
Query
(
Criteria
.
where
(
"storageId"
).
is
(
storageId
));
Map
<
String
,
List
<
PosRowDto
>>
resultMap
=
new
HashMap
<>();
List
<
StoragePos
>
posList
=
storagePosManager
.
findByQuery
(
query
);
Sort
sort
=
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"labelName"
,
"posName"
);
String
currPos
=
""
;
Map
<
Integer
,
Integer
>
currMap
=
new
HashMap
<>();
Map
<
String
,
Map
<
String
,
Map
<
Integer
,
Integer
>>>
allMap
=
new
HashMap
<>();
for
(
StoragePos
pos
:
posList
)
{
String
posName
=
pos
.
getPosName
();
String
posN
=
posName
.
substring
(
0
,
2
);
Integer
num
=
Convert
.
toInt
(
posName
.
substring
(
2
,
posName
.
length
()
));
Integer
used
=
0
;
if
(
pos
.
isUsed
())
{
used
=
1
;
}
// used=1;
if
(
currPos
.
equals
(
posN
))
{
currMap
.
put
(
num
,
used
);
}
else
{
if
(
ObjectUtil
.
isNotEmpty
(
currPos
)){
String
labelName
=
pos
.
getLabelName
();
if
(!
allMap
.
containsKey
(
labelName
)){
allMap
.
put
(
labelName
,
new
HashMap
<>());
}
if
(
allMap
.
get
(
labelName
).
containsKey
(
currPos
)){
allMap
.
get
(
labelName
).
get
(
currPos
).
putAll
(
currMap
);
}
else
{
allMap
.
get
(
labelName
).
put
(
currPos
,
currMap
);
}
}
//开始新的
currPos
=
posN
;
currMap
=
new
HashMap
<>();
currMap
.
put
(
num
,
used
);
}
}
for
(
String
lableName
:
allMap
.
keySet
())
{
Map
<
String
,
Map
<
Integer
,
Integer
>>
labelMap
=
allMap
.
get
(
lableName
);
List
<
PosRowDto
>
posRowDtos
=
new
ArrayList
<>();
for
(
String
name
:
labelMap
.
keySet
())
{
//记录此列
currMap
=
labelMap
.
get
(
name
);
Integer
[]
currA
=
new
Integer
[
currMap
.
size
()];
for
(
int
index
=
0
;
index
<
currMap
.
size
();
index
++)
{
int
v
=
currMap
.
getOrDefault
(
index
+
1
,
0
);
currA
[
index
]
=
v
;
}
PosRowDto
rowDto
=
new
PosRowDto
(
name
,
currA
);
posRowDtos
.
add
(
rowDto
);
}
resultMap
.
put
(
lableName
,
posRowDtos
);
}
return
resultMap
;
}
}
src/main/java/com/neotel/smfcore/custom/micron20031/bean/PosRowDto.java
0 → 100644
查看文件 @
5cf6742
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
.
bean
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
PosRowDto
implements
Serializable
{
private
String
name
;
private
Integer
[]
value
;
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论