Browse Source

项目创建因为新增字段无法创建BUG修复

anderx 7 years ago
parent
commit
84d4f71e5c

+ 3 - 1
src/main/java/com/goafanti/business/service/BusinessProjectService.java

@@ -66,6 +66,8 @@ public interface BusinessProjectService {
 	
 	List<BusinessProject> selectBusinessProjectByName(String businessName,String cid);
 
-	 List<BusinessVarieties> selectBusinessProjectCatalog();
+	List<BusinessVarieties> selectBusinessProjectCatalog();
+	 
+	
 	
 }

+ 3 - 0
src/main/java/com/goafanti/business/service/impl/BusinessProjectServiceImpl.java

@@ -1,5 +1,6 @@
 package com.goafanti.business.service.impl;
 
+import java.math.BigDecimal;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
@@ -59,6 +60,7 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
 		bp.setCreateTime(new Date());
 		bp.setStatus("0");
 		bp.setBoutique(Integer.valueOf(boutique));
+		bp.setFirstPayment(new BigDecimal("0"));
 		return businessProjectMapper.insert(bp);
 	}
 	@SuppressWarnings("unchecked")
@@ -460,5 +462,6 @@ public class BusinessProjectServiceImpl extends BaseMybatisDao<BusinessProjectMa
 		
 		return businessProjectMapper.selectBusinessProjectCatalog();
 	}
+	
 }
 

+ 6 - 1
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -15,6 +15,7 @@ import com.goafanti.banners.enums.BannersType;
 import com.goafanti.banners.service.BannersService;
 import com.goafanti.common.enums.MarketingPage;
 import com.goafanti.common.model.Banners;
+import com.goafanti.common.model.BusinessProject;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.demand.service.DemandService;
 import com.goafanti.marketing.bo.MarketingManagementBo;
@@ -229,8 +230,11 @@ public class WebpageController extends BaseController {
 		if (!banners.isEmpty()) {
 			modelview.addObject("banner", banners.get(0));
 		}
-		//modelview.addObject("zfwl", newsService.findIndexNewsList(0, NewsType.ZFWL.getCode(), 2));
+		//政策
 		modelview.addObject("jtdt", newsService.findIndexNewsList(0, NewsType.JTDT.getCode(), 4));
+		//服务项目
+		List<BusinessProject> projectList=marketingManagementService.selectHotProject(5);
+		
 		List<MarketingManagementBo> achievementList = marketingManagementService.selectMarketList(request,
 				MarketingPage.mainAchievement.getPageUrl(), MarketingPage.mainAchievement.getBoothType());
 		List<MarketingManagementBo> demandList = marketingManagementService.selectMarketList(request,
@@ -240,6 +244,7 @@ public class WebpageController extends BaseController {
 		modelview.addObject("achievementList", achievementList);
 		modelview.addObject("demandList", demandList);
 		modelview.addObject("speciaList", speciaList);
+		modelview.addObject("projectList", projectList);
 		return modelview; 
 	}
 

+ 2 - 0
src/main/java/com/goafanti/common/dao/BusinessProjectMapper.java

@@ -95,4 +95,6 @@ public interface BusinessProjectMapper {
 	List<ProjectBo> selectServiceProjectDetail();
 
 	 List<BusinessVarieties> selectBusinessProjectCatalog();
+
+	
 }

+ 7 - 0
src/main/java/com/goafanti/common/dao/MarketingManagementMapper.java

@@ -1,5 +1,6 @@
 package com.goafanti.common.dao;
 
+import com.goafanti.common.model.BusinessProject;
 import com.goafanti.common.model.MarketingManagement;
 import com.goafanti.common.model.MarketingManagementExample;
 import com.goafanti.marketing.bo.MarketingManagementBo;
@@ -126,4 +127,10 @@ public interface MarketingManagementMapper {
 	 * @return
 	 */
 	List<MarketingManagementBo> selectMarketList(@Param("url")String url,@Param("showPage")String showPage, @Param("category")Integer category);
+	/**
+	 * 查询服务列表
+	 * @param pSize
+	 * @return
+	 */
+	List<BusinessProject> selectHotProject(@Param("pSize")Integer pSize);
 }

+ 2 - 0
src/main/java/com/goafanti/common/mapper/BusinessProjectMapper.xml

@@ -811,4 +811,6 @@
   <select id="selectBusinessProjectCatalog" resultType="com.goafanti.common.model.BusinessVarieties">
   	select id,cname from business_varieties where delete_sign = 0
   </select>
+  
+
 </mapper>

+ 40 - 25
src/main/java/com/goafanti/common/mapper/MarketingManagementMapper.xml

@@ -353,25 +353,25 @@
   </select>
   <select id="selectMarketList" resultType="com.goafanti.marketing.bo.MarketingManagementBo">
   	<if test="category == 1"> <!-- 成果 -->
-  		select
-	x.id as productId,
-	x.owner_type as ownerType,
-	x.summary,
-	x.name,
-	x.technical_picture_url  as coverImg,
-	bi.platform_url
+  		    select
+	x.id as productId,x.owner_type as ownerType,x.summary,x.introduction,x.name,x.field_a,fg.name as fieldA,
+	x.field_b,fg1.name as fieldB,x.technical_picture_url  as coverImg,bi.domain_name 
 from
 	 achievement x 
 right join achievement_publish ap on ap.achievement_id=x.id
 left join branch_information bi on bi.id=ap.publish_platform
+left join field_glossory fg on x.field_a=fg.id
+left join field_glossory fg1 on x.field_b=fg1.id
 where x.audit_status = 3
 	and x.deleted_sign = 0
 	and ap.publish_client='0'
 	and ap.publish_page='W01'
-	and bi.platform_url like "%"#{url,jdbcType=VARCHAR}"%"
+	and bi.domain_name like "%"#{url,jdbcType=VARCHAR}"%"
   	</if>
   	<if test="category == 2"> <!-- 需求 -->
-  		select x.id as productId,x.data_category as ownerType,x.name,x.picture_url as coverImg,x.problem_des
+  		select x.id as productId,x.data_category as ownerType,x.name,
+	x.picture_url as coverImg,x.problem_des as problemDes,
+	x.urgent_days as urgentDays,x.urgent_money as urgentMoney,bi.domain_name
 		from    demand x 
 		right join demand_publish dp on dp.demand_id=x.id
 		left join branch_information bi on bi.id=dp.publish_platform
@@ -383,21 +383,36 @@ where x.audit_status = 3
   	</if>
   	<if test="category == 7"> <!-- 智者 -->
   		select
-                u.id,i.username,ua.ability_label as abilityLabel,
-                u.introduction as achievement,u.head_portrait_url as headPortraitUrl,u.type,i.expert
-                from `user` u
-                left join user_ability ua on u.id=ua.uid
-                left join user_career c on u.id=c.uid
-                left join user_identity i on u.id=i.uid
-                right join expert_publish ep on ep.expert_id=u.id
-                left join branch_information bi on bi.id=ep.publish_platform
-                WHERE
-                u.type = 0 and
-                i.expert = 1
-                and ep.publish_client='0'
-                and ep.publish_page='W01'
-		and bi.domain_name like "%"#{url,jdbcType=VARCHAR}"%" 
-		
-  	</if>
+		u.id,i.username,i.work_unit as workUnit,i.professional_title as professionalTitle,u.introduction,
+	    u.head_portrait_url as headPortraitUrl,u.type,i.expert,bi.domain_name,ifnull(o.x,0) as reservationCount
+	    from `user` u
+	    left join user_ability ua on u.id=ua.uid
+	    left join user_career c on u.id=c.uid
+	    left join user_identity i on u.id=i.uid
+	    left join (select count(0) as x,seller_id from t_order
+				where order_status != 4
+				group by  seller_id ) o on u.id=o.seller_id
+	    right join expert_publish ep on ep.expert_id=u.id
+	    left join branch_information bi on bi.id=ep.publish_platform
+	    WHERE
+	    u.type = 0 
+	    and i.expert = 1
+	    and ep.publish_client='0'
+	    and ep.publish_page='W01'
+	    and bi.domain_name like "%"#{url,jdbcType=VARCHAR}"%" 
+	</if>
+  </select>
+  
+    <select id="selectHotProject" resultType="com.goafanti.common.model.BusinessProject">
+  	select 
+  	id, create_id as createId, create_time as createTime, update_time as updateTime, delete_sign as deleteSign, bname, cid, price, offset, 
+    activity_price as activityPrice, activity_flag as activityFlag, member_price as memberPrice, introduce, status, country, province, 
+    city, district, principal_id as principalId, Value_effect as ValueEffect, client_size as clientSize, max_logo as maxLogo, min_logo as minLogo, boutique, 
+    project_url as projectUrl, first_payment as firstPayment
+  	FROM business_project
+    where boutique=1
+    <if test="pSize != null">
+    LIMIT 0, #{pSize,jdbcType=VARCHAR}
+    </if>    
   </select>
 </mapper>

+ 60 - 11
src/main/java/com/goafanti/marketing/bo/MarketingManagementBo.java

@@ -6,18 +6,48 @@ public class MarketingManagementBo extends MarketingManagement{
 	private String name; /** 名字 **/
 	private String summary; /** 简介 **/
 	private String ownerType; /** 用户类型 **/
-	private String problem_des;/** 问题说明 **/
-	
+	private String problemDes;/** 问题说明 **/
+	private String fieldA;
+	private String fieldB;
+	private String urgentDays;
+	private String urgentMoney;
+	private String workUnit;
+	private String professionalTitle;
 	private String abilityLabel;/** 领域 **/
 	private String username;/** 智者名字 **/
-	private String achievement;/** 主要成就 **/
+	private String introduction;/** 简介 **/
 	private String headPortraitUrl;/** 头像地址 **/
 	private String id;/** 智者ID **/
 	private String type;/** 个人,单位 **/
+	private Integer reservationCount;/**预约次数**/
 	
 	public String getName() {
 		return name;
 	}
+	public String getFieldA() {
+		return fieldA;
+	}
+	public void setFieldA(String fieldA) {
+		this.fieldA = fieldA;
+	}
+	public String getFieldB() {
+		return fieldB;
+	}
+	public void setFieldB(String fieldB) {
+		this.fieldB = fieldB;
+	}
+	public String getUrgentDays() {
+		return urgentDays;
+	}
+	public void setUrgentDays(String urgentDays) {
+		this.urgentDays = urgentDays;
+	}
+	public String getUrgentMoney() {
+		return urgentMoney;
+	}
+	public void setUrgentMoney(String urgentMoney) {
+		this.urgentMoney = urgentMoney;
+	}
 	public String getType() {
 		return type;
 	}
@@ -42,11 +72,11 @@ public class MarketingManagementBo extends MarketingManagement{
 	public void setUsername(String username) {
 		this.username = username;
 	}
-	public String getAchievement() {
-		return achievement;
+	public String getIntroduction() {
+		return introduction;
 	}
-	public void setAchievement(String achievement) {
-		this.achievement = achievement;
+	public void setIntroduction(String introduction) {
+		this.introduction = introduction;
 	}
 	public String getHeadPortraitUrl() {
 		return headPortraitUrl;
@@ -54,11 +84,11 @@ public class MarketingManagementBo extends MarketingManagement{
 	public void setHeadPortraitUrl(String headPortraitUrl) {
 		this.headPortraitUrl = headPortraitUrl;
 	}
-	public String getProblem_des() {
-		return problem_des;
+	public String getProblemDes() {
+		return problemDes;
 	}
-	public void setProblem_des(String problem_des) {
-		this.problem_des = problem_des;
+	public void setProblemDes(String problemDes) {
+		this.problemDes = problemDes;
 	}
 	public void setName(String name) {
 		this.name = name;
@@ -75,4 +105,23 @@ public class MarketingManagementBo extends MarketingManagement{
 	public void setOwnerType(String ownerType) {
 		this.ownerType = ownerType;
 	}
+	public Integer getReservationCount() {
+		if(reservationCount!=null)return 20;
+		return reservationCount+20;
+	}
+	public void setReservationCount(Integer reservationCount) {
+		this.reservationCount = reservationCount;
+	}
+	public String getWorkUnit() {
+		return workUnit;
+	}
+	public void setWorkUnit(String workUnit) {
+		this.workUnit = workUnit;
+	}
+	public String getProfessionalTitle() {
+		return professionalTitle;
+	}
+	public void setProfessionalTitle(String professionalTitle) {
+		this.professionalTitle = professionalTitle;
+	}
 }

+ 8 - 0
src/main/java/com/goafanti/marketing/service/MarketingManagementService.java

@@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletRequest;
 
 import org.apache.http.HttpRequest;
 
+import com.goafanti.common.model.BusinessProject;
 import com.goafanti.common.model.MarketingManagement;
 import com.goafanti.marketing.bo.MarketingManagementBo;
 
@@ -52,4 +53,11 @@ public interface MarketingManagementService {
 	 * @return
 	 */
 	public List<MarketingManagementBo> selectMarketList(HttpServletRequest res,String showPage,Integer category);
+	
+	/**
+	 * 查询营销活动
+	 * @param pSize 页面显示数
+	 * @return
+	 */
+	List<BusinessProject> selectHotProject(Integer pSize);
 }

+ 10 - 0
src/main/java/com/goafanti/marketing/service/impl/MarketingManagementServiceImpl.java

@@ -10,6 +10,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.goafanti.common.dao.MarketingManagementMapper;
+import com.goafanti.common.model.BusinessProject;
 import com.goafanti.common.model.MarketingManagement;
 import com.goafanti.marketing.bo.MarketingManagementBo;
 import com.goafanti.marketing.service.MarketingManagementService;
@@ -48,7 +49,16 @@ public class MarketingManagementServiceImpl implements MarketingManagementServic
 	public List<MarketingManagementBo> selectMarketList(HttpServletRequest res,String showPage, Integer category) {
 		String url=res.getServerName();
 		url=url.substring(url.indexOf(".")+1, url.length());
+		if (url.equals("localhost")) {
+			url="jishutao.com";
+		}
 		return marketingManagementMapper.selectMarketList(url,showPage, category);
 	}
 	
+	@Override
+	public List<BusinessProject> selectHotProject(Integer pSize) {
+		
+		return marketingManagementMapper.selectHotProject(pSize);
+	}
+	
 }

+ 10 - 8
src/main/webapp/WEB-INF/views/portal/index.html

@@ -58,8 +58,7 @@
 					<div class="fruit_content" th:if="${#lists.size(achievementList) ge 1}">
 						<img th:src="${avatarUploadHost+achievementList[0].coverImg}" alt="" />
 						<div class="cont_p">
-							<h5 th:text="${achievementList[0].name}"></h5>
-							<p th:text="${achievementList[0].summary}"></p>
+							
 						</div>
 						<div class="cont_img">
 							<a th:href="@{/portal/technologyTrading/achievementDetail(id=${achievementList[0].productId},type=${achievementList[0].ownerType})}">
@@ -119,7 +118,8 @@
 				<h3>精品需求</h3>
 				<a th:href="${basePath + '/portal/technologyTrading/demand.html'}">MORE+</a>
 			</div>
-			<div class="demand_cont">				
+			<div class="demand_cont">
+										
 				<div >
 					<a th:each="item:${demandList}"
 					th:href="@{/portal/technologyTrading/demandDetail(id=${item.productId},type=${item.ownerType})}">
@@ -131,7 +131,7 @@
 								<p><span><img th:src="${portalHost + '/img/index_er4.png'}"/></span>长沙</p>
 							</div>
 						</div>
-						<p class="demand_p" th:text="${item.problem_des}"></p>
+						<p class="demand_p" th:text="${item.problemDes}"></p>
 					</div>	
 					</a>
 				</div>										
@@ -209,14 +209,16 @@
 					<span class="man_left">
 						<img th:src="${portalHost+'/img/index_er7.png'}" alt=""/>
 					</span>
+					
 					<div class="index_cont">
 						<div th:if="${#lists.size(speciaList) ge 1}">
 							<a th:href="@{/portal/subscriberDetail.html(uid=${speciaList[0].id},type=${speciaList[0].type})}">
+							
 								<div class="index_oneman">
 									<img th:src="${speciaList[0].headPortraitUrl}?${avatarUploadHost+speciaList[0].headPortraitUrl}:${avatarUploadHost + '/default/person.jpg'}" alt=""  />
 									<h4 class="appellation" th:text="${speciaList[0].abilityLabel}">湖南大学生物科学教授</h4>
 									<h3 class="definition" th:text="${speciaList[0].username}">梁晓欣</h3>
-									<p th:text="${speciaList[0].achievement}">食子酸在高温和中压条件下可以脱去羧基,从而获得焦性没食子酸,再通过升华的方式获得较纯的焦性没食子产品,
+									<p th:text="${speciaList[0].introduction}">食子酸在高温和中压条件下可以脱去羧基,从而获得焦性没食子酸,再通过升华的方式获得较纯的焦性没食子产品,
 								单升华方式产能较低且能耗高,希望通过其他方式(重结晶)等获得此产品,提高产品的产能降低能耗。</p>
 								</div>
 							</a>	
@@ -227,7 +229,7 @@
 									<img th:src="${speciaList[1].headPortraitUrl}?${avatarUploadHost+speciaList[1].headPortraitUrl}:${avatarUploadHost + '/default/person.jpg'}" alt=""  />
 									<h4 class="appellation" th:text="${speciaList[1].abilityLabel}">中医皮肤病医院专家</h4>
 									<h3 class="definition" th:text="${speciaList[1].username}">钱艳雯</h3>
-									<p th:text="${speciaList[1].achievement}">师从中医医院皮肤科师承中医泰斗、全国著名皮外科专家赵炳南先生20余年,深受其真传。
+									<p th:text="${speciaList[1].introduction}">师从中医医院皮肤科师承中医泰斗、全国著名皮外科专家赵炳南先生20余年,深受其真传。
 									尤其擅长治各种急性热性红斑性皮肤病,是著名的中西医结合皮肤病专家。</p>
 								</div>
 							</a>	
@@ -238,7 +240,7 @@
 									<img th:src="${speciaList[2].headPortraitUrl}?${avatarUploadHost+speciaList[2].headPortraitUrl}:${avatarUploadHost + '/default/person.jpg'}" alt=""  />
 									<h4 class="appellation" th:text="${speciaList[2].abilityLabel}">电子薄膜材料专家</h4>
 									<h3 class="definition" th:text="${speciaList[2].username}">刘钊鑫</h3>
-									<p th:text="${speciaList[2].achievement}">主要研究方向包括:BST铁电薄膜、半导体SiC 外延薄膜、半导体低维结构等</p>
+									<p th:text="${speciaList[2].introduction}">主要研究方向包括:BST铁电薄膜、半导体SiC 外延薄膜、半导体低维结构等</p>
 								</div>
 							</a>	
 						</div>
@@ -248,7 +250,7 @@
 									<img th:src="${speciaList[3].headPortraitUrl}?${avatarUploadHost+speciaList[3].headPortraitUrl}:${avatarUploadHost + '/default/person.jpg'}" alt=""  />
 									<h4 class="appellation" th:text="${speciaList[3].abilityLabel}">热轧平整工艺专家</h4>
 									<h3 class="definition" th:text="${speciaList[3].username}">郑纹光</h3>
-									<p th:text="${speciaList[3].achievement}">主要研究内容有热轧平整工艺的专家指导系统开发,板料冲压成型CAE和模具CAD设计。
+									<p th:text="${speciaList[3].introduction}">主要研究内容有热轧平整工艺的专家指导系统开发,板料冲压成型CAE和模具CAD设计。
 									在各类核心期刊发表研究论文18篇。研究方向:1、 模具优化设计理论及应用2、
 									人工智能技术在材料成型中的应用</p>
 								</div>