| | |
| | | */ |
| | | LED_S_PROGRAM_CREATE_TIME("create_date"), |
| | | |
| | | /** |
| | | * 路灯任务列表 |
| | | */ |
| | | LIGHT_TASK_UPDATE_TIME("update_time"), |
| | | |
| | | /** |
| | | * 诺瓦-列表 |
| | | */ |
| | | VNNOX_ID("id"), |
| | | VNNOX_POLE_NAME("pole_name"), |
| | | VNNOX_CREATE_TIMESTAMP("create_timestamp"), |
| | | |
| | | /** |
| | | * 熙迅-播放计划 |
| | |
| | | //添加时间 |
| | | MONITOR_CREATE_TIME("t1.update_time"), |
| | | |
| | | /** |
| | | * 路灯列表 |
| | | */ |
| | | LIGHT_POLE_NAME("pole_name"), |
| | | LIGHT_UPDATE_TIME("update_time"), |
| | | LIGHT_CREATE_TIME("create_time"), |
| | | |
| | | /** |
| | | * IP音柱列表 |
| | |
| | | POLE_ID("id"), |
| | | POLE_CREATE_TIME("create_time"), |
| | | |
| | | /** |
| | | * 分组列表 |
| | | */ |
| | | POLE_GROUP_CREATE_TIME("create_time"), |
| | | POLE_GROUP_UPDATE_TIME("update_time"), |
| | | |
| | | /** |
| | | * 排序方式 |
| | |
| | | @GetMapping("/getLedPlayerEntityList") |
| | | public ResponseVO<Object> getLedPlayerEntityList() { |
| | | List<LedPlayerEntity> list = SpringContextHolder.getBean(LedPlayerEntityService.class). |
| | | ledPlayerEntityList(null, null); |
| | | ledPlayerEntityList(null, null, null, null); |
| | | |
| | | List<Map> mapList = new ArrayList<>(); |
| | | Map map; |
| | |
| | | |
| | | |
| | | @GetMapping("/list") |
| | | public ResponseVO<Object> listLight(BaseConditionVO conditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | public ResponseVO<Object> listLight(BaseConditionVO conditionVO, |
| | | @RequestParam(value = "keyword", required = false) String keyword, |
| | | @RequestParam(value = "order", required = false) Integer order, |
| | | @RequestParam(value = "seq", required = false) Integer seq) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | List<LightBo> list = lightService.listLight(conditionVO.getPageNo(), conditionVO.getPageSize(), keyword); |
| | | List<LightBo> list = lightService.listLight(conditionVO.getPageNo(), conditionVO.getPageSize(), keyword, order, seq); |
| | | return ResponseUtil.successPage(list); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | public ResponseVO<Object> listLightTask(BaseConditionVO conditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | public ResponseVO<Object> listLightTask(BaseConditionVO conditionVO, |
| | | @RequestParam(value = "keyword", required = false) String keyword, |
| | | @RequestParam(value = "order", required = false) Integer order, |
| | | @RequestParam(value = "seq", required = false) Integer seq) { |
| | | if (!permissionConfig.check(MenuEnum.LIGHT_TASK_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | List<LightTaskDto> taskList = lightTaskService.listLightTask(conditionVO, keyword); |
| | | List<LightTaskDto> taskList = lightTaskService.listLightTask(conditionVO, keyword, order, seq); |
| | | return ResponseUtil.successPage(taskList); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | public ResponseVO<Object> listGroup(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword, |
| | | @RequestParam(value = "groupid", required = false) Long groupid) { |
| | | public ResponseVO<Object> listGroup(BaseConditionVO baseConditionVO, |
| | | @RequestParam(value = "keyword", required = false) String keyword, |
| | | @RequestParam(value = "order", required = false) Integer order, |
| | | @RequestParam(value = "seq", required = false) Integer seq) { |
| | | if (!permissionConfig.check(MenuEnum.GROUP_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | return ResponseUtil.success(poleGroupService.groupList(baseConditionVO, keyword, groupid)); |
| | | return ResponseUtil.success(poleGroupService.groupList(baseConditionVO, keyword, order, seq)); |
| | | } |
| | | |
| | | @PostMapping("/bind/{groupId}") |
| | |
| | | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.security.annotation.AnonymousAccess; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.ximon.admin.param.VnnoxParam; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.admin.service.LedPlayerEntityService; |
| | | import com.sandu.ximon.admin.service.PoleBindingService; |
| | | import com.sandu.ximon.admin.service.PoleService; |
| | | import com.sandu.ximon.admin.service.VnnoxService; |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxResult; |
| | |
| | | * 诺瓦LED处理 |
| | | */ |
| | | @RestController |
| | | //@AllArgsConstructor |
| | | @RequestMapping("/v1/Vnnox") |
| | | public class VnnoxController { |
| | | @Autowired |
| | |
| | | private LedPlayerEntityService ledPlayerEntityService; |
| | | @Autowired |
| | | private VnnoxAPIUtil vnnoxAPIUtil; |
| | | @Autowired |
| | | private PoleBindingService bindingService; |
| | | @Autowired |
| | | private PoleService poleService; |
| | | |
| | | /** |
| | | * 截屏 |
| | |
| | | |
| | | |
| | | @GetMapping("/list") |
| | | public ResponseVO<Object> list(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | public ResponseVO<Object> list(BaseConditionVO baseConditionVO, |
| | | @RequestParam(value = "keyword", required = false) String keyword, |
| | | @RequestParam(value = "order", required = false) Integer order, |
| | | @RequestParam(value = "seq", required = false) Integer seq) { |
| | | if (!permissionConfig.check(MenuEnum.LED_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | return ResponseUtil.successPage(ledPlayerEntityService.ledPlayerEntityList(baseConditionVO, keyword)); |
| | | return ResponseUtil.successPage(ledPlayerEntityService.ledPlayerEntityList(baseConditionVO, keyword, order, seq)); |
| | | } |
| | | |
| | | @GetMapping("/onLineList") |
| | | public ResponseVO<Object> onLineList(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | public ResponseVO<Object> onLineList(BaseConditionVO baseConditionVO, |
| | | @RequestParam(value = "keyword", required = false) String keyword, |
| | | @RequestParam(value = "order", required = false) Integer order, |
| | | @RequestParam(value = "seq", required = false) Integer seq) { |
| | | if (!permissionConfig.check(MenuEnum.LED_LIST.getCode())) { |
| | | return ResponseUtil.fail("缺少对应用户权限"); |
| | | } |
| | | List<LedPlayerEntity> list = ledPlayerEntityService.ledPlayerEntityList(baseConditionVO, keyword); |
| | | List<LedPlayerEntity> list = ledPlayerEntityService.ledPlayerEntityList(baseConditionVO, keyword, order, seq); |
| | | List<LedPlayerEntity> entities = vnnoxService.setCacheInfo(vnnoxAPIUtil.syncCurrentInfo(list)); |
| | | List<LedPlayerEntity> online = new ArrayList<>(); |
| | | for (LedPlayerEntity ledPlayer : entities) { |
| | |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | | import com.sandu.ximon.admin.vo.EquipmentInfomation; |
| | | import com.sandu.ximon.dao.domain.LedPlayerEntity; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.mapper.LedPlayerEntityMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | |
| | | |
| | | public List<LedPlayerEntity> ledPlayerEntityList(BaseConditionVO baseConditionVO, String keyword) { |
| | | if (baseConditionVO != null) { |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | public List<LedPlayerEntity> ledPlayerEntityList(BaseConditionVO baseConditionVO, String keyword, Integer order, Integer seq) { |
| | | //排序字段 |
| | | String orderByResult = OrderByEnums.VNNOX_ID.getCode(); |
| | | //正序、倒叙 |
| | | String orderBySeq = OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | | switch (order) { |
| | | case 1: |
| | | orderByResult = OrderByEnums.VNNOX_POLE_NAME.getCode(); |
| | | break; |
| | | case 2: |
| | | orderByResult = OrderByEnums.VNNOX_CREATE_TIMESTAMP.getCode(); |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | if (seq != null) { |
| | | switch (seq) { |
| | | case 1: |
| | | orderBySeq = OrderByEnums.ASC.getCode(); |
| | | break; |
| | | case 2: |
| | | orderBySeq = OrderByEnums.DESC.getCode(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | //排序方式 |
| | | String orderBy = orderByResult + " " + orderBySeq; |
| | | |
| | | |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(), orderBy); |
| | | List<LedPlayerEntity> list; |
| | | //超管 |
| | | if (SecurityUtils.getClientId() == null) { |
| | |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.domain.PoleBinding; |
| | | import com.sandu.ximon.dao.enums.DeviceRespStatusEnums; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.mapper.LightMapper; |
| | | import com.sandu.ximon.dao.mapper.LightTaskMapper; |
| | | import lombok.AllArgsConstructor; |
| | |
| | | * |
| | | * @return 返回组合数据dto |
| | | */ |
| | | public List<LightBo> listLight(int pageNo, int pageSize, String keyword) { |
| | | public List<LightBo> listLight(int pageNo, int pageSize, String keyword, Integer order, Integer seq) { |
| | | Long clientId = SecurityUtils.getClientId(); |
| | | |
| | | PageHelper.startPage(pageNo, pageSize); |
| | | //排序字段 |
| | | String orderByResult = OrderByEnums.LIGHT_POLE_NAME.getCode(); |
| | | //正序、倒叙 |
| | | String orderBySeq = OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | | switch (order) { |
| | | case 1: |
| | | orderByResult = OrderByEnums.LIGHT_POLE_NAME.getCode(); |
| | | break; |
| | | case 2: |
| | | orderByResult = OrderByEnums.LIGHT_UPDATE_TIME.getCode(); |
| | | break; |
| | | case 3: |
| | | orderByResult = OrderByEnums.LIGHT_CREATE_TIME.getCode(); |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | if (seq != null) { |
| | | switch (seq) { |
| | | case 1: |
| | | orderBySeq = OrderByEnums.ASC.getCode(); |
| | | break; |
| | | case 2: |
| | | orderBySeq = OrderByEnums.DESC.getCode(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | //排序方式 |
| | | String orderBy = orderByResult + " " + orderBySeq; |
| | | |
| | | PageHelper.startPage(pageNo, pageSize, orderBy); |
| | | |
| | | List<LightBo> listLight = baseMapper.listLight(clientId, keyword); |
| | | |
| | |
| | | import com.sandu.ximon.dao.domain.LightTaskPoleRelation; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.enums.DeviceRespStatusEnums; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.mapper.LightTaskMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | return "编辑成功"; |
| | | } else if (newPoleSuccess.isEmpty() && oldPoleSuccess.isEmpty() && closePoleSuccess.isEmpty()) { |
| | | throw new BusinessException("编辑失败"); |
| | | } else if (!closePoleFail.isEmpty() || !oldPoleFail.isEmpty()) { |
| | | } else if (!closePoleFail.isEmpty() || !oldPoleFail.isEmpty()) { |
| | | return "原任务中存在下发异常,原任务保留,创建新任务进行保存"; |
| | | } else if (!newPoleFail.isEmpty()) { |
| | | return "新任务中存在下发异常,忽略异常操作的灯杆"; |
| | | }else { |
| | | } else { |
| | | return "操作异常"; |
| | | } |
| | | } |
| | |
| | | return Optional.ofNullable(responseCommonFrame).map(WrapResponseCommonFrame::getResponseInnerFrame).orElse(null); |
| | | } |
| | | |
| | | public List<LightTaskDto> listLightTask(BaseConditionVO conditionVO, String keyword) { |
| | | public List<LightTaskDto> listLightTask(BaseConditionVO conditionVO, String keyword, Integer order, Integer seq) { |
| | | LambdaQueryWrapper<LightTask> wrapper = Wrappers.lambdaQuery(LightTask.class); |
| | | if (StrUtil.isNotBlank(keyword)) { |
| | | wrapper.like(LightTask::getTaskName, keyword); |
| | |
| | | }); |
| | | } |
| | | |
| | | if (conditionVO != null) { |
| | | PageHelper.startPage(conditionVO.getPageNo(), conditionVO.getPageSize()); |
| | | //排序字段 |
| | | String orderByResult = OrderByEnums.LIGHT_TASK_UPDATE_TIME.getCode(); |
| | | //正序、倒叙 |
| | | String orderBySeq = OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | | switch (order) { |
| | | case 1: |
| | | orderByResult = OrderByEnums.LIGHT_TASK_UPDATE_TIME.getCode(); |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | if (seq != null) { |
| | | switch (seq) { |
| | | case 1: |
| | | orderBySeq = OrderByEnums.ASC.getCode(); |
| | | break; |
| | | case 2: |
| | | orderBySeq = OrderByEnums.DESC.getCode(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | //排序方式 |
| | | String orderBy = orderByResult + " " + orderBySeq; |
| | | |
| | | PageHelper.startPage(conditionVO.getPageNo(), conditionVO.getPageSize(), orderBy); |
| | | List<LightTask> list = list(wrapper); |
| | | |
| | | Page<LightTaskDto> page = new Page<>(); |
| | |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.dao.domain.PoleGroup; |
| | | import com.sandu.ximon.dao.domain.PoleGroupRelation; |
| | | import com.sandu.ximon.dao.enums.OrderByEnums; |
| | | import com.sandu.ximon.dao.mapper.PoleGroupMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | return removeById(groupId); |
| | | } |
| | | |
| | | public List<PoleGroup> groupList(BaseConditionVO baseConditionVO, String keyword, Long groupid) { |
| | | public List<PoleGroup> groupList(BaseConditionVO baseConditionVO, String keyword, Integer order, Integer seq) { |
| | | Long clientId = SecurityUtils.getClientId(); |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize()); |
| | | |
| | | // LambdaQueryWrapper<PoleGroup> wrapper = new LambdaQueryWrapper<>(); |
| | | List<PoleGroup> list = new ArrayList<>(); |
| | | //排序字段 |
| | | String orderByResult = OrderByEnums.POLE_GROUP_UPDATE_TIME.getCode(); |
| | | //正序、倒叙 |
| | | String orderBySeq = OrderByEnums.ASC.getCode(); |
| | | if (order != null) { |
| | | switch (order) { |
| | | case 1: |
| | | orderByResult = OrderByEnums.POLE_GROUP_UPDATE_TIME.getCode(); |
| | | break; |
| | | case 2: |
| | | orderByResult = OrderByEnums.POLE_GROUP_CREATE_TIME.getCode(); |
| | | break; |
| | | default: |
| | | } |
| | | } |
| | | if (seq != null) { |
| | | switch (seq) { |
| | | case 1: |
| | | orderBySeq = OrderByEnums.ASC.getCode(); |
| | | break; |
| | | case 2: |
| | | orderBySeq = OrderByEnums.DESC.getCode(); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | } |
| | | //排序方式 |
| | | String orderBy = orderByResult + " " + orderBySeq; |
| | | |
| | | PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize(), orderBy); |
| | | |
| | | List<PoleGroup> list; |
| | | if (clientId == null) { |
| | | list = list(Wrappers.lambdaQuery(PoleGroup.class).like(PoleGroup::getGroupName, keyword)); |
| | | |
| | | } else { |
| | | list = list(Wrappers.lambdaQuery(PoleGroup.class).eq(PoleGroup::getClientId, clientId).like(PoleGroup::getGroupName, keyword)); |
| | | } |
| | | |
| | | list.forEach(poleGroup -> { |
| | | // int size = poleGroupRelationService.list(Wrappers.lambdaQuery(PoleGroupRelation.class).eq(PoleGroupRelation::getPoleGroupId, poleGroup.getGroupId())).size(); |
| | | poleGroup.setPoleCount(poleGroupRelationService.list(Wrappers.lambdaQuery(PoleGroupRelation.class).eq(PoleGroupRelation::getPoleGroupId, poleGroup.getGroupId())).size()); |
| | | }); |
| | | return list; |
| | |
| | | result.put("poleTotalCount", list.size()); |
| | | |
| | | //诺瓦 |
| | | List<LedPlayerEntity> ledPlayerEntities = SpringContextHolder.getBean(LedPlayerEntityService.class).ledPlayerEntityList(null, null); |
| | | List<LedPlayerEntity> ledPlayerEntities = SpringContextHolder.getBean(LedPlayerEntityService.class).ledPlayerEntityList(null, null, null, null); |
| | | int number = 0; |
| | | for (LedPlayerEntity bean : ledPlayerEntities) { |
| | | if (bean.getOnlineStatus() == 1) { |