|
@@ -240,8 +240,16 @@ public class MeterBaseCarController extends BaseRESTfulController {
|
|
|
car.setUsetDepartment(params.get("unitName").toString());
|
|
car.setUsetDepartment(params.get("unitName").toString());
|
|
|
car.setCarTypeNo(params.get("carTypeNo").toString());
|
|
car.setCarTypeNo(params.get("carTypeNo").toString());
|
|
|
car.setCarTypeName(params.get("carTypeName").toString());
|
|
car.setCarTypeName(params.get("carTypeName").toString());
|
|
|
- car.setCarCarrierWeight(params.get("carCarrierWeight") != null ?
|
|
|
|
|
- new BigDecimal(params.get("carCarrierWeight").toString()): null);
|
|
|
|
|
|
|
+ if(params.get("carSelfWeight") != null ) {
|
|
|
|
|
+ if(!StringUtils.isEmpty(params.get("carSelfWeight").toString())) {
|
|
|
|
|
+ car.setCarSelfWeight(new BigDecimal(params.get("carSelfWeight").toString()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(params.get("carCarrierWeight") != null ) {
|
|
|
|
|
+ if(!StringUtils.isEmpty(params.get("carCarrierWeight").toString())) {
|
|
|
|
|
+ car.setCarCarrierWeight(new BigDecimal(params.get("carCarrierWeight").toString()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
// 将sso id写入车辆表,便于以后删除和重置密码
|
|
// 将sso id写入车辆表,便于以后删除和重置密码
|
|
|
if(!ssoMap.get("code").toString().equals("1")){
|
|
if(!ssoMap.get("code").toString().equals("1")){
|
|
|
car.setSsoId(ssoMap.get("data").toString());
|
|
car.setSsoId(ssoMap.get("data").toString());
|
|
@@ -276,13 +284,23 @@ public class MeterBaseCarController extends BaseRESTfulController {
|
|
|
car.setUsetDepartment(params.get("unitName").toString());
|
|
car.setUsetDepartment(params.get("unitName").toString());
|
|
|
car.setCarTypeNo(params.get("carTypeNo").toString());
|
|
car.setCarTypeNo(params.get("carTypeNo").toString());
|
|
|
car.setCarTypeName(params.get("carTypeName").toString());
|
|
car.setCarTypeName(params.get("carTypeName").toString());
|
|
|
- car.setCarCarrierWeight(params.get("carCarrierWeight") != null ?
|
|
|
|
|
- new BigDecimal(params.get("carCarrierWeight").toString()): null);
|
|
|
|
|
|
|
+ if(params.get("carSelfWeight") != null ) {
|
|
|
|
|
+ if(!StringUtils.isEmpty(params.get("carSelfWeight").toString())) {
|
|
|
|
|
+ car.setCarSelfWeight(new BigDecimal(params.get("carSelfWeight").toString()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(params.get("carCarrierWeight") != null ) {
|
|
|
|
|
+ if(!StringUtils.isEmpty(params.get("carCarrierWeight").toString())) {
|
|
|
|
|
+ car.setCarCarrierWeight(new BigDecimal(params.get("carCarrierWeight").toString()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
car.setUpdateManNo("admin");
|
|
car.setUpdateManNo("admin");
|
|
|
car.setUpdateManName("admins");
|
|
car.setUpdateManName("admins");
|
|
|
car.setUpdateTime(new Date());
|
|
car.setUpdateTime(new Date());
|
|
|
meterBaseCarMapper.updateByPrimaryKeySelective(car);
|
|
meterBaseCarMapper.updateByPrimaryKeySelective(car);
|
|
|
ssoUtil.ssoResetPwd(car.getSsoId(), params.get("password").toString(), "");
|
|
ssoUtil.ssoResetPwd(car.getSsoId(), params.get("password").toString(), "");
|
|
|
|
|
+ }else if(queryList01.size() >= 1) {
|
|
|
|
|
+ return failed(null, "车辆配置表已存在服役的车辆信息,请停役"+ carNo +"车辆,在进行车辆注册!!");
|
|
|
}
|
|
}
|
|
|
// 拆分司机list,新增司机表
|
|
// 拆分司机list,新增司机表
|
|
|
List<MeterBaseDriver> driverList = JSONObject.parseArray(params.get("driverList").toString(), MeterBaseDriver.class);
|
|
List<MeterBaseDriver> driverList = JSONObject.parseArray(params.get("driverList").toString(), MeterBaseDriver.class);
|
|
@@ -294,7 +312,6 @@ public class MeterBaseCarController extends BaseRESTfulController {
|
|
|
query.put("driverName", driver.getDriverName());
|
|
query.put("driverName", driver.getDriverName());
|
|
|
query.put("telNum", driver.getTelNum());
|
|
query.put("telNum", driver.getTelNum());
|
|
|
query.put("validFlag", "0");
|
|
query.put("validFlag", "0");
|
|
|
-
|
|
|
|
|
List<MeterBaseDriver> list = meterBaseDriverService.query(query);
|
|
List<MeterBaseDriver> list = meterBaseDriverService.query(query);
|
|
|
// 司机表已存在时,跳过
|
|
// 司机表已存在时,跳过
|
|
|
if (list.size() == 0) {
|
|
if (list.size() == 0) {
|
|
@@ -686,8 +703,6 @@ public class MeterBaseCarController extends BaseRESTfulController {
|
|
|
// 检查车辆是否存在
|
|
// 检查车辆是否存在
|
|
|
HashMap query = new HashMap();
|
|
HashMap query = new HashMap();
|
|
|
query.put("carNo", params.get("carNo").toString());
|
|
query.put("carNo", params.get("carNo").toString());
|
|
|
- query.put("validFlag", "0");
|
|
|
|
|
-
|
|
|
|
|
List<MeterBaseCar> list = meterBaseCarService.query(query);
|
|
List<MeterBaseCar> list = meterBaseCarService.query(query);
|
|
|
if (list.size() == 0) {
|
|
if (list.size() == 0) {
|
|
|
// sso注册
|
|
// sso注册
|
|
@@ -695,7 +710,7 @@ public class MeterBaseCarController extends BaseRESTfulController {
|
|
|
HashMap ssoMap = ssoUtil.ssoRegister(params);
|
|
HashMap ssoMap = ssoUtil.ssoRegister(params);
|
|
|
|
|
|
|
|
// sso注册成功时,增加车辆表
|
|
// sso注册成功时,增加车辆表
|
|
|
- if (ssoMap.get("code").equals("1")) {
|
|
|
|
|
|
|
+ if (ssoMap.get("code").equals("1") && false) {
|
|
|
return failed(null, ssoMap.get("msg").toString());
|
|
return failed(null, ssoMap.get("msg").toString());
|
|
|
} else {
|
|
} else {
|
|
|
// sso注册成功时,增加车辆表
|
|
// sso注册成功时,增加车辆表
|
|
@@ -704,32 +719,63 @@ public class MeterBaseCarController extends BaseRESTfulController {
|
|
|
car.setCarNo(params.get("carNo").toString());
|
|
car.setCarNo(params.get("carNo").toString());
|
|
|
car.setCarTypeNo(params.get("carTypeNo").toString());
|
|
car.setCarTypeNo(params.get("carTypeNo").toString());
|
|
|
car.setCarTypeName(params.get("carTypeName").toString());
|
|
car.setCarTypeName(params.get("carTypeName").toString());
|
|
|
- if (params.get("carSelfWeight") != null) {
|
|
|
|
|
- car.setCarSelfWeight(new BigDecimal(params.get("carSelfWeight").toString()));
|
|
|
|
|
|
|
+ car.setValidFlag("0");
|
|
|
|
|
+ if(params.get("carSelfWeight") != null ) {
|
|
|
|
|
+ if(!StringUtils.isEmpty(params.get("carSelfWeight").toString())) {
|
|
|
|
|
+ car.setCarSelfWeight(new BigDecimal(params.get("carSelfWeight").toString()));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- if (params.get("carCarrierWeight") != null) {
|
|
|
|
|
- car.setCarCarrierWeight(new BigDecimal(params.get("carCarrierWeight").toString()));
|
|
|
|
|
|
|
+ if(params.get("carCarrierWeight") != null ) {
|
|
|
|
|
+ if(!StringUtils.isEmpty(params.get("carCarrierWeight").toString())) {
|
|
|
|
|
+ car.setCarCarrierWeight(new BigDecimal(params.get("carCarrierWeight").toString()));
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
-// car.setMnemonicCode(params.get("mnemonicCode").toString());
|
|
|
|
|
-// car.setCustomerSupplierName(params.get("customerSupplierName").toString());
|
|
|
|
|
-// car.setMemo(params.get("memo").toString());
|
|
|
|
|
car.setCreateManNo("admin");
|
|
car.setCreateManNo("admin");
|
|
|
car.setCreateManName("admins");
|
|
car.setCreateManName("admins");
|
|
|
car.setCreateTime(new Date());
|
|
car.setCreateTime(new Date());
|
|
|
-
|
|
|
|
|
// 将sso id写入车辆表,便于以后删除和重置密码
|
|
// 将sso id写入车辆表,便于以后删除和重置密码
|
|
|
car.setSsoId(ssoMap.get("data").toString());
|
|
car.setSsoId(ssoMap.get("data").toString());
|
|
|
|
|
|
|
|
msg = meterBaseCarService.checkandadd(car);
|
|
msg = meterBaseCarService.checkandadd(car);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- msg = "车辆已存在";
|
|
|
|
|
|
|
+ // 车辆已存在,更新车辆表
|
|
|
|
|
+ MeterBaseCar car = list.get(0);
|
|
|
|
|
+ // 将车辆类型,载重信息加入实体
|
|
|
|
|
+ car.setCarTypeNo(params.get("carTypeNo").toString());
|
|
|
|
|
+ car.setCarTypeName(params.get("carTypeName").toString());
|
|
|
|
|
+ car.setValidFlag("0");
|
|
|
|
|
+ if(params.get("carSelfWeight") != null ) {
|
|
|
|
|
+ if(!StringUtils.isEmpty(params.get("carSelfWeight").toString())) {
|
|
|
|
|
+ car.setCarSelfWeight(new BigDecimal(params.get("carSelfWeight").toString()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ if(params.get("carCarrierWeight") != null ) {
|
|
|
|
|
+ if(!StringUtils.isEmpty(params.get("carCarrierWeight").toString())) {
|
|
|
|
|
+ car.setCarCarrierWeight(new BigDecimal(params.get("carCarrierWeight").toString()));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ /*if (params.get("carSelfWeight") != null) {
|
|
|
|
|
+ car.setCarSelfWeight(new BigDecimal(params.get("carSelfWeight").toString()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if (params.get("carCarrierWeight") != null) {
|
|
|
|
|
+ car.setCarCarrierWeight(new BigDecimal(params.get("carCarrierWeight").toString()));
|
|
|
|
|
+ }*/
|
|
|
|
|
+ car.setUpdateManNo("admin");
|
|
|
|
|
+ car.setUpdateManName("admins");
|
|
|
|
|
+ car.setUpdateTime(new Date());
|
|
|
|
|
+
|
|
|
|
|
+ // 将sso id写入车辆表,便于以后删除和重置密码
|
|
|
|
|
+ if (car.getSsoId() != null) {
|
|
|
|
|
+ // SSO重置密码
|
|
|
|
|
+ SSOUtil ssoUtil = new SSOUtil();
|
|
|
|
|
+ msg = ssoUtil.ssoResetPwd(car.getSsoId(), params.get("password").toString(), "");
|
|
|
|
|
+ }
|
|
|
|
|
+ meterBaseCarMapper.updateByPrimaryKeySelective(car);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (com.steerinfo.util.StringUtils.isNotEmpty(msg)) {
|
|
if (com.steerinfo.util.StringUtils.isNotEmpty(msg)) {
|
|
|
return failed(null, msg);
|
|
return failed(null, msg);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
@@ -748,8 +794,6 @@ public class MeterBaseCarController extends BaseRESTfulController {
|
|
|
// 检查车辆是否存在
|
|
// 检查车辆是否存在
|
|
|
HashMap query = new HashMap();
|
|
HashMap query = new HashMap();
|
|
|
query.put("carNo", params.get("carNo").toString());
|
|
query.put("carNo", params.get("carNo").toString());
|
|
|
- query.put("validFlag", "0");
|
|
|
|
|
-
|
|
|
|
|
List<MeterBaseCar> list = meterBaseCarService.query(query);
|
|
List<MeterBaseCar> list = meterBaseCarService.query(query);
|
|
|
if (list.size() == 0) {
|
|
if (list.size() == 0) {
|
|
|
// sso注册
|
|
// sso注册
|
|
@@ -758,7 +802,7 @@ public class MeterBaseCarController extends BaseRESTfulController {
|
|
|
HashMap ssoMap = ssoUtil.ssoRegister(params);
|
|
HashMap ssoMap = ssoUtil.ssoRegister(params);
|
|
|
|
|
|
|
|
// sso注册成功时,增加车辆表
|
|
// sso注册成功时,增加车辆表
|
|
|
- if (ssoMap.get("code").equals("1")) {
|
|
|
|
|
|
|
+ if (ssoMap.get("code").equals("1")&&false) {
|
|
|
return failed(null, ssoMap.get("msg").toString());
|
|
return failed(null, ssoMap.get("msg").toString());
|
|
|
} else {
|
|
} else {
|
|
|
// sso注册成功时,增加车辆表
|
|
// sso注册成功时,增加车辆表
|
|
@@ -778,7 +822,23 @@ public class MeterBaseCarController extends BaseRESTfulController {
|
|
|
msg = meterBaseCarService.checkandadd(car);
|
|
msg = meterBaseCarService.checkandadd(car);
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- msg = "车辆已存在";
|
|
|
|
|
|
|
+ // 车辆已存在,更新车辆表
|
|
|
|
|
+ car = list.get(0);
|
|
|
|
|
+ // 将车辆类型,载重信息加入实体
|
|
|
|
|
+ car.setCarTypeNo(params.get("carTypeNo").toString());
|
|
|
|
|
+ car.setCarTypeName(params.get("carTypeName").toString());
|
|
|
|
|
+ car.setValidFlag("0");
|
|
|
|
|
+ car.setUpdateManNo("admin");
|
|
|
|
|
+ car.setUpdateManName("admins");
|
|
|
|
|
+ car.setUpdateTime(new Date());
|
|
|
|
|
+
|
|
|
|
|
+ // 将sso id写入车辆表,便于以后删除和重置密码
|
|
|
|
|
+ if (car.getSsoId() != null) {
|
|
|
|
|
+ // SSO重置密码
|
|
|
|
|
+ SSOUtil ssoUtil = new SSOUtil();
|
|
|
|
|
+ msg = ssoUtil.ssoResetPwd(car.getSsoId(), params.get("newpassword").toString(), "");
|
|
|
|
|
+ }
|
|
|
|
|
+ meterBaseCarMapper.updateByPrimaryKeySelective(car);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (com.steerinfo.util.StringUtils.isNotEmpty(msg)) {
|
|
if (com.steerinfo.util.StringUtils.isNotEmpty(msg)) {
|