| | |
| | | SELECT t2.* |
| | | FROM `pole_binding` t1 |
| | | LEFT JOIN pole t2 ON t1.pole_id = t2.id |
| | | WHERE t1.device_type = #{type} |
| | | AND t1.device_code = #{Mac} |
| | | <if test="userId != null"> |
| | | AND ( |
| | | t2.user_id = #{userId} |
| | | OR t2.client_id = #{userId} |
| | | ) |
| | | </if> |
| | | t1.device_code = #{Mac} |
| | | <where> |
| | | <if test="type != null"> |
| | | AND t1.device_type = #{type} |
| | | </if> |
| | | <if test="userId != null"> |
| | | AND ( |
| | | t2.user_id = #{userId} |
| | | OR t2.client_id = #{userId} |
| | | ) |
| | | </if> |
| | | </where> |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | OperatingSystem os = userAgent.getOperatingSystem(); |
| | | String content = "登录IP地址:" + IPUtils.getPublicIp() + ",操作系统:" + os + ",浏览器:" + browser; |
| | | |
| | | StoreOperationRecordsUtils.storeOperationData(null, null, "用户登录", content, null); |
| | | StoreOperationRecordsUtils.storeOperationData(null, null, "用户登录", content); |
| | | return ResponseUtil.success(authInfo); |
| | | } |
| | | |
| | |
| | | @GetMapping(value = "/logout") |
| | | public ResponseVO<Object> LogOut() { |
| | | String content = "用户名:" + SecurityUtils.getUsername(); |
| | | StoreOperationRecordsUtils.storeOperationData(null, null, "用户退出登录", content, null); |
| | | StoreOperationRecordsUtils.storeOperationData(null, null, "用户退出登录", content); |
| | | String key = String.format("%d_%d", SecurityUtils.getUserDetails().getUserId(), SecurityUtils.getUserDetails().getAdministratorType()); |
| | | redisService.set(key, null); |
| | | return ResponseUtil.success("退出登录成功"); |
| | |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.object.BaseConditionVO; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.manager.iot.amqp.processor.AirDataProcessor; |
| | | import com.sandu.ximon.admin.manager.iot.frame.A5Frame; |
| | | import com.sandu.ximon.admin.manager.iot.frame.inner.request.AirDataReqInnerFrame; |
| | |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.mainboard.MainBoardInvokeSyncService; |
| | | import com.sandu.ximon.admin.security.PermissionConfig; |
| | | import com.sandu.ximon.admin.service.AirDataService; |
| | | import com.sandu.ximon.admin.service.PoleBindingService; |
| | | import com.sandu.ximon.admin.utils.RedisUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.dao.bo.AirDataBo; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.enums.MenuEnum; |
| | | import com.sandu.ximon.dao.enums.PoleBindingEnums; |
| | | import com.sandu.ximon.dao.mapper.PoleBindingMapper; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | resultMap.put("success", success); |
| | | resultMap.put("failed", failed); |
| | | |
| | | /** |
| | | * 服务端更新大气数据日志记录开始 |
| | | */ |
| | | String content = "更新结果:" + resultMap.toString(); |
| | | |
| | | |
| | | StoreOperationRecordsUtils.storeOperationData(listMac, null, "服务端更新大气数据", content); |
| | | /** |
| | | * 服务端更新大气数据日志记录结束 |
| | | */ |
| | | |
| | | return ResponseUtil.success(resultMap); |
| | | } |
| | | |
| | |
| | | private final PlayPlanNvService playPlanNvService; |
| | | private PermissionConfig permissionConfig; |
| | | |
| | | @AnonymousAccess |
| | | @PostMapping("/add") |
| | | public ResponseVO<Object> addLEDPlan(@RequestBody @Validated PlayPlanParam param) { |
| | | if (!permissionConfig.check(MenuEnum.LED_N_PLAY_PLAN_ADD.getCode())) { |
| | |
| | | return ResponseUtil.success(playPlanNvService.addPlan(param)); |
| | | } |
| | | |
| | | @AnonymousAccess |
| | | @GetMapping("/getByPlanId/{planId}") |
| | | public ResponseVO<Object> getPlan(@PathVariable Long planId) { |
| | | if (!permissionConfig.check(MenuEnum.LED_N_PLAY_PLAN_DETAIL.getCode())) { |
| | |
| | | return ResponseUtil.success(playPlanNvService.deletePlan(plianIds)); |
| | | } |
| | | |
| | | @AnonymousAccess |
| | | @PostMapping(value = "/push/{plianId}", produces = "application/json;charset=UTF-8") |
| | | public ResponseVO<Object> pushToLed(@PathVariable Long plianId, @RequestBody List<NovaPushResultVO> playerIds) { |
| | | if (!permissionConfig.check(MenuEnum.LED_N_PLAY_PLAN_PUSH.getCode())) { |
| | |
| | | } |
| | | |
| | | |
| | | @AnonymousAccess |
| | | @PostMapping(value = "/pushSchedule/{planId}", produces = "application/json;charset=UTF-8") |
| | | public ResponseVO<Object> pushSchedule(@PathVariable Long planId, @RequestBody List<NovaPushResultVO> playerIds) { |
| | | if (!permissionConfig.check(MenuEnum.LED_N_PLAY_PLAN_PUSH_SCHEDULE.getCode())) { |
| | |
| | | return ResponseUtil.success(playPlanNvService.pushSchedule(planId, playerIds)); |
| | | } |
| | | |
| | | @AnonymousAccess |
| | | @GetMapping("/listPlan") |
| | | public ResponseVO<Object> list(BaseConditionVO baseConditionVO, @RequestParam(value = "keyword", required = false) String keyword) { |
| | | if (!permissionConfig.check(MenuEnum.PLAYPLAN_LIST.getCode())) { |
| | |
| | | import com.sandu.ximon.admin.param.PwdParam; |
| | | import com.sandu.ximon.admin.param.UserPwsParm; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.dao.bo.AdminBo; |
| | | import com.sandu.ximon.dao.bo.MenuNode; |
| | | import com.sandu.ximon.dao.domain.*; |
| | |
| | | if (!adminRoleRelationService.save(adminRoleRelation)) { |
| | | throw new BusinessException("添加管理员角色失败"); |
| | | } |
| | | |
| | | /** |
| | | * 添加管理员日志记录开始 |
| | | */ |
| | | String content = "新注册用户:" + param.getUsername(); |
| | | StoreOperationRecordsUtils.storeOperationData(null, null, "添加管理员", content); |
| | | /** |
| | | * 添加管理员日志记录结束 |
| | | */ |
| | | return true; |
| | | } |
| | | |
| | |
| | | import com.sandu.ximon.admin.param.UpdateClientPrarm; |
| | | import com.sandu.ximon.admin.param.UserPwsParm; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.dao.bo.MenuNode; |
| | | import com.sandu.ximon.dao.domain.*; |
| | | import com.sandu.ximon.dao.mapper.AdminMapper; |
| | |
| | | throw new BusinessException("添加管理员角色失败"); |
| | | } |
| | | |
| | | /** |
| | | * 添加管理员日志记录开始 |
| | | */ |
| | | String content = "新注册用户:" + addClientPrarm.getClientName(); |
| | | StoreOperationRecordsUtils.storeOperationData(null, null, "添加普通用户", content); |
| | | /** |
| | | * 添加管理员日志记录结束 |
| | | */ |
| | | |
| | | return flag; |
| | | } |
| | | |
| | |
| | | + ", 灯杆ID:" + param.getPoleIdList().toString() |
| | | + ", 控制的灯头地址:" + param.getLightAddress() |
| | | + " }"; |
| | | StoreOperationRecordsUtils.storeOperationData(poleCodeList.toString(), null, "新增路灯任务", content, poleCodeList.toString()); |
| | | StoreOperationRecordsUtils.storeOperationData(poleCodeList, null, "新增路灯任务", content); |
| | | /** |
| | | * 新增路灯任务日志记录结束 |
| | | */ |
| | |
| | | + ", 任务名:" + lightTask.getTaskName() |
| | | + "}," + " 灯杆ID:" + param.getPoleIdList().toString() |
| | | + " }"; |
| | | StoreOperationRecordsUtils.storeOperationData(poleCodeList.toString(), null, "下发路灯任务", content1, poleCodeList.toString()); |
| | | StoreOperationRecordsUtils.storeOperationData(poleCodeList, null, "下发路灯任务", content1); |
| | | /** |
| | | * 下发路灯任务日志记录结束 |
| | | */ |
| | |
| | | + ", 灯杆ID:" + param.getPoleIdList().toString() |
| | | + ", 控制的灯头地址:" + param.getLightAddress() |
| | | + " }"; |
| | | StoreOperationRecordsUtils.storeOperationData(poleCodeList.toString(), null, "编辑路灯任务", content, poleCodeList.toString()); |
| | | StoreOperationRecordsUtils.storeOperationData(poleCodeList, null, "编辑路灯任务", content); |
| | | /** |
| | | * 编辑路灯任务日志记录结束 |
| | | */ |
| | |
| | | + ", 任务名:" + lightTask.getTaskName() |
| | | + "}," + " 灯杆ID:" + param.getPoleIdList().toString() |
| | | + " }"; |
| | | StoreOperationRecordsUtils.storeOperationData(poleCodeList.toString(), null, "下发路灯任务", content1, poleCodeList.toString()); |
| | | StoreOperationRecordsUtils.storeOperationData(poleCodeList, null, "下发路灯任务", content1); |
| | | /** |
| | | * 下发路灯任务日志记录结束 |
| | | */ |
| | |
| | | if (CollectionUtil.isNotEmpty(list)) { |
| | | poleCodeList = list.stream().map(Pole::getDeviceCode).collect(Collectors.toList()); |
| | | } |
| | | String content1 = "{任务ID:" + lightTask.getTaskId() |
| | | String content = "{任务ID:" + lightTask.getTaskId() |
| | | + ", 任务名:" + lightTask.getTaskName() |
| | | + "}," + " 灯杆ID:" + param.getPoleId() |
| | | + " }"; |
| | | StoreOperationRecordsUtils.storeOperationData(poleCodeList.toString(), null, "下发路灯任务", content1, poleCodeList.toString()); |
| | | StoreOperationRecordsUtils.storeOperationData(poleCodeList, null, "下发路灯任务", content); |
| | | /** |
| | | * 下发路灯任务日志记录结束 |
| | | */ |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.sandu.common.execption.BusinessException; |
| | | import com.sandu.common.service.impl.BaseServiceImpl; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | | import com.sandu.ximon.admin.config.VnnoxConstant; |
| | | import com.sandu.ximon.admin.dto.PlanDto; |
| | | import com.sandu.ximon.admin.dto.SchedulesDTO; |
| | |
| | | import com.sandu.ximon.admin.entity.Plans; |
| | | import com.sandu.ximon.admin.param.PlayPlanParam; |
| | | import com.sandu.ximon.admin.security.SecurityUtils; |
| | | import com.sandu.ximon.admin.utils.StoreOperationRecordsUtils; |
| | | import com.sandu.ximon.admin.utils.VnnoxAPIUtil; |
| | | import com.sandu.ximon.admin.utils.VnnoxProgramAPIUtil; |
| | | import com.sandu.ximon.admin.utils.response.VnnoxResultResponse; |
| | |
| | | import com.sandu.ximon.admin.vo.NovaPushResultVO; |
| | | 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; |
| | |
| | | //推送定时到LED |
| | | public Map<String, Object> pushSchedule(Long planId, List<NovaPushResultVO> nova) { |
| | | PlayPlanNv one = getOne(Wrappers.lambdaQuery(PlayPlanNv.class).eq(PlayPlanNv::getId, planId)); |
| | | if (one == null) { |
| | | throw new BusinessException("未找到节目"); |
| | | } |
| | | List<SchedulesDTO> schedulesDTOS = JSON.parseArray(one.getSchedules(), SchedulesDTO.class); |
| | | ProgramSchedule programSchedule = new ProgramSchedule(); |
| | | programSchedule.setSchedules(schedulesDTOS); |
| | |
| | | |
| | | result.put("success", successList); |
| | | result.put("fail", faileList); |
| | | |
| | | /** |
| | | * 诺瓦推送定时日志记录开始 |
| | | */ |
| | | List<LedPlayerEntity> list = SpringContextHolder.getBean(LedPlayerEntityService.class) |
| | | .list(Wrappers.lambdaQuery(LedPlayerEntity.class).in(LedPlayerEntity::getId, nova.stream().map(NovaPushResultVO::getPlayerId).toArray())); |
| | | List<String> listCode = new ArrayList<>(); |
| | | for (LedPlayerEntity temp : list) { |
| | | listCode.add(temp.getSn()); |
| | | } |
| | | |
| | | String content = "{节目ID:" + one.getId() |
| | | + ", 节目名称:" + one.getName() |
| | | + "}," + " 推送结果:" + result |
| | | + " }"; |
| | | StoreOperationRecordsUtils.storeOperationData(listCode, null, "诺瓦推送定时任务", content); |
| | | /** |
| | | * 诺瓦推送定时日志记录结束 |
| | | */ |
| | | return result; |
| | | } |
| | | |
| | |
| | | import com.sandu.ximon.admin.manager.iot.rrpc.dto.CommonFrame; |
| | | import com.sandu.ximon.admin.service.DeviceOperationLogService; |
| | | import com.sandu.ximon.admin.service.InnerFrameDataService; |
| | | import com.sandu.ximon.dao.domain.Pole; |
| | | import com.sandu.ximon.dao.enums.PoleBindingEnums; |
| | | import com.sandu.ximon.dao.mapper.PoleBindingMapper; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author ZZQ |
| | |
| | | /** |
| | | * 保存操作数据 |
| | | * |
| | | * @param deviceCode |
| | | * @param deviceCodeList |
| | | * @param deviceName |
| | | * @param operation |
| | | * @param content |
| | | * @param poleCode |
| | | */ |
| | | public static void storeOperationData(String deviceCode, String deviceName, String operation, String content, String poleCode) { |
| | | SpringContextHolder.getBean(DeviceOperationLogService.class).saveDeviceOperationLog(deviceCode, deviceName, operation, content, poleCode); |
| | | public static void storeOperationData(List<String> deviceCodeList, String deviceName, String operation, String content) { |
| | | if (deviceCodeList == null) { |
| | | deviceCodeList = new ArrayList<>(); |
| | | } |
| | | List<String> poleCodeList = new ArrayList<>(); |
| | | for (String str : deviceCodeList) { |
| | | Pole pole = SpringContextHolder.getBean(PoleBindingMapper.class).getPoleByBinding(null, str, null); |
| | | if (pole != null) { |
| | | poleCodeList.add(pole.getDeviceCode()); |
| | | } else { |
| | | poleCodeList.add(""); |
| | | } |
| | | } |
| | | SpringContextHolder.getBean(DeviceOperationLogService.class) |
| | | .saveDeviceOperationLog(deviceCodeList.toString(), deviceName, operation, content, poleCodeList.toString()); |
| | | } |
| | | } |