| | |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TEvaluationAutoReply; |
| | | import com.ruoyi.order.api.model.TOrderEvaluate; |
| | | import com.ruoyi.order.api.model.TOrderEvaluateTag; |
| | | import com.ruoyi.order.api.query.TOrderEvaluateQuery; |
| | |
| | | import com.ruoyi.order.mapper.TOrderEvaluateMapper; |
| | | import com.ruoyi.order.mapper.TOrderEvaluateTagMapper; |
| | | import com.ruoyi.order.service.TChargingOrderService; |
| | | import com.ruoyi.order.service.TEvaluationAutoReplyService; |
| | | import com.ruoyi.order.service.TOrderEvaluateService; |
| | | import com.ruoyi.other.api.domain.TEvaluationTag; |
| | | import com.ruoyi.other.api.domain.TIntegralRule; |
| | |
| | | @Resource |
| | | private SysUserRoleClient sysUserRoleClient; |
| | | |
| | | @Resource |
| | | private TEvaluationAutoReplyService evaluationAutoReplyService; |
| | | |
| | | |
| | | |
| | |
| | | String content = orderEvaluate.getContent(); |
| | | if(StringUtils.isNotEmpty(content)){ |
| | | Boolean data = appUserClient.sensitiveWordDetection(content, appUser.getWxOpenid()).getData(); |
| | | if(data){ |
| | | if(Boolean.TRUE.equals(data)){ |
| | | return AjaxResult.error("评价包含违规内容,请重新评价!"); |
| | | } |
| | | } |
| | | orderEvaluate.setContent(content); |
| | | this.save(orderEvaluate); |
| | | applyAutoReply(orderEvaluate); |
| | | |
| | | List<Integer> tagIds = query.getTagIds(); |
| | | if(null != tagIds){ |
| | |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | private void applyAutoReply(TOrderEvaluate orderEvaluate) { |
| | | TEvaluationAutoReply rule = evaluationAutoReplyService.matchRule(orderEvaluate.getContent(), orderEvaluate.getMark()); |
| | | if (rule == null || StringUtils.isEmpty(rule.getReplyContent())) { |
| | | return; |
| | | } |
| | | orderEvaluate.setEvaluationResponse(rule.getReplyContent()); |
| | | orderEvaluate.setResponseTime(LocalDateTime.now()); |
| | | this.updateById(orderEvaluate); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取订单评价 |