| | |
| | | import cn.gistack.sm.intelligentCall.constant.CallConstant; |
| | | import cn.gistack.sm.intelligentCall.constant.ZtConstant; |
| | | import cn.gistack.sm.intelligentCall.entity.Scene; |
| | | import cn.gistack.sm.intelligentCall.excel.CallExcel; |
| | | import cn.gistack.sm.intelligentCall.mapper.CallTaskMapper; |
| | | import cn.gistack.sm.intelligentCall.service.CallService; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskResultVO; |
| | | import cn.gistack.sm.intelligentCall.vo.CallTaskStatistic; |
| | | import cn.gistack.sm.sjztmd.entity.AttAdBase; |
| | | import cn.gistack.sm.sjztmd.service.IAttAdBaseService; |
| | | import cn.gistack.sm.sjztmd.service.IAttResManagePersonService; |
| | | import cn.gistack.sm.sjztmd.vo.AttAdBaseVO; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.jetbrains.annotations.NotNull; |
| | | import org.springblade.core.redis.cache.BladeRedis; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.*; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Autowired |
| | | private BladeRedis bladeRedis; |
| | | |
| | | @Autowired |
| | | private IAttResManagePersonService attResManagePersonService; |
| | | |
| | | @Autowired |
| | | private AsyncCallService asyncCallService; |
| | |
| | | */ |
| | | @Override |
| | | public Object getCallResultList(IPage<CallTaskStatistic> page, CallTaskStatistic callTaskStatistic) { |
| | | List<String> list = new ArrayList<>(); |
| | | if (null!= callTaskStatistic.getAdCode() && !callTaskStatistic.getAdCode().equals("")){ |
| | | // 查询所有下级区域code |
| | | list = getAllChildrenAreaByAreaCode(callTaskStatistic.getAdCode()); |
| | | } |
| | | if (null!=callTaskStatistic.getIsPage()){ |
| | | // 不分页 |
| | | return callTaskMapper.getCallResultList(null, list,callTaskStatistic); |
| | | return callTaskMapper.getCallResultList(null,callTaskStatistic); |
| | | } |
| | | List<CallTaskStatistic> callNotConnectResultList = callTaskMapper.getCallResultList(page,list, callTaskStatistic); |
| | | List<CallTaskStatistic> callNotConnectResultList = callTaskMapper.getCallResultList(page, callTaskStatistic); |
| | | // 返回 |
| | | return page.setRecords(callNotConnectResultList); |
| | | } |
| | |
| | | // 不分页 |
| | | return callTaskMapper.getCallResultListTemp(null,callTaskResult,list); |
| | | } |
| | | |
| | | /** |
| | | * 导入表格发送智能外呼 |
| | | * @param list |
| | | * @param time |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object importCall(List<CallExcel> list,String time) { |
| | | // 转换 |
| | | List<String> stringList = list.stream().map(CallExcel::getWaterCode).collect(Collectors.toList()); |
| | | // 通过水库代码获取水库及巡查责任人信息 |
| | | Set<Scene> personList = attResManagePersonService.getPatrolPersonListByWaterCodeList(stringList); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | //传入调度时间和随机得到的人员信息进行任务的创建并返回 |
| | | params.put("list",setForListMap(personList)); |
| | | // 调度时间处理 |
| | | if (null!=time && !time.equals("")){ |
| | | params.put("taskScheduleTime",time); |
| | | }else { |
| | | params.put("taskScheduleTime",new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); |
| | | } |
| | | // 创建任务并返回结果 |
| | | List<String> task = createTask(params); |
| | | if (null!=task.get(1) && !task.get(1).equals("")){ |
| | | String successMsg = "外呼任务创建成功"; |
| | | // 返回 |
| | | return R.data(200,successMsg,null); |
| | | } |
| | | String errorMsg = task.get(0); |
| | | // 返回 |
| | | return R.data(400,errorMsg,null); |
| | | } |
| | | } |