Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
sap-service
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
曲欣亮
sap-service
Commits
79d17d8b
Commit
79d17d8b
authored
Aug 13, 2019
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x
parent
0e3dd137
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
38 deletions
+39
-38
CommonService.java
src/main/java/com/egolm/sso/services/CommonService.java
+28
-21
ConfirmQuotationServiceImpl.java
...rvices/confirm_quotation/ConfirmQuotationServiceImpl.java
+1
-2
DNDeletionServiceImpl.java
...egolm/sso/services/dn_deletion/DNDeletionServiceImpl.java
+3
-4
MaterialMasterServiceImpl.java
...o/services/material_master/MaterialMasterServiceImpl.java
+1
-2
PrformaInvoiceServiceImpl.java
...o/services/prforma_invoice/PrformaInvoiceServiceImpl.java
+1
-2
PriceListServiceImpl.java
...m/egolm/sso/services/price_list/PriceListServiceImpl.java
+1
-2
ShippingNotificationServiceImpl.java
...hipping_notfirmation/ShippingNotificationServiceImpl.java
+4
-5
No files found.
src/main/java/com/egolm/sso/services/CommonService.java
View file @
79d17d8b
...
...
@@ -14,8 +14,6 @@ import org.springframework.dao.DuplicateKeyException;
import
org.springframework.dao.EmptyResultDataAccessException
;
import
org.springframework.jdbc.core.JdbcTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.alibaba.fastjson.JSONObject
;
import
com.egolm.sso.SapServiceApplication
;
...
...
@@ -58,11 +56,15 @@ public class CommonService {
public
Long
getNextval
(
String
sName
)
{
CommonService
common
=
SapServiceApplication
.
getBean
(
CommonService
.
class
);
return
common
.
getNextval
BySql
(
sName
);
return
common
.
getNextval
2
(
sName
);
}
@Transactional
(
propagation
=
Propagation
.
NOT_SUPPORTED
)
public
Long
getNextvalBySql
(
String
sName
)
{
public
void
saveApiAccessLog
(
String
METHOD
,
String
ADDRESS
,
String
RESULT
)
{
CommonService
common
=
SapServiceApplication
.
getBean
(
CommonService
.
class
);
common
.
saveApiAccessLog2
(
METHOD
,
ADDRESS
,
RESULT
);
}
private
Long
getNextval2
(
String
sName
)
{
try
{
Map
<
String
,
Object
>
seqMap
=
jdbcTemplate
.
queryForMap
(
"select * from x_sequence where name = ?"
,
sName
);
Integer
id
=
(
Integer
)
seqMap
.
get
(
"id"
);
...
...
@@ -94,22 +96,8 @@ public class CommonService {
}
}
}
public
String
getNextBatch
(
Date
day
,
String
sPrefix
,
String
sName
)
{
String
dateString
=
DateUtil
.
formatDate
(
day
,
"yyyyMMdd"
);
sName
=
sPrefix
+
"_"
+
sName
+
"_"
+
dateString
;
return
dateString
+
"-"
+
this
.
getNextval
(
sName
);
}
public
String
limitByMysql
(
String
sql
,
Page
page
)
{
long
start
=
(
page
.
getIndex
()
-
1
)
*
page
.
getLimit
();
long
limit
=
page
.
getLimit
();
String
limitKeys
=
StringUtil
.
join
(
", as_limit."
,
" order by as_limit."
,
""
,
""
,
page
.
getLimitKey
());
return
"select as_limit.* from ("
+
sql
+
") as_limit"
+
limitKeys
+
" limit "
+
start
+
", "
+
limit
;
}
@Transactional
(
propagation
=
Propagation
.
NOT_SUPPORTED
)
public
void
saveApiAccessLog
(
String
METHOD
,
String
ADDRESS
,
String
RESULT
)
{
private
void
saveApiAccessLog2
(
String
METHOD
,
String
ADDRESS
,
String
RESULT
)
{
Date
now
=
new
Date
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
"ID"
,
Long
.
valueOf
(
System
.
currentTimeMillis
()
+
StringUtil
.
getIndex
(
"T_API_ACCESS_LOG_ID"
)));
...
...
@@ -125,6 +113,25 @@ public class CommonService {
jdbcTemplate
.
update
(
sql
,
objs
);
}
public
String
getNextBatch
(
Date
day
,
String
sPrefix
,
String
sName
)
{
String
dateString
=
DateUtil
.
formatDate
(
day
,
"yyyyMMdd"
);
sName
=
sPrefix
+
"_"
+
sName
+
"_"
+
dateString
;
return
dateString
+
"-"
+
this
.
getNextval
(
sName
);
}
public
String
getNextTrace
(
Date
now
,
String
sPrefix
,
String
sName
)
{
String
dateString
=
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATE
);
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
return
sPrefix
+
timeString
+
this
.
getNextval
(
sName
+
"_"
+
dateString
);
}
public
String
limitByMysql
(
String
sql
,
Page
page
)
{
long
start
=
(
page
.
getIndex
()
-
1
)
*
page
.
getLimit
();
long
limit
=
page
.
getLimit
();
String
limitKeys
=
StringUtil
.
join
(
", as_limit."
,
" order by as_limit."
,
""
,
""
,
page
.
getLimitKey
());
return
"select as_limit.* from ("
+
sql
+
") as_limit"
+
limitKeys
+
" limit "
+
start
+
", "
+
limit
;
}
@Value
(
"${dataTracking.tokenExpireMinute}"
)
private
Long
tokenExpireMinute
;
private
static
String
token
;
...
...
src/main/java/com/egolm/sso/services/confirm_quotation/ConfirmQuotationServiceImpl.java
View file @
79d17d8b
...
...
@@ -53,8 +53,7 @@ public class ConfirmQuotationServiceImpl implements ConfirmQuotationService {
System
.
out
.
println
(
new
Gson
().
toJson
(
Z_MT_SD_008_SO_CONFIRM_QUOTATION
));
Date
now
=
new
Date
();
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
String
dateString
=
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATE
);
String
TRACE_NO
=
"sapsoconfirmquotation"
+
timeString
+
common
.
getNextval
(
"T_SO_CONFIRMACTION_HEADER_TRACE_"
+
dateString
);
String
TRACE_NO
=
common
.
getNextTrace
(
now
,
"sapsoconfirmquotation"
,
"T_SO_CONFIRMACTION_HEADER_TRACE"
);
Long
time
=
now
.
getTime
();
String
KUNNR
=
null
;
String
VBELN
=
null
;
...
...
src/main/java/com/egolm/sso/services/dn_deletion/DNDeletionServiceImpl.java
View file @
79d17d8b
...
...
@@ -17,11 +17,11 @@ import com.egolm.sso.services.CommonService;
import
com.egolm.sso.util.DateUtil
;
import
com.egolm.sso.util.FileUtil
;
import
com.egolm.sso.util.SqlUtil
;
import
com.egolm.sso.util.SqlUtil.Sql
;
import
com.egolm.sso.util.StringUtil
;
import
com.egolm.sso.util.ThrowableUtil
;
import
com.egolm.sso.util.SqlUtil.Sql
;
import
com.google.gson.Gson
;
import
com.egolm.sso.util.XMLUtil
;
import
com.google.gson.Gson
;
@Component
@WebService
(
serviceName
=
"DNDeletionService"
,
targetNamespace
=
"http://dn_deletion.sso.egolm.com"
,
endpointInterface
=
"com.egolm.sso.services.dn_deletion.DNDeletionService"
)
...
...
@@ -47,8 +47,7 @@ public class DNDeletionServiceImpl implements DNDeletionService {
System
.
out
.
println
(
new
Gson
().
toJson
(
DELETED_DOCUMENTS
));
Date
now
=
new
Date
();
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
String
dateString
=
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATE
);
String
TRACE_NO
=
"sapsodndeletion"
+
timeString
+
common
.
getNextval
(
"T_SO_DN_DELETION_TRACE_"
+
dateString
);
String
TRACE_NO
=
common
.
getNextTrace
(
now
,
"sapsodndeletion"
,
"T_SO_DN_DELETION_TRACE"
);
String
apiName
=
"SAP单据删除通知接口"
;
String
apiPath
=
"/dn_deletion"
;
String
traceName
=
"SODNDeletion"
;
...
...
src/main/java/com/egolm/sso/services/material_master/MaterialMasterServiceImpl.java
View file @
79d17d8b
...
...
@@ -50,8 +50,7 @@ public class MaterialMasterServiceImpl implements MaterialMasterService {
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
boolean
isSuccess
=
true
;
System
.
out
.
println
(
new
Gson
().
toJson
(
Z_MT_SD_001_MATERIAL_MASTER
));
String
dateString
=
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATE
);
String
TRACE_NO
=
"sapmaterialmaster"
+
timeString
+
common
.
getNextval
(
"T_VEN_GOODS_TRACE_"
+
dateString
);
String
TRACE_NO
=
common
.
getNextTrace
(
now
,
"sapmaterialmaster"
,
"T_VEN_GOODS_TRACE"
);
String
apiName
=
"SAP物料接口"
;
String
apiPath
=
"/material_master"
;
String
traceName
=
"MaterialMaster"
;
...
...
src/main/java/com/egolm/sso/services/prforma_invoice/PrformaInvoiceServiceImpl.java
View file @
79d17d8b
...
...
@@ -62,8 +62,7 @@ public class PrformaInvoiceServiceImpl implements PrformaInvoiceService {
System
.
out
.
println
(
new
Gson
().
toJson
(
Z_MT_SD_005_PERFORM_INVOICE
));
Date
now
=
new
Date
();
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
String
dateString
=
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATE
);
String
TRACE_NO
=
"sapproformainvoice"
+
timeString
+
common
.
getNextval
(
"T_PERFORM_INVOICE_HEADER_TRACE_"
+
dateString
);
String
TRACE_NO
=
common
.
getNextTrace
(
now
,
"sapproformainvoice"
,
"T_PERFORM_INVOICE_HEADER_TRACE"
);
String
apiName
=
"SAP形式发票接口"
;
String
apiPath
=
"/prforma_invoice"
;
String
traceName
=
"ProFormaInvoice"
;
...
...
src/main/java/com/egolm/sso/services/price_list/PriceListServiceImpl.java
View file @
79d17d8b
...
...
@@ -50,8 +50,7 @@ public class PriceListServiceImpl implements PriceListService {
System
.
out
.
println
(
new
Gson
().
toJson
(
Z_MT_SD_002_PRICE_LIST
));
Date
now
=
new
Date
();
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
String
dateString
=
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATE
);
String
TRACE_NO
=
"sappricelist"
+
timeString
+
common
.
getNextval
(
"T_PRICE_LIST_TRACE_"
+
dateString
);
String
TRACE_NO
=
common
.
getNextTrace
(
now
,
"sappricelist"
,
"T_PRICE_LIST_TRACE"
);
String
apiName
=
"SAP列表价接口"
;
String
apiPath
=
"/price_list"
;
String
traceName
=
"PriceList"
;
...
...
src/main/java/com/egolm/sso/services/shipping_notfirmation/ShippingNotificationServiceImpl.java
View file @
79d17d8b
...
...
@@ -55,10 +55,9 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
boolean
isSuccess
=
true
;
System
.
out
.
println
(
new
Gson
().
toJson
(
Z_MT_SD_007_SHIPPING_NOTFIRMATION_FILE
));
Date
now
=
new
Date
();
Long
timeMillis
=
now
.
getTime
();
String
timeString
=
DateUtil
.
formatDate
(
now
,
"yyyyMMddHHmmssSSS"
);
String
dateString
=
DateUtil
.
formatDate
(
now
,
DateUtil
.
FMT_DATE
);
Long
time
=
now
.
getTime
();
String
TRACE_NO
=
"sapshippingnotification"
+
timeString
+
common
.
getNextval
(
"T_SHIPPING_NOTIFICATION_HEADER_TRACE_"
+
dateString
);
String
TRACE_NO
=
common
.
getNextTrace
(
now
,
"sapshippingnotification"
,
"T_SHIPPING_NOTIFICATION_HEADER_TRACE"
);
String
apiName
=
"SAP发货通知接口"
;
String
apiPath
=
"/shipping_notfirmation"
;
String
traceName
=
"ShippingNotfirmation"
;
...
...
@@ -126,7 +125,7 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
header
.
put
(
"TRACE_NO"
,
TRACE_NO
);
header
.
put
(
"CREATED"
,
now
);
header
.
put
(
"CREATEBY"
,
systemId
);
Long
hID
=
Long
.
valueOf
(
time
+
StringUtil
.
getIndex
(
"T_SHIPPING_NOTIFICATION_HEADER_ID"
));
Long
hID
=
Long
.
valueOf
(
time
Millis
+
StringUtil
.
getIndex
(
"T_SHIPPING_NOTIFICATION_HEADER_ID"
));
header
.
put
(
"ID"
,
hID
);
insertTo
(
header
,
"t_shipping_notification_header"
);
...
...
@@ -134,7 +133,7 @@ public class ShippingNotificationServiceImpl implements ShippingNotificationServ
if
(
ITEMs
!=
null
)
{
for
(
ITEM
ITEM
:
ITEMs
)
{
Map
<
String
,
Object
>
item
=
new
HashMap
<>();
Long
iID
=
Long
.
valueOf
(
time
+
StringUtil
.
getIndex
(
"T_SHIPPING_NOTIFICATION_ITEM_ID"
));
Long
iID
=
Long
.
valueOf
(
time
Millis
+
StringUtil
.
getIndex
(
"T_SHIPPING_NOTIFICATION_ITEM_ID"
));
item
.
put
(
"ID"
,
iID
);
item
.
put
(
"HEADER_ID"
,
hID
);
item
.
put
(
"POSNR"
,
ITEM
.
getPOSNR
());
...
...
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