|
@@ -20,6 +20,7 @@ import com.steerinfo.baseinfo.meterbasecar.service.IMeterBaseCarService;
|
|
|
import com.steerinfo.meterwork.except.MarkerMetException;
|
|
import com.steerinfo.meterwork.except.MarkerMetException;
|
|
|
import com.steerinfo.util.CommonPage;
|
|
import com.steerinfo.util.CommonPage;
|
|
|
import com.steerinfo.util.SSOUtil;
|
|
import com.steerinfo.util.SSOUtil;
|
|
|
|
|
+import io.micrometer.core.instrument.Meter;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
import io.swagger.annotations.ApiImplicitParams;
|
|
@@ -202,12 +203,15 @@ public class MeterBaseCarController extends BaseRESTfulController {
|
|
|
HashMap queryCar = new HashMap();
|
|
HashMap queryCar = new HashMap();
|
|
|
queryCar.put("carNo", params.get("carNo").toString());
|
|
queryCar.put("carNo", params.get("carNo").toString());
|
|
|
queryCar.put("validFlag", "0");
|
|
queryCar.put("validFlag", "0");
|
|
|
- List<MeterBaseCar> queryList = meterBaseCarService.query(queryCar);
|
|
|
|
|
|
|
+ //查询服役状态的车辆信息
|
|
|
|
|
+ List<MeterBaseCar> queryList01 = meterBaseCarService.query(queryCar);
|
|
|
|
|
+ //查询停役、删除状态的车辆信息
|
|
|
|
|
+ List<MeterBaseCar> queryList02 = meterBaseCarMapper.selectByMap(params.get("carNo").toString());
|
|
|
|
|
|
|
|
- meterBaseDriverMapper.batchDeleteSelf(params.get("carNo").toString());
|
|
|
|
|
|
|
+ //meterBaseDriverMapper.batchDeleteSelf(params.get("carNo").toString());
|
|
|
|
|
|
|
|
- // 车辆表已存在时,跳过
|
|
|
|
|
- if (queryList.size() == 0) {
|
|
|
|
|
|
|
+ // 车辆表已存在车辆信息时,跳过
|
|
|
|
|
+ if (queryList01.size()+queryList02.size() == 0) {
|
|
|
// 新增车辆
|
|
// 新增车辆
|
|
|
MeterBaseCar car = new MeterBaseCar();
|
|
MeterBaseCar car = new MeterBaseCar();
|
|
|
car.setCarNo(params.get("carNo").toString());
|
|
car.setCarNo(params.get("carNo").toString());
|
|
@@ -217,15 +221,20 @@ public class MeterBaseCarController extends BaseRESTfulController {
|
|
|
if (params.get("carCarrierWeight") != null) {
|
|
if (params.get("carCarrierWeight") != null) {
|
|
|
new BigDecimal(params.get("carCarrierWeight").toString());
|
|
new BigDecimal(params.get("carCarrierWeight").toString());
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// 将sso id写入车辆表,便于以后删除和重置密码
|
|
// 将sso id写入车辆表,便于以后删除和重置密码
|
|
|
car.setSsoId(ssoMap.get("data").toString());
|
|
car.setSsoId(ssoMap.get("data").toString());
|
|
|
-
|
|
|
|
|
car.setCreateManNo("admin");
|
|
car.setCreateManNo("admin");
|
|
|
car.setCreateManName("admins");
|
|
car.setCreateManName("admins");
|
|
|
car.setCreateTime(new Date());
|
|
car.setCreateTime(new Date());
|
|
|
|
|
|
|
|
meterBaseCarService.add(car);
|
|
meterBaseCarService.add(car);
|
|
|
|
|
+ }else if(queryList02.size() >= 1){
|
|
|
|
|
+ for (MeterBaseCar model: queryList02) {
|
|
|
|
|
+ //停役或者删除状态的车辆信息更新为服役状态
|
|
|
|
|
+ meterBaseCarMapper.updateValidFlagById(model.getPkNo());
|
|
|
|
|
+ //停役或者删除状态的司机信息更新为服役状态
|
|
|
|
|
+ meterBaseDriverMapper.updateValidFlagByCarId(model.getCarNo());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
// 拆分司机list,新增司机表
|
|
// 拆分司机list,新增司机表
|
|
|
List<MeterBaseDriver> driverList = JSONObject.parseArray(params.get("driverList").toString(), MeterBaseDriver.class);
|
|
List<MeterBaseDriver> driverList = JSONObject.parseArray(params.get("driverList").toString(), MeterBaseDriver.class);
|