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
6cb2f1fd
Commit
6cb2f1fd
authored
Nov 07, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEv] add get job api impl
parent
63bedb84
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
67 additions
and
5 deletions
+67
-5
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+15
-2
Exceptions.java
.../src/main/java/pwc/taxtech/atms/exception/Exceptions.java
+1
-0
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+13
-3
PeriodJobMapper.java
...c/main/java/pwc/taxtech/atms/vat/dao/PeriodJobMapper.java
+38
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
6cb2f1fd
...
...
@@ -10,6 +10,7 @@ import pwc.taxtech.atms.dpo.ReportDto;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.vatdto.*
;
import
pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig
;
import
pwc.taxtech.atms.vat.entity.PeriodJob
;
import
pwc.taxtech.atms.vat.entity.VatEnterpriseAccount
;
import
pwc.taxtech.atms.vat.service.impl.ReportServiceImpl
;
...
...
@@ -32,13 +33,25 @@ public class ReportController {
return
reportService
.
getReportTemplate
(
projectId
,
EnumServiceType
.
getEnumByCode
(
serviceType
),
period
);
}
@RequestMapping
(
value
=
"generateByTotal/{projectId}/{
ifDeleteManualDataSource
}/{period}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@RequestMapping
(
value
=
"generateByTotal/{projectId}/{
mergeManual
}/{period}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
generateAllData
(
@PathVariable
String
projectId
,
@PathVariable
Boolean
ifDeleteManualDataSource
,
@PathVariable
Integer
period
,
@RequestParam
Optional
<
String
>
generator
,
@
RequestParam
Boolean
mergeManual
)
{
@
PathVariable
Boolean
mergeManual
)
{
return
reportService
.
generateData
(
projectId
,
EnumServiceType
.
VAT
,
mergeManual
,
period
,
null
,
generator
);
}
@RequestMapping
(
value
=
"getRunningJob/{projectId}/{period}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ResponseBody
public
PeriodJob
getRunningJob
(
@PathVariable
String
projectId
,
@PathVariable
Integer
period
)
{
return
reportService
.
getRunningJob
(
projectId
,
period
);
}
@RequestMapping
(
value
=
"getJobStatus/{projectId}//{period}/{jobId}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
@ResponseBody
public
PeriodJob
getJobStatus
(
@PathVariable
String
projectId
,
@PathVariable
Integer
period
,
@PathVariable
String
jobId
)
{
return
reportService
.
getJobStatus
(
projectId
,
period
,
jobId
);
}
@RequestMapping
(
value
=
"templateReferences/{period}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
List
<
CellTemplateReferenceDto
>
getTemplateReferences
(
@PathVariable
int
period
)
{
return
reportService
.
getTemplateReferences
(
period
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/exception/Exceptions.java
View file @
6cb2f1fd
...
...
@@ -17,4 +17,5 @@ public class Exceptions {
public
static
final
ApiException
PROJECT_EMPTY_EXCEPTION
=
new
BadParameterException
(
"projectId is empty"
);
public
static
final
ApiException
PROJECT_PROJECT_EXCEPTION
=
new
NotFoundException
(
"not found project"
);
public
static
final
ApiException
NOT_FOUND_TEMPLATE_GROUP_EXCEPTION
=
new
NotFoundException
(
"not found template group"
);
public
static
final
ApiException
NOT_FOUND_EXCEPTION
=
new
NotFoundException
(
"not found resources"
);
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
6cb2f1fd
...
...
@@ -489,13 +489,13 @@ public class ReportServiceImpl {
Workbook
workbook
=
reportGenerator
.
createWorkBookByPeriodTemplate
(
resources
.
getPeriodTemplates
(),
genJob
);
reportGenerator
.
addFunctionsAndContext
(
workbook
,
functions
,
reportGenerator
.
initContext
(
resources
,
periodParam
));
reportGenerator
.
setConfigAndDataToWorkBook
(
workbook
,
resources
);
reportGenerator
.
addFunctionsAndContext
(
workbook
,
functions
,
reportGenerator
.
initContext
(
resources
,
periodParam
));
reportGenerator
.
setConfigAndDataToWorkBook
(
workbook
,
resources
);
FormulaEvaluator
evaluator
=
workbook
.
getCreationHelper
().
createFormulaEvaluator
();
evaluator
.
evaluateAll
();
reportGenerator
.
updateWorkbookCaclsValueToDb
(
projectId
,
periodParam
,
workbook
,
resources
,
genJob
);
reportGenerator
.
updateWorkbookCaclsValueToDb
(
projectId
,
periodParam
,
workbook
,
resources
,
genJob
);
genJob
.
setStatus
(
WrapPeriodJobDto
.
STATUS_END
);
periodJobMapper
.
updateByPrimaryKey
(
genJob
);
}
...
...
@@ -1227,4 +1227,14 @@ public class ReportServiceImpl {
private
String
combine
(
String
parent
,
String
child
)
{
return
String
.
format
(
"%s"
+
File
.
separator
+
"%s"
,
parent
,
child
);
}
public
PeriodJob
getRunningJob
(
String
projectId
,
Integer
period
)
{
return
periodJobMapper
.
getRunningJob
(
projectId
,
period
);
}
public
PeriodJob
getJobStatus
(
String
projectId
,
Integer
period
,
String
jobId
)
{
PeriodJob
job
=
periodJobMapper
.
getJobStatus
(
projectId
,
period
,
jobId
);
MyAsserts
.
assertNotNull
(
job
,
Exceptions
.
NOT_FOUND_EXCEPTION
);
return
job
;
}
}
atms-dao/src/main/java/pwc/taxtech/atms/vat/dao/PeriodJobMapper.java
View file @
6cb2f1fd
...
...
@@ -3,6 +3,7 @@ package pwc.taxtech.atms.vat.dao;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
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.entity.PeriodJob
;
...
...
@@ -105,4 +106,40 @@ public interface PeriodJobMapper extends MyVatMapper {
* @mbg.generated
*/
int
updateByPrimaryKey
(
PeriodJob
record
);
@Select
(
"SELECT "
+
" ID AS id, "
+
" NAME AS name, "
+
" CURRENT_STEP AS currentStep, "
+
" PROJECT_ID AS projectId, "
+
" PERIOD AS period, "
+
" STEPS_CODE AS stepsCode, "
+
" CREATE_TIME AS createTime, "
+
" STATUS AS status, "
+
" ERROR_MSG AS errorMsg "
+
"FROM "
+
" PERIOD_JOB "
+
"WHERE "
+
" STATUS = 'Begin' "
+
" AND PROJECT_ID = #{projectId} "
+
" AND PERIOD =#{period}"
)
PeriodJob
getRunningJob
(
@Param
(
"projectId"
)
String
projectId
,
@Param
(
"period"
)
Integer
period
);
@Select
(
"SELECT "
+
" ID AS id, "
+
" NAME AS name, "
+
" CURRENT_STEP AS currentStep, "
+
" PROJECT_ID AS projectId, "
+
" PERIOD AS period, "
+
" STEPS_CODE AS stepsCode, "
+
" CREATE_TIME AS createTime, "
+
" STATUS AS status, "
+
" ERROR_MSG AS errorMsg "
+
"FROM "
+
" PERIOD_JOB "
+
"WHERE "
+
" PROJECT_ID = #{projectId} "
+
" AND PERIOD =#{period} "
+
" AND ID = #{id}"
)
PeriodJob
getJobStatus
(
@Param
(
"projectId"
)
String
projectId
,
@Param
(
"period"
)
Integer
period
,
@Param
(
"id"
)
String
id
);
}
\ No newline at end of file
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