Commit 5c85f1f4 authored by 麻笑宇's avatar 麻笑宇

历史设备登记车用气瓶提交修改

parent d25f199a
...@@ -1565,9 +1565,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -1565,9 +1565,10 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
@GlobalTransactional(rollbackFor = Exception.class) @GlobalTransactional(rollbackFor = Exception.class)
public List<JgVehicleInformation> saveOrUpdateHisData(JSONObject map) { public List<JgVehicleInformation> saveOrUpdateHisData(JSONObject map) {
ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())) + "", ReginParams.class); ReginParams reginParams = JSONObject.parseObject(redisUtils.get(RedisKey.buildReginKey(RequestContext.getExeUserId(), RequestContext.getToken())) + "", ReginParams.class);
JgVehicleInformationDto vehicleInfoDto = JSON.parseObject(JSON.toJSONString(map), JgVehicleInformationDto.class); JSONObject firstMap = map.getJSONObject("first");
JSONObject secondMap = map.getJSONObject("second");
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) map.get("equipmentLists"); JgVehicleInformationDto vehicleInfoDto = JSON.parseObject(JSON.toJSONString(secondMap), JgVehicleInformationDto.class);
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) secondMap.get("equipmentLists");
if (CollectionUtils.isEmpty(equipmentLists) || if (CollectionUtils.isEmpty(equipmentLists) ||
equipmentLists.stream().map(v -> (String) v.get("chargingMedium")).distinct().count() != 1) { equipmentLists.stream().map(v -> (String) v.get("chargingMedium")).distinct().count() != 1) {
throw new BadRequest(CollectionUtils.isEmpty(equipmentLists) ? "请选择设备信息!" : "请选择相同充装介质设备!"); throw new BadRequest(CollectionUtils.isEmpty(equipmentLists) ? "请选择设备信息!" : "请选择相同充装介质设备!");
...@@ -1656,7 +1657,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -1656,7 +1657,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
} }
// 安全管理员 // 安全管理员
Optional.ofNullable(map.getString("safetyManagerId")) Optional.ofNullable(secondMap.getString("safetyManagerId"))
.filter(manager -> manager.contains("_")) .filter(manager -> manager.contains("_"))
.map(manager -> manager.split("_")) .map(manager -> manager.split("_"))
.ifPresent(data -> { .ifPresent(data -> {
...@@ -1666,14 +1667,14 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -1666,14 +1667,14 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
// 产权单位信息 // 产权单位信息
if (!StringUtils.isEmpty(vehicleInfoDto.getEstateUnitName())) { if (!StringUtils.isEmpty(vehicleInfoDto.getEstateUnitName())) {
String[] data = String.valueOf(map.getString("estateUnitName")).split("_"); String[] data = String.valueOf(secondMap.getString("estateUnitName")).split("_");
vehicleInfoDto.setEstateUnitCreditCode(data[0]); vehicleInfoDto.setEstateUnitCreditCode(data[0]);
vehicleInfoDto.setEstateUnitName(data[1]); vehicleInfoDto.setEstateUnitName(data[1]);
} }
// 其他附件 // 其他附件
if (!ObjectUtils.isEmpty(map.get("otherAccessories"))) { if (!ObjectUtils.isEmpty(secondMap.get("otherAccessories"))) {
vehicleInfoDto.setOtherAccessories(JSONObject.toJSONString(map.get("otherAccessories"))); vehicleInfoDto.setOtherAccessories(JSONObject.toJSONString(secondMap.get("otherAccessories")));
} }
JgVehicleInformation vehicleInformation = new JgVehicleInformation(); JgVehicleInformation vehicleInformation = new JgVehicleInformation();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment