xieshengjie 1 gadu atpakaļ
vecāks
revīzija
7cf9db20c2

+ 5 - 2
web/runeconomy-xk/src/main/java/com/gyee/runeconomy/controller/CommonController.java

@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
 
 import javax.annotation.Resource;
 import java.util.*;
+import java.util.stream.Collectors;
 
 @Controller
 public class CommonController {
@@ -36,9 +37,11 @@ public class CommonController {
     @GetMapping("/findCompanys")
     @ResponseBody
     @ApiOperation(value = "查询公司", notes = "查询公司")
-    public R findCompanys() throws Exception {
-
+    public R findCompanys(@RequestParam(value = "regionid", required = false) String regionid) throws Exception {
         List<ProBasicCompany> cpls = CacheContext.cpls;
+        if (StringUtils.isNotEmpty(regionid)){
+            cpls = cpls.stream().filter(i->i.getRegionId().equals(regionid)).collect(Collectors.toList());
+        }
 
         if (StringUtils.isNotNull(cpls)) {
             return R.data(ResultMsg.ok(cpls));