Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
SiEn
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
SiEn
Commits
b888d46b
Commit
b888d46b
authored
Oct 21, 2020
by
lpx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 商家管理端飞机管理相关接口
parent
82c0b977
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
114 additions
and
23 deletions
+114
-23
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/order/McPlainTypeController.java
+2
-1
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/order/McStrokeController.java
+14
-6
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/plain/McPlainController.java
+16
-4
api-merchant/src/main/java/com/jumeirah/api/merchant/entity/param/McPlainAddParam.java
+42
-0
common/src/main/java/com/jumeirah/common/controller/McPlainController.java
+1
-1
common/src/main/java/com/jumeirah/common/entity/McPlain.java
+3
-2
common/src/main/java/com/jumeirah/common/mapper/McPlainMapper.java
+1
-1
common/src/main/java/com/jumeirah/common/param/McStrokePageParam.java
+3
-0
common/src/main/java/com/jumeirah/common/service/McPlainService.java
+1
-1
common/src/main/java/com/jumeirah/common/service/impl/McPlainServiceImpl.java
+1
-1
common/src/main/java/com/jumeirah/common/vo/McPlainQueryVo.java
+10
-1
common/src/main/resources/mapper/McPlainMapper.xml
+17
-5
common/src/main/resources/mapper/StrokeMapper.xml
+3
-0
No files found.
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/order/McPlainTypeController.java
View file @
b888d46b
...
...
@@ -12,6 +12,7 @@ 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.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -41,7 +42,7 @@ public class McPlainTypeController extends BaseController {
@GetMapping
(
"/getAllList"
)
@OperationLog
(
name
=
"获取飞机型号列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"获取飞机型号列表"
,
response
=
PlainTypeQueryVo
.
class
)
//
@RequiresPermissions("merchant:aircraft:management:view")
@RequiresPermissions
(
"merchant:aircraft:management:view"
)
public
ApiResult
<
List
<
PlainType
>
>
getAllList
()
throws
Exception
{
List
<
PlainType
>
plainTypeList
=
plainTypeService
.
getAllMap
();
return
ApiResult
.
ok
(
plainTypeList
);
...
...
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/order/McStrokeController.java
View file @
b888d46b
...
...
@@ -17,6 +17,7 @@ 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.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
...
...
@@ -25,6 +26,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.sql.Timestamp
;
/**
* 行程表 控制器
*
...
...
@@ -46,10 +49,11 @@ public class McStrokeController extends BaseController {
@PostMapping
(
"/complete"
)
@OperationLog
(
name
=
"完成行程接口"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"完成行程接口"
,
response
=
ApiResult
.
class
)
//
@RequiresPermissions("merchant:order:edit")
@RequiresPermissions
(
"merchant:order:edit"
)
public
ApiResult
<
Boolean
>
completeStroke
(
@Validated
@RequestBody
StrokeCompleteParam
strokeCompleteParam
)
throws
Exception
{
Stroke
stroke
=
new
Stroke
();
stroke
.
setId
(
strokeCompleteParam
.
getId
())
.
setUpdateTime
(
new
Timestamp
(
System
.
currentTimeMillis
()))
.
setStatus
(
StrokeStatusEnum
.
COMPLETED
.
getCode
());
boolean
flag
=
strokeService
.
updateStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
...
...
@@ -61,7 +65,7 @@ public class McStrokeController extends BaseController {
@PostMapping
(
"/getPageList"
)
@OperationLog
(
name
=
"行程分页列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"行程分页列表"
)
//
@RequiresPermissions("merchant:order:view")
@RequiresPermissions
(
"merchant:order:view"
)
public
ApiResult
<
Paging
<
McStrokeQueryVo
>>
getMyStrokePageList
(
@Validated
@RequestBody
McStrokePageParam
mcStrokePageParam
)
throws
Exception
{
Paging
<
McStrokeQueryVo
>
paging
=
strokeService
.
getMcStrokePageList
(
mcStrokePageParam
);
return
ApiResult
.
ok
(
paging
);
...
...
@@ -73,10 +77,11 @@ public class McStrokeController extends BaseController {
@PostMapping
(
"/update/quotedPrice"
)
@OperationLog
(
name
=
"行程报价接口"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"行程报价接口"
,
response
=
ApiResult
.
class
)
//
@RequiresPermissions("merchant:order:edit")
@RequiresPermissions
(
"merchant:order:edit"
)
public
ApiResult
<
Boolean
>
updateStroke
(
@Validated
@RequestBody
StrokeQuotedPriceParam
strokeQuotedPriceParam
)
throws
Exception
{
Stroke
stroke
=
new
Stroke
();
BeanUtils
.
copyProperties
(
strokeQuotedPriceParam
,
stroke
);
stroke
.
setUpdateTime
(
new
Timestamp
(
System
.
currentTimeMillis
()));
boolean
flag
=
strokeService
.
updateStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
}
...
...
@@ -87,10 +92,11 @@ public class McStrokeController extends BaseController {
@PostMapping
(
"/discount/check"
)
@OperationLog
(
name
=
"优惠调机审核接口"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"优惠调机审核接口"
,
response
=
ApiResult
.
class
)
//
@RequiresPermissions("merchant:order:edit")
@RequiresPermissions
(
"merchant:order:edit"
)
public
ApiResult
<
Boolean
>
checkStrokeDiscount
(
@Validated
@RequestBody
StrokeDiscountCheckParam
strokeDiscountCheckParam
)
throws
Exception
{
Stroke
stroke
=
new
Stroke
();
stroke
.
setId
(
strokeDiscountCheckParam
.
getId
())
.
setUpdateTime
(
new
Timestamp
(
System
.
currentTimeMillis
()))
.
setAuditStatus
(
strokeDiscountCheckParam
.
getAuditStatus
());
boolean
flag
=
strokeService
.
updateStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
...
...
@@ -102,16 +108,18 @@ public class McStrokeController extends BaseController {
@PostMapping
(
"/confirmPayment"
)
@OperationLog
(
name
=
"优惠调机审核接口"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"优惠调机审核接口"
,
response
=
ApiResult
.
class
)
//
@RequiresPermissions("merchant:order:edit")
@RequiresPermissions
(
"merchant:order:edit"
)
public
ApiResult
<
Boolean
>
confirmPaymentStroke
(
@Validated
@RequestBody
StrokeConfirmPaymentParam
strokeConfirmPaymentParam
)
throws
Exception
{
Stroke
stroke
=
new
Stroke
();
stroke
.
setId
(
strokeConfirmPaymentParam
.
getId
())
.
setStatus
(
StrokeStatusEnum
.
PROCESSING
.
getCode
())
.
setUpdateTime
(
new
Timestamp
(
System
.
currentTimeMillis
()))
.
setPaymentStatus
(
strokeConfirmPaymentParam
.
getPaymentStatus
());
boolean
flag
=
strokeService
.
updateStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
}
/* *//**
/* *//**
* 修改行程表
*//*
@PostMapping("/update")
...
...
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/plain/McPlainController.java
View file @
b888d46b
package
com
.
jumeirah
.
api
.
merchant
.
controller
.
plain
;
import
com.jumeirah.api.merchant.entity.param.McPlainAddParam
;
import
com.jumeirah.common.entity.McPlain
;
import
com.jumeirah.common.param.McPlainPageParam
;
import
com.jumeirah.common.
param
.McPlainQueryVo
;
import
com.jumeirah.common.
vo
.McPlainQueryVo
;
import
com.jumeirah.common.service.McPlainService
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
...
...
@@ -11,9 +12,13 @@ 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.geekidea.springbootplus.framework.shiro.jwt.JwtToken
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.shiro.SecurityUtils
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -31,7 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
*/
@Slf4j
@RestController
@RequestMapping
(
"/mcPlain"
)
@RequestMapping
(
"/m
erchant/m
cPlain"
)
@Api
(
value
=
"商家飞机表API"
,
tags
=
{
"商家飞机表"
})
public
class
McPlainController
extends
BaseController
{
...
...
@@ -44,7 +49,12 @@ public class McPlainController extends BaseController {
@PostMapping
(
"/add"
)
@OperationLog
(
name
=
"添加商家飞机表"
,
type
=
OperationLogType
.
ADD
)
@ApiOperation
(
value
=
"添加商家飞机表"
)
public
ApiResult
<
Boolean
>
addMcPlain
(
@Validated
(
Add
.
class
)
@RequestBody
McPlain
mcPlain
)
throws
Exception
{
@RequiresPermissions
(
"merchant:aircraft:management:edit"
)
public
ApiResult
<
Boolean
>
addMcPlain
(
@Validated
(
Add
.
class
)
@RequestBody
McPlainAddParam
mcPlainAddParam
)
throws
Exception
{
McPlain
mcPlain
=
new
McPlain
();
BeanUtils
.
copyProperties
(
mcPlainAddParam
,
mcPlain
);
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
mcPlain
.
setMcId
(
jwtToken
.
getMcId
());
boolean
flag
=
mcPlainService
.
saveMcPlain
(
mcPlain
);
return
ApiResult
.
result
(
flag
);
}
...
...
@@ -55,7 +65,9 @@ public class McPlainController extends BaseController {
@PostMapping
(
"/update"
)
@OperationLog
(
name
=
"修改商家飞机表"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"修改商家飞机表"
)
public
ApiResult
<
Boolean
>
updateMcPlain
(
@Validated
(
Update
.
class
)
@RequestBody
McPlain
mcPlain
)
throws
Exception
{
public
ApiResult
<
Boolean
>
updateMcPlain
(
@Validated
(
Update
.
class
)
@RequestBody
McPlainAddParam
mcPlainAddParam
)
throws
Exception
{
McPlain
mcPlain
=
new
McPlain
();
BeanUtils
.
copyProperties
(
mcPlainAddParam
,
mcPlain
);
boolean
flag
=
mcPlainService
.
updateMcPlain
(
mcPlain
);
return
ApiResult
.
result
(
flag
);
}
...
...
api-merchant/src/main/java/com/jumeirah/api/merchant/entity/param/McPlainAddParam.java
0 → 100644
View file @
b888d46b
package
com
.
jumeirah
.
api
.
merchant
.
entity
.
param
;
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
;
/**
* 商家飞机表
*
* @author xxx
* @since 2020-10-19
*/
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"McPlain对象"
)
public
class
McPlainAddParam
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
@NotNull
(
message
=
"id不能为空"
,
groups
=
{
Update
.
class
})
@ApiModelProperty
(
"主键ID"
)
private
Long
id
;
@NotNull
(
message
=
"飞机类型ID不能为空"
)
@ApiModelProperty
(
"飞机类型ID"
)
private
Long
ptId
;
@NotNull
(
message
=
"数量不能为空"
)
@ApiModelProperty
(
"数量"
)
private
Integer
amount
;
@NotNull
(
message
=
"所在地城市ID不能为空"
)
@ApiModelProperty
(
"所在地城市ID"
)
private
Long
cityId
;
}
common/src/main/java/com/jumeirah/common/controller/McPlainController.java
View file @
b888d46b
...
...
@@ -2,7 +2,7 @@ package com.jumeirah.common.controller;
import
com.jumeirah.common.entity.McPlain
;
import
com.jumeirah.common.param.McPlainPageParam
;
import
com.jumeirah.common.
param
.McPlainQueryVo
;
import
com.jumeirah.common.
vo
.McPlainQueryVo
;
import
com.jumeirah.common.service.McPlainService
;
import
io.geekidea.springbootplus.framework.common.api.ApiResult
;
import
io.geekidea.springbootplus.framework.common.controller.BaseController
;
...
...
common/src/main/java/com/jumeirah/common/entity/McPlain.java
View file @
b888d46b
...
...
@@ -11,6 +11,7 @@ import lombok.EqualsAndHashCode;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotNull
;
import
java.sql.Timestamp
;
/**
* 商家飞机表
...
...
@@ -40,10 +41,10 @@ public class McPlain extends BaseEntity {
@NotNull
(
message
=
"创建时间(时间戳)不能为空"
)
@ApiModelProperty
(
"创建时间(时间戳)"
)
private
Long
createTime
;
private
Timestamp
createTime
;
@ApiModelProperty
(
"更新时间(时间戳)"
)
private
Long
updateTime
;
private
Timestamp
updateTime
;
@NotNull
(
message
=
"商家ID不能为空"
)
@ApiModelProperty
(
"商家ID"
)
...
...
common/src/main/java/com/jumeirah/common/mapper/McPlainMapper.java
View file @
b888d46b
...
...
@@ -3,7 +3,7 @@ package com.jumeirah.common.mapper;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.jumeirah.common.entity.McPlain
;
import
com.jumeirah.common.param.McPlainPageParam
;
import
com.jumeirah.common.
param
.McPlainQueryVo
;
import
com.jumeirah.common.
vo
.McPlainQueryVo
;
import
org.springframework.stereotype.Repository
;
...
...
common/src/main/java/com/jumeirah/common/param/McStrokePageParam.java
View file @
b888d46b
...
...
@@ -28,6 +28,9 @@ public class McStrokePageParam extends BasePageOrderParam {
@ApiModelProperty
(
"主键id"
)
private
Long
id
;
@ApiModelProperty
(
"状态,-1全部,0-审核中,1-进行中,2-已完成,99-取消"
)
private
Integer
status
;
@ApiModelProperty
(
"开始时间"
)
private
String
startTime
;
...
...
common/src/main/java/com/jumeirah/common/service/McPlainService.java
View file @
b888d46b
...
...
@@ -3,7 +3,7 @@ package com.jumeirah.common.service;
import
com.jumeirah.common.entity.McPlain
;
import
com.jumeirah.common.param.McPlainPageParam
;
import
io.geekidea.springbootplus.framework.common.service.BaseService
;
import
com.jumeirah.common.
param
.McPlainQueryVo
;
import
com.jumeirah.common.
vo
.McPlainQueryVo
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
/**
...
...
common/src/main/java/com/jumeirah/common/service/impl/McPlainServiceImpl.java
View file @
b888d46b
...
...
@@ -4,7 +4,7 @@ import com.jumeirah.common.entity.McPlain;
import
com.jumeirah.common.mapper.McPlainMapper
;
import
com.jumeirah.common.service.McPlainService
;
import
com.jumeirah.common.param.McPlainPageParam
;
import
com.jumeirah.common.
param
.McPlainQueryVo
;
import
com.jumeirah.common.
vo
.McPlainQueryVo
;
import
io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl
;
import
io.geekidea.springbootplus.framework.core.pagination.Paging
;
import
io.geekidea.springbootplus.framework.core.pagination.PageInfo
;
...
...
common/src/main/java/com/jumeirah/common/
param
/McPlainQueryVo.java
→
common/src/main/java/com/jumeirah/common/
vo
/McPlainQueryVo.java
View file @
b888d46b
package
com
.
jumeirah
.
common
.
param
;
package
com
.
jumeirah
.
common
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -27,6 +27,9 @@ public class McPlainQueryVo implements Serializable {
@ApiModelProperty
(
"飞机类型ID"
)
private
Long
ptId
;
@ApiModelProperty
(
"飞机类型名称"
)
private
String
ptName
;
@ApiModelProperty
(
"状态,0-正常,1-禁用,99-删除"
)
private
Integer
status
;
...
...
@@ -44,4 +47,10 @@ public class McPlainQueryVo implements Serializable {
@ApiModelProperty
(
"所在地城市ID"
)
private
Long
cityId
;
@ApiModelProperty
(
"所在地城市名称"
)
private
String
cityName
;
@ApiModelProperty
(
"飞机图片地址"
)
private
String
imgUrl
;
}
common/src/main/resources/mapper/McPlainMapper.xml
View file @
b888d46b
...
...
@@ -4,20 +4,32 @@
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, pt_id, status, create_time, update_time, mc_id, amount, city_id
id,
pt_id,
status,
create_time,
update_time,
mc_id,
amount,
city_id
</sql>
<select
id=
"getMcPlainById"
resultType=
"com.jumeirah.common.
param
.McPlainQueryVo"
>
<select
id=
"getMcPlainById"
resultType=
"com.jumeirah.common.
vo
.McPlainQueryVo"
>
select
<include
refid=
"Base_Column_List"
/>
from mc_plain where id = #{id}
</select>
<select
id=
"getMcPlainPageList"
parameterType=
"com.jumeirah.common.param.McPlainPageParam"
resultType=
"com.jumeirah.common.
param
.McPlainQueryVo"
>
resultType=
"com.jumeirah.common.
vo
.McPlainQueryVo"
>
select
<include
refid=
"Base_Column_List"
/>
from mc_plain
pt.name as pt_name,
pt.img_url,
ctc.city_name_cn as city_name,
mp.*
from mc_plain mp
left join plain_type pt on pt.id = mp.pt_id
left join city_three_code ctc on ctc.id = mp.city_id
</select>
</mapper>
common/src/main/resources/mapper/StrokeMapper.xml
View file @
b888d46b
...
...
@@ -128,6 +128,9 @@
LEFT JOIN app_user au ON au.id = s.user_id
LEFT JOIN plain_type pt ON pt.id = s.plain_type_id
<where>
<if
test=
"mcStrokePageParam.status != null and mcStrokePageParam.status != -1"
>
AND s.status = #{mcStrokePageParam.status}
</if>
<if
test=
"mcStrokePageParam.type != null and mcStrokePageParam.type != -1"
>
AND s.type = #{mcStrokePageParam.type}
</if>
...
...
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