|
@@ -7,7 +7,9 @@ import java.util.Map;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import com.free.entity.ChatRecord;
|
|
import com.free.entity.TransferApply;
|
|
import com.free.entity.TransferApply;
|
|
import com.free.entity.system.Customer;
|
|
import com.free.entity.system.Customer;
|
|
import com.free.mapper.TransferApplyMapper;
|
|
import com.free.mapper.TransferApplyMapper;
|
|
@@ -18,6 +20,8 @@ import com.free.utils.Utils;
|
|
public class TransferApplyService extends ServiceImpl<TransferApplyMapper, TransferApply> {
|
|
public class TransferApplyService extends ServiceImpl<TransferApplyMapper, TransferApply> {
|
|
@Autowired
|
|
@Autowired
|
|
private CustomerService customerService;
|
|
private CustomerService customerService;
|
|
|
|
+ @Autowired
|
|
|
|
+ private ChatRecordService chatRecordService;
|
|
|
|
|
|
// @Autowired
|
|
// @Autowired
|
|
// private UserService userService
|
|
// private UserService userService
|
|
@@ -47,4 +51,28 @@ public class TransferApplyService extends ServiceImpl<TransferApplyMapper, Trans
|
|
}
|
|
}
|
|
return returnData;
|
|
return returnData;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 获取每个转人工申请中聊天记录的最后一条
|
|
|
|
+ *
|
|
|
|
+ * @param list
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public List<Map> getDataLastRecord(List<Map> list) {
|
|
|
|
+ for (Map map : list) {
|
|
|
|
+ Long apply_id = Utils.getLongValue(map.get("id"));
|
|
|
|
+ QueryWrapper qw = new QueryWrapper<>();
|
|
|
|
+ qw.select("content", "time", "is_read");
|
|
|
|
+ qw.eq("apply_id", apply_id);
|
|
|
|
+ qw.orderByDesc("time");
|
|
|
|
+ Map chatRecord = chatRecordService.getMap(qw);
|
|
|
|
+ if (null == chatRecord) {
|
|
|
|
+ map.put("chatRecord", null);
|
|
|
|
+ } else {
|
|
|
|
+ map.put("chatRecord", chatRecord);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return list;
|
|
|
|
+ }
|
|
}
|
|
}
|