|
@@ -89,6 +89,9 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
|
|
|
@Autowired
|
|
|
private ContactsMapper contactsMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TaskMapper taskMapper;
|
|
|
+
|
|
|
@Override
|
|
|
public HttpRespMsg insertAndUpdate(Custom custom, HttpServletRequest request) {
|
|
|
HttpRespMsg msg = new HttpRespMsg();
|
|
@@ -117,7 +120,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
|
|
|
ActionLog actionLog = new ActionLog();
|
|
|
actionLog.setCode("custom");
|
|
|
actionLog.setCreatTime(new Date());
|
|
|
- actionLog.setName("创建了客户");
|
|
|
+ actionLog.setName("编辑了客户");
|
|
|
actionLog.setItemId(custom.getId());
|
|
|
actionLog.setUserId(user.getId());
|
|
|
actionLogMapper.insert(actionLog);
|
|
@@ -144,7 +147,7 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
|
|
|
ActionLog actionLog = new ActionLog();
|
|
|
actionLog.setCode("custom");
|
|
|
actionLog.setCreatTime(new Date());
|
|
|
- actionLog.setName("编辑了客户");
|
|
|
+ actionLog.setName("新建了客户");
|
|
|
actionLog.setUserId(user.getId());
|
|
|
actionLog.setItemId(custom.getId());
|
|
|
actionLogMapper.insert(actionLog);
|
|
@@ -227,16 +230,19 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
|
|
|
//商机列表
|
|
|
custom1.setBusinessOpportunitys(businessOpportunityMapper.selectList(new QueryWrapper<BusinessOpportunity>().eq("customer_id",custom1.getId())));
|
|
|
//操作记录
|
|
|
- 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());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ List<ActionLog> actionLogs = actionLogMapper.selectByInfoListCustom(custom.getId());
|
|
|
+// List<String> userIds = actionLogs.stream().map(ActionLog::getUserId).collect(Collectors.toList());
|
|
|
+// System.out.println(userIds.toString());
|
|
|
+// 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());
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+ List<Task> tasks = taskMapper.selectList(new QueryWrapper<Task>().in("custom_id", custom1.getId()));
|
|
|
+ custom1.setTasks(tasks);
|
|
|
custom1.setActionLogs(actionLogs);
|
|
|
//联系人
|
|
|
custom1.setContacts(contactsMapper.selectList((new QueryWrapper<Contacts>().eq("custom_id",custom1.getId()))));
|