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
169b6f70
Commit
169b6f70
authored
Apr 22, 2024
by
liuzeheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
目的仓筛选
parent
6041c564
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
12 deletions
+53
-12
WarehouseMapper.java
...odule/depository/dal/mysql/warehouse/WarehouseMapper.java
+27
-0
WarehouseService.java
...module/depository/service/warehouse/WarehouseService.java
+2
-0
WarehouseServiceImpl.java
...pository/service/warehouse/impl/WarehouseServiceImpl.java
+18
-12
WarehouseController.java
...itory/controller/admin/warehouse/WarehouseController.java
+6
-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 @
169b6f70
...
...
@@ -133,4 +133,31 @@ public interface WarehouseMapper extends BaseMapperX<WarehouseDO> {
"WHERE w.deleted = 0 AND w.`status` =0 AND trade_type =#{tradeType}"
})
List
<
WarehouseTreeRegionVO
>
getWarehouseTreeRegionList
(
@Param
(
"tradeType"
)
Integer
tradeType
);
@ResultType
(
List
.
class
)
@Select
({
"<script>"
,
"SELECT w.*, "
,
"r1.title_zh as guojiaName,"
,
"r2.title_zh as shiName "
,
"FROM ecw_warehouse w "
,
"LEFT JOIN ecw_region r1 "
,
"ON w.guojia = r1.id "
,
"LEFT JOIN ecw_region r2 "
,
"ON w.shi = r2.id "
,
"WHERE w.deleted = 0 AND w.`status` =0 AND trade_type =1 "
,
"<when test = 'type == 1'>"
,
"GROUP BY r1.title_zh"
,
"</when>"
,
"<when test = 'type == 2'>"
,
"AND w.guojia=#{regionId}"
,
"GROUP BY w.shi"
,
"</when>"
,
"<when test = 'type == 3'>"
,
"AND w.shi=#{regionId}"
,
"GROUP BY w.title_zh"
,
"</when>"
,
"</script>"
})
List
<
WarehouseTreeRegionVO
>
getRegionList
(
@Param
(
"type"
)
Integer
type
,
@Param
(
"regionId"
)
Integer
regionId
);
}
yudao-module-depository/yudao-module-depository-core/src/main/java/cn/iocoder/yudao/module/depository/service/warehouse/WarehouseService.java
View file @
169b6f70
...
...
@@ -170,4 +170,6 @@ public interface WarehouseService {
LogisticsInfoDto
getStartInfoAndDestInfoByLineId
(
Long
lineId
);
List
<
WarehouseTreeRegionVO
>
getWarehouseTreeRegionList
(
Integer
tradeType
);
List
<
WarehouseTreeRegionVO
>
getRegionList
(
Integer
type
,
Integer
regionId
);
}
yudao-module-depository/yudao-module-depository-core/src/main/java/cn/iocoder/yudao/module/depository/service/warehouse/impl/WarehouseServiceImpl.java
View file @
169b6f70
...
...
@@ -495,13 +495,13 @@ public class WarehouseServiceImpl implements WarehouseService {
@Override
public
List
<
WarehouseTreeRegionVO
>
getWarehouseTreeRegionList
(
Integer
tradeType
)
{
List
<
WarehouseTreeRegionVO
>
list
=
warehouseMapper
.
getWarehouseTreeRegionList
(
tradeType
);
List
<
WarehouseTreeRegionVO
>
list
=
warehouseMapper
.
getWarehouseTreeRegionList
(
tradeType
);
list
.
stream
().
forEach
(
s
->
s
.
getGuojiaName
().
replaceAll
(
"\t"
,
""
));
Map
<
String
,
List
<
WarehouseTreeRegionVO
>>
map
=
(
HashMap
<
String
,
List
<
WarehouseTreeRegionVO
>>)
list
.
stream
()
list
.
stream
().
forEach
(
s
->
s
.
getGuojiaName
().
replaceAll
(
"\t"
,
""
));
Map
<
String
,
List
<
WarehouseTreeRegionVO
>>
map
=
(
HashMap
<
String
,
List
<
WarehouseTreeRegionVO
>>)
list
.
stream
()
.
collect
(
Collectors
.
groupingBy
(
WarehouseTreeRegionVO:
:
getGuojiaName
));
List
<
WarehouseTreeRegionVO
>
regionVOList
=
new
ArrayList
<>()
;
for
(
Map
.
Entry
<
String
,
List
<
WarehouseTreeRegionVO
>>
m:
map
.
entrySet
())
{
List
<
WarehouseTreeRegionVO
>
regionVOList
=
new
ArrayList
<>()
;
for
(
Map
.
Entry
<
String
,
List
<
WarehouseTreeRegionVO
>>
m
:
map
.
entrySet
())
{
WarehouseTreeRegionVO
v
=
new
WarehouseTreeRegionVO
();
v
.
setGuojiaName
(
m
.
getKey
());
v
.
setChildren
(
m
.
getValue
());
...
...
@@ -512,4 +512,10 @@ public class WarehouseServiceImpl implements WarehouseService {
return
regionVOList
;
}
@Override
public
List
<
WarehouseTreeRegionVO
>
getRegionList
(
Integer
type
,
Integer
regionId
)
{
List
<
WarehouseTreeRegionVO
>
list
=
warehouseMapper
.
getRegionList
(
type
,
regionId
);
return
list
;
}
}
yudao-module-depository/yudao-module-depository-rest/src/main/java/cn/iocoder/yudao/module/depository/controller/admin/warehouse/WarehouseController.java
View file @
169b6f70
...
...
@@ -100,6 +100,12 @@ public class WarehouseController {
return
success
(
list
);
}
@GetMapping
(
"/getRegionList"
)
public
CommonResult
<
List
<
WarehouseTreeRegionVO
>>
getRegionList
(
@RequestParam
(
value
=
"type"
,
required
=
false
)
Integer
type
,
Integer
regionId
){
List
<
WarehouseTreeRegionVO
>
list
=
warehouseService
.
getRegionList
(
type
,
regionId
);
return
success
(
list
);
}
@GetMapping
(
"/page"
)
@ApiOperation
(
"获得仓库分页"
)
// @PreAuthorize("@ss.hasPermission('ecw:warehouse:query')")
...
...
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