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
57d00e04
Commit
57d00e04
authored
Mar 20, 2019
by
chase
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev_mysql' of
http://code.tech.tax.asia.pwcinternal.com/root/atms
into dev_mysql
parents
1fa3f350
a35b8768
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
250 additions
and
39 deletions
+250
-39
PeriodJobDto.java
...c/main/java/pwc/taxtech/atms/dto/vatdto/PeriodJobDto.java
+1
-1
RSUMIFParasBo.java
.../main/java/pwc/taxtech/atms/dto/vatdto/RSUMIFParasBo.java
+35
-7
ReportCellTableSUMIFDataSourceDto.java
...ch/atms/dto/vatdto/ReportCellTableSUMIFDataSourceDto.java
+14
-0
CitReportServiceImpl.java
...a/pwc/taxtech/atms/service/impl/CitReportServiceImpl.java
+1
-1
FormulaAgent.java
.../java/pwc/taxtech/atms/vat/service/impl/FormulaAgent.java
+29
-3
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+18
-1
QMYE.java
.../taxtech/atms/vat/service/impl/report/functions/QMYE.java
+105
-0
SUM.java
...c/taxtech/atms/vat/service/impl/report/functions/SUM.java
+17
-14
cit-layout.ctrl.js
...web/src/main/webapp/app/cit/cit-layout/cit-layout.ctrl.js
+2
-2
cit-calculate-data.ctrl.js
...t/reduction/cit-calculate-data/cit-calculate-data.ctrl.js
+12
-6
cit-report-sheet.js
...ebapp/app/cit/report/cit-report-sheet/cit-report-sheet.js
+11
-3
cit-report-view.ctrl.js
...pp/app/cit/report/cit-report-view/cit-report-view.ctrl.js
+5
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/PeriodJobDto.java
View file @
57d00e04
...
...
@@ -46,7 +46,7 @@ public class PeriodJobDto {
String
[]
codes
=
stepsCode
.
split
(
","
);
if
(
tasks
.
stream
().
anyMatch
(
m
->
m
.
status
.
equals
(
STATUS_ERROR
)))
{
this
.
jobStatus
=
STATUS_ERROR
;
}
else
if
(
tasks
.
size
()
<
codes
.
length
)
{
}
else
if
(
tasks
.
size
()
<
codes
.
length
||
tasks
.
stream
().
anyMatch
(
m
->
m
.
status
.
equals
(
STATUS_BEGIN
))
)
{
this
.
jobStatus
=
STATUS_RUNNING
;
}
else
{
this
.
jobStatus
=
STATUS_END
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/RSUMIFParasBo.java
View file @
57d00e04
...
...
@@ -7,6 +7,7 @@ import org.apache.poi.ss.formula.eval.ValueEval;
import
java.util.ArrayList
;
import
java.util.List
;
import
static
pwc
.
taxtech
.
atms
.
common
.
util
.
FormulaUtil
.
resolverInteger
;
import
static
pwc
.
taxtech
.
atms
.
common
.
util
.
FormulaUtil
.
resolverString
;
import
static
pwc
.
taxtech
.
atms
.
exception
.
Exceptions
.
BAD_BBVO_PARAMS
;
...
...
@@ -40,23 +41,47 @@ public class RSUMIFParasBo {
expressionData
.
add
(
new
PeriodCellDataTemplate
(
period
,
cellTemplateId
));
}
public
String
getExpression
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
throws
EvaluationException
{
public
String
getExpression
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
throws
EvaluationException
{
StringBuilder
expression
=
new
StringBuilder
(
""
);
String
_para
=
""
;
begin
(
expression
);
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++){
_para
=
resolverString
(
args
,
ec
,
i
);
concatPara
(
expression
,
_para
);
for
(
int
i
=
0
;
i
<
args
.
length
;
i
++)
{
if
(
i
>=
4
)
{
concatPara
(
expression
,
resolverInteger
(
args
,
ec
,
i
));
}
else
{
concatPara
(
expression
,
resolverString
(
args
,
ec
,
i
));
}
if
(
i
==
args
.
length
-
1
)
{
continue
;
}
split
(
expression
);
}
end
(
expression
);
return
expression
.
toString
();
return
expression
.
toString
();
}
public
String
getQMYEExpression
(
Integer
subjectType
,
String
subjectCode
,
Integer
year
,
Integer
period
,
OperationEvaluationContext
ec
)
throws
EvaluationException
{
StringBuilder
expression
=
new
StringBuilder
(
""
);
beginQMYE
(
expression
);
concatPara
(
expression
,
subjectType
);
split
(
expression
);
concatPara
(
expression
,
subjectCode
);
split
(
expression
);
concatPara
(
expression
,
year
);
split
(
expression
);
concatPara
(
expression
,
period
);
end
(
expression
);
return
expression
.
toString
();
}
private
StringBuilder
begin
(
StringBuilder
expression
)
{
return
expression
.
append
(
"RSUMIF("
);
}
private
StringBuilder
beginQMYE
(
StringBuilder
expression
)
{
return
expression
.
append
(
"QMYE("
);
}
private
StringBuilder
end
(
StringBuilder
expression
)
{
return
expression
.
append
(
")"
);
}
...
...
@@ -72,7 +97,10 @@ public class RSUMIFParasBo {
private
StringBuilder
concatPara
(
StringBuilder
expression
,
Integer
para
)
{
return
expression
.
append
(
para
);
}
public
RSUMIFParasBo
(){}
public
RSUMIFParasBo
()
{
}
public
RSUMIFParasBo
(
RSUMIFParasBo
otherBo
,
int
period
,
int
curYear
)
{
this
.
reportCode
=
otherBo
.
reportCode
;
this
.
columnIndex
=
otherBo
.
getColumnIndex
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/ReportCellTableSUMIFDataSourceDto.java
View file @
57d00e04
...
...
@@ -70,6 +70,20 @@ public class ReportCellTableSUMIFDataSourceDto extends DataSourceDto {
this
.
name
=
DataSourceName
.
ReportDataSource
;
}
public
void
insertQMYEData
(
OperationEvaluationContext
o
,
FormulaContext
formulaContext
)
{
this
.
tag
=
"QMYE"
;
this
.
rowIndex
=
o
.
getRowIndex
();
this
.
columnIndex
=
o
.
getColumnIndex
();
this
.
cellTemplateId
=
null
;
this
.
period
=
formulaContext
.
getPeriod
();
this
.
reportTemplateId
=
formulaContext
.
getReportTemplateGroupId
().
toString
();
this
.
year
=
formulaContext
.
getYear
();
this
.
isOnlyManualInput
=
false
;
this
.
reportName
=
formulaContext
.
getReportTemplateGroupId
().
toString
();
this
.
name
=
DataSourceName
.
ReportDataSource
;
}
public
String
getTag
()
{
return
this
.
tag
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/CitReportServiceImpl.java
View file @
57d00e04
...
...
@@ -61,7 +61,7 @@ import static pwc.taxtech.atms.dto.vatdto.WrapPeriodJobDto.*;
public
class
CitReportServiceImpl
extends
BaseService
{
private
final
static
Logger
logger
=
LoggerFactory
.
getLogger
(
CitReportServiceImpl
.
class
);
private
final
static
String
[]
functions
=
{
"SGSR"
,
"FSJZ"
,
"ND"
,
"BB"
,
"XXFP"
,
"GZSD"
,
"PC"
,
"JXFPMX"
,
"JXFP"
,
"PSUM"
,
"DFFS"
,
"JFFS"
,
"WPSR"
,
"WPNAME"
,
"WPTYPE"
,
"SUM2"
,
"RSUMIF"
,
"
SUM
"
};
"JXFP"
,
"PSUM"
,
"DFFS"
,
"JFFS"
,
"WPSR"
,
"WPNAME"
,
"WPTYPE"
,
"SUM2"
,
"RSUMIF"
,
"
QMYE
"
};
@Autowired
private
OrganizationServiceTemplateGroupMapper
orgServiceTemplateGroupMapper
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/FormulaAgent.java
View file @
57d00e04
...
...
@@ -8,15 +8,16 @@ import pwc.taxtech.atms.common.util.MyAsserts;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
import
pwc.taxtech.atms.common.util.StringUtil
;
import
pwc.taxtech.atms.constant.enums.EnumServiceType
;
import
pwc.taxtech.atms.dao.CitTbamMapper
;
import
pwc.taxtech.atms.dao.FormulaAdminMapper
;
import
pwc.taxtech.atms.dao.ProjectMapper
;
import
pwc.taxtech.atms.dao.ProjectServiceTypeMapper
;
import
pwc.taxtech.atms.dpo.CellTemplatePerGroupDto
;
import
pwc.taxtech.atms.dpo.GroupId
;
import
pwc.taxtech.atms.dto.TableRule
;
import
pwc.taxtech.atms.entity.Project
;
import
pwc.taxtech.atms.entity.ProjectServiceType
;
import
pwc.taxtech.atms.entity.ProjectServiceTypeExample
;
import
pwc.taxtech.atms.entity.*
;
import
pwc.taxtech.atms.exception.Exceptions
;
import
pwc.taxtech.atms.service.impl.CitCommonUtil
;
import
pwc.taxtech.atms.vat.dao.*
;
import
pwc.taxtech.atms.vat.entity.*
;
import
pwc.taxtech.atms.vat.service.impl.report.functions.FormulaContext
;
...
...
@@ -41,6 +42,10 @@ public class FormulaAgent {
private
ProjectServiceTypeMapper
projectServiceTypeMapper
;
@Autowired
private
PeriodDataSourceMapper
periodDataSourceMapper
;
@Autowired
private
CitTbamMapper
citTbamMapper
;
@Autowired
private
ProjectMapper
projectMapper
;
public
List
<
CellTemplatePerGroupDto
>
getCellTemplateGroupDto
(
Long
templateGroupId
,
String
projectId
,
String
code
,
Integer
rowIndex
,
Integer
columnIndex
,
Integer
period
)
{
return
adminMp
.
getCellTemplatePerGroupDto
(
templateGroupId
,
code
,
rowIndex
,
columnIndex
,
projectId
,
period
);
...
...
@@ -253,4 +258,25 @@ public class FormulaAgent {
}
return
new
BigDecimal
(
0
);
}
/**
* 获取期末余额
* @author zhikai.z.wei
* @param subjectType
* @param subjectCode
* @param year
* @param period
* @param formulaContext
* @return
*/
public
BigDecimal
getQMYE
(
Integer
subjectType
,
String
subjectCode
,
Integer
year
,
Integer
period
,
FormulaContext
formulaContext
){
Project
project
=
projectMapper
.
selectByPrimaryKey
(
formulaContext
.
getProjectId
());
CitTbamExample
citTbamExample
=
new
CitTbamExample
();
citTbamExample
.
createCriteria
().
andAccountCodeEqualTo
(
subjectCode
).
andPeriodEqualTo
(
year
+
project
.
getYear
());
List
<
CitTbam
>
citTbams
=
citTbamMapper
.
selectByExample
(
citTbamExample
);
if
(
citTbams
==
null
||
citTbams
.
isEmpty
()){
return
new
BigDecimal
(
0.0
);
}
return
citTbams
.
get
(
0
).
getEndingBalance
();
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
57d00e04
...
...
@@ -147,7 +147,9 @@ public class ReportGeneratorImpl {
List
<
PeriodFormulaBlock
>
periodFormulaBlocks
=
periodFormulaBlockMapper
.
selectByExample
(
periodFormulaBlockExample2
);
//TODO:如果formula 为 ND(100) +ND(22) ,需要使用正则表达式拆分出自定义公式,然后根据自定义公式取formulablock 的数据进行替换
String
regex
=
"[A-Z]*\\([\\-A-Za-z0-9\\\"\\,\\.\\:\\u4e00-\\u9fa5\\%]*\\)"
;
//原始版本正则表达式,update by zhikai.z.wei at 20190319 19:00
// String regex = "[A-Z]*\\([\\-A-Za-z0-9\\\"\\,\\.\\:\\u4e00-\\u9fa5\\%]*\\)";
String
regex
=
"[A-Z]*\\([^(^)]*\\)"
;
Pattern
p
=
Pattern
.
compile
(
regex
);
String
sourceFormula
=
StringUtils
.
isNotBlank
(
periodCellTemplateConfig
.
getKeyValueParsedFormula
())
?
periodCellTemplateConfig
.
getKeyValueParsedFormula
()
:
...
...
@@ -536,6 +538,21 @@ public class ReportGeneratorImpl {
UDFFinder
udfToolpack
=
new
AggregatingUDFFinder
(
udfs
);
workbook
.
addToolPack
(
udfToolpack
);
}
/**
* 注册所有的自定义方法到工作簿
*
* @param workbook 工作簿
*/
public
void
addCitFunctionsAndContext
(
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
PC
(
formulaContext
)
,
new
JXFPMX
(
formulaContext
),
new
JXFP
(
formulaContext
),
new
PSUM
(
formulaContext
),
new
DFFS
(
formulaContext
),
new
JFFS
(
formulaContext
),
new
WPSR
(
formulaContext
),
new
WPNAME
(
formulaContext
),
new
WPTYPE
(
formulaContext
),
new
SUM2
(
formulaContext
),
new
RSUMIF
(
formulaContext
),
new
QMYE
(
formulaContext
)};
UDFFinder
udfs
=
new
DefaultUDFFinder
(
functions
,
functionImpls
);
UDFFinder
udfToolpack
=
new
AggregatingUDFFinder
(
udfs
);
workbook
.
addToolPack
(
udfToolpack
);
}
public
List
<
CellCalcInfoDto
>
getCellCalcInfo
(
List
<
Long
>
templateIdList
,
Integer
periodParam
,
String
projectId
)
{
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/QMYE.java
0 → 100644
View file @
57d00e04
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
.
report
.
functions
;
import
org.apache.poi.ss.formula.OperationEvaluationContext
;
import
org.apache.poi.ss.formula.eval.EvaluationException
;
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.constant.enums.FormulaDataSourceDetailType
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceType
;
import
pwc.taxtech.atms.dto.TableRule
;
import
pwc.taxtech.atms.dto.vatdto.RSUMIFParasBo
;
import
pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto
;
import
pwc.taxtech.atms.dto.vatdto.ReportCellTableSUMIFDataSourceDto
;
import
pwc.taxtech.atms.exception.Exceptions
;
import
pwc.taxtech.atms.vat.service.impl.FormulaAgent
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
static
pwc
.
taxtech
.
atms
.
common
.
util
.
FormulaUtil
.
resolverInteger
;
import
static
pwc
.
taxtech
.
atms
.
common
.
util
.
FormulaUtil
.
resolverString
;
/**
* @description 计算指定科目期末余额,目前不考虑科目类型,统一为企业科目
* @author ZhiKai Z Wei
*/
public
class
QMYE
extends
FunctionBase
implements
FreeRefFunction
{
private
String
tableName
=
"CIT_TBAM"
;
public
QMYE
(
FormulaContext
formulaContext
)
{
super
(
formulaContext
);
}
@Override
public
ValueEval
evaluate
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
{
//科目类型
Integer
subjectType
=
0
;
//科目代码
String
subjectCode
=
""
;
Integer
period
=
0
;
Integer
year
=
0
;
//参数验证
parameterCheck
(
args
,
ec
);
BigDecimal
cellValue
=
BigDecimal
.
ZERO
;
List
<
Object
>
dataSource
=
new
ArrayList
<>();
Map
map
=
new
HashMap
<
String
,
String
>();
ReportCellTableSUMIFDataSourceDto
reportCellTableSUMIFDataSourceDto
=
new
ReportCellTableSUMIFDataSourceDto
();
reportCellTableSUMIFDataSourceDto
.
insertQMYEData
(
ec
,
formulaContext
);
dataSource
.
add
(
reportCellTableSUMIFDataSourceDto
);
try
{
//科目类型,固定写为企业科目
subjectType
=
resolverInteger
(
args
,
ec
,
0
);
//科目代码
subjectCode
=
resolverString
(
args
,
ec
,
1
);
year
=
resolverInteger
(
args
,
ec
,
2
);
//年份
period
=
resolverInteger
(
args
,
ec
,
3
);
//期间
cellValue
=
agent
.
getQMYE
(
subjectType
,
subjectCode
,
year
,
period
,
formulaContext
);
return
new
NumberEval
(
cellValue
.
doubleValue
());
}
catch
(
EvaluationException
e
)
{
e
.
printStackTrace
();
return
new
NumberEval
(
0.00
);
}
finally
{
Long
dataSourceId
=
null
;
try
{
dataSourceId
=
saveDataRSUMIFSource
(
ec
,
dataSource
,
FormulaDataSourceDetailType
.
ReportCellTableSUMIFDataSourceDto
,
cellValue
,
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
(),
ec
.
getColumnIndex
(),
ec
.
getRowIndex
(),
formulaContext
.
getProjectId
(),
selectShow
(
tableName
),
null
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
try
{
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
new
RSUMIFParasBo
().
getQMYEExpression
(
subjectType
,
subjectCode
,
year
,
period
,
ec
),
cellValue
,
dataSourceId
,
formulaContext
.
getProjectId
());
}
catch
(
EvaluationException
e
)
{
e
.
printStackTrace
();
}
}
}
//进行参数验证
public
void
parameterCheck
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
{
Integer
argsLength
=
args
.
length
;
if
(
argsLength
!=
4
)
{
//参数小于4当做异常处理
throw
Exceptions
.
parameterError
;
}
}
//解决不同表结构关联不同的展示方式
public
FormulaDataSourceType
selectShow
(
String
tableName
)
{
if
(
"CIT_TBAM"
.
equals
(
tableName
))
{
return
FormulaDataSourceType
.
CIT_TBAM
;
}
return
null
;
}
public
static
String
getSql
(){
return
""
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/SUM.java
View file @
57d00e04
...
...
@@ -25,10 +25,26 @@ public class SUM extends FunctionBase implements FreeRefFunction {
super
(
formulaContext
);
}
@Override
public
ValueEval
evaluate
(
ValueEval
[]
valueEvals
,
OperationEvaluationContext
operationEvaluationContext
)
{
for
(
int
i
=
0
,
j
=
valueEvals
.
length
;
i
<
j
;
i
++)
{
try
{
return
new
NumberEval
(
sum
(
getData
(
parameter
(
resolverString
(
valueEvals
,
operationEvaluationContext
,
i
)))).
doubleValue
());
}
catch
(
EvaluationException
e
)
{
e
.
printStackTrace
();
return
defaultEval
;
}
}
return
defaultEval
;
}
//检查参数合法性
public
String
parameter
(
String
parameter
)
{
if
(
parameter
.
length
()
!=
2
)
if
(
parameter
.
length
()
!=
2
){
throw
Exceptions
.
parameterError
;
}
return
parameter
;
}
...
...
@@ -47,17 +63,4 @@ public class SUM extends FunctionBase implements FreeRefFunction {
return
cellValue
;
}
@Override
public
ValueEval
evaluate
(
ValueEval
[]
valueEvals
,
OperationEvaluationContext
operationEvaluationContext
)
{
for
(
int
i
=
0
,
j
=
valueEvals
.
length
;
i
<
j
;
i
++)
{
try
{
return
new
NumberEval
(
sum
(
getData
(
parameter
(
resolverString
(
valueEvals
,
operationEvaluationContext
,
i
)))).
doubleValue
());
}
catch
(
EvaluationException
e
)
{
e
.
printStackTrace
();
return
defaultEval
;
}
}
return
defaultEval
;
}
}
atms-web/src/main/webapp/app/cit/cit-layout/cit-layout.ctrl.js
View file @
57d00e04
citModule
.
controller
(
'citLayoutController'
,
[
'$scope'
,
'$rootScope'
,
'$location'
,
'$q'
,
'$log'
,
'$timeout'
,
'$state'
,
'$translate'
,
'projectService'
,
'SweetAlert'
,
'loginContext'
,
'citSessionService'
,
'vatSessionService'
,
'vatCommonService'
,
'vatWorkflowService'
,
'application'
,
'enums'
,
'$uibModal'
,
function
(
$scope
,
$rootScope
,
$location
,
$q
,
$log
,
$timeout
,
$state
,
$translate
,
projectService
,
SweetAlert
,
loginContext
,
citSessionService
,
vatSessionService
,
...
...
@@ -84,7 +84,7 @@ function ($scope, $rootScope, $location, $q, $log, $timeout, $state, $translate,
}
else
{
SweetAlert
.
warning
(
$translate
.
instant
(
'NoProjet'
));
$location
.
path
(
'/summary'
);
//
$location.path('/summary');
return
;
}
...
...
atms-web/src/main/webapp/app/cit/reduction/cit-calculate-data/cit-calculate-data.ctrl.js
View file @
57d00e04
vatModule
.
controller
(
'citCalculateDataController'
,
[
'$scope'
,
'$log'
,
'$timeout'
,
'$interval'
,
'$q'
,
'$translate'
,
'loginContext'
,
vatModule
.
controller
(
'citCalculateDataController'
,
[
'$scope'
,
'$log'
,
'$timeout'
,
'$interval'
,
'$q'
,
'$translate'
,
'loginContext'
,
'apiInterceptor'
,
'Upload'
,
'dataImportService'
,
'SweetAlert'
,
'vatReductionService'
,
'vatSessionService'
,
'uiGridConstants'
,
'enums'
,
'modelConfigurationService'
,
'citReportService'
,
'vatCommonService'
,
'BSPLService'
,
'vatOperationLogService'
,
'vatWorkflowService'
,
...
...
@@ -208,7 +208,7 @@ debugger;
var dataValidateCode = [/!*'DA001', 'DA002', 'DA003',*!/ ''];*/
//数据配置
result
.
push
({
name
:
$translate
.
instant
(
'ProcessData'
),
items
:
[
new
task
(
'UpdateReportConfig'
,
'unstarted'
)]
});
result
.
push
({
name
:
$translate
.
instant
(
'ProcessData'
),
items
:
[
new
task
(
'UpdateReportConfig'
,
'unstarted'
,
""
,
"UpdateConfig"
)]
});
result
[
result
.
length
-
1
].
items
.
forEach
(
function
(
t
)
{
t
.
seqNo
=
result
.
length
-
1
});
//数据校验
...
...
@@ -583,12 +583,18 @@ debugger;
debugger
;
item
.
status
=
'completed'
;
item
.
text
=
$translate
.
instant
(
'completed'
);
item
.
items
.
forEach
(
function
(
_task
,
index
)
{
debugger
;
tasks
.
forEach
(
function
(
task
){
debugger
;
if
(
task
.
code
==
_task
.
code
){
_task
.
status
=
'completed'
;
_task
.
text
=
$translate
.
instant
(
_task
.
status
);
}
})
})
});
$scope
.
tasks
[
0
].
items
[
0
].
status
=
'completed'
;
$scope
.
tasks
[
0
].
items
[
0
].
text
=
$translate
.
instant
(
'completed'
);
// $scope.tasks[tasks.length-1].items[items.length-1].status = 'completed';
// $scope.tasks[tasks.length-1].items[items.length-1].status.text = $translate.instant(_task.status);
if
(
$scope
.
timer
){
$interval
.
cancel
(
$scope
.
timer
);
vatCommonService
.
setProjectStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
constant
.
ProjectStatusEnum
.
Generated
...
...
atms-web/src/main/webapp/app/cit/report/cit-report-sheet/cit-report-sheet.js
View file @
57d00e04
citModule
.
directive
(
'citReportSheet'
,
[
'$rootScope'
,
'$log'
,
'$timeout'
,
'$q'
,
'templateService'
,
'enums'
,
'keyValueDataService'
,
'spreadJsTipService'
,
citModule
.
directive
(
'citReportSheet'
,
[
'$rootScope'
,
'$log'
,
'$timeout'
,
'$q'
,
'templateService'
,
'enums'
,
'keyValueDataService'
,
'spreadJsTipService'
,
'$interval'
,
'vatSessionService'
,
function
(
$rootScope
,
$log
,
$timeout
,
$q
,
templateService
,
enums
,
keyValueDataService
,
spreadJsTipService
,
$interval
,
vatSessionService
)
{
'use strict'
;
...
...
@@ -330,6 +330,7 @@
};
manualFunc
.
prototype
=
new
GC
.
Spread
.
CalcEngine
.
Functions
.
Function
(
"_Manual"
,
1
,
1
);
manualFunc
.
prototype
.
evaluate
=
function
(
args
)
{
debugger
;
if
(
!
_
.
isString
(
args
))
{
return
"#VALUE!"
;
}
...
...
@@ -447,6 +448,7 @@
// 根据已有信息通过spreadJS计算各单元格的值
var
setData
=
function
()
{
debugger
;
var
sheet
=
scope
.
spread
.
sheets
[
0
];
var
isExportData
=
false
;
if
(
angular
.
isArray
(
scope
.
reportSource
))
{
...
...
@@ -456,6 +458,7 @@
}
scope
.
reportSource
.
forEach
(
function
(
data
)
{
debugger
;
//fix bug11737 导出需要显示千分位
// 避免直接使用data.value = parseFloat(data.value)导致非数字型value无法显示
data
.
value
=
PWC
.
tryParseStringToNum
(
data
.
value
);
...
...
@@ -551,11 +554,14 @@
else
{
parsedFormula
=
'_Manual("'
+
data
.
cellTemplateID
+
'")'
;
}
}
if
(
!
_
.
isEmpty
(
parsedFormula
))
{
parsedFormula
=
'IFERROR('
+
parsedFormula
+
', "")'
;
debugger
;
// parsedFormula = 'IFERROR(' + parsedFormula + ', "")';
sheet
.
setFormula
(
data
.
rowIndex
,
data
.
columnIndex
,
'='
+
parsedFormula
);
// sheet.setValue(data.rowIndex, data.columnIndex, data.value);
ifShowParseFloat
=
false
;
// 有公式或手工数据源,单元格设置为公式
}
}
...
...
@@ -573,7 +579,7 @@
//设置 tooltip 和 图标信息
spreadJsTipService
.
setCellTipByCellData
(
sheet
.
getCell
(
data
.
rowIndex
,
data
.
columnIndex
),
data
);
});
debugger
;
// 设置破折号单元格的值和显示格式,将其替换为带破折号格式的0值,这样引用到的其他单元格才能正常计算
var
rowCount
=
sheet
.
getRowCount
();
var
columnCount
=
sheet
.
getColumnCount
();
...
...
@@ -593,6 +599,7 @@
// 更新数据源后,通过调用该方法计算所有当前sheet单元格,并通过比较原数据列表与spreadJS计算的新值列表,获取保存时需要修改库中Value的单元格信息列表
var
updateCells
=
function
()
{
debugger
;
setData
();
var
sheet
=
getSpreadControl
().
sheets
[
0
];
var
cells
=
[];
...
...
@@ -600,6 +607,7 @@
.
pluck
(
'dataSourceList'
)
.
flatten
(
true
).
value
();
angular
.
forEach
(
scope
.
reportSource
,
function
(
x
)
{
debugger
;
// 比较刷新前后报表中的值的变化
// 优先将单元格转换成数值比较,如果不能则转换为字符串比较
var
cell
=
sheet
.
getCell
(
x
.
rowIndex
,
x
.
columnIndex
);
...
...
atms-web/src/main/webapp/app/cit/report/cit-report-view/cit-report-view.ctrl.js
View file @
57d00e04
citModule
.
controller
(
'citReportViewController'
,
[
'$scope'
,
'$rootScope'
,
'$log'
,
'$translate'
,
'$timeout'
,
'$q'
,
'$compile'
,
'$state'
,
'$stateParams'
,
citModule
.
controller
(
'citReportViewController'
,
[
'$scope'
,
'$rootScope'
,
'$log'
,
'$translate'
,
'$timeout'
,
'$q'
,
'$compile'
,
'$state'
,
'$stateParams'
,
'apiInterceptor'
,
'vatExportService'
,
'SweetAlert'
,
'BSPLService'
,
'vatReportService'
,
'vatReportCacheService'
,
'vatSessionService'
,
'loginContext'
,
'enums'
,
'vatCommonService'
,
'vatWorkflowService'
,
'projectService'
,
'$uibModal'
,
'$cookies'
,
'Upload'
,
'vatImportService'
,
'vatApproveService'
,
function
(
$scope
,
$rootScope
,
$log
,
$translate
,
$timeout
,
$q
,
$compile
,
$state
,
$stateParams
,
apiInterceptor
,
vatExportService
,
SweetAlert
,
BSPLService
,
...
...
@@ -995,8 +995,10 @@
return
;
}
var
reportPromiss
=
vatReportService
.
getReportData
(
node
.
reportId
).
success
(
function
(
reportData
)
{
debugger
;
if
(
reportData
&&
reportData
.
data
&&
reportData
.
data
.
cellData
)
{
_
.
each
(
reportData
.
data
.
cellData
,
function
(
x
)
{
debugger
;
x
.
value
=
x
.
cellValue
;
if
(
x
.
formula
&&
reg
.
test
(
x
.
formula
))
{
x
.
isFormula
=
true
;
...
...
@@ -1123,7 +1125,9 @@
};
var
getReportData
=
function
()
{
debugger
;
vatReportService
.
getReportData
(
$scope
.
reportId
).
success
(
function
(
reportData
)
{
debugger
;
if
(
reportData
&&
reportData
.
data
&&
reportData
.
data
.
cellData
)
{
_
.
each
(
reportData
.
data
.
cellData
,
function
(
x
)
{
x
.
value
=
x
.
cellValue
;
...
...
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