|
|
@@ -1,6 +1,5 @@
|
|
|
package com.goafanti.common.controller;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -16,6 +15,7 @@ import com.goafanti.achievement.service.AchievementService;
|
|
|
import com.goafanti.common.enums.AchievementMaturity;
|
|
|
import com.goafanti.common.enums.AchievementTransferMode;
|
|
|
import com.goafanti.common.enums.UserType;
|
|
|
+import com.goafanti.common.service.FieldGlossoryService;
|
|
|
import com.goafanti.demand.service.DemandService;
|
|
|
import com.goafanti.portal.bo.AchievementPortalDetailBo;
|
|
|
import com.goafanti.portal.bo.AchievementPortalSimilarListBo;
|
|
|
@@ -25,9 +25,17 @@ import com.goafanti.portal.bo.DemandPortalSimilarListBo;
|
|
|
@Controller
|
|
|
public class PortalController extends BaseController {
|
|
|
@Resource
|
|
|
- private AchievementService achievementService;
|
|
|
+ private AchievementService achievementService;
|
|
|
@Resource
|
|
|
- private DemandService demandService;
|
|
|
+ private DemandService demandService;
|
|
|
+ @Resource
|
|
|
+ private FieldGlossoryService fieldGlossoryService;
|
|
|
+
|
|
|
+ private static final String UNIT = "万元";
|
|
|
+
|
|
|
+ private static final int MULTIPLE = 20;
|
|
|
+
|
|
|
+ private static final String DELIMITER = "-";
|
|
|
|
|
|
@RequestMapping(value = "/index", method = RequestMethod.GET)
|
|
|
public String index(ModelAndView modelview) {
|
|
|
@@ -52,16 +60,53 @@ public class PortalController extends BaseController {
|
|
|
demand = demandService.findOrgPortalDemandDetail(id);
|
|
|
}
|
|
|
if (null != demand) {
|
|
|
- String keyword = demand.getKeyword();
|
|
|
- if (StringUtils.isNotBlank(keyword)) {
|
|
|
- demand.setKeywordList(Arrays.asList(keyword.trim().split(",|,")));
|
|
|
- }
|
|
|
Integer industryCategoryA = demand.getIndustryCategoryA();
|
|
|
+ String industryCategory = "";
|
|
|
+ boolean a = Boolean.FALSE;
|
|
|
+ boolean b = Boolean.FALSE;
|
|
|
if (null != industryCategoryA) {
|
|
|
List<DemandPortalSimilarListBo> similarList = demandService.findByIndustryCategoryA(industryCategoryA,
|
|
|
demand.getId());
|
|
|
+ if (!similarList.isEmpty()) {
|
|
|
+ for (DemandPortalSimilarListBo s : similarList) {
|
|
|
+ a = Boolean.FALSE;
|
|
|
+ b = Boolean.FALSE;
|
|
|
+ industryCategory = "";
|
|
|
+ if (StringUtils.isBlank(s.getIndustryCategoryAS())) {
|
|
|
+ a = Boolean.TRUE;
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(s.getIndustryCategoryBS())) {
|
|
|
+ b = Boolean.TRUE;
|
|
|
+ }
|
|
|
+ industryCategory += (a ? s.getIndustryCategoryAS() : "") + (a && b ? DELIMITER : "")
|
|
|
+ + (b ? s.getIndustryCategoryBS() : "");
|
|
|
+ s.setIndustryCategory(industryCategory);
|
|
|
+ if (null != s.getBudgetCost()) {
|
|
|
+ s.setBudgetCostS(s.getBudgetCostS() + UNIT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
mv.addObject("similarList", similarList);
|
|
|
+ a = Boolean.FALSE;
|
|
|
+ if (StringUtils.isNotBlank(demand.getIndustryCategoryAS())) {
|
|
|
+ a = Boolean.TRUE;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ b = Boolean.FALSE;
|
|
|
+ if (StringUtils.isNotBlank(demand.getIndustryCategoryBS())) {
|
|
|
+ b = Boolean.TRUE;
|
|
|
}
|
|
|
+
|
|
|
+ industryCategory += (a ? demand.getIndustryCategoryAS() : "") + (a && b ? DELIMITER : "")
|
|
|
+ + (b ? demand.getIndustryCategoryBS() : "");
|
|
|
+ demand.setIndustryCategory(industryCategory);
|
|
|
+
|
|
|
+ String location = "";
|
|
|
+ String province = demand.getProvince();
|
|
|
+ String city = demand.getCity();
|
|
|
+ location += (StringUtils.isBlank(province) ? "" : province) + (StringUtils.isBlank(city) ? "" : city);
|
|
|
+ demand.setLocation(location);
|
|
|
}
|
|
|
mv.setViewName("/portal/detail/demandDetail");
|
|
|
mv.addObject("demand", demand);
|
|
|
@@ -82,25 +127,39 @@ public class PortalController extends BaseController {
|
|
|
achievement = achievementService.findOrgPortalAchievementDetail(id);
|
|
|
}
|
|
|
if (null != achievement) {
|
|
|
- String keyword = achievement.getKeyword();
|
|
|
- if (StringUtils.isNotBlank(keyword)) {
|
|
|
- achievement.setKeywordList(Arrays.asList(keyword.trim().split(",|,")));
|
|
|
- }
|
|
|
Integer fieldA = achievement.getFieldA();
|
|
|
+ String field = "";
|
|
|
+ boolean a = Boolean.FALSE;
|
|
|
+ boolean b = Boolean.FALSE;
|
|
|
if (null != fieldA) {
|
|
|
List<AchievementPortalSimilarListBo> similarList = achievementService.findByFieldA(fieldA,
|
|
|
achievement.getId(), type);
|
|
|
+ if (!similarList.isEmpty()) {
|
|
|
+ for (AchievementPortalSimilarListBo bo : similarList) {
|
|
|
+ if (null != bo.getMaturity()) {
|
|
|
+ bo.setMaturityS(bo.getMaturity() * MULTIPLE + "%");
|
|
|
+ }
|
|
|
+ if (null != bo.getTransferPrice()) {
|
|
|
+ bo.setTransferPriceS(bo.getTransferPrice() + UNIT);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
mv.addObject("similarList", similarList);
|
|
|
+ if (StringUtils.isNotBlank(achievement.getFieldAS())) {
|
|
|
+ a = Boolean.TRUE;
|
|
|
+ }
|
|
|
}
|
|
|
+ if (StringUtils.isNotBlank(achievement.getFieldBS())) {
|
|
|
+ b = Boolean.TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ field += (a ? achievement.getFieldAS() : "") + (a && b ? DELIMITER : "") + (b ? achievement.getFieldBS() : "");
|
|
|
+ achievement.setField(field);
|
|
|
String technicalPictureUrl = achievement.getTechnicalPictureUrl();
|
|
|
if (StringUtils.isNotBlank(technicalPictureUrl)) {
|
|
|
achievement.setPictureList(Arrays.asList(technicalPictureUrl.trim().split(",|,")));
|
|
|
}
|
|
|
- List<String> list = new ArrayList<String>();
|
|
|
- list.add("/achievement/achievement/28140801611164_achievement_technical_picture.jpg");
|
|
|
- list.add("/achievement/achievement/28140801611164_ach ievement_technical_picture.jpg");
|
|
|
-
|
|
|
- achievement.setPictureList(list);
|
|
|
+
|
|
|
Integer transfermode = achievement.getTransferMode();
|
|
|
if (null != transfermode) {
|
|
|
if (AchievementTransferMode.FULLTRANSFER.getCode().equals(transfermode)) {
|
|
|
@@ -132,7 +191,11 @@ public class PortalController extends BaseController {
|
|
|
String province = achievement.getProvince();
|
|
|
String city = achievement.getCity();
|
|
|
location += (StringUtils.isBlank(province) ? "" : province) + (StringUtils.isBlank(city) ? "" : city);
|
|
|
+ if (null != achievement.getTransferPrice()) {
|
|
|
+ achievement.setTransferPriceS(achievement.getTransferPrice() + UNIT);
|
|
|
+ }
|
|
|
achievement.setLocation(location);
|
|
|
+
|
|
|
}
|
|
|
mv.setViewName("/portal/detail/achievementDetail");
|
|
|
mv.addObject("achievement", achievement);
|