|
@@ -6,6 +6,7 @@ import com.jpsoft.enterprise.modules.base.service.CompanyInfoService;
|
|
|
import com.jpsoft.enterprise.modules.common.dto.MessageResult;
|
|
import com.jpsoft.enterprise.modules.common.dto.MessageResult;
|
|
|
import com.jpsoft.enterprise.modules.common.utils.PojoUtils;
|
|
import com.jpsoft.enterprise.modules.common.utils.PojoUtils;
|
|
|
import com.jpsoft.enterprise.modules.common.dto.Sort;
|
|
import com.jpsoft.enterprise.modules.common.dto.Sort;
|
|
|
|
|
+import com.jpsoft.enterprise.modules.sys.service.DataDictionaryService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -18,6 +19,10 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * 企业管理
|
|
|
|
|
+ * sz
|
|
|
|
|
+ */
|
|
|
@RestController
|
|
@RestController
|
|
|
@RequestMapping("/base/companyInfo")
|
|
@RequestMapping("/base/companyInfo")
|
|
|
@Api(description = "companyInfo")
|
|
@Api(description = "companyInfo")
|
|
@@ -26,6 +31,8 @@ public class CompanyInfoController {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private CompanyInfoService companyInfoService;
|
|
private CompanyInfoService companyInfoService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private DataDictionaryService dataDictionaryService;
|
|
|
|
|
|
|
|
@ApiOperation(value="创建空记录")
|
|
@ApiOperation(value="创建空记录")
|
|
|
@GetMapping("create")
|
|
@GetMapping("create")
|
|
@@ -196,7 +203,11 @@ public class CompanyInfoController {
|
|
|
@ApiOperation(value="列表")
|
|
@ApiOperation(value="列表")
|
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
@RequestMapping(value = "pageList",method = RequestMethod.POST)
|
|
|
public MessageResult<Map> pageList(
|
|
public MessageResult<Map> pageList(
|
|
|
- String id,
|
|
|
|
|
|
|
+ @RequestParam(value="companyName",defaultValue="") String companyName,
|
|
|
|
|
+ @RequestParam(value="type",defaultValue="") String type,
|
|
|
|
|
+ @RequestParam(value="industry",defaultValue="") String industry,
|
|
|
|
|
+ @RequestParam(value="scale",defaultValue="") String scale,
|
|
|
|
|
+ @RequestParam(value="region",defaultValue="") String region,
|
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
@RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
|
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
@RequestParam(value="pageSize",defaultValue="20") int pageSize,
|
|
|
@RequestAttribute String subject){
|
|
@RequestAttribute String subject){
|
|
@@ -209,13 +220,35 @@ public class CompanyInfoController {
|
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
Map<String,Object> searchParams = new HashMap<>();
|
|
|
|
|
|
|
|
List<Sort> sortList = new ArrayList<>();
|
|
List<Sort> sortList = new ArrayList<>();
|
|
|
- sortList.add(new Sort("id_","asc"));
|
|
|
|
|
|
|
+ sortList.add(new Sort("create_time","desc"));
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isNotEmpty(companyName)) {
|
|
|
|
|
+ searchParams.put("companyName","%" + companyName + "%");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isNotEmpty(type)) {
|
|
|
|
|
+ searchParams.put("type",type);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (StringUtils.isNotEmpty(id)) {
|
|
|
|
|
- searchParams.put("id","%" + id + "%");
|
|
|
|
|
|
|
+ if (StringUtils.isNotEmpty(industry)) {
|
|
|
|
|
+ searchParams.put("industry",industry);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isNotEmpty(scale)) {
|
|
|
|
|
+ searchParams.put("scale",scale);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (StringUtils.isNotEmpty(region)) {
|
|
|
|
|
+ searchParams.put("region",region);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Page<CompanyInfo> page = companyInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
Page<CompanyInfo> page = companyInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
|
|
|
|
|
+ for(CompanyInfo ci : page.getResult()){
|
|
|
|
|
+ ci.setIndustryN(dataDictionaryService.findNameByCatalogNameAndValue("所属行业",ci.getIndustry()));
|
|
|
|
|
+ ci.setTypeN(dataDictionaryService.findNameByCatalogNameAndValue("企业类型",ci.getType()));
|
|
|
|
|
+ ci.setScaleN(dataDictionaryService.findNameByCatalogNameAndValue("企业规模",ci.getScale()));
|
|
|
|
|
+ ci.setRegionN(dataDictionaryService.findNameByCatalogNameAndValue("区域",ci.getRegion()));
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
msgResult.setResult(true);
|
|
msgResult.setResult(true);
|
|
|
msgResult.setData(PojoUtils.pageWrapper(page));
|
|
msgResult.setData(PojoUtils.pageWrapper(page));
|