Browse Source

Merge branch 'dev_fix_dim'

dev_shibei_match
wxz 5 years ago
parent
commit
5432fffc04
  1. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java
  2. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java
  3. 7
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  4. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java
  5. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java
  6. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java
  7. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java
  8. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.service.evaluationindex.screen.impl; package com.epmet.service.evaluationindex.screen.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
@ -141,6 +142,13 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ
exists.setAllParentNames(e.getAllParentName()); exists.setAllParentNames(e.getAllParentName());
exists.setParentAreaCode(e.getParentAreaCode()); exists.setParentAreaCode(e.getParentAreaCode());
updateAgency(exists); updateAgency(exists);
// 已删除数据的处理
if ("1".equals(e.getDelFlag())) {
LambdaQueryWrapper<ScreenCustomerAgencyEntity> w = new LambdaQueryWrapper<>();
w.eq(ScreenCustomerAgencyEntity::getAgencyId, e.getId());
screenCustomerAgencyDao.delete(w);
}
} }
} }
} }

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerDeptServiceImpl.java

@ -17,6 +17,7 @@
package com.epmet.service.evaluationindex.screen.impl; package com.epmet.service.evaluationindex.screen.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
@ -90,6 +91,13 @@ public class ScreenCustomerDeptServiceImpl extends BaseServiceImpl<ScreenCustome
e.setCustomerId(dept.getCustomerId()); e.setCustomerId(dept.getCustomerId());
e.setAreaCode(dept.getAreaCode()); e.setAreaCode(dept.getAreaCode());
screenCustomerDeptDao.updateById(e); screenCustomerDeptDao.updateById(e);
// 已删除数据的处理
if ("1".equals(dept.getDelFlag())) {
LambdaQueryWrapper<ScreenCustomerDeptEntity> w = new LambdaQueryWrapper<>();
w.eq(ScreenCustomerDeptEntity::getDeptId, dept.getId());
screenCustomerDeptDao.delete(w);
}
} }
} }
} }

7
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java

@ -18,6 +18,7 @@
package com.epmet.service.evaluationindex.screen.impl; package com.epmet.service.evaluationindex.screen.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
@ -94,6 +95,12 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl<ScreenCustome
screenGrid.setGridName(grid.getGridName()); screenGrid.setGridName(grid.getGridName());
screenGrid.setAreaCode(grid.getAreaCode()); screenGrid.setAreaCode(grid.getAreaCode());
screenCustomerGridDao.updateById(screenGrid); screenCustomerGridDao.updateById(screenGrid);
if ("1".equals(grid.getDelFlag())) {
LambdaQueryWrapper<ScreenCustomerGridEntity> w = new LambdaQueryWrapper<>();
w.eq(ScreenCustomerGridEntity::getGridId, grid.getId());
screenCustomerGridDao.delete(w);
}
} }
} }
} }

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java

@ -106,6 +106,10 @@ public class StatsDimServiceImpl implements StatsDimService {
dimGrid.setGridName(updatedGrid.getGridName()); dimGrid.setGridName(updatedGrid.getGridName());
dimGrid.setUpdatedTime(now); dimGrid.setUpdatedTime(now);
dimGrid.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); dimGrid.setUpdatedBy(RobotConstant.DIMENSION_ROBOT);
dimGrid.setDelFlag(updatedGrid.getDelFlag());
dimGrid.setAgencyId(updatedGrid.getPid());
dimGrid.setAreaCode(updatedGrid.getAreaCode());
dimGrid.setCustomerId(updatedGrid.getCustomerId());
dimGrids.add(dimGrid); dimGrids.add(dimGrid);
} }
} }

9
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java

@ -139,9 +139,18 @@ public class DimAgencyServiceImpl extends BaseServiceImpl<DimAgencyDao, DimAgenc
if (existsDimAgency != null) { if (existsDimAgency != null) {
//说明是已存在的,不是新增的 //说明是已存在的,不是新增的
existsDimAgency.setAgencyName(agency.getOrganizationName()); existsDimAgency.setAgencyName(agency.getOrganizationName());
existsDimAgency.setAllParentName(agency.getAllParentName());
existsDimAgency.setCustomerId(agency.getCustomerId());
existsDimAgency.setLevel(agency.getLevel());
existsDimAgency.setPid(agency.getPid());
existsDimAgency.setPids(agency.getPids());
existsDimAgency.setUpdatedTime(initTime); existsDimAgency.setUpdatedTime(initTime);
existsDimAgency.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); existsDimAgency.setUpdatedBy(RobotConstant.DIMENSION_ROBOT);
baseDao.updateById(existsDimAgency); baseDao.updateById(existsDimAgency);
if ("1".equals(agency.getDelFlag())) {
baseDao.deleteById(agency.getId());
}
} }
} }

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java

@ -146,6 +146,10 @@ public class DimCustomerServiceImpl extends BaseServiceImpl<DimCustomerDao, DimC
existsCustomerDim.setUpdatedTime(initTime); existsCustomerDim.setUpdatedTime(initTime);
existsCustomerDim.setAreaCode(updatedCustomer.getAreaCode()); existsCustomerDim.setAreaCode(updatedCustomer.getAreaCode());
baseDao.updateById(existsCustomerDim); baseDao.updateById(existsCustomerDim);
if ("1".equals(updatedCustomer.getDelFlag())) {
baseDao.deleteById(updatedCustomer.getId());
}
} }
} }

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java

@ -132,9 +132,15 @@ public class DimDepartmentServiceImpl extends BaseServiceImpl<DimDepartmentDao,
DimDepartmentEntity dimDepartment = baseDao.selectById(updatedDepartment.getId()); DimDepartmentEntity dimDepartment = baseDao.selectById(updatedDepartment.getId());
if (dimDepartment != null) { if (dimDepartment != null) {
dimDepartment.setDepartmentName(updatedDepartment.getDepartmentName()); dimDepartment.setDepartmentName(updatedDepartment.getDepartmentName());
dimDepartment.setAgencyId(updatedDepartment.getAgencyId());
dimDepartment.setCustomerId(updatedDepartment.getCustomerId());
dimDepartment.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); dimDepartment.setUpdatedBy(RobotConstant.DIMENSION_ROBOT);
dimDepartment.setUpdatedTime(initTime); dimDepartment.setUpdatedTime(initTime);
baseDao.updateById(dimDepartment); baseDao.updateById(dimDepartment);
if ("1".equals(updatedDepartment.getDelFlag())) {
baseDao.deleteById(updatedDepartment.getId());
}
} }
} }

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java

@ -128,6 +128,10 @@ public class DimGridServiceImpl extends BaseServiceImpl<DimGridDao, DimGridEntit
for (DimGridEntity updatedGridDim : changedGrids) { for (DimGridEntity updatedGridDim : changedGrids) {
baseDao.updateById(updatedGridDim); baseDao.updateById(updatedGridDim);
if ("1".equals(updatedGridDim.getDelFlag())) {
// 如果已经被删除了,那么这里也做删除操作
baseDao.deleteById(updatedGridDim.getId());
}
} }
lastExecRecordDao.updateExecTimeBySubject(new Date(), StatsSubject.DIM_GRID); lastExecRecordDao.updateExecTimeBySubject(new Date(), StatsSubject.DIM_GRID);

Loading…
Cancel
Save