Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 198a91d6
由
LN
编写于
2022-05-18 17:04:13 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
元器件数量需大于0。
安全库存bug修改。
1 个父辈
0b9c5dd5
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
47 行增加
和
27 行删除
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/service/po/Component.java
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialStockController.java
src/main/java/com/neotel/smfcore/core/storage/rest/dto/SafetyInventoryDto.java
src/main/java/com/neotel/smfcore/core/barcode/rest/ComponentController.java
查看文件 @
198a91d
...
@@ -88,15 +88,15 @@ public class ComponentController {
...
@@ -88,15 +88,15 @@ public class ComponentController {
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()>0 )
{
//
{
if
(
component
.
getMinStoreNum
()<=
component
.
getSafetyStoreNum
()&&
component
.
getSafetyStoreNum
()<=
component
.
getMaxStoreNum
()){
//
if(component.getMinStoreNum()<=component.getSafetyStoreNum()&& component.getSafetyStoreNum()<=component.getMaxStoreNum()){
//
}
else
{
//
}else{
throw
new
ValidateException
(
"smfcore.component.storeError"
,
"请输入正确的库存,最小库存<=安全库存<=最大库存"
);
//
throw new ValidateException("smfcore.component.storeError","请输入正确的库存,最小库存<=安全库存<=最大库存" );
}
//
}
}
//
}
componentManager
.
saveComponent
(
component
);
componentManager
.
saveComponent
(
component
);
// //修改元器件时更新storagePos中的数据
// //修改元器件时更新storagePos中的数据
...
...
src/main/java/com/neotel/smfcore/core/barcode/service/manager/impl/ComponentManagerImpl.java
查看文件 @
198a91d
...
@@ -129,6 +129,21 @@ public class ComponentManagerImpl implements IComponentManager {
...
@@ -129,6 +129,21 @@ 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
.
getMaxStoreNum
()==
0
){
resources
.
setMaxStoreNum
(
999999999
);
}
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
(
""
);
}
}
...
...
src/main/java/com/neotel/smfcore/core/barcode/service/po/Component.java
查看文件 @
198a91d
...
@@ -125,15 +125,15 @@ public class Component extends BasePo implements Serializable {
...
@@ -125,15 +125,15 @@ public class Component extends BasePo implements Serializable {
private
boolean
sizeConfirmed
=
false
;
private
boolean
sizeConfirmed
=
false
;
/**
/**
* 最大库存
* 最大库存
盘数
*/
*/
private
int
maxStoreNum
=
999999999
;
private
int
maxStoreNum
=
999999999
;
/**
/**
* 最小库存
* 最小库存
盘数
*/
*/
private
int
minStoreNum
=
0
;
private
int
minStoreNum
=
0
;
/**
/**
*安全库存
*安全库存
盘数
*/
*/
private
int
safetyStoreNum
=
0
;
private
int
safetyStoreNum
=
0
;
/**
/**
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialStockController.java
查看文件 @
198a91d
...
@@ -147,6 +147,7 @@ public class MaterialStockController {
...
@@ -147,6 +147,7 @@ public class MaterialStockController {
private
List
<
SafetyInventoryDto
>
getSafetyInventoryList
(
SafetyInventoryQueryCriteria
criteria
)
{
private
List
<
SafetyInventoryDto
>
getSafetyInventoryList
(
SafetyInventoryQueryCriteria
criteria
)
{
boolean
needSupplement
=
criteria
.
isNeedSupplement
();
boolean
needSupplement
=
criteria
.
isNeedSupplement
();
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
query
.
addCriteria
(
Criteria
.
where
(
"safetyStoreNum"
).
gt
(
0
));
List
<
Component
>
componentList
=
componentManager
.
findByQuery
(
query
);
List
<
Component
>
componentList
=
componentManager
.
findByQuery
(
query
);
Map
<
String
,
InventoryItem
>
inventoryItemMap
=
dataCache
.
getAllInventory
(
criteria
.
getStorageIdList
(),
criteria
.
getBlurry
());
Map
<
String
,
InventoryItem
>
inventoryItemMap
=
dataCache
.
getAllInventory
(
criteria
.
getStorageIdList
(),
criteria
.
getBlurry
());
...
@@ -164,22 +165,24 @@ public class MaterialStockController {
...
@@ -164,22 +165,24 @@ public class MaterialStockController {
dto
.
setPartNumber
(
com
.
getPartNumber
());
dto
.
setPartNumber
(
com
.
getPartNumber
());
dto
.
setAmount
(
com
.
getAmount
());
dto
.
setAmount
(
com
.
getAmount
());
dto
.
setSupplementReel
(
0
);
dto
.
setSupplementReel
(
0
);
//判断是否需要补充
dto
.
setSafetyStoreNum
(
com
.
getSafetyStoreNum
());
if
(
dto
.
getStockCount
()
<
com
.
getMinStoreNum
())
{
//判断是否需要补充 判断当前盘数是否小于安全盘数
if
(
dto
.
getStockReel
()
<
com
.
getSafetyStoreNum
())
{
if
(
dto
.
getStockReel
()
>
0
&&
dto
.
getStockCount
()
>
0
)
{
//// if (dto.getStockReel() > 0 && dto.getStockCount() > 0) {
int
reelCount
=
dto
.
getStockCount
()
/
dto
.
getStockReel
();
//
//补充盘数
// int reelCount = dto.getStockCount() / dto.getStockReel();
int
needReel
=
(
com
.
getMinStoreNum
()
-
dto
.
getStockCount
())
/
reelCount
;
// //补充盘数
dto
.
setSupplementReel
(
needReel
);
// int needReel = (com.getMinStoreNum() - dto.getStockCount()) / reelCount;
}
else
{
// dto.setSupplementReel(needReel);
int
needReel
=
com
.
getMinStoreNum
()
/
dto
.
getAmount
();
// } else {
dto
.
setSupplementReel
(
needReel
);
// int needReel = com.getMinStoreNum() / dto.getAmount();
}
// dto.setSupplementReel(needReel);
// }
dto
.
setSupplementReel
(
com
.
getMinStoreNum
()
-
dto
.
getStockReel
());
}
}
if
(
needSupplement
)
{
if
(
needSupplement
)
{
if
(
dto
.
getSupplementReel
()
>
0
)
{
if
(
dto
.
getSupplementReel
()
>
0
)
{
results
.
add
(
dto
);
results
.
add
(
dto
);
}
}
}
else
{
}
else
{
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/dto/SafetyInventoryDto.java
查看文件 @
198a91d
...
@@ -45,4 +45,6 @@ public class SafetyInventoryDto implements Serializable {
...
@@ -45,4 +45,6 @@ public class SafetyInventoryDto implements Serializable {
@ApiModelProperty
(
"需要补充盘数"
)
@ApiModelProperty
(
"需要补充盘数"
)
private
int
supplementReel
=
0
;
private
int
supplementReel
=
0
;
@ApiModelProperty
(
"安全库存"
)
private
int
safetyStoreNum
=
0
;
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论