2021与蓝度共同重构项目,服务端
chenjiantian
2021-12-15 9797318a4c6867fb49d701c240fe877ee953d930
Merge branch 'master' of http://112.74.63.130:8088/r/XimengPole/XMPoleManager
已添加6个文件
已修改26个文件
已删除10个文件
1242 ■■■■■ 文件已修改
dao/src/main/java/com/sandu/ximon/dao/domain/ChargingPile.java 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/domain/ChargingPileOrderList.java 82 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/domain/Groups.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/domain/LCD.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/domain/LED.java 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/domain/LEDProgram.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/domain/LampPost.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/domain/MidConnectionRelation.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/domain/PlayPlan.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/domain/Pole.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/domain/SOS.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/domain/SingleLampData.java 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/mapper/ChargingPileMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/mapper/ChargingPileOrderListMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/mapper/GroupMapper.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/mapper/LEDMapper.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/mapper/LEDProgramMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/mapper/MidConnectionRelationMapper.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/mapper/SingleLampDataMapper.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/resources/mapper/ChargingPileMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/resources/mapper/ChargingPileOrderListMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/resources/mapper/GroupMapper.xml 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/resources/mapper/LEDMapper.xml 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/resources/mapper/LEDProgramMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/resources/mapper/MidConnectionRelationMapper.xml 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/resources/mapper/PlayPlanMapper.xml 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/resources/mapper/PoleMapper.xml 35 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/resources/mapper/SingleLampDataMapper.xml 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/GroupController.java 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/LEDProgramController.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/LampPostController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PoleController.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/manager/iot/amqp/InitAmqpListener.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/param/LEDProgramParam.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/param/PlayPlanParam.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/param/ReceiveParam.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/GroupService.java 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LEDProgramService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LEDService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LampPostService.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleGroupService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java 190 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/domain/ChargingPile.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,77 @@
package com.sandu.ximon.dao.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
/**
 * å……电桩列表
 * @TableName charging_pile
 */
@TableName(value ="charging_pile")
@Data
public class ChargingPile implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * ç¯æ†ID
     */
    private Long lightPoleId;
    /**
     * å……电桩名称
     */
    private String chargingPileName;
    /**
     * æ‰€å±žç¯æ†
     */
    private String belongTo;
    /**
     * åž‹å·
     */
    private String model;
    /**
     * USB口费率
     */
    private Double usbRate;
    /**
     * æ‘©æ‰˜å£è´¹çއ
     */
    private Double motorcycleRate;
    /**
     * æ±½è½¦å£è´¹çއ
     */
    private Double carRate;
    /**
     * åˆ›å»ºæ—¶é—´
     */
    private LocalDateTime createTime;
    /**
     * æ›´æ–°æ—¶é—´
     */
    private LocalDateTime updateTime;
    /**
     * ç»‘定状态
1:已绑定;0:未绑定
     */
    private Integer bindingState;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
dao/src/main/java/com/sandu/ximon/dao/domain/ChargingPileOrderList.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,82 @@
package com.sandu.ximon.dao.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
/**
 * å……电桩订单列表
 * @TableName charging_pile_order_list
 */
@TableName(value ="charging_pile_order_list")
@Data
public class ChargingPileOrderList implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     * è®¢å•号
     */
    private Long orderNumber;
    /**
     * å……电桩ID
     */
    private Long chargingPileId;
    /**
     * å……电桩名称
     */
    private String chargingPileName;
    /**
     * æ‰€å±žç¯æ†
     */
    private String belongTo;
    /**
     * æ”¯ä»˜é‡‘额
     */
    private Double payTheAmount;
    /**
     * é€€æ¬¾é‡‘额
     */
    private Double theRefundAmount;
    /**
     * è®¢å•状态
1:已支付;0:未支付
     */
    private Integer orderState;
    /**
     * åˆ›å»ºæ—¶é—´
     */
    private LocalDateTime createTime;
    /**
     * æ›´æ–°æ—¶é—´
     */
    private LocalDateTime updateTime;
    /**
     * æ”¯ä»˜æ—¶é—´
     */
    private LocalDateTime payTime;
    /**
     * å……电度数
     */
    private Double chargingDegree;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
dao/src/main/java/com/sandu/ximon/dao/domain/Groups.java
ÎļþÒÑɾ³ý
dao/src/main/java/com/sandu/ximon/dao/domain/LCD.java
ÎļþÒÑɾ³ý
dao/src/main/java/com/sandu/ximon/dao/domain/LED.java
@@ -1,21 +1,29 @@
package com.sandu.ximon.dao.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
/**
 * LED表
 * @TableName led
 */
@TableName(value ="led")
@Data
@TableName(value = "led")
public class LED implements Serializable {
    @TableId(type = IdType.AUTO)
    /**
     *
     */
    @TableId
    private Long id;
    /**
     *
     */
    private Long userId;
    /**
@@ -23,36 +31,51 @@
     */
    private Integer kind;
    /*板卡号*/
    /**
     * æ¿å¡å·
     */
    private String cardNo;
    /*名称*/
    // private String name;
    /**
     * åœ¨çº¿çŠ¶æ€ 0:在线  1:离线
     */
    private Integer state;
    /*所属灯杆*/
    private String blongsLamp;
    /**
     * æ‰€å±žç¯æ†
     */
    private Long blongsPole;
    private Long playPlanId;
    /**
     * æ’­æ”¾è®¡åˆ’id
     */
    private Long playplanId;
    /*IP地址*/
    /**
     * IP地址
     */
    private String ip;
    /*备注*/
    /**
     * å¤‡æ³¨
     */
    private String remark;
    /*灯杆ID*/
    private String lampId;
    /**
     * ç¯æ†ID
     */
    private String poleId;
    /*创建时间*/
    /**
     * åˆ›å»ºæ—¶é—´
     */
    private LocalDateTime createTime;
    /*最近交互时间*/
    /**
     * æœ€è¿‘交互时间
     */
    private LocalDateTime updateTime;
}
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
dao/src/main/java/com/sandu/ximon/dao/domain/LEDProgram.java
@@ -1,43 +1,61 @@
package com.sandu.ximon.dao.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
/**
 * LED节目列表
 * LED节目表
 * @TableName led_program
 */
@TableName(value ="led_program")
@Data
@TableName(value = "led_program")
public class LEDProgram implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     *
     */
    private Long userId;
    /*节目名称*/
    /**
     * èŠ‚ç›®åç§°
     */
    private String name;
    /*大小*/
    /**
     * å¤§å°
     */
    private Double size;
    /*尺寸*/
    /**
     * å°ºå¯¸
     */
    private String pixel;
    /**
     *
     */
    private String programBase64;
    /**
     * é€‚用型号 0:N 1:S
     */
    private Integer kind;
    private String programUel;
    /**
     *
     */
    private LocalDateTime createTime;
}
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
dao/src/main/java/com/sandu/ximon/dao/domain/LampPost.java
@@ -28,9 +28,11 @@
    private String name;
    /*所属客户*/
    @TableField(updateStrategy = FieldStrategy.IGNORED )
    private String belongsClient;
    /*客户id*/
    @TableField(updateStrategy = FieldStrategy.IGNORED )
    private Long clientId;
    /*路灯位置*/
@@ -47,6 +49,7 @@
    private String macCode;
    /*分组*/
    @TableField(updateStrategy = FieldStrategy.IGNORED )
    private String lampGroup;
    /*状态*/
dao/src/main/java/com/sandu/ximon/dao/domain/MidConnectionRelation.java
ÎļþÒÑɾ³ý
dao/src/main/java/com/sandu/ximon/dao/domain/PlayPlan.java
@@ -46,7 +46,7 @@
    /**
     * éŸ³é‡
     */
    private Double volume;
    private String volume;
    /**
     * é€‚用系列
@@ -56,31 +56,38 @@
    /**
     * æ—¥æœŸèŒƒå›´/开
     */
    private LocalDateTime onDateRange;
    private String onDateRange;
    /**
     * æ—¥æœŸèŒƒå›´/关
     */
    private LocalDateTime offDateRange;
    private String offDateRange;
    /**
     * æ˜ŸæœŸèŒƒå›´
     */
    @TableField(typeHandler = JsonIntegerArrayTypeHandler.class)
    private Integer[] weekRange;
    /**
     * å¼€æ’­æ—¶é—´
     */
    private LocalDateTime onTime;
    private String onTime;
    /**
     * ä¸‹æ’­æ—¶é—´
     */
    private LocalDateTime offTime;
    private String offTime;
    /**
     * åˆ›å»ºæ—¶é—´
     */
    private LocalDateTime createTime;
    /**
     * æ›´æ–°æ—¶é—´
     */
    private LocalDateTime updateTime;
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
dao/src/main/java/com/sandu/ximon/dao/domain/Pole.java
@@ -73,6 +73,11 @@
    private String deviceCode;
    /**
     * ç¯æ†åœ¨çº¿çŠ¶æ€
     */
    private String onLineState;
    /**
     * ç»‘定设备数量
     */
    private Integer bindingCount;
dao/src/main/java/com/sandu/ximon/dao/domain/SOS.java
ÎļþÒÑɾ³ý
dao/src/main/java/com/sandu/ximon/dao/domain/SingleLampData.java
@@ -1,58 +1,96 @@
package com.sandu.ximon.dao.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Data;
/**
 * å•灯数据
 * å•灯监控数据表
 * @TableName single_lamp_data
 */
@TableName(value ="single_lamp_data")
@Data
public class SingleLampData implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Long id;
    /**
     *
     */
    private Long userId;
    /*灯杆名称*/
    /**
     * ç¯æ†åç§°
     */
    private String lampName;
    /*市电电压*/
    /**
     * å¸‚电电压
     */
    private Double mainsVoltage;
    /*市电电流*/
    /**
     * å¸‚电电流
     */
    private Double mainsCurrent;
    /*设备温度*/
    /**
     * è®¾å¤‡æ¸©åº¦
     */
    private Double temperature;
    /*功率因数*/
    /**
     * åŠŸçŽ‡å› æ•°
     */
    private Double powerFactor;
    /*有功功率*/
    /**
     * IMEI号
     */
    private String imei;
    /**
     * ICCID号
     */
    private String iccId;
    /**
     * æœ‰åŠŸåŠŸçŽ‡
     */
    private Integer activePower;
    /*本次亮灯时间*/
    /**
     * æœ¬æ¬¡äº®ç¯æ—¶é—´
     */
    private LocalDateTime lightingTime;
    /*本次用电量*/
    private Double electricityConsumption;
    /**
     * æœ¬æ¬¡ç”¨ç”µé‡
     */
    private Double electricityEonsumption;
    /*总用电量*/
    private Double totalAlectricityConsumption;
    /**
     * æ€»ç”¨ç”µé‡
     */
    private Double totalElectricityEonsumption;
    /*灯杆亮度*/
    /**
     * ç¯æ†äº®åº¦
     */
    private Double lightPoleBrightness;
    /*更新时间*/
    /**
     * æ›´æ–°æ—¶é—´
     */
    private LocalDateTime updateTime;
}
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
dao/src/main/java/com/sandu/ximon/dao/mapper/ChargingPileMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
package com.sandu.ximon.dao.mapper;
import com.sandu.ximon.dao.domain.ChargingPile;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
 * @Entity com.sandu.ximon.dao.domain.ChargingPile
 */
@Mapper
public interface ChargingPileMapper extends BaseMapper<ChargingPile> {
}
dao/src/main/java/com/sandu/ximon/dao/mapper/ChargingPileOrderListMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,17 @@
package com.sandu.ximon.dao.mapper;
import com.sandu.ximon.dao.domain.ChargingPileOrderList;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
 * @Entity com.sandu.ximon.dao.domain.ChargingPileOrderList
 */
@Mapper
public interface ChargingPileOrderListMapper extends BaseMapper<ChargingPileOrderList> {
}
dao/src/main/java/com/sandu/ximon/dao/mapper/GroupMapper.java
ÎļþÒÑɾ³ý
dao/src/main/java/com/sandu/ximon/dao/mapper/LEDMapper.java
@@ -1,11 +1,17 @@
package com.sandu.ximon.dao.mapper;
import com.sandu.common.domain.BaseMapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sandu.ximon.dao.domain.LED;
import com.sandu.ximon.dao.domain.SingleLampData;
import org.apache.ibatis.annotations.Mapper;
/**
 * @Entity com.sandu.ximon.dao.domain.Led
 */
@Mapper
public interface LEDMapper extends BaseMapper<LED> {
}
dao/src/main/java/com/sandu/ximon/dao/mapper/LEDProgramMapper.java
@@ -1,9 +1,17 @@
package com.sandu.ximon.dao.mapper;
import com.sandu.common.domain.BaseMapper;
import com.sandu.ximon.dao.domain.LEDProgram;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
 * @Entity com.sandu.ximon.dao.domain.LEDProgram
 */
@Mapper
public interface LEDProgramMapper extends BaseMapper<LEDProgram> {
}
dao/src/main/java/com/sandu/ximon/dao/mapper/MidConnectionRelationMapper.java
ÎļþÒÑɾ³ý
dao/src/main/java/com/sandu/ximon/dao/mapper/SingleLampDataMapper.java
@@ -1,9 +1,17 @@
package com.sandu.ximon.dao.mapper;
import com.sandu.common.domain.BaseMapper;
import com.sandu.ximon.dao.domain.SingleLampData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
 * @Entity com.sandu.ximon.dao.domain.SingleLampData
 */
@Mapper
public interface SingleLampDataMapper extends BaseMapper<SingleLampData> {
}
dao/src/main/resources/mapper/ChargingPileMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sandu.ximon.dao.mapper.ChargingPileMapper">
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.ChargingPile">
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="lightPoleId" column="light_pole_id" jdbcType="BIGINT"/>
            <result property="chargingPileName" column="charging_pile_name" jdbcType="VARCHAR"/>
            <result property="belongTo" column="belong_to" jdbcType="VARCHAR"/>
            <result property="model" column="model" jdbcType="VARCHAR"/>
            <result property="usbRate" column="usb_rate" jdbcType="DOUBLE"/>
            <result property="motorcycleRate" column="motorcycle_rate" jdbcType="DOUBLE"/>
            <result property="carRate" column="car_rate" jdbcType="DOUBLE"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
            <result property="bindingState" column="binding_state" jdbcType="INTEGER"/>
    </resultMap>
</mapper>
dao/src/main/resources/mapper/ChargingPileOrderListMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.sandu.ximon.dao.mapper.ChargingPileOrderListMapper">
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.ChargingPileOrderList">
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="orderNumber" column="order_number" jdbcType="BIGINT"/>
            <result property="chargingPileId" column="charging_pile_id" jdbcType="BIGINT"/>
            <result property="chargingPileName" column="charging_pile_name" jdbcType="VARCHAR"/>
            <result property="belongTo" column="belong_to" jdbcType="VARCHAR"/>
            <result property="payTheAmount" column="pay_the_amount" jdbcType="DOUBLE"/>
            <result property="theRefundAmount" column="the_refund_amount" jdbcType="DOUBLE"/>
            <result property="orderState" column="order_state" jdbcType="INTEGER"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
            <result property="payTime" column="pay_time" jdbcType="TIMESTAMP"/>
            <result property="chargingDegree" column="charging_degree" jdbcType="DOUBLE"/>
    </resultMap>
</mapper>
dao/src/main/resources/mapper/GroupMapper.xml
ÎļþÒÑɾ³ý
dao/src/main/resources/mapper/LEDMapper.xml
@@ -5,15 +5,24 @@
<mapper namespace="com.sandu.ximon.dao.mapper.LEDMapper">
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LED">
        <id property="id" column="id" jdbcType="BIGINT"/>
        <id property="userId" column="user_id" jdbcType="BIGINT"/>
        <result property="kind" column="kind" jdbcType="INTEGER"/>
        <result property="cardNo" column="card_no" jdbcType="VARCHAR"/>
        <result property="state" column="state" jdbcType="INTEGER"/>
        <result property="remark" column="remark" jdbcType="VARCHAR"/>
        <result property="lampId" column="lamp_id" jdbcType="VARCHAR"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="userId" column="user__id" jdbcType="BIGINT"/>
            <result property="kind" column="kind" jdbcType="INTEGER"/>
            <result property="cardNo" column="card_no" jdbcType="VARCHAR"/>
            <result property="state" column="state" jdbcType="INTEGER"/>
            <result property="blongsPole" column="blongs_pole" jdbcType="BIGINT"/>
            <result property="playplanId" column="playplan_id" jdbcType="BIGINT"/>
            <result property="ip" column="ip" jdbcType="VARCHAR"/>
            <result property="remark" column="remark" jdbcType="VARCHAR"/>
            <result property="poleId" column="pole_id" jdbcType="VARCHAR"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>
</mapper>
    <sql id="Base_Column_List">
        id,user__id,kind,
        card_no,state,blongs_pole,
        playplan_id,ip,remark,
        pole_id,create_time,update_time
    </sql>
</mapper>
dao/src/main/resources/mapper/LEDProgramMapper.xml
@@ -5,13 +5,19 @@
<mapper namespace="com.sandu.ximon.dao.mapper.LEDProgramMapper">
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LEDProgram">
        <id property="id" column="id" jdbcType="BIGINT"/>
        <id property="userId" column="user_id" jdbcType="BIGINT"/>
        <result property="name" column="name" jdbcType="VARCHAR"/>
        <result property="size" column="size" jdbcType="DOUBLE"/>
        <result property="pixel" column="pixel" jdbcType="VARCHAR"/>
        <result property="kind" column="kind" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="userId" column="user_id" jdbcType="BIGINT"/>
            <result property="name" column="name" jdbcType="VARCHAR"/>
            <result property="size" column="size" jdbcType="DOUBLE"/>
            <result property="pixel" column="pixel" jdbcType="VARCHAR"/>
            <result property="programBase64" column="program_base64" jdbcType="VARCHAR"/>
            <result property="kind" column="kind" jdbcType="INTEGER"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
    </resultMap>
</mapper>
    <sql id="Base_Column_List">
        id,user_id,name,
        size,pixel,program_base64,
        kind,create_time
    </sql>
</mapper>
dao/src/main/resources/mapper/MidConnectionRelationMapper.xml
ÎļþÒÑɾ³ý
dao/src/main/resources/mapper/PlayPlanMapper.xml
@@ -10,19 +10,22 @@
            <result property="name" column="name" jdbcType="VARCHAR"/>
            <result property="ledProgramId" column="led_program_id" jdbcType="BIGINT"/>
            <result property="ledProgramName" column="led_program_name" jdbcType="VARCHAR"/>
            <result property="volume" column="volume" jdbcType="DOUBLE"/>
            <result property="volume" column="volume" jdbcType="VARCHAR"/>
            <result property="applySeries" column="apply_series" jdbcType="INTEGER"/>
            <result property="onDateRange" column="on_date_range" jdbcType="TIMESTAMP"/>
            <result property="offDateRange" column="off-date_range" jdbcType="TIMESTAMP"/>
            <result property="onDateRange" column="on_date_range" jdbcType="VARCHAR"/>
            <result property="offDateRange" column="off_date_range" jdbcType="VARCHAR"/>
            <result property="weekRange" column="week_range" typeHandler="com.sandu.common.mybatis.JsonStringArrayTypeHandler"/>
            <result property="onTime" column="on_time" jdbcType="TIMESTAMP"/>
            <result property="offTime" column="off_time" jdbcType="TIMESTAMP"/>
            <result property="onTime" column="on_time" jdbcType="VARCHAR"/>
            <result property="offTime" column="off_time" jdbcType="VARCHAR"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,user_id,name,
        led_program_id,led_program_name,volume,
        apply_series,date_range,week_range,
        on_time,off_time
        apply_series,on_date_range,off_date_range,
        week_range,on_time,off_time,
        create_time,update_time
    </sql>
</mapper>
dao/src/main/resources/mapper/PoleMapper.xml
@@ -5,27 +5,30 @@
<mapper namespace="com.sandu.ximon.dao.mapper.PoleMapper">
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.Pole">
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="poleCode" column="pole_code" jdbcType="BIGINT"/>
            <result property="poleName" column="pole_name" jdbcType="VARCHAR"/>
            <result property="clientId" column="client_id" jdbcType="BIGINT"/>
            <result property="province" column="province" jdbcType="VARCHAR"/>
            <result property="city" column="city" jdbcType="VARCHAR"/>
            <result property="region" column="region" jdbcType="VARCHAR"/>
            <result property="address" column="address" jdbcType="VARCHAR"/>
            <result property="lon" column="lon" jdbcType="DECIMAL"/>
            <result property="lat" column="lat" jdbcType="DECIMAL"/>
            <result property="deviceCode" column="device_code" jdbcType="VARCHAR"/>
            <result property="bindingCount" column="binding_count" jdbcType="INTEGER"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
        <id property="id" column="id" jdbcType="BIGINT"/>
        <result property="poleCode" column="pole_code" jdbcType="BIGINT"/>
        <result property="poleName" column="pole_name" jdbcType="VARCHAR"/>
        <result property="clientId" column="client_id" jdbcType="BIGINT"/>
        <result property="province" column="province" jdbcType="VARCHAR"/>
        <result property="city" column="city" jdbcType="VARCHAR"/>
        <result property="region" column="region" jdbcType="VARCHAR"/>
        <result property="address" column="address" jdbcType="VARCHAR"/>
        <result property="lon" column="lon" jdbcType="DECIMAL"/>
        <result property="lat" column="lat" jdbcType="DECIMAL"/>
        <result property="deviceCode" column="device_code" jdbcType="VARCHAR"/>
        <result property="onLineState" column="on_line_state" jdbcType="VARCHAR"/>
        <result property="bindingCount" column="binding_count" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>
    <sql id="Base_Column_List">
        id,pole_code,pole_name,
        id
        ,pole_code,pole_name,
        client_id,province,city,
        region,address,lon,
        lat,device_code,binding_count,
        lat,device_code,
         binding_count,on_line_state,
        create_time,update_time
    </sql>
</mapper>
dao/src/main/resources/mapper/SingleLampDataMapper.xml
@@ -5,19 +5,22 @@
<mapper namespace="com.sandu.ximon.dao.mapper.SingleLampDataMapper">
    <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.SingleLampData">
        <id property="id" column="id" jdbcType="BIGINT"/>
        <id property="userId" column="user_id" jdbcType="BIGINT"/>
        <result property="lampName" column="lamp_name" jdbcType="VARCHAR"/>
        <result property="mainsVoltage" column="mains_voltage" jdbcType="DOUBLE"/>
        <result property="mainsCurrent" column="mains_current" jdbcType="DOUBLE"/>
        <result property="temperature" column="temperature" jdbcType="DOUBLE"/>
        <result property="powerFactor" column="power_factor" jdbcType="DOUBLE"/>
        <result property="activePower" column="active_power" jdbcType="INTEGER"/>
        <result property="lightingTime" column="lighting_time" jdbcType="TIMESTAMP"/>
        <result property="electricityConsumption" column="electricity_eonsumption" jdbcType="DOUBLE"/>
        <result property="totalAlectricityConsumption" column="total_electricity_eonsumption" jdbcType="DOUBLE"/>
        <result property="lightPoleBrightness" column="light_pole_brightness" jdbcType="DOUBLE"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
            <id property="id" column="id" jdbcType="BIGINT"/>
            <result property="userId" column="user_id" jdbcType="BIGINT"/>
            <result property="lampName" column="lamp_name" jdbcType="VARCHAR"/>
            <result property="mainsVoltage" column="mains_voltage" jdbcType="DOUBLE"/>
            <result property="mainsCurrent" column="mains_current" jdbcType="DOUBLE"/>
            <result property="temperature" column="temperature" jdbcType="DOUBLE"/>
            <result property="powerFactor" column="power_factor" jdbcType="DOUBLE"/>
            <result property="imei" column="imei" jdbcType="VARCHAR"/>
            <result property="iccId" column="icc_Id" jdbcType="VARCHAR"/>
            <result property="activePower" column="active_power" jdbcType="INTEGER"/>
            <result property="lightingTime" column="lighting_time" jdbcType="TIMESTAMP"/>
            <result property="electricityEonsumption" column="electricity_eonsumption" jdbcType="DOUBLE"/>
            <result property="totalElectricityEonsumption" column="total_electricity_eonsumption" jdbcType="DOUBLE"/>
            <result property="lightPoleBrightness" column="light_pole_brightness" jdbcType="DOUBLE"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>
</mapper>
</mapper>
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/GroupController.java
ÎļþÒÑɾ³ý
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/LEDProgramController.java
@@ -8,6 +8,7 @@
import com.sandu.ximon.admin.param.LampPostParam;
import com.sandu.ximon.admin.service.LEDProgramService;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
/**
@@ -20,21 +21,14 @@
    private final LEDProgramService ledProgramService;
    @GetMapping("/add")
    public ResponseVO<Object> addLEDProgram(@RequestBody LEDProgramParam ledProgramParam) {
    public ResponseVO<Object> addLEDProgram(@RequestBody  @Validated LEDProgramParam ledProgramParam) {
        return ResponseUtil.success(ledProgramService.addProgram(ledProgramParam));
    }
    @GetMapping("/update")
    public ResponseVO<Object> updateLEDProgram( @RequestBody LEDProgramParam ledProgramParam) {
    public ResponseVO<Object> updateLEDProgram( @RequestBody @Validated LEDProgramParam ledProgramParam) {
        return ResponseUtil.success(ledProgramService.updateProgram(ledProgramParam));
    }
/*    @PostMapping("/setGroup")
    public ResponseVO<Object> setGroup(@RequestBody GroupParam groupParam){
        lampPostService.setGroup(groupParam.getGroup(), groupParam.getId());
        return ResponseUtil.success("分组设置成功");
    }*/
    @GetMapping("/delete/{id}")
    public ResponseVO<Object> deleteLEDProgram(@PathVariable Long id) {
@@ -45,9 +39,7 @@
    @PostMapping("/list")
    public ResponseVO<Object> listProgram() {
        //List<LampPost> list = lampPostService.list();
        return ResponseUtil.success(ledProgramService.list());
        //return ResponseUtil.success(lampPostService.listLamp());
    }
}
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/LampPostController.java
@@ -81,12 +81,10 @@
        LambdaQueryWrapper<LampPost> wrapper = Wrappers.lambdaQuery(LampPost.class);
        if(receiveParam.getKeyWord()!=null){
            wrapper.like(LampPost::getLampId,receiveParam.getKeyWord())
                    .or(lampPostLambdaQueryWrapper -> {
                        lampPostLambdaQueryWrapper.like(LampPost::getName,receiveParam.getKeyWord());
                    });
                    .or(lampPostLambdaQueryWrapper -> lampPostLambdaQueryWrapper.like(LampPost::getName,receiveParam.getKeyWord()));
        }
        List<LampPost> lsit= poleService.list(wrapper);
        return ResponseUtil.success(lsit);
        List<LampPost> list= poleService.list(wrapper);
        return ResponseUtil.success(list);
    }
}
ximon-admin/src/main/java/com/sandu/ximon/admin/controller/PoleController.java
@@ -55,6 +55,30 @@
        return ResponseUtil.success(list);
    }
    @GetMapping("listPoleAndState")
    public ResponseVO<Object> listPoleAndState() {
        return ResponseUtil.success(poleService.queryStatesAndList());
    }
    /**
     * è®¾ç½®ä¸‰å…ƒç 
     */
    @PostMapping("/setMac")
    public ResponseVO<Object> setMac(@PathVariable Long poleId) {
        return ResponseUtil.success(poleService.setMac(poleId));
    }
    /**
     * æ¢å¤ç¯æ†å‡ºåŽ‚è®¾ç½®
     */
    @PostMapping("/poleReset")
    public ResponseVO<Object> poleReset(@PathVariable Long poleId) {
        return ResponseUtil.success(poleService.poleReset(poleId));
    }
    /**
     * ç¯æ†ç»‘定设备
     */
ximon-admin/src/main/java/com/sandu/ximon/admin/manager/iot/amqp/InitAmqpListener.java
@@ -15,10 +15,10 @@
   private final MqttMainBoardConfig mqttMainBoardConfig;
    @PostConstruct
  /*  @PostConstruct
    public void initListener() throws Exception {
        new AmqpClient(
                mqttMainBoardConfig
        ).execute();
    }
    }*/
}
ximon-admin/src/main/java/com/sandu/ximon/admin/param/LEDProgramParam.java
@@ -3,6 +3,7 @@
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Base64;
@Data
public class LEDProgramParam {
@@ -11,10 +12,10 @@
    private Long id;
    @NotNull
    @NotNull(message = "节目名称不能为空")
    private String name;
    @NotNull
    @NotNull(message = "适用设备类型不能为空")
    private Integer kind;
    /*大小*/
@@ -24,6 +25,7 @@
    private String pixel;
    private String programUrl;
    @NotNull(message = "节目内容不能为空")
    private String programBase64;
}
ximon-admin/src/main/java/com/sandu/ximon/admin/param/PlayPlanParam.java
@@ -12,14 +12,15 @@
public class PlayPlanParam {
    @NotEmpty
    @NotEmpty(message = "播放计划名称不能为空")
    private String name;
    @NotEmpty
    @NotEmpty(message = "节目名称不能为空")
    private String ledProgramName;
    @NotEmpty
    @NotEmpty(message = "节目id不能为空")
    private Long ledProgramId;
    @NotEmpty
    private Double volume;
    @NotEmpty(message = "音量不能为空")
    //音量
    private String volume;
    /**
     * é€‚用系列
@@ -30,13 +31,13 @@
     * æ—¥æœŸèŒƒå›´/开
     */
    @NotEmpty
    private LocalDateTime onDateRange;
    private String onDateRange;
    /**
     * æ—¥æœŸèŒƒå›´/关
     */
    @NotEmpty
    private LocalDateTime offDateRange;
    private String offDateRange;
    /**
     * æ˜ŸæœŸèŒƒå›´
@@ -49,13 +50,13 @@
     * å¼€æ’­æ—¶é—´
     */
    @NotEmpty
    private LocalDateTime onTime;
    private String onTime;
    /**
     * ä¸‹æ’­æ—¶é—´
     */
    @NotEmpty
    private LocalDateTime offTime;
    private String offTime;
}
ximon-admin/src/main/java/com/sandu/ximon/admin/param/ReceiveParam.java
@@ -2,6 +2,9 @@
import lombok.Data;
/**
 * é€šç”¨çš„一个接收类
 */
@Data
public class ReceiveParam {
@@ -12,4 +15,12 @@
   private Integer kind;
   private String keyWord;
   private Integer lampPostType;
   private Integer lampPostState;
   private Integer bindState;
   private String groupName;
}
ximon-admin/src/main/java/com/sandu/ximon/admin/service/GroupService.java
ÎļþÒÑɾ³ý
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LEDProgramService.java
@@ -24,6 +24,7 @@
        }
        led.setName(receiveParam.getName());
        led.setKind(receiveParam.getKind());
        return save(led);
    }
@@ -37,9 +38,7 @@
        LEDProgram led = new LEDProgram();
        led.setId(receiveParam.getId());
        if (AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getClientId())) {
            led.setUserId(SecurityUtils.getUserId());
        }
        led.setUserId(SecurityUtils.getClientId());
        led.setName(receiveParam.getName());
        led.setKind(receiveParam.getKind());
        if (receiveParam.getPixel() != null) {
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LEDService.java
@@ -3,9 +3,13 @@
import com.sandu.common.service.impl.BaseServiceImpl;
import com.sandu.ximon.dao.domain.LED;
import com.sandu.ximon.dao.mapper.LEDMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
@Service
@AllArgsConstructor
public class LEDService extends BaseServiceImpl<LEDMapper, LED> {
    private final LEDMapper ledMapper;
}
ximon-admin/src/main/java/com/sandu/ximon/admin/service/LampPostService.java
@@ -132,6 +132,7 @@
                                    .orderType(A2OrderEnum.REQUEST_MAIN_BOARD_RESET.getCode()).build());
            if ("00".equals(rebootFrame.getPayload())) {
                lampPost.setMacCode(uniqueMac);
                save= save(lampPost);
                System.out.println("重启成功");
@@ -202,6 +203,7 @@
        for (Long id : Id
        ) {
            lampPostMapper.serGroup(group, id);
        }
        // return updateBatchById(update);
@@ -229,7 +231,7 @@
                    post.setOnLineState(deviceStatus.getStatus());
                }
            }
            MacCodes.add(post.getMacCode());
          //  MacCodes.add(post.getMacCode());
        }
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleGroupService.java
@@ -6,7 +6,6 @@
import com.sandu.ximon.admin.param.PoleGroupParam;
import com.sandu.ximon.admin.security.SecurityUtils;
import com.sandu.ximon.dao.domain.PoleGroup;
import com.sandu.ximon.dao.mapper.GroupMapper;
import com.sandu.ximon.dao.mapper.PoleGroupMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
@@ -1,14 +1,30 @@
package com.sandu.ximon.admin.service;
import com.aliyuncs.iot.model.v20180120.BatchGetDeviceStateResponse;
import com.aliyuncs.iot.model.v20180120.QueryDeviceDetailResponse;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.sandu.common.execption.BusinessException;
import com.sandu.common.redis.RedisService;
import com.sandu.common.service.impl.BaseServiceImpl;
import com.sandu.ximon.admin.manager.iot.frame.A1Frame;
import com.sandu.ximon.admin.manager.iot.frame.FrameBuilder;
import com.sandu.ximon.admin.manager.iot.frame.IRequestFrame;
import com.sandu.ximon.admin.manager.iot.frame.inner.request.A1TernaryCodeReqInnerFrame;
import com.sandu.ximon.admin.manager.iot.frame.inner.request.A5LightResetReqInnerFrame;
import com.sandu.ximon.admin.manager.iot.frame.inner.request.EmptyRequestInnerFrame;
import com.sandu.ximon.admin.manager.iot.frame.inner.response.A1DeviceMacRespInnerFrame;
import com.sandu.ximon.admin.manager.iot.frame.inner.response.A1TernaryCodeRespInnerFrame;
import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonFrame;
import com.sandu.ximon.admin.manager.iot.rrpc.dto.WrapResponseCommonFrame;
import com.sandu.ximon.admin.manager.iot.rrpc.enums.A1OrderEnum;
import com.sandu.ximon.admin.manager.iot.rrpc.enums.A2OrderEnum;
import com.sandu.ximon.admin.manager.iot.rrpc.enums.A5OrderEnum;
import com.sandu.ximon.admin.manager.iot.rrpc.mainboard.MainBoardInvokeSyncService;
import com.sandu.ximon.admin.param.PoleBindingParam;
import com.sandu.ximon.admin.param.PoleParam;
import com.sandu.ximon.admin.redis.LightKey;
import com.sandu.ximon.admin.security.SecurityUtils;
import com.sandu.ximon.dao.domain.Pole;
import com.sandu.ximon.dao.domain.PoleBinding;
import com.sandu.ximon.dao.enums.PoleBindingEnums;
import com.sandu.ximon.dao.mapper.PoleMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -16,7 +32,9 @@
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
 * ç¯æ†ç›¸å…³
@@ -79,6 +97,42 @@
        return Long.parseLong(sb.toString());
    }
    /**
     * æŸ¥è¯¢ç¯æ†çš„在线状态并赋值
     *
     * @return
     */
    public List<Pole> queryStatesAndList() {
        // List<LampPost> list = list(Wrappers.lambdaQuery(LampPost.class).eq(LampPost::getClientId, SecurityUtils.getUserId()));
        //List<Pole> list = list(Wrappers.lambdaQuery(Pole.class));
        List<Pole> list = new ArrayList<>();
        if (SecurityUtils.getClientId() == null) {
            list = list(Wrappers.lambdaQuery(Pole.class));
        } else {
            list = list(Wrappers.lambdaQuery(Pole.class).eq(Pole::getClientId, SecurityUtils.getUserId()));
        }
        List<String> MacCodes = new ArrayList<>();
        for (Pole post : list) {
            MacCodes.add(post.getDeviceCode());
        }
        List<BatchGetDeviceStateResponse.DeviceStatus> deviceStatuses = MainBoardInvokeSyncService.getInstance().batchGetDeviceState(MacCodes);
        for (Pole post : list) {
            for (BatchGetDeviceStateResponse.DeviceStatus deviceStatus : deviceStatuses) {
                if (post.getDeviceCode().equals(deviceStatus.getDeviceName())) {
                    post.setOnLineState(deviceStatus.getStatus());
                }
            }
            //  MacCodes.add(post.getDeviceCode());
        }
        return list;
    }
    /**
     * ç¯æ†ç»‘定设备
     *
@@ -91,6 +145,136 @@
        if (pole == null) {
            throw new BusinessException("未找到该灯杆");
        }
        return poleBindingService.bindPole( poleId,  param);
        return poleBindingService.bindPole(poleId, param);
    }
    /**
     * ç¯æ†æ¢å¤å‡ºåŽ‚è®¾ç½®
     *
     * @param id
     * @return
     */
    public boolean poleReset(Long id) {
        Pole byId = getById(id);
        String deviceName = byId.getDeviceCode();
        if (byId == null) {
            throw new BusinessException("未找到该灯杆");
        }
        if (deviceName.isEmpty()) {
            throw new BusinessException("该灯杆Mca为空");
        }
        IRequestFrame build = FrameBuilder.builderA5()
                .orderType(A5OrderEnum.REQUEST_LIGHT_DATA.getCode())
                .innerFrame(new A5LightResetReqInnerFrame())
                .build();
        CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance()
                .sendRRPC(deviceName, build);
        System.out.println(commonFrame.toString());
        CommonFrame rebootFrame = MainBoardInvokeSyncService.getInstance()
                .sendRRPC(deviceName,
                        FrameBuilder.builderA2().innerFrame(new EmptyRequestInnerFrame())
                                .orderType(A2OrderEnum.REQUEST_MAIN_BOARD_RESET.getCode()).build());
        if ("00".equals(rebootFrame.getPayload())) {
            System.out.println("重启成功");
        }
        CommonFrame result = MainBoardInvokeSyncService.getInstance()
                .sendRRPC(deviceName,
                        FrameBuilder.builderA2().innerFrame(new EmptyRequestInnerFrame())
                                .orderType(A2OrderEnum.REQUEST_MAIN_BOARD_RESET.getCode()).build());
        boolean b = false;
        if ("00".equals(result.getPayload())) {
            byId.setDeviceCode(null);
            b = updateById(byId);
            System.out.println("重启成功");
        }
        return b;
    }
    /**
     * ç»™ç¯æ†æ³¨å†Œä¸‰å…ƒç 
     */
    public boolean setMac(Long poleId) {
        Pole pole = getById(poleId);
        if (pole == null) {
            throw new BusinessException("未找到该灯杆");
        }
        boolean setMac = false;
        String baseMac = "baseDevice";
        A1Frame a1Frame = new A1Frame(A1OrderEnum.REQUEST_READ_DEVICE_UNIQUE_MAC.getCode(), new EmptyRequestInnerFrame());
        CommonFrame commonFrame = MainBoardInvokeSyncService.getInstance()
                .sendRRPC(baseMac, a1Frame);
        if (commonFrame == null) {
            throw new BusinessException("读取设备唯一ID失败");
        }
        A1DeviceMacRespInnerFrame a1DeviceMacRespInnerFrame = new A1DeviceMacRespInnerFrame().transformFrame(commonFrame.getPayload());
        log.info(commonFrame.toString());
        String uniqueMac = a1DeviceMacRespInnerFrame.getMac();
        uniqueMac = uniqueMac.toLowerCase();
        log.info("唯一码{}", uniqueMac);
        // 2  ä»Žé˜¿é‡Œæ³¨å†Œ
        MainBoardInvokeSyncService.getInstance().registerDevice(uniqueMac);
        // 3  èŽ·å–è®¾å¤‡è¯¦æƒ…
        QueryDeviceDetailResponse.Data deviceDetail = MainBoardInvokeSyncService.getInstance().queryDeviceDetail(uniqueMac, null);
        if (deviceDetail == null) {
            throw new BusinessException("注册失败");
        }
        log.info(deviceDetail.toString());
        // 4   é…ç½®Mac①
        WrapResponseCommonFrame<A1TernaryCodeRespInnerFrame> productKeyResp = MainBoardInvokeSyncService.getInstance()
                .sendRRPC(baseMac,
                        FrameBuilder.builderA1().innerFrame(new A1TernaryCodeReqInnerFrame(MainBoardInvokeSyncService.getInstance().getProductKey()))
                                .orderType(A1OrderEnum.REQUEST_SET_PRODUCT_KEY.getCode()).build(),
                        A1TernaryCodeRespInnerFrame.class);
        A1TernaryCodeRespInnerFrame responseInnerFrame = productKeyResp.getResponseInnerFrame();
        if (!MainBoardInvokeSyncService.getInstance().getProductKey().equals(responseInnerFrame.getTernaryCode())) {
            throw new BusinessException("设备配置ProductKey失败");
        }
        // 5   é…ç½®Mac②
        WrapResponseCommonFrame<A1TernaryCodeRespInnerFrame> responseCommonFrame = MainBoardInvokeSyncService.getInstance()
                .sendRRPC(baseMac,
                        FrameBuilder.builderA1().innerFrame(new A1TernaryCodeReqInnerFrame(uniqueMac))
                                .orderType(A1OrderEnum.REQUEST_SET_DEVICE_NAME.getCode()).build(),
                        A1TernaryCodeRespInnerFrame.class);
        A1TernaryCodeRespInnerFrame deviceNameFrame = responseCommonFrame.getResponseInnerFrame();
        if (!uniqueMac.equals(deviceNameFrame.getTernaryCode())) {
            throw new BusinessException("设备配置名失败");
        }
        // 6  é…ç½®Mac③
        WrapResponseCommonFrame<A1TernaryCodeRespInnerFrame> wrapResponseCommonFrame = MainBoardInvokeSyncService.getInstance()
                .sendRRPC(baseMac,
                        FrameBuilder.builderA1().innerFrame(new A1TernaryCodeReqInnerFrame(deviceDetail.getDeviceSecret()))
                                .orderType(A1OrderEnum.REQUEST_SET_DEVICE_SECRET.getCode()).build(),
                        A1TernaryCodeRespInnerFrame.class);
        A1TernaryCodeRespInnerFrame deviceSecretFrame = wrapResponseCommonFrame.getResponseInnerFrame();
        if (!deviceDetail.getDeviceSecret().equals(deviceSecretFrame.getTernaryCode())) {
            throw new BusinessException("设备密钥失败");
        }
        // 7  é‡å¯è®¾å¤‡  å¹¶ä½¿ç”¨æ–°çš„Mac
        CommonFrame rebootFrame = MainBoardInvokeSyncService.getInstance()
                .sendRRPC(baseMac,
                        FrameBuilder.builderA2().innerFrame(new EmptyRequestInnerFrame())
                                .orderType(A2OrderEnum.REQUEST_MAIN_BOARD_RESET.getCode()).build());
        if ("00".equals(rebootFrame.getPayload())) {
            pole.setDeviceCode(uniqueMac);
            setMac = updateById(pole);
            System.out.println("重启成功");
        }
        return setMac;
    }
}