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
181bf10f
Commit
181bf10f
authored
Oct 12, 2018
by
sherlock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JXFPMX
parent
5bf4ee74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
60 deletions
+64
-60
JXFPMX.java
...axtech/atms/vat/service/impl/report/functions/JXFPMX.java
+25
-19
InputInvoiceMapper.java
...ain/java/pwc/taxtech/atms/invoice/InputInvoiceMapper.java
+4
-0
InputInvoiceExtendsMapper.xml
...axtech/atms/invoice/extends/InputInvoiceExtendsMapper.xml
+35
-41
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/JXFPMX.java
View file @
181bf10f
...
@@ -5,20 +5,18 @@ import org.apache.poi.ss.formula.OperationEvaluationContext;
...
@@ -5,20 +5,18 @@ import org.apache.poi.ss.formula.OperationEvaluationContext;
import
org.apache.poi.ss.formula.eval.NumberEval
;
import
org.apache.poi.ss.formula.eval.NumberEval
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
import
pwc.taxtech.atms.common.util.DateUtils
;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
import
pwc.taxtech.atms.constant.Constant
;
import
pwc.taxtech.atms.constant.Constant
;
import
pwc.taxtech.atms.constant.enums.EnumOperationType
;
import
pwc.taxtech.atms.constant.enums.EnumOperationType
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType
;
import
pwc.taxtech.atms.constant.enums.KeyValueConfigResultType
;
import
pwc.taxtech.atms.constant.enums.KeyValueConfigResultType
;
import
pwc.taxtech.atms.dto.vatdto.InputInvoiceDetailDataSourceDto
;
import
pwc.taxtech.atms.dto.vatdto.InputInvoiceDetailDataSourceDto
;
import
pwc.taxtech.atms.vat.dpo.InputInvoiceResultDto
;
import
pwc.taxtech.atms.vat.dpo.InputVATInvoiceResultDto
;
import
pwc.taxtech.atms.vat.dpo.InputVATInvoiceResultDto
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -84,44 +82,45 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
...
@@ -84,44 +82,45 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
}
}
String
dbName
=
SpringContextUtil
.
projectDao
.
getDbNameWithYearAndOrgId
(
formulaContext
.
getOrganizationId
(),
curYear
);
String
dbName
=
SpringContextUtil
.
projectDao
.
getDbNameWithYearAndOrgId
(
formulaContext
.
getOrganizationId
(),
curYear
);
List
<
InputVATInvoiceResultDto
>
inputInvoice
=
SpringContextUtil
.
inputVatInvoiceMapper
.
getInputVATInvoiceResultDto
(
dbName
);
// List<InputVATInvoiceResultDto> inputInvoice = SpringContextUtil.inputVatInvoiceMapper.getInputVATInvoiceResultDto(dbName);
List
<
InputInvoiceResultDto
>
inputInvoice
=
SpringContextUtil
.
inputInvoiceMapper
.
getInputInvoiceResultDto
();
if
(!
goodsName
.
equals
(
"99"
))
{
if
(!
goodsName
.
equals
(
"99"
))
{
inputInvoice
=
inputInvoice
.
stream
()
inputInvoice
=
inputInvoice
.
stream
()
.
filter
(
a
->
a
.
get
GoodsMapping
()
!=
null
&&
a
.
getGoodsMapping
().
getStdGoodsName
()
!=
null
&&
a
.
getGoodsMapping
().
getStdGoodsName
().
equals
(
goodsName
))
.
filter
(
a
->
a
.
get
InputInvoiceDetail
()
!=
null
&&
StringUtils
.
isNotBlank
(
goodsName
)
&&
goodsName
.
equals
(
a
.
getInputInvoiceDetail
().
getSPMC
()
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
if
(
taxRateVal
.
compareTo
(
new
BigDecimal
(
"-1"
))
==
0
)
{
if
(
taxRateVal
.
compareTo
(
new
BigDecimal
(
"-1"
))
==
0
)
{
inputInvoice
=
inputInvoice
.
stream
()
inputInvoice
=
inputInvoice
.
stream
()
.
filter
(
a
->
Arrays
.
asList
(
FunctionBase
.
defaultTaxRates
).
contains
(
a
.
getInputVATInvoiceItem
().
getTaxRate
(
)))
.
filter
(
a
->
Arrays
.
asList
(
FunctionBase
.
defaultTaxRates
).
contains
(
new
BigDecimal
(
a
.
getInputInvoiceDetail
().
getSLV
()
)))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
else
if
(
taxRateVal
.
compareTo
(
new
BigDecimal
(
"99"
))
!=
0
)
{
}
else
if
(
taxRateVal
.
compareTo
(
new
BigDecimal
(
"99"
))
!=
0
)
{
BigDecimal
finalTaxRateVal
=
taxRateVal
;
BigDecimal
finalTaxRateVal
=
taxRateVal
;
inputInvoice
=
inputInvoice
.
stream
()
inputInvoice
=
inputInvoice
.
stream
()
.
filter
(
a
->
a
.
getInputVATInvoiceItem
().
getTaxRate
(
).
equals
(
finalTaxRateVal
))
.
filter
(
a
->
new
BigDecimal
(
a
.
getInputInvoiceDetail
().
getSLV
()
).
equals
(
finalTaxRateVal
))
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
if
(
period
!=
99
)
{
if
(
period
!=
99
)
{
int
finalPeriod
=
period
;
int
finalPeriod
=
period
;
inputInvoice
=
inputInvoice
.
stream
()
inputInvoice
=
inputInvoice
.
stream
()
.
filter
(
a
->
a
.
getInputVATInvoice
().
getPeriodId
(
)
==
finalPeriod
)
.
filter
(
a
->
getPeriodFromDate
(
a
.
getInputInvoice
().
getRZSJ
()
)
==
finalPeriod
)
.
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
}
}
List
<
InputInvoiceDetailDataSourceDto
>
dataSouce
=
new
ArrayList
<>();
List
<
InputInvoiceDetailDataSourceDto
>
dataSouce
=
new
ArrayList
<>();
for
(
Input
VAT
InvoiceResultDto
x
:
inputInvoice
)
{
for
(
InputInvoiceResultDto
x
:
inputInvoice
)
{
InputInvoiceDetailDataSourceDto
inputInvoiceDetailDataSourceDto
=
new
InputInvoiceDetailDataSourceDto
();
InputInvoiceDetailDataSourceDto
inputInvoiceDetailDataSourceDto
=
new
InputInvoiceDetailDataSourceDto
();
inputInvoiceDetailDataSourceDto
.
setAmount
(
FormulaHelper
.
roundValue
(
x
.
getInputVATInvoiceItem
().
getAmount
(
),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
inputInvoiceDetailDataSourceDto
.
setAmount
(
FormulaHelper
.
roundValue
(
new
BigDecimal
(
x
.
getInputInvoiceDetail
().
getJE
()
),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
inputInvoiceDetailDataSourceDto
.
setResultType
(
KeyValueConfigResultType
.
Accounting
.
getCode
());
inputInvoiceDetailDataSourceDto
.
setResultType
(
KeyValueConfigResultType
.
Accounting
.
getCode
());
inputInvoiceDetailDataSourceDto
.
setTaxAmount
(
FormulaHelper
.
roundValue
(
x
.
getInputVATInvoiceItem
().
getTaxAmount
(
),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
inputInvoiceDetailDataSourceDto
.
setTaxAmount
(
FormulaHelper
.
roundValue
(
new
BigDecimal
(
x
.
getInputInvoiceDetail
().
getSE
()
),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
inputInvoiceDetailDataSourceDto
.
setTaxRate
(
x
.
getInputVATInvoiceItem
().
getTaxRate
(
));
inputInvoiceDetailDataSourceDto
.
setTaxRate
(
new
BigDecimal
(
x
.
getInputInvoiceDetail
().
getSLV
()
));
inputInvoiceDetailDataSourceDto
.
setInvoiceNumber
(
x
.
getInput
VATInvoice
().
getInvoiceNumber
());
inputInvoiceDetailDataSourceDto
.
setInvoiceNumber
(
x
.
getInput
Invoice
().
getFPHM
());
inputInvoiceDetailDataSourceDto
.
setInvoiceDate
(
x
.
getInputVATInvoice
().
getInvoiceDate
(
));
inputInvoiceDetailDataSourceDto
.
setInvoiceDate
(
DateUtils
.
strToDate
(
x
.
getInputInvoice
().
getKPRQ
()
));
inputInvoiceDetailDataSourceDto
.
setInvoiceCode
(
x
.
getInput
VATInvoice
().
getInvoiceCode
());
inputInvoiceDetailDataSourceDto
.
setInvoiceCode
(
x
.
getInput
Invoice
().
getFPDM
());
inputInvoiceDetailDataSourceDto
.
setPeriod
(
x
.
getInputVATInvoice
().
getPeriodId
(
));
inputInvoiceDetailDataSourceDto
.
setPeriod
(
getPeriodFromDate
(
x
.
getInputInvoice
().
getKPRQ
()
));
inputInvoiceDetailDataSourceDto
.
setProductionName
(
x
.
getInput
VATInvoiceItem
().
getProductionName
());
inputInvoiceDetailDataSourceDto
.
setProductionName
(
x
.
getInput
InvoiceDetail
().
getSPMC
());
inputInvoiceDetailDataSourceDto
.
setName
(
Constant
.
DataSourceName
.
InputDetailInvoiceDataSource
);
inputInvoiceDetailDataSourceDto
.
setName
(
Constant
.
DataSourceName
.
InputDetailInvoiceDataSource
);
inputInvoiceDetailDataSourceDto
.
setOperationType
(
EnumOperationType
.
Single
.
getCode
());
inputInvoiceDetailDataSourceDto
.
setOperationType
(
EnumOperationType
.
Single
.
getCode
());
dataSouce
.
add
(
inputInvoiceDetailDataSourceDto
);
dataSouce
.
add
(
inputInvoiceDetailDataSourceDto
);
...
@@ -151,4 +150,11 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
...
@@ -151,4 +150,11 @@ public class JXFPMX extends FunctionBase implements FreeRefFunction {
return
NumberEval
.
ZERO
;
return
NumberEval
.
ZERO
;
}
}
private
int
getPeriodFromDate
(
String
dateStr
){
Date
date
=
DateUtils
.
strToDate
(
dateStr
);
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
return
cal
.
get
(
Calendar
.
MONTH
)
+
1
;
}
}
}
atms-dao/src/main/java/pwc/taxtech/atms/invoice/InputInvoiceMapper.java
View file @
181bf10f
...
@@ -7,6 +7,7 @@ import org.apache.ibatis.session.RowBounds;
...
@@ -7,6 +7,7 @@ import org.apache.ibatis.session.RowBounds;
import
pwc.taxtech.atms.MyVatMapper
;
import
pwc.taxtech.atms.MyVatMapper
;
import
pwc.taxtech.atms.vat.dpo.CellInvoiceDto
;
import
pwc.taxtech.atms.vat.dpo.CellInvoiceDto
;
//import pwc.taxtech.atms.vat.dpo.InputInvoiceItemExtendDto;
//import pwc.taxtech.atms.vat.dpo.InputInvoiceItemExtendDto;
import
pwc.taxtech.atms.vat.dpo.InputInvoiceResultDto
;
import
pwc.taxtech.atms.vat.entity.InputInvoice
;
import
pwc.taxtech.atms.vat.entity.InputInvoice
;
import
pwc.taxtech.atms.vat.entity.InputInvoiceExample
;
import
pwc.taxtech.atms.vat.entity.InputInvoiceExample
;
...
@@ -110,5 +111,7 @@ public interface InputInvoiceMapper extends MyVatMapper {
...
@@ -110,5 +111,7 @@ public interface InputInvoiceMapper extends MyVatMapper {
List
<
CellInvoiceDto
>
selectInputInvoiceWithItem
();
List
<
CellInvoiceDto
>
selectInputInvoiceWithItem
();
List
<
InputInvoiceResultDto
>
getInputInvoiceResultDto
();
// InputInvoiceItemExtendDto selectInvoiceExtendDto(@Param("invoiceItemId") String invoiceItemId);
// InputInvoiceItemExtendDto selectInvoiceExtendDto(@Param("invoiceItemId") String invoiceItemId);
}
}
\ No newline at end of file
atms-dao/src/main/resources/pwc/taxtech/atms/invoice/extends/InputInvoiceExtendsMapper.xml
View file @
181bf10f
...
@@ -136,7 +136,7 @@
...
@@ -136,7 +136,7 @@
</if>
</if>
</select>
</select>
<resultMap
id=
"inputInvoiceResultDto"
type=
"pwc.taxtech.atms.
dto.vatdto.InputVAT
InvoiceResultDto"
>
<resultMap
id=
"inputInvoiceResultDto"
type=
"pwc.taxtech.atms.
vat.dpo.Input
InvoiceResultDto"
>
<id
property=
"invoiceID"
column=
"invoice_id"
/>
<id
property=
"invoiceID"
column=
"invoice_id"
/>
<association
property=
"inputVATInvoice"
javaType=
"pwc.taxtech.atms.vat.entity.InputVatInvoice"
>
<association
property=
"inputVATInvoice"
javaType=
"pwc.taxtech.atms.vat.entity.InputVatInvoice"
>
<id
column=
"ID"
jdbcType=
"VARCHAR"
property=
"id"
/>
<id
column=
"ID"
jdbcType=
"VARCHAR"
property=
"id"
/>
...
@@ -180,54 +180,48 @@
...
@@ -180,54 +180,48 @@
</association>
</association>
</resultMap>
</resultMap>
<select
id=
"getInput
VATInvoiceResultDto"
resultMap=
"inputInvoiceResultDto"
parameterType=
"java.lang.String
"
>
<select
id=
"getInput
InvoiceResultDto"
resultMap=
"inputInvoiceResultDto
"
>
SELECT
SELECT
INPUT_INVOICE.ID AS INVOICE_ID,
INPUT_INVOICE.ID AS INVOICE_ID,
INPUTINVOICE.ID,
INPUTINVOICE.ID,
INPUTINVOICE.PERIOD_ID,
-- INPUTINVOICE.PERIOD_ID,
INPUTINVOICE.INVOICE_CODE,
INPUTINVOICE.FPDM,
INPUTINVOICE.INVOICE_NUMBER,
INPUTINVOICE.FPHM,
INPUTINVOICE.INVOICE_DATE,
INPUTINVOICE.KPRQ,
INPUTINVOICE.SELLER_TAX_NUMBER,
INPUTINVOICE.XFSH,
INPUTVATINVOICE.AMOUNT,
INPUTVATINVOICE.HJJE,
INPUTVATINVOICE.TAX_AMOUNT,
INPUTVATINVOICE.HJSE,
INPUTVATINVOICE.INVOICE_TYPE,
INPUTVATINVOICE.FPLX,
INPUTVATINVOICE.CERTIFICATION_RESULT,
INPUTVATINVOICE.RZJG,
INPUTVATINVOICE.CERTIFICATION_DATE,
INPUTVATINVOICE.RJSJ,
INPUTVATINVOICE.CREATOR_ID,
-- INPUTVATINVOICE.CREATOR_ID,
INPUTVATINVOICE.CREATE_TIME,
INPUTVATINVOICE.CJSJ,
INPUTVATINVOICE.`_S_T_A_T_U_S_`,
-- INPUTVATINVOICE.`_S_T_A_T_U_S_`,
INPUTVATINVOICE.PART_ACCNTED_PERIOD,
-- INPUTVATINVOICE.PART_ACCNTED_PERIOD,
INPUTVATINVOICE.ACCNTED_PERIOD,
-- INPUTVATINVOICE.ACCNTED_PERIOD,
INPUTVATINVOICEITEM.ID,
INPUTINVOICEDETAIL.ID,
INPUTVATINVOICEITEM.INPUT_VAT_INVOICE_ID,
INPUTINVOICEDETAIL.FPID,
INPUTVATINVOICEITEM.PERIOD_ID,
-- INPUTINVOICEDETAIL.PERIOD_ID,
INPUTVATINVOICEITEM.INVOICE_CODE,
INPUTINVOICEDETAIL.FPDM,
INPUTVATINVOICEITEM.INVOICE_NUMBER,
INPUTVATINVOICEITEM.FPHM,
INPUTVATINVOICEITEM.AMOUNT,
INPUTVATINVOICEITEM.JE,
INPUTVATINVOICEITEM.TAX_AMOUNT,
INPUTVATINVOICEITEM.SE,
INPUTVATINVOICEITEM.TAX_RATE,
INPUTVATINVOICEITEM.SLV,
INPUTVATINVOICEITEM.PRODUCTION_NAME,
INPUTVATINVOICEITEM.SPMC,
INPUTVATINVOICEITEM.CREATOR_ID,
-- INPUTVATINVOICEITEM.CREATOR_ID,
INPUTVATINVOICEITEM.CREATE_TIME,
-- INPUTVATINVOICEITEM.CREATE_TIME,
INPUTVATINVOICEITEM.PRODUCTION_CODE,
INPUTVATINVOICEITEM.GGXH
GOODSMAPPING.ID,
GOODSMAPPING.CUST_GOODS_NAME,
GOODSMAPPING.STD_GOODS_NAME,
GOODSMAPPING.CREATOR_ID,
GOODSMAPPING.CREATE_TIME,
GOODSMAPPING.UPDATE_TIME
FROM
FROM
${dbName}.
INPUT_INVOICE INPUTINVOICE
INPUT_INVOICE INPUTINVOICE
JOIN
JOIN
${dbName}.
INPUT_INVOICE_DETAIL INPUTINVOICEDETAIL
INPUT_INVOICE_DETAIL INPUTINVOICEDETAIL
ON
ON
INPUTINVOICE.ID = INPUTINVOICEDETAIL.FPID
INPUTINVOICE.ID = INPUTINVOICEDETAIL.FPID
AND INPUT_INVOICE.PERIOD_ID = INPUTVATINVOICEITEM.PERIOD_ID
AND INPUT_INVOICE.PERIOD_ID = INPUTVATINVOICEITEM.PERIOD_ID
LEFT JOIN
--
LEFT JOIN
${dbName}.INPUT_MATERIAL_ITEM MATERIALITEM
--
${dbName}.INPUT_MATERIAL_ITEM MATERIALITEM
ON
--
ON
INPUTVATINVOICEITEM.PRODUCTION_NAME = MATERIALITEM.CUST_GOODS_NAME
--
INPUTVATINVOICEITEM.PRODUCTION_NAME = MATERIALITEM.CUST_GOODS_NAME
</select>
</select>
<resultMap
id=
"cellInvoiceDto"
type=
"pwc.taxtech.atms.vat.dpo.CellInvoiceDto"
>
<resultMap
id=
"cellInvoiceDto"
type=
"pwc.taxtech.atms.vat.dpo.CellInvoiceDto"
>
...
...
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