| | |
| | | package com.sandu.ximon.admin.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.util.StringUtil; |
| | | import com.sandu.common.domain.ResponseVO; |
| | | import com.sandu.common.util.ResponseUtil; |
| | | import com.sandu.common.util.SpringContextHolder; |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | * 客户列表 |
| | | */ |
| | | @GetMapping("/getClientList") |
| | | public ResponseVO<Object> getClientList() { |
| | | public ResponseVO<Object> getClientList(@RequestParam(required = false, value = "keyword") String keyword) { |
| | | LambdaQueryWrapper<Client> wrapper = Wrappers.lambdaQuery(Client.class); |
| | | //非超管只能看到自己下属的客户信息 |
| | | if (SecurityUtils.getClientId() != null) { |
| | | wrapper.eq(Client::getSuperiorId, SecurityUtils.getUserId()); |
| | | } |
| | | if (!StringUtil.isEmpty(keyword)) { |
| | | wrapper.eq(Client::getId, keyword).or(w -> { |
| | | w.eq(Client::getClientName, keyword); |
| | | }); |
| | | } |
| | | List<Client> list = SpringContextHolder.getBean(ClientService.class).list(wrapper); |
| | | |
| | |
| | | @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("/getNledProgeamList") |
| | | public ResponseVO<Object> getNledProgeamList() { |
| | | List<LEDProgram> ledPrograms = ledProgramService.listProgram(null, null); |
| | | List<LEDProgram> ledPrograms = ledProgramService.listProgram(null, null, null, null); |
| | | List<Map> mapList = new ArrayList<>(); |
| | | Map map; |
| | | for (LEDProgram bean : ledPrograms) { |
| | |
| | | |
| | | @GetMapping("/getSledList") |
| | | public ResponseVO<Object> getSledList() { |
| | | List<PoleLightemitEntity> poleLightemitEntities = sLedService.listLed(null, false); |
| | | List<PoleLightemitEntity> poleLightemitEntities = sLedService.listLed(null, null, null, false); |
| | | List<Map> mapList = new ArrayList<>(); |
| | | Map map; |
| | | for (PoleLightemitEntity bean : poleLightemitEntities) { |
| | |
| | | map.put("lightemitName", bean.getLightemitName()); |
| | | map.put("lightemitControlCode", bean.getLightemitControlCode()); |
| | | map.put("isOnLine", bean.isOnLine()); |
| | | map.put("streetlightId", bean.getPoleId()); |
| | | map.put("streetlightName", bean.getPoleName()); |
| | | map.put("streetlightId", bean.getStreetlightId()); |
| | | map.put("streetlightName", bean.getStreetlightName()); |
| | | mapList.add(map); |
| | | } |
| | | return ResponseUtil.success(mapList); |
| | |
| | | List<MonitorBo> monitorBos; |
| | | //超管 |
| | | if (SecurityUtils.getClientId() == null) { |
| | | monitorBos = monitorMapper.listMonitorDeviceSerial1(null, null, 2,null); |
| | | monitorBos = monitorMapper.listMonitorDeviceSerial1(null, null, 2, null); |
| | | } else { |
| | | monitorBos = monitorMapper.listMonitorDeviceSerial1(SecurityUtils.getUserId(), null, 2,null); |
| | | monitorBos = monitorMapper.listMonitorDeviceSerial1(SecurityUtils.getUserId(), null, 2, null); |
| | | } |
| | | List<Map> mapList = new ArrayList<>(); |
| | | Map map; |