Commit 7b653de2 authored by 刘林's avatar 刘林

fix(jg):车用气瓶暂存功能

parent 2c2ad606
......@@ -233,16 +233,16 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
vehicleInfoDto.setUseRegistrationFormUrl(String.valueOf(vehicle.get("useRegistrationFormUrl")));
}
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) map.get("equipmentLists");
if (SUBMIT_TYPE_FLOW.equals(submit)) {
if (CollectionUtils.isEmpty(equipmentLists) ||
equipmentLists.stream().map(v -> (String) v.get("chargingMedium")).distinct().count() != 1) {
throw new BadRequest(CollectionUtils.isEmpty(equipmentLists) ? "请选择设备信息!" : "请选择相同充装介质设备!");
}
if (SUBMIT_TYPE_FLOW.equals(submit)) {
// 检查设备是否已经在使用
// 个人主体的身份证(6600_620422199903010258) 特殊处理 只取_后的身份证号码
this.repeatUsedEquipCheck(equipmentLists,
CompanyTypeEnum.INDIVIDUAL.getName().equals(company.getCompanyType()) ? company.getCompanyCode().split("_")[1] : company.getCompanyCode());
}
List<IdxBizJgInspectionDetectionInfo> inspectionDetectionInfoList = idxBizJgInspectionDetectionInfoService.checkInspectionInfo(
equipmentLists.stream()
.map(v -> (String) v.get("record"))
......@@ -260,6 +260,7 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
.filter(Objects::nonNull)
.min(Date::compareTo)
.orElse(null));
}
vehicleInfoDto.setCreateDate(new Date());
vehicleInfoDto.setPromoter(reginParams.getUserModel().getUserId());
......@@ -351,12 +352,19 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
vehicleInformation.setRegDate(new Date());
vehicleInformation.setUseDate(Optional.ofNullable(String.valueOf(map.get("useDate"))).orElse(""));
vehicleInformation.setCreateUserName(reginParams.getUserModel().getRealName());
vehicleInformation.setGasNum(equipmentLists.size());
BigDecimal totalVolume = equipmentLists.stream()
vehicleInformation.setGasNum(Optional.ofNullable(equipmentLists).map(List::size).orElse(0));
BigDecimal totalVolume = Optional.ofNullable(equipmentLists)
.orElse(Collections.emptyList())
.stream()
.map(x -> new BigDecimal(String.valueOf(x.get("singleBottleVolume"))))
.reduce(BigDecimal.ZERO, BigDecimal::add);
vehicleInformation.setVolume(totalVolume.toPlainString());
vehicleInformation.setFillingMedium(equipmentLists.get(0).get("chargingMedium") + "");
String fillingMedium = Optional.ofNullable(equipmentLists)
.filter(list -> !list.isEmpty())
.map(list -> String.valueOf(list.get(0).get("chargingMedium")))
.orElse("");
vehicleInformation.setFillingMedium(fillingMedium);
boolean hasId = StringUtils.isEmpty(vehicleInfoDto.getSequenceNbr());
//新增
......
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