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
a09a7123
Commit
a09a7123
authored
Nov 08, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] update old reporte id when merge manalcelldata
parent
2c437838
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
114 additions
and
2 deletions
+114
-2
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+18
-2
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+13
-0
PeriodCellDataMapper.java
...n/java/pwc/taxtech/atms/vat/dao/PeriodCellDataMapper.java
+33
-0
MergerManaualCellData.java
.../java/pwc/taxtech/atms/vat/dpo/MergerManaualCellData.java
+50
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
a09a7123
...
...
@@ -14,6 +14,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
pwc.taxtech.atms.common.POIUtil
;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
import
pwc.taxtech.atms.constant.enums.CellDataSourceType
;
...
...
@@ -26,6 +27,7 @@ import pwc.taxtech.atms.exception.Exceptions;
import
pwc.taxtech.atms.service.impl.DistributedIdService
;
import
pwc.taxtech.atms.service.impl.HttpFileService
;
import
pwc.taxtech.atms.vat.dao.*
;
import
pwc.taxtech.atms.vat.dpo.MergerManaualCellData
;
import
pwc.taxtech.atms.vat.dpo.PeriodCellTemplateConfigExtendDto
;
import
pwc.taxtech.atms.vat.entity.*
;
import
pwc.taxtech.atms.vat.service.impl.report.functions.*
;
...
...
@@ -83,6 +85,20 @@ public class ReportGeneratorImpl {
return
periodResources
;
}
@Transactional
public
void
updateManaCellDataWithNewReport
(
String
projectId
,
Integer
period
)
{
List
<
MergerManaualCellData
>
result
=
periodCellDataMapper
.
selectManualToBeMerged
(
projectId
,
period
);
if
(!
result
.
isEmpty
())
{
result
.
forEach
(
m
->
{
PeriodCellData
pcd
=
new
PeriodCellData
();
pcd
.
setId
(
m
.
getId
());
pcd
.
setReportId
(
m
.
getNewReportId
());
periodCellDataMapper
.
updateByPrimaryKeySelective
(
pcd
);
});
}
}
@Transactional
public
void
updateWorkbookCaclsValueToDb
(
String
projectId
,
Integer
period
,
Workbook
workbook
,
PeriodResources
resources
,
PeriodJob
job
)
{
for
(
int
i
=
0
;
i
<
workbook
.
getNumberOfSheets
();
i
++)
{
Sheet
sheet
=
workbook
.
getSheetAt
(
i
);
...
...
@@ -336,9 +352,9 @@ public class ReportGeneratorImpl {
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
job
.
setStatus
(
WrapPeriodJobDto
.
STATUS_ERROR
);
job
.
setErrorMsg
(
"cacals report for code "
+
code
+
" failed"
);
job
.
setErrorMsg
(
"cacals report for code "
+
code
+
" failed"
);
}
finally
{
}
finally
{
job
.
setCurrentStep
(
code
);
periodJobMapper
.
updateByPrimaryKey
(
job
);
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
a09a7123
...
...
@@ -11,6 +11,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.annotation.Transactional
;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.common.util.MyAsserts
;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
...
...
@@ -273,6 +274,7 @@ public class ReportServiceImpl {
}
@Transactional
private
void
updateConfig
(
String
projectId
,
Integer
period
,
Boolean
isMergeManualData
,
List
<
Template
>
templates
,
PeriodJob
job
)
{
try
{
List
<
Long
>
exceptTemplateIds
=
templateMapper
.
getIdsForExceptTemplate
();
...
...
@@ -496,6 +498,8 @@ public class ReportServiceImpl {
new
Thread
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
updateConfig
(
projectId
,
periodParam
,
isMergeManualData
,
templates
,
genJob
);
PeriodResources
resources
=
reportGenerator
.
getPeriodResources
(
projectId
,
periodParam
,
...
...
@@ -510,9 +514,18 @@ public class ReportServiceImpl {
evaluator
.
evaluateAll
();
reportGenerator
.
updateWorkbookCaclsValueToDb
(
projectId
,
periodParam
,
workbook
,
resources
,
genJob
);
reportGenerator
.
updateManaCellDataWithNewReport
(
projectId
,
periodParam
);
genJob
.
setStatus
(
WrapPeriodJobDto
.
STATUS_END
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
genJob
.
setStatus
(
WrapPeriodJobDto
.
STATUS_ERROR
);
genJob
.
setErrorMsg
(
"Server error"
);
}
finally
{
periodJobMapper
.
updateByPrimaryKey
(
genJob
);
}
}
}).
start
();
operationResultDto
.
setData
(
genJob
);
operationResultDto
.
setResult
(
true
);
...
...
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodCellDataMapper.java
View file @
a09a7123
...
...
@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Param;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.session.RowBounds
;
import
pwc.taxtech.atms.MyVatMapper
;
import
pwc.taxtech.atms.vat.dpo.MergerManaualCellData
;
import
pwc.taxtech.atms.vat.entity.PCTEntity
;
import
pwc.taxtech.atms.vat.entity.PeriodCellData
;
import
pwc.taxtech.atms.vat.entity.PeriodCellDataExample
;
...
...
@@ -130,4 +131,35 @@ public interface PeriodCellDataMapper extends MyVatMapper {
" </foreach>"
+
"</script>"
)
List
<
PCTEntity
>
queryByPCTs
(
@Param
(
"list"
)
Set
<
PCTEntity
>
parameter
,
@Param
(
"projectId"
)
String
projectId
);
@Select
(
""
+
"SELECT "
+
" d.ID AS id, "
+
" d.REPORT_ID AS reportId, "
+
" d.CELL_TEMPLATE_ID AS cellTemplateId, "
+
" p.REPORT_TEMPLATE_ID AS templateId, "
+
" t.ID AS newReportId "
+
"FROM "
+
" PERIOD_CELL_DATA d "
+
" JOIN PERIOD_CELL_TEMPLATE p ON d.CELL_TEMPLATE_ID = p.CELL_TEMPLATE_ID "
+
" LEFT JOIN PERIOD_REPORT t ON p.REPORT_TEMPLATE_ID = t.TEMPLATE_ID "
+
"WHERE "
+
" d.PROJECT_ID = #{projectId} "
+
" AND p.PROJECT_ID = #{projectId} "
+
" AND t.PROJECT_ID = #{projectId} "
+
" AND d.PERIOD = #{period} "
+
" AND p.PERIOD = #{period} "
+
" AND t.PERIOD = #{period} "
+
" AND d.REPORT_ID NOT IN ( "
+
" SELECT "
+
" ID "
+
" FROM "
+
" PERIOD_REPORT "
+
" WHERE "
+
" PROJECT_ID = #{projectId} "
+
" AND PERIOD = #{period} "
+
" )"
+
""
)
List
<
MergerManaualCellData
>
selectManualToBeMerged
(
@Param
(
"projectId"
)
String
projectId
,
@Param
(
"period"
)
Integer
period
);
}
\ No newline at end of file
atms-dao/src/main/java/pwc/taxtech/atms/vat/dpo/MergerManaualCellData.java
0 → 100644
View file @
a09a7123
package
pwc
.
taxtech
.
atms
.
vat
.
dpo
;
public
class
MergerManaualCellData
{
private
Long
id
;
private
Long
reportId
;
private
Long
cellTemplateId
;
private
Long
templateId
;
private
Long
newReportId
;
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
Long
getReportId
()
{
return
reportId
;
}
public
void
setReportId
(
Long
reportId
)
{
this
.
reportId
=
reportId
;
}
public
Long
getCellTemplateId
()
{
return
cellTemplateId
;
}
public
void
setCellTemplateId
(
Long
cellTemplateId
)
{
this
.
cellTemplateId
=
cellTemplateId
;
}
public
Long
getTemplateId
()
{
return
templateId
;
}
public
void
setTemplateId
(
Long
templateId
)
{
this
.
templateId
=
templateId
;
}
public
Long
getNewReportId
()
{
return
newReportId
;
}
public
void
setNewReportId
(
Long
newReportId
)
{
this
.
newReportId
=
newReportId
;
}
}
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