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
af974af5
Commit
af974af5
authored
Mar 21, 2019
by
gary
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、fix
2、添加dd secureToken
parent
7fc4b237
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
211 additions
and
35 deletions
+211
-35
AnalysisJob.java
...in/java/pwc/taxtech/atms/common/schedule/AnalysisJob.java
+7
-7
DateUtils.java
...src/main/java/pwc/taxtech/atms/common/util/DateUtils.java
+19
-0
HttpUtil.java
.../src/main/java/pwc/taxtech/atms/common/util/HttpUtil.java
+41
-0
DtsTokenService.java
...in/java/pwc/taxtech/atms/security/dd/DtsTokenService.java
+6
-11
AnalysisJobServiceImpl.java
...pwc/taxtech/atms/service/impl/AnalysisJobServiceImpl.java
+0
-0
BaseService.java
.../main/java/pwc/taxtech/atms/service/impl/BaseService.java
+3
-0
DataImportService.java
...java/pwc/taxtech/atms/service/impl/DataImportService.java
+25
-13
applicationContext-job.xml
atms-api/src/main/resources/applicationContext-job.xml
+16
-0
AnalysisTest.java
...test/java/pwc/taxtech/atms/service/impl/AnalysisTest.java
+88
-0
GaryTest.java
...src/test/java/pwc/taxtech/atms/service/impl/GaryTest.java
+1
-0
ProjectMapper.java
...dao/src/main/java/pwc/taxtech/atms/dao/ProjectMapper.java
+2
-1
ProjectExtendsMapper.xml
...ces/pwc/taxtech/atms/dao/extends/ProjectExtendsMapper.xml
+2
-2
PeriodCellDataExtendsMapper.xml
...tech/atms/vat/dao/extends/PeriodCellDataExtendsMapper.xml
+1
-1
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/schedule/An
y
lysisJob.java
→
atms-api/src/main/java/pwc/taxtech/atms/common/schedule/An
a
lysisJob.java
View file @
af974af5
...
...
@@ -18,8 +18,8 @@ import pwc.taxtech.atms.service.impl.AnalysisServiceImpl;
import
javax.annotation.Resource
;
import
java.util.List
;
public
class
An
y
lysisJob
extends
QuartzJobBean
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
An
y
lysisJob
.
class
);
public
class
An
a
lysisJob
extends
QuartzJobBean
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
An
a
lysisJob
.
class
);
@Resource
private
OrganizationMapper
organizationMapper
;
...
...
@@ -43,19 +43,19 @@ public class AnylysisJob extends QuartzJobBean {
logger
.
info
(
String
.
format
(
"开始分析%s预期返还税数据"
,
period
));
analysisJobService
.
analysisExpectedTax
(
orgs
,
period
,
EnumTbImportType
.
CoverImport
.
getCode
());
logger
.
info
(
String
.
format
(
"开始分析%s
预期返还税
数据"
,
period
));
logger
.
info
(
String
.
format
(
"开始分析%s
费用
数据"
,
period
));
analysisJobService
.
analysisFee
(
orgs
,
period
,
EnumTbImportType
.
CoverImport
.
getCode
());
logger
.
info
(
String
.
format
(
"开始分析%s
预期返还税
数据"
,
period
));
logger
.
info
(
String
.
format
(
"开始分析%s
档案管理
数据"
,
period
));
analysisJobService
.
analysisFileManagement
(
orgs
,
period
,
EnumTbImportType
.
CoverImport
.
getCode
());
logger
.
info
(
String
.
format
(
"开始分析%s
预期返还税
数据"
,
period
));
logger
.
info
(
String
.
format
(
"开始分析%s
机构
数据"
,
period
));
analysisJobService
.
analysisMaster
(
orgs
,
period
,
EnumTbImportType
.
CoverImport
.
getCode
());
logger
.
info
(
String
.
format
(
"开始分析%s
预期返还税
数据"
,
period
));
logger
.
info
(
String
.
format
(
"开始分析%s
申报表
数据"
,
period
));
analysisJobService
.
analysisSales
(
orgs
,
period
,
EnumTbImportType
.
CoverImport
.
getCode
());
logger
.
info
(
String
.
format
(
"开始分析%s
预期返还
税数据"
,
period
));
logger
.
info
(
String
.
format
(
"开始分析%s
返还后
税数据"
,
period
));
analysisJobService
.
analysisTaxReturnEnd
(
orgs
,
period
,
EnumTbImportType
.
CoverImport
.
getCode
());
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/common/util/DateUtils.java
View file @
af974af5
...
...
@@ -289,6 +289,25 @@ public class DateUtils {
return
hour
;
}
public
static
Date
getZero
(){
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
calendar
.
set
(
Calendar
.
MINUTE
,
0
);
calendar
.
set
(
Calendar
.
SECOND
,
0
);
return
calendar
.
getTime
();
}
public
static
Date
getThreeDayZero
(){
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
new
Date
());
calendar
.
set
(
Calendar
.
DAY_OF_MONTH
,-
3
);
calendar
.
set
(
Calendar
.
HOUR_OF_DAY
,
0
);
calendar
.
set
(
Calendar
.
MINUTE
,
0
);
calendar
.
set
(
Calendar
.
SECOND
,
0
);
return
calendar
.
getTime
();
}
/**
* 得到现在分钟
*
...
...
atms-api/src/main/java/pwc/taxtech/atms/common/util/HttpUtil.java
View file @
af974af5
...
...
@@ -138,6 +138,47 @@ public class HttpUtil {
return
result
;
}
public
static
String
post
(
String
url
,
Map
<
String
,
String
>
headers
,
String
mimeType
,
String
charset
,
Integer
connTimeout
,
Integer
readTimeout
)
throws
ConnectTimeoutException
,
SocketTimeoutException
,
Exception
{
HttpClient
client
=
null
;
HttpPost
post
=
new
HttpPost
(
url
);
String
result
=
""
;
try
{
if
(
headers
!=
null
&&
!
headers
.
isEmpty
())
{
for
(
Entry
<
String
,
String
>
entry
:
headers
.
entrySet
())
{
post
.
addHeader
(
entry
.
getKey
(),
entry
.
getValue
());
}
}
// 设置参数
Builder
customReqConf
=
RequestConfig
.
custom
();
if
(
connTimeout
!=
null
)
{
customReqConf
.
setConnectTimeout
(
connTimeout
);
}
if
(
readTimeout
!=
null
)
{
customReqConf
.
setSocketTimeout
(
readTimeout
);
}
post
.
setConfig
(
customReqConf
.
build
());
HttpResponse
res
;
if
(
url
.
startsWith
(
"https"
))
{
// 执行 Https 请求.
client
=
createSSLInsecureClient
();
res
=
client
.
execute
(
post
);
}
else
{
// 执行 Http 请求.
client
=
HttpUtil
.
client
;
res
=
client
.
execute
(
post
);
}
result
=
IOUtils
.
toString
(
res
.
getEntity
().
getContent
(),
charset
);
}
finally
{
post
.
releaseConnection
();
if
(
url
.
startsWith
(
"https"
)
&&
client
!=
null
&&
client
instanceof
CloseableHttpClient
)
{
((
CloseableHttpClient
)
client
).
close
();
}
}
return
result
;
}
/**
* 提交form表单
...
...
atms-api/src/main/java/pwc/taxtech/atms/security/dd/DtsTokenService.java
View file @
af974af5
...
...
@@ -3,6 +3,7 @@ import org.apache.commons.codec.binary.Base64;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
pwc.taxtech.atms.exception.ServiceException
;
import
pwc.taxtech.atms.service.impl.ProjectServiceImpl
;
import
sun.misc.BASE64Decoder
;
...
...
@@ -24,16 +25,13 @@ import java.util.TimeZone;
* @Date: 20/03/2019 20:41
* @Description:
*/
@Service
public
class
DtsTokenService
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProjectServiceImpl
.
class
);
private
static
String
PUBKEY
;
@Value
(
"${dd_pubkey}"
)
public
void
setDriver
(
String
pubkey
)
{
PUBKEY
=
pubkey
;
}
private
String
pubKey
;
public
static
final
String
KEY_ALGORITHM
=
"RSA"
;
...
...
@@ -49,7 +47,6 @@ public class DtsTokenService {
* @throws
*/
public
String
encryptInput
(){
String
pubKey
=
PUBKEY
;
BASE64Encoder
base64
=
new
BASE64Encoder
();
BASE64Decoder
base64Decoder
=
new
BASE64Decoder
();
byte
[]
encodeData
;
...
...
@@ -60,11 +57,9 @@ public class DtsTokenService {
long
rNum
=
generateRandomNumber
();
String
inputStr1
=
sDate
+
"@@"
+
"DTS"
+
"@@"
+
nonce
+
rNum
;
byte
[]
data1
=
inputStr1
.
getBytes
();
logger
.
info
(
"原文:"
+
inputStr1
);
logger
.
debug
(
"原文:"
+
inputStr1
);
encodeData
=
encryptByPublicKey
(
data1
,
publicKey
);
logger
.
info
(
"公钥加密后:"
+
base64
.
encode
(
encodeData
));
logger
.
debug
(
"公钥加密后:"
+
base64
.
encode
(
encodeData
));
}
catch
(
Exception
ex
)
{
throw
new
ServiceException
(
"cus"
+
ex
);
}
...
...
@@ -98,7 +93,7 @@ public class DtsTokenService {
private
byte
[]
encryptByPublicKey
(
byte
[]
data
,
byte
[]
key
)
throws
Exception
{
private
static
byte
[]
encryptByPublicKey
(
byte
[]
data
,
byte
[]
key
)
throws
Exception
{
X509EncodedKeySpec
x509KeySpec
=
new
X509EncodedKeySpec
(
key
);
KeyFactory
keyFactory
=
KeyFactory
.
getInstance
(
KEY_ALGORITHM
);
PublicKey
publicKey
=
keyFactory
.
generatePublic
(
x509KeySpec
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/impl/AnalysisJobServiceImpl.java
View file @
af974af5
This diff is collapsed.
Click to expand it.
atms-api/src/main/java/pwc/taxtech/atms/service/impl/BaseService.java
View file @
af974af5
...
...
@@ -8,6 +8,7 @@ import pwc.taxtech.atms.common.AtmsApiSettings;
import
pwc.taxtech.atms.common.AuthUserHelper
;
import
pwc.taxtech.atms.common.ResponseMessageBuilder
;
import
pwc.taxtech.atms.common.util.BeanUtil
;
import
pwc.taxtech.atms.security.dd.DtsTokenService
;
public
class
BaseService
{
protected
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
...
...
@@ -28,5 +29,7 @@ public class BaseService {
protected
CommonDocumentHelper
commonDocumentHelper
;
@Autowired
protected
ResponseMessageBuilder
responseMessageBuilder
;
@Autowired
protected
DtsTokenService
dtsTokenService
;
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/DataImportService.java
View file @
af974af5
...
...
@@ -42,6 +42,7 @@ import pwc.taxtech.atms.dto.vatdto.TrialBalanceDto;
import
pwc.taxtech.atms.dto.vatdto.TrialBalanceParam
;
import
pwc.taxtech.atms.entity.*
;
import
pwc.taxtech.atms.exception.ServiceException
;
import
pwc.taxtech.atms.security.dd.DtsTokenService
;
import
pwc.taxtech.atms.vat.dao.*
;
import
pwc.taxtech.atms.vat.entity.*
;
...
...
@@ -1849,7 +1850,7 @@ public class DataImportService extends BaseService {
orgs
.
forEach
(
o
->
{
try
{
Callable
callEbs
=
new
CallEbsThread
(
type
,
o
,
ebsCallUrl
,
dataImportLogMapper
,
authUserHelper
,
idService
,
period
,
effectiveDateFrom
,
effectiveDateTo
);
idService
,
dtsTokenService
,
period
,
effectiveDateFrom
,
effectiveDateTo
);
executorService
.
submit
(
callEbs
);
// resList.add(future);
}
catch
(
RejectedExecutionException
rje
)
{
...
...
@@ -1872,6 +1873,12 @@ public class DataImportService extends BaseService {
logger
.
error
(
String
.
format
(
EnumApiCodeMsg
.
CALLFAILED
.
getMsg
(),
e
.
getMessage
()),
e
);
}
});
// 三天外的日志隐藏
DataImportLog
dil
=
new
DataImportLog
();
dil
.
setDisplay
(
false
);
DataImportLogExample
e
=
new
DataImportLogExample
();
e
.
createCriteria
().
andCreateTimeLessThan
(
DateUtils
.
getThreeDayZero
());
dataImportLogMapper
.
updateByExampleSelective
(
dil
,
e
);
});
// 校验是否全部调用成功 这里有点问题
/*int res = 0;
...
...
@@ -1957,18 +1964,21 @@ public class DataImportService extends BaseService {
private
DistributedIdService
idService
;
private
DtsTokenService
dtsTokenService
;
private
String
effectiveDateFrom
;
private
String
effectiveDateTo
;
CallEbsThread
(
int
type
,
Organization
org
,
String
ebsCallUrl
,
DataImportLogMapper
dataImportLogMapper
,
AuthUserHelper
authUserHelper
,
DistributedIdService
idService
,
String
period
,
String
effectiveDateFrom
,
String
effectiveDateTo
)
{
CallEbsThread
(
int
type
,
Organization
org
,
String
ebsCallUrl
,
DataImportLogMapper
dataImportLogMapper
,
AuthUserHelper
authUserHelper
,
DistributedIdService
idService
,
DtsTokenService
dtsTokenService
,
String
period
,
String
effectiveDateFrom
,
String
effectiveDateTo
)
{
this
.
type
=
type
;
this
.
org
=
org
;
this
.
period
=
period
;
this
.
ebsCallUrl
=
ebsCallUrl
;
this
.
authUserHelper
=
authUserHelper
;
this
.
dtsTokenService
=
dtsTokenService
;
this
.
idService
=
idService
;
this
.
dataImportLogMapper
=
dataImportLogMapper
;
this
.
effectiveDateFrom
=
effectiveDateFrom
;
...
...
@@ -2008,44 +2018,46 @@ public class DataImportService extends BaseService {
dataImportLogMapper
.
insertSelective
(
log
);
return
0
;
}
String
secureToken
=
dtsTokenService
.
encryptInput
();
Map
<
String
,
String
>
headers
=
new
HashMap
<>();
headers
.
put
(
"secureToken"
,
secureToken
);
switch
(
type
)
{
case
EbsExtractTypeConstant
.
TB
:
response
=
HttpUtil
.
post
(
ebsCallUrl
+
"/glMonthlyBal?ledgerId="
+
ledgerId
+
"&companyCode="
+
code
+
"&period="
+
period
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
headers
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
break
;
case
EbsExtractTypeConstant
.
JE
:
// 这里BA反馈可按期间获取当月日记账即可
String
effecDateFrom
=
DateUtils
.
getFirstDayOfMonth
(
year
,
month
);
String
effecDateTo
=
DateUtils
.
getLastDayOfMonth
(
year
,
month
);
response
=
HttpUtil
.
post
(
ebsCallUrl
+
"/glJeLines"
+
"?ledgerId="
+
ledgerId
+
"&companyCode="
+
code
+
"&effectiveDateFrom="
+
effecDateFrom
+
"&effectiveDateTo="
+
effecDateTo
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
headers
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
break
;
case
EbsExtractTypeConstant
.
BSPRC
:
response
=
HttpUtil
.
post
(
ebsCallUrl
+
"/fsgAsset"
+
"?ledgerId="
+
ledgerId
+
"&companyCode="
+
code
+
"&period="
+
period
+
"&prcFlag=Y"
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
headers
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
break
;
case
EbsExtractTypeConstant
.
PLPRC
:
response
=
HttpUtil
.
post
(
ebsCallUrl
+
"/fsgProfit"
+
"?ledgerId="
+
ledgerId
+
"&companyCode="
+
code
+
"&period="
+
period
+
"&prcFlag=Y"
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
headers
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
break
;
case
EbsExtractTypeConstant
.
BS
:
response
=
HttpUtil
.
post
(
ebsCallUrl
+
"/fsgAsset"
+
"?ledgerId="
+
ledgerId
+
"&companyCode="
+
code
+
"&period="
+
period
+
"&prcFlag=N"
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
headers
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
break
;
case
EbsExtractTypeConstant
.
PL
:
response
=
HttpUtil
.
post
(
ebsCallUrl
+
"/fsgProfit"
+
"?ledgerId="
+
ledgerId
+
"&companyCode="
+
code
+
"&period="
+
period
+
"&prcFlag=N"
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
headers
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
break
;
case
EbsExtractTypeConstant
.
CF
:
response
=
HttpUtil
.
post
(
ebsCallUrl
+
"/fsgCash"
+
"?ledgerId="
+
ledgerId
+
"&companyCode="
+
code
+
"&period="
+
period
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
headers
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
break
;
case
EbsExtractTypeConstant
.
OCTB
:
break
;
case
EbsExtractTypeConstant
.
RATE
:
response
=
HttpUtil
.
post
(
ebsCallUrl
+
"/dailyRates"
+
"?period="
+
period
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
headers
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
break
;
default
:
break
;
...
...
atms-api/src/main/resources/applicationContext-job.xml
View file @
af974af5
...
...
@@ -36,12 +36,14 @@
<list>
<ref
bean=
"lgApiJobTrigger"
/>
<ref
bean=
"orgSyncJobTrigger"
/>
<ref
bean=
"analysisJobTrigger"
/>
</list>
</property>
<property
name=
"jobDetails"
>
<list>
<ref
bean=
"lgGlBalanceJob"
/>
<ref
bean=
"orgSyncJob"
/>
<ref
bean=
"analysisJob"
/>
</list>
</property>
<property
name=
"taskExecutor"
ref=
"executor"
/>
...
...
@@ -68,11 +70,24 @@
<property
name=
"description"
value=
"机构信息同步"
/>
</bean>
<bean
name=
"analysisJob"
class=
"org.springframework.scheduling.quartz.JobDetailFactoryBean"
>
<property
name=
"jobClass"
value=
"pwc.taxtech.atms.common.schedule.AnalysisJob"
/>
<property
name=
"durability"
value=
"true"
/>
<property
name=
"requestsRecovery"
value=
"false"
/>
<property
name=
"description"
value=
"分析模块"
/>
</bean>
<!-- 每月1日执行一次-->
<bean
id=
"orgSyncJobTrigger"
class=
"org.springframework.scheduling.quartz.CronTriggerFactoryBean"
>
<property
name=
"jobDetail"
ref=
"orgSyncJob"
/>
<property
name=
"cronExpression"
value=
"0 0 0 1 * ?"
/>
</bean>
<!-- 每天凌晨一点执行一次-->
<bean
id=
"analysisJobTrigger"
class=
"org.springframework.scheduling.quartz.CronTriggerFactoryBean"
>
<property
name=
"jobDetail"
ref=
"analysisJob"
/>
<property
name=
"cronExpression"
value=
"0 0 1 * * ?"
/>
</bean>
<!-- 分布式事务配置 end -->
</beans>
\ No newline at end of file
atms-api/src/test/java/pwc/taxtech/atms/service/impl/AnalysisTest.java
0 → 100644
View file @
af974af5
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
org.junit.Test
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
pwc.taxtech.atms.CommonIT
;
import
pwc.taxtech.atms.common.util.DateUtils
;
import
pwc.taxtech.atms.constant.enums.EnumTbImportType
;
import
pwc.taxtech.atms.entity.Organization
;
import
pwc.taxtech.atms.entity.OrganizationExample
;
import
java.util.List
;
/**
* @Auther: Gary J Li
* @Date: 21/03/2019 11:37
* @Description:
*/
public
class
AnalysisTest
extends
CommonIT
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
DataInitTest
.
class
);
@Autowired
private
AnalysisJobServiceImpl
analysisJobService
;
@Test
public
void
analysisExpectedTax
(){
Integer
period
=
DateUtils
.
getPeriodNow
();
OrganizationExample
e
=
new
OrganizationExample
();
e
.
createCriteria
().
andIsActiveEqualTo
(
true
);
List
<
Organization
>
orgs
=
organizationMapper
.
selectByExample
(
e
);
logger
.
info
(
String
.
format
(
"开始分析%s预期返还税数据"
,
period
));
analysisJobService
.
analysisExpectedTax
(
orgs
,
period
,
EnumTbImportType
.
CoverImport
.
getCode
());
}
@Test
public
void
analysisFee
(){
Integer
period
=
DateUtils
.
getPeriodNow
();
OrganizationExample
e
=
new
OrganizationExample
();
e
.
createCriteria
().
andIsActiveEqualTo
(
true
);
List
<
Organization
>
orgs
=
organizationMapper
.
selectByExample
(
e
);
logger
.
info
(
String
.
format
(
"开始分析%s费用数据"
,
period
));
analysisJobService
.
analysisFee
(
orgs
,
period
,
EnumTbImportType
.
CoverImport
.
getCode
());
}
@Test
public
void
analysisFileManagement
(){
Integer
period
=
DateUtils
.
getPeriodNow
();
OrganizationExample
e
=
new
OrganizationExample
();
e
.
createCriteria
().
andIsActiveEqualTo
(
true
);
List
<
Organization
>
orgs
=
organizationMapper
.
selectByExample
(
e
);
logger
.
info
(
String
.
format
(
"开始分析%s文档管理数据"
,
period
));
analysisJobService
.
analysisFileManagement
(
orgs
,
period
,
EnumTbImportType
.
CoverImport
.
getCode
());
}
@Test
public
void
analysisMaster
(){
Integer
period
=
DateUtils
.
getPeriodNow
();
OrganizationExample
e
=
new
OrganizationExample
();
e
.
createCriteria
().
andIsActiveEqualTo
(
true
);
List
<
Organization
>
orgs
=
organizationMapper
.
selectByExample
(
e
);
logger
.
info
(
String
.
format
(
"开始分析%s机构数据"
,
period
));
analysisJobService
.
analysisMaster
(
orgs
,
period
,
EnumTbImportType
.
CoverImport
.
getCode
());
}
@Test
public
void
analysisSales
(){
Integer
period
=
DateUtils
.
getPeriodNow
();
OrganizationExample
e
=
new
OrganizationExample
();
e
.
createCriteria
().
andIsActiveEqualTo
(
true
);
List
<
Organization
>
orgs
=
organizationMapper
.
selectByExample
(
e
);
logger
.
info
(
String
.
format
(
"开始分析%s申报表数据"
,
period
));
analysisJobService
.
analysisSales
(
orgs
,
period
,
EnumTbImportType
.
CoverImport
.
getCode
());
}
@Test
public
void
analysisTaxReturnEnd
(){
Integer
period
=
DateUtils
.
getPeriodNow
();
OrganizationExample
e
=
new
OrganizationExample
();
e
.
createCriteria
().
andIsActiveEqualTo
(
true
);
List
<
Organization
>
orgs
=
organizationMapper
.
selectByExample
(
e
);
logger
.
info
(
String
.
format
(
"开始分析%s返还后税数据"
,
period
));
analysisJobService
.
analysisTaxReturnEnd
(
orgs
,
period
,
EnumTbImportType
.
CoverImport
.
getCode
());
}
}
atms-api/src/test/java/pwc/taxtech/atms/service/impl/GaryTest.java
View file @
af974af5
...
...
@@ -11,6 +11,7 @@ import pwc.taxtech.atms.entity.Organization;
import
pwc.taxtech.atms.entity.OrganizationExample
;
import
pwc.taxtech.atms.entity.OrganizationExtra
;
import
pwc.taxtech.atms.entity.OrganizationExtraExample
;
import
pwc.taxtech.atms.security.dd.DtsTokenService
;
import
java.util.List
;
...
...
atms-dao/src/main/java/pwc/taxtech/atms/dao/ProjectMapper.java
View file @
af974af5
...
...
@@ -246,7 +246,7 @@ public interface ProjectMapper extends MyMapper {
" AND b.service_type_id = #{serviceType}"
)
Long
getTemplateGroupIdByProject
(
@Param
(
"projectId"
)
String
projectId
,
@Param
(
"serviceType"
)
Integer
serviceType
);
List
<
ProjectAnaylsisDto
>
getTemlateWithServiceType
(
@Param
(
"
orgIds
"
)
List
<
String
>
orgIds
,
@Param
(
"year"
)
Integer
year
,
@Param
(
"month"
)
Integer
month
,
@Param
(
"reportName"
)
String
reportName
);
List
<
ProjectAnaylsisDto
>
getTemlateWithServiceType
(
@Param
(
"
list
"
)
List
<
String
>
orgIds
,
@Param
(
"year"
)
Integer
year
,
@Param
(
"month"
)
Integer
month
,
@Param
(
"reportName"
)
String
reportName
);
List
<
ProjectAnaylsisDto
>
getTemlateWithServiceType2
(
@Param
(
"orgId"
)
String
orgId
,
@Param
(
"year"
)
Integer
year
,
@Param
(
"month"
)
Integer
month
,
@Param
(
"code"
)
String
code
);
}
\ No newline at end of file
atms-dao/src/main/resources/pwc/taxtech/atms/dao/extends/ProjectExtendsMapper.xml
View file @
af974af5
...
...
@@ -16,7 +16,7 @@
#{item}
</foreach>
and p.year = #{year}
and p.stat_period
<
#{month}
and p.sta
r
t_period
<
#{month}
and p.end_period
>
#{month}
and t.name = #{reportName}
</select>
...
...
@@ -32,7 +32,7 @@
on pp.template_id = t.id
where p.organization_id = #{orgId}
and p.year = #{year}
and p.stat_period
<
#{month}
and p.sta
r
t_period
<
#{month}
and p.end_period
>
#{month}
and t.code = #{code}
</select>
...
...
atms-dao/src/main/resources/pwc/taxtech/atms/vat/dao/extends/PeriodCellDataExtendsMapper.xml
View file @
af974af5
...
...
@@ -101,7 +101,7 @@
</select>
<select
id =
"selectAnalysisSalesValueDto"
resultType=
"pwc.taxtech.atms.dpo.AnalysisSalesValueDto"
>
select pcd.data as data,pct.column_index as columnIndex,pct.row_index as rowIndex
,
select pcd.data as data,pct.column_index as columnIndex,pct.row_index as rowIndex
from
period_cell_data pcd
left join period_cell_template pct
...
...
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