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
huluobin
dc-java
Commits
df59f15e
Commit
df59f15e
authored
Apr 14, 2020
by
yinyong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ebay费用item映射百伦sku,修改数据拆分逻辑
parent
6a86ae03
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
485 additions
and
2 deletions
+485
-2
DcBaseEbaySkuMapping.java
...ava/com/bailuntec/domain/entity/DcBaseEbaySkuMapping.java
+146
-0
DcBaseEbaySkuMappingExample.java
...bailuntec/domain/example/DcBaseEbaySkuMappingExample.java
+0
-0
DcBaseEbaySkuMappingMapper.java
...java/com/bailuntec/mapper/DcBaseEbaySkuMappingMapper.java
+125
-0
DcBaseEbaySkuMappingMapper.xml
.../java/com/bailuntec/mapper/DcBaseEbaySkuMappingMapper.xml
+0
-0
DcBaseFinanceEbayMapper.java
...in/java/com/bailuntec/mapper/DcBaseFinanceEbayMapper.java
+17
-0
DcBaseFinanceEbayMapper.xml
...ain/java/com/bailuntec/mapper/DcBaseFinanceEbayMapper.xml
+58
-2
Application.java
...lculate-item/src/main/java/com/bailuntec/Application.java
+9
-0
EbaySkuMappingRoot.java
...ava/com/bailuntec/domain/constant/EbaySkuMappingRoot.java
+18
-0
CalculateEbayItemJob.java
...src/main/java/com/bailuntec/job/CalculateEbayItemJob.java
+0
-0
EbayItemSyncJob.java
...item/src/main/java/com/bailuntec/job/EbayItemSyncJob.java
+106
-0
const.properties
...id/mid-calculate-item/src/main/resources/const.properties
+3
-0
job.properties
...-mid/mid-calculate-item/src/main/resources/job.properties
+3
-0
No files found.
data-common/src/main/java/com/bailuntec/domain/entity/DcBaseEbaySkuMapping.java
0 → 100644
View file @
df59f15e
package
com
.
bailuntec
.
domain
.
entity
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
@Data
public
class
DcBaseEbaySkuMapping
{
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_ebay_sku_mapping.id
*
* @mbg.generated
*/
private
Integer
id
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_ebay_sku_mapping.item_id
*
* @mbg.generated
*/
private
String
itemId
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_ebay_sku_mapping.sku_code
*
* @mbg.generated
*/
private
String
skuCode
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_ebay_sku_mapping.platform_code
*
* @mbg.generated
*/
private
String
platformCode
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_ebay_sku_mapping.has_publish
*
* @mbg.generated
*/
private
Integer
hasPublish
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_ebay_sku_mapping.gmt_create
*
* @mbg.generated
*/
private
LocalDateTime
gmtCreate
;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column dc_base_ebay_sku_mapping.gmt_modify
*
* @mbg.generated
*/
private
LocalDateTime
gmtModify
;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
private
BigDecimal
skuPrice
;
@Override
public
String
toString
()
{
StringBuilder
sb
=
new
StringBuilder
();
sb
.
append
(
getClass
().
getSimpleName
());
sb
.
append
(
" ["
);
sb
.
append
(
"Hash = "
).
append
(
hashCode
());
sb
.
append
(
", id="
).
append
(
id
);
sb
.
append
(
", itemId="
).
append
(
itemId
);
sb
.
append
(
", skuCode="
).
append
(
skuCode
);
sb
.
append
(
", platformCode="
).
append
(
platformCode
);
sb
.
append
(
", hasPublish="
).
append
(
hasPublish
);
sb
.
append
(
", gmtCreate="
).
append
(
gmtCreate
);
sb
.
append
(
", gmtModify="
).
append
(
gmtModify
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
@Override
public
boolean
equals
(
Object
that
)
{
if
(
this
==
that
)
{
return
true
;
}
if
(
that
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
that
.
getClass
())
{
return
false
;
}
DcBaseEbaySkuMapping
other
=
(
DcBaseEbaySkuMapping
)
that
;
return
(
this
.
getId
()
==
null
?
other
.
getId
()
==
null
:
this
.
getId
().
equals
(
other
.
getId
()))
&&
(
this
.
getItemId
()
==
null
?
other
.
getItemId
()
==
null
:
this
.
getItemId
().
equals
(
other
.
getItemId
()))
&&
(
this
.
getSkuCode
()
==
null
?
other
.
getSkuCode
()
==
null
:
this
.
getSkuCode
().
equals
(
other
.
getSkuCode
()))
&&
(
this
.
getPlatformCode
()
==
null
?
other
.
getPlatformCode
()
==
null
:
this
.
getPlatformCode
().
equals
(
other
.
getPlatformCode
()))
&&
(
this
.
getHasPublish
()
==
null
?
other
.
getHasPublish
()
==
null
:
this
.
getHasPublish
().
equals
(
other
.
getHasPublish
()))
&&
(
this
.
getGmtCreate
()
==
null
?
other
.
getGmtCreate
()
==
null
:
this
.
getGmtCreate
().
equals
(
other
.
getGmtCreate
()))
&&
(
this
.
getGmtModify
()
==
null
?
other
.
getGmtModify
()
==
null
:
this
.
getGmtModify
().
equals
(
other
.
getGmtModify
()));
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
((
getId
()
==
null
)
?
0
:
getId
().
hashCode
());
result
=
prime
*
result
+
((
getItemId
()
==
null
)
?
0
:
getItemId
().
hashCode
());
result
=
prime
*
result
+
((
getSkuCode
()
==
null
)
?
0
:
getSkuCode
().
hashCode
());
result
=
prime
*
result
+
((
getPlatformCode
()
==
null
)
?
0
:
getPlatformCode
().
hashCode
());
result
=
prime
*
result
+
((
getHasPublish
()
==
null
)
?
0
:
getHasPublish
().
hashCode
());
result
=
prime
*
result
+
((
getGmtCreate
()
==
null
)
?
0
:
getGmtCreate
().
hashCode
());
result
=
prime
*
result
+
((
getGmtModify
()
==
null
)
?
0
:
getGmtModify
().
hashCode
());
return
result
;
}
}
\ No newline at end of file
data-common/src/main/java/com/bailuntec/domain/example/DcBaseEbaySkuMappingExample.java
0 → 100644
View file @
df59f15e
This diff is collapsed.
Click to expand it.
data-common/src/main/java/com/bailuntec/mapper/DcBaseEbaySkuMappingMapper.java
0 → 100644
View file @
df59f15e
package
com
.
bailuntec
.
mapper
;
import
com.bailuntec.domain.entity.DcBaseEbaySkuMapping
;
import
com.bailuntec.domain.example.DcBaseEbaySkuMappingExample
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
DcBaseEbaySkuMappingMapper
{
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
long
countByExample
(
DcBaseEbaySkuMappingExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
int
deleteByExample
(
DcBaseEbaySkuMappingExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
int
deleteByPrimaryKey
(
Integer
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
int
insert
(
DcBaseEbaySkuMapping
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
int
insertSelective
(
DcBaseEbaySkuMapping
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
DcBaseEbaySkuMapping
selectOneByExample
(
DcBaseEbaySkuMappingExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
List
<
DcBaseEbaySkuMapping
>
selectByExample
(
DcBaseEbaySkuMappingExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
DcBaseEbaySkuMapping
selectByPrimaryKey
(
Integer
id
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
int
updateByExampleSelective
(
@Param
(
"record"
)
DcBaseEbaySkuMapping
record
,
@Param
(
"example"
)
DcBaseEbaySkuMappingExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
int
updateByExample
(
@Param
(
"record"
)
DcBaseEbaySkuMapping
record
,
@Param
(
"example"
)
DcBaseEbaySkuMappingExample
example
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
int
updateByPrimaryKeySelective
(
DcBaseEbaySkuMapping
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
*/
int
updateByPrimaryKey
(
DcBaseEbaySkuMapping
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int
upsert
(
DcBaseEbaySkuMapping
record
);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table dc_base_ebay_sku_mapping
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
int
upsertSelective
(
DcBaseEbaySkuMapping
record
);
}
\ No newline at end of file
data-common/src/main/java/com/bailuntec/mapper/DcBaseEbaySkuMappingMapper.xml
0 → 100644
View file @
df59f15e
This diff is collapsed.
Click to expand it.
data-common/src/main/java/com/bailuntec/mapper/DcBaseFinanceEbayMapper.java
View file @
df59f15e
...
...
@@ -2,10 +2,12 @@ package com.bailuntec.mapper;
import
com.bailuntec.domain.dto.DcBaseFinanceEbayItemDto
;
import
com.bailuntec.domain.entity.DcBaseFinanceEbay
;
import
com.bailuntec.domain.entity.DcBaseFinanceEbayItem
;
import
com.bailuntec.domain.entity.JobPointLog
;
import
com.bailuntec.domain.example.DcBaseFinanceEbayExample
;
import
org.apache.ibatis.annotations.Param
;
import
java.math.BigDecimal
;
import
java.util.List
;
public
interface
DcBaseFinanceEbayMapper
{
...
...
@@ -126,6 +128,20 @@ public interface DcBaseFinanceEbayMapper {
*/
int
upsertSelective
(
DcBaseFinanceEbay
record
);
// CalculateEbayItemJob start
List
<
DcBaseFinanceEbayItemDto
>
selectEbayList
(
JobPointLog
jobPointLog
);
BigDecimal
selectSkuPrice
(
@Param
(
"skuCode"
)
String
skuCode
);
// CalculateEbayItemJob end
// EbayItemSyncJob start
long
countByGroup
(
JobPointLog
jobPointLog
);
List
<
DcBaseFinanceEbayItemDto
>
selectEbay
(
JobPointLog
jobPointLog
);
List
<
String
>
selectEbayItem
(
JobPointLog
jobPointLog
);
// EbayItemSyncJob end
}
\ No newline at end of file
data-common/src/main/java/com/bailuntec/mapper/DcBaseFinanceEbayMapper.xml
View file @
df59f15e
...
...
@@ -1024,14 +1024,69 @@
</collection>
</resultMap>
<select
id=
"selectSkuMapping"
resultType=
"com.bailuntec.domain.dto.DcBaseSkuMappingItemDto"
>
<select
id=
"selectSkuMapping"
resultType=
"com.bailuntec.domain.dto.DcBaseSkuMappingItemDto"
>
select dc0.*, dc1.unit_price from dc_base_sku_mapping dc0 left join dc_base_sku dc1 on dc0.bailun_sku = dc1.bailun_sku where dc0.item_id = #{itemId} and dc0.has_deleted = 0
</select>
<select
id=
"selectEbayList"
resultMap=
"BaseResultMap1"
>
<resultMap
id=
"BaseResultMap2"
type=
"com.bailuntec.domain.dto.DcBaseFinanceEbayItemDto"
>
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"account_entry_type"
jdbcType=
"VARCHAR"
property=
"accountEntryType"
/>
<result
column=
"description"
jdbcType=
"VARCHAR"
property=
"description"
/>
<result
column=
"gmt_date"
jdbcType=
"TIMESTAMP"
property=
"gmtDate"
/>
<result
column=
"bj_date"
jdbcType=
"TIMESTAMP"
property=
"bjDate"
/>
<result
column=
"gross_amount"
jdbcType=
"DECIMAL"
property=
"grossAmount"
/>
<result
column=
"item_id"
jdbcType=
"VARCHAR"
property=
"itemId"
/>
<result
column=
"title"
jdbcType=
"VARCHAR"
property=
"title"
/>
<result
column=
"order_line_id"
jdbcType=
"VARCHAR"
property=
"orderLineId"
/>
<result
column=
"transaction_id"
jdbcType=
"VARCHAR"
property=
"transactionId"
/>
<result
column=
"company_id"
jdbcType=
"INTEGER"
property=
"companyId"
/>
<result
column=
"received_top_rated_discount"
jdbcType=
"BIT"
property=
"receivedTopRatedDiscount"
/>
<result
column=
"account_id"
jdbcType=
"INTEGER"
property=
"accountId"
/>
<result
column=
"currency"
jdbcType=
"VARCHAR"
property=
"currency"
/>
<result
column=
"exchange_rate"
jdbcType=
"DECIMAL"
property=
"exchangeRate"
/>
<result
column=
"exchange_rate_usd"
jdbcType=
"DECIMAL"
property=
"exchangeRateUsd"
/>
<result
column=
"report_date"
jdbcType=
"DATE"
property=
"reportDate"
/>
</resultMap>
<!--calculate start-->
<select
id=
"selectEbayList"
resultMap=
"BaseResultMap2"
>
select * from dc_base_finance_ebay
where bj_date
>
= #{startTime} and bj_date
<
#{endTime}
order by id asc
limit ${pageIndex * pageSize} , #{pageSize}
</select>
<select
id=
"selectSkuPrice"
resultType=
"java.math.BigDecimal"
>
select unit_price from dc_base_sku where bailun_sku = #{skuCode}
</select>
<!--calculate end-->
<select
id=
"countByGroup"
resultType=
"java.lang.Long"
>
select count(1) from (select item_id from dc_base_finance_ebay
where bj_date
>
= #{startTime} and bj_date
<
#{endTime} group by item_id) b
</select>
<select
id=
"selectEbayItem"
resultType=
"java.lang.String"
>
select item_id from dc_base_finance_ebay
where bj_date
>
= #{startTime} and bj_date
<
#{endTime}
group by item_id
order by id asc
limit ${pageIndex * pageSize} , #{pageSize}
</select>
<select
id=
"selectEbay"
resultMap=
"BaseResultMap2"
>
select * from dc_base_finance_ebay
where bj_date
>
= #{startTime} and bj_date
<
#{endTime}
group by item_id
order by id asc
limit ${pageIndex * pageSize} , #{pageSize}
</select>
</mapper>
\ No newline at end of file
data-mid/mid-calculate-item/src/main/java/com/bailuntec/Application.java
View file @
df59f15e
...
...
@@ -3,6 +3,7 @@ package com.bailuntec;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.bailuntec.job.CalculateAmazonItemJob
;
import
com.bailuntec.job.CalculateEbayItemJob
;
import
com.bailuntec.job.EbayItemSyncJob
;
import
com.bailuntec.utils.PropertiesUtil
;
import
com.dangdang.ddframe.job.config.JobCoreConfiguration
;
import
com.dangdang.ddframe.job.config.simple.SimpleJobConfiguration
;
...
...
@@ -27,6 +28,7 @@ public class Application {
public
static
void
main
(
String
[]
args
)
{
new
JobScheduler
(
createRegistryCenter
(),
createJobConfiguration
()).
init
();
new
JobScheduler
(
createRegistryCenter
(),
createJobConfiguration1
()).
init
();
new
JobScheduler
(
createRegistryCenter
(),
createJobConfiguration2
()).
init
();
}
private
static
CoordinatorRegistryCenter
createRegistryCenter
()
{
...
...
@@ -49,6 +51,13 @@ public class Application {
return
simpleJobRootConfig
;
}
private
static
LiteJobConfiguration
createJobConfiguration2
()
{
JobCoreConfiguration
simpleCoreConfig
=
JobCoreConfiguration
.
newBuilder
(
propertiesUtil
.
getPropertyAsString
(
"JOB_EBAY_SKU_NAME"
),
propertiesUtil
.
getPropertyAsString
(
"JOB_EBAY_SKU_CRON"
),
propertiesUtil
.
getPropertyAsInt
(
"SHARDING_TOTAL_COUNT"
)).
build
();
SimpleJobConfiguration
simpleJobConfig
=
new
SimpleJobConfiguration
(
simpleCoreConfig
,
EbayItemSyncJob
.
class
.
getCanonicalName
());
LiteJobConfiguration
simpleJobRootConfig
=
LiteJobConfiguration
.
newBuilder
(
simpleJobConfig
).
build
();
return
simpleJobRootConfig
;
}
private
static
JobEventConfiguration
createJobEventConfiguration
()
{
JobEventConfiguration
jobEventRdbConfig
=
new
JobEventRdbConfiguration
(
setUpEventTraceDataSource
());
return
jobEventRdbConfig
;
...
...
data-mid/mid-calculate-item/src/main/java/com/bailuntec/domain/constant/EbaySkuMappingRoot.java
0 → 100644
View file @
df59f15e
package
com
.
bailuntec
.
domain
.
constant
;
import
com.bailuntec.domain.entity.DcBaseEbaySkuMapping
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
import
java.util.List
;
@Data
public
class
EbaySkuMappingRoot
{
private
Boolean
isSucceeded
;
private
String
message
;
private
String
data
;
private
String
redirectUrl
;
private
List
<
DcBaseEbaySkuMapping
>
objData
;
}
\ No newline at end of file
data-mid/mid-calculate-item/src/main/java/com/bailuntec/job/CalculateEbayItemJob.java
View file @
df59f15e
This diff is collapsed.
Click to expand it.
data-mid/mid-calculate-item/src/main/java/com/bailuntec/job/EbayItemSyncJob.java
0 → 100644
View file @
df59f15e
package
com
.
bailuntec
.
job
;
import
com.alibaba.fastjson.JSON
;
import
com.bailuntec.domain.constant.EbaySkuMappingRoot
;
import
com.bailuntec.domain.entity.*
;
import
com.bailuntec.mapper.DcBaseEbaySkuMappingMapper
;
import
com.bailuntec.mapper.DcBaseFinanceEbayMapper
;
import
com.bailuntec.support.PointJob
;
import
com.bailuntec.utils.OkHttpUtil
;
import
com.bailuntec.utils.PropertiesUtil
;
import
com.bailuntec.utils.SessionUtil
;
import
com.dangdang.ddframe.job.api.ShardingContext
;
import
lombok.extern.slf4j.Slf4j
;
import
okhttp3.*
;
import
org.apache.commons.lang3.StringUtils
;
import
java.io.IOException
;
import
java.time.LocalDateTime
;
import
java.util.List
;
@Slf4j
public
class
EbayItemSyncJob
extends
PointJob
{
private
OkHttpClient
okHttpClient
=
OkHttpUtil
.
getInstance
();
private
PropertiesUtil
propertiesUtil
=
PropertiesUtil
.
getInstance
(
"const"
);
@Override
public
void
executeJob
(
ShardingContext
shardingContext
,
JobPointLog
jobPointLog
)
{
long
countEbayFee
;
try
{
DcBaseFinanceEbayMapper
dcBaseFinanceEbayMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseFinanceEbayMapper
.
class
);
countEbayFee
=
dcBaseFinanceEbayMapper
.
countByGroup
(
jobPointLog
);
}
catch
(
Exception
e
){
e
.
printStackTrace
();
throw
new
RuntimeException
(
"MYBATIS操作DB失败"
,
e
);
}
finally
{
SessionUtil
.
closeSession
();
}
long
totalPage
=
getEbayPage
(
countEbayFee
,
jobPointLog
);
do
{
List
<
String
>
dcBaseFinanceEbayItemDtoList
;
try
{
DcBaseFinanceEbayMapper
dcBaseFinanceEbayMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseFinanceEbayMapper
.
class
);
dcBaseFinanceEbayItemDtoList
=
dcBaseFinanceEbayMapper
.
selectEbayItem
(
jobPointLog
);
// for(DcBaseFinanceEbayItemDto dcBaseFinanceEbayItemDto : dcBaseFinanceEbayItemDtoList) {
MediaType
mediaType
=
MediaType
.
parse
(
"application/json"
);
RequestBody
body
=
RequestBody
.
create
(
mediaType
,
JSON
.
toJSONString
(
dcBaseFinanceEbayItemDtoList
));
Request
request
=
new
Request
.
Builder
()
.
url
(
propertiesUtil
.
getPropertyAsString
(
"getSkuCodeInfoByItemId"
))
.
post
(
body
)
.
addHeader
(
"Content-Type"
,
"application/json"
)
.
build
();
Response
response
=
null
;
String
ebaySkuMappingStr
=
null
;
try
{
response
=
okHttpClient
.
newCall
(
request
).
execute
();
ebaySkuMappingStr
=
response
.
body
().
string
();
}
catch
(
IOException
e
)
{
throw
new
RuntimeException
(
dcBaseFinanceEbayItemDtoList
+
"请求ebay广告费映射失败"
+
response
,
e
);
}
finally
{
if
(
response
!=
null
)
{
response
.
close
();
}
}
DcBaseEbaySkuMapping
dcBaseEbaySkuMapping
=
new
DcBaseEbaySkuMapping
();
if
(
StringUtils
.
isNoneBlank
(
ebaySkuMappingStr
))
{
EbaySkuMappingRoot
ebaySkuMappingRoot
=
JSON
.
parseObject
(
ebaySkuMappingStr
,
EbaySkuMappingRoot
.
class
);
if
(
ebaySkuMappingRoot
!=
null
&&
ebaySkuMappingRoot
.
getIsSucceeded
().
booleanValue
())
{
List
<
DcBaseEbaySkuMapping
>
dcBaseEbaySkuMappingList
=
ebaySkuMappingRoot
.
getObjData
();
if
(
dcBaseEbaySkuMappingList
!=
null
&&
dcBaseEbaySkuMappingList
.
size
()
>
0
)
{
DcBaseEbaySkuMappingMapper
dcBaseEbaySkuMappingMapper
=
SessionUtil
.
getSession
().
getMapper
(
DcBaseEbaySkuMappingMapper
.
class
);
for
(
DcBaseEbaySkuMapping
dcBaseEbaySkuMapping1
:
dcBaseEbaySkuMappingList
)
{
dcBaseEbaySkuMappingMapper
.
upsertSelective
(
dcBaseEbaySkuMapping1
);
}
}
}
else
{
throw
new
RuntimeException
(
"调用ebay广告费映射失败, 响应200, 请求参数"
+
dcBaseFinanceEbayItemDtoList
);
}
}
// }
}
catch
(
Exception
e
){
e
.
printStackTrace
();
throw
new
RuntimeException
(
"MYBATIS操作DB失败"
,
e
);
}
finally
{
SessionUtil
.
closeSession
();
}
jobPointLog
.
setPageIndex
(
jobPointLog
.
getPageIndex
()+
1
);
}
while
(
jobPointLog
.
getPageIndex
()
<=
totalPage
);
jobPointLog
.
setPageIndex
(
0
);
jobPointLog
.
setStartTime
(
jobPointLog
.
getEndTime
());
jobPointLog
.
setEndTime
(
jobPointLog
.
getStartTime
().
plusDays
(
jobPointLog
.
getIntervalTime
().
longValue
()).
isAfter
(
LocalDateTime
.
now
())
?
LocalDateTime
.
now
()
:
jobPointLog
.
getStartTime
().
plusDays
(
jobPointLog
.
getIntervalTime
().
longValue
()));
}
public
long
getEbayPage
(
long
countEbayFee
,
JobPointLog
jobPointLog
)
{
if
(
countEbayFee
%
jobPointLog
.
getPageSize
()
==
0
)
{
return
countEbayFee
/
jobPointLog
.
getPageSize
();
}
return
countEbayFee
/
jobPointLog
.
getPageSize
()
+
1
;
}
}
data-mid/mid-calculate-item/src/main/resources/const.properties
View file @
df59f15e
# getSkuCodeInfoByItemId: http://bltpro.bailuntec.com/api/EbayPulishApi/GetSkuCodeInfoByItemIds
getSkuCodeInfoByItemId
:
http://193.112.181.191:8002/api/EbayPulishApi/GetSkuCodeInfoByItemIds
\ No newline at end of file
data-mid/mid-calculate-item/src/main/resources/job.properties
View file @
df59f15e
...
...
@@ -13,4 +13,6 @@ JOB_NAME=mid-calculate-ebay-item
JOB_CRON
=
0 0 7 * * ? *
JOB_AMAZON_NAME
=
mid-calculate-amazon-item
JOB_AMAZON_CRON
=
0 0 7 * * ? *
JOB_EBAY_SKU_NAME
=
base-ebay-sku-sync
JOB_EBAY_SKU_CRON
=
0 0 12 * * ? *
SHARDING_TOTAL_COUNT
=
1
\ No newline at end of file
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