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
426f8d17
Commit
426f8d17
authored
Oct 13, 2020
by
testdl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 用户下单功能
parent
7be595f9
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
232 additions
and
16 deletions
+232
-16
api-app/src/main/java/com/jumeirah/api/app/controller/PlainTypeController.java
+2
-9
api-app/src/main/java/com/jumeirah/api/app/controller/StrokeController.java
+8
-4
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/order/McStrokeController.java
+86
-0
common/src/main/java/com/jumeirah/common/entity/PlainType.java
+4
-2
common/src/main/java/com/jumeirah/common/mapper/StrokeMapper.java
+10
-0
common/src/main/java/com/jumeirah/common/param/McStrokePageParam.java
+40
-0
common/src/main/java/com/jumeirah/common/service/StrokeService.java
+8
-0
common/src/main/java/com/jumeirah/common/service/impl/StrokeServiceImpl.java
+9
-0
common/src/main/java/com/jumeirah/common/vo/McStrokeQueryVo.java
+32
-0
common/src/main/resources/mapper/StrokeMapper.xml
+32
-0
config/src/main/resources/config/application.yml
+1
-1
No files found.
api-app/src/main/java/com/jumeirah/api/app/controller/PlainTypeController.java
View file @
426f8d17
...
...
@@ -13,20 +13,13 @@ 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.commons.collections.list.PredicatedList
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.CollectionUtils
;
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
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
...
...
@@ -39,7 +32,7 @@ import java.util.stream.Collectors;
*/
@Slf4j
@RestController
@RequestMapping
(
"/plainType"
)
@RequestMapping
(
"/
app/
plainType"
)
@Module
(
"${cfg.module}"
)
@Api
(
value
=
"飞机型号表API"
,
tags
=
{
"飞机型号表"
})
public
class
PlainTypeController
extends
BaseController
{
...
...
@@ -54,7 +47,7 @@ public class PlainTypeController extends BaseController {
@OperationLog
(
name
=
"分组获取飞机型号列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"分组获取飞机型号列表"
,
response
=
PlainTypeQueryVo
.
class
)
public
ApiResult
<
List
<
PlainTypeBo
>>
getAllMap
()
throws
Exception
{
List
<
PlainType
>
plainTypeList
=
plainTypeService
.
getAllMap
();
List
<
PlainType
>
plainTypeList
=
plainTypeService
.
getAllMap
();
Map
<
Integer
,
List
<
PlainType
>>
resultMap
;
List
<
PlainTypeBo
>
plainTypeBoList
=
new
ArrayList
<>();
if
(!
CollectionUtils
.
isEmpty
(
plainTypeList
))
{
...
...
api-app/src/main/java/com/jumeirah/api/app/controller/StrokeController.java
View file @
426f8d17
...
...
@@ -55,7 +55,8 @@ public class StrokeController extends BaseController {
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
Stroke
stroke
=
new
Stroke
();
BeanUtils
.
copyProperties
(
strokeAddOneWayVo
,
stroke
);
stroke
.
setType
(
0
);
stroke
.
setType
(
0
)
.
setUserId
(
jwtToken
.
getUserId
());
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
}
...
...
@@ -70,7 +71,8 @@ public class StrokeController extends BaseController {
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
Stroke
stroke
=
new
Stroke
();
BeanUtils
.
copyProperties
(
strokeAddBackAndForthVo
,
stroke
);
stroke
.
setType
(
1
);
stroke
.
setType
(
1
)
.
setUserId
(
jwtToken
.
getUserId
());
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
}
...
...
@@ -85,7 +87,8 @@ public class StrokeController extends BaseController {
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
Stroke
stroke
=
new
Stroke
();
BeanUtils
.
copyProperties
(
strokeAddFreightVo
,
stroke
);
stroke
.
setType
(
2
);
stroke
.
setType
(
2
)
.
setUserId
(
jwtToken
.
getUserId
());
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
}
...
...
@@ -101,7 +104,8 @@ public class StrokeController extends BaseController {
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
Stroke
stroke
=
new
Stroke
();
BeanUtils
.
copyProperties
(
strokeAddMedicalTreatmentVo
,
stroke
);
stroke
.
setType
(
3
);
stroke
.
setType
(
3
)
.
setUserId
(
jwtToken
.
getUserId
());
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
}
...
...
api-merchant/src/main/java/com/jumeirah/api/merchant/controller/order/McStrokeController.java
0 → 100644
View file @
426f8d17
package
com
.
jumeirah
.
api
.
merchant
.
controller
.
order
;
import
com.jumeirah.common.entity.Stroke
;
import
com.jumeirah.common.param.McStrokePageParam
;
import
com.jumeirah.common.service.StrokeService
;
import
com.jumeirah.common.vo.McStrokeQueryVo
;
import
com.jumeirah.common.vo.StrokeDetailVo
;
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.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 wei
* @since 2020-09-29
*/
@Slf4j
@RestController
@RequestMapping
(
"/merchant/stroke"
)
@Api
(
value
=
"行程API"
,
tags
=
{
"行程"
})
public
class
McStrokeController
extends
BaseController
{
@Autowired
private
StrokeService
strokeService
;
/**
* 修改行程表
*/
@PostMapping
(
"/update"
)
@OperationLog
(
name
=
"修改行程表"
,
type
=
OperationLogType
.
UPDATE
)
@ApiOperation
(
value
=
"修改行程表"
,
response
=
ApiResult
.
class
)
public
ApiResult
<
Boolean
>
updateStroke
(
@Validated
(
Update
.
class
)
@RequestBody
Stroke
stroke
)
throws
Exception
{
boolean
flag
=
strokeService
.
updateStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
}
/**
* 删除行程表
*/
@PostMapping
(
"/delete/{id}"
)
@OperationLog
(
name
=
"删除行程表"
,
type
=
OperationLogType
.
DELETE
)
@ApiOperation
(
value
=
"删除行程表"
,
response
=
ApiResult
.
class
)
public
ApiResult
<
Boolean
>
deleteStroke
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
boolean
flag
=
strokeService
.
deleteStroke
(
id
);
return
ApiResult
.
result
(
flag
);
}
/**
* 获取行程表详情
*/
@GetMapping
(
"/info/{id}"
)
@OperationLog
(
name
=
"行程表详情"
,
type
=
OperationLogType
.
INFO
)
@ApiOperation
(
value
=
"行程表详情"
,
response
=
StrokeDetailVo
.
class
)
public
ApiResult
<
StrokeDetailVo
>
getStroke
(
@PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
StrokeDetailVo
strokeQueryVo
=
strokeService
.
getStrokeById
(
id
);
return
ApiResult
.
ok
(
strokeQueryVo
);
}
/**
* 行程表分页列表
*/
@PostMapping
(
"/getPageList"
)
@OperationLog
(
name
=
"行程分页列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"行程分页列表"
)
public
ApiResult
<
Paging
<
McStrokeQueryVo
>>
getMyStrokePageList
(
@Validated
@RequestBody
McStrokePageParam
mcStrokePageParam
)
throws
Exception
{
Paging
<
McStrokeQueryVo
>
paging
=
strokeService
.
getMcStrokePageList
(
mcStrokePageParam
);
return
ApiResult
.
ok
(
paging
);
}
}
common/src/main/java/com/jumeirah/common/entity/PlainType.java
View file @
426f8d17
...
...
@@ -15,6 +15,8 @@ import javax.validation.constraints.NotNull;
import
io.geekidea.springbootplus.framework.core.validator.groups.Update
;
import
java.sql.Timestamp
;
/**
* 飞机型号表
*
...
...
@@ -55,10 +57,10 @@ public class PlainType extends BaseEntity {
@NotNull
(
message
=
"创建时间(时间戳)不能为空"
)
@ApiModelProperty
(
"创建时间(时间戳)"
)
private
Long
createTime
;
private
Timestamp
createTime
;
@ApiModelProperty
(
"更新时间(时间戳)"
)
private
Long
updateTime
;
private
Timestamp
updateTime
;
@ApiModelProperty
(
"宽 单位:像素"
)
private
Integer
width
;
...
...
common/src/main/java/com/jumeirah/common/mapper/StrokeMapper.java
View file @
426f8d17
...
...
@@ -4,7 +4,9 @@ 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.Stroke
;
import
com.jumeirah.common.param.McStrokePageParam
;
import
com.jumeirah.common.param.StrokePageParam
;
import
com.jumeirah.common.vo.McStrokeQueryVo
;
import
com.jumeirah.common.vo.StrokeDetailVo
;
import
com.jumeirah.common.vo.StrokeQueryVo
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -38,4 +40,12 @@ public interface StrokeMapper extends BaseMapper<Stroke> {
*/
IPage
<
StrokeQueryVo
>
getStrokePageList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"param"
)
StrokePageParam
strokePageParam
,
@Param
(
"userId"
)
Long
userId
);
/**
* 商家端 获取行程分页对象
*
* @param page
* @param mcStrokePageParam
* @return
*/
IPage
<
McStrokeQueryVo
>
getMcStrokePageList
(
@Param
(
"page"
)
Page
page
,
@Param
(
"mcStrokePageParam"
)
McStrokePageParam
mcStrokePageParam
);
}
common/src/main/java/com/jumeirah/common/param/McStrokePageParam.java
0 → 100644
View file @
426f8d17
package
com
.
jumeirah
.
common
.
param
;
import
io.geekidea.springbootplus.framework.core.pagination.BasePageOrderParam
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
/**
* <pre>
* 行程表 分页参数对象
* </pre>
*
* @author wei
* @date 2020-09-29
*/
@Data
@Accessors
(
chain
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
@ApiModel
(
value
=
"行程表分页参数"
)
public
class
McStrokePageParam
extends
BasePageOrderParam
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"行程类型,0-单程,1-往返行程,2-货运,3-医疗"
)
private
Integer
type
;
@ApiModelProperty
(
"主键id"
)
private
Long
id
;
@ApiModelProperty
(
"开始时间"
)
private
String
startTime
;
@ApiModelProperty
(
"结束时间"
)
private
String
endTime
;
@ApiModelProperty
(
"申请人"
)
private
String
applicant
;
}
common/src/main/java/com/jumeirah/common/service/StrokeService.java
View file @
426f8d17
package
com
.
jumeirah
.
common
.
service
;
import
com.jumeirah.common.entity.Stroke
;
import
com.jumeirah.common.param.McStrokePageParam
;
import
com.jumeirah.common.param.StrokePageParam
;
import
com.jumeirah.common.vo.McStrokeQueryVo
;
import
com.jumeirah.common.vo.StrokeDetailVo
;
import
com.jumeirah.common.vo.StrokeQueryVo
;
import
io.geekidea.springbootplus.framework.common.service.BaseService
;
...
...
@@ -60,4 +62,10 @@ public interface StrokeService extends BaseService<Stroke> {
*/
Paging
<
StrokeQueryVo
>
getStrokePageList
(
StrokePageParam
strokePageParam
)
throws
Exception
;
/**
* 商家端,分页获取行程接口
* @param mcStrokePageParam
* @return
*/
Paging
<
McStrokeQueryVo
>
getMcStrokePageList
(
McStrokePageParam
mcStrokePageParam
);
}
common/src/main/java/com/jumeirah/common/service/impl/StrokeServiceImpl.java
View file @
426f8d17
...
...
@@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.metadata.OrderItem;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.jumeirah.common.entity.Stroke
;
import
com.jumeirah.common.mapper.StrokeMapper
;
import
com.jumeirah.common.param.McStrokePageParam
;
import
com.jumeirah.common.param.StrokePageParam
;
import
com.jumeirah.common.service.StrokeService
;
import
com.jumeirah.common.vo.McStrokeQueryVo
;
import
com.jumeirah.common.vo.StrokeDetailVo
;
import
com.jumeirah.common.vo.StrokeQueryVo
;
import
io.geekidea.springbootplus.framework.common.service.impl.BaseServiceImpl
;
...
...
@@ -73,4 +75,11 @@ public class StrokeServiceImpl extends BaseServiceImpl<StrokeMapper, Stroke> imp
return
new
Paging
<
StrokeQueryVo
>(
iPage
);
}
@Override
public
Paging
<
McStrokeQueryVo
>
getMcStrokePageList
(
McStrokePageParam
mcStrokePageParam
)
{
Page
<
StrokeQueryVo
>
page
=
new
PageInfo
<>(
mcStrokePageParam
,
OrderItem
.
asc
(
getLambdaColumn
(
Stroke:
:
getCreateTime
)));
IPage
<
McStrokeQueryVo
>
mcStrokePageList
=
strokeMapper
.
getMcStrokePageList
(
page
,
mcStrokePageParam
);
return
new
Paging
<
McStrokeQueryVo
>(
mcStrokePageList
);
}
}
common/src/main/java/com/jumeirah/common/vo/McStrokeQueryVo.java
0 → 100644
View file @
426f8d17
package
com
.
jumeirah
.
common
.
vo
;
import
com.jumeirah.common.entity.Stroke
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
/**
* <pre>
* 行程表 查询结果对象
* </pre>
*
* @author wei
* @date 2020-09-29
*/
@Data
@Accessors
(
chain
=
true
)
@ApiModel
(
value
=
"StrokeQueryVo对象"
)
public
class
McStrokeQueryVo
extends
Stroke
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"申请人"
)
private
String
applicant
;
@ApiModelProperty
(
"手机号"
)
private
String
phoneNumber
;
}
common/src/main/resources/mapper/StrokeMapper.xml
View file @
426f8d17
...
...
@@ -50,5 +50,37 @@
</if>
</where>
</select>
<select
id=
"getMcStrokePageList"
parameterType=
"com.jumeirah.common.param.McStrokePageParam"
resultType=
"com.jumeirah.common.vo.McStrokeQueryVo"
>
SELECT
s.*,
CONCAT( au.surname, au.`name` ) AS applicant,
au.phone AS phone_number
FROM
stroke s
LEFT JOIN app_user au ON au.id = s.user_id
<where>
<if
test=
"mcStrokePageParam.type !=null"
>
AND s.type = #{mcStrokePageParam.type}
</if>
<if
test=
"mcStrokePageParam.id !=null"
>
AND s.id = #{mcStrokePageParam.id}
</if>
<if
test=
"mcStrokePageParam.startTime !=null and mcStrokePageParam.startTime != ''"
>
AND s.create_time
>
= #{mcStrokePageParam.startTime}
</if>
<if
test=
"mcStrokePageParam.endTime !=null and mcStrokePageParam.endTime != ''"
>
AND s.create_time
<
= #{mcStrokePageParam.endTime}
</if>
<if
test=
"mcStrokePageParam.applicant !=null and mcStrokePageParam.applicant != ''"
>
AND CONCAT( au.surname, au.`name` ) LIKE CONCAT('%',#{mcStrokePageParam.applicant},'%')
</if>
</where>
WHERE
s.type = 2
AND s.id = 1
AND (s.create_time BETWEEN '2020-10-07 15:32:30' AND '2020-10-12 15:32:30')
AND CONCAT( au.surname, au.`name` ) LIKE '%姓名'
</select>
</mapper>
config/src/main/resources/config/application.yml
View file @
426f8d17
...
...
@@ -75,7 +75,7 @@ spring-boot-plus:
order
:
1
async
:
true
xss
:
enable
:
tru
e
enable
:
fals
e
url-patterns
:
/*
order
:
2
async
:
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment