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
3ea1b53c
Commit
3ea1b53c
authored
Oct 28, 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
f4f482f0
cd38a860
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
82 additions
and
26 deletions
+82
-26
BaseBiz.java
.../java/com/github/wxiaoqi/security/common/biz/BaseBiz.java
+24
-2
BaseController.java
...m/github/wxiaoqi/security/common/rest/BaseController.java
+2
-2
ShuntApply.java
.../main/java/com/xxfc/platform/order/entity/ShuntApply.java
+4
-0
ShuntApplyController.java
...va/com/xxfc/platform/order/rest/ShuntApplyController.java
+4
-2
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+3
-3
Vehicle.java
...c/main/java/com/xxfc/platform/vehicle/entity/Vehicle.java
+3
-0
RentVehicleController.java
...com/xxfc/platform/vehicle/rest/RentVehicleController.java
+42
-17
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/biz/BaseBiz.java
View file @
3ea1b53c
package
com
.
github
.
wxiaoqi
.
security
.
common
.
biz
;
package
com
.
github
.
wxiaoqi
.
security
.
common
.
biz
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
...
@@ -235,18 +237,38 @@ public abstract class BaseBiz<M extends Mapper<T>, T> {
...
@@ -235,18 +237,38 @@ public abstract class BaseBiz<M extends Mapper<T>, T> {
return
new
TableResultResponse
<
T
>(
result
.
getTotal
(),
list
);
return
new
TableResultResponse
<
T
>(
result
.
getTotal
(),
list
);
}
}
public
ObjectRestResponse
selectAll
(){
public
ObjectRestResponse
selectAll
(
T
entity
){
List
<
T
>
list
=
selectListAlls
();
List
<
T
>
list
=
selectListAlls
(
entity
);
return
ObjectRestResponse
.
succ
(
list
);
return
ObjectRestResponse
.
succ
(
list
);
}
}
public
List
<
T
>
selectListAlls
(){
public
List
<
T
>
selectListAlls
(){
return
selectListAlls
(
null
);
}
public
List
<
T
>
selectListAlls
(
T
entity
){
Class
<
T
>
clazz
=
(
Class
<
T
>)
((
ParameterizedType
)
getClass
().
getGenericSuperclass
()).
getActualTypeArguments
()[
1
];
Class
<
T
>
clazz
=
(
Class
<
T
>)
((
ParameterizedType
)
getClass
().
getGenericSuperclass
()).
getActualTypeArguments
()[
1
];
Example
example
=
new
Example
(
clazz
);
Example
example
=
new
Example
(
clazz
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
Example
.
Criteria
criteria
=
example
.
createCriteria
();
if
(
null
!=
entity
)
{
Map
<
String
,
Object
>
map
=
BeanUtil
.
beanToMap
(
entity
);
if
(
map
.
entrySet
().
size
()>
0
)
{
if
(
criteria
==
null
){
criteria
=
example
.
createCriteria
();
}
for
(
Map
.
Entry
<
String
,
Object
>
entry
:
map
.
entrySet
())
{
if
(
null
!=
entry
.
getValue
())
{
criteria
.
andLike
(
entry
.
getKey
(),
"%"
+
entry
.
getValue
().
toString
()
+
"%"
);
}
}
}
}
if
(
checkFieldName
(
clazz
,
"isDel"
)){
if
(
checkFieldName
(
clazz
,
"isDel"
)){
criteria
.
andEqualTo
(
"isDel"
,
0
);
criteria
.
andEqualTo
(
"isDel"
,
0
);
}
}
if
(
checkFieldName
(
clazz
,
"sortOrder"
)){
if
(
checkFieldName
(
clazz
,
"sortOrder"
)){
example
.
setOrderByClause
(
"sort_order desc"
);
example
.
setOrderByClause
(
"sort_order desc"
);
}
else
if
(
checkFieldName
(
clazz
,
"rank"
)){
}
else
if
(
checkFieldName
(
clazz
,
"rank"
)){
...
...
ace-common/src/main/java/com/github/wxiaoqi/security/common/rest/BaseController.java
View file @
3ea1b53c
...
@@ -116,8 +116,8 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
...
@@ -116,8 +116,8 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
@ApiOperation
(
"查询所有"
)
@ApiOperation
(
"查询所有"
)
@RequestMapping
(
value
=
"/alls"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/alls"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
ObjectRestResponse
alls
(){
public
ObjectRestResponse
alls
(
Entity
entity
){
return
baseBiz
.
selectAll
(
);
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectListAlls
(
entity
)
);
}
}
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/ShuntApply.java
View file @
3ea1b53c
...
@@ -212,4 +212,8 @@ public class ShuntApply implements Serializable {
...
@@ -212,4 +212,8 @@ public class ShuntApply implements Serializable {
@Column
(
name
=
"category_id"
)
@Column
(
name
=
"category_id"
)
@ApiModelProperty
(
"型号id"
)
@ApiModelProperty
(
"型号id"
)
private
Integer
categoryId
;
private
Integer
categoryId
;
@Column
(
name
=
"goods_type"
)
@ApiModelProperty
(
"商品类型 1--房车;2--机车;3--游艇"
)
private
Integer
goodsType
;
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/ShuntApplyController.java
View file @
3ea1b53c
...
@@ -251,7 +251,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
...
@@ -251,7 +251,7 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
detail
.
setStartTime
(
shuntApply
.
getStartTime
());
detail
.
setStartTime
(
shuntApply
.
getStartTime
());
detail
.
setEndTime
(
shuntApply
.
getEndTime
());
detail
.
setEndTime
(
shuntApply
.
getEndTime
());
detail
.
setVehicleId
(
dto
.
getVehicleId
());
detail
.
setVehicleId
(
dto
.
getVehicleId
());
detail
.
setModelId
(
shuntApply
.
getModelId
());
//
detail.setModelId(shuntApply.getModelId());
detail
.
setStartAddr
(
shuntApply
.
getStartCompanyName
());
detail
.
setStartAddr
(
shuntApply
.
getStartCompanyName
());
detail
.
setStartCompanyId
(
shuntApply
.
getStartCompanyId
());
detail
.
setStartCompanyId
(
shuntApply
.
getStartCompanyId
());
detail
.
setEndCompanyId
(
shuntApply
.
getEndCompanyId
());
detail
.
setEndCompanyId
(
shuntApply
.
getEndCompanyId
());
...
@@ -292,7 +292,9 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
...
@@ -292,7 +292,9 @@ public class ShuntApplyController extends BaseController<ShuntApplyBiz, ShuntApp
StewardShuntApply
shuntApplyVO
=
BeanUtil
.
toBean
(
shuntApply
,
StewardShuntApply
.
class
);
StewardShuntApply
shuntApplyVO
=
BeanUtil
.
toBean
(
shuntApply
,
StewardShuntApply
.
class
);
shuntApplyVO
.
setVehicleCategory
(
vehicleFeign
.
getVehicleCategory
(
shuntApply
.
getCategoryId
()).
getData
());
shuntApplyVO
.
setVehicleCategory
(
vehicleFeign
.
getVehicleCategory
(
shuntApply
.
getCategoryId
()).
getData
());
RentVehicleBookDTO
rbd
=
new
RentVehicleBookDTO
();
RentVehicleBookDTO
rbd
=
new
RentVehicleBookDTO
();
rbd
.
setModelId
(
shuntApply
.
getModelId
());
//rbd.setModelId(shuntApply.getModelId());
rbd
.
setBrandId
(
shuntApply
.
getBrandId
());
rbd
.
setCategoryId
(
shuntApply
.
getCategoryId
());
rbd
.
setParkBranchCompanyId
(
companyId
);
rbd
.
setParkBranchCompanyId
(
companyId
);
rbd
.
setStartCompanyId
(
companyId
);
rbd
.
setStartCompanyId
(
companyId
);
rbd
.
setEndCompanyId
(
companyId
);
rbd
.
setEndCompanyId
(
companyId
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
3ea1b53c
...
@@ -371,10 +371,10 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -371,10 +371,10 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
@Override
@Override
public
RentVehiclePriceVO
calculatePrice
(
RentVehicleBO
detail
)
{
public
RentVehiclePriceVO
calculatePrice
(
RentVehicleBO
detail
)
{
if
(
Vehicle
.
GOODS_TYPE_RV
==
detail
.
getOrder
().
getGoodsType
())
{
if
(
Vehicle
.
PRICE_TYPE_HOUR
==
detail
.
getVehicle
().
getPriceType
())
{
return
dayCalculatePrice
(
detail
);
}
else
{
return
hourCalculatePrice
(
detail
);
return
hourCalculatePrice
(
detail
);
}
else
{
return
dayCalculatePrice
(
detail
);
}
}
}
}
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/Vehicle.java
View file @
3ea1b53c
...
@@ -20,6 +20,9 @@ public class Vehicle {
...
@@ -20,6 +20,9 @@ public class Vehicle {
public
static
final
int
STATE_UP
=
1
;
public
static
final
int
STATE_UP
=
1
;
public
static
final
int
STATE_DOWN
=
2
;
public
static
final
int
STATE_DOWN
=
2
;
public
static
final
int
PRICE_TYPE_DAY
=
1
;
public
static
final
int
PRICE_TYPE_HOUR
=
2
;
/**
/**
* 主键(uuid)
* 主键(uuid)
*/
*/
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/RentVehicleController.java
View file @
3ea1b53c
...
@@ -45,6 +45,7 @@ import java.util.HashSet;
...
@@ -45,6 +45,7 @@ import java.util.HashSet;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
import
static
cn
.
hutool
.
core
.
date
.
DateField
.
HOUR_OF_DAY
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.*;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.*;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
VehicleConstant
.
USER_APP
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
VehicleConstant
.
USER_APP
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
VehicleConstant
.
USER_APP_NAME
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
constant
.
VehicleConstant
.
USER_APP_NAME
;
...
@@ -422,25 +423,49 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
...
@@ -422,25 +423,49 @@ public class RentVehicleController extends BaseController<VehicleBiz> implements
return
CollUtil
.
newArrayList
();
return
CollUtil
.
newArrayList
();
}
}
//Date currentDate = DateUtil.beginOfDay(DateUtil.parse(startDate));
if
(
Vehicle
.
PRICE_TYPE_HOUR
==
vehicle
.
getPriceType
())
{
for
(
cn
.
hutool
.
core
.
date
.
DateTime
currentDate
=
DateUtil
.
beginOfDay
(
DateUtil
.
parse
(
startDate
));
//Date currentDate = DateUtil.beginOfDay(DateUtil.parse(startDate));
(
currentDate
.
isAfterOrEquals
(
beginOfStartDate
)
&&
currentDate
.
isBeforeOrEquals
(
endOfEndDate
));
for
(
cn
.
hutool
.
core
.
date
.
DateTime
currentDate
=
DateUtil
.
truncate
(
DateUtil
.
parse
(
startDate
),
HOUR_OF_DAY
);
currentDate
=
DateUtil
.
offsetDay
(
currentDate
,
1
))
{
(
currentDate
.
isAfterOrEquals
(
beginOfStartDate
)
&&
currentDate
.
isBeforeOrEquals
(
endOfEndDate
));
cn
.
hutool
.
core
.
date
.
DateTime
finalCurrentDate
=
currentDate
;
currentDate
=
DateUtil
.
offsetHour
(
currentDate
,
1
))
{
VehicleModelCalendarPriceDTO
dto
=
new
VehicleModelCalendarPriceDTO
(){{
cn
.
hutool
.
core
.
date
.
DateTime
finalCurrentDate
=
currentDate
;
setDate
(
DateUtil
.
beginOfDay
(
finalCurrentDate
));
VehicleModelCalendarPriceDTO
dto
=
new
VehicleModelCalendarPriceDTO
(){{
}};
setDate
(
DateUtil
.
beginOfDay
(
finalCurrentDate
));
if
(
currentDate
.
isWeekend
())
{
}};
dto
.
setNo_discount_price
(
vehicle
.
getHolidayPrice
());
if
(
currentDate
.
isWeekend
())
{
dto
.
setPrice
(
vehicle
.
getHolidayPrice
());
dto
.
setNo_discount_price
(
vehicle
.
getHolidayPrice
());
dto
.
setFreeDays
(
1
);
dto
.
setPrice
(
vehicle
.
getHolidayPrice
());
}
else
{
dto
.
setFreeDays
(
1
);
dto
.
setNo_discount_price
(
vehicle
.
getPrice
());
}
else
{
dto
.
setPrice
(
vehicle
.
getPrice
());
dto
.
setNo_discount_price
(
vehicle
.
getPrice
());
dto
.
setFreeDays
(
1
);
dto
.
setPrice
(
vehicle
.
getPrice
());
dto
.
setFreeDays
(
1
);
}
priceDTOS
.
add
(
dto
);
}
}
else
{
//Date currentDate = DateUtil.beginOfDay(DateUtil.parse(startDate));
for
(
cn
.
hutool
.
core
.
date
.
DateTime
currentDate
=
DateUtil
.
beginOfDay
(
DateUtil
.
parse
(
startDate
));
(
currentDate
.
isAfterOrEquals
(
beginOfStartDate
)
&&
currentDate
.
isBeforeOrEquals
(
endOfEndDate
));
currentDate
=
DateUtil
.
offsetDay
(
currentDate
,
1
))
{
cn
.
hutool
.
core
.
date
.
DateTime
finalCurrentDate
=
currentDate
;
VehicleModelCalendarPriceDTO
dto
=
new
VehicleModelCalendarPriceDTO
(){{
setDate
(
DateUtil
.
beginOfDay
(
finalCurrentDate
));
}};
if
(
currentDate
.
isWeekend
())
{
dto
.
setNo_discount_price
(
vehicle
.
getHolidayPrice
());
dto
.
setPrice
(
vehicle
.
getHolidayPrice
());
dto
.
setFreeDays
(
1
);
}
else
{
dto
.
setNo_discount_price
(
vehicle
.
getPrice
());
dto
.
setPrice
(
vehicle
.
getPrice
());
dto
.
setFreeDays
(
1
);
}
priceDTOS
.
add
(
dto
);
}
}
priceDTOS
.
add
(
dto
);
}
}
//获取节假日价格
//获取节假日价格
...
...
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