|
@@ -5,12 +5,15 @@ import com.fs.common.annotation.Log;
|
|
|
import com.fs.common.core.controller.BaseController;
|
|
import com.fs.common.core.controller.BaseController;
|
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
|
import com.fs.common.core.domain.R;
|
|
import com.fs.common.core.domain.R;
|
|
|
|
|
+import com.fs.common.core.domain.entity.SysDictData;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
import com.fs.common.enums.BusinessType;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
import com.fs.common.utils.ServletUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
|
|
+import com.fs.company.domain.Company;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
|
|
+import com.fs.company.service.ICompanyService;
|
|
|
import com.fs.company.service.ICompanyUserService;
|
|
import com.fs.company.service.ICompanyUserService;
|
|
|
import com.fs.company.service.ICompanyVoiceRoboticCallLogCallphoneService;
|
|
import com.fs.company.service.ICompanyVoiceRoboticCallLogCallphoneService;
|
|
|
import com.fs.company.util.OrderUtils;
|
|
import com.fs.company.util.OrderUtils;
|
|
@@ -22,7 +25,11 @@ import com.fs.crm.service.ICrmCustomerService;
|
|
|
import com.fs.crm.service.ICrmCustomerUserService;
|
|
import com.fs.crm.service.ICrmCustomerUserService;
|
|
|
import com.fs.crm.vo.*;
|
|
import com.fs.crm.vo.*;
|
|
|
import com.fs.framework.security.LoginUser;
|
|
import com.fs.framework.security.LoginUser;
|
|
|
|
|
+import com.fs.framework.service.PermissionService;
|
|
|
import com.fs.framework.service.TokenService;
|
|
import com.fs.framework.service.TokenService;
|
|
|
|
|
+import com.fs.his.utils.PhoneUtil;
|
|
|
|
|
+import com.fs.system.service.ISysConfigService;
|
|
|
|
|
+import com.fs.system.service.ISysDictTypeService;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
@@ -34,6 +41,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
@@ -62,6 +70,16 @@ public class CrmCustomerController extends BaseController
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ICompanyVoiceRoboticCallLogCallphoneService companyVoiceRoboticCallLogCallphoneService;
|
|
private ICompanyVoiceRoboticCallLogCallphoneService companyVoiceRoboticCallLogCallphoneService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ICompanyService companyService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ISysConfigService configService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ISysDictTypeService dictTypeService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private PermissionService permissionService;
|
|
|
@ApiOperation("获取线索客户")
|
|
@ApiOperation("获取线索客户")
|
|
|
@PreAuthorize("@ss.hasPermi('crm:customer:lineList')")
|
|
@PreAuthorize("@ss.hasPermi('crm:customer:lineList')")
|
|
|
@GetMapping("/getLineCustomerList")
|
|
@GetMapping("/getLineCustomerList")
|
|
@@ -70,6 +88,10 @@ public class CrmCustomerController extends BaseController
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
|
param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
|
|
+ if(!StringUtils.isEmpty(param.getEncryptedMobile())){
|
|
|
|
|
+ param.setMobile(PhoneUtil.encryptPhone(param.getEncryptedMobile()));
|
|
|
|
|
+ param.setEncryptedMobile(null);
|
|
|
|
|
+ }
|
|
|
List<CrmLineCustomerListQueryVO> list = crmCustomerService.selectCrmLineCustomerListQuery(param);
|
|
List<CrmLineCustomerListQueryVO> list = crmCustomerService.selectCrmLineCustomerListQuery(param);
|
|
|
if (list != null) {
|
|
if (list != null) {
|
|
|
for (CrmLineCustomerListQueryVO vo : list) {
|
|
for (CrmLineCustomerListQueryVO vo : list) {
|
|
@@ -106,37 +128,65 @@ public class CrmCustomerController extends BaseController
|
|
|
}
|
|
}
|
|
|
return getDataTable(list);
|
|
return getDataTable(list);
|
|
|
}
|
|
}
|
|
|
- @PreAuthorize("@ss.hasPermi('crm:customer:list')")
|
|
|
|
|
- @GetMapping("/listAll")
|
|
|
|
|
- public R listAll(CrmCustomerListQueryParam crmCustomer){
|
|
|
|
|
-
|
|
|
|
|
- LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
|
|
- crmCustomer.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
|
|
-
|
|
|
|
|
- if (!CompanyUser.isAdmin(loginUser.getUser().getUserType())) {
|
|
|
|
|
- crmCustomer.setCustomerUserId(loginUser.getUser().getUserId());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// @PreAuthorize("@ss.hasPermi('crm:customer:list')")
|
|
|
|
|
+// @GetMapping("/listAll")
|
|
|
|
|
+// public R listAll(CrmCustomerListQueryParam crmCustomer){
|
|
|
|
|
+//
|
|
|
|
|
+// LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
|
|
+// crmCustomer.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
|
|
+//
|
|
|
|
|
+// if (!CompanyUser.isAdmin(loginUser.getUser().getUserType())) {
|
|
|
|
|
+// crmCustomer.setCustomerUserId(loginUser.getUser().getUserId());
|
|
|
|
|
+// }
|
|
|
|
|
+//
|
|
|
|
|
+// PageHelper.startPage(1, 1000);
|
|
|
|
|
+// if(!StringUtils.isEmpty(crmCustomer.getReceiveTimeRange())){
|
|
|
|
|
+// crmCustomer.setReceiveTimeList(crmCustomer.getReceiveTimeRange().split("--"));
|
|
|
|
|
+// }
|
|
|
|
|
+// List<CrmCustomerListVO> list = crmCustomerService.selectCrmCustomerListQueryParam(crmCustomer);
|
|
|
|
|
+// if (list != null) {
|
|
|
|
|
+// for (CrmCustomerListVO vo : list) {
|
|
|
|
|
+// if(vo.getMobile()!=null){
|
|
|
|
|
+// vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
+// return R.ok().put("rows", list);
|
|
|
|
|
+// }
|
|
|
|
|
+@PreAuthorize("@ss.hasPermi('crm:customer:list')")
|
|
|
|
|
+@GetMapping("/listAll")
|
|
|
|
|
+public TableDataInfo listAll(CrmCustomerListQueryParam crmCustomer){
|
|
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
|
|
+ crmCustomer.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
|
|
+
|
|
|
|
|
+ if (!CompanyUser.isAdmin(loginUser.getUser().getUserType())) {
|
|
|
|
|
+ crmCustomer.setCustomerUserId(loginUser.getUser().getUserId());
|
|
|
|
|
+ }
|
|
|
|
|
+ PageHelper.startPage(crmCustomer.getPageNum(), crmCustomer.getPageSize());
|
|
|
|
|
+ if(!StringUtils.isEmpty(crmCustomer.getReceiveTimeRange())){
|
|
|
|
|
+ crmCustomer.setReceiveTimeList(crmCustomer.getReceiveTimeRange().split("--"));
|
|
|
|
|
+ }
|
|
|
|
|
+ List<CrmCustomerListVO> list = crmCustomerService.selectCrmCustomerListQueryParam(crmCustomer);
|
|
|
|
|
|
|
|
- PageHelper.startPage(1, 1000);
|
|
|
|
|
- if(!StringUtils.isEmpty(crmCustomer.getReceiveTimeRange())){
|
|
|
|
|
- crmCustomer.setReceiveTimeList(crmCustomer.getReceiveTimeRange().split("--"));
|
|
|
|
|
- }
|
|
|
|
|
- List<CrmCustomerListVO> list = crmCustomerService.selectCrmCustomerListQueryParam(crmCustomer);
|
|
|
|
|
- if (list != null) {
|
|
|
|
|
- for (CrmCustomerListVO vo : list) {
|
|
|
|
|
- if(vo.getMobile()!=null){
|
|
|
|
|
- vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (list != null) {
|
|
|
|
|
+ for (CrmCustomerListVO vo : list) {
|
|
|
|
|
+ if(vo.getMobile()!=null){
|
|
|
|
|
+ vo.setMobile(PhoneUtil.maskMobileForList(vo.getMobile()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return R.ok().put("rows", list);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ return getDataTable(list);
|
|
|
|
|
+}
|
|
|
@PreAuthorize("@ss.hasPermi('crm:customer:list')")
|
|
@PreAuthorize("@ss.hasPermi('crm:customer:list')")
|
|
|
@GetMapping("/listNoPage")
|
|
@GetMapping("/listNoPage")
|
|
|
public R listNoPage(CrmCustomerListQueryParam crmCustomer){
|
|
public R listNoPage(CrmCustomerListQueryParam crmCustomer){
|
|
|
|
|
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
crmCustomer.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
crmCustomer.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
|
|
+
|
|
|
|
|
+ if (!CompanyUser.isAdmin(loginUser.getUser().getUserType())) {
|
|
|
|
|
+ crmCustomer.setCustomerUserId(loginUser.getUser().getUserId());
|
|
|
|
|
+ }
|
|
|
if(!StringUtils.isEmpty(crmCustomer.getReceiveTimeRange())){
|
|
if(!StringUtils.isEmpty(crmCustomer.getReceiveTimeRange())){
|
|
|
crmCustomer.setReceiveTimeList(crmCustomer.getReceiveTimeRange().split("--"));
|
|
crmCustomer.setReceiveTimeList(crmCustomer.getReceiveTimeRange().split("--"));
|
|
|
}
|
|
}
|
|
@@ -144,7 +194,7 @@ public class CrmCustomerController extends BaseController
|
|
|
if (list != null) {
|
|
if (list != null) {
|
|
|
for (CrmCustomerListVO vo : list) {
|
|
for (CrmCustomerListVO vo : list) {
|
|
|
if(vo.getMobile()!=null){
|
|
if(vo.getMobile()!=null){
|
|
|
- vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
|
|
|
|
+ vo.setMobile(PhoneUtil.maskMobileForList(vo.getMobile()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -159,6 +209,7 @@ public class CrmCustomerController extends BaseController
|
|
|
PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
PageHelper.startPage(param.getPageNum(), param.getPageSize());
|
|
|
param.setCompanyUserId(loginUser.getUser().getUserId());
|
|
param.setCompanyUserId(loginUser.getUser().getUserId());
|
|
|
param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
|
|
+
|
|
|
if(!StringUtils.isEmpty(param.getCreateTimeRange())){
|
|
if(!StringUtils.isEmpty(param.getCreateTimeRange())){
|
|
|
param.setCustomerCreateTime(param.getCreateTimeRange().split("--"));
|
|
param.setCustomerCreateTime(param.getCreateTimeRange().split("--"));
|
|
|
}
|
|
}
|
|
@@ -166,7 +217,7 @@ public class CrmCustomerController extends BaseController
|
|
|
if (list != null) {
|
|
if (list != null) {
|
|
|
for (CrmMyCustomerListQueryVO vo : list) {
|
|
for (CrmMyCustomerListQueryVO vo : list) {
|
|
|
if(vo.getMobile()!=null){
|
|
if(vo.getMobile()!=null){
|
|
|
- vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
|
|
|
|
+ vo.setMobile(PhoneUtil.maskMobileForList(vo.getMobile()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -188,7 +239,7 @@ public class CrmCustomerController extends BaseController
|
|
|
if (list != null) {
|
|
if (list != null) {
|
|
|
for (CrmMyCustomerListQueryVO vo : list) {
|
|
for (CrmMyCustomerListQueryVO vo : list) {
|
|
|
if(vo.getMobile()!=null){
|
|
if(vo.getMobile()!=null){
|
|
|
- vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
|
|
|
|
+ vo.setMobile(PhoneUtil.maskMobileForList(vo.getMobile()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
fillMyCustomerListRoboticCallOutCount(list, param.getCompanyId());
|
|
fillMyCustomerListRoboticCallOutCount(list, param.getCompanyId());
|
|
@@ -214,7 +265,7 @@ public class CrmCustomerController extends BaseController
|
|
|
if (list1 != null) {
|
|
if (list1 != null) {
|
|
|
for (CrmLineCustomerListQueryVO vo : list1) {
|
|
for (CrmLineCustomerListQueryVO vo : list1) {
|
|
|
if(vo.getMobile()!=null){
|
|
if(vo.getMobile()!=null){
|
|
|
- vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
|
|
|
|
+ vo.setMobile(PhoneUtil.maskMobileForList(vo.getMobile()));
|
|
|
}
|
|
}
|
|
|
vo.setProperties( crmCustomerPropertyService.selectCrmCustomerPropertyByCustomerId(vo.getCustomerId()));
|
|
vo.setProperties( crmCustomerPropertyService.selectCrmCustomerPropertyByCustomerId(vo.getCustomerId()));
|
|
|
}
|
|
}
|
|
@@ -226,7 +277,7 @@ public class CrmCustomerController extends BaseController
|
|
|
if (list != null) {
|
|
if (list != null) {
|
|
|
for (CrmCustomerListQueryVO vo : list) {
|
|
for (CrmCustomerListQueryVO vo : list) {
|
|
|
if (vo.getMobile() != null) {
|
|
if (vo.getMobile() != null) {
|
|
|
- vo.setMobile(vo.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
|
|
|
|
+ vo.setMobile(PhoneUtil.maskMobileForList(vo.getMobile()));
|
|
|
}
|
|
}
|
|
|
vo.setProperties( crmCustomerPropertyService.selectCrmCustomerPropertyByCustomerId(vo.getCustomerId()));
|
|
vo.setProperties( crmCustomerPropertyService.selectCrmCustomerPropertyByCustomerId(vo.getCustomerId()));
|
|
|
|
|
|
|
@@ -311,7 +362,7 @@ public class CrmCustomerController extends BaseController
|
|
|
CrmCustomer customer=crmCustomerService.selectCrmCustomerById(customerId);
|
|
CrmCustomer customer=crmCustomerService.selectCrmCustomerById(customerId);
|
|
|
Boolean isReceive=false;
|
|
Boolean isReceive=false;
|
|
|
if (customer != null){
|
|
if (customer != null){
|
|
|
- customer.setMobile(customer.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
|
|
|
|
+ customer.setMobile(PhoneUtil.maskMobileForList(customer.getMobile()));
|
|
|
if(customer.getIsReceive()!=null&&customer.getIsReceive()==1&&customer.getReceiveUserId()!=null&&loginUser.getUser().getUserId().equals(customer.getReceiveUserId())){
|
|
if(customer.getIsReceive()!=null&&customer.getIsReceive()==1&&customer.getReceiveUserId()!=null&&loginUser.getUser().getUserId().equals(customer.getReceiveUserId())){
|
|
|
isReceive=true;
|
|
isReceive=true;
|
|
|
}
|
|
}
|
|
@@ -343,6 +394,29 @@ public class CrmCustomerController extends BaseController
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ //条件分配-统计数量
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('crm:customer:assignToUser')")
|
|
|
|
|
+ @PostMapping("/countByCondition")
|
|
|
|
|
+ public R countByCondition(@RequestBody CrmCustomerConditionAssignParam param)
|
|
|
|
|
+ {
|
|
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
|
|
+ param.getQueryParams().put("companyId", loginUser.getCompany().getCompanyId());
|
|
|
|
|
+ int count = crmCustomerService.countByCondition(param.getQueryType(), param.getQueryParams());
|
|
|
|
|
+ return R.ok().put("count", count);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //条件分配-执行分配
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('crm:customer:assignToUser')")
|
|
|
|
|
+ @PostMapping("/assignByCondition")
|
|
|
|
|
+ public R assignByCondition(@RequestBody CrmCustomerConditionAssignParam param)
|
|
|
|
|
+ {
|
|
|
|
|
+ LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
|
|
+ param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
|
|
+ param.getQueryParams().put("companyId", loginUser.getCompany().getCompanyId());
|
|
|
|
|
+ return crmCustomerService.assignByCondition(loginUser.getUsername(), loginUser.getUser().getUserId(), param);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@PreAuthorize("@ss.hasPermi('crm:customer:add')")
|
|
@PreAuthorize("@ss.hasPermi('crm:customer:add')")
|
|
|
@Log(title = "创建客户", businessType = BusinessType.INSERT)
|
|
@Log(title = "创建客户", businessType = BusinessType.INSERT)
|
|
@@ -484,15 +558,19 @@ public class CrmCustomerController extends BaseController
|
|
|
{
|
|
{
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
param.setCompanyId(loginUser.getCompany().getCompanyId());
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
List<CrmCustomerExportVO> list = crmCustomerService.selectCrmCustomerExportListQuery(param);
|
|
List<CrmCustomerExportVO> list = crmCustomerService.selectCrmCustomerExportListQuery(param);
|
|
|
|
|
+ boolean hasQueryPhonePermission = permissionService.hasPermi("crm:customer:queryPhone");
|
|
|
for(CrmCustomerExportVO customer:list){
|
|
for(CrmCustomerExportVO customer:list){
|
|
|
if(StringUtils.isNotEmpty(customer.getMobile())){
|
|
if(StringUtils.isNotEmpty(customer.getMobile())){
|
|
|
-
|
|
|
|
|
- customer.setMobile(customer.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
|
|
|
|
+ customer.setMobile(PhoneUtil.maskMobileForList(customer.getMobile()));
|
|
|
|
|
+ }
|
|
|
|
|
+ if(hasQueryPhonePermission && StringUtils.isNotEmpty(customer.getMobile())){
|
|
|
|
|
+ String originalMobile = customer.getMobile().replaceAll("\\*+", "");
|
|
|
|
|
+ if(originalMobile.length() >= 11){
|
|
|
|
|
+ customer.setMobilePlain(PhoneUtil.decryptPhone(customer.getMobile()));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ customer.setMobilePlain(originalMobile);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ExcelUtil<CrmCustomerExportVO> util = new ExcelUtil<CrmCustomerExportVO>(CrmCustomerExportVO.class);
|
|
ExcelUtil<CrmCustomerExportVO> util = new ExcelUtil<CrmCustomerExportVO>(CrmCustomerExportVO.class);
|
|
@@ -504,14 +582,21 @@ public class CrmCustomerController extends BaseController
|
|
|
{
|
|
{
|
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
|
|
|
List<CrmCustomerExportVO> list = crmCustomerService.selectCrmCustomerExportListByIds(customerIds);
|
|
List<CrmCustomerExportVO> list = crmCustomerService.selectCrmCustomerExportListByIds(customerIds);
|
|
|
|
|
+ boolean hasQueryPhonePermission = permissionService.hasPermi("crm:customer:queryPhone");
|
|
|
for(CrmCustomerExportVO customer:list){
|
|
for(CrmCustomerExportVO customer:list){
|
|
|
if(StringUtils.isNotEmpty(customer.getMobile())){
|
|
if(StringUtils.isNotEmpty(customer.getMobile())){
|
|
|
if(loginUser.getUser().getUserType().equals("00")){
|
|
if(loginUser.getUser().getUserType().equals("00")){
|
|
|
|
|
+ if(hasQueryPhonePermission){
|
|
|
|
|
+ if(customer.getMobile().length() > 11){
|
|
|
|
|
+ customer.setMobilePlain(PhoneUtil.decryptPhone(customer.getMobile()));
|
|
|
|
|
+ }else{
|
|
|
|
|
+ customer.setMobilePlain(customer.getMobile());
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
else{
|
|
else{
|
|
|
- customer.setMobile(customer.getMobile().replaceAll("(\\d{3})\\d*(\\d{4})", "$1****$2"));
|
|
|
|
|
|
|
+ customer.setMobile(PhoneUtil.maskMobileForList(customer.getMobile()));
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
ExcelUtil<CrmCustomerExportVO> util = new ExcelUtil<CrmCustomerExportVO>(CrmCustomerExportVO.class);
|
|
ExcelUtil<CrmCustomerExportVO> util = new ExcelUtil<CrmCustomerExportVO>(CrmCustomerExportVO.class);
|
|
@@ -544,4 +629,54 @@ public class CrmCustomerController extends BaseController
|
|
|
return R.ok().put("data",list);
|
|
return R.ok().put("data",list);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 查看手机号
|
|
|
|
|
+ */
|
|
|
|
|
+ @PreAuthorize("@ss.hasPermi('crm:customer:queryPhone')")
|
|
|
|
|
+ @Log(title = "查看手机号", businessType = BusinessType.GRANT)
|
|
|
|
|
+ @GetMapping(value = "/queryPhone/{customerId}")
|
|
|
|
|
+ public R queryPhone(@PathVariable("customerId") Long customerId)
|
|
|
|
|
+ {
|
|
|
|
|
+ CrmCustomer customer = crmCustomerService.selectCrmCustomerById(customerId);
|
|
|
|
|
+ if(null != customer){
|
|
|
|
|
+ String mobile = customer.getMobile();
|
|
|
|
|
+ if (mobile != null && mobile.length() > 11) {
|
|
|
|
|
+ mobile = PhoneUtil.decryptPhone(mobile);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return R.ok().put("mobile", mobile);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return R.error("数据缺失,请联系管理员");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation("动态数据字典查询")
|
|
|
|
|
+ @GetMapping("/tradeDicts")
|
|
|
|
|
+ public AjaxResult getTradeDicts() {
|
|
|
|
|
+
|
|
|
|
|
+ String[] dictTypes = {"crm_customer_source", "crm_customer_user_status",
|
|
|
|
|
+ "crm_customer_type", "crm_customer_tag"};
|
|
|
|
|
+ Map<String, List<SysDictData>> result = new HashMap<>();
|
|
|
|
|
+
|
|
|
|
|
+ for (String dictType : dictTypes) {
|
|
|
|
|
+ List<SysDictData> data = null;
|
|
|
|
|
+ // 保底逻辑:前缀查不到数据则使用原始字典
|
|
|
|
|
+ data = dictTypeService.selectDictDataByType(dictType);
|
|
|
|
|
+ result.put(dictType, data);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return AjaxResult.success(result);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private String getDictRemarkByValue(String dictType, String dictValue) {
|
|
|
|
|
+ List<SysDictData> dictDataList = dictTypeService.selectDictDataByType(dictType);
|
|
|
|
|
+ if (dictDataList != null) {
|
|
|
|
|
+ for (SysDictData data : dictDataList) {
|
|
|
|
|
+ if (dictValue.equals(data.getDictValue())) {
|
|
|
|
|
+ return StringUtils.isNotEmpty(data.getRemark()) ? data.getRemark() : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return "";
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|