Browse Source

党员统计

master
zxc 5 years ago
parent
commit
bafcf3b0f0
  1. 1
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java
  2. 131
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerPartymemberDTO.java
  3. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java
  4. 104
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/DimCustomerPartyMemberFormDTO.java
  5. 24
      epmet-module/data-statistical/data-statistical-server/pom.xml
  6. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  7. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java
  8. 45
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java
  9. 101
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerPartymemberEntity.java
  10. 22
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java
  11. 38
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java
  12. 104
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java
  13. 123
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java
  14. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml
  15. 27
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml
  16. 54
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml
  17. 6
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java

1
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java

@ -12,5 +12,6 @@ public interface DataSourceConstant {
String RESI_GROUP = "resiGroup"; String RESI_GROUP = "resiGroup";
String EPMET_USER = "epmetuser"; String EPMET_USER = "epmetuser";
String EVALUATION_INDEX = "evaluationIndex"; String EVALUATION_INDEX = "evaluationIndex";
String PARTY_MEMBER = "partyMember";
} }

131
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerPartymemberDTO.java

@ -0,0 +1,131 @@
/**
* 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.stats;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 党员维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-17
*/
@Data
public class DimCustomerPartymemberDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 党员认证时的网格id
*/
private String gridId;
/**
* 所属机关ID
*/
private String agencyId;
/**
* agencyId的上一级组织id
*/
private String parentId;
/**
* 党员认证成功的日期yyyyMMdd
*/
private String dateId;
/**
* 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 用户id
*/
private String userId;
/**
* 身份证
*/
private String idCard;
/**
* 生日
*/
private Date birthday;
/**
* 删除标识0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto.stats.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/9/17 11:02 上午
*/
@Data
public class CustomerIdAndDateIdFormDTO implements Serializable {
private static final long serialVersionUID = -3381286960911634231L;
public interface CustomerIdAndDateId extends CustomerClientShowGroup{}
@NotBlank(message = "客户ID不能为空",groups = CustomerIdAndDateId.class)
private String customerId;
@NotBlank(message = "日期Id不能为空",groups = CustomerIdAndDateId.class)
private String dateId;
}

104
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/DimCustomerPartyMemberFormDTO.java

@ -0,0 +1,104 @@
package com.epmet.dto.stats.form;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author zxc
* @DateTime 2020/9/17 11:15 上午
*/
@Data
public class DimCustomerPartyMemberFormDTO implements Serializable {
private static final long serialVersionUID = -9178779369245037701L;
/**
* 客户ID
*/
private String customerId;
/**
* 党员认证时的网格id
*/
private String gridId;
/**
* 所属机关ID
*/
private String agencyId;
/**
* agencyId的上一级组织id
*/
private String parentId;
/**
* 党员认证成功的日期yyyyMMdd
*/
private String dateId;
/**
* 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 用户id
*/
private String userId;
/**
* 身份证
*/
private String idCard;
/**
* 生日
*/
private Date birthday;
/**
* 删除标识0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 更新人
*/
private String updatedBy;
public DimCustomerPartyMemberFormDTO() {
this.delFlag = NumConstant.ZERO_STR;
this.revision = NumConstant.ZERO;
this.createdBy = "APP_USER";
this.updatedBy = "APP_USER";
}
}

24
epmet-module/data-statistical/data-statistical-server/pom.xml

@ -192,6 +192,12 @@
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username> <datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password> <datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<datasource.druid.partyMember.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.partyMember.url>
<datasource.druid.partyMember.username>epmet_resi_partymember_user</datasource.druid.partyMember.username>
<datasource.druid.partyMember.password>EpmEt-db-UsEr</datasource.druid.partyMember.password>
<!-- redis配置 --> <!-- redis配置 -->
<spring.redis.index>0</spring.redis.index> <spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host> <spring.redis.host>192.168.1.130</spring.redis.host>
@ -290,6 +296,12 @@
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username> <datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password> <datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<datasource.druid.partyMember.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.partyMember.url>
<datasource.druid.partyMember.username>epmet_resi_partymember_user</datasource.druid.partyMember.username>
<datasource.druid.partyMember.password>EpmEt-db-UsEr</datasource.druid.partyMember.password>
<!-- redis配置 --> <!-- redis配置 -->
<spring.redis.index>0</spring.redis.index> <spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host> <spring.redis.host>192.168.1.130</spring.redis.host>
@ -388,6 +400,12 @@
<datasource.druid.evaluationIndex.username>epmet</datasource.druid.evaluationIndex.username> <datasource.druid.evaluationIndex.username>epmet</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>elink@833066</datasource.druid.evaluationIndex.password> <datasource.druid.evaluationIndex.password>elink@833066</datasource.druid.evaluationIndex.password>
<datasource.druid.partyMember.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.partyMember.url>
<datasource.druid.partyMember.username>epmet</datasource.druid.partyMember.username>
<datasource.druid.partyMember.password>elink@833066</datasource.druid.partyMember.password>
<!-- redis配置 --> <!-- redis配置 -->
<spring.redis.index>0</spring.redis.index> <spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host> <spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>
@ -482,6 +500,12 @@
<datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username> <datasource.druid.evaluationIndex.username>epmet_evaluation_index_user</datasource.druid.evaluationIndex.username>
<datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password> <datasource.druid.evaluationIndex.password>EpmEt-db-UsEr</datasource.druid.evaluationIndex.password>
<datasource.druid.partyMember.url>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_resi_partymember?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.partyMember.url>
<datasource.druid.partyMember.username>epmet_resi_partymember_user</datasource.druid.partyMember.username>
<datasource.druid.partyMember.password>EpmEt-db-UsEr</datasource.druid.partyMember.password>
<!-- redis配置 --> <!-- redis配置 -->
<spring.redis.index>0</spring.redis.index> <spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com</spring.redis.host> <spring.redis.host>r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com</spring.redis.host>

11
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -16,6 +16,7 @@ import com.epmet.dao.stats.DimCustomerDao;
import com.epmet.dao.stats.DimDateDao; import com.epmet.dao.stats.DimDateDao;
import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity;
@ -27,6 +28,7 @@ import com.epmet.service.StatsDemoService;
import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.indexcal.*;
import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -515,4 +517,13 @@ public class DemoController {
} }
return new Result(); return new Result();
} }
@Autowired
private DimCustomerPartymemberService partymemberService;
@PostMapping("statsparty")
public Result getPartyInfo(@RequestBody CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO){
partymemberService.statsPartyMember(customerIdAndDateIdFormDTO);
return new Result();
}
} }

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java

@ -0,0 +1,29 @@
package com.epmet.dao.partymember;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.IssueInfoResultDTO;
import com.epmet.dto.extract.result.IssueProcessInfoResultDTO;
import com.epmet.dto.extract.result.SatisfactionInfoResultDTO;
import com.epmet.dto.issue.IssueAgencyDTO;
import com.epmet.dto.issue.IssueGridDTO;
import com.epmet.dto.issue.IssueProjectDTO;
import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO;
import com.epmet.entity.issue.IssueEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface PartyMemberDao{
/**
* @Description 查询党员信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/17 1:58 下午
*/
List<DimCustomerPartyMemberFormDTO> selectPartyMemberInfo(@Param("customerId") String customerId,@Param("dateId") String dateId);
}

45
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java

@ -0,0 +1,45 @@
/**
* 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.stats;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO;
import com.epmet.entity.stats.DimCustomerPartymemberEntity;
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 2020-09-17
*/
@Mapper
public interface DimCustomerPartymemberDao extends BaseDao<DimCustomerPartymemberEntity> {
/**
* @Description 批量插入党员信息
* @param partyMemberInfos
* @author zxc
* @date 2020/9/17 11:18 上午
*/
void insertPartyMemberInfo(@Param("partyMemberInfos")List<DimCustomerPartyMemberFormDTO> partyMemberInfos);
}

101
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerPartymemberEntity.java

@ -0,0 +1,101 @@
/**
* 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.stats;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 党员维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-17
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("dim_customer_partymember")
public class DimCustomerPartymemberEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 党员认证时的网格id
*/
private String gridId;
/**
* 所属机关ID
*/
private String agencyId;
/**
* agencyId的上一级组织id
*/
private String pid;
/**
* 党员认证成功的日期yyyyMMdd
*/
private String dateId;
/**
* 周ID eg2020W01 = 2020年第一周
*/
private String weekId;
/**
* 月份ID eg202006 = 2020年6月2020-07 = 2020年7月
*/
private String monthId;
/**
* 季度ID eg2020Q1 = 2020年第一季度2020Q2 = 2020年第二季度2020Q3 = 2020年第三季度2020Q4 = 2020年第四季度
*/
private String quarterId;
/**
* 年度ID eg2020 = 2020年2021 = 2021年
*/
private String yearId;
/**
* 用户id
*/
private String userId;
/**
* 身份证
*/
private String idCard;
/**
* 生日
*/
private Date birthday;
}

22
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java

@ -0,0 +1,22 @@
package com.epmet.service.partymember;
import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/9/17 1:52 下午
*/
public interface PartyMemberService {
/**
* @Description 查询党员信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/17 1:58 下午
*/
List<DimCustomerPartyMemberFormDTO> selectPartyMemberInfo(String customerId, String dateId);
}

38
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java

@ -0,0 +1,38 @@
package com.epmet.service.partymember.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.partymember.PartyMemberDao;
import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO;
import com.epmet.service.partymember.PartyMemberService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/9/17 1:53 下午
*/
@Service
@Slf4j
@DataSource(DataSourceConstant.PARTY_MEMBER)
public class PartyMemberServiceImpl implements PartyMemberService {
@Autowired
private PartyMemberDao partyMemberDao;
/**
* @Description 查询党员信息
* @param customerId
* @param dateId
* @author zxc
* @date 2020/9/17 1:58 下午
*/
@Override
public List<DimCustomerPartyMemberFormDTO> selectPartyMemberInfo(String customerId, String dateId){
return partyMemberDao.selectPartyMemberInfo(customerId, dateId);
}
}

104
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java

@ -0,0 +1,104 @@
/**
* 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.stats;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.stats.DimCustomerPartymemberDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.entity.stats.DimCustomerPartymemberEntity;
import java.util.List;
import java.util.Map;
/**
* 党员维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-17
*/
public interface DimCustomerPartymemberService extends BaseService<DimCustomerPartymemberEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<DimCustomerPartymemberDTO>
* @author generator
* @date 2020-09-17
*/
PageData<DimCustomerPartymemberDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<DimCustomerPartymemberDTO>
* @author generator
* @date 2020-09-17
*/
List<DimCustomerPartymemberDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return DimCustomerPartymemberDTO
* @author generator
* @date 2020-09-17
*/
DimCustomerPartymemberDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-09-17
*/
void save(DimCustomerPartymemberDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-09-17
*/
void update(DimCustomerPartymemberDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-09-17
*/
void delete(String[] ids);
/**
* @Description 统计党员
* @param customerIdAndDateIdFormDTO
* @author zxc
* @date 2020/9/17 11:05 上午
*/
Boolean statsPartyMember(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO);
}

123
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java

@ -0,0 +1,123 @@
/**
* 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.stats.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.stats.DimCustomerPartymemberDao;
import com.epmet.dto.stats.DimCustomerPartymemberDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO;
import com.epmet.entity.stats.DimCustomerPartymemberEntity;
import com.epmet.service.partymember.PartyMemberService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 党员维度表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-17
*/
@Service
public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl<DimCustomerPartymemberDao, DimCustomerPartymemberEntity> implements DimCustomerPartymemberService {
@Autowired
private DimCustomerPartymemberDao partyMemberDao;
@Autowired
private PartyMemberService partyMemberService;
@Override
public PageData<DimCustomerPartymemberDTO> page(Map<String, Object> params) {
IPage<DimCustomerPartymemberEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, DimCustomerPartymemberDTO.class);
}
@Override
public List<DimCustomerPartymemberDTO> list(Map<String, Object> params) {
List<DimCustomerPartymemberEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, DimCustomerPartymemberDTO.class);
}
private QueryWrapper<DimCustomerPartymemberEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<DimCustomerPartymemberEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public DimCustomerPartymemberDTO get(String id) {
DimCustomerPartymemberEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, DimCustomerPartymemberDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(DimCustomerPartymemberDTO dto) {
DimCustomerPartymemberEntity entity = ConvertUtils.sourceToTarget(dto, DimCustomerPartymemberEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(DimCustomerPartymemberDTO dto) {
DimCustomerPartymemberEntity entity = ConvertUtils.sourceToTarget(dto, DimCustomerPartymemberEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
/**
* @Description 统计党员
* @param customerIdAndDateIdFormDTO
* @author zxc
* @date 2020/9/17 11:05 上午
*/
@Override
public Boolean statsPartyMember(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) {
String customerId = customerIdAndDateIdFormDTO.getCustomerId();
String dateId = customerIdAndDateIdFormDTO.getDateId();
List<DimCustomerPartyMemberFormDTO> partyMemberList = partyMemberService.selectPartyMemberInfo(customerId, dateId);
return true;
}
}

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml

@ -170,6 +170,11 @@ dynamic:
url: @datasource.druid.evaluationIndex.url@ url: @datasource.druid.evaluationIndex.url@
username: @datasource.druid.evaluationIndex.username@ username: @datasource.druid.evaluationIndex.username@
password: @datasource.druid.evaluationIndex.password@ password: @datasource.druid.evaluationIndex.password@
partyMember:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.partyMember.url@
username: @datasource.druid.partyMember.username@
password: @datasource.druid.partyMember.password@
thread: thread:
# 线程池配置 # 线程池配置

27
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.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.partymember.PartyMemberDao">
<!-- 查询党员信息 -->
<select id="selectPartyMemberInfo" resultType="com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO">
SELECT
CUSTOMER_ID,
GRID_ID,
USER_ID,
ID_CARD,
CONCAT(
SUBSTRING( ID_CARD, 7, 4 ),
'-',
SUBSTRING( ID_CARD, 11, 2 ),
'-',
SUBSTRING( ID_CARD, 12, 2 )) AS birthday
FROM
partymember_info
WHERE
DEL_FLAG = 0
AND ( CONFIRM_RESULT = 'auto_confirm_success' OR CONFIRM_RESULT = 'approved' )
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT( UPDATED_TIME, '%Y%m%d' ) = #{dateId}
</select>
</mapper>

54
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml

@ -0,0 +1,54 @@
<?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.stats.DimCustomerPartymemberDao">
<!-- 批量插入党员信息 -->
<insert id="insertPartyMemberInfo">
INSERT INTO dim_customer_partymember (
ID,
CUSTOMER_ID,
GRID_ID,
AGENCY_ID,
PARENT_ID,
DATE_ID,
WEEK_ID,
MONTH_ID,
QUARTER_ID,
YEAR_ID,
USER_ID,
ID_CARD,
BIRTHDAY,
DEL_FLAG,
REVISION,
CREATED_BY,
CREATED_TIME,
UPDATED_BY,
UPDATED_TIME
)
VALUES
<foreach collection="partyMemberInfos" item="item" separator=",">
(
REPLACE ( UUID(), '-', '' ),
#{item.customerId},
#{item.gridId},
#{item.agencyId},
#{item.parentId},
#{item.dateId},
#{item.weekId},
#{item.monthId},
#{item.quarterId},
#{item.yearId},
#{item.userId},
#{item.idCard},
#{item.birthday},
#{item.delFlag},
#{item.revision},
#{item.createdBy},
NOW(),
#{item.updatedBy},
NOW()
)
</foreach>
</insert>
</mapper>

6
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java

@ -75,13 +75,13 @@ public class ExtAppJwtTokenUtils {
public static void genToken() { public static void genToken() {
HashMap<String, Object> claim = new HashMap<>(); HashMap<String, Object> claim = new HashMap<>();
claim.put("appId", "2c448b7da527055fbeebb628f8d3dcb0"); claim.put("appId", "acc4ad66c82a7b46e741364b4c62dce2");
claim.put("customerId", "c1"); claim.put("customerId", "b09527201c4409e19d1dbc5e3c3429a1");
long ts = System.currentTimeMillis() - 1000 * 60 * 4; long ts = System.currentTimeMillis() - 1000 * 60 * 4;
System.out.println("时间戳:" + ts); System.out.println("时间戳:" + ts);
claim.put("ts", ts); claim.put("ts", ts);
String abc = new ExtAppJwtTokenUtils().createToken(claim, "d4b73db4cf8e46ef99fa1f95149c2791ef2396fded114dd09e406cbce83fc88a"); String abc = new ExtAppJwtTokenUtils().createToken(claim, "612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970");
System.out.println(abc); System.out.println(abc);
} }

Loading…
Cancel
Save