Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
5d2e2de9
Commit
5d2e2de9
authored
Aug 02, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单表加上佣金相关字段
parent
b96beb9e
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
1081 additions
and
28 deletions
+1081
-28
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrder.java
...com/wwdz/ch/db/domain/distribution/DistributionOrder.java
+58
-3
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrderExample.java
...z/ch/db/domain/distribution/DistributionOrderExample.java
+793
-0
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/DistributionOrderRequestDto.java
...dto/request/distribution/DistributionOrderRequestDto.java
+31
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/DistributionOrderMapper.xml
...wdz/ch/db/mapper/distribution/DistributionOrderMapper.xml
+106
-9
ch-dao/src/main/resources/generatorConfig_new.xml
ch-dao/src/main/resources/generatorConfig_new.xml
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributionOrderServiceImpl.java
...ch/wx/impl/distribution/DistributionOrderServiceImpl.java
+24
-11
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SpecialPerformanceServiceImpl.java
...h/wx/impl/distribution/SpecialPerformanceServiceImpl.java
+26
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/UserAccountDetailServiceImpl.java
...ch/wx/impl/distribution/UserAccountDetailServiceImpl.java
+25
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/SpecialPerformanceNoticeJob.java
.../java/com/wwdz/ch/wx/job/SpecialPerformanceNoticeJob.java
+8
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/SpecialPerformanceService.java
...ch/wx/service/distribution/SpecialPerformanceService.java
+7
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/GroupPurchaseController.java
.../wwdz/ch/wx/web/distribution/GroupPurchaseController.java
+2
-2
No files found.
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrder.java
View file @
5d2e2de9
package
com.wwdz.ch.db.domain.distribution
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
...
...
@@ -10,7 +11,7 @@ import lombok.Data;
/**
* @author shiyu
* @date 2024/0
6/17
* @date 2024/0
8/02
*/
@Data
public
class
DistributionOrder
implements
Entity
{
...
...
@@ -146,6 +147,36 @@ public class DistributionOrder implements Entity {
*/
private
Integer
type
;
/**
* 供货价
*/
private
Long
supplyPrice
;
/**
* 介绍佣金金额
*/
private
Long
introduceAmount
;
/**
* 介绍佣金比例
*/
private
BigDecimal
introduceRebate
;
/**
* 介绍人id
*/
private
Long
introducerId
;
/**
* 平台佣金金额
*/
private
Long
channelAmount
;
/**
* 平台佣金比例
*/
private
BigDecimal
channelRebate
;
private
static
final
long
serialVersionUID
=
1L
;
@Override
...
...
@@ -181,6 +212,12 @@ public class DistributionOrder implements Entity {
sb
.
append
(
", state="
).
append
(
state
);
sb
.
append
(
", logisticsState="
).
append
(
logisticsState
);
sb
.
append
(
", type="
).
append
(
type
);
sb
.
append
(
", supplyPrice="
).
append
(
supplyPrice
);
sb
.
append
(
", introduceAmount="
).
append
(
introduceAmount
);
sb
.
append
(
", introduceRebate="
).
append
(
introduceRebate
);
sb
.
append
(
", introducerId="
).
append
(
introducerId
);
sb
.
append
(
", channelAmount="
).
append
(
channelAmount
);
sb
.
append
(
", channelRebate="
).
append
(
channelRebate
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
sb
.
append
(
"]"
);
return
sb
.
toString
();
...
...
@@ -224,7 +261,13 @@ public class DistributionOrder implements Entity {
&&
(
this
.
getShareRecordId
()
==
null
?
other
.
getShareRecordId
()
==
null
:
this
.
getShareRecordId
().
equals
(
other
.
getShareRecordId
()))
&&
(
this
.
getState
()
==
null
?
other
.
getState
()
==
null
:
this
.
getState
().
equals
(
other
.
getState
()))
&&
(
this
.
getLogisticsState
()
==
null
?
other
.
getLogisticsState
()
==
null
:
this
.
getLogisticsState
().
equals
(
other
.
getLogisticsState
()))
&&
(
this
.
getType
()
==
null
?
other
.
getType
()
==
null
:
this
.
getType
().
equals
(
other
.
getType
()));
&&
(
this
.
getType
()
==
null
?
other
.
getType
()
==
null
:
this
.
getType
().
equals
(
other
.
getType
()))
&&
(
this
.
getSupplyPrice
()
==
null
?
other
.
getSupplyPrice
()
==
null
:
this
.
getSupplyPrice
().
equals
(
other
.
getSupplyPrice
()))
&&
(
this
.
getIntroduceAmount
()
==
null
?
other
.
getIntroduceAmount
()
==
null
:
this
.
getIntroduceAmount
().
equals
(
other
.
getIntroduceAmount
()))
&&
(
this
.
getIntroduceRebate
()
==
null
?
other
.
getIntroduceRebate
()
==
null
:
this
.
getIntroduceRebate
().
equals
(
other
.
getIntroduceRebate
()))
&&
(
this
.
getIntroducerId
()
==
null
?
other
.
getIntroducerId
()
==
null
:
this
.
getIntroducerId
().
equals
(
other
.
getIntroducerId
()))
&&
(
this
.
getChannelAmount
()
==
null
?
other
.
getChannelAmount
()
==
null
:
this
.
getChannelAmount
().
equals
(
other
.
getChannelAmount
()))
&&
(
this
.
getChannelRebate
()
==
null
?
other
.
getChannelRebate
()
==
null
:
this
.
getChannelRebate
().
equals
(
other
.
getChannelRebate
()));
}
@Override
...
...
@@ -258,6 +301,12 @@ public class DistributionOrder implements Entity {
result
=
prime
*
result
+
((
getState
()
==
null
)
?
0
:
getState
().
hashCode
());
result
=
prime
*
result
+
((
getLogisticsState
()
==
null
)
?
0
:
getLogisticsState
().
hashCode
());
result
=
prime
*
result
+
((
getType
()
==
null
)
?
0
:
getType
().
hashCode
());
result
=
prime
*
result
+
((
getSupplyPrice
()
==
null
)
?
0
:
getSupplyPrice
().
hashCode
());
result
=
prime
*
result
+
((
getIntroduceAmount
()
==
null
)
?
0
:
getIntroduceAmount
().
hashCode
());
result
=
prime
*
result
+
((
getIntroduceRebate
()
==
null
)
?
0
:
getIntroduceRebate
().
hashCode
());
result
=
prime
*
result
+
((
getIntroducerId
()
==
null
)
?
0
:
getIntroducerId
().
hashCode
());
result
=
prime
*
result
+
((
getChannelAmount
()
==
null
)
?
0
:
getChannelAmount
().
hashCode
());
result
=
prime
*
result
+
((
getChannelRebate
()
==
null
)
?
0
:
getChannelRebate
().
hashCode
());
return
result
;
}
...
...
@@ -295,7 +344,13 @@ public class DistributionOrder implements Entity {
shareRecordId
(
"share_record_id"
,
"shareRecordId"
,
"VARCHAR"
,
false
),
state
(
"state"
,
"state"
,
"INTEGER"
,
true
),
logisticsState
(
"logistics_state"
,
"logisticsState"
,
"INTEGER"
,
false
),
type
(
"type"
,
"type"
,
"INTEGER"
,
true
);
type
(
"type"
,
"type"
,
"INTEGER"
,
true
),
supplyPrice
(
"supply_price"
,
"supplyPrice"
,
"BIGINT"
,
false
),
introduceAmount
(
"introduce_amount"
,
"introduceAmount"
,
"BIGINT"
,
false
),
introduceRebate
(
"introduce_rebate"
,
"introduceRebate"
,
"DECIMAL"
,
false
),
introducerId
(
"introducer_id"
,
"introducerId"
,
"BIGINT"
,
false
),
channelAmount
(
"channel_amount"
,
"channelAmount"
,
"BIGINT"
,
false
),
channelRebate
(
"channel_rebate"
,
"channelRebate"
,
"DECIMAL"
,
false
);
/**
* This field was generated by MyBatis Generator.
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/distribution/DistributionOrderExample.java
View file @
5d2e2de9
This diff is collapsed.
Click to expand it.
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/distribution/DistributionOrderRequestDto.java
View file @
5d2e2de9
...
...
@@ -4,6 +4,7 @@ import com.wwdz.ch.db.dto.request.BaseRequestDto;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -149,6 +150,36 @@ public class DistributionOrderRequestDto extends BaseRequestDto implements Entit
*/
private
String
refundPrice
;
/**
* 供货价
*/
private
Long
supplyPrice
;
/**
* 介绍佣金金额
*/
private
Long
introduceAmount
;
/**
* 介绍佣金比例
*/
private
BigDecimal
introduceRebate
;
/**
* 介绍人id
*/
private
Long
introducerId
;
/**
* 平台佣金金额
*/
private
Long
channelAmount
;
/**
* 平台佣金比例
*/
private
BigDecimal
channelRebate
;
/**
* 退款接口请求秘钥
*/
...
...
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/distribution/DistributionOrderMapper.xml
View file @
5d2e2de9
...
...
@@ -29,6 +29,12 @@
<result
column=
"state"
jdbcType=
"INTEGER"
property=
"state"
/>
<result
column=
"logistics_state"
jdbcType=
"INTEGER"
property=
"logisticsState"
/>
<result
column=
"type"
jdbcType=
"INTEGER"
property=
"type"
/>
<result
column=
"supply_price"
jdbcType=
"BIGINT"
property=
"supplyPrice"
/>
<result
column=
"introduce_amount"
jdbcType=
"BIGINT"
property=
"introduceAmount"
/>
<result
column=
"introduce_rebate"
jdbcType=
"DECIMAL"
property=
"introduceRebate"
/>
<result
column=
"introducer_id"
jdbcType=
"BIGINT"
property=
"introducerId"
/>
<result
column=
"channel_amount"
jdbcType=
"BIGINT"
property=
"channelAmount"
/>
<result
column=
"channel_rebate"
jdbcType=
"DECIMAL"
property=
"channelRebate"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
...
...
@@ -93,7 +99,8 @@
buyer_openid, shop_id, seller_id, amount, address_id, receiver_name, receiver_phone,
receiver_address, logistics_code, waybill, create_time, pay_time, delivery_time,
signed_time, finish_time, update_time, share_record_id, `state`, logistics_state,
`type`
`type`, supply_price, introduce_amount, introduce_rebate, introducer_id, channel_amount,
channel_rebate
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.DistributionOrderExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -132,7 +139,8 @@
buyer_openid, shop_id, seller_id, amount, address_id, receiver_name, receiver_phone,
receiver_address, logistics_code, waybill, create_time, pay_time, delivery_time,
signed_time, finish_time, update_time, share_record_id, `state`, logistics_state,
`type`
`type`, supply_price, introduce_amount, introduce_rebate, introducer_id, channel_amount,
channel_rebate
</otherwise>
</choose>
from distribution_order
...
...
@@ -167,7 +175,8 @@
buyer_openid, shop_id, seller_id, amount, address_id, receiver_name, receiver_phone,
receiver_address, logistics_code, waybill, create_time, pay_time, delivery_time,
signed_time, finish_time, update_time, share_record_id, `state`, logistics_state,
`type`
`type`, supply_price, introduce_amount, introduce_rebate, introducer_id, channel_amount,
channel_rebate
</otherwise>
</choose>
from distribution_order
...
...
@@ -195,7 +204,9 @@
waybill, create_time, pay_time,
delivery_time, signed_time, finish_time,
update_time, share_record_id, `state`,
logistics_state, `type`)
logistics_state, `type`, supply_price,
introduce_amount, introduce_rebate, introducer_id,
channel_amount, channel_rebate)
values (#{distributionOrderId,jdbcType=VARCHAR}, #{prepayId,jdbcType=VARCHAR}, #{transactionId,jdbcType=VARCHAR},
#{itemId,jdbcType=BIGINT}, #{itemNum,jdbcType=INTEGER}, #{buyerId,jdbcType=BIGINT},
#{buyerOpenid,jdbcType=VARCHAR}, #{shopId,jdbcType=BIGINT}, #{sellerId,jdbcType=BIGINT},
...
...
@@ -204,7 +215,9 @@
#{waybill,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{payTime,jdbcType=TIMESTAMP},
#{deliveryTime,jdbcType=TIMESTAMP}, #{signedTime,jdbcType=TIMESTAMP}, #{finishTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{shareRecordId,jdbcType=VARCHAR}, #{state,jdbcType=INTEGER},
#{logisticsState,jdbcType=INTEGER}, #{type,jdbcType=INTEGER})
#{logisticsState,jdbcType=INTEGER}, #{type,jdbcType=INTEGER}, #{supplyPrice,jdbcType=BIGINT},
#{introduceAmount,jdbcType=BIGINT}, #{introduceRebate,jdbcType=DECIMAL}, #{introducerId,jdbcType=BIGINT},
#{channelAmount,jdbcType=BIGINT}, #{channelRebate,jdbcType=DECIMAL})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.distribution.DistributionOrder"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Integer"
>
...
...
@@ -290,6 +303,24 @@
<if
test=
"type != null"
>
`type`,
</if>
<if
test=
"supplyPrice != null"
>
supply_price,
</if>
<if
test=
"introduceAmount != null"
>
introduce_amount,
</if>
<if
test=
"introduceRebate != null"
>
introduce_rebate,
</if>
<if
test=
"introducerId != null"
>
introducer_id,
</if>
<if
test=
"channelAmount != null"
>
channel_amount,
</if>
<if
test=
"channelRebate != null"
>
channel_rebate,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"distributionOrderId != null"
>
...
...
@@ -370,6 +401,24 @@
<if
test=
"type != null"
>
#{type,jdbcType=INTEGER},
</if>
<if
test=
"supplyPrice != null"
>
#{supplyPrice,jdbcType=BIGINT},
</if>
<if
test=
"introduceAmount != null"
>
#{introduceAmount,jdbcType=BIGINT},
</if>
<if
test=
"introduceRebate != null"
>
#{introduceRebate,jdbcType=DECIMAL},
</if>
<if
test=
"introducerId != null"
>
#{introducerId,jdbcType=BIGINT},
</if>
<if
test=
"channelAmount != null"
>
#{channelAmount,jdbcType=BIGINT},
</if>
<if
test=
"channelRebate != null"
>
#{channelRebate,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.DistributionOrderExample"
resultType=
"java.lang.Long"
>
...
...
@@ -462,6 +511,24 @@
<if
test=
"record.type != null"
>
`type` = #{record.type,jdbcType=INTEGER},
</if>
<if
test=
"record.supplyPrice != null"
>
supply_price = #{record.supplyPrice,jdbcType=BIGINT},
</if>
<if
test=
"record.introduceAmount != null"
>
introduce_amount = #{record.introduceAmount,jdbcType=BIGINT},
</if>
<if
test=
"record.introduceRebate != null"
>
introduce_rebate = #{record.introduceRebate,jdbcType=DECIMAL},
</if>
<if
test=
"record.introducerId != null"
>
introducer_id = #{record.introducerId,jdbcType=BIGINT},
</if>
<if
test=
"record.channelAmount != null"
>
channel_amount = #{record.channelAmount,jdbcType=BIGINT},
</if>
<if
test=
"record.channelRebate != null"
>
channel_rebate = #{record.channelRebate,jdbcType=DECIMAL},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
...
...
@@ -495,7 +562,13 @@
share_record_id = #{record.shareRecordId,jdbcType=VARCHAR},
`state` = #{record.state,jdbcType=INTEGER},
logistics_state = #{record.logisticsState,jdbcType=INTEGER},
`type` = #{record.type,jdbcType=INTEGER}
`type` = #{record.type,jdbcType=INTEGER},
supply_price = #{record.supplyPrice,jdbcType=BIGINT},
introduce_amount = #{record.introduceAmount,jdbcType=BIGINT},
introduce_rebate = #{record.introduceRebate,jdbcType=DECIMAL},
introducer_id = #{record.introducerId,jdbcType=BIGINT},
channel_amount = #{record.channelAmount,jdbcType=BIGINT},
channel_rebate = #{record.channelRebate,jdbcType=DECIMAL}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
...
...
@@ -581,6 +654,24 @@
<if
test=
"type != null"
>
`type` = #{type,jdbcType=INTEGER},
</if>
<if
test=
"supplyPrice != null"
>
supply_price = #{supplyPrice,jdbcType=BIGINT},
</if>
<if
test=
"introduceAmount != null"
>
introduce_amount = #{introduceAmount,jdbcType=BIGINT},
</if>
<if
test=
"introduceRebate != null"
>
introduce_rebate = #{introduceRebate,jdbcType=DECIMAL},
</if>
<if
test=
"introducerId != null"
>
introducer_id = #{introducerId,jdbcType=BIGINT},
</if>
<if
test=
"channelAmount != null"
>
channel_amount = #{channelAmount,jdbcType=BIGINT},
</if>
<if
test=
"channelRebate != null"
>
channel_rebate = #{channelRebate,jdbcType=DECIMAL},
</if>
</set>
where id = #{id,jdbcType=INTEGER}
</update>
...
...
@@ -611,7 +702,13 @@
share_record_id = #{shareRecordId,jdbcType=VARCHAR},
`state` = #{state,jdbcType=INTEGER},
logistics_state = #{logisticsState,jdbcType=INTEGER},
`type` = #{type,jdbcType=INTEGER}
`type` = #{type,jdbcType=INTEGER},
supply_price = #{supplyPrice,jdbcType=BIGINT},
introduce_amount = #{introduceAmount,jdbcType=BIGINT},
introduce_rebate = #{introduceRebate,jdbcType=DECIMAL},
introducer_id = #{introducerId,jdbcType=BIGINT},
channel_amount = #{channelAmount,jdbcType=BIGINT},
channel_rebate = #{channelRebate,jdbcType=DECIMAL}
where id = #{id,jdbcType=INTEGER}
</update>
<select
id=
"selectOneByExample"
parameterType=
"com.wwdz.ch.db.domain.distribution.DistributionOrderExample"
resultMap=
"BaseResultMap"
>
...
...
@@ -651,7 +748,8 @@
buyer_openid, shop_id, seller_id, amount, address_id, receiver_name, receiver_phone,
receiver_address, logistics_code, waybill, create_time, pay_time, delivery_time,
signed_time, finish_time, update_time, share_record_id, `state`, logistics_state,
`type`
`type`, supply_price, introduce_amount, introduce_rebate, introducer_id, channel_amount,
channel_rebate
</otherwise>
</choose>
from distribution_order
...
...
@@ -663,7 +761,6 @@
</if>
limit 1
</select>
<select
id=
"countGroupByStateForDistributor"
parameterType=
"java.lang.Long"
resultType=
"com.wwdz.ch.db.bean.DistributionOrderNum"
>
select state, count(distribution_order_id) as num from distribution_order where seller_id = #{sellerId} group by state
</select>
...
...
ch-dao/src/main/resources/generatorConfig_new.xml
View file @
5d2e2de9
...
...
@@ -72,7 +72,7 @@
<javaClientGenerator
type=
"XMLMAPPER"
targetPackage=
"com.wwdz.ch.db.mapper.distribution"
targetProject=
"ch-dao/src/main/java"
/>
<table
tableName=
"
group_purchase_config
"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<table
tableName=
"
distribution_order
"
enableCountByExample=
"true"
enableUpdateByExample=
"true"
enableDeleteByExample=
"true"
enableSelectByExample=
"true"
selectByExampleQueryId=
"true"
>
<generatedKey
column=
"id"
sqlStatement=
"Mysql"
identity=
"true"
/>
</table>
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributionOrderServiceImpl.java
View file @
5d2e2de9
...
...
@@ -271,7 +271,16 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
//把介绍人作为该订单的分享链接字段的值
introducerId
=
followFansRecord
.
getIntroducerId
();
}
//查询该用户和藏家的介绍人
FollowFansRecordRequestDto
followFansRecordRequestDto
=
new
FollowFansRecordRequestDto
();
followFansRecordRequestDto
.
setFollowerId
(
auctionConfig
.
getCreatorId
());
followFansRecordRequestDto
.
setFansId
(
auctionRecord
.
getUserId
());
double
rebate
=
distributorProfitService
.
getIntroduceRebate
(
followFansRecordRequestDto
);
DistributionOrder
distributionOrder
=
new
DistributionOrder
();
distributionOrder
.
setIntroducerId
(
introducerId
);
distributionOrder
.
setIntroduceRebate
(
BigDecimal
.
valueOf
(
rebate
));
distributionOrder
.
setItemId
(
dto
.
getItemId
());
distributionOrder
.
setItemNum
(
1
);
distributionOrder
.
setShareRecordId
(
String
.
valueOf
(
introducerId
));
...
...
@@ -292,11 +301,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
DistributorProfit
distributorProfit
=
new
DistributorProfit
();
SupplierItem
supplierItem
=
supplierItemDao
.
findById
(
dto
.
getItemId
());
//查询该用户和藏家的介绍人
FollowFansRecordRequestDto
followFansRecordRequestDto
=
new
FollowFansRecordRequestDto
();
followFansRecordRequestDto
.
setFollowerId
(
auctionConfig
.
getCreatorId
());
followFansRecordRequestDto
.
setFansId
(
auctionRecord
.
getUserId
());
double
rebate
=
distributorProfitService
.
getIntroduceRebate
(
followFansRecordRequestDto
);
double
introduceCost
=
distributionOrder
.
getAmount
().
doubleValue
()
*
rebate
;
//实际订单到账金额
...
...
@@ -313,7 +318,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
distributorProfit
.
setItemNum
(
distributionOrder
.
getItemNum
());
distributorProfit
.
setAmount
(
distributionOrder
.
getAmount
());
distributorProfit
.
setRealAmount
(
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
realAmount
)));
distributorProfit
.
setItemCost
(
auctionConfig
.
getStart
Price
());
distributorProfit
.
setItemCost
(
supplierItem
.
getSupply
Price
());
distributorProfit
.
setChannelCost
(
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
channelServiceCost
)));
distributorProfit
.
setIntroduceCost
(
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
introduceCost
)));
//拍卖订单,藏家的利润就是商品设置的供货价
...
...
@@ -419,7 +424,12 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
//把介绍人作为该订单的分享链接字段的值
introducerId
=
followFansRecord
.
getIntroducerId
();
}
//介绍人分佣
double
rebate
=
distributorProfitService
.
getIntroduceRebate
(
followFansRecordRequestDto
);
DistributionOrder
distributionOrder
=
new
DistributionOrder
();
distributionOrder
.
setIntroduceRebate
(
BigDecimal
.
valueOf
(
rebate
));
distributionOrder
.
setIntroducerId
(
introducerId
);
distributionOrder
.
setItemId
(
itemId
);
distributionOrder
.
setItemNum
(
dto
.
getItemNum
());
distributionOrder
.
setShareRecordId
(
String
.
valueOf
(
introducerId
));
...
...
@@ -461,8 +471,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
//暂时先不考虑
double
channelServiceCost
=
distributionOrder
.
getAmount
().
doubleValue
()
*
channelCostRebate
;
//介绍人分佣,自己推荐获得的订单无需计算介绍佣金
double
rebate
=
distributorProfitService
.
getIntroduceRebate
(
followFansRecordRequestDto
);
double
introduceCost
=
distributionOrder
.
getAmount
().
doubleValue
()
*
rebate
;
distributorProfit
.
setDistributionOrderId
(
distributionOrderId
);
distributorProfit
.
setDistributorId
(
distributionOrder
.
getSellerId
());
...
...
@@ -470,7 +479,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
distributorProfit
.
setItemNum
(
distributionOrder
.
getItemNum
());
distributorProfit
.
setAmount
(
distributionOrder
.
getAmount
());
distributorProfit
.
setRealAmount
(
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
realAmount
)));
distributorProfit
.
setItemCost
(
null
);
distributorProfit
.
setItemCost
(
supplierItem
.
getSupplyPrice
()
);
distributorProfit
.
setChannelCost
(
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
channelServiceCost
)));
distributorProfit
.
setIntroduceCost
(
PriceUtil
.
convertPriceFromStr
(
PriceUtil
.
convertDoubleToString
(
introduceCost
)));
long
profit
=
distributionOrder
.
getAmount
()
-
distributorProfit
.
getChannelCost
()
-
distributorProfit
.
getIntroduceCost
();
...
...
@@ -519,6 +528,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
//把介绍人作为该订单的分享链接字段的值
introducerId
=
followFansRecord
.
getIntroducerId
();
}
//查询该用户和藏家的介绍人
double
rebate
=
distributorProfitService
.
getIntroduceRebate
(
followFansRecordRequestDto
);
String
distributionOrderId
=
IdUtils
.
getOrderNumber
(
DISTRIBUTION_ORDER_PREFIX
);
DistributionOrderRequestDto
prePayDto
=
new
DistributionOrderRequestDto
();
prePayDto
.
setDistributionOrderId
(
distributionOrderId
);
...
...
@@ -535,6 +547,8 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
map
.
put
(
"prepayId"
,
prepayId
);
DistributionOrder
distributionOrder
=
new
DistributionOrder
();
distributionOrder
.
setIntroducerId
(
introducerId
);
distributionOrder
.
setIntroduceRebate
(
BigDecimal
.
valueOf
(
rebate
));
distributionOrder
.
setItemId
(
itemId
);
distributionOrder
.
setItemNum
(
dto
.
getItemNum
());
distributionOrder
.
setShareRecordId
(
String
.
valueOf
(
introducerId
));
...
...
@@ -569,8 +583,7 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
groupPurchaseRecordDao
.
insert
(
groupPurchaseRecord
);
//计算利润
//查询该用户和藏家的介绍人
double
rebate
=
distributorProfitService
.
getIntroduceRebate
(
followFansRecordRequestDto
);
double
introduceCost
=
distributionOrder
.
getAmount
().
doubleValue
()
*
rebate
;
//实际订单到账金额
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SpecialPerformanceServiceImpl.java
View file @
5d2e2de9
...
...
@@ -206,6 +206,8 @@ public class SpecialPerformanceServiceImpl implements SpecialPerformanceService
updateDto
.
setState
(
SpecialPerformanceEnum
.
StateEnum
.
END
.
getCode
());
updateDto
.
setUpdateTime
(
now
);
specialPerformanceDao
.
update
(
updateDto
);
//删除专场商品
offShelvesItemOfSpecialPerformance
(
specialPerformance
.
getId
());
specialPerformance
.
setState
(
SpecialPerformanceEnum
.
StateEnum
.
END
.
getCode
());
}
int
specialPerformanceId
=
specialPerformance
.
getId
();
...
...
@@ -454,6 +456,8 @@ public class SpecialPerformanceServiceImpl implements SpecialPerformanceService
updateDto
.
setState
(
SpecialPerformanceEnum
.
StateEnum
.
END
.
getCode
());
updateDto
.
setUpdateTime
(
now
);
specialPerformanceDao
.
update
(
updateDto
);
//删除专场商品
offShelvesItemOfSpecialPerformance
(
dto
.
getSpecialPerformanceId
());
resultMap
.
put
(
"state"
,
SpecialPerformanceEnum
.
StateEnum
.
END
.
getCode
());
resultMap
.
put
(
"stateName"
,
SpecialPerformanceEnum
.
StateEnum
.
END
.
getDes
());
}
else
{
...
...
@@ -567,7 +571,6 @@ public class SpecialPerformanceServiceImpl implements SpecialPerformanceService
logger
.
info
(
"================专场id: {}, 即将开始通知消息全部发送成功 =============="
,
specialPerformance
.
getId
());
}
private
void
sendStartSubscribeMsg
(
SpecialPerformance
specialPerformance
,
DisposableSubscribeRecord
disposableSubscribeRecord
,
String
msg
){
AuctionOfferNoticeMsg
auctionOfferNoticeMsg
=
new
AuctionOfferNoticeMsg
();
auctionOfferNoticeMsg
.
setSpecialPerformanceTitle
(
specialPerformance
.
getTitle
());
...
...
@@ -588,6 +591,28 @@ public class SpecialPerformanceServiceImpl implements SpecialPerformanceService
disposableSubscribeRecordDao
.
updateInvalid
(
disposableSubscribeRecord
.
getOpenid
(),
disposableSubscribeRecord
.
getTargetId
(),
disposableSubscribeRecord
.
getTemplateId
());
}
@Override
public
Result
offShelvesItemOfSpecialPerformance
(
int
specialPerformanceId
)
{
try
{
List
<
SpecialPerformanceConfig
>
list
=
specialPerformanceConfigDao
.
findAllItem
(
specialPerformanceId
);
for
(
SpecialPerformanceConfig
specialPerformanceConfig
:
list
)
{
long
itemId
=
specialPerformanceConfig
.
getItemId
();
SupplierItem
oldItem
=
supplierItemDao
.
findById
(
itemId
);
if
(
oldItem
.
getIsOnSale
())
{
return
Result
.
failed
(
"先下架商品"
);
}
SupplierItem
supplierItem
=
new
SupplierItem
();
supplierItem
.
setId
(
itemId
);
supplierItem
.
setIsDeleted
(
true
);
supplierItemDao
.
update
(
supplierItem
);
}
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"下架已结束的专场商品 error {}"
,
e
);
}
return
Result
.
failed
();
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/UserAccountDetailServiceImpl.java
View file @
5d2e2de9
...
...
@@ -2,10 +2,14 @@ package com.wwdz.ch.wx.impl.distribution;
import
com.wwdz.ch.core.consts.BillEnum
;
import
com.wwdz.ch.core.consts.CommConsts
;
import
com.wwdz.ch.core.consts.DistributionEnum
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.util.PriceUtil
;
import
com.wwdz.ch.db.dao.CollectorWhiteListDao
;
import
com.wwdz.ch.db.dao.distribution.DistributionOrderDao
;
import
com.wwdz.ch.db.dao.distribution.UserAccountDetailDao
;
import
com.wwdz.ch.db.dao.distribution.UserBillDao
;
import
com.wwdz.ch.db.domain.CollectorWhiteList
;
import
com.wwdz.ch.db.domain.distribution.DistributionOrder
;
import
com.wwdz.ch.db.domain.distribution.DistributorProfit
;
import
com.wwdz.ch.db.domain.distribution.UserAccountDetail
;
...
...
@@ -40,6 +44,12 @@ public class UserAccountDetailServiceImpl implements UserAccountDetailService {
@Autowired
UserBillService
userBillService
;
@Autowired
CollectorWhiteListDao
collectorWhiteListDao
;
@Autowired
DistributionOrderDao
distributionOrderDao
;
@Transactional
(
propagation
=
Propagation
.
REQUIRED
)
@Override
...
...
@@ -84,7 +94,7 @@ public class UserAccountDetailServiceImpl implements UserAccountDetailService {
||
CommConsts
.
SYSTEM_ACCOUNT
.
equals
(
distributionOrder
.
getShareRecordId
()))
{
introduceAccountDetail
.
setUserId
(
CommConsts
.
SYSTEM_ACCOUNT
);
}
else
{
introduceAccountDetail
.
setUserId
(
Long
.
valueOf
(
distributionOrder
.
getShareRecordId
()
));
introduceAccountDetail
.
setUserId
(
distributionOrder
.
getIntroducerId
()
==
null
?
Long
.
valueOf
(
distributionOrder
.
getShareRecordId
())
:
distributionOrder
.
getIntroducerId
(
));
}
introduceAccountDetail
.
setTransactionId
(
distributionOrder
.
getDistributionOrderId
());
introduceAccountDetail
.
setAmount
(
introduceCost
);
...
...
@@ -95,6 +105,20 @@ public class UserAccountDetailServiceImpl implements UserAccountDetailService {
introduceAccountDetail
.
setCreateTime
(
distributionOrder
.
getCreateTime
());
userAccountDetailDao
.
insert
(
introduceAccountDetail
);
//更新订单表中的佣金字段
DistributionOrder
updateDto
=
new
DistributionOrder
();
updateDto
.
setDistributionOrderId
(
distributionOrder
.
getDistributionOrderId
());
updateDto
.
setSupplyPrice
(
distributorProfit
.
getItemCost
());
updateDto
.
setIntroduceAmount
(
introduceCost
);
updateDto
.
setChannelAmount
(
channelCost
);
//查询平台佣金,拍卖和团购的不需要计算平台佣金比例,直接用供货价结算
if
(
distributionOrder
.
getType
()
==
DistributionEnum
.
DistributionTypeEnum
.
FIXED_PRICE
.
getCode
()
||
distributionOrder
.
getType
()
==
DistributionEnum
.
DistributionTypeEnum
.
COLLECT
.
getCode
())
{
CollectorWhiteList
collectorWhiteList
=
collectorWhiteListDao
.
findById
(
distributionOrder
.
getSellerId
());
updateDto
.
setChannelRebate
(
collectorWhiteList
.
getChannelCostRebate
());
}
distributionOrderDao
.
update
(
distributionOrder
);
//计算用户账单
Result
result
=
userBillService
.
payCalculate
(
distributionOrder
,
distributorProfit
);
if
(!
result
.
getSuccess
())
{
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/SpecialPerformanceNoticeJob.java
View file @
5d2e2de9
...
...
@@ -24,6 +24,7 @@ import com.wwdz.ch.db.dto.request.distribution.DisposableSubscribeRecordRequestD
import
com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceConfigRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.SpecialPerformanceRequestDto
;
import
com.wwdz.ch.wx.service.distribution.DistributionOrderService
;
import
com.wwdz.ch.wx.service.distribution.SpecialPerformanceService
;
import
com.xxdxxs.utils.DateUtils
;
import
com.xxdxxs.utils.JsonUtils
;
import
com.xxdxxs.utils.StringUtils
;
...
...
@@ -70,6 +71,9 @@ public class SpecialPerformanceNoticeJob {
@Autowired
SpecialPerformanceConfigDao
specialPerformanceConfigDao
;
@Autowired
SpecialPerformanceService
specialPerformanceService
;
@Autowired
RedissonClient
redissonClient
;
...
...
@@ -424,11 +428,15 @@ public class SpecialPerformanceNoticeJob {
}
else
if
(
specialPerformance
.
getEndTime
().
before
(
now
))
{
//超过结束时间,状态设置为结束
specialPerformanceDao
.
updateState
(
specialPerformance
.
getId
(),
SpecialPerformanceEnum
.
StateEnum
.
END
.
getCode
());
//删除专场商品
specialPerformanceService
.
offShelvesItemOfSpecialPerformance
(
specialPerformance
.
getId
());
}
}
else
if
(
specialPerformance
.
getState
().
intValue
()
==
SpecialPerformanceEnum
.
StateEnum
.
PROCESSING
.
getCode
())
{
//超过结束时间,状态设置为结束
if
(
specialPerformance
.
getEndTime
().
before
(
now
))
{
specialPerformanceDao
.
updateState
(
specialPerformance
.
getId
(),
SpecialPerformanceEnum
.
StateEnum
.
END
.
getCode
());
//删除专场商品
specialPerformanceService
.
offShelvesItemOfSpecialPerformance
(
specialPerformance
.
getId
());
}
}
//查询该专场下的商品,自动更新状态
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/service/distribution/SpecialPerformanceService.java
View file @
5d2e2de9
...
...
@@ -27,6 +27,13 @@ public interface SpecialPerformanceService {
*/
Result
findItemList
(
SpecialPerformanceRequestDto
dto
);
/**
* 专场结束删除对应商品
* @param specialPerformanceId
* @return
*/
Result
offShelvesItemOfSpecialPerformance
(
int
specialPerformanceId
);
/**
* 手动发送专场进行中短信给用户
* @return
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/web/distribution/GroupPurchaseController.java
View file @
5d2e2de9
...
...
@@ -44,8 +44,8 @@ public class GroupPurchaseController {
@ApiOperation
(
value
=
"取消团购订单"
)
@PostMapping
(
"/cancel
Deposit
"
)
public
Result
cancel
Deposit
(
@RequestBody
GroupPurchaseRecordRequestDto
dto
)
{
@PostMapping
(
"/cancel
Order
"
)
public
Result
cancel
Order
(
@RequestBody
GroupPurchaseRecordRequestDto
dto
)
{
logger
.
info
(
"取消团购订单,请求参数:{}"
,
JSON
.
toJSONString
(
dto
));
if
(!
StringUtils
.
isAllNotEmpty
(
dto
.
getDistributionOrderId
()))
{
return
Result
.
failed
(
ResultCode
.
PARAM_ERROR
);
...
...
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