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
16362a34
Commit
16362a34
authored
Oct 10, 2020
by
giaogiao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
行程相关
parent
2484b0a0
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 @
16362a34
...
@@ -12,6 +12,7 @@ import com.jumeirah.common.vo.StrokeQueryVo;
...
@@ -12,6 +12,7 @@ import com.jumeirah.common.vo.StrokeQueryVo;
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.Update
;
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.geekidea.springbootplus.framework.shiro.jwt.JwtToken
;
import
io.geekidea.springbootplus.framework.shiro.jwt.JwtToken
;
...
@@ -37,8 +38,8 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -37,8 +38,8 @@ import org.springframework.web.bind.annotation.RestController;
*/
*/
@Slf4j
@Slf4j
@RestController
@RestController
@RequestMapping
(
"/stroke"
)
@RequestMapping
(
"/
app/
stroke"
)
@Api
(
value
=
"行程
表API"
,
tags
=
{
"行程表
"
})
@Api
(
value
=
"行程
API"
,
tags
=
{
"行程
"
})
public
class
StrokeController
extends
BaseController
{
public
class
StrokeController
extends
BaseController
{
@Autowired
@Autowired
...
@@ -54,8 +55,7 @@ public class StrokeController extends BaseController {
...
@@ -54,8 +55,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
(
strokeAddOneWayVo
,
stroke
);
BeanUtils
.
copyProperties
(
strokeAddOneWayVo
,
stroke
);
stroke
.
setType
(
0
)
stroke
.
setType
(
0
);
.
setCreateTime
(
System
.
currentTimeMillis
());
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
return
ApiResult
.
result
(
flag
);
}
}
...
@@ -70,8 +70,7 @@ public class StrokeController extends BaseController {
...
@@ -70,8 +70,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
(
strokeAddBackAndForthVo
,
stroke
);
BeanUtils
.
copyProperties
(
strokeAddBackAndForthVo
,
stroke
);
stroke
.
setType
(
1
)
stroke
.
setType
(
1
);
.
setCreateTime
(
System
.
currentTimeMillis
());
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
return
ApiResult
.
result
(
flag
);
}
}
...
@@ -86,8 +85,7 @@ public class StrokeController extends BaseController {
...
@@ -86,8 +85,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
(
strokeAddFreightVo
,
stroke
);
BeanUtils
.
copyProperties
(
strokeAddFreightVo
,
stroke
);
stroke
.
setType
(
2
)
stroke
.
setType
(
2
);
.
setCreateTime
(
System
.
currentTimeMillis
());
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
return
ApiResult
.
result
(
flag
);
return
ApiResult
.
result
(
flag
);
}
}
...
@@ -103,23 +101,22 @@ public class StrokeController extends BaseController {
...
@@ -103,23 +101,22 @@ 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
(
strokeAddMedicalTreatmentVo
,
stroke
);
BeanUtils
.
copyProperties
(
strokeAddMedicalTreatmentVo
,
stroke
);
stroke
.
setType
(
3
)
stroke
.
setType
(
3
);
.
setCreateTime
(
System
.
currentTimeMillis
());
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
boolean
flag
=
strokeService
.
saveStroke
(
stroke
);
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> updateStroke(@Validated(Update.class) @RequestBody Stroke stroke) throws Exception {
public
ApiResult
<
Boolean
>
updateStroke
(
@Validated
(
Update
.
class
)
@RequestBody
Stroke
stroke
)
throws
Exception
{
//
boolean flag = strokeService.updateStroke(stroke);
boolean
flag
=
strokeService
.
updateStroke
(
stroke
);
//
return ApiResult.result(flag);
return
ApiResult
.
result
(
flag
);
//
}
}
/**
/**
* 删除行程表
* 删除行程表
...
@@ -159,7 +156,7 @@ public class StrokeController extends BaseController {
...
@@ -159,7 +156,7 @@ public class StrokeController extends BaseController {
*/
*/
@PostMapping
(
"/getMyStrokePageList"
)
@PostMapping
(
"/getMyStrokePageList"
)
@OperationLog
(
name
=
"行程分页列表"
,
type
=
OperationLogType
.
PAGE
)
@OperationLog
(
name
=
"行程分页列表"
,
type
=
OperationLogType
.
PAGE
)
@ApiOperation
(
value
=
"行程分页列表"
,
response
=
StrokeQueryVo
.
class
)
@ApiOperation
(
value
=
"行程分页列表"
)
public
ApiResult
<
Paging
<
StrokeQueryVo
>>
getMyStrokePageList
(
@Validated
@RequestBody
StrokePageParam
strokePageParam
)
throws
Exception
{
public
ApiResult
<
Paging
<
StrokeQueryVo
>>
getMyStrokePageList
(
@Validated
@RequestBody
StrokePageParam
strokePageParam
)
throws
Exception
{
Paging
<
StrokeQueryVo
>
paging
=
strokeService
.
getStrokePageList
(
strokePageParam
);
Paging
<
StrokeQueryVo
>
paging
=
strokeService
.
getStrokePageList
(
strokePageParam
);
return
ApiResult
.
ok
(
paging
);
return
ApiResult
.
ok
(
paging
);
...
...
common/src/main/java/com/jumeirah/common/entity/Stroke.java
View file @
16362a34
...
@@ -13,6 +13,7 @@ import lombok.experimental.Accessors;
...
@@ -13,6 +13,7 @@ import lombok.experimental.Accessors;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.sql.Timestamp
;
/**
/**
* 行程表
* 行程表
...
@@ -62,10 +63,10 @@ public class Stroke extends BaseEntity {
...
@@ -62,10 +63,10 @@ public class Stroke extends BaseEntity {
@NotNull
(
message
=
"出发时间不能为空"
)
@NotNull
(
message
=
"出发时间不能为空"
)
@ApiModelProperty
(
"出发时间"
)
@ApiModelProperty
(
"出发时间"
)
private
Long
outsetTime
;
private
Timestamp
outsetTime
;
@ApiModelProperty
(
"返程时间"
)
@ApiModelProperty
(
"返程时间"
)
private
Long
returnTime
;
private
Timestamp
returnTime
;
@NotNull
(
message
=
"行程类型,0-单程,1-往返行程,2-货运,3-医疗不能为空"
)
@NotNull
(
message
=
"行程类型,0-单程,1-往返行程,2-货运,3-医疗不能为空"
)
@ApiModelProperty
(
"行程类型,0-单程,1-往返行程,2-货运,3-医疗"
)
@ApiModelProperty
(
"行程类型,0-单程,1-往返行程,2-货运,3-医疗"
)
...
@@ -77,10 +78,10 @@ public class Stroke extends BaseEntity {
...
@@ -77,10 +78,10 @@ public class Stroke extends BaseEntity {
@NotNull
(
message
=
"创建时间不能为空"
)
@NotNull
(
message
=
"创建时间不能为空"
)
@ApiModelProperty
(
"创建时间"
)
@ApiModelProperty
(
"创建时间"
)
private
Long
createTime
;
private
Timestamp
createTime
;
@ApiModelProperty
(
"更新时间"
)
@ApiModelProperty
(
"更新时间"
)
private
Long
updateTime
;
private
Timestamp
updateTime
;
@ApiModelProperty
(
"货物名称"
)
@ApiModelProperty
(
"货物名称"
)
private
String
goodsName
;
private
String
goodsName
;
...
@@ -113,6 +114,26 @@ public class Stroke extends BaseEntity {
...
@@ -113,6 +114,26 @@ public class Stroke extends BaseEntity {
@ApiModelProperty
(
"用户ID"
)
@ApiModelProperty
(
"用户ID"
)
private
Long
userId
;
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不能为空"
)
@NotNull
(
message
=
"商家id不能为空"
)
@ApiModelProperty
(
"商家id"
)
@ApiModelProperty
(
"商家id"
)
private
Long
mcId
;
private
Long
mcId
;
...
...
common/src/main/java/com/jumeirah/common/vo/StrokeDetailVo.java
View file @
16362a34
...
@@ -12,6 +12,8 @@ import lombok.experimental.Accessors;
...
@@ -12,6 +12,8 @@ import lombok.experimental.Accessors;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.sql.Timestamp
;
/**
/**
* <pre>
* <pre>
...
@@ -62,11 +64,10 @@ public class StrokeDetailVo implements Serializable {
...
@@ -62,11 +64,10 @@ public class StrokeDetailVo implements Serializable {
@NotNull
(
message
=
"出发时间不能为空"
)
@NotNull
(
message
=
"出发时间不能为空"
)
@ApiModelProperty
(
"出发时间"
)
@ApiModelProperty
(
"出发时间"
)
private
Long
outsetTime
;
private
Timestamp
outsetTime
;
@ApiModelProperty
(
"返程时间"
)
@ApiModelProperty
(
"返程时间"
)
private
Long
returnTime
;
private
Timestamp
returnTime
;
@NotNull
(
message
=
"行程类型,0-单程,1-往返行程,2-货运,3-医疗不能为空"
)
@NotNull
(
message
=
"行程类型,0-单程,1-往返行程,2-货运,3-医疗不能为空"
)
@ApiModelProperty
(
"行程类型,0-单程,1-往返行程,2-货运,3-医疗"
)
@ApiModelProperty
(
"行程类型,0-单程,1-往返行程,2-货运,3-医疗"
)
...
@@ -78,10 +79,10 @@ public class StrokeDetailVo implements Serializable {
...
@@ -78,10 +79,10 @@ public class StrokeDetailVo implements Serializable {
@NotNull
(
message
=
"创建时间不能为空"
)
@NotNull
(
message
=
"创建时间不能为空"
)
@ApiModelProperty
(
"创建时间"
)
@ApiModelProperty
(
"创建时间"
)
private
Long
createTime
;
private
Timestamp
createTime
;
@ApiModelProperty
(
"更新时间"
)
@ApiModelProperty
(
"更新时间"
)
private
Long
updateTime
;
private
Timestamp
updateTime
;
@ApiModelProperty
(
"货物名称"
)
@ApiModelProperty
(
"货物名称"
)
private
String
goodsName
;
private
String
goodsName
;
...
@@ -107,8 +108,8 @@ public class StrokeDetailVo implements Serializable {
...
@@ -107,8 +108,8 @@ public class StrokeDetailVo implements Serializable {
@ApiModelProperty
(
"备注"
)
@ApiModelProperty
(
"备注"
)
private
String
remarks
;
private
String
remarks
;
@ApiModelProperty
(
"价格
,单位:分
"
)
@ApiModelProperty
(
"价格"
)
private
Long
money
;
private
BigDecimal
money
;
@NotNull
(
message
=
"用户ID不能为空"
)
@NotNull
(
message
=
"用户ID不能为空"
)
@ApiModelProperty
(
"用户ID"
)
@ApiModelProperty
(
"用户ID"
)
...
@@ -122,4 +123,28 @@ public class StrokeDetailVo implements Serializable {
...
@@ -122,4 +123,28 @@ public class StrokeDetailVo implements Serializable {
@ApiModelProperty
(
"用户选择机型"
)
@ApiModelProperty
(
"用户选择机型"
)
private
Long
choosePlainType
;
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 @
16362a34
...
@@ -5,7 +5,11 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -5,7 +5,11 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.sql.Timestamp
;
/**
/**
* <pre>
* <pre>
...
@@ -31,10 +35,10 @@ public class StrokeQueryVo implements Serializable {
...
@@ -31,10 +35,10 @@ public class StrokeQueryVo implements Serializable {
private
String
cityArriveName
;
private
String
cityArriveName
;
@ApiModelProperty
(
"出发时间"
)
@ApiModelProperty
(
"出发时间"
)
private
Long
outsetTime
;
private
Timestamp
outsetTime
;
@ApiModelProperty
(
"返程时间"
)
@ApiModelProperty
(
"返程时间"
)
private
Long
returnTime
;
private
Timestamp
returnTime
;
@ApiModelProperty
(
"行程类型,0-单程,1-往返行程,2-货运,3-医疗"
)
@ApiModelProperty
(
"行程类型,0-单程,1-往返行程,2-货运,3-医疗"
)
private
Integer
type
;
private
Integer
type
;
...
@@ -42,12 +46,32 @@ public class StrokeQueryVo implements Serializable {
...
@@ -42,12 +46,32 @@ public class StrokeQueryVo implements Serializable {
@ApiModelProperty
(
"状态,0-审核中,1-进行中,2-已完成,99-取消"
)
@ApiModelProperty
(
"状态,0-审核中,1-进行中,2-已完成,99-取消"
)
private
Integer
status
;
private
Integer
status
;
@ApiModelProperty
(
"备注"
)
@ApiModelProperty
(
"价格"
)
private
String
remarks
;
private
BigDecimal
money
;
@ApiModelProperty
(
"价格,单位:分"
)
private
Long
money
;
@ApiModelProperty
(
"用户ID"
)
@ApiModelProperty
(
"用户ID"
)
private
Long
userId
;
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 @
16362a34
...
@@ -2,14 +2,30 @@
...
@@ -2,14 +2,30 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!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"
>
<mapper
namespace=
"com.jumeirah.common.mapper.StrokeMapper"
>
<!--
通用
查询结果列 -->
<!--
分页列表
查询结果列 -->
<sql
id=
"Page_Column_List"
>
<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
s.id,
</sql>
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"
>
<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
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>
</sql>
<select
id=
"getStrokeById"
resultType=
"com.jumeirah.common.vo.StrokeDetailVo"
>
<select
id=
"getStrokeById"
resultType=
"com.jumeirah.common.vo.StrokeDetailVo"
>
...
@@ -22,14 +38,15 @@
...
@@ -22,14 +38,15 @@
resultType=
"com.jumeirah.common.vo.StrokeQueryVo"
>
resultType=
"com.jumeirah.common.vo.StrokeQueryVo"
>
select
select
<include
refid=
"Page_Column_List"
/>
<include
refid=
"Page_Column_List"
/>
from stroke
from stroke s
INNER JOIN merchant_user mu ON mu.id = s.mc_id
<where>
<where>
and user_id = #{userId}
and
s.
user_id = #{userId}
and deleted = 0
and
s.
deleted = 0
<if
test=
"param.status != -1"
>
<if
test=
"param.status != -1"
>
--
-1: 查询全部
--
查询全部 = -1
and `status` = #{param.status}
and
s.
`status` = #{param.status}
</if>
</if>
</where>
</where>
</select>
</select>
...
...
framework/src/main/java/io/geekidea/springbootplus/framework/util/Jackson.java
View file @
16362a34
...
@@ -34,7 +34,7 @@ public class Jackson {
...
@@ -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 {
...
@@ -76,7 +76,6 @@ public class Jackson {
* 键按自然顺序格式化输出
* 键按自然顺序格式化输出
*
*
* @param object
* @param object
* @param prettyFormat
* @return
* @return
*/
*/
public
static
String
toJsonStringNonNull
(
Object
object
)
{
public
static
String
toJsonStringNonNull
(
Object
object
)
{
...
...
generator/src/main/resources/templates/controller.java.vm
View file @
16362a34
...
@@ -81,7 +81,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
...
@@ -81,7 +81,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#
if
(${
cfg
.
operationLog
})
#
if
(${
cfg
.
operationLog
})
@
OperationLog
(
name
=
"添加$!{table.comment}"
,
type
=
OperationLogType
.
ADD
)
@
OperationLog
(
name
=
"添加$!{table.comment}"
,
type
=
OperationLogType
.
ADD
)
#
end
#
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
{
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
});
boolean
flag
=
${
cfg
.
serviceObjectName
}.
save
${
entity
}(${
cfg
.
entityObjectName
});
return
ApiResult
.
result
(
flag
);
return
ApiResult
.
result
(
flag
);
...
@@ -97,7 +97,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
...
@@ -97,7 +97,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#
if
(${
cfg
.
operationLog
})
#
if
(${
cfg
.
operationLog
})
@
OperationLog
(
name
=
"修改$!{table.comment}"
,
type
=
OperationLogType
.
UPDATE
)
@
OperationLog
(
name
=
"修改$!{table.comment}"
,
type
=
OperationLogType
.
UPDATE
)
#
end
#
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
{
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
});
boolean
flag
=
${
cfg
.
serviceObjectName
}.
update
${
entity
}(${
cfg
.
entityObjectName
});
return
ApiResult
.
result
(
flag
);
return
ApiResult
.
result
(
flag
);
...
@@ -113,7 +113,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
...
@@ -113,7 +113,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#
if
(${
cfg
.
operationLog
})
#
if
(${
cfg
.
operationLog
})
@
OperationLog
(
name
=
"删除$!{table.comment}"
,
type
=
OperationLogType
.
DELETE
)
@
OperationLog
(
name
=
"删除$!{table.comment}"
,
type
=
OperationLogType
.
DELETE
)
#
end
#
end
@
ApiOperation
(
value
=
"删除$!{table.comment}"
,
response
=
ApiResult
.
class
)
@
ApiOperation
(
value
=
"删除$!{table.comment}"
)
public
ApiResult
<
Boolean
>
delete
${
entity
}(@
PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
public
ApiResult
<
Boolean
>
delete
${
entity
}(@
PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
boolean
flag
=
${
cfg
.
serviceObjectName
}.
delete
${
entity
}(
id
);
boolean
flag
=
${
cfg
.
serviceObjectName
}.
delete
${
entity
}(
id
);
return
ApiResult
.
result
(
flag
);
return
ApiResult
.
result
(
flag
);
...
@@ -129,7 +129,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
...
@@ -129,7 +129,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#
if
(${
cfg
.
operationLog
})
#
if
(${
cfg
.
operationLog
})
@
OperationLog
(
name
=
"$!{table.comment}详情"
,
type
=
OperationLogType
.
INFO
)
@
OperationLog
(
name
=
"$!{table.comment}详情"
,
type
=
OperationLogType
.
INFO
)
#
end
#
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
{
public
ApiResult
<${
entity
}${
cfg
.
queryVo
}>
get
${
entity
}(@
PathVariable
(
"id"
)
Long
id
)
throws
Exception
{
#
if
(${
cfg
.
generatorStrategy
}
==
'SINGLE'
)
#
if
(${
cfg
.
generatorStrategy
}
==
'SINGLE'
)
${
entity
}${
cfg
.
queryVo
}
${
cfg
.
entityObjectName
}${
cfg
.
queryVo
}
=
${
cfg
.
serviceObjectName
}.
getById
(
id
);
${
entity
}${
cfg
.
queryVo
}
${
cfg
.
entityObjectName
}${
cfg
.
queryVo
}
=
${
cfg
.
serviceObjectName
}.
getById
(
id
);
...
@@ -149,7 +149,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
...
@@ -149,7 +149,7 @@ private ${table.serviceName} ${cfg.serviceObjectName};
#
if
(${
cfg
.
operationLog
})
#
if
(${
cfg
.
operationLog
})
@
OperationLog
(
name
=
"$!{table.comment}分页列表"
,
type
=
OperationLogType
.
PAGE
)
@
OperationLog
(
name
=
"$!{table.comment}分页列表"
,
type
=
OperationLogType
.
PAGE
)
#
end
#
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
{
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
});
Paging
<${
entity
}${
cfg
.
queryVo
}>
paging
=
${
cfg
.
entityObjectName
}
Service
.
get
${
entity
}
PageList
(${
cfg
.
entityObjectName
}${
cfg
.
pageParam
});
return
ApiResult
.
ok
(
paging
);
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