|
@@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.util.*;
|
|
|
|
|
|
@RestController
|
|
@@ -35,12 +36,8 @@ public class BigCompanyController {
|
|
|
|
|
|
@GetMapping("/list")
|
|
|
@ApiOperation("涉林分布-供应商信息获取")
|
|
|
- @ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "catId",value = "分类id",required = false,paramType = "Long"),
|
|
|
- @ApiImplicitParam(name = "key",value = "关键字",required = false,paramType = "String")
|
|
|
- })
|
|
|
- public CommonResult compList(@RequestParam(value = "catId",required = false)Long catId, @RequestParam(value = "key",required = false)String key){
|
|
|
- List<Map<String, Object>> companyList = bigCompanyService.getCompanyList(catId, key);
|
|
|
+ public CommonResult compList(@RequestParam(value = "id",required = false)Long id, @RequestParam(value = "key",required = false)String key){
|
|
|
+ List<Map<String, Object>> companyList = bigCompanyService.getCompanyList(id, key);
|
|
|
List<Map<String,Object>> sh = new ArrayList<>();
|
|
|
for (Map<String,Object> map:companyList){
|
|
|
List<String> strings = new LinkedList<>();
|
|
@@ -139,6 +136,8 @@ public class BigCompanyController {
|
|
|
String[] title = {"id","type","num"};
|
|
|
List<String> dto = bigCompanyService.getCat();
|
|
|
List<Map<String, Object>> title1 = getTitle(dto, title);
|
|
|
+ Map<String,Object> list = new HashMap<>();
|
|
|
+ list.put("list",title1);
|
|
|
return CommonResult.success(title1);
|
|
|
}
|
|
|
|
|
@@ -152,17 +151,47 @@ public class BigCompanyController {
|
|
|
if (strings == null|| strings.size()<1){
|
|
|
return null;
|
|
|
}
|
|
|
+ Map<String,Object> maps = new HashMap<>();
|
|
|
+ maps.put("id",null);
|
|
|
+ maps.put("type","全部");
|
|
|
+
|
|
|
List<Map<String,Object>> list = new ArrayList<>();
|
|
|
+ BigDecimal bigDecimal = new BigDecimal("0");
|
|
|
for (String str:strings) {
|
|
|
Map<String,Object> map = new HashMap<>();
|
|
|
String[] split = str.split("---");
|
|
|
+ String titles = null;
|
|
|
+ BigDecimal decimal = new BigDecimal("0");
|
|
|
for (int i = 0;i<split.length;i++){
|
|
|
String param = params[i];
|
|
|
String s = split[i];
|
|
|
map.put(param,s);
|
|
|
+ if ("num".equals(param)){
|
|
|
+ try {
|
|
|
+ decimal = new BigDecimal(s);
|
|
|
+ bigDecimal =bigDecimal.add(decimal);
|
|
|
+ }catch (Exception e){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if ("type".equals(param)){
|
|
|
+ titles=s;
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (Integer.valueOf(decimal.toString())>0){
|
|
|
+ map.put("title",titles+"涉林企统计");
|
|
|
+ list.add(map);
|
|
|
}
|
|
|
- list.add(map);
|
|
|
+
|
|
|
}
|
|
|
- return list;
|
|
|
+ maps.put("num",bigDecimal);
|
|
|
+ maps.put("title","全部涉林企业分布");
|
|
|
+ List<Map<String,Object>> list1 = new ArrayList<>();
|
|
|
+ list1.add(maps);
|
|
|
+ list1.addAll(list);
|
|
|
+ return list1;
|
|
|
}
|
|
|
}
|