|  |  | 
 |  |  | import com.moral.api.pojo.form.version.*; | 
 |  |  | import com.moral.api.service.VersionService; | 
 |  |  | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 
 |  |  | import com.moral.api.util.CacheUtils; | 
 |  |  | import com.moral.constant.Constants; | 
 |  |  | import com.moral.constant.ResponseCodeEnum; | 
 |  |  | import com.moral.util.ConvertUtils; | 
 |  |  | 
 |  |  |         dto.setMsg(ResponseCodeEnum.SUCCESS.getMsg()); | 
 |  |  |         return dto; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |      | 
 |  |  |     @Override | 
 |  |  |     @Transactional | 
 |  |  |     public VersionDTO update(VersionUpdateForm form) { | 
 |  |  | 
 |  |  |         Integer id = form.getId(); | 
 |  |  |         //查询型号是否被使用,如果被使用则无法删除 | 
 |  |  |         QueryWrapper<OrganizationUnitAlarm> queryWrapper = new QueryWrapper<>(); | 
 |  |  |         queryWrapper.select("id"); | 
 |  |  |         queryWrapper.eq("is_delete", Constants.NOT_DELETE); | 
 |  |  |         queryWrapper.eq("version_id", id); | 
 |  |  |         List<OrganizationUnitAlarm> organizationUnitAlarms = organizationUnitAlarmMapper.selectList(queryWrapper); | 
 |  |  | 
 |  |  |                 organizationUnitAlarmMapper.insert(organizationUnitAlarm); | 
 |  |  |             } | 
 |  |  |         } | 
 |  |  |         //刷新deviceInfo缓存 | 
 |  |  |         CacheUtils.refreshDeviceAlarmInfo(); | 
 |  |  |         //封装返回结果 | 
 |  |  |         dto.setCode(ResponseCodeEnum.SUCCESS.getCode()); | 
 |  |  |         dto.setMsg(ResponseCodeEnum.SUCCESS.getMsg()); | 
 |  |  | 
 |  |  |         return dto; | 
 |  |  |     } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | } | 
 |  |  |  |