Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
pseer
gxpt_ht
Commits
061a7c79
Commit
061a7c79
authored
Sep 12, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'refs/heads/dev' into test
parents
04476972
8dfce3f6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
13 deletions
+47
-13
EquityMembersOrderConfig.java
...in/java/share/system/domain/EquityMembersOrderConfig.java
+5
-6
EquityMembersOrderConfigServiceImpl.java
...tem/service/impl/EquityMembersOrderConfigServiceImpl.java
+42
-0
EquityMembersOrderConfigMapper.xml
...esources/mapper/system/EquityMembersOrderConfigMapper.xml
+0
-6
MemberConfigMapper.xml
...m/src/main/resources/mapper/system/MemberConfigMapper.xml
+0
-1
No files found.
share-system/src/main/java/share/system/domain/EquityMembersOrderConfig.java
View file @
061a7c79
...
...
@@ -35,11 +35,11 @@ public class EquityMembersOrderConfig extends BaseEntity {
@Excel
(
name
=
"默认会员等级"
)
private
Long
defaultLevel
;
/**
* 会员配置id
*/
@Excel
(
name
=
"会员配置id"
)
private
Long
memberConfigId
;
//
/**
//
* 会员配置id
//
*/
//
@Excel(name = "会员配置id")
//
private Long memberConfigId;
/**
* 所需金额
...
...
@@ -70,7 +70,6 @@ public class EquityMembersOrderConfig extends BaseEntity {
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
.
append
(
"id"
,
getId
())
.
append
(
"defaultLevel"
,
getDefaultLevel
())
.
append
(
"memberConfigId"
,
getMemberConfigId
())
.
append
(
"requiredAmount"
,
getRequiredAmount
())
.
append
(
"validityPeriod"
,
getValidityPeriod
())
.
append
(
"isDelete"
,
getIsDelete
())
...
...
share-system/src/main/java/share/system/service/impl/EquityMembersOrderConfigServiceImpl.java
View file @
061a7c79
package
share
.
system
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
share.common.utils.DateUtils
;
import
share.system.domain.EquityMembersOrderConfig
;
import
share.system.domain.MemberConfig
;
import
share.system.mapper.EquityMembersOrderConfigMapper
;
import
share.system.service.EquityMembersOrderConfigService
;
import
share.system.service.MemberConfigService
;
import
java.math.BigDecimal
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
* 权益会员订单配置Service业务层处理
...
...
@@ -20,6 +28,8 @@ import java.util.List;
public
class
EquityMembersOrderConfigServiceImpl
extends
ServiceImpl
<
EquityMembersOrderConfigMapper
,
EquityMembersOrderConfig
>
implements
EquityMembersOrderConfigService
{
@Autowired
private
EquityMembersOrderConfigMapper
equityMembersOrderConfigMapper
;
@Autowired
private
MemberConfigService
memberConfigService
;
/**
* 查询权益会员订单配置
...
...
@@ -51,6 +61,22 @@ public class EquityMembersOrderConfigServiceImpl extends ServiceImpl<EquityMembe
*/
@Override
public
int
insertEquityMembersOrderConfig
(
EquityMembersOrderConfig
equityMembersOrderConfig
)
{
List
<
MemberConfig
>
list
=
memberConfigService
.
list
(
new
LambdaQueryWrapper
<
MemberConfig
>()
// .eq(MemberConfig::getMemberType, one.getMemberType())
.
orderBy
(
true
,
false
,
MemberConfig:
:
getMembershipLevel
));
//转Map limitRequirements,MemberConfig
Map
<
Long
,
MemberConfig
>
memberConfigMap
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
MemberConfig:
:
getMembershipLevel
,
Function
.
identity
()));
for
(
Map
.
Entry
<
Long
,
MemberConfig
>
entry
:
memberConfigMap
.
entrySet
())
{
if
(
equityMembersOrderConfig
.
getGiftPoints
().
compareTo
(
BigDecimal
.
valueOf
(
entry
.
getValue
().
getLimitRequirements
()))
>=
0
&&
equityMembersOrderConfig
.
getGiftPoints
().
compareTo
(
BigDecimal
.
valueOf
(
memberConfigMap
.
get
(
entry
.
getKey
()
+
1
).
getLimitRequirements
()))
<
0
&&
entry
.
getKey
().
compareTo
(
Collections
.
max
(
memberConfigMap
.
keySet
()))
<
0
)
{
equityMembersOrderConfig
.
setDefaultLevel
(
entry
.
getKey
());
break
;
}
else
if
(
equityMembersOrderConfig
.
getGiftPoints
().
compareTo
(
BigDecimal
.
valueOf
(
memberConfigMap
.
get
(
Collections
.
max
(
memberConfigMap
.
keySet
())).
getLimitRequirements
()))
>=
0
)
{
equityMembersOrderConfig
.
setDefaultLevel
(
Collections
.
max
(
memberConfigMap
.
keySet
()));
break
;
}
}
equityMembersOrderConfig
.
setCreateTime
(
DateUtils
.
getNowDate
());
return
equityMembersOrderConfigMapper
.
insertEquityMembersOrderConfig
(
equityMembersOrderConfig
);
}
...
...
@@ -63,6 +89,22 @@ public class EquityMembersOrderConfigServiceImpl extends ServiceImpl<EquityMembe
*/
@Override
public
int
updateEquityMembersOrderConfig
(
EquityMembersOrderConfig
equityMembersOrderConfig
)
{
List
<
MemberConfig
>
list
=
memberConfigService
.
list
(
new
LambdaQueryWrapper
<
MemberConfig
>()
// .eq(MemberConfig::getMemberType, one.getMemberType())
.
orderBy
(
true
,
false
,
MemberConfig:
:
getMembershipLevel
));
//转Map limitRequirements,MemberConfig
Map
<
Long
,
MemberConfig
>
memberConfigMap
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
MemberConfig:
:
getMembershipLevel
,
Function
.
identity
()));
for
(
Map
.
Entry
<
Long
,
MemberConfig
>
entry
:
memberConfigMap
.
entrySet
())
{
if
(
equityMembersOrderConfig
.
getGiftPoints
().
compareTo
(
BigDecimal
.
valueOf
(
entry
.
getValue
().
getLimitRequirements
()))
>=
0
&&
equityMembersOrderConfig
.
getGiftPoints
().
compareTo
(
BigDecimal
.
valueOf
(
memberConfigMap
.
get
(
entry
.
getKey
()
+
1
).
getLimitRequirements
()))
<
0
&&
entry
.
getKey
().
compareTo
(
Collections
.
max
(
memberConfigMap
.
keySet
()))
<
0
)
{
equityMembersOrderConfig
.
setDefaultLevel
(
entry
.
getKey
());
break
;
}
else
if
(
equityMembersOrderConfig
.
getGiftPoints
().
compareTo
(
BigDecimal
.
valueOf
(
memberConfigMap
.
get
(
Collections
.
max
(
memberConfigMap
.
keySet
())).
getLimitRequirements
()))
>=
0
)
{
equityMembersOrderConfig
.
setDefaultLevel
(
Collections
.
max
(
memberConfigMap
.
keySet
()));
break
;
}
}
equityMembersOrderConfig
.
setUpdateTime
(
DateUtils
.
getNowDate
());
return
equityMembersOrderConfigMapper
.
updateEquityMembersOrderConfig
(
equityMembersOrderConfig
);
}
...
...
share-system/src/main/resources/mapper/system/EquityMembersOrderConfigMapper.xml
View file @
061a7c79
...
...
@@ -8,7 +8,6 @@
<result
property=
"id"
column=
"id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"defaultLevel"
column=
"default_level"
/>
<result
property=
"memberConfigId"
column=
"member_config_id"
/>
<result
property=
"requiredAmount"
column=
"required_amount"
/>
<result
property=
"validityPeriod"
column=
"validity_period"
/>
<result
property=
"giftPoints"
column=
"gift_points"
/>
...
...
@@ -24,7 +23,6 @@
select id,
name,
default_level,
member_config_id,
required_amount,
validity_period,
gift_points,
...
...
@@ -43,7 +41,6 @@
<where>
<if
test=
"defaultLevel != null "
>
and default_level = #{defaultLevel}
</if>
<if
test=
"name != null"
>
and name = #{name}
</if>
<if
test=
"memberConfigId != null "
>
and member_config_id = #{memberConfigId}
</if>
<if
test=
"requiredAmount != null "
>
and required_amount = #{requiredAmount}
</if>
<if
test=
"validityPeriod != null "
>
and validity_period = #{validityPeriod}
</if>
<if
test=
"giftPoints != null "
>
and gift_points = #{giftPoints}
</if>
...
...
@@ -62,7 +59,6 @@
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"name !=null"
>
name,
</if>
<if
test=
"defaultLevel != null"
>
default_level,
</if>
<if
test=
"memberConfigId != null"
>
member_config_id,
</if>
<if
test=
"requiredAmount != null"
>
required_amount,
</if>
<if
test=
"validityPeriod != null"
>
validity_period,
</if>
<if
test=
"giftPoints != null"
>
gift_points,
</if>
...
...
@@ -76,7 +72,6 @@
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"name !=null"
>
#{name},
</if>
<if
test=
"defaultLevel != null"
>
#{defaultLevel},
</if>
<if
test=
"memberConfigId != null"
>
#{memberConfigId},
</if>
<if
test=
"requiredAmount != null"
>
#{requiredAmount},
</if>
<if
test=
"validityPeriod != null"
>
#{validityPeriod},
</if>
<if
test=
"giftPoints != null"
>
#{giftPoints},
</if>
...
...
@@ -94,7 +89,6 @@
<trim
prefix=
"SET"
suffixOverrides=
","
>
<if
test=
"name !=null"
>
name = #{name},
</if>
<if
test=
"defaultLevel != null"
>
default_level = #{defaultLevel},
</if>
<if
test=
"memberConfigId != null"
>
member_config_id = #{memberConfigId},
</if>
<if
test=
"requiredAmount != null"
>
required_amount = #{requiredAmount},
</if>
<if
test=
"validityPeriod != null"
>
validity_period = #{validityPeriod},
</if>
<if
test=
"giftPoints != null"
>
gift_points = #{giftPoints},
</if>
...
...
share-system/src/main/resources/mapper/system/MemberConfigMapper.xml
View file @
061a7c79
...
...
@@ -43,7 +43,6 @@
<if
test=
"levelName != null and levelName != ''"
>
and level_name like concat('%', #{levelName}, '%')
</if>
<if
test=
"limitRequirements != null "
>
and limit_requirements = #{limitRequirements}
</if>
<if
test=
"discountRatio != null "
>
and discount_ratio = #{discountRatio}
</if>
>
<if
test=
"isDelete != null "
>
and is_delete = #{isDelete}
</if>
</where>
</select>
...
...
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