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
69f0be45
Commit
69f0be45
authored
Nov 18, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'holiday-price' into dev
parents
a8d0789a
5bd0611e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
VehicleModelCalendarPriceBiz.java
...fc/platform/vehicle/biz/VehicleModelCalendarPriceBiz.java
+14
-6
VehicleModelCalendarPriceAdminController.java
.../rest/admin/VehicleModelCalendarPriceAdminController.java
+2
-2
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleModelCalendarPriceBiz.java
View file @
69f0be45
...
...
@@ -23,6 +23,7 @@ import org.springframework.beans.BeanUtils;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
tk.mybatis.mapper.entity.Example
;
import
java.math.BigDecimal
;
...
...
@@ -69,18 +70,18 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
* @param vehicleModelCalendarPrices
* @param userId
*/
public
void
addVehicleModelCalendarPrice
(
List
<
VehicleModelCalendarPriceSaveDTO
>
vehicleModelCalendarPrices
,
Integer
userId
)
{
public
void
addVehicleModelCalendarPrice
(
List
<
VehicleModelCalendarPriceSaveDTO
>
vehicleModelCalendarPrices
,
String
date
,
Integer
userId
)
{
if
(
CollectionUtils
.
isNotEmpty
(
vehicleModelCalendarPrices
))
{
List
<
VehicleModelCalendarPrice
>
vehicleModelCalendarPriceList
=
new
ArrayList
<>();
List
<
Date
>
dateList
=
vehicleModelCalendarPrices
.
stream
().
peek
(
x
->
{
VehicleModelCalendarPrice
calendarPrice
=
new
VehicleModelCalendarPrice
();
BeanUtils
.
copyProperties
(
x
,
calendarPrice
);
Date
d
a
te
=
DateUtils
.
localDateToDate
(
LocalDate
.
parse
(
x
.
getDate
()));
calendarPrice
.
setVehicleModelDay
(
d
a
te
);
Date
dte
=
DateUtils
.
localDateToDate
(
LocalDate
.
parse
(
x
.
getDate
()));
calendarPrice
.
setVehicleModelDay
(
dte
);
calendarPrice
.
setCrtTime
(
new
Date
());
calendarPrice
.
setCrtUserId
(
userId
);
calendarPrice
.
setIsDel
(
0
);
x
.
setVehicleModelDay
(
d
a
te
);
x
.
setVehicleModelDay
(
dte
);
vehicleModelCalendarPriceList
.
add
(
calendarPrice
);
}).
map
(
VehicleModelCalendarPriceSaveDTO:
:
getVehicleModelDay
).
distinct
().
collect
(
Collectors
.
toList
());
...
...
@@ -92,10 +93,17 @@ public class VehicleModelCalendarPriceBiz extends BaseBiz<VehicleModelCalendarPr
vehicleModelCalendarPrice
.
setIsDel
(
1
);
Example
example
=
new
Example
(
VehicleModelCalendarPrice
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andIn
(
"vehicleModelDay"
,
dateList
);
if
(
CollectionUtils
.
isEmpty
(
dateList
)
&&
StringUtils
.
hasText
(
date
)){
criteria
.
andEqualTo
(
"vehicleModelDay"
,
DateUtils
.
localDateToDate
(
LocalDate
.
parse
(
date
)));
}
else
{
criteria
.
andIn
(
"vehicleModelDay"
,
dateList
);
}
mapper
.
updateByExampleSelective
(
vehicleModelCalendarPrice
,
example
);
//2.插入新的数据
mapper
.
insertList
(
vehicleModelCalendarPriceList
);
if
(!
CollectionUtils
.
isNotEmpty
(
dateList
)){
mapper
.
insertList
(
vehicleModelCalendarPriceList
);
}
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/VehicleModelCalendarPriceAdminController.java
View file @
69f0be45
...
...
@@ -31,8 +31,8 @@ public class VehicleModelCalendarPriceAdminController {
@ApiOperation
(
"车型日历价格设置"
)
@PostMapping
(
"/add_edit"
)
public
ObjectRestResponse
<
Void
>
add
(
@RequestBody
List
<
VehicleModelCalendarPriceSaveDTO
>
vehicleModelCalendarPriceSaveDTO
,
UserDTO
userDTO
){
vehicleModelCalendarPriceBiz
.
addVehicleModelCalendarPrice
(
vehicleModelCalendarPriceSaveDTO
,
userDTO
.
getId
());
public
ObjectRestResponse
<
Void
>
add
(
@RequestBody
List
<
VehicleModelCalendarPriceSaveDTO
>
vehicleModelCalendarPriceSaveDTO
,
@RequestParam
(
"date"
)
String
date
,
UserDTO
userDTO
){
vehicleModelCalendarPriceBiz
.
addVehicleModelCalendarPrice
(
vehicleModelCalendarPriceSaveDTO
,
date
,
userDTO
.
getId
());
return
ObjectRestResponse
.
succ
();
}
...
...
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