Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-api-boot-master
Commits
7ff95b93
Commit
7ff95b93
authored
Aug 06, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单V值VO调整
parent
3b3ffcf8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
3 deletions
+45
-3
ScoreRuleServiceImpl.java
...module/member/service/scoreRule/ScoreRuleServiceImpl.java
+44
-2
ScoreRuleOrderVExtraVO.java
...ule/member/vo/scoreRule/extra/ScoreRuleOrderVExtraVO.java
+1
-1
No files found.
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/scoreRule/ScoreRuleServiceImpl.java
View file @
7ff95b93
...
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.member.service.scoreRule;
...
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.module.member.service.scoreRule;
import
java.time.Instant
;
import
java.time.Instant
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
...
@@ -26,6 +27,7 @@ import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleShareExtraVO;
...
@@ -26,6 +27,7 @@ import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleShareExtraVO;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRulerRecommendExtraVO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRulerRecommendExtraVO
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.jetbrains.annotations.NotNull
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.validation.annotation.Validated
;
...
@@ -33,6 +35,7 @@ import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
...
@@ -33,6 +35,7 @@ import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
yudao
.
framework
.
common
.
exception
.
util
.
ServiceExceptionUtil
.
exception
;
import
static
cn
.
iocoder
.
yudao
.
module
.
member
.
enums
.
ErrorCodeConstants
.*;
import
static
cn
.
iocoder
.
yudao
.
module
.
member
.
enums
.
ErrorCodeConstants
.*;
import
static
java
.
util
.
Arrays
.
stream
;
/**
/**
* 积分规则 Service 实现类
* 积分规则 Service 实现类
...
@@ -148,7 +151,28 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
...
@@ -148,7 +151,28 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
if
(
extraOrderV
.
getTransportType
()
!=
TransportTypeEnum
.
OCEAN_LCL
.
getValue
()
&&
extraOrderV
.
getTransportType
()
!=
TransportTypeEnum
.
SPECIAL_LINE_AIR_FREIGHT
.
getValue
())
{
if
(
extraOrderV
.
getTransportType
()
!=
TransportTypeEnum
.
OCEAN_LCL
.
getValue
()
&&
extraOrderV
.
getTransportType
()
!=
TransportTypeEnum
.
SPECIAL_LINE_AIR_FREIGHT
.
getValue
())
{
throw
exception
(
SCORE_RULE_FIELD_ERROR
);
throw
exception
(
SCORE_RULE_FIELD_ERROR
);
}
}
if
(
StringUtils
.
isAnyBlank
(
extraOrderV
.
getTargetCountry
(),
extraOrderV
.
getTargetCity
(),
extraOrderV
.
getReceiveAddr
(),
extraOrderV
.
getOrderEntry
()))
{
// 国家,城市,仓库id从receiveAddrList中获取
List
<
List
<
Long
>>
receiveAddrList
=
extraOrderV
.
getReceiveAddrList
();
if
(
receiveAddrList
==
null
||
extraOrderV
.
getReceiveAddrList
().
isEmpty
())
{
throw
exception
(
SCORE_RULE_FIELD_ERROR
);
}
StringBuilder
targetCountry
=
new
StringBuilder
();
StringBuilder
targetCity
=
new
StringBuilder
();
StringBuilder
receiveAddr
=
new
StringBuilder
();
for
(
List
<
Long
>
integers
:
receiveAddrList
)
{
try
{
targetCountry
.
append
(
integers
.
get
(
1
)).
append
(
","
);
targetCity
.
append
(
integers
.
get
(
2
)).
append
(
","
);
receiveAddr
.
append
(
integers
.
get
(
3
)).
append
(
","
);
}
catch
(
Exception
e
)
{
throw
exception
(
SCORE_RULE_FIELD_ERROR
);
}
}
extraOrderV
.
setTargetCountry
(
targetCountry
.
toString
());
extraOrderV
.
setTargetCity
(
targetCity
.
toString
());
extraOrderV
.
setReceiveAddr
(
receiveAddr
.
toString
());
extraOrderV
.
setReceiveAddrList
(
null
);
if
(
StringUtils
.
isBlank
(
extraOrderV
.
getOrderEntry
()))
{
throw
exception
(
SCORE_RULE_FIELD_ERROR
);
throw
exception
(
SCORE_RULE_FIELD_ERROR
);
}
}
verifyOrderVRule
(
extraOrderV
.
getOrderVRule
());
verifyOrderVRule
(
extraOrderV
.
getOrderVRule
());
...
@@ -254,7 +278,10 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
...
@@ -254,7 +278,10 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
*/
*/
private
void
setExtraVO
(
ScoreRuleBackDetailVO
scoreRuleBackDetailVO
)
{
private
void
setExtraVO
(
ScoreRuleBackDetailVO
scoreRuleBackDetailVO
)
{
if
(
scoreRuleBackDetailVO
.
getType
()
==
ScoreRuleTypeEnum
.
ORDER_V
.
getValue
())
{
if
(
scoreRuleBackDetailVO
.
getType
()
==
ScoreRuleTypeEnum
.
ORDER_V
.
getValue
())
{
scoreRuleBackDetailVO
.
setExtraOrderV
(
JSONUtil
.
toBean
(
scoreRuleBackDetailVO
.
getExtra
(),
ScoreRuleOrderVExtraVO
.
class
));
ScoreRuleOrderVExtraVO
orderVExtraVO
=
JSONUtil
.
toBean
(
scoreRuleBackDetailVO
.
getExtra
(),
ScoreRuleOrderVExtraVO
.
class
);
List
<
List
<
Long
>>
receiveAddrList
=
getReceiveAddrList
(
orderVExtraVO
);
orderVExtraVO
.
setReceiveAddrList
(
receiveAddrList
);
scoreRuleBackDetailVO
.
setExtraOrderV
(
orderVExtraVO
);
}
else
if
(
scoreRuleBackDetailVO
.
getType
()
==
ScoreRuleTypeEnum
.
REGISTER
.
getValue
())
{
}
else
if
(
scoreRuleBackDetailVO
.
getType
()
==
ScoreRuleTypeEnum
.
REGISTER
.
getValue
())
{
scoreRuleBackDetailVO
.
setExtraRegister
(
JSONUtil
.
toBean
(
scoreRuleBackDetailVO
.
getExtra
(),
ScoreRuleRegisterExtraVO
.
class
));
scoreRuleBackDetailVO
.
setExtraRegister
(
JSONUtil
.
toBean
(
scoreRuleBackDetailVO
.
getExtra
(),
ScoreRuleRegisterExtraVO
.
class
));
}
else
if
(
scoreRuleBackDetailVO
.
getType
()
==
ScoreRuleTypeEnum
.
RECOMMEND
.
getValue
())
{
}
else
if
(
scoreRuleBackDetailVO
.
getType
()
==
ScoreRuleTypeEnum
.
RECOMMEND
.
getValue
())
{
...
@@ -266,6 +293,21 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
...
@@ -266,6 +293,21 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
}
}
}
}
private
@NotNull
List
<
List
<
Long
>>
getReceiveAddrList
(
ScoreRuleOrderVExtraVO
orderVExtraVO
)
{
List
<
List
<
Long
>>
receiveAddrList
=
new
ArrayList
<>();
String
[]
receiveAddrStrs
=
orderVExtraVO
.
getReceiveAddr
().
split
(
","
);
String
[]
targetCityStrs
=
orderVExtraVO
.
getTargetCity
().
split
(
","
);
String
[]
targetCountryStrs
=
orderVExtraVO
.
getTargetCountry
().
split
(
","
);
for
(
int
i
=
0
;
i
<
receiveAddrStrs
.
length
;
i
++)
{
List
<
Long
>
list
=
new
ArrayList
<>();
list
.
add
(
Long
.
parseLong
(
targetCountryStrs
[
i
]));
list
.
add
(
Long
.
parseLong
(
targetCityStrs
[
i
]));
list
.
add
(
Long
.
parseLong
(
receiveAddrStrs
[
i
]));
receiveAddrList
.
add
(
list
);
}
return
receiveAddrList
;
}
@Override
@Override
public
List
<
ScoreRuleDO
>
getScoreRuleList
(
ScoreRuleQueryVO
query
)
{
public
List
<
ScoreRuleDO
>
getScoreRuleList
(
ScoreRuleQueryVO
query
)
{
return
scoreRuleMapper
.
selectList
(
query
);
return
scoreRuleMapper
.
selectList
(
query
);
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/scoreRule/extra/ScoreRuleOrderVExtraVO.java
View file @
7ff95b93
...
@@ -20,7 +20,7 @@ public class ScoreRuleOrderVExtraVO {
...
@@ -20,7 +20,7 @@ public class ScoreRuleOrderVExtraVO {
@ApiModelProperty
(
value
=
"提货点,可多选,逗号拼接"
,
required
=
true
)
@ApiModelProperty
(
value
=
"提货点,可多选,逗号拼接"
,
required
=
true
)
private
String
receiveAddr
;
private
String
receiveAddr
;
@ApiModelProperty
(
value
=
"提货点列表(第一级提货点,第二级国家,城市,仓库id)"
,
required
=
true
)
@ApiModelProperty
(
value
=
"提货点列表(第一级提货点,第二级国家,城市,仓库id)"
,
required
=
true
)
private
List
<
List
<
Integer
>>
receiveAddrList
;
private
List
<
List
<
Long
>>
receiveAddrList
;
@ApiModelProperty
(
value
=
"渠道,运输方式选择海运时,渠道隐藏,可多选,逗号拼接"
)
@ApiModelProperty
(
value
=
"渠道,运输方式选择海运时,渠道隐藏,可多选,逗号拼接"
)
private
String
channel
;
private
String
channel
;
@ApiModelProperty
(
value
=
"积分规则列表"
,
required
=
true
)
@ApiModelProperty
(
value
=
"积分规则列表"
,
required
=
true
)
...
...
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