Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wecloud_im_server
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hewei
wecloud_im_server
Commits
2b1d00db
Commit
2b1d00db
authored
Oct 20, 2020
by
zhangjw
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://119.28.51.83/hewei/Jumeirah
into Jw
parents
892a540e
f96a5897
Show whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
960 additions
and
429 deletions
+960
-429
api-app/src/main/java/com/jumeirah/api/app/controller/StrokeController.java
+6
-5
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantPermissionController.java
+99
-99
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantRoleController.java
+99
-99
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantRolePermissionController.java
+99
-99
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantSmsController.java
+45
-45
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantUserPermissionController.java
+97
-0
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/order/McStrokeController.java
+16
-0
api-merchant/src/main/java/com/jumeirah/api/merchant/entity/param/StrokeCompleteParam.java
+29
-0
common/src/main/java/com/jumeirah/common/entity/CharterIntroduction.java
+3
-0
common/src/main/java/com/jumeirah/common/entity/MerchantUserPermission.java
+62
-0
common/src/main/java/com/jumeirah/common/entity/Stroke.java
+0
-4
common/src/main/java/com/jumeirah/common/enums/StrokeTypeEnum.java
+3
-1
common/src/main/java/com/jumeirah/common/mapper/MerchantUserPermissionMapper.java
+49
-0
common/src/main/java/com/jumeirah/common/param/McStrokePageParam.java
+1
-1
common/src/main/java/com/jumeirah/common/param/MerchantUserPermissionPageParam.java
+23
-0
common/src/main/java/com/jumeirah/common/param/MerchantUserPermissionQueryVo.java
+52
-0
common/src/main/java/com/jumeirah/common/service/MerchantUserPermissionService.java
+73
-0
common/src/main/java/com/jumeirah/common/service/MerchantUserService.java
+1
-2
common/src/main/java/com/jumeirah/common/service/impl/MerchantUserPermissionServiceImpl.java
+69
-0
common/src/main/java/com/jumeirah/common/service/impl/MerchantUserServiceImpl.java
+84
-68
common/src/main/java/com/jumeirah/common/vo/CharterIntroductionQueryForAppVo.java
+3
-0
common/src/main/java/com/jumeirah/common/vo/McStrokeQueryVo.java
+3
-0
common/src/main/resources/mapper/CharterIntroductionMapper.xml
+1
-1
common/src/main/resources/mapper/MerchantUserPermissionMapper.xml
+36
-0
common/src/main/resources/mapper/StrokeMapper.xml
+2
-0
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/cache/MerchantLoginRedisService.java
+1
-1
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/cache/impl/MerchantLoginRedisServiceImpl.java
+3
-3
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/jwt/realm/JwtRealmMerchant.java
+1
-1
No files found.
api-app/src/main/java/com/jumeirah/api/app/controller/StrokeController.java
View file @
2b1d00db
...
@@ -9,6 +9,7 @@ import com.jumeirah.api.app.entity.param.StrokeDiscountParam;
...
@@ -9,6 +9,7 @@ import com.jumeirah.api.app.entity.param.StrokeDiscountParam;
import
com.jumeirah.common.constant.Constant
;
import
com.jumeirah.common.constant.Constant
;
import
com.jumeirah.common.entity.Stroke
;
import
com.jumeirah.common.entity.Stroke
;
import
com.jumeirah.common.enums.StatePaymentStatusEnum
;
import
com.jumeirah.common.enums.StatePaymentStatusEnum
;
import
com.jumeirah.common.enums.StrokeTypeEnum
;
import
com.jumeirah.common.param.StrokePageParam
;
import
com.jumeirah.common.param.StrokePageParam
;
import
com.jumeirah.common.param.app.StrokePaymentInfoParam
;
import
com.jumeirah.common.param.app.StrokePaymentInfoParam
;
import
com.jumeirah.common.service.StrokeDiscountService
;
import
com.jumeirah.common.service.StrokeDiscountService
;
...
@@ -83,7 +84,7 @@ public class StrokeController extends BaseController {
...
@@ -83,7 +84,7 @@ public class StrokeController extends BaseController {
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
Stroke
stroke
=
new
Stroke
();
Stroke
stroke
=
new
Stroke
();
BeanUtils
.
copyProperties
(
strokeAddOneWayParam
,
stroke
);
BeanUtils
.
copyProperties
(
strokeAddOneWayParam
,
stroke
);
stroke
.
setType
(
0
)
stroke
.
setType
(
StrokeTypeEnum
.
ONE_WAY
.
getCode
()
)
.
setMoney
(
new
BigDecimal
(
"0"
))
.
setMoney
(
new
BigDecimal
(
"0"
))
.
setMcId
(
Constant
.
MC_ID
)
.
setMcId
(
Constant
.
MC_ID
)
.
setUserId
(
jwtToken
.
getUserId
());
.
setUserId
(
jwtToken
.
getUserId
());
...
@@ -101,7 +102,7 @@ public class StrokeController extends BaseController {
...
@@ -101,7 +102,7 @@ public class StrokeController extends BaseController {
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
Stroke
stroke
=
new
Stroke
();
Stroke
stroke
=
new
Stroke
();
BeanUtils
.
copyProperties
(
strokeAddBackAndForthParam
,
stroke
);
BeanUtils
.
copyProperties
(
strokeAddBackAndForthParam
,
stroke
);
stroke
.
setType
(
1
)
stroke
.
setType
(
StrokeTypeEnum
.
ROUND_TRIP
.
getCode
()
)
.
setMoney
(
new
BigDecimal
(
"0"
))
.
setMoney
(
new
BigDecimal
(
"0"
))
.
setMcId
(
Constant
.
MC_ID
)
.
setMcId
(
Constant
.
MC_ID
)
.
setUserId
(
jwtToken
.
getUserId
());
.
setUserId
(
jwtToken
.
getUserId
());
...
@@ -119,7 +120,7 @@ public class StrokeController extends BaseController {
...
@@ -119,7 +120,7 @@ public class StrokeController extends BaseController {
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
Stroke
stroke
=
new
Stroke
();
Stroke
stroke
=
new
Stroke
();
BeanUtils
.
copyProperties
(
strokeAddFreightParam
,
stroke
);
BeanUtils
.
copyProperties
(
strokeAddFreightParam
,
stroke
);
stroke
.
setType
(
2
)
stroke
.
setType
(
StrokeTypeEnum
.
CARGO_FLIGHT
.
getCode
()
)
.
setMoney
(
new
BigDecimal
(
"0"
))
.
setMoney
(
new
BigDecimal
(
"0"
))
.
setMcId
(
Constant
.
MC_ID
)
.
setMcId
(
Constant
.
MC_ID
)
.
setUserId
(
jwtToken
.
getUserId
());
.
setUserId
(
jwtToken
.
getUserId
());
...
@@ -138,7 +139,7 @@ public class StrokeController extends BaseController {
...
@@ -138,7 +139,7 @@ public class StrokeController extends BaseController {
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
Stroke
stroke
=
new
Stroke
();
Stroke
stroke
=
new
Stroke
();
BeanUtils
.
copyProperties
(
strokeAddMedicalTreatmentParam
,
stroke
);
BeanUtils
.
copyProperties
(
strokeAddMedicalTreatmentParam
,
stroke
);
stroke
.
setType
(
3
)
stroke
.
setType
(
StrokeTypeEnum
.
MEDICAL_FLIGHT
.
getCode
()
)
.
setMoney
(
new
BigDecimal
(
"0"
))
.
setMoney
(
new
BigDecimal
(
"0"
))
.
setMcId
(
Constant
.
MC_ID
)
.
setMcId
(
Constant
.
MC_ID
)
.
setUserId
(
jwtToken
.
getUserId
());
.
setUserId
(
jwtToken
.
getUserId
());
...
@@ -156,7 +157,7 @@ public class StrokeController extends BaseController {
...
@@ -156,7 +157,7 @@ public class StrokeController extends BaseController {
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
StrokeDiscountQueryVo
strokeDiscountQueryVo
=
strokeDiscountService
.
getStrokeDiscountById
(
strokeDiscountParam
.
getSdId
());
StrokeDiscountQueryVo
strokeDiscountQueryVo
=
strokeDiscountService
.
getStrokeDiscountById
(
strokeDiscountParam
.
getSdId
());
Stroke
stroke
=
new
Stroke
();
Stroke
stroke
=
new
Stroke
();
stroke
.
setType
(
4
)
stroke
.
setType
(
StrokeTypeEnum
.
PREFERENTIAL_TUNING
.
getCode
()
)
.
setCityOutsetId
(
strokeDiscountQueryVo
.
getCityOutsetId
())
.
setCityOutsetId
(
strokeDiscountQueryVo
.
getCityOutsetId
())
.
setCityArriveId
(
strokeDiscountQueryVo
.
getCityArriveId
())
.
setCityArriveId
(
strokeDiscountQueryVo
.
getCityArriveId
())
.
setPeopleNum
(
strokeDiscountParam
.
getPeopleNum
())
.
setPeopleNum
(
strokeDiscountParam
.
getPeopleNum
())
...
...
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantPermissionController.java
View file @
2b1d00db
package
com
.
jumeirah
.
api
.
merchant
.
controller
;
//
package com.jumeirah.api.merchant.controller;
//
import
com.jumeirah.common.entity.MerchantPermission
;
//
import com.jumeirah.common.entity.MerchantPermission;
import
com.jumeirah.common.param.MerchantPermissionPageParam
;
//
import com.jumeirah.common.param.MerchantPermissionPageParam;
import
com.jumeirah.common.service.MerchantPermissionService
;
//
import com.jumeirah.common.service.MerchantPermissionService;
import
com.jumeirah.common.vo.MerchantPermissionQueryVo
;
//
import com.jumeirah.common.vo.MerchantPermissionQueryVo;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
//
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
//
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
//
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import
io.geekidea.springbootplus.framework.core.validator.groups.Add
;
//
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import
io.geekidea.springbootplus.framework.core.validator.groups.Update
;
//
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import
io.geekidea.springbootplus.framework.log.annotation.Module
;
//
import io.geekidea.springbootplus.framework.log.annotation.Module;
import
io.geekidea.springbootplus.framework.log.annotation.OperationLog
;
//
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import
io.geekidea.springbootplus.framework.log.enums.OperationLogType
;
//
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import
io.swagger.annotations.Api
;
//
import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
//
import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
//
import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
//
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.validation.annotation.Validated
;
//
import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.GetMapping
;
//
import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.PathVariable
;
//
import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.PostMapping
;
//
import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
//
import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
//
import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
//
import org.springframework.web.bind.annotation.RestController;
//
/**
/
//
**
* 商家权限 控制器
//
* 商家权限 控制器
*
//
*
* @author wei
//
* @author wei
* @since 2020-09-27
//
* @since 2020-09-27
*/
//
*/
@Slf4j
//
@Slf4j
@RestController
//
@RestController
@RequestMapping
(
"/merchant/permission"
)
//
@RequestMapping("/merchant/permission")
@Module
(
"${cfg.module}"
)
//
@Module("${cfg.module}")
@Api
(
value
=
"商家权限API"
,
tags
=
{
"商家权限"
})
//
@Api(value = "商家权限API", tags = {"商家权限"})
public
class
MerchantPermissionController
extends
BaseController
{
//
public class MerchantPermissionController extends BaseController {
//
@Autowired
//
@Autowired
private
MerchantPermissionService
merchantPermissionService
;
//
private MerchantPermissionService merchantPermissionService;
//
/**
//
/**
* 添加商家权限
//
* 添加商家权限
*/
//
*/
@PostMapping
(
"/add"
)
//
@PostMapping("/add")
@OperationLog
(
name
=
"添加商家权限"
,
type
=
OperationLogType
.
ADD
)
//
@OperationLog(name = "添加商家权限", type = OperationLogType.ADD)
@ApiOperation
(
value
=
"添加商家权限"
,
response
=
ApiResult
.
class
)
//
@ApiOperation(value = "添加商家权限", response = ApiResult.class)
public
ApiResult
<
Boolean
>
addMerchantPermission
(
@Validated
(
Add
.
class
)
@RequestBody
MerchantPermission
merchantPermission
)
throws
Exception
{
//
public ApiResult<Boolean> addMerchantPermission(@Validated(Add.class) @RequestBody MerchantPermission merchantPermission) throws Exception {
boolean
flag
=
merchantPermissionService
.
saveMerchantPermission
(
merchantPermission
);
//
boolean flag = merchantPermissionService.saveMerchantPermission(merchantPermission);
return
ApiResult
.
result
(
flag
);
//
return ApiResult.result(flag);
}
//
}
//
/**
//
/**
* 修改商家权限
//
* 修改商家权限
*/
//
*/
@PostMapping
(
"/update"
)
//
@PostMapping("/update")
@OperationLog
(
name
=
"修改商家权限"
,
type
=
OperationLogType
.
UPDATE
)
//
@OperationLog(name = "修改商家权限", type = OperationLogType.UPDATE)
@ApiOperation
(
value
=
"修改商家权限"
,
response
=
ApiResult
.
class
)
//
@ApiOperation(value = "修改商家权限", response = ApiResult.class)
public
ApiResult
<
Boolean
>
updateMerchantPermission
(
@Validated
(
Update
.
class
)
@RequestBody
MerchantPermission
merchantPermission
)
throws
Exception
{
//
public ApiResult<Boolean> updateMerchantPermission(@Validated(Update.class) @RequestBody MerchantPermission merchantPermission) throws Exception {
boolean
flag
=
merchantPermissionService
.
updateMerchantPermission
(
merchantPermission
);
//
boolean flag = merchantPermissionService.updateMerchantPermission(merchantPermission);
return
ApiResult
.
result
(
flag
);
//
return ApiResult.result(flag);
}
//
}
//
/**
//
/**
* 删除商家权限
//
* 删除商家权限
*/
//
*/
@PostMapping
(
"/delete/{id}"
)
//
@PostMapping("/delete/{id}")
@OperationLog
(
name
=
"删除商家权限"
,
type
=
OperationLogType
.
DELETE
)
//
@OperationLog(name = "删除商家权限", type = OperationLogType.DELETE)
@ApiOperation
(
value
=
"删除商家权限"
,
response
=
ApiResult
.
class
)
//
@ApiOperation(value = "删除商家权限", response = ApiResult.class)
public
ApiResult
<
Boolean
>
deleteMerchantPermission
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
//
public ApiResult<Boolean> deleteMerchantPermission(@PathVariable("id") Long id) throws Exception {
boolean
flag
=
merchantPermissionService
.
deleteMerchantPermission
(
id
);
//
boolean flag = merchantPermissionService.deleteMerchantPermission(id);
return
ApiResult
.
result
(
flag
);
//
return ApiResult.result(flag);
}
//
}
//
/**
//
/**
* 获取商家权限详情
//
* 获取商家权限详情
*/
//
*/
@GetMapping
(
"/info/{id}"
)
//
@GetMapping("/info/{id}")
@OperationLog
(
name
=
"商家权限详情"
,
type
=
OperationLogType
.
INFO
)
//
@OperationLog(name = "商家权限详情", type = OperationLogType.INFO)
@ApiOperation
(
value
=
"商家权限详情"
,
response
=
MerchantPermissionQueryVo
.
class
)
//
@ApiOperation(value = "商家权限详情", response = MerchantPermissionQueryVo.class)
public
ApiResult
<
MerchantPermissionQueryVo
>
getMerchantPermission
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
//
public ApiResult<MerchantPermissionQueryVo> getMerchantPermission(@PathVariable("id") Long id) throws Exception {
MerchantPermissionQueryVo
merchantPermissionQueryVo
=
merchantPermissionService
.
getMerchantPermissionById
(
id
);
//
MerchantPermissionQueryVo merchantPermissionQueryVo = merchantPermissionService.getMerchantPermissionById(id);
return
ApiResult
.
ok
(
merchantPermissionQueryVo
);
//
return ApiResult.ok(merchantPermissionQueryVo);
}
//
}
//
/**
//
/**
* 商家权限分页列表
//
* 商家权限分页列表
*/
//
*/
@PostMapping
(
"/getPageList"
)
//
@PostMapping("/getPageList")
@OperationLog
(
name
=
"商家权限分页列表"
,
type
=
OperationLogType
.
PAGE
)
//
@OperationLog(name = "商家权限分页列表", type = OperationLogType.PAGE)
@ApiOperation
(
value
=
"商家权限分页列表"
,
response
=
MerchantPermissionQueryVo
.
class
)
//
@ApiOperation(value = "商家权限分页列表", response = MerchantPermissionQueryVo.class)
public
ApiResult
<
Paging
<
MerchantPermissionQueryVo
>>
getMerchantPermissionPageList
(
@Validated
@RequestBody
MerchantPermissionPageParam
merchantPermissionPageParam
)
throws
Exception
{
//
public ApiResult<Paging<MerchantPermissionQueryVo>> getMerchantPermissionPageList(@Validated @RequestBody MerchantPermissionPageParam merchantPermissionPageParam) throws Exception {
Paging
<
MerchantPermissionQueryVo
>
paging
=
merchantPermissionService
.
getMerchantPermissionPageList
(
merchantPermissionPageParam
);
//
Paging<MerchantPermissionQueryVo> paging = merchantPermissionService.getMerchantPermissionPageList(merchantPermissionPageParam);
return
ApiResult
.
ok
(
paging
);
//
return ApiResult.ok(paging);
}
//
}
//
}
//
}
//
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantRoleController.java
View file @
2b1d00db
package
com
.
jumeirah
.
api
.
merchant
.
controller
;
//
package com.jumeirah.api.merchant.controller;
//
import
com.jumeirah.common.entity.MerchantRole
;
//
import com.jumeirah.common.entity.MerchantRole;
import
com.jumeirah.common.param.MerchantRolePageParam
;
//
import com.jumeirah.common.param.MerchantRolePageParam;
import
com.jumeirah.common.service.MerchantRoleService
;
//
import com.jumeirah.common.service.MerchantRoleService;
import
com.jumeirah.common.vo.MerchantRoleQueryVo
;
//
import com.jumeirah.common.vo.MerchantRoleQueryVo;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
//
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
//
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
//
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import
io.geekidea.springbootplus.framework.core.validator.groups.Add
;
//
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import
io.geekidea.springbootplus.framework.core.validator.groups.Update
;
//
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import
io.geekidea.springbootplus.framework.log.annotation.Module
;
//
import io.geekidea.springbootplus.framework.log.annotation.Module;
import
io.geekidea.springbootplus.framework.log.annotation.OperationLog
;
//
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import
io.geekidea.springbootplus.framework.log.enums.OperationLogType
;
//
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import
io.swagger.annotations.Api
;
//
import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
//
import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
//
import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
//
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.validation.annotation.Validated
;
//
import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.GetMapping
;
//
import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.PathVariable
;
//
import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.PostMapping
;
//
import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
//
import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
//
import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
//
import org.springframework.web.bind.annotation.RestController;
//
/**
/
//
**
* 商家角色 控制器
//
* 商家角色 控制器
*
//
*
* @author wei
//
* @author wei
* @since 2020-09-27
//
* @since 2020-09-27
*/
//
*/
@Slf4j
//
@Slf4j
@RestController
//
@RestController
@RequestMapping
(
"/merchant/role"
)
//
@RequestMapping("/merchant/role")
@Module
(
"${cfg.module}"
)
//
@Module("${cfg.module}")
@Api
(
value
=
"商家角色API"
,
tags
=
{
"商家角色"
})
//
@Api(value = "商家角色API", tags = {"商家角色"})
public
class
MerchantRoleController
extends
BaseController
{
//
public class MerchantRoleController extends BaseController {
//
@Autowired
//
@Autowired
private
MerchantRoleService
merchantRoleService
;
//
private MerchantRoleService merchantRoleService;
//
/**
//
/**
* 添加商家角色
//
* 添加商家角色
*/
//
*/
@PostMapping
(
"/add"
)
//
@PostMapping("/add")
@OperationLog
(
name
=
"添加商家角色"
,
type
=
OperationLogType
.
ADD
)
//
@OperationLog(name = "添加商家角色", type = OperationLogType.ADD)
@ApiOperation
(
value
=
"添加商家角色"
,
response
=
ApiResult
.
class
)
//
@ApiOperation(value = "添加商家角色", response = ApiResult.class)
public
ApiResult
<
Boolean
>
addMerchantRole
(
@Validated
(
Add
.
class
)
@RequestBody
MerchantRole
merchantRole
)
throws
Exception
{
//
public ApiResult<Boolean> addMerchantRole(@Validated(Add.class) @RequestBody MerchantRole merchantRole) throws Exception {
boolean
flag
=
merchantRoleService
.
saveMerchantRole
(
merchantRole
);
//
boolean flag = merchantRoleService.saveMerchantRole(merchantRole);
return
ApiResult
.
result
(
flag
);
//
return ApiResult.result(flag);
}
//
}
//
/**
//
/**
* 修改商家角色
//
* 修改商家角色
*/
//
*/
@PostMapping
(
"/update"
)
//
@PostMapping("/update")
@OperationLog
(
name
=
"修改商家角色"
,
type
=
OperationLogType
.
UPDATE
)
//
@OperationLog(name = "修改商家角色", type = OperationLogType.UPDATE)
@ApiOperation
(
value
=
"修改商家角色"
,
response
=
ApiResult
.
class
)
//
@ApiOperation(value = "修改商家角色", response = ApiResult.class)
public
ApiResult
<
Boolean
>
updateMerchantRole
(
@Validated
(
Update
.
class
)
@RequestBody
MerchantRole
merchantRole
)
throws
Exception
{
//
public ApiResult<Boolean> updateMerchantRole(@Validated(Update.class) @RequestBody MerchantRole merchantRole) throws Exception {
boolean
flag
=
merchantRoleService
.
updateMerchantRole
(
merchantRole
);
//
boolean flag = merchantRoleService.updateMerchantRole(merchantRole);
return
ApiResult
.
result
(
flag
);
//
return ApiResult.result(flag);
}
//
}
//
/**
//
/**
* 删除商家角色
//
* 删除商家角色
*/
//
*/
@PostMapping
(
"/delete/{id}"
)
//
@PostMapping("/delete/{id}")
@OperationLog
(
name
=
"删除商家角色"
,
type
=
OperationLogType
.
DELETE
)
//
@OperationLog(name = "删除商家角色", type = OperationLogType.DELETE)
@ApiOperation
(
value
=
"删除商家角色"
,
response
=
ApiResult
.
class
)
//
@ApiOperation(value = "删除商家角色", response = ApiResult.class)
public
ApiResult
<
Boolean
>
deleteMerchantRole
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
//
public ApiResult<Boolean> deleteMerchantRole(@PathVariable("id") Long id) throws Exception {
boolean
flag
=
merchantRoleService
.
deleteMerchantRole
(
id
);
//
boolean flag = merchantRoleService.deleteMerchantRole(id);
return
ApiResult
.
result
(
flag
);
//
return ApiResult.result(flag);
}
//
}
//
/**
//
/**
* 获取商家角色详情
//
* 获取商家角色详情
*/
//
*/
@GetMapping
(
"/info/{id}"
)
//
@GetMapping("/info/{id}")
@OperationLog
(
name
=
"商家角色详情"
,
type
=
OperationLogType
.
INFO
)
//
@OperationLog(name = "商家角色详情", type = OperationLogType.INFO)
@ApiOperation
(
value
=
"商家角色详情"
,
response
=
MerchantRoleQueryVo
.
class
)
//
@ApiOperation(value = "商家角色详情", response = MerchantRoleQueryVo.class)
public
ApiResult
<
MerchantRoleQueryVo
>
getMerchantRole
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
//
public ApiResult<MerchantRoleQueryVo> getMerchantRole(@PathVariable("id") Long id) throws Exception {
MerchantRoleQueryVo
merchantRoleQueryVo
=
merchantRoleService
.
getMerchantRoleById
(
id
);
//
MerchantRoleQueryVo merchantRoleQueryVo = merchantRoleService.getMerchantRoleById(id);
return
ApiResult
.
ok
(
merchantRoleQueryVo
);
//
return ApiResult.ok(merchantRoleQueryVo);
}
//
}
//
/**
//
/**
* 商家角色分页列表
//
* 商家角色分页列表
*/
//
*/
@PostMapping
(
"/getPageList"
)
//
@PostMapping("/getPageList")
@OperationLog
(
name
=
"商家角色分页列表"
,
type
=
OperationLogType
.
PAGE
)
//
@OperationLog(name = "商家角色分页列表", type = OperationLogType.PAGE)
@ApiOperation
(
value
=
"商家角色分页列表"
,
response
=
MerchantRoleQueryVo
.
class
)
//
@ApiOperation(value = "商家角色分页列表", response = MerchantRoleQueryVo.class)
public
ApiResult
<
Paging
<
MerchantRoleQueryVo
>>
getMerchantRolePageList
(
@Validated
@RequestBody
MerchantRolePageParam
merchantRolePageParam
)
throws
Exception
{
//
public ApiResult<Paging<MerchantRoleQueryVo>> getMerchantRolePageList(@Validated @RequestBody MerchantRolePageParam merchantRolePageParam) throws Exception {
Paging
<
MerchantRoleQueryVo
>
paging
=
merchantRoleService
.
getMerchantRolePageList
(
merchantRolePageParam
);
//
Paging<MerchantRoleQueryVo> paging = merchantRoleService.getMerchantRolePageList(merchantRolePageParam);
return
ApiResult
.
ok
(
paging
);
//
return ApiResult.ok(paging);
}
//
}
//
}
//
}
//
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantRolePermissionController.java
View file @
2b1d00db
package
com
.
jumeirah
.
api
.
merchant
.
controller
;
//
package com.jumeirah.api.merchant.controller;
//
import
com.jumeirah.common.entity.MerchantRolePermission
;
//
import com.jumeirah.common.entity.MerchantRolePermission;
import
com.jumeirah.common.param.MerchantRolePermissionPageParam
;
//
import com.jumeirah.common.param.MerchantRolePermissionPageParam;
import
com.jumeirah.common.service.MerchantRolePermissionService
;
//
import com.jumeirah.common.service.MerchantRolePermissionService;
import
com.jumeirah.common.vo.MerchantRolePermissionQueryVo
;
//
import com.jumeirah.common.vo.MerchantRolePermissionQueryVo;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
//
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
//
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
//
import io.geekidea.springbootplus.framework.core.pagination.Paging;
import
io.geekidea.springbootplus.framework.core.validator.groups.Add
;
//
import io.geekidea.springbootplus.framework.core.validator.groups.Add;
import
io.geekidea.springbootplus.framework.core.validator.groups.Update
;
//
import io.geekidea.springbootplus.framework.core.validator.groups.Update;
import
io.geekidea.springbootplus.framework.log.annotation.Module
;
//
import io.geekidea.springbootplus.framework.log.annotation.Module;
import
io.geekidea.springbootplus.framework.log.annotation.OperationLog
;
//
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import
io.geekidea.springbootplus.framework.log.enums.OperationLogType
;
//
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import
io.swagger.annotations.Api
;
//
import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
//
import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
//
import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
//
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.validation.annotation.Validated
;
//
import org.springframework.validation.annotation.Validated;
import
org.springframework.web.bind.annotation.GetMapping
;
//
import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.PathVariable
;
//
import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.PostMapping
;
//
import org.springframework.web.bind.annotation.PostMapping;
import
org.springframework.web.bind.annotation.RequestBody
;
//
import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
//
import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
//
import org.springframework.web.bind.annotation.RestController;
//
/**
/
//
**
* 商家角色权限关系 控制器
//
* 商家角色权限关系 控制器
*
//
*
* @author wei
//
* @author wei
* @since 2020-09-27
//
* @since 2020-09-27
*/
//
*/
@Slf4j
//
@Slf4j
@RestController
//
@RestController
@RequestMapping
(
"/merchant/rolePermission"
)
//
@RequestMapping("/merchant/rolePermission")
@Module
(
"${cfg.module}"
)
//
@Module("${cfg.module}")
@Api
(
value
=
"商家角色权限关系API"
,
tags
=
{
"商家角色权限关系"
})
//
@Api(value = "商家角色权限关系API", tags = {"商家角色权限关系"})
public
class
MerchantRolePermissionController
extends
BaseController
{
//
public class MerchantRolePermissionController extends BaseController {
//
@Autowired
//
@Autowired
private
MerchantRolePermissionService
merchantRolePermissionService
;
//
private MerchantRolePermissionService merchantRolePermissionService;
//
/**
//
/**
* 添加商家角色权限关系
//
* 添加商家角色权限关系
*/
//
*/
@PostMapping
(
"/add"
)
//
@PostMapping("/add")
@OperationLog
(
name
=
"添加商家角色权限关系"
,
type
=
OperationLogType
.
ADD
)
//
@OperationLog(name = "添加商家角色权限关系", type = OperationLogType.ADD)
@ApiOperation
(
value
=
"添加商家角色权限关系"
,
response
=
ApiResult
.
class
)
//
@ApiOperation(value = "添加商家角色权限关系", response = ApiResult.class)
public
ApiResult
<
Boolean
>
addMerchantRolePermission
(
@Validated
(
Add
.
class
)
@RequestBody
MerchantRolePermission
merchantRolePermission
)
throws
Exception
{
//
public ApiResult<Boolean> addMerchantRolePermission(@Validated(Add.class) @RequestBody MerchantRolePermission merchantRolePermission) throws Exception {
boolean
flag
=
merchantRolePermissionService
.
saveMerchantRolePermission
(
merchantRolePermission
);
//
boolean flag = merchantRolePermissionService.saveMerchantRolePermission(merchantRolePermission);
return
ApiResult
.
result
(
flag
);
//
return ApiResult.result(flag);
}
//
}
//
/**
//
/**
* 修改商家角色权限关系
//
* 修改商家角色权限关系
*/
//
*/
@PostMapping
(
"/update"
)
//
@PostMapping("/update")
@OperationLog
(
name
=
"修改商家角色权限关系"
,
type
=
OperationLogType
.
UPDATE
)
//
@OperationLog(name = "修改商家角色权限关系", type = OperationLogType.UPDATE)
@ApiOperation
(
value
=
"修改商家角色权限关系"
,
response
=
ApiResult
.
class
)
//
@ApiOperation(value = "修改商家角色权限关系", response = ApiResult.class)
public
ApiResult
<
Boolean
>
updateMerchantRolePermission
(
@Validated
(
Update
.
class
)
@RequestBody
MerchantRolePermission
merchantRolePermission
)
throws
Exception
{
//
public ApiResult<Boolean> updateMerchantRolePermission(@Validated(Update.class) @RequestBody MerchantRolePermission merchantRolePermission) throws Exception {
boolean
flag
=
merchantRolePermissionService
.
updateMerchantRolePermission
(
merchantRolePermission
);
//
boolean flag = merchantRolePermissionService.updateMerchantRolePermission(merchantRolePermission);
return
ApiResult
.
result
(
flag
);
//
return ApiResult.result(flag);
}
//
}
//
/**
//
/**
* 删除商家角色权限关系
//
* 删除商家角色权限关系
*/
//
*/
@PostMapping
(
"/delete/{id}"
)
//
@PostMapping("/delete/{id}")
@OperationLog
(
name
=
"删除商家角色权限关系"
,
type
=
OperationLogType
.
DELETE
)
//
@OperationLog(name = "删除商家角色权限关系", type = OperationLogType.DELETE)
@ApiOperation
(
value
=
"删除商家角色权限关系"
,
response
=
ApiResult
.
class
)
//
@ApiOperation(value = "删除商家角色权限关系", response = ApiResult.class)
public
ApiResult
<
Boolean
>
deleteMerchantRolePermission
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
//
public ApiResult<Boolean> deleteMerchantRolePermission(@PathVariable("id") Long id) throws Exception {
boolean
flag
=
merchantRolePermissionService
.
deleteMerchantRolePermission
(
id
);
//
boolean flag = merchantRolePermissionService.deleteMerchantRolePermission(id);
return
ApiResult
.
result
(
flag
);
//
return ApiResult.result(flag);
}
//
}
//
/**
//
/**
* 获取商家角色权限关系详情
//
* 获取商家角色权限关系详情
*/
//
*/
@GetMapping
(
"/info/{id}"
)
//
@GetMapping("/info/{id}")
@OperationLog
(
name
=
"商家角色权限关系详情"
,
type
=
OperationLogType
.
INFO
)
//
@OperationLog(name = "商家角色权限关系详情", type = OperationLogType.INFO)
@ApiOperation
(
value
=
"商家角色权限关系详情"
,
response
=
MerchantRolePermissionQueryVo
.
class
)
//
@ApiOperation(value = "商家角色权限关系详情", response = MerchantRolePermissionQueryVo.class)
public
ApiResult
<
MerchantRolePermissionQueryVo
>
getMerchantRolePermission
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
//
public ApiResult<MerchantRolePermissionQueryVo> getMerchantRolePermission(@PathVariable("id") Long id) throws Exception {
MerchantRolePermissionQueryVo
merchantRolePermissionQueryVo
=
merchantRolePermissionService
.
getMerchantRolePermissionById
(
id
);
//
MerchantRolePermissionQueryVo merchantRolePermissionQueryVo = merchantRolePermissionService.getMerchantRolePermissionById(id);
return
ApiResult
.
ok
(
merchantRolePermissionQueryVo
);
//
return ApiResult.ok(merchantRolePermissionQueryVo);
}
//
}
//
/**
//
/**
* 商家角色权限关系分页列表
//
* 商家角色权限关系分页列表
*/
//
*/
@PostMapping
(
"/getPageList"
)
//
@PostMapping("/getPageList")
@OperationLog
(
name
=
"商家角色权限关系分页列表"
,
type
=
OperationLogType
.
PAGE
)
//
@OperationLog(name = "商家角色权限关系分页列表", type = OperationLogType.PAGE)
@ApiOperation
(
value
=
"商家角色权限关系分页列表"
,
response
=
MerchantRolePermissionQueryVo
.
class
)
//
@ApiOperation(value = "商家角色权限关系分页列表", response = MerchantRolePermissionQueryVo.class)
public
ApiResult
<
Paging
<
MerchantRolePermissionQueryVo
>>
getMerchantRolePermissionPageList
(
@Validated
@RequestBody
MerchantRolePermissionPageParam
merchantRolePermissionPageParam
)
throws
Exception
{
//
public ApiResult<Paging<MerchantRolePermissionQueryVo>> getMerchantRolePermissionPageList(@Validated @RequestBody MerchantRolePermissionPageParam merchantRolePermissionPageParam) throws Exception {
Paging
<
MerchantRolePermissionQueryVo
>
paging
=
merchantRolePermissionService
.
getMerchantRolePermissionPageList
(
merchantRolePermissionPageParam
);
//
Paging<MerchantRolePermissionQueryVo> paging = merchantRolePermissionService.getMerchantRolePermissionPageList(merchantRolePermissionPageParam);
return
ApiResult
.
ok
(
paging
);
//
return ApiResult.ok(paging);
}
//
}
//
}
//
}
//
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantSmsController.java
View file @
2b1d00db
package
com
.
jumeirah
.
api
.
merchant
.
controller
;
//
package com.jumeirah.api.merchant.controller;
//
import
com.jumeirah.common.service.impl.MerchantSmsService
;
//
import com.jumeirah.common.service.impl.MerchantSmsService;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
//
import io.geekidea.springbootplus.framework.common.api.ApiResult;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
//
import io.geekidea.springbootplus.framework.common.controller.BaseController;
import
io.geekidea.springbootplus.framework.log.annotation.OperationLog
;
//
import io.geekidea.springbootplus.framework.log.annotation.OperationLog;
import
io.geekidea.springbootplus.framework.log.enums.OperationLogType
;
//
import io.geekidea.springbootplus.framework.log.enums.OperationLogType;
import
io.swagger.annotations.Api
;
//
import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiOperation
;
//
import io.swagger.annotations.ApiOperation;
import
lombok.extern.slf4j.Slf4j
;
//
import lombok.extern.slf4j.Slf4j;
import
org.springframework.beans.factory.annotation.Autowired
;
//
import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.GetMapping
;
//
import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
//
import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RequestParam
;
//
import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
//
import org.springframework.web.bind.annotation.RestController;
//
/**
/
//
**
* APP用户 控制器
//
* APP用户 控制器
*
//
*
* @author wei
//
* @author wei
* @since 2020-09-23
//
* @since 2020-09-23
*/
//
*/
@Slf4j
//
@Slf4j
@RestController
//
@RestController
//@Module("api-app")
//
//
@Module("api-app")
@Api
(
value
=
"短信验证码"
,
tags
=
{
"APP短信验证码相关"
},
hidden
=
true
)
//
@Api(value = "短信验证码", tags = {"APP短信验证码相关"},hidden = true)
@RequestMapping
(
"/merchant/sms/"
)
//
@RequestMapping("/merchant/sms/")
public
class
MerchantSmsController
extends
BaseController
{
//
public class MerchantSmsController extends BaseController {
//
@Autowired
//
@Autowired
private
MerchantSmsService
merchantSmsService
;
//
private MerchantSmsService merchantSmsService;
//
/**
//
/**
* 获取注册验证码
//
* 获取注册验证码
*/
//
*/
@GetMapping
(
"/registerCode"
)
//
@GetMapping("/registerCode")
@OperationLog
(
name
=
"获取注册或登陆的验证码"
,
type
=
OperationLogType
.
INFO
)
//
@OperationLog(name = "获取注册或登陆的验证码", type = OperationLogType.INFO)
@ApiOperation
(
value
=
"获取注册或登陆的验证码"
,
response
=
Object
.
class
,
notes
=
"本地环境默认666666"
)
//
@ApiOperation(value = "获取注册或登陆的验证码", response = Object.class, notes = "本地环境默认666666")
public
ApiResult
<
Object
>
registerOrLoginCode
(
@RequestParam
String
phoneArea
,
@RequestParam
String
phone
)
throws
Exception
{
//
public ApiResult<Object> registerOrLoginCode(@RequestParam String phoneArea, @RequestParam String phone) throws Exception {
//
return
merchantSmsService
.
registerCode
(
phoneArea
,
phone
);
//
return merchantSmsService.registerCode(phoneArea, phone);
}
//
}
//
}
//
}
//
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/MerchantUserPermissionController.java
0 → 100644
View file @
2b1d00db
package
com
.
jumeirah
.
api
.
merchant
.
controller
;
import
com.jumeirah.common.entity.MerchantUserPermission
;
import
com.jumeirah.common.param.MerchantUserPermissionPageParam
;
import
com.jumeirah.common.param.MerchantUserPermissionQueryVo
;
import
com.jumeirah.common.service.MerchantUserPermissionService
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
io.geekidea.springbootplus.framework.core.validator.groups.Add
;
import
io.geekidea.springbootplus.framework.core.validator.groups.Update
;
import
io.geekidea.springbootplus.framework.log.annotation.OperationLog
;
import
io.geekidea.springbootplus.framework.log.enums.OperationLogType
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 商家用户权限关系 控制器
*
* @author giao
* @since 2020-10-19
*/
@Slf4j
@RestController
@RequestMapping
(
"/merchant/merchantUserPermission"
)
@Api
(
value
=
"商家用户权限关系API"
,
tags
=
{
"商家用户权限关系"
})
public
class
MerchantUserPermissionController
extends
BaseController
{
@Autowired
private
MerchantUserPermissionService
merchantUserPermissionService
;
/**
* 添加商家用户权限关系
*/
@PostMapping
(
"/add"
)
@OperationLog
(
name
=
"添加商家用户权限关系"
,
type
=
OperationLogType
.
ADD
)
@ApiOperation
(
value
=
"添加商家用户权限关系"
)
public
ApiResult
<
Boolean
>
addMerchantUserPermission
(
@Validated
(
Add
.
class
)
@RequestBody
MerchantUserPermission
merchantUserPermission
)
throws
Exception
{
boolean
flag
=
merchantUserPermissionService
.
saveMerchantUserPermission
(
merchantUserPermission
);
return
ApiResult
.
result
(
flag
);
}
/**
* 修改商家用户权限关系
*/
@PostMapping
(
"/update"
)
@OperationLog
(
name
=
"修改商家用户权限关系"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"修改商家用户权限关系"
)
public
ApiResult
<
Boolean
>
updateMerchantUserPermission
(
@Validated
(
Update
.
class
)
@RequestBody
MerchantUserPermission
merchantUserPermission
)
throws
Exception
{
boolean
flag
=
merchantUserPermissionService
.
updateMerchantUserPermission
(
merchantUserPermission
);
return
ApiResult
.
result
(
flag
);
}
/**
* 删除商家用户权限关系
*/
@PostMapping
(
"/delete/{id}"
)
@OperationLog
(
name
=
"删除商家用户权限关系"
,
type
=
OperationLogType
.
DELETE
)
@ApiOperation
(
value
=
"删除商家用户权限关系"
)
public
ApiResult
<
Boolean
>
deleteMerchantUserPermission
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
boolean
flag
=
merchantUserPermissionService
.
deleteMerchantUserPermission
(
id
);
return
ApiResult
.
result
(
flag
);
}
/**
* 获取商家用户权限关系详情
*/
@GetMapping
(
"/info/{id}"
)
@OperationLog
(
name
=
"商家用户权限关系详情"
,
type
=
OperationLogType
.
INFO
)
@ApiOperation
(
value
=
"商家用户权限关系详情"
)
public
ApiResult
<
MerchantUserPermissionQueryVo
>
getMerchantUserPermission
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
MerchantUserPermissionQueryVo
merchantUserPermissionQueryVo
=
merchantUserPermissionService
.
getMerchantUserPermissionById
(
id
);
return
ApiResult
.
ok
(
merchantUserPermissionQueryVo
);
}
/**
* 商家用户权限关系分页列表
*/
@PostMapping
(
"/getPageList"
)
@OperationLog
(
name
=
"商家用户权限关系分页列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"商家用户权限关系分页列表"
)
public
ApiResult
<
Paging
<
MerchantUserPermissionQueryVo
>>
getMerchantUserPermissionPageList
(
@Validated
@RequestBody
MerchantUserPermissionPageParam
merchantUserPermissionPageParam
)
throws
Exception
{
Paging
<
MerchantUserPermissionQueryVo
>
paging
=
merchantUserPermissionService
.
getMerchantUserPermissionPageList
(
merchantUserPermissionPageParam
);
return
ApiResult
.
ok
(
paging
);
}
}
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/order/McStrokeController.java
View file @
2b1d00db
package
com
.
jumeirah
.
api
.
merchant
.
controller
.
order
;
package
com
.
jumeirah
.
api
.
merchant
.
controller
.
order
;
import
com.jumeirah.api.merchant.entity.param.StrokeCompleteParam
;
import
com.jumeirah.api.merchant.entity.param.StrokeConfirmPaymentParam
;
import
com.jumeirah.api.merchant.entity.param.StrokeConfirmPaymentParam
;
import
com.jumeirah.api.merchant.entity.param.StrokeDiscountCheckParam
;
import
com.jumeirah.api.merchant.entity.param.StrokeDiscountCheckParam
;
import
com.jumeirah.api.merchant.entity.param.StrokeQuotedPriceParam
;
import
com.jumeirah.api.merchant.entity.param.StrokeQuotedPriceParam
;
import
com.jumeirah.common.entity.Stroke
;
import
com.jumeirah.common.entity.Stroke
;
import
com.jumeirah.common.enums.StrokeStatusEnum
;
import
com.jumeirah.common.param.McStrokePageParam
;
import
com.jumeirah.common.param.McStrokePageParam
;
import
com.jumeirah.common.service.StrokeService
;
import
com.jumeirah.common.service.StrokeService
;
import
com.jumeirah.common.vo.McStrokeQueryVo
;
import
com.jumeirah.common.vo.McStrokeQueryVo
;
...
@@ -39,6 +41,20 @@ public class McStrokeController extends BaseController {
...
@@ -39,6 +41,20 @@ public class McStrokeController extends BaseController {
private
StrokeService
strokeService
;
private
StrokeService
strokeService
;
/**
/**
* 完成行程接口
*/
@PostMapping
(
"/complete"
)
@OperationLog
(
name
=
"完成行程接口"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"完成行程接口"
,
response
=
ApiResult
.
class
)
public
ApiResult
<
Boolean
>
completeStroke
(
@Validated
@RequestBody
StrokeCompleteParam
strokeCompleteParam
)
throws
Exception
{
Stroke
stroke
=
new
Stroke
();
stroke
.
setId
(
strokeCompleteParam
.
getId
())
.
setStatus
(
StrokeStatusEnum
.
COMPLETED
.
getCode
());
boolean
flag
=
strokeService
.
updateStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
}
/**
* 行程表分页列表
* 行程表分页列表
*/
*/
@PostMapping
(
"/getPageList"
)
@PostMapping
(
"/getPageList"
)
...
...
api-merchant/src/main/java/com/jumeirah/api/merchant/entity/param/StrokeCompleteParam.java
0 → 100644
View file @
2b1d00db
package
com
.
jumeirah
.
api
.
merchant
.
entity
.
param
;
import
io.geekidea.springbootplus.framework.common.entity.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotNull
;
/**
* 行程表
*
* @author wei
* @since 2020-09-29
*/
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"完成行程对象"
)
public
class
StrokeCompleteParam
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@NotNull
(
message
=
"id不能为空"
)
@ApiModelProperty
(
"主键ID"
)
private
Long
id
;
}
common/src/main/java/com/jumeirah/common/entity/CharterIntroduction.java
View file @
2b1d00db
...
@@ -50,6 +50,9 @@ public class CharterIntroduction extends BaseEntity {
...
@@ -50,6 +50,9 @@ public class CharterIntroduction extends BaseEntity {
@ApiModelProperty
(
"包机文字"
)
@ApiModelProperty
(
"包机文字"
)
private
String
text
;
private
String
text
;
@ApiModelProperty
(
"包机标题"
)
private
String
title
;
@ApiModelProperty
(
"类型 1私人;2团体;3货运;4医疗"
)
@ApiModelProperty
(
"类型 1私人;2团体;3货运;4医疗"
)
private
Integer
type
;
private
Integer
type
;
...
...
common/src/main/java/com/jumeirah/common/entity/MerchantUserPermission.java
0 → 100644
View file @
2b1d00db
package
com
.
jumeirah
.
common
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.Version
;
import
io.geekidea.springbootplus.framework.common.entity.BaseEntity
;
import
io.geekidea.springbootplus.framework.core.validator.groups.Update
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotNull
;
import
java.util.Date
;
/**
* 商家用户权限关系
*
* @author giao
* @since 2020-10-19
*/
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"MerchantUserPermission对象"
)
public
class
MerchantUserPermission
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
@ApiModelProperty
(
"主键"
)
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Long
id
;
@NotNull
(
message
=
"用户id不能为空"
)
@ApiModelProperty
(
"用户id"
)
private
Long
userId
;
@NotNull
(
message
=
"权限id不能为空"
)
@ApiModelProperty
(
"权限id"
)
private
Long
permissionId
;
@ApiModelProperty
(
"状态,0:禁用,1:启用"
)
private
Integer
state
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
@ApiModelProperty
(
"职位名称"
)
private
String
positionName
;
@ApiModelProperty
(
"版本"
)
@Version
private
Integer
version
;
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
"修改时间"
)
private
Date
updateTime
;
}
common/src/main/java/com/jumeirah/common/entity/Stroke.java
View file @
2b1d00db
...
@@ -168,8 +168,4 @@ public class Stroke extends BaseEntity {
...
@@ -168,8 +168,4 @@ public class Stroke extends BaseEntity {
@ApiModelProperty
(
"用户充值截图证据, 传入数组"
)
@ApiModelProperty
(
"用户充值截图证据, 传入数组"
)
private
String
userRechargeCredentialsUrl
;
private
String
userRechargeCredentialsUrl
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
}
}
common/src/main/java/com/jumeirah/common/enums/StrokeTypeEnum.java
View file @
2b1d00db
...
@@ -14,7 +14,9 @@ public enum StrokeTypeEnum implements BaseEnum {
...
@@ -14,7 +14,9 @@ public enum StrokeTypeEnum implements BaseEnum {
ONE_WAY
(
0
,
"单程"
),
ONE_WAY
(
0
,
"单程"
),
ROUND_TRIP
(
1
,
"往返"
),
ROUND_TRIP
(
1
,
"往返"
),
CARGO_FLIGHT
(
2
,
"货运"
),
CARGO_FLIGHT
(
2
,
"货运"
),
MEDICAL_FLIGHT
(
3
,
"医疗"
);
MEDICAL_FLIGHT
(
3
,
"医疗"
),
PREFERENTIAL_TUNING
(
4
,
"优惠调机"
),
;
/**
/**
* 编号
* 编号
...
...
common/src/main/java/com/jumeirah/common/mapper/MerchantUserPermissionMapper.java
0 → 100644
View file @
2b1d00db
package
com
.
jumeirah
.
common
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jumeirah.common.entity.MerchantUserPermission
;
import
com.jumeirah.common.param.MerchantUserPermissionPageParam
;
import
com.jumeirah.common.param.MerchantUserPermissionQueryVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.io.Serializable
;
import
java.util.Set
;
/**
* 商家用户权限关系 Mapper 接口
*
* @author giao
* @since 2020-10-19
*/
@Repository
public
interface
MerchantUserPermissionMapper
extends
BaseMapper
<
MerchantUserPermission
>
{
/**
* 根据角色id获取可用的权限编码
*
* @param userId
* @return
*/
Set
<
String
>
getPermissionCodesByUserId
(
@Param
(
"userId"
)
Long
userId
);
/**
* 根据ID获取查询对象
*
* @param id
* @return
*/
MerchantUserPermissionQueryVo
getMerchantUserPermissionById
(
Serializable
id
);
/**
* 获取分页对象
*
* @param page
* @param merchantUserPermissionPageParam
* @return
*/
IPage
<
MerchantUserPermissionQueryVo
>
getMerchantUserPermissionPageList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"param"
)
MerchantUserPermissionPageParam
merchantUserPermissionPageParam
);
}
common/src/main/java/com/jumeirah/common/param/McStrokePageParam.java
View file @
2b1d00db
...
@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
...
@@ -22,7 +22,7 @@ import lombok.experimental.Accessors;
public
class
McStrokePageParam
extends
BasePageOrderParam
{
public
class
McStrokePageParam
extends
BasePageOrderParam
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"行程类型,-1-全部,0-单程,1-往返行程,2-货运,3-医疗"
)
@ApiModelProperty
(
"行程类型,-1-全部,0-单程,1-往返行程,2-货运,3-医疗
,4-优惠调机
"
)
private
Integer
type
;
private
Integer
type
;
@ApiModelProperty
(
"主键id"
)
@ApiModelProperty
(
"主键id"
)
...
...
common/src/main/java/com/jumeirah/common/param/MerchantUserPermissionPageParam.java
0 → 100644
View file @
2b1d00db
package
com
.
jumeirah
.
common
.
param
;
import
io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* <pre>
* 商家用户权限关系 分页参数对象
* </pre>
*
* @author giao
* @date 2020-10-19
*/
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"商家用户权限关系分页参数"
)
public
class
MerchantUserPermissionPageParam
extends
BasePageOrderParam
{
private
static
final
long
serialVersionUID
=
1L
;
}
common/src/main/java/com/jumeirah/common/param/MerchantUserPermissionQueryVo.java
0 → 100644
View file @
2b1d00db
package
com
.
jumeirah
.
common
.
param
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* <pre>
* 商家用户权限关系 查询结果对象
* </pre>
*
* @author giao
* @date 2020-10-19
*/
@Data
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"MerchantUserPermissionQueryVo对象"
)
public
class
MerchantUserPermissionQueryVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"主键"
)
private
Long
id
;
@ApiModelProperty
(
"用户id"
)
private
Long
userId
;
@ApiModelProperty
(
"权限id"
)
private
Long
permissionId
;
@ApiModelProperty
(
"状态,0:禁用,1:启用"
)
private
Integer
state
;
@ApiModelProperty
(
"备注"
)
private
String
remark
;
@ApiModelProperty
(
"职位名称"
)
private
String
positionName
;
@ApiModelProperty
(
"版本"
)
private
Integer
version
;
@ApiModelProperty
(
"创建时间"
)
private
Date
createTime
;
@ApiModelProperty
(
"修改时间"
)
private
Date
updateTime
;
}
\ No newline at end of file
common/src/main/java/com/jumeirah/common/service/MerchantUserPermissionService.java
0 → 100644
View file @
2b1d00db
package
com
.
jumeirah
.
common
.
service
;
import
com.jumeirah.common.entity.MerchantUserPermission
;
import
com.jumeirah.common.param.MerchantUserPermissionPageParam
;
import
com.jumeirah.common.param.MerchantUserPermissionQueryVo
;
import
io.geekidea.springbootplus.framework.common.service.BaseService
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
java.util.Set
;
/**
* 商家用户权限关系 服务类
*
* @author giao
* @since 2020-10-19
*/
public
interface
MerchantUserPermissionService
extends
BaseService
<
MerchantUserPermission
>
{
/**
* 根据角色id获取可用的权限编码
*
* @param userId
* @return
* @throws Exception
*/
Set
<
String
>
getPermissionCodesByUserId
(
Long
userId
)
throws
Exception
;
/**
* 保存
*
* @param merchantUserPermission
* @return
* @throws Exception
*/
boolean
saveMerchantUserPermission
(
MerchantUserPermission
merchantUserPermission
)
throws
Exception
;
/**
* 修改
*
* @param merchantUserPermission
* @return
* @throws Exception
*/
boolean
updateMerchantUserPermission
(
MerchantUserPermission
merchantUserPermission
)
throws
Exception
;
/**
* 删除
*
* @param id
* @return
* @throws Exception
*/
boolean
deleteMerchantUserPermission
(
Long
id
)
throws
Exception
;
/**
* 根据ID获取查询对象
*
* @param id
* @return
* @throws Exception
*/
MerchantUserPermissionQueryVo
getMerchantUserPermissionById
(
Long
id
)
throws
Exception
;
/**
* 获取分页对象
*
* @param merchantUserPermissionPageParam
* @return
* @throws Exception
*/
Paging
<
MerchantUserPermissionQueryVo
>
getMerchantUserPermissionPageList
(
MerchantUserPermissionPageParam
merchantUserPermissionPageParam
)
throws
Exception
;
}
common/src/main/java/com/jumeirah/common/service/MerchantUserService.java
View file @
2b1d00db
...
@@ -2,7 +2,6 @@ package com.jumeirah.common.service;
...
@@ -2,7 +2,6 @@ package com.jumeirah.common.service;
import
com.jumeirah.common.entity.MerchantUser
;
import
com.jumeirah.common.entity.MerchantUser
;
import
com.jumeirah.common.param.MerchantLoginParam
;
import
com.jumeirah.common.param.MerchantLoginParam
;
import
com.jumeirah.common.param.MerchantRegisterParam
;
import
com.jumeirah.common.param.MerchantUserPageParam
;
import
com.jumeirah.common.param.MerchantUserPageParam
;
import
com.jumeirah.common.vo.LoginMerUserTokenVo
;
import
com.jumeirah.common.vo.LoginMerUserTokenVo
;
import
com.jumeirah.common.vo.MerchantUserQueryVo
;
import
com.jumeirah.common.vo.MerchantUserQueryVo
;
...
@@ -37,7 +36,7 @@ public interface MerchantUserService extends BaseService<MerchantUser> {
...
@@ -37,7 +36,7 @@ public interface MerchantUserService extends BaseService<MerchantUser> {
ApiResult
<
LoginMerUserTokenVo
>
login
(
MerchantLoginParam
merchantLoginParam
)
throws
Exception
;
ApiResult
<
LoginMerUserTokenVo
>
login
(
MerchantLoginParam
merchantLoginParam
)
throws
Exception
;
ApiResult
<
Boolean
>
register
(
MerchantRegisterParam
merchantRegisterParam
)
throws
Exception
;
//
ApiResult<Boolean> register(MerchantRegisterParam merchantRegisterParam) throws Exception;
/**
/**
...
...
common/src/main/java/com/jumeirah/common/service/impl/MerchantUserPermissionServiceImpl.java
0 → 100644
View file @
2b1d00db
package
com
.
jumeirah
.
common
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jumeirah.common.entity.MerchantUserPermission
;
import
com.jumeirah.common.mapper.MerchantUserPermissionMapper
;
import
com.jumeirah.common.param.MerchantUserPermissionPageParam
;
import
com.jumeirah.common.param.MerchantUserPermissionQueryVo
;
import
com.jumeirah.common.service.MerchantUserPermissionService
;
import
io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl
;
import
io.geekidea.springbootplus.framework.core.pagination.PageInfo
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Set
;
/**
* 商家用户权限关系 服务实现类
*
* @author giao
* @since 2020-10-19
*/
@Slf4j
@Service
public
class
MerchantUserPermissionServiceImpl
extends
BaseServiceImpl
<
MerchantUserPermissionMapper
,
MerchantUserPermission
>
implements
MerchantUserPermissionService
{
@Autowired
private
MerchantUserPermissionMapper
merchantUserPermissionMapper
;
@Override
public
Set
<
String
>
getPermissionCodesByUserId
(
Long
userId
)
throws
Exception
{
return
merchantUserPermissionMapper
.
getPermissionCodesByUserId
(
userId
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
saveMerchantUserPermission
(
MerchantUserPermission
merchantUserPermission
)
throws
Exception
{
return
super
.
save
(
merchantUserPermission
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
updateMerchantUserPermission
(
MerchantUserPermission
merchantUserPermission
)
throws
Exception
{
return
super
.
updateById
(
merchantUserPermission
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
boolean
deleteMerchantUserPermission
(
Long
id
)
throws
Exception
{
return
super
.
removeById
(
id
);
}
@Override
public
MerchantUserPermissionQueryVo
getMerchantUserPermissionById
(
Long
id
)
throws
Exception
{
return
merchantUserPermissionMapper
.
getMerchantUserPermissionById
(
id
);
}
@Override
public
Paging
<
MerchantUserPermissionQueryVo
>
getMerchantUserPermissionPageList
(
MerchantUserPermissionPageParam
merchantUserPermissionPageParam
)
throws
Exception
{
Page
<
MerchantUserPermissionQueryVo
>
page
=
new
PageInfo
<>(
merchantUserPermissionPageParam
,
OrderItem
.
desc
(
getLambdaColumn
(
MerchantUserPermission:
:
getCreateTime
)));
IPage
<
MerchantUserPermissionQueryVo
>
iPage
=
merchantUserPermissionMapper
.
getMerchantUserPermissionPageList
(
page
,
merchantUserPermissionPageParam
);
return
new
Paging
<
MerchantUserPermissionQueryVo
>(
iPage
);
}
}
common/src/main/java/com/jumeirah/common/service/impl/MerchantUserServiceImpl.java
View file @
2b1d00db
...
@@ -5,17 +5,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
...
@@ -5,17 +5,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jumeirah.common.convert.UserConvert
;
import
com.jumeirah.common.convert.UserConvert
;
import
com.jumeirah.common.entity.Merchant
;
import
com.jumeirah.common.entity.MerchantPermission
;
import
com.jumeirah.common.entity.MerchantRole
;
import
com.jumeirah.common.entity.MerchantUser
;
import
com.jumeirah.common.entity.MerchantUser
;
import
com.jumeirah.common.enums.StateEnum
;
import
com.jumeirah.common.enums.StateEnum
;
import
com.jumeirah.common.mapper.MerchantUserMapper
;
import
com.jumeirah.common.mapper.MerchantUserMapper
;
import
com.jumeirah.common.param.MerchantLoginParam
;
import
com.jumeirah.common.param.MerchantLoginParam
;
import
com.jumeirah.common.param.MerchantRegisterParam
;
import
com.jumeirah.common.param.MerchantUserPageParam
;
import
com.jumeirah.common.param.MerchantUserPageParam
;
import
com.jumeirah.common.service.MerchantRolePermissionService
;
import
com.jumeirah.common.service.MerchantPermissionService
;
import
com.jumeirah.common.service.MerchantRoleService
;
import
com.jumeirah.common.service.MerchantUserPermissionService
;
import
com.jumeirah.common.service.MerchantService
;
import
com.jumeirah.common.service.MerchantUserService
;
import
com.jumeirah.common.service.MerchantUserService
;
import
com.jumeirah.common.vo.LoginMerUserTokenVo
;
import
com.jumeirah.common.vo.LoginMerUserTokenVo
;
import
com.jumeirah.common.vo.MerchantUserQueryVo
;
import
com.jumeirah.common.vo.MerchantUserQueryVo
;
...
@@ -35,16 +32,15 @@ import io.geekidea.springbootplus.framework.shiro.vo.LoginUserVo;
...
@@ -35,16 +32,15 @@ import io.geekidea.springbootplus.framework.shiro.vo.LoginUserVo;
import
io.geekidea.springbootplus.framework.util.PasswordUtil
;
import
io.geekidea.springbootplus.framework.util.PasswordUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.apache.shiro.subject.Subject
;
import
org.apache.shiro.subject.Subject
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.Duration
;
import
java.time.Duration
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
/**
/**
...
@@ -61,31 +57,37 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
...
@@ -61,31 +57,37 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
@Autowired
@Autowired
private
SpringBootPlusProperties
springBootPlusProperties
;
private
SpringBootPlusProperties
springBootPlusProperties
;
@Lazy
//
@Lazy
@Autowired
//
@Autowired
private
RedisTemplate
redisTemplate
;
//
private RedisTemplate redisTemplate;
@Lazy
@Lazy
@Autowired
@Autowired
private
MerchantLoginRedisService
merchantLoginRedisService
;
private
MerchantLoginRedisService
merchantLoginRedisService
;
@Lazy
@Autowired
private
JwtProperties
jwtProperties
;
@Autowired
private
MerchantUserMapper
merchantUserMapper
;
@Autowired
@Autowired
private
Merchant
RoleService
merchantRole
Service
;
private
Merchant
PermissionService
merchantPermission
Service
;
@Autowired
@Autowired
private
Merchant
Service
merchant
Service
;
private
Merchant
UserPermissionService
merchantUserPermission
Service
;
@Lazy
@Autowired
@Autowired
private
MerchantSmsService
merchantSmsService
;
private
JwtProperties
jwtProperties
;
@Autowired
@Autowired
private
MerchantRolePermissionService
merchantRolePermissionService
;
private
MerchantUserMapper
merchantUserMapper
;
//
// @Autowired
// private MerchantRoleService merchantRoleService;
//
// @Autowired
// private MerchantService merchantService;
//
// @Autowired
// private MerchantSmsService merchantSmsService;
// @Autowired
// private MerchantRolePermissionService merchantRolePermissionService;
public
MerchantUser
getMerUserByUsername
(
String
username
)
throws
Exception
{
public
MerchantUser
getMerUserByUsername
(
String
username
)
throws
Exception
{
MerchantUser
sysUser
=
new
MerchantUser
().
setUsername
(
username
);
MerchantUser
sysUser
=
new
MerchantUser
().
setUsername
(
username
);
...
@@ -121,22 +123,36 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
...
@@ -121,22 +123,36 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
// 将系统用户对象转换成登录用户对象
// 将系统用户对象转换成登录用户对象
LoginUserVo
loginSysUserVo
=
UserConvert
.
INSTANCE
.
merchantUserToLoginSysUserVo
(
merchantUser
);
LoginUserVo
loginSysUserVo
=
UserConvert
.
INSTANCE
.
merchantUserToLoginSysUserVo
(
merchantUser
);
// 获取当前用户角色
// // 获取当前用户角色
Long
roleId
=
merchantUser
.
getRoleId
();
// Long roleId = merchantUser.getRoleId();
MerchantRole
merchantRole
=
merchantRoleService
.
getById
(
roleId
);
// MerchantRole merchantRole = merchantRoleService.getById(roleId);
if
(
merchantRole
==
null
)
{
// if (merchantRole == null) {
throw
new
AuthenticationException
(
"角色不存在"
);
// throw new AuthenticationException("角色不存在");
}
// }
if
(
StateEnum
.
DISABLE
.
getCode
().
equals
(
merchantRole
.
getState
()))
{
// if (StateEnum.DISABLE.getCode().equals(merchantRole.getState())) {
throw
new
AuthenticationException
(
"角色已禁用"
);
// throw new AuthenticationException("角色已禁用");
}
// }
loginSysUserVo
.
setRoleId
(
merchantRole
.
getId
())
// loginSysUserVo.setRoleId(merchantRole.getId())
.
setRoleName
(
merchantRole
.
getName
())
// .setRoleName(merchantRole.getName())
.
setRoleCode
(
merchantRole
.
getCode
());
// .setRoleCode(merchantRole.getCode());
// 获取当前用户权限
// // 获取当前用户权限
Set
<
String
>
permissionCodes
=
merchantRolePermissionService
.
getPermissionCodesByRoleId
(
roleId
);
// Set<String> permissionCodes = merchantRolePermissionService.getPermissionCodesByRoleId(roleId);
// loginSysUserVo.setPermissionCodes(permissionCodes);
// 如果是超级管理员查询所有权限
if
(
merchantUser
.
getIsAdmin
().
equals
(
1
))
{
List
<
MerchantPermission
>
merchantPermissions
=
merchantPermissionService
.
list
();
Set
<
String
>
permissionCodes
=
new
HashSet
<>();
for
(
MerchantPermission
merchantPermission
:
merchantPermissions
)
{
permissionCodes
.
add
(
merchantPermission
.
getCode
());
}
loginSysUserVo
.
setPermissionCodes
(
permissionCodes
);
}
else
{
Set
<
String
>
permissionCodes
=
merchantUserPermissionService
.
getPermissionCodesByUserId
(
merchantUser
.
getId
());
loginSysUserVo
.
setPermissionCodes
(
permissionCodes
);
loginSysUserVo
.
setPermissionCodes
(
permissionCodes
);
}
// 获取数据库中保存的盐值
// 获取数据库中保存的盐值
String
newSalt
=
SaltUtil
.
getSalt
(
merchantUser
.
getSalt
(),
jwtProperties
);
String
newSalt
=
SaltUtil
.
getSalt
(
merchantUser
.
getSalt
(),
jwtProperties
);
...
@@ -147,7 +163,7 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
...
@@ -147,7 +163,7 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
log
.
debug
(
"token:{}"
,
token
);
log
.
debug
(
"token:{}"
,
token
);
// 创建AuthenticationToken
// 创建AuthenticationToken
JwtToken
jwtToken
=
JwtToken
.
build
(
token
,
username
,
merchantUser
.
getId
(),
newSalt
,
expireSecond
,
LoginClientTypeEnum
.
MERCHANT
.
getType
(),
merchantUser
.
getMcId
());
JwtToken
jwtToken
=
JwtToken
.
build
(
token
,
username
,
merchantUser
.
getId
(),
newSalt
,
expireSecond
,
LoginClientTypeEnum
.
MERCHANT
.
getType
(),
merchantUser
.
getMcId
());
boolean
enableShiro
=
springBootPlusProperties
.
getShiro
().
isEnable
();
boolean
enableShiro
=
springBootPlusProperties
.
getShiro
().
isEnable
();
if
(
enableShiro
)
{
if
(
enableShiro
)
{
...
@@ -175,37 +191,37 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
...
@@ -175,37 +191,37 @@ public class MerchantUserServiceImpl extends BaseServiceImpl<MerchantUserMapper,
return
ApiResult
.
ok
(
loginSysUserTokenVo
);
return
ApiResult
.
ok
(
loginSysUserTokenVo
);
}
}
@Override
// @Override
public
ApiResult
<
Boolean
>
register
(
MerchantRegisterParam
merchantRegisterPram
)
throws
Exception
{
// public ApiResult<Boolean> register(MerchantRegisterParam merchantRegisterPram) throws Exception {
//
// 校验验证码
// // 校验验证码
boolean
equalsRegisterCode
=
merchantSmsService
.
equalsRegisterCode
(
merchantRegisterPram
.
getPhoneArea
(),
merchantRegisterPram
.
getPhone
(),
merchantRegisterPram
.
getSmsCode
());
// boolean equalsRegisterCode = merchantSmsService.equalsRegisterCode(merchantRegisterPram.getPhoneArea(), merchantRegisterPram.getPhone(), merchantRegisterPram.getSmsCode());
if
(!
equalsRegisterCode
)
{
// if (!equalsRegisterCode) {
return
ApiResult
.
fail
(
ApiCode
.
SMS_CODE_ERROR
);
// return ApiResult.fail(ApiCode.SMS_CODE_ERROR);
}
// 删除已使用的验证码
merchantSmsService
.
deleteRegisterCode
(
merchantRegisterPram
.
getPhoneArea
(),
merchantRegisterPram
.
getPhone
());
// 判断是否已经注册
// if (appUserService.hasUserByPhoneNumer(loginParam.getPhoneArea(), loginParam.getPhone())) {
// // 如果已经注册直接走登陆的代码
// return appUserService.login(loginParam, language, true);
// }
// }
// // 删除已使用的验证码
// 没注册则先保存到数据库
// merchantSmsService.deleteRegisterCode(merchantRegisterPram.getPhoneArea(), merchantRegisterPram.getPhone());
Merchant
merchant
=
new
Merchant
();
// // 判断是否已经注册
BeanUtils
.
copyProperties
(
merchantRegisterPram
,
merchant
);
//// if (appUserService.hasUserByPhoneNumer(loginParam.getPhoneArea(), loginParam.getPhone())) {
merchant
.
setAuditRegisterStatus
(
0
);
//// // 如果已经注册直接走登陆的代码
merchant
.
setState
(
1
);
//// return appUserService.login(loginParam, language, true);
boolean
isDbOk
=
merchantService
.
saveMerchant
(
merchant
);
//// }
if
(!
isDbOk
)
{
//
return
ApiResult
.
fail
(
ApiCode
.
SPRING_BOOT_PLUS_EXCEPTION
);
// // 没注册则先保存到数据库
}
// Merchant merchant = new Merchant();
// BeanUtils.copyProperties(merchantRegisterPram, merchant);
// 创建一个该公司默认的管理员账号
// merchant.setAuditRegisterStatus(0);
// merchant.setState(1);
return
ApiResult
.
ok
();
// boolean isDbOk = merchantService.saveMerchant(merchant);
}
// if (!isDbOk) {
// return ApiResult.fail(ApiCode.SPRING_BOOT_PLUS_EXCEPTION);
// }
//
// // 创建一个该公司默认的管理员账号
//
// return ApiResult.ok();
// }
//
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
@Override
...
...
common/src/main/java/com/jumeirah/common/vo/CharterIntroductionQueryForAppVo.java
View file @
2b1d00db
...
@@ -31,6 +31,9 @@ public class CharterIntroductionQueryForAppVo implements Serializable {
...
@@ -31,6 +31,9 @@ public class CharterIntroductionQueryForAppVo implements Serializable {
@ApiModelProperty
(
"包机文字"
)
@ApiModelProperty
(
"包机文字"
)
private
String
text
;
private
String
text
;
@ApiModelProperty
(
"包机标题"
)
private
String
title
;
@ApiModelProperty
(
"图片高"
)
@ApiModelProperty
(
"图片高"
)
private
Integer
imageListHeight
;
private
Integer
imageListHeight
;
@ApiModelProperty
(
"图片宽"
)
@ApiModelProperty
(
"图片宽"
)
...
...
common/src/main/java/com/jumeirah/common/vo/McStrokeQueryVo.java
View file @
2b1d00db
...
@@ -28,5 +28,8 @@ public class McStrokeQueryVo extends Stroke implements Serializable {
...
@@ -28,5 +28,8 @@ public class McStrokeQueryVo extends Stroke implements Serializable {
@ApiModelProperty
(
"手机号"
)
@ApiModelProperty
(
"手机号"
)
private
String
phoneNumber
;
private
String
phoneNumber
;
@ApiModelProperty
(
"飞机型号名称"
)
private
String
plainTypeName
;
}
}
common/src/main/resources/mapper/CharterIntroductionMapper.xml
View file @
2b1d00db
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
id, mc_id, status, create_time, update_time,type,text,img_url,image_list_height,image_list_width
id, mc_id, status, create_time, update_time,type,text,img_url,image_list_height,image_list_width
</sql>
</sql>
<sql
id=
"Base_Column_ListForApp"
>
<sql
id=
"Base_Column_ListForApp"
>
text,img_url,ci.image_list_height,ci.image_list_width,m.head AS mcHead,m.name AS mcName
t
itle,t
ext,img_url,ci.image_list_height,ci.image_list_width,m.head AS mcHead,m.name AS mcName
</sql>
</sql>
<select
id=
"getCharterIntroductionById"
resultType=
"com.jumeirah.common.vo.CharterIntroductionQueryVo"
>
<select
id=
"getCharterIntroductionById"
resultType=
"com.jumeirah.common.vo.CharterIntroductionQueryVo"
>
...
...
common/src/main/resources/mapper/MerchantUserPermissionMapper.xml
0 → 100644
View file @
2b1d00db
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jumeirah.common.mapper.MerchantUserPermissionMapper"
>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, user_id, permission_id, state, remark, position_name, version, create_time, update_time
</sql>
<select
id=
"getPermissionCodesByUserId"
resultType=
"java.lang.String"
>
SELECT
mp.CODE
FROM
merchant_user_permission mup
INNER JOIN merchant_permission mp ON mp.id = mup.permission_id
WHERE
mup.user_id = #{userId}
</select>
<select
id=
"getMerchantUserPermissionById"
resultType=
"com.jumeirah.common.param.MerchantUserPermissionQueryVo"
>
select
<include
refid=
"Base_Column_List"
/>
from merchant_user_permission where id = #{id}
</select>
<select
id=
"getMerchantUserPermissionPageList"
parameterType=
"com.jumeirah.common.param.MerchantUserPermissionPageParam"
resultType=
"com.jumeirah.common.param.MerchantUserPermissionQueryVo"
>
select
<include
refid=
"Base_Column_List"
/>
from merchant_user_permission
</select>
</mapper>
common/src/main/resources/mapper/StrokeMapper.xml
View file @
2b1d00db
...
@@ -121,10 +121,12 @@
...
@@ -121,10 +121,12 @@
SELECT
SELECT
s.*,
s.*,
CONCAT( au.surname, au.`name` ) AS applicant,
CONCAT( au.surname, au.`name` ) AS applicant,
pt.name AS plain_type_name,
au.phone AS phone_number
au.phone AS phone_number
FROM
FROM
stroke s
stroke s
LEFT JOIN app_user au ON au.id = s.user_id
LEFT JOIN app_user au ON au.id = s.user_id
LEFT JOIN plain_type pt ON pt.id = s.plain_type_id
<where>
<where>
<if
test=
"mcStrokePageParam.type != null and mcStrokePageParam.type != -1"
>
<if
test=
"mcStrokePageParam.type != null and mcStrokePageParam.type != -1"
>
AND s.type = #{mcStrokePageParam.type}
AND s.type = #{mcStrokePageParam.type}
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/cache/MerchantLoginRedisService.java
View file @
2b1d00db
...
@@ -54,7 +54,7 @@ public interface MerchantLoginRedisService {
...
@@ -54,7 +54,7 @@ public interface MerchantLoginRedisService {
* @param username
* @param username
* @return
* @return
*/
*/
LoginUserRedisVo
getLogin
Sys
UserRedisVo
(
String
username
);
LoginUserRedisVo
getLogin
Mer
UserRedisVo
(
String
username
);
/**
/**
* 获取登录用户对象
* 获取登录用户对象
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/cache/impl/MerchantLoginRedisServiceImpl.java
View file @
2b1d00db
...
@@ -94,7 +94,7 @@ public class MerchantLoginRedisServiceImpl implements MerchantLoginRedisService
...
@@ -94,7 +94,7 @@ public class MerchantLoginRedisServiceImpl implements MerchantLoginRedisService
@Override
@Override
public
void
refreshLoginInfo
(
String
oldToken
,
String
username
,
JwtToken
newJwtToken
)
{
public
void
refreshLoginInfo
(
String
oldToken
,
String
username
,
JwtToken
newJwtToken
)
{
// 获取缓存的登录用户信息
// 获取缓存的登录用户信息
LoginUserRedisVo
loginSysUserRedisVo
=
getLogin
Sys
UserRedisVo
(
username
);
LoginUserRedisVo
loginSysUserRedisVo
=
getLogin
Mer
UserRedisVo
(
username
);
// 删除之前的token信息
// 删除之前的token信息
deleteLoginInfo
(
oldToken
,
username
);
deleteLoginInfo
(
oldToken
,
username
);
// 缓存登录信息
// 缓存登录信息
...
@@ -102,7 +102,7 @@ public class MerchantLoginRedisServiceImpl implements MerchantLoginRedisService
...
@@ -102,7 +102,7 @@ public class MerchantLoginRedisServiceImpl implements MerchantLoginRedisService
}
}
@Override
@Override
public
LoginUserRedisVo
getLogin
Sys
UserRedisVo
(
String
username
)
{
public
LoginUserRedisVo
getLogin
Mer
UserRedisVo
(
String
username
)
{
if
(
StringUtils
.
isBlank
(
username
))
{
if
(
StringUtils
.
isBlank
(
username
))
{
throw
new
IllegalArgumentException
(
"username不能为空"
);
throw
new
IllegalArgumentException
(
"username不能为空"
);
}
}
...
@@ -114,7 +114,7 @@ public class MerchantLoginRedisServiceImpl implements MerchantLoginRedisService
...
@@ -114,7 +114,7 @@ public class MerchantLoginRedisServiceImpl implements MerchantLoginRedisService
if
(
StringUtils
.
isBlank
(
username
))
{
if
(
StringUtils
.
isBlank
(
username
))
{
throw
new
IllegalArgumentException
(
"username不能为空"
);
throw
new
IllegalArgumentException
(
"username不能为空"
);
}
}
LoginUserRedisVo
userRedisVo
=
getLogin
Sys
UserRedisVo
(
username
);
LoginUserRedisVo
userRedisVo
=
getLogin
Mer
UserRedisVo
(
username
);
return
userRedisVo
;
return
userRedisVo
;
}
}
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/shiro/jwt/realm/JwtRealmMerchant.java
View file @
2b1d00db
...
@@ -73,7 +73,7 @@ public class JwtRealmMerchant extends AuthorizingRealm {
...
@@ -73,7 +73,7 @@ public class JwtRealmMerchant extends AuthorizingRealm {
// 获取username
// 获取username
String
username
=
jwtToken
.
getUsername
();
String
username
=
jwtToken
.
getUsername
();
// 获取登录用户角色权限信息
// 获取登录用户角色权限信息
LoginUserRedisVo
loginSysUserRedisVo
=
merchantLoginRedisService
.
getLogin
Sys
UserRedisVo
(
username
);
LoginUserRedisVo
loginSysUserRedisVo
=
merchantLoginRedisService
.
getLogin
Mer
UserRedisVo
(
username
);
SimpleAuthorizationInfo
authorizationInfo
=
new
SimpleAuthorizationInfo
();
SimpleAuthorizationInfo
authorizationInfo
=
new
SimpleAuthorizationInfo
();
// 设置角色
// 设置角色
authorizationInfo
.
setRoles
(
SetUtils
.
hashSet
(
loginSysUserRedisVo
.
getRoleCode
()));
authorizationInfo
.
setRoles
(
SetUtils
.
hashSet
(
loginSysUserRedisVo
.
getRoleCode
()));
...
...
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