Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
8475c939
Commit
8475c939
authored
Sep 10, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-vehicle-price' into dev-tiande
parents
9972e8cd
9af4f1f2
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
347 additions
and
0 deletions
+347
-0
ShuntApply.java
.../main/java/com/xxfc/platform/order/entity/ShuntApply.java
+160
-0
ShuntApplyMapper.java
...java/com/xxfc/platform/order/mapper/ShuntApplyMapper.java
+15
-0
ShuntApplyController.java
...va/com/xxfc/platform/order/rest/ShuntApplyController.java
+145
-0
ShuntApplyMapper.xml
...der-server/src/main/resources/mapper/ShuntApplyMapper.xml
+27
-0
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/ShuntApply.java
0 → 100755
View file @
8475c939
package
com
.
xxfc
.
platform
.
order
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* 调车申请
*
* @author libin
* @email 18178966185@163.com
* @date 2020-09-09 14:49:51
*/
@Data
@Table
(
name
=
"shunt_apply"
)
public
class
ShuntApply
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
public
static
final
int
STATUS_DEL
=
0
;
public
static
final
int
STATUS_CRT
=
1
;
public
static
final
int
STATUS_CNL
=
2
;
public
static
final
int
STATUS_CONFIRM
=
3
;
public
static
final
int
STATUS_ORDER
=
4
;
/**
* 主键
*/
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键"
)
private
Integer
id
;
/**
* 状态
0--删除
1--创建
2--取消
3--申请成功
*/
@Column
(
name
=
"status"
)
@ApiModelProperty
(
value
=
"状态 0--删除 1--创建 2--取消 3--申请成功 "
)
private
Integer
status
;
/**
* 创建时间
*/
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Date
crtTime
;
/**
* 创建者id
*/
@Column
(
name
=
"crt_user"
)
@ApiModelProperty
(
value
=
"创建者id"
)
private
String
crtUser
;
/**
* 用户id
*/
@Column
(
name
=
"user_id"
)
@ApiModelProperty
(
value
=
"用户id"
)
private
Integer
userId
;
/**
* 更新者id
*/
@Column
(
name
=
"upd_user"
)
@ApiModelProperty
(
value
=
"更新者id"
)
private
String
updUser
;
/**
* 更新时间
*/
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
value
=
"更新时间"
,
hidden
=
true
)
private
Date
updTime
;
/**
* 开始公司
*/
@Column
(
name
=
"start_company_id"
)
@ApiModelProperty
(
value
=
"开始公司"
)
private
Integer
startCompanyId
;
/**
* 结束公司
*/
@Column
(
name
=
"end_company_id"
)
@ApiModelProperty
(
value
=
"结束公司"
)
private
Integer
endCompanyId
;
/**
* 车型id
*/
@Column
(
name
=
"model_id"
)
@ApiModelProperty
(
value
=
"车型id"
)
private
Integer
modelId
;
/**
* 车辆id
*/
@Column
(
name
=
"vehicle_id"
)
@ApiModelProperty
(
value
=
"车辆id"
)
private
String
vehicleId
;
/**
* 开始时间
*/
@Column
(
name
=
"start_time"
)
@ApiModelProperty
(
value
=
"开始时间"
)
private
Long
startTime
;
/**
* 结束时间
*/
@Column
(
name
=
"end_time"
)
@ApiModelProperty
(
value
=
"结束时间"
)
private
Long
endTime
;
/**
* 订单id
*/
@Column
(
name
=
"order_id"
)
@ApiModelProperty
(
value
=
"订单id"
)
private
Integer
orderId
;
/**
* 订单编号
*/
@Column
(
name
=
"order_no"
)
@ApiModelProperty
(
value
=
"订单编号"
)
private
String
orderNo
;
/**
* 开始公司名称
*/
@Column
(
name
=
"start_company_name"
)
@ApiModelProperty
(
value
=
"开始公司名称"
)
private
String
startCompanyName
;
/**
* 结束公司名称
*/
@Column
(
name
=
"end_company_name"
)
@ApiModelProperty
(
value
=
"结束公司名称"
)
private
String
endCompanyName
;
/**
* 超时时间戳
*/
@Column
(
name
=
"over_time"
)
@ApiModelProperty
(
value
=
"超时时间戳"
,
hidden
=
true
)
private
Long
overTime
;
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mapper/ShuntApplyMapper.java
0 → 100755
View file @
8475c939
package
com
.
xxfc
.
platform
.
order
.
mapper
;
import
com.xxfc.platform.order.entity.ShuntApply
;
import
tk.mybatis.mapper.common.Mapper
;
/**
* 调车申请
*
* @author libin
* @email 18178966185@163.com
* @date 2020-09-09 14:49:51
*/
public
interface
ShuntApplyMapper
extends
Mapper
<
ShuntApply
>
{
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/ShuntApplyController.java
0 → 100755
View file @
8475c939
package
com
.
xxfc
.
platform
.
order
.
rest
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.common.context.BaseContextHandler
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
com.xxfc.platform.order.biz.OrderRentVehicleBiz
;
import
com.xxfc.platform.order.biz.ShuntApplyBiz
;
import
com.xxfc.platform.order.biz.inner.OrderCalculateBiz
;
import
com.xxfc.platform.order.entity.ShuntApply
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO
;
import
com.xxfc.platform.order.pojo.order.add.BgAddRentDTO
;
import
com.xxfc.platform.order.service.OrderRentVehicleService
;
import
com.xxfc.platform.vehicle.entity.VehicleModel
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
vo
.
PageDataVO
.
pageInfo
;
@RestController
@RequestMapping
(
"shuntApply"
)
public
class
ShuntApplyController
extends
BaseController
<
ShuntApplyBiz
,
ShuntApply
>
{
@Autowired
VehicleFeign
vehicleFeign
;
@Autowired
UserFeign
userFeign
;
@Autowired
OrderRentVehicleBiz
orderRentVehicleBiz
;
@Autowired
OrderCalculateBiz
orderCalculateBiz
;
@Autowired
OrderRentVehicleService
orderRentVehicleService
;
@RequestMapping
(
value
=
"/addApply"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ApiOperation
(
value
=
"申请列表"
)
public
ObjectRestResponse
addApply
(
@RequestBody
ShuntApply
shuntApply
)
{
//查询列表数据
if
(
StrUtil
.
isBlank
(
getCurrentUserId
()))
{
throw
new
BaseException
(
ResultCode
.
AJAX_WECHAT_NOTEXIST_CODE
);
}
shuntApply
.
setUserId
(
getCurrentUserIdInt
());
return
add
(
shuntApply
);
}
@RequestMapping
(
value
=
"/pageList"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ApiOperation
(
value
=
"申请列表"
)
public
ObjectRestResponse
<
PageDataVO
<
ShuntApplyVO
>>
pageList
(
QueryDTO
dto
)
{
//查询列表数据
if
(
StrUtil
.
isBlank
(
getCurrentUserId
()))
{
throw
new
BaseException
(
ResultCode
.
AJAX_WECHAT_NOTEXIST_CODE
);
}
dto
.
setUserId
(
Integer
.
valueOf
(
BaseContextHandler
.
getUserID
()));
Query
query
=
new
Query
(
dto
);
PageDataVO
<
ShuntApplyVO
>
pages
=
PageDataVO
.
pageInfo
(
query
,
()
->
baseBiz
.
selectByWeekend
(
w
->
{
w
.
andEqualTo
(
ShuntApply:
:
getUserId
,
dto
.
getUserId
());
return
w
;
},
" crt_time desc "
),
ShuntApplyVO
.
class
);
pages
.
getData
().
forEach
(
data
->
{
data
.
setVehicleModel
(
vehicleFeign
.
get
(
data
.
getModelId
()).
getData
());
});
return
ObjectRestResponse
.
succ
(
pages
);
}
@RequestMapping
(
value
=
"/applyOrder"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ApiOperation
(
value
=
"申请调车下单"
)
public
ObjectRestResponse
applyOrder
(
@RequestBody
ApplyOrderDTO
dto
)
{
//查询列表数据
if
(
StrUtil
.
isBlank
(
getCurrentUserId
()))
{
throw
new
BaseException
(
ResultCode
.
AJAX_WECHAT_NOTEXIST_CODE
);
}
if
(
null
==
dto
.
getApplyId
())
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
ShuntApply
shuntApply
=
baseBiz
.
selectById
(
dto
.
getApplyId
());
if
(
null
==
shuntApply
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
// BgAddRentDTO bgAddRentDTO = new BgAddRentDTO();
// bgAddRentDTO.setAppUserId(shuntApply.getUserId());
// bgAddRentDTO.setStartTime(shuntApply.getStartTime());
// bgAddRentDTO.setEndTime(shuntApply.getEndTime());
// bgAddRentDTO.setVehicleId(shuntApply.getVehicleId());
//
// RentVehicleBO bo = orderRentVehicleBiz.initRentVehicleBO(bgAddRentDTO);
// bo.setDayNum(orderCalculateBiz.getIncludeDays(bgAddRentDTO.getStartTime(), bgAddRentDTO.getEndTime()));
//
// bo.setAppUserDTO(userFeign.userDetailById(bgAddRentDTO.getAppUserId()).getData());
// bo.setCrtUser("-1"+ BaseContextHandler.getUserID());
// //设置-1表示查询所有的车
// //bo.setUseType(-1);
// orderRentVehicleService.createOrder(bo);
// AddRentVehicleDTO vo = new AddRentVehicleDTO(){{
// setStartTime(shuntApply.getStartTime());
// setEndTime(shuntApply.getEndTime());
// setC
// setDayNum(orderCalculateBiz.getIncludeDays(shuntApply.getStartTime(), shuntApply.getEndTime()));
// }};
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
bo
.
setAppUserDTO
(
userFeign
.
userDetailByToken
(
BaseContextHandler
.
getToken
()).
getData
());
orderRentVehicleService
.
createOrder
(
bo
);
return
ObjectRestResponse
.
succ
(
bo
.
getOrder
());
}
@Data
public
static
class
QueryDTO
extends
PageParam
{
Integer
userId
;
}
@Data
public
static
class
ShuntApplyVO
extends
ShuntApply
{
VehicleModel
vehicleModel
;
}
@Data
public
static
class
ApplyOrderDTO
extends
AddRentVehicleDTO
{
Integer
applyId
;
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/resources/mapper/ShuntApplyMapper.xml
0 → 100755
View file @
8475c939
<?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.xxfc.platform.order.mapper.ShuntApplyMapper"
>
<!-- 可根据自己的需求,是否要使用 -->
<resultMap
type=
"com.xxfc.platform.order.entity.ShuntApply"
id=
"shuntApplyMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"crtTime"
column=
"crt_time"
/>
<result
property=
"crtUser"
column=
"crt_user"
/>
<result
property=
"userId"
column=
"user_id"
/>
<result
property=
"updUser"
column=
"upd_user"
/>
<result
property=
"updTime"
column=
"upd_time"
/>
<result
property=
"startCompanyId"
column=
"start_company_id"
/>
<result
property=
"endCompanyId"
column=
"end_company_id"
/>
<result
property=
"modelId"
column=
"model_id"
/>
<result
property=
"vehicleId"
column=
"vehicle_id"
/>
<result
property=
"startTime"
column=
"start_time"
/>
<result
property=
"endTime"
column=
"end_time"
/>
<result
property=
"orderId"
column=
"order_id"
/>
<result
property=
"orderNo"
column=
"order_no"
/>
<result
property=
"startCompanyName"
column=
"start_company_name"
/>
<result
property=
"endCompanyName"
column=
"end_company_name"
/>
</resultMap>
</mapper>
\ No newline at end of file
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