|
@@ -1,12 +1,50 @@
|
|
|
package com.free.service;
|
|
|
|
|
|
+import com.free.entity.TransferApply;
|
|
|
+import com.free.entity.system.Customer;
|
|
|
+import com.free.service.system.CustomerService;
|
|
|
+import com.free.utils.Utils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.free.entity.ChatRecord;
|
|
|
import com.free.mapper.ChatRecordMapper;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
@Service
|
|
|
public class ChatRecordService extends ServiceImpl<ChatRecordMapper, ChatRecord> {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private CustomerService customerService;
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 将列表中的客服id和用户io的数据取出来
|
|
|
+ *
|
|
|
+ * @param list
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ public List<Map> getUserAndCustomerName(List<ChatRecord> list) {
|
|
|
+ List<Map> returnData = new ArrayList<>();
|
|
|
+ for (ChatRecord i : list) {
|
|
|
+ Map map = Utils.objectToMap(i);
|
|
|
+ String customer_id = i.getCustomer_id();
|
|
|
+ if (null != customer_id) {
|
|
|
+ Customer cData = customerService.getById(customer_id);
|
|
|
+ if (null != cData) {
|
|
|
+ map.put("customer_name", cData.getNick_name());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // TODO:查询用户名称
|
|
|
+ map.put("user_name", "还没有呢");
|
|
|
+
|
|
|
+ returnData.add(map);
|
|
|
+
|
|
|
+ }
|
|
|
+ return returnData;
|
|
|
+ }
|
|
|
+
|
|
|
}
|