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
e2fc00c4
Commit
e2fc00c4
authored
Mar 18, 2019
by
gary
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev_mysql' into dev_mysql
parents
e87e1fc8
ddb37e77
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
518 additions
and
347 deletions
+518
-347
POIUtil.java
atms-api/src/main/java/pwc/taxtech/atms/common/POIUtil.java
+1
-5
TaxesCalculateReportEnum.java
...taxtech/atms/constant/enums/TaxesCalculateReportEnum.java
+10
-9
CellCommentController.java
...va/pwc/taxtech/atms/controller/CellCommentController.java
+18
-0
MenuServiceImpl.java
...n/java/pwc/taxtech/atms/service/impl/MenuServiceImpl.java
+13
-0
TaxDocumentServiceImpl.java
...pwc/taxtech/atms/service/impl/TaxDocumentServiceImpl.java
+3
-3
TemplateGroupServiceImpl.java
...c/taxtech/atms/service/impl/TemplateGroupServiceImpl.java
+10
-1
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+130
-89
DFFS.java
.../taxtech/atms/vat/service/impl/report/functions/DFFS.java
+64
-88
JFFS.java
.../taxtech/atms/vat/service/impl/report/functions/JFFS.java
+66
-89
WPNAME.java
...axtech/atms/vat/service/impl/report/functions/WPNAME.java
+1
-7
TaxDocumentMapper.java
...src/main/java/pwc/taxtech/atms/dao/TaxDocumentMapper.java
+1
-1
CitTbam.java
atms-dao/src/main/java/pwc/taxtech/atms/entity/CitTbam.java
+30
-23
PeriodFormulaBlockMapper.java
...va/pwc/taxtech/atms/vat/dao/PeriodFormulaBlockMapper.java
+4
-0
CitTbamExtendsMapper.xml
...ces/pwc/taxtech/atms/dao/extends/CitTbamExtendsMapper.xml
+1
-2
Gruntfile.js
atms-web/src/main/webapp/Gruntfile.js
+1
-0
module-part2.js
atms-web/src/main/webapp/Scripts/module-part2.js
+20
-0
tableau-2.2.2.min.js
atms-web/src/main/webapp/Scripts/tableau-2.2.2.min.js
+0
-0
app.json
atms-web/src/main/webapp/app-resources/i18n/zh-CN/app.json
+11
-0
unreturned-tax.ctrl.js
.../analysis/dashboard/unreturned-tax/unreturned-tax.ctrl.js
+26
-0
unreturned-tax.html
...app/analysis/dashboard/unreturned-tax/unreturned-tax.html
+20
-0
unreturned-tax.js
...p/app/analysis/dashboard/unreturned-tax/unreturned-tax.js
+19
-0
unreturned-tax.less
...app/analysis/dashboard/unreturned-tax/unreturned-tax.less
+2
-0
entryList-modal.ctrl.js
...pp/app/cit/report/entryList-modal/entryList-modal.ctrl.js
+11
-16
entryList-modal.js
.../webapp/app/cit/report/entryList-modal/entryList-modal.js
+2
-1
entryLog-modal.ctrl.js
...bapp/app/cit/report/entryLog-modal/entryLog-modal.ctrl.js
+3
-1
entryLog-modal.html
.../webapp/app/cit/report/entryLog-modal/entryLog-modal.html
+1
-1
tax-report-cell-detail-modal.ctrl.js
...rt-cell-detail-modal/tax-report-cell-detail-modal.ctrl.js
+37
-2
tax-report-cell-detail-modal.html
...eport-cell-detail-modal/tax-report-cell-detail-modal.html
+1
-1
cellComment.svc.js
...src/main/webapp/app/common/webservices/cellComment.svc.js
+4
-0
app-nav.html
atms-web/src/main/webapp/app/framework/app-nav/app-nav.html
+5
-5
tax-document-list.svc.js
...DocumentManage/tax-document-list/tax-document-list.svc.js
+3
-3
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/POIUtil.java
View file @
e2fc00c4
...
...
@@ -117,7 +117,7 @@ public class POIUtil {
return
row
;
}
public
static
Row
createAndCloneRow
(
Workbook
wb
,
Sheet
sheet
,
Integer
destRowIndex
,
Row
fromRow
)
{
public
static
Row
createAndCloneRow
(
Workbook
wb
,
Sheet
sheet
,
Integer
destRowIndex
,
Row
fromRow
)
{
Row
toRow
=
null
;
if
(
sheet
.
getRow
(
destRowIndex
)
!=
null
)
{
int
lastRowNo
=
sheet
.
getLastRowNum
();
...
...
@@ -136,10 +136,6 @@ public class POIUtil {
boolean
copyValueFlag
)
{
CellStyle
newstyle
=
wb
.
createCellStyle
();
copyCellStyle
(
wb
,
srcCell
.
getCellStyle
(),
newstyle
);
if
(
srcCell
.
getColumnIndex
()==
7
){
newstyle
.
setLocked
(
false
);
}
// distCell.setEncoding(srcCell.getEncoding());
//样式
distCell
.
setCellStyle
(
newstyle
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/TaxesCalculateReportEnum.java
View file @
e2fc00c4
...
...
@@ -10,15 +10,16 @@ public class TaxesCalculateReportEnum {
Column_1
(
0
,
"序号"
),
Column_2
(
1
,
"收入类型名称"
),
Column_3
(
2
,
"税金项目"
),
Column_4
(
3
,
"账载收入-明细"
),
Column_5
(
4
,
"销项开票收入数-专票"
),
Column_6
(
5
,
"销项开票收入数-普票"
),
Column_7
(
6
,
"计税基数(应税收入)"
),
Column_8
(
7
,
"税率"
),
Column_9
(
8
,
"税额(元)"
),
Column_10
(
9
,
"收入类别"
),
Column_11
(
10
,
"计税方式"
),
Column_12
(
11
,
"备注"
)
Column_4
(
3
,
"期间"
),
Column_5
(
4
,
"账载收入-明细"
),
Column_6
(
5
,
"销项开票收入数-专票"
),
Column_7
(
6
,
"销项开票收入数-普票"
),
Column_8
(
7
,
"计税基数(应税收入)"
),
Column_9
(
8
,
"税率"
),
Column_10
(
9
,
"税额(元)"
),
Column_11
(
10
,
"收入类别"
),
Column_12
(
11
,
"计税方式"
),
Column_13
(
12
,
"备注"
)
;
private
Integer
index
;
private
String
name
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/CellCommentController.java
View file @
e2fc00c4
...
...
@@ -10,9 +10,12 @@ import pwc.taxtech.atms.dao.CitTbamMapper;
import
pwc.taxtech.atms.dpo.CitTbamDto
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.entity.CitJournalEntryAdjust
;
import
pwc.taxtech.atms.entity.CitTbam
;
import
pwc.taxtech.atms.vat.dao.JournalEntryMapper
;
import
pwc.taxtech.atms.vat.dao.PeriodFormulaBlockMapper
;
import
pwc.taxtech.atms.vat.entity.CellComment
;
import
pwc.taxtech.atms.vat.entity.PeriodCellComment
;
import
pwc.taxtech.atms.vat.entity.PeriodFormulaBlock
;
import
pwc.taxtech.atms.vat.service.impl.CellCommentServiceImpl
;
import
java.util.List
;
...
...
@@ -63,4 +66,19 @@ public class CellCommentController {
operationResultDto
.
setResultMsg
(
"success"
);
return
operationResultDto
;
}
@Autowired
private
PeriodFormulaBlockMapper
periodFormulaBlockMapper
;
//更新调整后金额
@RequestMapping
(
"updateAdjust"
)
public
OperationResultDto
updateAdjust
(
@RequestBody
CitTbam
[]
citTbams
){
OperationResultDto
operationResultDto
=
new
OperationResultDto
();
CitTbam
citTbam
=
new
CitTbam
();
for
(
CitTbam
citTbam1
:
citTbams
){
citTbam
.
setId
(
citTbam1
.
getId
());
citTbamMapper
.
updateByPrimaryKey
(
citTbam
);
}
operationResultDto
.
setResultMsg
(
"success"
);
return
operationResultDto
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/MenuServiceImpl.java
View file @
e2fc00c4
...
...
@@ -162,6 +162,19 @@ public class MenuServiceImpl {
menuIds
.
add
(
"12776533-9c54-4737-a28c-0cd2a3d75049"
);
menuIds
.
add
(
"17d6cd83-f5b6-46f2-88e0-58d21957ad29"
);
menuIds
.
add
(
"17d6cd83-f5b6-46f2-88e0-58d21957ad30"
);
menuIds
.
add
(
"12776533-9c54-4737-a28c-0cd2a3d74046"
);
menuIds
.
add
(
"17d6cd83-f5b6-46f2-88e0-58d21957ad30"
);
menuIds
.
add
(
"12776533-9c54-4737-a28c-0cd2a3d74050"
);
menuIds
.
add
(
"12776533-9c54-4737-a28c-0cd2a3d74051"
);
menuIds
.
add
(
"12776533-9c54-4737-a28c-0cd2a3d740510"
);
menuIds
.
add
(
"12776533-9c54-4737-a28c-0cd2a3d74052"
);
menuIds
.
add
(
"12776533-9c54-4737-a28c-0cd2a3d74053"
);
menuIds
.
add
(
"12776533-9c54-4737-a28c-0cd2a3d74054"
);
menuIds
.
add
(
"12776533-9c54-4737-a28c-0cd2a3d74055"
);
menuIds
.
add
(
"12776533-9c54-4737-a28c-0cd2a3d74056"
);
menuIds
.
add
(
"12776533-9c54-4737-a28c-0cd2a3d74057"
);
menuIds
.
add
(
"12776533-9c54-4737-a28c-0cd2a3d74058"
);
menuIds
.
add
(
"12776533-9c54-4737-a28c-0cd2a3d74059"
);
}
// List<MenuDto> menus = getMenus(moduleId).stream().filter(x -> permissionNames.contains(x.getName())).collect(Collectors.toList());
return
menuIds
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TaxDocumentServiceImpl.java
View file @
e2fc00c4
...
...
@@ -190,15 +190,15 @@ public class TaxDocumentServiceImpl {
taxDocument
.
setCreatorId
(
authUserHelper
.
getCurrentUserId
());
taxDocument
.
setUploadTime
(
new
Date
());
taxDocument
.
setYearRedundancy
(
Calendar
.
getInstance
().
get
(
Calendar
.
YEAR
));
Long
id
=
taxDocumentMapper
.
insert
(
taxDocument
);
int
num
=
taxDocumentMapper
.
insert
(
taxDocument
);
//根据公司Id 设置业务线
String
businessLine
=
organizationService
.
queryBusinessByCompanyId
(
taxDocument
.
getCompanyId
());
if
(
StringUtils
.
isNotBlank
(
businessLine
))
{
taxDocument
.
setBusinessLine
(
businessLine
);
}
if
(
id
>
0
)
{
if
(
num
>
0
)
{
OperationLogTaxDocument
actionEntity
=
buildOperationLogTaxDocument
();
actionEntity
.
setId
(
id
.
toString
());
actionEntity
.
setId
(
taxDocument
.
getId
()
.
toString
());
actionEntity
.
setOperationAction
(
"新增"
);
actionEntity
.
setUpdateState
(
taxDocument
.
toString
());
boolean
result
=
operationLogTaxDocService
.
addTaxDocumentList
(
actionEntity
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/TemplateGroupServiceImpl.java
View file @
e2fc00c4
...
...
@@ -258,7 +258,12 @@ public class TemplateGroupServiceImpl extends AbstractService {
cellTemplate
.
setCreateTime
(
now
);
cellTemplate
.
setUpdateTime
(
now
);
cellTemplate
.
setRowIndex
(
r
);
cellTemplate
.
setRowName
(
StringUtils
.
EMPTY
);
//税金计算表单独处理
if
(
"VAT020"
.
equals
(
template
.
getCode
())){
cellTemplate
.
setRowName
(
POIUtil
.
getCellFormulaString
(
cell
));
}
else
{
cellTemplate
.
setRowName
(
StringUtils
.
EMPTY
);
}
cellTemplate
.
setColumnName
(
StringUtils
.
EMPTY
);
cellTemplate
.
setComment
(
StringUtils
.
EMPTY
);
cellTemplate
.
setCopyFromId
(
0L
);
...
...
@@ -406,6 +411,10 @@ public class TemplateGroupServiceImpl extends AbstractService {
continue
;
//todo cell == null 如何处理
}
CellTemplate
cellTemplate
=
new
CellTemplate
();
//税金计算表单独处理
if
(
"VAT020"
.
equals
(
template
.
getCode
())){
cellTemplate
.
setRowName
(
POIUtil
.
getCellFormulaString
(
cell
));
}
cellTemplate
.
setColumnIndex
(
c
);
cellTemplate
.
setCreateTime
(
now
);
cellTemplate
.
setUpdateTime
(
now
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
e2fc00c4
...
...
@@ -64,7 +64,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"
};
"JXFP"
,
"PSUM"
,
"DFFS"
,
"JFFS"
,
"WPSR"
,
"WPNAME"
,
"WPTYPE"
,
"SUM2"
,
"RSUMIF"
,
"SUM"
};
@Autowired
private
ReportGeneratorImpl
reportGenerator
;
...
...
@@ -366,7 +366,19 @@ public class ReportServiceImpl extends BaseService {
@Transactional
public
void
assemblePeriodTemplate
(
Template
template
,
Workbook
workbook
,
String
projectId
,
Integer
period
,
Integer
addRowIndex
)
throws
ServiceException
{
List
<
Integer
>
hasHandDatas
=
Arrays
.
asList
(
TaxesCalculateReportEnum
.
Column
.
Column_5
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_6
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_7
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_10
.
getIndex
());
List
<
Integer
>
hasFormulaDatas
=
Arrays
.
asList
(
TaxesCalculateReportEnum
.
Column
.
Column_4
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_5
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_6
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_7
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_10
.
getIndex
());
try
{
Date
now
=
new
Date
();
Sheet
sheet
=
workbook
.
getSheetAt
(
0
);
...
...
@@ -380,72 +392,7 @@ public class ReportServiceImpl extends BaseService {
if
(
cell
==
null
)
{
continue
;
//todo cell == null 如何处理
}
//查询原来行cell是否有CellTemplate
CellTemplateExample
cellTemplateExample
=
new
CellTemplateExample
();
cellTemplateExample
.
createCriteria
().
andReportTemplateIdEqualTo
(
template
.
getId
()).
andRowIndexEqualTo
(
r
-
addRowIndex
).
andColumnIndexEqualTo
(
c
);
List
<
CellTemplate
>
cellTemplates
=
cellTemplateMapper
.
selectByExample
(
cellTemplateExample
);
if
(
CollectionUtils
.
isNotEmpty
(
cellTemplates
))
{
CellTemplate
cellTemplate
=
cellTemplates
.
get
(
0
);
PeriodCellTemplate
periodCellTemplate
=
new
PeriodCellTemplate
();
CommonUtils
.
copyProperties
(
cellTemplate
,
periodCellTemplate
);
periodCellTemplate
.
setId
(
distributedIdService
.
nextId
());
periodCellTemplate
.
setPeriod
(
period
);
periodCellTemplate
.
setReportTemplateId
(
template
.
getId
());
periodCellTemplate
.
setRowIndex
(
r
);
periodCellTemplate
.
setRowName
(
cellTemplate
.
getRowName
());
periodCellTemplate
.
setColumnIndex
(
c
);
periodCellTemplate
.
setColumnName
(
cellTemplate
.
getColumnName
());
periodCellTemplate
.
setComment
(
cellTemplate
.
getComment
());
periodCellTemplate
.
setCreateTime
(
cellTemplate
.
getCreateTime
());
periodCellTemplate
.
setUpdateTime
(
cellTemplate
.
getUpdateTime
());
periodCellTemplate
.
setCellTemplateId
(
cellTemplate
.
getId
());
periodCellTemplate
.
setDataType
(
cellTemplate
.
getDataType
());
periodCellTemplate
.
setIsReadOnly
(
cellTemplate
.
getIsReadOnly
()
?
1
:
0
);
periodCellTemplate
.
setCopyFromId
(
cellTemplate
.
getCopyFromId
());
periodCellTemplate
.
setCreateBy
(
StringUtils
.
isBlank
(
cellTemplate
.
getCreateBy
())
?
"admin"
:
cellTemplate
.
getCreateBy
());
periodCellTemplate
.
setUpdateBy
(
StringUtils
.
isBlank
(
cellTemplate
.
getUpdateBy
())
?
"admin"
:
cellTemplate
.
getUpdateBy
());
periodCellTemplate
.
setProjectId
(
projectId
);
cellTemplateList
.
add
(
periodCellTemplate
);
CellTemplateConfigExample
configExample
=
new
CellTemplateConfigExample
();
configExample
.
createCriteria
().
andCellTemplateIdEqualTo
(
cellTemplate
.
getId
());
List
<
CellTemplateConfig
>
configs
=
cellTemplateConfigMapper
.
selectByExample
(
configExample
);
if
(
CollectionUtils
.
isNotEmpty
(
configs
))
{
for
(
CellTemplateConfig
cellTemplateConfig
:
configs
)
{
PeriodCellTemplateConfig
periodCellTemplateConfig
=
new
PeriodCellTemplateConfig
();
CommonUtils
.
copyProperties
(
cellTemplateConfig
,
periodCellTemplateConfig
);
periodCellTemplateConfig
.
setId
(
distributedIdService
.
nextId
());
periodCellTemplateConfig
.
setPeriod
(
period
);
periodCellTemplateConfig
.
setCellTemplateId
(
cellTemplateConfig
.
getCellTemplateId
());
periodCellTemplateConfig
.
setReportTemplateId
(
template
.
getId
());
periodCellTemplateConfig
.
setDataSourceType
(
cellTemplateConfig
.
getDataSourceType
());
periodCellTemplateConfig
.
setFormula
(
StringUtils
.
isBlank
(
cellTemplateConfig
.
getFormula
())
?
null
:
cellTemplateConfig
.
getFormula
());
periodCellTemplateConfig
.
setParsedFormula
(
null
);
periodCellTemplateConfig
.
setFormulaDescription
(
cellTemplateConfig
.
getFormulaDescription
());
periodCellTemplateConfig
.
setAccountCodes
(
cellTemplateConfig
.
getAccountCodes
());
periodCellTemplateConfig
.
setInvoiceType
(
cellTemplateConfig
.
getInvoiceType
());
periodCellTemplateConfig
.
setTaxRate
(
cellTemplateConfig
.
getTaxRate
());
periodCellTemplateConfig
.
setInvoiceAmountType
(
cellTemplateConfig
.
getInvoiceAmountType
());
periodCellTemplateConfig
.
setModelIds
(
cellTemplateConfig
.
getModelIds
());
periodCellTemplateConfig
.
setCreateBy
(
StringUtils
.
isBlank
(
cellTemplateConfig
.
getCreateBy
())
?
"admin"
:
cellTemplateConfig
.
getCreateBy
());
periodCellTemplateConfig
.
setCreateTime
(
cellTemplateConfig
.
getCreateTime
());
periodCellTemplateConfig
.
setUpdateBy
(
StringUtils
.
isBlank
(
cellTemplateConfig
.
getUpdateBy
())
?
"admin"
:
cellTemplateConfig
.
getUpdateBy
());
periodCellTemplateConfig
.
setUpdateTime
(
cellTemplateConfig
.
getUpdateTime
());
periodCellTemplateConfig
.
setInvoiceCategory
(
cellTemplateConfig
.
getInvoiceCategory
());
periodCellTemplateConfig
.
setFormulaDataSource
(
cellTemplateConfig
.
getFormulaDataSource
());
periodCellTemplateConfig
.
setValidation
(
cellTemplateConfig
.
getValidation
());
periodCellTemplateConfig
.
setParsedValidation
(
null
);
periodCellTemplateConfig
.
setValidationDescription
(
cellTemplateConfig
.
getValidationDescription
());
periodCellTemplateConfig
.
setVoucherKeyword
(
cellTemplateConfig
.
getVoucherKeyword
());
periodCellTemplateConfig
.
setCellTemplateConfigId
(
cellTemplateConfig
.
getId
());
periodCellTemplateConfig
.
setKeyValueParsedFormula
(
null
);
periodCellTemplateConfig
.
setProjectId
(
projectId
);
fixedParsedFormula
(
periodCellTemplateConfig
);
fixedAccountCode
(
periodCellTemplateConfig
);
cellTemplateConfigList
.
add
(
periodCellTemplateConfig
);
}
}
}
else
{
if
(
r
<=
addRowIndex
)
{
Long
cellTemplateId
=
distributedIdService
.
nextId
();
PeriodCellTemplate
cellTemplate
=
new
PeriodCellTemplate
();
cellTemplate
.
setPeriod
(
period
);
...
...
@@ -462,13 +409,8 @@ public class ReportServiceImpl extends BaseService {
}
cellTemplate
.
setIsReadOnly
(
cell
.
getCellStyle
().
getLocked
()
?
1
:
0
);
cellTemplateList
.
add
(
cellTemplate
);
//todo: 这里没有Config数据只有在上传模板以后,在界面里面可以配置公式
if
(
hasKeyIn
(
cell
))
{
cell
.
setCellValue
(
StringUtils
.
EMPTY
);
addManualConfig
(
template
.
getId
(),
cell
,
now
,
cellTemplateConfigList
);
}
else
if
(!
cell
.
getCellStyle
().
getLocked
()
&&
StringUtils
.
isNotBlank
(
POIUtil
.
getCellFormulaString
(
cell
)))
{
if
(
hasFormulaDatas
.
contains
(
c
)
&&
StringUtils
.
isNotBlank
(
POIUtil
.
getCellFormulaString
(
cell
)))
{
PeriodCellTemplateConfig
periodCellTemplateConfig
=
new
PeriodCellTemplateConfig
();
periodCellTemplateConfig
.
setCellTemplateId
(
cellTemplateId
);
periodCellTemplateConfig
.
setId
(
distributedIdService
.
nextId
());
periodCellTemplateConfig
.
setPeriod
(
period
);
periodCellTemplateConfig
.
setCellTemplateId
(
cellTemplateId
);
...
...
@@ -486,11 +428,78 @@ public class ReportServiceImpl extends BaseService {
fixedParsedFormula
(
periodCellTemplateConfig
);
fixedAccountCode
(
periodCellTemplateConfig
);
cellTemplateConfigList
.
add
(
periodCellTemplateConfig
);
addManualConfig
(
template
.
getId
(),
cell
,
now
,
cellTemplateConfigList
);
}
if
(
hasHandDatas
.
contains
(
c
))
{
addManualConfig
(
template
.
getId
(),
cellTemplateId
,
cell
,
now
,
cellTemplateConfigList
);
}
}
else
{
//查询原来行cell是否有CellTemplate
CellTemplateExample
cellTemplateExample
=
new
CellTemplateExample
();
cellTemplateExample
.
createCriteria
().
andReportTemplateIdEqualTo
(
template
.
getId
()).
andRowIndexEqualTo
(
r
-
addRowIndex
).
andColumnIndexEqualTo
(
c
);
List
<
CellTemplate
>
cellTemplates
=
cellTemplateMapper
.
selectByExample
(
cellTemplateExample
);
if
(
CollectionUtils
.
isNotEmpty
(
cellTemplates
))
{
CellTemplate
cellTemplate
=
cellTemplates
.
get
(
0
);
PeriodCellTemplate
periodCellTemplate
=
new
PeriodCellTemplate
();
CommonUtils
.
copyProperties
(
cellTemplate
,
periodCellTemplate
);
periodCellTemplate
.
setId
(
distributedIdService
.
nextId
());
periodCellTemplate
.
setPeriod
(
period
);
periodCellTemplate
.
setReportTemplateId
(
template
.
getId
());
periodCellTemplate
.
setRowIndex
(
r
);
periodCellTemplate
.
setRowName
(
cellTemplate
.
getRowName
());
periodCellTemplate
.
setColumnIndex
(
c
);
periodCellTemplate
.
setColumnName
(
cellTemplate
.
getColumnName
());
periodCellTemplate
.
setComment
(
cellTemplate
.
getComment
());
periodCellTemplate
.
setCreateTime
(
cellTemplate
.
getCreateTime
());
periodCellTemplate
.
setUpdateTime
(
cellTemplate
.
getUpdateTime
());
periodCellTemplate
.
setCellTemplateId
(
cellTemplate
.
getId
());
periodCellTemplate
.
setDataType
(
cellTemplate
.
getDataType
());
periodCellTemplate
.
setIsReadOnly
(
cellTemplate
.
getIsReadOnly
()
?
1
:
0
);
periodCellTemplate
.
setCopyFromId
(
cellTemplate
.
getCopyFromId
());
periodCellTemplate
.
setCreateBy
(
StringUtils
.
isBlank
(
cellTemplate
.
getCreateBy
())
?
"admin"
:
cellTemplate
.
getCreateBy
());
periodCellTemplate
.
setUpdateBy
(
StringUtils
.
isBlank
(
cellTemplate
.
getUpdateBy
())
?
"admin"
:
cellTemplate
.
getUpdateBy
());
periodCellTemplate
.
setProjectId
(
projectId
);
cellTemplateList
.
add
(
periodCellTemplate
);
CellTemplateConfigExample
configExample
=
new
CellTemplateConfigExample
();
configExample
.
createCriteria
().
andCellTemplateIdEqualTo
(
cellTemplate
.
getId
());
List
<
CellTemplateConfig
>
configs
=
cellTemplateConfigMapper
.
selectByExample
(
configExample
);
if
(
CollectionUtils
.
isNotEmpty
(
configs
))
{
for
(
CellTemplateConfig
cellTemplateConfig
:
configs
)
{
PeriodCellTemplateConfig
periodCellTemplateConfig
=
new
PeriodCellTemplateConfig
();
CommonUtils
.
copyProperties
(
cellTemplateConfig
,
periodCellTemplateConfig
);
periodCellTemplateConfig
.
setId
(
distributedIdService
.
nextId
());
periodCellTemplateConfig
.
setPeriod
(
period
);
periodCellTemplateConfig
.
setCellTemplateId
(
cellTemplateConfig
.
getCellTemplateId
());
periodCellTemplateConfig
.
setReportTemplateId
(
template
.
getId
());
periodCellTemplateConfig
.
setDataSourceType
(
cellTemplateConfig
.
getDataSourceType
());
periodCellTemplateConfig
.
setFormula
(
StringUtils
.
isBlank
(
cellTemplateConfig
.
getFormula
())
?
null
:
cellTemplateConfig
.
getFormula
());
periodCellTemplateConfig
.
setParsedFormula
(
null
);
periodCellTemplateConfig
.
setFormulaDescription
(
cellTemplateConfig
.
getFormulaDescription
());
periodCellTemplateConfig
.
setAccountCodes
(
cellTemplateConfig
.
getAccountCodes
());
periodCellTemplateConfig
.
setInvoiceType
(
cellTemplateConfig
.
getInvoiceType
());
periodCellTemplateConfig
.
setTaxRate
(
cellTemplateConfig
.
getTaxRate
());
periodCellTemplateConfig
.
setInvoiceAmountType
(
cellTemplateConfig
.
getInvoiceAmountType
());
periodCellTemplateConfig
.
setModelIds
(
cellTemplateConfig
.
getModelIds
());
periodCellTemplateConfig
.
setCreateBy
(
StringUtils
.
isBlank
(
cellTemplateConfig
.
getCreateBy
())
?
"admin"
:
cellTemplateConfig
.
getCreateBy
());
periodCellTemplateConfig
.
setCreateTime
(
cellTemplateConfig
.
getCreateTime
());
periodCellTemplateConfig
.
setUpdateBy
(
StringUtils
.
isBlank
(
cellTemplateConfig
.
getUpdateBy
())
?
"admin"
:
cellTemplateConfig
.
getUpdateBy
());
periodCellTemplateConfig
.
setUpdateTime
(
cellTemplateConfig
.
getUpdateTime
());
periodCellTemplateConfig
.
setInvoiceCategory
(
cellTemplateConfig
.
getInvoiceCategory
());
periodCellTemplateConfig
.
setFormulaDataSource
(
cellTemplateConfig
.
getFormulaDataSource
());
periodCellTemplateConfig
.
setValidation
(
cellTemplateConfig
.
getValidation
());
periodCellTemplateConfig
.
setParsedValidation
(
null
);
periodCellTemplateConfig
.
setValidationDescription
(
cellTemplateConfig
.
getValidationDescription
());
periodCellTemplateConfig
.
setVoucherKeyword
(
cellTemplateConfig
.
getVoucherKeyword
());
periodCellTemplateConfig
.
setCellTemplateConfigId
(
cellTemplateConfig
.
getId
());
periodCellTemplateConfig
.
setKeyValueParsedFormula
(
null
);
periodCellTemplateConfig
.
setProjectId
(
projectId
);
fixedParsedFormula
(
periodCellTemplateConfig
);
fixedAccountCode
(
periodCellTemplateConfig
);
cellTemplateConfigList
.
add
(
periodCellTemplateConfig
);
}
}
}
}
}
}
List
<
List
<
PeriodCellTemplate
>>
tmpList
=
CommonUtils
.
subListWithLen
(
cellTemplateList
,
CommonUtils
.
BATCH_NUM
);
...
...
@@ -504,15 +513,15 @@ public class ReportServiceImpl extends BaseService {
}
}
private
void
addManualConfig
(
Long
templateId
,
Cell
cell
,
Date
now
,
List
<
PeriodCellTemplateConfig
>
list
)
{
private
void
addManualConfig
(
Long
templateId
,
Long
cellTemplateId
,
Cell
cell
,
Date
now
,
List
<
PeriodCellTemplateConfig
>
list
)
{
PeriodCellTemplateConfig
configManual
=
new
PeriodCellTemplateConfig
();
configManual
.
setId
(
distributedIdService
.
nextId
());
// configManual.setCellTemplateId(cellTemplate.getId()
);
configManual
.
setCellTemplateId
(
cellTemplateId
);
configManual
.
setReportTemplateId
(
templateId
);
configManual
.
setDataSourceType
(
CellDataSourceType
.
KeyIn
.
getCode
());
configManual
.
setFormula
(
POIUtil
.
getCellFormulaString
(
cell
));
// config.setFormula(cell.getCellFormula());
//
configManual.setFormulaDataSource("报表数据"); //todo KV相关
configManual
.
setFormulaDataSource
(
"报表数据"
);
//todo KV相关
configManual
.
setUpdateTime
(
now
);
// configManual.setUpdateBy(authUserHelper.getCurrentUserId());
list
.
add
(
configManual
);
...
...
@@ -668,7 +677,7 @@ public class ReportServiceImpl extends BaseService {
Map
<
String
,
String
>
urlMap
=
null
;
is
=
httpFileService
.
getUserTemplate
(
uploadDetail
.
getList
().
get
(
0
).
getViewHttpUrl
());
Workbook
tWorkbook
=
WorkbookFactory
.
create
(
is
);
tWorkbook
=
assembleTaxWorkBook
(
template
,
tWorkbook
,
projectId
,
period
);
tWorkbook
=
assembleTaxWorkBook
(
template
,
tWorkbook
,
projectId
,
period
);
tWorkbook
.
write
(
bout
);
FileUpload
fileUpload
=
didiFileUploadService
.
uploadFile
(
bout
.
toByteArray
(),
template
.
getCode
()
+
"_"
+
template
.
getName
()
+
".xlsx"
,
FileUploadEnum
.
BizSource
.
PERIOD_REPORT_TEMPLATE_UPLOAD
.
name
());
periodTemplate
.
setPath
(
fileUpload
.
getUid
());
...
...
@@ -697,27 +706,54 @@ public class ReportServiceImpl extends BaseService {
Sheet
sheet
=
tWorkbook
.
getSheetAt
(
0
);
RevenueConfigExample
example
=
new
RevenueConfigExample
();
List
<
RevenueConfig
>
dataList
=
revenueConfigMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isNotEmpty
(
dataList
))
{
Project
project
=
projectMapper
.
selectByPrimaryKey
(
projectId
);
int
rowIndex
=
1
;
Row
sourceRow
=
sheet
.
getRow
(
3
);
for
(
RevenueConfig
config
:
dataList
)
{
Row
row
=
POIUtil
.
createAndCloneRow
(
tWorkbook
,
sheet
,
1
,
sourceRow
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_1
.
getIndex
()).
setCellValue
(
"1-"
+
rowIndex
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_2
.
getIndex
()).
setCellValue
(
""
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_3
.
getIndex
()).
setCellValue
(
config
.
getName
());
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_4
.
getIndex
()).
setCellValue
(
"YYYY-MM"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_5
.
getIndex
()).
setCellValue
(
""
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_2
.
getIndex
()).
setCellValue
(
""
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_4
.
getIndex
()).
setCellValue
(
"PC(\"TimeInterval\",\"\""
);
//判断帐载收入明细
if
(
0
==
config
.
getAccountType
())
{
//0值
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_5
.
getIndex
()).
setCellValue
(
0.00
);
}
else
if
(
1
==
config
.
getAccountType
())
{
//科目
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_5
.
getIndex
()).
setCellValue
(
"DFFS(\""
+
config
.
getTbSegment3
()
+
"\","
+
project
.
getYear
()
+
","
+
period
+
","
+
1
+
",\""
+
config
.
getTbSegment5
()
+
"\",\""
+
config
.
getTbSegment6
()
+
"\")-"
+
"JFFS(\""
+
config
.
getTbSegment3
()
+
"\","
+
project
.
getYear
()
+
","
+
period
+
","
+
1
+
",\""
+
config
.
getTbSegment5
()
+
"\",\""
+
config
.
getTbSegment6
()
+
"\")"
);
}
else
if
(
2
==
config
.
getAccountType
()){
//手工输入
}
else
{
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_5
.
getIndex
()).
setCellValue
(
""
);
}
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_6
.
getIndex
()).
setCellValue
(
""
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_7
.
getIndex
()).
setCellValue
(
""
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()).
setCellValue
(
"BB(\"VAT005\",\"M\",8,0,0)"
);
if
(
1
==
config
.
getTaxBase
())
{
//账载
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()).
setCellValue
(
"WPNAME(\"VAT020\",\"B\",\""
+
config
.
getName
()+
"\",\"E\")"
);
}
else
if
(
2
==
config
.
getTaxBase
())
{
//开票收入
}
else
if
(
3
==
config
.
getTaxBase
())
{
//手工录入
}
else
if
(
4
==
config
.
getTaxBase
())
{
//借方发生额
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()).
setCellValue
(
"JFFS(\""
+
config
.
getTbSegment3
()
+
"\","
+
project
.
getYear
()
+
","
+
period
+
","
+
1
+
",\"\",\"\")"
);
}
else
if
(
5
==
config
.
getTaxBase
())
{
//贷方发生额
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()).
setCellValue
(
"DFFS(\""
+
config
.
getTbSegment3
()
+
"\","
+
project
.
getYear
()
+
","
+
period
+
","
+
1
+
",\"\",\"\")"
);
}
else
{
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()).
setCellValue
(
""
);
}
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()).
setCellValue
(
"WPNAME(\"VAT020\",\"C\",\"增值税进项税\",\"G\")"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_9
.
getIndex
()).
setCellValue
(
config
.
getTaxRate
().
multiply
(
new
BigDecimal
(
100
)).
intValue
()
+
"%"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_10
.
getIndex
()).
setCellValue
(
0
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_11
.
getIndex
()).
setCellValue
(
RevenueConfEnum
.
RevenueType
.
MAPPING
.
get
(
config
.
getRevenueType
()));
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_12
.
getIndex
()).
setCellValue
(
RevenueConfEnum
.
TaxType
.
MAPPING
.
get
(
config
.
getTaxType
()));
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_13
.
getIndex
()).
setCellValue
(
RevenueConfEnum
.
TaxType
.
MAPPING
.
get
(
config
.
getTaxType
()));
rowIndex
++;
}
}
assemblePeriodTemplate
(
template
,
tWorkbook
,
projectId
,
period
,
dataList
.
size
());
assemblePeriodTemplate
(
template
,
tWorkbook
,
projectId
,
period
,
dataList
.
size
());
return
tWorkbook
;
}
...
...
@@ -875,7 +911,7 @@ public class ReportServiceImpl extends BaseService {
periodJobMapper
.
updateByPrimaryKey
(
genJob
);
}
@
Autowired
@
Resource
private
DataValidateLogMapper
dataValidateLogMapper
;
public
void
insertDataValidateResult
(
Map
map
)
{
...
...
@@ -939,11 +975,16 @@ public class ReportServiceImpl extends BaseService {
cellDataExample
.
createCriteria
().
andPeriodEqualTo
(
report
.
getPeriod
()).
andProjectIdEqualTo
(
projectId
).
andReportIdEqualTo
(
reportId
);
List
<
PeriodCellData
>
currentCellDataList
=
periodCellDataMapper
.
selectByExample
(
cellDataExample
);
PeriodFormulaBlockExample
periodFormulaBlockExample
=
new
PeriodFormulaBlockExample
();
periodFormulaBlockExample
.
createCriteria
().
andProjectIdEqualTo
(
projectId
).
andPeriodEqualTo
(
report
.
getPeriod
())
.
andReportIdEqualTo
(
reportId
);
/* Map<String, Object> map = new HashMap<>();
map.put("projectId", projectId);
map.put("period", report.getPeriod());
map.put("reportId", reportId);
*/
List
<
PeriodFormulaBlock
>
formulaBlocks
=
periodFormulaBlockMapper
.
selectByExample
(
periodFormulaBlockExample
);
dataDto
.
setFormulaBlocks
(
formulaBlocks
);
//todo: 关键字数据源稍后再加
// 获取通过KeyValueDataId关联的数据源,即公式数据源
...
...
@@ -1686,7 +1727,7 @@ public class ReportServiceImpl extends BaseService {
return
operationResultDto
;
}
@
Autowired
@
Resource
private
PwcReportAttachMapper
pwcReportAttachMapper
;
public
void
bindPwcAttach
(
Long
activeCol
,
Long
activeRow
,
String
activeTemplateId
,
FileDto
file
)
{
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/DFFS.java
View file @
e2fc00c4
...
...
@@ -2,17 +2,17 @@ package pwc.taxtech.atms.vat.service.impl.report.functions;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.ss.formula.OperationEvaluationContext
;
import
org.apache.poi.ss.formula.eval.NumberEval
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
import
pwc.taxtech.atms.common.util.DateUtils
;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
import
pwc.taxtech.atms.constant.Constant
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceType
;
import
pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto
;
import
pwc.taxtech.atms.entity.
*
;
import
pwc.taxtech.atms.entity.
Organization
;
import
pwc.taxtech.atms.vat.entity.*
;
import
java.math.BigDecimal
;
...
...
@@ -27,17 +27,17 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
@Override
public
ValueEval
evaluate
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
{
if
(
args
.
length
<
5
)
{
if
(
args
.
length
<
6
)
{
return
null
;
}
int
type
=
getInt
Param
(
args
[
0
],
ec
);
String
code
=
getString
Param
(
args
[
1
],
ec
);
int
year
=
getIntParam
(
args
[
2
],
ec
);
int
period
=
getIntParam
(
args
[
3
],
ec
);
int
sourceDataType
=
getIntParam
(
args
[
4
],
ec
);
String
formulaExpression
=
"DFFS("
+
type
+
",\""
+
code
+
"\","
+
year
+
","
+
period
+
","
+
sourceDataType
+
")"
;
String
code
=
getString
Param
(
args
[
0
],
ec
);
int
year
=
getInt
Param
(
args
[
1
],
ec
);
int
period
=
getIntParam
(
args
[
2
],
ec
);
int
sourceDataType
=
getIntParam
(
args
[
3
],
ec
);
//科目代码
String
segment5
=
getStringParam
(
args
[
4
],
ec
);
//利润中心代码
String
segment6
=
getStringParam
(
args
[
5
],
ec
);
//产品代码
String
formulaExpression
=
"DFFS(\""
+
code
+
"\","
+
year
+
","
+
period
+
","
+
sourceDataType
+
",\""
+
segment5
+
"\",\""
+
segment6
+
"\
")"
;
logger
.
debug
(
formulaExpression
);
year
=
getYear
(
year
);
...
...
@@ -48,84 +48,54 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
year
=
year
+
yearOffset
;
List
<
ReportCellDataSourceDto
>
dataSource
=
Lists
.
newArrayList
();
if
(
type
==
0
){
EnterpriseAccountSetOrgExample
example
=
new
EnterpriseAccountSetOrgExample
();
example
.
createCriteria
().
andEffectiveDateLessThanOrEqualTo
(
DateUtils
.
getNow
()).
andExpiredDateGreaterThanOrEqualTo
(
DateUtils
.
getNow
()).
andOrganizationIdEqualTo
(
orgId
);
List
<
EnterpriseAccountSetOrg
>
enterpriseAccountSetOrgs
=
SpringContextUtil
.
enterpriseAccountSetOrgMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
enterpriseAccountSetOrgs
)){
return
NumberEval
.
ZERO
;
}
AccountMappingExample
accountMappingExample
=
new
AccountMappingExample
();
accountMappingExample
.
createCriteria
().
andOrganizationIdEqualTo
(
orgId
).
andEnterpriseAccountSetIdEqualTo
(
enterpriseAccountSetOrgs
.
get
(
0
).
getEnterpriseAccountSetId
()).
andStandardAccountCodeEqualTo
(
code
);
List
<
AccountMapping
>
accountMappings
=
SpringContextUtil
.
accountMappingMapper
.
selectByExample
(
accountMappingExample
);
double
result
=
0
;
for
(
AccountMapping
a
:
accountMappings
){
if
(
sourceDataType
==
1
){
result
+=
countForTrialBalance
(
a
.
getEnterpriseAccountCode
(),
dataSource
,
period
,
year
,
orgId
);
}
else
if
(
sourceDataType
==
2
){
result
+=
countForAdjBalance
(
a
.
getEnterpriseAccountCode
(),
dataSource
,
period
,
year
,
orgId
);
}
else
if
(
sourceDataType
==
3
){
result
+=
countForTrialFinalBalance
(
a
.
getEnterpriseAccountCode
(),
dataSource
,
period
,
year
,
orgId
);
}
else
{
return
NumberEval
.
ZERO
;
}
}
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
new
BigDecimal
(
result
),
period
,
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
result
),
dataSoureId
,
formulaContext
.
getProjectId
());
return
new
NumberEval
(
result
);
}
else
if
(
type
==
1
){
double
result
=
0.00
;
if
(
sourceDataType
==
1
){
result
=
countForTrialBalance
(
code
,
dataSource
,
period
,
year
,
orgId
);
}
else
if
(
sourceDataType
==
2
){
result
=
countForAdjBalance
(
code
,
dataSource
,
period
,
year
,
orgId
);
}
else
if
(
sourceDataType
==
3
){
result
=
countForTrialFinalBalance
(
code
,
dataSource
,
period
,
year
,
orgId
);
}
else
{
return
NumberEval
.
ZERO
;
}
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
new
BigDecimal
(
result
),
period
,
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
result
),
dataSoureId
,
formulaContext
.
getProjectId
());
return
new
NumberEval
(
result
);
}
return
NumberEval
.
ZERO
;
double
result
=
0.00
;
if
(
sourceDataType
==
1
)
{
result
=
countForTrialBalance
(
code
,
dataSource
,
period
,
year
,
orgId
,
segment5
,
segment6
);
}
else
if
(
sourceDataType
==
2
)
{
result
=
countForAdjBalance
(
code
,
dataSource
,
period
,
year
,
orgId
,
segment5
,
segment6
);
}
else
if
(
sourceDataType
==
3
)
{
result
=
countForTrialFinalBalance
(
code
,
dataSource
,
period
,
year
,
orgId
,
segment5
,
segment6
);
}
else
{
return
NumberEval
.
ZERO
;
}
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
new
BigDecimal
(
result
),
period
,
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
result
),
dataSoureId
,
formulaContext
.
getProjectId
());
return
new
NumberEval
(
result
);
}
private
int
pardePeriod
(
int
period
,
int
year
){
return
Integer
.
parseInt
(
""
+
year
+
(
period
>
9
?
period
:
(
"0"
+
period
)));
private
int
pardePeriod
(
int
period
,
int
year
)
{
return
Integer
.
parseInt
(
""
+
year
+
(
period
>
9
?
period
:
(
"0"
+
period
)));
}
private
double
countForTrialBalance
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
,
String
orgId
)
{
private
double
countForTrialBalance
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
,
String
orgId
,
String
segment5
,
String
segment6
)
{
Organization
organization
=
SpringContextUtil
.
organizationMapper
.
selectByPrimaryKey
(
orgId
);
TrialBalanceExample
glBalanceExample
=
new
TrialBalanceExample
();
TrialBalanceExample
.
Criteria
c1
=
glBalanceExample
.
createCriteria
().
andSegment3EqualTo
(
code
)
.
andPeriodEqualTo
(
pardePeriod
(
period
,
year
));
TrialBalanceExample
.
Criteria
c2
=
glBalanceExample
.
createCriteria
().
andSegment4EqualTo
(
code
)
.
andPeriodEqualTo
(
pardePeriod
(
period
,
year
));
if
(
organization
!=
null
){
if
(
organization
!=
null
)
{
c1
.
andOrganizationIdEqualTo
(
organization
.
getId
());
c2
.
andOrganizationIdEqualTo
(
organization
.
getId
());
}
glBalanceExample
.
or
(
c2
);
if
(
StringUtils
.
isNotBlank
(
segment5
)){
c1
.
andSegment5EqualTo
(
segment5
);
}
if
(
StringUtils
.
isNotBlank
(
segment6
)){
c1
.
andSegment5EqualTo
(
segment6
);
}
List
<
TrialBalance
>
list
=
SpringContextUtil
.
trialBalanceMapper
.
selectByExample
(
glBalanceExample
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
0.0
;
}
List
<
TrialBalance
>
temp
=
list
.
stream
().
filter
(
x
->
code
.
equalsIgnoreCase
(
x
.
getSegment3
())).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
temp
))
{
if
(
CollectionUtils
.
isEmpty
(
temp
))
{
temp
=
list
;
}
for
(
TrialBalance
balance
:
temp
)
{
for
(
TrialBalance
balance
:
temp
)
{
ReportCellDataSourceDto
dto
=
new
ReportCellDataSourceDto
();
dto
.
setAmount
(
balance
.
getPeriodCr
());
dto
.
setPeriod
(
period
);
...
...
@@ -136,28 +106,31 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
}
return
temp
.
stream
().
mapToDouble
(
a
->
a
.
getPeriodCr
().
doubleValue
()).
sum
();
}
private
double
countForAdjBalance
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
,
String
orgId
){
private
double
countForAdjBalance
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
,
String
orgId
,
String
segment5
,
String
segment6
)
{
Organization
organization
=
SpringContextUtil
.
organizationMapper
.
selectByPrimaryKey
(
orgId
);
AdjustmentTableExample
glBalanceExample
=
new
AdjustmentTableExample
();
AdjustmentTableExample
.
Criteria
c1
=
glBalanceExample
.
createCriteria
().
andSegment3EqualTo
(
code
)
.
andPeriodEqualTo
(
pardePeriod
(
period
,
year
));
AdjustmentTableExample
.
Criteria
c2
=
glBalanceExample
.
createCriteria
().
andSegment4EqualTo
(
code
)
.
andPeriodEqualTo
(
pardePeriod
(
period
,
year
));
if
(
organization
!=
null
){
if
(
organization
!=
null
)
{
c1
.
andOrganizationIdEqualTo
(
organization
.
getId
());
c2
.
andOrganizationIdEqualTo
(
organization
.
getId
());
}
glBalanceExample
.
or
(
c2
);
if
(
StringUtils
.
isNotBlank
(
segment5
)){
c1
.
andSegment5EqualTo
(
segment5
);
}
if
(
StringUtils
.
isNotBlank
(
segment6
)){
c1
.
andSegment5EqualTo
(
segment6
);
}
List
<
AdjustmentTable
>
list
=
SpringContextUtil
.
adjustmentTableMapper
.
selectByExample
(
glBalanceExample
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
0.0
;
}
List
<
AdjustmentTable
>
temp
=
list
.
stream
().
filter
(
x
->
code
.
equalsIgnoreCase
(
x
.
getSegment3
())).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
temp
))
{
if
(
CollectionUtils
.
isEmpty
(
temp
))
{
temp
=
list
;
}
for
(
AdjustmentTable
balance
:
temp
)
{
for
(
AdjustmentTable
balance
:
temp
)
{
ReportCellDataSourceDto
dto
=
new
ReportCellDataSourceDto
();
dto
.
setAmount
(
balance
.
getPeriodCrBeq
());
dto
.
setPeriod
(
period
);
...
...
@@ -168,28 +141,31 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
}
return
temp
.
stream
().
mapToDouble
(
a
->
a
.
getPeriodCrBeq
().
doubleValue
()).
sum
();
}
private
double
countForTrialFinalBalance
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
,
String
orgId
){
private
double
countForTrialFinalBalance
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
,
String
orgId
,
String
segment5
,
String
segment6
)
{
Organization
organization
=
SpringContextUtil
.
organizationMapper
.
selectByPrimaryKey
(
orgId
);
TrialBalanceFinalExample
glBalanceExample
=
new
TrialBalanceFinalExample
();
TrialBalanceFinalExample
.
Criteria
c1
=
glBalanceExample
.
createCriteria
().
andSegment3EqualTo
(
code
)
.
andPeriodEqualTo
(
pardePeriod
(
period
,
year
));
TrialBalanceFinalExample
.
Criteria
c2
=
glBalanceExample
.
createCriteria
().
andSegment4EqualTo
(
code
)
.
andPeriodEqualTo
(
pardePeriod
(
period
,
year
));
if
(
organization
!=
null
){
if
(
organization
!=
null
)
{
c1
.
andOrganizationIdEqualTo
(
organization
.
getId
());
c2
.
andOrganizationIdEqualTo
(
organization
.
getId
());
}
glBalanceExample
.
or
(
c2
);
if
(
StringUtils
.
isNotBlank
(
segment5
)){
c1
.
andSegment5EqualTo
(
segment5
);
}
if
(
StringUtils
.
isNotBlank
(
segment6
)){
c1
.
andSegment5EqualTo
(
segment6
);
}
List
<
TrialBalanceFinal
>
list
=
SpringContextUtil
.
trialBalanceFinalMapper
.
selectByExample
(
glBalanceExample
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
0.0
;
}
List
<
TrialBalanceFinal
>
temp
=
list
.
stream
().
filter
(
x
->
code
.
equalsIgnoreCase
(
x
.
getSegment3
())).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
temp
))
{
if
(
CollectionUtils
.
isEmpty
(
temp
))
{
temp
=
list
;
}
for
(
TrialBalanceFinal
balance
:
temp
)
{
for
(
TrialBalanceFinal
balance
:
temp
)
{
ReportCellDataSourceDto
dto
=
new
ReportCellDataSourceDto
();
dto
.
setAmount
(
balance
.
getPeriodCr
());
dto
.
setPeriod
(
period
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/JFFS.java
View file @
e2fc00c4
...
...
@@ -2,17 +2,17 @@ package pwc.taxtech.atms.vat.service.impl.report.functions;
import
com.google.common.collect.Lists
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.ss.formula.OperationEvaluationContext
;
import
org.apache.poi.ss.formula.eval.NumberEval
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
import
pwc.taxtech.atms.common.util.DateUtils
;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
import
pwc.taxtech.atms.constant.Constant
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceType
;
import
pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto
;
import
pwc.taxtech.atms.entity.
*
;
import
pwc.taxtech.atms.entity.
Organization
;
import
pwc.taxtech.atms.vat.entity.*
;
import
java.math.BigDecimal
;
...
...
@@ -27,17 +27,17 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
@Override
public
ValueEval
evaluate
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
{
if
(
args
.
length
<
5
)
{
if
(
args
.
length
<
6
)
{
return
null
;
}
int
type
=
getInt
Param
(
args
[
0
],
ec
);
String
code
=
getString
Param
(
args
[
1
],
ec
);
int
year
=
getIntParam
(
args
[
2
],
ec
);
int
period
=
getIntParam
(
args
[
3
],
ec
);
int
sourceDataType
=
getIntParam
(
args
[
4
],
ec
);
String
formulaExpression
=
"JFFS("
+
type
+
",\""
+
code
+
"\","
+
year
+
","
+
period
+
","
+
sourceDataType
+
")"
;
String
code
=
getString
Param
(
args
[
0
],
ec
);
int
year
=
getInt
Param
(
args
[
1
],
ec
);
int
period
=
getIntParam
(
args
[
2
],
ec
);
int
sourceDataType
=
getIntParam
(
args
[
3
],
ec
);
//科目代码
String
segment5
=
getStringParam
(
args
[
4
],
ec
);
//利润中心代码
String
segment6
=
getStringParam
(
args
[
5
],
ec
);
//产品代码
String
formulaExpression
=
"JFFS(\""
+
code
+
"\","
+
year
+
","
+
period
+
","
+
sourceDataType
+
",\""
+
segment5
+
"\",\""
+
segment6
+
"\
")"
;
logger
.
debug
(
formulaExpression
);
year
=
getYear
(
year
);
...
...
@@ -48,149 +48,126 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
year
=
year
+
yearOffset
;
List
<
ReportCellDataSourceDto
>
dataSource
=
Lists
.
newArrayList
();
if
(
type
==
0
){
EnterpriseAccountSetOrgExample
example
=
new
EnterpriseAccountSetOrgExample
();
example
.
createCriteria
().
andEffectiveDateLessThanOrEqualTo
(
DateUtils
.
getNow
()).
andExpiredDateGreaterThanOrEqualTo
(
DateUtils
.
getNow
()).
andOrganizationIdEqualTo
(
orgId
);
List
<
EnterpriseAccountSetOrg
>
enterpriseAccountSetOrgs
=
SpringContextUtil
.
enterpriseAccountSetOrgMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
enterpriseAccountSetOrgs
)){
return
NumberEval
.
ZERO
;
}
AccountMappingExample
accountMappingExample
=
new
AccountMappingExample
();
accountMappingExample
.
createCriteria
().
andOrganizationIdEqualTo
(
orgId
)
.
andEnterpriseAccountSetIdEqualTo
(
enterpriseAccountSetOrgs
.
get
(
0
).
getEnterpriseAccountSetId
())
.
andStandardAccountCodeEqualTo
(
code
);
List
<
AccountMapping
>
accountMappings
=
SpringContextUtil
.
accountMappingMapper
.
selectByExample
(
accountMappingExample
);
double
result
=
0
;
for
(
AccountMapping
a
:
accountMappings
){
if
(
sourceDataType
==
1
){
result
+=
countForTrialBalance
(
a
.
getEnterpriseAccountCode
(),
dataSource
,
period
,
year
,
orgId
);
}
else
if
(
sourceDataType
==
2
){
result
+=
countForAdjBalance
(
a
.
getEnterpriseAccountCode
(),
dataSource
,
period
,
year
,
orgId
);
}
else
if
(
sourceDataType
==
3
){
result
+=
countForTrialFinalBalance
(
a
.
getEnterpriseAccountCode
(),
dataSource
,
period
,
year
,
orgId
);
}
else
{
return
NumberEval
.
ZERO
;
}
}
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
new
BigDecimal
(
result
),
period
,
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
result
),
dataSoureId
,
formulaContext
.
getProjectId
());
return
new
NumberEval
(
result
);
}
else
if
(
type
==
1
){
double
result
=
0.00
;
if
(
sourceDataType
==
1
){
result
=
countForTrialBalance
(
code
,
dataSource
,
period
,
year
,
orgId
);
}
else
if
(
sourceDataType
==
2
){
result
=
countForAdjBalance
(
code
,
dataSource
,
period
,
year
,
orgId
);
}
else
if
(
sourceDataType
==
3
){
result
=
countForTrialFinalBalance
(
code
,
dataSource
,
period
,
year
,
orgId
);
}
else
{
return
NumberEval
.
ZERO
;
}
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
new
BigDecimal
(
result
),
period
,
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
result
),
dataSoureId
,
formulaContext
.
getProjectId
());
return
new
NumberEval
(
result
);
}
return
NumberEval
.
ZERO
;
double
result
=
0.00
;
if
(
sourceDataType
==
1
)
{
result
=
countForTrialBalance
(
code
,
dataSource
,
period
,
year
,
orgId
,
segment5
,
segment6
);
}
else
if
(
sourceDataType
==
2
)
{
result
=
countForAdjBalance
(
code
,
dataSource
,
period
,
year
,
orgId
,
segment5
,
segment6
);
}
else
if
(
sourceDataType
==
3
)
{
result
=
countForTrialFinalBalance
(
code
,
dataSource
,
period
,
year
,
orgId
,
segment5
,
segment6
);
}
else
{
return
NumberEval
.
ZERO
;
}
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
FormulaDataSourceDto
,
new
BigDecimal
(
result
),
period
,
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
saveFormulaBlock
(
period
,
ec
,
formulaExpression
,
new
BigDecimal
(
result
),
dataSoureId
,
formulaContext
.
getProjectId
());
return
new
NumberEval
(
result
);
}
private
int
pardePeriod
(
int
period
,
int
year
){
return
Integer
.
parseInt
(
""
+
year
+
(
period
>
9
?
period
:
(
"0"
+
period
)));
private
int
pardePeriod
(
int
period
,
int
year
)
{
return
Integer
.
parseInt
(
""
+
year
+
(
period
>
9
?
period
:
(
"0"
+
period
)));
}
private
double
countForTrialBalance
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
,
String
orgId
)
{
private
double
countForTrialBalance
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
,
String
orgId
,
String
segment5
,
String
segment6
)
{
Organization
organization
=
SpringContextUtil
.
organizationMapper
.
selectByPrimaryKey
(
orgId
);
TrialBalanceExample
example
=
new
TrialBalanceExample
();
TrialBalanceExample
.
Criteria
c1
=
example
.
createCriteria
().
andSegment3EqualTo
(
code
).
andPeriodEqualTo
(
pardePeriod
(
period
,
year
));
TrialBalanceExample
.
Criteria
c2
=
example
.
createCriteria
().
andSegment4EqualTo
(
code
).
andPeriodEqualTo
(
pardePeriod
(
period
,
year
));
if
(
organization
!=
null
){
if
(
organization
!=
null
)
{
c1
.
andOrganizationIdEqualTo
(
organization
.
getId
());
c2
.
andOrganizationIdEqualTo
(
organization
.
getId
());
}
example
.
or
(
c2
);
if
(
StringUtils
.
isNotBlank
(
segment5
)){
c1
.
andSegment5EqualTo
(
segment5
);
}
if
(
StringUtils
.
isNotBlank
(
segment6
)){
c1
.
andSegment5EqualTo
(
segment6
);
}
List
<
TrialBalance
>
list
=
SpringContextUtil
.
trialBalanceMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
0.0
;
}
List
<
TrialBalance
>
temp
=
list
.
stream
().
filter
(
x
->
code
.
equalsIgnoreCase
(
x
.
getSegment3
())).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
temp
))
{
if
(
CollectionUtils
.
isEmpty
(
temp
))
{
temp
=
list
;
}
for
(
TrialBalance
balance
:
temp
)
{
for
(
TrialBalance
balance
:
temp
)
{
ReportCellDataSourceDto
dto
=
new
ReportCellDataSourceDto
();
dto
.
setAmount
(
balance
.
getPeriodDr
());
dto
.
setPeriod
(
period
);
dto
.
setIsOnlyManualInput
(
Boolean
.
FALSE
);
dto
.
setName
(
Constant
.
DataSourceName
.
ReportDataSource
);
dto
.
setType
(
FormulaDataSourceType
.
TrialBalanceSource
.
getCode
());
dto
.
setType
(
FormulaDataSourceType
.
TrialBalanceSource
.
getCode
());
contain
.
add
(
dto
);
}
return
temp
.
stream
().
mapToDouble
(
a
->
a
.
getPeriodDr
().
doubleValue
()).
sum
();
}
private
double
countForAdjBalance
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
,
String
orgId
){
private
double
countForAdjBalance
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
,
String
orgId
,
String
segment5
,
String
segment6
)
{
Organization
organization
=
SpringContextUtil
.
organizationMapper
.
selectByPrimaryKey
(
orgId
);
AdjustmentTableExample
example
=
new
AdjustmentTableExample
();
AdjustmentTableExample
.
Criteria
c1
=
example
.
createCriteria
().
andSegment3EqualTo
(
code
).
andPeriodEqualTo
(
pardePeriod
(
period
,
year
));
AdjustmentTableExample
.
Criteria
c2
=
example
.
createCriteria
().
andSegment4EqualTo
(
code
).
andPeriodEqualTo
(
pardePeriod
(
period
,
year
));
if
(
organization
!=
null
){
if
(
organization
!=
null
)
{
c1
.
andOrganizationIdEqualTo
(
organization
.
getId
());
c2
.
andOrganizationIdEqualTo
(
organization
.
getId
());
}
example
.
or
(
c2
);
if
(
StringUtils
.
isNotBlank
(
segment5
)){
c1
.
andSegment5EqualTo
(
segment5
);
}
if
(
StringUtils
.
isNotBlank
(
segment6
)){
c1
.
andSegment5EqualTo
(
segment6
);
}
List
<
AdjustmentTable
>
list
=
SpringContextUtil
.
adjustmentTableMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
0.0
;
}
List
<
AdjustmentTable
>
temp
=
list
.
stream
().
filter
(
x
->
code
.
equalsIgnoreCase
(
x
.
getSegment3
())).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
temp
))
{
if
(
CollectionUtils
.
isEmpty
(
temp
))
{
temp
=
list
;
}
for
(
AdjustmentTable
balance
:
temp
)
{
for
(
AdjustmentTable
balance
:
temp
)
{
ReportCellDataSourceDto
dto
=
new
ReportCellDataSourceDto
();
dto
.
setAmount
(
balance
.
getPeriodDrBeq
());
dto
.
setPeriod
(
period
);
dto
.
setIsOnlyManualInput
(
Boolean
.
FALSE
);
dto
.
setName
(
Constant
.
DataSourceName
.
ReportDataSource
);
dto
.
setType
(
FormulaDataSourceType
.
TrialBalanceSource
.
getCode
());
dto
.
setType
(
FormulaDataSourceType
.
TrialBalanceSource
.
getCode
());
contain
.
add
(
dto
);
}
return
temp
.
stream
().
mapToDouble
(
a
->
a
.
getPeriodDrBeq
().
doubleValue
()).
sum
();
}
private
double
countForTrialFinalBalance
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
,
String
orgId
){
private
double
countForTrialFinalBalance
(
String
code
,
List
<
ReportCellDataSourceDto
>
contain
,
int
period
,
int
year
,
String
orgId
,
String
segment5
,
String
segment6
)
{
Organization
organization
=
SpringContextUtil
.
organizationMapper
.
selectByPrimaryKey
(
orgId
);
TrialBalanceFinalExample
example
=
new
TrialBalanceFinalExample
();
TrialBalanceFinalExample
.
Criteria
c1
=
example
.
createCriteria
().
andSegment3EqualTo
(
code
).
andPeriodEqualTo
(
pardePeriod
(
period
,
year
));
TrialBalanceFinalExample
.
Criteria
c2
=
example
.
createCriteria
().
andSegment4EqualTo
(
code
).
andPeriodEqualTo
(
pardePeriod
(
period
,
year
));
if
(
organization
!=
null
){
if
(
organization
!=
null
)
{
c1
.
andOrganizationIdEqualTo
(
organization
.
getId
());
c2
.
andOrganizationIdEqualTo
(
organization
.
getId
());
}
example
.
or
(
c2
);
if
(
StringUtils
.
isNotBlank
(
segment5
)){
c1
.
andSegment5EqualTo
(
segment5
);
}
if
(
StringUtils
.
isNotBlank
(
segment6
)){
c1
.
andSegment5EqualTo
(
segment6
);
}
List
<
TrialBalanceFinal
>
list
=
SpringContextUtil
.
trialBalanceFinalMapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
return
0.0
;
}
List
<
TrialBalanceFinal
>
temp
=
list
.
stream
().
filter
(
x
->
code
.
equalsIgnoreCase
(
x
.
getSegment3
())).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isEmpty
(
temp
))
{
if
(
CollectionUtils
.
isEmpty
(
temp
))
{
temp
=
list
;
}
for
(
TrialBalanceFinal
balance
:
temp
)
{
for
(
TrialBalanceFinal
balance
:
temp
)
{
ReportCellDataSourceDto
dto
=
new
ReportCellDataSourceDto
();
dto
.
setAmount
(
balance
.
getPeriodDr
());
dto
.
setPeriod
(
period
);
dto
.
setIsOnlyManualInput
(
Boolean
.
FALSE
);
dto
.
setName
(
Constant
.
DataSourceName
.
ReportDataSource
);
dto
.
setType
(
FormulaDataSourceType
.
TrialBalanceSource
.
getCode
());
dto
.
setType
(
FormulaDataSourceType
.
TrialBalanceSource
.
getCode
());
contain
.
add
(
dto
);
}
return
temp
.
stream
().
mapToDouble
(
a
->
a
.
getPeriodDr
().
doubleValue
()).
sum
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/WPNAME.java
View file @
e2fc00c4
...
...
@@ -8,18 +8,12 @@ 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.constant.DataSourceName
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType
;
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.dto.vatdto.WPNAMEParasBo
;
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
java.math.BigDecimal
;
import
java.util.ArrayList
;
...
...
@@ -65,7 +59,7 @@ public class WPNAME extends FunctionBase implements FreeRefFunction {
MyAsserts
.
assertNotEmpty
(
cellTemplateDataList
,
Exceptions
.
BB_CELL_TEMP_NULL
);
cellTemplateData
=
cellTemplateDataList
.
get
(
0
);
int
index
=
ec
.
getWorkbook
().
getSheetIndex
(
bo
.
getReportCode
());
cellValue
=
getCellValue
(
index
,
ec
,
formulaContext
,
agent
,
cellTemplateData
.
getRowIndex
(),
bo
.
getColumnIndex
()
-
1
,
cellValue
=
getCellValue
(
index
,
ec
,
formulaContext
,
agent
,
cellTemplateData
.
getRowIndex
(),
"VAT020"
.
equals
(
bo
.
getReportCode
())?
bo
.
getColumnIndex
():(
bo
.
getColumnIndex
()
-
1
)
,
Long
.
parseLong
(
cellTemplateData
.
getCellTemplateId
()));
nullCellDto
.
extractFromGroup
(
bo
,
formulaContext
.
getPeriod
(),
formulaContext
.
getYear
(),
cellTemplateData
);
nullCellDto
.
setAmount
(
cellValue
);
...
...
atms-dao/src/main/java/pwc/taxtech/atms/dao/TaxDocumentMapper.java
View file @
e2fc00c4
...
...
@@ -41,7 +41,7 @@ public interface TaxDocumentMapper extends MyMapper {
*
* @mbg.generated
*/
Long
insert
(
TaxDocument
record
);
int
insert
(
TaxDocument
record
);
/**
* This method was generated by MyBatis Generator.
...
...
atms-dao/src/main/java/pwc/taxtech/atms/entity/CitTbam.java
View file @
e2fc00c4
...
...
@@ -33,6 +33,15 @@ public class CitTbam extends BaseEntity implements Serializable {
* @mbg.generated
*/
private
String
organizationId
;
private
Long
adjustAccount
;
public
Long
getAdjustAccount
()
{
return
adjustAccount
;
}
public
void
setAdjustAccount
(
Long
adjustAccount
)
{
this
.
adjustAccount
=
adjustAccount
;
}
/**
* Database Column Remarks:
...
...
@@ -623,28 +632,25 @@ public class CitTbam extends BaseEntity implements Serializable {
*/
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", organizationId="
).
append
(
organizationId
);
sb
.
append
(
", projectId="
).
append
(
projectId
);
sb
.
append
(
", date="
).
append
(
date
);
sb
.
append
(
", source="
).
append
(
source
);
sb
.
append
(
", period="
).
append
(
period
);
sb
.
append
(
", accountPeriod="
).
append
(
accountPeriod
);
sb
.
append
(
", attribute="
).
append
(
attribute
);
sb
.
append
(
", accountCode="
).
append
(
accountCode
);
sb
.
append
(
", accountDescription="
).
append
(
accountDescription
);
sb
.
append
(
", debitAmount="
).
append
(
debitAmount
);
sb
.
append
(
", creditAmount="
).
append
(
creditAmount
);
sb
.
append
(
", beginningBalance="
).
append
(
beginningBalance
);
sb
.
append
(
", endingBalance="
).
append
(
endingBalance
);
sb
.
append
(
", createBy="
).
append
(
createBy
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
return
"CitTbam{"
+
"id="
+
id
+
", organizationId='"
+
organizationId
+
'\''
+
", adjustAccount="
+
adjustAccount
+
", projectId='"
+
projectId
+
'\''
+
", date="
+
date
+
", source='"
+
source
+
'\''
+
", period="
+
period
+
", accountPeriod="
+
accountPeriod
+
", attribute='"
+
attribute
+
'\''
+
", accountCode='"
+
accountCode
+
'\''
+
", accountDescription='"
+
accountDescription
+
'\''
+
", debitAmount="
+
debitAmount
+
", creditAmount="
+
creditAmount
+
", beginningBalance="
+
beginningBalance
+
", endingBalance="
+
endingBalance
+
", createBy='"
+
createBy
+
'\''
+
", createTime="
+
createTime
+
", updateTime="
+
updateTime
+
'}'
;
}
}
\ No newline at end of file
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodFormulaBlockMapper.java
View file @
e2fc00c4
...
...
@@ -8,6 +8,7 @@ import pwc.taxtech.atms.vat.entity.PeriodFormulaBlock;
import
pwc.taxtech.atms.vat.entity.PeriodFormulaBlockExample
;
import
java.util.List
;
import
java.util.Map
;
@Mapper
public
interface
PeriodFormulaBlockMapper
extends
MyVatMapper
{
...
...
@@ -109,4 +110,6 @@ public interface PeriodFormulaBlockMapper extends MyVatMapper {
void
updateReportId
(
@Param
(
"reportId"
)
Long
reportId
,
@Param
(
"cellTemplateConfigIds"
)
List
<
Long
>
cellTemplateConfigIds
,
@Param
(
"period"
)
Integer
period
,
@Param
(
"projectId"
)
String
projectId
);
List
<
PeriodFormulaBlock
>
selectByWhere
(
Map
<
String
,
Object
>
map
);
}
\ No newline at end of file
atms-dao/src/main/resources/pwc/taxtech/atms/dao/extends/CitTbamExtendsMapper.xml
View file @
e2fc00c4
...
...
@@ -88,13 +88,12 @@
select
id as id,
attribute attribute,
account_code as accountCode,
account_description accountDescription,
debit_amount as debitAmount ,
credit_amount as creditAmount,
beginning_balance as beginningBalance,
ending_balance
as endingBalance
IFNULL(adjust_account, ending_balance)
as endingBalance
<if
test=
"sql != null and sql != '' "
>
${sql}
</if>
...
...
atms-web/src/main/webapp/Gruntfile.js
View file @
e2fc00c4
...
...
@@ -215,6 +215,7 @@ grunt.initConfig({
util
:
{
src
:
[
"Scripts/underscore.js"
,
"Scripts/arrgh.js"
,
"Scripts/tableau-2.2.2.min.js"
,
"Scripts/jquery.page.js"
,
"Scripts/jquery.floatThead.js"
,
"Scripts/jquery.dataTables.js"
,
...
...
atms-web/src/main/webapp/Scripts/module-part2.js
View file @
e2fc00c4
...
...
@@ -1682,4 +1682,23 @@ var analysisModule = angular.module('app.analysis', ['ui.grid', 'ui.router','ui.
sticky
:
true
});
//分析dashboard
$stateProvider
.
state
({
name
:
'unreturnedTax'
,
url
:
"/analysis/unreturnedTax"
,
dsr
:
true
,
views
:
{
'importContent'
:
{
controller
:
[
'$scope'
,
'$state'
,
'appTranslation'
,
function
(
$scope
,
$state
,
appTranslation
)
{
$scope
.
state
=
$state
;
appTranslation
.
load
([
appTranslation
.
appPart
]);
}],
template
:
'<unreturned-tax></unreturned-tax>'
}
},
resolve
:
scriptDependencyProvider
.
createDependenciesMap
(
scriptDependencyProvider
.
analysis
),
sticky
:
true
});
}]);
\ No newline at end of file
atms-web/src/main/webapp/Scripts/tableau-2.2.2.min.js
0 → 100644
View file @
e2fc00c4
This source diff could not be displayed because it is too large. You can
view the blob
instead.
atms-web/src/main/webapp/app-resources/i18n/zh-CN/app.json
View file @
e2fc00c4
...
...
@@ -893,6 +893,17 @@
"InternationalDataImport"
:
"国际税数据"
,
"TBEBITForm"
:
"TB EBIT 表格"
,
"ClickEnsureTip"
:
"请点击确定按钮!"
,
"MenuUnreturnedTax"
:
"未返还税金分析"
,
"MenuTaxComparison"
:
"未返还/返还后税金比较"
,
"MenuCostAnalysis"
:
"费用分析"
,
"MenuProfitAndLoss"
:
"利润/亏损分析"
,
"MenuOtherDomesticData"
:
"其他国内数据"
,
"MenuDocSituation"
:
"档案归档情况"
,
"MenuGlobalOverview"
:
"全球概览"
,
"MenuMexicanTax"
:
"墨西哥税务分析"
,
"MenuAustralianTax"
:
"澳洲税务分析"
,
"MenuBrazilianTax"
:
"巴西税务分析"
,
"MenuOtherCountries"
:
"其他国家税务分析"
,
"true"
:
"是"
,
"false"
:
"否"
,
...
...
atms-web/src/main/webapp/app/analysis/dashboard/unreturned-tax/unreturned-tax.ctrl.js
0 → 100644
View file @
e2fc00c4
analysisModule
.
controller
(
'UnreturnedTaxController'
,
[
'$scope'
,
'$filter'
,
'$log'
,
'$translate'
,
'$timeout'
,
function
(
$scope
,
$filter
,
$log
,
$translate
,
$timeout
)
{
'use strict'
;
function
init
()
{
var
placeholderDiv
=
document
.
getElementById
(
'vizContainer'
);
var
url
=
'http://10.158.230.16:8890/trusted/b4TGi86ySyuKfWyvE8vnww==:Rel9fneoVyJ58IukJ5ve-_k1/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no'
;
var
options
=
{
hideTabs
:
true
,
width
:
"90%"
,
height
:
"500px"
,
onFirstInteractive
:
function
()
{
// The viz is now ready and can be safely used.
console
.
log
(
"Run this code when the viz has finished loading."
);
}
};
$scope
.
viz
=
new
tableau
.
Viz
(
placeholderDiv
,
url
,
options
);
}
init
();
(
function
initialize
()
{
})();
}
]);
\ No newline at end of file
atms-web/src/main/webapp/app/analysis/dashboard/unreturned-tax/unreturned-tax.html
0 → 100644
View file @
e2fc00c4
<!--<script type='text/javascript' src='http://10.158.230.16:8890/javascripts/api/tableau-2.min.js'></script>-->
<div
class=
'tableauPlaceholder'
style=
'width: 1920px; height: 848px;'
>
<!--<object class='tableauViz' width='1920' height='848' style='display:none;'>-->
<!--<param name='host_url' value='http%3A%2F%2F10.158.230.16%3A8890%2F'/>-->
<!--<param name='embed_code_version' value='3'/>-->
<!--<param name='site_root' value=''/>-->
<!--<param name='name' value='Didi_Tax_20190307/sheet8'/>-->
<!--<param name='tabs' value='no'/>-->
<!--<param name='toolbar' value='yes'/>-->
<!--<param name='showAppBanner' value='false'/>-->
<!--<param name='filter' value='iframeSizedToWindow=true'/>-->
<!--<param name="ticket" value="g2-zt7USSSmP7mPfZU2P1Q==:kZimvabueyV0_38cviKedMKz"/>-->
<!--</object>-->
<div
id=
"vizContainer"
style=
"display: flex; justify-content: center"
></div>
</div>
<!--<iframe src="http://10.158.230.16:8890/trusted/JS6C48CESm6veO9zZqFLHw==:0dKT6t0QE0OeVhKYRQ7k471k/views/Didi_Tax_20190307/sheet8?iframeSizedToWindow=true&:embed=y&:showAppBanner=false&:display_count=no&:showVizHome=no"-->
<!--width="800" height="600"></iframe>-->
\ No newline at end of file
atms-web/src/main/webapp/app/analysis/dashboard/unreturned-tax/unreturned-tax.js
0 → 100644
View file @
e2fc00c4
analysisModule
.
directive
(
'unreturnedTax'
,
[
'$log'
,
function
(
$log
)
{
'use strict'
;
return
{
restrict
:
'E'
,
templateUrl
:
'/app/analysis/dashboard/unreturned-tax/unreturned-tax.html'
+
'?_='
+
Math
.
random
(),
scope
:
{
serviceTypeId
:
"=?"
,
periodId
:
"=?"
},
controller
:
'UnreturnedTaxController'
,
link
:
function
(
scope
,
element
)
{
}
};
}
]);
\ No newline at end of file
atms-web/src/main/webapp/app/analysis/dashboard/unreturned-tax/unreturned-tax.less
0 → 100644
View file @
e2fc00c4
@import "~/app-resources/less/theme.less";
\ No newline at end of file
atms-web/src/main/webapp/app/cit/report/entryList-modal/entryList-modal.ctrl.js
View file @
e2fc00c4
citModule
.
controller
(
'entryListModalController'
,
[
'$log'
,
'apiInterceptor'
,
'Upload'
,
'$scope'
,
'$q'
,
'$translate'
,
'$uibModal'
,
'$document'
,
'$rootScope'
,
'SweetAlert'
,
'enums'
,
'vatReportService'
,
'loginContext'
,
'vatSessionService'
,
'stdAccountService'
,
'vatCommonService'
,
'formulaService'
,
'KeyValueConfigService'
,
'modelConfigurationService'
,
'$timeout'
,
'cellCommentService'
,
'modifiedReportCellService'
,
'vatReportService'
,
'loginContext'
,
'vatSessionService'
,
'stdAccountService'
,
'vatCommonService'
,
'formulaService'
,
'KeyValueConfigService'
,
'modelConfigurationService'
,
'$timeout'
,
'cellCommentService'
,
'modifiedReportCellService'
,
'commonWebService'
,
function
(
$log
,
apiInterceptor
,
Upload
,
$scope
,
$q
,
$translate
,
$uibModal
,
$document
,
$rootScope
,
SweetAlert
,
enums
,
vatReportService
,
loginContext
,
vatSessionService
,
stdAccountService
,
vatCommonService
,
formulaService
,
KeyValueConfigService
,
modelConfigurationService
,
$timeout
,
cellCommentService
,
modifiedReportCellService
)
{
vatSessionService
,
stdAccountService
,
vatCommonService
,
formulaService
,
KeyValueConfigService
,
modelConfigurationService
,
$timeout
,
cellCommentService
,
modifiedReportCellService
,
commonWebService
)
{
var
entityInit
=
function
()
{
...
...
@@ -13,7 +13,10 @@
QMYETotalend
:
""
}
}
$scope
.
relObj
.
logs
=
[];
entityInit
();
$scope
.
dataGridOptions
=
{
bindingOptions
:
{
columns
:
'entryListColumns'
,
...
...
@@ -48,7 +51,8 @@
$log.debug($scope.selectedItems);*/
$scope
.
doCalcute
(
selectedItems
.
selectedRowsData
);
//更新日志
$scope
.
relObj
var
_data
=
selectedItems
.
selectedRowsData
;
$scope
.
relObj
.
logs
=
commonWebService
.
_index
(
_data
);
},
allowColumnResizing
:
true
,
...
...
@@ -58,7 +62,6 @@
showColumnLines
:
true
,
};
//设置数据源表格的列
var
getEntryListColumns
=
function
()
{
var
dataGridColumns
;
...
...
@@ -110,23 +113,21 @@
$scope
.
makeSure
=
function
()
{
$scope
.
relObj
.
checkRadio
=
$scope
.
checkRadio
;
$
(
'#entryListModal'
).
modal
(
'hide'
);
}
$scope
.
cancel
=
function
()
{
$
(
'#entryListModal'
).
modal
(
'hide'
);
entityInit
();
//
entityInit();
}
$scope
.
hideCellAttachmentModel
=
function
()
{
$
(
'#entryListModal'
).
modal
(
'hide'
);
entityInit
();
//
entityInit();
}
//
//配置计算公式进行计算
$scope
.
doCalcute
=
function
(
data
)
{
debugger
;
var
v1
=
0
;
//借方发生额合计
var
v2
=
0
//贷方发生额合计
var
_index
=
0
;
...
...
@@ -135,8 +136,8 @@
v1
=
parseFloat
(
item
.
accountedDr
);
v2
=
parseFloat
(
item
.
accountedCr
);
}
else
{
v1
+=
v1
+
parseFloat
(
item
.
accountedDr
);
v2
+=
v2
+
parseFloat
(
item
.
accountedCr
);
v1
+=
parseFloat
(
item
.
accountedDr
);
v2
+=
parseFloat
(
item
.
accountedCr
);
}
_index
++
;
});
...
...
@@ -146,10 +147,5 @@
$scope
.
entry
.
QMYETotalend
=
v1
-
v2
;
}
$scope
.
showLog
=
function
()
{
alert
(
'查看日志'
);
}
}
]);
\ No newline at end of file
atms-web/src/main/webapp/app/cit/report/entryList-modal/entryList-modal.js
View file @
e2fc00c4
...
...
@@ -4,7 +4,8 @@ function ($log) {
restrict
:
'E'
,
templateUrl
:
'/app/cit/report/entryList-modal/entryList-modal.html'
+
'?_='
+
Math
.
random
(),
scope
:
{
relObj
:
'='
relObj
:
'='
,
showLog
:
'&'
},
controller
:
'entryListModalController'
,
link
:
function
(
$scope
,
$element
,
$attr
)
{
...
...
atms-web/src/main/webapp/app/cit/report/entryLog-modal/entryLog-modal.ctrl.js
View file @
e2fc00c4
...
...
@@ -6,7 +6,7 @@
$scope
.
dataGridOptions
=
{
bindingOptions
:
{
columns
:
'entryLogColumns'
,
dataSource
:
'relObj.
entryLogSource
'
dataSource
:
'relObj.
logs
'
},
loadPanel
:
{
enabled
:
false
...
...
@@ -73,7 +73,9 @@
$scope
.
entryLogColumns
=
getEntryLogColumns
();
/* $scope.$watch('relObj.logs', function (n,o) {
});*/
$scope
.
hideCellAttachmentModel
=
function
()
{
$
(
'#entryListModal'
).
modal
(
'hide'
);
}
...
...
atms-web/src/main/webapp/app/cit/report/entryLog-modal/entryLog-modal.html
View file @
e2fc00c4
<div
class=
"modal fade"
id=
"entryL
ist
Modal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
>
<div
class=
"modal fade"
id=
"entryL
og
Modal"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
>
<div
class=
"modal-dialog modal-lg"
style=
"width: 1200px;"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
...
...
atms-web/src/main/webapp/app/cit/report/tax-report-cell-detail-modal/tax-report-cell-detail-modal.ctrl.js
View file @
e2fc00c4
...
...
@@ -228,6 +228,24 @@
}
$scope
.
hidePanel
();
vatCommonService
.
setProjectStatus
(
vatSessionService
.
project
.
id
,
vatSessionService
.
month
,
status
,
null
,
null
);
if
(
$scope
.
detail
.
cellType
==
enums
.
formulaDataSourceType
.
CIT_TBAM
){
//
[
$scope
.
detail
.
entryIndex
].
adjustBack
var
updateAdjustDto
=
[];
$scope
.
detail
.
dataGridSourceBind
.
forEach
(
function
(
e
,
index
){
if
(
e
.
adjustBack
!=
undefined
&&
e
.
adjustBack
!=
null
){
updateAdjustDto
.
push
({
id
:
e
.
id
,
adjustAccount
:
e
.
adjustBack
});
}
});
cellCommentService
.
updateAdjust
(
updateAdjustDto
).
success
(
function
(
res
)
{
}).
error
(
function
(
error
)
{
if
(
error
){
alert
(
"调整金额数据更新失败"
);
}
});
}
};
...
...
@@ -692,6 +710,7 @@
+
' '
+
evalVal
.
formatAmount
(
precition
));
}
else
if
(
$scope
.
selectedTabIndex
===
enums
.
formulaDataSourceType
.
CIT_TBAM
){
evalVal
=
_
.
reduce
(
$scope
.
detail
.
dataGridSource
,
function
(
memo
,
x
)
{
debugger
;
return
memo
+
x
.
endBalance
;
},
0
);
$
(
"#dataGridFooterSummary"
).
html
(
$translate
.
instant
(
'Conclusion'
)
...
...
@@ -1524,17 +1543,33 @@
$scope
.
$watch
(
'relObj.checkRadio'
,
function
(
n
,
o
)
{
if
(
$scope
.
detail
.
entryIndex
!=
undefined
){
$scope
.
detail
.
dataGridSourceBind
[
$scope
.
detail
.
entryIndex
].
adjustBack
=
n
;
calculateSum
(
n
);
}
});
var
loadAllDataForSum
=
function
(){
//加载合计值
//重新计算合计值
var
calculateSum
=
function
(
n
){
var
precition
=
2
;
var
evalVal
=
_
.
reduce
(
$scope
.
detail
.
dataGridSourceBind
,
function
(
memo
,
x
)
{
if
(
x
.
accountCode
==
$scope
.
relObj
.
account
){
memo
+
n
;
}
else
{
return
memo
+
x
.
endBalance
;
}
},
0
);
$
(
"#dataGridFooterSummary"
).
html
(
$translate
.
instant
(
'Conclusion'
)
+
' '
+
evalVal
.
formatAmount
(
precition
));
}
$scope
.
entryShowLog
=
function
(){
//显示日志
$
(
'#entryLogModal'
).
modal
(
'show'
);
}
//显示分录信息 同时加载数据
$scope
.
loadEntryListDataList
=
function
(
e
)
{
$scope
.
detail
.
entryIndex
=
e
.
dataIndex
;
debugger
;
cellCommentService
.
loadEntryListDataList
(
e
.
data
.
accountCode
).
success
(
function
(
res
)
{
$scope
.
relObj
.
account
=
e
.
data
.
accountCode
;
if
(
res
.
resultMsg
==
"success"
)
{
...
...
atms-web/src/main/webapp/app/cit/report/tax-report-cell-detail-modal/tax-report-cell-detail-modal.html
View file @
e2fc00c4
...
...
@@ -303,7 +303,7 @@
<!--分录弹框-->
<entry-list-modal
id =
"entryListId"
rel-obj =
"relObj"
></entry-list-modal>
<entry-Log
id =
"entryLogId"
rel-obj =
"relObj"
></entry-Log>
<entry-Log
id =
"entryLogId"
rel-obj =
"relObj"
show-log =
"entryShowLog"
></entry-Log>
</div>
...
...
atms-web/src/main/webapp/app/common/webservices/cellComment.svc.js
View file @
e2fc00c4
...
...
@@ -16,6 +16,9 @@ webservices.factory('cellCommentService', ['$http', 'apiConfig', function ($http
},
loadEntryListDataList
:
function
(
code
)
{
return
$http
.
get
(
'/CellComment/loadEntryListDataList?code='
+
code
,
apiConfig
.
createVat
());
},
updateAdjust
:
function
(
data
)
{
return
$http
.
post
(
'/CellComment/updateAdjust'
,
data
,
apiConfig
.
createVat
());
}
};
}]);
\ No newline at end of file
atms-web/src/main/webapp/app/framework/app-nav/app-nav.html
View file @
e2fc00c4
...
...
@@ -20,11 +20,6 @@
<span
class=
"nav-icon-color"
>
{{'MenuVAT' | translate}}
</span>
</a>
</div>
<div
class=
"nav-element-left"
>
<a
ui-sref=
"listApproval"
>
<span
class=
"nav-icon-color"
>
{{'MenuListApproval' | translate}}
</span>
</a>
</div>
<div
class=
"nav-element-left"
>
<a
ui-sref=
"overviewCit"
>
<span
class=
"nav-icon-color"
>
{{'MenuCIT' | translate}}
</span>
...
...
@@ -40,6 +35,11 @@
<span
class=
"nav-icon-color"
>
{{'MenuAnalysis' | translate}}
</span>
</a>
</div>
<div
class=
"nav-element-left"
>
<a
ui-sref=
"listApproval"
>
<span
class=
"nav-icon-color"
>
{{'MenuListApproval' | translate}}
</span>
</a>
</div>
<!--<div class="nav-element-left">-->
<!--<a ui-sref="summaryDashboard" hover-show="second">-->
<!--<span class="nav-icon-color">{{'MenuTaxAnalysisPlatform' | translate}}</span>-->
...
...
atms-web/src/main/webapp/app/taxDocumentManage/tax-document-list/tax-document-list.svc.js
View file @
e2fc00c4
...
...
@@ -67,16 +67,16 @@ taxDocumentManageModule.factory('taxDocumentListService',
return
jqFetch
.
post
(
apiInterceptor
.
webApiHostUrl
+
'/fileTypes/query4SelectionBox'
,
params
);
},
getCompanyNameOptions
:
function
(
params
){
return
jqFetch
.
post
(
apiInterceptor
.
webApiHostUrl
+
'/org/query4SelectionBox
'
,
params
);
return
jqFetch
.
get
(
apiInterceptor
.
webApiHostUrl
+
'/org/getMyOrgList
'
,
params
);
},
delFileRecordItems
:
function
(
params
){
return
jqFetch
.
post
(
apiInterceptor
.
webApiHostUrl
+
'/taxDoc/batchDelete'
,
params
);
},
getDocumentsAttrAndType
:
function
(
params
){
return
jqFetch
.
post
(
apiInterceptor
.
webApiHostUrl
+
'/
v1/
fileTypes/selectList'
,
params
);
return
jqFetch
.
post
(
apiInterceptor
.
webApiHostUrl
+
'/fileTypes/selectList'
,
params
);
},
getBusinessList
:
function
(
params
){
return
jqFetch
.
get
(
apiInterceptor
.
webApiHostUrl
+
'/
v1/
businessunit/getlist'
,
params
);
return
jqFetch
.
get
(
apiInterceptor
.
webApiHostUrl
+
'/businessunit/getlist'
,
params
);
},
downloadAllFile
:
function
(
params
){
var
xhr
=
new
XMLHttpRequest
();
...
...
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