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
3b3ffcf8
Commit
3b3ffcf8
authored
Aug 06, 2024
by
zhangfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
获得目的仓树形列表返回优化
parent
f9d6bf8f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
111 additions
and
7 deletions
+111
-7
WarehouseMapper.java
...odule/depository/dal/mysql/warehouse/WarehouseMapper.java
+3
-1
WarehouseTreeRegionVO.java
...module/depository/vo/warehouse/WarehouseTreeRegionVO.java
+2
-0
ScoreRuleController.java
...ember/controller/admin/scoreRule/ScoreRuleController.java
+2
-6
ScoreRuleService.java
...dao/module/member/service/scoreRule/ScoreRuleService.java
+2
-0
ScoreRuleServiceImpl.java
...module/member/service/scoreRule/ScoreRuleServiceImpl.java
+45
-0
WarehouseTreeRegionSimpleVO.java
...dule/member/vo/scoreRule/WarehouseTreeRegionSimpleVO.java
+55
-0
ScoreRuleOrderVExtraVO.java
...ule/member/vo/scoreRule/extra/ScoreRuleOrderVExtraVO.java
+2
-0
No files found.
yudao-module-depository/yudao-module-depository-core/src/main/java/cn/iocoder/yudao/module/depository/dal/mysql/warehouse/WarehouseMapper.java
View file @
3b3ffcf8
...
...
@@ -123,7 +123,9 @@ public interface WarehouseMapper extends BaseMapperX<WarehouseDO> {
@Select
({
"SELECT w.*, "
,
"r1.title_zh as guojiaName,"
,
"r2.title_zh as shiName "
,
"r1.title_en as guojiaNameEn,"
,
"r2.title_zh as shiName, "
,
"r2.title_en as shiNameEn "
,
"FROM ecw_warehouse w "
,
"LEFT JOIN ecw_region r1 "
,
"ON w.guojia = r1.id "
,
...
...
yudao-module-depository/yudao-module-depository-core/src/main/java/cn/iocoder/yudao/module/depository/vo/warehouse/WarehouseTreeRegionVO.java
View file @
3b3ffcf8
...
...
@@ -9,8 +9,10 @@ import java.util.List;
public
class
WarehouseTreeRegionVO
extends
WarehouseRespVO
{
private
String
guojiaName
;
private
String
guojiaNameEn
;
private
String
shiName
;
private
String
shiNameEn
;
private
Long
pid
;
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/controller/admin/scoreRule/ScoreRuleController.java
View file @
3b3ffcf8
...
...
@@ -43,8 +43,6 @@ public class ScoreRuleController {
@Resource
private
ScoreRuleService
scoreRuleService
;
@Resource
private
WarehouseService
warehouseService
;
@Resource
private
ApplicationContext
applicationContext
;
@Resource
private
ScoreProducerApi
scoreProducerApi
;
...
...
@@ -122,10 +120,8 @@ public class ScoreRuleController {
@GetMapping
(
"/warehouse-tree-region-list"
)
@ApiOperation
(
"获得目的国、目的城市、目的仓列表"
)
public
CommonResult
<
List
<
WarehouseTreeRegionVO
>>
warehouseTreeRegionList
()
{
List
<
WarehouseTreeRegionVO
>
listIn
=
warehouseService
.
getWarehouseTreeRegionList
(
1
);
List
<
WarehouseTreeRegionVO
>
listOut
=
warehouseService
.
getWarehouseTreeRegionList
(
2
);
List
<
WarehouseTreeRegionVO
>
list
=
ListUtils
.
sum
(
listIn
,
listOut
);
public
CommonResult
<
List
<
WarehouseTreeRegionSimpleVO
>>
warehouseTreeRegionList
()
{
List
<
WarehouseTreeRegionSimpleVO
>
list
=
scoreRuleService
.
getWarehouseTreeRegionListSimple
();
return
success
(
list
);
}
...
...
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/scoreRule/ScoreRuleService.java
View file @
3b3ffcf8
...
...
@@ -119,4 +119,6 @@ public interface ScoreRuleService extends IService<ScoreRuleDO> {
* @return
*/
ScoreRuleDO
getEnableScoreRuleByType
(
ScoreRuleTypeEnum
scoreRuleType
,
TransportTypeEnum
transportType
);
List
<
WarehouseTreeRegionSimpleVO
>
getWarehouseTreeRegionListSimple
();
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/service/scoreRule/ScoreRuleServiceImpl.java
View file @
3b3ffcf8
...
...
@@ -9,6 +9,8 @@ import cn.hutool.json.JSONUtil;
import
cn.iocoder.yudao.framework.common.pojo.PageResult
;
import
cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery
;
import
cn.iocoder.yudao.framework.mybatis.core.service.AbstractService
;
import
cn.iocoder.yudao.module.depository.service.warehouse.WarehouseService
;
import
cn.iocoder.yudao.module.depository.vo.warehouse.WarehouseTreeRegionVO
;
import
cn.iocoder.yudao.module.member.convert.scoreRule.ScoreRuleConvert
;
import
cn.iocoder.yudao.module.member.dal.dataobject.scoreRule.ScoreRuleDO
;
import
cn.iocoder.yudao.module.member.dal.mysql.scoreRule.ScoreRuleMapper
;
...
...
@@ -22,6 +24,7 @@ import cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleOrderVExtraVO;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleRegisterExtraVO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRuleShareExtraVO
;
import
cn.iocoder.yudao.module.member.vo.scoreRule.extra.ScoreRulerRecommendExtraVO
;
import
org.apache.commons.collections4.ListUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
...
...
@@ -44,6 +47,8 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
private
ScoreRuleMapper
scoreRuleMapper
;
@Resource
private
ScoreRuleRedisDao
scoreRuleRedisDao
;
@Resource
private
WarehouseService
warehouseService
;
@Override
public
Long
createScoreRule
(
ScoreRuleCreateReqVO
createReqVO
)
{
...
...
@@ -402,4 +407,44 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
}
return
null
;
}
@Override
public
List
<
WarehouseTreeRegionSimpleVO
>
getWarehouseTreeRegionListSimple
()
{
List
<
WarehouseTreeRegionVO
>
listIn
=
warehouseService
.
getWarehouseTreeRegionList
(
1
);
List
<
WarehouseTreeRegionVO
>
listOut
=
warehouseService
.
getWarehouseTreeRegionList
(
2
);
List
<
WarehouseTreeRegionVO
>
list
=
ListUtils
.
sum
(
listIn
,
listOut
);
ArrayList
<
WarehouseTreeRegionSimpleVO
>
warehouseTreeRegionSimpleVOS
=
new
ArrayList
<>();
for
(
WarehouseTreeRegionVO
warehouseTreeRegionVO
:
list
)
{
WarehouseTreeRegionSimpleVO
warehouseTreeRegionSimpleVO
=
new
WarehouseTreeRegionSimpleVO
();
warehouseTreeRegionSimpleVO
.
setCountryId
(
warehouseTreeRegionVO
.
getGuojia
());
warehouseTreeRegionSimpleVO
.
setLabelZh
(
warehouseTreeRegionVO
.
getGuojiaName
().
replaceAll
(
"\t"
,
""
));
warehouseTreeRegionSimpleVO
.
setLabelEn
(
warehouseTreeRegionVO
.
getChildren
().
get
(
0
).
getGuojiaNameEn
());
ArrayList
<
WarehouseTreeRegionSimpleVO
.
WarehouseCity
>
warehouseCitiesSimple
=
new
ArrayList
<>();
for
(
WarehouseTreeRegionVO
warehouseTreeRegionVOChild
:
warehouseTreeRegionVO
.
getChildren
())
{
WarehouseTreeRegionSimpleVO
.
WarehouseCity
warehouseCity
=
new
WarehouseTreeRegionSimpleVO
.
WarehouseCity
();
warehouseCity
.
setCityId
(
warehouseTreeRegionVOChild
.
getShi
());
warehouseCity
.
setLabelZh
(
warehouseTreeRegionVOChild
.
getShiName
().
replaceAll
(
"\t"
,
""
));
warehouseCity
.
setLabelEn
(
warehouseTreeRegionVOChild
.
getShiNameEn
());
if
(
warehouseCitiesSimple
.
contains
(
warehouseCity
))
{
WarehouseTreeRegionSimpleVO
.
Warehouse
warehouse
=
new
WarehouseTreeRegionSimpleVO
.
Warehouse
();
warehouse
.
setWarehouseId
(
warehouseTreeRegionVOChild
.
getId
());
warehouse
.
setLabelZh
(
warehouseTreeRegionVOChild
.
getTitleZh
());
warehouse
.
setLabelEn
(
warehouseTreeRegionVOChild
.
getTitleEn
());
warehouseCitiesSimple
.
get
(
warehouseCitiesSimple
.
indexOf
(
warehouseCity
)).
getChildren
().
add
(
warehouse
);
continue
;
}
ArrayList
<
WarehouseTreeRegionSimpleVO
.
Warehouse
>
warehouseSimples
=
new
ArrayList
<>();
WarehouseTreeRegionSimpleVO
.
Warehouse
warehouse
=
new
WarehouseTreeRegionSimpleVO
.
Warehouse
();
warehouse
.
setWarehouseId
(
warehouseTreeRegionVOChild
.
getId
());
warehouse
.
setLabelZh
(
warehouseTreeRegionVOChild
.
getTitleZh
().
replaceAll
(
"\t"
,
""
));
warehouse
.
setLabelEn
(
warehouseTreeRegionVOChild
.
getTitleEn
());
warehouseSimples
.
add
(
warehouse
);
warehouseCity
.
setChildren
(
warehouseSimples
);
warehouseCitiesSimple
.
add
(
warehouseCity
);
}
warehouseTreeRegionSimpleVO
.
setChildren
(
warehouseCitiesSimple
);
warehouseTreeRegionSimpleVOS
.
add
(
warehouseTreeRegionSimpleVO
);
}
return
warehouseTreeRegionSimpleVOS
;
}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/scoreRule/WarehouseTreeRegionSimpleVO.java
0 → 100644
View file @
3b3ffcf8
package
cn
.
iocoder
.
yudao
.
module
.
member
.
vo
.
scoreRule
;
import
cn.iocoder.yudao.module.depository.vo.warehouse.WarehouseRespVO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
import
java.util.Objects
;
@Data
public
class
WarehouseTreeRegionSimpleVO
{
@ApiModelProperty
(
"国家id"
)
private
Long
countryId
;
@ApiModelProperty
(
"国家中文名"
)
private
String
labelZh
;
@ApiModelProperty
(
"国家英文名"
)
private
String
labelEn
;
@ApiModelProperty
(
"城市"
)
private
List
<
WarehouseCity
>
children
;
@Data
public
static
class
WarehouseCity
{
@ApiModelProperty
(
"城市id"
)
private
Long
cityId
;
@ApiModelProperty
(
"城市中文名"
)
private
String
labelZh
;
@ApiModelProperty
(
"城市英文名"
)
private
String
labelEn
;
@ApiModelProperty
(
"仓库"
)
private
List
<
Warehouse
>
children
;
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
WarehouseCity
that
=
(
WarehouseCity
)
o
;
return
Objects
.
equals
(
cityId
,
that
.
cityId
);
}
@Override
public
int
hashCode
()
{
return
Objects
.
hashCode
(
cityId
);
}
}
@Data
public
static
class
Warehouse
{
@ApiModelProperty
(
"仓库id"
)
private
Long
warehouseId
;
@ApiModelProperty
(
"仓库中文名"
)
private
String
labelZh
;
@ApiModelProperty
(
"仓库英文名"
)
private
String
labelEn
;
}
}
yudao-module-member/yudao-module-member-impl/src/main/java/cn/iocoder/yudao/module/member/vo/scoreRule/extra/ScoreRuleOrderVExtraVO.java
View file @
3b3ffcf8
...
...
@@ -19,6 +19,8 @@ public class ScoreRuleOrderVExtraVO {
private
String
targetCity
;
@ApiModelProperty
(
value
=
"提货点,可多选,逗号拼接"
,
required
=
true
)
private
String
receiveAddr
;
@ApiModelProperty
(
value
=
"提货点列表(第一级提货点,第二级国家,城市,仓库id)"
,
required
=
true
)
private
List
<
List
<
Integer
>>
receiveAddrList
;
@ApiModelProperty
(
value
=
"渠道,运输方式选择海运时,渠道隐藏,可多选,逗号拼接"
)
private
String
channel
;
@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