|
@@ -2,14 +2,13 @@ package com.jpsoft.enterprise.modules.mobile.controller;
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.Page;
|
|
|
-import com.jpsoft.enterprise.modules.base.dto.CompanyInfoDetailDTO;
|
|
|
|
|
-import com.jpsoft.enterprise.modules.base.dto.CompanyInfoListDTO;
|
|
|
|
|
-import com.jpsoft.enterprise.modules.base.dto.NewsInfoDTO;
|
|
|
|
|
-import com.jpsoft.enterprise.modules.base.dto.NewsInfoListDTO;
|
|
|
|
|
|
|
+import com.jpsoft.enterprise.modules.base.dto.*;
|
|
|
import com.jpsoft.enterprise.modules.base.entity.CompanyInfo;
|
|
import com.jpsoft.enterprise.modules.base.entity.CompanyInfo;
|
|
|
|
|
+import com.jpsoft.enterprise.modules.base.entity.IndustryInfo;
|
|
|
import com.jpsoft.enterprise.modules.base.entity.NewsInfo;
|
|
import com.jpsoft.enterprise.modules.base.entity.NewsInfo;
|
|
|
import com.jpsoft.enterprise.modules.base.entity.NewsType;
|
|
import com.jpsoft.enterprise.modules.base.entity.NewsType;
|
|
|
import com.jpsoft.enterprise.modules.base.service.CompanyInfoService;
|
|
import com.jpsoft.enterprise.modules.base.service.CompanyInfoService;
|
|
|
|
|
+import com.jpsoft.enterprise.modules.base.service.IndustryInfoService;
|
|
|
import com.jpsoft.enterprise.modules.base.service.NewsInfoService;
|
|
import com.jpsoft.enterprise.modules.base.service.NewsInfoService;
|
|
|
import com.jpsoft.enterprise.modules.base.service.NewsTypeService;
|
|
import com.jpsoft.enterprise.modules.base.service.NewsTypeService;
|
|
|
import com.jpsoft.enterprise.modules.common.dto.MessageResult;
|
|
import com.jpsoft.enterprise.modules.common.dto.MessageResult;
|
|
@@ -56,6 +55,9 @@ public class CompanyInfoApiController {
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private NewsTypeService newsTypeService;
|
|
private NewsTypeService newsTypeService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private IndustryInfoService industryInfoService;
|
|
|
|
|
+
|
|
|
@PostMapping("companyNum")
|
|
@PostMapping("companyNum")
|
|
|
@ApiOperation(value = "注册公司数量(公开接口)")
|
|
@ApiOperation(value = "注册公司数量(公开接口)")
|
|
|
public MessageResult<Map> companyNum() {
|
|
public MessageResult<Map> companyNum() {
|
|
@@ -108,6 +110,67 @@ public class CompanyInfoApiController {
|
|
|
return messageResult;
|
|
return messageResult;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @PostMapping("industryList")
|
|
|
|
|
+ @ApiOperation(value = "行业列表(公开接口)")
|
|
|
|
|
+ @ApiImplicitParams({
|
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "id", required = false, paramType = "form")
|
|
|
|
|
+ })
|
|
|
|
|
+ public MessageResult<Map> industryList(String id) {
|
|
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+
|
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
|
+ List<IndustryListDTO> list = new ArrayList<>();
|
|
|
|
|
+ if (StringUtils.isBlank(id)){
|
|
|
|
|
+ List<IndustryInfo> industryInfoList = industryInfoService.findParentIndustry();
|
|
|
|
|
+ if (industryInfoList.size()>0){
|
|
|
|
|
+ for (IndustryInfo industryInfo : industryInfoList){
|
|
|
|
|
+ IndustryListDTO industryListDTO = new IndustryListDTO();
|
|
|
|
|
+ industryListDTO.setValue(industryInfo.getId());
|
|
|
|
|
+ industryListDTO.setText(industryInfo.getIndustryName());
|
|
|
|
|
+ List<IndustryInfo> industryInfoList1 = industryInfoService.findIndustryByParentId(industryInfo.getId());
|
|
|
|
|
+ List<IndustryInfoDTO> industryInfoDTOList = new ArrayList<>();
|
|
|
|
|
+ if (industryInfoList1.size()>0){
|
|
|
|
|
+ for (IndustryInfo industryInfo1 : industryInfoList1){
|
|
|
|
|
+ IndustryInfoDTO industryInfoDTO = new IndustryInfoDTO();
|
|
|
|
|
+ industryInfoDTO.setValue(industryInfo1.getId());
|
|
|
|
|
+ industryInfoDTO.setText(industryInfo1.getIndustryName());
|
|
|
|
|
+ industryInfoDTOList.add(industryInfoDTO);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ industryListDTO.setChildren(industryInfoDTOList);
|
|
|
|
|
+ list.add(industryListDTO);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }else {
|
|
|
|
|
+ List<IndustryInfo> industryInfoList = industryInfoService.findIndustryByParentId(id);
|
|
|
|
|
+ if (industryInfoList.size()>0){
|
|
|
|
|
+ for (IndustryInfo industryInfo : industryInfoList){
|
|
|
|
|
+ IndustryListDTO industryListDTO = new IndustryListDTO();
|
|
|
|
|
+ industryListDTO.setValue(industryInfo.getId());
|
|
|
|
|
+ industryListDTO.setText(industryInfo.getIndustryName());
|
|
|
|
|
+ list.add(industryListDTO);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ map.put("list",list);
|
|
|
|
|
+
|
|
|
|
|
+ messageResult.setData(map);
|
|
|
|
|
+ messageResult.setResult(true);
|
|
|
|
|
+ messageResult.setCode(200);
|
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
|
+ log.error(ex.getMessage(), ex);
|
|
|
|
|
+ messageResult.setCode(400);
|
|
|
|
|
+ messageResult.setResult(false);
|
|
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return messageResult;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@PostMapping("companyList")
|
|
@PostMapping("companyList")
|
|
|
@ApiOperation(value = "企业列表(公开接口)")
|
|
@ApiOperation(value = "企业列表(公开接口)")
|
|
|
@ApiImplicitParams({
|
|
@ApiImplicitParams({
|
|
@@ -149,7 +212,19 @@ public class CompanyInfoApiController {
|
|
|
companyInfoListDTO.setRegionName(dataDictionaryService.findNameByCatalogNameAndValue("区域", companyInfo.getRegion()));
|
|
companyInfoListDTO.setRegionName(dataDictionaryService.findNameByCatalogNameAndValue("区域", companyInfo.getRegion()));
|
|
|
companyInfoListDTO.setTypeName(dataDictionaryService.findNameByCatalogNameAndValue("企业类型", companyInfo.getType()));
|
|
companyInfoListDTO.setTypeName(dataDictionaryService.findNameByCatalogNameAndValue("企业类型", companyInfo.getType()));
|
|
|
companyInfoListDTO.setScaleName(dataDictionaryService.findNameByCatalogNameAndValue("企业规模", companyInfo.getScale()));
|
|
companyInfoListDTO.setScaleName(dataDictionaryService.findNameByCatalogNameAndValue("企业规模", companyInfo.getScale()));
|
|
|
- companyInfoListDTO.setIndustryName(dataDictionaryService.findNameByCatalogNameAndValue("所属行业", companyInfo.getIndustry()));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //子行业
|
|
|
|
|
+ IndustryInfo industryInfo = industryInfoService.get(companyInfo.getIndustry());
|
|
|
|
|
+ String industryName = industryInfo.getIndustryName();
|
|
|
|
|
+ //父行业
|
|
|
|
|
+ if (StringUtils.isNotBlank(industryInfo.getParentId())){
|
|
|
|
|
+ IndustryInfo industryInfo1 = industryInfoService.get(industryInfo.getParentId());
|
|
|
|
|
+ if (industryInfo1 != null){
|
|
|
|
|
+ industryName = industryInfo1.getIndustryName()+"/"+industryName;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ companyInfoListDTO.setIndustryName(industryName);
|
|
|
list.add(companyInfoListDTO);
|
|
list.add(companyInfoListDTO);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
@@ -199,12 +274,23 @@ public class CompanyInfoApiController {
|
|
|
BeanUtils.copyProperties(companyInfo, companyInfoDetailDTO);
|
|
BeanUtils.copyProperties(companyInfo, companyInfoDetailDTO);
|
|
|
companyInfoDetailDTO.setTypeName(dataDictionaryService.findNameByCatalogNameAndValue("企业类型", companyInfo.getType()));
|
|
companyInfoDetailDTO.setTypeName(dataDictionaryService.findNameByCatalogNameAndValue("企业类型", companyInfo.getType()));
|
|
|
companyInfoDetailDTO.setScaleName(dataDictionaryService.findNameByCatalogNameAndValue("企业规模", companyInfo.getScale()));
|
|
companyInfoDetailDTO.setScaleName(dataDictionaryService.findNameByCatalogNameAndValue("企业规模", companyInfo.getScale()));
|
|
|
- companyInfoDetailDTO.setIndustryName(dataDictionaryService.findNameByCatalogNameAndValue("所属行业", companyInfo.getIndustry()));
|
|
|
|
|
|
|
+
|
|
|
|
|
+ //子行业
|
|
|
|
|
+ IndustryInfo industryInfo = industryInfoService.get(companyInfo.getIndustry());
|
|
|
|
|
+ String industryName = industryInfo.getIndustryName();
|
|
|
|
|
+ //父行业
|
|
|
|
|
+ if (StringUtils.isNotBlank(industryInfo.getParentId())){
|
|
|
|
|
+ IndustryInfo industryInfo1 = industryInfoService.get(industryInfo.getParentId());
|
|
|
|
|
+ if (industryInfo1 != null){
|
|
|
|
|
+ industryName = industryInfo1.getIndustryName()+"/"+industryName;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ companyInfoDetailDTO.setIndustryName(industryName);
|
|
|
|
|
|
|
|
//企业风采
|
|
//企业风采
|
|
|
List<NewsInfoListDTO> newsInfoDTOList = new ArrayList<>();
|
|
List<NewsInfoListDTO> newsInfoDTOList = new ArrayList<>();
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
- searchParams.put("newsTypeName","企业风采");
|
|
|
|
|
searchParams.put("companyId",companyInfo.getId());
|
|
searchParams.put("companyId",companyInfo.getId());
|
|
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
List<Sort> sortList = new ArrayList<>();
|