浏览代码

专家、顾问详情、评论修改

anderx 7 年之前
父节点
当前提交
b0fb5d0ec1

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

@@ -8,7 +8,9 @@ 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;
@@ -94,7 +96,7 @@ public class OpenAppUserController extends BaseApiController {
 	}
 	
 	/**
-	 * 专家、顾问详情
+	 * 专家、顾问评价
 	 */
 	@RequestMapping(value = "/expertsComment", method = RequestMethod.GET)
 	public Result expertsComment(String id ,Integer pageNo,Integer pageSize) {
@@ -103,7 +105,14 @@ public class OpenAppUserController extends BaseApiController {
 			res.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"专家必须指定","专家"));
 			return res;
 		}
-		res.setData(commentService.selectExpertsComment(id, pageNo, pageSize));
+		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;
 	}
 	

+ 3 - 0
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,5 +109,7 @@ public interface UserIdentityMapper {
 	List<UserIdentityBo>getExperts(Integer size);
 
 	ExpertsListBo selectAppExpertsDetail(@Param("id")String id, @Param("uid")String uid);
+
+	CommentDetailResult expertsCommentByUid(String id);
     
 }

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

@@ -1234,7 +1234,7 @@ from
 	on u.id = a.to_uid left join( select to_uid from user_interest where from_uid =#{uid,jdbcType=VARCHAR} ) b
 	on u.id = b.to_uid 
 	where u.status = 0 and u.source = 1 
-	and ui.expert = 1 and ui.expert_audit=2
+	and ui.expert = 1 and ui.audit_status = 2
 	<if test="industry != null">
 	 and ui.industry= #{industry,jdbcType=VARCHAR}
 	</if>
@@ -1254,7 +1254,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 = 1 and ui.expert = 1 and ui.audit_status = 2
 	  <if test="industry != null">
 		and ui.industry= #{industry,jdbcType=VARCHAR}
 	</if>
@@ -1298,7 +1298,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>
@@ -1329,7 +1329,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>
@@ -1407,4 +1407,17 @@ 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>
 </mapper>

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

@@ -548,7 +548,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")