Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 70a19b7d
由
LN
编写于
2022-02-10 13:07:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
工单出库暂不更改条码数量。增加屏蔽库位接口。
1 个父辈
6175b16c
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
52 行增加
和
21 行删除
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
70a19b7
package
com
.
neotel
.
smfcore
.
core
.
device
.
rest
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.google.common.base.Strings
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
...
...
@@ -11,6 +12,8 @@ import com.neotel.smfcore.common.utils.Constants;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.storage.service.dao.IStoragePosDao
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.dao.IAlarmInfoDao
;
import
com.neotel.smfcore.core.system.service.po.AlarmInfo
;
...
...
@@ -49,6 +52,9 @@ public class DeviceController {
@Autowired
private
CodeResolve
codeResolve
;
@Autowired
private
IStoragePosManager
storagePosManager
;
private
Map
<
String
,
IDeviceHandler
>
handlerMap
=
new
HashMap
<>();
public
DeviceController
(
List
<
IDeviceHandler
>
deviceHandlerList
)
{
...
...
@@ -356,4 +362,29 @@ public class DeviceController {
return
ResultBean
.
newErrorResult
(
2005
,
"smfcore.cancelOutTask.fail"
,
"客户端取消入库任务[{0}]失败:{1}"
,
new
String
[]{
codeStr
,
""
});
}
@ApiOperation
(
"屏蔽库位"
)
@RequestMapping
(
value
=
"/service/store/disabledPos"
)
@ResponseBody
@AnonymousAccess
public
ResultBean
disabledPos
(
HttpServletRequest
request
)
{
String
posId
=
request
.
getParameter
(
"posId"
);
String
barcode
=
request
.
getParameter
(
"barcode"
);
if
(
ObjectUtil
.
isEmpty
(
posId
))
{
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"posId"
});
}
if
(
ObjectUtil
.
isEmpty
(
barcode
))
{
barcode
=
""
;
}
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posId
);
if
(
pos
==
null
)
{
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"PosId"
,
posId
});
}
pos
.
setEnabled
(
true
);
storagePosManager
.
save
(
pos
);
log
.
info
(
"屏蔽库位:库位号["
+
pos
.
getId
()
+
"]["
+
pos
.
getPosName
()
+
"]barcode["
+
barcode
+
"]"
);
return
ResultBean
.
newOkResult
(
""
);
}
}
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
70a19b7
...
...
@@ -237,21 +237,21 @@ public class LiteOrderCache implements ITaskListener {
liteOrderItem
.
setTotalOutNum
(
liteOrderItem
.
getTotalOutNum
()+
task
.
getNum
());
liteOrderItem
.
setTotalOutReelCount
(
liteOrderItem
.
getTotalOutReelCount
()+
1
);
liteOrderItem
=
liteOrderItemManager
.
save
(
liteOrderItem
);
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
task
.
getBarcode
());
if
(
barcode
!=
null
)
{
Float
totalNeedNum
=
liteOrderItem
.
getNeedNum
()
*
order
.
getOrderTimes
();
int
barcodeRemainNum
=
liteOrderItem
.
getOutNum
()
-
totalNeedNum
.
intValue
();
if
(
barcodeRemainNum
<
0
)
{
barcodeRemainNum
=
0
;
}
barcode
.
setAmount
(
barcodeRemainNum
);
log
.
info
(
"条码["
+
task
.
getBarcode
()
+
"]从工单出库,更改数量为:"
+
barcodeRemainNum
);
try
{
barcodeManager
.
save
(
barcode
);
}
catch
(
ValidateException
e
)
{
e
.
printStackTrace
();
}
}
//
Barcode barcode = barcodeManager.findByBarcode(task.getBarcode());
//
if (barcode != null) {
//
Float totalNeedNum = liteOrderItem.getNeedNum() * order.getOrderTimes();
//
int barcodeRemainNum = liteOrderItem.getOutNum() - totalNeedNum.intValue();
//
if (barcodeRemainNum < 0) {
//
barcodeRemainNum = 0;
//
}
//
barcode.setAmount(barcodeRemainNum);
//
log.info("条码[" + task.getBarcode() + "]从工单出库,更改数量为:" + barcodeRemainNum);
//
try {
//
barcodeManager.save(barcode);
//
} catch (ValidateException e) {
//
e.printStackTrace();
//
}
//
}
}
items
.
add
(
liteOrderItem
);
}
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
70a19b7
...
...
@@ -65,8 +65,8 @@ public class StoragePosController {
@Autowired
private
final
IStoragePosManager
storagePosManager
;
@Autowired
private
final
IStoragePosDao
storagePosDao
;
//
@Autowired
//
private final IStoragePosDao storagePosDao;
@Autowired
private
final
StoragePosMapper
storagePosMapper
;
@Autowired
...
...
@@ -207,13 +207,13 @@ public class StoragePosController {
if
(
enabledDto
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
StoragePos
pos
=
storagePos
Dao
.
findOneById
(
enabledDto
.
getId
());
StoragePos
pos
=
storagePos
Manager
.
get
(
enabledDto
.
getId
());
if
(
pos
==
null
)
{
throw
new
ValidateException
(
"smfcore.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"PosId"
,
enabledDto
.
getId
()});
// throw new ValidateException("未找到库位 ");
}
pos
.
setEnabled
(
enabledDto
.
isEnabled
());
storagePos
Dao
.
save
(
pos
);
storagePos
Manager
.
save
(
pos
);
log
.
info
(
"启用禁用库位:库位号["
+
pos
.
getId
()
+
"]["
+
pos
.
getPosName
()
+
"]="
+
enabledDto
.
isEnabled
());
return
ResultBean
.
newOkResult
(
""
);
...
...
@@ -230,7 +230,7 @@ public class StoragePosController {
if
(
saveDto
.
getPosName
()
==
null
)
{
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
StoragePos
pos
=
storagePos
Dao
.
findOneById
(
saveDto
.
getId
());
StoragePos
pos
=
storagePos
Manager
.
get
(
saveDto
.
getId
());
if
(
pos
==
null
)
{
throw
new
ValidateException
(
"smfcore.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"PosId"
,
saveDto
.
getId
()});
// throw new ValidateException("未找到库位 ");
...
...
@@ -239,7 +239,7 @@ public class StoragePosController {
pos
.
setPriority
(
saveDto
.
getPriority
());
pos
.
setH
(
saveDto
.
getH
());
pos
.
setW
(
saveDto
.
getW
());
storagePos
Dao
.
save
(
pos
);
storagePos
Manager
.
save
(
pos
);
log
.
info
(
"修改库位:库位号["
+
pos
.
getId
()
+
"]=["
+
saveDto
.
toString
()
+
"]"
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论