Commit 5821a3fe authored by suhuiguang's avatar suhuiguang

Merge branch 'develop_tzs_register' of…

Merge branch 'develop_tzs_register' of http://36.40.66.175:5000/moa/amos-boot-biz into develop_tzs_register
parents 2280bcde 39a5a130
...@@ -213,4 +213,16 @@ public class JgVehicleInformationDto extends BaseDto { ...@@ -213,4 +213,16 @@ public class JgVehicleInformationDto extends BaseDto {
@ApiModelProperty(value = "下次检验日期") @ApiModelProperty(value = "下次检验日期")
private Date nextInspectionDate; private Date nextInspectionDate;
@ApiModelProperty(value = "安全员ID")
private String safetyManagerId;
@ApiModelProperty(value = "安全员名称")
private String safetyManagerName;
@ApiModelProperty(value = "产权单位Code")
private String estateUnitCreditCode;
@ApiModelProperty(value = "产权单位名称")
private String estateUnitName;
} }
...@@ -393,4 +393,16 @@ public class JgVehicleInformation extends BaseEntity { ...@@ -393,4 +393,16 @@ public class JgVehicleInformation extends BaseEntity {
*/ */
@TableField("next_inspection_date") @TableField("next_inspection_date")
private Date nextInspectionDate; private Date nextInspectionDate;
@TableField(value = "safety_manager_id")
private String safetyManagerId;
@TableField(value = "safety_manager_name")
private String safetyManagerName;
@TableField(value = "estate_unit_credit_code")
private String estateUnitCreditCode;
@TableField(value = "estate_unit_name")
private String estateUnitName;
} }
...@@ -125,11 +125,21 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -125,11 +125,21 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
JgVehicleInformationDto vehicleInfoDto = JSON.parseObject(JSON.toJSONString(map), JgVehicleInformationDto.class); JgVehicleInformationDto vehicleInfoDto = JSON.parseObject(JSON.toJSONString(map), JgVehicleInformationDto.class);
List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) map.get("equipmentLists"); List<Map<String, Object>> equipmentLists = (List<Map<String, Object>>) map.get("equipmentLists");
if (CollectionUtils.isEmpty(equipmentLists) || equipmentLists.stream() if (CollectionUtils.isEmpty(equipmentLists) ||
.map(v -> (String) v.get("EQU_DEFINE_CODE")) equipmentLists.stream().map(v -> (String) v.get("chargingMedium")).distinct().count() != 1) {
.distinct() throw new BadRequest(CollectionUtils.isEmpty(equipmentLists) ? "请选择设备信息!" : "请选择相同充装介质设备!");
.count() != 1) { }
throw new BadRequest(CollectionUtils.isEmpty(equipmentLists) ? "请选择设备信息!" : "请选择相同设备种类!");
List<IdxBizJgInspectionDetectionInfo> inspectionDetectionInfoList = idxBizJgInspectionDetectionInfoService.checkInspectionInfo(
equipmentLists.stream()
.map(v -> (String) v.get("record"))
.collect(Collectors.toList())
);
if (!CylinderTypeEnum.CYLINDER.getCode().equals(map.get("equCategory")) && inspectionDetectionInfoList.stream().anyMatch(info ->
ObjectUtils.isEmpty(info) || ObjectUtils.isEmpty(info.getInspectType()) ||
ObjectUtils.isEmpty(info.getInspectConclusion()) || ObjectUtils.isEmpty(info.getInspectOrgCode()) ||
ObjectUtils.isEmpty(info.getInspectOrgName()))) {
throw new BadRequest("请补充设备检验检测信息后提交!");
} }
CompanyBo company = reginParams.getCompany(); CompanyBo company = reginParams.getCompany();
...@@ -195,6 +205,34 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -195,6 +205,34 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
vehicleInfoDto.setOrgBranchName(splitOrgBranchCode[1]); vehicleInfoDto.setOrgBranchName(splitOrgBranchCode[1]);
} }
// 安全管理员
Optional.ofNullable(map.getString("safetyManager"))
.filter(manager -> manager.contains("_"))
.map(manager -> manager.split("_"))
.ifPresent(data -> {
vehicleInfoDto.setSafetyManagerId(data[0]);
vehicleInfoDto.setSafetyManagerName(data[1]);
});
//属地监管部门
if (!StringUtils.isEmpty(vehicleInfoDto.getOrgBranchCode())) {
String[] splitOrgBranchCode = vehicleInfoDto.getOrgBranchCode().split("_");
vehicleInfoDto.setOrgBranchCode(splitOrgBranchCode[0]);
vehicleInfoDto.setOrgBranchName(splitOrgBranchCode[1]);
}
// 产权单位信息
if (!StringUtils.isEmpty(vehicleInfoDto.getEstateUnitName())) {
String[] data = String.valueOf(map.getString("estateUnitName")).split("_");
vehicleInfoDto.setEstateUnitCreditCode(data[0]);
vehicleInfoDto.setEstateUnitName(data[1]);
}
// 其他附件
if (!ObjectUtils.isEmpty(map.get("otherAccessories"))) {
vehicleInfoDto.setOtherAccessories(JSONObject.toJSONString(map.get("otherAccessories")));
}
JgVehicleInformation vehicleInformation = new JgVehicleInformation(); JgVehicleInformation vehicleInformation = new JgVehicleInformation();
BeanUtils.copyProperties(vehicleInfoDto, vehicleInformation); BeanUtils.copyProperties(vehicleInfoDto, vehicleInformation);
vehicleInformation.setCreateUserId(reginParams.getUserModel().getUserId()); vehicleInformation.setCreateUserId(reginParams.getUserModel().getUserId());
......
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