|
@@ -1,7 +1,8 @@
|
|
|
package com.hwrj.cloud.admin.controller;
|
|
|
|
|
|
-import com.hwrj.cloud.admin.dto.PmsProductCategoryDto;
|
|
|
import com.hwrj.cloud.admin.dto.UmsCompanyDto;
|
|
|
+import com.hwrj.cloud.admin.dto.UmsMemberOriginParam;
|
|
|
+import com.hwrj.cloud.admin.dto.param.BigDataCompanyInfo;
|
|
|
import com.hwrj.cloud.admin.service.BigCompanyService;
|
|
|
import com.hwrj.cloud.admin.service.UmsCompanyService;
|
|
|
import com.hwrj.cloud.admin.service.UmsMemberOriginService;
|
|
@@ -16,8 +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.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping("/big/company")
|
|
@@ -33,7 +33,7 @@ public class BigCompanyController {
|
|
|
@Autowired
|
|
|
private UmsMemberOriginService umsMemberOriginService;
|
|
|
|
|
|
- @GetMapping("/lis")
|
|
|
+ @GetMapping("/list")
|
|
|
@ApiOperation("涉林分布-供应商信息获取")
|
|
|
@ApiImplicitParams({
|
|
|
@ApiImplicitParam(name = "catId",value = "分类id",required = false,paramType = "Long"),
|
|
@@ -41,26 +41,128 @@ public class BigCompanyController {
|
|
|
})
|
|
|
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);
|
|
|
+ List<Map<String,Object>> sh = new ArrayList<>();
|
|
|
+ for (Map<String,Object> map:companyList){
|
|
|
+ List<String> strings = new LinkedList<>();
|
|
|
+ if (map.containsKey("lng")){
|
|
|
+ strings.add(map.get("lng").toString());
|
|
|
+ }
|
|
|
+ if (map.containsKey("latitude")){
|
|
|
+ strings.add(map.get("latitude").toString());
|
|
|
+ }
|
|
|
|
|
|
+
|
|
|
+ map.put("laglat",strings);
|
|
|
+ map.put("legend","1");
|
|
|
+ List<Map<String,Object>> list = new LinkedList<>();
|
|
|
+ if (map.containsKey("compConPerson")){
|
|
|
+ Map<String,Object> map1 = new HashMap<>();
|
|
|
+ map1.put("value","联系人:"+map.get("compConPerson"));
|
|
|
+ list.add(map1);
|
|
|
+ }
|
|
|
+ if (map.containsKey("address")){
|
|
|
+ Map<String,Object> map2 = new HashMap<>();
|
|
|
+ map2.put("value","联系地址:"+map.get("address"));
|
|
|
+ list.add(map2);
|
|
|
+ }
|
|
|
+ map.put("info",list);
|
|
|
+ sh.add(map);
|
|
|
+ }
|
|
|
return CommonResult.success(companyList);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/detail")
|
|
|
- @ApiOperation("涉林分布-供应商信息获取")
|
|
|
+ @ApiOperation("涉林分布-供应商详细信息")
|
|
|
@ApiImplicitParams({
|
|
|
- @ApiImplicitParam(name = "catId",value = "分类id",required = false,paramType = "Long"),
|
|
|
- @ApiImplicitParam(name = "key",value = "关键字",required = false,paramType = "String")
|
|
|
+ @ApiImplicitParam(name = "供应商id",value = "分类id",required = false,paramType = "Long"),
|
|
|
})
|
|
|
public CommonResult compDetail(@RequestParam(value = "id",required = true)Long id){
|
|
|
UmsCompanyDto detailCompany = umsCompanyService.getDetailCompany(id);
|
|
|
+ UmsMemberOriginParam param = new UmsMemberOriginParam();
|
|
|
+ param.setFkCompanyInfoId(detailCompany.getId());
|
|
|
+ List<UmsMemberOriginParam> list = umsMemberOriginService.list(param);
|
|
|
+ List<BigDataCompanyInfo> listBate = new ArrayList<>();
|
|
|
+ BigDataCompanyInfo big1 = new BigDataCompanyInfo();
|
|
|
+ big1.setId("1");
|
|
|
+ big1.setTitle("企业名称");
|
|
|
+ big1.setData(detailCompany.getCompName());
|
|
|
+ listBate.add(big1);
|
|
|
+ BigDataCompanyInfo big2 = new BigDataCompanyInfo();
|
|
|
+ big2.setId("2");
|
|
|
+ big2.setTitle("联系人");
|
|
|
+ big2.setData(detailCompany.getCompConPerson());
|
|
|
+ listBate.add(big2);
|
|
|
+ BigDataCompanyInfo big3 = new BigDataCompanyInfo();
|
|
|
+ big3.setId("3");
|
|
|
+ big3.setTitle("联系方式");
|
|
|
+ big3.setData(detailCompany.getCompConNum());
|
|
|
+ listBate.add(big3);
|
|
|
+
|
|
|
+ BigDataCompanyInfo big4 = new BigDataCompanyInfo();
|
|
|
|
|
|
- return CommonResult.success();
|
|
|
+ big4.setId("4");
|
|
|
+ big4.setTitle("资质");
|
|
|
+ big4.setData(detailCompany.getCompQual());
|
|
|
+ listBate.add(big4);
|
|
|
+
|
|
|
+ BigDataCompanyInfo big5 = new BigDataCompanyInfo();
|
|
|
+ big5.setId("5");
|
|
|
+ big5.setTitle("类型");
|
|
|
+ big5.setData(detailCompany.getCompanyType());
|
|
|
+ listBate.add(big5);
|
|
|
+
|
|
|
+ BigDataCompanyInfo big6 = new BigDataCompanyInfo();
|
|
|
+ big6.setId("6");
|
|
|
+ big6.setTitle("是否有种植基地");
|
|
|
+ if (list != null && list.size()>0){
|
|
|
+ big6.setData("有");
|
|
|
+ }else {
|
|
|
+ big6.setData("没有");
|
|
|
+ }
|
|
|
+ big6.setData(detailCompany.getCompanyType());
|
|
|
+ listBate.add(big6);
|
|
|
+ BigDataCompanyInfo big7 = new BigDataCompanyInfo();
|
|
|
+ big7.setId("7");
|
|
|
+ big7.setTitle("地址");
|
|
|
+ big7.setData(detailCompany.getProvinceId()+detailCompany.getCityId()+detailCompany.getCountyId());
|
|
|
+ listBate.add(big7);
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ map.put("desc",detailCompany.getCompSum());
|
|
|
+ map.put("list",listBate);
|
|
|
+
|
|
|
+ return CommonResult.success(map);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/cat")
|
|
|
@ApiOperation("涉林分布-产品分类信息(刺梨,竹子,竹笋)")
|
|
|
public CommonResult cat(){
|
|
|
- List<PmsProductCategoryDto> dto = bigCompanyService.getCategoryDto();
|
|
|
- return CommonResult.success(dto);
|
|
|
+ String[] title = {"id","type","num"};
|
|
|
+ List<String> dto = bigCompanyService.getCat();
|
|
|
+ List<Map<String, Object>> title1 = getTitle(dto, title);
|
|
|
+ return CommonResult.success(title1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param strings 数据
|
|
|
+ * @param params
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<Map<String,Object>> getTitle(List<String> strings,String[] params){
|
|
|
+ if (strings == null|| strings.size()<1){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ List<Map<String,Object>> list = new ArrayList<>();
|
|
|
+ for (String str:strings) {
|
|
|
+ Map<String,Object> map = new HashMap<>();
|
|
|
+ String[] split = str.split("---");
|
|
|
+ for (int i = 0;i<split.length;i++){
|
|
|
+ String param = params[i];
|
|
|
+ String s = split[i];
|
|
|
+ map.put(param,s);
|
|
|
+ }
|
|
|
+ list.add(map);
|
|
|
+ }
|
|
|
+ return list;
|
|
|
}
|
|
|
}
|