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
5798c2e5
Commit
5798c2e5
authored
Oct 16, 2019
by
jiaorz
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-count-vehicle' into base-modify
parents
93fee4b9
0ce4c2a1
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
152 additions
and
10 deletions
+152
-10
OrderViolateEnum.java
...fc/platform/order/contant/enumerate/OrderViolateEnum.java
+1
-0
DedDetailDTO.java
.../main/java/com/xxfc/platform/order/pojo/DedDetailDTO.java
+1
-1
OrderPageVO.java
.../java/com/xxfc/platform/order/pojo/order/OrderPageVO.java
+4
-0
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+53
-1
OrderVehicleCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
+10
-8
DictionaryKey.java
...a/com/xxfc/platform/universal/constant/DictionaryKey.java
+11
-0
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+3
-0
DistanceUtil.java
...ain/java/com/xxfc/platform/vehicle/util/DistanceUtil.java
+51
-0
BookRecordUpdateLogBiz.java
...com/xxfc/platform/vehicle/biz/BookRecordUpdateLogBiz.java
+10
-0
BookRecordUpdateLogController.java
.../platform/vehicle/rest/BookRecordUpdateLogController.java
+8
-0
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/contant/enumerate/OrderViolateEnum.java
View file @
5798c2e5
...
@@ -7,6 +7,7 @@ import java.util.Map;
...
@@ -7,6 +7,7 @@ import java.util.Map;
public
enum
OrderViolateEnum
{
public
enum
OrderViolateEnum
{
BEFORE
(
1
,
"提前"
),
BEFORE
(
1
,
"提前"
),
AFTER
(
2
,
"延期"
),
AFTER
(
2
,
"延期"
),
CHANGE
(
3
,
"更换还车公司"
),
;
;
/**
/**
* 编码
* 编码
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/DedDetailDTO.java
View file @
5798c2e5
...
@@ -32,7 +32,7 @@ public class DedDetailDTO {
...
@@ -32,7 +32,7 @@ public class DedDetailDTO {
//作为:DedDetail :2、车辆损坏 3、其他
//作为:DedDetail :2、车辆损坏 3、其他
//作为:violate_amount_detail 1--提前还车 2--延期还车 3--
消费超额
//作为:violate_amount_detail 1--提前还车 2--延期还车 3--
更换还车公司费用
Integer
type
;
Integer
type
;
//小雨都不知道什么东西
//小雨都不知道什么东西
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/OrderPageVO.java
View file @
5798c2e5
...
@@ -2,6 +2,7 @@ package com.xxfc.platform.order.pojo.order;
...
@@ -2,6 +2,7 @@ package com.xxfc.platform.order.pojo.order;
import
com.xxfc.platform.order.entity.*
;
import
com.xxfc.platform.order.entity.*
;
import
com.xxfc.platform.order.pojo.DedDetailDTO
;
import
com.xxfc.platform.order.pojo.DedDetailDTO
;
import
com.xxfc.platform.vehicle.entity.BookRecordUpdateLog
;
import
com.xxfc.platform.vehicle.entity.VehicleUserLicense
;
import
com.xxfc.platform.vehicle.entity.VehicleUserLicense
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -21,6 +22,9 @@ public class OrderPageVO extends BaseOrder {
...
@@ -21,6 +22,9 @@ public class OrderPageVO extends BaseOrder {
List
<
VehicleUserLicense
>
vehicleUserLicenses
;
List
<
VehicleUserLicense
>
vehicleUserLicenses
;
//更换还车公司记录
List
<
BookRecordUpdateLog
>
bookRecordUpdateLogs
;
/**
/**
* 用户名
* 用户名
*/
*/
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
5798c2e5
...
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.bean.BeanUtil;
import
cn.hutool.core.bean.copier.CopyOptions
;
import
cn.hutool.core.bean.copier.CopyOptions
;
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.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
...
@@ -48,6 +49,7 @@ import com.xxfc.platform.vehicle.entity.Vehicle;
...
@@ -48,6 +49,7 @@ import com.xxfc.platform.vehicle.entity.Vehicle;
import
com.xxfc.platform.vehicle.entity.VehicleUserLicense
;
import
com.xxfc.platform.vehicle.entity.VehicleUserLicense
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
com.xxfc.platform.vehicle.pojo.CompanyDetail
;
import
com.xxfc.platform.vehicle.util.DistanceUtil
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -59,6 +61,7 @@ import org.springframework.stereotype.Service;
...
@@ -59,6 +61,7 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.awt.geom.Point2D
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -66,6 +69,7 @@ import java.util.stream.Collectors;
...
@@ -66,6 +69,7 @@ import java.util.stream.Collectors;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
config
.
rabbit
.
RabbitConstant
.*;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
config
.
rabbit
.
RabbitConstant
.*;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.*;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.*;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
APP_ORDER
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
ILLEGAL_TYPE
;
/**
/**
* @author zjw
* @author zjw
...
@@ -315,8 +319,53 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
...
@@ -315,8 +319,53 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
initDedDetail
(
dedDetailDTO
,
OrderViolateEnum
.
AFTER
.
getCode
(),
cost
,
stringBuilder
);
initDedDetail
(
dedDetailDTO
,
OrderViolateEnum
.
AFTER
.
getCode
(),
cost
,
stringBuilder
);
}
}
}
}
orderPageVO
.
setDedDetailDTO
(
JSONObject
.
toJSONString
(
dedDetailDTO
));
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
dedDetailDTO
);
DedDetailDTO
dedDetailDTO1
=
new
DedDetailDTO
();
//添加更改还车公司计算费用
if
(
orderPageVO
.
getOrderRentVehicleDetail
()
!=
null
&&
orderPageVO
.
getOrderRentVehicleDetail
().
getBookRecordId
()
!=
null
)
{
//查询是否有更换还车记录
List
<
BookRecordUpdateLog
>
bookRecordUpdateLogs
=
vehicleFeign
.
get
(
orderPageVO
.
getOrderRentVehicleDetail
().
getBookRecordId
()).
getData
();
if
(
bookRecordUpdateLogs
!=
null
&&
bookRecordUpdateLogs
.
size
()
>
0
)
{
orderPageVO
.
setBookRecordUpdateLogs
(
bookRecordUpdateLogs
);
//有更换记录,则需要计算更换费用
//原始公司经纬度,列表中最后一个 bookRecordUpdateLogs.get(bookRecordUpdateLogs.size -1 ) 最后还车公司是列表中的第一条中的getNewRetCompanyId
BookRecordUpdateLog
oldCompany
=
bookRecordUpdateLogs
.
get
(
bookRecordUpdateLogs
.
size
()
-
1
);
BookRecordUpdateLog
newCompany
=
bookRecordUpdateLogs
.
get
(
0
);
if
(
oldCompany
!=
null
&&
newCompany
!=
null
)
{
CompanyDetail
oldCompanyDetail
=
vehicleFeign
.
getCompanyDetail
(
oldCompany
.
getOldRetCompanyId
()).
getData
();
CompanyDetail
newCompanyDetail
=
vehicleFeign
.
getCompanyDetail
(
newCompany
.
getNewRetCompanyId
()).
getData
();
if
(
oldCompanyDetail
.
getLatitude
()
!=
null
&&
oldCompanyDetail
.
getLongitude
()
!=
null
&&
newCompanyDetail
.
getLongitude
()
!=
null
&&
newCompanyDetail
.
getLatitude
()
!=
null
)
{
//根据经纬度获取两个公司的距离
double
distance
=
DistanceUtil
.
getDistance
(
oldCompanyDetail
.
getLongitude
().
doubleValue
(),
oldCompanyDetail
.
getLatitude
().
doubleValue
(),
newCompanyDetail
.
getLongitude
().
doubleValue
(),
newCompanyDetail
.
getLatitude
().
doubleValue
());
log
.
info
(
"两个公司的距离为(米): {}"
,
distance
);
BigDecimal
distanceNum
=
new
BigDecimal
(
distance
+
""
).
divide
(
new
BigDecimal
(
"1000"
),
0
,
BigDecimal
.
ROUND_UP
);
//取出费用计算的单价
Map
<
String
,
Dictionary
>
dictionaryMap
=
thirdFeign
.
dictionaryGetAll4Map
().
getData
();
BigDecimal
illegalReserve
=
new
BigDecimal
(
dictionaryMap
.
get
(
ILLEGAL_TYPE
+
"_"
+
DictionaryKey
.
ILLEGAL_FEE_PRICE
).
getDetail
());
BigDecimal
totalCost
=
distanceNum
.
multiply
(
illegalReserve
);
log
.
info
(
"更换两个公司的总费用为: {}"
,
totalCost
);
StringBuilder
stringBuilder
=
new
StringBuilder
();
stringBuilder
.
append
(
illegalReserve
);
stringBuilder
.
append
(
" x "
);
stringBuilder
.
append
(
distanceNum
);
stringBuilder
.
append
(
"(KM)"
);
stringBuilder
.
append
(
" = "
);
stringBuilder
.
append
(
totalCost
);
stringBuilder
.
append
(
"元"
);
dedDetailDTO1
.
setCost
(
totalCost
);
initDedDetail
(
dedDetailDTO1
,
OrderViolateEnum
.
CHANGE
.
getCode
(),
totalCost
,
stringBuilder
);
}
}
}
}
jsonArray
.
add
(
dedDetailDTO1
);
orderPageVO
.
setDedDetailDTO
(
jsonArray
.
toJSONString
());
}
}
public
void
initDedDetail
(
DedDetailDTO
dedDetailDTO
,
Integer
type
,
BigDecimal
cost
,
StringBuilder
stringBuilder
)
{
public
void
initDedDetail
(
DedDetailDTO
dedDetailDTO
,
Integer
type
,
BigDecimal
cost
,
StringBuilder
stringBuilder
)
{
String
detailName
=
null
;
String
detailName
=
null
;
if
(
type
==
OrderViolateEnum
.
BEFORE
.
getCode
())
{
if
(
type
==
OrderViolateEnum
.
BEFORE
.
getCode
())
{
...
@@ -325,6 +374,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
...
@@ -325,6 +374,9 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> implements
}
else
if
(
type
==
OrderViolateEnum
.
AFTER
.
getCode
())
{
}
else
if
(
type
==
OrderViolateEnum
.
AFTER
.
getCode
())
{
dedDetailDTO
.
setType
(
OrderViolateEnum
.
AFTER
.
getCode
());
dedDetailDTO
.
setType
(
OrderViolateEnum
.
AFTER
.
getCode
());
detailName
=
"延期还车违约金"
;
detailName
=
"延期还车违约金"
;
}
else
if
(
type
==
OrderViolateEnum
.
CHANGE
.
getCode
())
{
dedDetailDTO
.
setType
(
OrderViolateEnum
.
CHANGE
.
getCode
());
detailName
=
"更换还车公司"
;
}
}
//900元+违约金(¥900x2天=)1800元
//900元+违约金(¥900x2天=)1800元
dedDetailDTO
.
setDeductions
(
stringBuilder
.
toString
());
dedDetailDTO
.
setDeductions
(
stringBuilder
.
toString
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
View file @
5798c2e5
...
@@ -35,7 +35,6 @@ import com.xxfc.platform.vehicle.pojo.VehicleDepartureVo;
...
@@ -35,7 +35,6 @@ import com.xxfc.platform.vehicle.pojo.VehicleDepartureVo;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.map.HashedMap
;
import
org.apache.commons.collections4.map.HashedMap
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.joda.time.DateTime
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormat
;
import
org.joda.time.format.DateTimeFormatter
;
import
org.joda.time.format.DateTimeFormatter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -264,13 +263,16 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
...
@@ -264,13 +263,16 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
}
}
//延期扣除费用
//延期扣除费用
if
(
StringUtils
.
isNotBlank
(
orderVehicleCrosstownDto
.
getViolateDetail
()))
{
if
(
StringUtils
.
isNotBlank
(
orderVehicleCrosstownDto
.
getViolateDetail
()))
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
orderVehicleCrosstownDto
.
getViolateDetail
());
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
orderVehicleCrosstownDto
.
getViolateDetail
());
if
(
jsonObject
!=
null
)
{
if
(
jsonArray
!=
null
&&
jsonArray
.
size
()
>
0
)
{
if
(
jsonObject
.
getString
(
"cost"
)
!=
null
)
{
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
cost
+=
Double
.
parseDouble
(
jsonObject
.
getString
(
"cost"
));
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jsonArray
.
get
(
i
).
toString
());
}
if
(
jsonObject
.
getString
(
"cost"
)
!=
null
)
{
if
(
jsonObject
.
getString
(
"excessCost"
)
!=
null
)
{
cost
+=
Double
.
parseDouble
(
jsonObject
.
getString
(
"cost"
));
cost
+=
Double
.
parseDouble
(
jsonObject
.
getString
(
"excessCost"
));
}
if
(
jsonObject
.
getString
(
"excessCost"
)
!=
null
)
{
cost
+=
Double
.
parseDouble
(
jsonObject
.
getString
(
"excessCost"
));
}
}
}
}
}
}
}
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/constant/DictionaryKey.java
View file @
5798c2e5
...
@@ -7,6 +7,17 @@ public class DictionaryKey {
...
@@ -7,6 +7,17 @@ public class DictionaryKey {
*/
*/
public
static
final
String
APP_ORDER
=
"APP_ORDER"
;
public
static
final
String
APP_ORDER
=
"APP_ORDER"
;
/**
* 违约类型
*/
public
static
final
String
ILLEGAL_TYPE
=
"ILLEGAL_TYPE"
;
/**
* 更换还车公司费用计算单价
*/
public
static
final
String
ILLEGAL_FEE_PRICE
=
"ILLEGAL_FEE_PRICE"
;
/**
/**
* IM类型
* IM类型
*/
*/
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
5798c2e5
...
@@ -168,4 +168,7 @@ public interface VehicleFeign {
...
@@ -168,4 +168,7 @@ public interface VehicleFeign {
@RequestMapping
(
value
=
"/vehicleInfo/bookRecord/update"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/vehicleInfo/bookRecord/update"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
update
(
@RequestBody
BookRecordUpdateLog
bookRecordUpdateLog
);
public
ObjectRestResponse
update
(
@RequestBody
BookRecordUpdateLog
bookRecordUpdateLog
);
@GetMapping
(
value
=
"/bookRecord/get"
)
public
ObjectRestResponse
<
List
<
BookRecordUpdateLog
>>
get
(
@RequestParam
(
value
=
"bookRecordId"
)
Long
bookRecordId
);
}
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/util/DistanceUtil.java
0 → 100644
View file @
5798c2e5
package
com
.
xxfc
.
platform
.
vehicle
.
util
;
import
java.awt.geom.Point2D
;
import
java.math.BigDecimal
;
public
class
DistanceUtil
{
private
static
final
double
EARTH_RADIUS
=
6371393
;
// 平均半径,单位:m
/**
* 通过AB点经纬度获取距离
* @param pointA A点(经,纬)
* @param pointB B点(经,纬)
* @return 距离(单位:米)
*/
public
static
double
getDistance
(
Point2D
pointA
,
Point2D
pointB
)
{
// 经纬度(角度)转弧度。弧度用作参数,以调用Math.cos和Math.sin
double
radiansAX
=
Math
.
toRadians
(
pointA
.
getX
());
// A经弧度
double
radiansAY
=
Math
.
toRadians
(
pointA
.
getY
());
// A纬弧度
double
radiansBX
=
Math
.
toRadians
(
pointB
.
getX
());
// B经弧度
double
radiansBY
=
Math
.
toRadians
(
pointB
.
getY
());
// B纬弧度
// 公式中“cosβ1cosβ2cos(α1-α2)+sinβ1sinβ2”的部分,得到∠AOB的cos值
double
cos
=
Math
.
cos
(
radiansAY
)
*
Math
.
cos
(
radiansBY
)
*
Math
.
cos
(
radiansAX
-
radiansBX
)
+
Math
.
sin
(
radiansAY
)
*
Math
.
sin
(
radiansBY
);
// System.out.println("cos = " + cos); // 值域[-1,1]
double
acos
=
Math
.
acos
(
cos
);
// 反余弦值
// System.out.println("acos = " + acos); // 值域[0,π]
// System.out.println("∠AOB = " + Math.toDegrees(acos)); // 球心角 值域[0,180]
return
EARTH_RADIUS
*
acos
;
// 最终结果
}
public
static
double
getDistance
(
double
longitude1
,
double
latitude1
,
double
longitude2
,
double
latitude2
)
{
Point2D
pointDD
=
new
Point2D
.
Double
(
longitude1
,
latitude1
);
// 北京 西单地铁站
Point2D
pointXD
=
new
Point2D
.
Double
(
longitude2
,
latitude2
);
return
getDistance
(
pointDD
,
pointXD
);
}
public
static
void
main
(
String
[]
args
)
{
// 北京 东单地铁站
Point2D
pointDD
=
new
Point2D
.
Double
(
113.906121
,
22.985271
);
// 北京 西单地铁站
Point2D
pointXD
=
new
Point2D
.
Double
(
114.42078
,
23.05989
);
System
.
out
.
println
(
getDistance
(
pointDD
,
pointXD
));
BigDecimal
distanceNum
=
new
BigDecimal
(
getDistance
(
pointDD
,
pointXD
)
+
""
).
divide
(
new
BigDecimal
(
"1000"
),
0
,
BigDecimal
.
ROUND_UP
);
BigDecimal
bigDecimal
=
new
BigDecimal
(
2
);
System
.
out
.
println
(
distanceNum
.
multiply
(
bigDecimal
));
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/BookRecordUpdateLogBiz.java
View file @
5798c2e5
...
@@ -5,6 +5,9 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
...
@@ -5,6 +5,9 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import
com.xxfc.platform.vehicle.entity.BookRecordUpdateLog
;
import
com.xxfc.platform.vehicle.entity.BookRecordUpdateLog
;
import
com.xxfc.platform.vehicle.mapper.BookRecordUpdateLogMapper
;
import
com.xxfc.platform.vehicle.mapper.BookRecordUpdateLogMapper
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.List
;
@Service
@Service
public
class
BookRecordUpdateLogBiz
extends
BaseBiz
<
BookRecordUpdateLogMapper
,
BookRecordUpdateLog
>
{
public
class
BookRecordUpdateLogBiz
extends
BaseBiz
<
BookRecordUpdateLogMapper
,
BookRecordUpdateLog
>
{
...
@@ -18,4 +21,11 @@ public class BookRecordUpdateLogBiz extends BaseBiz<BookRecordUpdateLogMapper, B
...
@@ -18,4 +21,11 @@ public class BookRecordUpdateLogBiz extends BaseBiz<BookRecordUpdateLogMapper, B
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
public
ObjectRestResponse
<
List
<
BookRecordUpdateLog
>>
selectByBookRecordId
(
Long
bookRecordId
)
{
Example
example
=
new
Example
(
BookRecordUpdateLog
.
class
);
example
.
createCriteria
().
andEqualTo
(
"bookRecordId"
,
bookRecordId
);
example
.
setOrderByClause
(
"create_time desc"
);
return
ObjectRestResponse
.
succ
(
selectByExample
(
example
));
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/BookRecordUpdateLogController.java
View file @
5798c2e5
...
@@ -6,6 +6,8 @@ import com.xxfc.platform.vehicle.entity.BookRecordUpdateLog;
...
@@ -6,6 +6,8 @@ import com.xxfc.platform.vehicle.entity.BookRecordUpdateLog;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@RestController
@RestController
@RequestMapping
(
"/bookRecord"
)
@RequestMapping
(
"/bookRecord"
)
public
class
BookRecordUpdateLogController
{
public
class
BookRecordUpdateLogController
{
...
@@ -17,4 +19,10 @@ public class BookRecordUpdateLogController {
...
@@ -17,4 +19,10 @@ public class BookRecordUpdateLogController {
public
ObjectRestResponse
save
(
@RequestBody
BookRecordUpdateLog
bookRecordUpdateLog
)
{
public
ObjectRestResponse
save
(
@RequestBody
BookRecordUpdateLog
bookRecordUpdateLog
)
{
return
bookRecordUpdateLogBiz
.
save
(
bookRecordUpdateLog
);
return
bookRecordUpdateLogBiz
.
save
(
bookRecordUpdateLog
);
}
}
@GetMapping
(
value
=
"/get"
)
public
ObjectRestResponse
<
List
<
BookRecordUpdateLog
>>
get
(
Long
bookRecordId
)
{
return
bookRecordUpdateLogBiz
.
selectByBookRecordId
(
bookRecordId
);
}
}
}
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