2021与蓝度共同重构项目,服务端
liuhaonan
2022-08-12 a49a6a80a76b2642232b887dd646a255cf5eaa4e
ximon-admin/src/main/java/com/sandu/ximon/admin/service/C3ChargingService.java
@@ -28,6 +28,7 @@
import com.sandu.ximon.admin.vo.EquipmentInfomation;
import com.sandu.ximon.dao.bo.C3ChargingBo;
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;
@@ -172,7 +173,7 @@
     *
     * @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();
        }
@@ -181,12 +182,38 @@
        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;
@@ -264,9 +291,9 @@
        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;
    }