|
|
@@ -8,6 +8,8 @@ import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.text.CharSequenceUtil;
|
|
|
+import cn.hutool.core.util.PhoneUtil;
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.google.common.collect.Lists;
|
|
|
@@ -63,7 +65,7 @@ public class SysCustomerDataPublicService {
|
|
|
*
|
|
|
* @return
|
|
|
*/
|
|
|
- public SysCustomerPublicSelectBO queryHeadSelectData() throws BusinessException{
|
|
|
+ public SysCustomerPublicSelectBO queryHeadSelectData() throws BusinessException {
|
|
|
// permissionService.publicPrivateCustomerPermission();
|
|
|
//返回数据对象
|
|
|
SysCustomerPublicSelectBO resultData = SysCustomerPublicSelectBO.builder().build();
|
|
|
@@ -111,18 +113,19 @@ public class SysCustomerDataPublicService {
|
|
|
* @param dto
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void adminInsertCustomerData(AdminSysCustomerDataInsertOrUpdateDTO dto) throws BusinessException{
|
|
|
+ public void adminInsertCustomerData(AdminSysCustomerDataInsertOrUpdateDTO dto) throws BusinessException {
|
|
|
permissionService.publicPrivateCustomerPermission();
|
|
|
sysCustomerDataService.adminInsert(dto);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 批量新增公海客户
|
|
|
+ *
|
|
|
* @param dtoList
|
|
|
* @throws BusinessException
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void adminInsertCustomerData(List<AdminSysCustomerDataInsertOrUpdateDTO> dtoList) throws BusinessException{
|
|
|
+ public void adminInsertCustomerData(List<AdminSysCustomerDataInsertOrUpdateDTO> dtoList) throws BusinessException {
|
|
|
permissionService.publicPrivateCustomerPermission();
|
|
|
sysCustomerDataService.importData(dtoList);
|
|
|
}
|
|
|
@@ -134,7 +137,7 @@ public class SysCustomerDataPublicService {
|
|
|
* @param dto
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void adminUpdateCustomerData(AdminSysCustomerDataInsertOrUpdateDTO dto) throws BusinessException{
|
|
|
+ public void adminUpdateCustomerData(AdminSysCustomerDataInsertOrUpdateDTO dto) throws BusinessException {
|
|
|
permissionService.publicPrivateCustomerPermission();
|
|
|
sysCustomerDataService.adminUpdate(dto);
|
|
|
}
|
|
|
@@ -145,7 +148,7 @@ public class SysCustomerDataPublicService {
|
|
|
* @param id
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void adminDeleteCustomerData(Long id) throws BusinessException{
|
|
|
+ public void adminDeleteCustomerData(Long id) throws BusinessException {
|
|
|
permissionService.publicPrivateCustomerPermission();
|
|
|
sysCustomerDataService.adminDelete(id);
|
|
|
}
|
|
|
@@ -156,7 +159,7 @@ public class SysCustomerDataPublicService {
|
|
|
* @param customerId
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void claimCustomer(Long customerId) throws BusinessException{
|
|
|
+ public void claimCustomer(Long customerId) throws BusinessException {
|
|
|
// permissionService.publicPrivateCustomerPermission();
|
|
|
sysCustomerDataService.claimCustomer(customerId);
|
|
|
}
|
|
|
@@ -169,7 +172,7 @@ public class SysCustomerDataPublicService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void adminInsertCustomerPerson(AdminSysCustomerPersonInsertOrUpdateDTO dto) throws BusinessException{
|
|
|
+ public void adminInsertCustomerPerson(AdminSysCustomerPersonInsertOrUpdateDTO dto) throws BusinessException {
|
|
|
permissionService.publicPrivateCustomerPermission();
|
|
|
sysCustomerPersonService.adminInsert(dto);
|
|
|
}
|
|
|
@@ -181,7 +184,7 @@ public class SysCustomerDataPublicService {
|
|
|
* @param dto
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void adminUpdateCustomerPerson(AdminSysCustomerPersonInsertOrUpdateDTO dto) throws BusinessException{
|
|
|
+ public void adminUpdateCustomerPerson(AdminSysCustomerPersonInsertOrUpdateDTO dto) throws BusinessException {
|
|
|
sysCustomerPersonService.adminUpdate(dto);
|
|
|
}
|
|
|
|
|
|
@@ -191,16 +194,31 @@ public class SysCustomerDataPublicService {
|
|
|
* @param id
|
|
|
*/
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public void adminDeleteCustomerPerson(Long id) throws BusinessException{
|
|
|
+ public void adminDeleteCustomerPerson(Long id) throws BusinessException {
|
|
|
sysCustomerPersonService.adminDelete(id);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 查询公海客户联系人
|
|
|
*/
|
|
|
- public List<SysCustomerPersonBO> adminListCustomerPerson(CustomerPersonReqDTO dto) throws BusinessException{
|
|
|
+ public List<SysCustomerPersonBO> adminListCustomerPerson(CustomerPersonReqDTO dto) throws BusinessException {
|
|
|
// permissionService.publicPrivateCustomerPermission();
|
|
|
- return sysCustomerPersonService.adminList(dto);
|
|
|
+ List<SysCustomerPersonBO> sysCustomerPersonBOS = sysCustomerPersonService.adminList(dto);
|
|
|
+
|
|
|
+ if (CollUtil.isNotEmpty(sysCustomerPersonBOS)) {
|
|
|
+ sysCustomerPersonBOS.forEach(bo -> {
|
|
|
+ if (!UserContextHolder.getUserContext().getRoles().contains("Admin")) {
|
|
|
+ //手机号脱敏
|
|
|
+ bo.setPhoneNo(PhoneUtil.hideBetween(bo.getPhoneNo()).toString());
|
|
|
+ if (StrUtil.isNotEmpty(bo.getOfficePhoneNo())) {
|
|
|
+ String start = bo.getOfficePhoneNo().substring(0, 2);
|
|
|
+ String end = bo.getOfficePhoneNo().substring(bo.getOfficePhoneNo().length() - 2);
|
|
|
+ bo.setOfficePhoneNo(start + "****" + end);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return sysCustomerPersonBOS;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -219,7 +237,7 @@ public class SysCustomerDataPublicService {
|
|
|
dto.setUserId(null);
|
|
|
|
|
|
detailBO.setHistoryFollowStatus(sysUserEntity.getHistoryFollowStatus() == null ? 0 : sysUserEntity.getHistoryFollowStatus());
|
|
|
- if(UserContextHolder.getUserContext().getRoles().contains("Admin")){
|
|
|
+ if (UserContextHolder.getUserContext().getRoles().contains("Admin")) {
|
|
|
detailBO.setHistoryFollowStatus(1);
|
|
|
}
|
|
|
//历史跟进总览开关
|
|
|
@@ -242,13 +260,13 @@ public class SysCustomerDataPublicService {
|
|
|
/**
|
|
|
* 操作日志列表查询
|
|
|
*/
|
|
|
- public SysCustomerOperLogDataBO queryOperLogData(AdminSysCustomerOperLogListDTO dto) throws BusinessException{
|
|
|
+ public SysCustomerOperLogDataBO queryOperLogData(AdminSysCustomerOperLogListDTO dto) throws BusinessException {
|
|
|
permissionService.publicPrivateCustomerPermission();
|
|
|
List<Long> userIds = Lists.newArrayList();
|
|
|
if (dto.getOperUserId() != null) {
|
|
|
userIds.add(dto.getOperUserId());
|
|
|
- }else {
|
|
|
- if(!UserContextHolder.getUserContext().getRoles().contains("Admin")){
|
|
|
+ } else {
|
|
|
+ if (!UserContextHolder.getUserContext().getRoles().contains("Admin")) {
|
|
|
userIds.add(UserContextHolder.getUserId());
|
|
|
}
|
|
|
}
|