Commit 198ab1a8 authored by 韩桐桐's avatar 韩桐桐

fix(jg):车用气瓶发动机号唯一性校验

parent b138accd
...@@ -148,7 +148,7 @@ public class JgVehicleInformationDto extends BaseDto { ...@@ -148,7 +148,7 @@ public class JgVehicleInformationDto extends BaseDto {
@ApiModelProperty(value = "号牌号码") @ApiModelProperty(value = "号牌号码")
private String carNumber; private String carNumber;
@ApiModelProperty(value = "识别代码") @ApiModelProperty(value = "车架号码")
private String identificationCode; private String identificationCode;
@ApiModelProperty(value = "发动机号") @ApiModelProperty(value = "发动机号")
......
...@@ -275,7 +275,7 @@ public class JgVehicleInformation extends BaseEntity { ...@@ -275,7 +275,7 @@ public class JgVehicleInformation extends BaseEntity {
private String carNumber; private String carNumber;
/** /**
* 识别代 * 车架号
*/ */
@TableField("identification_code") @TableField("identification_code")
private String identificationCode; private String identificationCode;
......
...@@ -138,7 +138,7 @@ public class JgVehicleInformationVo implements Serializable { ...@@ -138,7 +138,7 @@ public class JgVehicleInformationVo implements Serializable {
@ApiModelProperty(value = "号牌号码") @ApiModelProperty(value = "号牌号码")
private String carNumber; private String carNumber;
@ApiModelProperty(value = "识别代码") @ApiModelProperty(value = "车架号码")
private String identificationCode; private String identificationCode;
@ApiModelProperty(value = "发动机号") @ApiModelProperty(value = "发动机号")
......
...@@ -145,13 +145,22 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform ...@@ -145,13 +145,22 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
throw new LocalBadRequest("车牌号码已存在,请重新输入!"); throw new LocalBadRequest("车牌号码已存在,请重新输入!");
} }
// 【A109】 车用气瓶登记业务 识别代码 校验唯一性 // 发动机号 字段的唯一性校验
LambdaQueryWrapper<JgVehicleInformation> engineWrapper = new LambdaQueryWrapper<>();
engineWrapper.eq(JgVehicleInformation::getEngineNumber, vehicleInfoDto.getEngineNumber());
engineWrapper.ne(!ValidationUtil.isEmpty(vehicleInfoDto.getSequenceNbr()), JgVehicleInformation::getSequenceNbr, vehicleInfoDto.getSequenceNbr());
Integer enginecount = this.baseMapper.selectCount(engineWrapper);
if (enginecount > 0) {
throw new LocalBadRequest("发动机号已存在,请重新输入!");
}
// 【A109】 车用气瓶登记业务 车架号 校验唯一性
LambdaQueryWrapper<JgVehicleInformation> informationLambdaQueryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<JgVehicleInformation> informationLambdaQueryWrapper = new LambdaQueryWrapper<>();
informationLambdaQueryWrapper.eq(JgVehicleInformation::getIdentificationCode, vehicleInfoDto.getIdentificationCode()); informationLambdaQueryWrapper.eq(JgVehicleInformation::getIdentificationCode, vehicleInfoDto.getIdentificationCode());
informationLambdaQueryWrapper.eq(JgVehicleInformation::getIsDelete, false); informationLambdaQueryWrapper.eq(JgVehicleInformation::getIsDelete, false);
Integer identificationCodeCount = this.baseMapper.selectCount(informationLambdaQueryWrapper); Integer identificationCodeCount = this.baseMapper.selectCount(informationLambdaQueryWrapper);
if (identificationCodeCount > 0) { if (identificationCodeCount > 0) {
throw new BadRequest("识别代码已存在,请重新输入!"); throw new BadRequest("车架号已存在,请重新输入!");
} }
// 使用单位信息 // 使用单位信息
......
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