|
@@ -15,7 +15,10 @@ import com.ruixuan.salesLeads.mapper.SaleClueRecordInfoMapper;
|
|
|
import com.ruixuan.salesLeads.mapper.SaleQuotaInfoMapper;
|
|
|
import com.ruixuan.salesLeads.pojo.SaleClueDistributionInfoPojo;
|
|
|
import com.ruixuan.salesLeads.pojo.SaleClueInfoPojo;
|
|
|
+import com.ruixuan.salesLeads.pojo.SaleClueRecordInfoPojo;
|
|
|
import com.ruixuan.salesLeads.pojo.SaleQuotaInfoPojo;
|
|
|
+import com.ruixuan.salesLeads.pojo.vo.SaleRecordVo;
|
|
|
+import com.ruixuan.salesLeads.pojo.vo.SaleTaskInfoVo;
|
|
|
import com.ruixuan.salesLeads.service.ISaleClueInfoService;
|
|
|
import com.ruixuan.salesLeads.utils.CsvImportUtil;
|
|
|
import com.ruixuan.system.domain.SysAreaInfo;
|
|
@@ -135,9 +138,9 @@ public class SaleClueInfoServiceImpl implements ISaleClueInfoService {
|
|
|
clue.setSellerId(Long.valueOf(dataMap.get("sellerId")));
|
|
|
clue.setSellerName(dataMap.get("sellerName"));
|
|
|
clue.setFans(Long.valueOf(dataMap.get("fans")));
|
|
|
- clue.setTelephone( dataMap.get("telephone").isEmpty() ? 0 : Long.valueOf(dataMap.get("telephone")));
|
|
|
+ clue.setTelephone(StringUtils.isEmpty(dataMap.get("telephone")) ? 0 : Long.valueOf(dataMap.get("telephone")));
|
|
|
clue.setProviderFlag(dataMap.get("providerFlag").equals("否") ? 0 : 1);
|
|
|
- clue.setTransitionFlag(dataMap.get("transitionFlag") == null ? 0 : Integer.valueOf(dataMap.get("transitionFlag")));
|
|
|
+ clue.setTransitionFlag(dataMap.get("transitionFlag").equals("否") ? 0 : 1 );
|
|
|
clue.setCreateUserId(createUserId);
|
|
|
//查询行业
|
|
|
SysIndustryInfo industryInfo = sysIndustryInfoMapper.getIndustryInfoByName(dataMap.get("industryId"));
|
|
@@ -147,23 +150,54 @@ public class SaleClueInfoServiceImpl implements ISaleClueInfoService {
|
|
|
clue.setProvinceId(areaInfo == null ? 0 : areaInfo.getParentCode());
|
|
|
clue.setCityId(areaInfo == null ? 0 : areaInfo.getCode());
|
|
|
|
|
|
- quota.setNearlyThirtyDays(dataMap.get("NearlyThirtyDays"));
|
|
|
- quota.setGmvMonth(dataMap.get("gmvMonth") == null ? 0 : Long.valueOf(dataMap.get("gmvMonth")));
|
|
|
- quota.setGmv(dataMap.get("gmv"));
|
|
|
+ if (StringUtils.isNotEmpty(dataMap.get("NearlyThirtyDays"))){
|
|
|
+ quota.setNearlyThirtyDays(dataMap.get("NearlyThirtyDays"));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(dataMap.get("gmv"))){
|
|
|
+ quota.setGmvMonth(Long.valueOf(dataMap.get("gmvMonth")));
|
|
|
+ quota.setGmv(dataMap.get("gmv"));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(dataMap.get("mtd"))){
|
|
|
+ quota.setMtdDate(Long.valueOf(dataMap.get("mtdDate")));
|
|
|
+ quota.setMtd(dataMap.get("mtd"));
|
|
|
+ }
|
|
|
+
|
|
|
+ if (StringUtils.isNotEmpty(dataMap.get("NearlyThirtyDays")) ||
|
|
|
+ StringUtils.isNotEmpty(dataMap.get("gmv")) ||
|
|
|
+ StringUtils.isNotEmpty(dataMap.get("mtd"))){
|
|
|
+ quota.setCreateUserId(createUserId);
|
|
|
+ quota.setSellerId(Long.valueOf(dataMap.get("sellerId")));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (StringUtils.isNotNull(clue)){
|
|
|
+ clueList.add(clue);
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotNull(quota.getSellerId())){
|
|
|
+ quotaList.add(quota);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
- quota.setMtdDate(dataMap.get("mtdDate") == null ? 0 : Long.valueOf(dataMap.get("mtdDate")));
|
|
|
- quota.setMtd(dataMap.get("mtd"));
|
|
|
- quota.setCreateUserId(createUserId);
|
|
|
- quota.setSellerId(Long.valueOf(dataMap.get("sellerId")));
|
|
|
|
|
|
- clueList.add(clue);
|
|
|
- quotaList.add(quota);
|
|
|
}
|
|
|
|
|
|
- //销售线索
|
|
|
- saleClueInfoMapper.replaceSaleClueInfoBatch(clueList);
|
|
|
- //线索-额度
|
|
|
- saleQuotaInfoMapper.replaceSaleQuotaInfoBatch(quotaList);
|
|
|
+
|
|
|
+ if (clueList.size() > 0){
|
|
|
+ //销售线索
|
|
|
+ saleClueInfoMapper.replaceSaleClueInfoBatch(clueList);
|
|
|
+ }
|
|
|
+ if (quotaList.size() > 0){
|
|
|
+ //线索-额度
|
|
|
+ saleQuotaInfoMapper.replaceSaleQuotaInfoBatch(quotaList);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
@@ -283,6 +317,80 @@ public class SaleClueInfoServiceImpl implements ISaleClueInfoService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
+ * 销售线索任务-回显线索详情
|
|
|
+ * @param sellerId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResultResponse getSaleTaskInfoBySellerId(Long sellerId){
|
|
|
+
|
|
|
+ SaleTaskInfoVo saleTaskInfoVo = new SaleTaskInfoVo();
|
|
|
+ //线索详情
|
|
|
+ SaleRecordVo saleInfo = saleClueInfoMapper.selectSaleClueInfoBySellerId(sellerId);
|
|
|
+ //记录信息
|
|
|
+ List<SaleClueRecordInfoPojo> recordList = saleClueRecordInfoMapper.selectDistributionList(sellerId);
|
|
|
+
|
|
|
+ saleTaskInfoVo.setSaleRecordVo(saleInfo);
|
|
|
+ saleTaskInfoVo.setRecordList(recordList);
|
|
|
+ saleTaskInfoVo.setNextNum(StringUtils.isEmpty(recordList) ? 1 : recordList.size()+1);
|
|
|
+
|
|
|
+ return ResultResponse.successMsg("查询成功。",saleTaskInfoVo);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 销售线索任务-新增跟进记录
|
|
|
+ * @param recordInfoPojo
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResultResponse insertSaleTaskRecord(SaleClueRecordInfoPojo recordInfoPojo){
|
|
|
+
|
|
|
+ //新增跟进记录
|
|
|
+ saleClueRecordInfoMapper.insertSaleRedord(recordInfoPojo);
|
|
|
+
|
|
|
+ //修改线索状态
|
|
|
+ //是否继续跟进 1-继续跟进 2-意向合作 3-跟进完成无合作
|
|
|
+ if (recordInfoPojo.getContinueFlag() == 1){
|
|
|
+ //线索状态 1-未开始 2-进行中 3-已结束
|
|
|
+ saleClueInfoMapper.updateSaleClueState(recordInfoPojo.getSellerId(),2);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (recordInfoPojo.getContinueFlag() == 2){
|
|
|
+ //意向合作 1-不合作可跟进 2-添加微信 3-操盘合作 4-服务商合作 5-金牛合作 6-无法添加微信
|
|
|
+ if (recordInfoPojo.getIntendedCooperation() == 1){
|
|
|
+ saleClueInfoMapper.updateSaleClueState(recordInfoPojo.getSellerId(),2);
|
|
|
+ }
|
|
|
+ saleClueInfoMapper.updateSaleClueState(recordInfoPojo.getSellerId(),3);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (recordInfoPojo.getContinueFlag() == 3){
|
|
|
+ saleClueInfoMapper.updateSaleClueState(recordInfoPojo.getSellerId(),3);
|
|
|
+ }
|
|
|
+ return ResultResponse.successMsg("新增跟进记录成功。",null);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @description: 销售线索-转面销/电销
|
|
|
+ *
|
|
|
+ * @param sellerId 卖家id
|
|
|
+ * @param offlineSaleFlag 类型1-电销 2-面销
|
|
|
+ * @param createUserId
|
|
|
+ * @return: com.ruixuan.common.core.domain.ResultResponse
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public ResultResponse saleClueToOffline(Long sellerId,int offlineSaleFlag,Long createUserId){
|
|
|
+ saleClueInfoMapper.updateSaleClueOfflineFlag(sellerId,offlineSaleFlag);
|
|
|
+ return ResultResponse.successMsg("成功。",null);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|