Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
bec57933
Commit
bec57933
authored
Feb 20, 2019
by
Ken you
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test ebs je api ---Ken
parent
b9fcb4da
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
1 deletion
+98
-1
EbsApiController.java
...in/java/pwc/taxtech/atms/controller/EbsApiController.java
+6
-1
EbsApiServiceImplTest.java
.../pwc/taxtech/atms/service/impl/EbsApiServiceImplTest.java
+92
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/EbsApiController.java
View file @
bec57933
...
...
@@ -8,7 +8,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.RestController
;
import
pwc.taxtech.atms.dto.ApiResultDto
;
import
pwc.taxtech.atms.dto.ebsdto.JEqueryDto
;
import
pwc.taxtech.atms.service.EbsApiService
;
import
javax.annotation.Resource
;
import
java.util.Collections
;
import
java.util.List
;
...
...
@@ -17,6 +19,8 @@ import java.util.List;
public
class
EbsApiController
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
EbsApiController
.
class
);
@Resource
private
EbsApiService
ebsApiService
;
@RequestMapping
(
value
=
"/queryRemoteServerThenUpdateJE"
,
method
=
RequestMethod
.
POST
)
public
ApiResultDto
queryRemoteServerThenUpdateJE
(
@RequestBody
List
<
JEqueryDto
>
items
)
{
...
...
@@ -24,7 +28,8 @@ public class EbsApiController {
return
ApiResultDto
.
success
(
Collections
.
emptyList
());
}
try
{
return
ApiResultDto
.
success
(
queryRemoteServerThenUpdateJE
(
items
));
ebsApiService
.
queryRemoteServerThenUpdateJE
(
items
);
return
ApiResultDto
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"queryRemoteServerThenUpdateJE error."
,
e
);
}
...
...
atms-api/src/test/java/pwc/taxtech/atms/service/impl/EbsApiServiceImplTest.java
0 → 100644
View file @
bec57933
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
org.junit.Test
;
import
pwc.taxtech.atms.CommonIT
;
import
pwc.taxtech.atms.dto.ebsdto.JEqueryDto
;
import
pwc.taxtech.atms.service.EbsApiService
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
public
class
EbsApiServiceImplTest
extends
CommonIT
{
@Resource
private
EbsApiService
ebsApiService
;
@Resource
private
DistributedIdService
distributedIdService
;
@Test
public
void
queryRemoteServerThenUpdateJE
(){
List
<
JEqueryDto
>
items
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
10
;
i
++){
JEqueryDto
jEqueryDto
=
new
JEqueryDto
();
jEqueryDto
.
setId
(
distributedIdService
.
nextId
());
jEqueryDto
.
setOrganizationId
(
"44250A49-F3EF-4A1E-89E0-165BB89A94D0"
);
jEqueryDto
.
setProjectId
(
"44250A49-F3EF-4A1E-89E0-165BB89A94D0"
);
jEqueryDto
.
setDate
(
new
Date
());
jEqueryDto
.
setSource
(
"这是哪里"
+
i
);
jEqueryDto
.
setLedgerId
(
"我关联谁"
+
i
);
jEqueryDto
.
setLedgerName
(
"我是谁"
+
i
);
jEqueryDto
.
setCurrencyCode
(
"123"
+
i
);
jEqueryDto
.
setStatus
(
"1"
);
jEqueryDto
.
setHeaderId
(
"123456789"
);
jEqueryDto
.
setLineNum
(
"1"
);
jEqueryDto
.
setApprovalStatus
(
"1"
);
jEqueryDto
.
setPostedStatus
(
"1"
);
jEqueryDto
.
setPeriod
(
0
);
jEqueryDto
.
setAccountingDate
(
new
Date
());
jEqueryDto
.
setJournalSource
(
"setJournalSource"
);
jEqueryDto
.
setCategory
(
"setCategory"
);
jEqueryDto
.
setName
(
"setName"
);
jEqueryDto
.
setVoucherNum
(
"setVoucherNum"
);
jEqueryDto
.
setDescription
(
"setDescription"
);
jEqueryDto
.
setSegment1
(
"setSegment1"
);
jEqueryDto
.
setSegment2
(
"setSegment2"
);
jEqueryDto
.
setSegment3
(
""
);
jEqueryDto
.
setSegment4
(
""
);
jEqueryDto
.
setSegment5
(
""
);
jEqueryDto
.
setSegment6
(
""
);
jEqueryDto
.
setSegment7
(
""
);
jEqueryDto
.
setSegment8
(
""
);
jEqueryDto
.
setSegment9
(
""
);
jEqueryDto
.
setSegment10
(
""
);
jEqueryDto
.
setSegment1Name
(
""
);
jEqueryDto
.
setSegment2Name
(
""
);
jEqueryDto
.
setSegment3Name
(
""
);
jEqueryDto
.
setSegment4Name
(
""
);
jEqueryDto
.
setSegment5Name
(
""
);
jEqueryDto
.
setSegment6Name
(
""
);
jEqueryDto
.
setSegment7Name
(
""
);
jEqueryDto
.
setSegment8Name
(
""
);
jEqueryDto
.
setSegment9Name
(
""
);
jEqueryDto
.
setSegment10Name
(
""
);
jEqueryDto
.
setJournalCurrencyCode
(
""
);
jEqueryDto
.
setSobCurrencyCode
(
""
);
jEqueryDto
.
setAccountedDr
(
new
BigDecimal
(
"0"
));
jEqueryDto
.
setAccountedCr
(
new
BigDecimal
(
"0"
));
jEqueryDto
.
setEnteredDr
(
new
BigDecimal
(
"0"
));
jEqueryDto
.
setEnteredCr
(
new
BigDecimal
(
"0"
));
jEqueryDto
.
setCfItem
(
""
);
jEqueryDto
.
setAttribute1
(
""
);
jEqueryDto
.
setAttribute2
(
new
Date
());
jEqueryDto
.
setAttribute3
(
""
);
jEqueryDto
.
setAttribute4
(
""
);
jEqueryDto
.
setAttribute5
(
""
);
jEqueryDto
.
setAttribute6
(
""
);
jEqueryDto
.
setAttribute7
(
""
);
jEqueryDto
.
setAttribute8
(
""
);
jEqueryDto
.
setAttribute9
(
""
);
jEqueryDto
.
setAttribute10
(
""
);
jEqueryDto
.
setAttribute11
(
""
);
jEqueryDto
.
setAttribute12
(
""
);
jEqueryDto
.
setAttribute13
(
""
);
jEqueryDto
.
setAttribute14
(
""
);
jEqueryDto
.
setAttribute15
(
""
);
jEqueryDto
.
setAttribute16
(
""
);
items
.
add
(
jEqueryDto
);
}
ebsApiService
.
queryRemoteServerThenUpdateJE
(
items
);
}
}
\ No newline at end of file
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