|
|
@ -25,6 +25,7 @@ import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.constant.DimAgencyConstant; |
|
|
|
import com.epmet.constant.RobotConstant; |
|
|
|
import com.epmet.constant.StatsSubject; |
|
|
|
import com.epmet.dao.stats.DimAgencyDao; |
|
|
@ -44,7 +45,6 @@ import java.util.Arrays; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* 机关维度 |
|
|
@ -125,22 +125,47 @@ public class DimAgencyServiceImpl extends BaseServiceImpl<DimAgencyDao, DimAgenc |
|
|
|
@Override |
|
|
|
public void initAgencyDims(List<CustomerAgencyEntity> agencies) { |
|
|
|
for (CustomerAgencyEntity agency : agencies) { |
|
|
|
DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); |
|
|
|
dimAgencyEntity.setAgencyName(agency.getOrganizationName()); |
|
|
|
dimAgencyEntity.setAllParentName(agency.getAllParentName()); |
|
|
|
dimAgencyEntity.setCustomerId(agency.getCustomerId()); |
|
|
|
dimAgencyEntity.setLevel(agency.getLevel()); |
|
|
|
dimAgencyEntity.setPid(agency.getPid()); |
|
|
|
dimAgencyEntity.setPids(agency.getPids()); |
|
|
|
dimAgencyEntity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); |
|
|
|
dimAgencyEntity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); |
|
|
|
dimAgencyEntity.setId(agency.getId()); |
|
|
|
baseDao.insert(dimAgencyEntity); |
|
|
|
initAgencyAllDim(agency); |
|
|
|
initAgencySelfDim(agency); |
|
|
|
} |
|
|
|
|
|
|
|
lastExecRecordDao.updateExecTimeBySubject(new Date(), StatsSubject.DIM_AGENCY); |
|
|
|
} |
|
|
|
|
|
|
|
public void initAgencyAllDim(CustomerAgencyEntity agency) { |
|
|
|
DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); |
|
|
|
dimAgencyEntity.setAgencyName(agency.getOrganizationName()); |
|
|
|
dimAgencyEntity.setAllParentName(agency.getAllParentName()); |
|
|
|
dimAgencyEntity.setCustomerId(agency.getCustomerId()); |
|
|
|
dimAgencyEntity.setLevel(agency.getLevel()); |
|
|
|
dimAgencyEntity.setAgencyDimType(DimAgencyConstant.TYPE_ALL); |
|
|
|
dimAgencyEntity.setPid(agency.getPid()); |
|
|
|
dimAgencyEntity.setPids(agency.getPids()); |
|
|
|
dimAgencyEntity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); |
|
|
|
dimAgencyEntity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); |
|
|
|
dimAgencyEntity.setId(agency.getId()); |
|
|
|
baseDao.insert(dimAgencyEntity); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 初始化机关单位本身的维度(不包含本身) |
|
|
|
* @param agency |
|
|
|
*/ |
|
|
|
public void initAgencySelfDim(CustomerAgencyEntity agency) { |
|
|
|
DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); |
|
|
|
dimAgencyEntity.setAgencyName(agency.getOrganizationName()); |
|
|
|
dimAgencyEntity.setAllParentName(agency.getAllParentName()); |
|
|
|
dimAgencyEntity.setCustomerId(agency.getCustomerId()); |
|
|
|
dimAgencyEntity.setLevel(agency.getLevel()); |
|
|
|
dimAgencyEntity.setPid(agency.getId()); |
|
|
|
dimAgencyEntity.setAgencyDimType(DimAgencyConstant.TYPE_SELF); |
|
|
|
dimAgencyEntity.setPids(agency.getPids().concat(":").concat(agency.getId())); |
|
|
|
dimAgencyEntity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); |
|
|
|
dimAgencyEntity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); |
|
|
|
dimAgencyEntity.setId(agency.getId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX)); |
|
|
|
baseDao.insert(dimAgencyEntity); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 查询所有机关以及它下级机关的信息 |
|
|
|
* @param |
|
|
|