2021与蓝度共同重构项目,服务端
liuhaonan
2022-04-22 2bd99e4b0cb672923d74cd46e21228f989e7b2d8
首页
已修改7个文件
81 ■■■■■ 文件已修改
dao/src/main/java/com/sandu/ximon/dao/mapper/PoleMapper.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/resources/mapper/PoleMapper.xml 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/dto/SchedulesDTO.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ximon-admin/src/main/java/com/sandu/ximon/admin/utils/request/PlayerProgram.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
dao/src/main/java/com/sandu/ximon/dao/mapper/PoleMapper.java
@@ -10,6 +10,8 @@
@Mapper
public interface PoleMapper extends BaseMapper<Pole> {
   boolean updateDeviceCode(Long id);
}
dao/src/main/resources/mapper/PoleMapper.xml
@@ -5,31 +5,37 @@
<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="deviceType" column="device_type" jdbcType="INTEGER"/>
            <result property="userId" column="user_id" jdbcType="BIGINT"/>
            <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"/>
        <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="deviceType" column="device_type" jdbcType="INTEGER"/>
        <result property="userId" column="user_id" jdbcType="BIGINT"/>
        <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,
        device_type,user_id,client_id,
        province,city,region,
        address,lon,lat,
        device_code,on_line_state,binding_count,
        create_time,update_time
    </sql>
    <update id="updateDeviceCode" parameterType="java.lang.Long">
        UPDATE pole
        SET device_code=null
        WHERE id = #{id}
    </update>
</mapper>
ximon-admin/src/main/java/com/sandu/ximon/admin/dto/SchedulesDTO.java
@@ -2,14 +2,12 @@
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@NoArgsConstructor
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public  class SchedulesDTO {
public class SchedulesDTO {
    private String startDate;
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java
@@ -14,14 +14,18 @@
import com.sandu.ximon.admin.utils.response.VnnoxResultResponse;
import com.sandu.ximon.admin.vo.NovaOpenVO;
import com.sandu.ximon.admin.vo.PlansVO;
import com.sandu.ximon.dao.domain.*;
import com.sandu.ximon.dao.enums.AdministratorEnums;
import com.sandu.ximon.dao.domain.LEDProgram;
import com.sandu.ximon.dao.domain.LedPlayerEntity;
import com.sandu.ximon.dao.domain.PlayPlanNv;
import com.sandu.ximon.dao.domain.PushToLed;
import com.sandu.ximon.dao.mapper.PlayPlanNvMapper;
import lombok.AllArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 播放计划
@@ -40,9 +44,9 @@
    public boolean addPlan(PlayPlanParam playPlanParam) {
        PlayPlanNv playPlan = new PlayPlanNv();
        if (SecurityUtils.getClientId()!=null){
        if (SecurityUtils.getClientId() != null) {
            playPlan.setUserId(SecurityUtils.getUserId());
            if(clientService.findClientId()){
            if (clientService.findClientId()) {
                playPlan.setClientId(clientService.getClientId());
            }
        }
@@ -115,9 +119,8 @@
        program.setPlayerIds(playerIds);
        System.out.println(pushToLed.getPages());
        System.out.println(JSON.parseArray(pushToLed.getPages(), Map.class));
        program.setPages(JSON.parseObject(pushToLed.getPages(), List.class));
        program.setSchedules(JSON.parseObject(pushToLed.getSchedule(), Map.class));
        program.setSchedules(JSON.parseObject(pushToLed.getSchedule(), List.class));
        Map map = JSON.parseObject(pushToLed.getSchedule(), Map.class);
        program.setNoticeUrl(VnnoxConstant.NOTIFY_URL);
@@ -156,6 +159,7 @@
    /**
     * 解析定时
     *
     * @param
     * @return
     */
@@ -176,7 +180,6 @@
        NovaOpenVO Open1 = new NovaOpenVO();
        Open1.setStartDate(map.get("startDate").toString());
        Open1.setEndDate(map.get("endDate").toString());
        return null;
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleBindingService.java
@@ -62,8 +62,7 @@
                PoleService poleService = SpringContextHolder.getBean(PoleService.class);
                Pole pole = poleService.getOne(Wrappers.lambdaQuery(Pole.class).eq(Pole::getId, one.getPoleId()));
                if (pole != null) {
                    pole.setDeviceCode(null);
                    poleService.updateById(pole);
                    poleService.updateDeviceCode(pole.getId());
                }
            }
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
@@ -57,6 +57,7 @@
    private final PoleBindingService poleBindingService;
    private final PoleGroupRelationService groupRelationService;
    private final ClientService clientService;
    private final PoleMapper poleMapper;
    public boolean addPole(PoleParam param) {
        Pole pole = new Pole();
@@ -849,4 +850,9 @@
//        return energy;
//    }
   public boolean updateDeviceCode(Long poleId){
       return poleMapper.updateDeviceCode(poleId);
    }
}
ximon-admin/src/main/java/com/sandu/ximon/admin/utils/request/PlayerProgram.java
@@ -1,6 +1,7 @@
package com.sandu.ximon.admin.utils.request;
import com.sandu.ximon.admin.config.VnnoxConstant;
import com.sandu.ximon.admin.dto.SchedulesDTO;
import lombok.Data;
import java.util.List;
@@ -15,7 +16,7 @@
    //  需要处理的播放器ID集合,最多支持100个播放器同时处理
    private List<String> playerIds;
    //  播放时间排期,如果为空,会全天24小时循环播放
    private  Map schedules;
    private  List<SchedulesDTO> schedules;
    //  需要播放的页面内容集合
    private  List<Map<String,Object>> pages ;
    //  节目下载进度通知接口,会通过此接口将节目的下载进度发给客户,接口的响应时间不能超过3s