Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 467324c9
由
sunke
编写于
2023-01-11 14:55:58 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge remote-tracking branch 'origin/master'
2 个父辈
f11f6c78
ef46faa2
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
15 个修改的文件
包含
380 行增加
和
19 行删除
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
src/main/java/com/neotel/smfcore/core/inList/rest/InListController.java
src/main/java/com/neotel/smfcore/core/inList/service/po/InList.java
src/main/java/com/neotel/smfcore/core/kanban/rest/BoxKanbanController.java
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronApi.java
src/main/java/com/neotel/smfcore/custom/micron20031/Micron20031Api.java
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpApiListener.java
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpController.java
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpLoadController.java
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpUnloadController.java
src/main/java/com/neotel/smfcore/custom/micron20031/bean/OrderInfoDto.java → src/main/java/com/neotel/smfcore/custom/micron20031/bean/dto/OrderInfoDto.java
src/main/java/com/neotel/smfcore/custom/micron20031/bean/PosInfoDto.java → src/main/java/com/neotel/smfcore/custom/micron20031/bean/dto/PosInfoDto.java
src/main/java/com/neotel/smfcore/custom/micron20031/bean/PosRowDto.java → src/main/java/com/neotel/smfcore/custom/micron20031/bean/dto/PosRowDto.java
src/main/java/com/neotel/smfcore/custom/micron20031/bean/PosValueInfo.java → src/main/java/com/neotel/smfcore/custom/micron20031/bean/dto/PosValueInfo.java
src/main/java/com/neotel/smfcore/custom/micron20031/bean/dto/SpUnloadDto.java
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
467324c
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/core/inList/rest/InListController.java
查看文件 @
467324c
...
@@ -99,7 +99,7 @@ public class InListController {
...
@@ -99,7 +99,7 @@ public class InListController {
if
(
inListItems
.
size
()
<=
0
)
{
if
(
inListItems
.
size
()
<=
0
)
{
continue
;
continue
;
}
}
InList
inList
=
new
InList
(
name
,
INLIST_STATUS
.
WAIT
,
inListItems
);
InList
inList
=
new
InList
(
name
,
INLIST_STATUS
.
WAIT
,
inListItems
,
0L
);
InList
dbList
=
inListManager
.
findByName
(
name
);
InList
dbList
=
inListManager
.
findByName
(
name
);
if
(
dbList
!=
null
)
{
if
(
dbList
!=
null
)
{
...
...
src/main/java/com/neotel/smfcore/core/inList/service/po/InList.java
查看文件 @
467324c
...
@@ -26,4 +26,8 @@ public class InList extends BasePo implements Serializable {
...
@@ -26,4 +26,8 @@ public class InList extends BasePo implements Serializable {
private
List
<
InListItem
>
inListItems
;
private
List
<
InListItem
>
inListItems
;
/**
* 开始入库单入库时间,超时需要发送邮件
*/
private
long
startTime
=
0L
;
}
}
src/main/java/com/neotel/smfcore/core/kanban/rest/BoxKanbanController.java
查看文件 @
467324c
...
@@ -2,7 +2,6 @@ package com.neotel.smfcore.core.kanban.rest;
...
@@ -2,7 +2,6 @@ package com.neotel.smfcore.core.kanban.rest;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.google.common.base.Strings
;
import
com.google.common.base.Strings
;
import
com.google.common.collect.Lists
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
...
@@ -23,20 +22,16 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
...
@@ -23,20 +22,16 @@ import com.neotel.smfcore.core.storage.service.po.Storage;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.manager.impl.DataLogManagerImpl
;
import
com.neotel.smfcore.core.system.service.manager.impl.DataLogManagerImpl
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.Humiture
;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousPutMapping
;
import
com.neotel.smfcore.security.annotation.AnonymousPutMapping
;
import
com.neotel.smfcore.security.service.manager.IGroupManager
;
import
com.neotel.smfcore.security.service.manager.IGroupManager
;
import
com.neotel.smfcore.security.service.manager.impl.GroupManagerImpl
;
import
com.neotel.smfcore.security.service.manager.impl.UserManagerImpl
;
import
com.neotel.smfcore.security.service.manager.impl.UserManagerImpl
;
import
com.neotel.smfcore.security.service.po.Group
;
import
com.neotel.smfcore.security.service.po.Group
;
import
com.neotel.smfcore.security.service.po.User
;
import
com.neotel.smfcore.security.service.po.User
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
javafx.concurrent.Task
;
import
lombok.Data
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -44,7 +39,6 @@ import org.springframework.data.domain.Pageable;
...
@@ -44,7 +39,6 @@ import org.springframework.data.domain.Pageable;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
@@ -470,6 +464,13 @@ public class BoxKanbanController {
...
@@ -470,6 +464,13 @@ public class BoxKanbanController {
}
}
}
}
}
}
//如果是锡膏料仓,需要把回温区物料数量,冷藏区物料数量显示
if
(
storage
.
isSolderPaste
()){
Integer
warmUseCount
=
dataCache
.
getSpUsePosCount
(
storage
.
getCid
(),
DataCache
.
warmPosUseCount
);
Integer
coldingUseCount
=
dataCache
.
getSpUsePosCount
(
storage
.
getCid
(),
DataCache
.
coldingPosUseCount
);
boxDto
.
getData
().
put
(
DataCache
.
warmPosUseCount
,
warmUseCount
.
toString
());
boxDto
.
getData
().
put
(
DataCache
.
warmPosUseCount
,
coldingUseCount
.
toString
());
}
return
boxDto
;
return
boxDto
;
}
}
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronApi.java
查看文件 @
467324c
...
@@ -17,7 +17,6 @@ import java.util.List;
...
@@ -17,7 +17,6 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
@Controller
@Controller
@RequestMapping
(
"/rest/api/micron"
)
@Slf4j
@Slf4j
public
class
MicronApi
extends
BaseSmfApiListener
{
public
class
MicronApi
extends
BaseSmfApiListener
{
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/Micron20031Api.java
查看文件 @
467324c
...
@@ -17,6 +17,10 @@ import java.util.*;
...
@@ -17,6 +17,10 @@ import java.util.*;
*/
*/
@Slf4j
@Slf4j
public
class
Micron20031Api
{
public
class
Micron20031Api
{
public
static
String
MODE_DISABLE_SAP
=
"DISABLE_SAP"
;
public
static
String
MODE_DISABLE_MAM
=
"DISABLE_MAM"
;
public
static
String
MODE_DISABLE_MAM_AND_SAP
=
"DISABLE_MAM_AND_SAP"
;
public
static
String
MODE_ENABLE_MAM_SAP
=
"ENABLE_MAM_SAP"
;
private
static
String
AUTH_TOKEN
=
""
;
private
static
String
AUTH_TOKEN
=
""
;
...
@@ -151,19 +155,24 @@ public class Micron20031Api {
...
@@ -151,19 +155,24 @@ public class Micron20031Api {
* //Input: MatReqNo, MaterialType
* //Input: MatReqNo, MaterialType
* //Output: MatReqNo, Micron Part Number, Lot No, Quantity, UnitOfMeasures, MaterialType, Message, Status
* //Output: MatReqNo, Micron Part Number, Lot No, Quantity, UnitOfMeasures, MaterialType, Message, Status
*/
*/
public
static
DepositMatReqBean
getMatReqDetail
(
String
matReqNo
)
throws
ApiException
{
public
static
List
<
DepositMatReqBean
>
getMatReqDetail
(
String
matReqNo
)
throws
ApiException
{
//pnMap的key为pn, value为库存数量
//pnMap的key为pn, value为库存数量
String
getMatReqDetailUrl
=
""
;
String
getMatReqDetailUrl
=
""
;
String
auth
=
getAuthToken
();
String
auth
=
getAuthToken
();
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"MatReqNo"
,
matReqNo
);
dataMap
.
put
(
"MatReqNo"
,
matReqNo
);
dataMap
.
put
(
"MaterialType"
,
MATERIAL_TYPE
);
dataMap
.
put
(
"MaterialType"
,
MATERIAL_TYPE
);
log
.
info
(
"调用MES接口 getMatReqDetail,参数:"
+
JsonUtil
.
toJsonStr
(
dataMap
));
log
.
info
(
"调用MES接口 getMatReqDetail,参数:"
+
JsonUtil
.
toJsonStr
(
dataMap
));
String
resultStr
=
HttpHelper
.
postJsonWithAuth
(
getMatReqDetailUrl
,
dataMap
,
auth
);
String
resultStr
=
HttpHelper
.
postJsonWithAuth
(
getMatReqDetailUrl
,
dataMap
,
auth
);
log
.
info
(
"调用MES接口 getMatReqDetail 返回:"
+
resultStr
);
log
.
info
(
"调用MES接口 getMatReqDetail 返回:"
+
resultStr
);
DepositMatReqBean
depositMatReqBean
=
JsonUtil
.
toObj
(
resultStr
,
DepositMatReqBean
.
class
);
Map
<
String
,
Object
>
resultMap
=
JsonUtil
.
toMap
(
resultStr
);
return
depositMatReqBean
;
List
<
DepositMatReqBean
>
beans
=
new
ArrayList
<>();
if
(
resultMap
.
containsKey
(
"materialDocList"
))
{
beans
=
(
List
<
DepositMatReqBean
>)
resultMap
.
get
(
"materialDocList"
);
}
// DepositMatReqBean depositMatReqBean = JsonUtil.toObj(resultStr,DepositMatReqBean.class);
return
beans
;
}
}
/**
/**
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpApiListener.java
0 → 100644
查看文件 @
467324c
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.core.api.bean.CodeValidateParam
;
import
com.neotel.smfcore.core.api.listener.BaseSmfApiListener
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.inList.enums.INLIST_STATUS
;
import
com.neotel.smfcore.core.inList.service.po.InList
;
import
com.neotel.smfcore.core.inList.util.InListCache
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
javax.swing.text.html.InlineView
;
@Slf4j
public
class
MicronSpApiListener
extends
BaseSmfApiListener
{
@Autowired
private
InListCache
inListCache
;
@Override
public
boolean
isForThisApi
(
String
apiName
)
{
return
false
;
}
@Override
public
Barcode
canPutInAfterResolve
(
String
inCheckUrl
,
CodeValidateParam
params
,
Barcode
barcode
)
throws
ValidateException
{
//判断是否是入库单入库
for
(
Storage
storage
:
params
.
getStorageList
())
{
if
(
ObjectUtil
.
isNotEmpty
(
storage
.
getInListName
()))
{
//如果入库单还在执行中,验证是否可以入库
InList
inList
=
inListCache
.
getInList
(
storage
.
getInListName
());
if
(
inList
.
getStatus
()
<
INLIST_STATUS
.
WAIT
)
{
try
{
Barcode
resultBarcode
=
Micron20031Api
.
depositCreateMA
(
barcode
,
params
.
getLoginUser
());
if
(
resultBarcode
!=
null
){
return
resultBarcode
;
}
}
catch
(
ApiException
apiException
)
{
log
.
error
(
"MicronSpApiListener canPutInAfterResolve depositCreateMA error: "
+
apiException
.
getMessage
());
return
null
;
}
}
//普通入库验证 调用return
try
{
Barcode
resultBarcode
=
Micron20031Api
.
returnMaterial
(
barcode
,
Micron20031Api
.
MODE_ENABLE_MAM_SAP
,
params
.
getLoginUser
());
if
(
resultBarcode
!=
null
){
return
resultBarcode
;
}
}
catch
(
ApiException
apiException
)
{
log
.
error
(
"MicronSpApiListener canPutInAfterResolve returnMaterial error: "
+
apiException
.
getMessage
());
return
null
;
}
}
}
return
null
;
}
}
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpController.java
查看文件 @
467324c
...
@@ -53,6 +53,10 @@ public class MicronSpController {
...
@@ -53,6 +53,10 @@ public class MicronSpController {
Integer
used
=
0
;
Integer
used
=
0
;
if
(
pos
.
isUsed
())
{
if
(
pos
.
isUsed
())
{
used
=
1
;
used
=
1
;
boolean
AuthoriseNg
=
pos
.
getBarcode
().
getAppendData
(
"AuthoriseNg"
)
;
if
(
AuthoriseNg
){
used
=
2
;
}
}
}
// used=1;
// used=1;
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpLoadController.java
0 → 100644
查看文件 @
467324c
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.inList.rest.bean.dto.InListDto
;
import
com.neotel.smfcore.core.inList.rest.bean.mapstruct.InListMapper
;
import
com.neotel.smfcore.core.inList.service.manager.IInListManager
;
import
com.neotel.smfcore.core.inList.service.po.InList
;
import
com.neotel.smfcore.core.inList.service.po.InListItem
;
import
com.neotel.smfcore.core.inList.util.InListCache
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.service.manager.IStorageManager
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.custom.micron20031.bean.DepositMatReqBean
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
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.List
;
@Slf4j
@RestController
@Api
(
tags
=
"20031:load Desposit/Return"
)
@RequestMapping
(
"/rest/micron/sp"
)
public
class
MicronSpLoadController
{
@Autowired
private
InListCache
inListCache
;
@Autowired
private
IInListManager
inListManager
;
@Autowired
private
InListMapper
inListMapper
;
@Autowired
private
IStorageManager
storageManager
;
@Autowired
private
DataCache
dataCache
;
@ApiOperation
(
"获取入库单详情"
)
@GetMapping
(
value
=
"/desposit/getMatReqDetail"
)
public
ResultBean
getMatReqDetail
(
String
matReqNo
)
{
if
(
ObjectUtil
.
isEmpty
(
matReqNo
))
{
return
ResultBean
.
newOkResult
(
null
);
}
try
{
//先查询入库单是否存在
InList
inList
=
inListCache
.
getInList
(
matReqNo
);
if
(
inList
==
null
)
{
List
<
DepositMatReqBean
>
beans
=
Micron20031Api
.
getMatReqDetail
(
matReqNo
);
inList
=
new
InList
();
inList
.
setName
(
matReqNo
);
List
<
InListItem
>
items
=
new
ArrayList
<>();
for
(
DepositMatReqBean
bean
:
beans
)
{
InListItem
item
=
new
InListItem
();
item
.
setPN
(
bean
.
getMicronPN
());
item
.
setNum
(
bean
.
getQuantity
());
item
.
setName
(
matReqNo
);
items
.
add
(
item
);
}
inList
.
setInListItems
(
items
);
log
.
info
(
"load 获取到入库单:"
+
inList
.
getName
()
+
",共"
+
items
.
size
()
+
"条工单详情"
);
inList
=
inListManager
.
createWithItems
(
inList
);
inListCache
.
addInListToMap
(
inList
);
//保存入库单
// return ResultBean.newOkResult(reqBean);
}
InListDto
inListDto
=
inListMapper
.
toDto
(
inList
);
return
ResultBean
.
newOkResult
(
inListDto
);
}
catch
(
ApiException
e
)
{
return
ResultBean
.
newErrorResult
(
1
,
e
.
getMessage
(),
e
.
getMessage
());
}
}
@ApiOperation
(
"开始入库单 入库"
)
@RequestMapping
(
value
=
"/desposit/start"
)
public
ResultBean
startDesposit
(
String
matReqNo
)
{
InList
inList
=
inListCache
.
getInList
(
matReqNo
);
if
(
inList
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
Storage
storage
=
dataCache
.
getOneStorageByType
(
DeviceType
.
AUTO
);
if
(
storage
==
null
)
{
//未找到料仓,无法开始入库
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
inList
.
setStartTime
(
System
.
currentTimeMillis
());
inListManager
.
save
(
inList
);
inListCache
.
addInListToMap
(
inList
);
storage
.
setInListName
(
matReqNo
);
log
.
info
(
"设置料仓["
+
storage
.
getName
()
+
"]的入库单为:["
+
matReqNo
+
"],同时更新入库单开始时间"
);
storageManager
.
save
(
storage
);
dataCache
.
reloadStorage
(
storage
,
storage
.
getCid
());
return
ResultBean
.
newOkResult
(
matReqNo
);
}
@ApiOperation
(
"开始回库 "
)
@RequestMapping
(
value
=
"/return/start"
)
public
ResultBean
startReturn
()
{
Storage
storage
=
dataCache
.
getOneStorageByType
(
DeviceType
.
AUTO
);
if
(
storage
==
null
)
{
//未找到料仓,无法开始入库
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
storage
.
setInListName
(
""
);
log
.
info
(
"设置料仓["
+
storage
.
getName
()
+
"]开始 return "
);
storageManager
.
save
(
storage
);
dataCache
.
reloadStorage
(
storage
,
storage
.
getCid
());
return
ResultBean
.
newOkResult
(
""
);
}
}
src/main/java/com/neotel/smfcore/custom/micron20031/MicronSpUnloadController.java
0 → 100644
查看文件 @
467324c
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
;
import
com.google.common.base.Strings
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.storage.rest.dto.StoragePosDto
;
import
com.neotel.smfcore.core.storage.rest.mapstruct.StoragePosMapper
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.mongodb.core.query.Criteria
;
import
org.springframework.data.mongodb.core.query.Query
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@RestController
@Api
(
tags
=
"20031:Unload Withdraw_new/Withdraw_Offline/Removal"
)
@RequestMapping
(
"/rest/micron/sp"
)
public
class
MicronSpUnloadController
{
@Autowired
private
DataCache
dataCache
;
@Autowired
private
TaskService
taskService
;
@Autowired
private
IStoragePosManager
storagePosManager
;
@Autowired
private
StoragePosMapper
storagePosMapper
;
@ApiOperation
(
"出库:Withdraw Offline GetEquipIDList"
)
@GetMapping
(
value
=
"/unload/offlineIdList"
)
public
ResultBean
getEquipIdList
()
{
try
{
List
<
String
>
equipIdList
=
Micron20031Api
.
getEquipIDList
();
return
ResultBean
.
newOkResult
(
equipIdList
);
}
catch
(
ApiException
e
)
{
return
ResultBean
.
newErrorResult
(
1
,
e
.
getMessage
(),
e
.
getMessage
());
}
}
@ApiOperation
(
"出库:Withdraw Offline GetMicronPN"
)
@GetMapping
(
value
=
"/unload/getMicronPN"
)
public
ResultBean
GetMicronPN
(
String
lotId
,
String
lineId
)
{
try
{
String
pn
=
Micron20031Api
.
getMicronPN
(
lotId
,
lineId
);
//根据PN查找对应的物料,验证成功后返回
Criteria
c
=
Criteria
.
where
(
"used"
).
is
(
true
);
c
.
and
(
"barcode.partNumber"
).
is
(
pn
);
c
.
and
(
"barcode.appendData.AuthoriseNg"
).
ne
(
true
);
List
<
StoragePos
>
posList
=
storagePosManager
.
findByQuery
(
new
Query
(
c
));
for
(
StoragePos
pos
:
posList
)
{
try
{
//验证
Micron20031Api
.
chkAuthoriseToDispatch
(
pos
.
getBarcode
(),
Micron20031Api
.
MODE_ENABLE_MAM_SAP
,
SecurityUtils
.
getCurrentUsername
());
log
.
info
(
"unload/getMicronPN ["
+
pn
+
"] barcode ["
+
pos
.
getBarcode
().
getBarcode
()
+
"] chkAuthoriseToDispatch 成功"
);
StoragePosDto
dto
=
storagePosMapper
.
toDto
(
pos
);
return
ResultBean
.
newOkResult
(
dto
);
}
catch
(
ApiException
ex
)
{
log
.
error
(
"unload/getMicronPN ["
+
pn
+
"] barcode ["
+
pos
.
getBarcode
().
getBarcode
()
+
"] chkAuthoriseToDispatch 失败:"
+
ex
.
toString
());
//需要标记此物料
Barcode
barcode
=
pos
.
getBarcode
();
barcode
.
updateAppendData
(
"AuthoriseNg"
,
true
);
pos
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
pos
);
log
.
info
(
"unload/getMicronPN ["
+
pn
+
"] barcode ["
+
pos
.
getBarcode
().
getBarcode
()
+
"] 标记为NG"
);
}
}
return
ResultBean
.
newOkResult
(
pn
);
}
catch
(
ApiException
e
)
{
return
ResultBean
.
newErrorResult
(
1
,
e
.
getMessage
(),
e
.
getMessage
());
}
}
@ApiOperation
(
"开始出库"
)
@PutMapping
(
"/unload/checkout"
)
public
ResultBean
checkout
(
@RequestBody
Map
<
String
,
String
>
params
)
{
String
posName
=
params
.
get
(
"posName"
);
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
pos
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
==
null
)
{
throw
new
ValidateException
(
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
}
log
.
info
(
"出库料仓【"
+
storage
.
getName
()
+
"_"
+
storage
.
getCid
()
+
"】位置仓位【"
+
pos
.
getPosName
()
+
"】"
);
String
outResult
=
taskService
.
checkout
(
storage
,
pos
,
true
,
SecurityUtils
.
getCurrentUsername
());
if
(!
Strings
.
isNullOrEmpty
(
outResult
))
{
throw
new
ValidateException
(
"smfcore.error"
,
outResult
);
}
return
ResultBean
.
newOkResult
(
""
);
}
}
src/main/java/com/neotel/smfcore/custom/micron20031/bean/OrderInfoDto.java
→
src/main/java/com/neotel/smfcore/custom/micron20031/bean/
dto/
OrderInfoDto.java
查看文件 @
467324c
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
.
bean
;
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
.
bean
.
dto
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/bean/PosInfoDto.java
→
src/main/java/com/neotel/smfcore/custom/micron20031/bean/
dto/
PosInfoDto.java
查看文件 @
467324c
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
.
bean
;
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
.
bean
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/bean/PosRowDto.java
→
src/main/java/com/neotel/smfcore/custom/micron20031/bean/
dto/
PosRowDto.java
查看文件 @
467324c
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
.
bean
;
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
.
bean
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/bean/PosValueInfo.java
→
src/main/java/com/neotel/smfcore/custom/micron20031/bean/
dto/
PosValueInfo.java
查看文件 @
467324c
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
.
bean
;
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
.
bean
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
...
...
src/main/java/com/neotel/smfcore/custom/micron20031/bean/dto/SpUnloadDto.java
0 → 100644
查看文件 @
467324c
package
com
.
neotel
.
smfcore
.
custom
.
micron20031
.
bean
.
dto
;
import
com.neotel.smfcore.core.barcode.rest.bean.dto.BarcodeDto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
SpUnloadDto
{
@ApiModelProperty
(
"库位ID"
)
private
String
id
;
@ApiModelProperty
(
"料仓ID"
)
private
String
storageId
;
@ApiModelProperty
(
"库位号"
)
private
String
posName
;
@ApiModelProperty
(
"条码"
)
private
String
barcode
;
@ApiModelProperty
(
"物料编号"
)
private
String
partNumber
;
@ApiModelProperty
(
"数量"
)
private
int
num
;
@ApiModelProperty
(
"出库结果,默认1=成功,0=失败"
)
private
int
unloadState
=
1
;
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论