57 changed files with 1179 additions and 2 deletions
@ -0,0 +1,59 @@ |
|||
package com.epmet.dataaggre.dto.datastats.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description 数据统计页面查询-接口入参 |
|||
*/ |
|||
@Data |
|||
public class NowStatsDataFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 6462094914874831738L; |
|||
|
|||
public interface CustomerDataManageForm{} |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
@NotBlank(message = "客户ID不能为空",groups = CustomerDataManageForm.class) |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
@NotBlank(message = "组织ID不能为空",groups = CustomerDataManageForm.class) |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 区间:Interval 截止:end |
|||
*/ |
|||
@NotBlank(message = "type不能为空",groups = CustomerDataManageForm.class) |
|||
private String type; |
|||
|
|||
/** |
|||
* 开始时间 精确到秒【yyyy-MM-dd HH:mm:ss】 |
|||
*/ |
|||
private String startTime; |
|||
|
|||
/** |
|||
* 结束时间 精确到秒【yyyy-MM-dd HH:mm:ss】 |
|||
*/ |
|||
@NotBlank(message = "结束时间不能为空",groups = CustomerDataManageForm.class) |
|||
private String endTime; |
|||
|
|||
|
|||
//组织或网格Id集合
|
|||
private List<String> idList; |
|||
//数据类型【组织agency 网格grid】
|
|||
private String dataType; |
|||
|
|||
/** |
|||
* desc:是否是导出 |
|||
*/ |
|||
private boolean export = false; |
|||
} |
@ -0,0 +1,46 @@ |
|||
package com.epmet.dataaggre.dto.datastats.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description 数据统计页面查询-接口返参 |
|||
*/ |
|||
@Data |
|||
public class NowStatsDataResultDTO { |
|||
|
|||
//组织、网格Id
|
|||
private String orgId; |
|||
//组织、网格名称
|
|||
private String orgName; |
|||
//注册居民数
|
|||
private Integer resiUserCount = 0; |
|||
//注册党员数
|
|||
private Integer partyMemberCount = 0; |
|||
//事件总数
|
|||
private Integer icEventCount = 0; |
|||
//居民上报事件数【小程序端随手拍随时讲】
|
|||
private Integer resiEventCount = 0; |
|||
//平台录入事件数【数字平台录入的事件数】
|
|||
private Integer pcEventCount = 0; |
|||
//项目总数
|
|||
private Integer projectCount = 0; |
|||
//议题转项目数
|
|||
private Integer issueProjectCount = 0; |
|||
//事件立项数
|
|||
private Integer icEventProjectCount = 0; |
|||
//直接立项项目数
|
|||
private Integer agencyProjectCount = 0; |
|||
|
|||
|
|||
//组织的pids
|
|||
private String pids; |
|||
//事件来源,0代表居民点 其他代表数字平台
|
|||
private String sourceType; |
|||
//项目来源 issue议题 agency立项 ic_event事件
|
|||
private String origin; |
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
/** |
|||
* 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.resipartymember; |
|||
|
|||
import com.epmet.dataaggre.dto.datastats.form.NowStatsDataFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.result.NowStatsDataResultDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Mapper |
|||
public interface ResiPartymemberDao { |
|||
|
|||
List<NowStatsDataResultDTO> getNowPart(NowStatsDataFormDTO formDTO); |
|||
|
|||
} |
@ -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.dataaggre.excel; |
|||
|
|||
import com.alibaba.excel.annotation.ExcelProperty; |
|||
import com.alibaba.excel.annotation.write.style.ColumnWidth; |
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
public class NowStatsDataExcel { |
|||
|
|||
//组织、网格名称
|
|||
@ExcelProperty(value = "组织名称") |
|||
@ColumnWidth(25) |
|||
private String orgName; |
|||
//注册居民数
|
|||
@ExcelProperty(value = "注册居民数") |
|||
@ColumnWidth(20) |
|||
private Integer resiUserCount; |
|||
//注册党员数
|
|||
@ExcelProperty(value = "注册党员数") |
|||
@ColumnWidth(20) |
|||
private Integer partyMemberCount; |
|||
//事件总数
|
|||
@ExcelProperty(value = "事件总数") |
|||
@ColumnWidth(20) |
|||
private Integer icEventCount; |
|||
//居民上报事件数【小程序端随手拍随时讲】
|
|||
@ExcelProperty(value = "居民上报事件数") |
|||
@ColumnWidth(20) |
|||
private Integer resiEventCount; |
|||
//平台录入事件数【数字平台录入的事件数】
|
|||
@ExcelProperty(value = "平台录入事件数") |
|||
@ColumnWidth(20) |
|||
private Integer pcEventCount; |
|||
//项目总数
|
|||
@ExcelProperty(value = "项目总数") |
|||
@ColumnWidth(20) |
|||
private Integer projectCount; |
|||
//议题转项目数
|
|||
@ExcelProperty(value = "议题转项目数") |
|||
@ColumnWidth(20) |
|||
private Integer issueProjectCount; |
|||
//事件立项数
|
|||
@ExcelProperty(value = "事件立项数") |
|||
@ColumnWidth(20) |
|||
private Integer icEventProjectCount; |
|||
//直接立项项目数
|
|||
@ExcelProperty(value = "立项数") |
|||
@ColumnWidth(20) |
|||
private Integer agencyProjectCount; |
|||
|
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.epmet.dataaggre.service; |
|||
|
|||
import com.epmet.dataaggre.dto.datastats.form.NowStatsDataFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.result.NowStatsDataResultDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface PartymemberService { |
|||
|
|||
List<NowStatsDataResultDTO> getNowPart(NowStatsDataFormDTO formDTO); |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.epmet.dataaggre.service.impl; |
|||
|
|||
import com.epmet.dataaggre.dto.datastats.form.NowStatsDataFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.result.NowStatsDataResultDTO; |
|||
import com.epmet.dataaggre.service.PartymemberService; |
|||
import com.epmet.dataaggre.service.resipartymember.ResiPartymemberService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
public class PartymemberServiceImpl implements PartymemberService { |
|||
|
|||
@Autowired |
|||
private ResiPartymemberService resiPartymemberService; |
|||
|
|||
@Override |
|||
public List<NowStatsDataResultDTO> getNowPart(NowStatsDataFormDTO formDTO) { |
|||
return resiPartymemberService.getNowPart(formDTO); |
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.epmet.dataaggre.service.resipartymember; |
|||
|
|||
import com.epmet.dataaggre.dto.datastats.form.NowStatsDataFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.result.NowStatsDataResultDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface ResiPartymemberService { |
|||
|
|||
List<NowStatsDataResultDTO> getNowPart(NowStatsDataFormDTO formDTO); |
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.epmet.dataaggre.service.resipartymember.impl; |
|||
|
|||
import com.epmet.commons.dynamic.datasource.annotation.DataSource; |
|||
import com.epmet.dataaggre.constant.DataSourceConstant; |
|||
import com.epmet.dataaggre.dao.resipartymember.ResiPartymemberDao; |
|||
import com.epmet.dataaggre.dto.datastats.form.NowStatsDataFormDTO; |
|||
import com.epmet.dataaggre.dto.datastats.result.NowStatsDataResultDTO; |
|||
import com.epmet.dataaggre.service.resipartymember.ResiPartymemberService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
@DataSource(DataSourceConstant.RESI_PARTYMEMBER) |
|||
public class ResiPartymemberServiceImpl implements ResiPartymemberService { |
|||
|
|||
@Autowired |
|||
private ResiPartymemberDao resiPartymemberDao; |
|||
|
|||
|
|||
@Override |
|||
public List<NowStatsDataResultDTO> getNowPart(NowStatsDataFormDTO formDTO) { |
|||
return resiPartymemberDao.getNowPart(formDTO); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,46 @@ |
|||
<?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.resipartymember.ResiPartymemberDao"> |
|||
|
|||
<select id="getNowPart" resultType="com.epmet.dataaggre.dto.datastats.result.NowStatsDataResultDTO"> |
|||
<choose> |
|||
<when test="dataType != null and dataType == 'agency' "> |
|||
SELECT |
|||
agency_id orgId, |
|||
agency_id_path pids |
|||
FROM partymember_register_relation |
|||
WHERE del_flag = '0' |
|||
AND first_register = '1' |
|||
AND customer_id = #{customerId} |
|||
<if test=" null != startTime and startTime != '' "> |
|||
AND created_time <![CDATA[ >= ]]> #{startTime} |
|||
</if> |
|||
<if test="null != endTime and endTime != '' "> |
|||
AND created_time <![CDATA[ <= ]]> #{endTime} |
|||
</if> |
|||
</when> |
|||
<otherwise> |
|||
SELECT |
|||
grid_id orgId, |
|||
SUM(first_register = '1') partyMemberCount |
|||
FROM |
|||
partymember_register_relation |
|||
WHERE |
|||
del_flag = '0' |
|||
AND customer_id = #{customerId} |
|||
<foreach collection="idList" item="id" open="AND grid_id IN (" separator="," close=")"> |
|||
#{id} |
|||
</foreach> |
|||
<if test=" null != startTime and startTime != '' "> |
|||
AND created_time <![CDATA[ >= ]]> #{startTime} |
|||
</if> |
|||
<if test="null != endTime and endTime != '' "> |
|||
AND created_time <![CDATA[ <= ]]> #{endTime} |
|||
</if> |
|||
GROUP BY grid_id |
|||
</otherwise> |
|||
</choose> |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,17 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.plugin.power.dto.visit.form.VisitorLogoutFormDTO; |
|||
|
|||
public interface PliPowerService { |
|||
|
|||
/** |
|||
* 访客登出 |
|||
* |
|||
* @param formDTO |
|||
* @return com.epmet.commons.tools.utils.Result |
|||
* @author zhy |
|||
* @date 2022/5/30 10:25 |
|||
*/ |
|||
Result visitorLogout(VisitorLogoutFormDTO formDTO); |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.plugin.power.dto.visit.form.VisitorLogoutFormDTO; |
|||
import com.epmet.plugin.power.feign.PliPowerFeignClient; |
|||
import com.epmet.service.PliPowerService; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
|
|||
/** |
|||
* @Description |
|||
* @ClassName StatsUserServiceImpl |
|||
* @Auth wangc |
|||
* @Date 2020-06-29 09:41 |
|||
*/ |
|||
@Service |
|||
public class PliPowerServiceImpl implements PliPowerService { |
|||
|
|||
private Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
@Autowired |
|||
private PliPowerFeignClient pliPowerFeignClient; |
|||
|
|||
@Override |
|||
public Result visitorLogout(VisitorLogoutFormDTO formDTO) { |
|||
return pliPowerFeignClient.visitorLogout(formDTO); |
|||
} |
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.epmet.task; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.plugin.power.dto.visit.form.VisitorLogoutFormDTO; |
|||
import com.epmet.service.PliPowerService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* 访客登出 |
|||
* |
|||
* @author zhy |
|||
* @date 2022/5/30 10:23 |
|||
*/ |
|||
@Component("pliVisitorLogoutTask") |
|||
public class PliVisitorLogoutTask implements ITask { |
|||
|
|||
private Logger logger = LoggerFactory.getLogger(getClass()); |
|||
|
|||
@Autowired |
|||
private PliPowerService pliPowerService; |
|||
|
|||
@Override |
|||
public void run(String params) { |
|||
logger.info("VisitorLogoutTask定时任务正在执行,参数为:{}", params); |
|||
VisitorLogoutFormDTO formDTO = new VisitorLogoutFormDTO(); |
|||
if (StringUtils.isNotBlank(params)) { |
|||
formDTO = JSON.parseObject(params, VisitorLogoutFormDTO.class); |
|||
} |
|||
Result result = pliPowerService.visitorLogout(formDTO); |
|||
if (result.success()) { |
|||
logger.info("VisitorLogoutTask定时任务执行成功"); |
|||
} else { |
|||
logger.error("VisitorLogoutTask定时任务执行失败:" + result.getMsg()); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,71 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2022/8/5 15:03 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class PaCustomerDTO implements Serializable { |
|||
|
|||
/** |
|||
* 客户id,本主键和oper_crm.customer.id一致 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户名称,默认是根组织名称 |
|||
*/ |
|||
private String customerName; |
|||
|
|||
/** |
|||
* 是否已经完成客户信息初始化 0:未初始化,1:已初始化 |
|||
*/ |
|||
private Integer isInitialize; |
|||
|
|||
/** |
|||
* 客户类型 mini 微信小程序客户 app 第三方app客户 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 数据来源(dev:开发 test:体验 prod:生产) |
|||
*/ |
|||
private String source; |
|||
|
|||
/** |
|||
* 删除标识:0.未删除 1.已删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2022/8/5 11:11 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class IcUserMatchGridFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -5252136149475817567L; |
|||
|
|||
public interface IcUserMatchGridForm{} |
|||
|
|||
@NotBlank(message = "idCard不能为空",groups = IcUserMatchGridForm.class) |
|||
private String idCard; |
|||
|
|||
@NotBlank(message = "appId不能为空",groups = IcUserMatchGridForm.class) |
|||
private String appId; |
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @DateTime 2022/8/5 11:14 |
|||
* @DESC |
|||
*/ |
|||
@Data |
|||
public class IcUserMatchGridResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3215965796907113918L; |
|||
|
|||
private String gridId; |
|||
|
|||
private String customerId; |
|||
|
|||
private String gridName; |
|||
} |
Loading…
Reference in new issue