|
@ -165,9 +165,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict |
|
|
log.info("districtPartyAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); |
|
|
log.info("districtPartyAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); |
|
|
log.info("districtPartyAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); |
|
|
log.info("districtPartyAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); |
|
|
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); |
|
|
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); |
|
|
agencyScoreDao.deleteOldRecord(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL); |
|
|
deleteOldRecord(customerId,monthId,IndexCalConstant.DISTRICT_LEVEL); |
|
|
agencySubScoreDao.deleteOldRecord(customerId,monthId,IndexCalConstant.DISTRICT_LEVEL); |
|
|
insertDetail(result); |
|
|
deleteAndInsert(result); |
|
|
|
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -236,7 +235,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict |
|
|
log.info("districtGovernAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); |
|
|
log.info("districtGovernAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); |
|
|
log.info("districtGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); |
|
|
log.info("districtGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); |
|
|
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); |
|
|
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); |
|
|
deleteAndInsert(result); |
|
|
insertDetail(result); |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -286,7 +285,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict |
|
|
log.info("districtServiceAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); |
|
|
log.info("districtServiceAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); |
|
|
log.info("districtServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); |
|
|
log.info("districtServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); |
|
|
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); |
|
|
AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); |
|
|
deleteAndInsert(result); |
|
|
insertDetail(result); |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -347,6 +346,25 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @Description |
|
|
|
|
|
* @param customerId |
|
|
|
|
|
* @param monthId |
|
|
|
|
|
* @param dataType 数据类型 (街道:street,全区:district) |
|
|
|
|
|
* @author zxc |
|
|
|
|
|
* @date 2020/9/10 2:50 下午 |
|
|
|
|
|
*/ |
|
|
|
|
|
public void deleteOldRecord(String customerId,String monthId,String dataType){ |
|
|
|
|
|
Integer num; |
|
|
|
|
|
do { |
|
|
|
|
|
num = agencyScoreDao.deleteOldRecord(customerId, monthId,dataType,IndexCalConstant.DELETE_SIZE); |
|
|
|
|
|
}while (num != NumConstant.ZERO); |
|
|
|
|
|
Integer subNum; |
|
|
|
|
|
do { |
|
|
|
|
|
subNum = agencySubScoreDao.deleteOldRecord(customerId,monthId,dataType,IndexCalConstant.DELETE_SIZE); |
|
|
|
|
|
}while (subNum != NumConstant.ZERO); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param result |
|
|
* @param result |
|
|
* @Description 先删除记录,在插入 |
|
|
* @Description 先删除记录,在插入 |
|
@ -354,12 +372,18 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict |
|
|
* @date 2020/9/1 4:24 下午 |
|
|
* @date 2020/9/1 4:24 下午 |
|
|
*/ |
|
|
*/ |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public void deleteAndInsert(AgencyCalResultDTO result) { |
|
|
public void insertDetail(AgencyCalResultDTO result) { |
|
|
if (!CollectionUtils.isEmpty(result.getOneTwoLevel())){ |
|
|
if (!CollectionUtils.isEmpty(result.getOneTwoLevel())){ |
|
|
agencyScoreDao.insertStreetRecord(result.getOneTwoLevel()); |
|
|
List<List<AgencyScoreDTO>> partition = ListUtils.partition(result.getOneTwoLevel(), IndexCalConstant.INSERT_SIZE); |
|
|
|
|
|
partition.forEach(p -> { |
|
|
|
|
|
agencyScoreDao.insertStreetRecord(p); |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
if (!CollectionUtils.isEmpty(result.getFiveLevel())){ |
|
|
if (!CollectionUtils.isEmpty(result.getFiveLevel())){ |
|
|
agencySubScoreDao.insertStreetRecord(result.getFiveLevel()); |
|
|
List<List<AgencyScoreDTO>> partition = ListUtils.partition(result.getFiveLevel(), IndexCalConstant.INSERT_SIZE); |
|
|
|
|
|
partition.forEach(p -> { |
|
|
|
|
|
agencySubScoreDao.insertStreetRecord(p); |
|
|
|
|
|
}); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|