| | |
| | | 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("/getNledProgeamList") |
| | | public ResponseVO<Object> getNledProgeamList() { |
| | | List<LEDProgram> ledPrograms = ledProgramService.listProgram(null, null,null,null); |
| | | List<LEDProgram> ledPrograms = ledProgramService.listProgram(null, null, null, null); |
| | | List<Map> mapList = new ArrayList<>(); |
| | | Map map; |
| | | for (LEDProgram bean : ledPrograms) { |