dao/src/main/java/com/sandu/ximon/dao/domain/LedPlayerEntity.java
@@ -22,10 +22,16 @@ private Long id; /** * 播放器名称(database) */ private String name; /** * 播放器名称(server) */ private String playerName; /** * 播放器ID(Vnnox) */ dao/src/main/resources/mapper/LedPlayerEntityMapper.xml
@@ -5,18 +5,21 @@ <mapper namespace="com.sandu.ximon.dao.mapper.LedPlayerEntityMapper"> <resultMap id="BaseResultMap" type="com.sandu.ximon.dao.domain.LedPlayerEntity"> <id property="id" column="id" jdbcType="BIGINT"/> <result property="playerName" column="player_name" jdbcType="VARCHAR"/> <result property="playerId" column="player_id" jdbcType="VARCHAR"/> <result property="sn" column="sn" jdbcType="VARCHAR"/> <result property="createTimestamp" column="create_timestamp" jdbcType="BIGINT"/> <id property="id" column="id" jdbcType="BIGINT"/> <result property="name" column="name" jdbcType="VARCHAR"/> <result property="playerName" column="player_name" jdbcType="VARCHAR"/> <result property="playerId" column="player_id" jdbcType="VARCHAR"/> <result property="sn" column="sn" jdbcType="VARCHAR"/> <result property="createTimestamp" column="create_timestamp" jdbcType="BIGINT"/> </resultMap> <sql id="Base_Column_List"> id,player_name,player_id, id ,player_name,player_id, sn,create_timestamp </sql> <insert id="saveLed" parameterType="com.sandu.ximon.dao.domain.LedPlayerEntity"> insert into led (player_name,player_id,sn,create_timestamp) values (#{playerName},#{playerId},#{sn},#{createTimestamp}) insert into led (player_name, player_id, sn, create_timestamp) values (#{playerName}, #{playerId}, #{sn}, #{createTimestamp}) </insert> </mapper> ximon-admin/src/main/java/com/sandu/ximon/admin/controller/VnnoxController.java
@@ -105,6 +105,18 @@ return ResponseUtil.success(ledV2RegisterResultEntity); } @PostMapping("/updateLedName/{id}") public ResponseVO<Object> updateLedName(@PathVariable Long id,@RequestBody Map map) { String name = (String)map.get("name"); boolean b = vnnoxService.updateDataName(id, name); if(b){ return ResponseUtil.success("更改成功"); }{ return ResponseUtil.success("更改失败"); } } @GetMapping("/list") public ResponseVO<Object> list(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { ximon-admin/src/main/java/com/sandu/ximon/admin/service/LedPlayerEntityService.java
@@ -20,6 +20,9 @@ public LedPlayerEntity getBySn(String sn){ return getOne(Wrappers.lambdaQuery(LedPlayerEntity.class).eq(LedPlayerEntity::getSn, sn)); } public LedPlayerEntity getByPlayerId(String playerId){ return getOne(Wrappers.lambdaQuery(LedPlayerEntity.class).eq(LedPlayerEntity::getPlayerId,playerId)); } public boolean saveLed(LedPlayerEntity ledPlayerEntity){ return ledPlayerEntityMapper.saveLed(ledPlayerEntity); ximon-admin/src/main/java/com/sandu/ximon/admin/service/PlayPlanNvService.java
@@ -1,6 +1,7 @@ package com.sandu.ximon.admin.service; import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.sandu.common.execption.BusinessException; import com.sandu.common.service.impl.BaseServiceImpl; import com.sandu.ximon.admin.config.VnnoxConstant; @@ -9,6 +10,8 @@ import com.sandu.ximon.admin.utils.VnnoxProgramAPIUtil; import com.sandu.ximon.admin.utils.request.PlayerProgram; import com.sandu.ximon.admin.utils.response.VnnoxResultResponse; import com.sandu.ximon.dao.domain.BroadcastV2TaskTerminal; 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.enums.AdministratorEnums; @@ -17,10 +20,7 @@ import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.*; /** * 播放计划 @@ -31,6 +31,7 @@ private final PlayPlanNvMapper playPlanMapper; private final VnnoxProgramAPIUtil vnnoxProgramAPIUtil; private final LedPlayerEntityService ledPlayerEntityService; public boolean addPlan(PlayPlanParam playPlanParam) { @@ -117,8 +118,17 @@ List<String> success = vnnoxResultResponse.getData().getSuccess(); List<String> fail = vnnoxResultResponse.getData().getFail(); Map<String,Object> result=new HashMap<>(); result.put("success",success); result.put("fail",fail); List<LedPlayerEntity> successList= new ArrayList<>(); List<LedPlayerEntity> faileList= new ArrayList<>(); for (String playerId:success){ successList.add(ledPlayerEntityService.getByPlayerId(playerId)); } for (String playerId:fail){ faileList.add( ledPlayerEntityService.getByPlayerId(playerId)); } result.put("success",successList); result.put("fail",faileList); return result; // return program; ximon-admin/src/main/java/com/sandu/ximon/admin/service/PoleService.java
@@ -206,8 +206,6 @@ /** * 给灯杆注册三元码 */ public boolean setMac(String baseMac) { // public boolean setMac() { //Pole pole = getById(poleId); ximon-admin/src/main/java/com/sandu/ximon/admin/service/VnnoxService.java
@@ -1,5 +1,6 @@ package com.sandu.ximon.admin.service; import com.sandu.common.execption.BusinessException; import com.sandu.ximon.admin.config.VnnoxConstant; import com.sandu.ximon.admin.utils.RedisUtils; import com.sandu.ximon.admin.utils.VnnoxAPIUtil; @@ -190,4 +191,16 @@ ); } public boolean updateDataName(Long id, String name){ LedPlayerEntity byId = ledPlayerEntityService.getById(id); if(byId==null){ throw new BusinessException("未找到该设备"); } LedPlayerEntity led=new LedPlayerEntity(); led.setId(id); led.setName(name); return ledPlayerEntityService.updateById(led); } }