Commit a1741649 by 阳浪

4.21bug优化

parent b6700978
...@@ -9,6 +9,7 @@ import com.yizhi.core.application.context.ContextHolder; ...@@ -9,6 +9,7 @@ import com.yizhi.core.application.context.ContextHolder;
import com.yizhi.core.application.context.RequestContext; import com.yizhi.core.application.context.RequestContext;
import com.yizhi.system.application.system.remote.AccountClient; import com.yizhi.system.application.system.remote.AccountClient;
import com.yizhi.system.application.vo.AccountVO; import com.yizhi.system.application.vo.AccountVO;
import com.yizhi.training.application.constant.ProjectConstant;
import com.yizhi.training.application.domain.TpComment; import com.yizhi.training.application.domain.TpComment;
import com.yizhi.training.application.domain.TpCommentReply; import com.yizhi.training.application.domain.TpCommentReply;
import com.yizhi.training.application.service.ITpCommentReplyService; import com.yizhi.training.application.service.ITpCommentReplyService;
...@@ -72,8 +73,9 @@ public class TpCommentController { ...@@ -72,8 +73,9 @@ public class TpCommentController {
// tpComment.setContent(StringEscapeUtils.escapeJava(tpComment.getContent())); // tpComment.setContent(StringEscapeUtils.escapeJava(tpComment.getContent()));
TpComment tp=new TpComment(); TpComment tp=new TpComment();
if(Objects.equals(tpComment.getBizType(),2)){ if(Objects.equals(tpComment.getBizType(),2)){
tpComment.setAuditStatus("1"); tpComment.setState(1);
} }
tpComment.setAuditStatus(ProjectConstant.COMMENT_AUDIT_STATUS_UP.toString());
BeanUtils.copyProperties(tpComment,tp); BeanUtils.copyProperties(tpComment,tp);
Boolean f = iTpCommentService.insert(tp); Boolean f = iTpCommentService.insert(tp);
return f; return f;
...@@ -105,14 +107,15 @@ public class TpCommentController { ...@@ -105,14 +107,15 @@ public class TpCommentController {
} }
List<Long> ids = page.getRecords().stream().map(PageCommentVo::getId).collect(Collectors.toList()); List<Long> ids = page.getRecords().stream().map(PageCommentVo::getId).collect(Collectors.toList());
TpCommentReply reply = new TpCommentReply(); TpCommentReply reply = new TpCommentReply();
if (type != 0) {
reply.setState(0);
}
reply.setAuditStatus("0"); reply.setAuditStatus("0");
EntityWrapper<TpCommentReply> wrapper = new EntityWrapper<TpCommentReply>(reply); EntityWrapper<TpCommentReply> wrapper = new EntityWrapper<TpCommentReply>(reply);
List<String> list = new ArrayList<String>(); List<String> list = new ArrayList<String>();
list.add("createTime"); list.add("createTime");
wrapper.in("tp_comment_id",ids); wrapper.in("tp_comment_id",ids);
if (type != 0) {
reply.setState(0);
wrapper.and("state = {0} or create_by_id = {1}",0,ContextHolder.get().getAccountId());
}
wrapper.orderDesc(list); wrapper.orderDesc(list);
List<TpCommentReply> replies = iTpCommentReplyService.selectList(wrapper); List<TpCommentReply> replies = iTpCommentReplyService.selectList(wrapper);
......
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
AND c.biz_type=#{bizType} AND c.biz_type=#{bizType}
</if> </if>
<if test="type != 0 "> <if test="type != 0 ">
and c.state=0 and (c.state=0 or c.`create_by_id` = #{accountId})
</if> </if>
GROUP BY GROUP BY
c.`id` c.`id`
...@@ -203,7 +203,7 @@ ...@@ -203,7 +203,7 @@
AND c.biz_type=#{bizType} AND c.biz_type=#{bizType}
</if> </if>
<if test="type != 0 "> <if test="type != 0 ">
and c.state=0 and (c.state=0 or c.`create_by_id` = #{accountId})
</if> </if>
GROUP BY GROUP BY
c.`id` c.`id`
......
...@@ -165,7 +165,20 @@ ...@@ -165,7 +165,20 @@
</if> </if>
</where> </where>
GROUP BY tp.id GROUP BY tp.id,
tp.id,
tp.`logo_img`,
tp.`name`,
tp.`start_time`,
tp.`end_time`,
tp.status,
tp.visible_range,
tp.enable_enroll,
tp.enable_sign,
tp.enable_queue,
enroll.actual_price,
enroll.original_price,
enroll.enable_pay
ORDER BY tp.`create_time` DESC ORDER BY tp.`create_time` DESC
</select> </select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment