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
ee24fd66
Commit
ee24fd66
authored
Apr 01, 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
2aa794d6
5cd7ea54
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
237 additions
and
49 deletions
+237
-49
FileExcelUtil.java
...main/java/pwc/taxtech/atms/common/util/FileExcelUtil.java
+0
-0
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+15
-6
CitReportServiceImpl.java
...a/pwc/taxtech/atms/service/impl/CitReportServiceImpl.java
+1
-1
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+16
-6
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+19
-16
FunctionBase.java
.../atms/vat/service/impl/report/functions/FunctionBase.java
+1
-1
ND.java
...wc/taxtech/atms/vat/service/impl/report/functions/ND.java
+14
-4
RSUMIF.java
...axtech/atms/vat/service/impl/report/functions/RSUMIF.java
+1
-0
BB.java
...atms/vat/service/impl/report/functions/validation/BB.java
+157
-0
index.html
atms-web/src/main/webapp/WEB-INF/templates/index.html
+1
-1
tb-ebit-form.html
...-web/src/main/webapp/app/analysis/table/tb-ebit-form.html
+3
-3
tax-report-cell-detail-modal.ctrl.js
...rt-cell-detail-modal/tax-report-cell-detail-modal.ctrl.js
+4
-5
tax-report-cell-detail-modal.html
...eport-cell-detail-modal/tax-report-cell-detail-modal.html
+2
-2
tax-report-cell-detail-modal.ctrl.js
...rt-cell-detail-modal/tax-report-cell-detail-modal.ctrl.js
+2
-3
tax-report-cell-detail-modal.html
...eport-cell-detail-modal/tax-report-cell-detail-modal.html
+1
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/util/FileExcelUtil.java
View file @
ee24fd66
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
ee24fd66
...
...
@@ -8,6 +8,7 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
pwc.taxtech.atms.common.message.ErrorMessage
;
import
pwc.taxtech.atms.common.util.FileExcelUtil
;
import
pwc.taxtech.atms.constant.enums.EnumServiceType
;
import
pwc.taxtech.atms.dao.OrganizationMapper
;
import
pwc.taxtech.atms.dao.ProjectMapper
;
...
...
@@ -26,8 +27,10 @@ import pwc.taxtech.atms.vat.entity.*;
import
pwc.taxtech.atms.vat.service.impl.ReportServiceImpl
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.ByteArrayOutputStream
;
import
java.io.File
;
import
java.io.OutputStream
;
import
java.net.URISyntaxException
;
import
java.util.List
;
...
...
@@ -151,10 +154,10 @@ public class ReportController {
return
reportService
.
getCellData
(
reportId
,
from
);
}
private
static
OperationResultDto
<
ReportDataDto
>
operationResultDto
=
null
;
@RequestMapping
(
value
=
"reportEbitData"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
<
ReportDataDto
>
reportEbitData
(
@RequestBody
RequestParameterDto
requestParameterDto
)
{
OperationResultDto
operationResultDto
=
new
OperationResultDto
();
/*OperationResultDto resultDto = new OperationResultDto();
*//* if (requestParameterDto.getProjectId() == null || requestParameterDto.getReportId() == null) {
resultDto.setResult(false);
...
...
@@ -257,14 +260,16 @@ public class ReportController {
@RequestMapping
(
value
=
"doUpload"
,
method
=
RequestMethod
.
POST
)
public
OperationResultDto
doUploadAttach
(
@RequestParam
(
"fileName"
)
String
fileName
,
MultipartFile
file
,
String
remarks
,
@RequestParam
(
"activeCol"
)
Long
activeCol
,
@RequestParam
(
"activeRow"
)
Long
activeRow
,
@RequestParam
(
"activeTemplateId"
)
String
activeTemplateId
)
{
FileUpload
fileUpload
=
null
;
OperationResultDto
operationResultDto
=
new
OperationResultDto
();
try
{
fileUpload
=
didiFileUploadService
.
uploadFile
(
file
,
file
.
getOriginalFilename
(),
"附件上传"
);
operationResultDto
.
setData
(
reportService
.
bindPwcAttach
(
activeCol
,
activeRow
,
activeTemplateId
,
fileUpload
,
remarks
));
operationResultDto
.
setResultMsg
(
"success"
);
return
operationResultDto
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
return
operationResultDto
.
error
();
}
operationResultDto
.
success
();
reportService
.
bindPwcAttach
(
activeCol
,
activeRow
,
activeTemplateId
,
fileUpload
,
remarks
);
return
operationResultDto
;
}
@RequestMapping
(
"loadAttachList"
)
...
...
@@ -345,11 +350,14 @@ public class ReportController {
* 批量导出利润表
*/
@RequestMapping
(
"manyExport"
)
public
OperationResultDto
manyExport
(
@RequestBody
RequestParameterDto
requestParameterDto
)
{
public
OperationResultDto
manyExport
(
@RequestBody
RequestParameterDto
requestParameterDto
,
HttpServletResponse
response
,
HttpServletRequest
request
)
{
OperationResultDto
operationResultDto
=
new
OperationResultDto
();
String
zipName
=
"利润表"
;
try
{
reportService
.
manyExport
(
requestParameterDto
,
zipName
);
String
zipPath
=
"/zipDir"
;
//生成zip文件夹
FileExcelUtil
.
createFile
(
zipPath
);
reportService
.
manyExport
(
requestParameterDto
,
zipName
,
request
,
response
,
zipPath
);
}
catch
(
URISyntaxException
e
)
{
e
.
printStackTrace
();
}
...
...
@@ -357,6 +365,7 @@ public class ReportController {
return
operationResultDto
;
}
/**
* 将spread序列化字符串保存到数据库
*/
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/CitReportServiceImpl.java
View file @
ee24fd66
...
...
@@ -261,7 +261,7 @@ public class CitReportServiceImpl extends BaseService {
periodCellTemplateConfigDtos
.
forEach
(
a
->
{
workbook4Validate
.
getSheetAt
(
a
.
getSheetNumber
()
-
1
).
getRow
(
a
.
getRowNumber
()).
getCell
(
a
.
getColNumber
()).
setCellFormula
(
a
.
getParsedValidation
());
});
reportGenerator
.
addFunctionsAndContext
(
workbook4Validate
,
functions
,
reportGenerator
.
initContext
(
resources
,
periodParam
));
reportGenerator
.
addFunctionsAndContext
(
workbook4Validate
,
functions
,
reportGenerator
.
initContext
(
resources
,
periodParam
)
,
true
);
FormulaEvaluator
validateEvaluator
=
workbook4Validate
.
getCreationHelper
().
createFormulaEvaluator
();
validateEvaluator
.
evaluateAll
();
//todo: 4.then save the validation result to cellData table
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
ee24fd66
...
...
@@ -591,16 +591,26 @@ public class ReportGeneratorImpl {
*
* @param workbook 工作簿
*/
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
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
SUM
(
formulaContext
),
new
KPSR
(
formulaContext
),
new
TBM
(
formulaContext
)};
public
void
addFunctionsAndContext
(
Workbook
workbook
,
String
[]
functions
,
FormulaContext
formulaContext
,
Boolean
isValidate
)
{
FreeRefFunction
[]
functionImpls
=
new
FreeRefFunction
[
0
];
if
(!
isValidate
)
{
functionImpls
=
new
FreeRefFunction
[]{
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
SUM
(
formulaContext
),
new
KPSR
(
formulaContext
),
new
TBM
(
formulaContext
)};
}
else
{
functionImpls
=
new
FreeRefFunction
[]{
new
SGSR
(
formulaContext
),
new
FSJZ
(
formulaContext
),
new
ND
(
formulaContext
),
new
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
.
report
.
functions
.
validation
.
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
SUM
(
formulaContext
),
new
KPSR
(
formulaContext
),
new
TBM
(
formulaContext
)};
}
UDFFinder
udfs
=
new
DefaultUDFFinder
(
functions
,
functionImpls
);
UDFFinder
udfToolpack
=
new
AggregatingUDFFinder
(
udfs
);
workbook
.
addToolPack
(
udfToolpack
);
}
/**
* 为CIT复制的一份注册自定义公式,和上面的addFunctionsAndContext方法基本相同
* CIT 注册所有的自定义方法到工作簿
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
ee24fd66
...
...
@@ -6,7 +6,6 @@ import com.github.pagehelper.PageHelper;
import
com.github.pagehelper.PageInfo
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Sets
;
import
javassist.expr.NewArray
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.map.HashedMap
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -21,19 +20,21 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.web.multipart.MultipartFile
;
import
pwc.taxtech.atms.analysis.entity.AnalysisActualTaxReturn
;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.common.POIUtil
;
import
pwc.taxtech.atms.common.message.ErrorMessage
;
import
pwc.taxtech.atms.common.util.DataUtil
;
import
pwc.taxtech.atms.common.util.FileExcelUtil
;
import
pwc.taxtech.atms.common.util.MyAsserts
;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
import
pwc.taxtech.atms.constant.Constant
;
import
pwc.taxtech.atms.constant.enums.*
;
import
pwc.taxtech.atms.dao.*
;
import
pwc.taxtech.atms.dpo.ReportDto
;
import
pwc.taxtech.atms.dto.*
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.PeriodReportDto
;
import
pwc.taxtech.atms.dto.ReportAttachDto
;
import
pwc.taxtech.atms.dto.RequestParameterDto
;
import
pwc.taxtech.atms.dto.didiFileUpload.DidiFileIUploadParam
;
import
pwc.taxtech.atms.dto.didiFileUpload.DidiFileUploadDetailResult
;
import
pwc.taxtech.atms.dto.vatdto.*
;
...
...
@@ -51,6 +52,8 @@ import pwc.taxtech.atms.vat.entity.*;
import
pwc.taxtech.atms.vat.service.impl.report.functions.FormulaHelper
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.*
;
import
java.math.BigDecimal
;
import
java.net.URISyntaxException
;
...
...
@@ -68,7 +71,7 @@ public class ReportServiceImpl extends BaseService {
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"
,
"PC"
,
"JXFPMX"
,
"JXFP"
,
"PSUM"
,
"DFFS"
,
"JFFS"
,
"WPSR"
,
"WPNAME"
,
"WPTYPE"
,
"SUM2"
,
"RSUMIF"
,
"SUM"
,
"KPSR"
,
"TBM"
};
"JXFP"
,
"PSUM"
,
"DFFS"
,
"JFFS"
,
"WPSR"
,
"WPNAME"
,
"WPTYPE"
,
"SUM2"
,
"RSUMIF"
,
"SUM"
,
"KPSR"
,
"TBM"
};
@Autowired
private
ReportGeneratorImpl
reportGenerator
;
...
...
@@ -977,13 +980,13 @@ public class ReportServiceImpl extends BaseService {
Workbook
workbook
=
reportGenerator
.
createWorkBookByPeriodTemplate
(
resources
.
getPeriodTemplates
(),
genJob
);
reportGenerator
.
addFunctionsAndContext
(
workbook
,
functions
,
reportGenerator
.
initContext
(
resources
,
periodParam
));
reportGenerator
.
addFunctionsAndContext
(
workbook
,
functions
,
reportGenerator
.
initContext
(
resources
,
periodParam
)
,
false
);
reportGenerator
.
setConfigAndDataToWorkBook
(
workbook
,
resources
);
FormulaEvaluator
evaluator
=
workbook
.
getCreationHelper
().
createFormulaEvaluator
();
evaluator
.
evaluateAll
();
reportGenerator
.
updateWorkbookCaclsValueToDb
(
projectId
,
periodParam
,
workbook
,
resources
,
isMergeManualData
,
genJob
);
//===============================================start validation compute==========================================================
//===============================================start validation compute==========================================================
=================================================
//todo: 1.get the data from workbook, then put the data into new workbook
Workbook
workbook4Validate
=
reportGenerator
.
createWorkBookByPeriodTemplate
(
resources
.
getPeriodTemplates
(),
genJob
);
copyDataToWorkbook4Validate
(
workbook
,
workbook4Validate
);
...
...
@@ -1019,7 +1022,7 @@ public class ReportServiceImpl extends BaseService {
periodCellTemplateConfigDtos
.
forEach
(
a
->
{
workbook4Validate
.
getSheetAt
(
a
.
getSheetNumber
()
-
1
).
getRow
(
a
.
getRowNumber
()).
getCell
(
a
.
getColNumber
()).
setCellFormula
(
a
.
getParsedValidation
());
});
reportGenerator
.
addFunctionsAndContext
(
workbook4Validate
,
functions
,
reportGenerator
.
initContext
(
resources
,
periodParam
));
reportGenerator
.
addFunctionsAndContext
(
workbook4Validate
,
functions
,
reportGenerator
.
initContext
(
resources
,
periodParam
)
,
true
);
FormulaEvaluator
validateEvaluator
=
workbook4Validate
.
getCreationHelper
().
createFormulaEvaluator
();
validateEvaluator
.
evaluateAll
();
//todo: 4.then save the validation result to cellData table
...
...
@@ -1035,7 +1038,7 @@ public class ReportServiceImpl extends BaseService {
periodCellDataMapper
.
updateByPrimaryKey
(
cellData
.
get
());
}
});
//===============================================end validation compute==============================================================
//===============================================end validation compute==============================================================
==============================================
setStatus
(
genJob
,
STATUS_END
);
periodJobMapper
.
updateByPrimaryKey
(
genJob
);
}
catch
(
Exception
e
)
{
...
...
@@ -2213,11 +2216,10 @@ public class ReportServiceImpl extends BaseService {
}
@Resource
private
PwcReportAttachMapper
pwcReportAttachMapper
;
public
void
bindPwcAttach
(
Long
activeCol
,
Long
activeRow
,
String
activeTemplateId
,
FileUpload
file
,
String
remarks
)
{
public
PwcReportAttach
bindPwcAttach
(
Long
activeCol
,
Long
activeRow
,
String
activeTemplateId
,
FileUpload
file
,
String
remarks
)
{
PwcReportAttach
pwcReportAttach
=
new
PwcReportAttach
();
pwcReportAttach
.
setCol
(
activeCol
);
pwcReportAttach
.
setCreateTime
(
file
.
getCreateTime
());
...
...
@@ -2230,6 +2232,7 @@ public class ReportServiceImpl extends BaseService {
pwcReportAttach
.
setRemarks
(
remarks
);
pwcReportAttachMapper
.
insert
(
pwcReportAttach
);
System
.
out
.
println
(
"==>>>附件绑定成功"
);
return
pwcReportAttach
;
}
public
List
<
PwcReportAttach
>
loadAttachList
(
ReportAttachDto
param
)
{
...
...
@@ -2377,7 +2380,7 @@ public class ReportServiceImpl extends BaseService {
*
* @param requestParameterDto
*/
public
void
manyExport
(
RequestParameterDto
requestParameterDto
,
String
zipFileName
)
throws
URISyntaxException
{
public
void
manyExport
(
RequestParameterDto
requestParameterDto
,
String
zipFileName
,
HttpServletRequest
request
,
HttpServletResponse
response
,
String
zipPath
)
throws
URISyntaxException
{
try
{
FileOutputStream
out
=
new
FileOutputStream
(
zipFileName
);
//要输出的文件名字
}
catch
(
FileNotFoundException
e
)
{
...
...
@@ -2395,7 +2398,6 @@ public class ReportServiceImpl extends BaseService {
filePath
=
this
.
getClass
().
getResource
(
""
).
toURI
().
getPath
();
String
tempPath
=
filePath
.
substring
(
0
,
filePath
.
indexOf
(
"classes"
)
+
"\\classes"
.
length
());
templateFile
=
new
File
(
tempPath
+
templatePath
);
OutputStream
out
=
null
;
//获取当前期间进行过保存更新的机构的数据
EbitCellDataExample
example
=
new
EbitCellDataExample
();
EbitCellDataExample
.
Criteria
criteria
=
example
.
createCriteria
();
...
...
@@ -2449,16 +2451,17 @@ public class ReportServiceImpl extends BaseService {
}
}
workbooksList
.
add
(
workbook
);
//将workbook生成file文件
String
path
=
"\\\\zipDir\\\\"
+
requestParameterDto
.
getPeriod
()
+
Math
.
random
()
+
"利润表"
;
FileExcelUtil
.
downloadZip
(
request
,
response
,
zipFileName
,
FileExcelUtil
.
generateExcelToPath
(
workbook
,
path
),
zipPath
);
}
//将workbook转成流
/* ByteArrayOutputStream bos = new ByteArrayOutputStream();
workbook.write(bos);
byte[] barray = bos.toByteArray();
InputStream is = new ByteArrayInputStream(barray);*/
// FileOutputStream fileOut = new FileOutputStream(path);
// FileOutputStream fileOut = new FileOutputStream(path);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FunctionBase.java
View file @
ee24fd66
...
...
@@ -24,7 +24,7 @@ public class FunctionBase {
,
new
BigDecimal
(
"0.11"
),
new
BigDecimal
(
"0.06"
),
new
BigDecimal
(
"0.05"
),
new
BigDecimal
(
"0.03"
)};
protected
FormulaContext
formulaContext
;
private
static
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
FunctionBase
.
class
);
final
FormulaAgent
agent
;
public
final
FormulaAgent
agent
;
public
FunctionBase
(
FormulaContext
formulaContext
)
{
this
.
formulaContext
=
formulaContext
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/ND.java
View file @
ee24fd66
...
...
@@ -5,10 +5,13 @@ 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.SpringContextUtil
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType
;
import
pwc.taxtech.atms.dto.vatdto.RSUMIFParasBo
;
import
pwc.taxtech.atms.vat.entity.PeriodFormulaBlock
;
import
pwc.taxtech.atms.vat.service.impl.FormulaAgent
;
import
java.
util.Calendar
;
import
java.util.
Date
;
import
java.
math.BigDecimal
;
import
java.util.
*
;
/// <summary>
...
...
@@ -26,6 +29,7 @@ public class ND extends FunctionBase implements FreeRefFunction {
@Override
public
ValueEval
evaluate
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
{
List
<
Object
>
dataSource
=
new
ArrayList
<>();
Calendar
calendar
=
Calendar
.
getInstance
();
Date
creatTime
=
calendar
.
getTime
();
int
value
=
getIntParam
(
args
[
0
],
ec
);
...
...
@@ -34,7 +38,7 @@ public class ND extends FunctionBase implements FreeRefFunction {
String
formulaExpression
=
"ND("
+
value
+
")"
;
value
=
value
+
currentYear
;
logger
.
debug
(
formulaExpression
);
PeriodFormulaBlock
periodFormulaBlock
=
new
PeriodFormulaBlock
();
/*
PeriodFormulaBlock periodFormulaBlock = new PeriodFormulaBlock();
periodFormulaBlock.setId(SpringContextUtil.distributedIdService.nextId());
periodFormulaBlock.setPeriod(formulaContext.getPeriod());
periodFormulaBlock.setReportId(0L);
...
...
@@ -45,7 +49,12 @@ public class ND extends FunctionBase implements FreeRefFunction {
periodFormulaBlock.setCreateTime(creatTime);
periodFormulaBlock.setUpdateTime(creatTime);
periodFormulaBlock.setUpdateBy("Admin");
SpringContextUtil
.
formulaBlockMapper
.
insertSelective
(
periodFormulaBlock
);
SpringContextUtil.formulaBlockMapper.insertSelective(periodFormulaBlock);*/
Long
dataSourceId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
AssetDetailDataSourceDto
,
new
BigDecimal
(
value
),
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
saveFormulaBlock
(
0
,
ec
,
formulaExpression
,
new
BigDecimal
(
value
),
dataSourceId
,
formulaContext
.
getProjectId
());
return
new
NumberEval
(
value
);
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/RSUMIF.java
View file @
ee24fd66
...
...
@@ -9,6 +9,7 @@ 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
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/validation/BB.java
0 → 100644
View file @
ee24fd66
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
.
report
.
functions
.
validation
;
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.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
;
import
pwc.taxtech.atms.common.util.MyAsserts
;
import
pwc.taxtech.atms.dpo.CellTemplatePerGroupDto
;
import
pwc.taxtech.atms.dto.vatdto.BBParasBo
;
import
pwc.taxtech.atms.dto.vatdto.CurrentPeriodBo
;
import
pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto
;
import
pwc.taxtech.atms.entity.Project
;
import
pwc.taxtech.atms.exception.Exceptions
;
import
pwc.taxtech.atms.exception.FormulaException
;
import
pwc.taxtech.atms.vat.entity.PeriodCellData
;
import
pwc.taxtech.atms.vat.entity.PeriodDataSource
;
import
pwc.taxtech.atms.vat.service.impl.report.functions.FormulaContext
;
import
pwc.taxtech.atms.vat.service.impl.report.functions.FunctionBase
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
BB
extends
FunctionBase
implements
FreeRefFunction
{
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
BB
.
class
);
final
static
ValueEval
defaultEval
=
new
StringEval
(
"0"
);
final
static
BigDecimal
defaultBigDecimal
=
new
BigDecimal
(
"0"
);
public
BB
(
FormulaContext
context
)
{
super
(
context
);
}
@Override
public
ValueEval
evaluate
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
{
try
{
return
wrapExceptionEval
(
args
,
ec
);
}
catch
(
Exception
e
)
{
if
(
e
instanceof
FormulaException
)
LOGGER
.
warn
(
"Formula Exception || {}"
,
e
.
getMessage
());
e
.
printStackTrace
();
return
defaultEval
;
}
}
public
ValueEval
wrapExceptionEval
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
throws
Exception
{
List
<
Object
>
ds
=
new
ArrayList
<>();
return
new
NumberEval
(
bb
(
new
BBParasBo
(
args
,
ec
),
ec
,
ds
,
null
).
doubleValue
());
}
public
BigDecimal
bb
(
BBParasBo
bo
,
OperationEvaluationContext
ec
,
List
<
Object
>
dataSource
,
BBParasBo
rootBo
)
throws
Exception
{
CurrentPeriodBo
curPeriod
=
CurrentPeriodBo
.
getPeriod
(
bo
.
getPeriod
().
intValue
(),
formulaContext
.
getPeriod
());
curPeriod
.
fixedCurYear
(
getYear
(
bo
.
getYear
()));
ReportCellDataSourceDto
nullCellDto
=
ReportCellDataSourceDto
.
nullDataSource
(
bo
,
curPeriod
);
dataSource
.
add
(
nullCellDto
);
BigDecimal
cellValue
=
BigDecimal
.
ZERO
;
try
{
if
(
bo
.
getPeriod
().
intValue
()
==
99
)
{
dataSource
.
clear
();
BigDecimal
returnEval
=
defaultBigDecimal
;
if
(
formulaContext
.
getPeriod
()
<=
1
)
{
return
defaultBigDecimal
;
}
//如果是当年取到当期截至,往年取12期
for
(
int
p
=
1
;
p
<=
(
curPeriod
.
getCurYear
()==
formulaContext
.
getYear
()?
formulaContext
.
getPeriod
():
12
);
p
++)
{
try
{
returnEval
=
returnEval
.
add
(
bb
(
new
BBParasBo
(
bo
,
p
,
curPeriod
.
getCurYear
()),
ec
,
dataSource
,
bo
));
}
catch
(
Exception
e
)
{
if
(
e
instanceof
FormulaException
)
{
LOGGER
.
warn
(
"Formula Exception || {}"
,
e
.
getMessage
());
}
}
}
cellValue
=
returnEval
;
return
cellValue
;
}
List
<
CellTemplatePerGroupDto
>
cellTemplateDataList
;
Project
project
=
null
;
if
(
curPeriod
.
getCurYear
()
!=
formulaContext
.
getYear
())
{
project
=
agent
.
getFixedProject
(
formulaContext
.
getProjectId
(),
curPeriod
.
getCurYear
());
// MyAsserts.assertNotNull(project, Exceptions.PROJECT_NOT_FOUND);
if
(
project
==
null
){
return
cellValue
;
}
cellTemplateDataList
=
agent
.
getCellTemplateGroupDto
(
formulaContext
.
getReportTemplateGroupId
(),
project
.
getId
(),
bo
.
getReportCode
(),
bo
.
getRowIndex
()
-
1
,
bo
.
getColumnIndex
()
-
1
,
curPeriod
.
getCurPeriod
());
}
else
{
cellTemplateDataList
=
agent
.
getCellTemplateGroupDto
(
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
(),
bo
.
getReportCode
(),
bo
.
getRowIndex
()
-
1
,
bo
.
getColumnIndex
()
-
1
,
curPeriod
.
getCurPeriod
());
}
// MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
if
(
CollectionUtils
.
isEmpty
(
cellTemplateDataList
)){
return
cellValue
;
}
CellTemplatePerGroupDto
cellTemplateData
=
cellTemplateDataList
.
get
(
0
);
nullCellDto
.
fixedWithGroup
(
cellTemplateData
);
//当年当期
if
((
bo
.
getPeriod
().
intValue
()
==
0
&&
bo
.
getYear
().
intValue
()
==
0
)||
(
bo
.
getYear
().
equals
(
formulaContext
.
getYear
())&&
bo
.
getPeriod
().
equals
(
formulaContext
.
getPeriod
())))
{
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
);
nullCellDto
.
setAmount
(
cellValue
);
return
cellValue
;
}
PeriodCellData
cellData
=
null
;
String
projectId
=
agent
.
getPastProjectId
(
curPeriod
.
getCurYear
(),
formulaContext
.
getOrganizationId
());
MyAsserts
.
assertNotEmpty
(
projectId
,
Exceptions
.
PROJECT_EMPTY
);
cellData
=
agent
.
getCellData
(
cellTemplateData
.
getReportTemplateId
(),
cellTemplateData
.
getCellTemplateId
(),
curPeriod
.
getCurPeriod
(),
project
==
null
?
formulaContext
.
getProjectId
():
project
.
getId
());
List
<
PeriodDataSource
>
dss
=
agent
.
queryManualDataSource
(
Long
.
parseLong
(
cellTemplateData
.
getCellTemplateId
()),
project
==
null
?
formulaContext
.
getProjectId
():
project
.
getId
(),
bo
.
getPeriod
());
nullCellDto
.
extractFromGroup
(
bo
,
curPeriod
,
cellData
,
cellTemplateData
);
if
(
cellData
.
getData
()
==
null
&&
!
dss
.
isEmpty
())
{
cellValue
=
dss
.
get
(
0
).
getAmount
();
}
else
if
(
cellData
.
getData
()
!=
null
&&
dss
.
isEmpty
())
{
cellValue
=
new
BigDecimal
(
cellData
.
getData
()).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_DOWN
);
}
else
if
(
cellData
.
getData
()
!=
null
&&
!
dss
.
isEmpty
())
{
cellValue
=
dss
.
get
(
0
).
getAmount
().
add
(
new
BigDecimal
(
cellData
.
getData
()).
setScale
(
4
,
BigDecimal
.
ROUND_HALF_DOWN
));
}
else
throw
Exceptions
.
BB_CELL_DATA_NULL
;
nullCellDto
.
setAmount
(
cellValue
);
if
(
rootBo
!=
null
)
{
rootBo
.
putPeriodCellTempate
(
curPeriod
.
getCurPeriod
(),
Long
.
parseLong
(
cellTemplateData
.
getCellTemplateId
()));
}
else
{
bo
.
putPeriodCellTempate
(
curPeriod
.
getCurPeriod
(),
Long
.
parseLong
(
cellTemplateData
.
getCellTemplateId
()));
}
LOGGER
.
debug
(
"cell static value "
);
return
cellValue
;
}
catch
(
Exception
e
)
{
logger
.
warn
(
"[BB_Exception] some error {}"
,
bo
.
toString
());
throw
e
;
}
finally
{
if
(
rootBo
==
null
)
{
LOGGER
.
warn
(
"[BB_Exception] error for bb cacls for {} and current for {}"
,
bo
.
toString
(),
curPeriod
.
toString
());
// Long dataSourceId = saveDataSource(ec, dataSource, FormulaDataSourceDetailType.ReportCellDataSourceDto,
// cellValue, formulaContext.getPeriod(),
// formulaContext.getReportTemplateGroupId(), bo.getColumnIndex() - 1, bo.getRowIndex() - 1,
// formulaContext.getProjectId());
// saveFormulaBlock(formulaContext.getPeriod(), ec,
// bo.expression(), cellValue, dataSourceId, formulaContext.getProjectId());
}
}
}
}
atms-web/src/main/webapp/WEB-INF/templates/index.html
View file @
ee24fd66
...
...
@@ -63,7 +63,7 @@
<!--@Html.AntiForgeryToken()-->
<div
class=
"wrapper"
>
<app-nav></app-nav>
<div
class=
"page-wrapper"
style=
"position:relative;overflow
-x:hidden
;margin-top:55px"
>
<div
class=
"page-wrapper"
style=
"position:relative;overflow
:scroll
;margin-top:55px"
>
<div
class=
"main-contents"
ui-view
></div>
<div
class=
"data-import-contents"
ui-view=
"importContent"
></div>
<!--style="display: none"-->
</div>
...
...
atms-web/src/main/webapp/app/analysis/table/tb-ebit-form.html
View file @
ee24fd66
...
...
@@ -2,8 +2,8 @@
<!--Report SpreadJS-->
<div
class=
"row"
style=
" height: 71px; background: #ccc;"
>
<div
class=
"col-sm-7"
style=
" margin-top: 20px;"
>
<div
class=
"col-sm-
6
"
>
<span
class=
"text-bold"
translate=
"SelectedOrganization"
style=
" top: -11px; position: relative;"
>
:
</span>
<div
class=
"col-sm-
8
"
>
<span
class=
"text-bold"
translate=
"SelectedOrganization"
style=
" top: -11px; position: relative;
width: 320px;
"
>
:
</span>
<!-- <div id="dx-select-industry" class="tab-content-select industry " style=" display: inline-block;"
dx-select-box="dataSourceIndustryList" dx-item-alias="itemObj">
<div data-options="dxTemplate: { name: 'orgList' }" class="dx-item-content dx-list-item-content"
...
...
@@ -13,7 +13,7 @@
</div>-->
<div
dx-tag-box=
"selectOrgOptions"
style=
"width: 340px;display: inline-block"
></div>
</div>
<div
class=
"col-sm-
6
"
class=
"dateClass"
>
<div
class=
"col-sm-
4
"
class=
"dateClass"
>
<span
class=
"text-bold"
translate=
"InvoiceQJ"
>
:
</span>
<div
style=
" display: inline-block;"
>
<input
type=
"text"
id=
"ebitDatepacker"
class=
"datepicker"
style=
"width:120px;height: 34px;"
...
...
atms-web/src/main/webapp/app/cit/report/tax-report-cell-detail-modal/tax-report-cell-detail-modal.ctrl.js
View file @
ee24fd66
...
...
@@ -2487,7 +2487,7 @@
{
caption
:
'文件名'
,
dataField
:
"fileName"
,
cellTemplate
:
function
(
container
,
options
)
{
try
{
$
(
'<a href="'
+
options
.
data
.
fileUrl
+
'" target="_blank" style="cursor: pointer">"'
+
options
.
data
.
fileName
+
'"</a> '
)
$
(
'<a href="'
+
options
.
data
.
fileUrl
+
'"
target="_blank" style="cursor: pointer">"'
+
options
.
data
.
fileName
+
'"</a> '
)
.
appendTo
(
container
);
}
catch
(
e
)
{
...
...
@@ -2502,7 +2502,7 @@
{
caption
:
'操作'
,
cellTemplate
:
function
(
container
,
options
)
{
try
{
$
(
'<button type="button" class="btn btn-in-grid" onclick = "deleteAttach('
+
options
.
data
.
id
+
')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>删除</button> '
)
$
(
'<button type="button" class="btn btn-in-grid"
style="margin-top: -11px;"
onclick = "deleteAttach('
+
options
.
data
.
id
+
')"><i class="material-icons middle" style="vertical-align: text-bottom">delete</i>删除</button> '
)
.
appendTo
(
container
);
}
catch
(
e
)
{
...
...
@@ -2665,10 +2665,9 @@
console
.
log
(
'progress: '
+
progressPercentage
+
'% '
);
}).
success
(
function
(
data
,
status
,
headers
,
config
)
{
if
(
data
.
resultMsg
)
{
SweetAlert
.
error
(
data
.
resultMsg
)
re
turn
;
SweetAlert
.
info
(
data
.
resultMsg
)
re
freshAttachData
(
data
)
;
}
refreshAttachData
(
data
);
}).
error
(
function
(
data
,
status
,
headers
,
config
)
{
$
(
'#addCellAttachmentContainer'
).
modal
(
'hide'
);
SweetAlert
.
error
(
status
+
'错误'
+
",上传失败"
)
...
...
atms-web/src/main/webapp/app/cit/report/tax-report-cell-detail-modal/tax-report-cell-detail-modal.html
View file @
ee24fd66
...
...
@@ -22,8 +22,8 @@
<!--{{'ModelAnalysisResults' | translate}}</span>-->
<span
ng-show=
"detail.validationErrorList && detail.validationErrorList.length > 0"
ng-model=
"tabType"
uib-btn-radio=
"3"
><i
class=
"fa fa-exclamation-circle red-color"
></i>
{{'ReportCheckResult' | translate}}
</span>
<span
ng-model=
"tabType"
uib-btn-radio=
"4"
>
{{'cellComment'|translate}}
</span
>
<span
ng-model=
"tabType"
uib-btn-radio=
"5"
ng-click =
"loadAttach()"
>
{{'RelatedAttach'|translate}}
dsdsdsdssd
</span>
<!-- <span ng-model="tabType" uib-btn-radio="4">{{'cellComment'|translate}}</span>--
>
<span
ng-model=
"tabType"
uib-btn-radio=
"5"
ng-click =
"loadAttach()"
>
{{'RelatedAttach'|translate}}
</span>
</div>
<div
class=
"content-info"
ng-show=
"tabType === 1"
>
...
...
atms-web/src/main/webapp/app/common/controls/tax-report-cell-detail-modal/tax-report-cell-detail-modal.ctrl.js
View file @
ee24fd66
...
...
@@ -2514,10 +2514,9 @@
console
.
log
(
'progress: '
+
progressPercentage
+
'% '
);
}).
success
(
function
(
data
,
status
,
headers
,
config
)
{
if
(
data
.
resultMsg
)
{
SweetAlert
.
error
(
data
.
resultMsg
)
re
turn
;
SweetAlert
.
info
(
data
.
resultMsg
)
re
freshAttachData
(
data
)
;
}
refreshAttachData
(
data
);
}).
error
(
function
(
data
,
status
,
headers
,
config
)
{
$
(
'#addCellAttachmentContainer'
).
modal
(
'hide'
);
SweetAlert
.
error
(
status
+
'错误'
+
",上传失败"
)
...
...
atms-web/src/main/webapp/app/common/controls/tax-report-cell-detail-modal/tax-report-cell-detail-modal.html
View file @
ee24fd66
...
...
@@ -22,7 +22,7 @@
<!--{{'ModelAnalysisResults' | translate}}</span>-->
<span
ng-show=
"detail.validationErrorList && detail.validationErrorList.length > 0"
ng-model=
"tabType"
uib-btn-radio=
"3"
><i
class=
"fa fa-exclamation-circle red-color"
></i>
{{'ReportCheckResult' | translate}}
</span>
<span
ng-model=
"tabType"
uib-btn-radio=
"4"
>
{{'cellComment'|translate}}
</span
>
<!-- <span ng-model="tabType" uib-btn-radio="4">{{'cellComment'|translate}}</span>--
>
<span
ng-model=
"tabType"
uib-btn-radio=
"5"
ng-click =
"loadAttach()"
>
{{'RelatedAttach'|translate}}
</span>
</div>
...
...
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