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
30ba5f9d
Commit
30ba5f9d
authored
Jun 08, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
21bd1722
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
59 additions
and
45 deletions
+59
-45
TourBO.java
.../main/java/com/xxfc/platform/order/pojo/order/TourBO.java
+2
-1
OrderTourController.java
...ava/com/xxfc/platform/order/rest/OrderTourController.java
+2
-2
OrderTourService.java
...ava/com/xxfc/platform/order/service/OrderTourService.java
+12
-1
TourSpePriceDTO.java
...main/java/com/xxfc/platform/tour/dto/TourSpePriceDTO.java
+1
-3
TourFeign.java
...src/main/java/com/xxfc/platform/tour/feign/TourFeign.java
+9
-2
TourGoodSpeBiz.java
.../main/java/com/xxfc/platform/tour/biz/TourGoodSpeBiz.java
+2
-2
TourGoodSpeController.java
...va/com/xxfc/platform/tour/rest/TourGoodSpeController.java
+31
-34
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/TourBO.java
View file @
30ba5f9d
...
@@ -13,6 +13,7 @@ import java.util.List;
...
@@ -13,6 +13,7 @@ import java.util.List;
@Data
@Data
public
class
TourBO
extends
OrderTourDetail
implements
OrderDetail
{
public
class
TourBO
extends
OrderTourDetail
implements
OrderDetail
{
private
BaseOrder
order
;
private
BaseOrder
order
;
// private Tour
List
<
TourUser
>
tourUsers
;
List
<
TourUser
>
tourUsers
;
Integer
number
;
Integer
childNumber
;
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderTourController.java
View file @
30ba5f9d
...
@@ -47,9 +47,9 @@ public class OrderTourController extends BaseController<OrderTourDetailBiz,Order
...
@@ -47,9 +47,9 @@ public class OrderTourController extends BaseController<OrderTourDetailBiz,Order
@ResponseBody
@ResponseBody
@ApiOperation
(
value
=
"价格计算"
)
@ApiOperation
(
value
=
"价格计算"
)
@IgnoreUserToken
@IgnoreUserToken
public
ObjectRestResponse
<
TourPriceVO
>
calculatePrice
(
OrderRentVehicleController
.
CalculatePriceVO
vo
){
public
ObjectRestResponse
<
TourPriceVO
>
calculatePrice
(
CalculatePriceVO
vo
){
TourBO
bo
=
BeanUtil
.
toBean
(
vo
,
TourBO
.
class
);
TourBO
bo
=
BeanUtil
.
toBean
(
vo
,
TourBO
.
class
);
return
new
ObjectRestResponse
<>().
rel
(
true
).
data
(
orderTourService
.
calculatePrice
(
bo
));
return
ObjectRestResponse
.
succ
(
orderTourService
.
calculatePrice
(
bo
));
}
}
@Data
@Data
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderTourService.java
View file @
30ba5f9d
...
@@ -16,6 +16,8 @@ import com.xxfc.platform.order.entity.OrderCostDetail;
...
@@ -16,6 +16,8 @@ import com.xxfc.platform.order.entity.OrderCostDetail;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.order.RentVehicleBO
;
import
com.xxfc.platform.order.pojo.order.TourBO
;
import
com.xxfc.platform.order.pojo.order.TourBO
;
import
com.xxfc.platform.order.pojo.price.RentVehiclePriceVO
;
import
com.xxfc.platform.order.pojo.price.RentVehiclePriceVO
;
import
com.xxfc.platform.tour.dto.TourSpePriceDTO
;
import
com.xxfc.platform.tour.feign.TourFeign
;
import
com.xxfc.platform.vehicle.entity.VehicleModel
;
import
com.xxfc.platform.vehicle.entity.VehicleModel
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
lombok.extern.log4j.Log4j
;
import
lombok.extern.log4j.Log4j
;
...
@@ -29,6 +31,9 @@ import java.math.BigDecimal;
...
@@ -29,6 +31,9 @@ import java.math.BigDecimal;
@Log4j
@Log4j
public
class
OrderTourService
extends
AbstractOrderHandle
<
OrderRentVehicleBiz
,
TourBO
>
{
public
class
OrderTourService
extends
AbstractOrderHandle
<
OrderRentVehicleBiz
,
TourBO
>
{
@Autowired
TourFeign
tourFeign
;
private
static
BigDecimal
DRIVER_PRICE
=
new
BigDecimal
(
"600.00"
);
private
static
BigDecimal
DRIVER_PRICE
=
new
BigDecimal
(
"600.00"
);
private
static
BigDecimal
DAMAGE_SAFE
=
new
BigDecimal
(
"100.00"
);
//车损免赔
private
static
BigDecimal
DAMAGE_SAFE
=
new
BigDecimal
(
"100.00"
);
//车损免赔
// private static BigDecimal DEPOSIT = new BigDecimal("20000.00");
// private static BigDecimal DEPOSIT = new BigDecimal("20000.00");
...
@@ -80,6 +85,12 @@ public class OrderTourService extends AbstractOrderHandle<OrderRentVehicleBiz, T
...
@@ -80,6 +85,12 @@ public class OrderTourService extends AbstractOrderHandle<OrderRentVehicleBiz, T
BigDecimal
goodsAmount
=
BigDecimal
.
ZERO
;
BigDecimal
goodsAmount
=
BigDecimal
.
ZERO
;
BigDecimal
tourAmount
=
BigDecimal
.
ZERO
;
BigDecimal
tourAmount
=
BigDecimal
.
ZERO
;
//计算旅游价格
tourFeign
.
refund
(
new
TourSpePriceDTO
(){{
setChildNumber
(
detail
.
getChildNumber
());
setChildNumber
(
detail
.
getChildNumber
());
}});
//计算价格
//计算价格
//计算车辆费用
//计算车辆费用
// VehicleModel vehicleModel = vehicleFeign.get(detail.getModelId()).getData();
// VehicleModel vehicleModel = vehicleFeign.get(detail.getModelId()).getData();
...
@@ -108,7 +119,7 @@ public class OrderTourService extends AbstractOrderHandle<OrderRentVehicleBiz, T
...
@@ -108,7 +119,7 @@ public class OrderTourService extends AbstractOrderHandle<OrderRentVehicleBiz, T
rvp
.
setVehicleNum
(
1
);
rvp
.
setVehicleNum
(
1
);
rvp
.
setDriverNum
(
1
);
rvp
.
setDriverNum
(
1
);
detail
.
setCostDetail
(
costDetail
(
rvp
));
//
detail.setCostDetail(costDetail(rvp));
return
rvp
;
return
rvp
;
}
}
...
...
xx-tour/xx-tour-api/src/main/java/com/xxfc/platform/tour/dto/TourSpePriceD
to
.java
→
xx-tour/xx-tour-api/src/main/java/com/xxfc/platform/tour/dto/TourSpePriceD
TO
.java
View file @
30ba5f9d
...
@@ -4,13 +4,11 @@ package com.xxfc.platform.tour.dto;
...
@@ -4,13 +4,11 @@ package com.xxfc.platform.tour.dto;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
/**
* 计算价格
* 计算价格
*/
*/
@Data
@Data
public
class
TourSpePriceD
to
{
public
class
TourSpePriceD
TO
{
//用户id
//用户id
@ApiModelProperty
(
value
=
"用户id"
)
@ApiModelProperty
(
value
=
"用户id"
)
...
...
xx-tour/xx-tour-api/src/main/java/com/xxfc/platform/tour/feign/TourFeign.java
View file @
30ba5f9d
...
@@ -2,7 +2,7 @@ package com.xxfc.platform.tour.feign;
...
@@ -2,7 +2,7 @@ package com.xxfc.platform.tour.feign;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.tour.dto.TourSpePriceD
to
;
import
com.xxfc.platform.tour.dto.TourSpePriceD
TO
;
import
com.xxfc.platform.tour.vo.TourSpePriceVo
;
import
com.xxfc.platform.tour.vo.TourSpePriceVo
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -18,8 +18,15 @@ import org.springframework.web.bind.annotation.RequestMethod;
...
@@ -18,8 +18,15 @@ import org.springframework.web.bind.annotation.RequestMethod;
*/
*/
@FeignClient
(
value
=
"xx-tour"
)
@FeignClient
(
value
=
"xx-tour"
)
public
interface
TourFeign
{
public
interface
TourFeign
{
/**
* 计算价格
* @param spePriceDto
* @return
*/
@RequestMapping
(
value
=
"/spe/user/prices"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/spe/user/prices"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
<
TourSpePriceVo
>
prices
(
@RequestBody
TourSpePriceDto
spePriceDto
);
public
ObjectRestResponse
<
TourSpePriceVo
>
refund
(
@RequestBody
TourSpePriceDTO
spePriceDto
);
@RequestMapping
(
value
=
"/spe/stock"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/spe/stock"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
<
TourSpePriceVo
>
stock
(
Integer
speId
,
Integer
number
);
public
ObjectRestResponse
<
TourSpePriceVo
>
stock
(
Integer
speId
,
Integer
number
);
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/biz/TourGoodSpeBiz.java
View file @
30ba5f9d
...
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONArray;
...
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSONArray;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.tour.dto.TourSpePriceD
to
;
import
com.xxfc.platform.tour.dto.TourSpePriceD
TO
;
import
com.xxfc.platform.tour.entity.TourGoodSpePrice
;
import
com.xxfc.platform.tour.entity.TourGoodSpePrice
;
import
com.xxfc.platform.tour.mapper.TourGoodSpePriceMapper
;
import
com.xxfc.platform.tour.mapper.TourGoodSpePriceMapper
;
import
com.xxfc.platform.tour.vo.TourSpePriceVo
;
import
com.xxfc.platform.tour.vo.TourSpePriceVo
;
...
@@ -27,7 +27,7 @@ import java.math.RoundingMode;
...
@@ -27,7 +27,7 @@ import java.math.RoundingMode;
@Slf4j
@Slf4j
public
class
TourGoodSpeBiz
extends
BaseBiz
<
TourGoodSpePriceMapper
,
TourGoodSpePrice
>
{
public
class
TourGoodSpeBiz
extends
BaseBiz
<
TourGoodSpePriceMapper
,
TourGoodSpePrice
>
{
public
ObjectRestResponse
<
TourSpePriceVo
>
getPricesByuserid
(
TourSpePriceD
to
priceDto
)
{
public
ObjectRestResponse
<
TourSpePriceVo
>
getPricesByuserid
(
TourSpePriceD
TO
priceDto
)
{
if
(
priceDto
==
null
||
priceDto
.
getUserId
()
==
null
||
priceDto
.
getUserId
()
==
0
||
if
(
priceDto
==
null
||
priceDto
.
getUserId
()
==
null
||
priceDto
.
getUserId
()
==
0
||
priceDto
.
getNumber
()
==
null
||
priceDto
.
getNumber
()
==
0
||
priceDto
.
getSpeId
()==
null
)
{
priceDto
.
getNumber
()
==
null
||
priceDto
.
getNumber
()
==
0
||
priceDto
.
getSpeId
()==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数为空"
);
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/rest/TourGoodSpeController.java
View file @
30ba5f9d
package
com
.
xxfc
.
platform
.
tour
.
rest
;
package
com
.
xxfc
.
platform
.
tour
.
rest
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.xxfc.platform.tour.biz.TourGoodSpeBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.tour.common.TourBaseController
;
import
com.xxfc.platform.tour.biz.TourGoodSpeBiz
;
import
com.xxfc.platform.tour.dto.TourSpePriceDTO
;
import
com.xxfc.platform.tour.common.TourBaseController
;
import
com.xxfc.platform.tour.vo.TourSpePriceVo
;
import
com.xxfc.platform.tour.dto.TourSpePriceDto
;
import
org.springframework.web.bind.annotation.*
;
import
com.xxfc.platform.tour.vo.TourSpePriceVo
;
import
org.springframework.web.bind.annotation.*
;
@RestController
@RequestMapping
(
"spe"
)
@RestController
@IgnoreClientToken
@RequestMapping
(
"spe"
)
public
class
TourGoodSpeController
extends
TourBaseController
<
TourGoodSpeBiz
>
{
@IgnoreClientToken
public
class
TourGoodSpeController
extends
TourBaseController
<
TourGoodSpeBiz
>
{
//获取商品详情
@RequestMapping
(
value
=
"/user/prices"
,
method
=
RequestMethod
.
POST
)
//获取商品详情
public
ObjectRestResponse
<
TourSpePriceVo
>
prices
(
@RequestBody
TourSpePriceDTO
priceDto
)
{
@RequestMapping
(
value
=
"/user/prices"
,
method
=
RequestMethod
.
POST
)
return
baseBiz
.
getPricesByuserid
(
priceDto
);
public
ObjectRestResponse
<
TourSpePriceVo
>
prices
(
@RequestBody
TourSpePriceDto
priceDto
)
{
}
return
baseBiz
.
getPricesByuserid
(
priceDto
);
}
//减库存
@RequestMapping
(
value
=
"/stock"
,
method
=
RequestMethod
.
GET
)
//减库存
public
ObjectRestResponse
<
TourSpePriceVo
>
stock
(
@RequestMapping
(
value
=
"/stock"
,
method
=
RequestMethod
.
GET
)
@RequestParam
(
value
=
"speId"
,
defaultValue
=
"0"
)
Integer
speId
,
public
ObjectRestResponse
<
TourSpePriceVo
>
stock
(
@RequestParam
(
value
=
"number"
,
defaultValue
=
"0"
)
Integer
number
){
@RequestParam
(
value
=
"speId"
,
defaultValue
=
"0"
)
Integer
speId
,
return
baseBiz
.
cutStock
(
speId
,
number
);
@RequestParam
(
value
=
"number"
,
defaultValue
=
"0"
)
Integer
number
){
}
return
baseBiz
.
cutStock
(
speId
,
number
);
}
}
}
\ 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