|
|
@ -26,7 +26,6 @@ |
|
|
|
package com.yxt.crm.biz.crmcustomer; |
|
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
@ -42,7 +41,7 @@ import com.yxt.crm.feign.as.ascustomervehicle.AsCustomerCrmVehVo; |
|
|
|
import com.yxt.crm.feign.as.ascustomervehicle.AsCustomerVehicleDto; |
|
|
|
import com.yxt.crm.feign.as.ascustomervehicle.AsCustomerVehicleFeign; |
|
|
|
import com.yxt.crm.feign.base.basevehicleoutapply.BaseVehicleOutApplyFeign; |
|
|
|
import com.yxt.crm.feign.bus.bussalesorder.BusSalesOrder; |
|
|
|
import com.yxt.crm.feign.base.basevehicleoutapply.VehicleCustomerVo; |
|
|
|
import com.yxt.crm.feign.bus.bussalesorder.BusSalesOrderFeign; |
|
|
|
import com.yxt.crm.feign.portal.dictcommon.DictCommonFeign; |
|
|
|
import com.yxt.crm.feign.portal.dictcommon.DictCommonType; |
|
|
@ -116,7 +115,6 @@ public class CrmCustomerService extends MybatisBaseService<CrmCustomerMapper, Cr |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void insertByDto(CrmCustomerDto dto) { |
|
|
|
CrmCustomer entity = new CrmCustomer(); |
|
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
@ -124,7 +122,6 @@ public class CrmCustomerService extends MybatisBaseService<CrmCustomerMapper, Cr |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public CrmCustomerDetailsVo fetchDetailsVoBySid(String sid) { |
|
|
|
CrmCustomer entity = fetchBySid(sid); |
|
|
|
CrmCustomerDetailsVo vo = new CrmCustomerDetailsVo(); |
|
|
@ -303,6 +300,7 @@ public class CrmCustomerService extends MybatisBaseService<CrmCustomerMapper, Cr |
|
|
|
} |
|
|
|
return subList; |
|
|
|
} |
|
|
|
|
|
|
|
public void disableState(String[] sid) { |
|
|
|
for (String s : sid) { |
|
|
|
CrmCustomer customerTemp = fetchBySid(s); |
|
|
@ -318,6 +316,7 @@ public class CrmCustomerService extends MybatisBaseService<CrmCustomerMapper, Cr |
|
|
|
baseMapper.updateById(customerTemp); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public PagerVo<AsCustomerListVo> asListPage(PagerQuery<AsCustomerListQuery> pq) { |
|
|
|
AsCustomerListQuery query = pq.getParams(); |
|
|
|
QueryWrapper<CrmCustomer> qw = new QueryWrapper<>(); |
|
|
@ -401,7 +400,7 @@ public class CrmCustomerService extends MybatisBaseService<CrmCustomerMapper, Cr |
|
|
|
String sid = ""; |
|
|
|
if (dto.getVehState().equals("0")) { |
|
|
|
CrmCustomer crmCustomerTemp = new CrmCustomer(); |
|
|
|
BeanUtil.copyProperties(dto,crmCustomerTemp,"sid"); |
|
|
|
BeanUtil.copyProperties(dto, crmCustomerTemp, "sid"); |
|
|
|
String orgSid = ""; |
|
|
|
if (StringUtils.isNotBlank(dto.getOrgPath())) { |
|
|
|
orgSid = sysStaffOrgFeign.getOrgSidByPath(dto.getOrgPath()).getData(); |
|
|
@ -421,6 +420,7 @@ public class CrmCustomerService extends MybatisBaseService<CrmCustomerMapper, Cr |
|
|
|
if (StringUtils.isNotBlank(dto.getUseOrgSid())) { |
|
|
|
crmCustomerTemp.setUseOrgSid(dto.getUseOrgSid()); |
|
|
|
} |
|
|
|
crmCustomerTemp.setCreateBySid(dto.getUserSid()); |
|
|
|
save(crmCustomerTemp); |
|
|
|
sid = crmCustomerTemp.getSid(); |
|
|
|
AsCustomerVehicleDto v = new AsCustomerVehicleDto(); |
|
|
@ -432,6 +432,7 @@ public class CrmCustomerService extends MybatisBaseService<CrmCustomerMapper, Cr |
|
|
|
} |
|
|
|
if (StringUtils.isNotBlank(dto.getSaleDate())) { |
|
|
|
v.setSaleDate(dto.getSaleDate()); |
|
|
|
v.setBuyDate(dto.getSaleDate()); |
|
|
|
} |
|
|
|
v.setVehState(0); |
|
|
|
v.setCustomerSid(sid); |
|
|
@ -624,19 +625,17 @@ public class CrmCustomerService extends MybatisBaseService<CrmCustomerMapper, Cr |
|
|
|
vo.setVehState("1"); |
|
|
|
if (StringUtils.isNotBlank(query.getVinNo())) { |
|
|
|
String vinNo = query.getVinNo(); |
|
|
|
String orderSid = baseVehicleOutApplyFeign.selectSidByVinNo(vinNo).getData(); |
|
|
|
if (StringUtils.isNotBlank(orderSid)) { |
|
|
|
BusSalesOrder order = busSalesOrderFeign.fetchBySid(orderSid).getData(); |
|
|
|
if (null != order) { |
|
|
|
if (StringUtils.isNotBlank(order.getCustomerSid())) { |
|
|
|
String customerSid = order.getCustomerSid(); |
|
|
|
CrmCustomerTemp customerTemp = crmCustomerTempFeign.fetchEntity(customerSid).getData(); |
|
|
|
if (null != customerTemp) { |
|
|
|
BeanUtils.copyProperties(customerTemp,vo,"isDesignatedEnterprise","filingIndate","sid"); |
|
|
|
vo.setVehState("0"); |
|
|
|
vo.setSaleOrgName(order.getUseOrgName()); |
|
|
|
vo.setSaleDate(DateUtil.formatDate(order.getCreateDate())); |
|
|
|
} |
|
|
|
VehicleCustomerVo v = baseVehicleOutApplyFeign.selectSidByVinNo(vinNo).getData(); |
|
|
|
if (null != v) { |
|
|
|
vo.setVehState("0"); |
|
|
|
vo.setSaleOrgName(v.getUseOrgName()); |
|
|
|
vo.setSaleDate(v.getSaleDate()); |
|
|
|
vo.setBuyDate(v.getSaleDate()); |
|
|
|
if (StringUtils.isNotBlank(v.getCustomerSid())) { |
|
|
|
String customerSid = v.getCustomerSid(); |
|
|
|
CrmCustomerTemp customerTemp = crmCustomerTempFeign.fetchEntity(customerSid).getData(); |
|
|
|
if (null != customerTemp) { |
|
|
|
BeanUtils.copyProperties(customerTemp, vo, "isDesignatedEnterprise", "filingIndate", "sid"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -658,7 +657,7 @@ public class CrmCustomerService extends MybatisBaseService<CrmCustomerMapper, Cr |
|
|
|
if (dto.getVehState().equals("0")) { |
|
|
|
CrmCustomer crmCustomerTemp = new CrmCustomer(); |
|
|
|
sid = crmCustomerTemp.getSid(); |
|
|
|
BeanUtil.copyProperties(dto,crmCustomerTemp,"sid"); |
|
|
|
BeanUtil.copyProperties(dto, crmCustomerTemp, "sid"); |
|
|
|
String orgSid = ""; |
|
|
|
if (StringUtils.isNotBlank(dto.getOrgPath())) { |
|
|
|
orgSid = sysStaffOrgFeign.getOrgSidByPath(dto.getOrgPath()).getData(); |
|
|
@ -749,6 +748,6 @@ public class CrmCustomerService extends MybatisBaseService<CrmCustomerMapper, Cr |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return rb.success().setData(sid); |
|
|
|
return rb.success().setData(sid); |
|
|
|
} |
|
|
|
} |
|
|
|