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
280a12d3
Commit
280a12d3
authored
Nov 07, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
车辆排班
parent
fbe70d06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+6
-0
VehicleJobHandler.java
...m/xxfc/platform/vehicle/jobhandler/VehicleJobHandler.java
+18
-0
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
280a12d3
...
@@ -22,6 +22,7 @@ import com.xxfc.platform.vehicle.common.RestResponse;
...
@@ -22,6 +22,7 @@ import com.xxfc.platform.vehicle.common.RestResponse;
import
com.xxfc.platform.vehicle.constant.*
;
import
com.xxfc.platform.vehicle.constant.*
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.constant.ResCode.ResCode
;
import
com.xxfc.platform.vehicle.entity.*
;
import
com.xxfc.platform.vehicle.entity.*
;
import
com.xxfc.platform.vehicle.jobhandler.VehicleJobHandler
;
import
com.xxfc.platform.vehicle.mapper.BookRecordAccItemMapper
;
import
com.xxfc.platform.vehicle.mapper.BookRecordAccItemMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleBookInfoMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleBookInfoMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleMapper
;
...
@@ -89,6 +90,9 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -89,6 +90,9 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
@Autowired
@Autowired
private
VehicleBookInfoBiz
vehicleBookInfoBiz
;
private
VehicleBookInfoBiz
vehicleBookInfoBiz
;
@Autowired
private
VehicleJobHandler
vehicleJobHandler
;
@Override
@Override
public
UserFeign
getUserFeign
()
{
public
UserFeign
getUserFeign
()
{
...
@@ -237,6 +241,8 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -237,6 +241,8 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
// }
// }
}
}
mapper
.
insertSelective
(
vehicle
);
mapper
.
insertSelective
(
vehicle
);
vehicleJobHandler
.
InsertBookInfo
(
vehicle
.
getId
());
}
}
return
RestResponse
.
suc
();
return
RestResponse
.
suc
();
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/jobhandler/VehicleJobHandler.java
View file @
280a12d3
...
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Component;
...
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Component;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
/**
* @author libin
* @author libin
...
@@ -66,4 +67,21 @@ public class VehicleJobHandler extends IJobHandler {
...
@@ -66,4 +67,21 @@ public class VehicleJobHandler extends IJobHandler {
return
FAIL
;
return
FAIL
;
}
}
}
}
public
void
InsertBookInfo
(
String
vehicleId
){
XxlJobLogger
.
log
(
"----添加新建的车辆【{}】的bookInfo"
,
vehicleId
);
List
<
VehicleBookInfo
>
bookInfos
=
Stream
.
of
(
0
,
1
,
2
).
map
(
x
->
{
LocalDate
date
=
LocalDate
.
now
().
plusMonths
(
x
);
int
year
=
date
.
getYear
();
int
month
=
date
.
getMonthValue
();
String
yearAndMonth
=
String
.
format
(
"%d-%02d"
,
year
,
month
);
VehicleBookInfo
vehicleBookInfo
=
new
VehicleBookInfo
();
vehicleBookInfo
.
setVehicle
(
vehicleId
);
vehicleBookInfo
.
setYearMonth
(
yearAndMonth
);
return
vehicleBookInfo
;
}).
collect
(
Collectors
.
toList
());
XxlJobLogger
.
log
(
"----插入车型对象:【{}】"
,
bookInfos
);
vehicleBookInfoBiz
.
InsertBatch
(
bookInfos
);
}
}
}
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