Browse Source

Merge branch 'master' of https://git.coding.net/aft/AFT.git

ender 8 years ago
parent
commit
c3b426a34b

+ 77 - 0
src/main/java/com/goafanti/admin/bo/BusinessBo.java

@@ -0,0 +1,77 @@
+package com.goafanti.admin.bo;
+
+import java.util.Date;
+
+public class BusinessBo {
+	private Integer id;
+	private String create_id;
+	private Date create_time;
+	private Date update_time;
+	private Integer deleteSign;
+	private String cid;
+	private String cname;
+	private Integer super_id;
+	private Integer layer;
+	private Integer status;
+	
+	public Integer getId() {
+		return id;
+	}
+	public void setId(Integer id) {
+		this.id = id;
+	}
+	public String getCreate_id() {
+		return create_id;
+	}
+	public void setCreate_id(String create_id) {
+		this.create_id = create_id;
+	}
+	public Date getCreate_time() {
+		return create_time;
+	}
+	public void setCreate_time(Date create_time) {
+		this.create_time = create_time;
+	}
+	public Date getUpdate_time() {
+		return update_time;
+	}
+	public void setUpdate_time(Date update_time) {
+		this.update_time = update_time;
+	}
+	public Integer getDeleteSign() {
+		return deleteSign;
+	}
+	public void setDeleteSign(Integer deleteSign) {
+		this.deleteSign = deleteSign;
+	}
+	public String getCid() {
+		return cid;
+	}
+	public void setCid(String cid) {
+		this.cid = cid;
+	}
+	public String getCname() {
+		return cname;
+	}
+	public void setCname(String cname) {
+		this.cname = cname;
+	}
+	public Integer getSuper_id() {
+		return super_id;
+	}
+	public void setSuper_id(Integer super_id) {
+		this.super_id = super_id;
+	}
+	public Integer getLayer() {
+		return layer;
+	}
+	public void setLayer(Integer layer) {
+		this.layer = layer;
+	}
+	public Integer getStatus() {
+		return status;
+	}
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+}

+ 49 - 0
src/main/java/com/goafanti/admin/controller/AdminBusinessApiController.java

@@ -0,0 +1,49 @@
+package com.goafanti.admin.controller;
+
+import javax.annotation.Resource;
+
+import org.junit.runner.Request;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.admin.service.BusinessService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.utils.StringUtils;
+
+@RestController
+@RequestMapping(value="/api/admin/business")
+public class AdminBusinessApiController extends CertifyApiController{
+	@Resource
+	private BusinessService businessService; 
+	/**
+	 * 品种列表
+	 * @return
+	 */
+	@RequestMapping(value="/list" , method=RequestMethod.GET)
+	private Result varietiesList(String cname,Integer super_id,Integer layer,
+								Integer status,String pageNo,
+					            String pageSize,Integer hot) {
+		Result res=new Result();
+		Integer pNo=1;
+		Integer pSize=10;
+		if (StringUtils.isNumeric(pageSize)) {
+			pSize= Integer.parseInt(pageSize);
+		}
+		if(StringUtils.isNumeric(pageNo)) {
+			pNo=Integer.parseInt(pageNo);
+		}
+		res.setData(businessService.listBusiness(cname,super_id,layer,status,pNo,pSize,hot));
+		return res;
+		
+	}
+	/**
+	 * 品种名列表
+	 * @return
+	 */
+	@RequestMapping(value="/namelist",method=RequestMethod.GET)
+	private Result varietiesNamelist(String cname) {
+		return null;
+	}
+}

+ 11 - 0
src/main/java/com/goafanti/admin/service/BusinessService.java

@@ -0,0 +1,11 @@
+package com.goafanti.admin.service;
+
+
+
+import com.goafanti.admin.bo.BusinessBo;
+import com.goafanti.core.mybatis.page.Pagination;
+
+public interface BusinessService {
+	Pagination<BusinessBo> listBusiness(String cname,Integer super_id,Integer layer,
+			Integer status,Integer pNo,Integer pSize,Integer hot);
+}

+ 57 - 0
src/main/java/com/goafanti/admin/service/impl/BusinessServiceImpl.java

@@ -0,0 +1,57 @@
+package com.goafanti.admin.service.impl;
+
+import java.util.HashMap;
+
+import java.util.Map;
+
+import org.springframework.stereotype.Service;
+
+
+import com.goafanti.admin.bo.BusinessBo;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.admin.service.BusinessService;
+import com.goafanti.common.dao.AchievementMapper;
+@Service
+public class BusinessServiceImpl extends BaseMybatisDao<AchievementMapper> implements BusinessService {
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<BusinessBo> listBusiness(String cname, Integer super_id, Integer layer, Integer status, Integer pNo,
+			Integer pSize,Integer hot) {
+		Map<String, Object> params=disposeParams(cname,super_id,layer,status,hot);
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		return (Pagination<BusinessBo>) findPage("findBusinessVarietiesListByPage",
+				"findBusinessVarietiesCount",params,
+				pNo, pSize);
+	};
+	
+
+	private Map<String, Object> disposeParams(String cname, Integer super_id, Integer layer, Integer status,Integer hot) {
+		Map<String, Object> params = new HashMap<>();
+		if (null!=cname) {
+			params.put("cname", cname);
+		}
+		if (null!=super_id) {
+			params.put("super_id", super_id);
+		}
+		if (null!=layer) {
+			params.put("layer", layer);
+		}
+		if (null!=status) {
+			params.put("status", status);
+		}
+		if (null!=hot) {
+			params.put("hot", hot);
+		}
+		return params;
+	}
+
+
+}

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

@@ -1157,7 +1157,7 @@
     	 name, keyword, category,
     	 owner_name, owner_type, owner_id_number,
     	 owner_mobile, owner_email, owner_postal_address,
-    	 cooperation_mode, introduction
+    	 cooperation_mode, introduction, tech_broker_id
     	 )
     values 
     <foreach item="item" index="index" collection="list" separator=",">
@@ -1167,7 +1167,7 @@
       	#{item.name,jdbcType=VARCHAR}, #{item.keyword,jdbcType=VARCHAR}, #{item.category,jdbcType=INTEGER},
       	#{item.ownerName,jdbcType=VARCHAR}, #{item.ownerType,jdbcType=VARCHAR}, #{item.ownerIdNumber,jdbcType=VARCHAR},
       	#{item.ownerMobile,jdbcType=VARCHAR}, #{item.ownerEmail,jdbcType=VARCHAR}, #{item.ownerPostalAddress,jdbcType=VARCHAR},
-      	#{item.cooperationMode,jdbcType=INTEGER}, #{item.introduction,jdbcType=LONGVARCHAR}
+      	#{item.cooperationMode,jdbcType=INTEGER}, #{item.introduction,jdbcType=LONGVARCHAR},#{item.techBrokerId,jdbcType=VARCHAR}
       )
     </foreach>
   </insert>
@@ -1649,6 +1649,50 @@
         </if>
   	    order by a.release_date desc limit 0,4
   </select>
+  <select id="findBusinessVarietiesListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.BusinessBo">
+  	select 
+  		b.id,b.create_id,b.create_time,b.update_time,b.delete_sign,b.cid,
+  		b.cname,b.super_id,b.super_id,b.layer,b.status,b2.cname
+  	from  business_varieties b
+  	LEFT JOIN business_varieties b2 on b.super_id = b2.id
+  	where b.deleted_sign= 1	
+  	<if test="cname != null">
+  		and  b.cname= #{cname,jdbcType=VARCHAR}
+  	</if>
+  	<if test="super_id != null">
+  		and  b.super_id= #{super_id,jdbcType=INTEGER}
+  	</if>
+  	<if test="layer != null">
+  		and  layer= #{layer,jdbcType=VARCHAR}
+  	</if>
+  	<if test="status != null">
+  		and  status= #{status,jdbcType=VARCHAR}
+  	</if>
+	order by b.id desc
+	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
   
+    <select id="findBusinessVarietiesListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.BusinessBo">
+  	select 
+  		count(distinct(c.id))
+  	from  business_varieties b
+  	LEFT JOIN business_varieties b2 on b.super_id = b2.id
+  	where b.deleted_sign= 1	
+  	<if test="cname != null">
+  		and  b.cname= #{cname,jdbcType=VARCHAR}
+  	</if>
+  	<if test="super_id != null">
+  		and  b.super_id= #{super_id,jdbcType=INTEGER}
+  	</if>
+  	<if test="layer != null">
+  		and  layer= #{layer,jdbcType=VARCHAR}
+  	</if>
+  	<if test="status != null">
+  		and  status= #{status,jdbcType=VARCHAR}
+  	</if>
+	
+  </select>
   
 </mapper>

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

@@ -769,9 +769,6 @@
 	<if test="adminId != null">
 		LEFT JOIN user u on d.employer_id = u.id
 	</if>
-	<if test="adminId != null">
-		LEFT JOIN user u on d.employer_id = u.id
-	</if>
 	<if test="hot != null and hot == 1"><!-- 在首页 -->
 		inner join marketing_management mm on d.id = mm.product_id
 	</if>
@@ -1001,7 +998,7 @@
     	status, release_status, create_time, 
     	keyword, data_category, name,
     	demand_type, problem_des, employer_name,
-    	employer_contacts, employer_contacts_mobile, employer_contacts_mailbox, info_sources)
+    	employer_contacts, employer_contacts_mobile, employer_contacts_mailbox, info_sources,tech_broker_id)
     values 
     <foreach item="item" index="index" collection="list" separator=",">
       (
@@ -1010,7 +1007,7 @@
       	#{item.keyword,jdbcType=VARCHAR}, #{item.dataCategory,jdbcType=INTEGER}, #{item.name,jdbcType=VARCHAR},
       	#{item.demandType,jdbcType=INTEGER}, #{item.problemDes,jdbcType=VARCHAR}, #{item.employerName,jdbcType=VARCHAR},
       	#{item.employerContacts,jdbcType=VARCHAR}, #{item.employerContactsMobile,jdbcType=VARCHAR}, #{item.employerContactsMailbox,jdbcType=VARCHAR},
-      	#{item.infoSources,jdbcType=INTEGER}
+      	#{item.infoSources,jdbcType=INTEGER},#{item.techBrokerId,jdbcType=VARCHAR}
       )
     </foreach>
   </insert>

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

@@ -365,7 +365,7 @@
   	<if test="category == 7"> <!-- 智者 -->
   		select 
   		u.id,i.username,ua.ability_label as abilityLabel,
-  		c.achievement,u.head_portrait_url as headPortraitUrl
+  		c.achievement,u.head_portrait_url as headPortraitUrl,u.type
   		from `user` u
   		left join user_ability ua on u.id=ua.uid
   		left join user_career c on u.id=c.uid

+ 10 - 10
src/main/java/com/goafanti/common/mapper/UserMapper.xml

@@ -1220,9 +1220,9 @@
  	<select id="findUserPartnerDetail" parameterType="java.lang.String" resultType="com.goafanti.user.bo.UserPartnerDetailBo">
 		select
 		u.id,i.username,c.work_unit as work_unit,c.position,c.achievement,
-		info.person_portrait_url as personPortraitUrl,
+		u.head_portrait_url as personPortraitUrl,
 		i.province,
-		info.personal_profile as personalProfile,
+		u.introduction as personalProfile,
 		ua.ability_label as abilityLabel,c.qualification,
 		e.graduate_school,e.major_category,c.work_unit as workUnit,
 		c.engaged_field as engagedField
@@ -1230,7 +1230,7 @@
 		left join user_identity i on u.id=i.uid
 		left join
 		user_career c on u.id=c.uid
-		left join user_info info on u.id=info.uid
+		<!-- left join user_info info on u.id=info.uid -->
 		left join user_ability ua on u.id=ua.uid
 		left join user_edu e on u.id=e.uid
 		WHERE
@@ -1243,14 +1243,14 @@
   <select id="findOrgPartnerDetail" parameterType="java.lang.String" resultType="com.goafanti.user.bo.OrgPartnerDetailBo">
 		select
 		u.id,i.username,c.work_unit as work_unit,c.position,c.achievement,
-		info.person_portrait_url as personPortraitUrl,
-		i.province,info.personal_profile as personalProfile,
+		u.head_portrait_url as personPortraitUrl,
+		i.province,u.introduction as personalProfile,
 		ua.ability_label as abilityLabel
 		from `user` u
 		left join user_identity i on u.id=i.uid
 		left join
 		user_career c on u.id=c.uid
-		left join user_info info on u.id=info.uid
+		<!-- left join user_info info on u.id=info.uid -->
 		left join user_ability ua on u.id=ua.uid
 		WHERE
 		u.type = 1
@@ -1392,15 +1392,15 @@
   <select id="findUserPartner" parameterType="String" resultType="com.goafanti.user.bo.UserPartnerDetailBo">
 		select
 		u.id,i.username,c.work_unit as work_unit,c.position,c.achievement,
-		info.person_portrait_url as personPortraitUrl,
+		u.head_portrait_url as personPortraitUrl,
 		i.province,
-		info.personal_profile as personalProfile,
-		ua.ability_label as abilityLabel
+		u.introduction as personalProfile,
+		ua.ability_label as abilityLabel,i.uid,u.type
 		from `user` u
 		left join user_identity i on u.id=i.uid
 		left join
 		user_career c on u.id=c.uid
-		left join user_info info on u.id=info.uid
+		<!-- left join user_info info on u.id=info.uid -->
 		left join user_ability ua on u.id=ua.uid
 		WHERE
 		u.type = 0

+ 14 - 1
src/main/java/com/goafanti/marketing/bo/MarketingManagementBo.java

@@ -12,11 +12,24 @@ public class MarketingManagementBo extends MarketingManagement{
 	private String username;/** 智者名字 **/
 	private String achievement;/** 主要成就 **/
 	private String headPortraitUrl;/** 头像地址 **/
-
+	private String id;/** 智者ID **/
+	private String type;/** 个人,单位 **/
 	
 	public String getName() {
 		return name;
 	}
+	public String getType() {
+		return type;
+	}
+	public void setType(String type) {
+		this.type = type;
+	}
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
 	public String getAbilityLabel() {
 		return abilityLabel;
 	}

+ 10 - 0
src/main/java/com/goafanti/user/bo/UserPartnerDetailBo.java

@@ -43,7 +43,17 @@ public class UserPartnerDetailBo {
 	private String graduate_school;
 	/**专业类别**/
 	private String major_category;
+	/**个人、单位**/
+	private String type;
 	
+	public String getType() {
+		return type;
+	}
+
+	public void setType(String type) {
+		this.type = type;
+	}
+
 	public String getGraduate_school() {
 		return graduate_school;
 	}

+ 20 - 35
src/main/webapp/WEB-INF/views/portal/index.html

@@ -116,23 +116,8 @@
 				<a th:href="${basePath + '/portal/technologyTrading/demand.html'}">MORE+</a>
 			</div>
 			<div class="demand_cont">				
-				<div>
-					<a th:each="item:${demandList}" th:class="${demandList.odd}?'odd':'even'" 
-					th:href="@{/portal/technologyTrading/demandDetail(id=${item.productId},type=${item.ownerType})}">
-					<div>
-						<div class="demand_img">
-							<img th:src="${avatarUploadHost + item.coverImg}" alt=""  />
-							<div>
-								<h5 th:text="${item.name}"></h5>
-								<p><span><img th:src="${portalHost + '/img/index_er4.png'}"/></span>长沙</p>
-							</div>
-						</div>
-						<p class="demand_p" th:text="${item.problem_des}"></p>
-					</div>	
-					</a>
-				</div>
-				<div>
-					<a th:each="item:${demandList}" th:class="${demandList.even}?'even':'odd'" 
+				<div >
+					<a th:each="item:${demandList}"
 					th:href="@{/portal/technologyTrading/demandDetail(id=${item.productId},type=${item.ownerType})}">
 					<div>
 						<div class="demand_img">
@@ -221,9 +206,9 @@
 						<img th:src="${portalHost+'/img/index_er7.png'}" alt=""/>
 					</span>
 					<div class="index_cont">
-						<div>
-							<a>
-								<div class="index_oneman" th:if="${#lists.size(speciaList) ge 1}">
+						<div th:if="${#lists.size(speciaList) ge 1}">
+							<a th:href="@{/user/subscriberDetail.html(uid=${speciaList[0].id},type=${speciaList[0].type})}">
+								<div class="index_oneman">
 									<img th:src="${avatarUploadHost+speciaList[0].headPortraitUrl}" alt=""  />
 									<h4 class="appellation" th:text="${speciaList[0].abilityLabel}">湖南大学生物科学教授</h4>
 									<h3 class="definition" th:text="${speciaList[0].username}">梁晓欣</h3>
@@ -232,9 +217,9 @@
 								</div>
 							</a>	
 						</div>
-						<div>
-							<a>
-								<div class="index_oneman" th:if="${#lists.size(speciaList) ge 2}">
+						<div th:if="${#lists.size(speciaList) ge 2}">
+							<a th:href="@{/user/subscriberDetail.html(uid=${speciaList[1].id},type=${speciaList[1].type})}">
+								<div class="index_oneman">
 									<img th:src="${avatarUploadHost+speciaList[1].headPortraitUrl}" alt=""/>
 									<h4 class="appellation" th:text="${speciaList[1].abilityLabel}">中医皮肤病医院专家</h4>
 									<h3 class="definition" th:text="${speciaList[1].username}">钱艳雯</h3>
@@ -243,9 +228,9 @@
 								</div>
 							</a>	
 						</div>
-						<div>
-							<a>
-								<div class="index_oneman" th:if="${#lists.size(speciaList) ge 3}">
+						<div th:if="${#lists.size(speciaList) ge 3}">
+							<a th:href="@{/user/subscriberDetail.html(uid=${speciaList[2].id},type=${speciaList[2].type})}">
+								<div class="index_oneman">
 									<img th:src="${avatarUploadHost+speciaList[2].headPortraitUrl}" alt=""/>
 									<h4 class="appellation" th:text="${speciaList[2].abilityLabel}">电子薄膜材料专家</h4>
 									<h3 class="definition" th:text="${speciaList[2].username}">刘钊鑫</h3>
@@ -253,9 +238,9 @@
 								</div>
 							</a>	
 						</div>
-						<div>
-							<a>
-								<div class="index_oneman" th:if="${#lists.size(speciaList) ge 4}">
+						<div th:if="${#lists.size(speciaList) ge 4}">
+							<a th:href="@{/user/subscriberDetail.html(uid=${speciaList[3].id},type=${speciaList[3].type})}">
+								<div class="index_oneman">
 									<img th:src="${avatarUploadHost+speciaList[3].headPortraitUrl}" alt=""/>
 									<h4 class="appellation" th:text="${speciaList[3].abilityLabel}">热轧平整工艺专家</h4>
 									<h3 class="definition" th:text="${speciaList[3].username}">郑纹光</h3>
@@ -265,9 +250,9 @@
 								</div>
 							</a>	
 						</div>
-						<div>
-							<a>
-								<div class="index_oneman" th:if="${#lists.size(speciaList) ge 5}">
+						<div th:if="${#lists.size(speciaList) ge 5}">
+							<a th:href="@{/user/subscriberDetail.html(uid=${speciaList[4].id},type=${speciaList[4].type})}">
+								<div class="index_oneman">
 									<img th:src="${avatarUploadHost+speciaList[4].headPortraitUrl}" alt="" />
 									<h4 class="appellation" th:text="${speciaList[4].abilityLabel}">联网信息产品营销专家</h4>
 									<h3 class="definition" th:text="${speciaList[4].username}">安良煜</h3>
@@ -275,9 +260,9 @@
 								</div>
 							</a>	
 						</div>
-						<div>
-							<a>
-								<div class="index_oneman" th:if="${#lists.size(speciaList) ge 6}">
+						<div th:if="${#lists.size(speciaList) ge 6}">
+							<a th:href="@{/user/subscriberDetail.html(uid=${speciaList[5].id},type=${speciaList[5].type})}">
+								<div class="index_oneman">
 									<img th:src="${avatarUploadHost+speciaList[5].headPortraitUrl}" alt="" />
 									<h4 class="appellation" th:text="${speciaList[5].abilityLabel}">考古文博学院教授</h4>
 									<h3 class="definition" th:text="${speciaList[5].username}">齐方栋</h3>

+ 1 - 1
src/main/webapp/WEB-INF/views/user/subscriberDetail.html

@@ -82,7 +82,7 @@
 		<h3>相关智者</h3>
 		<div>
 			<div th:each="reuserPartner:${reuserPartner}">
-					<a>
+					<a th:href="@{/user/subscriberDetail.html(uid=${reuserPartner.uid},type=${reuserPartner.type})}">
 						<img th:src="${avatarUploadHost+reuserPartner.personPortraitUrl}"
 								alt="" />
 						<div class="about_name">