‘liusuyi’
2023-09-04 2a5cdf98e669f724758865135f5fefabf7c8f185
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) {