瀏覽代碼

APP开发赚钱模块

anderx 7 年之前
父節點
當前提交
a5e16c7ff1
共有 28 個文件被更改,包括 431 次插入72 次删除
  1. 38 0
      src/main/java/com/goafanti/achievement/bo/AchievementListBo.java
  2. 4 9
      src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java
  3. 16 20
      src/main/java/com/goafanti/app/controller/AppUserController.java
  4. 2 2
      src/main/java/com/goafanti/app/controller/OpenAppDiscoveryController.java
  5. 23 0
      src/main/java/com/goafanti/app/controller/OpenAppHomeController.java
  6. 20 3
      src/main/java/com/goafanti/business/bo/JtBusinessProjectResult.java
  7. 40 0
      src/main/java/com/goafanti/business/bo/makeMoneyCategoryListBo.java
  8. 6 0
      src/main/java/com/goafanti/business/controller/JtBusinessController.java
  9. 5 0
      src/main/java/com/goafanti/business/service/JtBusinessService.java
  10. 30 1
      src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java
  11. 1 1
      src/main/java/com/goafanti/common/dao/JtBusinessProjectMapper.java
  12. 4 0
      src/main/java/com/goafanti/common/dao/JtCommodityCommentMapper.java
  13. 2 2
      src/main/java/com/goafanti/common/enums/InterestType.java
  14. 10 14
      src/main/java/com/goafanti/common/mapper/AchievementMapper.xml
  15. 8 8
      src/main/java/com/goafanti/common/mapper/DemandMapper.xml
  16. 23 3
      src/main/java/com/goafanti/common/mapper/JtBusinessProjectMapper.xml
  17. 10 0
      src/main/java/com/goafanti/common/mapper/JtCommodityCommentMapper.xml
  18. 14 0
      src/main/java/com/goafanti/common/mapper/UserIdentityMapper.xml
  19. 24 0
      src/main/java/com/goafanti/common/model/UserIdentity.java
  20. 10 0
      src/main/java/com/goafanti/demand/bo/DemandListBo.java
  21. 2 1
      src/main/java/com/goafanti/demand/service/impl/DemandServiceImpl.java
  22. 2 2
      src/main/java/com/goafanti/order/service/impl/JtOrderServiceImpl.java
  23. 46 0
      src/main/java/com/goafanti/user/bo/CustomerAuditListBo.java
  24. 7 0
      src/main/java/com/goafanti/user/bo/ExpertUserIdentity.java
  25. 21 0
      src/main/java/com/goafanti/user/bo/InputUserIdentity.java
  26. 33 5
      src/main/java/com/goafanti/user/controller/UserApiController.java
  27. 5 0
      src/main/java/com/goafanti/user/service/UserIdentityService.java
  28. 25 1
      src/main/java/com/goafanti/user/service/impl/UserIdentityServiceImpl.java

+ 38 - 0
src/main/java/com/goafanti/achievement/bo/AchievementListBo.java

@@ -1,6 +1,44 @@
 package com.goafanti.achievement.bo;
 
 public class AchievementListBo extends InputAchievement{
+	private String countInterest;
 	
+	private String		field1;
+	
+	private String		field2;
+	
+	private String 		interested;
+
+	public String getCountInterest() {
+		return countInterest;
+	}
+
+	public void setCountInterest(String countInterest) {
+		this.countInterest = countInterest;
+	}
+
+	public String getField1() {
+		return field1;
+	}
+
+	public void setField1(String field1) {
+		this.field1 = field1;
+	}
+
+	public String getField2() {
+		return field2;
+	}
+
+	public void setField2(String field2) {
+		this.field2 = field2;
+	}
+
+	public String getInterested() {
+		return interested;
+	}
+
+	public void setInterested(String interested) {
+		this.interested = interested;
+	}
 	
 }

+ 4 - 9
src/main/java/com/goafanti/achievement/service/impl/AchievementServiceImpl.java

@@ -349,10 +349,6 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		if (null != internationalFlag) {
 			params.put("internationalFlag", internationalFlag);
 		}
-		if (!TokenManager.hasRole(AFTConstants.SUPERADMIN) && !TokenManager.hasRole(AFTConstants.AUDITORADMIN)) {
-			params.put("techBrokerId", TokenManager.getAdminId());
-		}
-		
 		return params;
 	}
 
@@ -651,7 +647,9 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 		}
 		if (null != dataCategory) {
 			params.put("dataCategory", dataCategory);
-		}																					
+		}											
+		if (null != TokenManager.getUserId()) params.put("uid", TokenManager.getUserId());
+		
 		Pagination<AchievementPartnerListBo> p=(Pagination<AchievementPartnerListBo>) findPage("findAppAchievementListByPage", "findAppAchievementCount",
 				params,pNo, pSize);
 		
@@ -680,13 +678,10 @@ public class AchievementServiceImpl extends BaseMybatisDao<AchievementMapper> im
 	public int saveAppAchievement(Achievement a, String[] keywords) {
 		a.setId(UUID.randomUUID().toString());
 		a.setDeletedSign(DeleteStatus.UNDELETE.getCode());
+		a.setInfoSources(1);
 		Calendar now = Calendar.getInstance();
 		now.set(Calendar.MILLISECOND, 0);
-		if (TokenManager.getToken() instanceof Admin) {
-			a.setTechBrokerId(TokenManager.getAdminId());
-		}
 		a.setReleaseStatus(AchievementReleaseStatus.UNRELEASE.getCode());
-
 		if (AchievementAuditStatus.SUBMIT.getCode().equals(a.getAuditStatus())) {
 			createAuditorNotice(a);
 		} else {

+ 16 - 20
src/main/java/com/goafanti/app/controller/AppUserController.java

@@ -265,7 +265,7 @@ public class AppUserController extends CertifyApiController {
 	/**
 	 * 关注功能
 	 */
-	@RequestMapping(value = "/interestAdd", method = RequestMethod.GET)
+	@RequestMapping(value = "/interestAdd", method = RequestMethod.POST)
 	public Result Addinterest( Integer type,String objectId,String interest) {
 		Result res = new Result();
 		if (null==type) {
@@ -412,11 +412,6 @@ public class AppUserController extends CertifyApiController {
             res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
             return res;
         }
-        
-        if (null == ia.getCooperationMode()) {
-            res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到合作方式", "合作方式"));
-            return res;
-        }
         for (int i = 0; i < keywords.length; i++) {
             if (AFTConstants.KEYWORDLENTH < keywords[i].length()) {
                 res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", "关键词长度"));
@@ -434,23 +429,24 @@ public class AppUserController extends CertifyApiController {
 			String keyword1,String keyword2,String keyword3,
 			String validityPeriodFormattedDate) {
 		Result res = new Result();
-		 /*String[] keywords ;
-	       if (StringUtils.isNotEmpty(keyword3)) {
-	        	keywords=new String[]{keyword1,keyword2}; 
-	        }else if (StringUtils.isNotEmpty(keyword2)) {
-	        	keywords=new String[]{keyword1};
-	        }else {
-	        	keywords=new String[]{keyword1,keyword2,keyword3};
+		 List<String> keyword=new ArrayList<>();
+	        if (!StringUtils.isBlank(keyword1)) {
+	        	keyword.add(keyword1);
+			}
+	        if (!StringUtils.isBlank(keyword2)) {
+	        	keyword.add(keyword2);
 			}
-	        if (null!=keywords) {
-	        	demand.setKeyword(StringUtils.join(keywords,","));
-			}*/
+	        if (!StringUtils.isBlank(keyword3)) {
+	        	keyword.add(keyword3);
+			}
+	        String[] keywords = keyword.toArray(new String[keyword.size()]);
+	        demand.setKeyword(StringUtils.join(keywords,","));
 		if (bindingResult.hasErrors()) {
 			res.getError().add(buildErrorByMsg(bindingResult.getFieldError().getDefaultMessage(),
 					DemandFields.getFieldDesc(bindingResult.getFieldError().getField())));
 			return res;
 		}
-		res = disposeDemand(res, demand, null);
+		res = disposeDemand(res, demand, keywords);
 		if (!res.getError().isEmpty()) {
 			return res;
 		}
@@ -459,7 +455,7 @@ public class AppUserController extends CertifyApiController {
 		if (null == demand.getUrgentMoney()) {
 			d.setUrgentMoney(demand.getUrgentMoney());
 		}
-		res.setData(demandService.saveAppUserDemand(d, validityPeriodFormattedDate, null));
+		res.setData(demandService.saveAppUserDemand(d, validityPeriodFormattedDate, keywords));
 		return res;
 	}
 	
@@ -469,7 +465,7 @@ public class AppUserController extends CertifyApiController {
 			return res;
 		}
 
-		/*if (StringUtils.isBlank(demand.getKeyword())) {
+		if (StringUtils.isBlank(demand.getKeyword())) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
 			return res;
 		}
@@ -477,7 +473,7 @@ public class AppUserController extends CertifyApiController {
 		if (null == keywords || keywords.length < 1) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到关键词", "关键词"));
 			return res;
-		}*/
+		}
 
 		if (null == demand.getIndustryCategoryA()) {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "找不到行业类别", "行业类别"));

+ 2 - 2
src/main/java/com/goafanti/app/controller/OpenAppDiscoveryController.java

@@ -104,9 +104,9 @@ public class OpenAppDiscoveryController extends BaseApiController {
 	 * 专家列表
 	 */
 	@RequestMapping(value = "/expertsList", method = RequestMethod.GET)
-	public Result expertsList(String name,String industry, Integer pNo, Integer pSize) {
+	public Result expertsList(String name,String industry, Integer pageNo, Integer pageSize) {
 		Result res = new Result();
-		res.setData(userIdentityService.expertsList(name,industry,pNo,pSize));
+		res.setData(userIdentityService.appExpertsList(name,industry,pageNo,pageSize));
 		return res;
 	}
 	

+ 23 - 0
src/main/java/com/goafanti/app/controller/OpenAppHomeController.java

@@ -105,6 +105,29 @@ public class OpenAppHomeController extends BaseApiController{
 		result.setData(commentResult);
 		return result;
 	}
+	/**
+	 * 赚钱更多分类
+	 * @return
+	 */
+	@RequestMapping(value = "/categoryList" , method = RequestMethod.GET)
+	public Result categoryList() {
+		Result result=new Result();
+		result.setData(jtBusinessService.makeMoneyCategoryList());
+		return result;
+	}
+	/**
+	 * 赚钱首页推荐运用
+	 * @return
+	 */
+	@RequestMapping(value = "/recommendedApplication" , method = RequestMethod.GET)
+	public Result recommendedApplication(Integer pageNo,Integer pageSize) {
+		Result result=new Result();
+		if (null==pageNo)pageNo=1;
+		if (null==pageSize)pageSize=3;
+		result.setData(jtBusinessService.recommendedApplication(pageNo,pageSize));
+		return result;
+	}
+	
 	
 	
 }

+ 20 - 3
src/main/java/com/goafanti/business/bo/JtBusinessProjectResult.java

@@ -4,7 +4,7 @@ import java.util.List;
 
 import com.goafanti.common.model.JtBusinessProject;
 import com.goafanti.common.model.JtTag;
-
+import com.goafanti.comment.bo.CommentDetailResult;
 public class JtBusinessProjectResult extends JtBusinessProject {
 	private Integer module;
 	
@@ -13,6 +13,9 @@ public class JtBusinessProjectResult extends JtBusinessProject {
 	private String  ownerName;
 	private String interestCount;
 	private String createTimeFormat;
+	private  CommentDetailResult	CommentDetailResult;
+	private Integer interested;
+	
 	
 	public String getOwnerName() {
 		return ownerName;
@@ -71,14 +74,12 @@ public void setCompanyId(String companyId) {
 	
 	@Override
 	public String getMaxImgUrl() {
-		// TODO Auto-generated method stub
 		if(super.getMaxImgUrl()!=null && !super.getMaxImgUrl().contains("."))return null;
 		return super.getMaxImgUrl();
 	}
 	
 	@Override
 	public String getMinImgUrl() {
-		// TODO Auto-generated method stub
 		if(super.getMinImgUrl()!=null && !super.getMinImgUrl().contains("."))return null;
 		return super.getMinImgUrl();
 	}
@@ -99,6 +100,22 @@ public void setCompanyId(String companyId) {
 		this.createTimeFormat = createTimeFormat;
 	}
 
+	public CommentDetailResult getCommentDetailResult() {
+		return CommentDetailResult;
+	}
+
+	public void setCommentDetailResult(CommentDetailResult commentDetailResult) {
+		CommentDetailResult = commentDetailResult;
+	}
+
+	public Integer getInterested() {
+		return interested;
+	}
+
+	public void setInterested(Integer interested) {
+		this.interested = interested;
+	}
+
 	
 	
 }

+ 40 - 0
src/main/java/com/goafanti/business/bo/makeMoneyCategoryListBo.java

@@ -0,0 +1,40 @@
+package com.goafanti.business.bo;
+
+import java.util.List;
+
+public class makeMoneyCategoryListBo {
+		private Integer module;
+		
+		private String name;
+		
+		private List<?> list;
+		
+		public makeMoneyCategoryListBo(Integer module,String name){
+			this.module=module;
+			this.name=name;
+		}
+
+		public Integer getModule() {
+			return module;
+		}
+
+		public void setModule(Integer module) {
+			this.module = module;
+		}
+
+		public String getName() {
+			return name;
+		}
+
+		public void setName(String name) {
+			this.name = name;
+		}
+
+		public List<?> getList() {
+			return list;
+		}
+
+		public void setList(List<?> list) {
+			this.list = list;
+		}
+}

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

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

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

@@ -1,10 +1,12 @@
 package com.goafanti.business.service;
 
 import java.util.List;
+import java.util.Map;
 
 import com.goafanti.business.bo.JtBusinessCategoryBo;
 import com.goafanti.business.bo.JtBusinessCategoryTree;
 import com.goafanti.business.bo.JtBusinessProjectResult;
+import com.goafanti.business.bo.makeMoneyCategoryListBo;
 import com.goafanti.common.bo.MyCollection;
 import com.goafanti.common.model.JtBusinessCategory;
 import com.goafanti.common.model.JtBusinessProject;
@@ -29,4 +31,7 @@ public interface JtBusinessService {
 	int deleteByIdAndUid(String id);
 	Pagination<JtBusinessProject>listProjectIInterestedIn(Integer pageNo,Integer pageSize);
 	Pagination<MyCollection> myCollectionProject(Integer pageNo, Integer pageSize);
+	List<makeMoneyCategoryListBo> makeMoneyCategoryList();
+	Pagination<MyCollection> recommendedApplication(Integer pageNo, Integer pageSize);
+	
 }

+ 30 - 1
src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java

@@ -1,5 +1,6 @@
 package com.goafanti.business.service.impl;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -13,10 +14,13 @@ import org.springframework.stereotype.Service;
 import com.goafanti.business.bo.JtBusinessCategoryBo;
 import com.goafanti.business.bo.JtBusinessCategoryTree;
 import com.goafanti.business.bo.JtBusinessProjectResult;
+import com.goafanti.business.bo.makeMoneyCategoryListBo;
 import com.goafanti.business.service.JtBusinessService;
+import com.goafanti.comment.bo.CommentDetailResult;
 import com.goafanti.common.bo.MyCollection;
 import com.goafanti.common.dao.JtBusinessCategoryMapper;
 import com.goafanti.common.dao.JtBusinessProjectMapper;
+import com.goafanti.common.dao.JtCommodityCommentMapper;
 import com.goafanti.common.dao.JtTagMapper;
 import com.goafanti.common.enums.ProjectAuditStatus;
 import com.goafanti.common.model.JtBusinessCategory;
@@ -36,6 +40,8 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 	JtBusinessProjectMapper jtBusinessProjectMapper;
 	@Autowired
 	private JtTagMapper	jtTagMapper;
+	@Autowired
+	private JtCommodityCommentMapper	jtCommodityCommentMapper;
 	@Override
 	public JtBusinessCategory getBusinessCategoryByLayerAndName(Integer layer, String name) {
 		// TODO Auto-generated method stub 
@@ -56,7 +62,9 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 
 	@Override
 	public JtBusinessProjectResult getBusinessProjectDetail(String id) {
-		JtBusinessProjectResult j=jtBusinessProjectMapper.selectByPrimaryKeyWithModule(id);
+		String uid=TokenManager.getUserId();
+		JtBusinessProjectResult j=jtBusinessProjectMapper.selectByPrimaryKeyWithModule(id,uid);
+		j.setCommentDetailResult(jtCommodityCommentMapper.selectByProjectId(id));
 		j.setTags(jtTagMapper.selectProjectTag(id));
 		return j;
 	}
@@ -321,6 +329,27 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 //		params.put("uid", "1180fa62-7c42-44be-bc41-5583814d69f4");
 		return (Pagination<MyCollection>) findPage("myCollectionProjectList", "myCollectionProjectCount", params, pageNo, pageSize);
 	}
+
+	@Override
+	public List<makeMoneyCategoryListBo> makeMoneyCategoryList() {
+		List<makeMoneyCategoryListBo> l=new ArrayList<makeMoneyCategoryListBo>();
+		//所属模块 0科技服务  1知识产权服务 2高新技术企业服务 3军民融合 4科技咨询 5科技项目
+		l.add(new makeMoneyCategoryListBo(2,"高新技术企业服务"));
+		l.add(new makeMoneyCategoryListBo(3,"军民融合"));
+		l.add(new makeMoneyCategoryListBo(4,"科技咨询"));
+		l.add(new makeMoneyCategoryListBo(5,"科技项目"));
+		for (makeMoneyCategoryListBo m : l) {
+			m.setList(getCategoryBoList(m.getModule()));
+		}
+		return l;
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<MyCollection> recommendedApplication(Integer pageNo, Integer pageSize) {
+		Map<String,Object> params=new HashMap<String,Object>();
+		return (Pagination<MyCollection>) findPage("recommendedApplicationList", "recommendedApplicationCount", params, pageNo, pageSize);
+	}
 	
 	
 	

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

@@ -82,7 +82,7 @@ public interface JtBusinessProjectMapper {
   
   int deleteByIdAndUid(String id,String uid);
   
-	JtBusinessProjectResult selectByPrimaryKeyWithModule(String id);
+	JtBusinessProjectResult selectByPrimaryKeyWithModule(@Param("id")String id,@Param("uid")String uid);
   
 
      

+ 4 - 0
src/main/java/com/goafanti/common/dao/JtCommodityCommentMapper.java

@@ -1,5 +1,7 @@
 package com.goafanti.common.dao;
 
+
+import com.goafanti.comment.bo.CommentDetailResult;
 import com.goafanti.common.model.JtCommodityComment;
 import com.goafanti.common.model.JtCommodityCommentExample;
 import java.util.List;
@@ -76,4 +78,6 @@ public interface JtCommodityCommentMapper {
 	int updateByPrimaryKey(JtCommodityComment record);
 	
 	Integer getCommentCount(Integer type,String commodityId);
+
+	CommentDetailResult selectByProjectId(String id);
 }

+ 2 - 2
src/main/java/com/goafanti/common/enums/InterestType.java

@@ -9,9 +9,9 @@ public enum InterestType {
 	ACHIEVEMENT(0, "成果"),
 	DEMAND(1, "需求"),
 	EXPERTS(2, "专家"),
-	POLICY(3,"政策"),
+	PROJECT(3,"项目"),
 	UNAUDITED(4,"活动"),
-	PROJECT(5,"项目"),
+	POLICY(5,"政策"),
 	OTHER(6, "其他"),
 	COUNSELOR(7,"咨询师");
 

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

@@ -635,18 +635,17 @@
    <select id="findAppAchievementListByPage" parameterType="String" resultType="com.goafanti.achievement.bo.AchievementListBo">
   	
 	select 
-  		a.id, a.serial_number as serialNumber, a.data_category as dataCategory, a.boutique,
-  		a.name, a.keyword, a.category, a.introduction,owner_postal_address as ownerPostalAddress,
-  		a.owner_name as ownerName, a.owner_type as ownerType, a.owner_mobile as ownerMobile,a.field_a as fieldA,a.field_b ,a.field_c as fieldC,
-  		a.status, a.release_date as releaseDate, a.audit_status as auditStatus,f.name as field,f2.name as fieldB,ifnull(b.countInterest,0) as countInterest
+  		a.id,a.name, a.keyword, a.introduction,a.field_a as fieldA,a.field_b as fieldB,a.data_category as dataCategory,
+  		a.status, a.release_date as releaseDate, a.audit_status as auditStatus,a.maturity,
+		f.name as field1,f2.name as field2,ifnull(b.countInterest,0) as countInterest,if(isnull(c.achievement_id),0,1) as interested  
   	from achievement a
-  	left join (
-	select count(0)  as countInterest,achievement_id from achievement_interest group by achievement_id
-			)b on a.id = b.achievement_id 
+  	left join (select count(0)  as countInterest,achievement_id from achievement_interest 
+  		group by achievement_id)b on a.id = b.achievement_id
+	left join (select achievement_id  from achievement_interest where uid=#{uid,jdbcType=VARCHAR})c
+	on a.id=c.achievement_id
   	left join field_glossory f on a.field_a=f.id
   	left join field_glossory f2 on a.field_b=f2.id
-  	where deleted_sign = 0 
-  	and audit_status = 3
+  	where a.deleted_sign = 0 and a.audit_status = 2 and a.info_sources=1 and a.release_status=1
   	<if test="ownerId != null">
   	and a.owner_id = #{ownerId,jdbcType=VARCHAR}
   	</if>
@@ -700,11 +699,8 @@
   <select id="findAppAchievementCount" parameterType="String" resultType="java.lang.Integer">
   	select 
   		count(1)
-  	from achievement a
-  	left join field_glossory f on a.field_a=f.id
-  	left join field_glossory f2 on a.field_b=f2.id
-  	where deleted_sign = 0 
-  	and audit_status = 3
+  from achievement a
+  	where a.deleted_sign = 0 and a.audit_status = 2 and a.info_sources=1 and a.release_status=1
 	<if test="ownerId != null">
   	and a.owner_id = #{ownerId,jdbcType=VARCHAR}
   	</if>

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

@@ -544,19 +544,19 @@
 
   <select id="findAppDemandListByPage" parameterType="String" resultType="com.goafanti.demand.bo.DemandListBo">
   	select 
-	  d.id, d.serial_number as serialNumber, d.data_category as dataCategory, d.boutique,
-	  d.name, d.keyword, d.demand_type as demandType, d.industry_category_a as industryCategoryA, d.industry_category_b as industryCategoryB, d.industry_category_c as industryCategoryC,
-	  d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus, 
-	  d.release_date as releaseDate, d.employer_id as employerId, d.audit_status as auditStatus,t.city as cityname,
-	  d.urgent_money as urgentMoney,d.urgent_days as  urgentDays,d.employer_address as employerAddress,d.problem_des as problemDes,ifnull(t.countInterest,0) as countInterest,g.name as industryCategory1,g2.name as industryCategory2
+	  d.id,d.name, d.keyword, d.is_urgent as isUrgent, d.demand_type as demandType, d.industry_category_a as industryCategoryA, d.industry_category_b as industryCategoryB, 
+	  d.validity_period as validityPeriod, d.status, d.release_status as releaseStatus,d.release_date as releaseDate, d.employer_id as employerId,
+	  d.audit_status as auditStatus,d.urgent_money as urgentMoney,d.urgent_days as  urgentDays,d.problem_des as problemDes,
+	  ifnull(t.countInterest,0) as countInterest,if(isnull(y.demand_id),0,1) as interested,
+	  g.name as industryCategory1,g2.name as industryCategory2
 	from  demand d 
 	left join  user_identity t on d.employer_id=t.uid
 	left join	field_glossory g on d.industry_category_a=g.id
 	left join	field_glossory g2 on d.industry_category_b=g2.id
 	left join (select count(0)  as countInterest ,demand_id from demand_interest 
 				group by demand_id) t on d.id=t.demand_id
-	where d.deleted_sign = 0 
-	and d.audit_status=3
+	left join (select demand_id from demand_interest where uid= #{uid,jdbcType=VARCHAR}) y on d.id=y.demand_id		
+	where d.deleted_sign = 0 and d.audit_status=2 and d.info_sources=1 and d.release_status=1
 	<if test="employerId != null">
 	and d.employer_id = #{employerId, jdbcType=VARCHAR}
 	</if>
@@ -605,7 +605,7 @@
   <select id="findAppDemandCount" parameterType="String" resultType="java.lang.Integer">
   		select count(1)
 	from  demand d 
-	where d.deleted_sign = 0 
+	where d.deleted_sign = 0 and d.audit_status=2 and d.info_sources=1 and d.release_status=1
 	<if test="employerId != null">
 	and d.employer_id = #{employerId, jdbcType=VARCHAR}
 	</if>

+ 23 - 3
src/main/java/com/goafanti/common/mapper/JtBusinessProjectMapper.xml

@@ -570,12 +570,13 @@
   <select id="selectByPrimaryKeyWithModule" resultType="com.goafanti.business.bo.JtBusinessProjectResult">
     select 
         jtbp.id, jtbp.name, jtbp.category_id as categoryId, jtbp.number, jtbp.price, jtbp.activity_price as activityPrice, jtbp.member_price as memberPrice, jtbp.offset, 
-        jtbp.activity_flag as activityFlag, u.nickname as ownerName,ifnull(p.count,0) as interestCount,
+        jtbp.activity_flag as activityFlag, u.nickname as ownerName,ifnull(p.count,0) as interestCount,if(isnull(x.project_id),0,1) as interested,
     jtbp.introduce, jtbp.province, jtbp.city, jtbp.create_time as createTime, jtbp.min_img_url as minImgUrl, jtbp.max_img_url as maxImgUrl, jtbp.value, jtbp.apply_conditions as applyConditions, 
     jtbp.owner_id as ownerId, jtbp.is_hot as isHot, jtbp.audit_status as auditStatus, jtbp.audit_info as auditInfo, jtbp.release_date as releaseDate,jtbc.module as module,jtbp.advertisement
     from jt_business_project jtbp left join `user` u on jtbp.owner_id=u.id
     left join jt_business_category jtbc on jtbc.id =  jtbp.category_id
-    left join (select project_id,count(*) as count from project_interest) p on jtbp.id=p.project_id
+    left join (select project_id,count(*) as count from project_interest group by project_id) p on jtbp.id=p.project_id
+    left join (select project_id from project_interest where uid= #{uid,jdbcType=VARCHAR} ) x on jtbp.id=x.project_id
     where jtbp.id = #{id,jdbcType=VARCHAR}
   </select>
   
@@ -632,7 +633,10 @@
   </if>
   left join (select sum(commodity_quantity) as dealCount ,commodity_id from jt_order_detail group by commodity_id) dct on jtbp.id=dct.commodity_id
   where 1=1
-  <if test="module !=null">
+  <if test="module == 0">
+  and jtbc1.module !=1
+  </if>
+  <if test="module !=null and module !=1">
   and jtbc1.module=#{module,jdbcType=INTEGER}
   </if>
   <if test="secondId!=null">
@@ -771,4 +775,20 @@
   left join project_interest pi on jtbp.id=pi.project_id
   where pi.uid=#{uid,jdbcType=VARCHAR}
   </select>
+  
+   <select id="recommendedApplicationList" resultType="com.goafanti.common.bo.MyCollection">
+  select a.id,a.name,a.introduce as introduction,a.price as textA,c.nickname as ownerName
+  	from jt_business_project a
+  	left join jt_business_category b on  a.category_id=b.id
+  	left join user c on a.owner_id=c.id
+  	where b.module != 1 and a.is_hot=1
+  <if test="page_sql!=null">
+		${page_sql}
+	</if>
+  </select>
+  <select id="recommendedApplicationCount" resultType="java.lang.Integer">
+  select count(*)
+  	from jt_business_project a
+  	where b.module != 1 and a.is_hot=1
+  </select>
 </mapper>

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

@@ -354,4 +354,14 @@
   left join user u on jcc.uid=u.id
   where jcc.commodity_id=#{commodityId,jdbcType=VARCHAR}  
   </select>
+  <select id="selectByProjectId" resultType="com.goafanti.comment.bo.CommentDetailResult">
+  select jcc.create_time as createTime,
+  date_format(jcc.create_time,'%Y-%m-%d') as createTimeFormat,
+  jcc.commodity_id,
+  jcc.content,jcc.star,u.identify_name as commenter
+  from jt_commodity_comment jcc
+  left join user u on jcc.uid=u.id
+  where jcc.commodity_id=#{id,jdbcType=VARCHAR}
+  order by jcc.create_time desc limit 1
+  </select>
 </mapper>

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

@@ -1207,4 +1207,18 @@ order by
 		left join user_interest ui on ui.to_uid=u.id
 		where t.expert=1 and ui.from_uid=#{uid,jdbcType=VARCHAR}
 </select>
+<select id="selectCustomerAuditList" resultType="com.goafanti.user.bo.CustomerAuditListBo">
+	  select a.id,a.uid,a.username,c.name  as industryName 
+  ,a.expert,a.expert_audit as expertAudit from user_identity a
+  left join industry_category c on a.industry=c.id
+  where expert !=0	and expert_audit =1
+	<if test="page_sql!=null">
+        ${page_sql}
+    </if>
+</select>
+  <select id="selectCustomerAuditCount" resultType="java.lang.Integer">
+	 	select count(0) from user_identity a
+  left join industry_category c on a.industry=c.id
+  where expert !=0	and expert_audit =1
+</select>
 </mapper>

+ 24 - 0
src/main/java/com/goafanti/common/model/UserIdentity.java

@@ -3,6 +3,10 @@ package com.goafanti.common.model;
 import java.math.BigDecimal;
 import java.util.Date;
 
+import javax.validation.constraints.Size;
+
+import com.goafanti.common.constant.ErrorConstants;
+
 public class UserIdentity {
 
 	/**
@@ -214,6 +218,10 @@ public class UserIdentity {
 	private Integer expertAudit;
 	
 	private Integer releaseStatus;
+	
+	private Integer consultantType;
+	
+	private String consultantCertificateUrl;
 
 	public Integer getExpertAudit() {
 		return expertAudit;
@@ -968,4 +976,20 @@ public class UserIdentity {
 	public void setConsultationPrice(BigDecimal consultationPrice) {
 		this.consultationPrice = consultationPrice;
 	}
+
+	public Integer getConsultantType() {
+		return consultantType;
+	}
+
+	public void setConsultantType(Integer consultantType) {
+		this.consultantType = consultantType;
+	}
+
+	public String getConsultantCertificateUrl() {
+		return consultantCertificateUrl;
+	}
+
+	public void setConsultantCertificateUrl(String consultantCertificateUrl) {
+		this.consultantCertificateUrl = consultantCertificateUrl;
+	}
 }

+ 10 - 0
src/main/java/com/goafanti/demand/bo/DemandListBo.java

@@ -30,6 +30,8 @@ public class DemandListBo extends InputDemand{
 	private BigDecimal fundForCrowd;
 	private String firstPic;
 	
+	private Integer interested;
+	
 
 	public String getFirstPic() {
 		return firstPic;
@@ -150,6 +152,14 @@ public class DemandListBo extends InputDemand{
 			setFirstPic(pictureUrl.split(",")[0]);
 		}
 	}
+
+	public Integer getInterested() {
+		return interested;
+	}
+
+	public void setInterested(Integer interested) {
+		this.interested = interested;
+	}
 	
 
 	

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

@@ -721,7 +721,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			d.setKeyword("");
 		}
 		d.setCreateTime(now.getTime());
-		//disposeDemandKeyword(keywords, d, false);
+		disposeDemandKeyword(keywords, d, false);
 		return demandMapper.insert(d);
 	}
 
@@ -802,6 +802,7 @@ public class DemandServiceImpl extends BaseMybatisDao<DemandMapper> implements D
 			pSize = 10;
 			
 		}
+		if (null != TokenManager.getUserId()) params.put("uid", TokenManager.getUserId());
 		Pagination<DemandSearchListBo> p=(Pagination<DemandSearchListBo>) findPage("findAppDemandListByPage", "findAppDemandCount", params, pNo, pSize);
 		return p;
 	}

+ 2 - 2
src/main/java/com/goafanti/order/service/impl/JtOrderServiceImpl.java

@@ -56,7 +56,7 @@ public class JtOrderServiceImpl extends BaseMybatisDao<JtOrderMapper> implements
 			if(order.getPayType()==null)order.setPayType(0);
 			switch(order.getCommodityType()) {
 			case 0:{
-				JtBusinessProjectResult jtBusinessProject=JtBusinessProjectMapper.selectByPrimaryKeyWithModule(order.getCommodityId());
+				JtBusinessProjectResult jtBusinessProject=JtBusinessProjectMapper.selectByPrimaryKeyWithModule(order.getCommodityId(),null);
 				if(jtBusinessProject==null || jtBusinessProject.getModule()!=0)return -1;
 				else {
 					jtOrder.setSellerId(jtBusinessProject.getOwnerId());
@@ -69,7 +69,7 @@ public class JtOrderServiceImpl extends BaseMybatisDao<JtOrderMapper> implements
 				}
 				break;}
 			case 1:{
-				JtBusinessProjectResult jtBusinessProject=JtBusinessProjectMapper.selectByPrimaryKeyWithModule(order.getCommodityId());
+				JtBusinessProjectResult jtBusinessProject=JtBusinessProjectMapper.selectByPrimaryKeyWithModule(order.getCommodityId(),null);
 				if(jtBusinessProject==null || jtBusinessProject.getModule()!=1)return -1;
 				else {
 					jtOrder.setSellerId(jtBusinessProject.getOwnerId());

+ 46 - 0
src/main/java/com/goafanti/user/bo/CustomerAuditListBo.java

@@ -0,0 +1,46 @@
+package com.goafanti.user.bo;
+
+public class CustomerAuditListBo {
+	private String id;
+	private String uid;
+	private String username;
+	private String industryName;
+	private String expert;
+	private String expertAudit;
+	public String getUid() {
+		return uid;
+	}
+	public void setUid(String uid) {
+		this.uid = uid;
+	}
+	public String getUsername() {
+		return username;
+	}
+	public void setUsername(String username) {
+		this.username = username;
+	}
+	public String getIndustryName() {
+		return industryName;
+	}
+	public void setIndustryName(String industryName) {
+		this.industryName = industryName;
+	}
+	public String getExpert() {
+		return expert;
+	}
+	public void setExpert(String expert) {
+		this.expert = expert;
+	}
+	public String getExpertAudit() {
+		return expertAudit;
+	}
+	public void setExpertAudit(String expertAudit) {
+		this.expertAudit = expertAudit;
+	}
+	public String getId() {
+		return id;
+	}
+	public void setId(String id) {
+		this.id = id;
+	}
+}

+ 7 - 0
src/main/java/com/goafanti/user/bo/ExpertUserIdentity.java

@@ -5,6 +5,7 @@ String graduateSchool;
 String majorCategory;
 String qualification;
 String professionalTitle;
+private Integer AuthenticationType;
 public String getGraduateSchool() {
 	return graduateSchool;
 }
@@ -29,5 +30,11 @@ public String getProfessionalTitle() {
 public void setProfessionalTitle(String professionalTitle) {
 	this.professionalTitle = professionalTitle;
 }
+public Integer getAuthenticationType() {
+	return AuthenticationType;
+}
+public void setAuthenticationType(Integer authenticationType) {
+	AuthenticationType = authenticationType;
+}
 
 }

+ 21 - 0
src/main/java/com/goafanti/user/bo/InputUserIdentity.java

@@ -115,7 +115,28 @@ public class InputUserIdentity {
 	private Integer authentication;
 	
 	String workUnit;
+	@Size(min = 0, max = 1, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private Integer consultantType;
+	@Size(min = 0, max = 128, message = "{" + ErrorConstants.PARAM_SIZE_ERROR + "}")
+	private String consultantCertificateUrl;
+	
 	
+	public String getConsultantCertificateUrl() {
+		return consultantCertificateUrl;
+	}
+
+	public void setConsultantCertificateUrl(String consultantCertificateUrl) {
+		this.consultantCertificateUrl = consultantCertificateUrl;
+	}
+
+	public Integer getConsultantType() {
+		return consultantType;
+	}
+
+	public void setConsultantType(Integer consultantType) {
+		this.consultantType = consultantType;
+	}
+
 	public String getWorkUnit() {
 		return workUnit;
 	}

+ 33 - 5
src/main/java/com/goafanti/user/controller/UserApiController.java

@@ -63,7 +63,7 @@ import com.goafanti.user.service.UserIdentityService;
 import com.goafanti.user.service.UserService;
 
 @RestController
-@RequestMapping(value = "/api/user")
+@RequestMapping(value = "/open/api/user")
 public class UserApiController extends BaseApiController {
 	@Resource
 	private UserService						userService;
@@ -442,7 +442,7 @@ public class UserApiController extends BaseApiController {
 	}
 	
 	/**
-	 * 更新专家信息
+	 * 更新个人信息
 	 * 
 	 * @param userIdentity
 	 * @param bindingResult
@@ -467,13 +467,19 @@ public class UserApiController extends BaseApiController {
 		if (res.getError().isEmpty()) {
 			UserIdentity ui = new UserIdentity();
 			User user = new User();
-			userIdentity.setExpert(1);//直接变为专家
 			BeanUtils.copyProperties(userIdentity, ui);
 			BeanUtils.copyProperties(userIdentity, user);
-			ui.setExpertAudit(2);//直接审核通过
 			UserIdentity u = userIdentityService.selectUserIdentityByUserId(TokenManager.getUserId());
-			if (null == u) {
+			if (null == u&&userIdentity.getAuthenticationType()==0) {
 				ui.setId(UUID.randomUUID().toString());
+				ui.setExpert(1);//直接变为专家
+				ui.setExpertAudit(1);//提交审核
+				ui.setUid(TokenManager.getUserId());
+				userIdentityService.insert(ui);
+			}else if (null == u&&userIdentity.getAuthenticationType()==1) {
+				ui.setId(UUID.randomUUID().toString());
+				ui.setExpert(2);//直接变为专家
+				ui.setExpertAudit(1);//提交审核
 				ui.setUid(TokenManager.getUserId());
 				userIdentityService.insert(ui);
 			} else {
@@ -482,6 +488,7 @@ public class UserApiController extends BaseApiController {
 			}
 			user.setId(TokenManager.getUserId());
 			userService.updateByPrimaryKeySelective(user);
+			
 		}
 		res.setData(userIdentity);
 		return res;
@@ -891,4 +898,25 @@ public class UserApiController extends BaseApiController {
 		}
 		return res;
 	}
+	/**
+	 *	顾问专家审核列表 
+	 * @return
+	 */
+	@RequestMapping(value = "/customerAuditList", method = RequestMethod.GET)
+	public Result customerAuditList(String name,String type,String identity, Integer pageNo,Integer pageSize) {
+		Result res = new Result();
+		res.setData(userIdentityService.selectCustomerAuditList(name,type,identity,pageNo,pageSize));
+		return res;
+	}
+	/**
+	 *	顾问专家审核 
+	 * @return
+	 */
+	@RequestMapping(value = "/customerAudit", method = RequestMethod.GET)
+	public Result customerAudit(String id) {
+		Result res = new Result();
+		//res.setData(userIdentityService.selectCustomerAuditList(name,type,identity,pageNo,pageSize));
+		return res;
+	}
+
 }

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

@@ -10,6 +10,7 @@ import com.goafanti.core.mybatis.page.Pagination;
 import com.goafanti.portal.bo.UserSubscriberListBo;
 import com.goafanti.user.bo.Advertisings;
 import com.goafanti.user.bo.AuditorUserIdentityDetailBo;
+import com.goafanti.user.bo.CustomerAuditListBo;
 import com.goafanti.user.bo.MyInterestedBo;
 import com.goafanti.user.bo.UserIdentityBo;
 import com.goafanti.user.bo.UserIdentityDetailAdminBo;
@@ -70,4 +71,8 @@ public interface UserIdentityService {
 
 	Pagination<MyInterestedBo> appMyInterestedExpert(Integer pageNo, Integer pageSize);
 
+	Pagination<CustomerAuditListBo> selectCustomerAuditList(String name, String type, String identity, Integer pageNo, Integer pageSize);
+
+	Pagination<UserIdentityBo> appExpertsList(String name, String industry, Integer pageNo, Integer pageSize);
+
 }

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

@@ -15,7 +15,6 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.stereotype.Service;
 
-
 import com.goafanti.app.bo.consultantListBo;
 import com.goafanti.common.bo.ReletivelyIndustry;
 import com.goafanti.common.bo.Result;
@@ -43,6 +42,7 @@ import com.goafanti.core.shiro.token.TokenManager;
 import com.goafanti.portal.bo.UserSubscriberListBo;
 import com.goafanti.user.bo.Advertisings;
 import com.goafanti.user.bo.AuditorUserIdentityDetailBo;
+import com.goafanti.user.bo.CustomerAuditListBo;
 import com.goafanti.user.bo.MyInterestedBo;
 import com.goafanti.user.bo.UserIdentityBo;
 import com.goafanti.user.bo.UserIdentityDetailAdminBo;
@@ -494,6 +494,30 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 //		 params.put("uid", "1180fa62-7c42-44be-bc41-5583814d69f4");
 		return (Pagination<MyInterestedBo>) findPage("appMyInterestedExpertList", "appMyInterestedExpertCount", params, pageNo, pageSize);
 	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<CustomerAuditListBo> selectCustomerAuditList(String name, String type, String identity,
+			Integer pageNo, Integer pageSize) {
+		if(pageNo==null || pageNo<1)pageNo=1;
+		if(pageSize==null ||pageSize<1)pageSize=10; 
+		 Map<String, Object> params=new HashMap<String,Object>();
+		if(StringUtils.isNotBlank(name))params.put("name", name);
+		if(StringUtils.isNotBlank(type))params.put("type", type);
+		if(StringUtils.isNotBlank(identity))params.put("identity", identity);
+		return (Pagination<CustomerAuditListBo>) findPage("selectCustomerAuditList", "selectCustomerAuditCount", params, pageNo, pageSize);
+	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<UserIdentityBo> appExpertsList(String name, String industry, Integer pageNo, Integer pageSize) {
+		if(pageNo==null || pageNo<1)pageNo=1;
+		if(pageSize==null ||pageSize<1)pageSize=10; 
+		 Map<String, Object> params=new HashMap<String,Object>();
+		 if(StringUtils.isNotBlank(name))params.put("name", name);
+		 if(StringUtils.isNotBlank(industry))params.put("industry", name);
+		 return (Pagination<UserIdentityBo>) findPage("selectCustomerAuditList", "selectCustomerAuditCount", params, pageNo, pageSize);
+	}
 	
 
 }