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
6970a45b
Commit
6970a45b
authored
Jul 09, 2018
by
neo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DEV] 状态码迁VV]V] http状态码迁移,自定义异常
parent
092ecc04
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
81 additions
and
53 deletions
+81
-53
pom.xml
atms-api/pom.xml
+15
-16
DataSourceFactory.java
...pwc/taxtech/atms/common/datasource/DataSourceFactory.java
+1
-1
Constant.java
...api/src/main/java/pwc/taxtech/atms/constant/Constant.java
+7
-5
CustomsInvoiceController.java
...pwc/taxtech/atms/controller/CustomsInvoiceController.java
+5
-3
FileUploadController.java
...ava/pwc/taxtech/atms/controller/FileUploadController.java
+1
-9
InputInvoiceImportController.java
...taxtech/atms/controller/InputInvoiceImportController.java
+5
-3
OutputInvoiceController.java
.../pwc/taxtech/atms/controller/OutputInvoiceController.java
+5
-3
TBDataImportController.java
...a/pwc/taxtech/atms/controller/TBDataImportController.java
+4
-4
NotSupportedException.java
...ava/pwc/taxtech/atms/exception/NotSupportedException.java
+10
-0
ParameterException.java
...n/java/pwc/taxtech/atms/exception/ParameterException.java
+12
-0
DataSourcePoolService.java
.../pwc/taxtech/atms/service/impl/DataSourcePoolService.java
+1
-1
ProjectServiceImpl.java
...ava/pwc/taxtech/atms/service/impl/ProjectServiceImpl.java
+1
-1
ReportGeneratorImpl.java
...wc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
+5
-3
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+9
-4
No files found.
atms-api/pom.xml
View file @
6970a45b
...
@@ -162,11 +162,7 @@
...
@@ -162,11 +162,7 @@
<version>
1.1.5
</version>
<version>
1.1.5
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.microsoft.sqlserver
</groupId>
<artifactId>
mssql-jdbc
</artifactId>
<version>
6.2.2.jre7
</version>
</dependency>
<dependency>
<dependency>
<groupId>
mysql
</groupId>
<groupId>
mysql
</groupId>
<artifactId>
mysql-connector-java
</artifactId>
<artifactId>
mysql-connector-java
</artifactId>
...
@@ -255,6 +251,7 @@
...
@@ -255,6 +251,7 @@
<artifactId>
poi-ooxml
</artifactId>
<artifactId>
poi-ooxml
</artifactId>
<version>
3.17
</version>
<version>
3.17
</version>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.apache.commons
</groupId>
<groupId>
org.apache.commons
</groupId>
<artifactId>
commons-text
</artifactId>
<artifactId>
commons-text
</artifactId>
...
@@ -300,11 +297,13 @@
...
@@ -300,11 +297,13 @@
<groupId>
org.apache.tika
</groupId>
<groupId>
org.apache.tika
</groupId>
<artifactId>
tika-core
</artifactId>
<artifactId>
tika-core
</artifactId>
<version>
1.17
</version>
<version>
1.17
</version>
<scope>
test
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
org.apache.tika
</groupId>
<groupId>
org.apache.tika
</groupId>
<artifactId>
tika-parsers
</artifactId>
<artifactId>
tika-parsers
</artifactId>
<version>
1.17
</version>
<version>
1.17
</version>
<scope>
test
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.javaaxp
</groupId>
<groupId>
com.javaaxp
</groupId>
...
@@ -323,17 +322,17 @@
...
@@ -323,17 +322,17 @@
<artifactId>
lombok
</artifactId>
<artifactId>
lombok
</artifactId>
<version>
1.18.0
</version>
<version>
1.18.0
</version>
</dependency>
</dependency>
<
!--<dependency>--
>
<
dependency
>
<
!--<groupId>org.eclipse.jetty.aggregate</groupId>--
>
<
groupId>
org.eclipse.jetty.aggregate
</groupId
>
<
!--<artifactId>jetty-all</artifactId>--
>
<
artifactId>
jetty-all
</artifactId
>
<
!--<version>9.4.10.v20180503</version>--
>
<
version>
9.4.10.v20180503
</version
>
<
!--<type>pom</type>--
>
<
type>
pom
</type
>
<
!--</dependency>--
>
<
/dependency
>
<
!--<dependency>--
>
<
dependency
>
<
!--<groupId>org.eclipse.jetty</groupId>--
>
<
groupId>
org.eclipse.jetty
</groupId
>
<
!--<artifactId>apache-jsp</artifactId>--
>
<
artifactId>
apache-jsp
</artifactId
>
<
!--<version>9.4.10.v20180503</version>--
>
<
version>
9.4.10.v20180503
</version
>
<
!--</dependency>--
>
<
/dependency
>
</dependencies>
</dependencies>
<profiles>
<profiles>
...
...
atms-api/src/main/java/pwc/taxtech/atms/common/datasource/DataSourceFactory.java
View file @
6970a45b
package
pwc
.
taxtech
.
atms
.
common
.
datasource
;
package
pwc
.
taxtech
.
atms
.
common
.
datasource
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.beust.jcommander.ParameterException
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.pool2.KeyedPooledObjectFactory
;
import
org.apache.commons.pool2.KeyedPooledObjectFactory
;
import
org.apache.commons.pool2.PooledObject
;
import
org.apache.commons.pool2.PooledObject
;
import
org.apache.commons.pool2.impl.DefaultPooledObject
;
import
org.apache.commons.pool2.impl.DefaultPooledObject
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
pwc.taxtech.atms.exception.ParameterException
;
public
class
DataSourceFactory
implements
KeyedPooledObjectFactory
<
String
,
DruidDataSource
>
{
public
class
DataSourceFactory
implements
KeyedPooledObjectFactory
<
String
,
DruidDataSource
>
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
DataSourceFactory
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
DataSourceFactory
.
class
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/constant/Constant.java
View file @
6970a45b
...
@@ -26,11 +26,11 @@ public final class Constant {
...
@@ -26,11 +26,11 @@ public final class Constant {
public
static
final
String
UPLOAD_FOLDER_NAME
=
"Upload"
;
public
static
final
String
UPLOAD_FOLDER_NAME
=
"Upload"
;
public
static
final
String
CURRENT_USER_HOME
=
"~"
;
public
static
final
String
CURRENT_USER_HOME
=
"~"
;
public
static
final
String
CURRENT_USER_UPLOAD_FOLDER
=
CURRENT_USER_HOME
+
File
.
separator
+
UPLOAD_FOLDER_NAME
;
public
static
final
String
CURRENT_USER_UPLOAD_FOLDER
=
CURRENT_USER_HOME
+
File
.
separator
+
UPLOAD_FOLDER_NAME
;
public
static
final
String
CURRENT_IMAGE_PATH
=
CURRENT_USER_HOME
+
File
.
separator
+
"Resource"
+
File
.
separator
+
"Images"
;
public
static
final
String
CURRENT_IMAGE_PATH
=
CURRENT_USER_HOME
+
File
.
separator
+
"Resource"
+
File
.
separator
+
"Images"
;
public
static
final
String
IMAGE_PATH_INFORMATION
=
CURRENT_IMAGE_PATH
+
File
.
separator
+
"information.png"
;
public
static
final
String
IMAGE_PATH_INFORMATION
=
CURRENT_IMAGE_PATH
+
File
.
separator
+
"information.png"
;
public
static
final
String
IMAGE_PATH_ERROR
=
CURRENT_IMAGE_PATH
+
File
.
separator
+
"error.png"
;
public
static
final
String
IMAGE_PATH_ERROR
=
CURRENT_IMAGE_PATH
+
File
.
separator
+
"error.png"
;
public
static
final
String
IMAGE_PATH_SUCCESS
=
CURRENT_IMAGE_PATH
+
File
.
separator
+
"success.png"
;
public
static
final
String
IMAGE_PATH_SUCCESS
=
CURRENT_IMAGE_PATH
+
File
.
separator
+
"success.png"
;
public
static
final
String
IMAGE_PATH_WARN
=
CURRENT_IMAGE_PATH
+
File
.
separator
+
"warning1.png"
;
public
static
final
String
IMAGE_PATH_WARN
=
CURRENT_IMAGE_PATH
+
File
.
separator
+
"warning1.png"
;
public
static
final
boolean
DEFAULT_RESULT
=
true
;
public
static
final
boolean
DEFAULT_RESULT
=
true
;
...
@@ -41,4 +41,5 @@ public final class Constant {
...
@@ -41,4 +41,5 @@ public final class Constant {
public
static
final
boolean
DEFAULT_HAS_HEADER
=
true
;
public
static
final
boolean
DEFAULT_HAS_HEADER
=
true
;
public
static
final
String
IMAGE_FORMART_
=
"png"
;
public
static
final
String
IMAGE_FORMART_
=
"png"
;
public
static
final
String
EMPTY
=
""
;
}
}
\ No newline at end of file
atms-api/src/main/java/pwc/taxtech/atms/controller/CustomsInvoiceController.java
View file @
6970a45b
...
@@ -2,7 +2,6 @@ package pwc.taxtech.atms.controller;
...
@@ -2,7 +2,6 @@ package pwc.taxtech.atms.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.HttpStatus
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
...
@@ -31,6 +30,9 @@ import java.util.Map;
...
@@ -31,6 +30,9 @@ import java.util.Map;
import
java.util.UUID
;
import
java.util.UUID
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_NO_CONTENT
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_OK
;
@RestController
@RestController
@RequestMapping
(
value
=
"api/v1/CustomsInvoice"
)
@RequestMapping
(
value
=
"api/v1/CustomsInvoice"
)
public
class
CustomsInvoiceController
{
public
class
CustomsInvoiceController
{
...
@@ -84,9 +86,9 @@ public class CustomsInvoiceController {
...
@@ -84,9 +86,9 @@ public class CustomsInvoiceController {
int
count
=
getDownloadFilePath
(
filter
,
os
);
int
count
=
getDownloadFilePath
(
filter
,
os
);
if
(
count
==
0
)
{
if
(
count
==
0
)
{
response
.
setStatus
(
HttpStatus
.
SC_NO_CONTENT
);
response
.
setStatus
(
SC_NO_CONTENT
);
}
else
{
}
else
{
response
.
setStatus
(
HttpStatus
.
SC_OK
);
response
.
setStatus
(
SC_OK
);
}
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/FileUploadController.java
View file @
6970a45b
package
pwc
.
taxtech
.
atms
.
controller
;
package
pwc
.
taxtech
.
atms
.
controller
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
org.springframework.web.multipart.MultipartHttpServletRequest
;
import
pwc.taxtech.atms.constant.enums.EnumModule
;
import
pwc.taxtech.atms.constant.enums.EnumModule
;
import
pwc.taxtech.atms.dto.PagingResultDto
;
import
pwc.taxtech.atms.dto.vatdto.InputVATInvoiceDto
;
import
pwc.taxtech.atms.vat.service.impl.FileUploadAdapter
;
import
pwc.taxtech.atms.vat.service.impl.FileUploadAdapter
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.ws.rs.core.Response
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
USER_ID_FOR_UPLOAD
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
USER_ID_FOR_UPLOAD
;
@RestController
@RestController
...
@@ -28,6 +20,6 @@ public class FileUploadController {
...
@@ -28,6 +20,6 @@ public class FileUploadController {
@RequestMapping
(
value
=
"NewFile"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
@RequestMapping
(
value
=
"NewFile"
,
method
=
RequestMethod
.
POST
,
produces
=
MediaType
.
MULTIPART_FORM_DATA_VALUE
)
public
ResponseEntity
getInputInvoiceTreeViewData
(
MultipartHttpServletRequest
request
)
{
public
ResponseEntity
getInputInvoiceTreeViewData
(
MultipartHttpServletRequest
request
)
{
return
fileUploadAdapter
.
upload
(
request
,
EnumModule
.
TrailBalance
,
USER_ID_FOR_UPLOAD
);
return
fileUploadAdapter
.
upload
(
request
,
EnumModule
.
TrailBalance
,
USER_ID_FOR_UPLOAD
);
}
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/InputInvoiceImportController.java
View file @
6970a45b
package
pwc
.
taxtech
.
atms
.
controller
;
package
pwc
.
taxtech
.
atms
.
controller
;
import
org.apache.http.HttpStatus
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
...
@@ -28,6 +27,9 @@ import java.util.List;
...
@@ -28,6 +27,9 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.UUID
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_NO_CONTENT
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_OK
;
@RestController
@RestController
@RequestMapping
(
value
=
"api/v1/inputInvoiceImport"
)
@RequestMapping
(
value
=
"api/v1/inputInvoiceImport"
)
public
class
InputInvoiceImportController
{
public
class
InputInvoiceImportController
{
...
@@ -52,9 +54,9 @@ public class InputInvoiceImportController {
...
@@ -52,9 +54,9 @@ public class InputInvoiceImportController {
int
count
=
getDownloadFilePath
(
paras
,
os
);
int
count
=
getDownloadFilePath
(
paras
,
os
);
if
(
count
==
0
)
{
if
(
count
==
0
)
{
response
.
setStatus
(
HttpStatus
.
SC_NO_CONTENT
);
response
.
setStatus
(
SC_NO_CONTENT
);
}
else
{
}
else
{
response
.
setStatus
(
HttpStatus
.
SC_OK
);
response
.
setStatus
(
SC_OK
);
}
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/OutputInvoiceController.java
View file @
6970a45b
package
pwc
.
taxtech
.
atms
.
controller
;
package
pwc
.
taxtech
.
atms
.
controller
;
import
org.apache.http.HttpStatus
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
...
@@ -24,6 +23,9 @@ import java.util.List;
...
@@ -24,6 +23,9 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.UUID
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_NO_CONTENT
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_OK
;
@RestController
@RestController
@RequestMapping
(
value
=
"api/v1/outputInvoiceImport"
)
@RequestMapping
(
value
=
"api/v1/outputInvoiceImport"
)
public
class
OutputInvoiceController
{
public
class
OutputInvoiceController
{
...
@@ -48,9 +50,9 @@ public class OutputInvoiceController {
...
@@ -48,9 +50,9 @@ public class OutputInvoiceController {
int
count
=
getDownloadFilePath
(
paras
,
os
);
int
count
=
getDownloadFilePath
(
paras
,
os
);
if
(
count
==
0
)
{
if
(
count
==
0
)
{
response
.
setStatus
(
HttpStatus
.
SC_NO_CONTENT
);
response
.
setStatus
(
SC_NO_CONTENT
);
}
else
{
}
else
{
response
.
setStatus
(
HttpStatus
.
SC_OK
);
response
.
setStatus
(
SC_OK
);
}
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/controller/TBDataImportController.java
View file @
6970a45b
...
@@ -3,7 +3,6 @@ package pwc.taxtech.atms.controller;
...
@@ -3,7 +3,6 @@ package pwc.taxtech.atms.controller;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.HttpStatus
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.MediaType
;
import
org.springframework.http.ResponseEntity
;
import
org.springframework.http.ResponseEntity
;
...
@@ -14,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
...
@@ -14,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.common.CommonUtils
;
import
pwc.taxtech.atms.common.util.NPOIHelper
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.vatdto.BalanceSubTotalDto
;
import
pwc.taxtech.atms.dto.vatdto.BalanceSubTotalDto
;
import
pwc.taxtech.atms.dto.vatdto.BalanceWithSubTotalsResultDto
;
import
pwc.taxtech.atms.dto.vatdto.BalanceWithSubTotalsResultDto
;
...
@@ -27,7 +27,6 @@ import pwc.taxtech.atms.dto.vatdto.VatEnterpriseAccountDto;
...
@@ -27,7 +27,6 @@ import pwc.taxtech.atms.dto.vatdto.VatEnterpriseAccountDto;
import
pwc.taxtech.atms.service.ICitTBDataImportService
;
import
pwc.taxtech.atms.service.ICitTBDataImportService
;
import
pwc.taxtech.atms.service.IdentityService
;
import
pwc.taxtech.atms.service.IdentityService
;
import
pwc.taxtech.atms.service.impl.DataImportServiceImpl
;
import
pwc.taxtech.atms.service.impl.DataImportServiceImpl
;
import
pwc.taxtech.atms.common.util.NPOIHelper
;
import
pwc.taxtech.atms.vat.dao.DataImportModel
;
import
pwc.taxtech.atms.vat.dao.DataImportModel
;
import
pwc.taxtech.atms.vat.service.TBDataImportService
;
import
pwc.taxtech.atms.vat.service.TBDataImportService
;
import
pwc.taxtech.atms.vat.service.impl.FileUploadAdapter
;
import
pwc.taxtech.atms.vat.service.impl.FileUploadAdapter
;
...
@@ -44,6 +43,7 @@ import java.util.List;
...
@@ -44,6 +43,7 @@ import java.util.List;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
javax
.
servlet
.
http
.
HttpServletResponse
.
SC_INTERNAL_SERVER_ERROR
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
DEFAULT_HAS_HEADER
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
DEFAULT_HAS_HEADER
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
HEADER_ROW_INDEX
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
HEADER_ROW_INDEX
;
...
@@ -478,10 +478,10 @@ public class TBDataImportController {
...
@@ -478,10 +478,10 @@ public class TBDataImportController {
return
ResponseEntity
.
ok
(
dataImportModel
);
return
ResponseEntity
.
ok
(
dataImportModel
);
}
catch
(
FileNotFoundException
e
)
{
//TODO: replace exception filter (neo)
}
catch
(
FileNotFoundException
e
)
{
//TODO: replace exception filter (neo)
e
.
printStackTrace
();
e
.
printStackTrace
();
return
ResponseEntity
.
status
(
HttpStatus
.
SC_INTERNAL_SERVER_ERROR
).
build
();
return
ResponseEntity
.
status
(
SC_INTERNAL_SERVER_ERROR
).
build
();
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
return
ResponseEntity
.
status
(
HttpStatus
.
SC_INTERNAL_SERVER_ERROR
).
build
();
return
ResponseEntity
.
status
(
SC_INTERNAL_SERVER_ERROR
).
build
();
}
}
}
else
{
}
else
{
return
ResponseEntity
.
ok
().
build
();
return
ResponseEntity
.
ok
().
build
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/exception/NotSupportedException.java
0 → 100644
View file @
6970a45b
package
pwc
.
taxtech
.
atms
.
exception
;
public
class
NotSupportedException
extends
ApplicationException
{
public
NotSupportedException
()
{
}
public
NotSupportedException
(
String
message
)
{
super
(
message
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/exception/ParameterException.java
0 → 100644
View file @
6970a45b
package
pwc
.
taxtech
.
atms
.
exception
;
public
class
ParameterException
extends
ApplicationException
{
public
ParameterException
()
{
super
();
}
public
ParameterException
(
String
message
)
{
super
(
message
);
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/DataSourcePoolService.java
View file @
6970a45b
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.beust.jcommander.ParameterException
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.pool2.impl.GenericKeyedObjectPool
;
import
org.apache.commons.pool2.impl.GenericKeyedObjectPool
;
...
@@ -19,6 +18,7 @@ import org.springframework.stereotype.Service;
...
@@ -19,6 +18,7 @@ import org.springframework.stereotype.Service;
import
pwc.taxtech.atms.common.datasource.DataSourceConfig
;
import
pwc.taxtech.atms.common.datasource.DataSourceConfig
;
import
pwc.taxtech.atms.common.datasource.DataSourceFactory
;
import
pwc.taxtech.atms.common.datasource.DataSourceFactory
;
import
pwc.taxtech.atms.common.datasource.ShardingContextHolder
;
import
pwc.taxtech.atms.common.datasource.ShardingContextHolder
;
import
pwc.taxtech.atms.exception.ParameterException
;
import
javax.annotation.PostConstruct
;
import
javax.annotation.PostConstruct
;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/ProjectServiceImpl.java
View file @
6970a45b
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
com.beust.jcommander.internal.Lists
;
import
com.google.common.base.Predicate
;
import
com.google.common.base.Predicate
;
import
com.google.common.collect.Lists
;
import
org.apache.ibatis.io.Resources
;
import
org.apache.ibatis.io.Resources
;
import
org.apache.ibatis.jdbc.ScriptRunner
;
import
org.apache.ibatis.jdbc.ScriptRunner
;
import
org.apache.ibatis.session.SqlSession
;
import
org.apache.ibatis.session.SqlSession
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportGeneratorImpl.java
View file @
6970a45b
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
;
package
pwc
.
taxtech
.
atms
.
vat
.
service
.
impl
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.poi.openxml4j.exceptions.InvalidFormatException
;
import
org.apache.poi.openxml4j.exceptions.InvalidFormatException
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
import
org.apache.poi.ss.formula.udf.AggregatingUDFFinder
;
import
org.apache.poi.ss.formula.udf.AggregatingUDFFinder
;
...
@@ -49,6 +48,9 @@ import java.util.Map;
...
@@ -49,6 +48,9 @@ import java.util.Map;
import
java.util.Optional
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
static
pwc
.
taxtech
.
atms
.
constant
.
Constant
.
EMPTY
;
@Service
@Service
public
class
ReportGeneratorImpl
implements
ReportGenerator
{
public
class
ReportGeneratorImpl
implements
ReportGenerator
{
@Autowired
@Autowired
...
@@ -187,10 +189,10 @@ public class ReportGeneratorImpl implements ReportGenerator {
...
@@ -187,10 +189,10 @@ public class ReportGeneratorImpl implements ReportGenerator {
if
(
sheet
.
getRow
(
tempPeriodCellTemplate
.
get
().
getRowIndex
())
!=
null
&&
sheet
.
getRow
(
tempPeriodCellTemplate
.
get
().
getRowIndex
()).
getCell
(
tempPeriodCellTemplate
.
get
().
getColumnIndex
())
!=
null
)
{
if
(
sheet
.
getRow
(
tempPeriodCellTemplate
.
get
().
getRowIndex
())
!=
null
&&
sheet
.
getRow
(
tempPeriodCellTemplate
.
get
().
getRowIndex
()).
getCell
(
tempPeriodCellTemplate
.
get
().
getColumnIndex
())
!=
null
)
{
data
=
Double
.
toString
(
sheet
.
getRow
(
tempPeriodCellTemplate
.
get
().
getRowIndex
()).
getCell
(
tempPeriodCellTemplate
.
get
().
getColumnIndex
()).
getNumericCellValue
());
data
=
Double
.
toString
(
sheet
.
getRow
(
tempPeriodCellTemplate
.
get
().
getRowIndex
()).
getCell
(
tempPeriodCellTemplate
.
get
().
getColumnIndex
()).
getNumericCellValue
());
}
else
{
}
else
{
data
=
StringUtils
.
EMPTY
;
data
=
EMPTY
;
}
}
cellData
.
setData
(
data
);
cellData
.
setData
(
data
);
cellData
.
setFormulaExp
(
StringUtils
.
EMPTY
);
cellData
.
setFormulaExp
(
EMPTY
);
cellData
.
setCreateBy
(
"Admin"
);
cellData
.
setCreateBy
(
"Admin"
);
cellData
.
setCreateTime
(
createTime
);
cellData
.
setCreateTime
(
createTime
);
cellData
.
setUpdateBy
(
"Admin"
);
cellData
.
setUpdateBy
(
"Admin"
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
6970a45b
...
@@ -8,14 +8,19 @@ import pwc.taxtech.atms.dto.OperationResultDto;
...
@@ -8,14 +8,19 @@ import pwc.taxtech.atms.dto.OperationResultDto;
import
pwc.taxtech.atms.dto.vatdto.CellTemplateReferenceDto
;
import
pwc.taxtech.atms.dto.vatdto.CellTemplateReferenceDto
;
import
pwc.taxtech.atms.dto.vatdto.ReportDto
;
import
pwc.taxtech.atms.dto.vatdto.ReportDto
;
import
pwc.taxtech.atms.entitiy.*
;
import
pwc.taxtech.atms.entitiy.*
;
import
pwc.taxtech.atms.exception.NotSupportedException
;
import
pwc.taxtech.atms.vat.entity.PeriodCellTemplate
;
import
pwc.taxtech.atms.vat.entity.PeriodCellTemplate
;
import
pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig
;
import
pwc.taxtech.atms.vat.entity.PeriodCellTemplateConfig
;
import
pwc.taxtech.atms.vat.entity.PeriodTemplate
;
import
pwc.taxtech.atms.vat.entity.PeriodTemplate
;
import
pwc.taxtech.atms.vat.entity.PeriodTemplateExample
;
import
pwc.taxtech.atms.vat.entity.PeriodTemplateExample
;
import
pwc.taxtech.atms.vat.service.ReportService
;
import
pwc.taxtech.atms.vat.service.ReportService
;
import
javax.ws.rs.NotSupportedException
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
...
@@ -81,7 +86,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
...
@@ -81,7 +86,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
}
}
@Override
@Override
public
OperationResultDto
updateConfig
(
String
projectId
,
Integer
period
,
Boolean
ifDeleteManualDataSource
,
String
generator
)
{
public
OperationResultDto
updateConfig
(
String
projectId
,
Integer
period
,
Boolean
ifDeleteManualDataSource
,
String
generator
)
{
OperationResultDto
result
=
new
OperationResultDto
();
OperationResultDto
result
=
new
OperationResultDto
();
if
(
period
==
null
)
{
if
(
period
==
null
)
{
...
@@ -112,7 +117,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
...
@@ -112,7 +117,7 @@ public class ReportServiceImpl extends VatAbstractService implements ReportServi
dataSourceMapper
.
clearTaxPayerReportWithPeriod
(
period
);
dataSourceMapper
.
clearTaxPayerReportWithPeriod
(
period
);
dataSourceMapper
.
clearDataSourceWithPeriod
(
period
);
dataSourceMapper
.
clearDataSourceWithPeriod
(
period
);
dataSourceMapper
.
clearDataSourceDetailWithPeriod
(
period
);
dataSourceMapper
.
clearDataSourceDetailWithPeriod
(
period
);
dataSourceMapper
.
clearCellDataWithPeriod
(
strExceptTemplateIDs
);
dataSourceMapper
.
clearCellDataWithPeriod
(
strExceptTemplateIDs
);
// 根据templategroupid 把 template 插入到 periodTemplate
// 根据templategroupid 把 template 插入到 periodTemplate
TemplateExample
example
=
new
TemplateExample
();
TemplateExample
example
=
new
TemplateExample
();
...
...
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