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
526121a2
Commit
526121a2
authored
Nov 06, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
保证金
parent
96940a93
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
529 additions
and
19 deletions
+529
-19
ch-core/src/main/java/com/wwdz/ch/core/consts/CommConsts.java
...ore/src/main/java/com/wwdz/ch/core/consts/CommConsts.java
+5
-0
ch-core/src/main/java/com/wwdz/ch/core/util/PriceUtil.java
ch-core/src/main/java/com/wwdz/ch/core/util/PriceUtil.java
+5
-0
ch-dao/src/main/java/com/wwdz/ch/db/domain/openShop/UserAccount.java
...main/java/com/wwdz/ch/db/domain/openShop/UserAccount.java
+11
-4
ch-dao/src/main/java/com/wwdz/ch/db/domain/openShop/UserAccountExample.java
...va/com/wwdz/ch/db/domain/openShop/UserAccountExample.java
+132
-0
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/openShop/EarnestRecordRequestDto.java
...z/ch/db/dto/request/openShop/EarnestRecordRequestDto.java
+5
-0
ch-dao/src/main/java/com/wwdz/ch/db/mapper/openShop/UserAccountMapper.java
...ava/com/wwdz/ch/db/mapper/openShop/UserAccountMapper.java
+0
-2
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/openShop/UserAccountMapper.xml
...rces/com/wwdz/ch/db/mapper/openShop/UserAccountMapper.xml
+331
-12
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/AuctionRecordServiceImpl.java
...wdz/ch/wx/impl/distribution/AuctionRecordServiceImpl.java
+5
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/openShop/AuctionEarnestServiceImpl.java
...m/wwdz/ch/wx/impl/openShop/AuctionEarnestServiceImpl.java
+35
-1
No files found.
ch-core/src/main/java/com/wwdz/ch/core/consts/CommConsts.java
View file @
526121a2
...
...
@@ -150,6 +150,11 @@ public interface CommConsts {
*/
public
final
static
String
AUCTION_EARNEST_ORDER_PREFIX
=
"AE"
;
/**
* 保证金换成出价额度比例为1:20,换成百分比为5%
*/
public
final
static
String
EARNEST_REBATE
=
"0.05"
;
/**
* 平台收货地址
...
...
ch-core/src/main/java/com/wwdz/ch/core/util/PriceUtil.java
View file @
526121a2
...
...
@@ -48,6 +48,11 @@ public class PriceUtil {
}
public
static
Long
convertToLong
(
BigDecimal
number
){
return
number
.
multiply
(
new
BigDecimal
(
100
)).
longValue
();
}
public
static
Long
convertPriceUnit
(
Long
price
){
BigDecimal
bigDecimal
=
new
BigDecimal
(
price
);
bigDecimal
=
bigDecimal
.
multiply
(
new
BigDecimal
(
100
));
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/openShop/UserAccount.java
View file @
526121a2
...
...
@@ -4,8 +4,6 @@ import java.io.Serializable;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Date
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
/**
...
...
@@ -13,7 +11,7 @@ import lombok.Data;
* @date 2024/11/06
*/
@Data
public
class
UserAccount
implements
Entity
{
public
class
UserAccount
implements
Serializable
{
private
Long
id
;
/**
...
...
@@ -52,10 +50,15 @@ public class UserAccount implements Entity {
private
Long
earnestAmount
;
/**
* 保证金可用
额度
* 保证金可用
金额
*/
private
Long
earnestUsableAmount
;
/**
* 赠送的保证金金额
*/
private
Long
giftEarnestAmount
;
/**
* 创建时间
*/
...
...
@@ -83,6 +86,7 @@ public class UserAccount implements Entity {
sb
.
append
(
", introduceWaitEntryAmount="
).
append
(
introduceWaitEntryAmount
);
sb
.
append
(
", earnestAmount="
).
append
(
earnestAmount
);
sb
.
append
(
", earnestUsableAmount="
).
append
(
earnestUsableAmount
);
sb
.
append
(
", giftEarnestAmount="
).
append
(
giftEarnestAmount
);
sb
.
append
(
", createTime="
).
append
(
createTime
);
sb
.
append
(
", updateTime="
).
append
(
updateTime
);
sb
.
append
(
", serialVersionUID="
).
append
(
serialVersionUID
);
...
...
@@ -111,6 +115,7 @@ public class UserAccount implements Entity {
&&
(
this
.
getIntroduceWaitEntryAmount
()
==
null
?
other
.
getIntroduceWaitEntryAmount
()
==
null
:
this
.
getIntroduceWaitEntryAmount
().
equals
(
other
.
getIntroduceWaitEntryAmount
()))
&&
(
this
.
getEarnestAmount
()
==
null
?
other
.
getEarnestAmount
()
==
null
:
this
.
getEarnestAmount
().
equals
(
other
.
getEarnestAmount
()))
&&
(
this
.
getEarnestUsableAmount
()
==
null
?
other
.
getEarnestUsableAmount
()
==
null
:
this
.
getEarnestUsableAmount
().
equals
(
other
.
getEarnestUsableAmount
()))
&&
(
this
.
getGiftEarnestAmount
()
==
null
?
other
.
getGiftEarnestAmount
()
==
null
:
this
.
getGiftEarnestAmount
().
equals
(
other
.
getGiftEarnestAmount
()))
&&
(
this
.
getCreateTime
()
==
null
?
other
.
getCreateTime
()
==
null
:
this
.
getCreateTime
().
equals
(
other
.
getCreateTime
()))
&&
(
this
.
getUpdateTime
()
==
null
?
other
.
getUpdateTime
()
==
null
:
this
.
getUpdateTime
().
equals
(
other
.
getUpdateTime
()));
}
...
...
@@ -128,6 +133,7 @@ public class UserAccount implements Entity {
result
=
prime
*
result
+
((
getIntroduceWaitEntryAmount
()
==
null
)
?
0
:
getIntroduceWaitEntryAmount
().
hashCode
());
result
=
prime
*
result
+
((
getEarnestAmount
()
==
null
)
?
0
:
getEarnestAmount
().
hashCode
());
result
=
prime
*
result
+
((
getEarnestUsableAmount
()
==
null
)
?
0
:
getEarnestUsableAmount
().
hashCode
());
result
=
prime
*
result
+
((
getGiftEarnestAmount
()
==
null
)
?
0
:
getGiftEarnestAmount
().
hashCode
());
result
=
prime
*
result
+
((
getCreateTime
()
==
null
)
?
0
:
getCreateTime
().
hashCode
());
result
=
prime
*
result
+
((
getUpdateTime
()
==
null
)
?
0
:
getUpdateTime
().
hashCode
());
return
result
;
...
...
@@ -150,6 +156,7 @@ public class UserAccount implements Entity {
introduceWaitEntryAmount
(
"introduce_wait_entry_amount"
,
"introduceWaitEntryAmount"
,
"BIGINT"
,
false
),
earnestAmount
(
"earnest_amount"
,
"earnestAmount"
,
"BIGINT"
,
false
),
earnestUsableAmount
(
"earnest_usable_amount"
,
"earnestUsableAmount"
,
"BIGINT"
,
false
),
giftEarnestAmount
(
"gift_earnest_amount"
,
"giftEarnestAmount"
,
"BIGINT"
,
false
),
createTime
(
"create_time"
,
"createTime"
,
"TIMESTAMP"
,
false
),
updateTime
(
"update_time"
,
"updateTime"
,
"TIMESTAMP"
,
false
);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/openShop/UserAccountExample.java
View file @
526121a2
...
...
@@ -1336,6 +1336,138 @@ public class UserAccountExample {
return
(
Criteria
)
this
;
}
public
Criteria
andGiftEarnestAmountIsNull
()
{
addCriterion
(
"gift_earnest_amount is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGiftEarnestAmountIsNotNull
()
{
addCriterion
(
"gift_earnest_amount is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGiftEarnestAmountEqualTo
(
Long
value
)
{
addCriterion
(
"gift_earnest_amount ="
,
value
,
"giftEarnestAmount"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andGiftEarnestAmountEqualToColumn
(
UserAccount
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"gift_earnest_amount = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andGiftEarnestAmountNotEqualTo
(
Long
value
)
{
addCriterion
(
"gift_earnest_amount <>"
,
value
,
"giftEarnestAmount"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andGiftEarnestAmountNotEqualToColumn
(
UserAccount
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"gift_earnest_amount <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andGiftEarnestAmountGreaterThan
(
Long
value
)
{
addCriterion
(
"gift_earnest_amount >"
,
value
,
"giftEarnestAmount"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andGiftEarnestAmountGreaterThanColumn
(
UserAccount
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"gift_earnest_amount > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andGiftEarnestAmountGreaterThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"gift_earnest_amount >="
,
value
,
"giftEarnestAmount"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andGiftEarnestAmountGreaterThanOrEqualToColumn
(
UserAccount
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"gift_earnest_amount >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andGiftEarnestAmountLessThan
(
Long
value
)
{
addCriterion
(
"gift_earnest_amount <"
,
value
,
"giftEarnestAmount"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andGiftEarnestAmountLessThanColumn
(
UserAccount
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"gift_earnest_amount < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andGiftEarnestAmountLessThanOrEqualTo
(
Long
value
)
{
addCriterion
(
"gift_earnest_amount <="
,
value
,
"giftEarnestAmount"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_account
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andGiftEarnestAmountLessThanOrEqualToColumn
(
UserAccount
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"gift_earnest_amount <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andGiftEarnestAmountIn
(
List
<
Long
>
values
)
{
addCriterion
(
"gift_earnest_amount in"
,
values
,
"giftEarnestAmount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGiftEarnestAmountNotIn
(
List
<
Long
>
values
)
{
addCriterion
(
"gift_earnest_amount not in"
,
values
,
"giftEarnestAmount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGiftEarnestAmountBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"gift_earnest_amount between"
,
value1
,
value2
,
"giftEarnestAmount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andGiftEarnestAmountNotBetween
(
Long
value1
,
Long
value2
)
{
addCriterion
(
"gift_earnest_amount not between"
,
value1
,
value2
,
"giftEarnestAmount"
);
return
(
Criteria
)
this
;
}
public
Criteria
andCreateTimeIsNull
()
{
addCriterion
(
"create_time is null"
);
return
(
Criteria
)
this
;
...
...
ch-dao/src/main/java/com/wwdz/ch/db/dto/request/openShop/EarnestRecordRequestDto.java
View file @
526121a2
...
...
@@ -30,6 +30,11 @@ public class EarnestRecordRequestDto extends BaseRequestDto implements Entity {
*/
private
String
amount
;
/**
* 拍卖出价金额
*/
private
Long
auctionPrice
;
/**
* -1扣除1新增
*/
...
...
ch-dao/src/main/java/com/wwdz/ch/db/mapper/openShop/UserAccountMapper.java
View file @
526121a2
...
...
@@ -3,10 +3,8 @@ package com.wwdz.ch.db.mapper.openShop;
import
com.wwdz.ch.db.domain.openShop.UserAccount
;
import
com.wwdz.ch.db.domain.openShop.UserAccountExample
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
@Mapper
public
interface
UserAccountMapper
{
long
countByExample
(
UserAccountExample
example
);
...
...
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/openShop/UserAccountMapper.xml
View file @
526121a2
...
...
@@ -11,6 +11,7 @@
<result
column=
"introduce_wait_entry_amount"
jdbcType=
"BIGINT"
property=
"introduceWaitEntryAmount"
/>
<result
column=
"earnest_amount"
jdbcType=
"BIGINT"
property=
"earnestAmount"
/>
<result
column=
"earnest_usable_amount"
jdbcType=
"BIGINT"
property=
"earnestUsableAmount"
/>
<result
column=
"gift_earnest_amount"
jdbcType=
"BIGINT"
property=
"giftEarnestAmount"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
...
...
@@ -74,8 +75,8 @@
</sql>
<sql
id=
"Base_Column_List"
>
id, user_id, guarantee_amount, goods_amount, goods_wait_entry_amount, introduce_amount,
introduce_wait_entry_amount, earnest_amount, earnest_usable_amount,
create_time
,
update_time
introduce_wait_entry_amount, earnest_amount, earnest_usable_amount,
gift_earnest_amount
,
create_time,
update_time
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.openShop.UserAccountExample"
resultMap=
"BaseResultMap"
>
select
...
...
@@ -111,8 +112,8 @@
</when>
<otherwise>
id, user_id, guarantee_amount, goods_amount, goods_wait_entry_amount, introduce_amount,
introduce_wait_entry_amount, earnest_amount, earnest_usable_amount,
create_time
,
update_time
introduce_wait_entry_amount, earnest_amount, earnest_usable_amount,
gift_earnest_amount
,
create_time,
update_time
</otherwise>
</choose>
from user_account
...
...
@@ -144,8 +145,8 @@
</when>
<otherwise>
id, user_id, guarantee_amount, goods_amount, goods_wait_entry_amount, introduce_amount,
introduce_wait_entry_amount, earnest_amount, earnest_usable_amount,
create_time
,
update_time
introduce_wait_entry_amount, earnest_amount, earnest_usable_amount,
gift_earnest_amount
,
create_time,
update_time
</otherwise>
</choose>
from user_account
...
...
@@ -167,12 +168,12 @@
</selectKey>
insert into user_account (user_id, guarantee_amount, goods_amount,
goods_wait_entry_amount, introduce_amount, introduce_wait_entry_amount,
earnest_amount, earnest_usable_amount,
create_time
,
update_time)
earnest_amount, earnest_usable_amount,
gift_earnest_amount
,
create_time,
update_time)
values (#{userId,jdbcType=BIGINT}, #{guaranteeAmount,jdbcType=BIGINT}, #{goodsAmount,jdbcType=BIGINT},
#{goodsWaitEntryAmount,jdbcType=BIGINT}, #{introduceAmount,jdbcType=BIGINT}, #{introduceWaitEntryAmount,jdbcType=BIGINT},
#{earnestAmount,jdbcType=BIGINT}, #{earnestUsableAmount,jdbcType=BIGINT}, #{
createTime,jdbcType=TIMESTAMP
},
#{updateTime,jdbcType=TIMESTAMP})
#{earnestAmount,jdbcType=BIGINT}, #{earnestUsableAmount,jdbcType=BIGINT}, #{
giftEarnestAmount,jdbcType=BIGINT
},
#{
createTime,jdbcType=TIMESTAMP}, #{
updateTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.openShop.UserAccount"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
...
...
@@ -204,6 +205,9 @@
<if
test=
"earnestUsableAmount != null"
>
earnest_usable_amount,
</if>
<if
test=
"giftEarnestAmount != null"
>
gift_earnest_amount,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
...
...
@@ -236,6 +240,9 @@
<if
test=
"earnestUsableAmount != null"
>
#{earnestUsableAmount,jdbcType=BIGINT},
</if>
<if
test=
"giftEarnestAmount != null"
>
#{giftEarnestAmount,jdbcType=BIGINT},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -280,6 +287,9 @@
<if
test=
"record.earnestUsableAmount != null"
>
earnest_usable_amount = #{record.earnestUsableAmount,jdbcType=BIGINT},
</if>
<if
test=
"record.giftEarnestAmount != null"
>
gift_earnest_amount = #{record.giftEarnestAmount,jdbcType=BIGINT},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -302,6 +312,7 @@
introduce_wait_entry_amount = #{record.introduceWaitEntryAmount,jdbcType=BIGINT},
earnest_amount = #{record.earnestAmount,jdbcType=BIGINT},
earnest_usable_amount = #{record.earnestUsableAmount,jdbcType=BIGINT},
gift_earnest_amount = #{record.giftEarnestAmount,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if
test=
"_parameter != null"
>
...
...
@@ -335,6 +346,9 @@
<if
test=
"earnestUsableAmount != null"
>
earnest_usable_amount = #{earnestUsableAmount,jdbcType=BIGINT},
</if>
<if
test=
"giftEarnestAmount != null"
>
gift_earnest_amount = #{giftEarnestAmount,jdbcType=BIGINT},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
...
...
@@ -354,6 +368,7 @@
introduce_wait_entry_amount = #{introduceWaitEntryAmount,jdbcType=BIGINT},
earnest_amount = #{earnestAmount,jdbcType=BIGINT},
earnest_usable_amount = #{earnestUsableAmount,jdbcType=BIGINT},
gift_earnest_amount = #{giftEarnestAmount,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
...
...
@@ -392,8 +407,8 @@
</when>
<otherwise>
id, user_id, guarantee_amount, goods_amount, goods_wait_entry_amount, introduce_amount,
introduce_wait_entry_amount, earnest_amount, earnest_usable_amount,
create_time
,
update_time
introduce_wait_entry_amount, earnest_amount, earnest_usable_amount,
gift_earnest_amount
,
create_time,
update_time
</otherwise>
</choose>
from user_account
...
...
@@ -405,4 +420,308 @@
</if>
limit 1
</select>
<resultMap
id=
"BaseResultMap"
type=
"com.wwdz.ch.db.domain.openShop.UserAccount"
>
<id
column=
"id"
jdbcType=
"BIGINT"
property=
"id"
/>
<result
column=
"user_id"
jdbcType=
"BIGINT"
property=
"userId"
/>
<result
column=
"guarantee_amount"
jdbcType=
"BIGINT"
property=
"guaranteeAmount"
/>
<result
column=
"goods_amount"
jdbcType=
"BIGINT"
property=
"goodsAmount"
/>
<result
column=
"goods_wait_entry_amount"
jdbcType=
"BIGINT"
property=
"goodsWaitEntryAmount"
/>
<result
column=
"introduce_amount"
jdbcType=
"BIGINT"
property=
"introduceAmount"
/>
<result
column=
"introduce_wait_entry_amount"
jdbcType=
"BIGINT"
property=
"introduceWaitEntryAmount"
/>
<result
column=
"earnest_amount"
jdbcType=
"BIGINT"
property=
"earnestAmount"
/>
<result
column=
"earnest_usable_amount"
jdbcType=
"BIGINT"
property=
"earnestUsableAmount"
/>
<result
column=
"create_time"
jdbcType=
"TIMESTAMP"
property=
"createTime"
/>
<result
column=
"update_time"
jdbcType=
"TIMESTAMP"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<where>
<foreach
collection=
"oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Update_By_Example_Where_Clause"
>
<where>
<foreach
collection=
"example.oredCriteria"
item=
"criteria"
separator=
"or"
>
<if
test=
"criteria.valid"
>
<trim
prefix=
"("
prefixOverrides=
"and"
suffix=
")"
>
<foreach
collection=
"criteria.criteria"
item=
"criterion"
>
<choose>
<when
test=
"criterion.noValue"
>
and ${criterion.condition}
</when>
<when
test=
"criterion.singleValue"
>
and ${criterion.condition} #{criterion.value}
</when>
<when
test=
"criterion.betweenValue"
>
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when
test=
"criterion.listValue"
>
and ${criterion.condition}
<foreach
close=
")"
collection=
"criterion.value"
item=
"listItem"
open=
"("
separator=
","
>
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql
id=
"Base_Column_List"
>
id, user_id, guarantee_amount, goods_amount, goods_wait_entry_amount, introduce_amount,
introduce_wait_entry_amount, earnest_amount, earnest_usable_amount, create_time,
update_time
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.openShop.UserAccountExample"
resultMap=
"BaseResultMap"
>
select
<if
test=
"distinct"
>
distinct
</if>
'true' as QUERYID,
<include
refid=
"Base_Column_List"
/>
from user_account
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
<if
test=
"orderByClause != null"
>
order by ${orderByClause}
</if>
</select>
<select
id=
"selectByPrimaryKey"
parameterType=
"java.lang.Long"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from user_account
where id = #{id,jdbcType=BIGINT}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.Long"
>
delete from user_account
where id = #{id,jdbcType=BIGINT}
</delete>
<delete
id=
"deleteByExample"
parameterType=
"com.wwdz.ch.db.domain.openShop.UserAccountExample"
>
delete from user_account
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</delete>
<insert
id=
"insert"
parameterType=
"com.wwdz.ch.db.domain.openShop.UserAccount"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into user_account (user_id, guarantee_amount, goods_amount,
goods_wait_entry_amount, introduce_amount, introduce_wait_entry_amount,
earnest_amount, earnest_usable_amount, create_time,
update_time)
values (#{userId,jdbcType=BIGINT}, #{guaranteeAmount,jdbcType=BIGINT}, #{goodsAmount,jdbcType=BIGINT},
#{goodsWaitEntryAmount,jdbcType=BIGINT}, #{introduceAmount,jdbcType=BIGINT}, #{introduceWaitEntryAmount,jdbcType=BIGINT},
#{earnestAmount,jdbcType=BIGINT}, #{earnestUsableAmount,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.openShop.UserAccount"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into user_account
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"userId != null"
>
user_id,
</if>
<if
test=
"guaranteeAmount != null"
>
guarantee_amount,
</if>
<if
test=
"goodsAmount != null"
>
goods_amount,
</if>
<if
test=
"goodsWaitEntryAmount != null"
>
goods_wait_entry_amount,
</if>
<if
test=
"introduceAmount != null"
>
introduce_amount,
</if>
<if
test=
"introduceWaitEntryAmount != null"
>
introduce_wait_entry_amount,
</if>
<if
test=
"earnestAmount != null"
>
earnest_amount,
</if>
<if
test=
"earnestUsableAmount != null"
>
earnest_usable_amount,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"updateTime != null"
>
update_time,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"userId != null"
>
#{userId,jdbcType=BIGINT},
</if>
<if
test=
"guaranteeAmount != null"
>
#{guaranteeAmount,jdbcType=BIGINT},
</if>
<if
test=
"goodsAmount != null"
>
#{goodsAmount,jdbcType=BIGINT},
</if>
<if
test=
"goodsWaitEntryAmount != null"
>
#{goodsWaitEntryAmount,jdbcType=BIGINT},
</if>
<if
test=
"introduceAmount != null"
>
#{introduceAmount,jdbcType=BIGINT},
</if>
<if
test=
"introduceWaitEntryAmount != null"
>
#{introduceWaitEntryAmount,jdbcType=BIGINT},
</if>
<if
test=
"earnestAmount != null"
>
#{earnestAmount,jdbcType=BIGINT},
</if>
<if
test=
"earnestUsableAmount != null"
>
#{earnestUsableAmount,jdbcType=BIGINT},
</if>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
#{updateTime,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select
id=
"countByExample"
parameterType=
"com.wwdz.ch.db.domain.openShop.UserAccountExample"
resultType=
"java.lang.Long"
>
select count(*) from user_account
<if
test=
"_parameter != null"
>
<include
refid=
"Example_Where_Clause"
/>
</if>
</select>
<update
id=
"updateByExampleSelective"
parameterType=
"map"
>
update user_account
<set>
<if
test=
"record.id != null"
>
id = #{record.id,jdbcType=BIGINT},
</if>
<if
test=
"record.userId != null"
>
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if
test=
"record.guaranteeAmount != null"
>
guarantee_amount = #{record.guaranteeAmount,jdbcType=BIGINT},
</if>
<if
test=
"record.goodsAmount != null"
>
goods_amount = #{record.goodsAmount,jdbcType=BIGINT},
</if>
<if
test=
"record.goodsWaitEntryAmount != null"
>
goods_wait_entry_amount = #{record.goodsWaitEntryAmount,jdbcType=BIGINT},
</if>
<if
test=
"record.introduceAmount != null"
>
introduce_amount = #{record.introduceAmount,jdbcType=BIGINT},
</if>
<if
test=
"record.introduceWaitEntryAmount != null"
>
introduce_wait_entry_amount = #{record.introduceWaitEntryAmount,jdbcType=BIGINT},
</if>
<if
test=
"record.earnestAmount != null"
>
earnest_amount = #{record.earnestAmount,jdbcType=BIGINT},
</if>
<if
test=
"record.earnestUsableAmount != null"
>
earnest_usable_amount = #{record.earnestUsableAmount,jdbcType=BIGINT},
</if>
<if
test=
"record.createTime != null"
>
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"record.updateTime != null"
>
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
</set>
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByExample"
parameterType=
"map"
>
update user_account
set id = #{record.id,jdbcType=BIGINT},
user_id = #{record.userId,jdbcType=BIGINT},
guarantee_amount = #{record.guaranteeAmount,jdbcType=BIGINT},
goods_amount = #{record.goodsAmount,jdbcType=BIGINT},
goods_wait_entry_amount = #{record.goodsWaitEntryAmount,jdbcType=BIGINT},
introduce_amount = #{record.introduceAmount,jdbcType=BIGINT},
introduce_wait_entry_amount = #{record.introduceWaitEntryAmount,jdbcType=BIGINT},
earnest_amount = #{record.earnestAmount,jdbcType=BIGINT},
earnest_usable_amount = #{record.earnestUsableAmount,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
<if
test=
"_parameter != null"
>
<include
refid=
"Update_By_Example_Where_Clause"
/>
</if>
</update>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.wwdz.ch.db.domain.openShop.UserAccount"
>
update user_account
<set>
<if
test=
"userId != null"
>
user_id = #{userId,jdbcType=BIGINT},
</if>
<if
test=
"guaranteeAmount != null"
>
guarantee_amount = #{guaranteeAmount,jdbcType=BIGINT},
</if>
<if
test=
"goodsAmount != null"
>
goods_amount = #{goodsAmount,jdbcType=BIGINT},
</if>
<if
test=
"goodsWaitEntryAmount != null"
>
goods_wait_entry_amount = #{goodsWaitEntryAmount,jdbcType=BIGINT},
</if>
<if
test=
"introduceAmount != null"
>
introduce_amount = #{introduceAmount,jdbcType=BIGINT},
</if>
<if
test=
"introduceWaitEntryAmount != null"
>
introduce_wait_entry_amount = #{introduceWaitEntryAmount,jdbcType=BIGINT},
</if>
<if
test=
"earnestAmount != null"
>
earnest_amount = #{earnestAmount,jdbcType=BIGINT},
</if>
<if
test=
"earnestUsableAmount != null"
>
earnest_usable_amount = #{earnestUsableAmount,jdbcType=BIGINT},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update
id=
"updateByPrimaryKey"
parameterType=
"com.wwdz.ch.db.domain.openShop.UserAccount"
>
update user_account
set user_id = #{userId,jdbcType=BIGINT},
guarantee_amount = #{guaranteeAmount,jdbcType=BIGINT},
goods_amount = #{goodsAmount,jdbcType=BIGINT},
goods_wait_entry_amount = #{goodsWaitEntryAmount,jdbcType=BIGINT},
introduce_amount = #{introduceAmount,jdbcType=BIGINT},
introduce_wait_entry_amount = #{introduceWaitEntryAmount,jdbcType=BIGINT},
earnest_amount = #{earnestAmount,jdbcType=BIGINT},
earnest_usable_amount = #{earnestUsableAmount,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>
\ No newline at end of file
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/AuctionRecordServiceImpl.java
View file @
526121a2
...
...
@@ -160,6 +160,9 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
}
//把上次的最高价记录改为落后
auctionRecordDao
.
updateNotLeadById
(
auctionRecord
.
getId
());
//把上次出价的用户保证金释放
//发送模板消息,提示用户出价被超越
String
openId
=
sendMsgService
.
getOpenIdByUserId
(
auctionRecord
.
getUserId
());
if
(
com
.
xxdxxs
.
utils
.
StringUtils
.
hasLength
(
openId
))
{
...
...
@@ -201,6 +204,8 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
//更新专场配置中商品的当前价
specialPerformanceConfigDao
.
updatePrice
(
itemId
,
price
);
//把当前领先的用户的保证金额度占用
//如果当前时间是拍卖截止时间的最后五分钟内,则再延长五分钟
Instant
instant
=
endTime
.
toInstant
().
minus
(
Duration
.
ofMinutes
(
5
));
Date
time
=
Date
.
from
(
instant
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/openShop/AuctionEarnestServiceImpl.java
View file @
526121a2
...
...
@@ -10,6 +10,8 @@ import com.wwdz.ch.db.dao.openShop.EarnestOrderDao;
import
com.wwdz.ch.db.dao.openShop.EarnestRecordDao
;
import
com.wwdz.ch.db.dao.openShop.UserAccountDao
;
import
com.wwdz.ch.db.domain.openShop.EarnestOrder
;
import
com.wwdz.ch.db.domain.openShop.EarnestRecord
;
import
com.wwdz.ch.db.domain.openShop.UserAccount
;
import
com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto
;
import
com.wwdz.ch.db.dto.request.openShop.EarnestOrderRequestDto
;
import
com.wwdz.ch.db.dto.request.openShop.EarnestRecordRequestDto
;
...
...
@@ -18,6 +20,10 @@ import org.slf4j.Logger;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.interceptor.TransactionAspectSupport
;
import
java.math.BigDecimal
;
import
java.util.Date
;
@Service
...
...
@@ -81,18 +87,46 @@ public class AuctionEarnestServiceImpl implements AuctionEarnestService {
}
@Transactional
@Override
public
Result
occupyEarnest
(
EarnestRecordRequestDto
dto
)
{
try
{
EarnestRecord
earnestRecord
=
new
EarnestRecord
();
long
auctionPrice
=
dto
.
getAuctionPrice
();
BigDecimal
earnestAmount
=
new
BigDecimal
(
String
.
valueOf
(
auctionPrice
)).
multiply
(
new
BigDecimal
(
CommConsts
.
EARNEST_REBATE
));
//换算成对应占用的保证金
long
occupyAmount
=
earnestAmount
.
longValue
();
earnestRecord
.
setAmount
(
earnestAmount
.
longValue
());
earnestRecord
.
setItemId
(
dto
.
getItemId
());
earnestRecord
.
setSpecialPerformanceId
(
dto
.
getSpecialPerformanceId
());
earnestRecord
.
setEntryType
(
EarnestEnum
.
EntryEnum
.
DEDUCT
.
getCode
());
earnestRecord
.
setCreateTime
(
new
Date
());
earnestRecord
.
setUpdateTime
(
new
Date
());
earnestRecord
.
setType
(
EarnestEnum
.
TypeEnum
.
OCCUPY
.
getCode
());
earnestRecord
.
setState
(
EarnestEnum
.
StateEnum
.
VALID
.
getCode
());
earnestRecordDao
.
insert
(
earnestRecord
);
//用户账户,更新保证金额度
UserAccount
userAccount
=
new
UserAccount
();
userAccount
.
setUserId
(
dto
.
getUserId
());
return
Result
.
success
();
}
catch
(
Exception
e
)
{
logger
.
error
(
"占用保证金失败 error : {}"
,
e
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
return
Result
.
failed
();
}
@Transactional
@Override
public
Result
releaseEarnest
(
EarnestRecordRequestDto
dto
)
{
return
null
;
try
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"释放保证金失败 error : {}"
,
e
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
return
Result
.
failed
();
}
}
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