Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 33a60f6c
由
zshaohui
编写于
2023-10-23 13:12:32 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
线外入库 出库功能优化提交
1 个父辈
2eb3b2d8
显示空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
117 行增加
和
26 行删除
src/main/java/com/neotel/smfcore/core/system/rest/DbBackupController.java
src/main/java/com/neotel/smfcore/core/system/util/DbBackupService.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/AgvBoxDeviceClientController.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/InventoryController.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/WarehouseController.java
src/main/java/com/neotel/smfcore/custom/lizhen/setting/bean/query/ExpiredSettingQueryCriteria.java
src/main/java/com/neotel/smfcore/custom/lizhen/setting/controller/ExpiredSettingController.java
src/main/java/com/neotel/smfcore/core/system/rest/DbBackupController.java
0 → 100644
查看文件 @
33a60f6
package
com
.
neotel
.
smfcore
.
core
.
system
.
rest
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.core.system.util.DbBackupService
;
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
;
@Api
(
"数据备份"
)
@RestController
@RequestMapping
(
"/dbBackup"
)
public
class
DbBackupController
{
@Autowired
private
DbBackupService
dbBackupService
;
@AnonymousAccess
@ApiOperation
(
"数据备份"
)
@RequestMapping
(
"/backup"
)
public
ResultBean
backup
(){
dbBackupService
.
backup
();
return
ResultBean
.
newOkResult
(
""
);
}
}
src/main/java/com/neotel/smfcore/core/system/util/DbBackupService.java
查看文件 @
33a60f6
...
...
@@ -130,6 +130,7 @@ public class DbBackupService {
List
<
Criteria
>
criteriaList
=
new
ArrayList
<>();
criteriaList
.
add
(
Criteria
.
where
(
"posName"
).
is
(
""
));
criteriaList
.
add
(
Criteria
.
where
(
"posName"
).
exists
(
false
));
monthsBeforeToday
=
cn
.
hutool
.
core
.
date
.
DateUtil
.
offsetMonth
(
monthsBeforeToday
,+
2
);
c
=
Criteria
.
where
(
"updateDate"
).
lt
(
monthsBeforeToday
).
orOperator
(
criteriaList
);
}
else
{
c
=
Criteria
.
where
(
"createDate"
).
lt
(
monthsBeforeToday
);
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/AgvBoxDeviceClientController.java
查看文件 @
33a60f6
...
...
@@ -353,7 +353,7 @@ public class AgvBoxDeviceClientController {
//如果是相同状态,则不执行
if
(
statusStr
.
equals
(
opTask
.
getStatus
())){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.taskStatusHasUpdate"
,
"任务{0}已经修改状态"
,
new
String
[]{
opTask
.
getBarcode
()});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.taskStatusHasUpdate"
,
"任务{0}已经修改状态"
,
new
String
[]{
opTask
.
getBarcode
()}
,
false
);
}
/**
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/InventoryController.java
查看文件 @
33a60f6
...
...
@@ -366,7 +366,7 @@ public class InventoryController {
//当前料箱的信息
String
currentRfid
=
station
.
getCurrentRfid
();
if
(
StringUtils
.
isBlank
(
currentRfid
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{});
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{}
,
false
);
}
//获取料箱信息
String
boxStr
=
BoxUtil
.
getBoxStr
(
currentRfid
);
...
...
@@ -421,7 +421,7 @@ public class InventoryController {
//判断当前工位是否有料箱
String
currentRfid
=
station
.
getCurrentRfid
();
if
(
StringUtils
.
isBlank
(
currentRfid
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{});
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{}
,
false
);
}
String
errorMsg
=
inventoryReel
(
currentRfid
,
bacodeStr
);
if
(
StringUtils
.
isNotBlank
(
errorMsg
))
{
...
...
@@ -464,7 +464,7 @@ public class InventoryController {
//校验rfid是否一致
String
currentRfid
=
station
.
getCurrentRfid
();
if
(
StringUtils
.
isBlank
(
currentRfid
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{});
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{}
,
false
);
}
else
if
(!
currentRfid
.
startsWith
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"当前工位料箱"
+
currentRfid
+
"与"
+
"要入库的料箱:"
+
boxStr
+
"不一致"
,
new
String
[]{});
}
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
查看文件 @
33a60f6
...
...
@@ -211,12 +211,6 @@ public class OutLineController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请先扫描料箱隔口码,再扫描物料二维码"
);
}
//判断是否存在其他料箱中
String
posName
=
getPosNameBySubcode
(
barcode
.
getBarcode
());
if
(
StringUtils
.
isNotBlank
(
posName
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"物料"
+
barcode
.
getBarcode
()
+
"已存在料箱:"
+
barcode
.
getPosName
());
}
//判断是否强制入库,为1时验证,否则不验证
if
(
"0"
.
equals
(
force
))
{
try
{
...
...
@@ -236,6 +230,12 @@ public class OutLineController {
}
}
//判断是否存在其他料箱中
String
posName
=
getPosNameBySubcode
(
barcode
.
getBarcode
());
if
(
StringUtils
.
isNotBlank
(
posName
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"物料"
+
barcode
.
getBarcode
()
+
"已存在料箱:"
+
barcode
.
getPosName
());
}
//校验是否可以入库
Map
<
String
,
Object
>
brandQty
=
lizhenApi
.
brandQty
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
());
if
(
brandQty
==
null
||
brandQty
.
isEmpty
())
{
...
...
@@ -1165,6 +1165,19 @@ public class OutLineController {
}
}
//判断是否有已完成的任务
List
<
DataLog
>
finishedTasks
=
taskService
.
getFinishedTasks
();
if
(
finishedTasks
!=
null
&&
!
finishedTasks
.
isEmpty
())
{
for
(
DataLog
finishedTask
:
finishedTasks
)
{
if
(
barcode
.
getBarcode
().
equals
(
finishedTask
.
getBarcode
()))
{
if
(
finishedTask
.
isFinished
()
&&
finishedTask
.
isPutInTask
())
{
return
"物料"
+
barcode
.
getBarcode
()
+
"已存在完成的入库任务,请核实"
;
}
}
}
}
barcode
=
barcodeManager
.
save
(
barcode
);
//更新barcode缓存
log
.
info
(
barcode
.
getBarcode
()
+
"的数量为:"
+
barcode
.
getAmount
());
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/WarehouseController.java
查看文件 @
33a60f6
...
...
@@ -262,12 +262,12 @@ public class WarehouseController {
//判断工位信息是否为空
Station
station
=
StationCacheUtil
.
getStation
(
name
);
if
(
station
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"工位信息未上传成功,请重试"
,
new
String
[]{});
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"工位信息未上传成功,请重试"
,
new
String
[]{}
,
false
);
}
//当前料箱的信息
String
currentRfid
=
station
.
getCurrentRfid
();
if
(
StringUtils
.
isBlank
(
currentRfid
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{});
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{}
,
false
);
}
//解析出具体的料箱信息
String
boxStr
=
getBoxInfoByRfid
(
currentRfid
);
...
...
@@ -366,11 +366,6 @@ public class WarehouseController {
}
else
if
(!
lastScanBoxCode
.
startsWith
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请先扫描料箱隔口码,再扫描物料二维码"
);
}
//判断是否存在其他料箱中
String
posName
=
getPosNameBySubcode
(
barcode
.
getBarcode
());
if
(
StringUtils
.
isNotBlank
(
posName
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"物料"
+
barcode
.
getBarcode
()
+
"已存在料箱:"
+
barcode
.
getPosName
());
}
//判断隔口中厂商,料号,gr标签是否一致
String
grLabelStr
=
station
.
getGrLabel
();
GrLabel
label
=
null
;
...
...
@@ -412,6 +407,12 @@ public class WarehouseController {
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.partNumber.invalid"
,
"{0}不是有效的料号"
,
new
String
[]{
barcode
.
getPartNumber
()});
}
//判断物料是否存在料箱
String
posName
=
getPosNameBySubcode
(
barcode
.
getBarcode
());
if
(
StringUtils
.
isNotBlank
(
posName
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"物料"
+
barcode
.
getBarcode
()
+
"已存在料箱:"
+
barcode
.
getPosName
());
}
//获取mes数量
Barcode
barcodeApi
=
lizhenApi
.
barcodeInfo
(
barcode
);
...
...
@@ -477,7 +478,7 @@ public class WarehouseController {
//校验rfid是否一致
String
currentRfid
=
station
.
getCurrentRfid
();
if
(
StringUtils
.
isBlank
(
currentRfid
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{});
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{}
,
false
);
}
else
if
(!
currentRfid
.
startsWith
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"当前工位料箱"
+
currentRfid
+
"与"
+
"要入库的料箱:"
+
boxStr
+
"不一致"
,
new
String
[]{});
}
...
...
@@ -578,7 +579,7 @@ public class WarehouseController {
//判断当前工位是否有料箱
String
currentRfid
=
station
.
getCurrentRfid
();
if
(
StringUtils
.
isBlank
(
currentRfid
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{});
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{}
,
false
);
}
barcodeStr
=
barcodeStr
.
toUpperCase
();
//获取料箱中的物料信息
...
...
@@ -609,7 +610,7 @@ public class WarehouseController {
//判断当前工位是否有料箱
String
currentRfid
=
station
.
getCurrentRfid
();
if
(
StringUtils
.
isBlank
(
currentRfid
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{});
return
ResultBean
.
newErrorResult
(-
1
,
""
,
name
+
"当前工位料箱信息未上传成功,请重试"
,
new
String
[]{}
,
false
);
}
//获取料箱中的物料信息
...
...
@@ -888,11 +889,18 @@ public class WarehouseController {
String
orderItemIdStr
=
""
;
//1.单盘入库
if
(
INOUT_TYPE
.
IN_ONE
.
name
().
equals
(
inoutType
))
{
//判断是否存在其他料箱中
String
posName
=
getPosNameBySubcode
(
barcode
.
getBarcode
());
if
(
StringUtils
.
isNotBlank
(
posName
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"物料"
+
barcode
.
getBarcode
()
+
"已存在料箱:"
+
barcode
.
getPosName
());
//判断是否已经入库成功
List
<
DataLog
>
finishedTasks
=
taskService
.
getFinishedTasks
();
if
(
finishedTasks
!=
null
&&
!
finishedTasks
.
isEmpty
()){
for
(
DataLog
finishedTask
:
finishedTasks
)
{
if
(
barcode
.
getBarcode
().
equals
(
finishedTask
.
getBarcode
())){
if
(
finishedTask
.
isFinished
()
&&
finishedTask
.
isPutInTask
()){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"物料"
+
barcode
.
getBarcode
()
+
"已存在完成的入库任务,请核实"
);
}
}
}
}
//根据箱子号 找到barcode
Barcode
pidBarcode
=
barcodeManager
.
findByBarcode
(
boxStr
);
//校验隔口中是否可以放入
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/setting/bean/query/ExpiredSettingQueryCriteria.java
查看文件 @
33a60f6
...
...
@@ -5,6 +5,6 @@ import lombok.Data;
@Data
public
class
ExpiredSettingQueryCriteria
{
@QueryCondition
(
blurry
=
"provider,month,createBy,updateBy"
)
@QueryCondition
(
blurry
=
"provider,month,createBy,updateBy
,partNumber
"
)
private
String
blurry
;
}
src/main/java/com/neotel/smfcore/custom/lizhen/setting/controller/ExpiredSettingController.java
查看文件 @
33a60f6
...
...
@@ -8,6 +8,8 @@ import com.alibaba.excel.read.metadata.ReadSheet;
import
com.alibaba.excel.support.ExcelTypeEnum
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Lists
;
import
com.neotel.smfcore.common.base.IExcelDownLoad
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
...
...
@@ -100,9 +102,45 @@ public class ExpiredSettingController {
}
@ApiOperation
(
"列表下载"
)
@GetMapping
(
"/list/download"
)
@AnonymousAccess
public
void
getExpiredSettingListDownLoad
(
ExpiredSettingQueryCriteria
criteria
,
Pageable
pageable
,
HttpServletResponse
response
)
throws
IOException
{
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
FileUtil
.
downloadExcel
(
query
,
pageable
,
response
,
new
IExcelDownLoad
()
{
@Override
public
List
<
List
<
String
>>
getHeader
()
{
List
<
List
<
String
>>
header
=
new
ArrayList
<>();
header
.
add
(
Lists
.
newArrayList
(
"provider"
));
header
.
add
(
Lists
.
newArrayList
(
"partNumber"
));
header
.
add
(
Lists
.
newArrayList
(
"expFormat"
));
header
.
add
(
Lists
.
newArrayList
(
"month"
));
return
header
;
}
@Override
public
List
<
List
<
Object
>>
getPageData
(
Query
query
,
Pageable
pageable
)
{
List
<
List
<
Object
>>
resultList
=
new
ArrayList
<>();
PageData
<
ExpiredSetting
>
pageData
=
expiredSettingManager
.
findByPage
(
query
,
pageable
);
List
<
ExpiredSetting
>
expiredSettingList
=
pageData
.
getContent
();
if
(
expiredSettingList
!=
null
&&
!
expiredSettingList
.
isEmpty
()){
for
(
ExpiredSetting
setting
:
expiredSettingList
)
{
List
<
Object
>
list
=
new
ArrayList
<>();
list
.
add
(
setting
.
getProvider
());
list
.
add
(
setting
.
getPartNumber
());
list
.
add
(
setting
.
getExpFormat
());
list
.
add
(
setting
.
getMonth
());
resultList
.
add
(
list
);
}
}
return
resultList
;
}
});
}
@ApiOperation
(
"下载模板"
)
@RequestMapping
(
"/
list
/download"
)
@RequestMapping
(
"/
model
/download"
)
@AnonymousAccess
public
ResultBean
download
(
HttpServletResponse
response
)
throws
IOException
{
List
<
List
<
String
>>
headerList
=
new
ArrayList
<>();
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论