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
ced56c6f
Commit
ced56c6f
authored
Oct 10, 2020
by
hewei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'future/strokeList' into 'master'
Future/stroke list See merge request hewei/Jumeirah!10
parents
c5fb9040
79172eec
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
139 additions
and
54 deletions
+139
-54
api-app/src/main/java/com/jumeirah/api/app/controller/StrokeController.java
+18
-21
common/src/main/java/com/jumeirah/common/entity/Stroke.java
+25
-4
common/src/main/java/com/jumeirah/common/vo/StrokeDetailVo.java
+33
-7
common/src/main/java/com/jumeirah/common/vo/StrokeQueryVo.java
+32
-7
common/src/main/resources/mapper/StrokeMapper.xml
+25
-8
framework/src/main/java/io/geekidea/springbootplus/framework/util/Jackson.java
+1
-2
generator/src/main/resources/templates/controller.java.vm
+5
-5
No files found.
api-app/src/main/java/com/jumeirah/api/app/controller/StrokeController.java
View file @
ced56c6f
...
...
@@ -12,6 +12,7 @@ import com.jumeirah.common.vo.StrokeQueryVo;
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.geekidea.springbootplus.framework.shiro.jwt.JwtToken
;
...
...
@@ -37,8 +38,8 @@ import org.springframework.web.bind.annotation.RestController;
*/
@Slf4j
@RestController
@RequestMapping
(
"/stroke"
)
@Api
(
value
=
"行程
表API"
,
tags
=
{
"行程表
"
})
@RequestMapping
(
"/
app/
stroke"
)
@Api
(
value
=
"行程
API"
,
tags
=
{
"行程
"
})
public
class
StrokeController
extends
BaseController
{
@Autowired
...
...
@@ -54,8 +55,7 @@ public class StrokeController extends BaseController {
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
Stroke
stroke
=
new
Stroke
();
BeanUtils
.
copyProperties
(
strokeAddOneWayVo
,
stroke
);
stroke
.
setType
(
0
)
.
setCreateTime
(
System
.
currentTimeMillis
());
stroke
.
setType
(
0
);
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
}
...
...
@@ -70,8 +70,7 @@ public class StrokeController extends BaseController {
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
Stroke
stroke
=
new
Stroke
();
BeanUtils
.
copyProperties
(
strokeAddBackAndForthVo
,
stroke
);
stroke
.
setType
(
1
)
.
setCreateTime
(
System
.
currentTimeMillis
());
stroke
.
setType
(
1
);
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
}
...
...
@@ -86,8 +85,7 @@ public class StrokeController extends BaseController {
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
Stroke
stroke
=
new
Stroke
();
BeanUtils
.
copyProperties
(
strokeAddFreightVo
,
stroke
);
stroke
.
setType
(
2
)
.
setCreateTime
(
System
.
currentTimeMillis
());
stroke
.
setType
(
2
);
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
}
...
...
@@ -103,23 +101,22 @@ public class StrokeController extends BaseController {
JwtToken
jwtToken
=
(
JwtToken
)
SecurityUtils
.
getSubject
().
getPrincipal
();
Stroke
stroke
=
new
Stroke
();
BeanUtils
.
copyProperties
(
strokeAddMedicalTreatmentVo
,
stroke
);
stroke
.
setType
(
3
)
.
setCreateTime
(
System
.
currentTimeMillis
());
stroke
.
setType
(
3
);
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
}
//
/**
//
* 修改行程表
//
*/
//
@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
(
"/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
);
}
/**
* 删除行程表
...
...
@@ -159,7 +156,7 @@ public class StrokeController extends BaseController {
*/
@PostMapping
(
"/getMyStrokePageList"
)
@OperationLog
(
name
=
"行程分页列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"行程分页列表"
,
response
=
StrokeQueryVo
.
class
)
@ApiOperation
(
value
=
"行程分页列表"
)
public
ApiResult
<
Paging
<
StrokeQueryVo
>>
getMyStrokePageList
(
@Validated
@RequestBody
StrokePageParam
strokePageParam
)
throws
Exception
{
Paging
<
StrokeQueryVo
>
paging
=
strokeService
.
getStrokePageList
(
strokePageParam
);
return
ApiResult
.
ok
(
paging
);
...
...
common/src/main/java/com/jumeirah/common/entity/Stroke.java
View file @
ced56c6f
...
...
@@ -13,6 +13,7 @@ import lombok.experimental.Accessors;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.sql.Timestamp
;
/**
* 行程表
...
...
@@ -62,10 +63,10 @@ public class Stroke extends BaseEntity {
@NotNull
(
message
=
"出发时间不能为空"
)
@ApiModelProperty
(
"出发时间"
)
private
Long
outsetTime
;
private
Timestamp
outsetTime
;
@ApiModelProperty
(
"返程时间"
)
private
Long
returnTime
;
private
Timestamp
returnTime
;
@NotNull
(
message
=
"行程类型,0-单程,1-往返行程,2-货运,3-医疗不能为空"
)
@ApiModelProperty
(
"行程类型,0-单程,1-往返行程,2-货运,3-医疗"
)
...
...
@@ -77,10 +78,10 @@ public class Stroke extends BaseEntity {
@NotNull
(
message
=
"创建时间不能为空"
)
@ApiModelProperty
(
"创建时间"
)
private
Long
createTime
;
private
Timestamp
createTime
;
@ApiModelProperty
(
"更新时间"
)
private
Long
updateTime
;
private
Timestamp
updateTime
;
@ApiModelProperty
(
"货物名称"
)
private
String
goodsName
;
...
...
@@ -113,6 +114,26 @@ public class Stroke extends BaseEntity {
@ApiModelProperty
(
"用户ID"
)
private
Long
userId
;
@NotBlank
(
message
=
"出发机场名称不能为空"
)
@ApiModelProperty
(
"出发机场名称"
)
private
String
outsetAirportName
;
@NotBlank
(
message
=
"到达机场名称不能为空"
)
@ApiModelProperty
(
"到达机场名称"
)
private
String
arriveAirportName
;
@NotNull
(
message
=
"返程飞机型号ID为空"
)
@ApiModelProperty
(
"返程飞机型号ID"
)
private
Long
arrivePlainTypeId
;
@NotBlank
(
message
=
"返程出发机场名称不能为空"
)
@ApiModelProperty
(
"返程出发机场名称"
)
private
String
backOutsetAirportName
;
@NotBlank
(
message
=
"返程到达机场名称不能为空"
)
@ApiModelProperty
(
"返程到达机场名称"
)
private
String
backArriveAirportName
;
@NotNull
(
message
=
"商家id不能为空"
)
@ApiModelProperty
(
"商家id"
)
private
Long
mcId
;
...
...
common/src/main/java/com/jumeirah/common/vo/StrokeDetailVo.java
View file @
ced56c6f
...
...
@@ -12,6 +12,8 @@ import lombok.experimental.Accessors;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.sql.Timestamp
;
/**
* <pre>
...
...
@@ -62,11 +64,10 @@ public class StrokeDetailVo implements Serializable {
@NotNull
(
message
=
"出发时间不能为空"
)
@ApiModelProperty
(
"出发时间"
)
private
Long
outsetTime
;
private
Timestamp
outsetTime
;
@ApiModelProperty
(
"返程时间"
)
private
Long
returnTime
;
private
Timestamp
returnTime
;
@NotNull
(
message
=
"行程类型,0-单程,1-往返行程,2-货运,3-医疗不能为空"
)
@ApiModelProperty
(
"行程类型,0-单程,1-往返行程,2-货运,3-医疗"
)
...
...
@@ -78,10 +79,10 @@ public class StrokeDetailVo implements Serializable {
@NotNull
(
message
=
"创建时间不能为空"
)
@ApiModelProperty
(
"创建时间"
)
private
Long
createTime
;
private
Timestamp
createTime
;
@ApiModelProperty
(
"更新时间"
)
private
Long
updateTime
;
private
Timestamp
updateTime
;
@ApiModelProperty
(
"货物名称"
)
private
String
goodsName
;
...
...
@@ -107,8 +108,8 @@ public class StrokeDetailVo implements Serializable {
@ApiModelProperty
(
"备注"
)
private
String
remarks
;
@ApiModelProperty
(
"价格
,单位:分
"
)
private
Long
money
;
@ApiModelProperty
(
"价格"
)
private
BigDecimal
money
;
@NotNull
(
message
=
"用户ID不能为空"
)
@ApiModelProperty
(
"用户ID"
)
...
...
@@ -122,4 +123,28 @@ public class StrokeDetailVo implements Serializable {
@ApiModelProperty
(
"用户选择机型"
)
private
Long
choosePlainType
;
@NotBlank
(
message
=
"出发机场名称不能为空"
)
@ApiModelProperty
(
"出发机场名称"
)
private
String
outsetAirportName
;
@NotBlank
(
message
=
"到达机场名称不能为空"
)
@ApiModelProperty
(
"到达机场名称"
)
private
String
arriveAirportName
;
@NotNull
(
message
=
"返程飞机型号ID为空"
)
@ApiModelProperty
(
"返程飞机型号ID"
)
private
Long
arrivePlainTypeId
;
@NotBlank
(
message
=
"返程出发机场名称不能为空"
)
@ApiModelProperty
(
"返程出发机场名称"
)
private
String
backOutsetAirportName
;
@NotBlank
(
message
=
"返程到达机场名称不能为空"
)
@ApiModelProperty
(
"返程到达机场名称"
)
private
String
backArriveAirportName
;
@ApiModelProperty
(
"商家名称"
)
private
String
merchantName
;
}
\ No newline at end of file
common/src/main/java/com/jumeirah/common/vo/StrokeQueryVo.java
View file @
ced56c6f
...
...
@@ -5,7 +5,11 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.sql.Timestamp
;
/**
* <pre>
...
...
@@ -31,10 +35,10 @@ public class StrokeQueryVo implements Serializable {
private
String
cityArriveName
;
@ApiModelProperty
(
"出发时间"
)
private
Long
outsetTime
;
private
Timestamp
outsetTime
;
@ApiModelProperty
(
"返程时间"
)
private
Long
returnTime
;
private
Timestamp
returnTime
;
@ApiModelProperty
(
"行程类型,0-单程,1-往返行程,2-货运,3-医疗"
)
private
Integer
type
;
...
...
@@ -42,12 +46,32 @@ public class StrokeQueryVo implements Serializable {
@ApiModelProperty
(
"状态,0-审核中,1-进行中,2-已完成,99-取消"
)
private
Integer
status
;
@ApiModelProperty
(
"备注"
)
private
String
remarks
;
@ApiModelProperty
(
"价格,单位:分"
)
private
Long
money
;
@ApiModelProperty
(
"价格"
)
private
BigDecimal
money
;
@ApiModelProperty
(
"用户ID"
)
private
Long
userId
;
@ApiModelProperty
(
"商家名称"
)
private
String
merchantName
;
@NotBlank
(
message
=
"出发机场名称不能为空"
)
@ApiModelProperty
(
"出发机场名称"
)
private
String
outsetAirportName
;
@NotBlank
(
message
=
"到达机场名称不能为空"
)
@ApiModelProperty
(
"到达机场名称"
)
private
String
arriveAirportName
;
@NotNull
(
message
=
"返程飞机型号ID为空"
)
@ApiModelProperty
(
"返程飞机型号ID"
)
private
Long
arrivePlainTypeId
;
@NotBlank
(
message
=
"返程出发机场名称不能为空"
)
@ApiModelProperty
(
"返程出发机场名称"
)
private
String
backOutsetAirportName
;
@NotBlank
(
message
=
"返程到达机场名称不能为空"
)
@ApiModelProperty
(
"返程到达机场名称"
)
private
String
backArriveAirportName
;
}
\ No newline at end of file
common/src/main/resources/mapper/StrokeMapper.xml
View file @
ced56c6f
...
...
@@ -2,14 +2,30 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jumeirah.common.mapper.StrokeMapper"
>
<!--
通用
查询结果列 -->
<!--
分页列表
查询结果列 -->
<sql
id=
"Page_Column_List"
>
id, city_outset_id, city_outset_name, city_arrive_id, city_arrive_name, people_mun, plain_type_id, outset_time, return_time, type, status, money, user_id
</sql>
s.id,
city_outset_id,
city_outset_name,
city_arrive_id,
city_arrive_name,
people_mun,
plain_type_id,
outset_time,
return_time,
type,
STATUS,
money,
user_id,
mu.username AS merchantName
,outset_airport_name,arrive_airport_name,arrive_plain_type_id,back_outset_airport_name,back_arrive_airport_name
</sql>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, city_outset_id, deleted, city_outset_name, city_arrive_id, city_arrive_name, people_mun, plain_type_id, outset_time, return_time, type, status, create_time, update_time, goods_name, goods_size, goods_weight, disease_name, instruments, medical_persons, remarks, money, user_id
,outset_airport_name,arrive_airport_name,arrive_plain_type_id,back_outset_airport_name,back_arrive_airport_name
</sql>
<select
id=
"getStrokeById"
resultType=
"com.jumeirah.common.vo.StrokeDetailVo"
>
...
...
@@ -22,14 +38,15 @@
resultType=
"com.jumeirah.common.vo.StrokeQueryVo"
>
select
<include
refid=
"Page_Column_List"
/>
from stroke
from stroke s
INNER JOIN merchant_user mu ON mu.id = s.mc_id
<where>
and user_id = #{userId}
and deleted = 0
and
s.
user_id = #{userId}
and
s.
deleted = 0
<if
test=
"param.status != -1"
>
--
-1: 查询全部
and `status` = #{param.status}
--
查询全部 = -1
and
s.
`status` = #{param.status}
</if>
</where>
</select>
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/util/Jackson.java
View file @
ced56c6f
...
...
@@ -34,7 +34,7 @@ public class Jackson {
/**
* 时区
*/
private
static
final
TimeZone
timeZone
=
TimeZone
.
getTimeZone
(
"GMT
+8
"
);
private
static
final
TimeZone
timeZone
=
TimeZone
.
getTimeZone
(
"GMT"
);
/**
* 键按自然顺序输出
...
...
@@ -76,7 +76,6 @@ public class Jackson {
* 键按自然顺序格式化输出
*
* @param object
* @param prettyFormat
* @return
*/
public
static
String
toJsonStringNonNull
(
Object
object
)
{
...
...
generator/src/main/resources/templates/controller.java.vm
View file @
ced56c6f
...
...
@@ -81,7 +81,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#
if
(${
cfg
.
operationLog
})
@
OperationLog
(
name
=
"添加$!{table.comment}"
,
type
=
OperationLogType
.
ADD
)
#
end
@
ApiOperation
(
value
=
"添加$!{table.comment}"
,
response
=
ApiResult
.
class
)
@
ApiOperation
(
value
=
"添加$!{table.comment}"
)
public
ApiResult
<
Boolean
>
add
${
entity
}(#
if
(${
cfg
.
paramValidation
})@
Validated
(
Add
.
class
)
#
end
@
RequestBody
${
entity
}
${
cfg
.
entityObjectName
})
throws
Exception
{
boolean
flag
=
${
cfg
.
serviceObjectName
}.
save
${
entity
}(${
cfg
.
entityObjectName
});
return
ApiResult
.
result
(
flag
);
...
...
@@ -97,7 +97,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#
if
(${
cfg
.
operationLog
})
@
OperationLog
(
name
=
"修改$!{table.comment}"
,
type
=
OperationLogType
.
UPDATE
)
#
end
@
ApiOperation
(
value
=
"修改$!{table.comment}"
,
response
=
ApiResult
.
class
)
@
ApiOperation
(
value
=
"修改$!{table.comment}"
)
public
ApiResult
<
Boolean
>
update
${
entity
}(#
if
(${
cfg
.
paramValidation
})@
Validated
(
Update
.
class
)
#
end
@
RequestBody
${
entity
}
${
cfg
.
entityObjectName
})
throws
Exception
{
boolean
flag
=
${
cfg
.
serviceObjectName
}.
update
${
entity
}(${
cfg
.
entityObjectName
});
return
ApiResult
.
result
(
flag
);
...
...
@@ -113,7 +113,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#
if
(${
cfg
.
operationLog
})
@
OperationLog
(
name
=
"删除$!{table.comment}"
,
type
=
OperationLogType
.
DELETE
)
#
end
@
ApiOperation
(
value
=
"删除$!{table.comment}"
,
response
=
ApiResult
.
class
)
@
ApiOperation
(
value
=
"删除$!{table.comment}"
)
public
ApiResult
<
Boolean
>
delete
${
entity
}(@
PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
boolean
flag
=
${
cfg
.
serviceObjectName
}.
delete
${
entity
}(
id
);
return
ApiResult
.
result
(
flag
);
...
...
@@ -129,7 +129,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#
if
(${
cfg
.
operationLog
})
@
OperationLog
(
name
=
"$!{table.comment}详情"
,
type
=
OperationLogType
.
INFO
)
#
end
@
ApiOperation
(
value
=
"$!{table.comment}详情"
,
response
=
${
entity
}${
cfg
.
queryVo
}.
class
)
@
ApiOperation
(
value
=
"$!{table.comment}详情"
)
public
ApiResult
<${
entity
}${
cfg
.
queryVo
}>
get
${
entity
}(@
PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
#
if
(${
cfg
.
generatorStrategy
}
==
'SINGLE'
)
${
entity
}${
cfg
.
queryVo
}
${
cfg
.
entityObjectName
}${
cfg
.
queryVo
}
=
${
cfg
.
serviceObjectName
}.
getById
(
id
);
...
...
@@ -149,7 +149,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#
if
(${
cfg
.
operationLog
})
@
OperationLog
(
name
=
"$!{table.comment}分页列表"
,
type
=
OperationLogType
.
PAGE
)
#
end
@
ApiOperation
(
value
=
"$!{table.comment}分页列表"
,
response
=
${
entity
}${
cfg
.
queryVo
}.
class
)
@
ApiOperation
(
value
=
"$!{table.comment}分页列表"
)
public
ApiResult
<
Paging
<${
entity
}${
cfg
.
queryVo
}>>
get
${
entity
}
PageList
(#
if
(${
cfg
.
paramValidation
})@
Validated
#
end
@
RequestBody
${
entity
}${
cfg
.
pageParam
}
${
cfg
.
entityObjectName
}${
cfg
.
pageParam
})
throws
Exception
{
Paging
<${
entity
}${
cfg
.
queryVo
}>
paging
=
${
cfg
.
entityObjectName
}
Service
.
get
${
entity
}
PageList
(${
cfg
.
entityObjectName
}${
cfg
.
pageParam
});
return
ApiResult
.
ok
(
paging
);
...
...
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