Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc-java
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
dc-java
Commits
5f8828e0
Commit
5f8828e0
authored
Jul 16, 2019
by
yinyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增汇率、
parent
585de63e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
127 additions
and
22 deletions
+127
-22
AdvertAddTaskSyncJob.java
...src/main/java/com/bailuntec/job/AdvertAddTaskSyncJob.java
+6
-0
DcBaseFinanceAmazonMapper.xml
...n/java/com/bailuntec/mapper/DcBaseFinanceAmazonMapper.xml
+36
-11
job.properties
...ase-sync-finance-amazon/src/main/resources/job.properties
+11
-10
DcBaseFinanceAmazon.java
...java/com/bailuntec/domain/entity/DcBaseFinanceAmazon.java
+14
-1
DcBaseFinanceAmazonExample.java
.../bailuntec/domain/example/DcBaseFinanceAmazonExample.java
+60
-0
No files found.
data-base/base-sync-finance-amazon/src/main/java/com/bailuntec/job/AdvertAddTaskSyncJob.java
View file @
5f8828e0
...
...
@@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON;
import
com.bailuntec.domain.AccountTokenInfo
;
import
com.bailuntec.domain.entity.DcBaseFinanceAmazon
;
import
com.bailuntec.domain.entity.JobPointLog
;
import
com.bailuntec.domain.enumerate.CurrencyType
;
import
com.bailuntec.mapper.DcBaseFinanceAmazonMapper
;
import
com.bailuntec.support.CallBailunSystem
;
import
com.bailuntec.support.PointJob
;
import
com.bailuntec.utils.OkHttpUtil
;
import
com.bailuntec.utils.PropertiesUtil
;
...
...
@@ -119,6 +121,10 @@ public class AdvertAddTaskSyncJob extends PointJob {
amazonAdvert
.
setAccountId
((
Integer
)
map0
.
get
(
"Id"
));
amazonAdvert
.
setCompanyId
((
Integer
)
map0
.
get
(
"UserId"
));
amazonAdvert
.
setReportDate
(
localDateTime
.
toLocalDate
());
if
(
amazonAdvert
.
getCurrency
()
!=
null
)
{
BigDecimal
exchangeRate
=
CallBailunSystem
.
getExchangeRate
(
amazonAdvert
.
getCurrency
(),
CurrencyType
.
CNY
.
value
(),
localDateTime
);
amazonAdvert
.
setOtherToCnyExchangeRate
(
exchangeRate
);
}
// amazonAdvert.setReportType(reportType);
try
{
DcBaseFinanceAmazonMapper
dcBaseFinanceAmazonMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseFinanceAmazonMapper
.
class
);
...
...
data-base/base-sync-finance-amazon/src/main/java/com/bailuntec/mapper/DcBaseFinanceAmazonMapper.xml
View file @
5f8828e0
...
...
@@ -52,6 +52,7 @@
<result
column=
"ad_group_id"
jdbcType=
"VARCHAR"
property=
"adGroupId"
/>
<result
column=
"asin"
jdbcType=
"VARCHAR"
property=
"asin"
/>
<result
column=
"sku"
jdbcType=
"VARCHAR"
property=
"sku"
/>
<result
column=
"other_to_cny_exchange_rate"
jdbcType=
"DECIMAL"
property=
"otherToCnyExchangeRate"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
...
...
@@ -135,7 +136,7 @@
attributed_sales_oneday_same_sku, attributed_sales_sevenday_same_sku, attributed_sales_fourteenday_same_sku,
attributed_sales_thirtyday_same_sku, attributed_units_ordered_oneday_same_sku, attributed_units_ordered_sevenday_same_sku,
attributed_units_ordered_fourteenday_same_sku, attributed_units_ordered_thirtyday_same_sku,
ad_group_id, asin, sku
ad_group_id, asin, sku
, other_to_cny_exchange_rate
</sql>
<select
id=
"selectByExample"
parameterType=
"com.bailuntec.domain.example.DcBaseFinanceAmazonExample"
resultMap=
"BaseResultMap"
>
<!--
...
...
@@ -214,8 +215,8 @@
attributed_sales_fourteenday_same_sku, attributed_sales_thirtyday_same_sku,
attributed_units_ordered_oneday_same_sku, attributed_units_ordered_sevenday_same_sku,
attributed_units_ordered_fourteenday_same_sku, attributed_units_ordered_thirtyday_same_sku,
ad_group_id, asin, sku
)
ad_group_id, asin, sku
,
other_to_cny_exchange_rate
)
values (#{id,jdbcType=INTEGER}, #{campaignName,jdbcType=VARCHAR}, #{campaignId,jdbcType=VARCHAR},
#{campaignStatus,jdbcType=VARCHAR}, #{campaignBudget,jdbcType=DECIMAL}, #{attributedConversionsOneday,jdbcType=INTEGER},
#{attributedUnitsOrderedOneday,jdbcType=INTEGER}, #{attributedSalesOneday,jdbcType=INTEGER},
...
...
@@ -234,8 +235,8 @@
#{attributedSalesFourteendaySameSku,jdbcType=VARCHAR}, #{attributedSalesThirtydaySameSku,jdbcType=VARCHAR},
#{attributedUnitsOrderedOnedaySameSku,jdbcType=VARCHAR}, #{attributedUnitsOrderedSevendaySameSku,jdbcType=VARCHAR},
#{attributedUnitsOrderedFourteendaySameSku,jdbcType=VARCHAR}, #{attributedUnitsOrderedThirtydaySameSku,jdbcType=VARCHAR},
#{adGroupId,jdbcType=VARCHAR}, #{asin,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR}
)
#{adGroupId,jdbcType=VARCHAR}, #{asin,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR}
,
#{otherToCnyExchangeRate,jdbcType=DECIMAL}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.bailuntec.domain.entity.DcBaseFinanceAmazon"
>
<!--
...
...
@@ -382,6 +383,9 @@
<if
test=
"sku != null"
>
sku,
</if>
<if
test=
"otherToCnyExchangeRate != null"
>
other_to_cny_exchange_rate,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
...
...
@@ -522,6 +526,9 @@
<if
test=
"sku != null"
>
#{sku,jdbcType=VARCHAR},
</if>
<if
test=
"otherToCnyExchangeRate != null"
>
#{otherToCnyExchangeRate,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.bailuntec.domain.example.DcBaseFinanceAmazonExample"
resultType=
"java.lang.Long"
>
...
...
@@ -679,6 +686,9 @@
<if
test=
"record.sku != null"
>
sku = #{record.sku,jdbcType=VARCHAR},
</if>
<if
test=
"record.otherToCnyExchangeRate != null"
>
other_to_cny_exchange_rate = #{record.otherToCnyExchangeRate,jdbcType=DECIMAL},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -735,7 +745,8 @@
attributed_units_ordered_thirtyday_same_sku = #{record.attributedUnitsOrderedThirtydaySameSku,jdbcType=VARCHAR},
ad_group_id = #{record.adGroupId,jdbcType=VARCHAR},
asin = #{record.asin,jdbcType=VARCHAR},
sku = #{record.sku,jdbcType=VARCHAR}
sku = #{record.sku,jdbcType=VARCHAR},
other_to_cny_exchange_rate = #{record.otherToCnyExchangeRate,jdbcType=DECIMAL}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -882,6 +893,9 @@
<if
test=
"sku != null"
>
sku = #{sku,jdbcType=VARCHAR},
</if>
<if
test=
"otherToCnyExchangeRate != null"
>
other_to_cny_exchange_rate = #{otherToCnyExchangeRate,jdbcType=DECIMAL},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
...
...
@@ -935,7 +949,8 @@
attributed_units_ordered_thirtyday_same_sku = #{attributedUnitsOrderedThirtydaySameSku,jdbcType=VARCHAR},
ad_group_id = #{adGroupId,jdbcType=VARCHAR},
asin = #{asin,jdbcType=VARCHAR},
sku = #{sku,jdbcType=VARCHAR}
sku = #{sku,jdbcType=VARCHAR},
other_to_cny_exchange_rate = #{otherToCnyExchangeRate,jdbcType=DECIMAL}
where id = #{id,jdbcType=INTEGER}
</update>
<insert
id=
"upsertSelective"
parameterType=
"com.bailuntec.domain.entity.DcBaseFinanceAmazon"
>
...
...
@@ -1084,6 +1099,9 @@
<if
test=
"sku != null"
>
sku,
</if>
<if
test=
"otherToCnyExchangeRate != null"
>
other_to_cny_exchange_rate,
</if>
</trim>
values
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -1225,6 +1243,9 @@
<if
test=
"sku != null"
>
#{sku,jdbcType=VARCHAR},
</if>
<if
test=
"otherToCnyExchangeRate != null"
>
#{otherToCnyExchangeRate,jdbcType=DECIMAL},
</if>
</trim>
on duplicate key update
<trim
suffixOverrides=
","
>
...
...
@@ -1366,6 +1387,9 @@
<if
test=
"sku != null"
>
sku = #{sku,jdbcType=VARCHAR},
</if>
<if
test=
"otherToCnyExchangeRate != null"
>
other_to_cny_exchange_rate = #{otherToCnyExchangeRate,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<insert
id=
"upsert"
parameterType=
"com.bailuntec.domain.entity.DcBaseFinanceAmazon"
>
...
...
@@ -1387,7 +1411,7 @@
attributed_sales_sevenday_same_sku, attributed_sales_fourteenday_same_sku, attributed_sales_thirtyday_same_sku,
attributed_units_ordered_oneday_same_sku, attributed_units_ordered_sevenday_same_sku,
attributed_units_ordered_fourteenday_same_sku, attributed_units_ordered_thirtyday_same_sku,
ad_group_id, asin, sku)
ad_group_id, asin, sku
, other_to_cny_exchange_rate
)
values
(#{id,jdbcType=INTEGER}, #{campaignName,jdbcType=VARCHAR}, #{campaignId,jdbcType=VARCHAR},
#{campaignStatus,jdbcType=VARCHAR}, #{campaignBudget,jdbcType=DECIMAL}, #{attributedConversionsOneday,jdbcType=INTEGER},
...
...
@@ -1407,8 +1431,8 @@
#{attributedSalesFourteendaySameSku,jdbcType=VARCHAR}, #{attributedSalesThirtydaySameSku,jdbcType=VARCHAR},
#{attributedUnitsOrderedOnedaySameSku,jdbcType=VARCHAR}, #{attributedUnitsOrderedSevendaySameSku,jdbcType=VARCHAR},
#{attributedUnitsOrderedFourteendaySameSku,jdbcType=VARCHAR}, #{attributedUnitsOrderedThirtydaySameSku,jdbcType=VARCHAR},
#{adGroupId,jdbcType=VARCHAR}, #{asin,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR}
)
#{adGroupId,jdbcType=VARCHAR}, #{asin,jdbcType=VARCHAR}, #{sku,jdbcType=VARCHAR}
,
#{otherToCnyExchangeRate,jdbcType=DECIMAL}
)
on duplicate key update
id = #{id,jdbcType=INTEGER},
campaign_name = #{campaignName,jdbcType=VARCHAR},
...
...
@@ -1455,7 +1479,8 @@
attributed_units_ordered_thirtyday_same_sku = #{attributedUnitsOrderedThirtydaySameSku,jdbcType=VARCHAR},
ad_group_id = #{adGroupId,jdbcType=VARCHAR},
asin = #{asin,jdbcType=VARCHAR},
sku = #{sku,jdbcType=VARCHAR}
sku = #{sku,jdbcType=VARCHAR},
other_to_cny_exchange_rate = #{otherToCnyExchangeRate,jdbcType=DECIMAL}
</insert>
<select
id=
"selectOneByExample"
parameterType=
"com.bailuntec.domain.example.DcBaseFinanceAmazonExample"
resultMap=
"BaseResultMap"
>
<!--
...
...
data-base/base-sync-finance-amazon/src/main/resources/job.properties
View file @
5f8828e0
#EVENT_RDB_STORAGE_DRIVER=com.mysql.jdbc.Driver
#EVENT_RDB_STORAGE_URL=jdbc:mysql://127.0.0.1:3306/bailun_datacenter?useUnicode=true&characterEncoding=UTF-8&serverTimeZone=GMT&useSSL=false&allowPublicKeyRetrieval=true&allowMultiQueries=true
#EVENT_RDB_STORAGE_USERNAME=root
#EVENT_RDB_STORAGE_PASSWORD=root
#ZOOKEEPER_SERVER=94.191.111.219:2181
EVENT_RDB_STORAGE_DRIVER
=
com.mysql.jdbc.Driver
EVENT_RDB_STORAGE_URL
=
jdbc:mysql://1
0.0.8.15:3306/bailun_datacenter?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
EVENT_RDB_STORAGE_URL
=
jdbc:mysql://1
27.0.0.1:3306/bailun_datacenter?useUnicode=true&characterEncoding=UTF-8&serverTimeZone=GMT&useSSL=false&allowPublicKeyRetrieval=true&allowMultiQueries=true
EVENT_RDB_STORAGE_USERNAME
=
root
EVENT_RDB_STORAGE_PASSWORD
=
#7kfnymAM$Y9-Ntf
ZOOKEEPER_SERVER=172.31.255.120:2181
EVENT_RDB_STORAGE_PASSWORD
=
root
ZOOKEEPER_SERVER
=
94.191.111.219:2181
#EVENT_RDB_STORAGE_DRIVER=com.mysql.jdbc.Driver
#EVENT_RDB_STORAGE_URL=jdbc:mysql://10.0.8.15:3306/bailun_datacenter?useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
#EVENT_RDB_STORAGE_USERNAME=root
#EVENT_RDB_STORAGE_PASSWORD=#7kfnymAM$Y9-Ntf
#ZOOKEEPER_SERVER=172.31.255.120:2181
NAME_SPACE
=
data-center
JOB_NAME_ADDTASK
=
base-sync-finance-amazon-ad
dtask
JOB_CRON_ADDTASK
=
0
0 9 *
* ? *
JOB_NAME_ADDTASK
=
base-sync-finance-amazon-ad
vert
JOB_CRON_ADDTASK
=
0
17 11 16
* ? *
JOB_NAME_GETRESULT
=
base-sync-finance-amazon-getresult
JOB_CRON_GETRESULT
=
0 0 6,23 * * ? *
SHARDING_TOTAL_COUNT
=
1
\ No newline at end of file
data-common/src/main/java/com/bailuntec/domain/entity/DcBaseFinanceAmazon.java
View file @
5f8828e0
...
...
@@ -448,6 +448,15 @@ public class DcBaseFinanceAmazon {
private
String
sku
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_finance_amazon.other_to_cny_exchange_rate
*
* @mbg.generated
*/
private
BigDecimal
otherToCnyExchangeRate
;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_finance_amazon
*
...
...
@@ -505,6 +514,7 @@ public class DcBaseFinanceAmazon {
sb
.
append
(
", adGroupId="
).
append
(
adGroupId
);
sb
.
append
(
", asin="
).
append
(
asin
);
sb
.
append
(
", sku="
).
append
(
sku
);
sb
.
append
(
", otherToCnyExchangeRate="
).
append
(
otherToCnyExchangeRate
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
...
...
@@ -572,7 +582,8 @@ public class DcBaseFinanceAmazon {
&&
(
this
.
getAttributedUnitsOrderedThirtydaySameSku
()
==
null
?
other
.
getAttributedUnitsOrderedThirtydaySameSku
()
==
null
:
this
.
getAttributedUnitsOrderedThirtydaySameSku
().
equals
(
other
.
getAttributedUnitsOrderedThirtydaySameSku
()))
&&
(
this
.
getAdGroupId
()
==
null
?
other
.
getAdGroupId
()
==
null
:
this
.
getAdGroupId
().
equals
(
other
.
getAdGroupId
()))
&&
(
this
.
getAsin
()
==
null
?
other
.
getAsin
()
==
null
:
this
.
getAsin
().
equals
(
other
.
getAsin
()))
&&
(
this
.
getSku
()
==
null
?
other
.
getSku
()
==
null
:
this
.
getSku
().
equals
(
other
.
getSku
()));
&&
(
this
.
getSku
()
==
null
?
other
.
getSku
()
==
null
:
this
.
getSku
().
equals
(
other
.
getSku
()))
&&
(
this
.
getOtherToCnyExchangeRate
()
==
null
?
other
.
getOtherToCnyExchangeRate
()
==
null
:
this
.
getOtherToCnyExchangeRate
().
equals
(
other
.
getOtherToCnyExchangeRate
()));
}
/**
...
...
@@ -631,6 +642,7 @@ public class DcBaseFinanceAmazon {
result
=
prime
*
result
+
((
getAdGroupId
()
==
null
)
?
0
:
getAdGroupId
().
hashCode
());
result
=
prime
*
result
+
((
getAsin
()
==
null
)
?
0
:
getAsin
().
hashCode
());
result
=
prime
*
result
+
((
getSku
()
==
null
)
?
0
:
getSku
().
hashCode
());
result
=
prime
*
result
+
((
getOtherToCnyExchangeRate
()
==
null
)
?
0
:
getOtherToCnyExchangeRate
().
hashCode
());
return
result
;
}
}
\ No newline at end of file
data-common/src/main/java/com/bailuntec/domain/example/DcBaseFinanceAmazonExample.java
View file @
5f8828e0
...
...
@@ -3381,6 +3381,66 @@ public class DcBaseFinanceAmazonExample {
addCriterion
(
"sku not between"
,
value1
,
value2
,
"sku"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOtherToCnyExchangeRateIsNull
()
{
addCriterion
(
"other_to_cny_exchange_rate is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOtherToCnyExchangeRateIsNotNull
()
{
addCriterion
(
"other_to_cny_exchange_rate is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOtherToCnyExchangeRateEqualTo
(
BigDecimal
value
)
{
addCriterion
(
"other_to_cny_exchange_rate ="
,
value
,
"otherToCnyExchangeRate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOtherToCnyExchangeRateNotEqualTo
(
BigDecimal
value
)
{
addCriterion
(
"other_to_cny_exchange_rate <>"
,
value
,
"otherToCnyExchangeRate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOtherToCnyExchangeRateGreaterThan
(
BigDecimal
value
)
{
addCriterion
(
"other_to_cny_exchange_rate >"
,
value
,
"otherToCnyExchangeRate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOtherToCnyExchangeRateGreaterThanOrEqualTo
(
BigDecimal
value
)
{
addCriterion
(
"other_to_cny_exchange_rate >="
,
value
,
"otherToCnyExchangeRate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOtherToCnyExchangeRateLessThan
(
BigDecimal
value
)
{
addCriterion
(
"other_to_cny_exchange_rate <"
,
value
,
"otherToCnyExchangeRate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOtherToCnyExchangeRateLessThanOrEqualTo
(
BigDecimal
value
)
{
addCriterion
(
"other_to_cny_exchange_rate <="
,
value
,
"otherToCnyExchangeRate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOtherToCnyExchangeRateIn
(
List
<
BigDecimal
>
values
)
{
addCriterion
(
"other_to_cny_exchange_rate in"
,
values
,
"otherToCnyExchangeRate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOtherToCnyExchangeRateNotIn
(
List
<
BigDecimal
>
values
)
{
addCriterion
(
"other_to_cny_exchange_rate not in"
,
values
,
"otherToCnyExchangeRate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOtherToCnyExchangeRateBetween
(
BigDecimal
value1
,
BigDecimal
value2
)
{
addCriterion
(
"other_to_cny_exchange_rate between"
,
value1
,
value2
,
"otherToCnyExchangeRate"
);
return
(
Criteria
)
this
;
}
public
Criteria
andOtherToCnyExchangeRateNotBetween
(
BigDecimal
value1
,
BigDecimal
value2
)
{
addCriterion
(
"other_to_cny_exchange_rate not between"
,
value1
,
value2
,
"otherToCnyExchangeRate"
);
return
(
Criteria
)
this
;
}
}
/**
...
...
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