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
4c02c4a2
Commit
4c02c4a2
authored
Mar 05, 2019
by
kevin
Browse files
Options
Browse Files
Download
Plain Diff
$
parents
fbeb6d31
7b8df0b0
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
162 additions
and
14 deletions
+162
-14
EbsApiController.java
...in/java/pwc/taxtech/atms/controller/EbsApiController.java
+2
-2
OrganizationAccountingRateDto.java
.../atms/dto/organization/OrganizationAccountingRateDto.java
+19
-0
EbsApiService.java
...src/main/java/pwc/taxtech/atms/service/EbsApiService.java
+1
-1
EbsApiServiceImpl.java
...java/pwc/taxtech/atms/service/impl/EbsApiServiceImpl.java
+19
-1
EbsApiServiceImplTest.java
.../pwc/taxtech/atms/service/impl/EbsApiServiceImplTest.java
+1
-1
OrganizationAccountingRate.java
...a/pwc/taxtech/atms/entity/OrganizationAccountingRate.java
+36
-0
OrganizationAccountingRateExample.java
...axtech/atms/entity/OrganizationAccountingRateExample.java
+60
-0
OrganizationAccountingRateMapper.xml
...pwc/taxtech/atms/dao/OrganizationAccountingRateMapper.xml
+24
-9
No files found.
atms-api/src/main/java/pwc/taxtech/atms/controller/EbsApiController.java
View file @
4c02c4a2
...
...
@@ -142,13 +142,13 @@ public class EbsApiController {
return
ApiResultDto
.
fail
();
}
@RequestMapping
(
value
=
"/updateOrg"
,
method
=
RequestMethod
.
POST
)
public
ApiResultDto
updateOrg
(
@RequestBody
@Valid
List
<
OrganizationQueryDto
>
items
)
{
public
ApiResultDto
updateOrg
(
@Request
Param
(
"id"
)
Long
id
,
@Request
Body
@Valid
List
<
OrganizationQueryDto
>
items
)
{
if
(
CollectionUtils
.
isEmpty
(
items
))
{
logger
.
debug
(
"the updateOrg return items is empty"
);
return
ApiResultDto
.
success
(
Collections
.
emptyList
());
}
try
{
ebsApiService
.
queryRemoteServerThenUpdateOrg
(
items
);
ebsApiService
.
queryRemoteServerThenUpdateOrg
(
i
d
,
i
tems
);
return
ApiResultDto
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"updateOrg error."
,
e
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/dto/organization/OrganizationAccountingRateDto.java
View file @
4c02c4a2
...
...
@@ -125,6 +125,17 @@ public class OrganizationAccountingRateDto implements Serializable {
*/
private
Float
rate
;
/**
* Database Column Remarks:
* 数据日期
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.date
*
* @mbg.generated
*/
private
Date
date
;
/**
* Database Column Remarks:
* 创建时间
...
...
@@ -443,6 +454,14 @@ public class OrganizationAccountingRateDto implements Serializable {
this
.
updateTime
=
updateTime
;
}
public
Date
getDate
()
{
return
date
;
}
public
void
setDate
(
Date
date
)
{
this
.
date
=
date
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table organization_accounting_rate
...
...
atms-api/src/main/java/pwc/taxtech/atms/service/EbsApiService.java
View file @
4c02c4a2
...
...
@@ -67,5 +67,5 @@ public interface EbsApiService {
*
* @param items
*/
void
queryRemoteServerThenUpdateOrg
(
List
<
OrganizationQueryDto
>
items
);
void
queryRemoteServerThenUpdateOrg
(
L
ong
id
,
L
ist
<
OrganizationQueryDto
>
items
);
}
atms-api/src/main/java/pwc/taxtech/atms/service/impl/EbsApiServiceImpl.java
View file @
4c02c4a2
...
...
@@ -48,6 +48,8 @@ public class EbsApiServiceImpl implements EbsApiService {
private
OrganizationEmployeeMapper
organizationEmployeeMapper
;
@Resource
private
OrganizationExtraMapper
organizationExtraMapper
;
@Resource
private
DataImportLogMapper
dataImportLogMapper
;
@Resource
private
DistributedIdService
distributedIdService
;
...
...
@@ -698,7 +700,7 @@ public class EbsApiServiceImpl implements EbsApiService {
result
.
setUpdateTime
(
new
Date
());
}
@Override
public
void
queryRemoteServerThenUpdateOrg
(
List
<
OrganizationQueryDto
>
items
)
{
public
void
queryRemoteServerThenUpdateOrg
(
L
ong
id
,
L
ist
<
OrganizationQueryDto
>
items
)
{
long
start
=
System
.
currentTimeMillis
();
logger
.
debug
(
"start queryRemoteServerThenUpdateOrg 机构表"
);
//判断数据是否存在
...
...
@@ -714,6 +716,7 @@ public class EbsApiServiceImpl implements EbsApiService {
logger
.
error
(
"break loop as catch:"
+
e
,
e
);
}
}
updateDataImportLog
(
id
,
items
.
size
());
logger
.
debug
(
"end queryRemoteServerThenUpdateOrg 机构表,took [{}] ms"
,
System
.
currentTimeMillis
()
-
start
);
}
...
...
@@ -766,6 +769,21 @@ public class EbsApiServiceImpl implements EbsApiService {
oe
.
setEmployeesNumEnd
(
a
.
getStaffSize
());
organizationEmployeeMapper
.
insertSelective
(
oe
);
}
private
void
updateDataImportLog
(
Long
id
,
int
size
)
{
DataImportLog
dataImportLog
=
new
DataImportLog
();
dataImportLog
.
setId
(
id
);
dataImportLog
.
setRecordSize
(
size
);
dataImportLog
.
setImportResult
(
true
);
int
res
=
dataImportLogMapper
.
updateByPrimaryKeySelective
(
dataImportLog
);
if
(
res
<
0
)
{
logger
.
warn
(
String
.
format
(
"无调用记录[%s]"
,
id
));
}
}
/**
* 获取格式化时间
* 返回时间类型 yyyy-MM-dd HH:mm:ss
...
...
atms-api/src/test/java/pwc/taxtech/atms/service/impl/EbsApiServiceImplTest.java
View file @
4c02c4a2
package
pwc
.
taxtech
.
atms
.
service
.
impl
;
import
com.alibaba.fastjson.JSON
;
import
com.google.common.collect.Lists
;
import
org.junit.Test
;
import
pwc.taxtech.atms.CommonIT
;
import
pwc.taxtech.atms.dto.ebsdto.*
;
...
...
@@ -9,7 +10,6 @@ import pwc.taxtech.atms.service.EbsApiService;
import
javax.annotation.Resource
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
public
class
EbsApiServiceImplTest
extends
CommonIT
{
...
...
atms-dao/src/main/java/pwc/taxtech/atms/entity/OrganizationAccountingRate.java
View file @
4c02c4a2
...
...
@@ -44,6 +44,17 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
*/
private
Integer
period
;
/**
* Database Column Remarks:
* 数据日期
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column organization_accounting_rate.date
*
* @mbg.generated
*/
private
Date
date
;
/**
* Database Column Remarks:
* 来源
...
...
@@ -223,6 +234,30 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
this
.
period
=
period
;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.date
*
* @return the value of organization_accounting_rate.date
*
* @mbg.generated
*/
public
Date
getDate
()
{
return
date
;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column organization_accounting_rate.date
*
* @param date the value for organization_accounting_rate.date
*
* @mbg.generated
*/
public
void
setDate
(
Date
date
)
{
this
.
date
=
date
;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column organization_accounting_rate.source
...
...
@@ -454,6 +489,7 @@ public class OrganizationAccountingRate extends BaseEntity implements Serializab
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", organizationId="
).
append
(
organizationId
);
sb
.
append
(
", period="
).
append
(
period
);
sb
.
append
(
", date="
).
append
(
date
);
sb
.
append
(
", source="
).
append
(
source
);
sb
.
append
(
", convertionType="
).
append
(
convertionType
);
sb
.
append
(
", currencyFrom="
).
append
(
currencyFrom
);
...
...
atms-dao/src/main/java/pwc/taxtech/atms/entity/OrganizationAccountingRateExample.java
View file @
4c02c4a2
...
...
@@ -385,6 +385,66 @@ public class OrganizationAccountingRateExample {
return
(
Criteria
)
this
;
}
public
Criteria
andDateIsNull
()
{
addCriterion
(
"date is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDateIsNotNull
()
{
addCriterion
(
"date is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDateEqualTo
(
Date
value
)
{
addCriterion
(
"date ="
,
value
,
"date"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDateNotEqualTo
(
Date
value
)
{
addCriterion
(
"date <>"
,
value
,
"date"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDateGreaterThan
(
Date
value
)
{
addCriterion
(
"date >"
,
value
,
"date"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDateGreaterThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"date >="
,
value
,
"date"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDateLessThan
(
Date
value
)
{
addCriterion
(
"date <"
,
value
,
"date"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDateLessThanOrEqualTo
(
Date
value
)
{
addCriterion
(
"date <="
,
value
,
"date"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDateIn
(
List
<
Date
>
values
)
{
addCriterion
(
"date in"
,
values
,
"date"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDateNotIn
(
List
<
Date
>
values
)
{
addCriterion
(
"date not in"
,
values
,
"date"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDateBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"date between"
,
value1
,
value2
,
"date"
);
return
(
Criteria
)
this
;
}
public
Criteria
andDateNotBetween
(
Date
value1
,
Date
value2
)
{
addCriterion
(
"date not between"
,
value1
,
value2
,
"date"
);
return
(
Criteria
)
this
;
}
public
Criteria
andSourceIsNull
()
{
addCriterion
(
"source is null"
);
return
(
Criteria
)
this
;
...
...
atms-dao/src/main/resources/pwc/taxtech/atms/dao/OrganizationAccountingRateMapper.xml
View file @
4c02c4a2
...
...
@@ -9,6 +9,7 @@
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"organization_id"
jdbcType=
"VARCHAR"
property=
"organizationId"
/>
<result
column=
"period"
jdbcType=
"INTEGER"
property=
"period"
/>
<result
column=
"date"
jdbcType=
"TIMESTAMP"
property=
"date"
/>
<result
column=
"source"
jdbcType=
"VARCHAR"
property=
"source"
/>
<result
column=
"convertion_type"
jdbcType=
"VARCHAR"
property=
"convertionType"
/>
<result
column=
"currency_from"
jdbcType=
"VARCHAR"
property=
"currencyFrom"
/>
...
...
@@ -90,7 +91,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, organization_id, period, source, convertion_type, currency_from, currency_to,
id, organization_id, period,
date,
source, convertion_type, currency_from, currency_to,
start_date, end_date, rate, create_time, update_time
</sql>
<select
id=
"selectByExample"
parameterType=
"pwc.taxtech.atms.entity.OrganizationAccountingRateExample"
resultMap=
"BaseResultMap"
>
...
...
@@ -145,15 +146,15 @@
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into organization_accounting_rate (id, organization_id, period,
source, convertion_type, currency_from
,
currency_
to, start_date, end
_date,
rate, create_time, update_time
)
date, source, convertion_type
,
currency_
from, currency_to, start
_date,
end_date, rate, create_time,
update_time
)
values (#{id,jdbcType=BIGINT}, #{organizationId,jdbcType=VARCHAR}, #{period,jdbcType=INTEGER},
#{
source,jdbcType=VARCHAR}, #{convertionType,jdbcType=VARCHAR}, #{currencyFrom
,jdbcType=VARCHAR},
#{currency
To,jdbcType=VARCHAR}, #{startDate,jdbcType=TIMESTAMP}, #{end
Date,jdbcType=TIMESTAMP},
#{
rate,jdbcType=REAL}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
#{
date,jdbcType=TIMESTAMP}, #{source,jdbcType=VARCHAR}, #{convertionType
,jdbcType=VARCHAR},
#{currency
From,jdbcType=VARCHAR}, #{currencyTo,jdbcType=VARCHAR}, #{start
Date,jdbcType=TIMESTAMP},
#{
endDate,jdbcType=TIMESTAMP}, #{rate,jdbcType=REAL}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"pwc.taxtech.atms.entity.OrganizationAccountingRate"
>
<!--
...
...
@@ -171,6 +172,9 @@
<if
test=
"period != null"
>
period,
</if>
<if
test=
"date != null"
>
date,
</if>
<if
test=
"source != null"
>
source,
</if>
...
...
@@ -209,6 +213,9 @@
<if
test=
"period != null"
>
#{period,jdbcType=INTEGER},
</if>
<if
test=
"date != null"
>
#{date,jdbcType=TIMESTAMP},
</if>
<if
test=
"source != null"
>
#{source,jdbcType=VARCHAR},
</if>
...
...
@@ -264,6 +271,9 @@
<if
test=
"record.period != null"
>
period = #{record.period,jdbcType=INTEGER},
</if>
<if
test=
"record.date != null"
>
date = #{record.date,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.source != null"
>
source = #{record.source,jdbcType=VARCHAR},
</if>
...
...
@@ -305,6 +315,7 @@
set id = #{record.id,jdbcType=BIGINT},
organization_id = #{record.organizationId,jdbcType=VARCHAR},
period = #{record.period,jdbcType=INTEGER},
date = #{record.date,jdbcType=TIMESTAMP},
source = #{record.source,jdbcType=VARCHAR},
convertion_type = #{record.convertionType,jdbcType=VARCHAR},
currency_from = #{record.currencyFrom,jdbcType=VARCHAR},
...
...
@@ -331,6 +342,9 @@
<if
test=
"period != null"
>
period = #{period,jdbcType=INTEGER},
</if>
<if
test=
"date != null"
>
date = #{date,jdbcType=TIMESTAMP},
</if>
<if
test=
"source != null"
>
source = #{source,jdbcType=VARCHAR},
</if>
...
...
@@ -369,6 +383,7 @@
update organization_accounting_rate
set organization_id = #{organizationId,jdbcType=VARCHAR},
period = #{period,jdbcType=INTEGER},
date = #{date,jdbcType=TIMESTAMP},
source = #{source,jdbcType=VARCHAR},
convertion_type = #{convertionType,jdbcType=VARCHAR},
currency_from = #{currencyFrom,jdbcType=VARCHAR},
...
...
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