|
@ -110,7 +110,21 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
} while (deleteNum != NumConstant.ZERO); |
|
|
} while (deleteNum != NumConstant.ZERO); |
|
|
} |
|
|
} |
|
|
if (!CollectionUtils.isEmpty(formDTO.getDataList())) { |
|
|
if (!CollectionUtils.isEmpty(formDTO.getDataList())) { |
|
|
screenPartyUserRankDataDao.batchInsertPartyUserRankData(formDTO.getDataList(), customerId); |
|
|
List<PartyUserRankDataFormDTO> list = new ArrayList<>(); |
|
|
|
|
|
formDTO.getDataList().forEach(item -> { |
|
|
|
|
|
if (StringUtils.isEmpty(item.getGridId())) { |
|
|
|
|
|
log.warn("gridId is null,userId:{}", item.getUserId()); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
list.add(item); |
|
|
|
|
|
if (list.size() == NumConstant.ONE_HUNDRED) { |
|
|
|
|
|
screenPartyUserRankDataDao.batchInsertPartyUserRankData(list, customerId); |
|
|
|
|
|
list.clear(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
if (list.size() > NumConstant.ZERO) { |
|
|
|
|
|
screenPartyUserRankDataDao.batchInsertPartyUserRankData(list, customerId); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -134,7 +148,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void insertPartyBranchData(PartyBranchDataListFormDTO formDTO, String customerId) { |
|
|
public void insertPartyBranchData(PartyBranchDataListFormDTO formDTO, String customerId) { |
|
|
if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { |
|
|
if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { |
|
|
throw new RenException("monthId格式应为: yyyyMM,当前传入:"+formDTO.getMonthId()); |
|
|
throw new RenException("monthId格式应为: yyyyMM,当前传入:" + formDTO.getMonthId()); |
|
|
} |
|
|
} |
|
|
if (formDTO.getIsFirst()) { |
|
|
if (formDTO.getIsFirst()) { |
|
|
int deleteNum; |
|
|
int deleteNum; |
|
@ -152,7 +166,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void insertOrgRankData(OrgRankDataListFormDTO formDTO, String customerId) { |
|
|
public void insertOrgRankData(OrgRankDataListFormDTO formDTO, String customerId) { |
|
|
if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { |
|
|
if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { |
|
|
throw new RenException("monthId格式应为: yyyyMM,当前传入:"+formDTO.getMonthId()); |
|
|
throw new RenException("monthId格式应为: yyyyMM,当前传入:" + formDTO.getMonthId()); |
|
|
} |
|
|
} |
|
|
if (formDTO.getIsFirst()) { |
|
|
if (formDTO.getIsFirst()) { |
|
|
int deleteNum; |
|
|
int deleteNum; |
|
@ -170,7 +184,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void insertGovernRankData(GovernRankDataListFormDTO formDTO, String customerId) { |
|
|
public void insertGovernRankData(GovernRankDataListFormDTO formDTO, String customerId) { |
|
|
if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { |
|
|
if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { |
|
|
throw new RenException("monthId格式应为: yyyyMM,当前传入:"+formDTO.getMonthId()); |
|
|
throw new RenException("monthId格式应为: yyyyMM,当前传入:" + formDTO.getMonthId()); |
|
|
} |
|
|
} |
|
|
if (formDTO.getIsFirst()) { |
|
|
if (formDTO.getIsFirst()) { |
|
|
int deleteNum; |
|
|
int deleteNum; |
|
@ -261,7 +275,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void insertIndexDataMonthly(IndexDataListMonthlyFormDTO formDTO, String customerId) { |
|
|
public void insertIndexDataMonthly(IndexDataListMonthlyFormDTO formDTO, String customerId) { |
|
|
if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { |
|
|
if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { |
|
|
throw new RenException("monthId格式应为: yyyyMM,当前传入:"+formDTO.getMonthId()); |
|
|
throw new RenException("monthId格式应为: yyyyMM,当前传入:" + formDTO.getMonthId()); |
|
|
} |
|
|
} |
|
|
if (formDTO.getIsFirst()) { |
|
|
if (formDTO.getIsFirst()) { |
|
|
int deleteNum; |
|
|
int deleteNum; |
|
@ -359,7 +373,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void insertUserJoin(UserJoinListFormDTO formDTO, String customerId) { |
|
|
public void insertUserJoin(UserJoinListFormDTO formDTO, String customerId) { |
|
|
if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { |
|
|
if (StringUtils.isEmpty(formDTO.getMonthId()) || formDTO.getMonthId().length() != NumConstant.SIX) { |
|
|
throw new RenException("monthId格式应为: yyyyMM,当前传入:"+formDTO.getMonthId()); |
|
|
throw new RenException("monthId格式应为: yyyyMM,当前传入:" + formDTO.getMonthId()); |
|
|
} |
|
|
} |
|
|
if (formDTO.getIsFirst()) { |
|
|
if (formDTO.getIsFirst()) { |
|
|
int deleteNum; |
|
|
int deleteNum; |
|
@ -377,7 +391,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
/*String[] lastMonth = this.lastMonthDate(); |
|
|
/*String[] lastMonth = this.lastMonthDate(); |
|
|
// 获取上个月的基本数据
|
|
|
// 获取上个月的基本数据
|
|
|
String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE];*/ |
|
|
String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE];*/ |
|
|
String monthId= DateUtils.getBeforeNMonthByMonth(1,formDTO.getMonthId()); |
|
|
String monthId = DateUtils.getBeforeNMonthByMonth(1, formDTO.getMonthId()); |
|
|
List<ScreenUserJoinEntity> lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, |
|
|
List<ScreenUserJoinEntity> lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, |
|
|
monthId, |
|
|
monthId, |
|
|
orgIds); |
|
|
orgIds); |
|
@ -386,7 +400,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
List<ScreenUserJoinEntity> curMonthJoinEntityList = new ArrayList<>(); |
|
|
List<ScreenUserJoinEntity> curMonthJoinEntityList = new ArrayList<>(); |
|
|
// 增加率计算
|
|
|
// 增加率计算
|
|
|
if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO) { |
|
|
if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO) { |
|
|
log.info("当前传入的monthId="+formDTO.getMonthId()+";数据集合长度="+formDTO.getDataList()+";当前monthId的上月已有数据集合长度="+lastMonthJoinList.size()); |
|
|
log.info("当前传入的monthId=" + formDTO.getMonthId() + ";数据集合长度=" + formDTO.getDataList() + ";当前monthId的上月已有数据集合长度=" + lastMonthJoinList.size()); |
|
|
// 存在上个月的数据 (本月-上月)/上月 *100
|
|
|
// 存在上个月的数据 (本月-上月)/上月 *100
|
|
|
for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { |
|
|
for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { |
|
|
for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++) { |
|
|
for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++) { |
|
@ -403,7 +417,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
log.info("当前传入的monthId="+formDTO.getMonthId()+";数据集合长度="+formDTO.getDataList()+";当前monthId上月不存在数据。"); |
|
|
log.info("当前传入的monthId=" + formDTO.getMonthId() + ";数据集合长度=" + formDTO.getDataList() + ";当前monthId上月不存在数据。"); |
|
|
// 计算增长率后的 待新增数据
|
|
|
// 计算增长率后的 待新增数据
|
|
|
BigDecimal zero = new BigDecimal(NumConstant.ZERO); |
|
|
BigDecimal zero = new BigDecimal(NumConstant.ZERO); |
|
|
// 不存在上个月的数据
|
|
|
// 不存在上个月的数据
|
|
@ -428,7 +442,7 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public Integer initBizOrg(CustomerBizOrgFormDTO formDTO) { |
|
|
public Integer initBizOrg(CustomerBizOrgFormDTO formDTO) { |
|
|
ValidatorUtils.validateEntity(formDTO); |
|
|
ValidatorUtils.validateEntity(formDTO); |
|
|
List<ScreenCustomerAgencyEntity> entityList = screenCustomerAgencyDao.selectListAgencyInfo(formDTO.getCustomerId(),null,null); |
|
|
List<ScreenCustomerAgencyEntity> entityList = screenCustomerAgencyDao.selectListAgencyInfo(formDTO.getCustomerId(), null, null); |
|
|
List<ScreenCustomerBizOrgEntity> list = new ArrayList<>(); |
|
|
List<ScreenCustomerBizOrgEntity> list = new ArrayList<>(); |
|
|
if (CollectionUtils.isEmpty(entityList)) { |
|
|
if (CollectionUtils.isEmpty(entityList)) { |
|
|
return 0; |
|
|
return 0; |
|
|