Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sso
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
sso
Commits
0019039d
Commit
0019039d
authored
Jul 08, 2019
by
曲欣红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
01d1c9f4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
8 deletions
+31
-8
MaterialMasterServiceImpl.java
...com/egolm/sso/service/impl/MaterialMasterServiceImpl.java
+31
-8
No files found.
src/main/java/com/egolm/sso/service/impl/MaterialMasterServiceImpl.java
View file @
0019039d
...
...
@@ -72,17 +72,15 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
/***************item**************/
goods
.
put
(
"GOODS_CODE"
,
GOODS_CODE
);
goods
.
put
(
"ROUGH_WEIGHT"
,
element
.
elementText
(
"BRGEW"
));
goods
.
put
(
"NET_WEIGHT"
,
element
.
elementText
(
"NTGEW"
));
goods
.
put
(
"ROUGH_WEIGHT"
,
Double
.
valueOf
(
element
.
elementText
(
"BRGEW"
)
));
goods
.
put
(
"NET_WEIGHT"
,
Double
.
valueOf
(
element
.
elementText
(
"NTGEW"
)
));
goods
.
put
(
"WETGHT_UNIT"
,
element
.
elementText
(
"GEWEI"
));
goods
.
put
(
"CATEGORY_CODE"
,
element
.
elementText
(
"PLINE"
));
goods
.
put
(
"CREATION_DATE"
,
datef
.
parse
(
element
.
elementText
(
"ERSDA"
)));
goods
.
put
(
"LAST_CHANGE_DATE"
,
datef
.
parse
(
element
.
elementText
(
"LAEDA"
)));
goods
.
put
(
"GOODS_NAME"
,
element
.
elementText
(
"NORMT"
));
goods
.
put
(
"VMSTA"
,
element
.
elementText
(
"VMSTA"
));
goods
.
put
(
"MSTAV"
,
element
.
elementText
(
"MSTAV"
));
goods
.
put
(
"STKTYP"
,
element
.
elementText
(
"STKTYP"
));
goods
.
put
(
"PRODUCTION_LINE_CODE"
,
element
.
elementText
(
"LIFNR"
));
goods
.
put
(
"SPEC"
,
element
.
elementText
(
"UMREZ"
));
/*******************新增字段,样例中没有******************/
...
...
@@ -102,6 +100,21 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
goods
.
put
(
"PUBLIC"
,
element
.
elementText
(
"PUBLIC"
));
goods
.
put
(
"INTERNET"
,
element
.
elementText
(
"INTERNET"
));
/*******************新增字段,样例中没有******************/
/*********************缺*********************/
goods
.
put
(
"CATEGORY_NAME"
,
""
);
goods
.
put
(
"PRODUCTION_LINE_CODE"
,
""
);
goods
.
put
(
"MSTAV"
,
""
);
goods
.
put
(
"BARCODE"
,
""
);
goods
.
put
(
"TAX_RATE"
,
0
);
goods
.
put
(
"PRODUCTION_LINE_NAME"
,
""
);
goods
.
put
(
"GOODS_KEY"
,
""
);
goods
.
put
(
"SEND_TIME"
,
new
Date
());
goods
.
put
(
"DIS_UPDATE_STATUS"
,
"N"
);
/*********************缺*********************/
/*******************不知道填什么**********************/
goods
.
put
(
"UPDATEDBY"
,
""
);
goods
.
put
(
"CREATEDBY"
,
""
);
/*******************不知道填什么**********************/
/***************item**************/
String
BATCH
=
(
String
)
goods
.
get
(
"BATCH"
);
...
...
@@ -121,6 +134,8 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
goods
.
put
(
"SEND_STATUS"
,
"N"
);
goods
.
put
(
"UPDATED"
,
datetimef
.
format
(
new
Date
()));
System
.
out
.
println
(
JSON
.
toJSONString
(
goods
));
if
(
goods
.
get
(
"ID"
)!=
null
)
{
updateGoods
(
goods
);
}
else
{
...
...
@@ -148,13 +163,17 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
sql
=
sql
.
substring
(
0
,
sql
.
length
()-
2
);
sql
=
sql
+
" where ID = ?"
;
args
.
add
(
goods
.
get
(
"ID"
));
jdbcTemplate
.
update
(
sql
,
args
);
System
.
out
.
println
(
"-------------------------------"
);
System
.
out
.
println
(
sql
);
System
.
out
.
println
(
JSON
.
toJSONString
(
args
));
System
.
out
.
println
(
"-------------------------------"
);
jdbcTemplate
.
update
(
sql
,
args
.
toArray
());
}
private
void
insertGoods
(
Map
<
String
,
Object
>
goods
)
{
String
countSql
=
"select count(1) from t_ven_goods"
;
Integer
count
=
jdbcTemplate
.
queryForObject
(
countSql
,
Integer
.
class
);
String
ID
=
System
.
currentTimeMillis
()
+
prependZero
(
count
,
5
);
String
ID
=
System
.
currentTimeMillis
()
+
prependZero
(
count
+
1
,
5
);
goods
.
put
(
"ID"
,
ID
);
goods
.
put
(
"CREATED"
,
datetimef
.
format
(
new
Date
()));
goods
.
put
(
"CREATEDBY"
,
""
);
...
...
@@ -172,7 +191,11 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
fieldSql
=
fieldSql
.
substring
(
0
,
fieldSql
.
length
()-
2
);
valuesSql
=
valuesSql
.
substring
(
0
,
valuesSql
.
length
()-
2
);
insertSql
=
insertSql
+
fieldSql
+
") values "
+
valuesSql
+
")"
;
jdbcTemplate
.
update
(
insertSql
,
values
);
System
.
out
.
println
(
"-------------------------------"
);
System
.
out
.
println
(
insertSql
);
System
.
out
.
println
(
JSON
.
toJSONString
(
values
));
System
.
out
.
println
(
"-------------------------------"
);
jdbcTemplate
.
update
(
insertSql
,
values
.
toArray
());
}
private
String
prependZero
(
int
Num
,
int
length
)
{
...
...
@@ -181,7 +204,7 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
private
String
prependZero
(
String
Num
,
int
length
)
{
String
prepend
=
""
;
for
(
int
i
=
Num
.
length
();
i
<
=
length
;
i
++)
{
for
(
int
i
=
Num
.
length
();
i
<
length
;
i
++)
{
prepend
=
prepend
+
"0"
;
}
return
prepend
+
Num
;
...
...
Write
Preview
Markdown
is supported
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