Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lingxi-lxy-yanshou
Project
Project
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
后端-黄柯铭
lingxi-lxy-yanshou
Commits
7350c648
Commit
7350c648
authored
Jul 29, 2021
by
fhj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模板服务 - 修复代码
parent
7e1b4264
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
54 additions
and
12 deletions
+54
-12
AreaControllerFeign.java
...lingxi/platform/manage/api/feign/AreaControllerFeign.java
+5
-0
AreaControllerFeignFallback.java
...tform/manage/api/hystrix/AreaControllerFeignFallback.java
+5
-0
AreaController.java
...ssy/lingxi/platform/manage/controller/AreaController.java
+7
-0
AreaRepository.java
...ssy/lingxi/platform/manage/repository/AreaRepository.java
+2
-0
IAreaService.java
.../com/ssy/lingxi/platform/manage/service/IAreaService.java
+2
-12
AreaServiceImpl.java
...y/lingxi/platform/manage/serviceimpl/AreaServiceImpl.java
+16
-0
build.gradle
platform-template-service/build.gradle
+1
-0
settings.gradle
platform-template-service/settings.gradle
+3
-0
MemberShop.java
...gxi/platform/template/service/entity/door/MemberShop.java
+13
-0
MemberShopWebServiceImpl.java
...ate/service/serviceimpl/web/MemberShopWebServiceImpl.java
+0
-0
No files found.
platform-manage-service/platform-manage-service-api/src/main/java/com/ssy/lingxi/platform/manage/api/feign/AreaControllerFeign.java
View file @
7350c648
...
...
@@ -6,6 +6,7 @@ import com.ssy.lingxi.platform.manage.api.vo.response.AreaResponse;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.util.List
;
...
...
@@ -18,6 +19,10 @@ import java.util.List;
@FeignClient
(
value
=
"platform-manage-service"
,
fallback
=
AreaControllerFeignFallback
.
class
)
public
interface
AreaControllerFeign
{
@ApiOperation
(
value
=
"根据省编码获取所有市编码"
)
@GetMapping
(
"/manage/area/findCityCodeByProvinceCode"
)
public
Wrapper
<
List
<
String
>>
findCityCodeByProvinceCode
(
@RequestParam
(
"provinceCodes"
)
List
<
String
>
provinceCodes
);
@ApiOperation
(
value
=
"查询省市区列表"
)
@GetMapping
(
"/manage/area/all"
)
Wrapper
<
List
<
AreaResponse
>>
areaAll
();
...
...
platform-manage-service/platform-manage-service-api/src/main/java/com/ssy/lingxi/platform/manage/api/hystrix/AreaControllerFeignFallback.java
View file @
7350c648
...
...
@@ -11,6 +11,11 @@ import java.util.List;
public
class
AreaControllerFeignFallback
implements
AreaControllerFeign
{
@Override
public
Wrapper
<
List
<
String
>>
findCityCodeByProvinceCode
(
List
<
String
>
provinceCodes
)
{
return
Wrapper
.
failService
(
"服务调用异常"
);
}
@Override
public
Wrapper
<
List
<
AreaResponse
>>
areaAll
()
{
return
Wrapper
.
failService
(
"服务调用异常"
);
}
...
...
platform-manage-service/src/main/java/com/ssy/lingxi/platform/manage/controller/AreaController.java
View file @
7350c648
...
...
@@ -8,6 +8,7 @@ import com.ssy.lingxi.platform.manage.service.IAreaService;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
...
...
@@ -26,6 +27,12 @@ public class AreaController {
@Resource
private
IAreaService
areaService
;
@ApiOperation
(
value
=
"根据省编码获取所有市编码"
)
@GetMapping
(
"/area/findCityCodeByProvinceCode"
)
public
Wrapper
<
List
<
String
>>
findCityCodeByProvinceCode
(
@RequestParam
(
"provinceCodes"
)
List
<
String
>
provinceCodes
)
{
return
areaService
.
findCityCodeByProvinceCode
(
provinceCodes
);
}
@ApiOperation
(
value
=
"获取省市"
)
@GetMapping
(
"/area/findProvinceCity"
)
public
Wrapper
<
List
<
ProvinceResponse
>>
findProvinceCity
()
{
...
...
platform-manage-service/src/main/java/com/ssy/lingxi/platform/manage/repository/AreaRepository.java
View file @
7350c648
...
...
@@ -9,6 +9,8 @@ import java.util.List;
@Repository
public
interface
AreaRepository
extends
JpaRepository
<
Area
,
Long
>
{
List
<
Area
>
findAllByPcodeIn
(
List
<
String
>
pcodes
);
List
<
Area
>
findAllByPcodeEquals
(
String
pcode
);
List
<
Area
>
findAllByLevel
(
Integer
level
);
...
...
platform-manage-service/src/main/java/com/ssy/lingxi/platform/manage/service/IAreaService.java
View file @
7350c648
...
...
@@ -16,24 +16,14 @@ import java.util.List;
*/
public
interface
IAreaService
{
/**
* 获取省市
* */
Wrapper
<
List
<
String
>>
findCityCodeByProvinceCode
(
List
<
String
>
provinceCodes
);
Wrapper
<
List
<
ProvinceResponse
>>
findProvinceCity
();
/**
* 查询省市区列表
*/
Wrapper
<
List
<
AreaResponse
>>
areaAll
();
/**
* 查询省市区列表
*/
Wrapper
<
List
<
AreaResponse
>>
areaList
();
/**
* 根据父code查询省市区列表
*/
Wrapper
<
List
<
AreaResponse
>>
areaByPcodeAll
(
AreaRequest
request
);
}
platform-manage-service/src/main/java/com/ssy/lingxi/platform/manage/serviceimpl/AreaServiceImpl.java
View file @
7350c648
package
com
.
ssy
.
lingxi
.
platform
.
manage
.
serviceimpl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.ssy.lingxi.common.response.Wrapper
;
import
com.ssy.lingxi.platform.manage.api.vo.request.AreaRequest
;
import
com.ssy.lingxi.platform.manage.api.vo.response.AreaResponse
;
...
...
@@ -30,6 +31,21 @@ public class AreaServiceImpl implements IAreaService {
private
AreaRepository
areaRepository
;
/**
* 根据省编码获取所有市编码
* */
@Override
public
Wrapper
<
List
<
String
>>
findCityCodeByProvinceCode
(
List
<
String
>
provinceCodes
)
{
if
(
CollectionUtil
.
isNotEmpty
(
provinceCodes
))
{
return
Wrapper
.
fail
(
"参数校验不通过"
);
}
List
<
Area
>
areas
=
areaRepository
.
findAllByPcodeIn
(
provinceCodes
);
return
Wrapper
.
success
(
areas
.
stream
().
map
(
Area:
:
getCode
).
collect
(
Collectors
.
toList
())
);
}
/**
* 获取省市
* */
@Override
...
...
platform-template-service/build.gradle
View file @
7350c648
...
...
@@ -33,6 +33,7 @@ dependencies {
implementation
project
(
':common'
)
implementation
project
(
':component-service:redis'
)
implementation
project
(
':platform-template-service:platform-template-service-api'
)
implementation
project
(
':platform-manage-service:platform-manage-service-api'
)
implementation
project
(
':merchant-member-service:merchant-member-service-api'
)
implementation
project
(
':search-service:search-service-api'
)
implementation
project
(
':product-service:product-service-api'
)
...
...
platform-template-service/settings.gradle
View file @
7350c648
...
...
@@ -9,6 +9,9 @@ project(':component-service:redis').projectDir = "../component-service/redis" as
include
'platform-template-service:platform-template-service-api'
project
(
':platform-template-service:platform-template-service-api'
).
projectDir
=
"$rootDir/platform-template-service-api"
as
File
include
'platform-manage-service:platform-manage-service-api'
project
(
':platform-manage-service:platform-manage-service-api'
).
projectDir
=
"$rootDir/platform-manage-service-api"
as
File
include
'merchant-member-service:merchant-member-service-api'
project
(
':merchant-member-service:merchant-member-service-api'
).
projectDir
=
"../merchant-member-service/merchant-member-service-api"
as
File
...
...
platform-template-service/src/main/java/com/ssy/lingxi/platform/template/service/entity/door/MemberShop.java
View file @
7350c648
package
com
.
ssy
.
lingxi
.
platform
.
template
.
service
.
entity
.
door
;
import
com.ssy.lingxi.platform.template.service.handler.convert.JpaJsonToAreaBOConverter
;
import
com.ssy.lingxi.platform.template.service.handler.convert.JpaJsonToStringListConverter
;
import
com.ssy.lingxi.platform.template.service.handler.convert.JpaStringToArrayConverter
;
import
com.ssy.lingxi.platform.template.service.model.bo.AreaBO
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -94,6 +95,16 @@ public class MemberShop {
@ApiModelProperty
(
value
=
"地市(冗余)"
)
private
String
areas
;
@Convert
(
converter
=
JpaJsonToStringListConverter
.
class
)
@Column
(
columnDefinition
=
"jsonb"
)
@ApiModelProperty
(
value
=
"省编码(冗余)"
)
private
List
<
String
>
provincesCodeList
;
@Convert
(
converter
=
JpaJsonToStringListConverter
.
class
)
@Column
(
columnDefinition
=
"jsonb"
)
@ApiModelProperty
(
value
=
"市编码(冗余)"
)
private
List
<
String
>
cityCodeList
;
@Column
(
columnDefinition
=
"varchar(200)"
)
@ApiModelProperty
(
value
=
"会员名称(冗余)"
)
private
String
memberName
;
...
...
@@ -137,4 +148,6 @@ public class MemberShop {
@Column
(
columnDefinition
=
"varchar(255)"
)
@ApiModelProperty
(
value
=
"注册地址(详细地址)(冗余)"
)
private
String
registerAddress
;
}
platform-template-service/src/main/java/com/ssy/lingxi/platform/template/service/serviceimpl/web/MemberShopWebServiceImpl.java
View file @
7350c648
This diff is collapsed.
Click to expand it.
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