| | |
| | | import com.sandu.ximon.dao.mapper.PoleBindingMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean bindPole(Long poleId, PoleBindingParam param) { |
| | | Integer deviceType = param.getDeviceType(); |
| | | |
| | |
| | | case PoleBindingEnums.LIGHT: |
| | | size = SpringContextHolder.getBean(LightService.class).list(Wrappers.lambdaQuery(Light.class).eq(Light::getDeviceCode, param.getDeviceCode())).size(); |
| | | break; |
| | | case PoleBindingEnums.PLC: |
| | | size = SpringContextHolder.getBean(PlcService.class).list(Wrappers.lambdaQuery(Plc.class).eq(Plc::getDeviceCode, param.getDeviceCode())).size(); |
| | | break; |
| | | case PoleBindingEnums.VONNOX: |
| | | size = SpringContextHolder.getBean(LedPlayerEntityService.class).list(Wrappers.lambdaQuery(LedPlayerEntity.class).eq(LedPlayerEntity::getSn, param.getDeviceCode())).size(); |
| | | break; |