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
a1399503
Commit
a1399503
authored
Mar 16, 2019
by
gary
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、数据抽取
2、fixbug
parent
c6bee104
Hide whitespace changes
Inline
Side-by-side
Showing
52 changed files
with
1351 additions
and
187 deletions
+1351
-187
OrgSyncJob.java
...ain/java/pwc/taxtech/atms/common/schedule/OrgSyncJob.java
+9
-2
BaseThreadFactory.java
.../java/pwc/taxtech/atms/common/util/BaseThreadFactory.java
+41
-0
DateUtils.java
...src/main/java/pwc/taxtech/atms/common/util/DateUtils.java
+32
-0
EbsExtractTypeConstant.java
...ava/pwc/taxtech/atms/constant/EbsExtractTypeConstant.java
+19
-0
EnumApiCodeMsg.java
.../java/pwc/taxtech/atms/constant/enums/EnumApiCodeMsg.java
+15
-8
EnumEbsExtractType.java
...a/pwc/taxtech/atms/constant/enums/EnumEbsExtractType.java
+39
-0
EbsApiController.java
...in/java/pwc/taxtech/atms/controller/EbsApiController.java
+31
-31
DataExtractParam.java
.../src/main/java/pwc/taxtech/atms/dto/DataExtractParam.java
+20
-0
EbsCallRateResp.java
...ain/java/pwc/taxtech/atms/dto/ebsdto/EbsCallRateResp.java
+51
-0
EbsCallResp.java
...rc/main/java/pwc/taxtech/atms/dto/ebsdto/EbsCallResp.java
+103
-0
DataImportService.java
...java/pwc/taxtech/atms/service/impl/DataImportService.java
+234
-34
OrganizationServiceImpl.java
...wc/taxtech/atms/service/impl/OrganizationServiceImpl.java
+55
-53
conf.properties
atms-api/src/main/resources/conf/conf.properties
+4
-2
conf_profile_dev.properties
atms-api/src/main/resources/conf/conf_profile_dev.properties
+2
-0
conf_profile_pub.properties
atms-api/src/main/resources/conf/conf_profile_pub.properties
+3
-2
conf_profile_staging.properties
...i/src/main/resources/conf/conf_profile_staging.properties
+6
-2
CommonIT.java
atms-api/src/test/java/pwc/taxtech/atms/CommonIT.java
+2
-0
EbsApiServiceImplTest.java
.../pwc/taxtech/atms/service/impl/EbsApiServiceImplTest.java
+353
-1
GaryTest.java
...src/test/java/pwc/taxtech/atms/service/impl/GaryTest.java
+226
-0
app.json
atms-web/src/main/webapp/app-resources/i18n/en-us/app.json
+1
-0
vat.json
atms-web/src/main/webapp/app-resources/i18n/en-us/vat.json
+4
-0
app.json
atms-web/src/main/webapp/app-resources/i18n/zh-CN/app.json
+1
-0
vat.json
atms-web/src/main/webapp/app-resources/i18n/zh-CN/vat.json
+3
-0
international-data-import.ctrl.js
...ternational-data-import/international-data-import.ctrl.js
+5
-14
international-data-import.html
.../international-data-import/international-data-import.html
+13
-13
edit-organization-modal.ctrl.js
...s/edit-organization-modal/edit-organization-modal.ctrl.js
+15
-2
import-adjust-table.less
...trols/import/import-adjust-table/import-adjust-table.less
+2
-0
import-audit-adjust.less
...trols/import/import-audit-adjust/import-audit-adjust.less
+2
-0
import-balance-sheet.less
...ols/import/import-balance-sheet/import-balance-sheet.less
+2
-0
import-cash-flow.less
...on/controls/import/import-cash-flow/import-cash-flow.less
+2
-0
import-certified-invoices-list.less
...rtified-invoices-list/import-certified-invoices-list.less
+2
-0
import-cit-bs-prc-adjust.less
...rt/import-cit-bs-prc-adjust/import-cit-bs-prc-adjust.less
+2
-0
import-cit-draft-account-mapping.less
...aft-account-mapping/import-cit-draft-account-mapping.less
+2
-0
import-cit-eam-assets-disposal.less
...t-eam-assets-disposal/import-cit-eam-assets-disposal.less
+2
-0
import-cit-journal-adjust.less
.../import-cit-journal-adjust/import-cit-journal-adjust.less
+2
-0
import-cit-profit-prc-adjust.less
...t-cit-profit-prc-adjust/import-cit-profit-prc-adjust.less
+2
-0
import-cit-salary-advance.less
.../import-cit-salary-advance/import-cit-salary-advance.less
+2
-0
import-cit-trial-balance.less
...rt/import-cit-trial-balance/import-cit-trial-balance.less
+2
-0
import-coupa-purchasing-report.less
...upa-purchasing-report/import-coupa-purchasing-report.less
+2
-0
import-invoice-data.less
...trols/import/import-invoice-data/import-invoice-data.less
+2
-0
import-invoice-record.less
...s/import/import-invoice-record/import-invoice-record.less
+2
-0
import-journal-entry.less
...ols/import/import-journal-entry/import-journal-entry.less
+2
-0
import-profit-loss.less
...ontrols/import/import-profit-loss/import-profit-loss.less
+2
-0
import-red-letter-info-table.less
...t-red-letter-info-table/import-red-letter-info-table.less
+2
-0
import-trialbalance.less
...trols/import/import-trialbalance/import-trialbalance.less
+2
-0
constant.js
atms-web/src/main/webapp/app/common/utils/constant.js
+10
-10
extract-financial-data.ctrl.js
...ion/extract-financial-data/extract-financial-data.ctrl.js
+11
-4
extract-financial-data.html
...action/extract-financial-data/extract-financial-data.html
+1
-1
extract-financial-data.js
...traction/extract-financial-data/extract-financial-data.js
+1
-1
extract-invoice-data.ctrl.js
...raction/extract-invoice-data/extract-invoice-data.ctrl.js
+2
-2
extract-invoice-data.html
...extraction/extract-invoice-data/extract-invoice-data.html
+1
-1
vat-preview-invoice-data.ctrl.js
...vat-preview-invoice-data/vat-preview-invoice-data.ctrl.js
+0
-4
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/schedule/OrgSyncJob.java
View file @
a1399503
package
pwc
.
taxtech
.
atms
.
common
.
schedule
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.google.common.collect.Lists
;
import
org.quartz.JobDataMap
;
import
org.quartz.JobExecutionContext
;
import
org.quartz.JobExecutionException
;
...
...
@@ -50,11 +52,13 @@ public class OrgSyncJob extends QuartzJobBean {
headers
.
put
(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
headers
.
put
(
"Idap"
,
"eddie.wu_v"
);
int
pageSize
=
1
;
List
<
OrgSyncData
>
failObjs
=
Lists
.
newArrayList
();
try
{
for
(
int
i
=
1
;
i
<=
pageSize
;
i
++)
{
String
response
=
HttpUtil
.
get
(
orgSyncUrl
+
"?currentPage="
+
i
,
headers
);
logger
.
info
(
"机构信息同步记录:"
+
response
);
DDSyncOrgInfo
ddSyncOrgInfo
=
JSONObject
.
parseObject
(
response
,
DDSyncOrgInfo
.
class
);
pageSize
=
ddSyncOrgInfo
.
get
PageSiz
e
();
pageSize
=
ddSyncOrgInfo
.
get
TotalPag
e
();
List
<
OrgSyncData
>
orgSyncDatas
=
ddSyncOrgInfo
.
getData
();
orgSyncDatas
.
forEach
(
osd
->
{
OrganizationExample
example
=
new
OrganizationExample
();
...
...
@@ -77,10 +81,13 @@ public class OrgSyncJob extends QuartzJobBean {
if
(
regions
.
size
()
>
0
)
{
o
.
setRegionId
(
regions
.
get
(
0
).
getId
());
}
if
(
organizationMapper
.
countByExample
(
example
)<
1
){
failObjs
.
add
(
osd
);
}
organizationMapper
.
updateByExampleSelective
(
o
,
example
);
});
}
logger
.
info
(
"同步未匹配的机构记录:"
+
JSON
.
toJSONString
(
failObjs
));
}
catch
(
Exception
e
)
{
logger
.
error
(
String
.
format
(
"机构信息同步异常:[%s]"
,
e
.
getMessage
()),
e
);
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/common/util/BaseThreadFactory.java
0 → 100644
View file @
a1399503
package
pwc
.
taxtech
.
atms
.
common
.
util
;
import
java.util.concurrent.ThreadFactory
;
import
java.util.concurrent.atomic.AtomicInteger
;
/**
* @Auther: Gary J Li
* @Date: 16/03/2019 10:11
* @Description:
*/
public
class
BaseThreadFactory
implements
ThreadFactory
{
private
static
final
AtomicInteger
poolNumber
=
new
AtomicInteger
(
1
);
private
final
ThreadGroup
group
;
private
final
AtomicInteger
threadNumber
=
new
AtomicInteger
(
1
);
private
final
String
namePrefix
;
public
BaseThreadFactory
(
String
poolName
)
{
SecurityManager
s
=
System
.
getSecurityManager
();
group
=
(
s
!=
null
)
?
s
.
getThreadGroup
()
:
Thread
.
currentThread
().
getThreadGroup
();
namePrefix
=
poolName
+
"-pool-"
+
poolNumber
.
getAndIncrement
()
+
"-thread-"
;
}
@Override
public
Thread
newThread
(
Runnable
r
)
{
Thread
t
=
new
Thread
(
group
,
r
,
namePrefix
+
threadNumber
.
getAndIncrement
(),
0
);
if
(
t
.
isDaemon
())
t
.
setDaemon
(
false
);
if
(
t
.
getPriority
()
!=
Thread
.
NORM_PRIORITY
)
t
.
setPriority
(
Thread
.
NORM_PRIORITY
);
return
t
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/common/util/DateUtils.java
View file @
a1399503
...
...
@@ -630,6 +630,38 @@ public class DateUtils {
return
true
;
}
/**
* 获得该月第一天
* @param year
* @param month
* @return
*/
public
static
String
getFirstDayOfMonth
(
int
year
,
int
month
){
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
set
(
Calendar
.
YEAR
,
year
);
cal
.
set
(
Calendar
.
MONTH
,
month
-
1
);
int
firstDay
=
cal
.
getActualMinimum
(
Calendar
.
DAY_OF_MONTH
);
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
firstDay
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
return
sdf
.
format
(
cal
.
getTime
());
}
/**
* 获得该月最后一天
* @param year
* @param month
* @return
*/
public
static
String
getLastDayOfMonth
(
int
year
,
int
month
){
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
set
(
Calendar
.
YEAR
,
year
);
cal
.
set
(
Calendar
.
MONTH
,
month
-
1
);
int
lastDay
=
cal
.
getActualMaximum
(
Calendar
.
DAY_OF_MONTH
);
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
lastDay
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
return
sdf
.
format
(
cal
.
getTime
());
}
public
static
String
getPeriodBegin
(
int
year
,
int
period
)
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
Calendar
calendar
=
Calendar
.
getInstance
();
...
...
atms-api/src/main/java/pwc/taxtech/atms/constant/EbsExtractTypeConstant.java
0 → 100644
View file @
a1399503
package
pwc
.
taxtech
.
atms
.
constant
;
/**
* @Auther: Gary J Li
* @Date: 16/03/2019 00:44
* @Description:
*/
public
class
EbsExtractTypeConstant
{
public
static
final
int
TB
=
100
;
public
static
final
int
JE
=
101
;
public
static
final
int
BSPRC
=
102
;
public
static
final
int
PLPRC
=
103
;
public
static
final
int
BS
=
104
;
public
static
final
int
PL
=
105
;
public
static
final
int
CF
=
106
;
public
static
final
int
OCTB
=
107
;
public
static
final
int
RATE
=
108
;
}
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/Enum
Error
CodeMsg.java
→
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/Enum
Api
CodeMsg.java
View file @
a1399503
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
Enum
Error
CodeMsg
{
public
enum
Enum
Api
CodeMsg
{
SUCCESS
(
0
,
"成功"
),
APIERROR
(-
1
,
"接口异常"
),
APIDATAEMPTY
(-
2
,
"接口输入数据为空"
);
APIDATAEMPTY
(-
2
,
"接口输入数据为空"
),
/** ebs调用Msg**/
CALLSUCCESS
(
10000
,
"调用成功,获取数据中![%s]"
),
CALLFAILED
(-
10000
,
"调用EBS接口失败![%s]"
),
BUSY
(-
10001
,
"接口调用失败,系统正忙!"
),
;
private
Integer
code
;
private
String
msg
;
Enum
Error
CodeMsg
(
Integer
code
,
String
msg
)
{
Enum
Api
CodeMsg
(
Integer
code
,
String
msg
)
{
this
.
code
=
code
;
this
.
msg
=
msg
;
}
...
...
@@ -22,19 +29,19 @@ public enum EnumErrorCodeMsg {
return
msg
;
}
public
static
Enum
Error
CodeMsg
fromCode
(
Integer
code
){
for
(
Enum
ErrorCodeMsg
error:
EnumError
CodeMsg
.
values
()){
public
static
Enum
Api
CodeMsg
fromCode
(
Integer
code
){
for
(
Enum
ApiCodeMsg
error:
EnumApi
CodeMsg
.
values
()){
if
(
error
.
getCode
().
intValue
()==
code
.
intValue
())
return
error
;
}
// 超出范围值默认返回异常
return
Enum
Error
CodeMsg
.
APIERROR
;
return
Enum
Api
CodeMsg
.
APIERROR
;
}
public
static
String
getMsg
(
Integer
code
){
for
(
Enum
ErrorCodeMsg
error:
EnumError
CodeMsg
.
values
()){
for
(
Enum
ApiCodeMsg
error:
EnumApi
CodeMsg
.
values
()){
if
(
error
.
getCode
().
intValue
()==
code
.
intValue
())
return
error
.
msg
;
}
// 超出范围值默认返回异常
return
Enum
Error
CodeMsg
.
APIERROR
.
msg
;
return
Enum
Api
CodeMsg
.
APIERROR
.
msg
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/EnumEbsExtractType.java
0 → 100644
View file @
a1399503
package
pwc
.
taxtech
.
atms
.
constant
.
enums
;
public
enum
EnumEbsExtractType
{
TB
(
100
,
"月度科目余额表"
),
JE
(
101
,
"日记账"
),
BSPRC
(
102
,
"资产负债表PRC"
),
PLPRC
(
103
,
"利润表PRC"
),
BS
(
104
,
"资产负债表"
),
PL
(
105
,
"利润表"
),
CF
(
106
,
"直接法现金流量表"
),
OCTB
(
107
,
"所有者权益变动表"
),
RATE
(
108
,
"汇率表"
);
private
int
code
;
private
String
file
;
EnumEbsExtractType
(
int
code
,
String
file
)
{
this
.
code
=
code
;
this
.
file
=
file
;
}
public
int
getCode
()
{
return
code
;
}
public
String
getFile
()
{
return
file
;
}
public
static
String
getNameByCode
(
int
code
){
for
(
EnumEbsExtractType
enumImportType
:
EnumEbsExtractType
.
values
()){
if
(
Integer
.
compare
(
code
,
enumImportType
.
getCode
())==
0
){
return
enumImportType
.
getFile
();
}
}
return
null
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/controller/EbsApiController.java
View file @
a1399503
...
...
@@ -4,7 +4,7 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.*
;
import
pwc.taxtech.atms.constant.enums.Enum
Error
CodeMsg
;
import
pwc.taxtech.atms.constant.enums.Enum
Api
CodeMsg
;
import
pwc.taxtech.atms.dto.ApiResultDto
;
import
pwc.taxtech.atms.dto.ebsdto.*
;
import
pwc.taxtech.atms.service.EbsApiService
;
...
...
@@ -28,18 +28,18 @@ public class EbsApiController {
ApiResultDto
apiResultDto
=
new
ApiResultDto
();
if
(
CollectionUtils
.
isEmpty
(
items
))
{
logger
.
debug
(
"the updateJE return items is empty"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIDATAEMPTY
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIDATAEMPTY
);
return
apiResultDto
;
}
try
{
ebsApiService
.
queryRemoteServerThenUpdateJE
(
id
,
items
);
logger
.
debug
(
"日记账同步更新 success"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
SUCCESS
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
SUCCESS
);
return
apiResultDto
;
}
catch
(
Exception
e
){
logger
.
error
(
"updateJE error."
,
e
);
e
.
printStackTrace
();
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIERROR
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIERROR
);
return
apiResultDto
;
}
}
...
...
@@ -50,18 +50,18 @@ public class EbsApiController {
ApiResultDto
apiResultDto
=
new
ApiResultDto
();
if
(
CollectionUtils
.
isEmpty
(
items
))
{
logger
.
debug
(
"the updateTB return items is empty"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIDATAEMPTY
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIDATAEMPTY
);
return
apiResultDto
;
}
try
{
ebsApiService
.
queryRemoteServerThenUpdateTB
(
id
,
items
);
logger
.
debug
(
"科目余额数据同步更新 success"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
SUCCESS
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
SUCCESS
);
return
apiResultDto
;
}
catch
(
Exception
e
){
logger
.
error
(
"updateTB error."
,
e
);
e
.
printStackTrace
();
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIERROR
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIERROR
);
return
apiResultDto
;
}
}
...
...
@@ -72,18 +72,18 @@ public class EbsApiController {
ApiResultDto
apiResultDto
=
new
ApiResultDto
();
if
(
CollectionUtils
.
isEmpty
(
items
))
{
logger
.
debug
(
"the updateCF return items is empty"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIDATAEMPTY
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIDATAEMPTY
);
return
apiResultDto
;
}
try
{
ebsApiService
.
queryRemoteServerThenUpdateCF
(
id
,
items
);
logger
.
debug
(
"现金流量数据同步更新 success"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
SUCCESS
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
SUCCESS
);
return
apiResultDto
;
}
catch
(
Exception
e
){
logger
.
error
(
"updateCF error."
,
e
);
e
.
printStackTrace
();
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIERROR
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIERROR
);
return
apiResultDto
;
}
}
...
...
@@ -94,18 +94,18 @@ public class EbsApiController {
ApiResultDto
apiResultDto
=
new
ApiResultDto
();
if
(
CollectionUtils
.
isEmpty
(
items
))
{
logger
.
debug
(
"the updateBS return items is empty"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIDATAEMPTY
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIDATAEMPTY
);
return
apiResultDto
;
}
try
{
ebsApiService
.
queryRemoteServerThenUpdateBS
(
id
,
items
);
logger
.
debug
(
"资产负债数据同步更新 success"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
SUCCESS
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
SUCCESS
);
return
apiResultDto
;
}
catch
(
Exception
e
){
logger
.
error
(
"updateBS error."
,
e
);
e
.
printStackTrace
();
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIERROR
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIERROR
);
return
apiResultDto
;
}
}
...
...
@@ -116,18 +116,18 @@ public class EbsApiController {
ApiResultDto
apiResultDto
=
new
ApiResultDto
();
if
(
CollectionUtils
.
isEmpty
(
items
))
{
logger
.
debug
(
"the updatePL return items is empty"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIDATAEMPTY
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIDATAEMPTY
);
return
apiResultDto
;
}
try
{
ebsApiService
.
queryRemoteServerThenUpdatePL
(
id
,
items
);
logger
.
debug
(
"利润数据同步更新 success"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
SUCCESS
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
SUCCESS
);
return
apiResultDto
;
}
catch
(
Exception
e
){
logger
.
error
(
"updatePL error."
,
e
);
e
.
printStackTrace
();
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIERROR
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIERROR
);
return
apiResultDto
;
}
}
...
...
@@ -138,17 +138,17 @@ public class EbsApiController {
ApiResultDto
apiResultDto
=
new
ApiResultDto
();
if
(
CollectionUtils
.
isEmpty
(
items
))
{
logger
.
debug
(
"the updateBSprc return items is empty"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIDATAEMPTY
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIDATAEMPTY
);
return
apiResultDto
;
}
try
{
ebsApiService
.
queryRemoteServerThenUpdateBSprc
(
id
,
items
);
logger
.
debug
(
"资产负债PRC数据同步更新 success"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
SUCCESS
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
SUCCESS
);
return
apiResultDto
;
}
catch
(
Exception
e
){
logger
.
error
(
"updateBSprc error."
,
e
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIERROR
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIERROR
);
return
apiResultDto
;
}
}
...
...
@@ -159,17 +159,17 @@ public class EbsApiController {
ApiResultDto
apiResultDto
=
new
ApiResultDto
();
if
(
CollectionUtils
.
isEmpty
(
items
))
{
logger
.
debug
(
"the updatePLprc return items is empty"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIDATAEMPTY
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIDATAEMPTY
);
return
apiResultDto
;
}
try
{
ebsApiService
.
queryRemoteServerThenUpdatePLprc
(
id
,
items
);
logger
.
debug
(
"利润PRC数据同步更新 success"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
SUCCESS
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
SUCCESS
);
return
apiResultDto
;
}
catch
(
Exception
e
){
logger
.
error
(
"updatePLprc error."
,
e
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIERROR
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIERROR
);
return
apiResultDto
;
}
}
...
...
@@ -180,17 +180,17 @@ public class EbsApiController {
ApiResultDto
apiResultDto
=
new
ApiResultDto
();
if
(
CollectionUtils
.
isEmpty
(
items
))
{
logger
.
debug
(
"the updateOAR return items is empty"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIDATAEMPTY
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIDATAEMPTY
);
return
apiResultDto
;
}
try
{
ebsApiService
.
queryRemoteServerThenUpdateOAR
(
id
,
items
);
logger
.
debug
(
"汇率数据同步更新 success"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
SUCCESS
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
SUCCESS
);
return
apiResultDto
;
}
catch
(
Exception
e
){
logger
.
error
(
"updateOAR error."
,
e
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIERROR
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIERROR
);
return
apiResultDto
;
}
}
...
...
@@ -200,17 +200,17 @@ public class EbsApiController {
ApiResultDto
apiResultDto
=
new
ApiResultDto
();
if
(
CollectionUtils
.
isEmpty
(
items
))
{
logger
.
debug
(
"the updateOrg return items is empty"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIDATAEMPTY
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIDATAEMPTY
);
return
apiResultDto
;
}
try
{
ebsApiService
.
queryRemoteServerThenUpdateOrg
(
id
,
items
);
logger
.
debug
(
"机构信息数据同步更新 success"
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
SUCCESS
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
SUCCESS
);
return
apiResultDto
;
}
catch
(
Exception
e
){
logger
.
error
(
"updateOrg error."
,
e
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIERROR
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIERROR
);
return
apiResultDto
;
}
}
...
...
@@ -227,16 +227,16 @@ public class EbsApiController {
try
{
ebsApiService
.
changeCallBackStatus
(
callBackDto
);
logger
.
debug
(
"ebs callback taskId:{},status:{} end "
,
callBackDto
.
getTaskId
(),
callBackDto
.
getTaskStatus
());
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
SUCCESS
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
SUCCESS
);
return
apiResultDto
;
}
catch
(
Exception
e
){
logger
.
error
(
"ebs callback error."
,
e
);
setApiResult
(
apiResultDto
,
EnumError
CodeMsg
.
APIERROR
);
setApiResult
(
apiResultDto
,
EnumApi
CodeMsg
.
APIERROR
);
return
apiResultDto
;
}
}
private
void
setApiResult
(
ApiResultDto
apiResultDto
,
EnumError
CodeMsg
error
)
{
private
void
setApiResult
(
ApiResultDto
apiResultDto
,
EnumApi
CodeMsg
error
)
{
apiResultDto
.
setCode
(
error
.
getCode
());
apiResultDto
.
setMessage
(
error
.
getMsg
());
}
...
...
atms-api/src/main/java/pwc/taxtech/atms/dto/DataExtractParam.java
View file @
a1399503
...
...
@@ -11,6 +11,10 @@ public class DataExtractParam {
private
List
<
Integer
>
dataTypes
;
private
String
effectiveDateFrom
;
private
String
effectiveDateTo
;
public
String
getPeriod
()
{
return
period
;
}
...
...
@@ -34,4 +38,20 @@ public class DataExtractParam {
public
void
setDataTypes
(
List
<
Integer
>
dataTypes
)
{
this
.
dataTypes
=
dataTypes
;
}
public
String
getEffectiveDateFrom
()
{
return
effectiveDateFrom
;
}
public
void
setEffectiveDateFrom
(
String
effectiveDateFrom
)
{
this
.
effectiveDateFrom
=
effectiveDateFrom
;
}
public
String
getEffectiveDateTo
()
{
return
effectiveDateTo
;
}
public
void
setEffectiveDateTo
(
String
effectiveDateTo
)
{
this
.
effectiveDateTo
=
effectiveDateTo
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/ebsdto/EbsCallRateResp.java
0 → 100644
View file @
a1399503
package
pwc
.
taxtech
.
atms
.
dto
.
ebsdto
;
/**
* @Auther: eddie.wu_v
* @Date: 2019/3/16 16:55
* @Description:
*/
public
class
EbsCallRateResp
{
private
String
companyCode
;
private
int
requestStatus
;
private
String
errorMessage
;
private
String
records
;
public
void
setCompanyCode
(
String
companyCode
)
{
this
.
companyCode
=
companyCode
;
}
public
String
getCompanyCode
()
{
return
companyCode
;
}
public
void
setRequestStatus
(
int
requestStatus
)
{
this
.
requestStatus
=
requestStatus
;
}
public
int
getRequestStatus
()
{
return
requestStatus
;
}
public
void
setErrorMessage
(
String
errorMessage
)
{
this
.
errorMessage
=
errorMessage
;
}
public
String
getErrorMessage
()
{
return
errorMessage
;
}
public
void
setRecords
(
String
records
)
{
this
.
records
=
records
;
}
public
String
getRecords
()
{
return
records
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/dto/ebsdto/EbsCallResp.java
0 → 100644
View file @
a1399503
package
pwc
.
taxtech
.
atms
.
dto
.
ebsdto
;
import
java.util.Date
;
/**
* @Auther: eddie.wu_v
* @Date: 2019/3/15 17:07
* @Description:
*/
public
class
EbsCallResp
{
private
String
errBuf
;
private
String
retCode
;
private
int
ledgerId
;
private
String
companyCode
;
private
String
period
;
private
String
prcFlag
;
private
int
taskId
;
private
String
taskStatus
;
private
String
taskDesc
;
public
void
setErrBuf
(
String
errBuf
)
{
this
.
errBuf
=
errBuf
;
}
public
String
getErrBuf
()
{
return
errBuf
;
}
public
void
setRetCode
(
String
retCode
)
{
this
.
retCode
=
retCode
;
}
public
String
getRetCode
()
{
return
retCode
;
}
public
void
setLedgerId
(
int
ledgerId
)
{
this
.
ledgerId
=
ledgerId
;
}
public
int
getLedgerId
()
{
return
ledgerId
;
}
public
void
setCompanyCode
(
String
companyCode
)
{
this
.
companyCode
=
companyCode
;
}
public
String
getCompanyCode
()
{
return
companyCode
;
}
public
void
setPeriod
(
String
period
)
{
this
.
period
=
period
;
}
public
String
getPeriod
()
{
return
period
;
}
public
void
setPrcFlag
(
String
prcFlag
)
{
this
.
prcFlag
=
prcFlag
;
}
public
String
getPrcFlag
()
{
return
prcFlag
;
}
public
void
setTaskId
(
int
taskId
)
{
this
.
taskId
=
taskId
;
}
public
int
getTaskId
()
{
return
taskId
;
}
public
void
setTaskStatus
(
String
taskStatus
)
{
this
.
taskStatus
=
taskStatus
;
}
public
String
getTaskStatus
()
{
return
taskStatus
;
}
public
void
setTaskDesc
(
String
taskDesc
)
{
this
.
taskDesc
=
taskDesc
;
}
public
String
getTaskDesc
()
{
return
taskDesc
;
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/DataImportService.java
View file @
a1399503
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
java.util.Date
;
import
com.alibaba.fastjson.JSON
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
...
...
@@ -9,15 +10,22 @@ import org.apache.commons.collections.CollectionUtils;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.poi.ss.usermodel.*
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
pwc.taxtech.atms.analysis.dao.*
;
import
pwc.taxtech.atms.analysis.entity.*
;
import
pwc.taxtech.atms.common.AuthUserHelper
;
import
pwc.taxtech.atms.common.message.ErrorMessage
;
import
pwc.taxtech.atms.common.message.ErrorMessageCN
;
import
pwc.taxtech.atms.common.util.BaseThreadFactory
;
import
pwc.taxtech.atms.common.util.DateUtils
;
import
pwc.taxtech.atms.common.util.HttpUtil
;
import
pwc.taxtech.atms.constant.Constant
;
import
pwc.taxtech.atms.constant.EbsExtractTypeConstant
;
import
pwc.taxtech.atms.constant.enums.EnumApiCodeMsg
;
import
pwc.taxtech.atms.constant.enums.EnumEbsExtractType
;
import
pwc.taxtech.atms.constant.enums.EnumImportType
;
import
pwc.taxtech.atms.constant.enums.EnumTbImportType
;
import
pwc.taxtech.atms.dao.*
;
...
...
@@ -28,6 +36,8 @@ import pwc.taxtech.atms.dto.DataValidateLogDto;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.dataimport.DataImportParam
;
import
pwc.taxtech.atms.dto.dataimport.DataProcessParam
;
import
pwc.taxtech.atms.dto.ebsdto.EbsCallRateResp
;
import
pwc.taxtech.atms.dto.ebsdto.EbsCallResp
;
import
pwc.taxtech.atms.dto.vatdto.TrialBalanceDto
;
import
pwc.taxtech.atms.dto.vatdto.TrialBalanceParam
;
import
pwc.taxtech.atms.entity.*
;
...
...
@@ -40,6 +50,7 @@ import java.io.InputStream;
import
java.math.BigDecimal
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.concurrent.*
;
import
java.util.stream.Collectors
;
@Service
...
...
@@ -85,33 +96,28 @@ public class DataImportService extends BaseService {
private
InvoiceRecordMapper
invoiceRecordMapper
;
@Resource
private
ProjectMapper
projectMapper
;
@Resource
private
AnalysisDriverNumMapper
analysisDriverNumMapper
;
@Resource
private
AnalysisEmployeeNumMapper
analysisEmployeeNumMapper
;
@Resource
private
AnalysisExpectedTaxReturnMapper
analysisExpectedTaxReturnMapper
;
@Resource
private
AnalysisActualTaxReturnMapper
analysisActualTaxReturnMapper
;
@Resource
private
AnalysisFeeMapper
analysisFeeMapper
;
@Resource
private
AnalysisFileManagementMapper
analysisFileManagementMapper
;
@Resource
private
AnalysisGmvSubsidyMapper
analysisGmvSubsidyMapper
;
@Resource
private
AnalysisInternationalBusinessDataMapper
analysisInternationalBusinessDataMapper
;
@Resource
private
AnalysisInternationalTaxDataMapper
analysisInternationalTaxDataMapper
;
@Resource
private
AnalysisMasterMapper
analysisMasterMapper
;
@Resource
private
AnalysisSalesMapper
analysisSalesMapper
;
@Resource
private
AnalysisTaxMapper
analysisTaxMapper
;
@Autowired
private
OrganizationServiceImpl
organizationService
;
private
static
String
ebsCallUrl
;
@Value
(
"${ebs_call_url}"
)
public
void
setEbsCallUrl
(
String
url
){
this
.
ebsCallUrl
=
url
;
}
private
static
int
corePoolSize
=
15
;
private
static
int
maxPoolSize
=
15
;
private
static
int
qSize
=
5000
;
private
static
BaseThreadFactory
factory
=
new
BaseThreadFactory
(
"callEbs"
);
private
static
ExecutorService
executorService
=
new
ThreadPoolExecutor
(
corePoolSize
,
maxPoolSize
,
0L
,
TimeUnit
.
MILLISECONDS
,
new
LinkedBlockingQueue
<>(
qSize
),
factory
,
new
ThreadPoolExecutor
.
AbortPolicy
());
/**
* TB表查询
*
...
...
@@ -1673,7 +1679,6 @@ public class DataImportService extends BaseService {
List
<
String
>
orgIds
=
organizationService
.
getMyOrgList
().
stream
().
map
(
OrgSelectDto:
:
getId
).
collect
(
Collectors
.
toList
());
// 这里会导致任何人都可以看到未映射到主体的数据
orgIds
.
add
(
""
);
if
(!
EnumImportType
.
Undefined
.
getCode
().
equals
(
param
.
getType
())){
criteria
.
andTypeEqualTo
(
param
.
getType
()).
andDisplayEqualTo
(
true
);
criteria
.
andOrganizationIdIn
(
orgIds
);
...
...
@@ -1716,18 +1721,71 @@ public class DataImportService extends BaseService {
return
pageInfo
;
}
public
OperationResultDto
callExtractFinancialData
(
DataExtractParam
dataExtractParam
)
{
// todo 调用滴滴的http财务数据抽取调用接口 List<String> codes, Integer period, List<Integer> dataTypes
/**
* 16/03/2019 12:43
* 1、根据类型调用EBS接口
* 2、定长线程池超过最长时丢弃记录日志
* 3、调用成功使用taskId作为日志id,未成功使用随机id
* [param]
* @author Gary J Li
* @return
*/
public
OperationResultDto
callExtractFinancialData
(
DataExtractParam
param
)
{
OrganizationExample
example
=
new
OrganizationExample
();
example
.
createCriteria
().
andIdIn
(
dataExtractP
aram
.
getOrgIds
());
example
.
createCriteria
().
andIdIn
(
p
aram
.
getOrgIds
());
List
<
Organization
>
orgs
=
organizationMapper
.
selectByExample
(
example
);
// HttpUtil.post();
Integer
tmsPeriod
=
DateUtils
.
strToPeriod
(
dataExtractParam
.
getPeriod
());
// data_import_log 日志记录为 EnumImportType.ExtractFinancialData
Integer
periodInt
=
DateUtils
.
strToPeriod
(
param
.
getPeriod
());
String
period
=
param
.
getPeriod
();
// 这两个参数未来可能有用
String
effectiveDateFrom
=
param
.
getEffectiveDateFrom
();
String
effectiveDateTo
=
param
.
getEffectiveDateTo
();
List
<
Future
>
resList
=
Lists
.
newArrayList
();
List
<
Integer
>
dataTypes
=
param
.
getDataTypes
();
dataTypes
.
forEach
(
type
->
{
orgs
.
forEach
(
o
->
{
try
{
Callable
callEbs
=
new
CallEbsThread
(
type
,
o
,
ebsCallUrl
,
dataImportLogMapper
,
authUserHelper
,
idService
,
period
,
effectiveDateFrom
,
effectiveDateTo
);
executorService
.
submit
(
callEbs
);
// resList.add(future);
}
catch
(
RejectedExecutionException
rje
)
{
// 这里可以考虑简化 没想好还
DataImportLog
log
=
new
DataImportLog
();
log
.
setId
(
idService
.
nextId
());
log
.
setTaxpayerIdNum
(
o
.
getTaxPayerNumber
());
log
.
setCompanyCode
(
o
.
getCode
());
log
.
setCompanyName
(
o
.
getName
());
log
.
setPeriodYear
(
periodInt
/
100
);
log
.
setPeriodMonth
(
periodInt
%
100
);
log
.
setType
(
EnumImportType
.
ExtractFinancialData
.
getCode
());
log
.
setFileType
(
EnumEbsExtractType
.
getNameByCode
(
type
));
log
.
setImportResult
(
false
);
log
.
setPeriodStatus
(
"EBS抽取"
);
log
.
setOperator
(
authUserHelper
.
getCurrentAuditor
().
get
());
log
.
setErrorMsg
(
EnumApiCodeMsg
.
BUSY
.
getMsg
());
dataImportLogMapper
.
insertSelective
(
log
);
}
catch
(
Exception
e
)
{
logger
.
error
(
String
.
format
(
EnumApiCodeMsg
.
CALLFAILED
.
getMsg
(),
e
.
getMessage
()),
e
);
}
});
});
// 校验是否全部调用成功 这里有点问题
/*int res = 0;
try{
for(Future future : resList){
res += future.get()!=null?(Integer)future.get():0;
}
System.out.println(res);
if(res!=orgs.size()*dataTypes.size()){
return OperationResultDto.error("抽取失败");
}
}catch (Exception e){
logger.error("获取结果异常");
}*/
resList
=
null
;
return
OperationResultDto
.
success
();
}
/**
* 25/02/2019 18:26
*
...
...
@@ -1767,4 +1825,146 @@ public class DataImportService extends BaseService {
return
""
;
}
// get 测试获取数据 post 触发任务请求
/**
* "http://172.20.201.201:8020/ebs-proxy-test/dts/glMonthlyBal?ledgerId=2021&companyCode=120200&period=2018-11"
* "http://172.20.201.201:8020/ebs-proxy-test/dts/fsgCash/?ledgerId=2021&companyCode=120200&period=2019-02"
* "http://172.20.201.201:8020/ebs-proxy-test/dts/fsgAsset?ledgerId=2021&period=2018-12&companyCode=120113&prcFlag=N"
* "http://172.20.201.201:8020/ebs-proxy-test/dts//fsgProfit?ledgerId=2021&companyCode=120200&period=2018-10&prcFlag=Y"
* "http://172.20.201.201:8020/ebs-proxy-test/dts/glJeLines/?ledgerId=2041&companyCode=110100&effectiveDateFrom=2018-02-01&effectiveDateTo=2018-02-10"
* "http://172.20.201.201:8020/ebs-proxy-test/dts/dailyRates?period=2018-10"
*/
private
static
class
CallEbsThread
implements
Callable
{
protected
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
private
int
type
;
private
Organization
org
;
private
String
period
;
private
String
ebsCallUrl
;
private
DataImportLogMapper
dataImportLogMapper
;
private
AuthUserHelper
authUserHelper
;
private
DistributedIdService
idService
;
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
)
{
this
.
type
=
type
;
this
.
org
=
org
;
this
.
period
=
period
;
this
.
ebsCallUrl
=
ebsCallUrl
;
this
.
authUserHelper
=
authUserHelper
;
this
.
idService
=
idService
;
this
.
dataImportLogMapper
=
dataImportLogMapper
;
this
.
effectiveDateFrom
=
effectiveDateFrom
;
this
.
effectiveDateTo
=
effectiveDateTo
;
}
@Override
public
Object
call
(){
String
response
=
null
;
String
ledgerId
=
org
.
getEnterpriseAccountCode
();
String
code
=
org
.
getCode
();
Integer
periodInt
=
DateUtils
.
strToPeriod
(
period
);
int
year
=
periodInt
/
100
;
int
month
=
periodInt
%
100
;
DataImportLog
log
=
new
DataImportLog
();
log
.
setTaxpayerIdNum
(
org
.
getTaxPayerNumber
());
log
.
setOrganizationId
(
org
.
getId
());
log
.
setCompanyCode
(
code
);
log
.
setCompanyName
(
org
.
getName
());
log
.
setPeriodYear
(
year
);
log
.
setPeriodMonth
(
month
);
log
.
setType
(
EnumImportType
.
ExtractFinancialData
.
getCode
());
log
.
setFileType
(
EnumEbsExtractType
.
getNameByCode
(
type
));
log
.
setPeriodStatus
(
"EBS抽取"
);
log
.
setOperator
(
authUserHelper
.
getCurrentAuditor
().
get
());
try
{
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
);
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
);
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
);
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
);
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
);
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
);
break
;
case
EbsExtractTypeConstant
.
CF
:
response
=
HttpUtil
.
post
(
ebsCallUrl
+
"/fsgCash"
+
"?ledgerId="
+
ledgerId
+
"&companyCode="
+
code
+
"&period="
+
period
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
break
;
case
EbsExtractTypeConstant
.
OCTB
:
break
;
case
EbsExtractTypeConstant
.
RATE
:
response
=
HttpUtil
.
post
(
ebsCallUrl
+
"/fsgCash"
+
"?dailyRates="
+
period
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
break
;
default
:
break
;
}
if
(
StringUtils
.
isNotEmpty
(
response
))
{
if
(
EbsExtractTypeConstant
.
RATE
==
type
){
EbsCallRateResp
resp
=
JSON
.
parseObject
(
response
,
EbsCallRateResp
.
class
);
log
.
setId
(
idService
.
nextId
());
log
.
setImportResult
(
true
);
log
.
setErrorMsg
(
String
.
format
(
EnumApiCodeMsg
.
CALLSUCCESS
.
getMsg
(),
resp
.
getRequestStatus
()));
}
else
{
EbsCallResp
resp
=
JSON
.
parseObject
(
response
,
EbsCallResp
.
class
);
long
taskId
=
Long
.
valueOf
(
resp
.
getTaskId
());
if
(
taskId
==
-
1
)
{
log
.
setId
(
idService
.
nextId
());
log
.
setImportResult
(
false
);
log
.
setErrorMsg
(
String
.
format
(
EnumApiCodeMsg
.
CALLFAILED
.
getMsg
(),
resp
.
getTaskDesc
()));
}
else
{
log
.
setId
(
taskId
);
log
.
setImportResult
(
true
);
log
.
setErrorMsg
(
String
.
format
(
EnumApiCodeMsg
.
CALLSUCCESS
.
getMsg
(),
resp
.
getTaskDesc
()));
}
}
dataImportLogMapper
.
insertSelective
(
log
);
}
}
catch
(
Exception
e
)
{
log
.
setId
(
idService
.
nextId
());
log
.
setImportResult
(
false
);
log
.
setErrorMsg
(
String
.
format
(
EnumApiCodeMsg
.
CALLFAILED
.
getMsg
(),
e
.
getMessage
()));
dataImportLogMapper
.
insertSelective
(
log
);
logger
.
error
(
String
.
format
(
EnumApiCodeMsg
.
CALLFAILED
.
getMsg
(),
e
.
getMessage
()),
e
);
}
return
null
;
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/OrganizationServiceImpl.java
View file @
a1399503
...
...
@@ -2013,7 +2013,7 @@ public class OrganizationServiceImpl extends BaseService{
if
(
StringUtils
.
isEmpty
(
org
.
getStructureId
()))
{
org
.
setStructureId
(
"null"
);
}
organizationMapper
.
insert
(
org
);
organizationMapper
.
insert
Selective
(
org
);
OperationResultDto
<
Object
>
validateSetRet
=
validateEnterpriseAccountSetDateTimeOverlap
(
orgDto
.
getEnterpriseAccountSetOrgList
());
if
(!
validateSetRet
.
getResult
())
{
...
...
@@ -2023,63 +2023,65 @@ public class OrganizationServiceImpl extends BaseService{
}
// 添加账套
for
(
EnterpriseAccountSetOrgDto
p
:
orgDto
.
getEnterpriseAccountSetOrgList
())
{
EnterpriseAccountSetOrg
enterpriseAccountSetOrg
=
new
EnterpriseAccountSetOrg
();
enterpriseAccountSetOrg
.
setId
(
CommonUtils
.
getUUID
());
enterpriseAccountSetOrg
.
setEnterpriseAccountSetId
(
p
.
getEnterpriseAccountSetId
());
enterpriseAccountSetOrg
.
setOrganizationId
(
orgDto
.
getId
());
if
(!
Strings
.
isEmpty
(
p
.
getEffectiveDateStr
()))
{
enterpriseAccountSetOrg
.
setEffectiveDate
(
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
)
.
parseDateTime
(
p
.
getEffectiveDateStr
()
+
"-01"
).
toDate
());
p
.
setEffectiveDate
(
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
)
.
parseDateTime
(
p
.
getEffectiveDateStr
()
+
"-01"
).
toDate
());
}
if
(!
orgDto
.
getOversea
()){
for
(
EnterpriseAccountSetOrgDto
p
:
orgDto
.
getEnterpriseAccountSetOrgList
())
{
EnterpriseAccountSetOrg
enterpriseAccountSetOrg
=
new
EnterpriseAccountSetOrg
();
enterpriseAccountSetOrg
.
setId
(
CommonUtils
.
getUUID
());
enterpriseAccountSetOrg
.
setEnterpriseAccountSetId
(
p
.
getEnterpriseAccountSetId
());
enterpriseAccountSetOrg
.
setOrganizationId
(
orgDto
.
getId
());
if
(!
Strings
.
isEmpty
(
p
.
getEffectiveDateStr
()))
{
enterpriseAccountSetOrg
.
setEffectiveDate
(
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
)
.
parseDateTime
(
p
.
getEffectiveDateStr
()
+
"-01"
).
toDate
());
p
.
setEffectiveDate
(
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
)
.
parseDateTime
(
p
.
getEffectiveDateStr
()
+
"-01"
).
toDate
());
}
if
(!
Strings
.
isEmpty
(
p
.
getExpiredDateStr
()))
{
enterpriseAccountSetOrg
.
setExpiredDate
(
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
)
.
parseDateTime
(
p
.
getExpiredDateStr
()
+
"-01"
).
plusMonths
(
1
).
minusDays
(
1
).
toDate
());
p
.
setExpiredDate
(
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
)
.
parseDateTime
(
p
.
getExpiredDateStr
()
+
"-01"
).
plusMonths
(
1
).
minusDays
(
1
).
toDate
());
if
(!
Strings
.
isEmpty
(
p
.
getExpiredDateStr
()))
{
enterpriseAccountSetOrg
.
setExpiredDate
(
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
)
.
parseDateTime
(
p
.
getExpiredDateStr
()
+
"-01"
).
plusMonths
(
1
).
minusDays
(
1
).
toDate
());
p
.
setExpiredDate
(
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
)
.
parseDateTime
(
p
.
getExpiredDateStr
()
+
"-01"
).
plusMonths
(
1
).
minusDays
(
1
).
toDate
());
}
enterpriseAccountSetOrgMapper
.
insert
(
enterpriseAccountSetOrg
);
}
enterpriseAccountSetOrgMapper
.
insert
(
enterpriseAccountSetOrg
);
}
// 添加服务
// For VAT, update Rule Engine tables after updating
// OrganizationServiceTemplateGroup
// .NET中定义了以下变量,但未被使用,故在此处注释 defaultRule, reportRules
OrganizationServiceTemplateGroupDto
vatSetting
=
orgDto
.
getOrganizationServiceTemplateGroupList
().
stream
()
.
filter
(
t
->
ServiceTypeEnum
.
VAT
.
toString
().
equals
(
t
.
getServiceTypeId
())).
findFirst
().
orElse
(
null
);
if
(
vatSetting
!=
null
)
{
// If currently no rule and new rule should be added
TemplateGroup
templateGrp
=
vatSetting
.
getTemplateGroupId
()
!=
null
?
templateGroupMapper
.
selectByPrimaryKey
(
vatSetting
.
getTemplateGroupId
())
:
null
;
// In organization module tax payer type is 1&2 while 0&1 in rule engine
Integer
newTaxPayerType
=
(
templateGrp
!=
null
&&
templateGrp
.
getPayTaxType
()
!=
null
)
?
templateGrp
.
getPayTaxType
()
-
1
:
VatTaxPayerTypeEnum
.
General
.
value
();
TaxPayerReportRule
newRule
=
new
TaxPayerReportRule
();
newRule
.
setId
(
distributedIdService
.
nextId
());
newRule
.
setIsDefault
(
false
);
newRule
.
setOrganizationId
(
orgDto
.
getId
());
newRule
.
setTemplateGroupId
(
vatSetting
.
getTemplateGroupId
());
newRule
.
setTaxPayerType
(
newTaxPayerType
);
// Use tax payer type related to template group
newRule
.
setCreateTime
(
now
);
newRule
.
setUpdateTime
(
now
);
taxPayerReportRuleMapper
.
insert
(
newRule
);
}
for
(
OrganizationServiceTemplateGroupDto
p
:
orgDto
.
getOrganizationServiceTemplateGroupList
())
{
OrganizationServiceTemplateGroup
orgServiceTempGroup
=
new
OrganizationServiceTemplateGroup
();
orgServiceTempGroup
.
setId
(
distributedIdService
.
nextId
());
orgServiceTempGroup
.
setOrganizationId
(
orgDto
.
getId
());
orgServiceTempGroup
.
setServiceTypeId
(
p
.
getServiceTypeId
());
orgServiceTempGroup
.
setTemplateGroupId
(
p
.
getTemplateGroupId
());
organizationServiceTemplateGroupMapper
.
insert
(
orgServiceTempGroup
);
}
// 添加服务
// For VAT, update Rule Engine tables after updating
// OrganizationServiceTemplateGroup
// .NET中定义了以下变量,但未被使用,故在此处注释 defaultRule, reportRules
OrganizationServiceTemplateGroupDto
vatSetting
=
orgDto
.
getOrganizationServiceTemplateGroupList
().
stream
()
.
filter
(
t
->
ServiceTypeEnum
.
VAT
.
toString
().
equals
(
t
.
getServiceTypeId
())).
findFirst
().
orElse
(
null
);
if
(
vatSetting
!=
null
)
{
// If currently no rule and new rule should be added
TemplateGroup
templateGrp
=
vatSetting
.
getTemplateGroupId
()
!=
null
?
templateGroupMapper
.
selectByPrimaryKey
(
vatSetting
.
getTemplateGroupId
())
:
null
;
// In organization module tax payer type is 1&2 while 0&1 in rule engine
Integer
newTaxPayerType
=
(
templateGrp
!=
null
&&
templateGrp
.
getPayTaxType
()
!=
null
)
?
templateGrp
.
getPayTaxType
()
-
1
:
VatTaxPayerTypeEnum
.
General
.
value
();
TaxPayerReportRule
newRule
=
new
TaxPayerReportRule
();
newRule
.
setId
(
distributedIdService
.
nextId
());
newRule
.
setIsDefault
(
false
);
newRule
.
setOrganizationId
(
orgDto
.
getId
());
newRule
.
setTemplateGroupId
(
vatSetting
.
getTemplateGroupId
());
newRule
.
setTaxPayerType
(
newTaxPayerType
);
// Use tax payer type related to template group
newRule
.
setCreateTime
(
now
);
newRule
.
setUpdateTime
(
now
);
taxPayerReportRuleMapper
.
insert
(
newRule
);
}
for
(
OrganizationServiceTemplateGroupDto
p
:
orgDto
.
getOrganizationServiceTemplateGroupList
())
{
OrganizationServiceTemplateGroup
orgServiceTempGroup
=
new
OrganizationServiceTemplateGroup
();
orgServiceTempGroup
.
setId
(
distributedIdService
.
nextId
());
orgServiceTempGroup
.
setOrganizationId
(
orgDto
.
getId
());
orgServiceTempGroup
.
setServiceTypeId
(
p
.
getServiceTypeId
());
orgServiceTempGroup
.
setTemplateGroupId
(
p
.
getTemplateGroupId
());
organizationServiceTemplateGroupMapper
.
insert
(
orgServiceTempGroup
);
}
// CopyModelTree(orgDto);//__restoreroy__
// CopyModelTree(orgDto);//__restoreroy__
addOrgSelfDimensionList
(
orgDto
);
addOrgSelfDimensionList
(
orgDto
);
}
// C#中的内部类CommonLogParams 在JAVA中已经被合并到OperationLogDto中
UpdateLogParams
tempCommonLogParms
=
new
UpdateLogParams
();
tempCommonLogParms
.
setOperationModule
(
Organization
.
value
());
...
...
atms-api/src/main/resources/conf/conf.properties
View file @
a1399503
...
...
@@ -55,4 +55,6 @@ app_key=${app_key}
cookie.maxAgeSeconds
=
${cookie.maxAgeSeconds}
api_white_list
=
${api_white_list}
org_sync_url
=
${org_sync_url}
org_sync_token
=
${org_sync_token}
\ No newline at end of file
org_sync_token
=
${org_sync_token}
ebs_call_url
=
${ebs_call_url}
\ No newline at end of file
atms-api/src/main/resources/conf/conf_profile_dev.properties
View file @
a1399503
...
...
@@ -54,3 +54,5 @@ cookie.maxAgeSeconds=86400
api_white_list
=
/ebs/api/v1/dd;
org_sync_url
=
http://10.96.238.10/erp-main-data-test-v2/api/companies
org_sync_token
=
174af08f
ebs_call_url
=
http://172.20.201.201:8020/ebs-proxy-test/dts
atms-api/src/main/resources/conf/conf_profile_pub.properties
View file @
a1399503
...
...
@@ -56,4 +56,6 @@ app_key=983258e7fd04d7fa0534735f7b1c33f3
cookie.maxAgeSeconds
=
18000
api_white_list
=
/ebs/api/v1/dd;
org_sync_url
=
http://10.96.238.10/erp-main-data-test-v2/api/companies
org_sync_token
=
174af08f
\ No newline at end of file
org_sync_token
=
174af08f
ebs_call_url
=
http://172.20.201.201:8020/ebs-proxy-test/dts
atms-api/src/main/resources/conf/conf_profile_staging.properties
View file @
a1399503
...
...
@@ -48,4 +48,9 @@ check_ticket=false
get_user_info_url
=
http://mis-test.diditaxi.com.cn/auth/sso/api/
app_id
=
2500
app_key
=
983258e7fd04d7fa0534735f7b1c33f3
cookie.maxAgeSeconds
=
86400
\ No newline at end of file
cookie.maxAgeSeconds
=
86400
api_white_list
=
/ebs/api/v1/dd;
org_sync_url
=
http://10.96.238.10/erp-main-data-test-v2/api/companies
org_sync_token
=
174af08f
ebs_call_url
=
http://172.20.201.201:8020/ebs-proxy-test/dts
atms-api/src/test/java/pwc/taxtech/atms/CommonIT.java
View file @
a1399503
...
...
@@ -53,6 +53,8 @@ public abstract class CommonIT {
private
SqlSessionFactory
sqlSessionFactory
;
@Autowired
protected
ObjectMapper
objectMapper
;
@Autowired
protected
DataImportLogMapper
dataImportLogMapper
;
@Autowired
protected
AreaMapper
areaMapper
;
...
...
atms-api/src/test/java/pwc/taxtech/atms/service/impl/EbsApiServiceImplTest.java
View file @
a1399503
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.commons.lang3.StringUtils
;
import
org.assertj.core.util.Lists
;
import
org.junit.Test
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
pwc.taxtech.atms.CommonIT
;
import
pwc.taxtech.atms.common.AuthUserHelper
;
import
pwc.taxtech.atms.common.schedule.OrgSyncJob
;
import
pwc.taxtech.atms.common.util.BaseThreadFactory
;
import
pwc.taxtech.atms.common.util.DateUtils
;
import
pwc.taxtech.atms.common.util.HttpUtil
;
import
pwc.taxtech.atms.constant.EbsExtractTypeConstant
;
import
pwc.taxtech.atms.constant.enums.EnumApiCodeMsg
;
import
pwc.taxtech.atms.constant.enums.EnumEbsExtractType
;
import
pwc.taxtech.atms.constant.enums.EnumImportType
;
import
pwc.taxtech.atms.dao.DataImportLogMapper
;
import
pwc.taxtech.atms.dto.DataExtractParam
;
import
pwc.taxtech.atms.dto.OperationResultDto
;
import
pwc.taxtech.atms.dto.ebsdto.*
;
import
pwc.taxtech.atms.dto.organization.DDSyncOrgInfo
;
import
pwc.taxtech.atms.dto.organization.OrgSyncData
;
import
pwc.taxtech.atms.entity.*
;
import
pwc.taxtech.atms.service.EbsApiService
;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.concurrent.*
;
public
class
EbsApiServiceImplTest
extends
CommonIT
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
EbsApiServiceImplTest
.
class
);
@Resource
private
EbsApiService
ebsApiService
;
@Resource
private
DistributedIdService
distributedIdService
;
private
DistributedIdService
idService
;
@Autowired
private
DataImportService
dataImportService
;
@Value
(
"${org_sync_url}"
)
private
String
orgSyncUrl
;
@Value
(
"${org_sync_token}"
)
private
String
token
;
private
static
String
ebsCallUrl
=
"http://172.20.201.201:8020/ebs-proxy-test/dts"
;
private
static
int
corePoolSize
=
15
;
private
static
int
maxPoolSize
=
15
;
private
static
int
qSize
=
5000
;
private
static
BaseThreadFactory
factory
=
new
BaseThreadFactory
(
"callEbs"
);
private
static
ExecutorService
executorService
=
new
ThreadPoolExecutor
(
corePoolSize
,
maxPoolSize
,
0L
,
TimeUnit
.
MILLISECONDS
,
new
LinkedBlockingQueue
<>(
qSize
),
factory
,
new
ThreadPoolExecutor
.
AbortPolicy
());
@Test
public
void
testExtractTB
(){
try
{
String
response
=
HttpUtil
.
post
(
"http://172.20.201.201:8020/ebs-proxy-test/dts/glMonthlyBal?ledgerId=2021&companyCode=120200&period=2018-11"
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
String
ledgerId
=
"2021"
;
String
code
=
"120200"
;
String
period
=
"2018-11"
;
String
url
=
ebsCallUrl
+
"/glMonthlyBal?ledgerId="
+
ledgerId
+
"&companyCode="
+
code
+
"&period="
+
period
;
System
.
out
.
println
(
url
);
response
=
HttpUtil
.
post
(
url
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
DataImportLog
log
=
new
DataImportLog
();
log
.
setTaxpayerIdNum
(
"123"
);
log
.
setOrganizationId
(
ledgerId
);
log
.
setCompanyCode
(
code
);
log
.
setCompanyName
(
ledgerId
);
log
.
setPeriodYear
(
2018
);
log
.
setPeriodMonth
(
11
);
log
.
setType
(
EnumImportType
.
ExtractFinancialData
.
getCode
());
log
.
setFileType
(
"caicai"
);
log
.
setPeriodStatus
(
"EBS抽取"
);
log
.
setOperator
(
"admin"
);
System
.
out
.
println
(
response
);
if
(
StringUtils
.
isNotEmpty
(
response
))
{
EbsCallResp
resp
=
JSON
.
parseObject
(
response
,
EbsCallResp
.
class
);
long
taskId
=
Long
.
valueOf
(
resp
.
getTaskId
());
if
(
taskId
==
-
1
)
{
log
.
setId
(
idService
.
nextId
());
log
.
setImportResult
(
false
);
log
.
setErrorMsg
(
String
.
format
(
EnumApiCodeMsg
.
CALLFAILED
.
getMsg
(),
resp
.
getTaskDesc
()));
}
else
{
log
.
setId
(
taskId
);
log
.
setImportResult
(
true
);
log
.
setErrorMsg
(
String
.
format
(
EnumApiCodeMsg
.
CALLSUCCESS
.
getMsg
(),
resp
.
getTaskDesc
()));
}
int
i
=
dataImportLogMapper
.
insertSelective
(
log
);
System
.
out
.
println
(
i
);
}
System
.
out
.
println
(
response
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
}
@Test
public
void
testExtract
(){
DataExtractParam
param
=
new
DataExtractParam
();
List
<
String
>
orgs
=
Lists
.
newArrayList
();
orgs
.
add
(
"5bbd739c-1a13-4b0f-aba6-32ba41e4de69"
);
List
<
Integer
>
dataTypes
=
Lists
.
newArrayList
();
dataTypes
.
add
(
100
);
dataTypes
.
add
(
101
);
dataTypes
.
add
(
102
);
dataTypes
.
add
(
103
);
dataTypes
.
add
(
104
);
dataTypes
.
add
(
105
);
dataTypes
.
add
(
106
);
dataTypes
.
add
(
108
);
param
.
setOrgIds
(
orgs
);
param
.
setDataTypes
(
dataTypes
);
param
.
setPeriod
(
"2019-03"
);
callExtractFinancialData
(
param
);
}
public
OperationResultDto
callExtractFinancialData
(
DataExtractParam
param
)
{
OrganizationExample
example
=
new
OrganizationExample
();
example
.
createCriteria
().
andIdIn
(
param
.
getOrgIds
());
List
<
Organization
>
orgs
=
organizationMapper
.
selectByExample
(
example
);
Integer
periodInt
=
DateUtils
.
strToPeriod
(
param
.
getPeriod
());
String
period
=
param
.
getPeriod
();
// 这两个参数未来可能有用
String
effectiveDateFrom
=
param
.
getEffectiveDateFrom
();
String
effectiveDateTo
=
param
.
getEffectiveDateTo
();
List
<
Future
>
list
=
Lists
.
newArrayList
();
param
.
getDataTypes
().
forEach
(
type
->
{
orgs
.
forEach
(
o
->
{
try
{
Callable
callEbs
=
new
CallEbsThread
(
type
,
o
,
ebsCallUrl
,
dataImportLogMapper
,
period
,
effectiveDateFrom
,
effectiveDateTo
);
Future
future
=
executorService
.
submit
(
callEbs
);
list
.
add
(
future
);
}
catch
(
RejectedExecutionException
rje
)
{
// 这里可以考虑简化 没想好还
DataImportLog
log
=
new
DataImportLog
();
log
.
setId
(
idService
.
nextId
());
log
.
setTaxpayerIdNum
(
o
.
getTaxPayerNumber
());
log
.
setCompanyCode
(
o
.
getCode
());
log
.
setCompanyName
(
o
.
getName
());
log
.
setPeriodYear
(
periodInt
/
100
);
log
.
setPeriodMonth
(
periodInt
%
100
);
log
.
setType
(
EnumImportType
.
ExtractFinancialData
.
getCode
());
log
.
setFileType
(
EnumEbsExtractType
.
getNameByCode
(
type
));
log
.
setImportResult
(
false
);
log
.
setPeriodStatus
(
"EBS抽取"
);
log
.
setOperator
(
"test"
);
log
.
setErrorMsg
(
EnumApiCodeMsg
.
BUSY
.
getMsg
());
dataImportLogMapper
.
insertSelective
(
log
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
});
});
int
res
=
0
;
try
{
for
(
Future
future
:
list
){
res
+=
(
Integer
)
list
.
get
(
0
).
get
();
}
System
.
out
.
println
(
res
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
return
OperationResultDto
.
success
();
}
@Test
public
void
testOrgApi
(){
Map
<
String
,
String
>
headers
=
new
HashMap
<>();
headers
.
put
(
"token"
,
token
);
headers
.
put
(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
headers
.
put
(
"Idap"
,
"eddie.wu_v"
);
int
pageSize
=
1
;
List
<
String
>
failedCnList
=
Lists
.
newArrayList
();
List
<
String
>
failedList
=
Lists
.
newArrayList
();
List
<
OrgSyncData
>
failedObjList
=
Lists
.
newArrayList
();
try
{
for
(
int
i
=
1
;
i
<=
pageSize
;
i
++)
{
String
response
=
HttpUtil
.
get
(
orgSyncUrl
+
"?currentPage="
+
i
,
headers
);
System
.
out
.
println
(
response
);
DDSyncOrgInfo
ddSyncOrgInfo
=
JSONObject
.
parseObject
(
response
,
DDSyncOrgInfo
.
class
);
pageSize
=
ddSyncOrgInfo
.
getTotalPage
();
List
<
OrgSyncData
>
orgSyncDatas
=
ddSyncOrgInfo
.
getData
();
orgSyncDatas
.
forEach
(
osd
->
{
OrganizationExample
example
=
new
OrganizationExample
();
example
.
createCriteria
().
andNameEqualTo
(
osd
.
getNameCN
());
Organization
o
=
new
Organization
();
o
.
setClientCode
(
osd
.
getCode
());
o
.
setCode
(
osd
.
getCode
());
o
.
setEnterpriseAccountCode
(
String
.
valueOf
(
osd
.
getSobId
()));
o
.
setEnterpriseAccountName
(
osd
.
getSobName
());
o
.
setCurrencyCode
(
osd
.
getCurrencyCode
());
o
.
setLegalEntity
(
osd
.
getLegalEntity
());
o
.
setLegalPersonName
(
osd
.
getLegalRepresentative
());
o
.
setAddress
(
osd
.
getAddress
());
o
.
setCreateTime
(
osd
.
getGmtCreate
());
o
.
setUpdateTime
(
osd
.
getGmtModified
());
o
.
setPsCode
(
osd
.
getPsCode
());
RegionExample
regionExample
=
new
RegionExample
();
regionExample
.
createCriteria
().
andShortNameEqualTo
(
osd
.
getCompanyLocation
());
List
<
Region
>
regions
=
regionMapper
.
selectByExample
(
regionExample
);
if
(
regions
.
size
()
>
0
)
{
o
.
setRegionId
(
regions
.
get
(
0
).
getId
());
}
if
(
organizationMapper
.
countByExample
(
example
)<
1
){
failedCnList
.
add
(
osd
.
getNameCN
());
failedList
.
add
(
osd
.
getOrgName
());
failedObjList
.
add
(
osd
);
}
organizationMapper
.
updateByExampleSelective
(
o
,
example
);
});
}
System
.
out
.
println
(
failedCnList
);
System
.
out
.
println
(
failedList
);
System
.
out
.
println
(
JSON
.
toJSONString
(
failedObjList
));
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
String
.
format
(
"机构信息同步异常:[%s]"
,
e
.
getMessage
()));
}
}
@Test
public
void
testApi
(){
...
...
@@ -347,4 +567,135 @@ public class EbsApiServiceImplTest extends CommonIT {
}
return
period
;
}
private
static
class
CallEbsThread
implements
Callable
{
protected
final
Logger
logger
=
LoggerFactory
.
getLogger
(
this
.
getClass
());
private
int
type
;
private
Organization
org
;
private
String
period
;
private
String
ebsCallUrl
;
private
String
effectiveDateFrom
;
private
String
effectiveDateTo
;
private
DataImportLogMapper
dataImportLogMapper
;
@Autowired
private
AuthUserHelper
authUserHelper
;
@Autowired
private
DistributedIdService
idService
;
CallEbsThread
(
int
type
,
Organization
org
,
String
ebsCallUrl
,
DataImportLogMapper
dataImportLogMapper
,
String
period
,
String
effectiveDateFrom
,
String
effectiveDateTo
)
{
this
.
type
=
type
;
this
.
org
=
org
;
this
.
ebsCallUrl
=
ebsCallUrl
;
this
.
dataImportLogMapper
=
dataImportLogMapper
;
this
.
period
=
period
;
this
.
effectiveDateFrom
=
effectiveDateFrom
;
this
.
effectiveDateTo
=
effectiveDateTo
;
}
@Override
public
Object
call
(){
String
response
=
null
;
String
ledgerId
=
org
.
getEnterpriseAccountCode
();
String
code
=
org
.
getCode
();
Integer
periodInt
=
DateUtils
.
strToPeriod
(
period
);
int
year
=
periodInt
/
100
;
int
month
=
periodInt
%
100
;
DataImportLog
log
=
new
DataImportLog
();
log
.
setTaxpayerIdNum
(
org
.
getTaxPayerNumber
());
log
.
setOrganizationId
(
org
.
getId
());
log
.
setCompanyCode
(
code
);
log
.
setCompanyName
(
org
.
getName
());
log
.
setPeriodYear
(
year
);
log
.
setPeriodMonth
(
month
);
log
.
setType
(
EnumImportType
.
ExtractFinancialData
.
getCode
());
log
.
setFileType
(
EnumEbsExtractType
.
getNameByCode
(
type
));
log
.
setPeriodStatus
(
"EBS抽取"
);
log
.
setOperator
(
"admin"
);
try
{
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
);
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
);
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
);
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
);
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
);
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
);
break
;
case
EbsExtractTypeConstant
.
CF
:
response
=
HttpUtil
.
post
(
ebsCallUrl
+
"/fsgCash"
+
"?ledgerId="
+
ledgerId
+
"&companyCode="
+
code
+
"&period="
+
period
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
break
;
case
EbsExtractTypeConstant
.
OCTB
:
break
;
case
EbsExtractTypeConstant
.
RATE
:
response
=
HttpUtil
.
post
(
ebsCallUrl
+
"/fsgCash"
+
"?dailyRates="
+
period
,
""
,
"application/json;charset=utf-8"
,
"UTF-8"
,
10000
,
10000
);
break
;
default
:
break
;
}
System
.
out
.
println
(
"call"
+
EnumEbsExtractType
.
getNameByCode
(
type
)+
":"
+
response
);
if
(
StringUtils
.
isNotEmpty
(
response
))
{
if
(
EbsExtractTypeConstant
.
RATE
==
type
){
EbsCallRateResp
resp
=
JSON
.
parseObject
(
response
,
EbsCallRateResp
.
class
);
log
.
setId
(
idService
.
nextId
());
log
.
setImportResult
(
true
);
log
.
setErrorMsg
(
String
.
format
(
EnumApiCodeMsg
.
CALLSUCCESS
.
getMsg
(),
resp
.
getRequestStatus
()));
}
else
{
EbsCallResp
resp
=
JSON
.
parseObject
(
response
,
EbsCallResp
.
class
);
long
taskId
=
Long
.
valueOf
(
resp
.
getTaskId
());
if
(
taskId
==
-
1
)
{
log
.
setId
(
idService
.
nextId
());
log
.
setImportResult
(
false
);
log
.
setErrorMsg
(
String
.
format
(
EnumApiCodeMsg
.
CALLFAILED
.
getMsg
(),
resp
.
getTaskDesc
()));
}
else
{
log
.
setId
(
taskId
);
log
.
setImportResult
(
true
);
log
.
setErrorMsg
(
String
.
format
(
EnumApiCodeMsg
.
CALLSUCCESS
.
getMsg
(),
resp
.
getTaskDesc
()));
}
}
dataImportLogMapper
.
insertSelective
(
log
);
}
}
catch
(
Exception
e
)
{
log
.
setId
(
idService
.
nextId
());
log
.
setImportResult
(
false
);
log
.
setErrorMsg
(
String
.
format
(
EnumApiCodeMsg
.
CALLFAILED
.
getMsg
(),
e
.
getMessage
()));
dataImportLogMapper
.
insertSelective
(
log
);
e
.
printStackTrace
();
}
return
new
Integer
(
1
);
}
}
}
\ No newline at end of file
atms-api/src/test/java/pwc/taxtech/atms/service/impl/GaryTest.java
0 → 100644
View file @
a1399503
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.google.common.collect.Lists
;
import
org.junit.Test
;
import
java.util.List
;
/**
* @Auther: Gary J Li
* @Date: 15/03/2019 20:42
* @Description:
*/
public
class
GaryTest
{
@Test
public
void
gagaga
(){
String
originJson
=
"[\n"
+
" \"Angola-安哥拉-0244\",\n"
+
" \"Afghanistan-阿富汗-93\",\n"
+
" \"Albania-阿尔巴尼亚-335\",\n"
+
" \"Algeria-阿尔及利亚-213\",\n"
+
" \"Andorra-安道尔共和国-376\",\n"
+
" \"Anguilla-安圭拉岛-1254\",\n"
+
" \"Antigua and Barbuda-安提瓜和巴布达-1268\",\n"
+
" \"Argentina-阿根廷-54\",\n"
+
" \"Armenia-亚美尼亚-374\",\n"
+
" \"Ascension-阿森松-247\",\n"
+
" \"Australia-澳大利亚-61\",\n"
+
" \"Austria-奥地利-43\",\n"
+
" \"Azerbaijan-阿塞拜疆-994\",\n"
+
" \"Bahamas-巴哈马-1242\",\n"
+
" \"Bahrain-巴林-973\",\n"
+
" \"Bangladesh-孟加拉国-880\",\n"
+
" \"Barbados-巴巴多斯-1246\",\n"
+
" \"Belarus-白俄罗斯-375\",\n"
+
" \"Belgium-比利时-32\",\n"
+
" \"Belize-伯利兹-501\",\n"
+
" \"Benin-贝宁-229\",\n"
+
" \"Bermuda Is-百慕大群岛-1441\",\n"
+
" \"Bolivia-玻利维亚-591\",\n"
+
" \"Botswana-博茨瓦纳-267\",\n"
+
" \"Brazil-巴西-55\",\n"
+
" \"Brunei-文莱-673\",\n"
+
" \"Bulgaria-保加利亚-359\",\n"
+
" \"Burkina Faso-布基纳法索-226\",\n"
+
" \"Burma-缅甸-95\",\n"
+
" \"Burundi-布隆迪-257\",\n"
+
" \"Cameroon-喀麦隆-237\",\n"
+
" \"Canada-加拿大-1\",\n"
+
" \"Cayman Is-开曼群岛-1345\",\n"
+
" \"Central African Republic-中非共和国-236\",\n"
+
" \"Chad-乍得-235\",\n"
+
" \"Chile-智利-56\",\n"
+
" \"China-中国-86\",\n"
+
" \"Colombia-哥伦比亚-57\",\n"
+
" \"Congo-刚果-242\",\n"
+
" \"Cook Is-库克群岛-682\",\n"
+
" \"Costa Rica-哥斯达黎加-506\",\n"
+
" \"Cuba-古巴-53\",\n"
+
" \"Cyprus-塞浦路斯-357\",\n"
+
" \"Czech Republic-捷克-420\",\n"
+
" \"Denmark-丹麦-45\",\n"
+
" \"Djibouti-吉布提-253\",\n"
+
" \"Dominica Rep-多米尼加共和国-1890\",\n"
+
" \"Ecuador-厄瓜多尔-593\",\n"
+
" \"Egypt-埃及-20\",\n"
+
" \"EI Salvador-萨尔瓦多-503\",\n"
+
" \"Estonia-爱沙尼亚-372\",\n"
+
" \"Ethiopia-埃塞俄比亚-251\",\n"
+
" \"Fiji-斐济-679\",\n"
+
" \"Finland-芬兰-358\",\n"
+
" \"France-法国-33\",\n"
+
" \"French Guiana-法属圭亚那-594\",\n"
+
" \"French Polynesia-法属玻利尼西亚-689\",\n"
+
" \"Gabon-加蓬-241\",\n"
+
" \"Gambia-冈比亚-220\",\n"
+
" \"Georgia-格鲁吉亚-995\",\n"
+
" \"Germany-德国-49\",\n"
+
" \"Ghana-加纳-233\",\n"
+
" \"Gibraltar-直布罗陀-350\",\n"
+
" \"Greece-希腊-30\",\n"
+
" \"Grenada-格林纳达-1809\",\n"
+
" \"Guam-关岛-1671\",\n"
+
" \"Guatemala-危地马拉-502\",\n"
+
" \"Guinea-几内亚-224\",\n"
+
" \"Guyana-圭亚那-592\",\n"
+
" \"Haiti-海地-509\",\n"
+
" \"Honduras-洪都拉斯-504\",\n"
+
" \"Hongkong-香港-852\",\n"
+
" \"Hungary-匈牙利-36\",\n"
+
" \"Iceland-冰岛-354\",\n"
+
" \"India-印度-91\",\n"
+
" \"Indonesia-印度尼西亚-62\",\n"
+
" \"Iran-伊朗-98\",\n"
+
" \"Iraq-伊拉克-964\",\n"
+
" \"Ireland-爱尔兰-353\",\n"
+
" \"Israel-以色列-972\",\n"
+
" \"Italy-意大利-39\",\n"
+
" \"Ivory Coast-科特迪瓦-225\",\n"
+
" \"Jamaica-牙买加-1876\",\n"
+
" \"Japan-日本-81\",\n"
+
" \"Jordan-约旦-962\",\n"
+
" \"Kampuchea (Cambodia )-柬埔寨-855\",\n"
+
" \"Kazakstan-哈萨克斯坦-327\",\n"
+
" \"Kenya-肯尼亚-254\",\n"
+
" \"Korea-韩国-82\",\n"
+
" \"Kuwait-科威特-965\",\n"
+
" \"Kyrgyzstan-吉尔吉斯坦-331\",\n"
+
" \"Laos-老挝-856\",\n"
+
" \"Latvia-拉脱维亚-371\",\n"
+
" \"Lebanon-黎巴嫩-961\",\n"
+
" \"Lesotho-莱索托-266\",\n"
+
" \"Liberia-利比里亚-231\",\n"
+
" \"Libya-利比亚-218\",\n"
+
" \"Liechtenstein-列支敦士登--423\",\n"
+
" \"Lithuania-立陶宛-370\",\n"
+
" \"Luxembourg-卢森堡-352\",\n"
+
" \"Macao-澳门-853\",\n"
+
" \"Madagascar-马达加斯加-261\",\n"
+
" \"Malawi-马拉维-265\",\n"
+
" \"Malaysia-马来西亚-60\",\n"
+
" \"Maldives-马尔代夫-960\",\n"
+
" \"Mali-马里-223\",\n"
+
" \"Malta-马耳他-356\",\n"
+
" \"Mariana Is-马里亚那群岛-1670\",\n"
+
" \"Martinique-马提尼克-596\",\n"
+
" \"Mauritius-毛里求斯-230\",\n"
+
" \"Mexico-墨西哥-52\",\n"
+
" \"Moldova-摩尔多瓦-373\",\n"
+
" \"Monaco-摩纳哥-377\",\n"
+
" \"Mongolia-蒙古-976\",\n"
+
" \"Montserrat Is-蒙特塞拉特岛-1664\",\n"
+
" \"Morocco-摩洛哥-212\",\n"
+
" \"Mozambique-莫桑比克-258\",\n"
+
" \"Namibia-纳米比亚-264\",\n"
+
" \"Nauru-瑙鲁-674\",\n"
+
" \"Nepal-尼泊尔-977\",\n"
+
" \"Netheriands Antilles-荷属安的列斯-599\",\n"
+
" \"Netherlands-荷兰-31\",\n"
+
" \"New Zealand-新西兰-64\",\n"
+
" \"Nicaragua-尼加拉瓜-505\",\n"
+
" \"Niger-尼日尔-227\",\n"
+
" \"Nigeria-尼日利亚-234\",\n"
+
" \"North Korea-朝鲜-850\",\n"
+
" \"Norway-挪威-47\",\n"
+
" \"Oman-阿曼-968\",\n"
+
" \"Pakistan-巴基斯坦-92\",\n"
+
" \"Panama-巴拿马-507\",\n"
+
" \"Papua New Cuinea-巴布亚新几内亚-675\",\n"
+
" \"Paraguay-巴拉圭-595\",\n"
+
" \"Peru-秘鲁-51\",\n"
+
" \"Philippines-菲律宾-63\",\n"
+
" \"Poland-波兰-48\",\n"
+
" \"Portugal-葡萄牙-351\",\n"
+
" \"Puerto Rico-波多黎各-1787\",\n"
+
" \"Qatar-卡塔尔-974\",\n"
+
" \"Reunion-留尼旺-262\",\n"
+
" \"Romania-罗马尼亚-40\",\n"
+
" \"Russia-俄罗斯-7\",\n"
+
" \"Saint Lueia-圣卢西亚-1758\",\n"
+
" \"Saint Vincent-圣文森特岛-1784\",\n"
+
" \"Samoa Eastern-东萨摩亚(美)-684\",\n"
+
" \"Samoa Western-西萨摩亚-685\",\n"
+
" \"San Marino-圣马力诺-378\",\n"
+
" \"Sao Tome and Principe-圣多美和普林西比-239\",\n"
+
" \"Saudi Arabia-沙特阿拉伯-966\",\n"
+
" \"Senegal-塞内加尔-221\",\n"
+
" \"Seychelles-塞舌尔-248\",\n"
+
" \"Sierra Leone-塞拉利昂-232\",\n"
+
" \"Singapore-新加坡-65\",\n"
+
" \"Slovakia-斯洛伐克-421\",\n"
+
" \"Slovenia-斯洛文尼亚-386\",\n"
+
" \"Solomon Is-所罗门群岛-677\",\n"
+
" \"Somali-索马里-252\",\n"
+
" \"South Africa-南非-27\",\n"
+
" \"Spain-西班牙-34\",\n"
+
" \"SriLanka-斯里兰卡-94\",\n"
+
" \"St.Lucia-圣卢西亚-1758\",\n"
+
" \"St.Vincent-圣文森特-1784\",\n"
+
" \"Sudan-苏丹-249\",\n"
+
" \"Suriname-苏里南-597\",\n"
+
" \"Swaziland-斯威士兰-268\",\n"
+
" \"Sweden-瑞典-46\",\n"
+
" \"Switzerland-瑞士-41\",\n"
+
" \"Syria-叙利亚-963\",\n"
+
" \"Taiwan-台湾省-886\",\n"
+
" \"Tajikstan-塔吉克斯坦-992\",\n"
+
" \"Tanzania-坦桑尼亚-255\",\n"
+
" \"Thailand-泰国-66\",\n"
+
" \"Togo-多哥-228\",\n"
+
" \"Tonga-汤加-676\",\n"
+
" \"Trinidad and Tobago-特立尼达和多巴哥-1809\",\n"
+
" \"Tunisia-突尼斯-216\",\n"
+
" \"Turkey-土耳其-90\",\n"
+
" \"Turkmenistan-土库曼斯坦-993\",\n"
+
" \"Uganda-乌干达-256\",\n"
+
" \"Ukraine-乌克兰-380\",\n"
+
" \"United Arab Emirates-阿拉伯联合酋长国-971\",\n"
+
" \"United Kiongdom-英国-44\",\n"
+
" \"United States of America-美国-1\",\n"
+
" \"Uruguay-乌拉圭-598\",\n"
+
" \"Uzbekistan-乌兹别克斯坦-233\",\n"
+
" \"Venezuela-委内瑞拉-58\",\n"
+
" \"Vietnam-越南-84\",\n"
+
" \"Yemen-也门-967\",\n"
+
" \"Yugoslavia-南斯拉夫-381\",\n"
+
" \"Zimbabwe-津巴布韦-263\",\n"
+
" \"Zaire-扎伊尔-243\",\n"
+
" \"Zambia-赞比亚-260\"\n"
+
"]"
;
List
<
String
>
lists
=
(
List
)
JSONArray
.
parseArray
(
originJson
);
List
<
String
>
cnNameList
=
Lists
.
newArrayList
();
List
<
String
>
enNameList
=
Lists
.
newArrayList
();
lists
.
forEach
(
l
->{
String
cnName
=
l
.
split
(
"-"
)[
1
];
String
enName
=
l
.
split
(
"-"
)[
0
];
cnNameList
.
add
(
"'"
+
cnName
+
"'"
);
enNameList
.
add
(
"'"
+
enName
+
"'"
);
});
System
.
out
.
println
(
"cnNameList"
+
cnNameList
);
System
.
out
.
println
(
"enNameList"
+
enNameList
);
}
}
atms-web/src/main/webapp/app-resources/i18n/en-us/app.json
View file @
a1399503
...
...
@@ -809,6 +809,7 @@
"dateFormat4YearMonthDay"
:
"yyyy-mm-dd"
,
"dateFormat4YearMonthDayCh"
:
"yyyy-mm-dd"
,
"RecordSize"
:
"Record Size"
,
"ExtractFile"
:
"Extract File"
,
"TaxPayerIdNum"
:
"纳税人识别号"
,
"ExtractDistribution"
:
"Extract Distribution"
,
...
...
atms-web/src/main/webapp/app-resources/i18n/en-us/vat.json
View file @
a1399503
...
...
@@ -1913,5 +1913,8 @@
"Company"
:
"Company"
,
"CompanySimpleName"
:
"Company Simple Name"
,
"DriverType"
:
"Driver Type"
,
"FileExportSuccess"
:
"File Export Success"
,
"FileExportFailed"
:
"File Export Failed"
,
"~MustBeEndOneApp"
:
"I Must be the End One, please!"
}
\ No newline at end of file
atms-web/src/main/webapp/app-resources/i18n/zh-CN/app.json
View file @
a1399503
...
...
@@ -856,6 +856,7 @@
"startsWith"
:
"起始于"
,
"RecordSize"
:
"记录条数"
,
"ExtractFile"
:
"抽取类型"
,
"TaxPayerIdNum"
:
"纳税人识别号"
,
"ExtractDistribution"
:
"抽取分发"
,
"Log"
:
"日志"
,
...
...
atms-web/src/main/webapp/app-resources/i18n/zh-CN/vat.json
View file @
a1399503
...
...
@@ -2276,6 +2276,8 @@
"CompanySimpleName"
:
"公司简称"
,
"DriverType"
:
"司机类型"
,
"FileExportSuccess"
:
"文件下载成功!"
,
"FileExportFailed"
:
"文件下载失败!"
,
"~MustBeEndOneApp"
:
"我必须是最后一个!"
}
\ No newline at end of file
atms-web/src/main/webapp/app/analysis/data-import/international-data-import/international-data-import.ctrl.js
View file @
a1399503
...
...
@@ -52,7 +52,7 @@
$scope
.
selectCountry
=
''
;
$scope
.
internationalDataList
=
constant
.
internationalDataList
;
$scope
.
countryList
=
[]
;
$scope
.
countryList
=
constant
.
countryCNList
;
$scope
.
companyList
=
[];
var
date
=
new
Date
();
...
...
@@ -540,23 +540,15 @@
};
var
initCompanyList
=
function
()
{
vatImportService
.
getAnalysisInternationalCompanyList
(
$scope
.
importType
,
$scope
.
UploadPeriodTime
).
success
(
function
(
data
)
{
orgService
.
getOrgListByUserId
(
).
success
(
function
(
data
)
{
if
(
data
)
{
$scope
.
companyList
=
data
;
}
});
};
var
initCountryList
=
function
()
{
vatImportService
.
getAnalysisInternationalCountryList
(
$scope
.
importType
,
$scope
.
UploadPeriodTime
).
success
(
function
(
data
)
{
if
(
data
)
{
$scope
.
countryList
=
data
;
}
});
};
$scope
.
selectCompanyEvent
=
function
(
company
){
$scope
.
selectCompany
=
company
;
$scope
.
selectCompanyEvent
=
function
(
i
){
$scope
.
selectCompany
=
i
.
name
;
refreshGrid
();
};
...
...
@@ -632,8 +624,6 @@
default
:
break
;
}
initCompanyList
();
initCountryList
();
};
//开始
...
...
@@ -643,6 +633,7 @@
checkUserOrganizationPermissionList
();
getUserPermission
();
initDatePicker
();
initCompanyList
();
$scope
.
$watch
(
'importExcelFile'
,
function
(
newValue
,
oldValue
)
{
if
(
newValue
!==
null
&&
newValue
!==
oldValue
)
{
...
...
atms-web/src/main/webapp/app/analysis/data-import/international-data-import/international-data-import.html
View file @
a1399503
...
...
@@ -15,11 +15,11 @@
<span
class=
"text-bold"
translate=
"SelectedImportType"
></span>
:
<div
class=
"dropdown"
style=
"margin-left:10px"
>
<button
class=
"btn btn-default dropdown-toggle"
type=
"button"
id=
"dropdownMenu2"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"true"
style=
"width: 1
2
0px;"
>
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"true"
style=
"width: 1
4
0px;"
>
{{selectType ? ((selectType)|translate):('PleaseSelect' | translate)}}
<span
class=
"caret"
style=
"float: right "
></span>
</button>
<ul
class=
"dropdown-menu"
style=
"width: 1
2
0px;"
aria-labelledby=
"dropdownMenu2"
>
<ul
class=
"dropdown-menu"
style=
"width: 1
4
0px;"
aria-labelledby=
"dropdownMenu2"
>
<li
ng-repeat=
"i in internationalDataList"
ng-click=
"changeTab(i)"
>
<div
class=
"checkbox-custom checkbox-default"
>
<span
style=
"margin-left:15px; float: left;"
>
{{(i.type)|translate}}
</span>
...
...
@@ -36,11 +36,11 @@
<span
class=
"text-bold"
translate=
"Country"
></span>
:
<div
class=
"dropdown"
style=
"margin-left:10px"
>
<button
class=
"btn btn-default dropdown-toggle"
type=
"button"
id=
"dropdownMenu3"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"true"
style=
"width: 1
2
0px;"
>
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"true"
style=
"width: 1
5
0px;"
>
{{selectCountry ? ((selectCountry)|translate):('PleaseSelect' | translate)}}
<span
class=
"caret"
style=
"float: right "
></span>
</button>
<ul
class=
"dropdown-menu"
style=
"width: 1
20px
;"
aria-labelledby=
"dropdownMenu3"
>
<ul
class=
"dropdown-menu"
style=
"width: 1
50px;max-height: 300px;overflow-y: auto
;"
aria-labelledby=
"dropdownMenu3"
>
<li
ng-repeat=
"i in countryList"
ng-click=
"selectCountryEvent(i)"
>
<div
class=
"checkbox-custom checkbox-default"
>
<span
style=
"margin-left:15px; float: left;"
>
{{i}}
</span>
...
...
@@ -51,14 +51,14 @@
<span
class=
"text-bold"
translate=
"Company"
></span>
:
<div
class=
"dropdown"
style=
"margin-left:10px"
>
<button
class=
"btn btn-default dropdown-toggle"
type=
"button"
id=
"dropdownMenu4"
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"true"
style=
"width:
12
0px;"
>
data-toggle=
"dropdown"
aria-haspopup=
"true"
aria-expanded=
"true"
style=
"width:
25
0px;"
>
{{selectCompany ? ((selectCompany)|translate):('PleaseSelect' | translate)}}
<span
class=
"caret"
style=
"float: right "
></span>
</button>
<ul
class=
"dropdown-menu"
style=
"width:
120px
;"
aria-labelledby=
"dropdownMenu4"
>
<ul
class=
"dropdown-menu"
style=
"width:
250px;max-height: 300px;overflow-y: auto
;"
aria-labelledby=
"dropdownMenu4"
>
<li
ng-repeat=
"i in companyList"
ng-click=
"selectCompanyEvent(i)"
>
<div
class=
"checkbox-custom checkbox-default"
>
<span
style=
"margin-left:15px; float: left;"
>
{{i}}
</span>
<span
style=
"margin-left:15px; float: left;"
>
{{i
.name
}}
</span>
</div>
</li>
</ul>
...
...
@@ -66,22 +66,22 @@
<button
type=
"button"
ngf-select=
""
type=
"file"
ng-model=
"importExcelFile"
ngf-drag-over-class=
"'dragover'"
accept=
".xls,.xlsx"
ngf-multiple=
"false"
ngf-allow-dir=
"false"
class=
"btn btn-vat-third"
style=
"margin-right:10px;margin-left:10px"
>
{{fileName ? ((fileName)|limitString:
maxTitleLength
):'SelectFile' | translate}}
ngf-allow-dir=
"false"
class=
"btn btn-vat-third"
style=
"margin-right:10px;margin-left:10px
;max-width: 30px;
"
>
{{fileName ? ((fileName)|limitString:
5
):'SelectFile' | translate}}
</button>
<button
type=
"button"
atms-permission
permission-control-type=
"ngIf"
permission-code=
"{{$root.vatPermission.dataImport.balanceSheet.importCode}}"
class=
"btn btn-vat-primary"
style=
"float:right;
margin-right: 10px;margin-left: 30
px;margin-top: 8px;"
<button
type=
"button"
atms-permission
permission-control-type=
"ngIf"
class=
"btn btn-vat-primary"
style=
"float:right;
margin-left: 15
px;margin-top: 8px;"
translate=
"ExportBtn"
ng-click=
"doExport()"
></button>
<button
type=
"button"
atms-permission
permission-control-type=
"ngIf"
class=
"btn btn-vat-primary"
style=
"float:right;
margin-right: 10px;margin-left: 30px;
margin-top: 8px;"
class=
"btn btn-vat-primary"
style=
"float:right;margin-top: 8px;"
translate=
"ImportBtn"
ng-click=
"doUpload()"
></button>
<button
type=
"button"
atms-permission
permission-control-type=
"ngIf"
class=
"btn btn-vat-primary"
style=
"float:right;
margin-right: 10px;margin-left: 30px;
margin-top: 8px;"
class=
"btn btn-vat-primary"
style=
"float:right;margin-top: 8px;"
translate=
"TemplateBtn"
ng-click=
"downloadTemplate()"
></button>
</div>
...
...
atms-web/src/main/webapp/app/common/controls/edit-organization-modal/edit-organization-modal.ctrl.js
View file @
a1399503
...
...
@@ -7,7 +7,7 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
$scope
.
pleaseSelect
=
$translate
.
instant
(
'PleaseSelect'
);
$scope
.
startDate
=
new
Date
(
new
Date
().
getFullYear
()
-
20
,
1
,
1
);
$scope
.
endDate
=
new
Date
(
new
Date
().
getFullYear
()
+
20
,
1
,
1
);
$scope
.
viewMode
=
1
;
$scope
.
viewMode
=
days
;
var
defaultSelcectRegion
=
{
id
:
0
,
...
...
@@ -114,6 +114,18 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
// 是否为境外企业
editModel
.
oversea
=
$scope
.
isInternational
;
if
((
typeof
$scope
.
editOrgModel
.
logoutTime
)
===
"string"
){
if
(
""
!==
(
$scope
.
editOrgModel
.
logoutTime
))
{
$scope
.
editOrgModel
.
logoutTime
=
new
Date
(
$scope
.
editOrgModel
.
logoutTime
);
}
}
if
((
typeof
$scope
.
editOrgModel
.
foundationDate
)
===
"string"
){
if
(
""
!==
(
$scope
.
editOrgModel
.
foundationDate
))
{
$scope
.
editOrgModel
.
foundationDate
=
new
Date
(
$scope
.
editOrgModel
.
foundationDate
);
}
}
if
(
$scope
.
isAdd
)
{
editModel
.
isActive
=
true
;
orgService
.
addOrg
(
editModel
).
success
(
function
(
orgId
)
{
...
...
@@ -250,9 +262,10 @@ controller('editOrganizationModalController', ['$scope', '$log', '$translate', '
if
(
$scope
.
componentSelectedArea
)
{
editModel
.
areaID
=
$scope
.
selectedAreaId
;
}
if
((
typeof
$scope
.
editOrgModel
.
foundationDate
)
===
"string"
){
if
(
""
!==
(
$scope
.
editOrgModel
.
foundationDate
))
{
$scope
.
editOrgModel
.
foundationDate
=
new
Date
(
Date
.
parse
(
$scope
.
editOrgModel
.
foundationDate
.
replace
(
/-/g
,
"/"
))
);
$scope
.
editOrgModel
.
foundationDate
=
new
Date
(
$scope
.
editOrgModel
.
foundationDate
);
}
}
...
...
atms-web/src/main/webapp/app/common/controls/import/import-adjust-table/import-adjust-table.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-audit-adjust/import-audit-adjust.less
View file @
a1399503
...
...
@@ -20,6 +20,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
padding: 5px;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-balance-sheet/import-balance-sheet.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-cash-flow/import-cash-flow.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-certified-invoices-list/import-certified-invoices-list.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-cit-bs-prc-adjust/import-cit-bs-prc-adjust.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-cit-draft-account-mapping/import-cit-draft-account-mapping.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-cit-eam-assets-disposal/import-cit-eam-assets-disposal.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-cit-journal-adjust/import-cit-journal-adjust.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-cit-profit-prc-adjust/import-cit-profit-prc-adjust.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-cit-salary-advance/import-cit-salary-advance.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-cit-trial-balance/import-cit-trial-balance.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-coupa-purchasing-report/import-coupa-purchasing-report.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-invoice-data/import-invoice-data.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-invoice-record/import-invoice-record.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-journal-entry/import-journal-entry.less
View file @
a1399503
...
...
@@ -82,6 +82,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-profit-loss/import-profit-loss.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-red-letter-info-table/import-red-letter-info-table.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/controls/import/import-trialbalance/import-trialbalance.less
View file @
a1399503
...
...
@@ -85,6 +85,8 @@
.dropdown-menu {
min-width: 100px;
max-height: 300px;
overflow-y: auto;
li {
text-align: center;
...
...
atms-web/src/main/webapp/app/common/utils/constant.js
View file @
a1399503
...
...
@@ -1538,15 +1538,15 @@ constant.citImportFileType = {
};
constant
.
fileTypeList
=
[
{
code
:
0
,
type
:
"月度科目余额表"
},
{
code
:
1
,
type
:
"日记账"
},
{
code
:
2
,
type
:
"资产负债表PRC"
},
{
code
:
3
,
type
:
"利润表PRC"
},
{
code
:
4
,
type
:
"资产负债表"
},
{
code
:
5
,
type
:
"利润表"
},
{
code
:
6
,
type
:
"直接法现金流量表"
},
{
code
:
7
,
type
:
"所有者权益变动表"
},
{
code
:
8
,
type
:
"汇率表"
}
{
code
:
10
0
,
type
:
"月度科目余额表"
},
{
code
:
1
01
,
type
:
"日记账"
},
{
code
:
10
2
,
type
:
"资产负债表PRC"
},
{
code
:
10
3
,
type
:
"利润表PRC"
},
{
code
:
10
4
,
type
:
"资产负债表"
},
{
code
:
10
5
,
type
:
"利润表"
},
{
code
:
10
6
,
type
:
"直接法现金流量表"
},
{
code
:
10
7
,
type
:
"所有者权益变动表"
},
{
code
:
10
8
,
type
:
"汇率表"
}
];
constant
.
domesticDataList
=
[
...
...
@@ -1615,7 +1615,7 @@ constant.anlDownLoadFileNameList = [
{
code
:
101
,
name
:
"国际税税务数据_"
}
];
constant
.
countryCNList
=
[
'安哥拉'
,
'阿富汗'
,
'阿尔巴尼亚'
,
'阿尔及利亚'
,
'安道尔共和国'
,
'安圭拉岛'
,
'安提瓜和巴布达'
,
'阿根廷'
,
'亚美尼亚'
,
'阿森松'
,
'澳大利亚'
,
'奥地利'
,
'阿塞拜疆'
,
'巴哈马'
,
'巴林'
,
'孟加拉国'
,
'巴巴多斯'
,
'白俄罗斯'
,
'比利时'
,
'伯利兹'
,
'贝宁'
,
'百慕大群岛'
,
'玻利维亚'
,
'博茨瓦纳'
,
'巴西'
,
'文莱'
,
'保加利亚'
,
'布基纳法索'
,
'缅甸'
,
'布隆迪'
,
'喀麦隆'
,
'加拿大'
,
'开曼群岛'
,
'中非共和国'
,
'乍得'
,
'智利'
,
'中国'
,
'哥伦比亚'
,
'刚果'
,
'库克群岛'
,
'哥斯达黎加'
,
'古巴'
,
'塞浦路斯'
,
'捷克'
,
'丹麦'
,
'吉布提'
,
'多米尼加共和国'
,
'厄瓜多尔'
,
'埃及'
,
'萨尔瓦多'
,
'爱沙尼亚'
,
'埃塞俄比亚'
,
'斐济'
,
'芬兰'
,
'法国'
,
'法属圭亚那'
,
'法属玻利尼西亚'
,
'加蓬'
,
'冈比亚'
,
'格鲁吉亚'
,
'德国'
,
'加纳'
,
'直布罗陀'
,
'希腊'
,
'格林纳达'
,
'关岛'
,
'危地马拉'
,
'几内亚'
,
'圭亚那'
,
'海地'
,
'洪都拉斯'
,
'香港'
,
'匈牙利'
,
'冰岛'
,
'印度'
,
'印度尼西亚'
,
'伊朗'
,
'伊拉克'
,
'爱尔兰'
,
'以色列'
,
'意大利'
,
'科特迪瓦'
,
'牙买加'
,
'日本'
,
'约旦'
,
'柬埔寨'
,
'哈萨克斯坦'
,
'肯尼亚'
,
'韩国'
,
'科威特'
,
'吉尔吉斯坦'
,
'老挝'
,
'拉脱维亚'
,
'黎巴嫩'
,
'莱索托'
,
'利比里亚'
,
'利比亚'
,
'列支敦士登'
,
'立陶宛'
,
'卢森堡'
,
'澳门'
,
'马达加斯加'
,
'马拉维'
,
'马来西亚'
,
'马尔代夫'
,
'马里'
,
'马耳他'
,
'马里亚那群岛'
,
'马提尼克'
,
'毛里求斯'
,
'墨西哥'
,
'摩尔多瓦'
,
'摩纳哥'
,
'蒙古'
,
'蒙特塞拉特岛'
,
'摩洛哥'
,
'莫桑比克'
,
'纳米比亚'
,
'瑙鲁'
,
'尼泊尔'
,
'荷属安的列斯'
,
'荷兰'
,
'新西兰'
,
'尼加拉瓜'
,
'尼日尔'
,
'尼日利亚'
,
'朝鲜'
,
'挪威'
,
'阿曼'
,
'巴基斯坦'
,
'巴拿马'
,
'巴布亚新几内亚'
,
'巴拉圭'
,
'秘鲁'
,
'菲律宾'
,
'波兰'
,
'葡萄牙'
,
'波多黎各'
,
'卡塔尔'
,
'留尼旺'
,
'罗马尼亚'
,
'俄罗斯'
,
'圣卢西亚'
,
'圣文森特岛'
,
'东萨摩亚(美)'
,
'西萨摩亚'
,
'圣马力诺'
,
'圣多美和普林西比'
,
'沙特阿拉伯'
,
'塞内加尔'
,
'塞舌尔'
,
'塞拉利昂'
,
'新加坡'
,
'斯洛伐克'
,
'斯洛文尼亚'
,
'所罗门群岛'
,
'索马里'
,
'南非'
,
'西班牙'
,
'斯里兰卡'
,
'圣
卢西亚'
,
'圣
文森特'
,
'苏丹'
,
'苏里南'
,
'斯威士兰'
,
'瑞典'
,
'瑞士'
,
'叙利亚'
,
'台湾省'
,
'塔吉克斯坦'
,
'坦桑尼亚'
,
'泰国'
,
'多哥'
,
'汤加'
,
'特立尼达和多巴哥'
,
'突尼斯'
,
'土耳其'
,
'土库曼斯坦'
,
'乌干达'
,
'乌克兰'
,
'阿拉伯联合酋长国'
,
'英国'
,
'美国'
,
'乌拉圭'
,
'乌兹别克斯坦'
,
'委内瑞拉'
,
'越南'
,
'也门'
,
'南斯拉夫'
,
'津巴布韦'
,
'扎伊尔'
,
'赞比亚'
];
constant
.
countryCNList
=
[
'安哥拉'
,
'阿富汗'
,
'阿尔巴尼亚'
,
'阿尔及利亚'
,
'安道尔共和国'
,
'安圭拉岛'
,
'安提瓜和巴布达'
,
'阿根廷'
,
'亚美尼亚'
,
'阿森松'
,
'澳大利亚'
,
'奥地利'
,
'阿塞拜疆'
,
'巴哈马'
,
'巴林'
,
'孟加拉国'
,
'巴巴多斯'
,
'白俄罗斯'
,
'比利时'
,
'伯利兹'
,
'贝宁'
,
'百慕大群岛'
,
'玻利维亚'
,
'博茨瓦纳'
,
'巴西'
,
'文莱'
,
'保加利亚'
,
'布基纳法索'
,
'缅甸'
,
'布隆迪'
,
'喀麦隆'
,
'加拿大'
,
'开曼群岛'
,
'中非共和国'
,
'乍得'
,
'智利'
,
'中国'
,
'哥伦比亚'
,
'刚果'
,
'库克群岛'
,
'哥斯达黎加'
,
'古巴'
,
'塞浦路斯'
,
'捷克'
,
'丹麦'
,
'吉布提'
,
'多米尼加共和国'
,
'厄瓜多尔'
,
'埃及'
,
'萨尔瓦多'
,
'爱沙尼亚'
,
'埃塞俄比亚'
,
'斐济'
,
'芬兰'
,
'法国'
,
'法属圭亚那'
,
'法属玻利尼西亚'
,
'加蓬'
,
'冈比亚'
,
'格鲁吉亚'
,
'德国'
,
'加纳'
,
'直布罗陀'
,
'希腊'
,
'格林纳达'
,
'关岛'
,
'危地马拉'
,
'几内亚'
,
'圭亚那'
,
'海地'
,
'洪都拉斯'
,
'香港'
,
'匈牙利'
,
'冰岛'
,
'印度'
,
'印度尼西亚'
,
'伊朗'
,
'伊拉克'
,
'爱尔兰'
,
'以色列'
,
'意大利'
,
'科特迪瓦'
,
'牙买加'
,
'日本'
,
'约旦'
,
'柬埔寨'
,
'哈萨克斯坦'
,
'肯尼亚'
,
'韩国'
,
'科威特'
,
'吉尔吉斯坦'
,
'老挝'
,
'拉脱维亚'
,
'黎巴嫩'
,
'莱索托'
,
'利比里亚'
,
'利比亚'
,
'列支敦士登'
,
'立陶宛'
,
'卢森堡'
,
'澳门'
,
'马达加斯加'
,
'马拉维'
,
'马来西亚'
,
'马尔代夫'
,
'马里'
,
'马耳他'
,
'马里亚那群岛'
,
'马提尼克'
,
'毛里求斯'
,
'墨西哥'
,
'摩尔多瓦'
,
'摩纳哥'
,
'蒙古'
,
'蒙特塞拉特岛'
,
'摩洛哥'
,
'莫桑比克'
,
'纳米比亚'
,
'瑙鲁'
,
'尼泊尔'
,
'荷属安的列斯'
,
'荷兰'
,
'新西兰'
,
'尼加拉瓜'
,
'尼日尔'
,
'尼日利亚'
,
'朝鲜'
,
'挪威'
,
'阿曼'
,
'巴基斯坦'
,
'巴拿马'
,
'巴布亚新几内亚'
,
'巴拉圭'
,
'秘鲁'
,
'菲律宾'
,
'波兰'
,
'葡萄牙'
,
'波多黎各'
,
'卡塔尔'
,
'留尼旺'
,
'罗马尼亚'
,
'俄罗斯'
,
'圣卢西亚'
,
'圣文森特岛'
,
'东萨摩亚(美)'
,
'西萨摩亚'
,
'圣马力诺'
,
'圣多美和普林西比'
,
'沙特阿拉伯'
,
'塞内加尔'
,
'塞舌尔'
,
'塞拉利昂'
,
'新加坡'
,
'斯洛伐克'
,
'斯洛文尼亚'
,
'所罗门群岛'
,
'索马里'
,
'南非'
,
'西班牙'
,
'斯里兰卡'
,
'圣文森特'
,
'苏丹'
,
'苏里南'
,
'斯威士兰'
,
'瑞典'
,
'瑞士'
,
'叙利亚'
,
'台湾省'
,
'塔吉克斯坦'
,
'坦桑尼亚'
,
'泰国'
,
'多哥'
,
'汤加'
,
'特立尼达和多巴哥'
,
'突尼斯'
,
'土耳其'
,
'土库曼斯坦'
,
'乌干达'
,
'乌克兰'
,
'阿拉伯联合酋长国'
,
'英国'
,
'美国'
,
'乌拉圭'
,
'乌兹别克斯坦'
,
'委内瑞拉'
,
'越南'
,
'也门'
,
'南斯拉夫'
,
'津巴布韦'
,
'扎伊尔'
,
'赞比亚'
];
constant
.
countryENList
=
[
'Angola'
,
'Afghanistan'
,
'Albania'
,
'Algeria'
,
'Andorra'
,
'Anguilla'
,
'Antigua and Barbuda'
,
'Argentina'
,
'Armenia'
,
'Ascension'
,
'Australia'
,
'Austria'
,
'Azerbaijan'
,
'Bahamas'
,
'Bahrain'
,
'Bangladesh'
,
'Barbados'
,
'Belarus'
,
'Belgium'
,
'Belize'
,
'Benin'
,
'Bermuda Is'
,
'Bolivia'
,
'Botswana'
,
'Brazil'
,
'Brunei'
,
'Bulgaria'
,
'Burkina Faso'
,
'Burma'
,
'Burundi'
,
'Cameroon'
,
'Canada'
,
'Cayman Is'
,
'Central African Republic'
,
'Chad'
,
'Chile'
,
'China'
,
'Colombia'
,
'Congo'
,
'Cook Is'
,
'Costa Rica'
,
'Cuba'
,
'Cyprus'
,
'Czech Republic'
,
'Denmark'
,
'Djibouti'
,
'Dominica Rep'
,
'Ecuador'
,
'Egypt'
,
'EI Salvador'
,
'Estonia'
,
'Ethiopia'
,
'Fiji'
,
'Finland'
,
'France'
,
'French Guiana'
,
'French Polynesia'
,
'Gabon'
,
'Gambia'
,
'Georgia'
,
'Germany'
,
'Ghana'
,
'Gibraltar'
,
'Greece'
,
'Grenada'
,
'Guam'
,
'Guatemala'
,
'Guinea'
,
'Guyana'
,
'Haiti'
,
'Honduras'
,
'Hongkong'
,
'Hungary'
,
'Iceland'
,
'India'
,
'Indonesia'
,
'Iran'
,
'Iraq'
,
'Ireland'
,
'Israel'
,
'Italy'
,
'Ivory Coast'
,
'Jamaica'
,
'Japan'
,
'Jordan'
,
'Kampuchea (Cambodia )'
,
'Kazakstan'
,
'Kenya'
,
'Korea'
,
'Kuwait'
,
'Kyrgyzstan'
,
'Laos'
,
'Latvia'
,
'Lebanon'
,
'Lesotho'
,
'Liberia'
,
'Libya'
,
'Liechtenstein'
,
'Lithuania'
,
'Luxembourg'
,
'Macao'
,
'Madagascar'
,
'Malawi'
,
'Malaysia'
,
'Maldives'
,
'Mali'
,
'Malta'
,
'Mariana Is'
,
'Martinique'
,
'Mauritius'
,
'Mexico'
,
'Moldova'
,
'Monaco'
,
'Mongolia'
,
'Montserrat Is'
,
'Morocco'
,
'Mozambique'
,
'Namibia'
,
'Nauru'
,
'Nepal'
,
'Netheriands Antilles'
,
'Netherlands'
,
'New Zealand'
,
'Nicaragua'
,
'Niger'
,
'Nigeria'
,
'North Korea'
,
'Norway'
,
'Oman'
,
'Pakistan'
,
'Panama'
,
'Papua New Cuinea'
,
'Paraguay'
,
'Peru'
,
'Philippines'
,
'Poland'
,
'Portugal'
,
'Puerto Rico'
,
'Qatar'
,
'Reunion'
,
'Romania'
,
'Russia'
,
'Saint Lueia'
,
'Saint Vincent'
,
'Samoa Eastern'
,
'Samoa Western'
,
'San Marino'
,
'Sao Tome and Principe'
,
'Saudi Arabia'
,
'Senegal'
,
'Seychelles'
,
'Sierra Leone'
,
'Singapore'
,
'Slovakia'
,
'Slovenia'
,
'Solomon Is'
,
'Somali'
,
'South Africa'
,
'Spain'
,
'SriLanka'
,
'St.Lucia'
,
'St.Vincent'
,
'Sudan'
,
'Suriname'
,
'Swaziland'
,
'Sweden'
,
'Switzerland'
,
'Syria'
,
'Taiwan'
,
'Tajikstan'
,
'Tanzania'
,
'Thailand'
,
'Togo'
,
'Tonga'
,
'Trinidad and Tobago'
,
'Tunisia'
,
'Turkey'
,
'Turkmenistan'
,
'Uganda'
,
'Ukraine'
,
'United Arab Emirates'
,
'United Kiongdom'
,
'United States of America'
,
'Uruguay'
,
'Uzbekistan'
,
'Venezuela'
,
'Vietnam'
,
'Yemen'
,
'Yugoslavia'
,
'Zimbabwe'
,
'Zaire'
,
'Zambia'
];
...
...
atms-web/src/main/webapp/app/dataImport/data-extraction/extract-financial-data/extract-financial-data.ctrl.js
View file @
a1399503
...
...
@@ -105,7 +105,7 @@
};
//导入事件
var
callApi
=
function
()
{
var
call
Financial
Api
=
function
()
{
var
periodStr
=
$scope
.
UploadPeriodTime
;
dataImportService
.
callExtractFinancialData
(
$scope
.
checkedCompanyCodeList
,
periodStr
,
$scope
.
checkedFileCodeList
).
success
(
function
(
data
)
{
if
(
data
)
{
...
...
@@ -150,17 +150,24 @@
allowHeaderFiltering
:
false
,
width
:
'27%'
,
caption
:
$translate
.
instant
(
'CompanyName'
)
},
{
dataField
:
"fileType"
,
allowHeaderFiltering
:
false
,
width
:
'27%'
,
caption
:
$translate
.
instant
(
'ExtractFile'
)
},
{
dataField
:
"periodYear"
,
allowHeaderFiltering
:
false
,
width
:
'5%'
,
caption
:
$translate
.
instant
(
'YearPeriod'
)
},
{
},
/*{
dataField: "periodMonth",
allowHeaderFiltering: false,
width: '10%',
caption: $translate.instant('TMSPeriod')
},
{
}, */
{
dataField
:
"periodMonth"
,
allowHeaderFiltering
:
false
,
width
:
'5%'
,
...
...
@@ -389,7 +396,7 @@
};
var
initParam
=
function
()
{
$scope
.
call
Api
=
cal
lApi
;
$scope
.
call
FinancialApi
=
callFinancia
lApi
;
$scope
.
initPagingControl
=
initPagingControl
;
$scope
.
setButtonWrapStyle
=
setButtonWrapStyle
;
$scope
.
getGridHeight
=
getGridHeight
;
...
...
atms-web/src/main/webapp/app/dataImport/data-extraction/extract-financial-data/extract-financial-data.html
View file @
a1399503
...
...
@@ -67,7 +67,7 @@
<button
type=
"button"
atms-permission
permission-control-type=
"ngIf"
permission-code=
"{{$root.vatPermission.dataImport.balanceSheet.importCode}}"
class=
"btn btn-vat-primary"
style=
"float:right; margin-right: 10px;margin-left: 30px;margin-top: 8px;"
translate=
"ImportBtn"
ng-click=
"callApi()"
></button>
ng-click=
"call
Financial
Api()"
></button>
</div>
</div>
</form>
...
...
atms-web/src/main/webapp/app/dataImport/data-extraction/extract-financial-data/extract-financial-data.js
View file @
a1399503
...
...
@@ -8,7 +8,7 @@
serviceTypeId
:
"=?"
,
periodId
:
"=?"
},
controller
:
'extract
Invoice
DataController'
,
controller
:
'extract
Financial
DataController'
,
link
:
function
(
scope
,
element
)
{
$
(
'.main-contents'
)[
0
].
style
.
width
=
"260px"
;
$
(
'.data-import-contents'
)[
0
].
style
.
display
=
"block"
;
...
...
atms-web/src/main/webapp/app/dataImport/data-extraction/extract-invoice-data/extract-invoice-data.ctrl.js
View file @
a1399503
...
...
@@ -105,7 +105,7 @@
};
//导入事件
var
callApi
=
function
()
{
var
call
Invoice
Api
=
function
()
{
var
periodStr
=
$scope
.
UploadPeriodTime
;
dataImportService
.
callExtractInvoiceData
(
$scope
.
checkedCompanyCodeList
,
periodStr
,
$scope
.
checkedFileCodeList
).
success
(
function
(
data
)
{
...
...
@@ -389,7 +389,7 @@
};
var
initParam
=
function
()
{
$scope
.
call
Api
=
call
Api
;
$scope
.
call
InvoiceApi
=
callInvoice
Api
;
$scope
.
initPagingControl
=
initPagingControl
;
$scope
.
setButtonWrapStyle
=
setButtonWrapStyle
;
$scope
.
getGridHeight
=
getGridHeight
;
...
...
atms-web/src/main/webapp/app/dataImport/data-extraction/extract-invoice-data/extract-invoice-data.html
View file @
a1399503
...
...
@@ -67,7 +67,7 @@
<button
type=
"button"
atms-permission
permission-control-type=
"ngIf"
permission-code=
"{{$root.vatPermission.dataImport.balanceSheet.importCode}}"
class=
"btn btn-vat-primary"
style=
"float:right; margin-right: 10px;margin-left: 30px;margin-top: 8px;"
translate=
"ImportBtn"
ng-click=
"callApi()"
></button>
ng-click=
"call
Invoice
Api()"
></button>
</div>
</div>
</form>
...
...
atms-web/src/main/webapp/app/vat/preview/vat-preview-invoice-data/vat-preview-invoice-data.ctrl.js
View file @
a1399503
...
...
@@ -279,13 +279,9 @@
var
localDate
=
$filter
(
'date'
)(
new
Date
(),
'yyyyMMddHHmmss'
);
var
fileName
=
constant
.
exportExcelFileName
.
invoiceData
+
localDate
;
vatPreviewService
.
initExportIDData
(
$scope
.
queryParams
,
fileName
).
then
(
function
(
data
)
{
if
(
data
)
{
ackMessageBox
.
success
(
translate
(
'FileExportSuccess'
));
}
});
};
$scope
.
gridOptions
=
{
rowHeight
:
constant
.
UIGrid
.
rowHeight
,
selectionRowHeaderWidth
:
constant
.
UIGrid
.
rowHeight
,
...
...
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