|
|
@ -8,7 +8,7 @@ import com.epmet.commons.tools.utils.Result; |
|
|
|
import com.epmet.constant.DataSourceConstant; |
|
|
|
import com.epmet.dto.indexcal.CalculateCommonFormDTO; |
|
|
|
import com.epmet.feign.EpmetCommonServiceOpenFeignClient; |
|
|
|
import com.epmet.redis.IndexCodeFieldReRedis; |
|
|
|
import com.epmet.redis.IndexCalRedis; |
|
|
|
import com.epmet.service.evaluationindex.indexcal.*; |
|
|
|
import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; |
|
|
|
import com.epmet.util.DimIdGenerator; |
|
|
@ -36,7 +36,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { |
|
|
|
@Autowired |
|
|
|
private CpcIndexCalculateService cpcIndexCalculateService; |
|
|
|
@Autowired |
|
|
|
private IndexCodeFieldReRedis indexCodeFieldReRedis; |
|
|
|
private IndexCalRedis indexCalRedis; |
|
|
|
@Autowired |
|
|
|
private IndexCalculateCommunityService indexCalculateCommunityService; |
|
|
|
@Autowired |
|
|
@ -70,13 +70,31 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { |
|
|
|
} |
|
|
|
Boolean flag = false; |
|
|
|
for (String customerId : customerIds) { |
|
|
|
CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); |
|
|
|
CalculateCommonFormDTO param = new CalculateCommonFormDTO(); |
|
|
|
param.setCustomerId(customerId); |
|
|
|
param.setMonthId(formDTO.getMonthId()); |
|
|
|
flag = calulateCustomerIndexScore(param); |
|
|
|
} |
|
|
|
return flag; |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO)); |
|
|
|
} finally { |
|
|
|
//清除缓存
|
|
|
|
indexCalRedis.deleteIndexCodeFromRedis(); |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
private Boolean calulateCustomerIndexScore(CalculateCommonFormDTO formDTO) { |
|
|
|
try { |
|
|
|
String customerId = formDTO.getCustomerId(); |
|
|
|
Boolean flag; |
|
|
|
long start = System.currentTimeMillis(); |
|
|
|
try { |
|
|
|
//计算党员相关的
|
|
|
|
try { |
|
|
|
CalculateCommonFormDTO param = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); |
|
|
|
flag = cpcIndexCalculateService.cpcIndexCalculate(param); |
|
|
|
|
|
|
|
flag = cpcIndexCalculateService.cpcIndexCalculate(formDTO); |
|
|
|
log.info("客户Id:{}【党员相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("indexCalculate cpcIndexCalculate exception", e); |
|
|
@ -87,7 +105,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { |
|
|
|
//计算网格
|
|
|
|
start = System.currentTimeMillis(); |
|
|
|
try { |
|
|
|
flag = gridCorreLationService.calculateGridCorreLation(calculateCommonFormDTO); |
|
|
|
flag = gridCorreLationService.calculateGridCorreLation(formDTO); |
|
|
|
log.info("客户Id:{}【网格相关】计算完毕,总耗时:{}秒,result:{},result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("indexCalculate calculateGridCorreLation exception", e); |
|
|
@ -116,7 +134,7 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { |
|
|
|
//计算区直属
|
|
|
|
start = System.currentTimeMillis(); |
|
|
|
try { |
|
|
|
flag = deptScoreService.calculateDeptCorreLation(calculateCommonFormDTO); |
|
|
|
flag = deptScoreService.calculateDeptCorreLation(formDTO); |
|
|
|
log.info("客户Id:{}【区直部门】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("indexCalculate calculateDeptCorreLation exception", e); |
|
|
@ -147,13 +165,11 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { |
|
|
|
flag = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return flag; |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("indexCalculate exception,param:{}", JSON.toJSONString(formDTO)); |
|
|
|
log.error("calulateCustomerIndexScore exception", e); |
|
|
|
} finally { |
|
|
|
//清除缓存
|
|
|
|
indexCodeFieldReRedis.deleteIndexCodeFromRedis(); |
|
|
|
indexCalRedis.deleteIndexCodeWeightFromRedis(formDTO.getCustomerId()); |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|