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
3dfd1bb9
Commit
3dfd1bb9
authored
Nov 21, 2018
by
eddie.woo
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
0ebd6219
b8504a11
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
193 additions
and
36 deletions
+193
-36
InputInvoiceImportController.java
...taxtech/atms/controller/InputInvoiceImportController.java
+1
-1
OutputInvoiceController.java
.../pwc/taxtech/atms/controller/OutputInvoiceController.java
+5
-4
OutputVATInvoiceInfoDto.java
.../pwc/taxtech/atms/dto/vatdto/OutputVATInvoiceInfoDto.java
+9
-9
TemplateGroupServiceImpl.java
...c/taxtech/atms/service/impl/TemplateGroupServiceImpl.java
+4
-1
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+2
-2
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+1
-1
BB.java
...wc/taxtech/atms/vat/service/impl/report/functions/BB.java
+2
-1
DFFS.java
.../taxtech/atms/vat/service/impl/report/functions/DFFS.java
+10
-7
FunctionBase.java
.../atms/vat/service/impl/report/functions/FunctionBase.java
+6
-3
JFFS.java
.../taxtech/atms/vat/service/impl/report/functions/JFFS.java
+116
-0
PSUM.java
.../taxtech/atms/vat/service/impl/report/functions/PSUM.java
+3
-3
preview-trial-balance.ctrl.js
...trols/preview-trial-balance/preview-trial-balance.ctrl.js
+24
-4
preview-trial-balance.html
...controls/preview-trial-balance/preview-trial-balance.html
+10
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/InputInvoiceImportController.java
View file @
3dfd1bb9
...
...
@@ -156,7 +156,7 @@ public class InputInvoiceImportController {
inputInvoiceDetailExportDto
.
setAmount
(
inputInvoiceDetail
.
getJE
()
!=
null
?
new
BigDecimal
(
inputInvoiceDetail
.
getJE
().
replace
(
","
,
""
))
:
BigDecimal
.
ZERO
);
inputInvoiceDetailExportDto
.
setInvoiceCode
(
inputInvoiceDetail
.
getFPDM
());
inputInvoiceDetailExportDto
.
setInvoiceNumber
(
inputInvoiceDetail
.
getFPHM
());
inputInvoiceDetailExportDto
.
setPeriodId
(
Integer
.
parseInt
(
item
.
getRZS
J
().
substring
(
5
,
7
)));
inputInvoiceDetailExportDto
.
setPeriodId
(
Integer
.
parseInt
(
item
.
getRZS
Q
().
substring
(
4
,
6
)));
inputInvoiceDetailExportDto
.
setProductionName
(
inputInvoiceDetail
.
getSPMC
());
inputInvoiceDetailExportDto
.
setTaxAmount
(
inputInvoiceDetail
.
getSE
()
!=
null
?
new
BigDecimal
(
inputInvoiceDetail
.
getSE
().
replace
(
","
,
""
))
:
BigDecimal
.
ZERO
);
inputInvoiceDetailExportDto
.
setTaxRate
(
inputInvoiceDetail
.
getSLV
());
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/OutputInvoiceController.java
View file @
3dfd1bb9
...
...
@@ -104,6 +104,7 @@ public class OutputInvoiceController {
new
pwc
.
taxtech
.
atms
.
dto
.
vatdto
.
OutputVATInvoiceInfoDto
();
d
=
beanUtil
.
copyProperties
(
x
,
d
);
d
.
setInvoiceTypeName
(
d
.
getInvoiceTypeName
());
d
.
setTaxRate
(
x
.
getTaxRate
().
toString
()
+
"%"
);
list2
.
add
(
d
);
});
Map
<
String
,
String
>
header
=
new
LinkedHashMap
<>();
...
...
@@ -117,13 +118,13 @@ public class OutputInvoiceController {
header
.
put
(
"InvoiceDate"
,
"开票日期"
);
// header.put("CodeVersion", "商品编码版本号");
// header.put("DocumentNum", "单据号");
//
header.put("ProductName", "商品名称");
header
.
put
(
"ProductName"
,
"商品名称"
);
// header.put("ProductStandar", "规格");
// header.put("Unit", "单位");
//
header.put("Quantity", "数量");
//
header.put("UnitPrice", "单价");
header
.
put
(
"Quantity"
,
"数量"
);
header
.
put
(
"UnitPrice"
,
"单价"
);
header
.
put
(
"Amount"
,
"金额"
);
//
header.put("TaxRate", "税率");
header
.
put
(
"TaxRate"
,
"税率"
);
header
.
put
(
"TaxAmount"
,
"税额"
);
// header.put("TaxClassCode", "税收分类编码");
...
...
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/OutputVATInvoiceInfoDto.java
View file @
3dfd1bb9
...
...
@@ -30,7 +30,7 @@ public class OutputVATInvoiceInfoDto {
private
Date
invoiceDate
;
// @ExcelCell(index=9)
private
String
codeVersion
;
// @ExcelCell(index=11
)
@ExcelCell
(
index
=
7
)
private
String
productName
;
// @ExcelCell(index=10)
private
String
documentNum
;
...
...
@@ -38,15 +38,15 @@ public class OutputVATInvoiceInfoDto {
private
String
productStandard
;
// @ExcelCell(index=13)
private
String
unit
;
// @ExcelCell(index=14
)
@ExcelCell
(
index
=
8
)
private
Integer
quantity
;
// @ExcelCell(index=15
)
@ExcelCell
(
index
=
9
)
private
Double
unitPrice
;
@ExcelCell
(
index
=
7
)
@ExcelCell
(
index
=
10
)
private
BigDecimal
amount
;
// @ExcelCell(index=17
)
private
BigDecimal
taxRate
;
@ExcelCell
(
index
=
8
)
@ExcelCell
(
index
=
11
)
private
String
taxRate
;
@ExcelCell
(
index
=
12
)
private
BigDecimal
taxAmount
;
private
String
taxClassCode
;
@JsonProperty
(
"periodID"
)
...
...
@@ -194,11 +194,11 @@ public class OutputVATInvoiceInfoDto {
this
.
amount
=
amount
;
}
public
BigDecimal
getTaxRate
()
{
public
String
getTaxRate
()
{
return
taxRate
;
}
public
void
setTaxRate
(
BigDecimal
taxRate
)
{
public
void
setTaxRate
(
String
taxRate
)
{
this
.
taxRate
=
taxRate
;
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TemplateGroupServiceImpl.java
View file @
3dfd1bb9
...
...
@@ -212,7 +212,7 @@ public class TemplateGroupServiceImpl extends AbstractService {
templateGroupMapper
.
insertSelective
(
templateGroup
);
for
(
int
i
=
0
;
i
<
workbook
.
getNumberOfSheets
();
i
++)
{
String
sheetName
=
workbook
.
getSheetName
(
i
);
if
(!
templateGroupDto
.
getSheetNameList
()
.
contains
(
sheetName
)){
if
(!
sheetNameList
.
contains
(
sheetName
)){
continue
;
}
String
newName
=
sheetName
+
CommonUtils
.
getUUID
()
+
POIUtil
.
getFileSuffix
(
fileName
).
get
();
...
...
@@ -347,6 +347,9 @@ public class TemplateGroupServiceImpl extends AbstractService {
int
length
=
templateMapper
.
selectByExample
(
t
).
size
();
for
(
int
i
=
0
;
i
<
workbook
.
getNumberOfSheets
();
i
++)
{
String
sheetName
=
workbook
.
getSheetName
(
i
);
if
(!
sheetNameList
.
contains
(
sheetName
)){
continue
;
}
String
newName
=
sheetName
+
CommonUtils
.
getUUID
()
+
POIUtil
.
getFileSuffix
(
fileName
).
get
();
Sheet
sheet
=
workbook
.
getSheetAt
(
i
);
Optional
<
Workbook
>
optional
=
POIUtil
.
cloneNewSheet
(
sheet
,
fileName
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
3dfd1bb9
...
...
@@ -518,8 +518,8 @@ public class ReportGeneratorImpl {
public
void
addFunctionsAndContext
(
Workbook
workbook
,
String
[]
functions
,
FormulaContext
formulaContext
)
{
FreeRefFunction
[]
functionImpls
=
{
new
SGSR
(
formulaContext
),
new
FSJZ
(
formulaContext
),
new
ND
(
formulaContext
),
new
BB
(
formulaContext
),
new
XXFP
(
formulaContext
),
new
GZSD
(
formulaContext
),
new
ProjectContext
(
formulaContext
)
,
new
JXFPMX
(
formulaContext
),
new
JXFP
(
formulaContext
),
new
PSUM
(
formulaContext
)
,
new
DFFS
(
formulaContext
),
new
WPSR
(
formulaContext
)};
,
new
JXFPMX
(
formulaContext
),
new
JXFP
(
formulaContext
),
new
PSUM
(
formulaContext
)
,
new
DFFS
(
formulaContext
),
new
JFFS
(
formulaContext
),
new
WPSR
(
formulaContext
)};
UDFFinder
udfs
=
new
DefaultUDFFinder
(
functions
,
functionImpls
);
UDFFinder
udfToolpack
=
new
AggregatingUDFFinder
(
udfs
);
workbook
.
addToolPack
(
udfToolpack
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
3dfd1bb9
...
...
@@ -51,7 +51,7 @@ public class ReportServiceImpl {
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
ReportServiceImpl
.
class
);
private
BlockingQueue
<
PeriodJob
>
queue
=
new
LinkedBlockingQueue
<>();
private
final
static
String
[]
functions
=
{
"SGSR"
,
"FSJZ"
,
"ND"
,
"BB"
,
"XXFP"
,
"GZSD"
,
"ProjectContext"
,
"JXFPMX"
,
"JXFP"
,
"PSUM"
,
"DFFS"
,
"WPSR"
};
"JXFP"
,
"PSUM"
,
"DFFS"
,
"JFFS"
,
"WPSR"
};
@Autowired
private
ReportGeneratorImpl
reportGenerator
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/BB.java
View file @
3dfd1bb9
...
...
@@ -95,7 +95,8 @@ public class BB extends FunctionBase implements FreeRefFunction {
return
returnEval
;
}
else
if
(
bo
.
getPeriod
().
intValue
()
==
0
)
{
cellValue
=
getCellValue
(
ec
,
formulaContext
,
agent
,
bo
.
getRowIndex
()
-
1
,
bo
.
getColumnIndex
()
-
1
,
int
index
=
ec
.
getWorkbook
().
getSheetIndex
(
bo
.
getReportCode
());
cellValue
=
getCellValue
(
index
,
ec
,
formulaContext
,
agent
,
bo
.
getRowIndex
()
-
1
,
bo
.
getColumnIndex
()
-
1
,
Long
.
parseLong
(
cellTemplateData
.
getCellTemplateId
()));
nullCellDto
.
extractFromGroup
(
bo
,
formulaContext
.
getPeriod
(),
formulaContext
.
getYear
(),
cellTemplateData
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/DFFS.java
View file @
3dfd1bb9
...
...
@@ -53,12 +53,11 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
period
=
FormulaHelper
.
getPeriod
(
period
,
yearOffset
,
formulaContext
);
String
orgId
=
formulaContext
.
getOrganizationId
();
year
=
year
+
yearOffset
;
Date
date
=
DateUtils
.
strToDate
(
year
+
"-"
+
period
+
"-"
+
15
);
List
<
ReportCellDataSourceDto
>
dataSource
=
Lists
.
newArrayList
();
if
(
type
==
0
){
EnterpriseAccountSetOrgExample
example
=
new
EnterpriseAccountSetOrgExample
();
example
.
createCriteria
().
andEffectiveDateLessThanOrEqualTo
(
date
).
andExpiredDateGreaterThanOrEqualTo
(
date
).
andOrganizationIdEqualTo
(
orgId
);
example
.
createCriteria
().
andEffectiveDateLessThanOrEqualTo
(
DateUtils
.
getNow
()).
andExpiredDateGreaterThanOrEqualTo
(
DateUtils
.
getNow
()
).
andOrganizationIdEqualTo
(
orgId
);
List
<
EnterpriseAccountSetOrg
>
enterpriseAccountSetOrgs
=
SpringContextUtil
.
enterpriseAccountSetOrgMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
enterpriseAccountSetOrgs
)){
return
NumberEval
.
ZERO
;
...
...
@@ -69,7 +68,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
double
result
=
0
;
for
(
AccountMapping
a
:
accountMappings
){
result
+=
count
(
a
.
getEnterpriseAccountCode
(),
dataSource
,
period
);
result
+=
count
(
a
.
getEnterpriseAccountCode
(),
dataSource
,
period
,
year
);
}
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
...
...
@@ -79,7 +78,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
return
new
NumberEval
(
result
);
}
else
if
(
type
==
1
){
double
result
=
count
(
code
,
dataSource
,
period
);
double
result
=
count
(
code
,
dataSource
,
period
,
year
);
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
new
BigDecimal
(
result
),
period
,
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
...
...
@@ -90,10 +89,14 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
return
NumberEval
.
ZERO
;
}
private
double
count
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
){
private
String
periodName
(
int
period
,
int
year
){
return
year
+
"-"
+
(
period
>
9
?
period
:
(
"0"
+
period
));
}
private
double
count
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
){
GlBalanceExample
glBalanceExample
=
new
GlBalanceExample
();
GlBalanceExample
.
Criteria
c1
=
glBalanceExample
.
createCriteria
().
andSegment3EqualTo
(
code
);
GlBalanceExample
.
Criteria
c2
=
glBalanceExample
.
createCriteria
().
andSegment4EqualTo
(
code
);
GlBalanceExample
.
Criteria
c1
=
glBalanceExample
.
createCriteria
().
andSegment3EqualTo
(
code
)
.
andPeriodNameEqualTo
(
periodName
(
period
,
year
))
;
GlBalanceExample
.
Criteria
c2
=
glBalanceExample
.
createCriteria
().
andSegment4EqualTo
(
code
)
.
andPeriodNameEqualTo
(
periodName
(
period
,
year
))
;
glBalanceExample
.
or
(
c2
);
List
<
GlBalance
>
list
=
SpringContextUtil
.
glBalanceMapper
.
selectByExample
(
glBalanceExample
);
if
(
CollectionUtils
.
isEmpty
(
list
)){
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FunctionBase.java
View file @
3dfd1bb9
...
...
@@ -191,12 +191,12 @@ public class FunctionBase {
SpringContextUtil
.
periodFormulaBlockMapper
.
insertSelective
(
periodFormulaBlock
);
}
public
static
BigDecimal
getCellValue
(
OperationEvaluationContext
ec
,
FormulaContext
formulaContext
,
FormulaAgent
agent
,
public
static
BigDecimal
getCellValue
(
int
index
,
OperationEvaluationContext
ec
,
FormulaContext
formulaContext
,
FormulaAgent
agent
,
int
rowIndex
,
int
columnIndex
,
Long
cellTemplateId
)
throws
NoSuchFieldException
,
IllegalAccessException
{
Field
evaluatorField
=
OperationEvaluationContext
.
class
.
getDeclaredField
(
"_bookEvaluator"
);
evaluatorField
.
setAccessible
(
true
);
WorkbookEvaluator
evaluator
=
(
WorkbookEvaluator
)
evaluatorField
.
get
(
ec
);
ValueEval
eval
=
evaluator
.
evaluate
(
ec
.
getWorkbook
().
getSheet
(
ec
.
getSheetIndex
()
).
getCell
(
rowIndex
,
columnIndex
));
ValueEval
eval
=
evaluator
.
evaluate
(
ec
.
getWorkbook
().
getSheet
(
index
).
getCell
(
rowIndex
,
columnIndex
));
List
<
PeriodDataSource
>
dss
=
agent
.
queryManualDataSource
(
cellTemplateId
,
formulaContext
.
getProjectId
(),
formulaContext
.
getPeriod
());
...
...
@@ -208,8 +208,11 @@ public class FunctionBase {
String
evalStr
=
OperandResolver
.
coerceValueToString
(
eval
);
LOGGER
.
debug
(
"[Formula_debug] eval other cell value {}"
,
evalStr
);
try
{
BigDecimal
bigDecimal
=
new
BigDecimal
(
evalStr
);
if
(!
dss
.
isEmpty
())
{
return
new
BigDecimal
(
evalStr
).
add
(
dss
.
get
(
0
).
getAmount
());
return
bigDecimal
.
add
(
dss
.
get
(
0
).
getAmount
());
}
else
{
return
bigDecimal
;
}
}
catch
(
Exception
e
)
{
if
(!
dss
.
isEmpty
())
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/JFFS.java
0 → 100644
View file @
3dfd1bb9
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
.
report
.
functions
;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.poi.ss.formula.OperationEvaluationContext
;
import
org.apache.poi.ss.formula.eval.NumberEval
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
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.constant.Constant
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType
;
import
pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto
;
import
pwc.taxtech.atms.entity.AccountMapping
;
import
pwc.taxtech.atms.entity.AccountMappingExample
;
import
pwc.taxtech.atms.entity.EnterpriseAccountSetOrg
;
import
pwc.taxtech.atms.entity.EnterpriseAccountSetOrgExample
;
import
pwc.taxtech.atms.vat.entity.GlBalance
;
import
pwc.taxtech.atms.vat.entity.GlBalanceExample
;
import
java.math.BigDecimal
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.stream.Collectors
;
public
class
JFFS
extends
FunctionBase
implements
FreeRefFunction
{
public
JFFS
(
FormulaContext
formulaContext
)
{
super
(
formulaContext
);
}
@Override
public
ValueEval
evaluate
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
{
if
(
args
.
length
<
4
)
{
return
null
;
}
int
type
=
getIntParam
(
args
[
0
],
ec
);
String
code
=
getStringParam
(
args
[
1
],
ec
);
int
year
=
getIntParam
(
args
[
2
],
ec
);
int
period
=
getIntParam
(
args
[
3
],
ec
);
String
formulaExpression
=
"JFFS("
+
type
+
",\""
+
code
+
"\","
+
year
+
","
+
period
+
")"
;
logger
.
debug
(
formulaExpression
);
year
=
getYear
(
year
);
Integer
yearOffset
=
0
;
period
=
FormulaHelper
.
getPeriod
(
period
,
yearOffset
,
formulaContext
);
String
orgId
=
formulaContext
.
getOrganizationId
();
year
=
year
+
yearOffset
;
List
<
ReportCellDataSourceDto
>
dataSource
=
Lists
.
newArrayList
();
if
(
type
==
0
){
EnterpriseAccountSetOrgExample
example
=
new
EnterpriseAccountSetOrgExample
();
example
.
createCriteria
().
andEffectiveDateLessThanOrEqualTo
(
DateUtils
.
getNow
()).
andExpiredDateGreaterThanOrEqualTo
(
DateUtils
.
getNow
()).
andOrganizationIdEqualTo
(
orgId
);
List
<
EnterpriseAccountSetOrg
>
enterpriseAccountSetOrgs
=
SpringContextUtil
.
enterpriseAccountSetOrgMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
enterpriseAccountSetOrgs
)){
return
NumberEval
.
ZERO
;
}
AccountMappingExample
accountMappingExample
=
new
AccountMappingExample
();
accountMappingExample
.
createCriteria
().
andOrganizationIdEqualTo
(
orgId
).
andEnterpriseAccountSetIdEqualTo
(
enterpriseAccountSetOrgs
.
get
(
0
).
getEnterpriseAccountSetId
());
List
<
AccountMapping
>
accountMappings
=
SpringContextUtil
.
accountMappingMapper
.
selectByExample
(
accountMappingExample
);
double
result
=
0
;
for
(
AccountMapping
a
:
accountMappings
){
result
+=
count
(
a
.
getEnterpriseAccountCode
(),
dataSource
,
period
,
year
);
}
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
new
BigDecimal
(
result
),
period
,
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
result
),
dataSoureId
,
formulaContext
.
getProjectId
());
return
new
NumberEval
(
result
);
}
else
if
(
type
==
1
){
double
result
=
count
(
code
,
dataSource
,
period
,
year
);
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
new
BigDecimal
(
result
),
period
,
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
result
),
dataSoureId
,
formulaContext
.
getProjectId
());
return
new
NumberEval
(
result
);
}
return
NumberEval
.
ZERO
;
}
private
String
periodName
(
int
period
,
int
year
){
return
year
+
"-"
+
(
period
>
9
?
period
:
(
"0"
+
period
));
}
private
double
count
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
){
GlBalanceExample
glBalanceExample
=
new
GlBalanceExample
();
GlBalanceExample
.
Criteria
c1
=
glBalanceExample
.
createCriteria
().
andSegment3EqualTo
(
code
).
andPeriodNameEqualTo
(
periodName
(
period
,
year
));
GlBalanceExample
.
Criteria
c2
=
glBalanceExample
.
createCriteria
().
andSegment4EqualTo
(
code
).
andPeriodNameEqualTo
(
periodName
(
period
,
year
));
glBalanceExample
.
or
(
c2
);
List
<
GlBalance
>
list
=
SpringContextUtil
.
glBalanceMapper
.
selectByExample
(
glBalanceExample
);
if
(
CollectionUtils
.
isEmpty
(
list
)){
return
0.0
;
}
List
<
GlBalance
>
temp
=
list
.
stream
().
filter
(
x
->
code
.
equalsIgnoreCase
(
x
.
getSegment3
())).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
temp
)){
temp
=
list
;
}
for
(
GlBalance
glBalance
:
temp
){
ReportCellDataSourceDto
dto
=
new
ReportCellDataSourceDto
();
dto
.
setAmount
(
glBalance
.
getPtdDr
());
dto
.
setPeriod
(
period
);
dto
.
setIsOnlyManualInput
(
Boolean
.
FALSE
);
dto
.
setName
(
Constant
.
DataSourceName
.
ReportDataSource
);
contain
.
add
(
dto
);
}
return
temp
.
stream
().
mapToDouble
(
a
->
a
.
getPtdDr
().
doubleValue
()).
sum
();
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/PSUM.java
View file @
3dfd1bb9
...
...
@@ -72,7 +72,7 @@ public class PSUM extends FunctionBase implements FreeRefFunction {
MyAsserts
.
assertNotEmpty
(
cellTemplateDataList
,
Exceptions
.
PSUM_CELL_TEMP_NULL
);
CellTemplatePerGroupDto
cellTemplateData
=
cellTemplateDataList
.
get
(
0
);
BigDecimal
cellValue
=
getCellValue
(
ec
,
formulaContext
,
agent
,
pCell
.
rowIndex
-
1
,
pCell
.
columnIndex
-
1
,
BigDecimal
cellValue
=
getCellValue
(
ec
.
getSheetIndex
(),
ec
,
formulaContext
,
agent
,
pCell
.
rowIndex
-
1
,
pCell
.
columnIndex
-
1
,
Long
.
parseLong
(
cellTemplateData
.
getCellTemplateId
()));
ReportCellDataSourceDto
dto
=
new
ReportCellDataSourceDto
();
dto
.
fixedWithGroup
(
cellTemplateData
);
...
...
@@ -82,8 +82,8 @@ public class PSUM extends FunctionBase implements FreeRefFunction {
dto
.
setProjectId
(
formulaContext
.
getProjectId
());
dto
.
setRowIndex
(
pCell
.
rowIndex
-
1
);
dto
.
setColumnIndex
(
pCell
.
columnIndex
-
1
);
dto
.
setColumnName
((
pCell
.
columnIndex
-
1
)+
"列"
);
dto
.
setRowName
((
pCell
.
rowIndex
-
1
)+
"行"
);
dto
.
setColumnName
((
pCell
.
columnIndex
)+
"列"
);
dto
.
setRowName
((
pCell
.
rowIndex
)+
"行"
);
dto
.
setReportName
(
ec
.
getWorkbook
().
getSheetName
(
ec
.
getSheetIndex
()));
dto
.
setType
(
FormulaDataSourceType
.
Report
.
getCode
());
...
...
atms-web/src/main/webapp/app/common/controls/preview-trial-balance/preview-trial-balance.ctrl.js
View file @
3dfd1bb9
...
...
@@ -6,8 +6,15 @@
$scope
.
startDate
=
new
Date
(
$scope
.
project
.
year
,
0
,
1
);
$scope
.
endDate
=
new
Date
(
$scope
.
project
.
year
,
11
,
31
);
$scope
.
dateFormat
=
$translate
.
instant
(
'dateFormat4YearMonthDay'
);
$scope
.
isReadOnly
=
false
;
$scope
.
isReadOnly
=
false
;
$scope
.
totalBegDebitBal
=
0
;
$scope
.
totalBegCreditBal
=
0
;
$scope
.
totalDebitBal
=
0
;
$scope
.
totalCreditBal
=
0
;
$scope
.
totalEndDebitBal
=
0
;
$scope
.
totalEndCreditBal
=
0
;
var
minDate
=
[
1
,
$scope
.
project
.
year
];
var
maxDate
=
[
12
,
$scope
.
project
.
year
];
var
setDate
=
[
...
...
@@ -116,7 +123,7 @@
//************ EXCEL EXPORT FUNCTION ***************/
$scope
.
$on
(
'ngRepeatFinished'
,
function
(
ngRepeatFinishedEvent
)
{
if
(
$scope
.
isToPrint
)
export_table_to_excel
(
'exportTable'
,
'
GL
'
,
'xlsx'
,
''
);
export_table_to_excel
(
'exportTable'
,
'
试算平衡表
'
,
'xlsx'
,
''
);
$scope
.
isToPrint
=
false
;
});
...
...
@@ -149,7 +156,20 @@
if
(
isExportOnly
!==
null
&&
isExportOnly
)
{
$scope
.
exportDataList
=
newTree
;
_
.
each
(
$scope
.
exportDataList
,
function
(
exportData
){
if
(
exportData
.
begDebitBal
&&
parseFloat
(
exportData
.
begDebitBal
.
replace
(
/,/g
,
""
)).
toString
()
!=
"NaN"
)
$scope
.
totalBegDebitBal
+=
parseFloat
(
exportData
.
begDebitBal
.
replace
(
/,/g
,
""
));
if
(
exportData
.
begCreditBal
&&
parseFloat
(
exportData
.
begCreditBal
.
replace
(
/,/g
,
""
)).
toString
()
!=
"NaN"
)
$scope
.
totalBegCreditBal
+=
parseFloat
(
exportData
.
begCreditBal
.
replace
(
/,/g
,
""
));
if
(
exportData
.
debitBal
&&
parseFloat
(
exportData
.
debitBal
.
replace
(
/,/g
,
""
)).
toString
()
!=
"NaN"
)
$scope
.
totalDebitBal
+=
parseFloat
(
exportData
.
debitBal
.
replace
(
/,/g
,
""
));
if
(
exportData
.
creditBal
&&
parseFloat
(
exportData
.
creditBal
.
replace
(
/,/g
,
""
)).
toString
()
!=
"NaN"
)
$scope
.
totalCreditBal
+=
parseFloat
(
exportData
.
creditBal
.
replace
(
/,/g
,
""
));
if
(
exportData
.
endDebitBal
&&
parseFloat
(
exportData
.
endDebitBal
.
replace
(
/,/g
,
""
)).
toString
()
!=
"NaN"
)
$scope
.
totalEndDebitBal
+=
parseFloat
(
exportData
.
endDebitBal
.
replace
(
/,/g
,
""
));
if
(
exportData
.
endCreditBal
&&
parseFloat
(
exportData
.
endCreditBal
.
replace
(
/,/g
,
""
)).
toString
()
!=
"NaN"
)
$scope
.
totalEndCreditBal
+=
parseFloat
(
exportData
.
endCreditBal
.
replace
(
/,/g
,
""
));
})
}
else
{
$scope
.
gridOptions
.
data
=
newTree
;
...
...
atms-web/src/main/webapp/app/common/controls/preview-trial-balance/preview-trial-balance.html
View file @
3dfd1bb9
...
...
@@ -108,6 +108,16 @@
<td>
{{exportData.endDebitBal}}
</td>
<td>
{{exportData.endCreditBal}}
</td>
</tr>
<tr>
<td></td>
<td></td>
<td>
{{totalBegDebitBal}}
</td>
<td>
{{totalBegCreditBal}}
</td>
<td>
{{totalDebitBal}}
</td>
<td>
{{totalCreditBal}}
</td>
<td>
{{totalEndDebitBal}}
</td>
<td>
{{totalEndCreditBal}}
</td>
</tr>
</table>
</div>
<!--For Export ONLY-->
...
...
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