|
|
@@ -487,34 +487,28 @@ public class MeterBaseCusSupCarController extends BaseRESTfulController {
|
|
|
try {
|
|
|
String msg = "";
|
|
|
|
|
|
- // 拆分司机list,新增客商车辆表
|
|
|
- List<MeterBaseCusSupCar> driverList = JSONObject.parseArray(params.get("driverList").toString(), MeterBaseCusSupCar.class);
|
|
|
- // 循环新增车辆
|
|
|
- for (MeterBaseCusSupCar car: driverList) {
|
|
|
- // 检查车辆是否存在
|
|
|
- HashMap query = new HashMap();
|
|
|
- query.put("cusSupCarNo", params.get("cusSupCarNo").toString());
|
|
|
- query.put("validFlag", "0");
|
|
|
-
|
|
|
- List<MeterBaseCusSupCar> list = meterBaseCusSupCarService.query(query);
|
|
|
- if(list.size() == 0){
|
|
|
- // 将车辆类型,载重信息加入实体
|
|
|
- car.setCusSupCarNo(params.get("cusSupCarNo").toString());
|
|
|
-
|
|
|
- car.setCarTypeNo(params.get("carTypeNo").toString());
|
|
|
- car.setCarTypeName(params.get("carTypeName").toString());
|
|
|
+ // 检查车辆是否存在
|
|
|
+ HashMap query = new HashMap();
|
|
|
+ query.put("cusSupCarNo", params.get("cusSupCarNo").toString());
|
|
|
+ query.put("validFlag", "0");
|
|
|
+
|
|
|
+ List<MeterBaseCusSupCar> list = meterBaseCusSupCarService.query(query);
|
|
|
+ if(list.size() == 0){
|
|
|
+ MeterBaseCusSupCar car = new MeterBaseCusSupCar();
|
|
|
+ // 将车辆类型,载重信息加入实体
|
|
|
+ car.setCusSupCarNo(params.get("cusSupCarNo").toString());
|
|
|
+
|
|
|
+ car.setCarTypeNo(params.get("carTypeNo").toString());
|
|
|
+ car.setCarTypeName(params.get("carTypeName").toString());
|
|
|
+ if(params.get("carCarrierWeight") != null){
|
|
|
car.setCarCarrierWeight(new BigDecimal(params.get("carCarrierWeight").toString()));
|
|
|
-
|
|
|
- car.setCreateManNo("admin");
|
|
|
- car.setCreateManName("admins");
|
|
|
- car.setCreateTime(new Date());
|
|
|
-
|
|
|
- msg = meterBaseCusSupCarService.checkandadd(car);
|
|
|
}
|
|
|
|
|
|
- if(StringUtils.isNotEmpty(msg)){
|
|
|
- break;
|
|
|
- }
|
|
|
+ car.setCreateManNo("admin");
|
|
|
+ car.setCreateManName("admins");
|
|
|
+ car.setCreateTime(new Date());
|
|
|
+
|
|
|
+ msg = meterBaseCusSupCarService.checkandadd(car);
|
|
|
}
|
|
|
|
|
|
// *将司机注册sso账户*
|
|
|
@@ -570,9 +564,17 @@ public class MeterBaseCusSupCarController extends BaseRESTfulController {
|
|
|
String ssomsg3 = HttpsRequest.sendPost(ssoUrl + "/v1/sysusers/updpsw", pwdMap, accessToken);
|
|
|
|
|
|
JSONObject jsonObject3 = JSONObject.parseObject(ssomsg3);
|
|
|
+
|
|
|
+ if(!jsonObject3.get("code").toString().equals("0")) {
|
|
|
+ msg = jsonObject3.get("resultMessage").toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ msg = jsonObject2.get("resultMessage").toString();
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
if (StringUtils.isNotEmpty(msg)) {
|
|
|
return failed(null, msg);
|
|
|
}
|