|
@ -23,6 +23,8 @@ import com.yxt.anrui.crm.biz.crmvehicledemand.CrmVehicledemandService; |
|
|
import com.yxt.anrui.crm.biz.crmvisit.CrmVisitService; |
|
|
import com.yxt.anrui.crm.biz.crmvisit.CrmVisitService; |
|
|
import com.yxt.anrui.portal.api.dictcommon.DictCommonFeign; |
|
|
import com.yxt.anrui.portal.api.dictcommon.DictCommonFeign; |
|
|
import com.yxt.anrui.portal.api.dictcommon.DictCommonVo; |
|
|
import com.yxt.anrui.portal.api.dictcommon.DictCommonVo; |
|
|
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationFeign; |
|
|
|
|
|
import com.yxt.anrui.portal.api.sysorganization.SysOrganizationVo; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
import com.yxt.anrui.portal.api.sysstafforg.SysStaffOrgFeign; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserFeign; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserInfoVo; |
|
|
import com.yxt.anrui.portal.api.sysuser.SysUserInfoVo; |
|
@ -89,6 +91,8 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
private CommonAppendixFeign commonAppendixFeign; |
|
|
private CommonAppendixFeign commonAppendixFeign; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private SysStaffOrgFeign sysStaffOrgFeign; |
|
|
private SysStaffOrgFeign sysStaffOrgFeign; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private SysOrganizationFeign sysOrganizationFeign; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public PagerVo<CrmCustomerTemp> listPage(PagerQuery<CrmCustomerTempQuery> pq) { |
|
|
public PagerVo<CrmCustomerTemp> listPage(PagerQuery<CrmCustomerTempQuery> pq) { |
|
@ -111,28 +115,28 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
QueryWrapper<CrmCustomerTemp> qw = new QueryWrapper<>(); |
|
|
QueryWrapper<CrmCustomerTemp> qw = new QueryWrapper<>(); |
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getCustomerTypeKey())) { |
|
|
if (StringUtils.isNotBlank(query.getCustomerTypeKey())) { |
|
|
qw.eq("customerTypeKey", query.getCustomerTypeKey()); |
|
|
qw.eq("cct.customerTypeKey", query.getCustomerTypeKey()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getName())) { |
|
|
if (StringUtils.isNotBlank(query.getName())) { |
|
|
qw.like("name", query.getName()); |
|
|
qw.like("cct.name", query.getName()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getLevelKey())) { |
|
|
if (StringUtils.isNotBlank(query.getLevelKey())) { |
|
|
qw.eq("levelKey", query.getLevelKey()); |
|
|
qw.eq("cct.levelKey", query.getLevelKey()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getMobile())) { |
|
|
if (StringUtils.isNotBlank(query.getMobile())) { |
|
|
qw.like("mobile", query.getMobile()); |
|
|
qw.like("cct.mobile", query.getMobile()); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getStaffSid())) { |
|
|
if (StringUtils.isNotBlank(query.getStaffSid())) { |
|
|
qw.eq("staffSid", query.getStaffSid()); |
|
|
qw.eq("cct.staffSid", query.getStaffSid()); |
|
|
} |
|
|
} |
|
|
String remindStartDay = query.getRemindStartDay(); |
|
|
String remindStartDay = query.getRemindStartDay(); |
|
|
String remindEndDay = query.getRemindEndDay(); |
|
|
String remindEndDay = query.getRemindEndDay(); |
|
|
qw.apply(StringUtils.isNotBlank(remindStartDay), "date_format (remind_day,'%Y-%m-%d') >= date_format('" + remindStartDay + "','%Y-%m-%d')"). |
|
|
qw.apply(StringUtils.isNotBlank(remindStartDay), "date_format (cct.remind_day,'%Y-%m-%d') >= date_format('" + remindStartDay + "','%Y-%m-%d')"). |
|
|
apply(StringUtils.isNotBlank(remindEndDay), "date_format (remind_day,'%Y-%m-%d') <= date_format('" + remindEndDay + "','%Y-%m-%d')" |
|
|
apply(StringUtils.isNotBlank(remindEndDay), "date_format (cct.remind_day,'%Y-%m-%d') <= date_format('" + remindEndDay + "','%Y-%m-%d')" |
|
|
); |
|
|
); |
|
|
return qw; |
|
|
return qw; |
|
|
} |
|
|
} |
|
@ -146,6 +150,50 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
return p; |
|
|
return p; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public PagerVo<CrmCustomerTempVo> listPageByOrgPathSid(PagerQuery<CrmCustomerTempQuery> pq) { |
|
|
|
|
|
CrmCustomerTempQuery query = pq.getParams(); |
|
|
|
|
|
QueryWrapper<CrmCustomerTemp> qw = new QueryWrapper<>(); |
|
|
|
|
|
String userSid = query.getUserSid(); |
|
|
|
|
|
String sid = sysOrganizationFeign.getUseOrgByUserSid(userSid).getData().getSid(); |
|
|
|
|
|
String orgSidPath = query.getOrgSidPath(); |
|
|
|
|
|
SysOrganizationVo data = sysOrganizationFeign.selectByOrgSidPath(orgSidPath).getData(); |
|
|
|
|
|
String orgLevelKey = data.getOrgLevelKey(); |
|
|
|
|
|
if ("2".equals(orgLevelKey)) { |
|
|
|
|
|
orgSidPath = orgSidPath.substring(0, 73); |
|
|
|
|
|
qw.like("so.orgSidPath", orgSidPath); |
|
|
|
|
|
} else if ("3".equals(orgLevelKey)) { |
|
|
|
|
|
qw.eq("cct.createOrgSid", sid); |
|
|
|
|
|
} |
|
|
|
|
|
if (StringUtils.isNotBlank(query.getCustomerTypeKey())) { |
|
|
|
|
|
qw.eq("cct.customerTypeKey", query.getCustomerTypeKey()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getName())) { |
|
|
|
|
|
qw.like("cct.name", query.getName()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getLevelKey())) { |
|
|
|
|
|
qw.eq("cct.levelKey", query.getLevelKey()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getMobile())) { |
|
|
|
|
|
qw.like("cct.mobile", query.getMobile()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotBlank(query.getStaffSid())) { |
|
|
|
|
|
qw.eq("cct.staffSid", query.getStaffSid()); |
|
|
|
|
|
} |
|
|
|
|
|
String remindStartDay = query.getRemindStartDay(); |
|
|
|
|
|
String remindEndDay = query.getRemindEndDay(); |
|
|
|
|
|
qw.apply(StringUtils.isNotBlank(remindStartDay), "date_format (cct.remind_day,'%Y-%m-%d') >= date_format('" + remindStartDay + "','%Y-%m-%d')"). |
|
|
|
|
|
apply(StringUtils.isNotBlank(remindEndDay), "date_format (cct.remind_day,'%Y-%m-%d') <= date_format('" + remindEndDay + "','%Y-%m-%d')" |
|
|
|
|
|
); |
|
|
|
|
|
IPage<CrmCustomerTemp> page = PagerUtil.queryToPage(pq); |
|
|
|
|
|
IPage<CrmCustomerTempVo> pagging = baseMapper.selectPageVo(page, qw); |
|
|
|
|
|
PagerVo<CrmCustomerTempVo> p = PagerUtil.pageToVo(pagging, null); |
|
|
|
|
|
return p; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public List<CrmCustomerTempVo> listAllVo(CrmCustomerTempQuery query) { |
|
|
public List<CrmCustomerTempVo> listAllVo(CrmCustomerTempQuery query) { |
|
|
QueryWrapper<CrmCustomerTemp> qw = createQueryWrapper(query); |
|
|
QueryWrapper<CrmCustomerTemp> qw = createQueryWrapper(query); |
|
|
return baseMapper.selectListAllVo(qw); |
|
|
return baseMapper.selectListAllVo(qw); |
|
@ -921,4 +969,5 @@ public class CrmCustomerTempService extends MybatisBaseService<CrmCustomerTempMa |
|
|
list.removeAll(Collections.singleton(null)); |
|
|
list.removeAll(Collections.singleton(null)); |
|
|
return rb.success().setData(list); |
|
|
return rb.success().setData(list); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |