Browse Source

screen_index_data_monthly 赋值ALL_PARENT_IDS

dev_shibei_match
yinzuomei 5 years ago
parent
commit
35150537ca
  1. 45
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  2. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  3. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java
  4. 6
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml

45
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<ScreenIndexDataMonthlyEntity> wrapper = new QueryWrapper<>();
wrapper.eq("ORG_TYPE", "department");
List<ScreenIndexDataMonthlyEntity> 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();
}
}

2
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<ScreenIndexDataMonthl
Integer deleteIndexDataMonthlyByOrgType(@Param("customerId") String customerId,
@Param("monthId") String monthId,
@Param("orgType") String orgType);
int updateParentIdsById(@Param("id") String id, @Param("allParentIds") String allParentIds);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenIndexDataMonthlyEntity.java

@ -109,4 +109,6 @@ public class ScreenIndexDataMonthlyEntity extends BaseEpmetEntity {
* 治理能力分数权重
*/
private BigDecimal governAblityWeight;
private String allParentIds;
}

6
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml

@ -99,4 +99,10 @@
where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} AND ORG_TYPE = #{orgType}
limit 1000;
</delete>
<update id="updateParentIdsById" parameterType="map">
update screen_index_data_monthly m3
SET m3.ALL_PARENT_IDS =#{allParentIds}
where m3.id=#{id}
</update>
</mapper>

Loading…
Cancel
Save