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
6cd19dc9
Commit
6cd19dc9
authored
Aug 16, 2020
by
季圣华
Browse files
优化商品导入模块
parent
619d4cbe
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/com/jsh/erp/service/MaterialExtend/MaterialExtendService.java
View file @
6cd19dc9
...
...
@@ -296,4 +296,17 @@ public class MaterialExtendService {
}
return
list
;
}
@Transactional
(
value
=
"transactionManager"
,
rollbackFor
=
Exception
.
class
)
public
Long
selectIdByMaterialIdAndDefaultFlag
(
Long
materialId
,
String
defaultFlag
)
throws
Exception
{
Long
id
=
0L
;
MaterialExtendExample
example
=
new
MaterialExtendExample
();
example
.
createCriteria
().
andMaterialIdEqualTo
(
materialId
).
andDefaultFlagEqualTo
(
defaultFlag
)
.
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
MaterialExtend
>
list
=
materialExtendMapper
.
selectByExample
(
example
);
if
(
list
!=
null
&&
list
.
size
()>
0
)
{
id
=
list
.
get
(
0
).
getId
();
}
return
id
;
}
}
src/main/java/com/jsh/erp/service/material/MaterialService.java
View file @
6cd19dc9
...
...
@@ -493,7 +493,13 @@ public class MaterialService {
basicMaterialExtend
.
setUpdateTime
(
System
.
currentTimeMillis
());
basicMaterialExtend
.
setCreateSerial
(
user
.
getLoginName
());
basicMaterialExtend
.
setUpdateSerial
(
user
.
getLoginName
());
materialExtendMapper
.
insertSelective
(
basicMaterialExtend
);
Long
meId
=
materialExtendService
.
selectIdByMaterialIdAndDefaultFlag
(
mId
,
"1"
);
if
(
meId
==
0L
){
materialExtendMapper
.
insertSelective
(
basicMaterialExtend
);
}
else
{
basicMaterialExtend
.
setId
(
meId
);
materialExtendMapper
.
updateByPrimaryKeySelective
(
basicMaterialExtend
);
}
}
if
(
StringUtil
.
isExist
(
materialExObj
.
get
(
"other"
)))
{
String
otherStr
=
materialExObj
.
getString
(
"other"
);
...
...
@@ -504,7 +510,13 @@ public class MaterialService {
otherMaterialExtend
.
setUpdateTime
(
System
.
currentTimeMillis
());
otherMaterialExtend
.
setCreateSerial
(
user
.
getLoginName
());
otherMaterialExtend
.
setUpdateSerial
(
user
.
getLoginName
());
materialExtendMapper
.
insertSelective
(
otherMaterialExtend
);
Long
meId
=
materialExtendService
.
selectIdByMaterialIdAndDefaultFlag
(
mId
,
"0"
);
if
(
meId
==
0L
){
materialExtendMapper
.
insertSelective
(
otherMaterialExtend
);
}
else
{
otherMaterialExtend
.
setId
(
meId
);
materialExtendMapper
.
updateByPrimaryKeySelective
(
otherMaterialExtend
);
}
}
//给商品初始化库存
Map
<
Long
,
BigDecimal
>
stockMap
=
m
.
getStockMap
();
...
...
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