Browse Source

代码调整

dev_shibei_match
jianjun 5 years ago
parent
commit
2b64a6519e
  1. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java

@ -91,9 +91,10 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
private Boolean calulateCustomerIndexScore(CalculateCommonFormDTO formDTO) { private Boolean calulateCustomerIndexScore(CalculateCommonFormDTO formDTO) {
try { try {
String customerId = formDTO.getCustomerId(); String customerId = formDTO.getCustomerId();
Boolean flag = false; Boolean insertFlag = true;
long start = System.currentTimeMillis(); long start = System.currentTimeMillis();
try { try {
Boolean flag = false;
//校验是否含有组织数据 //校验是否含有组织数据
int agencyCount = screenCustomerAgencyDao.selectCountByCustomerId(formDTO.getCustomerId()); int agencyCount = screenCustomerAgencyDao.selectCountByCustomerId(formDTO.getCustomerId());
if (agencyCount < 1) { if (agencyCount < 1) {
@ -148,27 +149,28 @@ public class IndexCalculateServiceImpl implements IndexCalculateService {
//计算全区 //计算全区
start = System.currentTimeMillis(); start = System.currentTimeMillis();
try { try {
indexCalculateDistrictService.calDistrictAll(customerId, formDTO.getMonthId()); flag = indexCalculateDistrictService.calDistrictAll(customerId, formDTO.getMonthId());
log.info("客户Id:{}【全区相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag); log.info("客户Id:{}【全区相关】计算完毕,总耗时:{}秒,result:{}", customerId, (System.currentTimeMillis() - start) / 1000, flag);
} catch (Exception e) { } catch (Exception e) {
log.error("indexCalculate calDistrictAll exception", e); log.error("indexCalculate calDistrictAll exception", e);
} }
} catch (RenException e) { } catch (RenException e) {
flag = false; insertFlag = false;
} }
//计算完毕后 将结果插入大屏相关数据表 //计算完毕后 将结果插入大屏相关数据表 计算当月的数据时 及时有错也插入
if (flag) { String currentMonthId = DimIdGenerator.getMonthDimId(new Date());
if (insertFlag || currentMonthId.equals(formDTO.getMonthId())) {
start = System.currentTimeMillis(); start = System.currentTimeMillis();
try { try {
factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(formDTO.getMonthId(), formDTO.getCustomerId()); factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(formDTO.getMonthId(), formDTO.getCustomerId());
log.info("客户Id:{}分数插入到大屏显示库完毕,总耗时:{}秒", customerId, (System.currentTimeMillis() - start) / 1000); log.info("客户Id:{}分数插入到大屏显示库完毕,总耗时:{}秒", customerId, (System.currentTimeMillis() - start) / 1000);
} catch (Exception e) { } catch (Exception e) {
log.error("indexCalculate insertScreenIndexDataMonthlyAndYearly exception", e); log.error("indexCalculate insertScreenIndexDataMonthlyAndYearly exception", e);
flag = false; insertFlag = false;
} }
} }
return flag; return insertFlag;
} catch (Exception e) { } catch (Exception e) {
log.error("calulateCustomerIndexScore exception", e); log.error("calulateCustomerIndexScore exception", e);
} finally { } finally {

Loading…
Cancel
Save