diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index c5d269e36f..7ebedfc864 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -11,21 +11,23 @@ import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao; import com.epmet.dao.stats.DimCustomerDao; import com.epmet.dao.stats.DimDateDao; import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; -import com.epmet.dto.extract.form.ScreenExtractFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; +import com.epmet.entity.evaluationindex.screen.ScreenIndexDataMonthlyEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimCustomerEntity; import com.epmet.entity.stats.DimDateEntity; @@ -37,8 +39,6 @@ import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollCommunityS import com.epmet.service.evaluationindex.extract.dataToIndex.IndexCollStreetService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; -import com.epmet.service.evaluationindex.extract.todata.GroupExtractService; -import com.epmet.service.evaluationindex.extract.todata.ProjectExtractService; import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; @@ -718,5 +718,42 @@ public class DemoController { } + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description screen_index_data_monthly 赋值ALL_PARENT_IDS + * @Date 2020/10/10 17:59 + **/ + @DataSource(DataSourceConstant.EVALUATION_INDEX) + @PostMapping("updateDeptIndexMonthly") + public Result updateDeptIndexMonthly(){ + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq("ORG_TYPE", "department"); + List list=screenIndexDataMonthlyDao.selectList(wrapper); + int updateNum=0; + for(ScreenIndexDataMonthlyEntity entity:list){ + if(StringUtils.isNotBlank(entity.getParentId())){ + ScreenCustomerAgencyEntity agencyEntity=screenCustomerAgencyDao.selectByAgencyId(entity.getParentId()); + if(null!=agencyEntity){ + //根组织下的部门 + if("0".equals(agencyEntity.getPid())){ + log.info("根组织下的部门"); + entity.setAllParentIds(agencyEntity.getAgencyId()); + }else{ + entity.setAllParentIds(agencyEntity.getPids().concat(",").concat(agencyEntity.getAgencyId())); + } + updateNum+=screenIndexDataMonthlyDao.updateParentIdsById(entity.getId(),entity.getAllParentIds()); + } + } + } + log.info("影响行数="+updateNum); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 925c5c728f..ecb417b9b6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -95,4 +95,6 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao + + + update screen_index_data_monthly m3 + SET m3.ALL_PARENT_IDS =#{allParentIds} + where m3.id=#{id} +