17 changed files with 847 additions and 3 deletions
@ -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 eg:2020W01 = 2020年第一周 |
||||
|
*/ |
||||
|
private String weekId; |
||||
|
|
||||
|
/** |
||||
|
* 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 |
||||
|
*/ |
||||
|
private String quarterId; |
||||
|
|
||||
|
/** |
||||
|
* 年度ID eg:2020 = 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; |
||||
|
|
||||
|
} |
@ -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; |
||||
|
} |
@ -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 eg:2020W01 = 2020年第一周 |
||||
|
*/ |
||||
|
private String weekId; |
||||
|
|
||||
|
/** |
||||
|
* 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 |
||||
|
*/ |
||||
|
private String quarterId; |
||||
|
|
||||
|
/** |
||||
|
* 年度ID eg:2020 = 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"; |
||||
|
} |
||||
|
} |
@ -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); |
||||
|
|
||||
|
} |
@ -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); |
||||
|
|
||||
|
} |
@ -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 eg:2020W01 = 2020年第一周 |
||||
|
*/ |
||||
|
private String weekId; |
||||
|
|
||||
|
/** |
||||
|
* 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 |
||||
|
*/ |
||||
|
private String quarterId; |
||||
|
|
||||
|
/** |
||||
|
* 年度ID eg:2020 = 2020年、2021 = 2021年 |
||||
|
*/ |
||||
|
private String yearId; |
||||
|
|
||||
|
/** |
||||
|
* 用户id |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 身份证 |
||||
|
*/ |
||||
|
private String idCard; |
||||
|
|
||||
|
/** |
||||
|
* 生日 |
||||
|
*/ |
||||
|
private Date birthday; |
||||
|
|
||||
|
} |
@ -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); |
||||
|
|
||||
|
} |
@ -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); |
||||
|
} |
||||
|
|
||||
|
} |
@ -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); |
||||
|
} |
@ -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; |
||||
|
} |
||||
|
|
||||
|
} |
@ -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> |
@ -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> |
Loading…
Reference in new issue