Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 15045d70
由
LN
编写于
2022-05-18 14:51:44 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
元器件数量需大于0
1 个父辈
7cf932bf
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
11 行删除
src/main/java/com/neotel/smfcore/core/barcode/rest/ComponentController.java
src/main/java/com/neotel/smfcore/core/barcode/service/manager/impl/ComponentManagerImpl.java
src/main/java/com/neotel/smfcore/core/barcode/rest/ComponentController.java
查看文件 @
15045d7
...
@@ -81,6 +81,7 @@ public class ComponentController {
...
@@ -81,6 +81,7 @@ public class ComponentController {
public
ResponseEntity
<
Object
>
create
(
@Validated
@RequestBody
ComponentDto
resources
)
{
public
ResponseEntity
<
Object
>
create
(
@Validated
@RequestBody
ComponentDto
resources
)
{
Component
component
=
componentMapper
.
toEntity
(
resources
);
Component
component
=
componentMapper
.
toEntity
(
resources
);
component
.
setPartNumber
(
component
.
getPartNumber
().
trim
());
component
.
setPartNumber
(
component
.
getPartNumber
().
trim
());
componentManager
.
saveComponent
(
component
);
componentManager
.
saveComponent
(
component
);
return
new
ResponseEntity
<>(
HttpStatus
.
CREATED
);
return
new
ResponseEntity
<>(
HttpStatus
.
CREATED
);
}
}
...
@@ -94,17 +95,6 @@ public class ComponentController {
...
@@ -94,17 +95,6 @@ public class ComponentController {
if
(
component
.
getId
()
==
null
)
{
if
(
component
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
}
//判断最大库存和最小库存
if
(
component
.
getMinStoreNum
()>
0
)
{
if
(
component
.
getMinStoreNum
()<=
component
.
getSafetyStoreNum
()&&
component
.
getSafetyStoreNum
()<=
component
.
getMaxStoreNum
()){
}
else
{
throw
new
ValidateException
(
"smfcore.component.storeError"
,
"请输入正确的库存,最小库存<=安全库存<=最大库存"
);
}
}
componentManager
.
saveComponent
(
component
);
componentManager
.
saveComponent
(
component
);
// //修改元器件时更新storagePos中的数据
// //修改元器件时更新storagePos中的数据
// if(!ObjectUtil.isEmpty(component.getPartNumber()))
// if(!ObjectUtil.isEmpty(component.getPartNumber()))
...
...
src/main/java/com/neotel/smfcore/core/barcode/service/manager/impl/ComponentManagerImpl.java
查看文件 @
15045d7
...
@@ -169,6 +169,18 @@ public class ComponentManagerImpl implements IComponentManager {
...
@@ -169,6 +169,18 @@ public class ComponentManagerImpl implements IComponentManager {
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"partNumber"
}
);
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"partNumber"
}
);
// throw new BadRequestException("料号不能为空");
// throw new BadRequestException("料号不能为空");
}
}
if
(
resources
.
getAmount
()<=
0
){
throw
new
ValidateException
(
"smfcore.component.amount.error"
,
"元器件数量必须大于0"
);
}
//判断最大库存和最小库存
if
(
resources
.
getMinStoreNum
()>
0
)
{
if
(
resources
.
getMinStoreNum
()<=
resources
.
getSafetyStoreNum
()&&
resources
.
getSafetyStoreNum
()<=
resources
.
getMaxStoreNum
()){
}
else
{
throw
new
ValidateException
(
"smfcore.component.storeError"
,
"请输入正确的库存,最小库存<=安全库存<=最大库存"
);
}
}
if
(
resources
.
getProvider
()==
null
){
if
(
resources
.
getProvider
()==
null
){
resources
.
setProvider
(
""
);
resources
.
setProvider
(
""
);
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论