Kaynağa Gözat

Merge branch 'master' of jishutao/jitao-server into test

liliang4869 7 yıl önce
ebeveyn
işleme
4655919f47

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

@@ -636,8 +636,8 @@ public class WebpageController extends BaseController {
 			if(demandListBo.getPictureUrl()==null || !demandListBo.getPictureUrl().contains("."))demandListBo.setPictureUrl(null);
 			else demandListBo.setPictureUrl(demandListBo.getPictureUrl().split(",")[0]);
 		}
-		LimitLengthUtil.limiteDemandLength(nightMaxProLearnStudyDemand,10,208);
-		LimitLengthUtil.limiteDemandCompanyAndName(nightMaxProLearnStudyDemand, 10, 208);
+		LimitLengthUtil.limiteDemandLength(nightMaxProLearnStudyDemand,10,18);
+		LimitLengthUtil.limiteDemandCompanyAndName(nightMaxProLearnStudyDemand, 10, 18);
 		modelview.addObject("proLearnStudyDemandList",nightMaxProLearnStudyDemand);
 		
 		//研产资金需求 最多4个

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

@@ -1234,7 +1234,6 @@ left join industry_category fgg on
 	fgg.id = a.field_b
 where
 	a.id = #{0}
-	and a.data_category=#{1}
 </select>
 
 <select id="getBoutiquePatent" resultType="com.goafanti.portal.bo.AchievementObject">
@@ -1399,7 +1398,8 @@ where
   		a.audit_status as auditStatus,
   		a.technical_picture_url as technicalPictureUrl,
   		a.boutique,
-  		b.identify_name as ownerName
+  		a.release_date as releaseDate,
+  		introduction
   	from achievement a
   	left join achievement_interest ai on ai.achievement_id=a.id
   	where ai.uid=#{uid,jdbcType=VARCHAR}

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

@@ -1159,8 +1159,8 @@ order by release_date desc limit #{0}
   
   
   <select id="findInterestedDemand" resultType="com.goafanti.demand.bo.DemandListBo">
-   select a.name,a.id,create_time as createTime ,picture_url as pictureUrl,data_category as dataCategory,is_hot as isHot,demand_type as demandType,
-  industry_category_a as industryCategoryA,industry_category_b as industryCategoryB,ic.name as industryCategory1,icc.name as industryCategory2
+   select a.name,a.id,a.create_time as createTime ,picture_url as pictureUrl,data_category as dataCategory,is_hot as isHot,demand_type as demandType,
+  industry_category_a as industryCategoryA,industry_category_b as industryCategoryB,a.release_date as releaseDate,problem_des as problemDes
    from demand a
    left join demand_interest di on di.demand_id=a.id
    where di.uid=#{uid,jdbcType=VARCHAR}

+ 10 - 0
src/main/java/com/goafanti/common/model/Achievement.java

@@ -73,6 +73,8 @@ public class Achievement {
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column achievement.maturity_video_url
 	 * @mbg.generated  Fri Jun 15 10:39:21 CST 2018
 	 */
+	
+	private String maturityPictureUrl;
 	private String maturityVideoUrl;
 	/**
 	 * This field was generated by MyBatis Generator. This field corresponds to the database column achievement.innovation
@@ -332,6 +334,14 @@ public void setAuditInfo(String auditInfo) {
 		this.id = id;
 	}
 
+	public String getMaturityPictureUrl() {
+		return maturityPictureUrl;
+	}
+
+	public void setMaturityPictureUrl(String maturityPictureUrl) {
+		this.maturityPictureUrl = maturityPictureUrl;
+	}
+
 	/**
 	 * This method was generated by MyBatis Generator. This method returns the value of the database column achievement.serial_number
 	 * @return  the value of achievement.serial_number

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

@@ -1,19 +1,19 @@
-package com.goafanti.demand.service;
-
-import com.goafanti.common.model.DemandInterest;
-import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.portal.bo.DemandInterestListBo;
-
-
-public interface DemandInterestService {
-
-	int saveCancelDemandInterest(String id);
-
-	String saveAchievementInterest(String id);
-
-	DemandInterest selectDemandInterestByUidAndDemandId(String userId, String id);
-
-	Pagination<DemandInterestListBo> listDemandInterest(Integer pNo, Integer pSize);
-
-	int countDemandInterest(String id); 
-}
+package com.goafanti.demand.service;
+
+import com.goafanti.common.model.DemandInterest;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.portal.bo.DemandInterestListBo;
+
+
+public interface DemandInterestService {
+
+	int saveCancelDemandInterest(String id);
+
+	String saveDemandInterest(String id);
+
+	DemandInterest selectDemandInterestByUidAndDemandId(String userId, String id);
+
+	Pagination<DemandInterestListBo> listDemandInterest(Integer pNo, Integer pSize);
+
+	int countDemandInterest(String id); 
+}

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

@@ -82,6 +82,6 @@ public interface DemandService {
 	
 	Pagination<DemandListBo>getDemandObjects(DemandListBo demandListBo,Integer pageNo,Integer pageSize);
 	
-	Pagination<DemandListBo>listInterestedAchievement(Integer pageNo,Integer pageSize);
+	Pagination<DemandListBo>listInterestedDemand(Integer pageNo,Integer pageSize);
 	
 }

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

@@ -1,75 +1,75 @@
-package com.goafanti.demand.service.impl;
-
-import java.util.Calendar;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.goafanti.common.dao.DemandInterestMapper;
-import com.goafanti.common.model.DemandInterest;
-import com.goafanti.common.model.User;
-import com.goafanti.common.utils.StringUtils;
-import com.goafanti.core.mybatis.BaseMybatisDao;
-import com.goafanti.core.mybatis.page.Pagination;
-import com.goafanti.core.shiro.token.TokenManager;
-import com.goafanti.demand.service.DemandInterestService;
-import com.goafanti.portal.bo.DemandInterestListBo;
-
-@Service
-public class DemandInterestServiceImpl extends BaseMybatisDao<DemandInterestMapper> implements DemandInterestService {
-	@Autowired
-	private DemandInterestMapper demandInterestMapper;
-
-	@Override
-	public int saveCancelDemandInterest(String id) {
-		return demandInterestMapper.deleteByPrimaryKey(id,TokenManager.getUserId());
-	}
-
-	@Override
-	public String saveAchievementInterest(String id) {
-		DemandInterest di = new DemandInterest();
-		di.setId(UUID.randomUUID().toString());
-		di.setDemandId(id);
-		Calendar now = Calendar.getInstance();
-		now.set(Calendar.MILLISECOND, 0);
-		di.setCreateTime(now.getTime());
-		di.setUid(TokenManager.getUserId());
-		if (StringUtils.isBlank(di.getUid())){
-			return null;
-		}
-		demandInterestMapper.insert(di);
-		return di.getId();
-	}
-
-	@Override
-	public DemandInterest selectDemandInterestByUidAndDemandId(String uid, String id) {
-		return demandInterestMapper.selectDemandInterestByUidAndDemandId(uid, id);
-	}
-
-	@SuppressWarnings("unchecked")
-	@Override
-	public Pagination<DemandInterestListBo> listDemandInterest(Integer pNo, Integer pSize) {
-		Map<String, Object> params = new HashMap<>();
-
-		if (pNo == null || pNo < 0) {
-			pNo = 1;
-		}
-
-		if (pSize == null || pSize < 0 || pSize > 10) {
-			pSize = 10;
-		}
-		if (TokenManager.getToken() instanceof User) {
-			params.put("uid", TokenManager.getUserId());
-		}
-		return (Pagination<DemandInterestListBo>) findPage("findDemandInterestListByPage",
-				"findDemandInterestCount", params, pNo, pSize);
-	}
-
-	@Override
-	public int countDemandInterest(String id) {
-		return demandInterestMapper.countInterestById(id);
-	}
-}
+package com.goafanti.demand.service.impl;
+
+import java.util.Calendar;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.DemandInterestMapper;
+import com.goafanti.common.model.DemandInterest;
+import com.goafanti.common.model.User;
+import com.goafanti.common.utils.StringUtils;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.demand.service.DemandInterestService;
+import com.goafanti.portal.bo.DemandInterestListBo;
+
+@Service
+public class DemandInterestServiceImpl extends BaseMybatisDao<DemandInterestMapper> implements DemandInterestService {
+	@Autowired
+	private DemandInterestMapper demandInterestMapper;
+
+	@Override
+	public int saveCancelDemandInterest(String id) {
+		return demandInterestMapper.deleteByPrimaryKey(id,TokenManager.getUserId());
+	}
+
+	@Override
+	public String saveDemandInterest(String id) {
+		DemandInterest di = new DemandInterest();
+		di.setId(UUID.randomUUID().toString());
+		di.setDemandId(id);
+		Calendar now = Calendar.getInstance();
+		now.set(Calendar.MILLISECOND, 0);
+		di.setCreateTime(now.getTime());
+		di.setUid(TokenManager.getUserId());
+		if (StringUtils.isBlank(di.getUid())){
+			return null;
+		}
+		demandInterestMapper.insert(di);
+		return di.getId();
+	}
+
+	@Override
+	public DemandInterest selectDemandInterestByUidAndDemandId(String uid, String id) {
+		return demandInterestMapper.selectDemandInterestByUidAndDemandId(uid, id);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<DemandInterestListBo> listDemandInterest(Integer pNo, Integer pSize) {
+		Map<String, Object> params = new HashMap<>();
+
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		if (TokenManager.getToken() instanceof User) {
+			params.put("uid", TokenManager.getUserId());
+		}
+		return (Pagination<DemandInterestListBo>) findPage("findDemandInterestListByPage",
+				"findDemandInterestCount", params, pNo, pSize);
+	}
+
+	@Override
+	public int countDemandInterest(String id) {
+		return demandInterestMapper.countInterestById(id);
+	}
+}

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

@@ -910,7 +910,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<DemandListBo> listInterestedAchievement(Integer pageNo, Integer pageSize) {
+	public Pagination<DemandListBo> listInterestedDemand(Integer pageNo, Integer pageSize) {
 		// TODO Auto-generated method stub
 		if(pageNo==null || pageNo<1) {
 			pageNo=1;

+ 35 - 16
src/main/java/com/goafanti/portal/controller/PortalInterestApiController.java

@@ -16,6 +16,7 @@ import com.goafanti.business.service.JtBusinessService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.dao.AchievementInterestMapper;
 import com.goafanti.common.dao.ProjectInterestMapper;
 import com.goafanti.common.enums.AchievementAuditStatus;
 import com.goafanti.common.enums.AchievementReleaseStatus;
@@ -103,6 +104,15 @@ public class PortalInterestApiController extends CertifyApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
 			return res;
 		}
+		if(StringUtils.isBlank(TokenManager.getUserId())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
+			return res;
+		}
+		DemandInterest demandInterest=demandInterestService.selectDemandInterestByUidAndDemandId(TokenManager.getUserId(), id);
+		if(demandInterest==null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "需求"));
+			return res;
+		}
 		res.setData(demandInterestService.saveCancelDemandInterest(id));
 		return res;
 	}
@@ -124,13 +134,12 @@ public class PortalInterestApiController extends CertifyApiController{
 			return res;
 		}
 		Demand d = demandService.selectByPrimaryKey(id);
-		if (null == d || d.getDeletedSign().equals(DeleteStatus.DELETED.getCode())
-				|| !d.getAuditStatus().equals(DemandAuditStatus.AUDITED.getCode())
-				|| !d.getReleaseStatus().equals(DemandReleaseStatus.RELEASED.getCode())) {
+		if (null == d 
+				|| !d.getAuditStatus().equals(DemandAuditStatus.AUDITED.getCode())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "需求ID"));
 			return res;
 		}
-		res.setData(demandInterestService.saveAchievementInterest(id));
+		res.setData(demandInterestService.saveDemandInterest(id));
 		return res;
 	}
 
@@ -145,7 +154,16 @@ public class PortalInterestApiController extends CertifyApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
 			return res;
 		}
-		res.setData(achievementInterestService.saveCancelAchievementInterest(id));
+		if(StringUtils.isBlank(TokenManager.getUserId())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
+			return res;
+		}
+		AchievementInterest achievementInterest=achievementInterestService.selectAchievementInterestByUidAndAchievementId(TokenManager.getUserId(), id);
+		if(achievementInterest==null) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "找不到成果ID", "找不到成果"));
+			return res;
+		}
+		res.setData(achievementInterestService.saveCancelAchievementInterest(achievementInterest.getId()));
 		return res;
 	}
 
@@ -169,9 +187,8 @@ public class PortalInterestApiController extends CertifyApiController{
 		}
 
 		Achievement a = achievementService.selectByPrimaryKey(id);
-		if (null == a || a.getDeletedSign().equals(DeleteStatus.DELETED.getCode())
-				|| !a.getAuditStatus().equals(AchievementAuditStatus.AUDITED.getCode())
-				|| !a.getReleaseStatus().equals(AchievementReleaseStatus.RELEASED.getCode())) {
+		if (null == a 
+				|| !a.getAuditStatus().equals(AchievementAuditStatus.AUDITED.getCode())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "成果ID"));
 			return res;
 		}
@@ -204,6 +221,10 @@ public class PortalInterestApiController extends CertifyApiController{
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
 			return res;
 		}
+		if(StringUtils.isBlank(TokenManager.getUserId())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
+			return res;
+		}
 		res.setData(demandService.selectDemandDetail(TokenManager.getUserId(), id));
 		return res;
 	}
@@ -233,13 +254,14 @@ public class PortalInterestApiController extends CertifyApiController{
 	public Result projectInterest(String id) {
 		Result result=new Result();
 		if(StringUtils.isBlank(id)) {
-			result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
+			result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "项目ID"));
 			return result;
 		}
 		if(StringUtils.isBlank(TokenManager.getUserId())) {
 			result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
 			return result;
 		}
+		projectInterestMapper.deleteInterest(TokenManager.getUserId(), id);
 		ProjectInterest projectInterest=new ProjectInterest();
 		projectInterest.setCreateTime(new Date());
 		projectInterest.setId(UUID.randomUUID().toString());
@@ -289,7 +311,7 @@ public class PortalInterestApiController extends CertifyApiController{
 			result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
 			return result;
 		}
-		result.setData(demandService.listInterestedAchievement(pageNo, pageSize));
+		result.setData(demandService.listInterestedDemand(pageNo, pageSize));
 		return result;
 		
 	}
@@ -308,11 +330,8 @@ public class PortalInterestApiController extends CertifyApiController{
 			result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
 			return result;
 		}
-//		UserInterest userInterest=new UserInterest();
-//		userInterest.setCreateTime(new Date());
-//		userInterest.setId(UUID.randomUUID().toString());
-//		userInterest.setFromUid(TokenManager.getUserId());
-//		userInterest.setToUid(id);
+	UserInterest userInterest=userInterestService.findByFromUidAndToUid(TokenManager.getUserId(), id);
+	if(userInterest==null )
 		userInterestService.insert(id);
 		return result;
 	}
@@ -347,7 +366,7 @@ public class PortalInterestApiController extends CertifyApiController{
 			result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
 			return result;
 		}
-		result.setData(userIdentityService.listInterestedDemand(pageNo,pageSize));
+		result.setData(userIdentityService.listInterestedExpert(pageNo,pageSize));
 		return result;
 	}
 

+ 1 - 1
src/main/java/com/goafanti/user/service/UserIdentityService.java

@@ -65,5 +65,5 @@ public interface UserIdentityService {
 	
 	List<ReletivelyIndustry>selectIndustryReletively();
 
-	Pagination<UserIdentityBo>listInterestedDemand(Integer pageNo,Integer pageSize);
+	Pagination<UserIdentityBo>listInterestedExpert(Integer pageNo,Integer pageSize);
 }

+ 1 - 1
src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java

@@ -477,7 +477,7 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 	
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<UserIdentityBo> listInterestedDemand(Integer pageNo, Integer pageSize) {
+	public Pagination<UserIdentityBo> listInterestedExpert(Integer pageNo, Integer pageSize) {
 		// TODO Auto-generated method stub
 		if(pageNo==null || pageNo<1) {
 			pageNo=1;

Dosya farkı çok büyük olduğundan ihmal edildi
+ 1 - 1
src/main/webapp/WEB-INF/views/portal/service/serviceDetails.html


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

@@ -39,6 +39,9 @@
 						<div th:if="${achievementdetail.firstPicture} != null ">
 							<img th:src= "${avatarUploadHost+achievementdetail.firstPicture}"alt=""  />
 						</div>
+						     <div class="collection">
+             <p><span class="heart"></span><span>收藏</span></p>
+        </div>
 					</div>
 					<div class="basic">
 						<div class="inline_span">

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

@@ -32,6 +32,9 @@
 						<div th:if="${demand.firstPic} != null " >
 							<img th:src= "${avatarUploadHost+demand.firstPic}"alt="" />
 						</div>
+						<div class="collection">
+				             <p><span class="heart"></span><span>收藏</span></p>
+				        </div>
 					</div>
 					<div class="basic">
 						<div>
@@ -54,7 +57,7 @@
 							<input type="hidden" th:typ="${demand.dataCategory}" id="ownerType_" />
 							<input type="hidden" th:isLogin="${!isLogin}" id="isLogin" />
 	                    </div>
-
+ 
 					</div>
 					<div class="fine">
 						<div class="fine_title">热门需求</div>

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

@@ -39,19 +39,9 @@
 						th:src="${avatarUploadHost + '/default/subscriberDetail.jpg'}"
 						alt="" />
 			</div>
-			<div>
-				<div>
-<!-- 				<span>擅长领域</span> -->
-<!-- 				<span class="lingyu" th:text="${rePartnerDetail.abilityLabel}?${rePartnerDetail.abilityLabel}:未知"></span> -->
-<!-- 				<span class="box_love"></span> -->
-<!-- 				<span class="dem_number">0</span> -->
-<!-- 				<span class="shoucang">收藏</span> -->
-<!-- 				<span class="yuejian">线下约见</span> -->
-<!-- 				<span class="cishu">32</span> -->
-<!-- 				<span class="ci">次</span>  -->
-			
-				</div>
-			</div>
+			<div class="collection">
+            	 <p><span class="heart"></span><span>收藏</span></p>
+       		</div>
 		</div>
 		<div class="basc_p">
 			<h4>关于智者</h4>
@@ -122,9 +112,7 @@
 		<div th:replace="common::copyright"></div>
 		<div th:replace="common::login"></div>
 	</footer>
-	<div class="smg">
-		<input type="text" name="msg" value="" id="msg" />
-	</div>
+	
 	<div th:replace="common::footer(~{::script})">
 		<script type="text/javascript" th:src="${portalHost + '/vendors.js'}"></script>
 		<script type="text/javascript" th:src="${staticHost+'/dll/dll.js'}"></script>