소스 검색

项目排序、需求成果服务界面修改、专利列表

liliang4869 7 년 전
부모
커밋
efe9d31b8b

+ 21 - 0
src/main/java/com/goafanti/business/bo/JtBusinessProjectResult.java

@@ -14,4 +14,25 @@ public class JtBusinessProjectResult extends JtBusinessProject {
 	}
 	
 
+	Integer dealCount;
+	
+
+	public Integer getDealCount() {
+		return dealCount;
+	}
+
+	public void setDealCount(Integer dealCount) {
+		this.dealCount = dealCount;
+	}
+
+	private String companyName;
+
+	public String getCompanyName() {
+		return companyName;
+	}
+
+	public void setCompanyName(String companyName) {
+		this.companyName = companyName;
+	}
+	
 }

+ 2 - 2
src/main/java/com/goafanti/business/controller/JtBusinessController.java

@@ -25,9 +25,9 @@ public class JtBusinessController extends CertifyApiController {
 	}
 	
 	@RequestMapping(value="/jtProject/list", method=RequestMethod.GET)
-	public Result getProjectList(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot) {
+	public Result getProjectList(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot,Integer orderType,Integer orderSort) {
 		Result result=new Result();
-		result.setData(jtBusinessService.getProjects(topId,secondId,name,pageSize,pageNo,privateProject,auditStatus,module,isHot));
+		result.setData(jtBusinessService.getProjects(topId,secondId,name,pageSize,pageNo,privateProject,auditStatus,module,isHot,orderType,orderSort));
 		return result;
 	}
 	

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

@@ -16,7 +16,7 @@ public interface JtBusinessService {
 	JtBusinessProjectResult getBusinessProjectDetail(String id);
 	JtBusinessCategoryTree getCategoryTree(String id);
 	List<JtBusinessCategoryBo>getCategoryBoList(Integer module);
-	Pagination<JtBusinessProject>getProjects(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot); 
+	Pagination<JtBusinessProjectResult>getProjects(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot,Integer orderType,Integer orderSort); 
 	int insertCategory(JtBusinessCategory jtBusinessCategory);
 	int deleteCategoryById(String id);
 	JtBusinessCategory getCategoryById(String id);

+ 14 - 5
src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java

@@ -67,11 +67,16 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 
 	/*
 	 * 登录用户0     项目列表页1  privateProject
+	 * 
+	 * ordetType---0 发布时间  1价格  2成交量
+	 * orderSort ----0大->小   1小->大
 	 * */
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<JtBusinessProject> getProjects(String topId, String secondId, String name, Integer pageSize,
-			Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot) {
+	public Pagination<JtBusinessProjectResult> getProjects(String topId, String secondId, String name, Integer pageSize,
+			Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot,Integer orderType,Integer orderSort) {
+		if(orderType==null)orderType=0;
+		if(orderSort==null)orderSort=0;
 		// TODO Auto-generated method stub
 		if (pageNo == null || pageNo < 0) {
 			pageNo = 1;
@@ -91,7 +96,9 @@ if(auditStatus!=null ) {
 		params.put("ownerId", TokenManager.getUserId());
 		if(module!=null)params.put("module", module);
 		if(isHot!=null)params.put("isHot", isHot);
-		return (Pagination<JtBusinessProject>)findPage("findJtBusinessProjectByPage","findJtBusinessCountByPage",params,pageNo,pageSize);
+		if(orderType!=null)params.put("orderType", orderType);
+		if(orderSort!=null)params.put("orderSort", orderSort);
+		return (Pagination<JtBusinessProjectResult>)findPage("findJtBusinessProjectByPage","findJtBusinessCountByPage",params,pageNo,pageSize);
 	}
 	
 	private Map<String, Object> disposeParams(String topId, String secondId,  String name) {
@@ -224,7 +231,9 @@ if(auditStatus!=null ) {
 			{
 				String nbString=number.substring(2);
 				try {
-				cSize=Integer.parseInt(nbString)+1;}catch (Exception e) {
+				cSize=Integer.parseInt(nbString)+1;
+				cSize=Math.max(cSize, projects.size()+1);
+				}catch (Exception e) {
 					// TODO: handle exception
 					return -1;
 				}
@@ -232,7 +241,7 @@ if(auditStatus!=null ) {
 			else cSize=1;
 		}
 		else cSize=1;
-	
+
 		String nbString="BP";
 		String sizeString="000"+cSize;
 		sizeString=sizeString.substring(sizeString.length()-4);

+ 11 - 0
src/main/java/com/goafanti/common/controller/PortalController.java

@@ -13,19 +13,24 @@ import org.springframework.web.bind.annotation.ResponseBody;
 import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.view.RedirectView;
 
+import com.fasterxml.jackson.annotation.JsonTypeInfo.Id;
 import com.goafanti.achievement.bo.AchievementPartnerListBo;
 import com.goafanti.achievement.service.AchievementService;
 import com.goafanti.business.service.BusinessProjectService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.enums.AchievementMaturity;
 import com.goafanti.common.enums.UserType;
+import com.goafanti.common.model.UserInterest;
 import com.goafanti.common.service.DistrictGlossoryService;
 import com.goafanti.common.service.FieldGlossoryService;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.demand.service.DemandInterestService;
 import com.goafanti.demand.service.DemandService;
 import com.goafanti.order.service.OrderService;
 import com.goafanti.user.bo.UserPartnerDetailBo;
 import com.goafanti.user.service.UserIdentityService;
+import com.goafanti.user.service.UserInterestService;
 import com.goafanti.user.service.UserService;
 
 @Controller
@@ -50,6 +55,8 @@ public class PortalController extends BaseController {
 	BusinessProjectService	businessProjectService;
 	@Resource
 	OrderService	orderService;
+	@Resource
+	UserInterestService userInterestService;
 
 	@RequestMapping(value = "/index", method = RequestMethod.GET)
 	public ModelAndView index(HttpServletRequest request, ModelAndView modelview) {
@@ -139,6 +146,10 @@ public class PortalController extends BaseController {
 			mv.addObject("showflg", 1);
 		};
 		mv.addObject("uid", uid);
+		if(StringUtils.isNotBlank(TokenManager.getUserId())) {
+		UserInterest userInterest=userInterestService.findByFromUidAndToUid(TokenManager.getUserId(), uid);
+		if(userInterest!=null )mv.addObject("interested",true);
+		}
 		return mv;
 
 	}

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

@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.servlet.ModelAndView;
 
+import com.goafanti.achievement.service.AchievementInterestService;
 import com.goafanti.achievement.service.AchievementService;
 import com.goafanti.app.bo.consultantListBo;
 import com.goafanti.banners.enums.BannersType;
@@ -22,17 +23,23 @@ import com.goafanti.common.bo.PolicyEntity;
 import com.goafanti.common.bo.fieldGlossoryBo;
 import com.goafanti.common.constant.AFTConstants;
 import com.goafanti.common.constant.PageConstants;
+import com.goafanti.common.dao.ProjectInterestMapper;
+import com.goafanti.common.model.AchievementInterest;
 import com.goafanti.common.model.Banners;
+import com.goafanti.common.model.Demand;
+import com.goafanti.common.model.DemandInterest;
 import com.goafanti.common.model.IndustryCategory;
 import com.goafanti.common.model.JtBusinessCategory;
 import com.goafanti.common.model.JtBusinessProject;
 import com.goafanti.common.model.News;
 import com.goafanti.common.model.Policy;
+import com.goafanti.common.model.ProjectInterest;
 import com.goafanti.common.model.User;
 import com.goafanti.common.utils.LimitLengthUtil;
 import com.goafanti.common.utils.StringUtils;
 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.user.bo.UserIdentityBo;
 import com.goafanti.user.service.OrganizationIdentityService;
@@ -74,6 +81,15 @@ public class WebpageController extends BaseController {
 	
 	@Resource
 	private UserService userService;
+	
+	@Resource
+	private AchievementInterestService achievementInterestService;
+	
+	@Resource
+	private DemandInterestService demandInterestService;
+	
+	@Resource
+	private ProjectInterestMapper				projectInterestMapper;
 
 	@RequestMapping(value = "/user/account/index", method = RequestMethod.GET)
 	public ModelAndView index(HttpServletRequest request, ModelAndView modelview) {
@@ -363,6 +379,12 @@ public class WebpageController extends BaseController {
 	JtBusinessCategory jtBusinessCategory=jtBusinessService.getCategoryById(jtBusinessProject.getCategoryId());
 	if(jtBusinessCategory!=null && jtBusinessCategory.getModule()!=null)modelview.addObject("module",jtBusinessCategory.getModule());
 	else modelview.addObject("module",0);
+	
+	//是否关注
+	if(StringUtils.isNotBlank(TokenManager.getUserId())) {
+		int projectInterest=projectInterestMapper.checkUidAndDid(id, TokenManager.getUserId());
+		if(projectInterest>0)modelview.addObject("interested",true);
+	}
 	return modelview;
 	}
 	
@@ -543,8 +565,8 @@ public class WebpageController extends BaseController {
 		String url =com.goafanti.common.utils.StringUtils.getDomainByHttpRequest(request);
 		modelview.setViewName("/portal/index");
 		@SuppressWarnings("unchecked")
-		List<JtBusinessProject> jtBusinessProjects=(List<JtBusinessProject>) jtBusinessService.getProjects(null, null, null, 5, 1, 1, 2, 0, 1).getList();
-		for(JtBusinessProject project:jtBusinessProjects) {
+		List<JtBusinessProject> jtBusinessProjects=(List<JtBusinessProject>) jtBusinessService.getProjects(null, null, null, 5, 1, 1, 2, 0, 1,0,0).getList();
+		for(JtBusinessProject project:jtBusinessProjects) { 
 			if(project.getMaxImgUrl()!=null && project.getMaxImgUrl().length()<=0)project.setMaxImgUrl(null);
 			if(project.getMinImgUrl()!=null && project.getMinImgUrl().length()<=0)project.setMinImgUrl(null);
 		}
@@ -697,6 +719,12 @@ public class WebpageController extends BaseController {
 	
 		//view
 		modelAndView.setViewName("/portal/technologyTrading/demandDetail");
+		
+		//是否关注
+		if(StringUtils.isNotBlank(TokenManager.getUserId())) {
+		DemandInterest demandInterest=demandInterestService.selectDemandInterestByUidAndDemandId(TokenManager.getUserId(), id);
+		if(demandInterest!=null)modelAndView.addObject("interested",true);
+				}
 		return modelAndView;
 	} 
 	
@@ -747,6 +775,21 @@ public class WebpageController extends BaseController {
 		modelAndView.addObject("guess",guess); 
 		//view
 		modelAndView.setViewName("/portal/technologyTrading/achievementDetail");
+		
+		//是否关注
+		if(StringUtils.isNotBlank(TokenManager.getUserId())){
+		AchievementInterest achievementInterest=achievementInterestService.selectAchievementInterestByUidAndAchievementId(TokenManager.getUserId(), id);
+		if(achievementInterest!=null)modelAndView.addObject("isInterested",true);
+		}
+		return modelAndView;
+	}
+	
+	
+	@RequestMapping(value = "/portal/service/patentList")
+	public ModelAndView patentList(HttpServletRequest request, ModelAndView modelAndView,String id, Integer type) {
+		
+		modelAndView.setViewName("/portal/service/patentList");
+	
 		return modelAndView;
 	}
 	

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

@@ -597,7 +597,7 @@
 	  	limit #{size,jdbcType=INTEGER}
   </select>
   
-  <select id="findJtBusinessProjectByPage" resultType="com.goafanti.common.model.JtBusinessProject">
+  <select id="findJtBusinessProjectByPage" resultType="com.goafanti.business.bo.JtBusinessProjectResult">
   select 
 	  jtbp.id,  
 	  jtbp.name, 
@@ -618,14 +618,18 @@
 	  jtbp.is_hot as isHot,
 	  jtbp.audit_status as auditStatus,
 	  jtbp.release_Date as releaseDate,
-	  jtbp.advertisement
+	  jtbp.advertisement,
+	  dct.dealCount as dealCount,
+	  u.identify_name as companyName
   from jt_business_project jtbp
+  left join user u on u.id=jtbp.owner_id
   <if test="topId!=null">
   left join jt_business_category jtbc on jtbc.super_id =#{topId,jdbcType=VARCHAR}
   </if>
   <if test="module!=null">
   left join jt_business_category jtbc1 on jtbc1.id = jtbp.category_id
   </if>
+  left join (select count(0) as dealCount ,commodity_id from jt_order_detail group by commodity_id) dct on jtbp.id=dct.commodity_id
   where 1=1
   <if test="module !=null">
   and jtbc1.module=#{module,jdbcType=INTEGER}
@@ -645,7 +649,17 @@
   <if test="auditStatus!=null">
   and jtbp.audit_status=#{auditStatus,jdbcType=INTEGER}
   </if>
-  
+  <if test="orderType!=null and orderType==0">
+  order by release_date
+  </if>
+  <if test="orderType!=null and orderType==1">
+  order by jtbp.price
+  </if>
+  <if test="orderType!=null and orderType==2">
+  order by dct.dealCount
+  </if>
+  <if test="orderSort!=null and orderSort=0">
+   desc</if>
   	<if test="page_sql!=null">
 		${page_sql}
 	</if>
@@ -686,7 +700,7 @@
  <include refid="Base_Column_List" />
   from jt_business_project 
   where audit_status=2
-  order by release_date desc
+  order by create_time desc
   </select>
   <select id="findInterestedProjcet" resultType="com.goafanti.common.model.JtBusinessProject">
   select 

+ 3 - 3
src/main/webapp/WEB-INF/views/common.html

@@ -81,7 +81,7 @@
 						<img th:src="${portalHost+'/img/index/index_webkit2.png'}" alt="">
 					</span>
 					<p>
-						<a href="#">高企服务</a>
+						<a th:href="@{/portal/service/serviceIndex}">高企服务</a>
 						<a href="#">科技项目</a>
 					</p>
 					<p>
@@ -297,12 +297,12 @@
 					<div class="text_center">
 						<div class="cont_left">
 							<img th:src="${portalHost+'/img/dizhi.jpg'}" alt=""/>
-							<p>湖南省长沙市营盘东路19号金山大厦</p>
+							<p>湖南省长沙市营盘东路19号金山大厦八楼</p>
 						</div>
 						<div class="cont_center">
 							<img th:src="${portalHost+'/img/dianhua.jpg'}" alt=""/>
 							<p>合作电话:0731-89907207</p>
-							<p>400-8800-962八楼</p>
+							<p>400-8800-962</p>
 						</div>
 						<div class="cont_rightapp">
 							<img th:src="${portalHost+'/img/erweima_iphone.png'}" alt=""/>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 0
src/main/webapp/WEB-INF/views/portal/service/patentList.html


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/service/serviceDetails.html


+ 2 - 2
src/main/webapp/WEB-INF/views/portal/service/serviceList.html

@@ -72,13 +72,13 @@
                         <ul class="pagination">
                             <li class="pagePre">
                                 <a href="#" aria-label="Previous">
-                                    <span aria-hidden="true">&laquo;</span>
+                                    <span aria-hidden="true">上一页</span>
                                 </a>
                             </li>
                             <li class="pageNumber"><a href="#" value="1">1</a></li>
                             <li class="pageNext">
                                 <a href="#" aria-label="Next">
-                                    <span aria-hidden="true">&raquo;</span>
+                                    <span aria-hidden="true">下一页</span>
                                 </a>
                             </li>
                         </ul>

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

@@ -40,7 +40,7 @@
 							<img th:src= "${avatarUploadHost+achievementdetail.firstPicture}"alt=""  />
 						</div>
 						     <div class="collection">
-             <p><span class="heart"></span><span>收藏</span></p>
+             <p><span th:class="${interested}==null?'heart':'heart active'"></span><span>收藏</span></p>
         </div>
 					</div>
 					<div class="basic">

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/technologyTrading/achievementList.html


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

@@ -33,7 +33,7 @@
 							<img th:src= "${avatarUploadHost+demand.firstPic}"alt="" />
 						</div>
 						<div class="collection">
-				             <p><span class="heart"></span><span>收藏</span></p>
+				             <p><span th:class="${interested}==null?'heart':'heart active'"></span><span>收藏</span></p>
 				        </div>
 					</div>
 					<div class="basic">

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/technologyTrading/demandList.html


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

@@ -40,7 +40,7 @@
 						alt="" />
 			</div>
 			<div class="collection">
-            	 <p><span class="heart"></span><span>收藏</span></p>
+            	 <p><span th:class="${interested}==null?'heart':'heart active'"></span><span>收藏</span></p>
        		</div>
 		</div>
 		<div class="basc_p">