Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
324894ad
Commit
324894ad
authored
Jan 20, 2022
by
李健华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加大锤黑名单需求获取联系人
parent
639cd26e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
6 deletions
+35
-6
ContactController.java
...qb/controller/middleoffice/contact/ContactController.java
+24
-6
IContactRepository.java
...ava/cn/quantgroup/xyqb/repository/IContactRepository.java
+3
-0
IContactService.java
...java/cn/quantgroup/xyqb/service/user/IContactService.java
+3
-0
ContactServiceImpl.java
...quantgroup/xyqb/service/user/impl/ContactServiceImpl.java
+5
-0
No files found.
src/main/java/cn/quantgroup/xyqb/controller/middleoffice/contact/ContactController.java
View file @
324894ad
...
@@ -4,19 +4,17 @@ import cn.quantgroup.user.enums.BizType;
...
@@ -4,19 +4,17 @@ import cn.quantgroup.user.enums.BizType;
import
cn.quantgroup.xyqb.controller.middleoffice.contact.dto.ContactSaveDto
;
import
cn.quantgroup.xyqb.controller.middleoffice.contact.dto.ContactSaveDto
;
import
cn.quantgroup.xyqb.controller.middleoffice.contact.dto.ContactUpdateDto
;
import
cn.quantgroup.xyqb.controller.middleoffice.contact.dto.ContactUpdateDto
;
import
cn.quantgroup.xyqb.entity.Contact
;
import
cn.quantgroup.xyqb.entity.Contact
;
import
cn.quantgroup.xyqb.entity.User
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.JsonResult
;
import
cn.quantgroup.xyqb.model.Tuple
;
import
cn.quantgroup.xyqb.model.Tuple
;
import
cn.quantgroup.xyqb.service.user.IContactService
;
import
cn.quantgroup.xyqb.service.user.IContactService
;
import
cn.quantgroup.xyqb.service.user.IUserService
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
cn.quantgroup.xyqb.util.ValidationUtil
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PatchMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -30,6 +28,9 @@ public class ContactController {
...
@@ -30,6 +28,9 @@ public class ContactController {
@Resource
@Resource
private
IContactService
contactService
;
private
IContactService
contactService
;
@Resource
private
IUserService
userService
;
/**
/**
* 获取联系人
* 获取联系人
*
*
...
@@ -87,4 +88,21 @@ public class ContactController {
...
@@ -87,4 +88,21 @@ public class ContactController {
return
JsonResult
.
buildSuccessResult
();
return
JsonResult
.
buildSuccessResult
();
}
}
/**
* @需求 http://confluence.quantgroup.cn/pages/viewpage.action?pageId=61683308
* 根据用户uuid 获取联系人列表
* @param uuid
* @return
* @Yapi http://yapi.quantgroups.com/project/17/interface/api/33578
*/
@RequestMapping
(
"/getContactForUuid"
)
public
JsonResult
getContactForUuid
(
@RequestParam
String
uuid
)
{
User
user
=
userService
.
findByUuidInDb
(
uuid
);
List
<
Contact
>
contactList
=
new
ArrayList
<>();
if
(
user
!=
null
)
{
contactList
=
contactService
.
findContactForUserId
(
user
.
getId
());
}
return
JsonResult
.
buildSuccessResult
(
""
,
contactList
);
}
}
}
src/main/java/cn/quantgroup/xyqb/repository/IContactRepository.java
View file @
324894ad
...
@@ -22,4 +22,7 @@ public interface IContactRepository extends JpaRepository<Contact, Long> {
...
@@ -22,4 +22,7 @@ public interface IContactRepository extends JpaRepository<Contact, Long> {
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Query
(
value
=
"update contact set name=?1,phone_no=?2,relation=?3 where id = ?4"
,
nativeQuery
=
true
)
@Query
(
value
=
"update contact set name=?1,phone_no=?2,relation=?3 where id = ?4"
,
nativeQuery
=
true
)
void
update
(
String
name
,
String
phoneNo
,
Integer
relation
,
Long
id
);
void
update
(
String
name
,
String
phoneNo
,
Integer
relation
,
Long
id
);
@Query
(
value
=
"select *, max(`id`) as mid from contact where user_id=?1 GROUP BY phone_no ORDER BY id desc limit 2"
,
nativeQuery
=
true
)
List
<
Contact
>
findContactForUserId
(
Long
userId
);
}
}
src/main/java/cn/quantgroup/xyqb/service/user/IContactService.java
View file @
324894ad
...
@@ -3,6 +3,7 @@ package cn.quantgroup.xyqb.service.user;
...
@@ -3,6 +3,7 @@ package cn.quantgroup.xyqb.service.user;
import
cn.quantgroup.user.enums.BizType
;
import
cn.quantgroup.user.enums.BizType
;
import
cn.quantgroup.user.enums.Relation
;
import
cn.quantgroup.user.enums.Relation
;
import
cn.quantgroup.xyqb.entity.Contact
;
import
cn.quantgroup.xyqb.entity.Contact
;
import
org.springframework.data.jpa.repository.Query
;
import
java.util.List
;
import
java.util.List
;
...
@@ -41,4 +42,6 @@ public interface IContactService {
...
@@ -41,4 +42,6 @@ public interface IContactService {
void
update
(
String
name
,
String
phoneNo
,
Relation
relation
,
Long
id
);
void
update
(
String
name
,
String
phoneNo
,
Relation
relation
,
Long
id
);
void
save
(
List
<
Contact
>
contactList
);
void
save
(
List
<
Contact
>
contactList
);
List
<
Contact
>
findContactForUserId
(
Long
userId
);
}
}
src/main/java/cn/quantgroup/xyqb/service/user/impl/ContactServiceImpl.java
View file @
324894ad
...
@@ -98,6 +98,11 @@ public class ContactServiceImpl implements IContactService {
...
@@ -98,6 +98,11 @@ public class ContactServiceImpl implements IContactService {
contactRepository
.
save
(
contactList
);
contactRepository
.
save
(
contactList
);
}
}
@Override
public
List
<
Contact
>
findContactForUserId
(
Long
userId
)
{
return
contactRepository
.
findContactForUserId
(
userId
);
}
/**
/**
* 合并当前用户列表到更新列表
* 合并当前用户列表到更新列表
*
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment