Kaynağa Gözat

技术交易主页查询问题

zou_ht 8 yıl önce
ebeveyn
işleme
18e2752ee4

+ 71 - 5
src/main/java/com/goafanti/common/controller/PortalController.java

@@ -124,6 +124,17 @@ public class PortalController extends BaseController {
 			demand.setLocation((StringUtils.isBlank(demand.getProvince()) ? "" : demand.getProvince())
 					+ (StringUtils.isBlank(demand.getCity()) ? "" : demand.getCity()));
 		}
+		
+		
+			String demandpic=demand.getPictureUrl();//在存在多张图片的情况下,暂时先取第一张
+			if(null!= demandpic) {
+				boolean hascomma = demandpic.contains(",");
+				if(hascomma) {
+					String[] picurl = demandpic.split(",");
+					demand.setPictureUrl(picurl[0]);
+				}
+			}
+		
 
 		/*--------------查询精品需求---------------*/
 		List<DemandListBo> boutiquedemand = demandService.selectDemandList(1);
@@ -135,8 +146,19 @@ public class PortalController extends BaseController {
 			reboutiquedemand.add(boutiquedemand.get(index + 2));
 		} else {
 			reboutiquedemand.addAll(boutiquedemand);
-		}
-		;
+		};
+		
+		for (int i = 0; i < reboutiquedemand.size(); i++) {
+			String pic=reboutiquedemand.get(i).getPictureUrl();//在存在多张图片的情况下,暂时先取第一张
+			if(null!= pic) {
+				boolean hascomma = pic.contains(",");
+				if(hascomma) {
+					String[] picurl = pic.split(",");
+					reboutiquedemand.get(i).setPictureUrl(picurl[0]);
+				}
+			}
+		};
+		
 
 		// 判断登录没登录. 登录了.查找用户喜欢的. 没登录就随机查四个.
 		boolean isLogin = TokenManager.isLogin();
@@ -182,7 +204,18 @@ public class PortalController extends BaseController {
 					redemandlist.get(i).setDemandTypeS("技术人才型需求");
 				}
 			}
-		}
+		};
+		
+		for (int i = 0; i < redemandlist.size(); i++) {
+			String pic=redemandlist.get(i).getPictureUrl();//在存在多张图片的情况下,暂时先取第一张
+			if(null!= pic) {
+				boolean hascomma = pic.contains(",");
+				if(hascomma) {
+					String[] picurl = pic.split(",");
+					redemandlist.get(i).setPictureUrl(picurl[0]);
+				}
+			}
+		};
 
 		mv.setViewName("/portal/technologyTrading/demandDetail");
 		mv.addObject("demand", demand);
@@ -308,6 +341,17 @@ public class PortalController extends BaseController {
 					achievementdetail.setMaturityS(AchievementMaturity.MASSPRODUCTION.getDesc());
 				}
 			}
+			
+			String pic=achievementdetail.getTechnicalPictureUrl();//在存在多张图片的情况下,暂时先取第一张
+			if(null!= pic) {
+				boolean hascomma = pic.contains(",");
+				if(hascomma) {
+					String[] picurl = pic.split(",");
+					achievementdetail.setTechnicalPictureUrl(picurl[0]);
+				}
+			}
+			
+			
 			String location = "";
 			String province = achievementdetail.getProvince();
 			String city = achievementdetail.getCity();
@@ -338,8 +382,20 @@ public class PortalController extends BaseController {
 			reboutiqueachievement.add(boutiqueachievement.get(index + 2));
 		} else {
 			reboutiqueachievement.addAll(boutiqueachievement);
-		}
-		;
+		};
+		
+		for (int i = 0; i < boutiqueachievement.size(); i++) {
+			String pic=boutiqueachievement.get(i).getTechnicalpictureurl();//在存在多张图片的情况下,暂时先取第一张
+			if(null!= pic) {
+				boolean hascomma = pic.contains(",");
+				if(hascomma) {
+					String[] picurl = pic.split(",");
+					boutiqueachievement.get(i).setTechnicalpictureurl(picurl[0]);
+				}
+			}
+		};
+		
+		
 
 		// 判断登录没登录. 登录了.查找用户喜欢的. 没登录就随机查四个.
 		boolean isLogin = TokenManager.isLogin();
@@ -445,7 +501,17 @@ public class PortalController extends BaseController {
 				} else if (AchievementMaturity.MASSPRODUCTION.getCode().equals(maturity)) {
 					reachievementlist.get(i).setMaturityS(AchievementMaturity.MASSPRODUCTION.getDesc());
 				}
+			};
+			
+			String pic=reachievementlist.get(i).getTechnicalpictureurl();//在存在多张图片的情况下,暂时先取第一张
+			if(null!= pic) {
+				boolean hascomma = pic.contains(",");
+				if(hascomma) {
+					String[] picurl = pic.split(",");
+					reachievementlist.get(i).setTechnicalpictureurl(picurl[0]);
+				}
 			}
+			
 
 		}
 

+ 4 - 4
src/main/java/com/goafanti/common/mapper/AchievementMapper.xml

@@ -1462,8 +1462,8 @@
 	on 
 		a.field_a = b.id 	
 	where 
-		a.boutique = 1  and a.audit_status = 3 
-	<if test="dataCategory != null and dataCategory != ''">
+		a.boutique = 1  and a.audit_status = 3 and a.deleted_sign=0
+	<if test="fieldA != null and fieldA != ''">
 		and a.field_a = #{fieldA,jdbcType=INTEGER}
 	</if>
 	<if test="dataCategory != null and dataCategory != ''">
@@ -1487,8 +1487,8 @@
 	on 
 		a.field_a = b.id 
 	where 
-		a.boutique = 1  and a.audit_status = 3 
-	<if test="dataCategory != null and dataCategory != ''">
+		a.boutique = 1  and a.audit_status = 3 and a.deleted_sign=0
+	<if test="fieldA != null and fieldA != ''">
 		and a.field_a = #{fieldA,jdbcType=INTEGER}
 	</if>
 	<if test="dataCategory != null and dataCategory != ''">

+ 8 - 2
src/main/java/com/goafanti/common/mapper/DemandMapper.xml

@@ -1191,7 +1191,10 @@
 	on 
 		a.industry_category_a = b.id
 	where
-		a.boutique = 1 and a.audit_status =3 and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER} 
+		a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
+	<if test="industryCategoryA != null and industryCategoryA != ''">
+		and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER} 
+	</if>	
 	order by 
 		a.create_time desc
 	<if test="page_sql!=null">
@@ -1208,7 +1211,10 @@
 	on 
 		a.industry_category_a = b.id
 	where
-		a.boutique = 1 and a.audit_status =3 and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER} 
+		a.boutique = 1 and a.audit_status =3 and a.deleted_sign=0
+	<if test="industryCategoryA != null and industryCategoryA != ''">
+		and a.industry_category_a = #{industryCategoryA,jdbcType=INTEGER} 
+	</if>
   </select>
   
   <!-- 查询需求列表 -->

+ 1 - 1
src/main/webapp/WEB-INF/views/portal/technologyTrading/achievementDetail.html

@@ -54,7 +54,7 @@
 						</div>
 						<div class="basic_right">
 							<h5>交易方式</h5>
-							<p th:text="${achievementdetail.transferModeS}"></p>
+							<p th:text="${achievementdetail.transferModeS}?${achievementdetail.transferModeS}:面议"></p>
 						</div>
 						<!-- <span><img th:src="${portalHost + '/img/detail_img5.png'}"alt="" /> <span  >8</span> </span> -->
 						<div class="detail_btn">我要咨询</div>