| | |
| | | package com.sandu.ximon.admin.service; |
| | | |
| | | import cn.hutool.core.util.PageUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.sandu.common.domain.CommonPage; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.config.C3mRedisConfig; |
| | | import com.sandu.ximon.admin.controller.C3mChargingChargeController; |
| | | import com.sandu.ximon.admin.dto.ChargingDto; |
| | | import com.sandu.ximon.admin.manager.iot.frame.A5Frame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.report.A5C3HeartbeatReportInnerFrame; |
| | |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.admin.vo.EquipmentInfomation; |
| | | import com.sandu.ximon.dao.bo.C3ChargingBo; |
| | | import com.sandu.ximon.dao.domain.C3mCharging; |
| | | import com.sandu.ximon.dao.domain.C3mChargingCharge; |
| | | import com.sandu.ximon.dao.domain.C3mOrder; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.enums.OrderStatus; |
| | | import com.sandu.ximon.dao.domain.*; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.enums.OrderStatus; |
| | | import com.sandu.ximon.dao.mapper.C3mChargingMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 保存上报C3充电设备心跳数据 |
| | | * 保存上报C3充电设备 |
| | | * |
| | | * @return 是否成功 |
| | | */ |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | public Map getC3ChargingListByKeyword(BaseConditionVO baseConditionVO, C3ChargingParam c3ChargingParam) { |
| | | public Map getC3ChargingListByKeyword(BaseConditionVO baseConditionVO, C3ChargingParam c3ChargingParam, Integer order, Integer seq) { |
| | | if (c3ChargingParam == null) { |
| | | c3ChargingParam = new C3ChargingParam(); |
| | | } |
| | |
| | | if (c3ChargingParam.getKeyword() != null) { |
| | | c3ChargingParam.setKeyword(c3ChargingParam.getKeyword().trim()); |
| | | } |
| | | //排序字段 |
| | | String orderByResult = "t1.c3_id"; |
| | | //正序、倒叙 |
| | | String orderBySeq = OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | | switch (order) { |
| | | case 1: |
| | | orderByResult = OrderByEnums.CHARGE_POLE_CREATE_TIME.getCode(); |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | if (seq != null) { |
| | | switch (seq) { |
| | | case 1: |
| | | orderBySeq = " ASC"; |
| | | break; |
| | | case 2: |
| | | orderBySeq = " DESC"; |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | //排序方式 |
| | | String orderBy = orderByResult + " " + orderBySeq; |
| | | |
| | | List<C3ChargingBo> c3ChargingBoList; |
| | | if (SecurityUtils.getClientId() == null) { |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(c3ChargingParam.getKeyword(), null); |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(c3ChargingParam.getKeyword(), null, orderBy); |
| | | } else { |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(c3ChargingParam.getKeyword(), SecurityUtils.getUserId()); |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(c3ChargingParam.getKeyword(), SecurityUtils.getUserId(), orderBy); |
| | | } |
| | | //在线数量 |
| | | int onlineNumber = 0; |
| | |
| | | |
| | | List<C3ChargingBo> c3ChargingBoList; |
| | | if (SecurityUtils.getClientId() == null) { |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(null, null); |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(null, null, "c3_id ASC"); |
| | | } else { |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(null, SecurityUtils.getUserId()); |
| | | c3ChargingBoList = c3mChargingMapper.listC3mChargingDto(null, SecurityUtils.getUserId(), "c3_id ASC"); |
| | | } |
| | | return c3ChargingBoList; |
| | | } |