Преглед на файлове

我感兴趣,订单中转页面修改

zou_ht преди 8 години
родител
ревизия
afc6fbf031
променени са 18 файла, в които са добавени 127 реда и са изтрити 37 реда
  1. 1 0
      src/main/java/com/goafanti/achievement/service/impl/AchievementInterestServiceImpl.java
  2. 16 10
      src/main/java/com/goafanti/common/controller/PortalController.java
  3. 12 2
      src/main/java/com/goafanti/common/controller/WebpageController.java
  4. 1 1
      src/main/java/com/goafanti/common/dao/AchievementInterestMapper.java
  5. 5 1
      src/main/java/com/goafanti/common/dao/DemandInterestMapper.java
  6. 1 0
      src/main/java/com/goafanti/common/mapper/AchievementInterestMapper.xml
  7. 15 1
      src/main/java/com/goafanti/common/mapper/DemandInterestMapper.xml
  8. 4 0
      src/main/java/com/goafanti/common/mapper/DemandMapper.xml
  9. 2 2
      src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml
  10. 1 1
      src/main/java/com/goafanti/demand/service/DemandInterestService.java
  11. 5 2
      src/main/java/com/goafanti/demand/service/impl/DemandInterestServiceImpl.java
  12. 43 0
      src/main/java/com/goafanti/portal/bo/DemandPortalDetailBo.java
  13. 0 1
      src/main/java/com/goafanti/portal/controller/PortalInterestApiController.java
  14. 1 1
      src/main/webapp/WEB-INF/views/portal/technologyTrading/achievement.html
  15. 1 0
      src/main/webapp/WEB-INF/views/portal/technologyTrading/achievementOrder.html
  16. 1 1
      src/main/webapp/WEB-INF/views/portal/technologyTrading/demand.html
  17. 6 2
      src/main/webapp/WEB-INF/views/portal/technologyTrading/demandDetail.html
  18. 12 12
      src/main/webapp/WEB-INF/views/portal/technologyTrading/demandOrder.html

+ 1 - 0
src/main/java/com/goafanti/achievement/service/impl/AchievementInterestServiceImpl.java

@@ -68,4 +68,5 @@ public class AchievementInterestServiceImpl extends BaseMybatisDao<AchievementIn
 	public AchievementInterest selectAchievementInterestByUidAndAchievementId(String uid, String id) {
 		return achievementInterestMapper.selectAchievementInterestByUidAndAchievementId(uid, id);
 	}
+
 }

+ 16 - 10
src/main/java/com/goafanti/common/controller/PortalController.java

@@ -17,6 +17,7 @@ import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.view.RedirectView;
 
 import com.goafanti.achievement.bo.AchievementListBo;
+import com.goafanti.achievement.service.AchievementInterestService;
 import com.goafanti.achievement.service.AchievementService;
 import com.goafanti.common.enums.AchievementBargainingMode;
 import com.goafanti.common.enums.AchievementMaturity;
@@ -26,6 +27,7 @@ import com.goafanti.common.enums.UserType;
 import com.goafanti.common.service.FieldGlossoryService;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.demand.bo.DemandListBo;
+import com.goafanti.demand.service.DemandInterestService;
 import com.goafanti.demand.service.DemandService;
 import com.goafanti.portal.bo.AchievementPortalDetailBo;
 import com.goafanti.portal.bo.AchievementPortalSimilarListBo;
@@ -42,6 +44,8 @@ public class PortalController extends BaseController {
 	private DemandService demandService;
 	@Resource
 	private FieldGlossoryService fieldGlossoryService;
+	@Resource
+	private DemandInterestService  demandInterestService;
 
 	private static final String UNIT = "万元";
 
@@ -74,6 +78,12 @@ public class PortalController extends BaseController {
 	public ModelAndView portalDemandDetail(String id, Integer type) {
 		ModelAndView mv = new ModelAndView();
 		DemandPortalDetailBo demand = null;
+		int countDemandInterest = demandInterestService.countDemandInterest(id);
+		if(demandInterestService.selectDemandInterestByUidAndDemandId(TokenManager.getUserId(),id) != null) {
+			mv.addObject("isInterester", 0);
+		}else{
+			mv.addObject("isInterester", 1);
+		};
 		if (UserType.PERSONAL.getCode().equals(type)) {
 			demand = demandService.findUserPortalDemandDetail(id);
 		} else if (UserType.ORGANIZATION.getCode().equals(type)) {
@@ -92,6 +102,7 @@ public class PortalController extends BaseController {
 					demand.setEmployerName(" ");
 				}
 			}
+			demand.setCountDemandInterest(countDemandInterest);
 			Integer industryCategoryA = demand.getIndustryCategoryA();
 			boolean hasCategoryA = false;
 			boolean hasCategoryB = false;
@@ -215,9 +226,7 @@ public class PortalController extends BaseController {
 					redemandlist.get(i).setPictureUrl(picurl[0]);
 				}
 			}
-		}
-		;
-
+		};
 		mv.setViewName("/portal/technologyTrading/demandDetail");
 		mv.addObject("demand", demand);
 		mv.addObject("reboutiquedemand", reboutiquedemand);
@@ -241,7 +250,6 @@ public class PortalController extends BaseController {
 		if (null != achievementdetail) {
 			achievementdetail.setId(id);
 			achievementdetail.setOwnerType(String.valueOf(type));
-			System.out.println(achievementdetail.getOwnerType());
 			Integer category = achievementdetail.getCategory();
 			if (null != category) {
 				if (category == 0) {
@@ -535,7 +543,6 @@ public class PortalController extends BaseController {
 		if (null != achievementdetail) {
 			achievementdetail.setId(id);
 			achievementdetail.setOwnerType(String.valueOf(type));
-			System.out.println(achievementdetail.getOwnerType());
 			Integer category = achievementdetail.getCategory();
 			if (null != category) {
 				if (category == 0) {
@@ -711,6 +718,8 @@ public class PortalController extends BaseController {
 				}
 			}
 		}
+		
+		
 		mv.setViewName("/portal/technologyTrading/achievementOrder");
 		mv.addObject("achievementdetail", achievementdetail);
 		mv.addObject("reachievementlist", reachievementlist);
@@ -780,7 +789,7 @@ public class PortalController extends BaseController {
 				demand.setPictureUrl(picurl[0]);
 			}
 		}
-
+		
 		/*--------------查询精品需求---------------*/
 		List<DemandListBo> boutiquedemand = demandService.selectDemandList(1);
 		List<DemandListBo> reboutiquedemand = new ArrayList<DemandListBo>();
@@ -862,14 +871,11 @@ public class PortalController extends BaseController {
 					redemandlist.get(i).setPictureUrl(picurl[0]);
 				}
 			}
-		}
-		;
-
+		};
 		mv.setViewName("/portal/technologyTrading/demandOrder");
 		mv.addObject("demand", demand);
 		mv.addObject("reboutiquedemand", reboutiquedemand);
 		mv.addObject("redemandlist", redemandlist);
-
 		return mv;
 	}
 }

+ 12 - 2
src/main/java/com/goafanti/common/controller/WebpageController.java

@@ -224,10 +224,8 @@ public class WebpageController extends BaseController {
 		partnerAchievementList.size();
 		if (partnerAchievementList.size()<=0) {
 			mv.addObject("showflg", 0);
-			System.out.println("showflg=1");
 		}else{
 			mv.addObject("showflg", 1);
-			System.out.println("showflg=1");
 		};
 		mv.addObject("uid", uid);
 		return mv;
@@ -605,6 +603,18 @@ public class WebpageController extends BaseController {
 		return modelview;
 	}
 	
+	/**
+	 *  技术评估
+	 * @param request
+	 * @param modelview
+	 * @return
+	 */
+	@RequestMapping(value="/portal/technologyTrading/assessMent")
+	public ModelAndView assessMent(HttpServletRequest request, ModelAndView modelview){
+		modelview.setViewName("/portal/technologyTrading/assessMent");
+		return modelview;
+	}
+	
 	private void handleBanners(ModelAndView modelview, BannersType bannersType) {
 		List<Banners> banners = bannersService.findPortalBanners(bannersType.getKey());
 		if (!banners.isEmpty()) {

+ 1 - 1
src/main/java/com/goafanti/common/dao/AchievementInterestMapper.java

@@ -16,5 +16,5 @@ public interface AchievementInterestMapper {
     int updateByPrimaryKey(AchievementInterest record);
 
 	AchievementInterest selectAchievementInterestByUidAndAchievementId(String uid, String id);
-
+	
 }

+ 5 - 1
src/main/java/com/goafanti/common/dao/DemandInterestMapper.java

@@ -1,9 +1,11 @@
 package com.goafanti.common.dao;
 
+import org.apache.ibatis.annotations.Param;
+
 import com.goafanti.common.model.DemandInterest;
 
 public interface DemandInterestMapper {
-    int deleteByPrimaryKey(String id);
+    int deleteByPrimaryKey(@Param("id")String id,@Param("uid")String uid);
 
     int insert(DemandInterest record);
 
@@ -16,4 +18,6 @@ public interface DemandInterestMapper {
     int updateByPrimaryKey(DemandInterest record);
 
 	DemandInterest selectDemandInterestByUidAndDemandId(String uid, String id);
+	
+	int countInterestById(@Param("id")String id);
 }

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

@@ -113,4 +113,5 @@
     from achievement_interest
     where uid = #{0} and achievement_id = #{1}
   </select>
+  
 </mapper>

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

@@ -3,6 +3,7 @@
 <mapper namespace="com.goafanti.common.dao.DemandInterestMapper" >
   <resultMap id="BaseResultMap" type="com.goafanti.common.model.DemandInterest" >
     <id column="id" property="id" jdbcType="VARCHAR" />
+    <id column="uid" property="uid" jdbcType="VARCHAR" />
     <result column="demand_id" property="demandId" jdbcType="VARCHAR" />
     <result column="uid" property="uid" jdbcType="VARCHAR" />
     <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
@@ -18,7 +19,13 @@
   </select>
   <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
     delete from demand_interest
-    where id = #{id,jdbcType=VARCHAR}
+    where 1=1
+      <if test="id != null" >
+        and demand_id = #{id,jdbcType=VARCHAR}
+      </if>
+      <if test="uid != null" >
+        and uid = #{uid,jdbcType=VARCHAR}
+      </if>
   </delete>
   <insert id="insert" parameterType="com.goafanti.common.model.DemandInterest" >
     insert into demand_interest (id, demand_id, uid, 
@@ -113,4 +120,11 @@
     from demand_interest
     where uid = #{0} and demand_id = #{1}
   </select>
+  
+    <select id="countInterestById" resultType="Integer">
+  	    select count(0) from demand_interest where 1=1  
+  	    <if test="id != null">
+  	       and demand_id = #{id,jdbcType=VARCHAR}
+  	    </if> 
+  </select>
 </mapper>

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

@@ -1181,6 +1181,8 @@
 		d.validity_period as validityPeriod,
 		d.industry_category_a AS industryCategoryA,
 		d.picture_url as pictureUrl,
+		d.employer_contacts_mobile as employerContactsMobile,
+		d.data_category as dataCategory,
 		fg.name AS industryCategoryAS,
 		fgg.name AS industryCategorBS,
 		d.budget_cost AS budgetCost,
@@ -1210,6 +1212,8 @@
 		d.keyword,
 		d.picture_url as pictureUrl,
 		d.validity_period as validityPeriod,
+		d.employer_contacts_mobile as employerContactsMobile,
+		d.data_category as dataCategory,
 		d.industry_category_a AS industryCategoryA,
 		fg.name AS industryCategoryAS,
 		fgg.name AS industryCategoryBS,

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

@@ -441,7 +441,7 @@
 		LEFT JOIN user_info info ON info.uid = u.id
 		LEFT JOIN achievement_demand_count adc ON adc.uid = u.id
 		WHERE
-			u.type = 0
+			u.type = 0 and ui.expert = 1
 		<if test="null != level and level==1 ">
 			AND u.lvl <![CDATA[ >= ]]> 1 
 		</if>
@@ -478,7 +478,7 @@
 			LEFT JOIN user_identity ui ON ui.uid = u.id
 			LEFT JOIN user_career uc ON uc.uid = u.id
 			WHERE
-				u.type = 0 
+				u.type = 0 and ui.expert = 1
 			<if test="null != level and level==1 ">
 				AND u.lvl <![CDATA[ >= ]]> 1 
 			</if>

+ 1 - 1
src/main/java/com/goafanti/demand/service/DemandInterestService.java

@@ -15,5 +15,5 @@ public interface DemandInterestService {
 
 	Pagination<DemandInterestListBo> listDemandInterest(Integer pNo, Integer pSize);
 
-
+	int countDemandInterest(String id); 
 }

+ 5 - 2
src/main/java/com/goafanti/demand/service/impl/DemandInterestServiceImpl.java

@@ -25,7 +25,7 @@ public class DemandInterestServiceImpl extends BaseMybatisDao<DemandInterestMapp
 
 	@Override
 	public int saveCancelDemandInterest(String id) {
-		return demandInterestMapper.deleteByPrimaryKey(id);
+		return demandInterestMapper.deleteByPrimaryKey(id,TokenManager.getUserId());
 	}
 
 	@Override
@@ -68,5 +68,8 @@ public class DemandInterestServiceImpl extends BaseMybatisDao<DemandInterestMapp
 				"findDemandInterestCount", params, pNo, pSize);
 	}
 
-	
+	@Override
+	public int countDemandInterest(String id) {
+		return demandInterestMapper.countInterestById(id);
+	}
 }

+ 43 - 0
src/main/java/com/goafanti/portal/bo/DemandPortalDetailBo.java

@@ -48,6 +48,12 @@ public class DemandPortalDetailBo {
 	private Integer      fixedbudget;
 	
 	private String      validityPeriodS;
+	
+	private Integer countDemandInterest;
+	
+	private String employerContactsMobile;
+	
+	private String dataCategory;
 
 	public Integer getLevel() {
 		return level;
@@ -223,6 +229,43 @@ public class DemandPortalDetailBo {
 	public void setValidityPeriodS(String validityPeriodS) {
 		this.validityPeriodS = validityPeriodS;
 	}
+
+	public Integer getCountDemandInterest() {
+		return countDemandInterest;
+	}
+
+	public void setCountDemandInterest(Integer countDemandInterest) {
+		this.countDemandInterest = countDemandInterest;
+	}
+
+	public String getEmployerContactsMobile() {
+		return employerContactsMobile;
+	}
+
+	public void setEmployerContactsMobile(String employerContactsMobile) {
+		this.employerContactsMobile = employerContactsMobile;
+	}
+
+	public String getDataCategory() {
+		return dataCategory;
+	}
+
+	public void setDataCategory(String dataCategory) {
+		this.dataCategory = dataCategory;
+	}
+
+	@Override
+	public String toString() {
+		return "DemandPortalDetailBo [id=" + id + ", name=" + name + ", keyword=" + keyword + ", industryCategoryA="
+				+ industryCategoryA + ", industryCategoryAS=" + industryCategoryAS + ", industryCategoryBS="
+				+ industryCategoryBS + ", budgetCost=" + budgetCost + ", budgetCostS=" + budgetCostS + ", province="
+				+ province + ", city=" + city + ", problemDes=" + problemDes + ", interestId=" + interestId
+				+ ", location=" + location + ", industryCategory=" + industryCategory + ", employerName=" + employerName
+				+ ", level=" + level + ", pictureUrl=" + pictureUrl + ", employerAddress=" + employerAddress
+				+ ", validityPeriod=" + validityPeriod + ", fixedbudget=" + fixedbudget + ", validityPeriodS="
+				+ validityPeriodS + ", countDemandInterest=" + countDemandInterest + ", employerContactsMobile="
+				+ employerContactsMobile + ", dataCategory=" + dataCategory + "]";
+	}
 	
 	
 	

+ 0 - 1
src/main/java/com/goafanti/portal/controller/PortalInterestApiController.java

@@ -136,7 +136,6 @@ public class PortalInterestApiController extends CertifyApiController{
 	@RequestMapping(value = "/achievementInterest", method = RequestMethod.POST)
 	public Result achievementInterest(String id) {
 		Result res = new Result();
-		System.out.println("感兴趣的id="+id);
 
 		if (StringUtils.isBlank(id)) {
 			System.out.println("找不到成果ID");

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

@@ -174,7 +174,7 @@
 							</a>
 						</li>
 					</ul>
-					<span class="totalCount">共0条数据</span>
+					<span class="totalCount"></span>
 				</nav>
 			</div>
 		</div>

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

@@ -131,6 +131,7 @@
 		<script type="text/javascript"
 			th:src="${portalHost + '/technologyTrading/achievementOrder.js'}"></script>
 	</div>
+	<div class="smg"><input type="text" name="msg" value="" id="msg"/></div>
 </body>
 
 </html>

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

@@ -149,7 +149,7 @@
 							</a>
 						</li>
 					</ul>
-					<span class="totalCount">共0条数据</span>
+					<span class="totalCount"></span>
 				</nav>
 			</div>
 		</div>

+ 6 - 2
src/main/webapp/WEB-INF/views/portal/technologyTrading/demandDetail.html

@@ -53,11 +53,15 @@
 							<span>有效日期:</span> <span th:text="${demand.validityPeriodS}?${demand.validityPeriodS}:永久"></span>
 						</div>
 						<div class="loves">  
-                       		<span class="box_love"></span><span class="dem_number">8</span><span>我感兴趣</span>
-							<input type="hidden" th:val="${demand.id}">                     
+                       		<span class="box_love"></span><span class="dem_number" th:text="${demand.countDemandInterest}"></span><span>我感兴趣</span>
+							<input type="hidden" th:val="${demand.id}" id="demand_id">                     
+							<input type="hidden" th:isInterester="${isInterester}" id="isInterester">                     
                     	</div>
 	                    <div class="detail_btn">
 	                       <a href="javascript:;" onclick="_MEIQIA('showPanel')">我要咨询</a><a href="javascript:;" id="purchase">立即购买</a>
+	                        <input type="hidden" th:val="${demand.id}" id="Id_" />
+							<input type="hidden" th:typ="${demand.dataCategory}" id="ownerType_" />
+							<input type="hidden" th:isLogin="${!isLogin}" id="isLogin" />
 	                    </div>
 
 					</div>

+ 12 - 12
src/main/webapp/WEB-INF/views/portal/technologyTrading/demandOrder.html

@@ -6,7 +6,7 @@
 <title>订单页--我的技术和科技服务交易平台</title>
 <link th:href="${portalHost +'/vendors.css'}" rel="stylesheet">
 <link
-	th:href="${portalHost + '/technologyTrading/achievementOrder.css'}"
+	th:href="${portalHost + '/technologyTrading/demandOrder.css'}"
 	rel="stylesheet">
 </head>
 <body>
@@ -27,30 +27,30 @@
 						</div>
 						<div>
 							<h4>产品类型:</h4>
-							<p th:text="${demand.categoryS}?${demand.categoryS}:暂无分类信息">发明专利</p>
+							<p th:text="${demand.industryCategoryAS}?${demand.industryCategoryAS}:暂无行业分类"></p>
 						</div>
 						<div>
-							<h4>交易方式:</h4>
-							<p th:text="${demand.transferModeS}?${demand.transferModeS}:暂无"></p>
+							<h4>有效期:</h4>
+							<p th:text="${demand.validityPeriodS}?${demand.validityPeriodS}:永久"></p>
 						</div>
 						<div>
-							<h4>技术持有人:</h4>
-							<p th:text="${demand.ownerName}?${demand.ownerName}:陈灿"></p>
+							<h4>需求发布人:</h4>
+							<p th:text="${demand.employerName}?${demand.employerName}:陈灿"></p>
 						</div>
 						<div>
-							<h4>技术购买人:</h4>
+							<h4>需求解决人:</h4>
 							<p th:text="${userData != null}?${userData.nickname}:暂无"></p>
 						</div>
 					</div>
 					<div class="order_right">
 						<div class="order_right_p">
-							<h4>交易金额:</h4>
-							<p th:text="${demand.transferPrice}?${demand.transferPrice}:暂无"></p>
+							<h4>需求预算:</h4>
+							<p th:text="${demand.fixedbudget}?${demand.fixedbudget}:价格面议"></p>
 							<span onclick="_MEIQIA('showPanel')">立即议价</span>
 						</div>
 						<div>
 							<h4>电话:</h4>
-							<p th:text="${demand.ownerMobile}?${demand.ownerMobile}:073184121803"></p>
+							<p th:text="${demand.employerContactsMobile}?${demand.employerContactsMobile}:073184121803"></p>
 						</div>
 						<div>
 							<h4 >电话:</h4>
@@ -59,7 +59,7 @@
 					</div>
 				</div>
 				<div class="order_button">
-					<div>加入订单</div>
+					<div th:val="${demand.id}" id='id_'>加入订单</div>
 					<div>去支付</div>
 				</div>
 				<div class="order_text">加入订单,技术所有人很快就会联系你呦~,技淘祝您交易成功!</div>
@@ -129,7 +129,7 @@
 	<div th:replace="common::footer(~{::script})">
 		<script type="text/javascript" th:src="${portalHost + '/vendors.js'}"></script>
 		<script type="text/javascript"
-			th:src="${portalHost + '/technologyTrading/achievementOrder.js'}"></script>
+			th:src="${portalHost + '/technologyTrading/demandOrder.js'}"></script>
 	</div>
 </body>