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
91b2449a
Commit
91b2449a
authored
Jun 25, 2018
by
frank.xa.zhang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev_frank
parents
e1f4c3ea
4dff5e25
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
2 deletions
+98
-2
CommonUtils.java
...pi/src/main/java/pwc/taxtech/atms/common/CommonUtils.java
+3
-0
VoucherInvoiceMappingController.java
...tech/atms/controller/VoucherInvoiceMappingController.java
+27
-0
CustomsInvoiceServiceImpl.java
...tech/atms/vat/service/impl/CustomsInvoiceServiceImpl.java
+26
-2
VoucherInvoiceMappingServiceImpl.java
...ms/vat/service/impl/VoucherInvoiceMappingServiceImpl.java
+42
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/CommonUtils.java
View file @
91b2449a
package
pwc
.
taxtech
.
atms
.
common
;
import
java.io.IOException
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -151,4 +152,6 @@ public class CommonUtils {
}
return
result
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/VoucherInvoiceMappingController.java
0 → 100644
View file @
91b2449a
package
pwc
.
taxtech
.
atms
.
controller
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
pwc.taxtech.atms.vat.service.impl.VoucherInvoiceMappingServiceImpl
;
@RequestMapping
(
value
=
"api/v1/vimapping"
)
@RestController
public
class
VoucherInvoiceMappingController
{
@Autowired
private
VoucherInvoiceMappingServiceImpl
voucherInvoiceMappingService
;
@RequestMapping
(
value
=
"getvmappings/{period}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseEntity
GetInvoiceMappings
(
@PathVariable
Integer
period
)
{
return
ResponseEntity
.
ok
().
body
(
voucherInvoiceMappingService
.
getVourcherMappings
(
period
));
}
@RequestMapping
(
value
=
"getimappings/{period}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
ResponseEntity
ValidDBVoucherMapping
(
@PathVariable
Integer
period
)
{
return
ResponseEntity
.
ok
().
body
(
voucherInvoiceMappingService
.
getInvoiceMappings
(
period
));
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/CustomsInvoiceServiceImpl.java
View file @
91b2449a
...
...
@@ -2,13 +2,16 @@ package pwc.taxtech.atms.vat.service.impl;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.dto.FieldsMapper
;
import
pwc.taxtech.atms.dto.vatdto.CustomsInvoiceDto
;
import
pwc.taxtech.atms.vat.entity.CustomsInvoice
;
import
pwc.taxtech.atms.vat.entity.CustomsInvoiceExample
;
import
pwc.taxtech.atms.vat.service.CustomsInvoiceService
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
@Service
...
...
@@ -43,8 +46,29 @@ public class CustomsInvoiceServiceImpl extends VatAbstractService implements Cus
@Override
public
List
<
CustomsInvoiceDto
>
getCustomsInvoicesByPeriodId
(
Integer
periodId
)
{
CustomsInvoiceExample
example
=
new
CustomsInvoiceExample
();
// example.createCriteria().andPeriodIdEqualTo(periodId)
example
.
createCriteria
().
andPeriodIdEqualTo
(
periodId
);
return
null
;
List
<
CustomsInvoice
>
result
=
customsInvoiceMapper
.
selectByExample
(
example
);
result
.
sort
(
Comparator
.
comparing
(
CustomsInvoice:
:
getPayNum
));
int
seqNo
=
1
;
List
<
CustomsInvoiceDto
>
dtos
=
new
ArrayList
<>(
result
.
size
());
for
(
CustomsInvoice
ci:
result
){
CustomsInvoiceDto
dto
=
new
CustomsInvoiceDto
();
try
{
FieldsMapper
.
map
(
ci
,
dto
);
dto
.
setSeqNo
(
seqNo
++);
dto
.
setInvoiceAmount
(
ci
.
getInvoiceAmount
().
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
dto
.
setInvoiceTaxAmount
(
ci
.
getInvoiceTaxAmount
().
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
));
}
catch
(
ClassNotFoundException
e
)
{
e
.
printStackTrace
();
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
}
return
dtos
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/VoucherInvoiceMappingServiceImpl.java
0 → 100644
View file @
91b2449a
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.dao.AreaRegionMapper
;
import
pwc.taxtech.atms.vat.dao.InvoiceMappingMapper
;
import
pwc.taxtech.atms.vat.dao.VoucherMappingMapper
;
import
pwc.taxtech.atms.vat.entity.InvoiceMapping
;
import
pwc.taxtech.atms.vat.entity.InvoiceMappingExample
;
import
pwc.taxtech.atms.vat.entity.VoucherMapping
;
import
pwc.taxtech.atms.vat.entity.VoucherMappingExample
;
import
java.util.Comparator
;
import
java.util.List
;
@Service
public
class
VoucherInvoiceMappingServiceImpl
{
@Autowired
private
InvoiceMappingMapper
invoiceMappingMapper
;
@Autowired
private
VoucherMappingMapper
voucherMappingMapper
;
public
List
<
VoucherMapping
>
getVourcherMappings
(
Integer
period
)
{
VoucherMappingExample
example
=
new
VoucherMappingExample
();
example
.
createCriteria
().
andPeriodEqualTo
(
period
);
List
<
VoucherMapping
>
result
=
voucherMappingMapper
.
selectByExample
(
example
);
result
.
sort
(
Comparator
.
comparing
(
invoiceMapping
->
invoiceMapping
.
getTranCode
()
+
"_"
+
invoiceMapping
.
getGroup
()
+
"_"
+
invoiceMapping
.
getItemID
()));
return
result
;
}
public
List
<
InvoiceMapping
>
getInvoiceMappings
(
Integer
period
)
{
InvoiceMappingExample
example
=
new
InvoiceMappingExample
();
example
.
createCriteria
().
andPeriodEqualTo
(
period
);
List
<
InvoiceMapping
>
result
=
invoiceMappingMapper
.
selectByExample
(
example
);
result
.
sort
(
Comparator
.
comparing
(
invoiceMapping
->
invoiceMapping
.
getPeriod
()
+
"_"
+
invoiceMapping
.
getInvoiceCode
()
+
"_"
+
invoiceMapping
.
getInvoiceNumber
()));
return
result
;
}
}
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