49 changed files with 2399 additions and 66 deletions
			
			
		@ -0,0 +1,33 @@ | 
				
			|||
package com.epmet.dataaggre.dto.datastats.form; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import javax.validation.constraints.NotBlank; | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 治理实况-组织/网格下响应解决满意自治率-接口入参 | 
				
			|||
 * @Auth sun | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class GovrnRatioFormDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = -3381286960911634231L; | 
				
			|||
    /** | 
				
			|||
     * 组织Id | 
				
			|||
     */ | 
				
			|||
    @NotBlank(message = "组织或网格Id不能为空", groups = GovrnRatioFormDTO.AgencyGrid.class) | 
				
			|||
    private String orgId; | 
				
			|||
    /** | 
				
			|||
     * 组织:agency  网格:grid | 
				
			|||
     */ | 
				
			|||
    @NotBlank(message = "网格Id不能为空", groups = GovrnRatioFormDTO.AgencyGrid.class) | 
				
			|||
    private String orgType; | 
				
			|||
    /** | 
				
			|||
     * 日维度Id[日期,不传值默认查前一天的【格式:20210101】] | 
				
			|||
     */ | 
				
			|||
    private String dateId; | 
				
			|||
    public interface AgencyGrid extends CustomerClientShowGroup {} | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,27 @@ | 
				
			|||
package com.epmet.dataaggre.dto.datastats.result; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Description 治理实况-组织/网格下响应解决满意自治率-接口返参 | 
				
			|||
 * @Auth sun | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class GovrnRatioResultDTO implements Serializable { | 
				
			|||
    private static final long serialVersionUID = 466974582608407121L; | 
				
			|||
    //组织或网格Id
 | 
				
			|||
    private String orgId; | 
				
			|||
    //组织:agency  网格:grid
 | 
				
			|||
    private String orgType; | 
				
			|||
    //响应率
 | 
				
			|||
    private String responseRatio = "0%"; | 
				
			|||
    //解决率
 | 
				
			|||
    private String resolvedRatio = "0%"; | 
				
			|||
    //自治率
 | 
				
			|||
    private String governRatio = "0%"; | 
				
			|||
    //满意率
 | 
				
			|||
    private String satisfactionRatio = "0%"; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,37 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.dataaggre.dao.evaluationindex; | 
				
			|||
 | 
				
			|||
import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; | 
				
			|||
import org.apache.ibatis.annotations.Mapper; | 
				
			|||
import org.apache.ibatis.annotations.Param; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Author sun | 
				
			|||
 * @Description  指标统计服务 | 
				
			|||
 */ | 
				
			|||
@Mapper | 
				
			|||
public interface EvaluationIndexDao { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * @Param formDTO | 
				
			|||
     * @Description 按类型、日期查询治理指数下响应解决满意自治四个统计率 | 
				
			|||
     * @author sun | 
				
			|||
     */ | 
				
			|||
    GovrnRatioResultDTO getAgnecyOrGridGoverRatio(@Param("orgId") String orgId, @Param("orgType") String orgType, @Param("dateId") String dateId); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,18 @@ | 
				
			|||
package com.epmet.dataaggre.service.evaluationindex; | 
				
			|||
 | 
				
			|||
import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO; | 
				
			|||
import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Author sun | 
				
			|||
 * @Description  指标统计服务 | 
				
			|||
 */ | 
				
			|||
public interface EvaluationIndexService { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * @Param formDTO | 
				
			|||
     * @Description 治理实况-组织/网格下响应解决满意自治率 | 
				
			|||
     * @author sun | 
				
			|||
     */ | 
				
			|||
    GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,40 @@ | 
				
			|||
package com.epmet.dataaggre.service.evaluationindex.impl; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; | 
				
			|||
import com.epmet.commons.tools.utils.DateUtils; | 
				
			|||
import com.epmet.dataaggre.constant.DataSourceConstant; | 
				
			|||
import com.epmet.dataaggre.dao.datastats.DataStatsDao; | 
				
			|||
import com.epmet.dataaggre.dao.evaluationindex.EvaluationIndexDao; | 
				
			|||
import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO; | 
				
			|||
import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; | 
				
			|||
import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; | 
				
			|||
import lombok.extern.slf4j.Slf4j; | 
				
			|||
import org.apache.commons.lang3.StringUtils; | 
				
			|||
import org.springframework.beans.factory.annotation.Autowired; | 
				
			|||
import org.springframework.stereotype.Service; | 
				
			|||
 | 
				
			|||
import java.text.SimpleDateFormat; | 
				
			|||
import java.util.Date; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @Author sun | 
				
			|||
 * @Description 指标统计服务 | 
				
			|||
 */ | 
				
			|||
@Service | 
				
			|||
@DataSource(DataSourceConstant.EVALUATION_INDEX) | 
				
			|||
@Slf4j | 
				
			|||
public class EvaluationIndexServiceImpl implements EvaluationIndexService { | 
				
			|||
    @Autowired | 
				
			|||
    private EvaluationIndexDao evaluationIndexDao; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * @Param formDTO | 
				
			|||
     * @Description 按类型、日期查询治理指数下响应解决满意自治四个统计率 | 
				
			|||
     * @author sun | 
				
			|||
     */ | 
				
			|||
    @Override | 
				
			|||
    public GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO) { | 
				
			|||
        return  evaluationIndexDao.getAgnecyOrGridGoverRatio(formDTO.getOrgId(),formDTO.getOrgType(),formDTO.getDateId()); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,23 @@ | 
				
			|||
<?xml version="1.0" encoding="UTF-8"?> | 
				
			|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 
				
			|||
 | 
				
			|||
<mapper namespace="com.epmet.dataaggre.dao.evaluationindex.EvaluationIndexDao"> | 
				
			|||
 | 
				
			|||
    <select id="getAgnecyOrGridGoverRatio" resultType="com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO"> | 
				
			|||
        SELECT | 
				
			|||
            org_id AS orgId, | 
				
			|||
            org_type AS orgType, | 
				
			|||
            CONCAT(ROUND(response_ratio, 1), '%') AS responseRatio, | 
				
			|||
            CONCAT(ROUND(resolved_ratio, 1) , '%')AS resolvedRatio, | 
				
			|||
            CONCAT(ROUND(govern_ratio, 1), '%') AS governRatio, | 
				
			|||
            CONCAT(ROUND(satisfaction_ratio, 1), '%') AS satisfactionRatio | 
				
			|||
        FROM | 
				
			|||
            screen_govern_rank_data_daily | 
				
			|||
        WHERE | 
				
			|||
            del_flag = '0' | 
				
			|||
        AND org_id = #{orgId} | 
				
			|||
        AND org_type = #{orgType} | 
				
			|||
        AND date_id = #{dateId} | 
				
			|||
    </select> | 
				
			|||
 | 
				
			|||
</mapper> | 
				
			|||
@ -0,0 +1,17 @@ | 
				
			|||
package com.epmet.dto.project; | 
				
			|||
 | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * @author zhaoqifeng | 
				
			|||
 * @dscription | 
				
			|||
 * @date 2021/5/21 10:53 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class ProjectPointDTO implements Serializable { | 
				
			|||
	private static final long serialVersionUID = -592430619162380664L; | 
				
			|||
	private String projectId; | 
				
			|||
	private Integer point; | 
				
			|||
} | 
				
			|||
@ -0,0 +1,132 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.dto.screen; | 
				
			|||
 | 
				
			|||
import java.io.Serializable; | 
				
			|||
import java.util.Date; | 
				
			|||
import lombok.Data; | 
				
			|||
 | 
				
			|||
import java.math.BigDecimal; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 基层治理-治理能力排行数据(按月统计) | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-05-24 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
public class ScreenGovernRankDataDailyDTO implements Serializable { | 
				
			|||
 | 
				
			|||
    private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * ID 主键 | 
				
			|||
     */ | 
				
			|||
	private String id; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 客户Id | 
				
			|||
     */ | 
				
			|||
	private String customerId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 年Id | 
				
			|||
     */ | 
				
			|||
	private String yearId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 月份Id | 
				
			|||
     */ | 
				
			|||
	private String monthId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 数据更新至:yyyyMMdd | 
				
			|||
     */ | 
				
			|||
	private String dateId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 组织类别 agency:组织;部门:department;网格:grid | 
				
			|||
     */ | 
				
			|||
	private String orgType; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 组织Id 可以为网格,机关id | 
				
			|||
     */ | 
				
			|||
	private String orgId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 上级组织Id | 
				
			|||
     */ | 
				
			|||
	private String parentId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 组织名称 | 
				
			|||
     */ | 
				
			|||
	private String orgName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 响应率 | 
				
			|||
     */ | 
				
			|||
	private BigDecimal responseRatio; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 解决率 | 
				
			|||
     */ | 
				
			|||
	private BigDecimal resolvedRatio; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 自治率 | 
				
			|||
     */ | 
				
			|||
	private BigDecimal governRatio; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 满意率 | 
				
			|||
     */ | 
				
			|||
	private BigDecimal satisfactionRatio; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 删除标识 0未删除;1已删除 | 
				
			|||
     */ | 
				
			|||
	private String delFlag; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 乐观锁 | 
				
			|||
     */ | 
				
			|||
	private Integer revision; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建人 | 
				
			|||
     */ | 
				
			|||
	private String createdBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 创建时间 | 
				
			|||
     */ | 
				
			|||
	private Date createdTime; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新人 | 
				
			|||
     */ | 
				
			|||
	private String updatedBy; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 更新时间 | 
				
			|||
     */ | 
				
			|||
	private Date updatedTime; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,33 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.dao.evaluationindex.extract; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.dao.BaseDao; | 
				
			|||
import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; | 
				
			|||
import org.apache.ibatis.annotations.Mapper; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 组织的治理指数,按天统计 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-05-24 | 
				
			|||
 */ | 
				
			|||
@Mapper | 
				
			|||
public interface FactAgencyGovernDailyDao extends BaseDao<FactAgencyGovernDailyEntity> { | 
				
			|||
	 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,68 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.dao.evaluationindex.screen; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.dao.BaseDao; | 
				
			|||
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; | 
				
			|||
import org.apache.ibatis.annotations.Mapper; | 
				
			|||
import org.apache.ibatis.annotations.Param; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 基层治理-治理能力排行数据(按月统计) | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-05-24 | 
				
			|||
 */ | 
				
			|||
@Mapper | 
				
			|||
public interface ScreenGovernRankDataDailyDao extends BaseDao<ScreenGovernRankDataDailyEntity> { | 
				
			|||
	/** | 
				
			|||
	 * 组织级别初始化数据 | 
				
			|||
	 * @author zhaoqifeng | 
				
			|||
	 * @date 2020/9/24 14:52 | 
				
			|||
	 * @param customerId | 
				
			|||
	 * @param level | 
				
			|||
	 * @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity> | 
				
			|||
	 */ | 
				
			|||
	List<ScreenGovernRankDataDailyEntity> initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level); | 
				
			|||
 | 
				
			|||
	/** | 
				
			|||
	 * 网格级别初始化数据 | 
				
			|||
	 * @author zhaoqifeng | 
				
			|||
	 * @date 2020/9/24 14:52 | 
				
			|||
	 * @param customerId | 
				
			|||
	 * @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity> | 
				
			|||
	 */ | 
				
			|||
	List<ScreenGovernRankDataDailyEntity> initGridDataList(@Param("customerId") String customerId); | 
				
			|||
 | 
				
			|||
	/** | 
				
			|||
	 * 删除旧数据 | 
				
			|||
	 * @author zhaoqifeng | 
				
			|||
	 * @date 2020/9/25 10:38 | 
				
			|||
	 * @param customerId | 
				
			|||
	 * @param orgType | 
				
			|||
	 * @param dateId | 
				
			|||
	 * @param deleteSize | 
				
			|||
	 * @param orgIds | 
				
			|||
	 * @return java.lang.Integer | 
				
			|||
	 */ | 
				
			|||
	Integer deleteRankData(@Param("customerId") String customerId, @Param("orgType") String orgType, @Param("dateId") String dateId, | 
				
			|||
						   @Param("deleteSize") Integer deleteSize, | 
				
			|||
						   @Param("orgIds")List<String> orgIds); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,174 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.entity.evaluationindex.extract; | 
				
			|||
 | 
				
			|||
import com.baomidou.mybatisplus.annotation.TableName; | 
				
			|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; | 
				
			|||
import lombok.Data; | 
				
			|||
import lombok.EqualsAndHashCode; | 
				
			|||
 | 
				
			|||
import java.math.BigDecimal; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 组织的治理指数,按天统计 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-05-24 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
@EqualsAndHashCode(callSuper=false) | 
				
			|||
@TableName("fact_agency_govern_daily") | 
				
			|||
public class FactAgencyGovernDailyEntity extends BaseEpmetEntity { | 
				
			|||
 | 
				
			|||
	private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 客户id | 
				
			|||
     */ | 
				
			|||
	private String customerId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 数据更新至:yyyyMMdd;  | 
				
			|||
     */ | 
				
			|||
	private String dateId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 组织id | 
				
			|||
     */ | 
				
			|||
	private String agencyId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * agency_id所属的机关级别(社区级:community, | 
				
			|||
乡(镇、街道)级:street, | 
				
			|||
区县级: district, | 
				
			|||
市级: city | 
				
			|||
省级:province) | 
				
			|||
     */ | 
				
			|||
	private String level; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 组织i所属的组织id | 
				
			|||
     */ | 
				
			|||
	private String pid; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 组织i所有上级id | 
				
			|||
     */ | 
				
			|||
	private String pids; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 界面展示:问题解决总数=1+2+3+4+5+6+7+8 | 
				
			|||
     */ | 
				
			|||
	private Integer problemResolvedCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数 | 
				
			|||
     */ | 
				
			|||
	private BigDecimal groupSelfGovernRatio; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数 | 
				
			|||
     */ | 
				
			|||
	private BigDecimal gridSelfGovernRatio; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 | 
				
			|||
     */ | 
				
			|||
	private BigDecimal communityClosedRatio; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 | 
				
			|||
     */ | 
				
			|||
	private BigDecimal streetClosedRatio; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 | 
				
			|||
     */ | 
				
			|||
	private BigDecimal districtDeptClosedRatio; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 1、当前组织内,话题关闭已解决数 | 
				
			|||
     */ | 
				
			|||
	private Integer topicResolvedCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 2、当前组织内,话题关闭无需解决数 | 
				
			|||
     */ | 
				
			|||
	private Integer topicUnResolvedCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 3、当前组织内,议题关闭已解决数 | 
				
			|||
     */ | 
				
			|||
	private Integer issueResolvedCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 4、当前组织内,议题关闭无需解决数 | 
				
			|||
     */ | 
				
			|||
	private Integer issueUnResolvedCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 5、当前组织内:来源于议题的项目:结案已解决数 | 
				
			|||
     */ | 
				
			|||
	private Integer issueProjectResolvedCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 6、当前组织内:来源于议题的项目:结案无需解决数 | 
				
			|||
     */ | 
				
			|||
	private Integer issueProjectUnResolvedCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 7、当前组织内:项目立项,结案已解决数;默认为0, | 
				
			|||
     */ | 
				
			|||
	private Integer approvalProjectResolvedCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 8、当前组织内:项目立项,结案无需解决数;默认为0, | 
				
			|||
     */ | 
				
			|||
	private Integer approvalProjectUnResolvedCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 9、当前组织内,未出小组即未转议题的:话题关闭已解决数 | 
				
			|||
     */ | 
				
			|||
	private Integer inGroupTopicResolvedCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 10、当前组织内,未出小组即未转议题的:话题关闭无需解决数 | 
				
			|||
     */ | 
				
			|||
	private Integer inGroupTopicUnResolvedCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 未出当前网格的,结案项目数 | 
				
			|||
     */ | 
				
			|||
	private Integer gridSelfGovernProjectTotal; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 当前组织内结案的项目中:由社区结案的项目总数 | 
				
			|||
     */ | 
				
			|||
	private Integer communityClosedCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 当前组织内结案的项目中:由街道结案的项目总数 | 
				
			|||
     */ | 
				
			|||
	private Integer streetClosedCount; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 当前组织内结案的项目中:由区直部门结案的项目总数 | 
				
			|||
     */ | 
				
			|||
	private Integer districtDeptClosedCount; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,102 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.entity.evaluationindex.screen; | 
				
			|||
 | 
				
			|||
import com.baomidou.mybatisplus.annotation.TableName; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; | 
				
			|||
import lombok.Data; | 
				
			|||
import lombok.EqualsAndHashCode; | 
				
			|||
 | 
				
			|||
import java.math.BigDecimal; | 
				
			|||
import java.util.Date; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 基层治理-治理能力排行数据(按月统计) | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-05-24 | 
				
			|||
 */ | 
				
			|||
@Data | 
				
			|||
@EqualsAndHashCode(callSuper=false) | 
				
			|||
@TableName("screen_govern_rank_data_daily") | 
				
			|||
public class ScreenGovernRankDataDailyEntity extends BaseEpmetEntity { | 
				
			|||
 | 
				
			|||
	private static final long serialVersionUID = 1L; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 客户Id | 
				
			|||
     */ | 
				
			|||
	private String customerId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 年Id | 
				
			|||
     */ | 
				
			|||
	private String yearId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 月份Id | 
				
			|||
     */ | 
				
			|||
	private String monthId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 数据更新至:yyyyMMdd | 
				
			|||
     */ | 
				
			|||
	private String dateId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 组织类别 agency:组织;部门:department;网格:grid | 
				
			|||
     */ | 
				
			|||
	private String orgType; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 组织Id 可以为网格,机关id | 
				
			|||
     */ | 
				
			|||
	private String orgId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 上级组织Id | 
				
			|||
     */ | 
				
			|||
	private String parentId; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 组织名称 | 
				
			|||
     */ | 
				
			|||
	private String orgName; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 响应率 | 
				
			|||
     */ | 
				
			|||
	private BigDecimal responseRatio; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 解决率 | 
				
			|||
     */ | 
				
			|||
	private BigDecimal resolvedRatio; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 自治率 | 
				
			|||
     */ | 
				
			|||
	private BigDecimal governRatio; | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 满意率 | 
				
			|||
     */ | 
				
			|||
	private BigDecimal satisfactionRatio; | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,46 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.service.evaluationindex.extract.todata; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.service.BaseService; | 
				
			|||
import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 组织的治理指数,按天统计 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-05-24 | 
				
			|||
 */ | 
				
			|||
public interface FactAgencyGovernDailyService extends BaseService<FactAgencyGovernDailyEntity> { | 
				
			|||
    // 问题解决总数:当前组织下,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和
 | 
				
			|||
    // 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
 | 
				
			|||
    // 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格)
 | 
				
			|||
    // 参考:fact_index_govrn_ablity_grid_monthly的SELF_SOLVE_PROJECT_COUNT计算
 | 
				
			|||
    // 社区解决占比:当前组织下,由社区结案的项目数与问题解决总数之比
 | 
				
			|||
    // 区直部门解决占比:当前组织下,由区级部门结案的项目数与问题解决总数之比
 | 
				
			|||
    // 街道解决占比:当前组织下,由街道结案的项目数与问题解决总数之比
 | 
				
			|||
    // 自下而上的项目解决:结案时操作人所代表的的处理部门(可以是网格、街道、组织)
 | 
				
			|||
    // 自上而下的项目解决:向下吹哨,谁立项谁解决(后期在讨论哪样更合理)
 | 
				
			|||
    //
 | 
				
			|||
    // 究竟是谁解决!!:
 | 
				
			|||
    // A社区→A街道→B社区(结案)——A街道解决(自下而上吹(饱含立项往上吹/从话题来的项目),看往上吹的最高层级)
 | 
				
			|||
    // A社区→B社区→C社区(结案)——C社区解决(平级协助解决,看最后结案)
 | 
				
			|||
    // A街道→A社区→B社区(结案)——A街道解决(自上而下吹,谁立项谁解决)
 | 
				
			|||
    // 注:A社区→A街道→(退回)A社区→B社区(结案),A街道不算处理项目,仍是平级协助解决,看最后谁结案
 | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,37 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.service.evaluationindex.extract.todata.impl; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			|||
import com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao; | 
				
			|||
import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; | 
				
			|||
import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService; | 
				
			|||
import org.springframework.stereotype.Service; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 组织的治理指数,按天统计 | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-05-24 | 
				
			|||
 */ | 
				
			|||
@Service | 
				
			|||
public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgencyGovernDailyDao, FactAgencyGovernDailyEntity> implements FactAgencyGovernDailyService { | 
				
			|||
 | 
				
			|||
 | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,121 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.service.evaluationindex.screen; | 
				
			|||
 | 
				
			|||
import com.epmet.commons.mybatis.service.BaseService; | 
				
			|||
import com.epmet.commons.tools.page.PageData; | 
				
			|||
import com.epmet.dto.screen.ScreenGovernRankDataDailyDTO; | 
				
			|||
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; | 
				
			|||
 | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 基层治理-治理能力排行数据(按月统计) | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-05-24 | 
				
			|||
 */ | 
				
			|||
public interface ScreenGovernRankDataDailyService extends BaseService<ScreenGovernRankDataDailyEntity> { | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认分页 | 
				
			|||
     * | 
				
			|||
     * @param params | 
				
			|||
     * @return PageData<ScreenGovernRankDataDailyDTO> | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-05-24 | 
				
			|||
     */ | 
				
			|||
    PageData<ScreenGovernRankDataDailyDTO> page(Map<String, Object> params); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认查询 | 
				
			|||
     * | 
				
			|||
     * @param params | 
				
			|||
     * @return java.util.List<ScreenGovernRankDataDailyDTO> | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-05-24 | 
				
			|||
     */ | 
				
			|||
    List<ScreenGovernRankDataDailyDTO> list(Map<String, Object> params); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 单条查询 | 
				
			|||
     * | 
				
			|||
     * @param id | 
				
			|||
     * @return ScreenGovernRankDataDailyDTO | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-05-24 | 
				
			|||
     */ | 
				
			|||
    ScreenGovernRankDataDailyDTO get(String id); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认保存 | 
				
			|||
     * | 
				
			|||
     * @param dto | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-05-24 | 
				
			|||
     */ | 
				
			|||
    void save(ScreenGovernRankDataDailyDTO dto); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 默认更新 | 
				
			|||
     * | 
				
			|||
     * @param dto | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-05-24 | 
				
			|||
     */ | 
				
			|||
    void update(ScreenGovernRankDataDailyDTO dto); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 批量删除 | 
				
			|||
     * | 
				
			|||
     * @param ids | 
				
			|||
     * @return void | 
				
			|||
     * @author generator | 
				
			|||
     * @date 2021-05-24 | 
				
			|||
     */ | 
				
			|||
    void delete(String[] ids); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 构造screen_govern_rank_data 初始数据,先赋值为0 | 
				
			|||
     * | 
				
			|||
     * @param customerId | 
				
			|||
     * @param orgType | 
				
			|||
     * @param agencyLevel | 
				
			|||
     * @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity> | 
				
			|||
     * @author zhaoqifeng | 
				
			|||
     * @date 2020/9/24 14:41 | 
				
			|||
     */ | 
				
			|||
    List<ScreenGovernRankDataDailyEntity> initList(String customerId, String orgType, String agencyLevel); | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 保存抽取结果 | 
				
			|||
     * | 
				
			|||
     * @param customerId | 
				
			|||
     * @param orgType | 
				
			|||
     * @param dateId | 
				
			|||
     * @param deleteSize | 
				
			|||
     * @param entityList | 
				
			|||
     * @return void | 
				
			|||
     * @author zhaoqifeng | 
				
			|||
     * @date 2020/9/25 10:32 | 
				
			|||
     */ | 
				
			|||
    void delAndSaveRankData(String customerId, String orgType, String dateId, Integer deleteSize, List<ScreenGovernRankDataDailyEntity> entityList); | 
				
			|||
} | 
				
			|||
@ -0,0 +1,170 @@ | 
				
			|||
/** | 
				
			|||
 * Copyright 2018 人人开源 https://www.renren.io
 | 
				
			|||
 * <p> | 
				
			|||
 * This program is free software: you can redistribute it and/or modify | 
				
			|||
 * it under the terms of the GNU General Public License as published by | 
				
			|||
 * the Free Software Foundation, either version 3 of the License, or | 
				
			|||
 * (at your option) any later version. | 
				
			|||
 * <p> | 
				
			|||
 * This program is distributed in the hope that it will be useful, | 
				
			|||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
				
			|||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
				
			|||
 * GNU General Public License for more details. | 
				
			|||
 * <p> | 
				
			|||
 * You should have received a copy of the GNU General Public License | 
				
			|||
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
				
			|||
 */ | 
				
			|||
 | 
				
			|||
package com.epmet.service.evaluationindex.screen.impl; | 
				
			|||
 | 
				
			|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; | 
				
			|||
import com.baomidou.mybatisplus.core.metadata.IPage; | 
				
			|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; | 
				
			|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; | 
				
			|||
import com.epmet.commons.tools.constant.FieldConstant; | 
				
			|||
import com.epmet.commons.tools.constant.NumConstant; | 
				
			|||
import com.epmet.commons.tools.page.PageData; | 
				
			|||
import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			|||
import com.epmet.constant.DataSourceConstant; | 
				
			|||
import com.epmet.constant.OrgTypeConstant; | 
				
			|||
import com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDailyDao; | 
				
			|||
import com.epmet.dto.screen.ScreenGovernRankDataDailyDTO; | 
				
			|||
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; | 
				
			|||
import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; | 
				
			|||
import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataDailyService; | 
				
			|||
import lombok.extern.slf4j.Slf4j; | 
				
			|||
import org.apache.commons.collections4.CollectionUtils; | 
				
			|||
import org.apache.commons.lang3.StringUtils; | 
				
			|||
import org.springframework.stereotype.Service; | 
				
			|||
import org.springframework.transaction.annotation.Transactional; | 
				
			|||
 | 
				
			|||
import java.util.ArrayList; | 
				
			|||
import java.util.Arrays; | 
				
			|||
import java.util.List; | 
				
			|||
import java.util.Map; | 
				
			|||
 | 
				
			|||
/** | 
				
			|||
 * 基层治理-治理能力排行数据(按月统计) | 
				
			|||
 * | 
				
			|||
 * @author generator generator@elink-cn.com | 
				
			|||
 * @since v1.0.0 2021-05-24 | 
				
			|||
 */ | 
				
			|||
@Service | 
				
			|||
@Slf4j | 
				
			|||
@DataSource(DataSourceConstant.EVALUATION_INDEX) | 
				
			|||
public class ScreenGovernRankDataDailyServiceImpl extends BaseServiceImpl<ScreenGovernRankDataDailyDao, ScreenGovernRankDataDailyEntity> implements ScreenGovernRankDataDailyService { | 
				
			|||
 | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public PageData<ScreenGovernRankDataDailyDTO> page(Map<String, Object> params) { | 
				
			|||
        IPage<ScreenGovernRankDataDailyEntity> page = baseDao.selectPage( | 
				
			|||
                getPage(params, FieldConstant.CREATED_TIME, false), | 
				
			|||
                getWrapper(params) | 
				
			|||
        ); | 
				
			|||
        return getPageData(page, ScreenGovernRankDataDailyDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public List<ScreenGovernRankDataDailyDTO> list(Map<String, Object> params) { | 
				
			|||
        List<ScreenGovernRankDataDailyEntity> entityList = baseDao.selectList(getWrapper(params)); | 
				
			|||
 | 
				
			|||
        return ConvertUtils.sourceToTarget(entityList, ScreenGovernRankDataDailyDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    private QueryWrapper<ScreenGovernRankDataDailyEntity> getWrapper(Map<String, Object> params){ | 
				
			|||
        String id = (String)params.get(FieldConstant.ID_HUMP); | 
				
			|||
 | 
				
			|||
        QueryWrapper<ScreenGovernRankDataDailyEntity> wrapper = new QueryWrapper<>(); | 
				
			|||
        wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); | 
				
			|||
 | 
				
			|||
        return wrapper; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    public ScreenGovernRankDataDailyDTO get(String id) { | 
				
			|||
        ScreenGovernRankDataDailyEntity entity = baseDao.selectById(id); | 
				
			|||
        return ConvertUtils.sourceToTarget(entity, ScreenGovernRankDataDailyDTO.class); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void save(ScreenGovernRankDataDailyDTO dto) { | 
				
			|||
        ScreenGovernRankDataDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenGovernRankDataDailyEntity.class); | 
				
			|||
        insert(entity); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void update(ScreenGovernRankDataDailyDTO dto) { | 
				
			|||
        ScreenGovernRankDataDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenGovernRankDataDailyEntity.class); | 
				
			|||
        updateById(entity); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void delete(String[] ids) { | 
				
			|||
        // 逻辑删除(@TableLogic 注解)
 | 
				
			|||
        baseDao.deleteBatchIds(Arrays.asList(ids)); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 构造screen_govern_rank_data 初始数据,先赋值为0 | 
				
			|||
     * | 
				
			|||
     * @param customerId | 
				
			|||
     * @param orgType | 
				
			|||
     * @param agencyLevel | 
				
			|||
     * @return java.util.List<com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity> | 
				
			|||
     * @author zhaoqifeng | 
				
			|||
     * @date 2020/9/24 14:41 | 
				
			|||
     */ | 
				
			|||
    @Override | 
				
			|||
    public List<ScreenGovernRankDataDailyEntity> initList(String customerId, String orgType, String agencyLevel) { | 
				
			|||
        List<ScreenGovernRankDataDailyEntity> list = new ArrayList<>(); | 
				
			|||
        switch (orgType) { | 
				
			|||
            case OrgTypeConstant.AGENCY: | 
				
			|||
                log.info("组织级别统计"); | 
				
			|||
                list = baseDao.initAgencyDataList(customerId, agencyLevel); | 
				
			|||
                break; | 
				
			|||
            case OrgTypeConstant.GRID: | 
				
			|||
                log.info("网格级别统计"); | 
				
			|||
                list = baseDao.initGridDataList(customerId); | 
				
			|||
                break; | 
				
			|||
            default: | 
				
			|||
                log.info("部门级别统计"); | 
				
			|||
                break; | 
				
			|||
        } | 
				
			|||
        return list; | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
    /** | 
				
			|||
     * 保存抽取结果 | 
				
			|||
     * | 
				
			|||
     * @param customerId | 
				
			|||
     * @param orgType | 
				
			|||
     * @param dateId | 
				
			|||
     * @param deleteSize | 
				
			|||
     * @param entityList | 
				
			|||
     * @return void | 
				
			|||
     * @author zhaoqifeng | 
				
			|||
     * @date 2020/9/25 10:32 | 
				
			|||
     */ | 
				
			|||
    @Override | 
				
			|||
    @Transactional(rollbackFor = Exception.class) | 
				
			|||
    public void delAndSaveRankData(String customerId, String orgType, String dateId, Integer deleteSize, | 
				
			|||
                                   List<ScreenGovernRankDataDailyEntity> entityList) { | 
				
			|||
        if (CollectionUtils.isEmpty(entityList)) { | 
				
			|||
            return; | 
				
			|||
        } | 
				
			|||
        List<String> orgIds = new ArrayList<>(); | 
				
			|||
        for (ScreenGovernRankDataDailyEntity entity : entityList) { | 
				
			|||
            orgIds.add(entity.getOrgId()); | 
				
			|||
        } | 
				
			|||
        int deleteNum; | 
				
			|||
        do { | 
				
			|||
            deleteNum = baseDao.deleteRankData(customerId, orgType, dateId, deleteSize, orgIds); | 
				
			|||
        } while (deleteNum != NumConstant.ZERO); | 
				
			|||
 | 
				
			|||
        insertBatch(entityList); | 
				
			|||
    } | 
				
			|||
 | 
				
			|||
} | 
				
			|||
@ -0,0 +1,8 @@ | 
				
			|||
<?xml version="1.0" encoding="UTF-8"?> | 
				
			|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 
				
			|||
 | 
				
			|||
<mapper namespace="com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao"> | 
				
			|||
 | 
				
			|||
 | 
				
			|||
 | 
				
			|||
</mapper> | 
				
			|||
@ -0,0 +1,80 @@ | 
				
			|||
<?xml version="1.0" encoding="UTF-8"?> | 
				
			|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | 
				
			|||
 | 
				
			|||
<mapper namespace="com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDailyDao"> | 
				
			|||
 | 
				
			|||
    <resultMap type="com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity" id="screenGovernRankDataDailyMap"> | 
				
			|||
        <result property="id" column="ID"/> | 
				
			|||
        <result property="customerId" column="CUSTOMER_ID"/> | 
				
			|||
        <result property="yearId" column="YEAR_ID"/> | 
				
			|||
        <result property="monthId" column="MONTH_ID"/> | 
				
			|||
        <result property="dateId" column="DATE_ID"/> | 
				
			|||
        <result property="orgType" column="ORG_TYPE"/> | 
				
			|||
        <result property="orgId" column="ORG_ID"/> | 
				
			|||
        <result property="parentId" column="PARENT_ID"/> | 
				
			|||
        <result property="orgName" column="ORG_NAME"/> | 
				
			|||
        <result property="responseRatio" column="RESPONSE_RATIO"/> | 
				
			|||
        <result property="resolvedRatio" column="RESOLVED_RATIO"/> | 
				
			|||
        <result property="governRatio" column="GOVERN_RATIO"/> | 
				
			|||
        <result property="satisfactionRatio" column="SATISFACTION_RATIO"/> | 
				
			|||
        <result property="delFlag" column="DEL_FLAG"/> | 
				
			|||
        <result property="revision" column="REVISION"/> | 
				
			|||
        <result property="createdBy" column="CREATED_BY"/> | 
				
			|||
        <result property="createdTime" column="CREATED_TIME"/> | 
				
			|||
        <result property="updatedBy" column="UPDATED_BY"/> | 
				
			|||
        <result property="updatedTime" column="UPDATED_TIME"/> | 
				
			|||
    </resultMap> | 
				
			|||
    <delete id="deleteRankData"> | 
				
			|||
        delete from screen_govern_rank_data_daily | 
				
			|||
        where CUSTOMER_ID = #{customerId} | 
				
			|||
        AND DATE_ID <= #{dateId} | 
				
			|||
        <if test='null != orgType and "" != orgType'> | 
				
			|||
            and ORG_TYPE=#{orgType} | 
				
			|||
        </if> | 
				
			|||
        <if test='null!=orgIds and orgIds.size()>0'> | 
				
			|||
            and | 
				
			|||
            ( | 
				
			|||
            <foreach collection="orgIds" item="orgId" separator=" OR "> | 
				
			|||
                ORG_ID = #{orgId} | 
				
			|||
            </foreach> | 
				
			|||
            ) | 
				
			|||
        </if> | 
				
			|||
        limit #{deleteSize} | 
				
			|||
    </delete> | 
				
			|||
 | 
				
			|||
    <select id="initAgencyDataList" resultType="com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity"> | 
				
			|||
        SELECT DISTINCT | 
				
			|||
            CUSTOMER_ID, | 
				
			|||
            'agency' AS ORG_TYPE, | 
				
			|||
            AGENCY_ID AS ORG_ID, | 
				
			|||
            PID AS PARENT_ID, | 
				
			|||
            AGENCY_NAME AS ORG_NAME, | 
				
			|||
            0 AS RESPONSE_RATIO, | 
				
			|||
            0 AS RESOLVED_RATIO, | 
				
			|||
            0 AS GOVERN_RATIO, | 
				
			|||
            0 AS SATISFACTION_RATIO | 
				
			|||
        FROM | 
				
			|||
            screen_customer_agency | 
				
			|||
        WHERE | 
				
			|||
            CUSTOMER_ID = #{customerId} | 
				
			|||
          AND `LEVEL` = #{level} | 
				
			|||
    </select> | 
				
			|||
    <select id="initGridDataList" resultType="com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity"> | 
				
			|||
        SELECT DISTINCT | 
				
			|||
            CUSTOMER_ID, | 
				
			|||
            'grid' AS ORG_TYPE, | 
				
			|||
            GRID_ID AS ORG_ID, | 
				
			|||
            PARENT_AGENCY_ID AS PARENT_ID, | 
				
			|||
            GRID_NAME AS ORG_NAME, | 
				
			|||
            0 AS RESPONSE_RATIO, | 
				
			|||
            0 AS RESOLVED_RATIO, | 
				
			|||
            0 AS GOVERN_RATIO, | 
				
			|||
            0 AS SATISFACTION_RATIO | 
				
			|||
        FROM | 
				
			|||
            screen_customer_grid | 
				
			|||
        WHERE | 
				
			|||
            CUSTOMER_ID = #{customerId} | 
				
			|||
    </select> | 
				
			|||
 | 
				
			|||
 | 
				
			|||
</mapper> | 
				
			|||
					Loading…
					
					
				
		Reference in new issue