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
64aa2c3b
Commit
64aa2c3b
authored
Mar 28, 2019
by
kevin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#
parent
6059beec
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
413 additions
and
84 deletions
+413
-84
Constant.java
...api/src/main/java/pwc/taxtech/atms/constant/Constant.java
+3
-0
TemplateHeaderCheck.java
...n/java/pwc/taxtech/atms/constant/TemplateHeaderCheck.java
+30
-0
AnalysisController.java
.../java/pwc/taxtech/atms/controller/AnalysisController.java
+3
-1
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+34
-21
TemplateGroupController.java
.../pwc/taxtech/atms/controller/TemplateGroupController.java
+3
-3
RequestParameterDto.java
...c/main/java/pwc/taxtech/atms/dto/RequestParameterDto.java
+71
-0
Exceptions.java
.../src/main/java/pwc/taxtech/atms/exception/Exceptions.java
+1
-0
AnalysisServiceImpl.java
...va/pwc/taxtech/atms/service/impl/AnalysisServiceImpl.java
+0
-0
TemplateGroupServiceImpl.java
...c/taxtech/atms/service/impl/TemplateGroupServiceImpl.java
+24
-7
ExcelUtil.java
.../src/main/java/pwc/taxtech/atms/thirdparty/ExcelUtil.java
+8
-0
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+50
-17
FunctionBase.java
.../atms/vat/service/impl/report/functions/FunctionBase.java
+2
-2
EbitCellDataMapper.java
...ain/java/pwc/taxtech/atms/vat/dao/EbitCellDataMapper.java
+5
-0
EbitCellDataExtendsMapper.xml
...axtech/atms/vat/dao/extends/EbitCellDataExtendsMapper.xml
+64
-0
table-report-sheet.js
...ain/webapp/app/analysis/table/sheet/table-report-sheet.js
+23
-16
tb-ebit-form.ctrl.js
...b/src/main/webapp/app/analysis/table/tb-ebit-form.ctrl.js
+77
-12
tb-ebit-form.html
...-web/src/main/webapp/app/analysis/table/tb-ebit-form.html
+4
-4
vatReportService.js
...rc/main/webapp/app/common/vatservices/vatReportService.js
+11
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/constant/Constant.java
View file @
64aa2c3b
...
...
@@ -156,4 +156,6 @@ public final class Constant {
this
.
segment6
=
segment6
;
}
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/constant/TemplateHeaderCheck.java
0 → 100644
View file @
64aa2c3b
package
pwc
.
taxtech
.
atms
.
constant
;
/**
* @ClassName TemplateHeaderCheck
* Description TODO
* @Author pwc kevin
* @Date 3/28/2019 12:17 PM
* Version 1.0
**/
public
class
TemplateHeaderCheck
{
public
static
String
[]
sjfhse
=
{
"公司名称"
,
"增值税返还"
,
"城建税返还"
,
"教育费附加返还"
,
"地方教育费附加返还"
,
"个人所得税返还"
};
public
static
String
[]
gszse
=
{
"公司名称"
,
"城建税"
,
"教育费附加"
,
"地方教育费附加"
,
"员工个税"
,
"司机个税"
,
"印花税"
};
//业务线GMV
public
static
String
[]
ywxgmv
=
{
"业务线"
,
"订单环比"
,
"GMV环比"
,
"B端补贴率"
,
"B端环比"
,
"C端补贴率"
,
"C端环比"
};
//职工人数
public
static
String
[]
zgrs
=
{
"公司简称"
,
"正式员工"
,
"实习生"
,
"外包"
,
"合计"
};
//司机人数
public
static
String
[]
sjrs
=
{
"司機類型"
,
"合计"
};
}
atms-api/src/main/java/pwc/taxtech/atms/controller/AnalysisController.java
View file @
64aa2c3b
...
...
@@ -87,7 +87,9 @@ public class AnalysisController extends BaseController {
}
return
analysisServiceImpl
.
importDomesitcExcelFile
(
file
,
period
,
type
);
}
catch
(
ServiceException
e
)
{
return
OperationResultDto
.
error
(
e
.
getMessage
());
String
message
=
e
.
getMessage
();
String
[]
split
=
message
.
split
(
":"
);
return
OperationResultDto
.
error
(
split
[
1
]);
}
catch
(
Exception
e
)
{
logger
.
error
(
"importDomesitcExcelFile error."
,
e
);
return
OperationResultDto
.
error
(
ErrorMessage
.
SystemError
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
64aa2c3b
...
...
@@ -10,10 +10,7 @@ import pwc.taxtech.atms.constant.enums.EnumServiceType;
import
pwc.taxtech.atms.dao.OrganizationMapper
;
import
pwc.taxtech.atms.dao.ProjectMapper
;
import
pwc.taxtech.atms.dpo.ReportDto
;
import
pwc.taxtech.atms.dto.FileDto
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.PeriodReportDto
;
import
pwc.taxtech.atms.dto.ReportAttachDto
;
import
pwc.taxtech.atms.dto.*
;
import
pwc.taxtech.atms.dto.vatdto.*
;
import
pwc.taxtech.atms.entity.OrganizationExample
;
import
pwc.taxtech.atms.entity.Project
;
...
...
@@ -88,14 +85,14 @@ public class ReportController {
private
static
OperationResultDto
<
ReportDataDto
>
operationResultDto
=
null
;
@RequestMapping
(
value
=
"reportEbitData"
,
method
=
RequestMethod
.
GE
T
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
<
ReportDataDto
>
reportEbitData
(
Long
reportId
,
String
orgId
,
Integer
period
)
{
OperationResultDto
resultDto
=
new
OperationResultDto
();
if
(
reportId
==
null
||
reportId
==
0L
)
{
@RequestMapping
(
value
=
"reportEbitData"
,
method
=
RequestMethod
.
POS
T
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
<
ReportDataDto
>
reportEbitData
(
@RequestBody
RequestParameterDto
requestParameterDto
)
{
/*
OperationResultDto resultDto = new OperationResultDto();
*//* if (requestParameterDto.getProjectId() == null || requestParameterDto.getReportId() == null
) {
resultDto.setResult(false);
return resultDto;
}
operationResultDto
=
reportService
.
getCellData
(
reportId
,
orgId
,
period
);
}
*/
operationResultDto
=
reportService
.
getCellData
(
Long
.
parseLong
(
requestParameterDto
.
getReportId
()),
requestParameterDto
.
getOrgId
(),
requestParameterDto
.
getPeriod
()
);
return
operationResultDto
;
}
...
...
@@ -140,16 +137,9 @@ public class ReportController {
}
@RequestMapping
(
value
=
"getReportByTemplateEbit/{templateId}/{period}/{orgId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
<
PeriodReportDto
>
getReportByTemplateEbit
(
@PathVariable
String
templateId
,
@PathVariable
Integer
period
,
@PathVariable
String
orgId
)
{
OperationResultDto
resultDto
=
new
OperationResultDto
();
if
(
templateId
==
null
||
period
==
null
||
period
==
0
)
{
resultDto
.
setResult
(
false
);
resultDto
.
setResultMsg
(
"templateId or period is invalid"
);
return
resultDto
;
}
return
reportService
.
getReportByTemplateEbit
(
Long
.
parseLong
(
templateId
),
period
%
100
,
getProjId
(
orgId
,
period
));
}
@RequestMapping
(
value
=
"getCellTemplateConfig/{reportTemplateId}/{period}/{rowIndex}/{columnIndex}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
<
PeriodCellTemplateConfig
>
getCellTemplateConfig
(
@PathVariable
Long
reportTemplateId
,
...
...
@@ -226,7 +216,6 @@ public class ReportController {
@RequestMapping
(
"loadAttachList"
)
public
List
<
PwcReportAttach
>
loadAttachList
(
@RequestBody
ReportAttachDto
reportAttachDto
)
{
System
.
out
.
println
(
"sdsdfsd"
);
return
reportService
.
loadAttachList
(
reportAttachDto
);
}
...
...
@@ -246,4 +235,27 @@ public class ReportController {
return
operationResultDto
;
}
@RequestMapping
(
value
=
"getReportByTemplateEbit/{templateId}/{period}/{orgId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
<
PeriodReportDto
>
getReportByTemplateEbit
(
@PathVariable
String
templateId
,
@PathVariable
Integer
period
,
@PathVariable
String
orgId
)
{
OperationResultDto
resultDto
=
new
OperationResultDto
();
if
(
templateId
==
null
||
period
==
null
||
period
==
0
)
{
resultDto
.
setResult
(
false
);
resultDto
.
setResultMsg
(
"templateId or period is invalid"
);
return
resultDto
;
}
return
reportService
.
getReportByTemplateEbit
(
Long
.
parseLong
(
templateId
),
period
%
100
,
getProjId
(
orgId
,
period
));
}
/**
*批量导出利润表
*/
@RequestMapping
(
"manyExport"
)
public
OperationResultDto
manyExport
(
@RequestBody
RequestParameterDto
requestParameterDto
){
OperationResultDto
operationResultDto
=
new
OperationResultDto
();
operationResultDto
.
setResult
(
null
);
return
operationResultDto
;
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/controller/TemplateGroupController.java
View file @
64aa2c3b
...
...
@@ -145,9 +145,9 @@ public class TemplateGroupController {
@ResponseBody
@RequestMapping
(
value
=
"ebitTemplateImport"
,
method
=
RequestMethod
.
POST
)
public
OperationResultDto
ebitTemplateImport
(
@RequestParam
MultipartFile
file
,
@RequestParam
String
orgId
,
@RequestParam
Integer
period
)
{
public
OperationResultDto
ebitTemplateImport
(
@RequestParam
(
"file"
)
MultipartFile
file
,
@RequestParam
(
"orgId"
)
String
orgId
,
@RequestParam
(
"period"
)
Integer
period
)
{
try
{
templateGroupService
.
ebitTemplateImport
(
file
,
orgId
,
period
);
return
OperationResultDto
.
success
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/dto/RequestParameterDto.java
0 → 100644
View file @
64aa2c3b
package
pwc
.
taxtech
.
atms
.
dto
;
import
java.io.Serializable
;
/**
* @ClassName RequestParameterDto
* Description TODO
* @Author pwc kevin
* @Date 3/27/2019 6:38 PM
* Version 1.0
* 请求参数封装
**/
public
class
RequestParameterDto
implements
Serializable
{
private
String
reportId
;
private
String
orgId
;
private
Integer
period
;
private
String
templateId
;
private
String
projectId
;
public
String
getReportId
()
{
return
reportId
;
}
public
void
setReportId
(
String
reportId
)
{
this
.
reportId
=
reportId
;
}
public
String
getOrgId
()
{
return
orgId
;
}
public
void
setOrgId
(
String
orgId
)
{
this
.
orgId
=
orgId
;
}
public
Integer
getPeriod
()
{
return
period
;
}
public
void
setPeriod
(
Integer
period
)
{
this
.
period
=
period
;
}
public
String
getTemplateId
()
{
return
templateId
;
}
public
void
setTemplateId
(
String
templateId
)
{
this
.
templateId
=
templateId
;
}
public
String
getProjectId
()
{
return
projectId
;
}
public
void
setProjectId
(
String
projectId
)
{
this
.
projectId
=
projectId
;
}
@Override
public
String
toString
()
{
return
"RequestParameterDto{"
+
"reportId='"
+
reportId
+
'\''
+
", orgId='"
+
orgId
+
'\''
+
", period="
+
period
+
", templateId='"
+
templateId
+
'\''
+
", projectId='"
+
projectId
+
'\''
+
'}'
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/exception/Exceptions.java
View file @
64aa2c3b
...
...
@@ -23,4 +23,5 @@ public class Exceptions {
public
static
final
FormulaException
PSUM_CELL_TEMP_NULL
=
new
FormulaException
(
"cell template group is null or empty"
);
public
static
final
ApiException
NOT_FOUND_INSTANCE_EXCEPTION
=
new
NotFoundException
(
"not found instance"
);
public
static
final
FormulaException
parameterError
=
new
FormulaException
(
"formula parameter is error"
);
public
static
final
FormulaException
IMPORT_TEMPLATE_HEADER_ERROR
=
new
FormulaException
(
"导入模板不匹配"
);
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/AnalysisServiceImpl.java
View file @
64aa2c3b
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TemplateGroupServiceImpl.java
View file @
64aa2c3b
...
...
@@ -27,6 +27,7 @@ import pwc.taxtech.atms.dto.OperationResultDto;
import
pwc.taxtech.atms.dto.TemplateGroupDto
;
import
pwc.taxtech.atms.entity.*
;
import
pwc.taxtech.atms.exception.ServiceException
;
import
pwc.taxtech.atms.vat.dao.EbitCellDataMapper
;
import
pwc.taxtech.atms.vat.dao.PeriodDataSourceMapper
;
import
pwc.taxtech.atms.vat.entity.*
;
...
...
@@ -63,6 +64,9 @@ public class TemplateGroupServiceImpl extends AbstractService {
@Autowired
private
DidiFileUploadService
didiFileUploadService
;
@Autowired
protected
DistributedIdService
idService
;
public
List
<
TemplateGroupDto
>
get
()
{
List
<
TemplateGroup
>
templateGroups
=
templateGroupMapper
.
selectByExample
(
new
TemplateGroupExample
());
List
<
TemplateGroupDto
>
templateGroupDtos
=
new
ArrayList
<>();
...
...
@@ -196,7 +200,10 @@ public class TemplateGroupServiceImpl extends AbstractService {
public
static
final
String
PROTABLEID
=
"100610523201314816"
;
public
void
ebitTemplateImport
(
MultipartFile
file
,
String
orgId
,
Integer
period
)
{
@Autowired
private
EbitCellDataMapper
ebitCellDataMapper
;
public
OperationResultDto
ebitTemplateImport
(
MultipartFile
file
,
String
orgId
,
Integer
period
)
{
OperationResultDto
operationResultDto
=
new
OperationResultDto
();
InputStream
inputStream
=
null
;
Date
now
=
new
Date
();
String
projectId
=
getProjId
(
orgId
,
period
);
...
...
@@ -216,29 +223,39 @@ public class TemplateGroupServiceImpl extends AbstractService {
if
(
period
==
null
)
{
throw
new
ServiceException
(
ErrorMessageCN
.
DoNotSelectPeriod
);
}
//判断是否已经上传
EbitCellDataExample
example
=
new
EbitCellDataExample
();
EbitCellDataExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andPeriodEqualTo
(
period
).
andOrganizationIdEqualTo
(
orgId
);
if
(
ebitCellDataMapper
.
selectByExample
(
example
).
size
()
!=
0
){
ebitCellDataMapper
.
deleteByExample
(
example
);
}
for
(
int
j
=
1
;
j
<=
sheet
.
getRow
(
0
).
getLastCellNum
();
j
++)
{
for
(
int
m
=
1
;
j
<
sheet
.
getLastRowNum
();
j
++)
{
if
(
j
==
2
||
j
==
3
)
{
if
(
j
==
1
||
j
==
2
)
{
EbitCellData
ebitCellData
=
new
EbitCellData
();
ebitCellData
.
setId
(
idService
.
nextId
());
ebitCellData
.
setCol
(
j
);
ebitCellData
.
setRow
(
m
);
ebitCellData
.
setCreateTime
(
now
);
ebitCellData
.
setData
(
sheet
.
getRow
(
m
).
getCell
(
j
).
getStringCellValue
());
ebitCellData
.
setTemplateId
(
PROTABLEID
);
ebitCellData
.
setProjectId
(
projectId
);
ebitCellData
.
setOrganizationId
(
orgId
);
ebitCellData
.
setPeriod
(
period
);
list
.
add
(
ebitCellData
);
}
}
}
ebitCellDataMapper
.
insertBatch
(
list
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
catch
(
InvalidFormatException
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
operationResultDto
.
setResult
(
false
);
}
operationResultDto
.
setResult
(
true
);
return
operationResultDto
;
}
public
class
TemplateGroupMessage
{
...
...
atms-api/src/main/java/pwc/taxtech/atms/thirdparty/ExcelUtil.java
View file @
64aa2c3b
...
...
@@ -771,4 +771,12 @@ public class ExcelUtil {
}
}
//验证表头
public
static
void
checkHeader
(
Sheet
sheet
,
String
[]
headerArr
,
Exception
exception
)
throws
Exception
{
for
(
int
i
=
0
;
i
<
headerArr
.
length
;
i
++){
if
(!(
headerArr
[
i
].
trim
().
equals
(
sheet
.
getRow
(
0
).
getCell
(
i
).
toString
().
trim
()))){
throw
exception
;
}
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
64aa2c3b
...
...
@@ -1077,45 +1077,78 @@ public class ReportServiceImpl extends BaseService {
}
public
OperationResultDto
<
ReportDataDto
>
getCellData
(
Long
reportId
,
String
orgId
,
Integer
period
)
{
orgId
=
"5bbd739c-1a13-4b0f-aba6-32ba41e4de69"
;
OperationResultDto
<
ReportDataDto
>
cellData
=
getCellData
(
reportId
,
getProjId
(
orgId
,
period
));
cellData
.
getData
().
setEbitData
(
loadEbitDataFirst
(
orgId
,
period
));
//特殊因素考虑 默认为0 rate 默认为1%
EbitDataDto
ebitDataDto
=
loadEbitDataFirst
(
orgId
,
period
);
if
(
ebitDataDto
!=
null
)
{
cellData
.
getData
().
setEbitData
(
ebitDataDto
);
}
else
{
//特殊因素考虑 默认为0 rate 默认为1%
EbitDataDto
ebitDataDto1
=
loadEbitData
(
orgId
,
period
,
0
,
"1%"
);
if
(
ebitDataDto1
!=
null
)
if
(
cellData
.
getData
()
!=
null
){
cellData
.
getData
().
setEbitData
(
ebitDataDto1
);
}
else
{
ReportDataDto
reportDataDto
=
new
ReportDataDto
();
reportDataDto
.
setEbitData
(
ebitDataDto1
);
cellData
.
setData
(
reportDataDto
);
return
cellData
;
}
}
return
cellData
;
}
public
EbitDataDto
loadEbitDataFirst
(
String
orgId
,
Integer
period
){
public
EbitDataDto
loadEbitDataFirst
(
String
orgId
,
Integer
period
)
{
EbitDataDto
ebitDataDto
=
new
EbitDataDto
();
EbitCellDataExample
example
=
new
EbitCellDataExample
();
EbitCellDataExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andOrganizationIdEqualTo
(
orgId
);
criteria
.
andPeriodEqualTo
(
period
);
List
<
EbitCellData
>
ebitCellData
=
ebitCellDataMapper
.
selectByExample
(
example
);
for
(
EbitCellData
ebitCellData1
:
ebitCellData
){
switch
(
ebitCellData1
.
getRow
()){
case
37
:
boolean
bool
=
false
;
for
(
EbitCellData
ebitCellData1
:
ebitCellData
)
{
bool
=
true
;
switch
(
ebitCellData1
.
getRow
())
{
case
37
:
if
(
ebitCellData1
.
getData
()
==
null
)
break
;
ebitDataDto
.
setSpecialConsiderations
(
ebitCellData1
.
getData
());
break
;
case
38
:
case
38
:
if
(
ebitCellData1
.
getData
()
==
null
)
break
;
ebitDataDto
.
setSpecialConsiderations
(
ebitCellData1
.
getData
());
break
;
case
39
:
case
39
:
if
(
ebitCellData1
.
getData
()
==
null
)
break
;
ebitDataDto
.
setSpecialFactors
(
new
BigDecimal
(
ebitCellData1
.
getData
()));
break
;
case
40
:
case
40
:
if
(
ebitCellData1
.
getData
()
==
null
)
break
;
ebitDataDto
.
setEbitRate
(
Double
.
parseDouble
(
ebitCellData1
.
getData
()));
break
;
case
41
:
case
41
:
if
(
ebitCellData1
.
getData
()
==
null
)
break
;
ebitDataDto
.
setTransactionAmount
(
new
BigDecimal
(
ebitCellData1
.
getData
()));
break
;
case
42
:
case
42
:
if
(
ebitCellData1
.
getData
()
==
null
)
break
;
ebitDataDto
.
setSixAddTax
(
ebitCellData1
.
getData
());
break
;
case
43
:
case
43
:
if
(
ebitCellData1
.
getData
()
==
null
)
break
;
ebitDataDto
.
setTotalAmountTax
(
new
BigDecimal
(
ebitCellData1
.
getData
()));
break
;
}
}
return
ebitDataDto
;
if
(!
bool
)
return
null
;
return
ebitDataDto
;
}
public
OperationResultDto
<
ReportDataDto
>
getCellData
(
Long
reportId
,
String
projectId
)
{
...
...
@@ -1344,7 +1377,7 @@ public class ReportServiceImpl extends BaseService {
spec
=
new
BigDecimal
(
specialConsiderations
);
if
(
_index
!=
-
1
)
{
rate
=
Double
.
parseDouble
(
ebitRate
.
substring
(
0
,
_index
-
1
))
/
100
;
rate
=
Double
.
parseDouble
(
ebitRate
.
substring
(
0
,
_index
))
/
100
;
}
else
{
rate
=
Double
.
parseDouble
(
ebitRate
)
/
100
;
}
...
...
@@ -1353,7 +1386,7 @@ public class ReportServiceImpl extends BaseService {
ProfitLossStatementExample
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andOrganizationIdEqualTo
(
orgId
);
criteria
.
andPeriodEqualTo
(
period
);
List
<
ProfitLossStatement
>
profitLossStatements
=
profitLossStatementFinalMapper
.
selectBy
Condition
(
example
);
List
<
ProfitLossStatement
>
profitLossStatements
=
profitLossStatementFinalMapper
.
selectBy
Example
(
example
);
BigDecimal
yysr
=
new
BigDecimal
(
0
);
//营业收入
BigDecimal
yycb
=
new
BigDecimal
(
0
);
//营业成本
BigDecimal
yysjfj
=
new
BigDecimal
(
0
);
//营业税金附加
...
...
@@ -1474,7 +1507,7 @@ public class ReportServiceImpl extends BaseService {
Optional
<
PeriodReport
>
report
=
periodReportMapper
.
selectByExample
(
example
).
stream
().
findFirst
();
if
(
report
.
isPresent
())
{
PeriodReportDto
periodReportDto
=
new
PeriodReportDto
();
BeanUtils
.
copyProperties
(
report
,
periodReportDto
);
BeanUtils
.
copyProperties
(
report
.
get
()
,
periodReportDto
);
resultDto
.
setResult
(
true
);
resultDto
.
setData
(
periodReportDto
);
}
else
{
...
...
@@ -2086,7 +2119,7 @@ public class ReportServiceImpl extends BaseService {
criteria
.
andRowEqualTo
(
i
);
List
<
EbitCellData
>
ebitCellData
=
ebitCellDataMapper
.
selectByExample
(
example
);
if
(
ebitCellData
.
size
()
==
0
)
{
ebitCellDataMapper
.
insert
(
switchMeth
(
i
,
new
EbitCellData
(),
operationResultDto
,
specialConsiderations
,
ebitRate
,
orgId
,
period
));
ebitCellDataMapper
.
insert
(
switchMeth
(
i
,
new
EbitCellData
(),
operationResultDto
,
specialConsiderations
,
ebitRate
,
orgId
,
period
));
}
else
{
ebitCellDataMapper
.
updateByExampleSelective
(
switchMeth
(
i
,
new
EbitCellData
(),
operationResultDto
,
specialConsiderations
,
ebitRate
,
orgId
,
period
),
example
);
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/FunctionBase.java
View file @
64aa2c3b
...
...
@@ -229,9 +229,9 @@ public class FunctionBase {
List
<
PeriodDataSource
>
dss
=
agent
.
queryManualDataSource
(
cellTemplateId
,
formulaContext
.
getProjectId
(),
formulaContext
.
getPeriod
());
if
(
eval
instanceof
ErrorEval
||
eval
==
null
||
eval
instanceof
BlankEval
)
{
if
(
eval
!=
null
&&
eval
instanceof
ErrorEval
){
if
(
eval
!=
null
&&
eval
instanceof
ErrorEval
){
ErrorEval
LOGGER
.
warn
(
"[Formula_Exception] error eval for cell {} and error code {} and error String {}"
,
cellTemplateId
,
((
ErrorEval
)
eval
).
getErrorCode
(),
((
ErrorEval
)
eval
).
getErrorString
());
((
ErrorEval
)
eval
).
getErrorCode
(),
(()
eval
).
getErrorString
());
}
if
(!
dss
.
isEmpty
())
return
dss
.
get
(
0
).
getAmount
();
}
else
{
...
...
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/EbitCellDataMapper.java
View file @
64aa2c3b
...
...
@@ -7,6 +7,7 @@ import org.apache.ibatis.session.RowBounds;
import
pwc.taxtech.atms.MyVatMapper
;
import
pwc.taxtech.atms.vat.entity.EbitCellData
;
import
pwc.taxtech.atms.vat.entity.EbitCellDataExample
;
import
pwc.taxtech.atms.vat.entity.ProfitLossStatement
;
@Mapper
public
interface
EbitCellDataMapper
extends
MyVatMapper
{
...
...
@@ -105,4 +106,7 @@ public interface EbitCellDataMapper extends MyVatMapper {
* @mbg.generated
*/
int
updateByPrimaryKey
(
EbitCellData
record
);
int
insertBatch
(
List
<
EbitCellData
>
pls
);
}
\ No newline at end of file
atms-dao/src/main/resources/pwc/taxtech/atms/vat/dao/extends/EbitCellDataExtendsMapper.xml
0 → 100644
View file @
64aa2c3b
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"pwc.taxtech.atms.vat.dao.EbitCellDataMapper"
>
<sql
id=
"Base_Column_List_Ebit"
>
id, template_id, `data`, organization_id, project_id, row, col,
period, create_time, update_time
</sql>
<insert
id=
"insertBatch"
parameterType=
"java.util.List"
>
insert into profit_loss_statement_manual
(
<include
refid=
"Base_Column_List_Ebit"
/>
)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<choose>
<when
test=
"item.id != null"
>
#{item.id,jdbcType=BIGINT},
</when>
<otherwise>
0,
</otherwise>
</choose>
<choose>
<when
test=
"item.templateId != null"
>
#{item.templateId,jdbcType=VARCHAR},
</when>
<otherwise>
'',
</otherwise>
</choose>
<choose>
<when
test=
"item.data != null"
>
#{item.data,jdbcType=VARCHAR},
</when>
<otherwise>
'',
</otherwise>
</choose>
<choose>
<when
test=
"item.organizationId != null"
>
#{item.organizationId,jdbcType=VARCHAR},
</when>
<otherwise>
'',
</otherwise>
</choose>
<choose>
<when
test=
"item.projectId != null"
>
#{item.projectId,jdbcType=VARCHAR},
</when>
<otherwise>
'',
</otherwise>
</choose>
<choose>
<when
test=
"item.row != null"
>
#{item.row,jdbcType=INTEGER},
</when>
<otherwise>
'',
</otherwise>
</choose>
<choose>
<when
test=
"item.col != null"
>
#{item.col,jdbcType=INTEGER},
</when>
<otherwise>
'',
</otherwise>
</choose>
<choose>
<when
test=
"item.period != null"
>
#{item.period,jdbcType=INTEGER},
</when>
<otherwise>
0,
</otherwise>
</choose>
<choose>
<when
test=
"item.createTime != null"
>
#{item.createTime,jdbcType=TIMESTAMP},
</when>
<otherwise>
CURRENT_TIMESTAMP,
</otherwise>
</choose>
<choose>
<when
test=
"item.updateTime != null"
>
#{item.updateTime,jdbcType=TIMESTAMP},
</when>
<otherwise>
CURRENT_TIMESTAMP
</otherwise>
</choose>
</trim>
</foreach>
;
SELECT 1 FROM DUAL;
</insert>
</mapper>
\ No newline at end of file
atms-web/src/main/webapp/app/analysis/table/sheet/table-report-sheet.js
View file @
64aa2c3b
...
...
@@ -38,7 +38,7 @@
});
scope
.
$watchGroup
([
'reportSource'
,
'formulaBlocks'
,
'manualDataSources'
,
'templateId'
],
function
(
newVal
,
oldValue
)
{
if
(
scope
.
templateId
&&
scope
.
reportSource
&&
scope
.
hasLoadSpread
)
{
if
(
scope
.
templateId
&&
scope
.
reportSource
)
{
setData
();
}
});
...
...
@@ -85,9 +85,9 @@
}
};
scope
.
$watchGroup
([
'relation.period'
,
'relation.orgId'
,
'relation.data'
],
function
(
newValue
,
oldValue
){
scope
.
$watchGroup
([
'relation.period'
,
'relation.orgId'
,
'relation.data'
,
'relation.broadcast'
],
function
(
newValue
,
oldValue
){
if
(
scope
.
relation
.
orgId
!=
null
&&
scope
.
relation
.
period
!=
null
&&
scope
.
spread
!=
undefined
){
setData
(
"true"
)
loadSheet
(
scope
.
templateId
,
true
)
}
});
var
loadSheet
=
function
(
templateId
,
init
)
{
...
...
@@ -177,10 +177,19 @@
}
spread
.
resumePaint
();
scope
.
spread
=
spread
;
if
(
scope
.
templateId
&&
scope
.
reportSource
&&
scope
.
hasLoadSpread
)
{
setData
(
"false"
);
if
(
scope
.
templateId
&&
scope
.
reportSource
)
{
setData
(
"true"
);
}
//
sheet
.
setColumnWidth
(
0
,
350
)
//添加单元格
sheet
.
addRows
(
sheet
.
getRowCount
(
scope
.
relation
.
sheetArea
.
viewport
),
1
);
sheet
.
addRows
(
sheet
.
getRowCount
(
scope
.
relation
.
sheetArea
.
viewport
),
1
);
sheet
.
addRows
(
sheet
.
getRowCount
(
scope
.
relation
.
sheetArea
.
viewport
),
1
);
for
(
var
i
=
0
;
i
<=
7
;
i
++
){
sheet
.
addRows
(
sheet
.
getRowCount
(
scope
.
relation
.
sheetArea
.
viewport
),
1
);
sheet
.
setValue
(
i
+
37
,
0
,
profileList
[
i
]);
}
return
$q
.
when
(
spread
);
};
...
...
@@ -346,6 +355,7 @@
// Get spreadJS control.
var
getSpreadControl
=
function
()
{
scope
.
relation
.
sheetArea
=
GC
.
Spread
.
Sheets
.
SheetArea
;
return
new
GC
.
Spread
.
Sheets
.
Workbook
(
getSpreadControlElement
());
};
...
...
@@ -525,30 +535,27 @@
var
loadEbitCell
=
function
(
sheet
,
type
){
for
(
var
r
=
37
;
r
<=
43
;
r
++
){
for
(
var
c
=
1
;
c
<=
3
;
c
++
){
if
(
c
==
1
){
sheet
.
setValue
(
r
,
c
,
profileList
[
r
-
37
]);
}
if
(
c
==
3
&&
type
){
if
(
r
==
37
){
sheet
.
setValue
(
r
,
c
,
scope
.
relation
.
data
.
ebitSubtraction
);
sheet
.
setValue
(
r
,
c
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
ebitSubtraction
)
);
}
if
(
r
==
38
){
sheet
.
setValue
(
r
,
c
,
scope
.
relation
.
data
.
specialConsiderations
);
sheet
.
setValue
(
r
,
c
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
specialConsiderations
)
);
}
if
(
r
==
39
){
sheet
.
setValue
(
r
,
c
,
scope
.
relation
.
data
.
specialFactors
);
sheet
.
setValue
(
r
,
c
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
specialFactors
)
);
}
if
(
r
==
40
){
sheet
.
setValue
(
r
,
c
,
scope
.
relation
.
data
.
ebitRate
);
sheet
.
setValue
(
r
,
c
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
ebitRate
)
);
}
if
(
r
==
41
){
sheet
.
setValue
(
r
,
c
,
scope
.
relation
.
data
.
transactionAmount
);
sheet
.
setValue
(
r
,
c
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
transactionAmount
)
);
}
if
(
r
==
42
){
sheet
.
setValue
(
r
,
c
,
scope
.
relation
.
data
.
sixAddTax
);
sheet
.
setValue
(
r
,
c
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
sixAddTa
)
);
}
if
(
r
==
43
){
sheet
.
setValue
(
r
,
c
,
scope
.
relation
.
data
.
totalAmountTax
);
sheet
.
setValue
(
r
,
c
,
PWC
.
tryParseStringToNum
(
scope
.
relation
.
data
.
totalAmountTax
)
);
}
}
}
...
...
atms-web/src/main/webapp/app/analysis/table/tb-ebit-form.ctrl.js
View file @
64aa2c3b
...
...
@@ -1099,8 +1099,8 @@
BSPLService
.
getReportData
();
};
var
getReportData
=
function
(
cb
)
{
vatReportService
.
getReportEbitData
(
$scope
.
reportId
,
$scope
.
relation
.
orgId
,
$scope
.
relation
.
period
).
success
(
function
(
reportData
)
{
var
getReportData
=
function
(
cb
,
period
)
{
vatReportService
.
getReportEbitData
(
$scope
.
reportId
,
$scope
.
relation
.
orgId
,
$scope
.
relation
.
period
==
undefined
?
period
:
$scope
.
relation
.
period
).
success
(
function
(
reportData
)
{
if
(
reportData
&&
reportData
.
data
&&
reportData
.
data
.
cellData
)
{
_
.
each
(
reportData
.
data
.
cellData
,
function
(
x
)
{
x
.
value
=
x
.
cellValue
;
...
...
@@ -1110,14 +1110,17 @@
$scope
.
formulaBlocks
=
reportData
.
data
.
formulaBlocks
;
$scope
.
manualDataSources
=
reportData
.
data
.
manualDataSources
;
$scope
.
relation
.
data
=
reportData
.
data
.
ebitData
;
cb
();
if
(
cb
)
cb
();
}
else
{
$scope
.
reportData
=
[];
$scope
.
formulaBlocks
=
[];
$scope
.
manualDataSources
=
[];
$scope
.
relation
.
data
=
reportData
.
data
.
ebitData
;
if
(
cb
)
cb
();
}
});
};
var
loadCellData
=
function
(
period
,
orgId
,
cb
)
{
...
...
@@ -1127,7 +1130,7 @@
vatReportService
.
getReportByTemplateIdEbit
(
$scope
.
templateId
,
period
,
orgId
).
success
(
function
(
report
)
{
if
(
report
.
result
)
{
$scope
.
reportId
=
report
.
data
.
id
;
getReportData
(
cb
);
getReportData
(
cb
,
period
);
}
else
if
(
!
(
report
.
result
&&
report
.
data
))
{
$scope
.
reportData
=
[];
$scope
.
formulaBlocks
=
[];
...
...
@@ -2849,7 +2852,6 @@
});
},
onInitialized
:
function
(
e
)
{
debugger
;
$scope
.
dataSourceIndustryListInstance
=
e
.
component
;
}
}
...
...
@@ -2923,7 +2925,6 @@
$scope
.
relation
.
data
=
res
.
data
;
}
}).
error
(
function
(
error
){
deferred
.
reject
(
error
);
});
}
...
...
@@ -2931,29 +2932,93 @@
$scope
.
upload
(
$scope
.
file
);
});
//上传模板
//Upload.setDefaults( {ngf-keep:false ngf-accept:'image/*', ...} );
$scope
.
upload
=
function
(
file
)
{
if
(
file
==
null
)
return
frontImport
(
file
);
var
token
=
$
(
'input[name="__RequestVerificationToken"]'
).
val
();
var
url
=
apiInterceptor
.
w
ebApiHostUrl
+
'/templateGroup/ebitTemplateImport'
;
var
url
=
apiInterceptor
.
vatW
ebApiHostUrl
+
'/templateGroup/ebitTemplateImport'
;
Upload
.
upload
(
{
url
:
url
,
fields
:
{
orgId
:
$scope
.
relation
.
orgId
,
period
:
$scope
.
relation
.
period
},
file
:
file
,
data
:
{
orgId
:
$scope
.
relation
.
orgId
,
period
:
$scope
.
relation
.
period
},
file
:
file
,
headers
:
{
'Access-Control-Allow-Origin'
:
'*'
,
Authorization
:
apiInterceptor
.
tokenType
+
' '
+
apiInterceptor
.
apiToken
()
},
__RequestVerificationToken
:
token
,
},
__RequestVerificationToken
:
token
,
withCredentials
:
true
})
.
progress
(
function
(
evt
)
{
})
.
success
(
function
(
data
,
status
,
headers
,
config
)
{
SweetAlert
.
error
(
"上传成功"
);
$scope
.
relation
.
fileName
=
config
.
file
.
name
;
vatReportService
.
frontImportBack
().
success
(
function
(
res
){
getReportData
(
function
(){
$scope
.
relation
.
broadcast
=
true
;
},
$scope
.
relation
.
period
);
});
})
.
error
(
function
(
data
,
status
,
headers
,
config
)
{
SweetAlert
.
error
(
status
+
'错误'
+
",上传失败"
)
})
};
//前端导入
var
frontImport
=
function
(
file
){
alert
(
typeof
file
);
if
(
typeof
file
!=
Blob
){
file
=
new
Blob
(
file
);
}
if
(
$scope
.
spread
!=
undefined
&&
$scope
.
spread
){
var
excelIo
=
new
GC
.
Spread
.
Excel
.
IO
();
excelIo
.
open
(
file
,
function
(
json
)
{
var
workbookObj
=
json
;
spread
.
fromJSON
(
workbookObj
);
},
function
(
e
)
{
// process error
alert
(
e
.
errorMessage
);
if
(
e
.
errorCode
===
2
/*noPassword*/
||
e
.
errorCode
===
3
/*invalidPassword*/
)
{
}
});
}
}
$scope
.
singleExport
=
function
(){
if
(
$scope
.
spread
!=
undefined
&&
$scope
.
spread
){
var
excelIo
=
new
GC
.
Spread
.
Excel
.
IO
();
var
fileName
=
$scope
.
relation
.
fileName
;
if
(
fileName
.
substr
(
-
5
,
5
)
!==
'.xlsx'
)
{
fileName
+=
'.xlsx'
;
}
var
json
=
$scope
.
spread
.
toJSON
();
// here is excel IO API
excelIo
.
save
(
json
,
function
(
blob
)
{
saveAs
(
blob
,
fileName
);
},
function
(
e
)
{
// process error
console
.
log
(
e
);
});
}
};
//批量导出,导出当前期间进行过保存或刷新的所有的机构的利润表
$scope
.
manyExport
=
function
(){
var
param
=
{
period
:
$scope
.
relation
.
period
,
templateId
:
$scope
.
templateId
}
vatReportService
.
manyExport
(
JSON
.
stringify
(
param
)).
success
(
function
(
res
){
}).
error
(
function
(
error
){
SweetAlert
.
error
(
error
+
"批量导出失败"
)
});
};
// ---------------------------------------end -------------------------------------------
(
function
initialize
()
{
...
...
atms-web/src/main/webapp/app/analysis/table/tb-ebit-form.html
View file @
64aa2c3b
...
...
@@ -22,19 +22,19 @@
</div>
</div>
<div
class=
"col-sm-5"
class=
"bar-export"
style=
" margin-top: 20px;width: 39%; float: right;"
>
<span
ng-click=
"uploadProfileTable()"
ngf-select
ngf-change=
"upload($files)"
ngf-multiple=
"tru
e"
<span
ngf-select=
"upload($files)"
ngf-multiple=
"fals
e"
ngf-validate=
"{size: {min:'10KB', max:'20MB'}}"
><i
class=
"fa fa-file"
>
{{'uploadProfileTable' | translate}}
</i></span>
<span
ng-click=
"saveAndRefresh()"
><i
class=
"fa fa-refresh"
></i>
{{'saveAndRefresh' | translate}}
</span>
<span
ng-click=
"singleExport()
;
"
><i
<span
ng-click=
"singleExport()"
><i
class=
"fa fa-upload"
></i>
{{'singleExport' | translate}}
</span>
<span
ng-click=
"manyExport()"
><i
class=
"fa fa-cloud-upload"
></i>
{{'manyExport' | translate}}
</span>
</div>
</div>
internationalDataImport
<div
class=
'report-container'
id=
"reportContainer"
>
<input
type=
"file"
id=
"fileDemo"
style=
"display: none"
class=
"input"
>
<input
type=
"file"
id=
"fileDemo"
style=
"display: none"
class=
"input"
ng-model =
"relation.fileName"
>
<table-report-sheet
report-source=
"reportData"
spread=
'spread'
template-id=
'templateId'
relation=
"relation"
>
</table-report-sheet>
...
...
atms-web/src/main/webapp/app/common/vatservices/vatReportService.js
View file @
64aa2c3b
...
...
@@ -61,8 +61,18 @@
return
$http
.
get
(
'/Report/reportData/'
+
reportId
,
apiConfig
.
createVat
());
},
getReportEbitData
:
function
(
reportId
,
orgId
,
period
)
{
return
$http
.
get
(
'/Report/reportEbitData?reportId='
+
reportId
+
'&orgId='
+
orgId
,
+
'&period='
+
period
,
apiConfig
.
createVat
());
var
param
=
{
reportId
:
reportId
,
period
:
period
,
orgId
:
orgId
}
param
=
JSON
.
stringify
(
param
);
return
$http
.
post
(
'/Report/reportEbitData'
,
param
,
apiConfig
.
createVat
({
contentType
:
"application/json"
}));
}
,
manyExport
:
function
(
param
){
return
$http
.
post
(
'/Report/manyExport'
,
param
,
apiConfig
.
createVat
());
}
,
saveAndRefresh
:
function
(
orgId
,
period
,
specialConsiderations
,
ebitRate
)
{
return
$http
.
get
(
'/Report/specialConsiderations?='
+
orgId
+
'&period='
+
period
+
"&specialConsiderations="
+
specialConsiderations
+
"&ebitRate="
+
ebitRate
,
apiConfig
.
createVat
());
},
...
...
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