ard-work/src/main/java/com/ruoyi/alarm/global/service/impl/GlobalAlarmServiceImpl.java
@@ -283,7 +283,7 @@ GlobalAlarmData globalAlarmData = new GlobalAlarmData() .setId(ardAlarmWall.getId()) .setName(ardAlarmWall.getWallName()) .setAlarmTime(ardAlarmWall.getCreateTime()) .setAlarmTime(ardAlarmWall.getAlarmTime()) .setLongitude(ardAlarmWall.getLongitude()) .setLatitude(ardAlarmWall.getLatitude()) .setCount(ardAlarmWall.getCount()) ard-work/src/main/java/com/ruoyi/alarmpoints/well/mapper/ArdAlarmpointsWellMapper.java
@@ -85,7 +85,7 @@ * @return 结果 */ public boolean checkWellIdExists(String wellId); public ArdAlarmpointsWell checkWellIdExists(String wellId); List<ArdAlarmpointsWell> wellByPlanId(String id); ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/IArdAlarmpointsWellService.java
@@ -98,6 +98,15 @@ */ public void checkWellAllowed(ArdAlarmpointsWell well); /** * 核对井号是否唯一 * * @param id 需要核对的井的主键 * @return 结果 */ public Boolean checkWellIdExists(ArdAlarmpointsWell well); List<ArdAlarmpointsWell> wellByDeptList(List<Long> deptList); ArdAlarmpointsWell wellById(String id); ard-work/src/main/java/com/ruoyi/alarmpoints/well/service/impl/ArdAlarmpointsWellServiceImpl.java
@@ -94,7 +94,7 @@ @Override @Transactional public int insertArdAlarmpointsWell(ArdAlarmpointsWell ardAlarmpointsWell) { boolean wellIdExists = ardAlarmpointsWellMapper.checkWellIdExists(ardAlarmpointsWell.getWellId()); boolean wellIdExists = checkWellIdExists(ardAlarmpointsWell); if(wellIdExists) { throw new RuntimeException("井号已存在"); @@ -115,7 +115,7 @@ @Override @Transactional public int updateArdAlarmpointsWell(ArdAlarmpointsWell ardAlarmpointsWell) { boolean wellIdExists = ardAlarmpointsWellMapper.checkWellIdExists(ardAlarmpointsWell.getWellId()); boolean wellIdExists = checkWellIdExists(ardAlarmpointsWell); if(wellIdExists) { throw new RuntimeException("井号已存在"); @@ -230,7 +230,25 @@ } } } /** * 核对井号是否唯一 * * @param wellId 需要核对的井号 * @return 结果 */ @Override public Boolean checkWellIdExists(ArdAlarmpointsWell well) { // 校验:wellId String id = (well.getId() == null) ? "" : well.getId(); String wellId = well.getWellId(); ArdAlarmpointsWell ardAlarmpointsWell = ardAlarmpointsWellMapper.checkWellIdExists(wellId); String infoId = (ardAlarmpointsWell == null) ? "" : (ardAlarmpointsWell.getId()); if ((ardAlarmpointsWell != null) && !((infoId).equals(id))) { //已存在 return true; } return false; } @Override public List<ArdAlarmpointsWell> wellByDeptList(List<Long> deptList) { ard-work/src/main/resources/mapper/alarmpoints/ArdAlarmpointsWellMapper.xml
@@ -198,10 +198,8 @@ #{id} </foreach> </delete> <select id="checkWellIdExists" resultType="boolean"> SELECT COUNT(*) FROM ard_alarmpoints_well WHERE well_id = #{wellId} <select id="checkWellIdExists" resultType="ArdAlarmpointsWell"> SELECT * FROM ard_alarmpoints_well WHERE well_id = #{wellId} limit 1 </select> <select id="wellByPlanId" parameterType="String" resultMap="wellResult">