|
@@ -32,10 +32,7 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
@@ -108,21 +105,23 @@ public class TelephoneRobotServiceImpl implements ITelephoneRobotService {
|
|
|
* @author: zianY
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResultResponse importRobotTelephone(List<Long> sellerIds,String userId){
|
|
|
+ public ResultResponse importRobotTelephone(List<Long> sellerIds,String userId) throws Exception{
|
|
|
Map<String,String> headers = new HashMap<>();
|
|
|
Map<String,Object> result = new HashMap<>();
|
|
|
- result.put("taskId",123);
|
|
|
- result.put("batchId",123);
|
|
|
+ //日期8位数 自增
|
|
|
+ String flowCode = redisCache.getFlowCode();
|
|
|
+ log.info("task------>>>>{}",flowCode);
|
|
|
+ result.put("taskId",flowCode);
|
|
|
+ result.put("batchId",flowCode);
|
|
|
result.put("callBackUrl",RobotConstant.CALL_BACK_URL);
|
|
|
result.put("canCover",true);
|
|
|
-
|
|
|
List customerList = new ArrayList();
|
|
|
for (Long sellerId : sellerIds) {
|
|
|
SaleRecordVo saleInfo = saleClueInfoMapper.selectSaleClueInfoBySellerId(sellerId);
|
|
|
Map<String,Object> param = new HashMap<>();
|
|
|
- param.put("id",saleInfo.getSellerId());
|
|
|
- param.put("name",saleInfo.getSellerName());
|
|
|
- param.put("companyName","");
|
|
|
+ param.put("id",saleInfo.getSellerId().intValue());
|
|
|
+ param.put("name",saleInfo.getSellerId());
|
|
|
+ param.put("companyName",saleInfo.getSellerName());
|
|
|
param.put("phone","17778037644");
|
|
|
param.put("website","");
|
|
|
customerList.add(param);
|
|
@@ -145,11 +144,14 @@ public class TelephoneRobotServiceImpl implements ITelephoneRobotService {
|
|
|
return ResultResponse.error("第三方接口异常,请稍候再试");
|
|
|
}
|
|
|
|
|
|
- //更新记录 用户
|
|
|
- saleClueCallRecordMapper.updateCallRecordUser(userId);
|
|
|
- JSONArray success = jsonObject.getJSONArray("success");
|
|
|
- JSONArray error = jsonObject.getJSONArray("error");
|
|
|
- return ResultResponse.successMsg("本次导入记录,成功"+success.size()+"条;失败"+error.size()+"条。",null);
|
|
|
+ Thread.sleep(500);
|
|
|
+ //更新最新的记录 用户信息
|
|
|
+ //1分钟只能调取导入接口一次 所以可以保证最新的记录就是刚通过回调接口回来的数据信息
|
|
|
+ saleClueCallRecordMapper.updateCallRecordUser(userId,flowCode);
|
|
|
+ log.info("------>>>>>>修改用户信息");
|
|
|
+ //JSONArray success = jsonObject.getJSONArray("success");
|
|
|
+ //JSONArray error = jsonObject.getJSONArray("error");
|
|
|
+ return ResultResponse.successMsg("导入记录成功"+customerList.size()+"条",null);
|
|
|
}
|
|
|
|
|
|
|