| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.ximon.admin.param.C3mChargingChargeParam; |
| | | import com.sandu.ximon.dao.domain.C3mChargingCharge; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.mapper.C3mChargingChargeMapper; |
| | | import com.sandu.ximon.dao.mapper.C3mChargingMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | @AllArgsConstructor |
| | | public class C3mChargingChargeService extends BaseServiceImpl<C3mChargingChargeMapper, C3mChargingCharge> { |
| | | private final C3mChargingChargeMapper c3mChargingChargeMapper; |
| | | private final PoleBindingService bindingService; |
| | | private final C3mChargingMapper chargingMapper; |
| | | |
| | | /** |
| | | * 修改费率 |
| | |
| | | |
| | | /** |
| | | * 插入费率 |
| | | * |
| | | * @param c3 |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 自动插入默认费率 |
| | | * |
| | | * @param c3Id |
| | | */ |
| | | public void initCharge(Integer c3Id) { |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 根据灯杆id查找费率 |
| | | * @param poleId |
| | | * @return |
| | | */ |
| | | public List<C3mChargingCharge> getChargeByPoleId(Long poleId) { |
| | | PoleBinding one = bindingService.getOne(Wrappers.lambdaQuery(PoleBinding.class).eq(PoleBinding::getDeviceType, 2).eq(PoleBinding::getPoleId, poleId)); |
| | | if (one == null) { |
| | | throw new BusinessException("未找到绑定关系"); |
| | | } |
| | | Long c3Id = chargingMapper.getAllByC3Mac(one.getDeviceCode()).getC3Id(); |
| | | return getChargeByC3Id(c3Id.intValue()); |
| | | } |
| | | } |