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
2820495f
Commit
2820495f
authored
Jul 22, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://113.105.137.151:22280/youjj/cloud-platform
into base-modify
parents
79652939
d7fffb3a
Changes
34
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
309 additions
and
105 deletions
+309
-105
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+5
-2
MyWalletDetailMapper.xml
...-admin/src/main/resources/mapper/MyWalletDetailMapper.xml
+2
-2
IntegralSignRecordBiz.java
...com/xxfc/platform/activity/biz/IntegralSignRecordBiz.java
+2
-2
IntegralUserRecordBiz.java
...com/xxfc/platform/activity/biz/IntegralUserRecordBiz.java
+3
-3
MsgBiz.java
...server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
+12
-3
RefundTypeEnum.java
...xxfc/platform/order/contant/enumerate/RefundTypeEnum.java
+2
-2
OrderRentVehicleDetail.java
...om/xxfc/platform/order/entity/OrderRentVehicleDetail.java
+8
-5
OrderVehicleCrosstown.java
...com/xxfc/platform/order/entity/OrderVehicleCrosstown.java
+3
-0
OrderViolation.java
...n/java/com/xxfc/platform/order/entity/OrderViolation.java
+2
-1
OrderVehicleCrosstownDto.java
...c/platform/order/pojo/order/OrderVehicleCrosstownDto.java
+2
-0
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+28
-3
OrderRefundBiz.java
...main/java/com/xxfc/platform/order/biz/OrderRefundBiz.java
+25
-30
OrderVehicalCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicalCrosstownBiz.java
+34
-4
RentDepositJobHandler.java
...xxfc/platform/order/jobhandler/RentDepositJobHandler.java
+31
-30
OrderVehicaleCrosstownMapper.java
...c/platform/order/mapper/OrderVehicaleCrosstownMapper.java
+1
-1
RefundMQHandler.java
...va/com/xxfc/platform/order/mqhandler/RefundMQHandler.java
+68
-0
BaseOrderController.java
...ava/com/xxfc/platform/order/rest/BaseOrderController.java
+22
-0
OrderVehicleCrosstownController.java
.../platform/order/rest/OrderVehicleCrosstownController.java
+3
-2
OrderVehicaleCrosstownMapper.xml
...rc/main/resources/mapper/OrderVehicaleCrosstownMapper.xml
+1
-1
DictionaryKey.java
...a/com/xxfc/platform/universal/constant/DictionaryKey.java
+5
-0
VehicleAndModelInfoVo.java
...com/xxfc/platform/vehicle/pojo/VehicleAndModelInfoVo.java
+1
-0
VehicleWarningMsgQueryVo.java
.../xxfc/platform/vehicle/pojo/VehicleWarningMsgQueryVo.java
+4
-1
BranchCompanyBiz.java
.../java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
+7
-0
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+9
-1
VehicleBookHourInfoBiz.java
...com/xxfc/platform/vehicle/biz/VehicleBookHourInfoBiz.java
+0
-3
VehicleWarningMsgBiz.java
...a/com/xxfc/platform/vehicle/biz/VehicleWarningMsgBiz.java
+4
-2
BranchCompanyMapper.java
...com/xxfc/platform/vehicle/mapper/BranchCompanyMapper.java
+1
-0
VehicleWarningMsgMapper.java
...xxfc/platform/vehicle/mapper/VehicleWarningMsgMapper.java
+2
-1
VehicleWarningRuleMapper.java
...xfc/platform/vehicle/mapper/VehicleWarningRuleMapper.java
+1
-2
BranchCompanyController.java
...m/xxfc/platform/vehicle/rest/BranchCompanyController.java
+5
-0
VehicleController.java
...ava/com/xxfc/platform/vehicle/rest/VehicleController.java
+1
-2
BranchCompanyMapper.xml
...-server/src/main/resources/mapper/BranchCompanyMapper.xml
+4
-0
VehicleWarningMsgMapper.xml
...ver/src/main/resources/mapper/VehicleWarningMsgMapper.xml
+8
-1
VehicleWarningRuleMapper.xml
...er/src/main/resources/mapper/VehicleWarningRuleMapper.xml
+3
-1
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
2820495f
...
...
@@ -203,11 +203,14 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper,AppUserRel
List
<
InviteMemberBO
>
inviteMemberBOS
=
new
ArrayList
<>();
InviteMemberBO
inviteMemberBO
;
for
(
AppUserRelation
appUserRelation
:
appUserRelations
)
{
if
(
userIdAndUserLoginMap
==
null
||
userIdAndUserDetailMap
==
null
){
continue
;
}
inviteMemberBO
=
new
InviteMemberBO
();
inviteMemberBO
.
setBindTime
(
appUserRelation
.
getBindTime
());
inviteMemberBO
.
setJoinTime
(
appUserRelation
.
getBindTime
());
inviteMemberBO
.
setUsername
(
userIdAndUserLoginMap
.
get
(
appUserRelation
.
getUserId
()).
getUsername
());
inviteMemberBO
.
setHeadUrl
(
userIdAndUserDetailMap
.
get
(
appUserRelation
.
getUserId
()).
getHeadimgurl
());
inviteMemberBO
.
setUsername
(
userIdAndUserLoginMap
==
null
?
""
:
userIdAndUserLoginMap
.
get
(
appUserRelation
.
getUserId
())==
null
?
""
:
userIdAndUserLoginMap
.
get
(
appUserRelation
.
getUserId
()).
getUsername
());
inviteMemberBO
.
setHeadUrl
(
userIdAndUserDetailMap
==
null
?
""
:
userIdAndUserDetailMap
.
get
(
appUserRelation
.
getUserId
())==
null
?
""
:
userIdAndUserDetailMap
.
get
(
appUserRelation
.
getUserId
()).
getHeadimgurl
());
inviteMemberBOS
.
add
(
inviteMemberBO
);
}
inviteMemberVo
.
setTotalCount
(
pageDataVO
.
getTotalCount
().
intValue
());
...
...
ace-modules/ace-admin/src/main/resources/mapper/MyWalletDetailMapper.xml
View file @
2820495f
...
...
@@ -23,10 +23,10 @@ FROM
(select id,user_id,source,amount,cono,itype,activity_id,activity_name,`crt_time` FROM `my_wallet_detail`
<if
test=
"sourceType != null"
>
WHERE `source`=#{sourceType}
</if>
) AS `wd`
LEFT
JOIN (SELECT id,username FROM `app_user_login`
<if
test=
"phone != null and phone != ''"
>
INNER
JOIN (SELECT id,username FROM `app_user_login`
<if
test=
"phone != null and phone != ''"
>
WHERE `username`=#{phone}
</if>
) AS `aul` ON aul.id = wd.user_id
LEFT
JOIN (SELECT userid,nickname,realname FROM `app_user_detail`
<if
test=
"userName != null and userName != ''"
>
INNER
JOIN (SELECT userid,nickname,realname FROM `app_user_detail`
<if
test=
"userName != null and userName != ''"
>
WHERE `nickname`=#{userName} OR `realname`=#{userName}
</if>
) AS `aud` ON aud.userid = aul.id
LEFT JOIN (SELECT DISTINCT order_id,id,price,extract,waiting,title FROM `app_user_selling_water`) AS `ausw` ON ausw.order_id = wd.cono
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralSignRecordBiz.java
View file @
2820495f
...
...
@@ -108,12 +108,12 @@ public class IntegralSignRecordBiz extends BaseBiz<IntegralSignRecordMapper, Int
addPoint
(
objectRestResponse
.
getData
(),
integralSignRecord
,
appUserDTO
,
integralSignRecord
.
getSignDays
());
return
ObjectRestResponse
.
succ
(
objectRestResponse
.
getData
().
getPoint
());
}
return
ObjectRestResponse
.
createFailedResult
(
1006
,
"
签到次数已达到上限,请下次再来
"
);
return
ObjectRestResponse
.
createFailedResult
(
1006
,
"
今日已签到!
"
);
}
}
else
{
return
ObjectRestResponse
.
createFailedResult
(
1003
,
"签到规则不存在!"
);
}
}
}
return
ObjectRestResponse
.
succ
();
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/IntegralUserRecordBiz.java
View file @
2820495f
...
...
@@ -58,10 +58,10 @@ public class IntegralUserRecordBiz extends BaseBiz<IntegralUserRecordMapper, Int
return
ObjectRestResponse
.
createFailedResult
(
1202
,
"积分规则不存在"
);
}
Integer
point
=
0
;
if
(
ruleObjectRestResponse
.
getData
()
.
getPoint
()
==
0
)
{
//没有基础分需要计算分数
IntegralRule
oldValue
=
ruleObjectRestResponse
.
getData
();
if
(
oldValue
.
getPoint
()
==
0
)
{
//没有基础分需要计算分数
Integer
amount
=
Integer
.
parseInt
(
new
BigDecimal
(
integralUserRecord
.
getAmount
()).
divide
(
new
BigDecimal
(
"100"
),
0
,
BigDecimal
.
ROUND_DOWN
).
toString
());
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
ruleObjectRestResponse
.
getData
()
.
getOtherRule
());
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
oldValue
.
getOtherRule
());
log
.
info
(
"查询的其他规则json信息:jsonObject = {}"
,
jsonObject
);
if
(
jsonObject
==
null
)
{
point
=
ruleObjectRestResponse
.
getData
().
getPoint
();
...
...
xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
View file @
2820495f
...
...
@@ -57,17 +57,23 @@ public class MsgBiz {
Query
query
=
null
;
List
<
Msg
>
msgList
=
null
;
if
(
type
!=
null
)
{
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
is
(
type
)).
with
(
pageable
);
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
is
(
type
));
int
totalSize
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
).
size
();
query
.
with
(
pageable
);
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
}
else
{
List
<
Integer
>
ids
=
new
ArrayList
<>();
ids
.
add
(
2
);
ids
.
add
(
4
);
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
)).
with
(
pageable
);
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
));
int
totalSize
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
).
size
();
query
.
with
(
pageable
);
msgList
=
fetchAndAttach
(
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
),
userId
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
}
...
...
@@ -81,10 +87,13 @@ public class MsgBiz {
List
<
Integer
>
ids
=
new
ArrayList
<>();
ids
.
add
(
2
);
ids
.
add
(
4
);
Query
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
)).
with
(
pageable
);
Query
query
=
new
Query
(
Criteria
.
where
(
"body.type"
).
in
(
ids
));
int
totalSize
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
).
size
();
query
.
with
(
pageable
);
query
.
with
(
new
Sort
(
Sort
.
Direction
.
DESC
,
"count.praise"
));
List
<
Msg
>
msgList
=
mongoTemplate
.
find
(
query
,
Msg
.
class
,
"s_msg"
);
PageInfo
<
MsgVo
>
goodPageInfo
=
new
PageInfo
<>(
replaceMsgResult
(
msgList
));
goodPageInfo
.
setPageSize
(
totalSize
%
limit
==
0
?
totalSize
/
limit
:
totalSize
/
limit
+
1
);
return
ObjectRestResponse
.
succ
(
goodPageInfo
);
}
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/contant/enumerate/RefundTypeEnum.java
View file @
2820495f
...
...
@@ -4,8 +4,8 @@ import java.util.HashMap;
import
java.util.Map
;
public
enum
RefundTypeEnum
{
RentVehicle
(
1
,
"订单款"
),
TOUR
(
2
,
"押金"
),
ORDER_FUND
(
1
,
"订单款"
),
DEPOSIT
(
2
,
"押金"
),
;
/**
* 编码
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderRentVehicleDetail.java
View file @
2820495f
package
com
.
xxfc
.
platform
.
order
.
entity
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* 租车订单详情
...
...
@@ -297,7 +300,7 @@ public class OrderRentVehicleDetail implements Serializable {
/**
* 是否处理违章 0--未处理;1--已处理
*/
@ApiModelProperty
(
value
=
"是否
购买免赔
"
)
@ApiModelProperty
(
value
=
"是否
处理违章
"
)
@Column
(
name
=
"handel_violation"
)
private
Integer
handelViolation
;
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderVehicleCrosstown.java
View file @
2820495f
...
...
@@ -123,4 +123,7 @@ public class OrderVehicleCrosstown {
* 驾驶人Id
*/
private
String
userLicenseId
;
//操作人ID
private
Integer
orperaterId
;
}
\ No newline at end of file
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/OrderViolation.java
View file @
2820495f
...
...
@@ -5,6 +5,7 @@ import javax.persistence.Column;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
@Data
...
...
@@ -19,7 +20,7 @@ public class OrderViolation {
* 违章总金额
*/
@Column
(
name
=
"price"
)
private
Double
price
;
private
BigDecimal
price
;
/**
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/OrderVehicleCrosstownDto.java
View file @
2820495f
...
...
@@ -27,4 +27,6 @@ public class OrderVehicleCrosstownDto extends OrderVehicleCrosstown {
private
String
licenseIdCard
;
private
String
vehicleNumberPlat
;
private
String
username
;
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
2820495f
...
...
@@ -172,7 +172,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
=
new
OrderVehicleCrosstownDto
();
orderVehicleCrosstownDto
.
setOrderId
(
orderPageVo
.
getId
());
orderVehicleCrosstownDto
.
setOrderNo
(
orderPageVo
.
getNo
());
List
<
OrderVehicleCrosstown
>
orderVehicleCrosstowns
=
orderVehicalCrosstownBiz
.
selectByOrderId
(
orderVehicleCrosstownDto
);
List
<
OrderVehicleCrosstown
Dto
>
orderVehicleCrosstowns
=
orderVehicalCrosstownBiz
.
selectByOrderId
(
orderVehicleCrosstownDto
);
if
(
orderVehicleCrosstowns
!=
null
&&
orderVehicleCrosstowns
.
size
()
>
0
)
{
List
<
OrderUserLicense
>
orderUserLicenses
=
orderUserLicenseBiz
.
selectByIds
(
orderVehicleCrosstowns
.
get
(
0
).
getUserLicenseId
()).
getData
();
if
(
orderUserLicenses
!=
null
&&
orderUserLicenses
.
size
()
>
0
)
{
...
...
@@ -326,7 +326,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
//退款金额
BigDecimal
refundAmount
=
depositAmount
.
add
(
refundGoodsAmount
);
//退款子流程: 订单基础,退款描述,退款金额
refundSubProcess
(
baseOrder
,
refundDesc
,
refundAmount
,
RefundTypeEnum
.
RentVehicle
.
getCode
(),
RefundStatusEnum
.
ALL
.
getCode
());
refundSubProcess
(
baseOrder
,
refundDesc
,
refundAmount
,
RefundTypeEnum
.
ORDER_FUND
.
getCode
(),
RefundStatusEnum
.
ALL
.
getCode
());
}
public
BigDecimal
calculateRefund
(
BigDecimal
goodsAmount
,
Long
timeLag
,
String
dicParentKey
,
String
refundDesc
)
{
...
...
@@ -412,7 +412,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
setOrderId
(
orderId
);
setRefundTime
(
System
.
currentTimeMillis
());
setTradeNo
(
refundTradeNo
);
setRefundType
(
RefundTypeEnum
.
RentVehicle
.
getCode
());
setRefundType
(
RefundTypeEnum
.
ORDER_FUND
.
getCode
());
}};
orderRefund
.
setRefundAmount
(
refundAmount
);
orderRefund
.
setRefundDesc
(
refundDesc
);
...
...
@@ -523,6 +523,18 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
* @return
*/
public
BaseOrder
updateSelectiveByIdReT
(
BaseOrder
baseOrder
)
{
return
updateSelectiveByIdReT
(
baseOrder
,
false
);
}
/**
* 更新(不成功抛异常)
* @param baseOrder
* @return
*/
public
BaseOrder
updateSelectiveByIdReT
(
BaseOrder
baseOrder
,
boolean
needVersion
)
{
if
(
needVersion
)
{
baseOrder
.
setVersion
(
selectById
(
baseOrder
.
getId
()).
getVersion
());
}
if
(
updateSelectiveByIdRe
(
baseOrder
)
>
0
)
{
return
selectById
(
baseOrder
.
getId
());
}
else
{
...
...
@@ -530,6 +542,19 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
}
}
// /**
// * 更新(不成功抛异常)
// * @param baseOrder
// * @return
// */
// public BaseOrder updateSelectiveByIdReT(BaseOrder baseOrder) {
// if(updateSelectiveByIdRe(baseOrder) > 0) {
// return selectById(baseOrder.getId());
// }else {
// throw new BaseException(ResultCode.DB_OPERATION_FAIL_CODE);
// }
// }
public
boolean
getTodyTime
(
Long
time
)
{
Long
startTime
=
getDayStart
();
if
(
time
>
startTime
&&
time
<
startTime
+
24
*
60
*
60
*
1000
-
1
)
{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderRefundBiz.java
View file @
2820495f
...
...
@@ -6,6 +6,7 @@ import com.xxfc.platform.order.entity.BaseOrder;
import
com.xxfc.platform.order.entity.OrderRentVehicleDetail
;
import
com.xxfc.platform.order.entity.OrderVehicleCrosstown
;
import
com.xxfc.platform.order.pojo.DedDetailDTO
;
import
com.xxfc.platform.order.pojo.mq.OrderMQDTO
;
import
com.xxfc.platform.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
...
...
@@ -15,8 +16,6 @@ import org.springframework.stereotype.Service;
import
com.xxfc.platform.order.entity.OrderRefund
;
import
com.xxfc.platform.order.mapper.OrderRefundMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
java.math.BigDecimal
;
import
java.util.List
;
...
...
@@ -45,39 +44,35 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper,OrderRefund> {
@Autowired
OrderVehicalCrosstownBiz
crosstownBiz
;
public
void
refundDeposit
(){
public
void
refundDeposit
(
OrderMQDTO
orderMQDTO
){
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
BigDecimal
illegalReserve
=
new
BigDecimal
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
ILLEGAL_RESERVE
).
getDetail
());
List
<
BaseOrder
>
lists
=
baseOrderBiz
.
selectByExample
(
new
Example
.
Builder
(
BaseOrder
.
class
)
//订单已完成的租车订单
.
where
(
WeekendSqls
.<
BaseOrder
>
custom
().
andEqualTo
(
BaseOrder:
:
getType
,
OrderTypeEnum
.
RENT_VEHICLE
)
.
andEqualTo
(
BaseOrder:
:
getStatus
,
OrderStatusEnum
.
ORDER_FINISH
)
// .andLike(BaseOrder::getId, "%"+ String.valueOf(i))
).
build
());
//处理自动退押金
for
(
BaseOrder
baseOrder
:
lists
)
{
OrderRentVehicleDetail
orvd
=
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
()
{{
setOrderId
(
baseOrder
.
getId
());
//未退还, 进行保留违章预备金 的退还
if
(
RefundStatusEnum
.
NONE
.
getCode
().
equals
(
orderMQDTO
.
getRefundStatus
()))
{
OrderVehicleCrosstown
crosstown
=
crosstownBiz
.
selectOne
(
new
OrderVehicleCrosstown
(){{
setOrderId
(
orderMQDTO
.
getId
());
setType
(
CrosstownTypeEnum
.
TOUR
.
getCode
());
}});
//未退还, 进行保留违章预备金 的退还
if
(
RefundStatusEnum
.
NONE
.
getCode
().
equals
(
baseOrder
.
getRefundStatus
()))
{
OrderVehicleCrosstown
crosstown
=
crosstownBiz
.
selectOne
(
new
OrderVehicleCrosstown
(){{
setOrderId
(
baseOrder
.
getId
());
setType
(
CrosstownTypeEnum
.
TOUR
.
getCode
());
}});
BigDecimal
refundAmont
=
crosstown
.
getRestDeposit
().
subtract
(
illegalReserve
);
List
<
DedDetailDTO
>
dddList
=
JSONUtil
.
toBean
(
crosstown
.
getDedDetail
(),
List
.
class
);
String
refundDesc
=
"退还押金:"
+
refundAmont
.
toString
()+
"(已扣除 违章预备金:"
+
illegalReserve
.
toString
();
for
(
DedDetailDTO
ddd
:
dddList
)
{
refundDesc
+=
", "
+
ddd
.
getDeductions
()+
":"
+
ddd
.
getCost
();
}
refundDesc
+=
")"
;
//退款子流程: 订单基础,退款描述,退款金额
baseOrderBiz
.
refundSubProcess
(
baseOrder
,
refundDesc
,
refundAmont
,
RefundTypeEnum
.
RentVehicle
.
getCode
(),
RefundStatusEnum
.
RESIDUE_ILLEGAL
.
getCode
());
//设置剩余
//还车扣除款 剩余的 钱,再减去违章预备金
BigDecimal
refundAmont
=
crosstown
.
getRestDeposit
().
subtract
(
illegalReserve
);
List
<
DedDetailDTO
>
dddList
=
JSONUtil
.
toBean
(
crosstown
.
getDedDetail
(),
List
.
class
);
String
refundDesc
=
"退还押金:"
+
refundAmont
.
toString
()+
"(已扣除 违章预备金:"
+
illegalReserve
.
toString
();
for
(
DedDetailDTO
ddd
:
dddList
)
{
refundDesc
+=
", "
+
ddd
.
getDeductions
()+
":"
+
ddd
.
getCost
();
}
refundDesc
+=
")"
;
refundTrigger
(
orderMQDTO
,
orderMQDTO
.
getOrderRentVehicleDetail
(),
illegalReserve
,
refundAmont
,
refundDesc
,
RefundStatusEnum
.
RESIDUE_ILLEGAL
.
getCode
());
}
}
public
void
refundTrigger
(
BaseOrder
baseOrder
,
OrderRentVehicleDetail
orvd
,
BigDecimal
residueAmount
,
BigDecimal
refundAmont
,
String
refundDesc
,
Integer
refundStatus
)
{
//退款子流程: 订单基础,退款描述,退款金额
baseOrderBiz
.
refundSubProcess
(
baseOrder
,
refundDesc
,
refundAmont
,
RefundTypeEnum
.
DEPOSIT
.
getCode
(),
refundStatus
);
//设置剩余没有返还的钱
orderRentVehicleBiz
.
updateSelectiveById
(
new
OrderRentVehicleDetail
(){{
setId
(
orvd
.
getId
());
setReturnPayResidue
(
residueAmount
);
}});
}
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicalCrosstownBiz.java
View file @
2820495f
...
...
@@ -2,8 +2,11 @@ package com.xxfc.platform.order.biz;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.activity.user.UserInfoBiz
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.entity.OrderRentVehicleDetail
;
import
com.xxfc.platform.order.entity.OrderUserLicense
;
...
...
@@ -30,9 +33,12 @@ public class OrderVehicalCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
@Autowired
OrderUserLicenseBiz
orderUserLicenseBiz
;
@Autowired
UserInfoBiz
userInfoBiz
;
@Autowired
VehicleFeign
vehicleFeign
;
@Autowired
UserFeign
userFeign
;
@Autowired
private
OrderRentVehicleBiz
orderRentVehicleBiz
;
...
...
@@ -43,21 +49,45 @@ public class OrderVehicalCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
return
selectById
(
id
);
}
public
List
<
OrderVehicleCrosstown
>
selectByOrderId
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
return
mapper
.
selectByOrderId
(
orderVehicleCrosstownDto
);
public
List
<
OrderVehicleCrosstownDto
>
selectByOrderId
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
List
<
OrderVehicleCrosstownDto
>
list
=
mapper
.
selectByOrderId
(
orderVehicleCrosstownDto
);
for
(
OrderVehicleCrosstownDto
value
:
list
)
{
if
(
value
.
getOrperaterId
()
!=
null
)
{
ObjectRestResponse
<
AppUserDTO
>
objectRestResponse
=
userFeign
.
userDetailById
(
value
.
getOrperaterId
());
if
(
objectRestResponse
.
getData
()
!=
null
)
{
value
.
setUsername
(
objectRestResponse
.
getData
().
getNickname
());
}
}
if
(
value
.
getUserLicenseId
()
!=
null
)
{
List
<
OrderUserLicense
>
orderUserLicenses
=
orderUserLicenseBiz
.
selectByIds
(
value
.
getUserLicenseId
()).
getData
();
if
(
orderUserLicenses
!=
null
&&
orderUserLicenses
.
size
()
>
0
)
{
value
.
setLicenseIdCard
(
orderUserLicenses
.
get
(
0
).
getLicenseIdCard
());
value
.
setLicenseImg
(
orderUserLicenses
.
get
(
0
).
getLicenseImg
());
value
.
setLicenseName
(
orderUserLicenses
.
get
(
0
).
getLicenseName
());
value
.
setLicensePhone
(
orderUserLicenses
.
get
(
0
).
getLicensePhone
());
}
}
}
return
list
;
}
public
ObjectRestResponse
<
OrderVehicleCrosstownDto
>
add
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
log
.
info
(
"添加的参数:orderVehicaleCrosstown = {}"
,
orderVehicleCrosstownDto
);
AppUserDTO
appUserDTO
=
userInfoBiz
.
getUserInfo
();
if
(
appUserDTO
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
508
,
"token is null or invalid"
);
}
if
(
orderVehicleCrosstownDto
==
null
||
orderVehicleCrosstownDto
.
getOrderId
()
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"参数为空!"
);
}
orderVehicleCrosstownDto
.
setOrperaterId
(
appUserDTO
.
getUserid
());
BaseOrder
baseOrder
=
baseOrderBiz
.
selectById
(
orderVehicleCrosstownDto
.
getOrderId
());
if
(
baseOrder
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"订单不存在!"
);
}
OrderRentVehicleDetail
orderRentVehicleDetail
=
orderRentVehicleBiz
.
selectById
(
baseOrder
.
getDetailId
());
List
<
OrderVehicleCrosstown
>
oldValue
=
orderVehicalCrosstownBiz
.
selectByOrderId
(
orderVehicleCrosstownDto
);
List
<
OrderVehicleCrosstown
Dto
>
oldValue
=
orderVehicalCrosstownBiz
.
selectByOrderId
(
orderVehicleCrosstownDto
);
if
(
oldValue
.
size
()
==
1
)
{
//已有直接返回
//交车完成 设置订单状态为出行中
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/jobhandler/RentDepositHandler.java
→
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/jobhandler/RentDeposit
Job
Handler.java
View file @
2820495f
...
...
@@ -2,13 +2,12 @@ package com.xxfc.platform.order.jobhandler;
import
cn.hutool.json.JSONUtil
;
import
com.github.wxiaoqi.security.common.util.IntervalUtil
;
import
com.xxfc.platform.order.biz.BaseOrderBiz
;
import
com.xxfc.platform.order.biz.OrderRentVehicleBiz
;
import
com.xxfc.platform.order.biz.OrderVehicalCrosstownBiz
;
import
com.xxfc.platform.order.biz.*
;
import
com.xxfc.platform.order.contant.enumerate.*
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.entity.OrderRentVehicleDetail
;
import
com.xxfc.platform.order.entity.OrderVehicleCrosstown
;
import
com.xxfc.platform.order.entity.OrderViolation
;
import
com.xxfc.platform.order.pojo.DedDetailDTO
;
import
com.xxfc.platform.universal.constant.DictionaryKey
;
import
com.xxfc.platform.universal.entity.Dictionary
;
...
...
@@ -27,6 +26,7 @@ import java.math.BigDecimal;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
/**
...
...
@@ -37,7 +37,7 @@ import static com.xxfc.platform.universal.constant.DictionaryKey.APP_ORDER;
@JobHandler
(
value
=
"rentDepositHandler"
)
@Component
@Slf4j
public
class
RentDepositHandler
extends
IJobHandler
{
public
class
RentDeposit
Job
Handler
extends
IJobHandler
{
@Autowired
BaseOrderBiz
baseOrderBiz
;
...
...
@@ -48,50 +48,51 @@ public class RentDepositHandler extends IJobHandler {
@Autowired
OrderVehicalCrosstownBiz
crosstownBiz
;
@Autowired
OrderViolationBiz
orderViolationBiz
;
@Autowired
OrderRefundBiz
orderRefundBiz
;
@Autowired
ThirdFeign
thirdFeign
;
@Override
public
ReturnT
<
String
>
execute
(
String
idLastNumInterval
)
throws
Exception
{
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
BigDecimal
illegalReserve
=
new
BigDecimal
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
ILLEGAL_RESERV
E
).
getDetail
());
Integer
rentDepositAutoRefundTime
=
new
Integer
(
dictionaryMap
.
get
(
APP_ORDER
+
"_"
+
DictionaryKey
.
RENT_DEPOSIT_AUTO_REFUND_TIM
E
).
getDetail
());
try
{
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
if
(
IntervalUtil
.
staticIsInTheInterval
(
String
.
valueOf
(
i
),
idLastNumInterval
))
{
//三十天
List
<
BaseOrder
>
lists
=
baseOrderBiz
.
selectByExample
(
new
Example
.
Builder
(
BaseOrder
.
class
)
//订单已完成的租车订单
.
where
(
WeekendSqls
.<
BaseOrder
>
custom
().
andEqualTo
(
BaseOrder:
:
getType
,
OrderTypeEnum
.
RENT_VEHICLE
)
.
andEqualTo
(
BaseOrder:
:
getStatus
,
OrderStatusEnum
.
ORDER_FINISH
)
.
andLike
(
BaseOrder:
:
getId
,
"%"
+
String
.
valueOf
(
i
))).
build
());
.
andEqualTo
(
BaseOrder:
:
getStatus
,
OrderStatusEnum
.
ORDER_FINISH
)
//已完成的订单
.
andEqualTo
(
BaseOrder:
:
getRefundStatus
,
RefundStatusEnum
.
RESIDUE_ILLEGAL
)
//已归还了部分押金
.
andLessThanOrEqualTo
(
BaseOrder:
:
getRefundTime
,
System
.
currentTimeMillis
()
-
(
rentDepositAutoRefundTime
*
60
*
60
*
1000
))
.
andLike
(
BaseOrder:
:
getId
,
"%"
+
i
)).
build
());
//处理自动退押金
//处理自动退
剩余
押金
for
(
BaseOrder
baseOrder
:
lists
)
{
OrderRentVehicleDetail
orvd
=
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
()
{{
setOrderId
(
baseOrder
.
getId
());
}});
//未退还, 进行保留违章预备金 的退还
if
(
RefundStatusEnum
.
NONE
.
getCode
().
equals
(
baseOrder
.
getRefundStatus
()))
{
OrderVehicleCrosstown
crosstown
=
crosstownBiz
.
selectOne
(
new
OrderVehicleCrosstown
(){{
setOrderId
(
baseOrder
.
getId
());
setType
(
CrosstownTypeEnum
.
TOUR
.
getCode
());
}});
BigDecimal
refundAmont
=
crosstown
.
getRestDeposit
().
subtract
(
illegalReserve
);
List
<
DedDetailDTO
>
dddList
=
JSONUtil
.
toBean
(
crosstown
.
getDedDetail
(),
List
.
class
);
String
refundDesc
=
"退还押金:"
+
refundAmont
.
toString
()+
"(已扣除 违章预备金:"
+
illegalReserve
.
toString
();
for
(
DedDetailDTO
ddd
:
dddList
)
{
refundDesc
+=
", "
+
ddd
.
getDeductions
()+
":"
+
ddd
.
getCost
();
}
refundDesc
+=
")"
;
//退款子流程: 订单基础,退款描述,退款金额
baseOrderBiz
.
refundSubProcess
(
baseOrder
,
refundDesc
,
refundAmont
,
RefundTypeEnum
.
RentVehicle
.
getCode
(),
RefundStatusEnum
.
RESIDUE_ILLEGAL
.
getCode
());
//设置剩余
}
else
if
(
RefundStatusEnum
.
RESIDUE_ILLEGAL
.
getCode
().
equals
(
baseOrder
.
getRefundStatus
())){
//判断是否违章
//扣违章的钱
//baseOrderBiz.refundSubProcess(baseOrder, refundDesc, refundAmont, RefundTypeEnum.RENT_VEHICLE.getCode(), RefundStatusEnum.RESIDUE_ILLEGAL.getCode());
}
// baseOrderBiz.refundSubProcess(baseOrder, refundDesc, refundAmont);
OrderViolation
orderViolation
=
orderViolationBiz
.
selectOne
(
new
OrderViolation
(){{
setDetailId
(
orvd
.
getId
());
setIsDel
(
SYS_FALSE
);
}});
//还车扣除款 剩余的 钱,再减去违章预备金
BigDecimal
refundAmont
=
orvd
.
getReturnPayResidue
().
subtract
(
orderViolation
.
getPrice
());
String
refundDesc
=
"退还押金:"
+
refundAmont
.
toString
()+
"(已扣除 违章扣款:"
+
refundAmont
.
toString
();
// for(DedDetailDTO ddd : dddList) {
// refundDesc += ", "+ ddd.getDeductions()+ ":"+ ddd.getCost();
// }
refundDesc
+=
")"
;
orderRefundBiz
.
refundTrigger
(
baseOrder
,
orvd
,
refundAmont
,
refundAmont
,
refundDesc
,
RefundStatusEnum
.
REFUND_DEPOSIT
.
getCode
());
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mapper/OrderVehicaleCrosstownMapper.java
View file @
2820495f
...
...
@@ -8,6 +8,6 @@ import java.util.List;
public
interface
OrderVehicaleCrosstownMapper
extends
Mapper
<
OrderVehicleCrosstown
>
{
List
<
OrderVehicleCrosstown
>
selectByOrderId
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
);
List
<
OrderVehicleCrosstown
Dto
>
selectByOrderId
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
);
}
\ No newline at end of file
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/mqhandler/RefundMQHandler.java
0 → 100644
View file @
2820495f
package
com
.
xxfc
.
platform
.
order
.
mqhandler
;
import
cn.hutool.json.JSONUtil
;
import
com.github.wxiaoqi.security.admin.dto.OrderGoodsDTO
;
import
com.github.wxiaoqi.security.admin.dto.OrderWaterDTO
;
import
com.rabbitmq.client.Channel
;
import
com.xxfc.platform.order.biz.OrderRefundBiz
;
import
com.xxfc.platform.order.contant.enumerate.OrderTypeEnum
;
import
com.xxfc.platform.order.pojo.mq.OrderMQDTO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.amqp.core.Message
;
import
org.springframework.amqp.rabbit.annotation.RabbitListener
;
import
org.springframework.amqp.support.AmqpHeaders
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.messaging.handler.annotation.Headers
;
import
org.springframework.stereotype.Component
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Map
;
import
java.util.concurrent.ExecutorService
;
import
java.util.concurrent.Executors
;
import
static
com
.
xxfc
.
platform
.
order
.
config
.
RabbitOrderConfig
.
ORDER_DEPOSIT_REFUND_QUEUE
;
import
static
com
.
xxfc
.
platform
.
order
.
pojo
.
mq
.
OrderMQDTO
.*;
@Component
@Slf4j
public
class
RefundMQHandler
{
@Autowired
OrderRefundBiz
orderRefundBiz
;
/**
* 佣金
* @param
*/
@RabbitListener
(
queues
=
ORDER_DEPOSIT_REFUND_QUEUE
)
public
void
integralHandler
(
Message
message
,
@Headers
Map
<
String
,
Object
>
headers
,
Channel
channel
)
{
ExecutorService
executorService
=
Executors
.
newCachedThreadPool
();
executorService
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
try
{
String
messageId
=
message
.
getMessageProperties
().
getMessageId
();
String
msg
=
new
String
(
message
.
getBody
(),
"UTF-8"
);
OrderMQDTO
orderMQDTO
=
JSONUtil
.
toBean
(
msg
,
OrderMQDTO
.
class
);
orderRefundBiz
.
refundDeposit
(
orderMQDTO
);
executorService
.
shutdown
();
Long
deliveryTag
=
(
Long
)
headers
.
get
(
AmqpHeaders
.
DELIVERY_TAG
);
// 手动签收
channel
.
basicAck
(
deliveryTag
,
false
);
}
catch
(
Exception
e
)
{
log
.
info
(
"接收到的消息失败"
);
try
{
channel
.
basicNack
(
message
.
getMessageProperties
().
getDeliveryTag
(),
false
,
false
);
}
catch
(
IOException
i
)
{
i
.
printStackTrace
();
}
e
.
printStackTrace
();
}
}
});
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BaseOrderController.java
View file @
2820495f
...
...
@@ -20,8 +20,11 @@ import com.github.wxiaoqi.security.common.util.process.ResultCode;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.order.biz.BaseOrderBiz
;
import
com.xxfc.platform.order.biz.OrderMemberDetailBiz
;
import
com.xxfc.platform.order.biz.OrderUserLicenseBiz
;
import
com.xxfc.platform.order.biz.OrderVehicalCrosstownBiz
;
import
com.xxfc.platform.order.contant.enumerate.OrderStatusEnum
;
import
com.xxfc.platform.order.entity.BaseOrder
;
import
com.xxfc.platform.order.entity.OrderUserLicense
;
import
com.xxfc.platform.order.mqhandler.RabbitProduct
;
import
com.xxfc.platform.order.pojo.order.*
;
import
com.xxfc.platform.order.pojo.pay.OrderPayDTO
;
...
...
@@ -73,6 +76,10 @@ public class BaseOrderController extends CommonBaseController implements UserRes
@Autowired
OrderMemberDetailBiz
orderMemberDetailBiz
;
@Autowired
OrderUserLicenseBiz
orderUserLicenseBiz
;
@Autowired
OrderVehicalCrosstownBiz
orderVehicalCrosstownBiz
;
@Override
public
UserFeign
getUserFeign
()
{
...
...
@@ -178,6 +185,19 @@ public class BaseOrderController extends CommonBaseController implements UserRes
if
(
restResponse
.
getData
()
!=
null
)
{
orderPageVO
.
setVehicleNumberPlat
(
restResponse
.
getData
().
getNumberPlate
());
}
if
(
StringUtils
.
isNotBlank
(
orderPageVO
.
getOrderRentVehicleDetail
().
getMyDriverIds
()))
{
List
<
OrderUserLicense
>
orderUserLicenses
=
orderUserLicenseBiz
.
selectByIds
(
orderPageVO
.
getOrderRentVehicleDetail
().
getMyDriverIds
()).
getData
();
if
(
orderUserLicenses
!=
null
&&
orderUserLicenses
.
size
()
>
0
)
{
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
=
new
OrderVehicleCrosstownDto
();
orderVehicleCrosstownDto
.
setLicenseIdCard
(
orderUserLicenses
.
get
(
0
).
getLicenseIdCard
());
orderVehicleCrosstownDto
.
setLicenseImg
(
orderUserLicenses
.
get
(
0
).
getLicenseImg
());
orderVehicleCrosstownDto
.
setLicenseName
(
orderUserLicenses
.
get
(
0
).
getLicenseName
());
orderVehicleCrosstownDto
.
setLicensePhone
(
orderUserLicenses
.
get
(
0
).
getLicensePhone
());
orderPageVO
.
setOrderVehicleCrosstownDto
(
orderVehicleCrosstownDto
);
}
}
}
if
(
orderPageVO
.
getOrderRentVehicleDetail
()
!=
null
&&
orderPageVO
.
getOrderRentVehicleDetail
().
getStartCompanyId
()!=
null
&&
orderPageVO
.
getOrderRentVehicleDetail
().
getEndCompanyId
()
!=
null
)
{
ObjectRestResponse
<
CompanyDetail
>
startResponse
=
vehicleFeign
.
getCompanyDetail
(
orderPageVO
.
getOrderRentVehicleDetail
().
getStartCompanyId
());
...
...
@@ -197,6 +217,8 @@ public class BaseOrderController extends CommonBaseController implements UserRes
orderPageVO
.
setStartCompanyName
(
startResponse
.
getData
().
getName
());
}
}
}
}
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderVehicleCrosstownController.java
View file @
2820495f
...
...
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.*;
import
java.util.List
;
@RestController
@RequestMapping
(
value
=
"
/
orderVehicle"
)
@RequestMapping
(
value
=
"orderVehicle"
)
@Api
(
value
=
"交还车记录"
,
tags
=
{
"交还车记录"
})
@Slf4j
public
class
OrderVehicleCrosstownController
{
...
...
@@ -34,6 +34,7 @@ public class OrderVehicleCrosstownController {
@ApiOperation
(
value
=
"添加交还车记录"
)
@Transactional
public
ObjectRestResponse
<
OrderVehicleCrosstownDto
>
add
(
@RequestBody
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
return
orderVehicalCrosstownBiz
.
add
(
orderVehicleCrosstownDto
);
}
...
...
@@ -45,7 +46,7 @@ public class OrderVehicleCrosstownController {
@GetMapping
(
value
=
"/getByOrderId"
)
@ApiOperation
(
value
=
"根据订单Id获取所有记录信息"
)
public
ObjectRestResponse
<
List
<
OrderVehicleCrosstown
>>
getByOrderId
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
public
ObjectRestResponse
<
List
<
OrderVehicleCrosstown
Dto
>>
getByOrderId
(
OrderVehicleCrosstownDto
orderVehicleCrosstownDto
)
{
if
(
orderVehicleCrosstownDto
==
null
)
{
return
ObjectRestResponse
.
createFailedResult
(
500
,
"参数orderId为空"
);
}
...
...
xx-order/xx-order-server/src/main/resources/mapper/OrderVehicaleCrosstownMapper.xml
View file @
2820495f
...
...
@@ -28,7 +28,7 @@
<result
column=
"user_license_id"
jdbcType=
"VARCHAR"
property=
"userLicenseId"
/>
</resultMap>
<select
id=
"selectByOrderId"
parameterType=
"com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto"
result
Map=
"BaseResultMap
"
>
<select
id=
"selectByOrderId"
parameterType=
"com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto"
result
Type=
"com.xxfc.platform.order.pojo.order.OrderVehicleCrosstownDto
"
>
select *
from order_vehicle_crosstown
<where>
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/constant/DictionaryKey.java
View file @
2820495f
...
...
@@ -42,4 +42,9 @@ public class DictionaryKey {
* 支付价格减低
*/
public
static
final
String
PAY_DEMOTION
=
"PAY_DEMOTION"
;
/**
* 自动退款保留押金的时间(小时)
*/
public
static
final
String
RENT_DEPOSIT_AUTO_REFUND_TIME
=
"RENT_DEPOSIT_AUTO_REFUND_TIME"
;
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehicleAndModelInfoVo.java
View file @
2820495f
...
...
@@ -11,4 +11,5 @@ import java.util.List;
public
class
VehicleAndModelInfoVo
extends
Vehicle
{
VehicleModel
vehicleModel
;
List
<
VehicleBookRecord
>
vehicleBookRecord
;
private
String
endCompanyName
;
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehicleWarningMsgQueryVo.java
View file @
2820495f
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
;
import
com.xxfc.platform.vehicle.entity.VehicleWarningRule
;
import
lombok.Data
;
import
java.util.Date
;
...
...
@@ -9,7 +10,7 @@ import java.util.Date;
*
*/
@Data
public
class
VehicleWarningMsgQueryVo
{
public
class
VehicleWarningMsgQueryVo
{
public
Integer
id
;
/**
...
...
@@ -66,4 +67,6 @@ public class VehicleWarningMsgQueryVo {
private
Date
createTime
;
private
Date
updateTime
;
VehicleWarningRule
vehicleWarningRule
;
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BranchCompanyBiz.java
View file @
2820495f
...
...
@@ -71,6 +71,13 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
return
mapper
.
selectByPrimaryKey
(
id
);
}
public
List
<
BranchCompany
>
selectByZoneId
(
Integer
zoneId
)
{
if
(
zoneId
==
null
)
{
return
null
;
}
return
mapper
.
selectByZoneId
(
zoneId
);
}
/**
* 获取公司信息
* @param id
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
2820495f
...
...
@@ -2,7 +2,6 @@ package com.xxfc.platform.vehicle.biz;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.ace.cache.annotation.Cache
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
...
...
@@ -317,6 +316,8 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
Map
<
String
,
List
<
String
>>
yearMonthAndDate
=
Maps
.
newHashMap
();
DateTime
startDay
=
DateTime
.
parse
(
bookVehicleVo
.
getBookStartDate
(),
DEFAULT_DATE_TIME_FORMATTER
);
DateTime
endDay
=
DateTime
.
parse
(
bookVehicleVo
.
getBookEndDate
(),
DEFAULT_DATE_TIME_FORMATTER
);
//转换日期范围为列表,并检查是否合法
fillDateList4DatePeriod
(
yearMonthAndDate
,
startDay
,
endDay
);
if
(
yearMonthAndDate
.
size
()>
3
){
//连续的日期最多夸3个月
...
...
@@ -1088,6 +1089,13 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> {
public
PageDataVO
<
VehicleAndModelInfoVo
>
getAllVehicle
(
VehiclePlanDto
vehiclePlanDto
)
{
Query
query
=
new
Query
(
vehiclePlanDto
);
PageDataVO
<
VehicleAndModelInfoVo
>
pageDataVO
=
PageDataVO
.
pageInfo
(
query
,
()
->
mapper
.
getAllVehicle
(
query
.
getSuper
()));
for
(
VehicleAndModelInfoVo
vehicleAndModelInfoVo
:
pageDataVO
.
getData
())
{
CompanyDetail
restResponse
=
branchCompanyBiz
.
getDetailById
(
vehicleAndModelInfoVo
.
getParkBranchCompanyId
());
if
(
restResponse
!=
null
)
{
vehicleAndModelInfoVo
.
setEndCompanyName
(
restResponse
.
getName
());
}
}
return
pageDataVO
;
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBookHourInfoBiz.java
View file @
2820495f
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.google.common.collect.Maps
;
...
...
@@ -72,7 +70,6 @@ public class VehicleBookHourInfoBiz extends BaseBiz<VehicleBookHourInfoMapper, V
}
}
return
predictableHours
;
}
// public static void main(String[] args) {
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleWarningMsgBiz.java
View file @
2820495f
...
...
@@ -14,6 +14,7 @@ import com.xxfc.platform.vehicle.entity.VehicleWarningRule;
import
com.xxfc.platform.vehicle.mapper.VehicleMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleWarningMsgMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleWarningRuleMapper
;
import
com.xxfc.platform.vehicle.pojo.VehicleWarningMsgQueryVo
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto
;
import
com.xxfc.platform.vehicle.util.JSUtil
;
import
com.xxfc.platform.vehicle.pojo.AddVehicleWarningMsgVo
;
...
...
@@ -213,8 +214,9 @@ public class VehicleWarningMsgBiz extends BaseBiz<VehicleWarningMsgMapper, Vehic
}
}
public
List
<
VehicleWarningMsg
>
getAllByParam
(
VehiclePlanDto
vehiclePlanDto
)
{
return
mapper
.
getAllByparam
(
vehiclePlanDto
);
public
List
<
VehicleWarningMsgQueryVo
>
getAllByParam
(
VehiclePlanDto
vehiclePlanDto
)
{
List
<
VehicleWarningMsgQueryVo
>
list
=
mapper
.
getAllByparam
(
vehiclePlanDto
);
return
list
;
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/BranchCompanyMapper.java
View file @
2820495f
...
...
@@ -8,4 +8,5 @@ import java.util.List;
public
interface
BranchCompanyMapper
extends
Mapper
<
BranchCompany
>
{
List
<
BranchCompany
>
search
(
@Param
(
"lon"
)
String
lon
,
@Param
(
"lat"
)
String
lat
,
@Param
(
"addrCity"
)
Integer
addrCity
);
List
<
BranchCompany
>
selectByZoneId
(
Integer
zoneId
);
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleWarningMsgMapper.java
View file @
2820495f
...
...
@@ -2,6 +2,7 @@ package com.xxfc.platform.vehicle.mapper;
import
com.xxfc.platform.vehicle.entity.VehicleWarningMsg
;
import
com.xxfc.platform.vehicle.pojo.QueryVehicleWarningMsgVo
;
import
com.xxfc.platform.vehicle.pojo.VehicleWarningMsgQueryVo
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto
;
import
tk.mybatis.mapper.common.Mapper
;
...
...
@@ -16,6 +17,6 @@ public interface VehicleWarningMsgMapper extends Mapper<VehicleWarningMsg> {
public
List
<
VehicleWarningMsg
>
getMsgByVehicle
(
String
vehicleId
);
public
List
<
VehicleWarningMsg
>
getAllByparam
(
VehiclePlanDto
vehiclePlanDto
);
public
List
<
VehicleWarningMsg
QueryVo
>
getAllByparam
(
VehiclePlanDto
vehiclePlanDto
);
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleWarningRuleMapper.java
View file @
2820495f
...
...
@@ -4,6 +4,5 @@ import com.xxfc.platform.vehicle.entity.VehicleWarningRule;
import
tk.mybatis.mapper.common.Mapper
;
public
interface
VehicleWarningRuleMapper
extends
Mapper
<
VehicleWarningRule
>
{
VehicleWarningRule
getOne
(
Integer
id
);
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/BranchCompanyController.java
View file @
2820495f
...
...
@@ -91,6 +91,11 @@ public class BranchCompanyController extends BaseController<BranchCompanyBiz> {
return
RestResponse
.
data
(
baseBiz
.
add
(
branchCompanyVo
));
}
@RequestMapping
(
value
=
"/app/unauth/getByZone"
,
method
=
RequestMethod
.
GET
)
public
RestResponse
getByZoneId
(
Integer
zoneId
)
{
return
RestResponse
.
suc
(
baseBiz
.
selectByZoneId
(
zoneId
));
}
@RequestMapping
(
value
=
"/upload/companyPic"
,
method
=
RequestMethod
.
POST
)
public
RestResponse
uploadCompanyPic
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
Exception
{
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleController.java
View file @
2820495f
...
...
@@ -26,7 +26,6 @@ import com.xxfc.platform.vehicle.constant.VehicleBookRecordStatus;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.VehicleBookInfo
;
import
com.xxfc.platform.vehicle.entity.VehicleBookRecord
;
import
com.xxfc.platform.vehicle.entity.VehicleWarningMsg
;
import
com.xxfc.platform.vehicle.pojo.*
;
import
com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto
;
import
io.swagger.annotations.Api
;
...
...
@@ -425,7 +424,7 @@ public class VehicleController extends BaseController<VehicleBiz> {
//获取统计信息
List
<
VehicleCountVo
>
vehicleCountVos
=
baseBiz
.
countVehicleByParam
(
vehiclePlanDto
);
//获取警告信息
List
<
VehicleWarningMsg
>
vehicleWarningMsgs
=
vehicleWarningMsgBiz
.
getAllByParam
(
vehiclePlanDto
);
List
<
VehicleWarningMsg
QueryVo
>
vehicleWarningMsgs
=
vehicleWarningMsgBiz
.
getAllByParam
(
vehiclePlanDto
);
//获取列表
PageDataVO
<
VehicleAndModelInfoVo
>
pageDataVO
=
baseBiz
.
getAllVehicle
(
vehiclePlanDto
);
Map
<
String
,
Object
>
map
=
Maps
.
newHashMap
();
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/BranchCompanyMapper.xml
View file @
2820495f
...
...
@@ -39,4 +39,8 @@
order by distance asc
</if>
</select>
<select
id=
"selectByZoneId"
parameterType=
"java.lang.Integer"
resultType=
"com.xxfc.platform.vehicle.entity.BranchCompany"
>
select * from branch_company
where zone_id = #{zoneId}
</select>
</mapper>
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleWarningMsgMapper.xml
View file @
2820495f
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.xxfc.platform.vehicle.mapper.VehicleWarningMsgMapper"
>
<resultMap
type=
"com.xxfc.platform.vehicle.pojo.VehicleWarningMsgQueryVo"
id=
"vehicleListMap"
>
<result
javaType=
"Integer"
column=
"id"
property=
"id"
></result>
<association
column=
"rule_id"
property=
"vehicleWarningRule"
select=
"com.xxfc.platform.vehicle.mapper.VehicleWarningRuleMapper.selectByPrimaryKey"
javaType=
"com.xxfc.platform.vehicle.entity.VehicleWarningRule"
></association>
</resultMap>
<select
id=
"getByPage"
resultType=
"com.xxfc.platform.vehicle.pojo.VehicleWarningMsgQueryVo"
parameterType=
"com.xxfc.platform.vehicle.pojo.QueryVehicleWarningMsgVo"
>
select
...
...
@@ -25,7 +32,7 @@
where vehicle_id = #{_parameter}
</select>
<select
id=
"getAllByparam"
parameterType=
"com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto"
result
Type=
"com.xxfc.platform.vehicle.entity.VehicleWarningMsg
"
>
<select
id=
"getAllByparam"
parameterType=
"com.xxfc.platform.vehicle.pojo.dto.VehiclePlanDto"
result
Map=
"vehicleListMap
"
>
select w.*
from vehicle_warning_msg w
left join vehicle v on w.vehicle_id = v.id
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleWarningRuleMapper.xml
View file @
2820495f
...
...
@@ -5,6 +5,8 @@
<select
id=
"getByPage"
parameterType=
"com.xxfc.platform.vehicle.pojo.QueryVehicleWarningMsgVo"
resultType=
"com.xxfc.platform.vehicle.entity.VehicleWarningMsg"
>
</select>
<select
id=
"getOne"
resultType=
"com.xxfc.platform.vehicle.entity.VehicleWarningRule"
parameterType=
"java.lang.Integer"
>
select * from vehicle_warning_rule where id = #{id}
</select>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment