| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | */ |
| | | 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; |
| | | } |
| | |
| | | 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 programUrl; |
| | | |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | private LocalDateTime createTime; |
| | | |
| | | } |
| | | @TableField(exist = false) |
| | | private static final long serialVersionUID = 1L; |
| | | } |
| | |
| | | /** |
| | | * 音量 |
| | | */ |
| | | private Double volume; |
| | | private String volume; |
| | | |
| | | /** |
| | | * 适用系列 |
| | |
| | | /** |
| | | * 日期范围/开 |
| | | */ |
| | | 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; |
| | | |
| | | |
| | | } |
| | |
| | | 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> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | 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> { |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | <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> |
| | |
| | | <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="programUrl" column="program_url" jdbcType="VARCHAR"/> |
| | | <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> |
| | |
| | | <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> |
| | |
| | | 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.*; |
| | | |
| | | /** |
| | |
| | | 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) { |
| | |
| | | |
| | | @PostMapping("/list") |
| | | public ResponseVO<Object> listProgram() { |
| | | //List<LampPost> list = lampPostService.list(); |
| | | return ResponseUtil.success(ledProgramService.list()); |
| | | //return ResponseUtil.success(lampPostService.listLamp()); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | private final MqttMainBoardConfig mqttMainBoardConfig; |
| | | |
| | | @PostConstruct |
| | | /* @PostConstruct |
| | | public void initListener() throws Exception { |
| | | new AmqpClient( |
| | | mqttMainBoardConfig |
| | | ).execute(); |
| | | } |
| | | }*/ |
| | | } |
| | |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Base64; |
| | | |
| | | @Data |
| | | public class LEDProgramParam { |
| | |
| | | |
| | | private Long id; |
| | | |
| | | @NotNull |
| | | @NotNull(message = "节目名称不能为空") |
| | | private String name; |
| | | |
| | | @NotNull |
| | | @NotNull(message = "适用设备类型不能为空") |
| | | private Integer kind; |
| | | |
| | | /*大小*/ |
| | |
| | | private String pixel; |
| | | |
| | | |
| | | private String programUrl; |
| | | @NotNull(message = "节目内容不能为空") |
| | | private String programBase64; |
| | | |
| | | } |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 适用系列 |
| | |
| | | * 日期范围/开 |
| | | */ |
| | | @NotEmpty |
| | | private LocalDateTime onDateRange; |
| | | private String onDateRange; |
| | | |
| | | /** |
| | | * 日期范围/关 |
| | | */ |
| | | @NotEmpty |
| | | private LocalDateTime offDateRange; |
| | | private String offDateRange; |
| | | |
| | | /** |
| | | * 星期范围 |
| | |
| | | * 开播时间 |
| | | */ |
| | | @NotEmpty |
| | | private LocalDateTime onTime; |
| | | private String onTime; |
| | | |
| | | /** |
| | | * 下播时间 |
| | | */ |
| | | @NotEmpty |
| | | private LocalDateTime offTime; |
| | | private String offTime; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | led.setName(receiveParam.getName()); |
| | | led.setKind(receiveParam.getKind()); |
| | | |
| | | return save(led); |
| | | } |
| | | |
| | |
| | | |
| | | 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) { |
| | |
| | | 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; |
| | | |
| | | } |