15 changed files with 300 additions and 4 deletions
			
			
		@ -0,0 +1,19 @@ | 
				
			|||
package com.epmet.service.evaluationindex.extract.toscreen; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * screen_public_parti_total_data | 
				
			|||
 * 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数   按天统计 | 
				
			|||
 * @author yinzuomei@elink-cn.com | 
				
			|||
 * @date 2020/9/27 11:09 | 
				
			|||
 */ | 
				
			|||
public interface PublicPartiTotalDataExtractService { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 按天统计 | 
				
			|||
     * | 
				
			|||
     * @param customerId 客户id | 
				
			|||
     * @param dateId yyyyMMdd  这一列存储到 screen_public_parti_total_data表中的数据更新至: yyyy|yyyyMM|yyyyMMdd | 
				
			|||
     * @return | 
				
			|||
     */ | 
				
			|||
    void extractPublicPartiTotalData(String customerId,String dateId); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,68 @@ | 
				
			|||
package com.epmet.service.evaluationindex.extract.toscreen.impl; | 
				
			|||
 | 
				
			|||
import com.epmet.entity.evaluationindex.screen.ScreenPublicPartiTotalDataEntity; | 
				
			|||
import com.epmet.entity.evaluationindex.screen.ScreenUserTotalDataEntity; | 
				
			|||
import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueLogDailyService; | 
				
			|||
import com.epmet.service.evaluationindex.extract.toscreen.PublicPartiTotalDataExtractService; | 
				
			|||
import com.epmet.service.evaluationindex.screen.ScreenPublicPartiTotalDataService; | 
				
			|||
import com.epmet.service.evaluationindex.screen.ScreenUserTotalDataService; | 
				
			|||
import lombok.extern.slf4j.Slf4j; | 
				
			|||
import org.apache.commons.collections4.CollectionUtils; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.stereotype.Service; | 
				
			|||
 | 
				
			|||
import java.util.ArrayList; | 
				
			|||
import java.util.List; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * screen_public_parti_total_data | 
				
			|||
 * 公众参与-各类(话题|议题|项目|注册人数|参与人数)总数   按天统计 | 
				
			|||
 * @author yinzuomei@elink-cn.com | 
				
			|||
 * @date 2020/9/27 11:09 | 
				
			|||
 */ | 
				
			|||
@Slf4j | 
				
			|||
@Service | 
				
			|||
public class PublicPartiTotalDataExtractServiceImpl implements PublicPartiTotalDataExtractService { | 
				
			|||
    @Autowired | 
				
			|||
    private ScreenUserTotalDataService screenUserTotalDataService; | 
				
			|||
    @Autowired | 
				
			|||
    private ScreenPublicPartiTotalDataService screenPublicPartiTotalDataService; | 
				
			|||
    @Autowired | 
				
			|||
    private FactOriginIssueLogDailyService factOriginIssueLogDailyService; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 按天统计 | 
				
			|||
     * | 
				
			|||
     * @param customerId 客户id | 
				
			|||
     * @param dateId     yyyyMMdd  这一列存储到 screen_public_parti_total_data表中的数据更新至: yyyy|yyyyMM|yyyyMMdd | 
				
			|||
     * @return | 
				
			|||
     */ | 
				
			|||
    @Override | 
				
			|||
    public void extractPublicPartiTotalData(String customerId, String dateId) { | 
				
			|||
        List<ScreenUserTotalDataEntity> userTotalDataEntityList = screenUserTotalDataService.selectList(customerId); | 
				
			|||
        if (CollectionUtils.isEmpty(userTotalDataEntityList)) { | 
				
			|||
            log.warn("screen_user_total_data dosen't have any record "); | 
				
			|||
            return; | 
				
			|||
        } | 
				
			|||
        List<ScreenPublicPartiTotalDataEntity> list = new ArrayList<>(); | 
				
			|||
        for (ScreenUserTotalDataEntity totalData : userTotalDataEntityList) { | 
				
			|||
            ScreenPublicPartiTotalDataEntity entity = new ScreenPublicPartiTotalDataEntity(); | 
				
			|||
            entity.setCustomerId(customerId); | 
				
			|||
            entity.setOrgType(totalData.getOrgType()); | 
				
			|||
            entity.setOrgId(totalData.getOrgId()); | 
				
			|||
            entity.setParentId(totalData.getParentId()); | 
				
			|||
            entity.setOrgName(totalData.getOrgName()); | 
				
			|||
            entity.setDataEndTime(dateId); | 
				
			|||
            entity.setTopicTotal(totalData.getTopicTotal()); | 
				
			|||
            entity.setIssueTotal(totalData.getIssueTotal()); | 
				
			|||
            entity.setProjectTotal(totalData.getProjectTotal()); | 
				
			|||
            entity.setRegUserTotal(totalData.getUserTotal()); | 
				
			|||
            //参与人数参与人数:  议题的表决行为的用户数去重的累计值
 | 
				
			|||
            int joinUserTotal=factOriginIssueLogDailyService.queryJoinUserTotal(customerId,totalData.getOrgType(),totalData.getOrgId()); | 
				
			|||
            entity.setJoinUserTotal(joinUserTotal); | 
				
			|||
            list.add(entity); | 
				
			|||
        } | 
				
			|||
        //先删除,后插入
 | 
				
			|||
        screenPublicPartiTotalDataService.delAndInsertBatch(customerId, list); | 
				
			|||
    } | 
				
			|||
} | 
				
			|||
					Loading…
					
					
				
		Reference in new issue