|
@@ -1,17 +1,25 @@
|
|
|
package com.fdkankan.manage_jp.controller;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fdkankan.common.util.JwtUtil;
|
|
|
import com.fdkankan.manage_jp.common.Result;
|
|
|
import com.fdkankan.manage_jp.entity.*;
|
|
|
+import com.fdkankan.manage_jp.httpClient.service.LaserService;
|
|
|
+import com.fdkankan.manage_jp.mapper.ISceneProMapper;
|
|
|
import com.fdkankan.manage_jp.service.*;
|
|
|
+import com.fdkankan.manage_jp.vo.request.SceneParam;
|
|
|
+import com.fdkankan.manage_jp.vo.response.SceneVo;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
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;
|
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/manage_jp/laser-use")
|
|
@@ -67,4 +75,32 @@ public class LaserController extends BaseController{
|
|
|
|
|
|
return Result.success(false);
|
|
|
}
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ISceneProMapper sceneProMapper;
|
|
|
+
|
|
|
+ @GetMapping("/getNumListByUserName")
|
|
|
+ public Result getNumListByUserName(@RequestParam(required = false)String userName){
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("list",new ArrayList<>());
|
|
|
+ User user = userService.getByUserName(userName);
|
|
|
+ if(user == null){
|
|
|
+ return Result.success(jsonObject);
|
|
|
+ }
|
|
|
+ Set<Long> roleIds = userRoleService.getByUser(user);
|
|
|
+ SceneParam sceneParam = new SceneParam();
|
|
|
+ sceneParam.setPageNum(1);
|
|
|
+ sceneParam.setPageSize(99999);
|
|
|
+ sceneParam.setType(10);
|
|
|
+ if(!roleIds.contains(5L) && roleIds.contains(6L)){
|
|
|
+ sceneParam.setCompanyId(user.getCompanyId());
|
|
|
+ }
|
|
|
+ if(!roleIds.contains(6L)){
|
|
|
+ sceneParam.setUserId(user.getId());
|
|
|
+ }
|
|
|
+ Page<SceneVo> page = sceneProMapper.pageList(new Page<>(sceneParam.getPageNum(),sceneParam.getPageSize()),sceneParam);
|
|
|
+ List<String> numList = page.getRecords().stream().map(SceneVo::getNum).collect(Collectors.toList());
|
|
|
+ jsonObject.put("list",numList);
|
|
|
+ return Result.success(jsonObject);
|
|
|
+ }
|
|
|
}
|