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
a0a31f33
Commit
a0a31f33
authored
Aug 08, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add invoice and voucher datasource manually --part3 ---not finished yet
parent
446acf7e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
0 deletions
+54
-0
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+7
-0
ReportService.java
...main/java/pwc/taxtech/atms/vat/service/ReportService.java
+2
-0
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+45
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
a0a31f33
...
...
@@ -93,4 +93,10 @@ public class ReportController {
public
OperationResultDto
<
String
>
getAllDataItems
(
@PathVariable
Integer
dataSourceType
){
return
reportService
.
getAllDataItems
(
dataSourceType
);
}
@RequestMapping
(
value
=
"addDataSourceItems"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
addDataSourceItems
(
@RequestBody
DataSourceDto
dataSource
){
return
reportService
.
addDataSourceItems
(
dataSource
);
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/vat/service/ReportService.java
View file @
a0a31f33
...
...
@@ -39,4 +39,6 @@ public interface ReportService {
OperationResultDto
<
String
>
addDataSource
(
DataSourceDto
datasource
);
OperationResultDto
<
String
>
getAllDataItems
(
Integer
dataSourceType
);
OperationResultDto
addDataSourceItems
(
DataSourceDto
dataSource
);
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
a0a31f33
...
...
@@ -805,6 +805,51 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
return
operationResultDto
;
}
@Override
public
OperationResultDto
addDataSourceItems
(
DataSourceDto
dataSource
)
{
OperationResultDto
operationResultDto
=
new
OperationResultDto
();
if
(
dataSource
.
getItems
()
==
null
||
dataSource
.
getItems
().
isEmpty
())
{
operationResultDto
.
setResultMsg
(
"NoData"
);
operationResultDto
.
setResult
(
false
);
return
operationResultDto
;
}
if
(
dataSource
==
null
||
StringUtils
.
isBlank
(
dataSource
.
getId
()))
{
operationResultDto
.
setResultMsg
(
"DataSourceInvalid"
);
operationResultDto
.
setResult
(
false
);
return
operationResultDto
;
}
DataSource
datasourceEntity
=
dataSourceMapper
.
selectByPrimaryKey
(
Long
.
parseLong
(
dataSource
.
getId
()));
if
(
datasourceEntity
==
null
)
{
operationResultDto
.
setResultMsg
(
"DatasourceInvalid"
);
operationResultDto
.
setResult
(
false
);
return
operationResultDto
;
}
updateCellValueForDataSourceChange
(
datasourceEntity
,
dataSource
.
getAmount
());
dataSourceMapper
.
updateByPrimaryKeySelective
(
datasourceEntity
);
//todo:MarkProjectModelDirty(dataSource.projectID, dataSource.serviceTypeID, dataSource.Updater);
List
<
DataSourceDetail
>
dataSourceItems
=
new
ArrayList
<>();
dataSource
.
getItems
().
forEach
(
a
->
{
DataSourceDetail
dataSourceDetail
=
new
DataSourceDetail
();
dataSourceDetail
.
setId
(
distributedIDService
.
nextId
());
dataSourceDetail
.
setDataSourceId
(
Long
.
parseLong
(
dataSource
.
getId
()));
dataSourceDetail
.
setDataSourceType
(
dataSource
.
getDataSourceType
());
dataSourceDetail
.
setItemValue
(
a
);
dataSourceItems
.
add
(
dataSourceDetail
);
});
DataSourceDetailExample
example
=
new
DataSourceDetailExample
();
example
.
createCriteria
().
andDataSourceIdEqualTo
(
Long
.
parseLong
(
dataSource
.
getId
()));
List
<
DataSourceDetail
>
dataSourceDetailList
=
dataSourceDetailMapper
.
selectByExample
(
example
);
//todo: TBC tomorrow
return
null
;
}
private
void
updateCellValueForDataSourceChange
(
Long
cellDataID
,
BigDecimal
originalAmount
,
BigDecimal
newAmount
)
{
BigDecimal
aValue
=
newAmount
!=
null
?
newAmount
:
new
BigDecimal
(
"0"
);
BigDecimal
bValue
=
originalAmount
!=
null
?
originalAmount
:
new
BigDecimal
(
"0"
);
...
...
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