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
2a4347de
Commit
2a4347de
authored
Apr 11, 2019
by
wutong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CRM退款数据重新获取
parent
00a9e7e1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
11 deletions
+43
-11
RefundItem.java
...d/src/main/java/com/bailuntec/domain/pojo/RefundItem.java
+1
-1
CrmRefundSyncJob.java
...und/src/main/java/com/bailuntec/job/CrmRefundSyncJob.java
+5
-2
DcBaseCrmRefundMapper.xml
.../main/java/com/bailuntec/mapper/DcBaseCrmRefundMapper.xml
+37
-8
No files found.
data-base/base-sync-crm-refund/src/main/java/com/bailuntec/domain/pojo/RefundItem.java
View file @
2a4347de
...
...
@@ -11,7 +11,7 @@ public class RefundItem {
@JSONField
(
name
=
"ID"
)
private
Integer
i
d
;
private
Integer
crmI
d
;
@JSONField
(
name
=
"PlatformName"
)
private
String
platformType
;
@JSONField
(
name
=
"SellerAccount"
)
...
...
data-base/base-sync-crm-refund/src/main/java/com/bailuntec/job/CrmRefundSyncJob.java
View file @
2a4347de
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.bailuntec.domain.constant.CommonConstant
;
import
com.bailuntec.domain.entity.DcBaseCrmRefund
;
import
com.bailuntec.domain.entity.JobPointLog
;
import
com.bailuntec.domain.example.DcBaseCrmRefundExample
;
import
com.bailuntec.domain.pojo.RefundDetails
;
import
com.bailuntec.domain.pojo.RefundItem
;
import
com.bailuntec.mapper.DcBaseCrmRefundMapper
;
...
...
@@ -77,11 +78,13 @@ public class CrmRefundSyncJob extends PointJob {
e
.
printStackTrace
();
throw
new
RuntimeException
(
"CRM退款BeanUtils.copyProperties失败"
,
e
);
}
mapper
.
upsertSelective
(
dcBaseCrmRefund
);
int
i
=
mapper
.
updateByExampleSelective
(
dcBaseCrmRefund
,
DcBaseCrmRefundExample
.
newAndCreateCriteria
().
andCrmIdEqualTo
(
dcBaseCrmRefund
.
getCrmId
()).
example
());
if
(
i
==
0
)
{
mapper
.
insertSelective
(
dcBaseCrmRefund
);
}
SessionUtil
.
getSession
().
commit
();
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
RuntimeException
(
"MYBATIS操作DB异常"
,
e
);
}
finally
{
SessionUtil
.
closeSession
();
...
...
data-base/base-sync-crm-refund/src/main/java/com/bailuntec/mapper/DcBaseCrmRefundMapper.xml
View file @
2a4347de
...
...
@@ -23,6 +23,7 @@
<result
column=
"gmt_modified"
jdbcType=
"TIMESTAMP"
property=
"gmtModified"
/>
<result
column=
"linked"
jdbcType=
"BIT"
property=
"linked"
/>
<result
column=
"amount_refund_rmb"
jdbcType=
"DECIMAL"
property=
"amountRefundRmb"
/>
<result
column=
"crm_id"
jdbcType=
"INTEGER"
property=
"crmId"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<!--
...
...
@@ -97,7 +98,7 @@
-->
id, platform_type, bailun_account, bailun_account_id, website, origin_order_id, bailun_sku,
platform_sku, amount_refund, order_currency, refund_time, bailun_sku_quantity_refund,
bailun_sku_unit_price, gmt_create, gmt_modified, linked, amount_refund_rmb
bailun_sku_unit_price, gmt_create, gmt_modified, linked, amount_refund_rmb
, crm_id
</sql>
<select
id=
"selectByExample"
parameterType=
"com.bailuntec.domain.example.DcBaseCrmRefundExample"
resultMap=
"BaseResultMap"
>
<!--
...
...
@@ -163,13 +164,15 @@
bailun_sku, platform_sku, amount_refund,
order_currency, refund_time, bailun_sku_quantity_refund,
bailun_sku_unit_price, gmt_create, gmt_modified,
linked, amount_refund_rmb)
linked, amount_refund_rmb, crm_id
)
values (#{id,jdbcType=INTEGER}, #{platformType,jdbcType=VARCHAR}, #{bailunAccount,jdbcType=VARCHAR},
#{bailunAccountId,jdbcType=INTEGER}, #{website,jdbcType=VARCHAR}, #{originOrderId,jdbcType=VARCHAR},
#{bailunSku,jdbcType=VARCHAR}, #{platformSku,jdbcType=VARCHAR}, #{amountRefund,jdbcType=DECIMAL},
#{orderCurrency,jdbcType=VARCHAR}, #{refundTime,jdbcType=TIMESTAMP}, #{bailunSkuQuantityRefund,jdbcType=INTEGER},
#{bailunSkuUnitPrice,jdbcType=DECIMAL}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
#{linked,jdbcType=BIT}, #{amountRefundRmb,jdbcType=DECIMAL})
#{linked,jdbcType=BIT}, #{amountRefundRmb,jdbcType=DECIMAL}, #{crmId,jdbcType=INTEGER}
)
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.bailuntec.domain.entity.DcBaseCrmRefund"
>
<!--
...
...
@@ -229,6 +232,9 @@
<if
test=
"amountRefundRmb != null"
>
amount_refund_rmb,
</if>
<if
test=
"crmId != null"
>
crm_id,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
...
...
@@ -282,6 +288,9 @@
<if
test=
"amountRefundRmb != null"
>
#{amountRefundRmb,jdbcType=DECIMAL},
</if>
<if
test=
"crmId != null"
>
#{crmId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.bailuntec.domain.example.DcBaseCrmRefundExample"
resultType=
"java.lang.Long"
>
...
...
@@ -352,6 +361,9 @@
<if
test=
"record.amountRefundRmb != null"
>
amount_refund_rmb = #{record.amountRefundRmb,jdbcType=DECIMAL},
</if>
<if
test=
"record.crmId != null"
>
crm_id = #{record.crmId,jdbcType=INTEGER},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -379,7 +391,8 @@
gmt_create = #{record.gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{record.gmtModified,jdbcType=TIMESTAMP},
linked = #{record.linked,jdbcType=BIT},
amount_refund_rmb = #{record.amountRefundRmb,jdbcType=DECIMAL}
amount_refund_rmb = #{record.amountRefundRmb,jdbcType=DECIMAL},
crm_id = #{record.crmId,jdbcType=INTEGER}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -439,6 +452,9 @@
<if
test=
"amountRefundRmb != null"
>
amount_refund_rmb = #{amountRefundRmb,jdbcType=DECIMAL},
</if>
<if
test=
"crmId != null"
>
crm_id = #{crmId,jdbcType=INTEGER},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
...
...
@@ -463,7 +479,8 @@
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
linked = #{linked,jdbcType=BIT},
amount_refund_rmb = #{amountRefundRmb,jdbcType=DECIMAL}
amount_refund_rmb = #{amountRefundRmb,jdbcType=DECIMAL},
crm_id = #{crmId,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER}
</update>
<insert
id=
"upsertSelective"
parameterType=
"com.bailuntec.domain.entity.DcBaseCrmRefund"
>
...
...
@@ -525,6 +542,9 @@
<if
test=
"amountRefundRmb != null"
>
amount_refund_rmb,
</if>
<if
test=
"crmId != null"
>
crm_id,
</if>
</trim>
values
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
@@ -579,6 +599,9 @@
<if
test=
"amountRefundRmb != null"
>
#{amountRefundRmb,jdbcType=DECIMAL},
</if>
<if
test=
"crmId != null"
>
#{crmId,jdbcType=INTEGER},
</if>
</trim>
on duplicate key update
<trim
suffixOverrides=
","
>
...
...
@@ -633,6 +656,9 @@
<if
test=
"amountRefundRmb != null"
>
amount_refund_rmb = #{amountRefundRmb,jdbcType=DECIMAL},
</if>
<if
test=
"crmId != null"
>
crm_id = #{crmId,jdbcType=INTEGER},
</if>
</trim>
</insert>
<insert
id=
"upsert"
parameterType=
"com.bailuntec.domain.entity.DcBaseCrmRefund"
>
...
...
@@ -644,14 +670,16 @@
insert into dc_base_crm_refund
(id, platform_type, bailun_account, bailun_account_id, website, origin_order_id,
bailun_sku, platform_sku, amount_refund, order_currency, refund_time, bailun_sku_quantity_refund,
bailun_sku_unit_price, gmt_create, gmt_modified, linked, amount_refund_rmb)
bailun_sku_unit_price, gmt_create, gmt_modified, linked, amount_refund_rmb, crm_id
)
values
(#{id,jdbcType=INTEGER}, #{platformType,jdbcType=VARCHAR}, #{bailunAccount,jdbcType=VARCHAR},
#{bailunAccountId,jdbcType=INTEGER}, #{website,jdbcType=VARCHAR}, #{originOrderId,jdbcType=VARCHAR},
#{bailunSku,jdbcType=VARCHAR}, #{platformSku,jdbcType=VARCHAR}, #{amountRefund,jdbcType=DECIMAL},
#{orderCurrency,jdbcType=VARCHAR}, #{refundTime,jdbcType=TIMESTAMP}, #{bailunSkuQuantityRefund,jdbcType=INTEGER},
#{bailunSkuUnitPrice,jdbcType=DECIMAL}, #{gmtCreate,jdbcType=TIMESTAMP}, #{gmtModified,jdbcType=TIMESTAMP},
#{linked,jdbcType=BIT}, #{amountRefundRmb,jdbcType=DECIMAL})
#{linked,jdbcType=BIT}, #{amountRefundRmb,jdbcType=DECIMAL}, #{crmId,jdbcType=INTEGER}
)
on duplicate key update
id = #{id,jdbcType=INTEGER},
platform_type = #{platformType,jdbcType=VARCHAR},
...
...
@@ -669,7 +697,8 @@
gmt_create = #{gmtCreate,jdbcType=TIMESTAMP},
gmt_modified = #{gmtModified,jdbcType=TIMESTAMP},
linked = #{linked,jdbcType=BIT},
amount_refund_rmb = #{amountRefundRmb,jdbcType=DECIMAL}
amount_refund_rmb = #{amountRefundRmb,jdbcType=DECIMAL},
crm_id = #{crmId,jdbcType=INTEGER}
</insert>
<select
id=
"selectOneByExample"
parameterType=
"com.bailuntec.domain.example.DcBaseCrmRefundExample"
resultMap=
"BaseResultMap"
>
<!--
...
...
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