|
|
@@ -13,8 +13,10 @@ import com.goafanti.comment.bo.CommentDetailResult;
|
|
|
import com.goafanti.comment.bo.CommentInput;
|
|
|
import com.goafanti.comment.service.CommentService;
|
|
|
import com.goafanti.common.dao.JtCommodityCommentMapper;
|
|
|
+import com.goafanti.common.dao.JtConsultOrderMapper;
|
|
|
import com.goafanti.common.dao.JtOrderMapper;
|
|
|
import com.goafanti.common.model.JtCommodityComment;
|
|
|
+import com.goafanti.common.model.JtConsultOrder;
|
|
|
import com.goafanti.common.model.JtOrder;
|
|
|
import com.goafanti.core.mybatis.BaseMybatisDao;
|
|
|
import com.goafanti.core.mybatis.page.Pagination;
|
|
|
@@ -25,6 +27,8 @@ public class CommentServiceImpl extends BaseMybatisDao<JtCommodityCommentMapper>
|
|
|
@Autowired
|
|
|
JtCommodityCommentMapper jtCommodityCommentMapper;
|
|
|
@Autowired
|
|
|
+ JtConsultOrderMapper jtConsultOrderMapper;
|
|
|
+ @Autowired
|
|
|
JtOrderMapper jtOrderMapper;
|
|
|
|
|
|
@Override
|
|
|
@@ -33,8 +37,18 @@ public class CommentServiceImpl extends BaseMybatisDao<JtCommodityCommentMapper>
|
|
|
String id=UUID.randomUUID().toString();
|
|
|
String uid=TokenManager.getUserId();
|
|
|
// String uid="1180fa62-7c42-44be-bc41-5583814d69f4";
|
|
|
- JtOrder jtOrder=jtOrderMapper.selectByPrimaryKey(commentInput.getOrderNo());
|
|
|
- if(jtOrder==null || jtOrder.getBuyerId()==null || !jtOrder.getBuyerId().equals(uid))return -1;
|
|
|
+ JtOrder jtOrder= new JtOrder();
|
|
|
+
|
|
|
+ if (commentInput.getType()==0){
|
|
|
+ jtOrder=jtOrderMapper.selectByPrimaryKey(commentInput.getOrderNo());
|
|
|
+ if(jtOrder==null || jtOrder.getBuyerId()==null || !jtOrder.getBuyerId().equals(uid))return -1;
|
|
|
+ }
|
|
|
+ if (commentInput.getType()==1){
|
|
|
+ JtConsultOrder jtConsultOrder=jtConsultOrderMapper.selectByPrimaryKey(commentInput.getOrderNo());
|
|
|
+ if(jtConsultOrder==null || jtConsultOrder.getBuyerId()==null || !jtConsultOrder.getBuyerId().equals(uid))return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
JtCommodityComment jtCommodityComment=new JtCommodityComment();
|
|
|
jtCommodityComment.setCommodityId(commentInput.getCommodityId());
|
|
|
jtCommodityComment.setContent(commentInput.getContent());
|