|
|
@ -209,16 +209,23 @@ public class StatsUserServiceImpl implements StatsUserService { |
|
|
|
@Override |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void gmUploadData(GmUploadDataFormDTO formDTO) { |
|
|
|
String customerId = formDTO.getDataList().get(0).getCustomerId(); |
|
|
|
//1.判断是否批量删除历史数据
|
|
|
|
if (formDTO.getIsFirst()) { |
|
|
|
int deleteNum; |
|
|
|
do { |
|
|
|
deleteNum = dataStatsDao.delGmUploadData(formDTO.getCustomerId(), formDTO.getDateId()); |
|
|
|
deleteNum = dataStatsDao.delGmUploadData(customerId, formDTO.getDataList().get(0).getDateId()); |
|
|
|
} while (deleteNum > NumConstant.ZERO); |
|
|
|
} |
|
|
|
|
|
|
|
//2.查询当前客户index库组织信息供数据封装使用
|
|
|
|
List<CustomerAgencyDTO> agencyList = screenCustomerAgencyService.getByCustomerId(formDTO.getCustomerId()); |
|
|
|
//2.数据准备
|
|
|
|
//2-1.查询当前客户index库组织信息供数据封装使用
|
|
|
|
List<CustomerAgencyDTO> agencyList = screenCustomerAgencyService.getByCustomerId(customerId); |
|
|
|
//2-2.查询客户所属父客户信息
|
|
|
|
CustomerRelationDTO crm = customerService.getByCustomerId(customerId); |
|
|
|
if (null == crm) { |
|
|
|
throw new RenException(String.format("未查询到子客户所属父客户信息,子客户Id->%s", customerId)); |
|
|
|
} |
|
|
|
|
|
|
|
//3.分批处理上传数据
|
|
|
|
List<List<GmUploadDataFormDTO.DataList>> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); |
|
|
@ -236,6 +243,8 @@ public class StatsUserServiceImpl implements StatsUserService { |
|
|
|
} |
|
|
|
}); |
|
|
|
if (bl.get()) { |
|
|
|
m.setSourceType("external"); |
|
|
|
m.setParentCustomerId(crm.getParentCustomerId()); |
|
|
|
m.setPid(pid.toString()); |
|
|
|
m.setPids(pids.toString()); |
|
|
|
} else { |
|
|
|