|
|
@@ -86,54 +86,36 @@ public class PortalController extends BaseController {
|
|
|
}
|
|
|
}
|
|
|
Integer industryCategoryA = demand.getIndustryCategoryA();
|
|
|
- String industryCategory = "";
|
|
|
- boolean a = Boolean.FALSE;
|
|
|
- boolean b = Boolean.FALSE;
|
|
|
+ boolean hasCategoryA = false;
|
|
|
+ boolean hasCategoryB = 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.isNotBlank(s.getIndustryCategoryAS())) {
|
|
|
- a = Boolean.TRUE;
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(s.getIndustryCategoryBS())) {
|
|
|
- b = Boolean.TRUE;
|
|
|
- }
|
|
|
- industryCategory += (a ? s.getIndustryCategoryAS() : "") + (a && b ? DELIMITER : "")
|
|
|
- + (b ? s.getIndustryCategoryBS() : "");
|
|
|
- s.setIndustryCategory(industryCategory);
|
|
|
+ hasCategoryA = StringUtils.isNotBlank(s.getIndustryCategoryAS());
|
|
|
+ hasCategoryB = StringUtils.isNotBlank(s.getIndustryCategoryBS());
|
|
|
+ s.setIndustryCategory((hasCategoryA ? s.getIndustryCategoryAS() : "")
|
|
|
+ + (hasCategoryA && hasCategoryB ? DELIMITER : "")
|
|
|
+ + (hasCategoryB ? s.getIndustryCategoryBS() : ""));
|
|
|
if (null != s.getBudgetCost() || s.getBudgetCost().compareTo(BigDecimal.ZERO) > 0) {
|
|
|
s.setBudgetCostS(s.getBudgetCost() + UNIT);
|
|
|
} else {
|
|
|
s.setBudgetCostS(PRICE_NEGOTIABLE);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
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;
|
|
|
+ hasCategoryA = StringUtils.isNotBlank(demand.getIndustryCategoryAS());
|
|
|
}
|
|
|
+ hasCategoryB = StringUtils.isNotBlank(demand.getIndustryCategoryBS());
|
|
|
|
|
|
- industryCategory += (a ? demand.getIndustryCategoryAS() : "") + (a && b ? DELIMITER : "")
|
|
|
- + (b ? demand.getIndustryCategoryBS() : "");
|
|
|
- demand.setIndustryCategory(industryCategory);
|
|
|
+ demand.setIndustryCategory((hasCategoryA ? demand.getIndustryCategoryAS() : "")
|
|
|
+ + (hasCategoryA && hasCategoryB ? DELIMITER : "")
|
|
|
+ + (hasCategoryB ? demand.getIndustryCategoryBS() : ""));
|
|
|
|
|
|
- String location = "";
|
|
|
- String province = demand.getProvince();
|
|
|
- String city = demand.getCity();
|
|
|
- location += (StringUtils.isBlank(province) ? "" : province) + (StringUtils.isBlank(city) ? "" : city);
|
|
|
- demand.setLocation(location);
|
|
|
+ demand.setLocation((StringUtils.isBlank(demand.getProvince()) ? "" : demand.getProvince())
|
|
|
+ + (StringUtils.isBlank(demand.getCity()) ? "" : demand.getCity()));
|
|
|
}
|
|
|
mv.setViewName("/portal/detail/demandDetail");
|
|
|
mv.addObject("demand", demand);
|