|
@@ -39,6 +39,7 @@ import java.lang.reflect.InvocationTargetException;
|
|
import java.lang.reflect.Method;
|
|
import java.lang.reflect.Method;
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
@@ -226,16 +227,17 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
|
|
//商机列表
|
|
//商机列表
|
|
custom1.setBusinessOpportunitys(businessOpportunityMapper.selectList(new QueryWrapper<BusinessOpportunity>().eq("customer_id",custom1.getId())));
|
|
custom1.setBusinessOpportunitys(businessOpportunityMapper.selectList(new QueryWrapper<BusinessOpportunity>().eq("customer_id",custom1.getId())));
|
|
//操作记录
|
|
//操作记录
|
|
- custom1.setActionLogs(actionLogMapper.selectList(new QueryWrapper<ActionLog>().eq("code","custom").eq("item_id",custom1.getId())));
|
|
|
|
-// List<CustomItemContacts> contacts = customItemContactsMapper.selectList(new QueryWrapper<CustomItemContacts>().eq("contacts_id", custom1.getId()));
|
|
|
|
-// List<Integer> ids = new ArrayList<>();
|
|
|
|
-// for (CustomItemContacts contact : contacts) {
|
|
|
|
-// ids.add(contact.getCustomId());
|
|
|
|
-// }
|
|
|
|
-// if (ids.size() > 0){
|
|
|
|
-// List<Contacts> cs = contactsMapper.selectListByIds(ids);
|
|
|
|
-// custom1.setContactsList(cs);
|
|
|
|
-// }
|
|
|
|
|
|
+ List<ActionLog> actionLogs = actionLogMapper.selectList(new QueryWrapper<ActionLog>().eq("code", "custom").eq("item_id", custom1.getId()));
|
|
|
|
+ List<String> userIds = actionLogs.stream().map(ActionLog::getUserId).collect(Collectors.toList());
|
|
|
|
+ List<User> ids = userMapper.selectList(new QueryWrapper<User>().in("id", userIds));
|
|
|
|
+ for (ActionLog actionLog : actionLogs) {
|
|
|
|
+ for (User id : ids) {
|
|
|
|
+ if(actionLog.getUserId().equals(id)){
|
|
|
|
+ actionLog.setUserName(id.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ custom1.setActionLogs(actionLogs);
|
|
//联系人
|
|
//联系人
|
|
custom1.setContacts(contactsMapper.selectList((new QueryWrapper<Contacts>().eq("custom_id",custom1.getId()))));
|
|
custom1.setContacts(contactsMapper.selectList((new QueryWrapper<Contacts>().eq("custom_id",custom1.getId()))));
|
|
//订单
|
|
//订单
|