Commit 0781adb6 authored by zhengyi's avatar zhengyi

联系人下拉框搜索补充电话搜索参数查询业务

parent 2b49ea4c
......@@ -83,6 +83,9 @@ public interface CustomerContactsMapper extends BaseMapperX<CustomerContactsDO>
"<when test = 'searchKey != null and searchKey != \"\" '>",
"and CONCAT(IFNULL(cc.`name`,''),IFNULL(cc.`name_en`,''),IFNULL(cc.`phone_new`,''),IFNULL(cc.`email`,''),IFNULL(c.`company`,''),IFNULL(c.`company_en`,'')) like concat('%', concat(#{searchKey}, '%'))",
"</when>",
"<when test = 'phone != null and phone != \"\" '>",
"and IFNULL(cc.`phone_new`,'') like concat('%', concat(#{phone}, '%'))",
"</when>",
"<when test = 'type != null and type != \"\" '>",
"and FIND_IN_SET(#{type}, c.type) ",
"</when>",
......@@ -98,6 +101,7 @@ public interface CustomerContactsMapper extends BaseMapperX<CustomerContactsDO>
})
IPage<CustomerContactsDto> selectBySearchKey(IPage page,
@Param("searchKey") String searchKey,
@Param("phone") String phone,
@Param("type") String type,
@Param("ids") Collection<Long> ids,
@Param("customerId") Long customerId);
......@@ -145,6 +149,7 @@ public interface CustomerContactsMapper extends BaseMapperX<CustomerContactsDO>
//过滤客户经理函数
IPage<CustomerContactsDto> selectBySearchKey2(IPage page,
@Param("searchKey") String searchKey,
@Param("phone") String phone,
@Param("type") String type,
@Param("ids") Collection<Long> ids,
@Param("customerId") Long customerId,
......
......@@ -107,14 +107,14 @@ public interface CustomerContactsService extends IService<CustomerContactsDO> {
* @param customerId 客户ID
* @return 联系人列表
*/
PageResult<CustomerContactsDto> selectBySearchKey(String searchKey, String type, Collection<Long> ids, Long customerId, PageParam page);
PageResult<CustomerContactsDto> selectBySearchKey(String searchKey,String phone, String type, Collection<Long> ids, Long customerId, PageParam page);
/*
添加的客户选择函数
*/
PageResult<CustomerContactsDto> selectBySearchKey2(
String searchKey, String type, Collection<Long> ids,
String searchKey, String phone, String type, Collection<Long> ids,
Long customerId, PageParam page, Long UserId);
......
......@@ -146,9 +146,9 @@ public class CustomerContactsServiceImpl extends AbstractService<CustomerContact
}
@Override
public PageResult<CustomerContactsDto> selectBySearchKey(String searchKey, String type, Collection<Long> ids, Long customerId, PageParam page) {
public PageResult<CustomerContactsDto> selectBySearchKey(String searchKey, String phone, String type, Collection<Long> ids, Long customerId, PageParam page) {
IPage<CustomerContactsDto> mpPage = MyBatisUtils.buildPage(page);
customerContactsMapper.selectBySearchKey(mpPage, searchKey,
customerContactsMapper.selectBySearchKey(mpPage, searchKey, phone,
type, ids, customerId);
return PageResult.of(mpPage);
......@@ -157,13 +157,14 @@ public class CustomerContactsServiceImpl extends AbstractService<CustomerContact
@Override
public PageResult<CustomerContactsDto> selectBySearchKey2(
String searchKey,
String phone,
String type,
Collection<Long> ids,
Long customerId,
PageParam page,
Long UserId) {
IPage<CustomerContactsDto> mpPage = MyBatisUtils.buildPage(page);
customerContactsMapper.selectBySearchKey2(mpPage, searchKey,
customerContactsMapper.selectBySearchKey2(mpPage, searchKey, phone,
type, ids, customerId,UserId);
return PageResult.of(mpPage);
......
......@@ -164,19 +164,21 @@ public class CustomerContactsController {
@ApiOperation("获得客户联系人下拉框列表(单次最多显示20条,请输入联系人电话、联系人姓名、客户名称搜索)")
@ApiImplicitParams({
@ApiImplicitParam(name = "searchKey", value = "请输入联系人电话、联系人姓名、客户名称搜索", example = "姓名或电话", dataTypeClass = String.class),
@ApiImplicitParam(name = "type", value = "客户类型", example = "姓名或电话", dataTypeClass = String.class),
@ApiImplicitParam(name = "phone", value = "请输入联系人电话搜索", example = "电话", dataTypeClass = String.class),
@ApiImplicitParam(name = "type", value = "客户类型", example = "1", dataTypeClass = String.class),
@ApiImplicitParam(name = "ids", value = "编号列表", example = "1024,2048", dataTypeClass = List.class),
@ApiImplicitParam(name = "customerId", value = "客户ID", example = "1024", dataTypeClass = Long.class)
})
public CommonResult<PageResult<CustomerContactsDto>> selectBySearchKey(
@RequestParam(value = "searchKey", required = false) String searchKey,
@RequestParam(value = "phone", required = false) String phone,
@RequestParam(value = "type", required = false) String type,
@RequestParam(value = "ids", required = false) Collection<Long> ids,
@RequestParam(value = "customerId", required = false) Long customerId
, PageParam page) {
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
return success(customerContactsService.selectBySearchKey(searchKey,
return success(customerContactsService.selectBySearchKey(searchKey, phone,
type, ids, customerId, page));
}
......@@ -188,12 +190,14 @@ public class CustomerContactsController {
@ApiOperation("获得客户联系人下拉框列表(单次最多显示20条,请输入联系人电话、联系人姓名、客户名称搜索)")
@ApiImplicitParams({
@ApiImplicitParam(name = "searchKey", value = "请输入联系人电话、联系人姓名、客户名称搜索", example = "姓名或电话", dataTypeClass = String.class),
@ApiImplicitParam(name = "phone", value = "请输入联系人电话搜索", example = "电话", dataTypeClass = String.class),
@ApiImplicitParam(name = "type", value = "客户类型", example = "姓名或电话", dataTypeClass = String.class),
@ApiImplicitParam(name = "ids", value = "编号列表", example = "1024,2048", dataTypeClass = List.class),
@ApiImplicitParam(name = "customerId", value = "客户ID", example = "1024", dataTypeClass = Long.class)
})
public CommonResult<PageResult<CustomerContactsDto>> selectBySearchKey2(
@RequestParam(value = "searchKey", required = false) String searchKey,
@RequestParam(value = "phone", required = false) String phone,
@RequestParam(value = "type", required = false) String type,
@RequestParam(value = "ids", required = false) Collection<Long> ids,
@RequestParam(value = "customerId", required = false) Long customerId
......@@ -205,7 +209,7 @@ public class CustomerContactsController {
type, ids, customerId, page));*/
//当前用户ID
Long loginUserId = SecurityFrameworkUtils.getLoginUserId();
return success(customerContactsService.selectBySearchKey2(searchKey,
return success(customerContactsService.selectBySearchKey2(searchKey, phone,
type, ids, customerId, page, loginUserId));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment