Преглед на файлове

修改顾问、专家评论列表

anderx преди 7 години
родител
ревизия
93dc322ece

+ 0 - 1
bin

@@ -1 +0,0 @@
-Subproject commit 43cffb74e64a8ccdb83fba0b0b466530eef6eaf4

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

@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RestController;
 import com.goafanti.achievement.service.AchievementInterestService;
 import com.goafanti.achievement.service.AchievementService;
 import com.goafanti.banners.service.BannersService;
+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 +30,8 @@ public class OpenAppUserController extends BaseApiController {
 	@Resource
 	private MessageService messageService;
 	@Resource
+	private CommentService 	commentService;
+	@Resource
 	private EasemobUtils   easemobUtils;
 	@Resource
 	private BannersService		bannersService;
@@ -77,7 +80,7 @@ public class OpenAppUserController extends BaseApiController {
 	}
 	
 	/**
-	 * 专家详情
+	 * 专家、顾问详情
 	 */
 	@RequestMapping(value = "/expertsDetail", method = RequestMethod.GET)
 	public Result expertsDetail(String id ) {
@@ -90,6 +93,20 @@ 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;
+		}
+		res.setData(commentService.selectExpertsComment(id, pageNo, pageSize));
+		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);
+	}
 	
 	
 	

+ 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>