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
0b0882ef
Commit
0b0882ef
authored
Nov 02, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加代码
parent
5c02cfd4
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
312 additions
and
13 deletions
+312
-13
SpecialRent.java
...main/java/com/xxfc/platform/order/entity/SpecialRent.java
+32
-3
RentVehicleBO.java
...ava/com/xxfc/platform/order/pojo/order/RentVehicleBO.java
+5
-0
SpecialRentBiz.java
...main/java/com/xxfc/platform/order/biz/SpecialRentBiz.java
+21
-0
SpecialRentController.java
...a/com/xxfc/platform/order/rest/SpecialRentController.java
+215
-4
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+22
-1
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+4
-0
AdminVehicleController.java
...c/platform/vehicle/rest/admin/AdminVehicleController.java
+9
-4
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+4
-1
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/SpecialRent.java
View file @
0b0882ef
package
com
.
xxfc
.
platform
.
order
.
entity
;
package
com
.
xxfc
.
platform
.
order
.
entity
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Date
;
import
javax.persistence.*
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
...
@@ -18,8 +19,24 @@ import lombok.Data;
...
@@ -18,8 +19,24 @@ import lombok.Data;
@Table
(
name
=
"special_rent"
)
@Table
(
name
=
"special_rent"
)
public
class
SpecialRent
implements
Serializable
{
public
class
SpecialRent
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
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_ORDER
=
4
;
public
static
final
int
STATUS_AUTOCNL_REQUIRE
=
501
;
public
static
final
int
STATUS_AUTOCNL_ORDER
=
502
;
public
static
final
int
STATUS_AUTOCNL_TOPAY
=
503
;
public
static
final
int
STATUS_AUTOCNL_PAYED
=
504
;
public
static
final
int
STATUS_ERR
=
6
;
public
static
final
int
STATUS_SUCC
=
7
;
public
static
final
int
ORDER_STATUS_TOPAY
=
1
;
public
static
final
int
ORDER_STATUS_PAY
=
2
;
public
static
final
int
ORDER_STATUS_CANCEL
=
3
;
/**
* 主键
* 主键
*/
*/
@Id
@Id
...
@@ -200,6 +217,18 @@ public class SpecialRent implements Serializable {
...
@@ -200,6 +217,18 @@ public class SpecialRent implements Serializable {
@Column
(
name
=
"goods_type"
)
@Column
(
name
=
"goods_type"
)
@ApiModelProperty
(
value
=
"商品类型 1--房车;2--机车;3--游艇"
)
@ApiModelProperty
(
value
=
"商品类型 1--房车;2--机车;3--游艇"
)
private
Integer
goodsType
;
private
Integer
goodsType
;
/**
* 单价,每日价格
*/
@Column
(
name
=
"unit_price"
)
@ApiModelProperty
(
value
=
"单价,每日价格"
)
private
BigDecimal
unitPrice
;
/**
* 商品信息,json
*/
@Column
(
name
=
"goods_json"
)
@ApiModelProperty
(
value
=
"商品信息json"
)
private
String
goodsJson
;
}
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/RentVehicleBO.java
View file @
0b0882ef
...
@@ -29,6 +29,11 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
...
@@ -29,6 +29,11 @@ public class RentVehicleBO extends OrderRentVehicleDetail implements OrderDetail
*/
*/
private
Integer
applyOrderSign
=
0
;
private
Integer
applyOrderSign
=
0
;
/**
* 是否特惠租车下订单
*/
private
Integer
specialOrderSign
=
0
;
/**
/**
* 是否使用出租免费天数
* 是否使用出租免费天数
*/
*/
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/SpecialRentBiz.java
View file @
0b0882ef
package
com
.
xxfc
.
platform
.
order
.
biz
;
package
com
.
xxfc
.
platform
.
order
.
biz
;
import
cn.hutool.core.collection.CollUtil
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.xxfc.platform.order.entity.SpecialRent
;
import
com.xxfc.platform.order.entity.SpecialRent
;
import
com.xxfc.platform.order.mapper.SpecialRentMapper
;
import
com.xxfc.platform.order.mapper.SpecialRentMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
java.util.List
;
/**
/**
* 特惠租车
* 特惠租车
*
*
...
@@ -15,4 +18,22 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
...
@@ -15,4 +18,22 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
*/
*/
@Service
@Service
public
class
SpecialRentBiz
extends
BaseBiz
<
SpecialRentMapper
,
SpecialRent
>
{
public
class
SpecialRentBiz
extends
BaseBiz
<
SpecialRentMapper
,
SpecialRent
>
{
/**
* 判断车辆是否有进行中的特惠租车
* @param vehicleId
* @return
*/
public
Boolean
checkHasSpecialRent
(
String
vehicleId
)
{
List
<
SpecialRent
>
list
=
selectByWeekend
(
w
->
{
w
.
andIn
(
SpecialRent:
:
getStatus
,
CollUtil
.
newArrayList
(
SpecialRent
.
STATUS_CRT
,
SpecialRent
.
STATUS_ORDER
))
.
andEqualTo
(
SpecialRent:
:
getVehicleId
,
vehicleId
);
return
w
;
});
if
(
list
.
size
()
>
0
)
{
return
Boolean
.
TRUE
;
}
return
Boolean
.
FALSE
;
}
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/SpecialRentController.java
View file @
0b0882ef
package
com
.
xxfc
.
platform
.
order
.
rest
;
package
com
.
xxfc
.
platform
.
order
.
rest
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
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.rest.BaseController
;
import
com.github.wxiaoqi.security.common.util.AssertUtils
;
import
com.github.wxiaoqi.security.common.util.OrderUtil
;
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.SpecialRentBiz
;
import
com.xxfc.platform.order.biz.SpecialRentBiz
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.entity.SpecialRent
;
import
com.xxfc.platform.order.entity.SpecialRent
;
import
org.springframework.stereotype.Controller
;
import
com.xxfc.platform.order.mqhandler.RabbitProduct
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.xxfc.platform.order.pojo.order.add.AddRentVehicleDTO
;
import
com.xxfc.platform.order.service.OrderRentVehicleService
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.BookVehicleVO
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
org.mockito.internal.util.collections.Sets
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
SpecialRent
.
STATUS_CRT
;
@RestController
@RestController
@RequestMapping
(
"specialRent"
)
@RequestMapping
(
"specialRent"
)
public
class
SpecialRentController
extends
BaseController
<
SpecialRentBiz
,
SpecialRent
>
{
public
class
SpecialRentController
extends
BaseController
<
SpecialRentBiz
,
SpecialRent
>
implements
UserRestInterface
{
@Autowired
RabbitProduct
rabbitProduct
;
@Autowired
OrderRentVehicleBiz
orderRentVehicleBiz
;
@Autowired
OrderRentVehicleService
orderRentVehicleService
;
@Autowired
VehicleFeign
vehicleFeign
;
@Autowired
UserFeign
userFeign
;
@Override
public
UserFeign
getUserFeign
()
{
return
userFeign
;
}
@RequestMapping
(
value
=
"/appBusiness/addRent"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ApiOperation
(
value
=
"添加特惠租车"
)
public
ObjectRestResponse
appBusinessAddRent
(
@RequestBody
SpecialRent
specialRent
)
{
UserDTO
userDTO
=
getBusinessUserByAppUser
();
AssertUtils
.
isBlank
(
userDTO
);
if
(
StrUtil
.
isNotBlank
(
specialRent
.
getVehicleId
()))
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
Vehicle
vehicle
=
vehicleFeign
.
get
(
specialRent
.
getVehicleId
()).
getData
();
if
(
null
==
vehicle
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
specialRent
.
setGoodsJson
(
JSONUtil
.
parse
(
vehicle
).
toString
());
DateTime
startDateTime
=
DateUtil
.
date
(
specialRent
.
getStartTime
());
// DateTime endDateTime = DateUtil.date(specialRent.getEndTime());
// DateTime tomorrowBegin = DateUtil.beginOfDay(DateUtil.tomorrow());
DateTime
afterDateTime
=
DateUtil
.
offsetHour
(
DateUtil
.
date
(),
1
);
if
(!
startDateTime
.
isAfterOrEquals
(
afterDateTime
))
{
throw
new
BaseException
(
ResultCode
.
FAILED_CODE
,
Sets
.
newSet
(
"请提前一小时特惠租车发布"
));
}
if
(
null
!=
specialRent
.
getStartCompanyId
())
{
specialRent
.
setStartCityCode
(
vehicleFeign
.
getCompanyDetail
(
specialRent
.
getStartCompanyId
()).
getData
().
getAddrCity
());
}
if
(
null
!=
specialRent
.
getEndCompanyId
())
{
specialRent
.
setEndCityCode
(
vehicleFeign
.
getCompanyDetail
(
specialRent
.
getEndCompanyId
()).
getData
().
getAddrCity
());
}
specialRent
.
setPublishUserId
(
userDTO
.
getId
());
specialRent
.
setStatus
(
STATUS_CRT
);
RentVehicleBO
detail
=
new
RentVehicleBO
();
detail
.
setStartTime
(
specialRent
.
getStartTime
());
detail
.
setEndTime
(
specialRent
.
getEndTime
());
detail
.
setVehicleId
(
specialRent
.
getVehicleId
());
detail
.
setStartAddr
(
specialRent
.
getStartCompanyName
());
detail
.
setStartCompanyId
(
specialRent
.
getStartCompanyId
());
detail
.
setEndCompanyId
(
specialRent
.
getEndCompanyId
());
detail
.
setOrder
(
new
BaseOrder
(){{
setNo
(
OrderUtil
.
GetOrderNumber
(
""
,
OrderUtil
.
APP_MID
));}});
detail
.
setRentFreeDay
(
SYS_FALSE
);
detail
.
setBookVehicleVO
(
new
BookVehicleVO
(){{
setBookStartDate
(
DateUtil
.
date
(
specialRent
.
getStartTime
()).
toDateStr
());
setBookEndDate
(
DateUtil
.
date
(
specialRent
.
getEndTime
()).
toDateStr
());
setBookStartDateTime
(
DateUtil
.
date
(
specialRent
.
getStartTime
()).
toString
());
setBookEndDateTime
(
DateUtil
.
date
(
specialRent
.
getEndTime
()).
toString
());
}});
//预约车辆
orderRentVehicleService
.
acquireVehicle
(
detail
,
null
,
null
);
specialRent
.
setOrderNo
(
detail
.
getOrder
().
getNo
());
// specialRent.setOverTime(DateUtil.offsetHour(DateUtil.date(), 1).getTime());
specialRent
.
setBookRecordId
(
detail
.
getBookRecordId
());
//设置车辆下架
ObjectRestResponse
restResponse
=
vehicleFeign
.
updVehicleFeign
(
new
Vehicle
(){{
setId
(
vehicle
.
getId
());
setStatus
(
STATE_DOWN
);
}});
// rabbitProduct.sendApplyDelayMessage(baseBiz.selectById(specialRent.getId()), 1000L * 3601L);
// Long delayTime = DateUtil.date().getTime() - DateUtil.offsetDay(endDateTime, -1).getTime();
// specialRent.setOverTime(delayTime);
baseBiz
.
insertSelective
(
specialRent
);
// rabbitProduct.sendApplyRequireDelayMessage(baseBiz.selectById(shuntApply.getId()), delayTime);
return
ObjectRestResponse
.
succ
();
}
@RequestMapping
(
value
=
"/pageList"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ApiOperation
(
value
=
"分页查询可参加特惠租车"
)
public
ObjectRestResponse
<
SpecialRentVO
>
pageList
(
QueryDTO
dto
)
{
//查询列表数据
if
(
StrUtil
.
isBlank
(
getCurrentUserId
()))
{
throw
new
BaseException
(
ResultCode
.
AJAX_WECHAT_NOTEXIST_CODE
);
}
dto
.
setUserId
(
getCurrentUserIdInt
());
Query
query
=
new
Query
(
dto
);
PageDataVO
<
SpecialRentVO
>
pages
=
PageDataVO
.
pageInfo
(
query
,
()
->
baseBiz
.
selectByWeekend
(
w
->
{
w
.
andEqualTo
(
SpecialRent:
:
getStatus
,
STATUS_CRT
);
return
w
;
},
" crt_time desc "
),
SpecialRentVO
.
class
);
return
ObjectRestResponse
.
succ
(
pages
);
}
@RequestMapping
(
value
=
"/specialOrder"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ApiOperation
(
value
=
"特惠租车下单"
)
public
ObjectRestResponse
specialOrder
(
@RequestBody
SpecialOrderDTO
dto
)
{
//查询列表数据
if
(
StrUtil
.
isBlank
(
getCurrentUserId
()))
{
throw
new
BaseException
(
ResultCode
.
AJAX_WECHAT_NOTEXIST_CODE
);
}
if
(
null
==
dto
.
getSpecialId
())
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
SpecialRent
specialRent
=
baseBiz
.
selectById
(
dto
.
getSpecialId
());
if
(
null
==
specialRent
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
if
(
!(
DateUtil
.
date
(
dto
.
getStartTime
()).
isAfterOrEquals
(
DateUtil
.
date
(
specialRent
.
getStartTime
()))
&&
DateUtil
.
date
(
dto
.
getEndTime
()).
isBeforeOrEquals
(
DateUtil
.
date
(
specialRent
.
getEndTime
())))
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
if
(
SpecialRent
.
STATUS_ORDER
==
specialRent
.
getStatus
())
{
throw
new
BaseException
(
"该特惠租车已下单"
,
ResultCode
.
PARAM_ILLEGAL_CODE
);
}
//拒绝原来的预约
orderRentVehicleService
.
errorRejectVehicle
(
new
RentVehicleBO
(){{
setBookRecordId
(
specialRent
.
getBookRecordId
());
}});
//正式下单
dto
.
setVehicleId
(
specialRent
.
getVehicleId
());
dto
.
setStartTime
(
specialRent
.
getStartTime
());
dto
.
setEndTime
(
specialRent
.
getEndTime
());
dto
.
setStartCompanyId
(
specialRent
.
getStartCompanyId
());
dto
.
setEndCompanyId
(
specialRent
.
getEndCompanyId
());
RentVehicleBO
bo
=
orderRentVehicleBiz
.
initRentVehicleBO
(
dto
);
// bo.setSpecialOrderSign(SYS_TRUE);
bo
.
setAppUserDTO
(
getAppUser
());
// orderRentVehicleService.applyCreateOrder(bo, specialRent.getOrderNo());
orderRentVehicleService
.
createOrder
(
bo
);
baseBiz
.
updateSelectiveById
(
new
SpecialRent
(){{
setId
(
specialRent
.
getId
());
setStatus
(
SpecialRent
.
STATUS_ORDER
);
setOrderStatus
(
SpecialRent
.
ORDER_STATUS_TOPAY
);
}});
return
ObjectRestResponse
.
succ
(
bo
.
getOrder
());
}
@Data
public
static
class
SpecialRentVO
extends
SpecialRent
{
Vehicle
vehicle
;
}
@Data
public
static
class
QueryDTO
extends
PageParam
{
Integer
userId
;
}
@Data
public
static
class
SpecialOrderDTO
extends
AddRentVehicleDTO
{
Integer
specialId
;
}
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
0b0882ef
...
@@ -98,7 +98,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -98,7 +98,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
}
}
/**
/**
* 创建订单及其子项
* 创建订单及其子项
(需求预定申请)
* @param detail
* @param detail
*/
*/
public
void
applyCreateOrder
(
RentVehicleBO
detail
,
String
orderNo
)
{
public
void
applyCreateOrder
(
RentVehicleBO
detail
,
String
orderNo
)
{
...
@@ -112,12 +112,33 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -112,12 +112,33 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
handleDetail
(
detail
);
handleDetail
(
detail
);
}
}
// /**
// * 创建订单及其子项(特惠租车)
// * @param detail
// */
// public void specialCreateOrder(RentVehicleBO detail, String orderNo) {
// //初始化
// applyInitDetail(detail, orderNo);
// //计算价格
// handleCalculate(detail);
// //插入baseOrder
// baseOrderBiz.insertSelective(detail.getOrder());
// //处理detail
// handleDetail(detail);
// }
public
void
applyInitDetail
(
RentVehicleBO
bo
,
String
orderNo
)
{
public
void
applyInitDetail
(
RentVehicleBO
bo
,
String
orderNo
)
{
BaseOrder
order
=
createBaseOrder
(
bo
.
getOrderOrigin
(),
bo
.
getFacilitatePhone
(),
bo
.
getAppUserDTO
(),
orderNo
);
BaseOrder
order
=
createBaseOrder
(
bo
.
getOrderOrigin
(),
bo
.
getFacilitatePhone
(),
bo
.
getAppUserDTO
(),
orderNo
);
bo
.
setOrder
(
order
);
bo
.
setOrder
(
order
);
initDetailSecond
(
bo
);
initDetailSecond
(
bo
);
}
}
// public void specialInitDetail(RentVehicleBO bo, String orderNo) {
// BaseOrder order = createBaseOrder(bo.getOrderOrigin(), bo.getFacilitatePhone(), bo.getAppUserDTO(), orderNo);
// bo.setOrder(order);
// initDetailSecond(bo);
// }
@Override
@Override
public
void
initDetail
(
RentVehicleBO
bo
)
{
public
void
initDetail
(
RentVehicleBO
bo
)
{
super
.
initDetail
(
bo
);
super
.
initDetail
(
bo
);
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
0b0882ef
...
@@ -41,6 +41,10 @@ public interface VehicleFeign {
...
@@ -41,6 +41,10 @@ public interface VehicleFeign {
@RequestMapping
(
value
=
"/vehicleInfo/getByIds"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/vehicleInfo/getByIds"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
<
List
<
Vehicle
>>
getByIds
(
@RequestParam
(
value
=
"ids"
)
List
<
String
>
id
);
public
RestResponse
<
List
<
Vehicle
>>
getByIds
(
@RequestParam
(
value
=
"ids"
)
List
<
String
>
id
);
//提车
@PostMapping
(
"/backstage/vehicle/unauth/app/updVehicleFeign"
)
public
ObjectRestResponse
updVehicleFeign
(
@RequestBody
Vehicle
vehicle
);
//提车
//提车
@PostMapping
(
"/active/small/departure"
)
@PostMapping
(
"/active/small/departure"
)
public
RestResponse
departureBySmall
(
@RequestBody
VehicleDepartureVo
departureVo
);
public
RestResponse
departureBySmall
(
@RequestBody
VehicleDepartureVo
departureVo
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/AdminVehicleController.java
View file @
0b0882ef
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.vehicle.rest.admin;
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.vehicle.rest.admin;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleExtensionBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleExtensionBiz
;
...
@@ -32,10 +33,6 @@ import java.util.stream.Collectors;
...
@@ -32,10 +33,6 @@ import java.util.stream.Collectors;
@Api
(
tags
=
{
"商品申请"
})
@Api
(
tags
=
{
"商品申请"
})
public
class
AdminVehicleController
extends
BaseController
<
VehicleBiz
>{
public
class
AdminVehicleController
extends
BaseController
<
VehicleBiz
>{
@Autowired
@Autowired
UserFeign
userFeign
;
UserFeign
userFeign
;
...
@@ -73,6 +70,14 @@ public class AdminVehicleController extends BaseController<VehicleBiz>{
...
@@ -73,6 +70,14 @@ public class AdminVehicleController extends BaseController<VehicleBiz>{
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
@PostMapping
(
"/unauth/app/updVehicleFeign"
)
@IgnoreUserToken
@ApiModelProperty
(
"更新商品信息Feign"
)
public
ObjectRestResponse
updVehicleFeign
(
@RequestBody
Vehicle
vehicle
)
{
baseBiz
.
updateSelectiveById
(
vehicle
);
return
ObjectRestResponse
.
succ
();
}
@PostMapping
(
"delVehicle"
)
@PostMapping
(
"delVehicle"
)
@ApiModelProperty
(
"更新商品信息"
)
@ApiModelProperty
(
"更新商品信息"
)
public
ObjectRestResponse
delVehicle
(
@RequestBody
Vehicle
vehicle
)
{
public
ObjectRestResponse
delVehicle
(
@RequestBody
Vehicle
vehicle
)
{
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
0b0882ef
...
@@ -1417,7 +1417,9 @@
...
@@ -1417,7 +1417,9 @@
v.*,
v.*,
b.cn_name as brandName,
b.cn_name as brandName,
c.`name` categoryName,
c.`name` categoryName,
bc.`name` as companyName
bc.`name` as companyName,
bc1.`leader` as manageCompanyLeader,
bc1.`leader_contact_info` as manageCompanyLeaderContact
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
,st_distance_sphere(point(#{lon}, #{lat}), point(bc.longitude, bc.latitude)) as distance
</if>
</if>
...
@@ -1425,6 +1427,7 @@
...
@@ -1425,6 +1427,7 @@
LEFT JOIN vehicle_brand b ON v.brand_id=b.id
LEFT JOIN vehicle_brand b ON v.brand_id=b.id
LEFT JOIN vehicle_category c ON v.category_id=c.id
LEFT JOIN vehicle_category c ON v.category_id=c.id
LEFT JOIN branch_company bc ON v.subordinate_branch=bc.id
LEFT JOIN branch_company bc ON v.subordinate_branch=bc.id
LEFT JOIN branch_company bc1 ON v.manage_company_id=bc1.id
<where>
<where>
v.is_del = 0
v.is_del = 0
<if
test=
"addrCity !=null"
>
<if
test=
"addrCity !=null"
>
...
...
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