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
def95670
Commit
def95670
authored
Nov 23, 2018
by
neo.wang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_oracle_neo' into 'dev_oracle'
Dev oracle neo See merge request root/atms!207
parents
ebf3c7d4
7e7b44b1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
29 deletions
+16
-29
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+1
-8
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+1
-1
PC.java
...wc/taxtech/atms/vat/service/impl/report/functions/PC.java
+5
-9
PSUM.java
.../taxtech/atms/vat/service/impl/report/functions/PSUM.java
+9
-11
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
def95670
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
;
import
com.google.common.collect.Lists
;
import
jdk.nashorn.internal.runtime.options.Option
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.openxml4j.exceptions.InvalidFormatException
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
...
...
@@ -16,20 +14,16 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
pwc.taxtech.atms.common.POIUtil
;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
import
pwc.taxtech.atms.constant.enums.CellDataSourceType
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceType
;
import
pwc.taxtech.atms.dao.ProjectMapper
;
import
pwc.taxtech.atms.dto.vatdto.CellCalcInfoDto
;
import
pwc.taxtech.atms.dto.vatdto.PeriodResources
;
import
pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto
;
import
pwc.taxtech.atms.exception.Exceptions
;
import
pwc.taxtech.atms.service.impl.DistributedIdService
;
import
pwc.taxtech.atms.service.impl.HttpFileService
;
import
pwc.taxtech.atms.vat.dao.*
;
import
pwc.taxtech.atms.vat.dpo.MergerManaualCellData
;
import
pwc.taxtech.atms.vat.dpo.PeriodCellTemplateConfigExtendDto
;
import
pwc.taxtech.atms.vat.entity.*
;
import
pwc.taxtech.atms.vat.service.impl.report.functions.*
;
...
...
@@ -44,7 +38,6 @@ import java.util.regex.Pattern;
import
java.util.stream.Collectors
;
import
static
pwc
.
taxtech
.
atms
.
common
.
util
.
SpringContextUtil
.
reportMapper
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
EMPTY
;
import
static
pwc
.
taxtech
.
atms
.
dto
.
vatdto
.
WrapPeriodJobDto
.*;
@Component
...
...
@@ -517,7 +510,7 @@ 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
P
rojectContext
(
formulaContext
)
new
BB
(
formulaContext
),
new
XXFP
(
formulaContext
),
new
GZSD
(
formulaContext
),
new
P
C
(
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
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
def95670
...
...
@@ -50,7 +50,7 @@ import static pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto.*;
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"
,
"P
rojectContext
"
,
"JXFPMX"
,
private
final
static
String
[]
functions
=
{
"SGSR"
,
"FSJZ"
,
"ND"
,
"BB"
,
"XXFP"
,
"GZSD"
,
"P
C
"
,
"JXFPMX"
,
"JXFP"
,
"PSUM"
,
"DFFS"
,
"JFFS"
,
"WPSR"
};
@Autowired
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/P
rojectContext
.java
→
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/P
C
.java
View file @
def95670
...
...
@@ -12,8 +12,8 @@ import pwc.taxtech.atms.vat.entity.PeriodReport;
import
java.util.Calendar
;
import
java.util.Date
;
public
class
P
rojectContext
extends
FunctionBase
implements
FreeRefFunction
{
public
P
rojectContext
(
FormulaContext
formulaContext
)
{
public
class
P
C
extends
FunctionBase
implements
FreeRefFunction
{
public
P
C
(
FormulaContext
formulaContext
)
{
super
(
formulaContext
);
}
...
...
@@ -56,13 +56,9 @@ public class ProjectContext extends FunctionBase implements FreeRefFunction {
,
formulaContext
.
getPeriod
(),
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
),
formulaContext
.
getYear
()
,
formulaContext
.
getPeriod
(),
calendar2
.
get
(
Calendar
.
DAY_OF_MONTH
)));
case
"FillForm"
:
PeriodReport
report
=
SpringContextUtil
.
reportMapper
.
selectByPrimaryKey
(
formulaContext
.
getReportId
());
if
(
report
!=
null
)
{
return
new
StringEval
(
String
.
format
(
Constant
.
ReportBuildInStringFormat
.
FillForm
,
report
.
getUpdateTime
().
getYear
()
,
report
.
getUpdateTime
().
getMonth
(),
report
.
getUpdateTime
().
getDay
()));
}
else
{
return
new
StringEval
(
String
.
format
(
Constant
.
ReportBuildInStringFormat
.
FillFormStr
,
" "
,
" "
,
" "
));
}
Date
updateDate
=
new
Date
();
return
new
StringEval
(
String
.
format
(
Constant
.
ReportBuildInStringFormat
.
FillForm
,
updateDate
.
getYear
()
,
updateDate
.
getMonth
(),
updateDate
.
getDay
()));
case
"TaxPayerNo"
:
String
taxPayerNo
=
SpringContextUtil
.
organizationMapper
.
selectByPrimaryKey
(
formulaContext
.
getOrganizationId
()).
getTaxPayerNumber
();
if
(
StringUtils
.
isNotBlank
(
taxPayerNo
)
&&
taxPayerNo
.
length
()
-
1
>=
parameterInt
)
{
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/PSUM.java
View file @
def95670
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
.
report
.
functions
;
import
org.apache.poi.ss.formula.OperationEvaluationContext
;
import
org.apache.poi.ss.formula.WorkbookEvaluator
;
import
org.apache.poi.ss.formula.eval.*
;
import
org.apache.poi.ss.formula.eval.NumberEval
;
import
org.apache.poi.ss.formula.eval.StringEval
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -13,10 +14,7 @@ import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import
pwc.taxtech.atms.dpo.CellTemplatePerGroupDto
;
import
pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto
;
import
pwc.taxtech.atms.exception.Exceptions
;
import
pwc.taxtech.atms.vat.entity.PeriodDataSource
;
import
pwc.taxtech.atms.vat.service.impl.FormulaAgent
;
import
java.lang.reflect.Field
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -80,16 +78,16 @@ public class PSUM extends FunctionBase implements FreeRefFunction {
dto
.
setName
(
DataSourceName
.
ReportDataSource
);
dto
.
setPeriod
(
formulaContext
.
getPeriod
());
dto
.
setProjectId
(
formulaContext
.
getProjectId
());
dto
.
setRowIndex
(
pCell
.
rowIndex
-
1
);
dto
.
setColumnIndex
(
pCell
.
columnIndex
-
1
);
dto
.
setColumnName
((
pCell
.
columnIndex
)
+
"列"
);
dto
.
setRowName
((
pCell
.
rowIndex
)
+
"行"
);
dto
.
setRowIndex
(
pCell
.
rowIndex
-
1
);
dto
.
setColumnIndex
(
pCell
.
columnIndex
-
1
);
dto
.
setColumnName
((
pCell
.
columnIndex
)
+
"列"
);
dto
.
setRowName
((
pCell
.
rowIndex
)
+
"行"
);
dto
.
setReportName
(
ec
.
getWorkbook
().
getSheetName
(
ec
.
getSheetIndex
()));
dto
.
setType
(
FormulaDataSourceType
.
Report
.
getCode
());
dto
.
setType
(
FormulaDataSourceType
.
Report
.
getCode
());
dataSource
.
add
(
dto
);
bigDecimal
=
bigDecimal
.
add
(
cellValue
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
...
...
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