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
17dc2517
Commit
17dc2517
authored
Jul 08, 2019
by
曲欣红
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
0019039d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
37 deletions
+109
-37
PriceListService.java
src/main/java/com/egolm/sso/service/PriceListService.java
+11
-0
MaterialMasterServiceImpl.java
...com/egolm/sso/service/impl/MaterialMasterServiceImpl.java
+11
-37
PriceListServiceImpl.java
...java/com/egolm/sso/service/impl/PriceListServiceImpl.java
+28
-0
DateUtil.java
src/main/java/com/egolm/sso/util/DateUtil.java
+43
-0
StringUtil.java
src/main/java/com/egolm/sso/util/StringUtil.java
+16
-0
No files found.
src/main/java/com/egolm/sso/service/PriceListService.java
0 → 100644
View file @
17dc2517
package
com
.
egolm
.
sso
.
service
;
import
javax.jws.WebMethod
;
import
javax.jws.WebService
;
@WebService
(
targetNamespace
=
"http://service.sso.egolm.com"
)
public
interface
PriceListService
{
@WebMethod
public
void
execute
(
String
xml
);
}
src/main/java/com/egolm/sso/service/impl/MaterialMasterServiceImpl.java
View file @
17dc2517
package
com
.
egolm
.
sso
.
service
.
impl
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
...
...
@@ -22,6 +20,8 @@ import org.springframework.stereotype.Component;
import
com.alibaba.fastjson.JSON
;
import
com.egolm.sso.service.CommonService
;
import
com.egolm.sso.service.MaterialMasterService
;
import
com.egolm.sso.util.DateUtil
;
import
com.egolm.sso.util.StringUtil
;
@Component
@WebService
(
serviceName
=
"MaterialMasterService"
,
targetNamespace
=
"http://service.sso.egolm.com"
,
endpointInterface
=
"com.egolm.sso.service.MaterialMasterService"
)
...
...
@@ -33,10 +33,6 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
@Autowired
CommonService
common
;
private
static
DateFormat
datef
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
private
static
DateFormat
datetimef
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
private
static
DateFormat
timef
=
new
SimpleDateFormat
(
"HHmmss"
);
@Override
public
void
execute
(
String
xml
)
{
System
.
out
.
println
(
common
.
getNextval
(
"Test"
));
...
...
@@ -44,13 +40,11 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
Element
record
=
getRecordElement
(
xml
);
Map
<
String
,
String
>
header
=
new
HashMap
<>();
Element
headerSending
=
record
.
element
(
"HEADER_SENDING"
);
String
DIS_CODE
=
headerSending
.
elementText
(
"KUNNR"
);
String
DATUM
=
headerSending
.
elementText
(
"DATUM"
);
String
UZEIT
=
headerSending
.
elementText
(
"UZEIT"
);
List
<
Map
<
String
,
String
>>
items
=
new
ArrayList
<>();
List
<
Element
>
itemList
=
record
.
elements
(
"ITEM"
);
...
...
@@ -66,8 +60,8 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
/***************header**************/
goods
.
put
(
"DIS_CODE"
,
DIS_CODE
);
goods
.
put
(
"DATUM"
,
datef
.
parse
(
DATUM
));
goods
.
put
(
"UZEIT"
,
timef
.
parse
(
UZEIT
)
);
goods
.
put
(
"DATUM"
,
DateUtil
.
parseDate
(
DATUM
,
DateUtil
.
FMT_DATE
));
goods
.
put
(
"UZEIT"
,
DateUtil
.
parseDate
(
UZEIT
,
DateUtil
.
FMT_TIME
)
/*timef.parse(UZEIT)*/
);
/***************header**************/
/***************item**************/
...
...
@@ -76,8 +70,8 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
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
(
"CREATION_DATE"
,
DateUtil
.
parseDate
(
element
.
elementText
(
"ERSDA"
),
DateUtil
.
FMT_DATE
));
goods
.
put
(
"LAST_CHANGE_DATE"
,
DateUtil
.
parseDate
(
element
.
elementText
(
"LAEDA"
),
DateUtil
.
FMT_DATE
));
goods
.
put
(
"GOODS_NAME"
,
element
.
elementText
(
"NORMT"
));
goods
.
put
(
"VMSTA"
,
element
.
elementText
(
"VMSTA"
));
goods
.
put
(
"STKTYP"
,
element
.
elementText
(
"STKTYP"
));
...
...
@@ -119,10 +113,10 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
String
BATCH
=
(
String
)
goods
.
get
(
"BATCH"
);
if
(
BATCH
==
null
||
""
.
equals
(
BATCH
.
trim
()))
{
BATCH
=
datef
.
format
(
new
Date
())+
"-1"
;
BATCH
=
DateUtil
.
formatDate
(
new
Date
(),
DateUtil
.
FMT_DATE
)+
"-1"
/*datef.format(new Date())+"-1"*/
;
}
else
{
String
[]
ss
=
BATCH
.
split
(
"-"
);
String
newDate
=
datef
.
format
(
new
Date
()
);
String
newDate
=
DateUtil
.
formatDate
(
new
Date
(),
DateUtil
.
FMT_DATE
);
int
v
=
1
;
if
(
ss
[
0
].
equals
(
newDate
))
{
v
=
Integer
.
valueOf
(
ss
[
1
])+
1
;
...
...
@@ -132,7 +126,7 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
goods
.
put
(
"BATCH"
,
BATCH
);
goods
.
put
(
"SEND_STATUS"
,
"N"
);
goods
.
put
(
"UPDATED"
,
datetimef
.
format
(
new
Date
())
);
goods
.
put
(
"UPDATED"
,
DateUtil
.
formatDate
(
new
Date
(),
DateUtil
.
FMT_DATE_TIME
)
/*datetimef.format(new Date())*/
);
System
.
out
.
println
(
JSON
.
toJSONString
(
goods
));
...
...
@@ -163,19 +157,15 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
sql
=
sql
.
substring
(
0
,
sql
.
length
()-
2
);
sql
=
sql
+
" where ID = ?"
;
args
.
add
(
goods
.
get
(
"ID"
));
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
+
1
,
5
);
String
ID
=
System
.
currentTimeMillis
()
+
StringUtil
.
prependZero
(
count
+
1
,
5
);
goods
.
put
(
"ID"
,
ID
);
goods
.
put
(
"CREATED"
,
datetimef
.
format
(
new
Date
())
);
goods
.
put
(
"CREATED"
,
DateUtil
.
formatDate
(
new
Date
(),
DateUtil
.
FMT_DATE_TIME
)
/*datetimef.format(new Date())*/
);
goods
.
put
(
"CREATEDBY"
,
""
);
...
...
@@ -191,25 +181,9 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
fieldSql
=
fieldSql
.
substring
(
0
,
fieldSql
.
length
()-
2
);
valuesSql
=
valuesSql
.
substring
(
0
,
valuesSql
.
length
()-
2
);
insertSql
=
insertSql
+
fieldSql
+
") values "
+
valuesSql
+
")"
;
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
)
{
return
prependZero
(
Num
+
""
,
length
);
}
private
String
prependZero
(
String
Num
,
int
length
)
{
String
prepend
=
""
;
for
(
int
i
=
Num
.
length
();
i
<
length
;
i
++)
{
prepend
=
prepend
+
"0"
;
}
return
prepend
+
Num
;
}
private
Map
<
String
,
Object
>
getGoods
(
String
DIS_CODE
,
String
GOODS_CODE
){
String
sql
=
"select * from t_ven_goods where DIS_CODE = ? and GOODS_CODE = ?"
;
List
<
Map
<
String
,
Object
>>
list
=
jdbcTemplate
.
queryForList
(
sql
,
DIS_CODE
,
GOODS_CODE
);
...
...
src/main/java/com/egolm/sso/service/impl/PriceListServiceImpl.java
0 → 100644
View file @
17dc2517
package
com
.
egolm
.
sso
.
service
.
impl
;
import
javax.jws.WebService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Component
;
import
com.egolm.sso.service.CommonService
;
import
com.egolm.sso.service.PriceListService
;
@Component
@WebService
(
serviceName
=
"PriceListService"
,
targetNamespace
=
"http://service.sso.egolm.com"
,
endpointInterface
=
"com.egolm.sso.service.PriceListService"
)
public
class
PriceListServiceImpl
implements
PriceListService
{
@Autowired
JdbcTemplate
jdbcTemplate
;
@Autowired
CommonService
common
;
@Override
public
void
execute
(
String
xml
)
{
// TODO Auto-generated method stub
}
}
src/main/java/com/egolm/sso/util/DateUtil.java
0 → 100644
View file @
17dc2517
package
com
.
egolm
.
sso
.
util
;
import
java.text.DateFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.Map
;
public
class
DateUtil
{
public
static
Map
<
String
,
DateFormat
>
fmtMap
;
public
static
final
String
FMT_DATE
=
"yyyyMMdd"
;
public
static
final
String
FMT_TIME
=
"HHmmss"
;
public
static
final
String
FMT_DATE_TIME
=
"yyyy-MM-dd HH:mm:ss"
;
public
static
String
formatDate
(
Date
d
,
String
fmt
)
{
DateFormat
df
=
getFmt
(
fmt
);
return
formatDate
(
d
,
df
);
}
public
static
String
formatDate
(
Date
d
,
DateFormat
fmt
)
{
return
fmt
.
format
(
d
);
}
public
static
Date
parseDate
(
String
d
,
String
fmt
)
throws
ParseException
{
DateFormat
df
=
getFmt
(
fmt
);
return
parseDate
(
d
,
df
);
}
public
static
Date
parseDate
(
String
d
,
DateFormat
fmt
)
throws
ParseException
{
return
fmt
.
parse
(
d
);
}
public
static
DateFormat
getFmt
(
String
fmt
)
{
DateFormat
df
=
fmtMap
.
get
(
fmt
);
if
(
df
==
null
)
{
df
=
new
SimpleDateFormat
(
fmt
);
}
return
df
;
}
}
src/main/java/com/egolm/sso/util/StringUtil.java
0 → 100644
View file @
17dc2517
package
com
.
egolm
.
sso
.
util
;
public
class
StringUtil
{
public
static
String
prependZero
(
int
Num
,
int
length
)
{
return
prependZero
(
Num
+
""
,
length
);
}
public
static
String
prependZero
(
String
Num
,
int
length
)
{
String
prepend
=
""
;
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