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
59b492cb
Commit
59b492cb
authored
Oct 30, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-chw' of
http://113.105.137.151:22280/youjj/cloud-platform
into dev-chw
parents
9292ed4b
94b0f9e8
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
381 additions
and
168 deletions
+381
-168
systemconfig.properties
...mon/src/main/resources/properties/systemconfig.properties
+5
-5
BaseOrder.java
...c/main/java/com/xxfc/platform/order/entity/BaseOrder.java
+1
-1
OrderRentVehicleDetail.java
...om/xxfc/platform/order/entity/OrderRentVehicleDetail.java
+17
-1
ShuntApply.java
.../main/java/com/xxfc/platform/order/entity/ShuntApply.java
+4
-0
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+1
-2
OrderItemBiz.java
...c/main/java/com/xxfc/platform/order/biz/OrderItemBiz.java
+1
-1
OrderVehicleCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
+7
-3
OrderCalculateBiz.java
.../com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
+74
-68
RabbitProduct.java
...java/com/xxfc/platform/order/mqhandler/RabbitProduct.java
+16
-1
OrderVehicleCrosstownController.java
.../platform/order/rest/OrderVehicleCrosstownController.java
+1
-7
ShuntApplyController.java
...va/com/xxfc/platform/order/rest/ShuntApplyController.java
+15
-15
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+14
-2
CalculateInterface.java
...com/xxfc/platform/universal/inter/CalculateInterface.java
+85
-0
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+1
-1
RentVehicleBookDTO.java
...va/com/xxfc/platform/vehicle/pojo/RentVehicleBookDTO.java
+3
-2
VehicleModelCalendarPriceBiz.java
...fc/platform/vehicle/biz/VehicleModelCalendarPriceBiz.java
+74
-35
VehiclePlatCataBiz.java
...ava/com/xxfc/platform/vehicle/biz/VehiclePlatCataBiz.java
+13
-7
RentVehicleController.java
...com/xxfc/platform/vehicle/rest/RentVehicleController.java
+45
-14
VehicleCataController.java
...com/xxfc/platform/vehicle/rest/VehicleCataController.java
+1
-1
BgVehicleCataController.java
.../platform/vehicle/rest/admin/BgVehicleCataController.java
+3
-2
No files found.
ace-common/src/main/resources/properties/systemconfig.properties
View file @
59b492cb
...
@@ -50,12 +50,12 @@ weixinHost=xxtest.upyuns.com
...
@@ -50,12 +50,12 @@ weixinHost=xxtest.upyuns.com
APICLIENT_CERT
=
D:
\\
cert
\\
1514583081_20181017_cert.p12
APICLIENT_CERT
=
D:
\\
cert
\\
1514583081_20181017_cert.p12
#\u652F\u4ED8\u5B9D\u914D\u7F6E
#\u652F\u4ED8\u5B9D\u914D\u7F6E
ALIPAY_APPID
=
20
19070965781964
ALIPAY_APPID
=
20
21002105612008
ALIPAY_PID
=
2088
531634846583
ALIPAY_PID
=
2088
231782582000
#\u652F\u4ED8\u5B9D\u516C\u94A5
#\u652F\u4ED8\u5B9D\u516C\u94A5
ALIPAY_PUBLIC_KEY
=
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
j/EMaAD2iJP3I5M0g6pssDDe3RxF5I3ECM/Kz/btM0RiW2g5oRrHSjtGuos9l1QhQAY0SrVqa2eZdPKUB3ZqJdimQiXr3dbiMvG9UCs8vVUcrtCHCBjDllKQLiYzboxE6JLXyfII5tIXbFKiGyiEyXQnffUhQ9uGyT2EGWGecz6PLIjDdbwpxuzF2gIUzV3bPxb+0axejBxJ/3zKnWrsbyq2nvs8XrzrR2CEggNqgqsKzaacCL1yZjXzQRseSnCMtgSxR5W5afbdY0zqbUlLHUrUZ8ycCRC0ECuI9HyTbuqtdWHEZH7vIH44wEQWZPDRhMfMZvzmPUgpTWZLv5Bta
QIDAQAB
ALIPAY_PUBLIC_KEY
=
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA
sNKvomBS4ZfJXY/cO03z7ocy86/L3dR7YMftKOiVlQXZQc3gBLVCYtcI6T3+haom+xx1UMEz1p3FtFZiZuq+wxbok9XsYPpjoMH+R4QHe8wjyIbR5m73veJWtSe+WGTWrIkOnbuOc+n+ZD8Fv4A5XDRvnTLV1dm+Ax2d7pkAUyNc3lvAs8pkYMszQ3pqxacL66x1EjG7AM0lNW2QuRPPoJKUwrCCgdBQA3Gpyp1led4WYpy4RGnJAtSyzKU1elPXeGqGtwAfS+DnetOKOMVndWfSqZuEwzEP0ZdT8FgEcLqn+1xgMVIPMJ2GuLEekOuPQeq2wAsuYC5DpQ8CJqRXK
QIDAQAB
ALIPAY_ACOUNT
=
xxfc810@163
.com
ALIPAY_ACOUNT
=
hjingyou@upyuns
.com
ALIPAY_PRIVATE_KEY
=
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC
0wXVGAameVSLlLrq7edrMuoabN16/bYJNosLmPlHltEhehKO1ak/oIFvlKGyKwsW+xXd8t27p5hpsHqzNisU/jLbwEi6t0U/RBMbx3ult9zNhsZqSdJxe4QINChudVM6FdE8ssaq19ABwiLisMxxck0IiXDmesGI6vUSNzLEvKyYWTUsVsW1HgYXVjXmi8mOiwuFsJtdALS/psWci3UlX80rYG9KGqSBWT0B0Nr8UcM1L7UEkOHUEf1uq4Ipl5rTzgqoRQN5uHbBu50b7welAL2MFA9D/Ecv+FOfMIiLBtm1/6zNtjo/mvwORtS64mJXCaAbY1Pxa1bqs274fAwWtAgMBAAECggEAOObZ2zL0yZI1jP477H68wUxKyZwRqKN5rKT7Q+4EbBJn4dFRk++mvgVJyIcEPF56T8bsCYfZU6qLUNQLRB1WYN4UTNj8dt14ie0+D7BDvclfFHcLmOU6wKeGtMIk1U94QAzQS9qWSfdJGCQCNrtUR1RYMmbkAK+4DJO+fAEfGiCr1oMQpsz0h6Jhwp/DDBXZEjPdrECOjx2w5ZVULyPxFui2NQ8IS3rTT5SQvOBAgn9dbgZ/FVVbs2x6SpnWyOCUREK0uaLXJgf0JoX1WW4bswZlYmd7qURPscwFVKdYRautimcmO0FOUue62aPSYfvJwx8tTZanQbbwfrr0XrisBQKBgQDyKPYDYZzgGL/G5H8CQZajKnqg7a5AAZXJQLKkF7kiEgOlB3b6OqK6CeKVGawfuNIshECmmKcZmqrsPV42xrZl458kiDyqJNHq2lgFs9kj9BFUDi11EZfDGah4piJo5tgc09Hj6eAmeKdmG7aTS0/954xOK7eBFdG1T6R1Rd9Y4wKBgQC/Fhd5Nw6XYAg4qBmzOnvc9YwEL+wdy0aontFAFzaQlgkYm+efhYyjMcjyj4aloJZzpTd6eKbZI57IzihJI+F8+b1qToQDu8A2BTPkiOyXRcNY3y0LTNx7/gae6a9oGFc+8ILGa41va7WKjuPd08aXpSSBI34u10wWRMP+70m8LwKBgQCLerRYtjyZhyfO84WEUyrkyG7hioU3MLKJvM4oXdGwohefUnFhJ6za4x6zKppNmzLTmUlzq7FzufaBI8fEXShp/3WGoUHv7k1KrIDOqAyF/OqOM6xTJdL3+StkcqyXJ3+K+yaF1AvbnNsuoP/ETzi/0kKqM9v6agrkF/9t3NUMaQKBgCpafS1y1Jscv/W+3KNrLRUWn8g1zwHzkl/Bg+POwVtexflcZQRol3l8iWuqAFApve84CYntwB2U1ZbwiuFbQJlwyVkMuhoRvVK76HqZFseYwOmr3dIJYT1iWplSdnx+GKhsqq/MGvc9SmnBriP20qe+BM9SzJ8ZPVYaO87/vrolAoGARD8/IeEzMCPfYr9zBkE5rBtiT7t6nZXmMc6GH2Vao9meDofN8vj/XEfTGovusUYTWyA2Enac0YKdK6f6f+NYBqGYqn5Ludgxeotzo9UoXd3Hnv1gMCRs4ehloVODkHj2qhkvqL2iuZLsNp/wMq/ZHpRUzT4bO5H2FQhH4SUElKI
=
ALIPAY_PRIVATE_KEY
=
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC
MAEco0Ev98cCPxPtsSIEVrPa9828K112l4hG2Nk+G2CnFgku9EuIQUTP2wf6YJKAR1F5mfXnEcX2LURjhuvaudhIq8Eh4veiaKvGhVOdOc2w5GIhYptaV4VKopJNgOVmn7EMl0TGIkAP31sBJpXph7maS/lk+q86uE+tW5CfnQG3s2Znt8sNA/3vaArSbndENgDsWxNAwDERBxxaQ0A4MLTF4dNJ5ignfJ+dPCf9hl/dH2rNofrorLBNrCxuuzZUa2hx5Iq+Btbrfimx/RpT7L4Dqo8Fymo7uh5tZTpKYlpNfjuVoPR0buGGmW18wzCbFKYtieW5JimgUOvHdgCDbAgMBAAECggEAVhotqYpB0lKGbWVmg/gre5s+vSAkYPSHYeghoIDSdEoplpFF52jfo81tOguhewy7bXvA+yOcahaqca5UsS99W1q+Xa4dxDR4A6j5ppFDGNqf6pWN9YfWXaOQZKujAAEFhOMngPChmC2KYziuVhzxoZ0vdKP9Wy/rEuCpUm1LpUrstOxwhxDcwFviPXeinWYq8OU4K7xCcNU5P6tBTwhagA44rdZfJr9uP4/gXC4lDzY/vHD14H0qgAKm/mWW+2E3MqUnbOMAzig8cVK3rIWA0lwcRtqELpDczMGE1dXKhhU1u7iDFhnse/vGVwPErJmUs41gKGQjG2d7ZjFj8XAhcQKBgQDfpYPldV4JwgVJKt9HJXXRYaf+ppVAvObglcKiV61PD3HYOxrGYiMW+g9r1E0aZjl4cp05CEsVFufrOH8xnLD8Z6axvDam0HI15Am6nOWhulXBb7FSNyWKMl0rE+Fzzv6+GRKby2thfq1YCNhlr7rqm03tyMgUGM8eDaH/P4/D3wKBgQCgQQ1kKrquidWPKjEBoidjBqf4pl+QLfs3J9QgUbfEDZV6EDmCTzo0ANZ6nYPWlLwVdWsXg2HGdGgWQSAsRY6QAxyw7vsqO7SIXTsaOujwJ5qpZYmnsH6JdOAhMAFcJJXKA8TKRoxIZkESxN1BbNsC11b//3dHNxrL7UnVa6xihQKBgQCKJxCHGi1xEa16OUWcCYPyR8UjBXyFdSuZ6GlHJ6ojgILu8/PiQJU0iFwmXAsVF7jAsux0Yq8e4/t3znqkBws9oDnU6VNJUNJ8f9WStYEUmqqGx5xeETrbV6k+BxXqGCA9Bff8zXgTzdD+5NfoWNm6Ox20mace4wRuqDU+G+GPOQKBgHDigiFeLBSIyWPIz66b3+zUonv4DncMvNp0duuxRKaY/wN17FzLnG9Ha84BqP391aO0C5ULmlNmam/KvnQRJ0RwvMQyA8ETP6+TJO/sMWwCKeNLwDTckbYYG02leD/FEbK1BumJ2oWhahNjk4vjtz8AG6vG8+m5emnOI+VvrIXVAoGAZk4TT1aKYr+I949Txot19x4cum9BLJnVIst7BqY3xFRcR35TS/x3mvZ0Ui75QwgeeU9I6Ns65y0g/MRz8VjJ5XQeI5PAK575sy2UTMClt3ep1X6vgLdl12g9qkiljN7mWUv4su+X+k+8zYDUcWm17KsGVNg+WrUAdRoWbkZUGW8
=
#
#
#ALIPAY_APPID=2016100100641990
#ALIPAY_APPID=2016100100641990
#ALIPAY_PID=2088102178153042
#ALIPAY_PID=2088102178153042
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/BaseOrder.java
View file @
59b492cb
...
@@ -69,7 +69,7 @@ public class BaseOrder implements Serializable {
...
@@ -69,7 +69,7 @@ public class BaseOrder implements Serializable {
+
"3--待付款"
+
"3--待付款"
+
"4--待出行"
+
"4--待出行"
+
"5--出行中(进行中)"
+
"5--出行中(进行中)"
+
"6--已完成"
)
+
"6--已完成"
)
private
Integer
status
;
private
Integer
status
;
/**
/**
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderRentVehicleDetail.java
View file @
59b492cb
...
@@ -396,8 +396,16 @@ public class OrderRentVehicleDetail implements Serializable {
...
@@ -396,8 +396,16 @@ public class OrderRentVehicleDetail implements Serializable {
@ApiModelProperty
(
value
=
"车辆隶属企业id"
)
@ApiModelProperty
(
value
=
"车辆隶属企业id"
)
private
Long
vehicleBranchId
;
private
Long
vehicleBranchId
;
public
void
setVehicleBranchId
(
Long
vehicleBranchId
)
{
this
.
vehicleBranchId
=
vehicleBranchId
;
}
public
void
setVehicleCompanyId
(
Integer
vehicleCompanyId
)
{
this
.
vehicleCompanyId
=
vehicleCompanyId
;
}
@Column
(
name
=
"vehicle_company_id"
)
@Column
(
name
=
"vehicle_company_id"
)
@ApiModelProperty
(
value
=
"车辆公司(门店)id"
)
@ApiModelProperty
(
value
=
"车辆
隶属
公司(门店)id"
)
private
Integer
vehicleCompanyId
;
private
Integer
vehicleCompanyId
;
@Column
(
name
=
"vehicle_deposit"
)
@Column
(
name
=
"vehicle_deposit"
)
...
@@ -408,6 +416,14 @@ public class OrderRentVehicleDetail implements Serializable {
...
@@ -408,6 +416,14 @@ public class OrderRentVehicleDetail implements Serializable {
@ApiModelProperty
(
value
=
"交通违章押金"
)
@ApiModelProperty
(
value
=
"交通违章押金"
)
private
BigDecimal
trafficDeposit
;
private
BigDecimal
trafficDeposit
;
@Column
(
name
=
"vehicle_manage_branch_id"
)
@ApiModelProperty
(
value
=
"车辆隶属企业id"
)
private
Long
vehicleManageBranchId
;
@Column
(
name
=
"vehicle_manage_company_id"
)
@ApiModelProperty
(
value
=
"车辆隶属公司(门店)id"
)
private
Integer
vehicleManageCompanyId
;
/**
/**
* 商品押金方式 1--线上;2--线下
* 商品押金方式 1--线上;2--线下
*/
*/
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/ShuntApply.java
View file @
59b492cb
...
@@ -228,5 +228,9 @@ public class ShuntApply implements Serializable {
...
@@ -228,5 +228,9 @@ public class ShuntApply implements Serializable {
@ApiModelProperty
(
"型号名称"
)
@ApiModelProperty
(
"型号名称"
)
private
String
categoryName
;
private
String
categoryName
;
@Column
(
name
=
"is_del"
)
private
Integer
isDel
;
@Column
(
name
=
"is_bizdel"
)
private
Integer
isBizdel
;
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
59b492cb
...
@@ -6,9 +6,7 @@ import cn.hutool.core.collection.CollectionUtil;
...
@@ -6,9 +6,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.csp.sentinel.util.StringUtil
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
...
@@ -1087,4 +1085,5 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
...
@@ -1087,4 +1085,5 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
}
}
return
pageDataVO
;
return
pageDataVO
;
}
}
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderItemBiz.java
View file @
59b492cb
...
@@ -58,7 +58,7 @@ public class OrderItemBiz extends BaseBiz<OrderItemMapper,OrderItem> {
...
@@ -58,7 +58,7 @@ public class OrderItemBiz extends BaseBiz<OrderItemMapper,OrderItem> {
Date
overStart
=
DateUtil
.
offsetDay
(
endDate
,
1
);
Date
overStart
=
DateUtil
.
offsetDay
(
endDate
,
1
);
Date
overEnd
=
DateUtil
.
offsetDay
(
overStart
,
overDays
);
Date
overEnd
=
DateUtil
.
offsetDay
(
overStart
,
overDays
);
// List<VehicleModelCalendarPriceDTO> overlist = vehicleFeign.findVehicleModelCalendarPriceByDate(overStart.getTime(), overEnd.getTime(), modelId, userId).getData();
// List<VehicleModelCalendarPriceDTO> overlist = vehicleFeign.findVehicleModelCalendarPriceByDate(overStart.getTime(), overEnd.getTime(), modelId, userId).getData();
List
<
VehicleModelCalendarPriceDTO
>
overlist
=
vehicleFeign
.
getPriceByVehicleIdFeignV2
(
vehicleId
,
overStart
.
toString
(),
overEnd
.
toString
(),
userId
).
getData
();
List
<
VehicleModelCalendarPriceDTO
>
overlist
=
vehicleFeign
.
getPriceByVehicleIdFeignV2
(
vehicleId
,
overStart
.
getTime
(),
overEnd
.
getTime
(),
userId
).
getData
();
for
(
VehicleModelCalendarPriceDTO
vmcpd
:
overlist
)
{
for
(
VehicleModelCalendarPriceDTO
vmcpd
:
overlist
)
{
overAmountList
.
add
(
BeanUtil
.
toBean
(
vmcpd
,
VMCalendarPriceCostDTO
.
class
));
overAmountList
.
add
(
BeanUtil
.
toBean
(
vmcpd
,
VMCalendarPriceCostDTO
.
class
));
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
View file @
59b492cb
...
@@ -99,7 +99,11 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
...
@@ -99,7 +99,11 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
public
static
final
DateTimeFormatter
DEFAULT_DATE_TIME_FORMATTER
=
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
);
public
static
final
DateTimeFormatter
DEFAULT_DATE_TIME_FORMATTER
=
DateTimeFormat
.
forPattern
(
"yyyy-MM-dd"
);
public
List
<
OrderVehicleCrosstownDto
>
selectByOrderId
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
public
List
<
OrderVehicleCrosstownDto
>
selectByOrderId
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
throws
BaseException
{
UserDTO
byAppUser
=
getBusinessUserByAppUser
();
if
(
byAppUser
==
null
)
{
throw
new
BaseException
(
ResultCode
.
RSTOKEN_EXPIRED_CODE
);
}
if
(
StringUtils
.
isNotBlank
(
orderVehicleCrosstownDto
.
getTypes
()))
{
if
(
StringUtils
.
isNotBlank
(
orderVehicleCrosstownDto
.
getTypes
()))
{
String
[]
types
=
orderVehicleCrosstownDto
.
getTypes
().
split
(
","
);
String
[]
types
=
orderVehicleCrosstownDto
.
getTypes
().
split
(
","
);
orderVehicleCrosstownDto
.
setTypeList
(
Lists
.
newArrayList
(
types
));
orderVehicleCrosstownDto
.
setTypeList
(
Lists
.
newArrayList
(
types
));
...
@@ -229,7 +233,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
...
@@ -229,7 +233,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
log
.
info
(
"交还车参数:orderVehicleCrosstown = {}"
,
orderVehicleCrosstownDto
);
log
.
info
(
"交还车参数:orderVehicleCrosstown = {}"
,
orderVehicleCrosstownDto
);
//获取app用户信息 根据用户名(手机号)定位后台商家用户
//获取app用户信息 根据用户名(手机号)定位后台商家用户
UserDTO
userDTO
=
userInfoBiz
.
getAdminUserInfo
();
UserDTO
userDTO
=
getBusinessUserByAppUser
();
if
(
null
==
userDTO
&&
null
!=
getAppUser
())
{
if
(
null
==
userDTO
&&
null
!=
getAppUser
())
{
userDTO
=
userFeign
.
businessUserinfoByMobilePhone
(
getAppUser
().
getUsername
()).
getData
();
userDTO
=
userFeign
.
businessUserinfoByMobilePhone
(
getAppUser
().
getUsername
()).
getData
();
}
}
...
@@ -470,7 +474,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
...
@@ -470,7 +474,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
depositRefundRecord
.
setTotalAmount
(
totalAmount
.
subtract
(
illegalReserve
));
depositRefundRecord
.
setTotalAmount
(
totalAmount
.
subtract
(
illegalReserve
));
depositRefundRecord
.
setCrosstownId
(
orderVehicleCrosstown
.
getId
());
depositRefundRecord
.
setCrosstownId
(
orderVehicleCrosstown
.
getId
());
orderDepositRefundRecordBiz
.
saveFixLossRecord
(
depositRefundRecord
,
false
);
orderDepositRefundRecordBiz
.
saveFixLossRecord
(
depositRefundRecord
,
false
);
//修改
訂單狀態為定損
//修改
订单状态为定损
baseOrder
.
setStatus
(
OrderStatusEnum
.
ORDER_FIXED_LOSS
.
getCode
());
baseOrder
.
setStatus
(
OrderStatusEnum
.
ORDER_FIXED_LOSS
.
getCode
());
baseOrder
=
baseOrderBiz
.
updateSelectiveByIdReT
(
baseOrder
);
baseOrder
=
baseOrderBiz
.
updateSelectiveByIdReT
(
baseOrder
);
orderRentVehicleDetail
.
setFixedLossStatus
(
1
);
orderRentVehicleDetail
.
setFixedLossStatus
(
1
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCalculateBiz.java
View file @
59b492cb
...
@@ -30,6 +30,7 @@ import com.xxfc.platform.order.pojo.price.DelayAddPriceVO;
...
@@ -30,6 +30,7 @@ import com.xxfc.platform.order.pojo.price.DelayAddPriceVO;
import
com.xxfc.platform.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.inter.CalculateInterface
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.order.VMCalendarPriceCostDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.order.VMCalendarPriceCostDTO
;
...
@@ -56,7 +57,7 @@ import static com.xxfc.platform.universal.constant.DictionaryKey.*;
...
@@ -56,7 +57,7 @@ import static com.xxfc.platform.universal.constant.DictionaryKey.*;
*/
*/
@Slf4j
@Slf4j
@Service
@Service
public
class
OrderCalculateBiz
{
public
class
OrderCalculateBiz
implements
CalculateInterface
{
@Autowired
@Autowired
UserFeign
userFeign
;
UserFeign
userFeign
;
...
@@ -85,6 +86,11 @@ public class OrderCalculateBiz {
...
@@ -85,6 +86,11 @@ public class OrderCalculateBiz {
@Autowired
@Autowired
OrderRentVehicleBiz
orderRentVehicleBiz
;
OrderRentVehicleBiz
orderRentVehicleBiz
;
@Override
public
ThirdFeign
getThirdFeign
()
{
return
thirdFeign
;
}
public
InProgressVO
inProgressCalculate
(
BaseOrder
baseOrder
,
VehicleItemDTO
vehicleItemDTO
,
OrderRentVehicleDetail
orvd
,
Integer
useDays
,
OrderAccountDetail
oad
,
Boolean
isCancel
)
{
public
InProgressVO
inProgressCalculate
(
BaseOrder
baseOrder
,
VehicleItemDTO
vehicleItemDTO
,
OrderRentVehicleDetail
orvd
,
Integer
useDays
,
OrderAccountDetail
oad
,
Boolean
isCancel
)
{
BigDecimal
refundAmount
=
BigDecimal
.
ZERO
;
BigDecimal
refundAmount
=
BigDecimal
.
ZERO
;
BigDecimal
consumeAmount
=
BigDecimal
.
ZERO
;
BigDecimal
consumeAmount
=
BigDecimal
.
ZERO
;
...
@@ -351,73 +357,73 @@ public class OrderCalculateBiz {
...
@@ -351,73 +357,73 @@ public class OrderCalculateBiz {
return
inProgressVO
;
return
inProgressVO
;
}
}
/**
//
/**
* 计算包含多少天
//
* 计算包含多少天
* @param startLong
//
* @param startLong
* @param endLong
//
* @param endLong
* @return
//
* @return
*/
//
*/
public
Integer
getIncludeDays
(
Long
startLong
,
Long
endLong
)
{
//
public Integer getIncludeDays(Long startLong, Long endLong) {
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
//
Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
Long
hourLong
=
(
60L
*
60L
*
1000L
);
//
Long hourLong = (60L * 60L * 1000L);
Long
dayLong
=
hourLong
*
24
;
//
Long dayLong = hourLong * 24;
Long
bufferLong
=
Long
.
valueOf
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_TIME_BUFFER
).
getDetail
())
*
hourLong
;
//
Long bufferLong = Long.valueOf(dictionaryMap.get(APP_ORDER+ "_"+ DictionaryKey.RENT_TIME_BUFFER).getDetail()) * hourLong;
//
//计算:使用天数 当前时间 - 开始时间的0时0分0秒
//
//计算:使用天数 当前时间 - 开始时间的0时0分0秒
Long
bookTimeLag
=
endLong
-
startLong
;
//
Long bookTimeLag = endLong - startLong;
//
//默认 已使用了一天
//
//默认 已使用了一天
if
(
bookTimeLag
<=
0
)
{
//
if(bookTimeLag <= 0) {
return
1
;
//
return 1;
}
//
}
//
log
.
info
(
"bookTimeLag {}"
,
new
BigDecimal
(
bookTimeLag
+
""
));
//
log.info("bookTimeLag {}", new BigDecimal(bookTimeLag + ""));
log
.
info
(
"divide {}"
,
new
BigDecimal
((
24
*
60
*
60
*
1000
)+
""
));
//
log.info("divide {}", new BigDecimal((24 * 60 * 60 * 1000)+ ""));
Integer
bookDays
=
new
BigDecimal
(
bookTimeLag
+
""
).
divide
(
new
BigDecimal
(
dayLong
+
""
),
0
,
RoundingMode
.
DOWN
).
intValue
();
//
Integer bookDays = new BigDecimal(bookTimeLag + "").divide(new BigDecimal(dayLong+ ""), 0, RoundingMode.DOWN).intValue();
Long
excess
=
bookTimeLag
%
dayLong
;
//
Long excess = bookTimeLag%dayLong;
if
(
excess
>
bufferLong
)
{
//
if(excess > bufferLong) {
bookDays
+=
1
;
//
bookDays += 1;
}
//
}
//
if
(
0
==
bookDays
)
{
//
if(0 == bookDays) {
bookDays
=
1
;
//
bookDays = 1;
}
//
}
return
bookDays
;
//
return bookDays;
}
//
}
//
/**
//
/**
* 计算包含多少小时
//
* 计算包含多少小时
* @param startLong
//
* @param startLong
* @param endLong
//
* @param endLong
* @return
//
* @return
*/
//
*/
public
Integer
getIncludeHours
(
Long
startLong
,
Long
endLong
)
{
//
public Integer getIncludeHours(Long startLong, Long endLong) {
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
//
Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
Long
hourLong
=
(
60L
*
60L
*
1000L
);
//
Long hourLong = (60L * 60L * 1000L);
//Long dayLong = hourLong * 24;
//
//Long dayLong = hourLong * 24;
Long
bufferLong
=
0L
;
//
Long bufferLong = 0L;
//
//计算:使用天数 当前时间 - 开始时间的0时0分0秒
//
//计算:使用天数 当前时间 - 开始时间的0时0分0秒
Long
bookTimeLag
=
endLong
-
startLong
;
//
Long bookTimeLag = endLong - startLong;
//
//默认 已使用了1小时
//
//默认 已使用了1小时
if
(
bookTimeLag
<=
0
)
{
//
if(bookTimeLag <= 0) {
return
1
;
//
return 1;
}
//
}
//
log
.
info
(
"bookTimeLag {}"
,
new
BigDecimal
(
bookTimeLag
+
""
));
//
log.info("bookTimeLag {}", new BigDecimal(bookTimeLag + ""));
log
.
info
(
"divide {}"
,
new
BigDecimal
(
hourLong
+
""
));
//
log.info("divide {}", new BigDecimal(hourLong+ ""));
Integer
hourDays
=
new
BigDecimal
(
bookTimeLag
+
""
).
divide
(
new
BigDecimal
(
hourLong
+
""
),
0
,
RoundingMode
.
DOWN
).
intValue
();
//
Integer hourDays = new BigDecimal(bookTimeLag + "").divide(new BigDecimal(hourLong+ ""), 0, RoundingMode.DOWN).intValue();
Long
excess
=
bookTimeLag
%
hourLong
;
//
Long excess = bookTimeLag%hourLong;
if
(
excess
>
bufferLong
)
{
//
if(excess > bufferLong) {
hourDays
+=
1
;
//
hourDays += 1;
}
//
}
//
if
(
0
==
hourDays
)
{
//
if(0 == hourDays) {
hourDays
=
1
;
//
hourDays = 1;
}
//
}
return
hourDays
;
//
return hourDays;
}
//
}
public
OrderRefundPriceVO
getPriceCalculate
(
String
no
,
OrderPageVO
orderPageVO
)
{
public
OrderRefundPriceVO
getPriceCalculate
(
String
no
,
OrderPageVO
orderPageVO
)
{
//根据no 查订单
//根据no 查订单
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mqhandler/RabbitProduct.java
View file @
59b492cb
...
@@ -10,7 +10,6 @@ import org.springframework.stereotype.Component;
...
@@ -10,7 +10,6 @@ import org.springframework.stereotype.Component;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
static
com
.
xxfc
.
platform
.
order
.
config
.
RabbitDelayConfig
.*;
import
static
com
.
xxfc
.
platform
.
order
.
config
.
RabbitDelayConfig
.*;
import
static
com
.
xxfc
.
platform
.
order
.
config
.
RabbitDelayConfig
.
APPLY_CANCEL_KEY
;
/**
/**
* rabbitMq生产者类
* rabbitMq生产者类
...
@@ -58,5 +57,21 @@ public class RabbitProduct {
...
@@ -58,5 +57,21 @@ public class RabbitProduct {
log
.
info
(
"{}ms后执行"
,
delayTime
);
log
.
info
(
"{}ms后执行"
,
delayTime
);
}
}
public
void
sendApplyRequireDelayMessage
(
ShuntApply
shuntApply
,
Long
delayTime
)
{
//这里的消息可以是任意对象,无需额外配置,直接传即可
log
.
info
(
"===============延时队列生产消息===================="
);
log
.
info
(
"发送时间:{},发送内容:{}"
,
LocalDateTime
.
now
(),
shuntApply
.
toString
());
this
.
rabbitTemplate
.
convertAndSend
(
APPLY_REQUIRE_CANCEL_EXC
,
APPLY_REQUIRE_CANCEL_KEY
,
shuntApply
,
message
->
{
//注意这里时间可以使long,而且是设置header
message
.
getMessageProperties
().
setHeader
(
"x-delay"
,
delayTime
);
return
message
;
}
);
log
.
info
(
"{}ms后执行"
,
delayTime
);
}
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderVehicleCrosstownController.java
View file @
59b492cb
package
com
.
xxfc
.
platform
.
order
.
rest
;
package
com
.
xxfc
.
platform
.
order
.
rest
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.activity.user.UserInfoBiz
;
import
com.xxfc.platform.activity.user.UserInfoBiz
;
import
com.xxfc.platform.order.biz.BaseOrderBiz
;
import
com.xxfc.platform.order.biz.BaseOrderBiz
;
...
@@ -49,11 +47,7 @@ public class OrderVehicleCrosstownController {
...
@@ -49,11 +47,7 @@ public class OrderVehicleCrosstownController {
@GetMapping
(
value
=
"/getByOrderId"
)
@GetMapping
(
value
=
"/getByOrderId"
)
@ApiOperation
(
value
=
"根据订单Id获取所有记录信息"
)
@ApiOperation
(
value
=
"根据订单Id获取所有记录信息"
)
public
ObjectRestResponse
<
List
<
OrderVehicleCrosstownDto
>>
getByOrderId
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
public
ObjectRestResponse
<
List
<
OrderVehicleCrosstownDto
>>
getByOrderId
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
UserDTO
userDTO
=
userInfoBiz
.
getAdminUserInfo
();
AppUserDTO
appUserDTO
=
userInfoBiz
.
getUserInfo
();
if
(
userDTO
==
null
&&
appUserDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
508
,
"token is null or invalid"
);
}
if
(
orderVehicleCrosstownDto
==
null
)
{
if
(
orderVehicleCrosstownDto
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"参数orderId为空"
);
return
ObjectRestResponse
.
createFailedResult
(
500
,
"参数orderId为空"
);
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/ShuntApplyController.java
View file @
59b492cb
...
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
...
@@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollUtil;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.common.context.BaseContextHandler
;
import
com.github.wxiaoqi.security.common.context.BaseContextHandler
;
...
@@ -98,8 +99,6 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
...
@@ -98,8 +99,6 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
// if(null != shuntApply.getCategoryId()) {
// if(null != shuntApply.getCategoryId()) {
// VehicleCategory vehicleCategory = vehicleFeign.getVehicleCategory(shuntApply.getCategoryId()).getData();
// VehicleCategory vehicleCategory = vehicleFeign.getVehicleCategory(shuntApply.getCategoryId()).getData();
// shuntApply.setCategoryName(vehicleCategory.getName());
// shuntApply.setCategoryName(vehicleCategory.getName());
// }else if{
//
// }
// }
shuntApply
.
setUserId
(
getCurrentUserIdInt
());
shuntApply
.
setUserId
(
getCurrentUserIdInt
());
...
@@ -141,13 +140,12 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
...
@@ -141,13 +140,12 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
Query
query
=
new
Query
(
dto
);
Query
query
=
new
Query
(
dto
);
PageDataVO
<
ShuntApplyVO
>
pages
=
PageDataVO
.
pageInfo
(
query
,
()
->
baseBiz
.
selectByWeekend
(
w
->
{
PageDataVO
<
ShuntApplyVO
>
pages
=
PageDataVO
.
pageInfo
(
query
,
()
->
baseBiz
.
selectByWeekend
(
w
->
{
w
.
andEqualTo
(
ShuntApply:
:
getUserId
,
dto
.
getUserId
());
w
.
andEqualTo
(
ShuntApply:
:
getUserId
,
dto
.
getUserId
());
w
.
andEqualTo
(
ShuntApply:
:
getIsDel
,
SYS_FALSE
);
return
w
;
return
w
;
},
" crt_time desc "
),
ShuntApplyVO
.
class
);
},
" crt_time desc "
),
ShuntApplyVO
.
class
);
// pages.getData().forEach(data -> {
pages
.
getData
().
forEach
(
data
->
{
// if(null != data.getCategoryId()) {
data
.
setAppUserDTO
(
userFeign
.
userDetailById
(
data
.
getUserId
()).
getData
());
// data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
});
// }
// });
return
ObjectRestResponse
.
succ
(
pages
);
return
ObjectRestResponse
.
succ
(
pages
);
}
}
...
@@ -203,6 +201,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
...
@@ -203,6 +201,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
OrderPageVO
orderPageVO
;
OrderPageVO
orderPageVO
;
VehicleCategory
vehicleCategory
;
VehicleCategory
vehicleCategory
;
VehicleBrand
vehicleBrand
;
VehicleBrand
vehicleBrand
;
AppUserDTO
appUserDTO
;
}
}
@Data
@Data
...
@@ -227,16 +226,15 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
...
@@ -227,16 +226,15 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
PageDataVO
<
StewardShuntApply
>
list
=
PageDataVO
.
pageInfo
(
dto
.
initQuery
(),
()
->
baseBiz
.
selectByWeekend
(
w
->
{
PageDataVO
<
StewardShuntApply
>
list
=
PageDataVO
.
pageInfo
(
dto
.
initQuery
(),
()
->
baseBiz
.
selectByWeekend
(
w
->
{
if
(
null
!=
dto
.
getCityCode
())
{
if
(
null
!=
dto
.
getCityCode
())
{
w
.
andEqualTo
(
ShuntApply:
:
getStartCityCode
,
dto
.
getCityCode
());
w
.
andEqualTo
(
ShuntApply:
:
getStartCityCode
,
dto
.
getCityCode
());
w
.
andEqualTo
(
ShuntApply:
:
getIsDel
,
SYS_FALSE
);
}
}
w
.
andEqualTo
(
ShuntApply:
:
getStatus
,
STATUS_CRT
);
w
.
andEqualTo
(
ShuntApply:
:
getStatus
,
STATUS_CRT
);
return
w
;
return
w
;
},
" crt_time desc "
),
StewardShuntApply
.
class
);
},
" crt_time desc "
),
StewardShuntApply
.
class
);
// list.getData().forEach(data -> {
list
.
getData
().
forEach
(
data
->
{
// if(null != data.getCategoryId()) {
data
.
setAppUserDTO
(
userFeign
.
userDetailById
(
data
.
getUserId
()).
getData
());
// data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
});
// }
// });
return
ObjectRestResponse
.
succ
(
list
);
return
ObjectRestResponse
.
succ
(
list
);
}
}
...
@@ -304,10 +302,12 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
...
@@ -304,10 +302,12 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
Integer
companyId
=
userDTO
.
getCompanyId
();
Integer
companyId
=
userDTO
.
getCompanyId
();
ShuntApply
shuntApply
=
baseBiz
.
selectById
(
applyId
);
ShuntApply
shuntApply
=
baseBiz
.
selectById
(
applyId
);
StewardShuntApply
shuntApplyVO
=
BeanUtil
.
toBean
(
shuntApply
,
StewardShuntApply
.
class
);
StewardShuntApply
shuntApplyVO
=
BeanUtil
.
toBean
(
shuntApply
,
StewardShuntApply
.
class
);
shuntApplyVO
.
setAppUserDTO
(
userFeign
.
userDetailById
(
shuntApplyVO
.
getUserId
()).
getData
());
RentVehicleBookDTO
rbd
=
new
RentVehicleBookDTO
();
RentVehicleBookDTO
rbd
=
new
RentVehicleBookDTO
();
//rbd.setModelId(shuntApply.getModelId());
//rbd.setModelId(shuntApply.getModelId());
rbd
.
setBrandId
(
shuntApply
.
getBrandId
());
rbd
.
setBrandId
(
shuntApply
.
getBrandId
());
rbd
.
setCategoryId
(
shuntApply
.
getCategoryId
());
rbd
.
setCategoryId
(
shuntApply
.
getCategoryId
());
rbd
.
setGoodsType
(
shuntApply
.
getGoodsType
());
rbd
.
setParkBranchCompanyId
(
companyId
);
rbd
.
setParkBranchCompanyId
(
companyId
);
rbd
.
setStartCompanyId
(
companyId
);
rbd
.
setStartCompanyId
(
companyId
);
rbd
.
setEndCompanyId
(
companyId
);
rbd
.
setEndCompanyId
(
companyId
);
...
@@ -356,14 +356,13 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
...
@@ -356,14 +356,13 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
w
.
andEqualTo
(
ShuntApply:
:
getConfirmUserId
,
userDTO
.
getId
());
w
.
andEqualTo
(
ShuntApply:
:
getConfirmUserId
,
userDTO
.
getId
());
if
(
StrUtil
.
isNotBlank
(
dto
.
getMultiStatus
()))
{
if
(
StrUtil
.
isNotBlank
(
dto
.
getMultiStatus
()))
{
w
.
andIn
(
ShuntApply:
:
getStatus
,
CollUtil
.
toList
(
dto
.
getMultiStatus
().
split
(
","
)));
w
.
andIn
(
ShuntApply:
:
getStatus
,
CollUtil
.
toList
(
dto
.
getMultiStatus
().
split
(
","
)));
w
.
andEqualTo
(
ShuntApply:
:
getIsBizdel
,
SYS_FALSE
);
}
}
return
w
;
return
w
;
}),
ShuntApplyController
.
ShuntApplyVO
.
class
);
}),
ShuntApplyController
.
ShuntApplyVO
.
class
);
pages
.
getData
().
forEach
(
data
->
{
pages
.
getData
().
forEach
(
data
->
{
// if(null != data.getCategoryId()) {
data
.
setAppUserDTO
(
userFeign
.
userDetailById
(
data
.
getUserId
()).
getData
());
// data.setVehicleCategory(vehicleFeign.getVehicleCategory(data.getCategoryId()).getData());
// }
if
(
StrUtil
.
isNotBlank
(
data
.
getOrderNo
()))
{
if
(
StrUtil
.
isNotBlank
(
data
.
getOrderNo
()))
{
Map
<
String
,
Object
>
map
=
CollUtil
.
newHashMap
();
Map
<
String
,
Object
>
map
=
CollUtil
.
newHashMap
();
...
@@ -400,5 +399,6 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
...
@@ -400,5 +399,6 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
List
<
UsableVeicleVO
>
vehicles
;
List
<
UsableVeicleVO
>
vehicles
;
VehicleCategory
vehicleCategory
;
VehicleCategory
vehicleCategory
;
VehicleBrand
vehicleBrand
;
VehicleBrand
vehicleBrand
;
AppUserDTO
appUserDTO
;
}
}
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
59b492cb
...
@@ -185,6 +185,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -185,6 +185,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
if
(
null
!=
bo
.
getVehicleId
())
{
if
(
null
!=
bo
.
getVehicleId
())
{
Vehicle
vehicle
=
vehicleFeign
.
get
(
bo
.
getVehicleId
()).
getData
();
Vehicle
vehicle
=
vehicleFeign
.
get
(
bo
.
getVehicleId
()).
getData
();
bo
.
setVehicleCompanyId
(
vehicle
.
getSubordinateBranch
());
bo
.
setVehicleCompanyId
(
vehicle
.
getSubordinateBranch
());
bo
.
setVehicleManageCompanyId
(
vehicle
.
getManageCompanyId
());
List
<
BranchCompany
>
companyDetails
=
vehicleFeign
.
branchCompanyEntityList
(
List
<
BranchCompany
>
companyDetails
=
vehicleFeign
.
branchCompanyEntityList
(
BeanUtil
.
beanToMap
(
new
BranchCompany
(){{
BeanUtil
.
beanToMap
(
new
BranchCompany
(){{
...
@@ -195,6 +196,15 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -195,6 +196,15 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
bo
.
setVehicleBranchId
(
companyDetails
.
get
(
0
).
getCompanyId
());
bo
.
setVehicleBranchId
(
companyDetails
.
get
(
0
).
getCompanyId
());
}
}
List
<
BranchCompany
>
companyDetails2
=
vehicleFeign
.
branchCompanyEntityList
(
BeanUtil
.
beanToMap
(
new
BranchCompany
(){{
setId
(
bo
.
getVehicleManageCompanyId
());
}},
false
,
true
)).
getData
();
if
(
null
!=
companyDetails2
&&
companyDetails2
.
size
()
>
0
)
{
bo
.
setVehicleManageBranchId
(
companyDetails2
.
get
(
0
).
getCompanyId
());
}
//商品类型
//商品类型
bo
.
getOrder
().
setGoodsType
(
vehicle
.
getGoodsType
());
bo
.
getOrder
().
setGoodsType
(
vehicle
.
getGoodsType
());
bo
.
setVehicle
(
vehicle
);
bo
.
setVehicle
(
vehicle
);
...
@@ -403,7 +413,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -403,7 +413,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
Vehicle
vehicle
=
detail
.
getVehicle
();
Vehicle
vehicle
=
detail
.
getVehicle
();
detail
.
initDate
();
detail
.
initDate
();
List
<
VehicleModelCalendarPriceDTO
>
metaVmcpds
=
vehicleFeign
.
getPriceByVehicleIdFeignV2
(
detail
.
getVehicleId
(),
detail
.
getStart
DateStr
(),
detail
.
getEndDateStr
(),
dto
.
getUserid
()).
getData
();
List
<
VehicleModelCalendarPriceDTO
>
metaVmcpds
=
vehicleFeign
.
getPriceByVehicleIdFeignV2
(
detail
.
getVehicleId
(),
detail
.
getStart
Time
(),
detail
.
getEndTime
(),
dto
.
getUserid
()).
getData
();
List
<
VMCalendarPriceCostDTO
>
vmcpds
=
Convert
.
toList
(
VMCalendarPriceCostDTO
.
class
,
metaVmcpds
);
List
<
VMCalendarPriceCostDTO
>
vmcpds
=
Convert
.
toList
(
VMCalendarPriceCostDTO
.
class
,
metaVmcpds
);
...
@@ -528,6 +538,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -528,6 +538,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
depositAmount
=
depositAmount
.
add
(
detail
.
getTrafficDeposit
());
depositAmount
=
depositAmount
.
add
(
detail
.
getTrafficDeposit
());
}
}
orderAmount
=
orderAmount
.
add
(
goodsAmount
).
add
(
depositAmount
);
orderAmount
=
orderAmount
.
add
(
goodsAmount
).
add
(
depositAmount
);
realAmount
=
orderAmount
.
subtract
(
couponAmount
);
//生成订单明细
//生成订单明细
RentVehiclePriceVO
rvp
=
new
RentVehiclePriceVO
();
RentVehiclePriceVO
rvp
=
new
RentVehiclePriceVO
();
...
@@ -589,7 +600,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -589,7 +600,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
Vehicle
vehicle
=
detail
.
getVehicle
();
Vehicle
vehicle
=
detail
.
getVehicle
();
detail
.
initDate
();
detail
.
initDate
();
List
<
VehicleModelCalendarPriceDTO
>
metaVmcpds
=
vehicleFeign
.
getPriceByVehicleIdFeignV2
(
detail
.
getVehicleId
(),
detail
.
getStart
DateStr
(),
detail
.
getEndDateStr
(),
dto
.
getUserid
()).
getData
();
List
<
VehicleModelCalendarPriceDTO
>
metaVmcpds
=
vehicleFeign
.
getPriceByVehicleIdFeignV2
(
detail
.
getVehicleId
(),
detail
.
getStart
Time
(),
detail
.
getEndTime
(),
dto
.
getUserid
()).
getData
();
List
<
VMCalendarPriceCostDTO
>
vmcpds
=
Convert
.
toList
(
VMCalendarPriceCostDTO
.
class
,
metaVmcpds
);
List
<
VMCalendarPriceCostDTO
>
vmcpds
=
Convert
.
toList
(
VMCalendarPriceCostDTO
.
class
,
metaVmcpds
);
...
@@ -718,6 +729,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -718,6 +729,7 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
depositAmount
=
depositAmount
.
add
(
detail
.
getTrafficDeposit
());
depositAmount
=
depositAmount
.
add
(
detail
.
getTrafficDeposit
());
}
}
orderAmount
=
orderAmount
.
add
(
goodsAmount
).
add
(
depositAmount
);
orderAmount
=
orderAmount
.
add
(
goodsAmount
).
add
(
depositAmount
);
realAmount
=
orderAmount
.
subtract
(
couponAmount
);
//生成订单明细
//生成订单明细
RentVehiclePriceVO
rvp
=
new
RentVehiclePriceVO
();
RentVehiclePriceVO
rvp
=
new
RentVehiclePriceVO
();
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/inter/CalculateInterface.java
0 → 100644
View file @
59b492cb
package
com
.
xxfc
.
platform
.
universal
.
inter
;
import
com.xxfc.platform.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.Map
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
public
interface
CalculateInterface
{
public
ThirdFeign
getThirdFeign
();
/**
* 计算包含多少天
* @param startLong
* @param endLong
* @return
*/
default
Integer
getIncludeDays
(
Long
startLong
,
Long
endLong
)
{
Map
<
String
,
Dictionary
>
dictionaryMap
=
getThirdFeign
().
dictionaryGetAll4Map
().
getData
();
Long
hourLong
=
(
60L
*
60L
*
1000L
);
Long
dayLong
=
hourLong
*
24
;
Long
bufferLong
=
Long
.
valueOf
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_TIME_BUFFER
).
getDetail
())
*
hourLong
;
//计算:使用天数 当前时间 - 开始时间的0时0分0秒
Long
bookTimeLag
=
endLong
-
startLong
;
//默认 已使用了一天
if
(
bookTimeLag
<=
0
)
{
return
1
;
}
// log.info("bookTimeLag {}", new BigDecimal(bookTimeLag + ""));
// log.info("divide {}", new BigDecimal((24 * 60 * 60 * 1000)+ ""));
Integer
bookDays
=
new
BigDecimal
(
bookTimeLag
+
""
).
divide
(
new
BigDecimal
(
dayLong
+
""
),
0
,
RoundingMode
.
DOWN
).
intValue
();
Long
excess
=
bookTimeLag
%
dayLong
;
if
(
excess
>
bufferLong
)
{
bookDays
+=
1
;
}
if
(
0
==
bookDays
)
{
bookDays
=
1
;
}
return
bookDays
;
}
/**
* 计算包含多少小时
* @param startLong
* @param endLong
* @return
*/
default
Integer
getIncludeHours
(
Long
startLong
,
Long
endLong
)
{
Map
<
String
,
Dictionary
>
dictionaryMap
=
getThirdFeign
().
dictionaryGetAll4Map
().
getData
();
Long
hourLong
=
(
60L
*
60L
*
1000L
);
//Long dayLong = hourLong * 24;
Long
bufferLong
=
0L
;
//计算:使用天数 当前时间 - 开始时间的0时0分0秒
Long
bookTimeLag
=
endLong
-
startLong
;
//默认 已使用了1小时
if
(
bookTimeLag
<=
0
)
{
return
1
;
}
// log.info("bookTimeLag {}", new BigDecimal(bookTimeLag + ""));
// log.info("divide {}", new BigDecimal(hourLong+ ""));
Integer
hourDays
=
new
BigDecimal
(
bookTimeLag
+
""
).
divide
(
new
BigDecimal
(
hourLong
+
""
),
0
,
RoundingMode
.
DOWN
).
intValue
();
Long
excess
=
bookTimeLag
%
hourLong
;
if
(
excess
>
bufferLong
)
{
hourDays
+=
1
;
}
if
(
0
==
hourDays
)
{
hourDays
=
1
;
}
return
hourDays
;
}
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
59b492cb
...
@@ -243,7 +243,7 @@ public interface VehicleFeign {
...
@@ -243,7 +243,7 @@ public interface VehicleFeign {
@GetMapping
(
value
=
"/vehicleInfo/v2/getPriceByVehicleFeign"
)
@GetMapping
(
value
=
"/vehicleInfo/v2/getPriceByVehicleFeign"
)
public
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
getPriceByVehicleIdFeignV2
(
public
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
getPriceByVehicleIdFeignV2
(
@RequestParam
(
"vehicleId"
)
String
vehicleId
,
@RequestParam
(
"startDate
"
)
String
startDate
,
@RequestParam
(
"endDate"
)
String
endDate
,
@RequestParam
(
"userId"
)
Integer
userId
);
@RequestParam
(
"vehicleId"
)
String
vehicleId
,
@RequestParam
(
"startDate
Temp"
)
Long
startDateTemp
,
@RequestParam
(
"endDateTemp"
)
Long
endDateTemp
,
@RequestParam
(
"userId"
)
Integer
userId
);
@RequestMapping
(
value
=
"/vehicleInfo/selectByParam"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/vehicleInfo/selectByParam"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
<
List
<
Vehicle
>>
vehicleSelectByParam
(
@RequestParam
(
value
=
"vehicle"
)
Map
<
String
,
Object
>
vehicleMap
);
public
RestResponse
<
List
<
Vehicle
>>
vehicleSelectByParam
(
@RequestParam
(
value
=
"vehicle"
)
Map
<
String
,
Object
>
vehicleMap
);
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/RentVehicleBookDTO.java
View file @
59b492cb
...
@@ -24,6 +24,9 @@ public class RentVehicleBookDTO extends PageParam {
...
@@ -24,6 +24,9 @@ public class RentVehicleBookDTO extends PageParam {
@ApiModelProperty
(
"型号id"
)
@ApiModelProperty
(
"型号id"
)
private
Integer
categoryId
;
private
Integer
categoryId
;
@ApiModelProperty
(
"商品类型 1--房车;2--机车;3--游艇"
)
private
Integer
goodsType
;
/**
/**
* 预定目标日期(开始)
* 预定目标日期(开始)
*/
*/
...
@@ -146,8 +149,6 @@ public class RentVehicleBookDTO extends PageParam {
...
@@ -146,8 +149,6 @@ public class RentVehicleBookDTO extends PageParam {
Double
lon
;
Double
lon
;
@ApiModelProperty
(
"纬度"
)
@ApiModelProperty
(
"纬度"
)
Double
lat
;
Double
lat
;
@ApiModelProperty
(
"商品类型 1--房车;2--机车;3--游艇"
)
Integer
goodsType
;
@ApiModelProperty
(
"分类逗号分割"
)
@ApiModelProperty
(
"分类逗号分割"
)
String
catasStr
;
String
catasStr
;
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleModelCalendarPriceBiz.java
View file @
59b492cb
...
@@ -8,6 +8,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
...
@@ -8,6 +8,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import
com.xxfc.platform.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.inter.CalculateInterface
;
import
com.xxfc.platform.vehicle.entity.VehicleModelCalendarPrice
;
import
com.xxfc.platform.vehicle.entity.VehicleModelCalendarPrice
;
import
com.xxfc.platform.vehicle.mapper.VehicleModelCalendarPriceMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleModelCalendarPriceMapper
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleModelCalendarPriceDTO
;
...
@@ -48,7 +49,7 @@ import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
...
@@ -48,7 +49,7 @@ import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
@Service
@Service
@RequiredArgsConstructor
(
onConstructor
=
@__
(
@Autowired
))
@RequiredArgsConstructor
(
onConstructor
=
@__
(
@Autowired
))
@Slf4j
@Slf4j
public
class
VehicleModelCalendarPriceBiz
extends
BaseBiz
<
VehicleModelCalendarPriceMapper
,
VehicleModelCalendarPrice
>
{
public
class
VehicleModelCalendarPriceBiz
extends
BaseBiz
<
VehicleModelCalendarPriceMapper
,
VehicleModelCalendarPrice
>
implements
CalculateInterface
{
private
static
final
int
START_OF_WEEK
=
1
;
private
static
final
int
START_OF_WEEK
=
1
;
private
static
final
int
END_OF_WEEK
=
7
;
private
static
final
int
END_OF_WEEK
=
7
;
private
static
final
Integer
DEFAULT_DISCOUNT
=
100
;
private
static
final
Integer
DEFAULT_DISCOUNT
=
100
;
...
@@ -63,6 +64,10 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
...
@@ -63,6 +64,10 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
private
final
UserFeign
userFeign
;
private
final
UserFeign
userFeign
;
private
final
ThirdFeign
thirdFeign
;
private
final
ThirdFeign
thirdFeign
;
@Override
public
ThirdFeign
getThirdFeign
()
{
return
thirdFeign
;
}
/**
/**
* 保存
* 保存
...
@@ -233,40 +238,74 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
...
@@ -233,40 +238,74 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
return
vehicleModelCalendarPrice
;
return
vehicleModelCalendarPrice
;
}
}
/**
// /**
* 计算包含多少天
// * 计算包含多少天
*
// *
* @param startLong
// * @param startLong
* @param endLong
// * @param endLong
* @return
// * @return
*/
// */
private
Integer
getIncludeDays
(
Long
startLong
,
Long
endLong
)
{
// private Integer getIncludeDays(Long startLong, Long endLong) {
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
// Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
Long
hourLong
=
(
60L
*
60L
*
1000L
);
// Long hourLong = (60L * 60L * 1000L);
Long
dayLong
=
hourLong
*
24
;
// Long dayLong = hourLong * 24;
Long
bufferLong
=
Long
.
valueOf
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_TIME_BUFFER
).
getDetail
())
*
hourLong
;
// Long bufferLong = Long.valueOf(dictionaryMap.get(APP_ORDER + "_" + DictionaryKey.RENT_TIME_BUFFER).getDetail()) * hourLong;
//
//计算:使用天数 当前时间 - 开始时间的0时0分0秒
// //计算:使用天数 当前时间 - 开始时间的0时0分0秒
Long
bookTimeLag
=
endLong
-
startLong
;
// Long bookTimeLag = endLong - startLong;
//
//默认 已使用了一天
// //默认 已使用了一天
if
(
bookTimeLag
<=
0
)
{
// if(bookTimeLag <= 0) {
return
1
;
// return 1;
}
// }
//
log
.
info
(
"bookTimeLag {}"
,
new
BigDecimal
(
bookTimeLag
+
""
));
// log.info("bookTimeLag {}", new BigDecimal(bookTimeLag + ""));
log
.
info
(
"divide {}"
,
new
BigDecimal
((
24
*
60
*
60
*
1000
)
+
""
));
// log.info("divide {}", new BigDecimal((24 * 60 * 60 * 1000) + ""));
Integer
bookDays
=
new
BigDecimal
(
bookTimeLag
+
""
).
divide
(
new
BigDecimal
(
dayLong
+
""
),
0
,
RoundingMode
.
DOWN
).
intValue
();
// Integer bookDays = new BigDecimal(bookTimeLag + "").divide(new BigDecimal(dayLong + ""), 0, RoundingMode.DOWN).intValue();
Long
excess
=
bookTimeLag
%
dayLong
;
// Long excess = bookTimeLag % dayLong;
if
(
excess
>
bufferLong
)
{
// if (excess > bufferLong) {
bookDays
+=
1
;
// bookDays += 1;
}
// }
//
if
(
0
==
bookDays
)
{
// if (0 == bookDays) {
bookDays
=
1
;
// bookDays = 1;
}
// }
return
bookDays
;
// return bookDays;
}
// }
//
// /**
// * 计算包含多少小时
// * @param startLong
// * @param endLong
// * @return
// */
// public Integer getIncludeHours(Long startLong, Long endLong) {
// Map<String, Dictionary> dictionaryMap = thirdFeign.dictionaryGetAll4Map().getData();
// Long hourLong = (60L * 60L * 1000L);
// //Long dayLong = hourLong * 24;
// Long bufferLong = 0L;
//
// //计算:使用天数 当前时间 - 开始时间的0时0分0秒
// Long bookTimeLag = endLong - startLong;
//
// //默认 已使用了1小时
// if(bookTimeLag <= 0) {
// return 1;
// }
//
// log.info("bookTimeLag {}", new BigDecimal(bookTimeLag + ""));
// log.info("divide {}", new BigDecimal(hourLong+ ""));
// Integer hourDays = new BigDecimal(bookTimeLag + "").divide(new BigDecimal(hourLong+ ""), 0, RoundingMode.DOWN).intValue();
// Long excess = bookTimeLag%hourLong;
// if(excess > bufferLong) {
// hourDays += 1;
// }
//
// if(0 == hourDays) {
// hourDays = 1;
// }
// return hourDays;
// }
/**
/**
* 价格24小时处理
* 价格24小时处理
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehiclePlatCataBiz.java
View file @
59b492cb
...
@@ -13,6 +13,7 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO;
...
@@ -13,6 +13,7 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.VehicleCata
;
import
com.xxfc.platform.vehicle.entity.VehicleCata
;
import
com.xxfc.platform.vehicle.entity.VehiclePlatCata
;
import
com.xxfc.platform.vehicle.entity.VehiclePlatCata
;
import
com.xxfc.platform.vehicle.mapper.VehiclePlatCataMapper
;
import
com.xxfc.platform.vehicle.mapper.VehiclePlatCataMapper
;
...
@@ -203,16 +204,16 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
...
@@ -203,16 +204,16 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
* @param limit
* @param limit
* @return
* @return
*/
*/
public
ObjectRestResponse
getCascades
(
Integer
page
,
Integer
limit
,
Integer
sort
,
Integer
goodsType
)
{
public
ObjectRestResponse
getCascades
(
Integer
page
,
Integer
limit
,
Integer
sort
,
Integer
goodsType
,
String
name
)
{
try
{
try
{
//标签列表页面
//标签列表页面
if
(
sort
==
null
||
sort
==
0
)
{
if
(
sort
==
null
||
sort
==
0
)
{
return
getPage
(
page
,
limit
,
goodsType
);
return
getPage
(
page
,
limit
,
goodsType
,
name
);
}
}
//增加车型页面
//增加车型页面
if
(
sort
==
1
)
{
if
(
sort
==
1
)
{
return
getList
();
return
getList
(
goodsType
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);;
log
.
error
(
e
.
getMessage
(),
e
);;
...
@@ -221,13 +222,15 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
...
@@ -221,13 +222,15 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
}
}
@Cache
(
key
=
RedisKey
.
BRANCH_COMPANY_CATA_LIST
)
@Cache
(
key
=
RedisKey
.
BRANCH_COMPANY_CATA_LIST
+
"{1}"
)
private
ObjectRestResponse
getList
()
{
private
ObjectRestResponse
getList
(
Integer
goodsType
)
{
//获取一级标签
//获取一级标签
Example
example
=
Example
.
builder
(
VehiclePlatCata
.
class
)
Example
example
=
Example
.
builder
(
VehiclePlatCata
.
class
)
.
where
(
WeekendSqls
.<
VehiclePlatCata
>
custom
()
.
where
(
WeekendSqls
.<
VehiclePlatCata
>
custom
()
.
andEqualTo
(
VehiclePlatCata:
:
getParentId
,
0
)
.
andEqualTo
(
VehiclePlatCata:
:
getParentId
,
0
)
.
andEqualTo
(
VehiclePlatCata:
:
getState
,
0
))
.
andEqualTo
(
VehiclePlatCata:
:
getState
,
0
)
.
andEqualTo
(
VehiclePlatCata:
:
getGoodsType
,
goodsType
)
)
.
orderByAsc
(
"isMore"
,
"rank"
)
.
orderByAsc
(
"isMore"
,
"rank"
)
.
build
();
.
build
();
//分页查询父类
//分页查询父类
...
@@ -239,7 +242,7 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
...
@@ -239,7 +242,7 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
}
}
@Cache
(
key
=
RedisKey
.
BRANCH_COMPANY_CATA_PAGE
)
@Cache
(
key
=
RedisKey
.
BRANCH_COMPANY_CATA_PAGE
)
private
ObjectRestResponse
getPage
(
Integer
page
,
Integer
limit
,
Integer
goodsType
)
{
private
ObjectRestResponse
getPage
(
Integer
page
,
Integer
limit
,
Integer
goodsType
,
String
name
)
{
//获取一级标签
//获取一级标签
WeekendSqls
<
VehiclePlatCata
>
weekendSqls
=
WeekendSqls
.<
VehiclePlatCata
>
custom
();
WeekendSqls
<
VehiclePlatCata
>
weekendSqls
=
WeekendSqls
.<
VehiclePlatCata
>
custom
();
if
(
null
!=
goodsType
){
if
(
null
!=
goodsType
){
...
@@ -247,6 +250,9 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
...
@@ -247,6 +250,9 @@ public class VehiclePlatCataBiz extends BaseBiz<VehiclePlatCataMapper, VehiclePl
}
}
weekendSqls
.
andEqualTo
(
VehiclePlatCata:
:
getParentId
,
0
)
weekendSqls
.
andEqualTo
(
VehiclePlatCata:
:
getParentId
,
0
)
.
andEqualTo
(
VehiclePlatCata:
:
getState
,
0
);
.
andEqualTo
(
VehiclePlatCata:
:
getState
,
0
);
if
(
StringUtils
.
isNotBlank
(
name
))
{
weekendSqls
.
andLike
(
VehiclePlatCata:
:
getName
,
"%"
+
name
+
"%"
);
}
Example
example
=
Example
.
builder
(
VehiclePlatCata
.
class
)
Example
example
=
Example
.
builder
(
VehiclePlatCata
.
class
)
.
where
(
weekendSqls
)
.
where
(
weekendSqls
)
.
orderByAsc
(
"rank"
)
.
orderByAsc
(
"rank"
)
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/RentVehicleController.java
View file @
59b492cb
...
@@ -16,6 +16,8 @@ import com.github.wxiaoqi.security.common.exception.BaseException;
...
@@ -16,6 +16,8 @@ import com.github.wxiaoqi.security.common.exception.BaseException;
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.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.inter.CalculateInterface
;
import
com.xxfc.platform.vehicle.biz.*
;
import
com.xxfc.platform.vehicle.biz.*
;
import
com.xxfc.platform.vehicle.common.BaseController
;
import
com.xxfc.platform.vehicle.common.BaseController
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
...
@@ -55,7 +57,7 @@ import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP_NAME;
...
@@ -55,7 +57,7 @@ import static com.xxfc.platform.vehicle.constant.VehicleConstant.USER_APP_NAME;
@Slf4j
@Slf4j
@IgnoreClientToken
@IgnoreClientToken
@Api
(
value
=
"租车相关车辆管理controller"
,
tags
={
"租车相关车辆管理接口"
})
@Api
(
value
=
"租车相关车辆管理controller"
,
tags
={
"租车相关车辆管理接口"
})
public
class
RentVehicleController
extends
BaseController
<
VehicleBiz
>
implements
UserRestInterface
{
public
class
RentVehicleController
extends
BaseController
<
VehicleBiz
>
implements
UserRestInterface
,
CalculateInterface
{
private
static
final
Integer
DEFAULT_DISCOUNT
=
100
;
private
static
final
Integer
DEFAULT_DISCOUNT
=
100
;
private
static
final
Integer
DEFAULT_MEMBER_LEVEL
=
0
;
private
static
final
Integer
DEFAULT_MEMBER_LEVEL
=
0
;
private
static
final
Integer
DEFAULT_MEMBER_TYPE
=
0
;
private
static
final
Integer
DEFAULT_MEMBER_TYPE
=
0
;
...
@@ -69,6 +71,9 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
...
@@ -69,6 +71,9 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
@Autowired
@Autowired
UserFeign
userFeign
;
UserFeign
userFeign
;
@Autowired
ThirdFeign
thirdFeign
;
@Autowired
@Autowired
VehicleBiz
vehicleBiz
;
VehicleBiz
vehicleBiz
;
...
@@ -81,6 +86,12 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
...
@@ -81,6 +86,12 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
@Autowired
@Autowired
VehicleHolidayPriceInfoBiz
vehicleHolidayPriceInfoBiz
;
VehicleHolidayPriceInfoBiz
vehicleHolidayPriceInfoBiz
;
@Override
public
ThirdFeign
getThirdFeign
()
{
return
thirdFeign
;
}
public
UserFeign
getUserFeign
()
{
public
UserFeign
getUserFeign
()
{
return
userFeign
;
return
userFeign
;
}
}
...
@@ -277,10 +288,10 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
...
@@ -277,10 +288,10 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
@RequestMapping
(
value
=
"/rent/apply/usable-vehicle"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/rent/apply/usable-vehicle"
,
method
=
RequestMethod
.
POST
)
@IgnoreUserToken
@IgnoreUserToken
public
ObjectRestResponse
<
PageDataVO
<
UsableVeicleVO
>>
applyUsableVehicle
(
@RequestBody
RentVehicleBookDTO
rbd
)
{
public
ObjectRestResponse
<
PageDataVO
<
UsableVeicleVO
>>
applyUsableVehicle
(
@RequestBody
RentVehicleBookDTO
rbd
)
{
rbd
.
setRecordIntersection
(
Boolean
.
TRU
E
);
rbd
.
setRecordIntersection
(
Boolean
.
FALS
E
);
rbd
.
setLimit
(
100
);
rbd
.
setLimit
(
100
);
rbd
.
setPage
(
1
);
rbd
.
setPage
(
1
);
rbd
.
setYearNo4Where
(
Boolean
.
TRUE
);
//
rbd.setYearNo4Where(Boolean.TRUE);
//查询可车辆信息
//查询可车辆信息
PageDataVO
<
UsableVeicleVO
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
rbd
);
PageDataVO
<
UsableVeicleVO
>
pageDataVO
=
vehicleBiz
.
searchUsableVehicle
(
rbd
);
...
@@ -406,26 +417,46 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
...
@@ -406,26 +417,46 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
@GetMapping
(
value
=
"/app/unauth/v2/getPriceByVehicle"
)
@GetMapping
(
value
=
"/app/unauth/v2/getPriceByVehicle"
)
@IgnoreUserToken
@IgnoreUserToken
public
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
getByVehicleIdV2
(
String
vehicleId
,
String
startDate
,
String
endDate
,
Long
startDateTemp
,
Long
endDateTemp
)
{
public
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
getByVehicleIdV2
(
String
vehicleId
,
String
startDate
,
String
endDate
,
Long
startDateTemp
,
Long
endDateTemp
)
{
if
(
null
!=
startDateTemp
)
{
//
if(null != startDateTemp) {
startDate
=
DateUtil
.
date
(
startDateTemp
).
toString
();
//
startDate = DateUtil.date(startDateTemp).toString();
}
//
}
if
(
null
!=
endDateTemp
)
{
//
if(null != endDateTemp) {
endDate
=
DateUtil
.
date
(
endDateTemp
).
toString
();
//
endDate = DateUtil.date(endDateTemp).toString();
}
//
}
return
ObjectRestResponse
.
succ
(
getSynthesizePrice
(
vehicleId
,
startDate
,
endDate
,
getCurrentUserIdInt
()));
return
ObjectRestResponse
.
succ
(
getSynthesizePrice
(
vehicleId
,
startDate
Temp
,
endDateTemp
,
getCurrentUserIdInt
()));
}
}
@GetMapping
(
value
=
"v2/getPriceByVehicleFeign"
)
@GetMapping
(
value
=
"v2/getPriceByVehicleFeign"
)
@IgnoreUserToken
@IgnoreUserToken
public
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
getByVehicleIdFeignV2
(
String
vehicleId
,
String
startDate
,
String
endDate
,
Integer
userId
)
{
public
ObjectRestResponse
<
List
<
VehicleModelCalendarPriceDTO
>>
getByVehicleIdFeignV2
(
String
vehicleId
,
Long
startDateTemp
,
Long
endDateTemp
,
Integer
userId
)
{
return
ObjectRestResponse
.
succ
(
getSynthesizePrice
(
vehicleId
,
startDate
,
endDate
,
userId
));
List
<
VehicleModelCalendarPriceDTO
>
list
=
getSynthesizePrice
(
vehicleId
,
startDateTemp
,
endDateTemp
,
userId
);
Vehicle
vehicle
=
vehicleBiz
.
selectOne
(
new
Vehicle
(){{
setId
(
vehicleId
);
}});
List
<
VehicleModelCalendarPriceDTO
>
list2
=
CollUtil
.
newArrayList
();
if
(
list
.
size
()
>
0
)
{
Integer
cycle
=
0
;
if
(
Vehicle
.
PRICE_TYPE_HOUR
==
vehicle
.
getPriceType
())
{
cycle
=
getIncludeHours
(
startDateTemp
,
endDateTemp
);
}
else
{
cycle
=
getIncludeDays
(
startDateTemp
,
endDateTemp
);
}
for
(
int
i
=
0
;
i
<
cycle
;
i
++)
{
list2
.
add
(
list
.
get
(
i
));
}
}
return
ObjectRestResponse
.
succ
(
list2
);
}
}
public
List
<
VehicleModelCalendarPriceDTO
>
getSynthesizePrice
(
String
vehicleId
,
String
startDate
,
String
endDate
,
Integer
userId
)
{
public
List
<
VehicleModelCalendarPriceDTO
>
getSynthesizePrice
(
String
vehicleId
,
Long
startDateTemp
,
Long
endDateTemp
,
Integer
userId
)
{
List
<
VehicleModelCalendarPriceDTO
>
priceDTOS
=
CollUtil
.
newArrayList
();
List
<
VehicleModelCalendarPriceDTO
>
priceDTOS
=
CollUtil
.
newArrayList
();
String
startDate
=
DateUtil
.
date
(
startDateTemp
).
toString
();
String
endDate
=
DateUtil
.
date
(
endDateTemp
).
toString
();
cn
.
hutool
.
core
.
date
.
DateTime
beginOfStartDate
=
DateUtil
.
beginOfDay
(
DateUtil
.
parse
(
startDate
));
cn
.
hutool
.
core
.
date
.
DateTime
beginOfStartDate
=
DateUtil
.
beginOfDay
(
DateUtil
.
parse
(
startDate
));
cn
.
hutool
.
core
.
date
.
DateTime
endOfEndDate
=
DateUtil
.
endOfDay
(
DateUtil
.
parse
(
endDate
));
cn
.
hutool
.
core
.
date
.
DateTime
endOfEndDate
=
DateUtil
.
endOfDay
(
DateUtil
.
parse
(
endDate
));
//获取基本和周末价格
//获取基本和周末价格
company_info
Vehicle
vehicle
=
vehicleBiz
.
selectOne
(
new
Vehicle
(){{
Vehicle
vehicle
=
vehicleBiz
.
selectOne
(
new
Vehicle
(){{
setId
(
vehicleId
);
setId
(
vehicleId
);
}});
}});
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleCataController.java
View file @
59b492cb
...
@@ -98,7 +98,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
...
@@ -98,7 +98,7 @@ public class VehicleCataController extends VehicleBaseController<VehiclePlatCata
,
@PathVariable
Integer
limit
,
@PathVariable
Integer
limit
,
@PathVariable
Integer
sort
){
,
@PathVariable
Integer
sort
){
return
baseBiz
.
getCascades
(
page
,
limit
,
sort
,
null
);
return
baseBiz
.
getCascades
(
page
,
limit
,
sort
,
null
,
null
);
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/BgVehicleCataController.java
View file @
59b492cb
...
@@ -90,7 +90,7 @@ public class BgVehicleCataController extends VehicleBaseController<VehiclePlatCa
...
@@ -90,7 +90,7 @@ public class BgVehicleCataController extends VehicleBaseController<VehiclePlatCa
*/
*/
@GetMapping
(
value
=
"/operation/getCascades"
)
@GetMapping
(
value
=
"/operation/getCascades"
)
public
ObjectRestResponse
getCascades
(
PageDTO
dto
){
public
ObjectRestResponse
getCascades
(
PageDTO
dto
){
return
baseBiz
.
getCascades
(
dto
.
getPage
(),
dto
.
getLimit
(),
dto
.
getSort
(),
dto
.
getGoodsType
());
return
baseBiz
.
getCascades
(
dto
.
getPage
(),
dto
.
getLimit
(),
dto
.
getSort
(),
dto
.
getGoodsType
()
,
dto
.
getName
()
);
}
}
/**
/**
...
@@ -103,13 +103,14 @@ public class BgVehicleCataController extends VehicleBaseController<VehiclePlatCa
...
@@ -103,13 +103,14 @@ public class BgVehicleCataController extends VehicleBaseController<VehiclePlatCa
@GetMapping
(
value
=
"/business/getCascades"
)
@GetMapping
(
value
=
"/business/getCascades"
)
public
ObjectRestResponse
getBusinessCascades
(
PageDTO
dto
){
public
ObjectRestResponse
getBusinessCascades
(
PageDTO
dto
){
dto
.
setSort
(
1
);
dto
.
setSort
(
1
);
return
baseBiz
.
getCascades
(
dto
.
getPage
(),
dto
.
getLimit
(),
dto
.
getSort
(),
dto
.
getGoodsType
());
return
baseBiz
.
getCascades
(
dto
.
getPage
(),
dto
.
getLimit
(),
dto
.
getSort
(),
dto
.
getGoodsType
()
,
dto
.
getName
()
);
}
}
@Data
@Data
public
static
class
PageDTO
extends
PageParam
{
public
static
class
PageDTO
extends
PageParam
{
Integer
sort
;
Integer
sort
;
Integer
goodsType
;
Integer
goodsType
;
String
name
;
}
}
...
...
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