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
aae9f6a9
Commit
aae9f6a9
authored
Nov 06, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Optimial] fixed gen data to async
parent
178b5b36
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
130 additions
and
15 deletions
+130
-15
ReportController.java
...in/java/pwc/taxtech/atms/controller/ReportController.java
+3
-14
PeriodResources.java
...ain/java/pwc/taxtech/atms/dto/vatdto/PeriodResources.java
+50
-0
WrapPeriodJobDto.java
...in/java/pwc/taxtech/atms/dto/vatdto/WrapPeriodJobDto.java
+41
-0
ConflictException.java
...in/java/pwc/taxtech/atms/exception/ConflictException.java
+30
-0
Exceptions.java
.../src/main/java/pwc/taxtech/atms/exception/Exceptions.java
+6
-1
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+0
-0
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+0
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/ReportController.java
View file @
aae9f6a9
...
...
@@ -32,22 +32,11 @@ public class ReportController {
return
reportService
.
getReportTemplate
(
projectId
,
EnumServiceType
.
getEnumByCode
(
serviceType
),
period
);
}
@RequestMapping
(
value
=
"updateConfig/{projectId}/{ifDeleteManualDataSource}/{period}"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
public
OperationResultDto
updateConfig
(
@PathVariable
String
projectId
,
@PathVariable
Boolean
ifDeleteManualDataSource
,
@PathVariable
Integer
period
,
@RequestParam
String
generator
,
@RequestParam
Boolean
mergeManual
)
{
return
reportService
.
updateConfig
(
projectId
,
period
,
ifDeleteManualDataSource
,
generator
,
mergeManual
);
// OperationResultDto operationResultDto = new OperationResultDto();
// operationResultDto.setResult(true);
// return operationResultDto;
}
@RequestMapping
(
value
=
"generateByTotal/{projectId}/{ifDeleteManualDataSource}/{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
)
{
return
reportService
.
generateData
(
projectId
,
EnumServiceType
.
VAT
,
ifDeleteManualDataSource
,
period
,
null
,
generator
);
@PathVariable
Integer
period
,
@RequestParam
Optional
<
String
>
generator
,
@RequestParam
Boolean
mergeManual
)
{
return
reportService
.
generateData
(
projectId
,
EnumServiceType
.
VAT
,
mergeManual
,
period
,
null
,
generator
);
}
@RequestMapping
(
value
=
"templateReferences/{period}"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
APPLICATION_JSON_UTF8_VALUE
)
...
...
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/PeriodResources.java
0 → 100644
View file @
aae9f6a9
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
lombok.Getter
;
import
pwc.taxtech.atms.common.util.MyAsserts
;
import
pwc.taxtech.atms.entity.Project
;
import
pwc.taxtech.atms.entity.TemplateGroup
;
import
pwc.taxtech.atms.exception.Exceptions
;
import
pwc.taxtech.atms.service.impl.Message
;
import
pwc.taxtech.atms.vat.entity.PeriodCellTemplate
;
import
pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig
;
import
pwc.taxtech.atms.vat.entity.PeriodTemplate
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Getter
public
class
PeriodResources
{
Project
project
;
List
<
PeriodTemplate
>
periodTemplates
=
new
ArrayList
<>();
List
<
PeriodCellTemplate
>
periodCellTemplates
=
new
ArrayList
<>();
List
<
PeriodCellTemplateConfig
>
periodCellTemplateConfigs
=
new
ArrayList
<>();
public
void
setProject
(
Project
project
)
{
this
.
project
=
project
;
}
public
void
putAllTemplate
(
List
<
PeriodTemplate
>
periodTemplates
)
{
periodTemplates
.
addAll
(
periodTemplates
);
}
public
List
<
Long
>
getTemolateIds
()
{
MyAsserts
.
assertNotEmpty
(
periodTemplates
,
Exceptions
.
NOT_FOUND_TEMPLATE_EXCEPTION
);
return
periodTemplates
.
stream
()
.
map
(
PeriodTemplate:
:
getTemplateId
)
.
collect
(
Collectors
.
toList
());
}
public
void
putAllCellTemplate
(
List
<
PeriodCellTemplate
>
periodCellTemplates
)
{
periodCellTemplates
.
addAll
(
periodCellTemplates
);
}
public
void
putAllCellTemplateConfig
(
List
<
PeriodCellTemplateConfig
>
periodCellTemplateConfigs
)
{
periodCellTemplateConfigs
.
addAll
(
periodCellTemplateConfigs
);
}
public
Long
getTemplateGroupId
(){
return
periodTemplates
.
get
(
0
).
getTemplateGroupId
();
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/vatdto/WrapPeriodJobDto.java
0 → 100644
View file @
aae9f6a9
package
pwc
.
taxtech
.
atms
.
dto
.
vatdto
;
import
pwc.taxtech.atms.common.util.MyAsserts
;
import
pwc.taxtech.atms.entity.Project
;
import
pwc.taxtech.atms.entity.Template
;
import
pwc.taxtech.atms.exception.Exceptions
;
import
pwc.taxtech.atms.vat.entity.PeriodJob
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.UUID
;
public
class
WrapPeriodJobDto
{
public
static
final
String
STATUS_BEGIN
=
"Begin"
;
public
static
final
String
STATUS_CANCEL
=
"Cancel"
;
public
static
final
String
STATUS_ERROR
=
"Error"
;
public
static
final
String
STATUS_END
=
"End"
;
public
static
final
String
STEP_UPDATE_CONFIG
=
"UpdateConfig"
;
public
static
PeriodJob
createReportGenJob
(
String
projectId
,
Integer
period
,
List
<
Template
>
templates
)
{
MyAsserts
.
assertNotEmpty
(
templates
,
Exceptions
.
NOT_FOUND_TEMPLATE_EXCEPTION
);
PeriodJob
job
=
new
PeriodJob
();
job
.
setCreateTime
(
new
Date
());
job
.
setName
(
"Gen All Report"
);
job
.
setProjectId
(
projectId
);
job
.
setPeriod
(
period
);
job
.
setId
(
UUID
.
randomUUID
().
toString
());
job
.
setStatus
(
STATUS_BEGIN
);
job
.
setCurrentStep
(
STEP_UPDATE_CONFIG
);
StringBuilder
builder
=
new
StringBuilder
(
STEP_UPDATE_CONFIG
);
templates
.
forEach
(
m
->
{
builder
.
append
(
","
).
append
(
m
.
getCode
());
});
job
.
setStepsCode
(
builder
.
toString
());
return
job
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/exception/ConflictException.java
0 → 100644
View file @
aae9f6a9
package
pwc
.
taxtech
.
atms
.
exception
;
import
org.springframework.http.ResponseEntity
;
import
javax.net.ssl.SSLEngineResult
;
import
static
org
.
springframework
.
http
.
HttpStatus
.
CONFLICT
;
public
class
ConflictException
extends
ApiException
{
public
ConflictException
()
{
super
();
}
public
ConflictException
(
String
message
)
{
super
(
message
);
}
public
ConflictException
(
String
message
,
Throwable
cause
)
{
super
(
message
,
cause
);
}
public
ConflictException
(
Throwable
cause
)
{
super
(
cause
);
}
@Override
public
<
Object
>
ResponseEntity
handle
()
{
return
ResponseEntity
.
status
(
CONFLICT
).
build
();
}
}
atms-api/src/main/java/pwc/taxtech/atms/exception/Exceptions.java
View file @
aae9f6a9
...
...
@@ -10,6 +10,11 @@ public class Exceptions {
public
static
final
ApiException
EMPTY_PROJECT_PARAM
=
new
BadParameterException
(
"project is empty"
);
public
static
final
ApiException
EMPTY_PRIODDATE_PARAM
=
new
BadParameterException
(
"period data is empty"
);
public
static
final
ApiException
NOT_FOUND_REPORT_EXCEPTION
=
new
NotFoundException
(
"not found report"
);
public
static
final
ApiException
NOT_FOUND_TEMPLATE_EXCEPTION
=
new
NotFoundException
(
"not found template"
);
public
static
final
ApiException
REPORT_HAS_COMMIT_EXCEPTION
=
new
AlreadyExistsException
(
"report approval has commit"
);
public
static
final
ApiException
SERVER_ERROR_EXCEPTION
=
new
ServerErrorException
(
"server error exception"
);
public
static
final
ApiException
SERVER_ERROR_EXCEPTION
=
new
ServerErrorException
(
"server error exception"
);
public
static
final
ApiException
TASK_HAS_BEGINNING
=
new
ConflictException
(
"task has beginning .."
);
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"
);
}
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
aae9f6a9
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
aae9f6a9
This diff is collapsed.
Click to expand it.
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