63 changed files with 1488 additions and 45 deletions
@ -0,0 +1,29 @@ |
|||
package com.epmet.dataaggre.dto.epmetuser.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 OpenStaffDetailFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3381286960911634231L; |
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
@NotBlank(message = "客户Id不能为空", groups = OpenStaffDetailFormDTO.Open.class) |
|||
private String customerId; |
|||
/** |
|||
* 手机号 |
|||
*/ |
|||
@NotBlank(message = "手机号不能为空", groups = OpenStaffDetailFormDTO.Open.class) |
|||
private String mobile; |
|||
public interface Open extends CustomerClientShowGroup {} |
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.epmet.dataaggre.dto.epmetuser.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description 对外接口--查询工作人员基本信息-接口返参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class OpenStaffDetailResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 7129564173128153335L; |
|||
|
|||
//工作人员用户id
|
|||
private String staffId = ""; |
|||
//工作人员姓名
|
|||
private String staffName = ""; |
|||
//手机号
|
|||
private String mobile = ""; |
|||
//用户所属组织id
|
|||
private String agencyId = ""; |
|||
//用户所属组织全路径名称
|
|||
private String agencyAllName = ""; |
|||
//客户Id
|
|||
private String customerId = ""; |
|||
|
|||
} |
@ -0,0 +1,116 @@ |
|||
/** |
|||
* 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.crm; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 客户关系表(01.14 add) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2021-02-03 |
|||
*/ |
|||
@Data |
|||
public class CustomerRelationDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 父级客户id;如果是顶级客户,此列=0 |
|||
*/ |
|||
private String parentCustomerId; |
|||
|
|||
/** |
|||
* 当前客户的所有父级客户id,以英文冒号隔开,如果是顶级客户,此列=0 |
|||
*/ |
|||
private String pids; |
|||
|
|||
/** |
|||
* 当前客户类型取值: external:外部客户,internal:内部客户 |
|||
*/ |
|||
private String customerType; |
|||
|
|||
/** |
|||
* 父级客户类型取值: external:外部客户,internal:内部客户;如果是顶级客户,此列=0 |
|||
*/ |
|||
private String parentCustomerType; |
|||
|
|||
/** |
|||
* open,closed是否启用 |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 当前客户级别(社区级:community, |
|||
乡(镇、街道)级:street, |
|||
区县级: district, |
|||
市级: city |
|||
省级:province) |
|||
*/ |
|||
private String level; |
|||
|
|||
/** |
|||
* 当前客户的地区编码,实际就是根组织的area_code |
|||
*/ |
|||
private String areaCode; |
|||
|
|||
/** |
|||
* 删除标识0未删除1已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.dto.extract.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 描述一下 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2021/7/6 16:37 |
|||
*/ |
|||
@Data |
|||
public class SyncOrgInfoFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -3533276226280926966L; |
|||
@NotBlank(message = "孔村or榆山or锦水客户id不能为空") |
|||
private String fromCustomerId; |
|||
@NotBlank(message = "平阴客户id不能为空") |
|||
private String toCustomerId; |
|||
} |
@ -0,0 +1,82 @@ |
|||
package com.epmet.dto.stats.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description 数据上报--网格员事件总数上报-接口入参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class GmUploadDataFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -9178779369245037701L; |
|||
/** |
|||
* 为true时需要删除历史数据 |
|||
*/ |
|||
private Boolean isFirst; |
|||
//数据集合对象
|
|||
@NotEmpty(message = "数据集合对象不能为空",groups = UploadData.class) |
|||
private List<DataList> dataList; |
|||
public interface UploadData extends CustomerClientShowGroup {} |
|||
|
|||
@Data |
|||
public static class DataList{ |
|||
//来源类型 external:外部,internal:内部
|
|||
private String sourceType; |
|||
//客户Id 【dim_customer.id】[接口传入的是来源数据的客户Id]
|
|||
private String customerId; |
|||
//数据来源客户Id
|
|||
private String parentCustomerId; |
|||
//机关Id 【dim_agency.id】
|
|||
private String agencyId; |
|||
//日维度Id 【dim_date.id】
|
|||
private String dateId; |
|||
//月维度Id 【dim_month.id】
|
|||
private String monthId; |
|||
//年维度Id 【dim_year.id】
|
|||
private String yearId; |
|||
//网格id
|
|||
private String gridId; |
|||
//上级ID(网格所属Agency的上级组织Id)
|
|||
private String pid; |
|||
//所有agencyId的上级组织ID(包含agencyId)
|
|||
private String pids; |
|||
//工作人员id
|
|||
private String staffId; |
|||
//工作人员姓名
|
|||
private String staffName; |
|||
//项目立项数,截止到当前dateId的总数
|
|||
private Integer projectCount; |
|||
//议题转项目数,截止到当前dateId的总数
|
|||
private Integer issueToProjectCount; |
|||
//议题关闭数,截止到当前dateId的总数
|
|||
private Integer closedIssueCount; |
|||
//项目响应数,截止到当前dateId的总数
|
|||
private Integer projectResponseCount; |
|||
//项目吹哨数,截止到当前dateId的总数
|
|||
private Integer projectTransferCount; |
|||
//项目结案数,dateId这一天的增量
|
|||
private Integer projectClosedCount; |
|||
//项目立项数,dateId这一天的增量
|
|||
private Integer projectIncr; |
|||
//议题转项目数,dateId这一天的增量
|
|||
private Integer issueToProjectIncr; |
|||
//议题关闭数,dateId这一天的增量
|
|||
private Integer closedIssueIncr; |
|||
//项目响应数,dateId这一天的增量
|
|||
private Integer projectResponseIncr; |
|||
//项目吹哨数,dateId这一天的增量
|
|||
private Integer projectTransferIncr; |
|||
//项目结案数,截止到当前dateId的总数
|
|||
private Integer projectClosedIncr; |
|||
|
|||
} |
|||
|
|||
} |
@ -0,0 +1,65 @@ |
|||
package com.epmet.dto.stats.form; |
|||
|
|||
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description 数据上报--网格员事件总数上报-接口入参 |
|||
* @Auth sun |
|||
*/ |
|||
@Data |
|||
public class GmUploadEventFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -9178779369245037701L; |
|||
//为true时需要删除历史数据
|
|||
private Boolean isFirst; |
|||
//数据集合对象
|
|||
@NotEmpty(message = "数据集合对象不能为空",groups = UploadEvent.class) |
|||
private List<DataList> dataList; |
|||
public interface UploadEvent extends CustomerClientShowGroup {} |
|||
|
|||
@Data |
|||
public static class DataList{ |
|||
//来源类型 external:外部,internal:内部
|
|||
private String sourceType; |
|||
//客户Id 【dim_customer.id】[接口传入的是来源数据的客户Id]
|
|||
private String customerId; |
|||
//数据来源客户Id
|
|||
private String parentCustomerId; |
|||
//机关Id 【dim_agency.id】
|
|||
private String agencyId; |
|||
//日维度Id 【dim_date.id】
|
|||
private String dateId; |
|||
//周维度Id 【dim_week.id】
|
|||
private String weekId; |
|||
//月维度Id 【dim_month.id】
|
|||
private String monthId; |
|||
//季ID
|
|||
private String quarterId; |
|||
//年维度Id 【dim_year.id】
|
|||
private String yearId; |
|||
//网格id
|
|||
private String gridId; |
|||
//网格所有上级id
|
|||
private String gridPids; |
|||
//产品这边工作人员用户id
|
|||
private String staffId; |
|||
//巡查次数
|
|||
private Integer patrolTotal = 0; |
|||
//巡查时长 单位:秒
|
|||
private Integer totalTime = 0; |
|||
//事件数【立项项目数】
|
|||
private Integer reportProjectCount = 0; |
|||
//最新的巡查开始时间
|
|||
private Date latestPatrolTime; |
|||
//最新的巡查状态 正在巡查中:patrolling;结束:end
|
|||
private String latestPatrolStatus = "end"; |
|||
|
|||
} |
|||
|
|||
} |
@ -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.dto.stats.form.GmUploadDataFormDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据统计服务 |
|||
*/ |
|||
@Mapper |
|||
public interface DataStatsDao { |
|||
|
|||
/** |
|||
* @Description 数据上报--网格员数据分析上报--按客户Id和dateId删除历史数据 |
|||
* @author sun |
|||
*/ |
|||
int delGmUploadData(String customerId, String dateId); |
|||
|
|||
/** |
|||
* @Description 数据上报--网格员数据分析上报--批量新增或修改数据 |
|||
* @author sun |
|||
*/ |
|||
int saveOrUpGmUploadData(@Param("list") List<GmUploadDataFormDTO.DataList> list); |
|||
|
|||
} |
@ -0,0 +1,108 @@ |
|||
<?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.DataStatsDao"> |
|||
|
|||
<delete id="delGmUploadData"> |
|||
DELETE |
|||
FROM |
|||
fact_grid_member_statistics_daily |
|||
WHERE |
|||
source_customer_id = #{customerId} |
|||
AND date_id = #{dateId} |
|||
LIMIT 1000 |
|||
</delete> |
|||
|
|||
<insert id="saveOrUpGmUploadData"> |
|||
INSERT INTO fact_grid_member_statistics_daily |
|||
( |
|||
id, |
|||
date_id, |
|||
month_id, |
|||
year_id, |
|||
source_type, |
|||
customer_id, |
|||
source_customer_id, |
|||
agency_id, |
|||
grid_id, |
|||
pid, |
|||
pids, |
|||
staff_id, |
|||
staff_name, |
|||
project_count, |
|||
issue_to_project_count, |
|||
closed_issue_count, |
|||
project_response_count, |
|||
project_transfer_count, |
|||
project_closed_count, |
|||
project_incr, |
|||
issue_to_project_incr, |
|||
closed_issue_incr, |
|||
project_response_incr, |
|||
project_transfer_incr, |
|||
project_closed_incr, |
|||
del_flag, |
|||
revision, |
|||
created_by, |
|||
created_time, |
|||
updated_by, |
|||
updated_time |
|||
) |
|||
VALUES |
|||
<foreach collection="list" item="i" separator=","> |
|||
( |
|||
REPLACE(UUID(), '-', ''), |
|||
#{i.dateId}, |
|||
#{i.monthId}, |
|||
#{i.yearId}, |
|||
#{i.sourceType}, |
|||
#{i.parentCustomerId}, |
|||
#{i.customerId}, |
|||
#{i.agencyId}, |
|||
#{i.gridId}, |
|||
#{i.pid}, |
|||
#{i.pids}, |
|||
#{i.staffId}, |
|||
#{i.staffName}, |
|||
#{i.projectCount}, |
|||
#{i.issueToProjectCount}, |
|||
#{i.closedIssueCount}, |
|||
#{i.projectResponseCount}, |
|||
#{i.projectTransferCount}, |
|||
#{i.projectClosedCount}, |
|||
#{i.projectIncr}, |
|||
#{i.issueToProjectIncr}, |
|||
#{i.closedIssueIncr}, |
|||
#{i.projectResponseIncr}, |
|||
#{i.projectTransferIncr}, |
|||
#{i.projectClosedIncr}, |
|||
0, |
|||
0, |
|||
'BASE_REPORT', |
|||
NOW(), |
|||
'BASE_REPORT', |
|||
NOW() |
|||
) |
|||
</foreach> |
|||
ON DUPLICATE KEY |
|||
UPDATE |
|||
source_type = values(source_type), |
|||
customer_id = values(customer_id), |
|||
source_customer_id = values(source_customer_id), |
|||
project_count = values(project_count), |
|||
issue_to_project_count = values(issue_to_project_count), |
|||
closed_issue_count = values(closed_issue_count), |
|||
project_response_count = values(project_response_count), |
|||
project_transfer_count = values(project_transfer_count), |
|||
project_closed_count = values(project_closed_count), |
|||
project_incr = values(project_incr), |
|||
issue_to_project_incr = values(issue_to_project_incr), |
|||
closed_issue_incr = values(closed_issue_incr), |
|||
project_response_incr = values(project_response_incr), |
|||
project_transfer_incr = values(project_transfer_incr), |
|||
project_closed_incr = values(project_closed_incr), |
|||
updated_by = 'BASE_REPORT', |
|||
updated_time = NOW() |
|||
</insert> |
|||
|
|||
</mapper> |
@ -0,0 +1,2 @@ |
|||
alter table customer_agency add column SYNC_FLAG VARCHAR(1) not null default '1' comment '当前组织是否同步到统计库和指标库' AFTER AREA_CODE; |
|||
alter table customer_grid add column SYNC_FLAG VARCHAR(1) not null default '1' comment '当前网格是否同步到统计库和指标库' AFTER AREA_CODE; |
@ -0,0 +1,4 @@ |
|||
ALTER TABLE `stats_staff_patrol_record_daily` |
|||
ADD COLUMN `SOURCE_TYPE` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'internal' COMMENT '来源类型 external:外部,internal:内部' AFTER `ID`, |
|||
ADD COLUMN `SOURCE_CUSTOMER_ID` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL COMMENT '数据来源客户Id' AFTER `CUSTOMER_ID`; |
|||
|
Loading…
Reference in new issue