2021与蓝度共同重构项目,服务端
fix
zhanzhiqin
2022-04-22 7c92a9851eb6bf90e3bb9e2a5059b83f12564b85
ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java
@@ -12,14 +12,20 @@
import com.sandu.ximon.admin.utils.request.PlayerProgram;
import com.sandu.ximon.admin.utils.response.VnnoxResult;
import com.sandu.ximon.admin.utils.response.VnnoxResultResponse;
import com.sandu.ximon.dao.domain.*;
import com.sandu.ximon.dao.enums.AdministratorEnums;
import com.sandu.ximon.admin.vo.NovaOpenVO;
import com.sandu.ximon.admin.vo.PlansVO;
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;
/**
 * 播放计划
@@ -33,12 +39,16 @@
    private final LedPlayerEntityService ledPlayerEntityService;
    private VnnoxAPIUtil vnnoxAPIUtil;
    private final LEDProgramService ledProgramService;
    private final ClientService clientService;
    public boolean addPlan(PlayPlanParam playPlanParam) {
        PlayPlanNv playPlan = new PlayPlanNv();
        if (AdministratorEnums.CUSTOMER.getCode().equals(SecurityUtils.getAdministratorIdentity())) {
        if (SecurityUtils.getClientId() != null) {
            playPlan.setUserId(SecurityUtils.getUserId());
            if (clientService.findClientId()) {
                playPlan.setClientId(clientService.getClientId());
            }
        }
        playPlan.setName(playPlanParam.getName());
        playPlan.setLedProgramName(playPlanParam.getLedProgramName());
@@ -109,11 +119,12 @@
        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.setSchedule(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);
        VnnoxResultResponse vnnoxResultResponse = vnnoxProgramAPIUtil.normalProgram(program);
        VnnoxResultResponse vnnoxResultResponse = vnnoxProgramAPIUtil.timeProgram(program);
        VnnoxResult vnnoxResult = vnnoxAPIUtil.volChange(playerIds, Integer.valueOf(one.getVolume()).intValue());
        // VnnoxResultResponse vnnoxResultResponse = vnnoxProgramAPIUtil.normalProgram(push);
@@ -139,12 +150,41 @@
        result.put("success", successList);
        result.put("fail", faileList);
        result.put("program", program);
        return result;
        // return program;
    }
    /**
     * 解析定时
     *
     * @param
     * @return
     */
    public List<Map<String, Object>> parseSchedule(Map map) {
        map.get("startDate");
        map.get("endDate");
        List<PlansVO> plans = (List<PlansVO>) map.get("plans");
        plans.forEach(
                plan -> {
                    NovaOpenVO Open = new NovaOpenVO();
                    Open.setStartDate(map.get("startDate").toString());
                    Open.setEndDate(map.get("endDate").toString());
                    Open.setExecTime(plan.getStartTime());
                }
        );
        NovaOpenVO Open1 = new NovaOpenVO();
        Open1.setStartDate(map.get("startDate").toString());
        Open1.setEndDate(map.get("endDate").toString());
        return null;
    }
    public Object getByPlanId(Long planId) {
        PlayPlanNv byId = getById(planId);
        if (byId == null) {