|
@@ -1,8 +1,12 @@
|
|
package com.management.platform.controller;
|
|
package com.management.platform.controller;
|
|
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.management.platform.entity.Contacts;
|
|
import com.management.platform.entity.Contacts;
|
|
import com.management.platform.entity.Custom;
|
|
import com.management.platform.entity.Custom;
|
|
|
|
+import com.management.platform.entity.User;
|
|
|
|
+import com.management.platform.mapper.ContactsMapper;
|
|
|
|
+import com.management.platform.mapper.UserMapper;
|
|
import com.management.platform.service.ContactsService;
|
|
import com.management.platform.service.ContactsService;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
import com.management.platform.util.HttpRespMsg;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -35,6 +39,12 @@ public class ContactsController {
|
|
@Autowired
|
|
@Autowired
|
|
private ContactsService contactsService;
|
|
private ContactsService contactsService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private UserMapper userMapper;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private ContactsMapper contactsMapper;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 添加联系人
|
|
* 添加联系人
|
|
* @param contacts
|
|
* @param contacts
|
|
@@ -139,6 +149,16 @@ public class ContactsController {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ @RequestMapping("allContacts")
|
|
|
|
+ public HttpRespMsg allContacts(HttpServletRequest request){
|
|
|
|
+ User user = userMapper.selectById(request.getHeader("Token"));
|
|
|
|
+ HttpRespMsg msg = new HttpRespMsg();
|
|
|
|
+ msg.setMsg("操作成功");
|
|
|
|
+ msg.setData(
|
|
|
|
+ contactsMapper.selectList(new QueryWrapper<Contacts>().eq("company_id", user.getCompanyId()))
|
|
|
|
+ );
|
|
|
|
+ return msg;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|