Commit 2280bcde authored by suhuiguang's avatar suhuiguang

1.增加校验A110

parent bc3b6040
......@@ -25,4 +25,6 @@ public interface JgVehicleInformationMapper extends BaseMapper<JgVehicleInformat
@MapKey("id")
List<Map<String, Object>> selectEquipList(@Param("id")Long id);
Long countVesselCylinderIsUsedNumber(@Param("vehicleId") Long currentVehicleId, @Param("equIds") List<String> records);
}
......@@ -186,4 +186,23 @@
WHERE tjvie.vehicle_id = #{id}
</select>
<select id="countVesselCylinderIsUsedNumber" resultType="java.lang.Long">
SELECT
count(1)
FROM
tzs_jg_vehicle_information v,
tzs_jg_vehicle_information_eq ve
WHERE
v.sequence_nbr = ve.vehicle_id
and ve.equ_id = ui."RECORD"
and v.status !='使用单位待提交'
and v.status !='一级受理已驳回'
and v.status !='使用单位已撤回'
and v.sequence_nbr !=#{vehicleId}
and ve.equ_id in
<foreach collection="records" item="record" open="(" close=")" separator=",">
#{record}
</foreach>
</select>
</mapper>
......@@ -940,4 +940,11 @@ public class JgVehicleInformationServiceImpl extends BaseService<JgVehicleInform
useFlagParamDto.setInspectionUnitName(vehicleInformation.getInspectUnitName());
return useFlagParamDto;
}
private void checkVesselCylinderIsUsed(Long currentVehicleId, List<String> records){
Long usedNumber = this.getBaseMapper().countVesselCylinderIsUsedNumber(currentVehicleId, records);
if(usedNumber > 0){
throw new BadRequest("存在已经登记过的气瓶!");
}
}
}
\ No newline at end of file
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