|
@@ -25,8 +25,7 @@ public class VehicleInfoServiceImpl implements VehicleInfoService { |
|
@@ -25,8 +25,7 @@ public class VehicleInfoServiceImpl implements VehicleInfoService { |
25
|
/**
|
25
|
/**
|
26
|
* 调度车辆方法
|
26
|
* 调度车辆方法
|
27
|
*
|
27
|
*
|
28
|
- * @param vehicleType:车辆类型
|
|
|
29
|
- * @param vehicleStatus:车辆状态
|
28
|
+ * @param vehicleInfo:车辆实体
|
30
|
* @return List<VehicleInfo>
|
29
|
* @return List<VehicleInfo>
|
31
|
*/
|
30
|
*/
|
32
|
@Override
|
31
|
@Override
|
|
@@ -62,14 +61,26 @@ public class VehicleInfoServiceImpl implements VehicleInfoService { |
|
@@ -62,14 +61,26 @@ public class VehicleInfoServiceImpl implements VehicleInfoService { |
62
|
|
61
|
|
63
|
@Override
|
62
|
@Override
|
64
|
public int deleteByPrimaryKey(String id) {
|
63
|
public int deleteByPrimaryKey(String id) {
|
|
|
64
|
+ /**
|
|
|
65
|
+ * 设置一个判断数值,记录删除的个数
|
|
|
66
|
+ * 判断该个数与前端传递来的个数是否一致
|
|
|
67
|
+ */
|
|
|
68
|
+ int index = 0;
|
65
|
//如果id,传过来多个,以','分割,即批量删除
|
69
|
//如果id,传过来多个,以','分割,即批量删除
|
66
|
if (id.contains(",")) {
|
70
|
if (id.contains(",")) {
|
67
|
try {
|
71
|
try {
|
68
|
String[] split = id.split(",");
|
72
|
String[] split = id.split(",");
|
69
|
for (int i = 0; i < split.length; i++) {
|
73
|
for (int i = 0; i < split.length; i++) {
|
70
|
- vehicleInfoMapper.deleteByPrimaryKey(split[i]);
|
74
|
+ int num = vehicleInfoMapper.deleteByPrimaryKey(split[i]);
|
|
|
75
|
+ if (num > 0) {
|
|
|
76
|
+ index = index + num;
|
|
|
77
|
+ }
|
|
|
78
|
+ }
|
|
|
79
|
+ if (index == split.length) {
|
|
|
80
|
+ return 1;
|
|
|
81
|
+ } else {
|
|
|
82
|
+ return 0;
|
71
|
}
|
83
|
}
|
72
|
- return 1;
|
|
|
73
|
} catch (Exception e) {
|
84
|
} catch (Exception e) {
|
74
|
e.printStackTrace();
|
85
|
e.printStackTrace();
|
75
|
return 0;
|
86
|
return 0;
|