Browse Source

生成fact_index_cpc_score、fact_index_grid_score

master
yinzuomei 5 years ago
parent
commit
8ebe8b6b73
  1. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java
  2. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java
  3. 87
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java
  4. 92
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/GridScoreEntity.java
  5. 47
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java
  6. 26
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml
  7. 27
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/CpcScoreDao.java

@ -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.indexscore;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.indexscore.CpcScoreEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 党员相关分值
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-31
*/
@Mapper
public interface CpcScoreDao extends BaseDao<CpcScoreEntity> {
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/indexscore/GridScoreDao.java

@ -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.indexscore;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.indexscore.GridScoreEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 网格相关分值
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-08-31
*/
@Mapper
public interface GridScoreDao extends BaseDao<GridScoreEntity> {
}

87
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/CpcScoreEntity.java

@ -0,0 +1,87 @@
/**
* 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.indexscore;
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 2020-08-31
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_index_cpc_score")
public class CpcScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 网格所属的机关Id
*/
private String agencyId;
/**
* 网格Id
*/
private String gridId;
/**
* 用户id
*/
private String userId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 党建能力分值
*/
private BigDecimal partyAblityScore;
/**
* 参与议事分值
*/
private BigDecimal joinIssueScore;
/**
* 党务活动分值
*/
private BigDecimal partyWorkActScore;
/**
* 联系群众分值
*/
private BigDecimal contactMassesScore;
}

92
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/indexscore/GridScoreEntity.java

@ -0,0 +1,92 @@
/**
* 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.indexscore;
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 2020-08-31
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("fact_index_grid_score")
public class GridScoreEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户Id
*/
private String customerId;
/**
* 网格Id
*/
private String gridId;
/**
* 网格所属的机关Id
*/
private String agencyId;
/**
* 季度ID
*/
private String quarterId;
/**
* 年度ID
*/
private String yearId;
/**
* 月维度Id: yyyyMM
*/
private String monthId;
/**
* 总指数分值
*/
private BigDecimal totalScore;
/**
* 党建能力分值
*/
private BigDecimal partyAblityScore;
/**
* 治理能力分值
*/
private BigDecimal govrnAblityScore;
/**
* 服务能力分值
*/
private BigDecimal serviceAblityScore;
}

47
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/indexcal/impl/GridCorreLationServiceImpl.java

@ -136,12 +136,13 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
SampleValue<BigDecimal> currentGridIndexValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), new BigDecimal(sampleValueStr));
value.getIndexValueVOs().add(currentGridIndexValue);
} else if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(key)) {
//组织内党员的联系群众能力考评分(平均值) TODO
logger.info("组织内党员的联系群众能力考评分(平均值) TODO");
//组织内党员的联系群众能力考评分(平均值)
logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理");
//网格内党员的联系群众能力考评分(平均值)
/* BigDecimal contactResiAblity = null;
SampleValue<BigDecimal> contactResiAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactResiAblity);
value.getIndexValueVOs().add(contactResiAblityValue);*/
String gridId=(String) recordMap.get(IndexCalConstant.GRID_ID);
BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(gridId);
SampleValue<BigDecimal> contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgValue);
value.getIndexValueVOs().add(contactMassesAblityValue);
}
});
});
@ -162,6 +163,29 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
}
}
/**
* @return java.util.Map<java.lang.String,java.math.BigDecimal>
* @param formDTO
* @author yinzuomei
* @description TODO
* @Date 2020/8/31 9:51
**/
private Map<String, BigDecimal> contactMassesAblityMap(CalculateCommonFormDTO formDTO) {
return null;
}
/**
* @return java.math.BigDecimal
* @param gridId 网格id
* @author yinzuomei TODO
* @description 获取网格组织内党员的联系群众能力考评分平均值
* @Date 2020/8/31 9:50
**/
private BigDecimal getGridContactMassesAvgValue(String gridId) {
return null;
}
/**
* @param formDTO 客户id 月份id: yyyyMM
* @param indexList 指标集合
@ -230,12 +254,11 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
BigDecimal minValue = null;
BigDecimal maxValue = null;
if (IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode().equals(index.getIndexCode())) {
//组织内党员的联系群众能力考评分(平均值) TODO 获取最大值,最小值
logger.info("组织内党员的联系群众能力考评分(平均值) TODO");
/*Map<String,BigDecimal> contactResiAblityMap=;
minValue=contactResiAblityMap.get(StrConstant.MIN);
maxValue=contactResiAblityMap.get(StrConstant.MAX);*/
continue;
//组织内党员的联系群众能力考评分(平均值) 获取最大值,最小值
logger.info("组织内党员的联系群众能力考评分(平均值) 单独处理");
Map<String,BigDecimal> contactMassesAblityMap= this.contactMassesAblityMap(formDTO);
minValue=contactMassesAblityMap.get(StrConstant.MIN);
maxValue=contactMassesAblityMap.get(StrConstant.MAX);
} else {
//获取指标对应的列名
String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(index.getIndexCode());
@ -267,7 +290,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService {
/**
* @param formDTO
* @param indexList
* @return void
* @return void TODO
* @author yinzuomei
* @description 计算网格相关-治理能力
* @Date 2020/8/26 16:47

26
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/CpcScoreDao.xml

@ -0,0 +1,26 @@
<?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.indexscore.CpcScoreDao">
<resultMap type="com.epmet.entity.indexscore.CpcScoreEntity" id="cpcScoreMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="userId" column="USER_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="partyAblityScore" column="PARTY_ABLITY_SCORE"/>
<result property="joinIssueScore" column="JOIN_ISSUE_SCORE"/>
<result property="partyWorkActScore" column="PARTY_WORK_ACT_SCORE"/>
<result property="contactMassesScore" column="CONTACT_MASSES_SCORE"/>
<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>
</mapper>

27
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/indexscore/GridScoreDao.xml

@ -0,0 +1,27 @@
<?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.indexscore.GridScoreDao">
<resultMap type="com.epmet.entity.indexscore.GridScoreEntity" id="gridScoreMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="gridId" column="GRID_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="quarterId" column="QUARTER_ID"/>
<result property="yearId" column="YEAR_ID"/>
<result property="monthId" column="MONTH_ID"/>
<result property="totalScore" column="TOTAL_SCORE"/>
<result property="partyAblityScore" column="PARTY_ABLITY_SCORE"/>
<result property="govrnAblityScore" column="GOVRN_ABLITY_SCORE"/>
<result property="serviceAblityScore" column="SERVICE_ABLITY_SCORE"/>
<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>
</mapper>
Loading…
Cancel
Save