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
5b555442
Commit
5b555442
authored
Oct 28, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加车辆排班
parent
1191470b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
2 deletions
+33
-2
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+1
-0
VehicleBookInfoBiz.java
...ava/com/xxfc/platform/vehicle/biz/VehicleBookInfoBiz.java
+31
-1
VehicleApplyMapper.xml
...e-server/src/main/resources/mapper/VehicleApplyMapper.xml
+1
-1
No files found.
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
5b555442
...
@@ -1626,6 +1626,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -1626,6 +1626,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
vehicle
.
setManageCompanyId
(
vehicleApply
.
getSubordinateBranch
());
vehicle
.
setManageCompanyId
(
vehicleApply
.
getSubordinateBranch
());
insertSelective
(
vehicle
);
insertSelective
(
vehicle
);
vehicleId
=
vehicle
.
getId
();
vehicleId
=
vehicle
.
getId
();
vehicleBookInfoBiz
.
addVehicleBookInfo
(
vehicleId
);
setGoodsTypes
(
vehicle
);
setGoodsTypes
(
vehicle
);
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBookInfoBiz.java
View file @
5b555442
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
package
com
.
xxfc
.
platform
.
vehicle
.
biz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
com.xxfc.platform.vehicle.constant.RedisKey
;
import
com.xxfc.platform.vehicle.entity.VehicleBookInfo
;
import
com.xxfc.platform.vehicle.entity.VehicleBookInfo
;
import
com.xxfc.platform.vehicle.mapper.VehicleBookInfoMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleBookInfoMapper
;
...
@@ -15,7 +18,7 @@ import org.springframework.data.redis.core.RedisTemplate;
...
@@ -15,7 +18,7 @@ import org.springframework.data.redis.core.RedisTemplate;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDate
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
...
@@ -34,6 +37,13 @@ public class VehicleBookInfoBiz extends BaseBiz<VehicleBookInfoMapper, VehicleBo
...
@@ -34,6 +37,13 @@ public class VehicleBookInfoBiz extends BaseBiz<VehicleBookInfoMapper, VehicleBo
@Autowired
@Autowired
private
RedisTemplate
customRedisTemplate
;
private
RedisTemplate
customRedisTemplate
;
@Autowired
ThirdFeign
thirdFeign
;
private
static
final
String
DIC_VEHICLE_TYPE
=
"VEHICLE"
;
private
static
final
String
DIC_VEHICLE_CODE
=
"VEHICLE_JOB"
;
/**
/**
* 迁移数据到历史表
* 迁移数据到历史表
* 每年一张表
* 每年一张表
...
@@ -136,4 +146,24 @@ public class VehicleBookInfoBiz extends BaseBiz<VehicleBookInfoMapper, VehicleBo
...
@@ -136,4 +146,24 @@ public class VehicleBookInfoBiz extends BaseBiz<VehicleBookInfoMapper, VehicleBo
public
int
update
(
VehicleBookInfo
vehicleBookInfo
)
{
public
int
update
(
VehicleBookInfo
vehicleBookInfo
)
{
return
mapper
.
updateById
(
vehicleBookInfo
);
return
mapper
.
updateById
(
vehicleBookInfo
);
}
}
public
void
addVehicleBookInfo
(
String
vehicleId
)
{
Dictionary
dictionary
=
thirdFeign
.
findDictionaryByTypeAndCode
(
DIC_VEHICLE_TYPE
,
DIC_VEHICLE_CODE
);
Integer
months
=
Integer
.
valueOf
(
dictionary
.
getDetail
());
LocalDate
date
=
LocalDate
.
now
();
for
(
int
i
=
0
;
i
<=
months
;
i
++)
{
if
(
i
>
0
){
date
=
date
.
plusMonths
(
i
);
}
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
);
insertSelective
(
vehicleBookInfo
);
}
}
}
}
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleApplyMapper.xml
View file @
5b555442
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
LEFT JOIN vehicle_category c ON v.category_id=c.id
LEFT JOIN vehicle_category c ON v.category_id=c.id
LEFT JOIN branch_company i on v.subordinate_branch=i.id
LEFT JOIN branch_company i on v.subordinate_branch=i.id
<where>
<where>
v.is_del = 0
v.is_del = 0
<if
test=
"dataCompanyIds != null and dataCompanyIds.size > 0"
>
<if
test=
"dataCompanyIds != null and dataCompanyIds.size > 0"
>
and i.id in
and i.id in
<foreach
collection=
"dataCompanyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
<foreach
collection=
"dataCompanyIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
...
...
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