PortalSearchApiController.java 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. package com.goafanti.portal.controller;
  2. import java.math.BigDecimal;
  3. import javax.annotation.Resource;
  4. import org.apache.commons.lang3.StringUtils;
  5. import org.springframework.web.bind.annotation.RequestMapping;
  6. import org.springframework.web.bind.annotation.RequestMethod;
  7. import org.springframework.web.bind.annotation.RestController;
  8. import com.goafanti.achievement.service.AchievementService;
  9. import com.goafanti.common.bo.Result;
  10. import com.goafanti.common.controller.BaseApiController;
  11. import com.goafanti.demand.service.DemandService;
  12. @RestController
  13. @RequestMapping(value = "/portal/search")
  14. public class PortalSearchApiController extends BaseApiController {
  15. @Resource
  16. private AchievementService achievementService;
  17. @Resource
  18. private DemandService demandService;
  19. /**
  20. * 科技成果搜索
  21. */
  22. @RequestMapping(value = "/achievementList", method = RequestMethod.GET)
  23. public Result achievementSearchList(Integer bargainingMode, Integer category, Integer maturity,
  24. BigDecimal transferPriceLower, BigDecimal transferPriceUpper, Integer transferMode, String keyword,
  25. Integer fieldA, Integer fieldB, String pageNo, String pageSize) {
  26. Result res = new Result();
  27. Integer pNo = 1;
  28. Integer pSize = 10;
  29. if (StringUtils.isNumeric(pageSize)) {
  30. pSize = Integer.parseInt(pageSize);
  31. }
  32. if (StringUtils.isNumeric(pageNo)) {
  33. pNo = Integer.parseInt(pageNo);
  34. }
  35. res.setData(achievementService.listAchievementSearchList(bargainingMode, category, maturity, transferPriceLower,
  36. transferPriceUpper, transferMode, keyword, fieldA, fieldB, pNo, pSize));
  37. return res;
  38. }
  39. /**
  40. * 科技需求搜索
  41. */
  42. @RequestMapping(value = "/demandList", method = RequestMethod.GET)
  43. public Result demandSerarchList(String keyword, Integer industryCategoryA, Integer industryCategoryB,
  44. Integer demandType, BigDecimal budgetCostLower, BigDecimal budgetCostUpper, String pageNo,
  45. String pageSize) {
  46. Result res = new Result();
  47. Integer pNo = 1;
  48. Integer pSize = 10;
  49. if (StringUtils.isNumeric(pageSize)) {
  50. pSize = Integer.parseInt(pageSize);
  51. }
  52. if (StringUtils.isNumeric(pageNo)) {
  53. pNo = Integer.parseInt(pageNo);
  54. }
  55. res.setData(demandService.listDemandSearchList(keyword, industryCategoryA, industryCategoryB, demandType,
  56. budgetCostLower, budgetCostUpper, pNo, pSize));
  57. return res;
  58. }
  59. }