Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
fd1c7e10
Commit
fd1c7e10
authored
Aug 08, 2019
by
季圣华
Browse files
解决序列号的产品销售报错的bug
parent
4c5cea8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
erp_web/js/pages/materials/in_out.js
View file @
fd1c7e10
...
...
@@ -3097,7 +3097,7 @@
if
(
tipInfo
){
if
(
tipInfo
.
code
!=
200
){
$
.
messager
.
alert
(
'
提示
'
,
tipInfo
.
msg
,
'
error
'
);
$
.
messager
.
alert
(
'
提示
'
,
tipInfo
.
msg
,
'
warning
'
);
return
;
}
$
.
messager
.
alert
(
'
提示
'
,
'
保存成功!
'
,
'
info
'
);
...
...
@@ -3146,7 +3146,7 @@
success
:
function
(
tipInfo
){
if
(
tipInfo
){
if
(
tipInfo
.
code
!=
200
){
$
.
messager
.
alert
(
'
提示
'
,
tipInfo
.
msg
,
'
error
'
);
$
.
messager
.
alert
(
'
提示
'
,
tipInfo
.
msg
,
'
warning
'
);
return
;
}
$
.
messager
.
alert
(
'
提示
'
,
'
保存成功!
'
,
'
info
'
);
...
...
src/main/java/com/jsh/erp/service/serialNumber/SerialNumberService.java
View file @
fd1c7e10
...
...
@@ -426,28 +426,19 @@ public class SerialNumberService {
* @return void
*/
public
void
checkAndUpdateSerialNumber
(
DepotItem
depotItem
,
User
userInfo
)
throws
Exception
{
if
(
depotItem
!=
null
){
//查询商品下已分配的可用序列号数量
try
{
int
SerialNumberSum
=
serialNumberMapperEx
.
countSerialNumberByMaterialIdAndDepotheadId
(
depotItem
.
getMaterialid
(),
null
,
BusinessConstants
.
IS_SELL_HOLD
);
//BasicNumber=OperNumber*ratio
if
((
depotItem
.
getBasicnumber
()==
null
?
0
:
depotItem
.
getBasicnumber
()).
intValue
()>
SerialNumberSum
){
//获取商品名称
Material
material
=
materialMapper
.
selectByPrimaryKey
(
depotItem
.
getMaterialid
());
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_CODE
,
String
.
format
(
ExceptionConstants
.
MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_MSG
,
material
==
null
?
""
:
material
.
getName
()));
}
}
catch
(
Exception
e
){
logger
.
error
(
"异常码[{}],异常提示[{}],异常[{}]"
,
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
,
e
);
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DATA_READ_FAIL_CODE
,
ExceptionConstants
.
DATA_READ_FAIL_MSG
);
}
//商品下序列号充足,分配序列号
sellSerialNumber
(
depotItem
.
getMaterialid
(),
depotItem
.
getHeaderid
(),(
depotItem
.
getBasicnumber
()==
null
?
0
:
depotItem
.
getBasicnumber
()).
intValue
(),
userInfo
);
}
if
(
depotItem
!=
null
){
//查询商品下已分配的可用序列号数量
int
SerialNumberSum
=
serialNumberMapperEx
.
countSerialNumberByMaterialIdAndDepotheadId
(
depotItem
.
getMaterialid
(),
null
,
BusinessConstants
.
IS_SELL_HOLD
);
//BasicNumber=OperNumber*ratio
if
((
depotItem
.
getBasicnumber
()==
null
?
0
:
depotItem
.
getBasicnumber
()).
intValue
()>
SerialNumberSum
){
//获取商品名称
Material
material
=
materialMapper
.
selectByPrimaryKey
(
depotItem
.
getMaterialid
());
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_CODE
,
String
.
format
(
ExceptionConstants
.
MATERIAL_SERIAL_NUMBERE_NOT_ENOUGH_MSG
,
material
==
null
?
""
:
material
.
getName
()));
}
//商品下序列号充足,分配序列号
sellSerialNumber
(
depotItem
.
getMaterialid
(),
depotItem
.
getHeaderid
(),(
depotItem
.
getBasicnumber
()==
null
?
0
:
depotItem
.
getBasicnumber
()).
intValue
(),
userInfo
);
}
}
/**
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment