Quellcode durchsuchen

Merge remote-tracking branch 'origin/test'

limin vor 7 Jahren
Ursprung
Commit
d1deb36f80

+ 1 - 0
.gitignore

@@ -1,3 +1,4 @@
 /target/
 /bin/
 /.classpath
+/.settings

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

@@ -812,7 +812,7 @@ public class AppUserController extends CertifyApiController {
 		return res;
 	}
 	/*
-	 * 关注列表 -专家
+	 * 关注列表 -专家 顾问
 	 * */
 	@RequestMapping(value="/appMyInterested",method=RequestMethod.GET)
 	public Result appMyInterested(Integer type,Integer pageNo,Integer pageSize) {
@@ -821,12 +821,7 @@ public class AppUserController extends CertifyApiController {
 			result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR, "", "当前用户未登陆"));
 			return result;
 		}
-		if (type==0) {
-			result.setData(userIdentityService.appMyInterestedExpert(pageNo,pageSize));
-		}else if(type==1){
-			return null;
-		}
-		//result.setData(userIdentityService.listInterestedExpert(pageNo,pageSize));
+			result.setData(userIdentityService.appMyInterestedExpert(type,pageNo,pageSize));
 		return result;
 	}
 	

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

@@ -139,7 +139,7 @@ public class OpenAppHomeController extends BaseApiController{
 		Map<String, Object> map=new HashMap<>();
 		//1 赚钱数据    2首页数据
 		map.put("recommended", jtBusinessService.recommendedApplication(1,pageNo,pageSize));
-		map.put("tag", jtTagService.selectListJtTag(null, pageNo, pageSize));
+		map.put("tag", jtTagService.selectListJtTag(null, 1, 10));
 		result.setData(map);
 		return result;
 	}

+ 27 - 1
src/main/java/com/goafanti/app/controller/OpenAppUserController.java

@@ -8,7 +8,10 @@ import org.springframework.web.bind.annotation.RestController;
 
 import com.goafanti.achievement.service.AchievementInterestService;
 import com.goafanti.achievement.service.AchievementService;
+import com.goafanti.app.bo.ExpertsListBo;
 import com.goafanti.banners.service.BannersService;
+import com.goafanti.comment.bo.CommentResult;
+import com.goafanti.comment.service.CommentService;
 import com.goafanti.common.bo.Result;
 import com.goafanti.common.constant.ErrorConstants;
 import com.goafanti.common.controller.BaseApiController;
@@ -29,6 +32,8 @@ public class OpenAppUserController extends BaseApiController {
 	@Resource
 	private MessageService messageService;
 	@Resource
+	private CommentService 	commentService;
+	@Resource
 	private EasemobUtils   easemobUtils;
 	@Resource
 	private BannersService		bannersService;
@@ -77,7 +82,7 @@ public class OpenAppUserController extends BaseApiController {
 	}
 	
 	/**
-	 * 专家详情
+	 * 专家、顾问详情
 	 */
 	@RequestMapping(value = "/expertsDetail", method = RequestMethod.GET)
 	public Result expertsDetail(String id ) {
@@ -90,6 +95,27 @@ public class OpenAppUserController extends BaseApiController {
 		return res;
 	}
 	
+	/**
+	 * 专家、顾问评价
+	 */
+	@RequestMapping(value = "/expertsComment", method = RequestMethod.GET)
+	public Result expertsComment(String id ,Integer pageNo,Integer pageSize) {
+		Result res = new Result();
+		if (StringUtils.isBlank(id)) {
+			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"专家必须指定","专家"));
+			return res;
+		}
+		CommentResult commentResult=new CommentResult();
+		ExpertsListBo e=userIdentityService.selectAppExpertsDetail( id);
+		commentResult.setNegativeCommentCount(e.getInferior());
+		commentResult.setOrdinaryCommentCount(e.getGeneral());
+		commentResult.setPositiveCommentCount(e.getFavorable());
+		commentResult.setTotalCommentCount(e.getCommentCount());
+		commentResult.setComments(commentService.selectExpertsComment(id, pageNo, pageSize));
+		res.setData(commentResult);
+		return res;
+	}
+	
 	@RequestMapping(value = "/index", method = RequestMethod.GET)
 	public Result index(){
 		Result res = new Result();

+ 2 - 0
src/main/java/com/goafanti/comment/service/CommentService.java

@@ -11,4 +11,6 @@ public interface CommentService {
 	
 	Pagination<CommentDetailResult> searchComment(String commodityId,Integer pageNo,Integer pageSize);
 
+	Pagination<CommentDetailResult> selectExpertsComment(String id,Integer pageNo,Integer pageSize);
+
 }

+ 10 - 1
src/main/java/com/goafanti/comment/service/impl/CommentServiceImpl.java

@@ -60,13 +60,22 @@ public class CommentServiceImpl extends BaseMybatisDao<JtCommodityCommentMapper>
 	@SuppressWarnings("unchecked")
 	@Override
 	public Pagination<CommentDetailResult> searchComment(String commodityId,Integer pageNo,Integer pageSize) {
-		// TODO Auto-generated method stub
 		Map<String, Object>params=new HashMap<>();
 		if(pageNo==null || pageNo<1)pageNo=1;
 		if(pageSize == null || pageSize <1)pageSize=10;
 		params.put("commodityId", commodityId);
 		return (Pagination<CommentDetailResult>) findPage("searchCommentByCommodityId", "searchCommentCountByCommodityId", params, pageNo, pageSize);
 	}
+
+	@SuppressWarnings("unchecked")
+	@Override
+	public Pagination<CommentDetailResult> selectExpertsComment(String id,Integer pageNo,Integer pageSize) {
+		Map<String, Object>params=new HashMap<>();
+		if(pageNo==null || pageNo<1)pageNo=1;
+		if(pageSize == null || pageSize <1)pageSize=10;
+		params.put("id", id);
+		return (Pagination<CommentDetailResult>) findPage("selectExpertsCommentList", "selectExpertsCommentCount", params, pageNo, pageSize);
+	}
 	
 	
 	

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

@@ -2,6 +2,7 @@ package com.goafanti.common.dao;
 
 import com.goafanti.app.bo.ExpertsListBo;
 import com.goafanti.app.bo.consultantListBo;
+import com.goafanti.comment.bo.CommentDetailResult;
 import com.goafanti.common.model.UserIdentity;
 import com.goafanti.common.model.UserIdentityExample;
 import com.goafanti.core.mybatis.page.Pagination;
@@ -108,8 +109,10 @@ public interface UserIdentityMapper {
 	List<UserIdentityBo>getExperts(Integer size);
 
 	ExpertsListBo selectAppExpertsDetail(@Param("id")String id, @Param("uid")String uid);
+
+	CommentDetailResult expertsCommentByUid(String id);
     
 	UserIdentity getUserIdentityByUid(String uid);
 	
 	Integer updateAuditing(UserIdentity identity);
-}
+}

+ 10 - 1
src/main/java/com/goafanti/common/mapper/JtBusinessProjectMapper.xml

@@ -643,6 +643,9 @@
   <if test="module == 0">
   and jtbc1.module !=1
   </if>
+  <if test="module == 1">
+  and jtbc1.module =1
+  </if>
   <if test="module !=null and module !=1">
   and jtbc1.module=#{module,jdbcType=INTEGER}
   </if>
@@ -695,7 +698,13 @@
   <if test="tag != null">
   and y.id= #{tag,jdbcType=VARCHAR}
   </if> 
-  <if test="module !=null">
+ <if test="module == 0">
+  and jtbc1.module !=1
+  </if>
+  <if test="module == 1">
+  and jtbc1.module =1
+  </if>
+  <if test="module !=null and module !=1">
   and jtbc1.module=#{module,jdbcType=INTEGER}
   </if>
 	  <if test="secondId!=null">

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

@@ -364,4 +364,25 @@
   where jcc.commodity_id=#{id,jdbcType=VARCHAR}
   order by jcc.create_time desc limit 1
   </select>
+  <select id="selectExpertsCommentList" resultType="com.goafanti.comment.bo.CommentDetailResult">
+  select a.create_time as createTime,
+  date_format(a.create_time,'%Y-%m-%d') as createTimeFormat,
+  a.commodity_id,
+  a.content,a.star,u.identify_name as commenter
+  from jt_commodity_comment a 
+  left join user u on a.uid=u.id
+  left join jt_consult_order b on a.order_no=b.order_no
+  where 1=1
+  and b.seller_id= #{id,jdbcType=VARCHAR}
+  <if test="page_sql!=null">
+	${page_sql}
+  </if>
+  </select>
+  <select id="selectExpertsCommentCount" resultType="java.lang.Integer">
+  select count(*)
+  from jt_commodity_comment a 
+  left join jt_consult_order b on a.order_no=b.order_no
+  where 1=1
+  and b.seller_id= #{id,jdbcType=VARCHAR}
+  </select>
 </mapper>

+ 3 - 0
src/main/java/com/goafanti/common/mapper/JtOrderMapper.xml

@@ -572,6 +572,9 @@ count(0)
   <if test="orderType!=null ">
   and (x.commodityType=#{orderType,jdbcType=INTEGER} or (#{orderType,jdbcType=INTEGER}=10 and (x.commodityType=1 or x.commodityType=0)))
   </if>
+  <if test="page_sql!=null">
+			${page_sql}
+	</if>
   </select>
   <select id="appSearchJtOrderListCount" resultType="java.lang.Integer">
   select count(x.commodityType) from 

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

@@ -1199,23 +1199,36 @@ order by
 		where ui.from_uid=#{uid,jdbcType=VARCHAR}
 </select>
 <select id="appMyInterestedExpertList" resultType="com.goafanti.user.bo.MyInterestedBo">
-	select t.id ,t.uid,u.identify_name as name,t.work_unit as workUnit,u.introduction,
+	select t.uid as id,u.nickname as name,t.work_unit as workUnit,u.introduction,
     t.professional_title as professionalTitle,u.head_portrait_url as imgUrl,
     if(isnull(a.count),0,a.count) as interestCount 
-	from user_identity t left JOIN `user` u on t.uid = u.id
-	left join user_interest ui on ui.to_uid=u.id
+	from user_interest ui left JOIN `user` u on ui.to_uid = u.id
+	left join user_identity t on ui.to_uid=t.uid
 	left join (select to_uid,count(*) as count from user_interest 
-		order by to_uid) a on ui.to_uid=u.id
-	where t.expert=1 and ui.from_uid=#{uid,jdbcType=VARCHAR}
+		GROUP  by to_uid)a on ui.to_uid=a.to_uid
+	where 1=1
+	<if test="type==0">
+	and t.expert=1 
+	</if>
+	<if test="type==1">
+	and t.expert=2 
+	</if>
+	and ui.from_uid=#{uid,jdbcType=VARCHAR}
 	<if test="page_sql!=null">
         ${page_sql}
     </if>
 </select>
   <select id="appMyInterestedExpertCount" resultType="java.lang.Integer">
-	 	select count(0)
-		from user_identity t left JOIN user u on t.uid = u.id
-		left join user_interest ui on ui.to_uid=u.id
-		where t.expert=1 and ui.from_uid=#{uid,jdbcType=VARCHAR}
+	 	select count(*)from user_interest ui 
+	left join user_identity t on ui.to_uid=t.uid
+	where 1=1
+	<if test="type==0">
+	and t.expert=1 
+	</if>
+	<if test="type==1">
+	and t.expert=2 
+	</if>
+	and ui.from_uid=#{uid,jdbcType=VARCHAR}
 </select>
 <select id="selectCustomerAuditList" resultType="com.goafanti.app.bo.ExpertsListBo">
 	select u.id as uid, u.nickname as username, u.head_portrait_url as personPortraitUrl,
@@ -1233,10 +1246,10 @@ from
 		a.order_no = b.order_no group by b.seller_id
 		) x on u.id = x.uid 
 	left join( select count(*) as count, to_uid from user_interest group by to_uid) a 
-	on u.id = a.to_uid left join( select to_uid from user_interest where from_uid =#{uid,jdbcType=VARCHAR} ) b
+	on u.id = a.to_uid left join( select to_uid from user_interest where from_uid =#{uid,jdbcType=VARCHAR} GROUP by to_uid) b
 	on u.id = b.to_uid 
-	where u.status = 0 and u.source = 1 
-	and ui.expert = 1 and ui.expert_audit=2
+	where u.status = 0 and u.source = 0 
+	and ui.expert = 1 and ui.audit_status = 2
 	<if test="industry != null">
 	 and ui.industry= #{industry,jdbcType=VARCHAR}
 	</if>
@@ -1256,7 +1269,7 @@ from
   <select id="selectCustomerAuditCount" resultType="java.lang.Integer">
 	 	select count(0)from
 	`user` u left join user_identity ui on ui.uid = u.id 
-	  where u.status = 0 and u.source = 1 and ui.expert = 1 and ui.expert_audit=2
+	  where u.status = 0 and u.source = 0 and ui.expert = 1 and ui.audit_status = 2
 	  <if test="industry != null">
 		and ui.industry= #{industry,jdbcType=VARCHAR}
 	</if>
@@ -1278,7 +1291,7 @@ select a.id as uid,a.nickname as username,a.head_portrait_url as personPortraitU
 			left join jt_consult_order b on a.order_no=b.order_no
 			group by b.seller_id)x on a.id=x.uid
 		left join (select count(*) as count,to_uid from  user_interest group by to_uid)c on a.id=c.to_uid
-left join (select to_uid from  user_interest where from_uid='1')d on a.id=d.to_uid
+left join (select to_uid from  user_interest where from_uid= #{uid,jdbcType=VARCHAR} group by to_uid)d on a.id=d.to_uid
 where a.id=#{id,jdbcType=VARCHAR}
 </select>
 <select id="appConsultantList" resultType="com.goafanti.app.bo.ExpertsListBo">
@@ -1300,7 +1313,7 @@ from
 	on u.id = a.to_uid left join( select to_uid from user_interest where from_uid ='1' ) b
 	on u.id = b.to_uid 
 	where u.status = 0 and u.source = 1 
-	and ui.expert = 2 and ui.expert_audit=2
+	and ui.expert = 2 and ui.audit_status=2
 	<if test="consultantType != null">
 	and ui.consultant_type=#{consultantType,jdbcType=INTEGER}
 	</if>
@@ -1331,7 +1344,7 @@ from
 from
 	`user` u left join user_identity ui on ui.uid = u.id 
 	where u.status = 0 and u.source = 1 
-	and ui.expert = 2 and ui.expert_audit=2
+	and ui.expert = 2 and ui.audit_status=2
 	<if test="consultantType != null">
 	and ui.consultant_type=#{consultantType,jdbcType=INTEGER}
 	</if>
@@ -1418,6 +1431,19 @@ from
 	inner join user_identity i on u.id = i.uid
 	where u.id = #{uid,jdbcType=VARCHAR}
 </select>
+<select id="expertsCommentByUid" resultType="com.goafanti.comment.bo.CommentDetailResult">
+select a.create_time as createTime,
+  date_format(a.create_time,'%Y-%m-%d') as createTimeFormat,
+  a.commodity_id,
+  a.content,a.star,u.identify_name as commenter
+  from jt_commodity_comment a 
+  left join user u on a.uid=u.id
+  left join jt_consult_order b on a.order_no=b.order_no
+  where 1=1
+  and b.seller_id= #{id,jdbcType=VARCHAR}
+  limit 1
+
+</select>
 
 <!-- 更改用户认证(专家/顾问审核状态) -->
 <update id="updateAuditing" parameterType="com.goafanti.common.model.UserIdentity">
@@ -1428,4 +1454,4 @@ from
 	</if>
 	where id = #{id,jdbcType=VARCHAR}
 </update>
-</mapper>
+</mapper>

+ 1 - 1
src/main/java/com/goafanti/order/service/impl/JtConsultOrderServiceImpl.java

@@ -33,7 +33,7 @@ public class JtConsultOrderServiceImpl implements JtConsultOrderService {
 			order.setOrderChannel(0);
 			order.setDeleteSign(0);
 			order.setBuyerId(TokenManager.getUserId());
-			order.setBuyerId("0549c290-5178-4886-8294-5037f1743b0c");
+//			order.setBuyerId("0549c290-5178-4886-8294-5037f1743b0c");
 			order.setOrderNo(jdbcIdGenerator.generateId()+"");
 			order.setOrderTime(new Date());
 				consultOrder.setSellerId(order.getSellerId());

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

@@ -72,7 +72,7 @@ public interface UserIdentityService {
 
 	Pagination<UserIdentityBo>listInterestedExpert(Integer pageNo,Integer pageSize);
 
-	Pagination<MyInterestedBo> appMyInterestedExpert(Integer pageNo, Integer pageSize);
+	Pagination<MyInterestedBo> appMyInterestedExpert(Integer type,Integer pageNo, Integer pageSize);
 	
 	Pagination<MyInterestedBo> getExpertAuditList(InputUserIdentity identity,Integer pageNo, Integer pageSize);
 	

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

@@ -489,11 +489,12 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 
 	@SuppressWarnings("unchecked")
 	@Override
-	public Pagination<MyInterestedBo> appMyInterestedExpert(Integer pageNo, Integer pageSize) {
+	public Pagination<MyInterestedBo> appMyInterestedExpert(Integer type,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>();
 		 params.put("uid", TokenManager.getUserId());
+		 params.put("type", type);
 //		 params.put("uid", "1180fa62-7c42-44be-bc41-5583814d69f4");
 		return (Pagination<MyInterestedBo>) findPage("appMyInterestedExpertList", "appMyInterestedExpertCount", params, pageNo, pageSize);
 	}
@@ -548,7 +549,9 @@ public class UserIdentityServiceImpl extends BaseMybatisDao<UserIdentityMapper>
 
 	@Override
 	public ExpertsListBo selectAppExpertsDetail(String id) {
-		return userIdentityMapper.selectAppExpertsDetail(id,TokenManager.getUserId());
+		ExpertsListBo expertsListBo=userIdentityMapper.selectAppExpertsDetail(id,TokenManager.getUserId());
+		expertsListBo.setCommentDetailResult(userIdentityMapper.expertsCommentByUid(id));
+		return expertsListBo;
 	}
 
 	@SuppressWarnings("unchecked")

+ 2 - 2
src/main/resources/props/config_local.properties

@@ -1,7 +1,7 @@
 #Driver
 jdbc.driverClassName=com.mysql.jdbc.Driver
 #\u6570\u636e\u5e93\u94fe\u63a5\uff0c
-jdbc.url=jdbc:mysql://192.168.1.213:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
+jdbc.url=jdbc:mysql://192.168.1.102:3306/aft?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&useSSL=false
 #\u5e10\u53f7
 jdbc.username=dev
 #\u5bc6\u7801
@@ -40,7 +40,7 @@ jdbc.filters=stat
 
 logging.level.com.goafanti=DEBUG
 
-jedis.host=192.168.1.213
+jedis.host=192.168.1.102
 jedis.port=6379
 jedis.timeout=5000
 jedis.password=aft123456