package com.supersavedriving.user.modular.system.service.impl;
|
|
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
import com.supersavedriving.user.modular.system.dao.ComplaintMapper;
|
import com.supersavedriving.user.modular.system.model.Complaint;
|
import com.supersavedriving.user.modular.system.model.Order;
|
import com.supersavedriving.user.modular.system.service.IComplaintService;
|
import com.supersavedriving.user.modular.system.service.IOrderService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.util.Date;
|
|
/**
|
* @author zhibing.pu
|
* @date 2023/3/24 16:07
|
*/
|
@Service
|
public class ComplaintServiceImpl extends ServiceImpl<ComplaintMapper, Complaint> implements IComplaintService {
|
|
@Autowired
|
private IOrderService orderService;
|
|
|
|
|
/**
|
* 投诉反馈
|
* @param orderId
|
* @param content
|
* @throws Exception
|
*/
|
@Override
|
public void feedback(Integer uid, Integer orderId, String content) throws Exception {
|
Complaint complaint = new Complaint();
|
complaint.setUserId(uid);
|
if(null != orderId){
|
Order order = orderService.selectById(orderId);
|
complaint.setOrderId(orderId);
|
complaint.setDriverId(order.getDriverId());
|
}
|
complaint.setReason(content);
|
complaint.setState(1);
|
complaint.setStatus(1);
|
complaint.setCreateTime(new Date());
|
this.updateById(complaint);
|
}
|
}
|