Browse Source

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

albertshaw 9 years ago
parent
commit
00db616338
48 changed files with 3044 additions and 71 deletions
  1. 16 0
      schema/2017-05-28.sql
  2. 29 0
      schema/2017-06-01.sql
  3. 17 0
      src/main/java/com/goafanti/achievement/service/AchievementInterestService.java
  4. 17 8
      src/main/java/com/goafanti/achievement/service/AchievementService.java
  5. 66 0
      src/main/java/com/goafanti/achievement/service/impl/AchievementInterestServiceImpl.java
  6. 63 1
      src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java
  7. 12 10
      src/main/java/com/goafanti/common/controller/WebpageController.java
  8. 20 0
      src/main/java/com/goafanti/common/dao/AchievementInterestMapper.java
  9. 3 0
      src/main/java/com/goafanti/common/dao/AchievementMapper.java
  10. 19 0
      src/main/java/com/goafanti/common/dao/DemandInterestMapper.java
  11. 5 0
      src/main/java/com/goafanti/common/dao/DemandMapper.java
  12. 17 0
      src/main/java/com/goafanti/common/dao/DemandOrderLogMapper.java
  13. 19 0
      src/main/java/com/goafanti/common/dao/DemandOrderMapper.java
  14. 3 3
      src/main/java/com/goafanti/common/enums/AchievementReleaseStatus.java
  15. 60 0
      src/main/java/com/goafanti/common/enums/DemandOrderStatus.java
  16. 2 2
      src/main/java/com/goafanti/common/mapper/AchievementDemandMapper.xml
  17. 116 0
      src/main/java/com/goafanti/common/mapper/AchievementInterestMapper.xml
  18. 139 32
      src/main/java/com/goafanti/common/mapper/AchievementMapper.xml
  19. 116 0
      src/main/java/com/goafanti/common/mapper/DemandInterestMapper.xml
  20. 85 0
      src/main/java/com/goafanti/common/mapper/DemandMapper.xml
  21. 106 0
      src/main/java/com/goafanti/common/mapper/DemandOrderLogMapper.xml
  22. 195 0
      src/main/java/com/goafanti/common/mapper/DemandOrderMapper.xml
  23. 54 0
      src/main/java/com/goafanti/common/model/AchievementInterest.java
  24. 54 0
      src/main/java/com/goafanti/common/model/DemandInterest.java
  25. 171 0
      src/main/java/com/goafanti/common/model/DemandOrder.java
  26. 74 0
      src/main/java/com/goafanti/common/model/DemandOrderLog.java
  27. 5 0
      src/main/java/com/goafanti/demand/bo/InputDemandOrder.java
  28. 19 0
      src/main/java/com/goafanti/demand/service/DemandInterestService.java
  29. 11 0
      src/main/java/com/goafanti/demand/service/DemandOrderService.java
  30. 19 11
      src/main/java/com/goafanti/demand/service/DemandService.java
  31. 67 0
      src/main/java/com/goafanti/demand/service/impl/DemandInterestServiceImpl.java
  32. 50 0
      src/main/java/com/goafanti/demand/service/impl/DemandOrderServiceImpl.java
  33. 51 4
      src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java
  34. 246 0
      src/main/java/com/goafanti/portal/bo/AchievementDetailBo.java
  35. 17 0
      src/main/java/com/goafanti/portal/bo/AchievementInterestListBo.java
  36. 244 0
      src/main/java/com/goafanti/portal/bo/AchievementSearchListBo.java
  37. 29 0
      src/main/java/com/goafanti/portal/bo/DemandInterestListBo.java
  38. 153 0
      src/main/java/com/goafanti/portal/bo/DemandSearchDetailBo.java
  39. 198 0
      src/main/java/com/goafanti/portal/bo/DemandSearchListBo.java
  40. 96 0
      src/main/java/com/goafanti/portal/bo/InterestListBo.java
  41. 192 0
      src/main/java/com/goafanti/portal/controller/PortalInterestApiController.java
  42. 56 0
      src/main/java/com/goafanti/portal/controller/PortalOrderApiController.java
  43. 11 0
      src/main/java/com/goafanti/portal/controller/PortalQuizApiController.java
  44. 69 0
      src/main/java/com/goafanti/portal/controller/PortalSearchApiController.java
  45. 10 0
      src/main/java/com/goafanti/portal/service/PortalSearchService.java
  46. 1 0
      src/main/resources/shiro_base_auth.ini
  47. 11 0
      src/main/webapp/WEB-INF/views/portal/search/achievement.jsp
  48. 11 0
      src/main/webapp/WEB-INF/views/portal/search/demand.jsp

+ 16 - 0
schema/2017-05-28.sql

@@ -0,0 +1,16 @@
+CREATE TABLE `achievement_interest` (
+  `id` varchar(36) NOT NULL,
+  `achievement_id` varchar(36) NOT NULL COMMENT '科技成果ID',
+  `uid` varchar(36) NOT NULL COMMENT '感兴趣人ID',
+  `create_time` datetime NOT NULL COMMENT '记录创建时间(关注时间)',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='科技成果"感兴趣(关注)"';
+
+CREATE TABLE `demand_interest` (
+  `id` VARCHAR(36) NOT NULL,
+  `demand_id` VARCHAR(36) NOT NULL COMMENT '需求主键',
+  `uid` VARCHAR(36) NOT NULL COMMENT '关注人ID',
+  `create_time` DATETIME NOT NULL COMMENT '关注时间',
+  PRIMARY KEY (`id`))
+ENGINE = InnoDB
+COMMENT = '科技需求\"感兴趣(关注)\"'

+ 29 - 0
schema/2017-06-01.sql

@@ -0,0 +1,29 @@
+CREATE TABLE `demand_order` (
+  `id` VARCHAR(36) NOT NULL,
+  `serial_number` INT(8) NULL COMMENT '编号'  AUTO_INCREMENT,
+  `demand_id` VARCHAR(36) NOT NULL COMMENT '科技需求ID',
+  `uid` VARCHAR(36) NULL COMMENT '接单人ID',
+  `create_time` DATETIME NULL COMMENT '接单时间',
+  `enclosure_url` VARCHAR(255) NULL COMMENT '附件URL',
+  `status` INT(1) NULL COMMENT '流程变动(0--初始意向,1--意向金,2--签订合同,3--合同金,4--佣金,5--服务金,6--关闭)',
+  `intention_money` INT(8) NULL COMMENT '意向金',
+  `contract_money` INT(8) NULL COMMENT '合同金',
+  `commission` INT(8) NULL COMMENT '佣金',
+  `service_money` INT(8) NULL COMMENT '服务金',
+  `refund` INT(1) NULL COMMENT '是否退款(0--未退款,1--已退款)',
+  `deleted_sign` INT(1) NULL COMMENT '删除标记(0--未删除,1--已删除)',
+  PRIMARY KEY (`id`),
+  INDEX `serialNumber` (`serial_number` ASC))
+ENGINE = InnoDB	AUTO_INCREMENT= 600000
+COMMENT = '科技需求意向单/交易单';
+
+CREATE TABLE `demand_order_log` (
+  `id` VARCHAR(36) NOT NULL,
+  `demand_order_id` VARCHAR(36) NOT NULL COMMENT '科技需求意向单/交易单ID',
+  `record_time` DATETIME NULL,
+  `status` INT(1) NULL COMMENT '状态',
+  `operator` VARCHAR(36) NULL COMMENT '记录操作人',
+  `comment` VARCHAR(128) NULL,
+  PRIMARY KEY (`id`))
+ENGINE = InnoDB
+COMMENT = '科技需求意向单/交易单日志';

+ 17 - 0
src/main/java/com/goafanti/achievement/service/AchievementInterestService.java

@@ -0,0 +1,17 @@
+package com.goafanti.achievement.service;
+
+import com.goafanti.common.model.AchievementInterest;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.portal.bo.AchievementInterestListBo;
+
+public interface AchievementInterestService {
+
+	void saveAchievementInterest(String id);
+
+	int saveCancelAchievementInterest(String id);
+
+	Pagination<AchievementInterestListBo> listAchievementInterest(Integer pNo, Integer pSize);
+
+	AchievementInterest selectAchievementInterestByUidAndAchievementId(String userId, String id);
+
+}

+ 17 - 8
src/main/java/com/goafanti/achievement/service/AchievementService.java

@@ -1,5 +1,6 @@
 package com.goafanti.achievement.service;
 package com.goafanti.achievement.service;
 
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.List;
 
 
 import com.goafanti.achievement.bo.AchievementImportBo;
 import com.goafanti.achievement.bo.AchievementImportBo;
@@ -9,11 +10,13 @@ import com.goafanti.achievement.bo.AchievementUserOwnerDetailBo;
 import com.goafanti.common.model.Achievement;
 import com.goafanti.common.model.Achievement;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.demand.bo.DemandAchievementListBo;
 import com.goafanti.demand.bo.DemandAchievementListBo;
+import com.goafanti.portal.bo.AchievementDetailBo;
+import com.goafanti.portal.bo.AchievementSearchListBo;
 
 
 public interface AchievementService {
 public interface AchievementService {
 
 
-	Pagination<AchievementListBo> listUserOwnerAchievement(String ownerId, Integer auditStatus, Integer serialNumber, String name, String keyword, Integer category,
-			Integer status, String releaseDateStartDate,
+	Pagination<AchievementListBo> listUserOwnerAchievement(String ownerId, Integer auditStatus, Integer serialNumber,
+			String name, String keyword, Integer category, Integer status, String releaseDateStartDate,
 			String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize);
 			String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize);
 
 
 	void saveAchievement(Achievement a, String[] keywords);
 	void saveAchievement(Achievement a, String[] keywords);
@@ -24,17 +27,17 @@ public interface AchievementService {
 
 
 	int deleteByPrimaryKey(List<String> asList);
 	int deleteByPrimaryKey(List<String> asList);
 
 
-	Pagination<AchievementListBo> listUserAchievement(Integer auditStatus, Integer serialNumber, String name, String keyword, Integer category, Integer ownerType,
-			Integer status, String releaseDateStartDate, String releaseDateEndDate, Integer releaseStatus, Integer pNo,
-			Integer pSize);
+	Pagination<AchievementListBo> listUserAchievement(Integer auditStatus, Integer serialNumber, String name,
+			String keyword, Integer category, Integer ownerType, Integer status, String releaseDateStartDate,
+			String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize);
 
 
 	int updateAuditAchievement(Achievement a, String techBroderId, Integer auditStatus);
 	int updateAuditAchievement(Achievement a, String techBroderId, Integer auditStatus);
 
 
 	int updateReleaseStatus(Achievement a);
 	int updateReleaseStatus(Achievement a);
 
 
-	Pagination<AchievementListBo> listOrgOwnerAchievement(String ownerId, Integer auditStatus, Integer serialNumber, String name, String keyword,
-			Integer category, Integer status, String releaseDateStartDate, String releaseDateEndDate,
-			Integer releaseStatus, Integer pNo, Integer pSize);
+	Pagination<AchievementListBo> listOrgOwnerAchievement(String ownerId, Integer auditStatus, Integer serialNumber,
+			String name, String keyword, Integer category, Integer status, String releaseDateStartDate,
+			String releaseDateEndDate, Integer releaseStatus, Integer pNo, Integer pSize);
 
 
 	AchievementUserOwnerDetailBo selectUserOwnerDetail(String id);
 	AchievementUserOwnerDetailBo selectUserOwnerDetail(String id);
 
 
@@ -44,5 +47,11 @@ public interface AchievementService {
 
 
 	void insertImport(List<AchievementImportBo> data);
 	void insertImport(List<AchievementImportBo> data);
 
 
+	Pagination<AchievementSearchListBo> listAchievementSearchList(Integer bargainingMode, Integer category,
+			Integer maturity, BigDecimal transferPriceLower, BigDecimal transferPriceUpper, Integer transferMode,
+			String keyword, Integer fieldA, Integer fieldB, Integer pageNo, Integer pageSize);
+
+	AchievementDetailBo selectAchievementSearchDetail(String uid, String id);
+
 
 
 }
 }

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

@@ -0,0 +1,66 @@
+package com.goafanti.achievement.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.achievement.service.AchievementInterestService;
+import com.goafanti.common.dao.AchievementInterestMapper;
+import com.goafanti.common.model.AchievementInterest;
+import com.goafanti.common.model.User;
+import com.goafanti.core.mybatis.BaseMybatisDao;
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.portal.bo.AchievementInterestListBo;
+
+@Service
+public class AchievementInterestServiceImpl extends BaseMybatisDao<AchievementInterestMapper>
+		implements AchievementInterestService {
+	@Autowired
+	private AchievementInterestMapper achievementInterestMapper;
+
+	@Override
+	public void saveAchievementInterest(String id) {
+		AchievementInterest ai = new AchievementInterest();
+		ai.setId(UUID.randomUUID().toString());
+		ai.setUid(TokenManager.getUserId());
+		ai.setAchievementId(id);
+		Calendar now = Calendar.getInstance();
+		now.set(Calendar.MILLISECOND, 0);
+		ai.setCreateTime(now.getTime());
+		achievementInterestMapper.insert(ai);
+	}
+
+	@Override
+	public int saveCancelAchievementInterest(String id) {
+		return achievementInterestMapper.deleteByPrimaryKey(id);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<AchievementInterestListBo> listAchievementInterest(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<AchievementInterestListBo>) findPage("findAchievementInterestListByPage",
+				"findAchievementInterestCount", params, pNo, pSize);
+	}
+
+	@Override
+	public AchievementInterest selectAchievementInterestByUidAndAchievementId(String uid, String id) {
+		return achievementInterestMapper.selectAchievementInterestByUidAndAchievementId(uid, id);
+	}
+}

+ 63 - 1
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -1,5 +1,6 @@
 package com.goafanti.achievement.service.impl;
 package com.goafanti.achievement.service.impl;
 
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Calendar;
@@ -44,6 +45,8 @@ import com.goafanti.core.mybatis.BaseMybatisDao;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.demand.bo.DemandAchievementListBo;
 import com.goafanti.demand.bo.DemandAchievementListBo;
+import com.goafanti.portal.bo.AchievementDetailBo;
+import com.goafanti.portal.bo.AchievementSearchListBo;
 
 
 @Service
 @Service
 public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> implements AchievementService {
 public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> implements AchievementService {
@@ -308,11 +311,70 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 			}
 			}
 			achievementList.add(a);
 			achievementList.add(a);
 		}
 		}
-		
+
 		achievementMapper.insertBatch(achievementList);
 		achievementMapper.insertBatch(achievementList);
 		achievementKeywordMapper.insertBatch(AchievementKeywordList);
 		achievementKeywordMapper.insertBatch(AchievementKeywordList);
 	}
 	}
 
 
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<AchievementSearchListBo> listAchievementSearchList(Integer bargainingMode, Integer category,
+			Integer maturity, BigDecimal transferPriceLower, BigDecimal transferPriceUpper, Integer transferMode,
+			String keyword, Integer fieldA, Integer fieldB, Integer pNo, Integer pSize) {
+		Map<String, Object> params = new HashMap<>();
+		if (!StringUtils.isBlank(keyword)) {
+			params.put("keyword", keyword);
+		}
+
+		if (null != bargainingMode) {
+			params.put("bargainingMode", bargainingMode);
+		}
+
+		if (null != category) {
+			params.put("category", category);
+		}
+
+		if (null != maturity) {
+			params.put("maturity", maturity);
+		}
+
+		if (null != transferPriceLower) {
+			params.put("transferPriceLower", transferPriceLower);
+		}
+
+		if (null != transferPriceUpper) {
+			params.put("transferPriceUpper", transferPriceUpper);
+		}
+
+		if (null != transferMode) {
+			params.put("transferMode", transferMode);
+		}
+
+		if (null != fieldA) {
+			params.put("fieldA", fieldA);
+		}
+
+		if (null != fieldB) {
+			params.put("fieldB", fieldB);
+		}
+
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		return (Pagination<AchievementSearchListBo>) findPage("findSearchAchievementListByPage",
+				"findSearchAchievementCount", params, pNo, pSize);
+	}
+
+	@Override
+	public AchievementDetailBo selectAchievementSearchDetail(String uid, String id) {
+		return achievementMapper.selectAchievementSearchDetail(uid, id);
+	}
+
+
 	private void createTechBorkerNotice(Achievement a) {
 	private void createTechBorkerNotice(Achievement a) {
 		noticeMapper.insert(disposeNotice(a, null));
 		noticeMapper.insert(disposeNotice(a, null));
 	}
 	}

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

@@ -106,16 +106,6 @@ public class WebpageController extends BaseController {
 		return "/admin/set";
 		return "/admin/set";
 	}
 	}
 	
 	
-	/*@RequestMapping(value = "/admin/userManage", method = RequestMethod.GET)
-	public String adminUserManage(HttpServletRequest request, ModelAndView modelview) {
-		return "/admin/userManage";
-	}
-	
-	@RequestMapping(value = "/admin/servicesManage/patent", method = RequestMethod.GET)
-	public String adminServicesManagePatent(HttpServletRequest request, ModelAndView modelview) {
-		return "/admin/servicesManage/patent";
-	}*/
-	
 	@RequestMapping(value = "/admin/userManage", method = RequestMethod.GET)
 	@RequestMapping(value = "/admin/userManage", method = RequestMethod.GET)
 	public ModelAndView adminUserManage(HttpServletRequest request, ModelAndView modelview) {
 	public ModelAndView adminUserManage(HttpServletRequest request, ModelAndView modelview) {
 		return adminToLogin(request,modelview,"/admin/userManage");
 		return adminToLogin(request,modelview,"/admin/userManage");
@@ -156,6 +146,18 @@ public class WebpageController extends BaseController {
 		return adminToLogin(request,modelview,"/admin/index");
 		return adminToLogin(request,modelview,"/admin/index");
 	}
 	}
 	
 	
+	@RequestMapping(value = "/portal/search/achievement", method = RequestMethod.GET)
+	public ModelAndView portalSearchAchievement(HttpServletRequest request, ModelAndView modelview) {
+		modelview.setViewName("/portal/search/achievement");
+		return modelview;
+	}
+	
+	@RequestMapping(value = "/portal/search/demand", method = RequestMethod.GET)
+	public ModelAndView portalSearchDemand(HttpServletRequest request, ModelAndView modelview) {
+		modelview.setViewName("/portal/search/demand");
+		return modelview;
+	}
+	
 	
 	
 	private ModelAndView userLogin(HttpServletRequest request, ModelAndView modelview, String next) {
 	private ModelAndView userLogin(HttpServletRequest request, ModelAndView modelview, String next) {
 		String key = TokenManager.getUserId();
 		String key = TokenManager.getUserId();

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

@@ -0,0 +1,20 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.AchievementInterest;
+
+public interface AchievementInterestMapper {
+    int deleteByPrimaryKey(String id);
+
+    int insert(AchievementInterest record);
+
+    int insertSelective(AchievementInterest record);
+
+    AchievementInterest selectByPrimaryKey(String id);
+
+    int updateByPrimaryKeySelective(AchievementInterest record);
+
+    int updateByPrimaryKey(AchievementInterest record);
+
+	AchievementInterest selectAchievementInterestByUidAndAchievementId(String uid, String id);
+
+}

+ 3 - 0
src/main/java/com/goafanti/common/dao/AchievementMapper.java

@@ -5,6 +5,7 @@ import java.util.List;
 import com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo;
 import com.goafanti.achievement.bo.AchievementOrgOwnerDetailBo;
 import com.goafanti.achievement.bo.AchievementUserOwnerDetailBo;
 import com.goafanti.achievement.bo.AchievementUserOwnerDetailBo;
 import com.goafanti.common.model.Achievement;
 import com.goafanti.common.model.Achievement;
+import com.goafanti.portal.bo.AchievementDetailBo;
 
 
 public interface AchievementMapper {
 public interface AchievementMapper {
     int deleteByPrimaryKey(String id);
     int deleteByPrimaryKey(String id);
@@ -28,4 +29,6 @@ public interface AchievementMapper {
 	AchievementOrgOwnerDetailBo selectOrgOwnerDetail(String id);
 	AchievementOrgOwnerDetailBo selectOrgOwnerDetail(String id);
 
 
 	void insertBatch(List<Achievement> achievementList);
 	void insertBatch(List<Achievement> achievementList);
+
+	AchievementDetailBo selectAchievementSearchDetail(String uid, String id);
 }
 }

+ 19 - 0
src/main/java/com/goafanti/common/dao/DemandInterestMapper.java

@@ -0,0 +1,19 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.DemandInterest;
+
+public interface DemandInterestMapper {
+    int deleteByPrimaryKey(String id);
+
+    int insert(DemandInterest record);
+
+    int insertSelective(DemandInterest record);
+
+    DemandInterest selectByPrimaryKey(String id);
+
+    int updateByPrimaryKeySelective(DemandInterest record);
+
+    int updateByPrimaryKey(DemandInterest record);
+
+	DemandInterest selectDemandInterestByUidAndDemandId(String uid, String id);
+}

+ 5 - 0
src/main/java/com/goafanti/common/dao/DemandMapper.java

@@ -4,6 +4,7 @@ import java.util.List;
 
 
 import com.goafanti.common.model.Demand;
 import com.goafanti.common.model.Demand;
 import com.goafanti.demand.bo.DemandManageDetailBo;
 import com.goafanti.demand.bo.DemandManageDetailBo;
+import com.goafanti.portal.bo.DemandSearchDetailBo;
 
 
 public interface DemandMapper {
 public interface DemandMapper {
     int deleteByPrimaryKey(String id);
     int deleteByPrimaryKey(String id);
@@ -27,4 +28,8 @@ public interface DemandMapper {
 	int updateReleaseDate(String id);
 	int updateReleaseDate(String id);
 
 
 	void insertBatch(List<Demand> demandList);
 	void insertBatch(List<Demand> demandList);
+
+	DemandSearchDetailBo selectDemandSearchDetail(String id);
+
+	DemandSearchDetailBo selectDemandSearchDetail(String uid, String id);
 }
 }

+ 17 - 0
src/main/java/com/goafanti/common/dao/DemandOrderLogMapper.java

@@ -0,0 +1,17 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.DemandOrderLog;
+
+public interface DemandOrderLogMapper {
+    int deleteByPrimaryKey(String id);
+
+    int insert(DemandOrderLog record);
+
+    int insertSelective(DemandOrderLog record);
+
+    DemandOrderLog selectByPrimaryKey(String id);
+
+    int updateByPrimaryKeySelective(DemandOrderLog record);
+
+    int updateByPrimaryKey(DemandOrderLog record);
+}

+ 19 - 0
src/main/java/com/goafanti/common/dao/DemandOrderMapper.java

@@ -0,0 +1,19 @@
+package com.goafanti.common.dao;
+
+import com.goafanti.common.model.DemandOrder;
+
+public interface DemandOrderMapper {
+    int deleteByPrimaryKey(String id);
+
+    int insert(DemandOrder record);
+
+    int insertSelective(DemandOrder record);
+
+    DemandOrder selectByPrimaryKey(String id);
+
+    int updateByPrimaryKeySelective(DemandOrder record);
+
+    int updateByPrimaryKey(DemandOrder record);
+
+	DemandOrder selectDemandOrderByUidAndDemandId(String uid, String id);
+}

+ 3 - 3
src/main/java/com/goafanti/common/enums/AchievementReleaseStatus.java

@@ -7,9 +7,9 @@ import org.apache.commons.lang3.StringUtils;
 
 
 public enum AchievementReleaseStatus {
 public enum AchievementReleaseStatus {
 	
 	
-	UNRELEASE(1, "成果未发布"),
-	RELEASED(2, "成果已发布"),
-	OTHER(3, "其他");
+	UNRELEASE(0, "成果未发布"),
+	RELEASED(1, "成果已发布"),
+	OTHER(2, "其他");
 
 
 	private AchievementReleaseStatus(Integer code, String desc) {
 	private AchievementReleaseStatus(Integer code, String desc) {
 		this.code = code;
 		this.code = code;

+ 60 - 0
src/main/java/com/goafanti/common/enums/DemandOrderStatus.java

@@ -0,0 +1,60 @@
+package com.goafanti.common.enums;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.lang3.StringUtils;
+
+public enum DemandOrderStatus {
+	CREATE(0, "初始意向"),
+	INTENTIONMONEY(1,"交付意向金"),
+	SIGN(2,"签订合同"),
+	CONTRACTMONEY(3, "交付合同金"),
+	COMMISSION(4,"交付佣金"),
+	SERVICEMONEY(5, "交付服务金"),
+	CLOSE(6,"关闭订单"),
+	OTHER(7, "其他");
+
+	private DemandOrderStatus(Integer code, String desc) {
+		this.code = code;
+		this.desc = desc;
+	}
+
+	private static Map<Integer, DemandOrderStatus> status = new HashMap<Integer, DemandOrderStatus>();
+
+	static {
+		for (DemandOrderStatus value : DemandOrderStatus.values()) {
+			status.put(value.getCode(), value);
+		}
+	}
+
+	public static DemandOrderStatus getStatus(Integer code) {
+		if (containsType(code)) {
+			return status.get(code);
+		}
+		return OTHER;
+	}
+
+	public static DemandOrderStatus getStatus(String code) {
+		if (StringUtils.isNumeric(code)) {
+			return getStatus(Integer.parseInt(code));
+		}
+		return OTHER;
+	}
+
+	public static boolean containsType(Integer code) {
+		return status.containsKey(code);
+	}
+
+	private Integer	code;
+	private String	desc;
+
+	public Integer getCode() {
+		return code;
+	}
+
+	public String getDesc() {
+		return desc;
+	}
+
+}

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

@@ -78,7 +78,7 @@
     LEFT JOIN organization_identity oi on oi.uid = a.owner_id
     LEFT JOIN organization_identity oi on oi.uid = a.owner_id
 		where ad.demand_id = #{id,jdbcType=VARCHAR}
 		where ad.demand_id = #{id,jdbcType=VARCHAR}
 		and a.deleted_sign = 0  
 		and a.deleted_sign = 0  
-		and a.audit_status = 4 
+		and a.audit_status = 3 
 		and a.release_status = 1
 		and a.release_status = 1
   </select>
   </select>
   
   
@@ -94,7 +94,7 @@
   	LEFT JOIN organization_identity oi on oi.uid = d.employer_id
   	LEFT JOIN organization_identity oi on oi.uid = d.employer_id
   	where ad.achievement_id = #{id,jdbcType=VARCHAR}
   	where ad.achievement_id = #{id,jdbcType=VARCHAR}
   	and d.deleted_sign = 0
   	and d.deleted_sign = 0
-  	and d.audit_status = 4
+  	and d.audit_status = 3
   	and d.release_status = 1
   	and d.release_status = 1
   </select>
   </select>
 </mapper>
 </mapper>

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

@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.goafanti.common.dao.AchievementInterestMapper" >
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.AchievementInterest" >
+    <id column="id" property="id" jdbcType="VARCHAR" />
+    <result column="achievement_id" property="achievementId" jdbcType="VARCHAR" />
+    <result column="uid" property="uid" jdbcType="VARCHAR" />
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    id, achievement_id, uid, create_time
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select 
+    <include refid="Base_Column_List" />
+    from achievement_interest
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+    delete from achievement_interest
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.AchievementInterest" >
+    insert into achievement_interest (id, achievement_id, uid, 
+      create_time)
+    values (#{id,jdbcType=VARCHAR}, #{achievementId,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.AchievementInterest" >
+    insert into achievement_interest
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        id,
+      </if>
+      <if test="achievementId != null" >
+        achievement_id,
+      </if>
+      <if test="uid != null" >
+        uid,
+      </if>
+      <if test="createTime != null" >
+        create_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="achievementId != null" >
+        #{achievementId,jdbcType=VARCHAR},
+      </if>
+      <if test="uid != null" >
+        #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.AchievementInterest" >
+    update achievement_interest
+    <set >
+      <if test="achievementId != null" >
+        achievement_id = #{achievementId,jdbcType=VARCHAR},
+      </if>
+      <if test="uid != null" >
+        uid = #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.AchievementInterest" >
+    update achievement_interest
+    set achievement_id = #{achievementId,jdbcType=VARCHAR},
+      uid = #{uid,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  
+  <select id="findAchievementInterestListByPage" parameterType="String" resultType="com.goafanti.portal.bo.AchievementInterestListBo">
+  	select 
+  		ai.id, ai.achievement_id as achievementId, ai.create_time as createTime,
+  		a.name, a.serial_number as serialNumber, a.deleted_sign as deletedSign,
+  		a.audit_status as auditStatus, a.keyword
+  	from achievement_interest ai
+  	left join achievement a on a.id = ai.achievement_id
+  	where 1=1
+  	<if test="uid != null">
+  		and ai.uid = #{uid,jdbcType=VARCHAR}
+  	</if> 
+  	order by ai.create_time desc
+  	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findAchievementInterestCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+  		count(1)
+  	from achievement_interest ai
+  	where 1=1
+  	<if test="uid != null">
+  		and	ai.uid = #{uid,jdbcType=VARCHAR}
+  	</if> 
+  </select>
+  
+  <select id="selectAchievementInterestByUidAndAchievementId" resultMap="BaseResultMap">
+  	select  
+  	<include refid="Base_Column_List" />
+    from achievement_interest
+    where uid = #{0} and achievement_id = #{1}
+  </select>
+</mapper>

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

@@ -656,34 +656,34 @@
   	LEFT JOIN user_identity ui on a.owner_id = ui.uid
   	LEFT JOIN user_identity ui on a.owner_id = ui.uid
   	where deleted_sign = 0 and owner_type = 0
   	where deleted_sign = 0 and owner_type = 0
   	<if test="ownerId != null">
   	<if test="ownerId != null">
-		and  owner_id = #{ownerId,jdbcType=VARCHAR}
+		and  a.owner_id = #{ownerId,jdbcType=VARCHAR}
 	</if>
 	</if>
   	<if test="serialNumber != null">
   	<if test="serialNumber != null">
-		and  serial_number = #{serialNumber,jdbcType=INTEGER}
+		and  a.serial_number = #{serialNumber,jdbcType=INTEGER}
 	</if>
 	</if>
 	<if test="auditStatus != null">
 	<if test="auditStatus != null">
-		and  audit_status = #{auditStatus,jdbcType=INTEGER}
+		and  a.audit_status = #{auditStatus,jdbcType=INTEGER}
 	</if>
 	</if>
 	<if test="name != null">
 	<if test="name != null">
-		and  name = #{name,jdbcType=VARCHAR}
+		and  a.name = #{name,jdbcType=VARCHAR}
 	</if>
 	</if>
 	<if test="keyword != null">
 	<if test="keyword != null">
-		and  keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+		and  a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
 	</if>
 	</if>
 	<if test="category != null">
 	<if test="category != null">
-		and  category = #{category,jdbcType=INTEGER}
+		and  a.category = #{category,jdbcType=INTEGER}
 	</if>
 	</if>
 	<if test="status != null">
 	<if test="status != null">
-		and  status = #{status,jdbcType=INTEGER}
+		and  a.status = #{status,jdbcType=INTEGER}
 	</if>
 	</if>
 	<if test="rStart != null">
 	<if test="rStart != null">
-       and	release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
+       and	a.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
 	</if>
 	</if>
 	<if test="rEnd != null">
 	<if test="rEnd != null">
-	   and release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	   and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
 	</if>
 	</if>
 	<if test="releaseStatus != null">
 	<if test="releaseStatus != null">
-	   and  release_status = #{releaseStatus,jdbcType=INTEGER}
+	   and  a.release_status = #{releaseStatus,jdbcType=INTEGER}
 	</if>
 	</if>
 	order by serial_number desc
 	order by serial_number desc
 	<if test="page_sql!=null">
 	<if test="page_sql!=null">
@@ -741,34 +741,34 @@
   	LEFT JOIN organization_identity oi on a.owner_id = oi.uid
   	LEFT JOIN organization_identity oi on a.owner_id = oi.uid
   	where deleted_sign = 0 and owner_type = 1
   	where deleted_sign = 0 and owner_type = 1
   	<if test="ownerId != null">
   	<if test="ownerId != null">
-		and  owner_id = #{ownerId,jdbcType=VARCHAR}
+		and  a.owner_id = #{ownerId,jdbcType=VARCHAR}
 	</if>
 	</if>
   	<if test="serialNumber != null">
   	<if test="serialNumber != null">
-		and  serial_number = #{serialNumber,jdbcType=INTEGER}
+		and  a.serial_number = #{serialNumber,jdbcType=INTEGER}
 	</if>
 	</if>
 	<if test="auditStatus != null">
 	<if test="auditStatus != null">
-		and  audit_status = #{auditStatus,jdbcType=INTEGER}
+		and  a.audit_status = #{auditStatus,jdbcType=INTEGER}
 	</if>
 	</if>
 	<if test="name != null">
 	<if test="name != null">
-		and  name = #{name,jdbcType=VARCHAR}
+		and  a.name = #{name,jdbcType=VARCHAR}
 	</if>
 	</if>
 	<if test="keyword != null">
 	<if test="keyword != null">
-		and  keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+		and  a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
 	</if>
 	</if>
 	<if test="category != null">
 	<if test="category != null">
-		and  category = #{category,jdbcType=INTEGER}
+		and  a.category = #{category,jdbcType=INTEGER}
 	</if>
 	</if>
 	<if test="status != null">
 	<if test="status != null">
-		and  status = #{status,jdbcType=INTEGER}
+		and  a.status = #{status,jdbcType=INTEGER}
 	</if>
 	</if>
 	<if test="rStart != null">
 	<if test="rStart != null">
-       and	release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
+       and	a.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
 	</if>
 	</if>
 	<if test="rEnd != null">
 	<if test="rEnd != null">
-	   and release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	   and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
 	</if>
 	</if>
 	<if test="releaseStatus != null">
 	<if test="releaseStatus != null">
-	   and  release_status = #{releaseStatus,jdbcType=INTEGER}
+	   and  a.release_status = #{releaseStatus,jdbcType=INTEGER}
 	</if>
 	</if>
 	order by serial_number desc
 	order by serial_number desc
 	<if test="page_sql!=null">
 	<if test="page_sql!=null">
@@ -779,37 +779,37 @@
   <select id="findOrgOwnerAchievementCount" parameterType="String" resultType="java.lang.Integer">
   <select id="findOrgOwnerAchievementCount" parameterType="String" resultType="java.lang.Integer">
   	select 
   	select 
   		count(1)
   		count(1)
-  	from achievement
-  	where deleted_sign = 0 and owner_type = 1
+  	from achievement a
+  	where a.deleted_sign = 0 and a.owner_type = 1
   	<if test="ownerId != null">
   	<if test="ownerId != null">
-		and  owner_id = #{ownerId,jdbcType=VARCHAR}
+		and  a.owner_id = #{ownerId,jdbcType=VARCHAR}
 	</if>
 	</if>
   	<if test="serialNumber != null">
   	<if test="serialNumber != null">
-		and  serial_number = #{serialNumber,jdbcType=INTEGER}
+		and  a.serial_number = #{serialNumber,jdbcType=INTEGER}
 	</if>
 	</if>
 	<if test="auditStatus != null">
 	<if test="auditStatus != null">
-		and  audit_status = #{auditStatus,jdbcType=INTEGER}
+		and  a.audit_status = #{auditStatus,jdbcType=INTEGER}
 	</if>
 	</if>
 	<if test="name != null">
 	<if test="name != null">
-		and  name = #{name,jdbcType=VARCHAR}
+		and  a.name = #{name,jdbcType=VARCHAR}
 	</if>
 	</if>
 	<if test="keyword != null">
 	<if test="keyword != null">
-		and  keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+		and  a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
 	</if>
 	</if>
 	<if test="category != null">
 	<if test="category != null">
-		and  category = #{category,jdbcType=INTEGER}
+		and  a.category = #{category,jdbcType=INTEGER}
 	</if>
 	</if>
 	<if test="status != null">
 	<if test="status != null">
-		and  status = #{status,jdbcType=INTEGER}
+		and  a.status = #{status,jdbcType=INTEGER}
 	</if>
 	</if>
 	<if test="rStart != null">
 	<if test="rStart != null">
-       and	release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
+       and	a.release_date <![CDATA[ > ]]> #{rStart,jdbcType=TIMESTAMP}
 	</if>
 	</if>
 	<if test="rEnd != null">
 	<if test="rEnd != null">
-	   and release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
+	   and a.release_date <![CDATA[ < ]]> #{rEnd,jdbcType=TIMESTAMP}
 	</if>
 	</if>
 	<if test="releaseStatus != null">
 	<if test="releaseStatus != null">
-	   and  release_status = #{releaseStatus,jdbcType=INTEGER}
+	   and  a.release_status = #{releaseStatus,jdbcType=INTEGER}
 	</if>
 	</if>
   </select>
   </select>
   
   
@@ -980,4 +980,111 @@
     </foreach>
     </foreach>
   </insert>
   </insert>
   
   
+  <select id="findSearchAchievementListByPage" parameterType="String" resultType="com.goafanti.portal.bo.AchievementSearchListBo">
+  	select 
+  		a.id, a.name, a.keyword,
+  		a.serial_number as serialNumber, a.data_category as dataCategory, a.category,
+  		a.release_date as releaseDate, a.owner_type as ownerType, ui.username,
+  		oi.unit_name as unitName, a.field_a as fieldA, a.field_b as fieldB,
+  		a.transfer_price as transferPrice, a.maturity, a.transfer_mode as transferMode,
+  		a.bargaining_mode as bargainingMode
+  	from achievement a 
+  	left join user_identity ui on ui.uid = a.owner_id
+  	left join organization_identity oi on oi.uid = a.owner_id
+  	where a.deleted_sign = 0 
+  	<if test="keyword != null">
+  		and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+  	</if>
+  	<if test="category != null">
+  		and a.category = #{category,jdbcType=INTEGER}
+  	</if>
+  	<if test="bargainingMode != null">
+  		and a.bargaining_mode = #{bargainingMode,jdbcType=INTEGER}
+  	</if>
+  	
+  	<if test="maturity != maturity">
+  		and a.maturity = #{maturity,jdbcType=INTEGER}
+  	</if>
+  	<if test="transferPriceLower != null">
+  		and a.transfer_price <![CDATA[ > ]]> #{transferPriceLower,jdbcType=DECIMAL}
+  	</if>
+  	<if test="transferPriceUpper != null">
+  		and a.transfer_price <![CDATA[ < ]]> #{transferPriceUpper,jdbcType=DECIMAL}
+  	</if>
+  	<if test="transferMode != null">
+  		and a.transfer_mode = #{transferMode,jdbcType=INTEGER}
+  	</if>
+  	<if test="fieldA != null">
+  		and a.field_a = #{fieldA,jdbcType=INTEGER}
+  	</if>
+  	<if test="fieldB != null">
+  		and a.field_b = #{fieldB,jdbcType=INTEGER}
+  	</if>
+  	and a.deleted_sign = 0 
+  	and a.release_status = 1
+  	and a.audit_status = 3
+  	order by a.release_date desc
+  	<if test="page_sql!=null">
+			${page_sql}
+	</if>
+  </select>
+  
+  <select id="findSearchAchievementCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+  		count(1)
+  	from achievement a
+  	where a.deleted_sign = 0 
+  	<if test="keyword != null">
+  		and a.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+  	</if>
+  	<if test="bargainingMode != null">
+  		and a.bargaining_mode = #{bargainingMode,jdbcType=INTEGER}
+  	</if>
+  	<if test="category != null">
+  		and a.category = #{category,jdbcType=INTEGER}
+  	</if>
+  	
+  	<if test="maturity != maturity">
+  		and a.maturity = #{maturity,jdbcType=INTEGER}
+  	</if>
+  	<if test="transferPriceLower != null">
+  		and a.transfer_price <![CDATA[ > ]]> #{transferPriceLower,jdbcType=DECIMAL}
+  	</if>
+  	<if test="transferPriceUpper != null">
+  		and a.transfer_price <![CDATA[ < ]]> #{transferPriceUpper,jdbcType=DECIMAL}
+  	</if>
+  	<if test="transferMode != null">
+  		and a.transfer_mode = #{transferMode,jdbcType=INTEGER}
+  	</if>
+  	<if test="fieldA != null">
+  		and a.field_a = #{fieldA,jdbcType=INTEGER}
+  	</if>
+  	<if test="fieldB != null">
+  		and a.field_b = #{fieldB,jdbcType=INTEGER}
+  	</if>
+  	and a.release_status = 1
+  	and a.audit_status = 3
+  </select>
+  
+  <select id="selectAchievementSearchDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.AchievementDetailBo">
+  	select 
+  		a.id, a.serial_number as serialNumber, a.keyword, 
+  		a.name, a.data_category as dataCategory, a.category,
+  		ui.username, oi.unit_name as unitName, a.release_date as releaseDate,
+  		a.owner_type as ownerType, a.field_a as fieldA, a.field_b as fieldB,
+  		a.transfer_price as transferPrice, a.maturity, a.transfer_mode as transferMode,
+  		a.bargaining_mode as bargainingMode, a.summary, a.introduction,
+  		a.technical_picture_url as technicalPictureUrl, a.maturity_picture_url as maturityPictureUrl, a.maturity_text_file_url as maturityTextFileUrl,
+  		a.maturity_video_url as maturityVideoUrl, a.innovation, a.cooperation_mode as cooperationMode,
+  		a.bargaining_mode as bargainingMode, a.technical_scene as technicalScene, a.breakthrough,
+  		a.patent_case as patentCase, a.awards, a.team_des as teamDes, 
+  		a.parameter, a.tech_plan_url as techPlanUrl, a.business_plan_url as businessPlanUrl,
+  		ai.id as achievementInterestId
+  	from achievement a
+  	left join user_identity ui on ui.uid = a.owner_id
+  	left join organization_identity oi on oi.uid = a.owner_id
+  	left join achievement_interest ai on ai.achievement_id = a.id and ai.uid = #{0}
+  	where a.id = #{1}
+  </select>
+  
 </mapper>
 </mapper>

+ 116 - 0
src/main/java/com/goafanti/common/mapper/DemandInterestMapper.xml

@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.goafanti.common.dao.DemandInterestMapper" >
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.DemandInterest" >
+    <id column="id" property="id" 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" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    id, demand_id, uid, create_time
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select 
+    <include refid="Base_Column_List" />
+    from demand_interest
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+    delete from demand_interest
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.DemandInterest" >
+    insert into demand_interest (id, demand_id, uid, 
+      create_time)
+    values (#{id,jdbcType=VARCHAR}, #{demandId,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, 
+      #{createTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.DemandInterest" >
+    insert into demand_interest
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        id,
+      </if>
+      <if test="demandId != null" >
+        demand_id,
+      </if>
+      <if test="uid != null" >
+        uid,
+      </if>
+      <if test="createTime != null" >
+        create_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="demandId != null" >
+        #{demandId,jdbcType=VARCHAR},
+      </if>
+      <if test="uid != null" >
+        #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.DemandInterest" >
+    update demand_interest
+    <set >
+      <if test="demandId != null" >
+        demand_id = #{demandId,jdbcType=VARCHAR},
+      </if>
+      <if test="uid != null" >
+        uid = #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.DemandInterest" >
+    update demand_interest
+    set demand_id = #{demandId,jdbcType=VARCHAR},
+      uid = #{uid,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  
+   <select id="findDemandInterestListByPage" parameterType="String" resultType="com.goafanti.portal.bo.DemandInterestListBo">
+  	select 
+  		di.id, di.demand_id as demandId, di.create_time as createTime,
+  		d.name, d.serial_number as serialNumber, d.deleted_sign as deletedSign,
+  		d.audit_status as auditStatus, d.keyword, d.status
+  	from demand_interest di
+  	left join demand d on d.id = di.demand_id
+  	where 1=1
+  	<if test="uid != null">
+  		and di.uid = #{uid,jdbcType=VARCHAR}
+  	</if> 
+  	order by di.create_time desc
+  	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findDemandInterestCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+  		count(1)
+  	from demand_interest di
+  	where 1=1
+  	<if test="uid != null">
+  		and	di.uid = #{uid,jdbcType=VARCHAR}
+  	</if> 
+  </select>
+  
+   <select id="selectDemandInterestByUidAndDemandId" resultMap="BaseResultMap"  >
+    select 
+    <include refid="Base_Column_List" />
+    from demand_interest
+    where uid = #{0} and demand_id = #{1}
+  </select>
+</mapper>

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

@@ -897,4 +897,89 @@
     </foreach>
     </foreach>
   </insert>
   </insert>
   
   
+  <select id="findSearchDemandListByPage" parameterType="String" resultType="com.goafanti.portal.bo.DemandSearchListBo">
+  	select 
+	  		d.id, d.name, d.keyword,
+	  		d.serial_number as serialNumber, d.data_category as dataCategory, d.industry_category_a as industryCategoryA,
+	  		d.industry_category_b as industryCategoryB, d.demand_type as demandType, d.budget_cost as budgetCost,
+	  		d.problem_des as problemDes, d.release_date as releaseDate, ui.username,
+	  		oi.unit_name as unitName
+  		from demand d
+  		left join user_identity ui on d.employer_id = ui.uid
+  		left join organization_identity oi on d.employer_id = oi.uid
+  		where d.deleted_sign = 0 and d.status = 0
+  		<if test="keyword != null">
+  			and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+  		</if>
+  		<if test="industryCategoryA != null">
+  			and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
+  		</if>
+  		<if test="industryCategoryB != null">
+  			and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
+  		</if>
+  		<if test="budgetCostLower != null">
+  			and d.budget_cost <![CDATA[ > ]]>= #{budgetCostLower,jdbcType=DECIMAL}
+  		</if>
+  		<if test="budgetCostUpper != null">
+  			and d.budget_cost <![CDATA[ < ]]>= #{budgetCostUpper,jdbcType=DECIMAL}}
+  		</if>
+  		<if test="demandType != null">
+  			and d.demand_type = #{demandType,jdbcType=INTEGER}
+  		</if>
+  		and d.deleted_sign = 0 
+  		and d.release_status = 1
+  		and d.audit_status = 3
+  		order by d.release_date desc
+  	<if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  
+  <select id="findSearchDemandCount" parameterType="String" resultType="java.lang.Integer">
+  	select 
+  		count(1)
+  	from demand d
+  	where d.deleted_sign = 0 and d.status = 0
+  	<if test="keyword != null">
+  			and d.keyword like "%"#{keyword,jdbcType=VARCHAR}"%"
+  		</if>
+  		<if test="industryCategoryA != null">
+  			and d.industry_category_a = #{industryCategoryA,jdbcType=INTEGER}
+  		</if>
+  		<if test="industryCategoryB != null">
+  			and d.industry_category_b = #{industryCategoryB,jdbcType=INTEGER}
+  		</if>
+  		<if test="budgetCostLower != null">
+  			and d.budget_cost <![CDATA[ > ]]>= #{budgetCostLower,jdbcType=DECIMAL}
+  		</if>
+  		<if test="budgetCostUpper != null">
+  			and d.budget_cost <![CDATA[ < ]]>= #{budgetCostUpper,jdbcType=DECIMAL}}
+  		</if>
+  		<if test="demandType != null">
+  			and d.demand_type = #{demandType,jdbcType=INTEGER}
+  		</if>
+  		and d.deleted_sign = 0 
+  		and d.release_status = 1
+  		and d.audit_status = 3
+  </select>
+  
+  <select id="selectDemandSearchDetail" parameterType="java.lang.String" resultType="com.goafanti.portal.bo.DemandSearchDetailBo"> 
+  	select 
+  		d.id, d.serial_number as serialNumber, d.keyword, 
+  		d.data_category as dataCategory, d.name, d.industry_category_a as industryCategoryA,
+  		d.industry_category_b as industryCategoryB, d.demand_type as demandType, d.budget_cost as budgetCost,
+  		d.problem_des as problemDes, d.release_date as releaseDate, d.technical_requirements as technicalRequirements,
+  		d.picture_url as pictureUrl, d.text_file_url as textFileUrl, d.video_url as videoUrl,
+  		d.fixed_cycle as fixedCycle, d.people_number as peopleNumber, d.fixed_scheme as fixedScheme,
+  		d.cost_escrow as costEscrow, d.validity_period as validityPeriod, ui.username,
+  		oi.unit_name as unitName, di.id as demandInterestId
+  	from demand d
+  	left join user_identity ui on ui.uid = d.employer_id
+  	left join organization_identity oi on oi.uid = d.employer_id
+  	left join demand_interest di on di.demand_id = d.id and di.uid = #{0}
+  	where d.id = #{1}
+  </select>
+  
+  
+  
 </mapper>
 </mapper>

+ 106 - 0
src/main/java/com/goafanti/common/mapper/DemandOrderLogMapper.xml

@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.goafanti.common.dao.DemandOrderLogMapper" >
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.DemandOrderLog" >
+    <id column="id" property="id" jdbcType="VARCHAR" />
+    <result column="demand_order_id" property="demandOrderId" jdbcType="VARCHAR" />
+    <result column="record_time" property="recordTime" jdbcType="TIMESTAMP" />
+    <result column="status" property="status" jdbcType="INTEGER" />
+    <result column="operator" property="operator" jdbcType="VARCHAR" />
+    <result column="comment" property="comment" jdbcType="VARCHAR" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    id, demand_order_id, record_time, status, operator, comment
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select 
+    <include refid="Base_Column_List" />
+    from demand_order_log
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+    delete from demand_order_log
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.DemandOrderLog" >
+    insert into demand_order_log (id, demand_order_id, record_time, 
+      status, operator, comment
+      )
+    values (#{id,jdbcType=VARCHAR}, #{demandOrderId,jdbcType=VARCHAR}, #{recordTime,jdbcType=TIMESTAMP}, 
+      #{status,jdbcType=INTEGER}, #{operator,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.DemandOrderLog" >
+    insert into demand_order_log
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        id,
+      </if>
+      <if test="demandOrderId != null" >
+        demand_order_id,
+      </if>
+      <if test="recordTime != null" >
+        record_time,
+      </if>
+      <if test="status != null" >
+        status,
+      </if>
+      <if test="operator != null" >
+        operator,
+      </if>
+      <if test="comment != null" >
+        comment,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="demandOrderId != null" >
+        #{demandOrderId,jdbcType=VARCHAR},
+      </if>
+      <if test="recordTime != null" >
+        #{recordTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="status != null" >
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="operator != null" >
+        #{operator,jdbcType=VARCHAR},
+      </if>
+      <if test="comment != null" >
+        #{comment,jdbcType=VARCHAR},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.DemandOrderLog" >
+    update demand_order_log
+    <set >
+      <if test="demandOrderId != null" >
+        demand_order_id = #{demandOrderId,jdbcType=VARCHAR},
+      </if>
+      <if test="recordTime != null" >
+        record_time = #{recordTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="status != null" >
+        status = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="operator != null" >
+        operator = #{operator,jdbcType=VARCHAR},
+      </if>
+      <if test="comment != null" >
+        comment = #{comment,jdbcType=VARCHAR},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.DemandOrderLog" >
+    update demand_order_log
+    set demand_order_id = #{demandOrderId,jdbcType=VARCHAR},
+      record_time = #{recordTime,jdbcType=TIMESTAMP},
+      status = #{status,jdbcType=INTEGER},
+      operator = #{operator,jdbcType=VARCHAR},
+      comment = #{comment,jdbcType=VARCHAR}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+</mapper>

+ 195 - 0
src/main/java/com/goafanti/common/mapper/DemandOrderMapper.xml

@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.goafanti.common.dao.DemandOrderMapper" >
+  <resultMap id="BaseResultMap" type="com.goafanti.common.model.DemandOrder" >
+    <id column="id" property="id" jdbcType="VARCHAR" />
+    <result column="serial_number" property="serialNumber" jdbcType="INTEGER" />
+    <result column="demand_id" property="demandId" jdbcType="VARCHAR" />
+    <result column="uid" property="uid" jdbcType="VARCHAR" />
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="enclosure_url" property="enclosureUrl" jdbcType="VARCHAR" />
+    <result column="status" property="status" jdbcType="INTEGER" />
+    <result column="intention_money" property="intentionMoney" jdbcType="INTEGER" />
+    <result column="contract_money" property="contractMoney" jdbcType="INTEGER" />
+    <result column="commission" property="commission" jdbcType="INTEGER" />
+    <result column="service_money" property="serviceMoney" jdbcType="INTEGER" />
+    <result column="refund" property="refund" jdbcType="INTEGER" />
+    <result column="deleted_sign" property="deletedSign" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Base_Column_List" >
+    id, serial_number, demand_id, uid, create_time, enclosure_url, status, intention_money, 
+    contract_money, commission, service_money, refund, deleted_sign
+  </sql>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
+    select 
+    <include refid="Base_Column_List" />
+    from demand_order
+    where id = #{id,jdbcType=VARCHAR}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
+    delete from demand_order
+    where id = #{id,jdbcType=VARCHAR}
+  </delete>
+  <insert id="insert" parameterType="com.goafanti.common.model.DemandOrder" >
+    insert into demand_order (id, serial_number, demand_id, 
+      uid, create_time, enclosure_url, 
+      status, intention_money, contract_money, 
+      commission, service_money, refund, 
+      deleted_sign)
+    values (#{id,jdbcType=VARCHAR}, #{serialNumber,jdbcType=INTEGER}, #{demandId,jdbcType=VARCHAR}, 
+      #{uid,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{enclosureUrl,jdbcType=VARCHAR}, 
+      #{status,jdbcType=INTEGER}, #{intentionMoney,jdbcType=INTEGER}, #{contractMoney,jdbcType=INTEGER}, 
+      #{commission,jdbcType=INTEGER}, #{serviceMoney,jdbcType=INTEGER}, #{refund,jdbcType=INTEGER}, 
+      #{deletedSign,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.goafanti.common.model.DemandOrder" >
+    insert into demand_order
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        id,
+      </if>
+      <if test="serialNumber != null" >
+        serial_number,
+      </if>
+      <if test="demandId != null" >
+        demand_id,
+      </if>
+      <if test="uid != null" >
+        uid,
+      </if>
+      <if test="createTime != null" >
+        create_time,
+      </if>
+      <if test="enclosureUrl != null" >
+        enclosure_url,
+      </if>
+      <if test="status != null" >
+        status,
+      </if>
+      <if test="intentionMoney != null" >
+        intention_money,
+      </if>
+      <if test="contractMoney != null" >
+        contract_money,
+      </if>
+      <if test="commission != null" >
+        commission,
+      </if>
+      <if test="serviceMoney != null" >
+        service_money,
+      </if>
+      <if test="refund != null" >
+        refund,
+      </if>
+      <if test="deletedSign != null" >
+        deleted_sign,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=VARCHAR},
+      </if>
+      <if test="serialNumber != null" >
+        #{serialNumber,jdbcType=INTEGER},
+      </if>
+      <if test="demandId != null" >
+        #{demandId,jdbcType=VARCHAR},
+      </if>
+      <if test="uid != null" >
+        #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="enclosureUrl != null" >
+        #{enclosureUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null" >
+        #{status,jdbcType=INTEGER},
+      </if>
+      <if test="intentionMoney != null" >
+        #{intentionMoney,jdbcType=INTEGER},
+      </if>
+      <if test="contractMoney != null" >
+        #{contractMoney,jdbcType=INTEGER},
+      </if>
+      <if test="commission != null" >
+        #{commission,jdbcType=INTEGER},
+      </if>
+      <if test="serviceMoney != null" >
+        #{serviceMoney,jdbcType=INTEGER},
+      </if>
+      <if test="refund != null" >
+        #{refund,jdbcType=INTEGER},
+      </if>
+      <if test="deletedSign != null" >
+        #{deletedSign,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.DemandOrder" >
+    update demand_order
+    <set >
+      <if test="serialNumber != null" >
+        serial_number = #{serialNumber,jdbcType=INTEGER},
+      </if>
+      <if test="demandId != null" >
+        demand_id = #{demandId,jdbcType=VARCHAR},
+      </if>
+      <if test="uid != null" >
+        uid = #{uid,jdbcType=VARCHAR},
+      </if>
+      <if test="createTime != null" >
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="enclosureUrl != null" >
+        enclosure_url = #{enclosureUrl,jdbcType=VARCHAR},
+      </if>
+      <if test="status != null" >
+        status = #{status,jdbcType=INTEGER},
+      </if>
+      <if test="intentionMoney != null" >
+        intention_money = #{intentionMoney,jdbcType=INTEGER},
+      </if>
+      <if test="contractMoney != null" >
+        contract_money = #{contractMoney,jdbcType=INTEGER},
+      </if>
+      <if test="commission != null" >
+        commission = #{commission,jdbcType=INTEGER},
+      </if>
+      <if test="serviceMoney != null" >
+        service_money = #{serviceMoney,jdbcType=INTEGER},
+      </if>
+      <if test="refund != null" >
+        refund = #{refund,jdbcType=INTEGER},
+      </if>
+      <if test="deletedSign != null" >
+        deleted_sign = #{deletedSign,jdbcType=INTEGER},
+      </if>
+    </set>
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.DemandOrder" >
+    update demand_order
+    set serial_number = #{serialNumber,jdbcType=INTEGER},
+      demand_id = #{demandId,jdbcType=VARCHAR},
+      uid = #{uid,jdbcType=VARCHAR},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      enclosure_url = #{enclosureUrl,jdbcType=VARCHAR},
+      status = #{status,jdbcType=INTEGER},
+      intention_money = #{intentionMoney,jdbcType=INTEGER},
+      contract_money = #{contractMoney,jdbcType=INTEGER},
+      commission = #{commission,jdbcType=INTEGER},
+      service_money = #{serviceMoney,jdbcType=INTEGER},
+      refund = #{refund,jdbcType=INTEGER},
+      deleted_sign = #{deletedSign,jdbcType=INTEGER}
+    where id = #{id,jdbcType=VARCHAR}
+  </update>
+  
+   <select id="selectDemandOrderByUidAndDemandId" resultMap="BaseResultMap" >
+    select 
+    <include refid="Base_Column_List" />
+    from demand_order
+    where uid = #{0} and demand_id = #{1}
+  </select>
+</mapper>

+ 54 - 0
src/main/java/com/goafanti/common/model/AchievementInterest.java

@@ -0,0 +1,54 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class AchievementInterest {
+    private String id;
+
+    /**
+    * 科技成果ID
+    */
+    private String achievementId;
+
+    /**
+    * 感兴趣人ID
+    */
+    private String uid;
+
+    /**
+    * 记录创建时间(关注时间)
+    */
+    private Date createTime;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getAchievementId() {
+        return achievementId;
+    }
+
+    public void setAchievementId(String achievementId) {
+        this.achievementId = achievementId;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}

+ 54 - 0
src/main/java/com/goafanti/common/model/DemandInterest.java

@@ -0,0 +1,54 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class DemandInterest {
+    private String id;
+
+    /**
+    * 需求主键
+    */
+    private String demandId;
+
+    /**
+    * 关注人ID
+    */
+    private String uid;
+
+    /**
+    * 关注时间
+    */
+    private Date createTime;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getDemandId() {
+        return demandId;
+    }
+
+    public void setDemandId(String demandId) {
+        this.demandId = demandId;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+}

+ 171 - 0
src/main/java/com/goafanti/common/model/DemandOrder.java

@@ -0,0 +1,171 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class DemandOrder {
+    private String id;
+
+    /**
+    * 编号
+    */
+    private Integer serialNumber;
+
+    /**
+    * 科技需求ID
+    */
+    private String demandId;
+
+    /**
+    * 接单人ID
+    */
+    private String uid;
+
+    /**
+    * 接单时间
+    */
+    private Date createTime;
+
+    /**
+    * 附件URL
+    */
+    private String enclosureUrl;
+
+    /**
+    * 流程变动(0--初始意向,1--意向金,2--签订合同,3--合同金,4--佣金,5--服务金,6--关闭)
+    */
+    private Integer status;
+
+    /**
+    * 意向金
+    */
+    private Integer intentionMoney;
+
+    /**
+    * 合同金
+    */
+    private Integer contractMoney;
+
+    /**
+    * 佣金
+    */
+    private Integer commission;
+
+    /**
+    * 服务金
+    */
+    private Integer serviceMoney;
+
+    /**
+    * 是否退款(0--未退款,1--已退款)
+    */
+    private Integer refund;
+
+    /**
+    * 删除标记(0--未删除,1--已删除)
+    */
+    private Integer deletedSign;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public Integer getSerialNumber() {
+        return serialNumber;
+    }
+
+    public void setSerialNumber(Integer serialNumber) {
+        this.serialNumber = serialNumber;
+    }
+
+    public String getDemandId() {
+        return demandId;
+    }
+
+    public void setDemandId(String demandId) {
+        this.demandId = demandId;
+    }
+
+    public String getUid() {
+        return uid;
+    }
+
+    public void setUid(String uid) {
+        this.uid = uid;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getEnclosureUrl() {
+        return enclosureUrl;
+    }
+
+    public void setEnclosureUrl(String enclosureUrl) {
+        this.enclosureUrl = enclosureUrl;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public Integer getIntentionMoney() {
+        return intentionMoney;
+    }
+
+    public void setIntentionMoney(Integer intentionMoney) {
+        this.intentionMoney = intentionMoney;
+    }
+
+    public Integer getContractMoney() {
+        return contractMoney;
+    }
+
+    public void setContractMoney(Integer contractMoney) {
+        this.contractMoney = contractMoney;
+    }
+
+    public Integer getCommission() {
+        return commission;
+    }
+
+    public void setCommission(Integer commission) {
+        this.commission = commission;
+    }
+
+    public Integer getServiceMoney() {
+        return serviceMoney;
+    }
+
+    public void setServiceMoney(Integer serviceMoney) {
+        this.serviceMoney = serviceMoney;
+    }
+
+    public Integer getRefund() {
+        return refund;
+    }
+
+    public void setRefund(Integer refund) {
+        this.refund = refund;
+    }
+
+    public Integer getDeletedSign() {
+        return deletedSign;
+    }
+
+    public void setDeletedSign(Integer deletedSign) {
+        this.deletedSign = deletedSign;
+    }
+}

+ 74 - 0
src/main/java/com/goafanti/common/model/DemandOrderLog.java

@@ -0,0 +1,74 @@
+package com.goafanti.common.model;
+
+import java.util.Date;
+
+public class DemandOrderLog {
+    private String id;
+
+    /**
+    * 科技需求意向单/交易单ID
+    */
+    private String demandOrderId;
+
+    private Date recordTime;
+
+    /**
+    * 状态
+    */
+    private Integer status;
+
+    /**
+    * 记录操作人
+    */
+    private String operator;
+
+    private String comment;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getDemandOrderId() {
+        return demandOrderId;
+    }
+
+    public void setDemandOrderId(String demandOrderId) {
+        this.demandOrderId = demandOrderId;
+    }
+
+    public Date getRecordTime() {
+        return recordTime;
+    }
+
+    public void setRecordTime(Date recordTime) {
+        this.recordTime = recordTime;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getOperator() {
+        return operator;
+    }
+
+    public void setOperator(String operator) {
+        this.operator = operator;
+    }
+
+    public String getComment() {
+        return comment;
+    }
+
+    public void setComment(String comment) {
+        this.comment = comment;
+    }
+}

+ 5 - 0
src/main/java/com/goafanti/demand/bo/InputDemandOrder.java

@@ -0,0 +1,5 @@
+package com.goafanti.demand.bo;
+
+public class InputDemandOrder {
+	private String demandId;
+}

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

@@ -0,0 +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);
+
+	void saveAchievementInterest(String id);
+
+	DemandInterest selectDemandInterestByUidAndDemandId(String userId, String id);
+
+	Pagination<DemandInterestListBo> listDemandInterest(Integer pNo, Integer pSize);
+
+
+}

+ 11 - 0
src/main/java/com/goafanti/demand/service/DemandOrderService.java

@@ -0,0 +1,11 @@
+package com.goafanti.demand.service;
+
+import com.goafanti.common.model.DemandOrder;
+
+public interface DemandOrderService {
+
+	DemandOrder selectDemandOrderByUidAndDemandId(String userId, String id);
+
+	void saveDemandOrder(String id);
+
+}

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

@@ -1,5 +1,6 @@
 package com.goafanti.demand.service;
 package com.goafanti.demand.service;
 
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.List;
 
 
 import com.goafanti.achievement.bo.AchievementDemandListBo;
 import com.goafanti.achievement.bo.AchievementDemandListBo;
@@ -9,18 +10,20 @@ import com.goafanti.demand.bo.DemandImportBo;
 import com.goafanti.demand.bo.DemandListBo;
 import com.goafanti.demand.bo.DemandListBo;
 import com.goafanti.demand.bo.DemandManageDetailBo;
 import com.goafanti.demand.bo.DemandManageDetailBo;
 import com.goafanti.demand.bo.DemandManageListBo;
 import com.goafanti.demand.bo.DemandManageListBo;
+import com.goafanti.portal.bo.DemandSearchDetailBo;
+import com.goafanti.portal.bo.DemandSearchListBo;
 
 
 public interface DemandService {
 public interface DemandService {
 
 
-	Pagination<DemandManageListBo> selectUserDemandManageList(Integer auditStatus, String province, Integer serialNumber, String name, String keyword,
-			Integer infoSources, Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate,
-			String employerName, Integer status, Integer releaseStatus, String releaseDateStartDate,
-			String releaseDateEndDate, Integer pNo, Integer pSize);
+	Pagination<DemandManageListBo> selectUserDemandManageList(Integer auditStatus, String province,
+			Integer serialNumber, String name, String keyword, Integer infoSources, Integer demandType,
+			String validityPeriodStartDate, String validityPeriodEndDate, String employerName, Integer status,
+			Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo, Integer pSize);
 
 
-	Pagination<DemandManageListBo> selectOrgDemandManageList(Integer auditStatus, String province, Integer serialNumber, String name,
-			String keyword, Integer infoSources, Integer demandType, String validityPeriodStartDate,
-			String validityPeriodEndDate, String username, Integer status, Integer releaseStatus, String releaseDateStartDate,
-			String releaseDateEndDate, Integer pNo, Integer pSize);
+	Pagination<DemandManageListBo> selectOrgDemandManageList(Integer auditStatus, String province, Integer serialNumber,
+			String name, String keyword, Integer infoSources, Integer demandType, String validityPeriodStartDate,
+			String validityPeriodEndDate, String username, Integer status, Integer releaseStatus,
+			String releaseDateStartDate, String releaseDateEndDate, Integer pNo, Integer pSize);
 
 
 	void saveUserDemand(Demand d, String validityPeriodFormattedDate, String[] keywords);
 	void saveUserDemand(Demand d, String validityPeriodFormattedDate, String[] keywords);
 
 
@@ -34,9 +37,8 @@ public interface DemandService {
 
 
 	Demand selectByPrimaryKey(String id);
 	Demand selectByPrimaryKey(String id);
 
 
-
-	Pagination<DemandListBo> listDemand(Integer auditStatus, Integer serialNumber, String name, String keyword, Integer demandType,
-			String validityPeriodStartDate, String validityPeriodEndDate, Integer status,
+	Pagination<DemandListBo> listDemand(Integer auditStatus, Integer serialNumber, String name, String keyword,
+			Integer demandType, String validityPeriodStartDate, String validityPeriodEndDate, Integer status,
 			Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo, Integer pSize);
 			Integer releaseStatus, String releaseDateStartDate, String releaseDateEndDate, Integer pNo, Integer pSize);
 
 
 	int updateReleaseStatus(Demand d);
 	int updateReleaseStatus(Demand d);
@@ -49,4 +51,10 @@ public interface DemandService {
 
 
 	void insertImport(List<DemandImportBo> data);
 	void insertImport(List<DemandImportBo> data);
 
 
+	Pagination<DemandSearchListBo> listDemandSearchList(String keyword, Integer industryCategoryA,
+			Integer industryCategoryB, Integer demandType, BigDecimal budgetCostLower, BigDecimal budgetCostUpper,
+			Integer pNo, Integer pSize);
+
+	DemandSearchDetailBo selectDemandSearchDetail(String uid, String id);
+
 }
 }

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

@@ -0,0 +1,67 @@
+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.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);
+	}
+
+	@Override
+	public void 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());
+		demandInterestMapper.insert(di);
+	}
+
+	@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);
+	}
+
+	
+}

+ 50 - 0
src/main/java/com/goafanti/demand/service/impl/DemandOrderServiceImpl.java

@@ -0,0 +1,50 @@
+package com.goafanti.demand.service.impl;
+
+import java.util.Calendar;
+import java.util.UUID;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import com.goafanti.common.dao.DemandOrderLogMapper;
+import com.goafanti.common.dao.DemandOrderMapper;
+import com.goafanti.common.enums.DeleteStatus;
+import com.goafanti.common.enums.DemandOrderStatus;
+import com.goafanti.common.model.DemandOrder;
+import com.goafanti.common.model.DemandOrderLog;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.demand.service.DemandOrderService;
+@Service
+public class DemandOrderServiceImpl implements DemandOrderService {
+	@Autowired
+	private DemandOrderMapper demandOrderMapper;
+	@Autowired
+	private DemandOrderLogMapper demandOrderLogMapper;
+	
+	@Override
+	public DemandOrder selectDemandOrderByUidAndDemandId(String uid, String id) {
+		return demandOrderMapper.selectDemandOrderByUidAndDemandId(uid, id);
+	}
+
+	@Override
+	public void saveDemandOrder(String id) {
+		DemandOrder demandOrder = new DemandOrder();
+		demandOrder.setId(UUID.randomUUID().toString().toString());
+		Calendar now = Calendar.getInstance();
+		now.set(Calendar.MILLISECOND, 0);
+		demandOrder.setCreateTime(now.getTime());
+		demandOrder.setUid(TokenManager.getUserId());
+		demandOrder.setDeletedSign(DeleteStatus.UNDELETE.getCode());
+		demandOrder.setStatus(DemandOrderStatus.CREATE.getCode());
+		demandOrderMapper.insert(demandOrder);
+		
+		DemandOrderLog dol = new DemandOrderLog();
+		dol.setId(UUID.randomUUID().toString());
+		dol.setDemandOrderId(demandOrder.getId());
+		dol.setRecordTime(demandOrder.getCreateTime());
+		dol.setStatus(demandOrder.getStatus());
+		demandOrderLogMapper.insert(dol);
+		
+	}
+
+}

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

@@ -1,5 +1,6 @@
 package com.goafanti.demand.service.impl;
 package com.goafanti.demand.service.impl;
 
 
+import java.math.BigDecimal;
 import java.text.ParseException;
 import java.text.ParseException;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Calendar;
@@ -45,6 +46,8 @@ import com.goafanti.demand.bo.DemandListBo;
 import com.goafanti.demand.bo.DemandManageDetailBo;
 import com.goafanti.demand.bo.DemandManageDetailBo;
 import com.goafanti.demand.bo.DemandManageListBo;
 import com.goafanti.demand.bo.DemandManageListBo;
 import com.goafanti.demand.service.DemandService;
 import com.goafanti.demand.service.DemandService;
+import com.goafanti.portal.bo.DemandSearchDetailBo;
+import com.goafanti.portal.bo.DemandSearchListBo;
 
 
 @Service
 @Service
 public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements DemandService {
 public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements DemandService {
@@ -300,7 +303,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 	public List<AchievementDemandListBo> selectAchievementDemandListByDemandId(String id) {
 	public List<AchievementDemandListBo> selectAchievementDemandListByDemandId(String id) {
 		return achievementDemandMapper.selectAchievementDemandListByDemandId(id);
 		return achievementDemandMapper.selectAchievementDemandListByDemandId(id);
 	}
 	}
-	
+
 	@Override
 	@Override
 	public void insertImport(List<DemandImportBo> data) {
 	public void insertImport(List<DemandImportBo> data) {
 		if (null == data || data.isEmpty()) {
 		if (null == data || data.isEmpty()) {
@@ -312,7 +315,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		List<DemandKeyword> demandKeywordList = new ArrayList<>();
 		List<DemandKeyword> demandKeywordList = new ArrayList<>();
 		Calendar now = Calendar.getInstance();
 		Calendar now = Calendar.getInstance();
 		now.set(Calendar.MILLISECOND, 0);
 		now.set(Calendar.MILLISECOND, 0);
-		for (DemandImportBo bo : data){
+		for (DemandImportBo bo : data) {
 			d = new Demand();
 			d = new Demand();
 			BeanUtils.copyProperties(bo, d);
 			BeanUtils.copyProperties(bo, d);
 			d.setId(UUID.randomUUID().toString());
 			d.setId(UUID.randomUUID().toString());
@@ -340,6 +343,52 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		demandKeywordMapper.insertBatch(demandKeywordList);
 		demandKeywordMapper.insertBatch(demandKeywordList);
 	}
 	}
 
 
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<DemandSearchListBo> listDemandSearchList(String keyword, Integer industryCategoryA,
+			Integer industryCategoryB, Integer demandType, BigDecimal budgetCostLower, BigDecimal budgetCostUpper,
+			Integer pNo, Integer pSize) {
+		Map<String, Object> params = new HashMap<>();
+		if (!StringUtils.isBlank(keyword)) {
+			params.put("keyword", keyword);
+		}
+
+		if (null != industryCategoryA) {
+			params.put("industryCategoryA", industryCategoryA);
+		}
+
+		if (null != industryCategoryB) {
+			params.put("industryCategoryB", industryCategoryB);
+		}
+
+		if (null != demandType) {
+			params.put("demandType", demandType);
+		}
+
+		if (null != budgetCostLower) {
+			params.put("budgetCostLower", budgetCostLower);
+		}
+
+		if (null != budgetCostUpper) {
+			params.put("budgetCostUpper", budgetCostUpper);
+		}
+
+		if (pNo == null || pNo < 0) {
+			pNo = 1;
+		}
+
+		if (pSize == null || pSize < 0 || pSize > 10) {
+			pSize = 10;
+		}
+		return (Pagination<DemandSearchListBo>) findPage("findSearchDemandListByPage", "findSearchDemandCount", params,
+				pNo, pSize);
+	}
+
+	@Override
+	public DemandSearchDetailBo selectDemandSearchDetail(String uid, String id) {
+		return demandMapper.selectDemandSearchDetail(uid, id);
+	}
+
 	private Map<String, Object> disposeParams(Integer auditStatus, String province, Integer serialNumber, String name,
 	private Map<String, Object> disposeParams(Integer auditStatus, String province, Integer serialNumber, String name,
 			String keyword, Integer infoSources, Integer demandType, String validityPeriodStartDate,
 			String keyword, Integer infoSources, Integer demandType, String validityPeriodStartDate,
 			String validityPeriodEndDate, String username, Integer status, Integer releaseStatus,
 			String validityPeriodEndDate, String username, Integer status, Integer releaseStatus,
@@ -511,6 +560,4 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 		}
 		}
 	}
 	}
 
 
-	
-
 }
 }

+ 246 - 0
src/main/java/com/goafanti/portal/bo/AchievementDetailBo.java

@@ -0,0 +1,246 @@
+package com.goafanti.portal.bo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+
+public class AchievementDetailBo extends AchievementSearchListBo {
+	/**
+	 * 摘要
+	 */
+	private String	summary;
+
+	/**
+	 * 成果简介
+	 */
+	private String	introduction;
+
+	/**
+	 * 技术图片
+	 */
+	private String	technicalPictureUrl;
+
+	/**
+	 * 成熟度资料--图片URL
+	 */
+	private String	maturityPictureUrl;
+
+	/**
+	 * 成熟度资料--文本文件URL
+	 */
+	private String	maturityTextFileUrl;
+
+	/**
+	 * 成熟度资料--视屏URL
+	 */
+	private String	maturityVideoUrl;
+
+	/**
+	 * 创新度(0--行业先进,1--行业领先,2--国内先进,3--国内领先,4--国际先进,5--国际领先)
+	 */
+	private Integer	innovation;
+
+	/**
+	 * 合作方式(0--技术转让,1--授权生产)
+	 */
+	private Integer	cooperationMode;
+
+	/**
+	 * 议价方式(0--面议,1--定价)
+	 */
+	private Integer	bargainingMode;
+
+	/**
+	 * 技术场景
+	 */
+	private String	technicalScene;
+
+	/**
+	 * 技术突破
+	 */
+	private String	breakthrough;
+
+	/**
+	 * 专利情况
+	 */
+	private String	patentCase;
+
+	/**
+	 * 获奖情况
+	 */
+	private String	awards;
+	
+	/**
+	 * 技术团队情况
+	 */
+	private String teamDes;
+	
+	/**
+	 * 技术参数
+	 */
+	private String parameter;
+	
+	/**
+	 * 技术方案URL
+	 */
+	private String techPlanUrl;
+	
+	/**
+	 * 商业计划书URL
+	 */
+	private String businessPlanUrl;
+	
+	/**
+	 * 关注ID
+	 */
+	private String achievementInterestId;
+	
+
+	public String getAchievementInterestId() {
+		return achievementInterestId;
+	}
+
+	public void setAchievementInterestId(String achievementInterestId) {
+		this.achievementInterestId = achievementInterestId;
+	}
+
+	public String getSummary() {
+		return summary;
+	}
+
+	public void setSummary(String summary) {
+		this.summary = summary;
+	}
+
+	public String getIntroduction() {
+		return introduction;
+	}
+
+	public void setIntroduction(String introduction) {
+		this.introduction = introduction;
+	}
+
+	public String getTechnicalPictureUrl() {
+		return technicalPictureUrl;
+	}
+
+	public void setTechnicalPictureUrl(String technicalPictureUrl) {
+		this.technicalPictureUrl = technicalPictureUrl;
+	}
+
+	public String getMaturityPictureUrl() {
+		return maturityPictureUrl;
+	}
+
+	public void setMaturityPictureUrl(String maturityPictureUrl) {
+		this.maturityPictureUrl = maturityPictureUrl;
+	}
+
+	public String getMaturityTextFileUrl() {
+		return maturityTextFileUrl;
+	}
+
+	public void setMaturityTextFileUrl(String maturityTextFileUrl) {
+		this.maturityTextFileUrl = maturityTextFileUrl;
+	}
+
+	public String getMaturityVideoUrl() {
+		return maturityVideoUrl;
+	}
+
+	public void setMaturityVideoUrl(String maturityVideoUrl) {
+		this.maturityVideoUrl = maturityVideoUrl;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getInnovation() {
+		return innovation;
+	}
+
+	public void setInnovation(Integer innovation) {
+		this.innovation = innovation;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getCooperationMode() {
+		return cooperationMode;
+	}
+
+	public void setCooperationMode(Integer cooperationMode) {
+		this.cooperationMode = cooperationMode;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getBargainingMode() {
+		return bargainingMode;
+	}
+
+	public void setBargainingMode(Integer bargainingMode) {
+		this.bargainingMode = bargainingMode;
+	}
+
+	public String getTechnicalScene() {
+		return technicalScene;
+	}
+
+	public void setTechnicalScene(String technicalScene) {
+		this.technicalScene = technicalScene;
+	}
+
+	public String getBreakthrough() {
+		return breakthrough;
+	}
+
+	public void setBreakthrough(String breakthrough) {
+		this.breakthrough = breakthrough;
+	}
+
+	public String getPatentCase() {
+		return patentCase;
+	}
+
+	public void setPatentCase(String patentCase) {
+		this.patentCase = patentCase;
+	}
+
+	public String getAwards() {
+		return awards;
+	}
+
+	public void setAwards(String awards) {
+		this.awards = awards;
+	}
+
+	public String getTeamDes() {
+		return teamDes;
+	}
+
+	public void setTeamDes(String teamDes) {
+		this.teamDes = teamDes;
+	}
+
+	public String getParameter() {
+		return parameter;
+	}
+
+	public void setParameter(String parameter) {
+		this.parameter = parameter;
+	}
+
+	public String getTechPlanUrl() {
+		return techPlanUrl;
+	}
+
+	public void setTechPlanUrl(String techPlanUrl) {
+		this.techPlanUrl = techPlanUrl;
+	}
+
+	public String getBusinessPlanUrl() {
+		return businessPlanUrl;
+	}
+
+	public void setBusinessPlanUrl(String businessPlanUrl) {
+		this.businessPlanUrl = businessPlanUrl;
+	}
+	
+	
+}

+ 17 - 0
src/main/java/com/goafanti/portal/bo/AchievementInterestListBo.java

@@ -0,0 +1,17 @@
+package com.goafanti.portal.bo;
+
+
+public class AchievementInterestListBo extends InterestListBo{
+
+	private String	achievementId;
+
+	public String getAchievementId() {
+		return achievementId;
+	}
+
+	public void setAchievementId(String achievementId) {
+		this.achievementId = achievementId;
+	}
+
+
+}

+ 244 - 0
src/main/java/com/goafanti/portal/bo/AchievementSearchListBo.java

@@ -0,0 +1,244 @@
+package com.goafanti.portal.bo;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+import com.goafanti.common.constant.AFTConstants;
+
+public class AchievementSearchListBo {
+	private String id;
+	
+	/**
+	 * 编号
+	 */
+	private Integer serialNumber;
+	
+	/**
+	 * 关键词
+	 */
+	private String keyword;
+	
+	/**
+	 * 成果
+	 */
+	private String name;
+	
+	/**
+	 * 数据类别 (0--成果, 1--技术, 2--项目)
+	 */
+	private Integer dataCategory;
+	
+	/**
+	 * 类型(0--专利, 2--软著, 3--项目, 4--版权, 5--工业设计, 6--配方, 7--非标)
+	 */
+	private Integer category;
+	
+	/**
+	 * 所有人名称(个人)
+	 */
+	private String username;
+	
+	/**
+	 * 所有人名称(组织)
+	 */
+	private String unitName;
+	
+	/**
+	 * 发布时间
+	 */
+	private Date releaseDate;
+	
+	/**
+	 * 所有人类型(0--个人,1--组织)
+	 */
+	private Integer ownerType;
+	
+	/**
+	 * 行业分类A
+	 */
+	private Integer fieldA;
+	
+	/**
+	 * 行业分类B
+	 */
+	private Integer fieldB;
+	
+	/**
+	 * 交易价格
+	 */
+	private BigDecimal transferPrice;
+	
+	/**
+	 * 成熟度(1--正在研发, 2-- 已有样品, 3-- 通过小试, 4-- 通过中试, 5-- 可以量产)
+	 */
+	private Integer maturity;
+	
+	/**
+	 * 交易方式(转让方式(0--完全转让,1--许可转让,2--技术入股))
+	 */
+	private Integer transferMode;
+	
+	/**
+	 * 议价方式(0--面议,1--定价)
+	 */
+	private Integer bargainingMode;
+	
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getBargainingMode() {
+		return bargainingMode;
+	}
+
+	public void setBargainingMode(Integer bargainingMode) {
+		this.bargainingMode = bargainingMode;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public Integer getSerialNumber() {
+		return serialNumber;
+	}
+
+	public void setSerialNumber(Integer serialNumber) {
+		this.serialNumber = serialNumber;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getDataCategory() {
+		return dataCategory;
+	}
+
+	public void setDataCategory(Integer dataCategory) {
+		this.dataCategory = dataCategory;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getCategory() {
+		return category;
+	}
+
+	public void setCategory(Integer category) {
+		this.category = category;
+	}
+
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	public String getUnitName() {
+		return unitName;
+	}
+
+	public void setUnitName(String unitName) {
+		this.unitName = unitName;
+	}
+
+	public Date getReleaseDate() {
+		return releaseDate;
+	}
+
+	public void setReleaseDate(Date releaseDate) {
+		this.releaseDate = releaseDate;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getOwnerType() {
+		return ownerType;
+	}
+	
+	public void setOwnerType(Integer ownerType) {
+		this.ownerType = ownerType;
+	} 
+	
+	
+	
+	public String getKeyword() {
+		return keyword;
+	}
+
+	public void setKeyword(String keyword) {
+		this.keyword = keyword;
+	}
+	
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getFieldA() {
+		return fieldA;
+	}
+
+	public void setFieldA(Integer fieldA) {
+		this.fieldA = fieldA;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getFieldB() {
+		return fieldB;
+	}
+
+	public void setFieldB(Integer fieldB) {
+		this.fieldB = fieldB;
+	}
+
+	public BigDecimal getTransferPrice() {
+		return transferPrice;
+	}
+
+	public void setTransferPrice(BigDecimal transferPrice) {
+		this.transferPrice = transferPrice;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getMaturity() {
+		return maturity;
+	}
+
+	public void setMaturity(Integer maturity) {
+		this.maturity = maturity;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getTransferMode() {
+		return transferMode;
+	}
+
+	public void setTransferMode(Integer transferMode) {
+		this.transferMode = transferMode;
+	}
+
+	public String getReleaseDateFormattedDate() {
+		if (this.releaseDate == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getReleaseDate(), AFTConstants.YYYYMMDD);
+		}
+	}
+
+	public void setReleaseDateFormattedDate(String releaseDateFormattedDate) {
+
+	}
+	
+	
+
+}

+ 29 - 0
src/main/java/com/goafanti/portal/bo/DemandInterestListBo.java

@@ -0,0 +1,29 @@
+package com.goafanti.portal.bo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+
+public class DemandInterestListBo extends InterestListBo {
+
+	private String	demandId;
+
+	private Integer	status;
+
+	public String getDemandId() {
+		return demandId;
+	}
+
+	public void setDemandId(String demandId) {
+		this.demandId = demandId;
+	}
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getStatus() {
+		return status;
+	}
+
+	public void setStatus(Integer status) {
+		this.status = status;
+	}
+
+}

+ 153 - 0
src/main/java/com/goafanti/portal/bo/DemandSearchDetailBo.java

@@ -0,0 +1,153 @@
+package com.goafanti.portal.bo;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.goafanti.common.constant.AFTConstants;
+
+public class DemandSearchDetailBo extends DemandSearchListBo{
+	/**
+	 * 技术指标要求
+	 */
+	private String technicalRequirements;
+	
+	/**
+	 * 需求文件--图片URL
+	 */
+	private String pictureUrl;
+	
+	/**
+	 * 需求文件--文本文件
+	 */
+	private String textFileUrl;
+	
+	/**
+	 * 需求文件--视屏文件URL
+	 */
+	private String videoUrl;
+	
+	/**
+	 * 固定周期
+	 */
+	private String fixedCycle;
+	
+	/**
+	 * 固定人数
+	 */
+	private Integer peopleNumber; 
+	
+	/**
+	 * 固定方案
+	 */
+	private String fixedScheme;
+	
+	/**
+	 * 费用托管
+	 */
+	private BigDecimal costEscrow;
+	
+	/**
+	 * 有效期限
+	 */
+	private Date validityPeriod;
+	
+	/**
+	 * 关注ID
+	 */
+	private String demandInterestId;
+	
+
+	public String getDemandInterestId() {
+		return demandInterestId;
+	}
+
+	public void setDemandInterestId(String demandInterestId) {
+		this.demandInterestId = demandInterestId;
+	}
+
+	public String getTechnicalRequirements() {
+		return technicalRequirements;
+	}
+
+	public void setTechnicalRequirements(String technicalRequirements) {
+		this.technicalRequirements = technicalRequirements;
+	}
+
+	public String getPictureUrl() {
+		return pictureUrl;
+	}
+
+	public void setPictureUrl(String pictureUrl) {
+		this.pictureUrl = pictureUrl;
+	}
+
+	public String getTextFileUrl() {
+		return textFileUrl;
+	}
+
+	public void setTextFileUrl(String textFileUrl) {
+		this.textFileUrl = textFileUrl;
+	}
+
+	public String getVideoUrl() {
+		return videoUrl;
+	}
+
+	public void setVideoUrl(String videoUrl) {
+		this.videoUrl = videoUrl;
+	}
+
+	public String getFixedCycle() {
+		return fixedCycle;
+	}
+
+	public void setFixedCycle(String fixedCycle) {
+		this.fixedCycle = fixedCycle;
+	}
+
+	public Integer getPeopleNumber() {
+		return peopleNumber;
+	}
+
+	public void setPeopleNumber(Integer peopleNumber) {
+		this.peopleNumber = peopleNumber;
+	}
+
+	public String getFixedScheme() {
+		return fixedScheme;
+	}
+
+	public void setFixedScheme(String fixedScheme) {
+		this.fixedScheme = fixedScheme;
+	}
+
+	public BigDecimal getCostEscrow() {
+		return costEscrow;
+	}
+
+	public void setCostEscrow(BigDecimal costEscrow) {
+		this.costEscrow = costEscrow;
+	}
+
+	public Date getValidityPeriod() {
+		return validityPeriod;
+	}
+
+	public void setValidityPeriod(Date validityPeriod) {
+		this.validityPeriod = validityPeriod;
+	}
+	
+	public String getValidityPeriodFormattedDate() {
+		if (this.validityPeriod == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getValidityPeriod(), AFTConstants.YYYYMMDD);
+		}
+	}
+
+	public void setValidityPeriodFormattedDate(String validityPeriodFormattedDate) {
+
+	}
+}

+ 198 - 0
src/main/java/com/goafanti/portal/bo/DemandSearchListBo.java

@@ -0,0 +1,198 @@
+package com.goafanti.portal.bo;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+import com.goafanti.common.constant.AFTConstants;
+
+public class DemandSearchListBo {
+	private String id;
+	
+	/**
+	 * 编号
+	 */
+	private Integer serialNumber;
+	
+	
+	/**
+	 * 关键词
+	 */
+	private String keyword;
+	
+	/**
+	 * 数据类别(0-个人需求,1-单位需求)
+	 */
+	private Integer dataCategory;
+	
+	/**
+	 * 名称
+	 */
+	private String name;
+	
+	/**
+	 * 行业类别下拉A
+	 */
+	private Integer industryCategoryA;
+	
+
+	/**
+	 * 行业类别下拉B
+	 */
+	private Integer industryCategoryB;
+	
+	/**
+	 * 需求类型
+	 */
+	private Integer demandType;
+	
+	/**
+	 * 预算价格
+	 */
+	private BigDecimal budgetCost;
+	
+	/**
+	 * 问题说明
+	 */
+	private String problemDes;
+	
+	/**
+	 * 发布时间
+	 */
+	private Date releaseDate;
+	
+	/**
+	 * 个人雇主名称
+	 */
+	private String username;
+	
+	/**
+	 * 组织雇主名称
+	 */
+	private String unitName;
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+	
+	public String getKeyword() {
+		return keyword;
+	}
+
+	public void setKeyword(String keyword) {
+		this.keyword = keyword;
+	}
+
+	public Integer getSerialNumber() {
+		return serialNumber;
+	}
+
+	public void setSerialNumber(Integer serialNumber) {
+		this.serialNumber = serialNumber;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getDataCategory() {
+		return dataCategory;
+	}
+
+	public void setDataCategory(Integer dataCategory) {
+		this.dataCategory = dataCategory;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getIndustryCategoryA() {
+		return industryCategoryA;
+	}
+
+	public void setIndustryCategoryA(Integer industryCategoryA) {
+		this.industryCategoryA = industryCategoryA;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getIndustryCategoryB() {
+		return industryCategoryB;
+	}
+
+	public void setIndustryCategoryB(Integer industryCategoryB) {
+		this.industryCategoryB = industryCategoryB;
+	}
+	
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getDemandType() {
+		return demandType;
+	}
+
+	public void setDemandType(Integer demandType) {
+		this.demandType = demandType;
+	}
+
+	public BigDecimal getBudgetCost() {
+		return budgetCost;
+	}
+
+	public void setBudgetCost(BigDecimal budgetCost) {
+		this.budgetCost = budgetCost;
+	}
+
+	public String getProblemDes() {
+		return problemDes;
+	}
+
+	public void setProblemDes(String problemDes) {
+		this.problemDes = problemDes;
+	}
+
+	public Date getReleaseDate() {
+		return releaseDate;
+	}
+
+	public void setReleaseDate(Date releaseDate) {
+		this.releaseDate = releaseDate;
+	}
+	
+	public String getUsername() {
+		return username;
+	}
+
+	public void setUsername(String username) {
+		this.username = username;
+	}
+
+	public String getUnitName() {
+		return unitName;
+	}
+
+	public void setUnitName(String unitName) {
+		this.unitName = unitName;
+	}
+
+	public String getReleaseDateFormattedDate() {
+		if (this.releaseDate == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getReleaseDate(), AFTConstants.YYYYMMDD);
+		}
+	}
+
+	public void setReleaseDateFormattedDate(String releaseDateFormattedDate) {
+
+	}
+	
+	
+}

+ 96 - 0
src/main/java/com/goafanti/portal/bo/InterestListBo.java

@@ -0,0 +1,96 @@
+package com.goafanti.portal.bo;
+
+import java.util.Date;
+
+import org.apache.commons.lang3.time.DateFormatUtils;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonFormat.Shape;
+import com.goafanti.common.constant.AFTConstants;
+
+public class InterestListBo {
+	private String	id;
+
+	private Date	createTime;
+
+	private String	name;
+
+	private Integer	serialNumber;
+
+	private Integer	deletedSign;
+
+	private Integer	auditStatus;
+
+	private String	keyword;
+	
+	public String getKeyword() {
+		return keyword;
+	}
+
+	public void setKeyword(String keyword) {
+		this.keyword = keyword;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public Date getCreateTime() {
+		return createTime;
+	}
+
+	public void setCreateTime(Date createTime) {
+		this.createTime = createTime;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public Integer getSerialNumber() {
+		return serialNumber;
+	}
+
+	public void setSerialNumber(Integer serialNumber) {
+		this.serialNumber = serialNumber;
+	}
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getDeletedSign() {
+		return deletedSign;
+	}
+
+	public void setDeletedSign(Integer deletedSign) {
+		this.deletedSign = deletedSign;
+	}
+
+	@JsonFormat(shape = Shape.STRING)
+	public Integer getAuditStatus() {
+		return auditStatus;
+	}
+
+	public void setAuditStatus(Integer auditStatus) {
+		this.auditStatus = auditStatus;
+	}
+
+	public String getCreateTimeFormattedDate() {
+		if (this.createTime == null) {
+			return null;
+		} else {
+			return DateFormatUtils.format(this.getCreateTime(), AFTConstants.YYYYMMDD);
+		}
+	}
+
+	public void setCreateTimeFormattedDate(String createTimeFormattedDate) {
+
+	}
+
+}

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

@@ -0,0 +1,192 @@
+package com.goafanti.portal.controller;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.achievement.service.AchievementInterestService;
+import com.goafanti.achievement.service.AchievementService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.AchievementAuditStatus;
+import com.goafanti.common.enums.AchievementReleaseStatus;
+import com.goafanti.common.enums.DeleteStatus;
+import com.goafanti.common.enums.DemandAuditStatus;
+import com.goafanti.common.enums.DemandReleaseStatus;
+import com.goafanti.common.model.Achievement;
+import com.goafanti.common.model.AchievementInterest;
+import com.goafanti.common.model.Demand;
+import com.goafanti.common.model.DemandInterest;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.demand.service.DemandInterestService;
+import com.goafanti.demand.service.DemandService;
+
+@RestController
+@RequestMapping(value = "/api/user/portal")
+public class PortalInterestApiController extends CertifyApiController{
+	@Resource
+	private AchievementService			achievementService;
+	@Resource
+	private DemandService				demandService;
+	@Resource
+	private AchievementInterestService	achievementInterestService;
+	@Resource
+	private DemandInterestService		demandInterestService;
+	
+	/**
+	 * 科技需求"感兴趣列表"
+	 */
+	@RequestMapping(value = "/demandInterestList", method = RequestMethod.GET)
+	public Result demandInterestList(String pageNo, String pageSize){
+		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(demandInterestService.listDemandInterest(pNo, pSize));
+		return res;
+	}
+
+	/**
+	 * 科技成果"感兴趣列表"
+	 */
+	@RequestMapping(value = "/achievementInterestList", method = RequestMethod.GET)
+	private Result achievementInterestList(String pageNo, String pageSize) {
+		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(achievementInterestService.listAchievementInterest(pNo, pSize));
+		return res;
+	}
+
+	/**
+	 * 科技需求取消关注
+	 * 
+	 */
+	@RequestMapping(value = "/demandCancelInterest", method = RequestMethod.POST)
+	public Result demandCancelInterest(String id) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
+			return res;
+		}
+		res.setData(demandInterestService.saveCancelDemandInterest(id));
+		return res;
+	}
+
+	/**
+	 * 科技需求关注
+	 */
+	@RequestMapping(value = "/demandInterest", method = RequestMethod.POST)
+	public Result demandInterest(String id) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
+			return res;
+		}
+
+		DemandInterest di = demandInterestService.selectDemandInterestByUidAndDemandId(TokenManager.getUserId(), id);
+		if (null != di) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "当前科技需求已关注!"));
+			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())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "需求ID"));
+			return res;
+		}
+		demandInterestService.saveAchievementInterest(id);
+		return res;
+	}
+
+	/**
+	 * 科技成果取消关注
+	 * 
+	 */
+	@RequestMapping(value = "/achievementCancelInterest", method = RequestMethod.POST)
+	public Result achievementCancelInterest(String id) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
+			return res;
+		}
+		res.setData(achievementInterestService.saveCancelAchievementInterest(id));
+		return res;
+	}
+
+	/**
+	 * 科技成果关注
+	 */
+	@RequestMapping(value = "/achievementInterest", method = RequestMethod.POST)
+	public Result achievementInterest(String id) {
+		Result res = new Result();
+
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "科技成果ID"));
+			return res;
+		}
+
+		AchievementInterest ai = achievementInterestService
+				.selectAchievementInterestByUidAndAchievementId(TokenManager.getUserId(), id);
+		if (null != ai) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "当前科技成果已关注!"));
+			return res;
+		}
+
+		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())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "成果ID"));
+			return res;
+		}
+		achievementInterestService.saveAchievementInterest(id);
+		return res;
+	}
+
+	
+	/**
+	 * 科技成果详情
+	 */
+	@RequestMapping(value = "/achievementDetail", method = RequestMethod.GET)
+	public Result achievementDetail(String id) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到成果ID", "成果ID"));
+			return res;
+		}
+		res.setData(achievementService.selectAchievementSearchDetail(TokenManager.getUserId(), id));
+		return res;
+	}
+
+	/**
+	 * 科技需求详情
+	 */
+	@RequestMapping(value = "/demandDetail", method = RequestMethod.GET)
+	public Result demandDetail(String id) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
+			return res;
+		}
+		res.setData(demandService.selectDemandSearchDetail(TokenManager.getUserId(), id));
+		return res;
+	}
+
+}

+ 56 - 0
src/main/java/com/goafanti/portal/controller/PortalOrderApiController.java

@@ -0,0 +1,56 @@
+package com.goafanti.portal.controller;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.constant.ErrorConstants;
+import com.goafanti.common.controller.CertifyApiController;
+import com.goafanti.common.enums.DeleteStatus;
+import com.goafanti.common.enums.DemandAuditStatus;
+import com.goafanti.common.enums.DemandReleaseStatus;
+import com.goafanti.common.model.Demand;
+import com.goafanti.common.model.DemandOrder;
+import com.goafanti.core.shiro.token.TokenManager;
+import com.goafanti.demand.service.DemandOrderService;
+import com.goafanti.demand.service.DemandService;
+
+@RestController
+@RequestMapping(value = "/api/user/portal/order")
+public class PortalOrderApiController extends CertifyApiController {
+	@Resource
+	private DemandOrderService	demandOrderService;
+	@Resource
+	private DemandService		demandService;
+
+	/**
+	 * "我要接单"
+	 */
+	@RequestMapping(value = "/order", method = RequestMethod.POST)
+	public Result order(String id) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到需求ID", "需求ID"));
+			return res;
+		}
+		DemandOrder demandOrder = demandOrderService.selectDemandOrderByUidAndDemandId(TokenManager.getUserId(), id);
+		if (null != demandOrder) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "当前科技需求已接单!"));
+			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())) {
+			res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "科技需求ID"));
+			return res;
+		}
+		
+		demandOrderService.saveDemandOrder(id);
+		return res;
+	}
+}

+ 11 - 0
src/main/java/com/goafanti/portal/controller/PortalQuizApiController.java

@@ -0,0 +1,11 @@
+package com.goafanti.portal.controller;
+
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.common.controller.CertifyApiController;
+@RestController
+@RequestMapping(value = "/api/user/portal/quiz")
+public class PortalQuizApiController extends CertifyApiController{
+	
+}

+ 69 - 0
src/main/java/com/goafanti/portal/controller/PortalSearchApiController.java

@@ -0,0 +1,69 @@
+package com.goafanti.portal.controller;
+
+import java.math.BigDecimal;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import com.goafanti.achievement.service.AchievementService;
+import com.goafanti.common.bo.Result;
+import com.goafanti.common.controller.BaseApiController;
+import com.goafanti.demand.service.DemandService;
+
+@RestController
+@RequestMapping(value = "/portal/search")
+public class PortalSearchApiController extends BaseApiController {
+	@Resource
+	private AchievementService			achievementService;
+	@Resource
+	private DemandService				demandService;
+
+	/**
+	 * 科技成果搜索
+	 */
+	@RequestMapping(value = "/achievementList", method = RequestMethod.GET)
+	public Result achievementSearchList(Integer bargainingMode, Integer category, Integer maturity,
+			BigDecimal transferPriceLower, BigDecimal transferPriceUpper, Integer transferMode, String keyword,
+			Integer fieldA, Integer fieldB, String pageNo, String pageSize) {
+		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(achievementService.listAchievementSearchList(bargainingMode, category, maturity, transferPriceLower,
+				transferPriceUpper, transferMode, keyword, fieldA, fieldB, pNo, pSize));
+		return res;
+	}
+
+	/**
+	 * 科技需求搜索
+	 */
+	@RequestMapping(value = "/demandList", method = RequestMethod.GET)
+	public Result demandSerarchList(String keyword, Integer industryCategoryA, Integer industryCategoryB,
+			Integer demandType, BigDecimal budgetCostLower, BigDecimal budgetCostUpper, String pageNo,
+			String pageSize) {
+		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(demandService.listDemandSearchList(keyword, industryCategoryA, industryCategoryB, demandType,
+				budgetCostLower, budgetCostUpper, pNo, pSize));
+		return res;
+	}
+
+	
+
+}

+ 10 - 0
src/main/java/com/goafanti/portal/service/PortalSearchService.java

@@ -0,0 +1,10 @@
+package com.goafanti.portal.service;
+
+import com.goafanti.core.mybatis.page.Pagination;
+import com.goafanti.portal.bo.AchievementSearchListBo;
+
+public interface PortalSearchService {
+
+	Pagination<AchievementSearchListBo> listAchievementSearchList(String keyword, Integer pNo, Integer pSize);
+
+}

+ 1 - 0
src/main/resources/shiro_base_auth.ini

@@ -11,6 +11,7 @@
 /open/**=anon
 /open/**=anon
 /favicon.ico=anon
 /favicon.ico=anon
 /static/**=anon
 /static/**=anon
+/portal/search/**=anon
 /api/admin/**=admin,permission
 /api/admin/**=admin,permission
 /api/user/**=login
 /api/user/**=login
 /admin/servicesManage/**=admin
 /admin/servicesManage/**=admin

+ 11 - 0
src/main/webapp/WEB-INF/views/portal/search/achievement.jsp

@@ -0,0 +1,11 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
+<%@ include file="../../header.jsp"%>
+<title>科技成果搜索页面</title>
+<link href="${staticHost}/portal/search/achievement.css" rel="stylesheet">
+</head>
+<body>
+	<div id="root"></div>
+	<script type="text/javascript" src="${staticHost}/portal/search/achievement.js"></script>
+</body>
+</html>

+ 11 - 0
src/main/webapp/WEB-INF/views/portal/search/demand.jsp

@@ -0,0 +1,11 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java"%>
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
+<%@ include file="../../header.jsp"%>
+<title>科技需求搜索页面</title>
+<link href="${staticHost}/portal/search/demand.css" rel="stylesheet">
+</head>
+<body>
+	<div id="root"></div>
+	<script type="text/javascript" src="${staticHost}/portal/search/demand.js"></script>
+</body>
+</html>