578 changed files with 43090 additions and 126 deletions
@ -0,0 +1,40 @@ |
|||
package com.epmet.constant; |
|||
|
|||
/** |
|||
* 描述一下 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 16:35 |
|||
*/ |
|||
public interface UserAnalysisConstant { |
|||
|
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
String REG_FLAG="reg"; |
|||
|
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
String PARTI_FLAG="parti"; |
|||
|
|||
String QUERY_USER_AGENCY_FAILED="查询用户所属机关信息失败"; |
|||
|
|||
/** |
|||
* 普通居民(已注册) |
|||
*/ |
|||
String REGISTERED_RESI= "居民"; |
|||
|
|||
/** |
|||
* 热心居民 |
|||
*/ |
|||
String WARMHEARTED="热心居民"; |
|||
|
|||
/** |
|||
* 党员 |
|||
*/ |
|||
String PARTYMEMBER="党员"; |
|||
|
|||
String DAY_TYPE="day"; |
|||
String MONTH_TYPE="month"; |
|||
} |
@ -0,0 +1,46 @@ |
|||
/** |
|||
* 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; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 机关维度 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-16 |
|||
*/ |
|||
@Data |
|||
public class DimAgencyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 组织IDAGENCY_ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 组织名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
} |
@ -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.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 客户网格维度 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-16 |
|||
*/ |
|||
@Data |
|||
public class DimGridDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* GRID_ID |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String gridName; |
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.epmet.dto.form.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 按日、按月查询注册用户数(参与用户数)增量折线图 入参 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:57 |
|||
*/ |
|||
@Data |
|||
public class UserIncrTrendFormDTO implements Serializable { |
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
@NotBlank(message = "regOrPartiFlag不能为空") |
|||
private String regOrPartiFlag; |
|||
|
|||
/** |
|||
* day:日维度 | month:月维度 | (周、季、年)… |
|||
*/ |
|||
@NotBlank(message = "type不能为空") |
|||
private String type; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.dto.form.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 各机关注册用户数入参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:47 |
|||
*/ |
|||
@Data |
|||
public class UserSubAgencyFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -4558978951554887536L; |
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
@NotBlank(message = "regOrPartiFlag不能为空") |
|||
private String regOrPartiFlag; |
|||
|
|||
@NotBlank(message = "查询日期不能为空") |
|||
private String dateId; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.dto.form.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 直属网格注册用户数 入参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:52 |
|||
*/ |
|||
@Data |
|||
public class UserSubGridFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -1815903503939673149L; |
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
@NotBlank(message = "regOrPartiFlag不能为空") |
|||
private String regOrPartiFlag; |
|||
|
|||
@NotBlank(message = "查询日期不能为空") |
|||
private String dateId; |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.epmet.dto.form.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 用户汇总信息 入参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:31 |
|||
*/ |
|||
@Data |
|||
public class UserSummaryInfoFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -1802471335671321322L; |
|||
|
|||
/** |
|||
* reg:注册居民 parti:参与用户,如果值为null,默认为reg |
|||
*/ |
|||
@NotBlank(message = "regOrPartiFlag不能为空") |
|||
private String regOrPartiFlag; |
|||
} |
@ -0,0 +1,20 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 描述一下 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/23 9:13 |
|||
*/ |
|||
@Data |
|||
public class UserIncrTrendResDTO implements Serializable { |
|||
private static final long serialVersionUID = 290620373673325352L; |
|||
private Integer regIncr; |
|||
private Integer warmIncr; |
|||
private Integer partymemberIncr; |
|||
private String dateIdOrMonthId; |
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 按日、按月查询注册用户数(参与用户数)增量折线图 返参 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 13:17 |
|||
*/ |
|||
@Data |
|||
public class UserIncrTrendResultDTO implements Serializable { |
|||
/** |
|||
* 日期如果按日查询返回yyyy/MM/dd,如果按月返回yyyy/MM |
|||
*/ |
|||
private String date; |
|||
|
|||
/** |
|||
* 居民、党员、热心居民返回中文描述 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 增量值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
// yyyyMMdd yyyyMM
|
|||
@JsonIgnore |
|||
private String dateOrMonthId; |
|||
} |
@ -0,0 +1,45 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 描述一下 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 21:45 |
|||
*/ |
|||
@Data |
|||
public class UserSubAgencyResDTO implements Serializable { |
|||
private static final long serialVersionUID = 5807572279154511198L; |
|||
/** |
|||
* 机关id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 机关名称 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 截止到本日参与用户总数 |
|||
*/ |
|||
private Integer regTotal; |
|||
|
|||
/** |
|||
* 截止到本日(参与用户中)居民总数 |
|||
*/ |
|||
private Integer resiTotal; |
|||
|
|||
/** |
|||
* 截止到本日(参与用户中)热心居民总数 |
|||
*/ |
|||
private Integer warmHeartedTotal; |
|||
|
|||
/** |
|||
* 截止到本日(参与用户中)党员总数 |
|||
*/ |
|||
private Integer partymemberTotal; |
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 各机关注册用户数入参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:49 |
|||
*/ |
|||
@Data |
|||
public class UserSubAgencyResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 3038896791082755087L; |
|||
/** |
|||
* 辽阳路街道 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 数值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型:居民、党员、热心居民 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 机关id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
@JsonIgnore |
|||
private Integer total; |
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 直属网格注册用户数(参与用户、注册用户通用类) |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 23:57 |
|||
*/ |
|||
@Data |
|||
public class UserSubGridResDTO implements Serializable { |
|||
private static final long serialVersionUID = 2203260762393704885L; |
|||
private String gridId; |
|||
private Integer regTotal; |
|||
private Integer resiTotal; |
|||
private Integer warmHeartedTotal; |
|||
private Integer partymemberTotal; |
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 直属网格注册用户数 返参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:54 |
|||
*/ |
|||
@Data |
|||
public class UserSubGridResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -7432747804212305863L; |
|||
|
|||
/** |
|||
* 网格名称:eg:第一网格 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 数值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型:居民、党员、热心居民 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
@JsonIgnore |
|||
private Integer total; |
|||
} |
@ -0,0 +1,77 @@ |
|||
package com.epmet.dto.result.user; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* 用户汇总信息 返参DTO |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 12:34 |
|||
*/ |
|||
@Data |
|||
public class UserSummaryInfoResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -4270726421611289755L; |
|||
/** |
|||
* 数据更新至yyyy.MM.dd |
|||
*/ |
|||
private String currentDate; |
|||
|
|||
/** |
|||
* 注册居民数 |
|||
*/ |
|||
private Integer regTotal; |
|||
|
|||
/** |
|||
* 参与用户数 |
|||
*/ |
|||
private Integer partiTotal; |
|||
|
|||
/** |
|||
* 党员数 |
|||
*/ |
|||
private Integer partymemberTotal; |
|||
|
|||
/** |
|||
* 党员占比 |
|||
*/ |
|||
private String partymemberProportion; |
|||
/** |
|||
* 热心居民数 |
|||
*/ |
|||
private Integer warmHeartedTotal; |
|||
|
|||
/** |
|||
* 热心居民占比 |
|||
*/ |
|||
private String warmHeartedProportion; |
|||
|
|||
@JsonIgnore |
|||
private BigDecimal partymemberProportionValue; |
|||
|
|||
@JsonIgnore |
|||
private BigDecimal warmHeartedProportionValue; |
|||
|
|||
@JsonIgnore |
|||
private String id; |
|||
|
|||
public UserSummaryInfoResultDTO(){ |
|||
this.currentDate=""; |
|||
this.regTotal=0; |
|||
this.partiTotal=0; |
|||
this.partymemberTotal=0; |
|||
this.partymemberProportion="0%"; |
|||
this.warmHeartedTotal=0; |
|||
this.warmHeartedProportion="0%"; |
|||
this.id=""; |
|||
} |
|||
|
|||
public static void main(String[] args) { |
|||
StringBuffer s=new StringBuffer("20190305").insert(4,".").insert(7,"."); |
|||
System.out.println(s); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,12 @@ |
|||
package com.epmet.group.constant; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 15:24 |
|||
*/ |
|||
public interface GroupConstant { |
|||
|
|||
String MONTH = "month"; |
|||
String DATE = "date"; |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.group.dto.form; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NonNull; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 12:07 |
|||
*/ |
|||
@Data |
|||
public class GroupIncrTrendFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1788937450915240575L; |
|||
|
|||
public interface GroupJava {} |
|||
|
|||
/** |
|||
* 类型 month:月 date:日 |
|||
*/ |
|||
@NotBlank(message = "type不能为空", groups = {GroupJava.class}) |
|||
private String type; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.group.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 14:30 |
|||
*/ |
|||
@Data |
|||
public class GridInfoResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 5301902590768338888L; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String gridName; |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.group.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 12:03 |
|||
*/ |
|||
@Data |
|||
public class GroupIncrTrendResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 5132636251609157706L; |
|||
|
|||
/** |
|||
* 日期 |
|||
*/ |
|||
private String date; |
|||
|
|||
/** |
|||
* 值 【小组数量】 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型 【小组数量】 |
|||
*/ |
|||
private String type; |
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.epmet.group.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 11:56 |
|||
* 网格小组——下级机关小组数柱状图 |
|||
*/ |
|||
@Data |
|||
public class GroupSubAgencyResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8562403482616167221L; |
|||
|
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 机关ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.epmet.group.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 11:56 |
|||
* 网格小组——下级机关小组数柱状图 |
|||
*/ |
|||
@Data |
|||
public class GroupSubGridResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -3260124064513560994L; |
|||
|
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 机关ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.epmet.group.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 11:05 |
|||
*/ |
|||
@Data |
|||
public class GroupSummaryInfoResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8529179932504931368L; |
|||
|
|||
/** |
|||
* 网格总数量 |
|||
*/ |
|||
private Integer gridTotalCount; |
|||
|
|||
/** |
|||
* 小组总数量 |
|||
*/ |
|||
private Integer groupTotalCount; |
|||
|
|||
/** |
|||
* 小组平均人数 |
|||
*/ |
|||
private Integer groupPeopleAvg; |
|||
|
|||
/** |
|||
* 小组人数中位数 |
|||
*/ |
|||
private Integer groupPeopleMedian; |
|||
|
|||
/** |
|||
* 数据更新至 时间 |
|||
*/ |
|||
private String deadline; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.group.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 14:02 |
|||
*/ |
|||
@Data |
|||
public class SubAgencyResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 2276056225590553307L; |
|||
|
|||
/** |
|||
* 机关ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 机关名称 |
|||
*/ |
|||
private String agencyName; |
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.epmet.issue.constant; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 14:07 |
|||
*/ |
|||
public interface IssueConstant { |
|||
String MONTH = "month"; |
|||
String DATE = "date"; |
|||
String VOTING_NAME = "表决中"; |
|||
String SHIFT_NAME = "已转项目"; |
|||
String CLOSED_NAME = "已关闭"; |
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.epmet.issue.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 16:32 |
|||
*/ |
|||
@Data |
|||
public class IssueIncrtrendFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 4408419854627376175L; |
|||
/** |
|||
* 类型,按日date 按月month |
|||
*/ |
|||
private String type; |
|||
} |
@ -0,0 +1,206 @@ |
|||
package com.epmet.issue.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 14:11 |
|||
*/ |
|||
@Data |
|||
public class IssueDataDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 9136989870868730175L; |
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 组织名 |
|||
*/ |
|||
private String agencyName; |
|||
|
|||
/** |
|||
* 网格ID |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 网格名 |
|||
*/ |
|||
private String gridName; |
|||
|
|||
/** |
|||
* 年度ID |
|||
*/ |
|||
private String yearId; |
|||
|
|||
/** |
|||
* 年度名 |
|||
*/ |
|||
private String yearName; |
|||
|
|||
/** |
|||
* 季度ID |
|||
*/ |
|||
private String quarterId; |
|||
|
|||
/** |
|||
* 季度名 |
|||
*/ |
|||
private String quarterName; |
|||
|
|||
/** |
|||
* 月度ID |
|||
*/ |
|||
private String monthId; |
|||
|
|||
/** |
|||
* 月度名 |
|||
*/ |
|||
private String monthName; |
|||
|
|||
/** |
|||
* 周ID |
|||
*/ |
|||
private String weekId; |
|||
|
|||
/** |
|||
* 日期ID |
|||
*/ |
|||
private String dateId; |
|||
|
|||
/** |
|||
* 日期名 |
|||
*/ |
|||
private String dateName; |
|||
|
|||
/** |
|||
* 当日议题增量 |
|||
*/ |
|||
private Integer issueIncr; |
|||
|
|||
/** |
|||
* 议题总数 |
|||
*/ |
|||
private Integer issueTotal; |
|||
|
|||
/** |
|||
* 当日已转项目的议题数增量 |
|||
*/ |
|||
private Integer shiftProjectIncr; |
|||
|
|||
/** |
|||
* 已转项目的议题总数 |
|||
*/ |
|||
private Integer shiftProjectTotal; |
|||
|
|||
/** |
|||
* 已转项目所占百分比 |
|||
*/ |
|||
private BigDecimal shiftProjectPercent; |
|||
|
|||
/** |
|||
* 当日表决中议题数增量 |
|||
*/ |
|||
private Integer votingIncr; |
|||
|
|||
/** |
|||
* 表决中议题总数 |
|||
*/ |
|||
private Integer votingTotal; |
|||
|
|||
/** |
|||
* 表决中议题所占百分比 |
|||
*/ |
|||
private BigDecimal votingPercent; |
|||
|
|||
/** |
|||
* 当日已关闭议题数增量 |
|||
*/ |
|||
private Integer closedIncr; |
|||
|
|||
/** |
|||
* 当日已关闭议题中已解决数量 |
|||
*/ |
|||
private Integer closedResolvedIncr; |
|||
|
|||
/** |
|||
* 当日已关闭议题中无需解决数量 |
|||
*/ |
|||
private Integer closedUnresolvedIncr; |
|||
|
|||
/** |
|||
* 已关闭议题总数 |
|||
*/ |
|||
private Integer closedTotal; |
|||
|
|||
/** |
|||
* 已关闭议题中已解决总数 |
|||
*/ |
|||
private Integer closedResolvedTotal; |
|||
|
|||
/** |
|||
* 已关闭议题中未解决总数 |
|||
*/ |
|||
private Integer closedUnresolvedTotal; |
|||
|
|||
/** |
|||
* 已关闭议题所占百分比 |
|||
*/ |
|||
private BigDecimal closedPercent; |
|||
|
|||
/** |
|||
* 已关闭议题中已解决百分比 |
|||
*/ |
|||
private BigDecimal closedResolvedPercent; |
|||
|
|||
/** |
|||
* 已关闭议题中未解决百分比 |
|||
*/ |
|||
private BigDecimal closedUnresolvedPercent; |
|||
|
|||
/** |
|||
* 当日已结案议题数 |
|||
*/ |
|||
private Integer closedCaseIncr; |
|||
|
|||
/** |
|||
* 当日已结案议题中已解决数 |
|||
*/ |
|||
private Integer closedCaseResolvedIncr; |
|||
|
|||
/** |
|||
* 当日已结案议题中未解决数 |
|||
*/ |
|||
private Integer closedCaseUnresolvedIncr; |
|||
|
|||
/** |
|||
* 已结案议题总数 |
|||
*/ |
|||
private Integer closedCaseTotal; |
|||
|
|||
/** |
|||
* 已结案议题中已解决总数 |
|||
*/ |
|||
private Integer closedCaseResolvedTotal; |
|||
|
|||
/** |
|||
* 已结案议题中未解决总数 |
|||
*/ |
|||
private Integer closedCaseUnresolvedTotal; |
|||
|
|||
/** |
|||
* 已结案议题中已解决百分比 |
|||
*/ |
|||
private BigDecimal closedCaseResolvedPercent; |
|||
|
|||
/** |
|||
* 已结案议题中未解决百分比 |
|||
*/ |
|||
private BigDecimal closedCaseUnresolvedPercent; |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.issue.dto.result; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 16:30 |
|||
*/ |
|||
@NoArgsConstructor |
|||
@Data |
|||
public class IssueIncrtrendResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 7762529188251385355L; |
|||
/** |
|||
* 日期 |
|||
*/ |
|||
private String date; |
|||
/** |
|||
* 状态(表决中,已转项目,已关闭) |
|||
*/ |
|||
private String type; |
|||
/** |
|||
* 数量 |
|||
*/ |
|||
private Integer value; |
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.epmet.issue.dto.result; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 16:24 |
|||
*/ |
|||
@NoArgsConstructor |
|||
@Data |
|||
public class IssueSubAgencyResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 2640337888693960513L; |
|||
/** |
|||
* 组织ID |
|||
*/ |
|||
private String agencyId; |
|||
/** |
|||
* 组织名 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 类型 表决中,已转项目,已关闭 |
|||
*/ |
|||
private String type; |
|||
/** |
|||
* 数量 |
|||
*/ |
|||
private Integer value; |
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.epmet.issue.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 16:27 |
|||
*/ |
|||
@Data |
|||
public class IssueSubGridResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -3318384216762207856L; |
|||
/** |
|||
* 网格名 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 类型 表决中,已转项目,已关闭 |
|||
*/ |
|||
private String type; |
|||
/** |
|||
* 数量 |
|||
*/ |
|||
private Integer value; |
|||
} |
@ -0,0 +1,54 @@ |
|||
package com.epmet.issue.dto.result; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 16:17 |
|||
*/ |
|||
@NoArgsConstructor |
|||
@Data |
|||
public class IssueSummaryInfoResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -7959140755148294338L; |
|||
/** |
|||
* 机关ID |
|||
*/ |
|||
private String agencyId; |
|||
/** |
|||
* 议题总数 |
|||
*/ |
|||
private Integer issueTotal; |
|||
/** |
|||
* 表决中数量 |
|||
*/ |
|||
private Integer votingTotal; |
|||
/** |
|||
* 已转项目数量 |
|||
*/ |
|||
private Integer shiftProjectTotal; |
|||
/** |
|||
* 已关闭数量 |
|||
*/ |
|||
private Integer closedTotal; |
|||
/** |
|||
* 表决中占比 |
|||
*/ |
|||
private String votingRatio; |
|||
/** |
|||
* 已转项目占比 |
|||
*/ |
|||
private String shiftProjectRatio; |
|||
/** |
|||
* 已关闭占比 |
|||
*/ |
|||
private String closedRatio; |
|||
/** |
|||
* 更新至日期 |
|||
*/ |
|||
private String dateName; |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.issue.dto.result; |
|||
|
|||
import lombok.Data; |
|||
import lombok.NoArgsConstructor; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 16:21 |
|||
*/ |
|||
@NoArgsConstructor |
|||
@Data |
|||
public class IssueSummaryPieResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -971115426789868580L; |
|||
/** |
|||
* 名称 表决中,已转项目,已关闭 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 值 |
|||
*/ |
|||
private Integer value; |
|||
/** |
|||
* 百分比 |
|||
*/ |
|||
private String ratio; |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.project.constant; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目 |
|||
**/ |
|||
public interface ProjectConstant { |
|||
|
|||
String DATE = "date"; |
|||
String MONTH = "month"; |
|||
|
|||
/** |
|||
* 根据Token获取组织信息失败 |
|||
*/ |
|||
String GET_AGENCYID = "根据Token获取组织信息失败"; |
|||
/** |
|||
* 参数异常 |
|||
*/ |
|||
String TYPE_EXCEPTION = "必要参数为空或参数格式错误"; |
|||
|
|||
} |
@ -0,0 +1,182 @@ |
|||
/** |
|||
* 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.project.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-16 |
|||
*/ |
|||
@Data |
|||
public class FactAgencyProjectDailyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 唯一标识 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户Id 【dim_customer.id】 |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 机关Id 【dim_agency.id】 |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 上级组织Id【dim_agency.pid】 |
|||
*/ |
|||
private String parentId; |
|||
|
|||
/** |
|||
* 日维度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; |
|||
|
|||
/** |
|||
* 截止当日项目总数 【当前组织及下级项目总数】 |
|||
*/ |
|||
private Integer projectTotal; |
|||
|
|||
/** |
|||
* 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 |
|||
*/ |
|||
private Integer pendingTotal; |
|||
|
|||
/** |
|||
* 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 |
|||
*/ |
|||
private BigDecimal pendingRatio; |
|||
|
|||
/** |
|||
* 截止当日已结案项目数 【当前组织及下级已结案项目总数】 |
|||
*/ |
|||
private Integer closedTotal; |
|||
|
|||
/** |
|||
* 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 |
|||
*/ |
|||
private BigDecimal closedRatio; |
|||
|
|||
/** |
|||
* 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 |
|||
*/ |
|||
private Integer resolvedTotal; |
|||
|
|||
/** |
|||
* 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 |
|||
*/ |
|||
private BigDecimal resolvedRatio; |
|||
|
|||
/** |
|||
* 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 |
|||
*/ |
|||
private Integer unresolvedTotal; |
|||
|
|||
/** |
|||
* 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 |
|||
*/ |
|||
private BigDecimal unresolvedRatio; |
|||
|
|||
/** |
|||
* 当日项目总数 【当前组织及下级项目总数】 |
|||
*/ |
|||
private Integer projectIncr; |
|||
|
|||
/** |
|||
* 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 |
|||
*/ |
|||
private Integer pendingIncr; |
|||
|
|||
/** |
|||
* 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 |
|||
*/ |
|||
private Integer closedIncr; |
|||
|
|||
/** |
|||
* 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 |
|||
*/ |
|||
private Integer resolvedIncr; |
|||
|
|||
/** |
|||
* 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 |
|||
*/ |
|||
private Integer unresolvedIncr; |
|||
|
|||
/** |
|||
* 删除标识 【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.project.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-日/月数据查询-接口入参 |
|||
*/ |
|||
@Data |
|||
public class ProjectIncrTrendFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -4929038359220814068L; |
|||
|
|||
public interface ProjectIncr { |
|||
} |
|||
|
|||
/** |
|||
* 类型 month:代表月 date:代表日 |
|||
*/ |
|||
@NotBlank(message = "month / date 类型不能为空", groups = {ProjectIncr.class}) |
|||
private String type; |
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.epmet.project.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取组织下饼图数据-接口返参 |
|||
**/ |
|||
@Data |
|||
public class ProjectIncrTrendResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8529179932504931368L; |
|||
|
|||
/** |
|||
* 日期(2020/1/1;2020/1/2...) |
|||
*/ |
|||
private String date; |
|||
|
|||
/** |
|||
* 类型对应数量 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型名称(处理中;已结案) |
|||
*/ |
|||
private String type; |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.epmet.project.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取组织下饼图数据-接口返参 |
|||
**/ |
|||
@Data |
|||
public class ProjectSubAgencyResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8529179932504931368L; |
|||
|
|||
/** |
|||
* 机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 机关名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 不同类型对应数据 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型名称(处理中;已结案) |
|||
*/ |
|||
private String type; |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.epmet.project.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取组织下饼图数据-接口返参 |
|||
**/ |
|||
@Data |
|||
public class ProjectSubGridResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8529179932504931368L; |
|||
|
|||
/** |
|||
* 机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 机关名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 不同类型对应数据 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型名称(处理中;已结案) |
|||
*/ |
|||
private String type; |
|||
|
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.epmet.project.dto.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取组织下饼图数据-接口返参 |
|||
**/ |
|||
@Data |
|||
public class ProjectSummaryInfoResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8529179932504931368L; |
|||
|
|||
/** |
|||
* 类型名称(处理中;已结案) |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 类型对应数量 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型对应百分比(10% 10.1% 10.01%小数点后两位) |
|||
*/ |
|||
@JsonIgnore |
|||
private BigDecimal ratioInt; |
|||
private String ratio; |
|||
|
|||
} |
@ -0,0 +1,56 @@ |
|||
package com.epmet.project.dto.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonIgnore; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-汇总数据-接口返参 |
|||
**/ |
|||
@Data |
|||
public class ProjectSummaryResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 8529179932504931368L; |
|||
|
|||
/** |
|||
* 机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 项目总数 |
|||
*/ |
|||
private Integer projectTotal; |
|||
|
|||
/** |
|||
* 更新日期 |
|||
*/ |
|||
private String dateName; |
|||
|
|||
/** |
|||
* 处理中总数 |
|||
*/ |
|||
private Integer pendingTotal; |
|||
|
|||
/** |
|||
* 处理中占比 |
|||
*/ |
|||
@JsonIgnore |
|||
private BigDecimal pendingRatioInt; |
|||
private String pendingRatio; |
|||
|
|||
/** |
|||
* 已结案总数 |
|||
*/ |
|||
private Integer closedTotal; |
|||
|
|||
/** |
|||
* 已结案占比 |
|||
*/ |
|||
@JsonIgnore |
|||
private BigDecimal closedRatioInt; |
|||
private String closedRatio; |
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.epmet.publicity.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author jyy |
|||
* @CreateTime 2020/6/22 12:07 |
|||
*/ |
|||
@Data |
|||
public class TagFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1788937450915240575L; |
|||
|
|||
public interface GroupJava {} |
|||
|
|||
/** |
|||
* 获取数据条数;默认为10 |
|||
*/ |
|||
private Integer pageSize; |
|||
|
|||
/** |
|||
* 时间查询维度;日:date;月:month;季:quarter;年:year |
|||
*/ |
|||
@NotBlank(message = "type不能为空", groups = {GroupJava.class}) |
|||
private String type; |
|||
} |
@ -0,0 +1,61 @@ |
|||
/** |
|||
* 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.publicity.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 文章发表数量—下级机关统计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-19 |
|||
*/ |
|||
@Data |
|||
public class FactPublishedAgencyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 机关名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* 发文数量 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 固定值:文章数量 |
|||
*/ |
|||
private String type="文章数量"; |
|||
|
|||
/** |
|||
* 机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 上级机关Id |
|||
*/ |
|||
private String pid; |
|||
|
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
/** |
|||
* 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.publicity.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 文章发表数量—下级机关统计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-19 |
|||
*/ |
|||
@Data |
|||
public class FactPublishedAgencyDailyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
|
|||
/** |
|||
* 累计发文总数 |
|||
*/ |
|||
private Integer publishedTotal; |
|||
|
|||
/** |
|||
* 发布中的文章总数 |
|||
*/ |
|||
private Integer publishingTotal; |
|||
|
|||
/** |
|||
* 数据截止日期 |
|||
*/ |
|||
private String dateName; |
|||
|
|||
|
|||
} |
@ -0,0 +1,62 @@ |
|||
/** |
|||
* 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.publicity.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 文章发表数量—直属部门统计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-19 |
|||
*/ |
|||
@Data |
|||
public class FactPublishedDepartmentDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 部门名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 发文数量 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 固定值:文章数量 |
|||
*/ |
|||
private String type="文章数量"; |
|||
|
|||
/** |
|||
* 机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 部门Id |
|||
*/ |
|||
private String departmentId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,62 @@ |
|||
/** |
|||
* 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.publicity.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
|
|||
/** |
|||
* 文章发表数量—直属部门统计 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-19 |
|||
*/ |
|||
@Data |
|||
public class FactPublishedGridDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 网格名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 发文数量 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 固定值:文章数量 |
|||
*/ |
|||
private String type="文章数量"; |
|||
|
|||
/** |
|||
* 机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 网格Id |
|||
*/ |
|||
private String gridId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,63 @@ |
|||
/** |
|||
* 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.publicity.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* 文章引用标签阅读数量【机关】统计表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-19 |
|||
*/ |
|||
@Data |
|||
public class FactTagAgencyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 标签名称 标签名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 使用改标签的数量 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 固定值:文章数量 |
|||
*/ |
|||
private String type="文章数量"; |
|||
|
|||
/** |
|||
* 机关Id |
|||
*/ |
|||
private String agencyId; |
|||
|
|||
/** |
|||
* 标签Id |
|||
*/ |
|||
private String tagId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.topic.constant; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 17:19 |
|||
*/ |
|||
public interface TopicConstant { |
|||
|
|||
/** |
|||
* 讨论中 |
|||
*/ |
|||
String DISCUSSING = "discussing"; |
|||
|
|||
/** |
|||
* 已屏蔽 |
|||
*/ |
|||
String HIDDEN = "hidden"; |
|||
|
|||
/** |
|||
* 已关闭 |
|||
*/ |
|||
String CLOSED = "closed"; |
|||
|
|||
String RATIO = "%"; |
|||
|
|||
String SHIFTED = "已转议题"; |
|||
|
|||
String MONTH = "month"; |
|||
String DATE = "date"; |
|||
} |
@ -0,0 +1,24 @@ |
|||
package com.epmet.topic.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 16:24 |
|||
*/ |
|||
@Data |
|||
public class TopicIncrTrendFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -4929038359220814068L; |
|||
|
|||
public interface TopicIncr{} |
|||
|
|||
/** |
|||
* 类型 month:代表月 date:代表日 |
|||
*/ |
|||
@NotBlank(message = "month / date 类型不能为空",groups = {TopicIncr.class}) |
|||
private String type; |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.topic.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 16:09 |
|||
*/ |
|||
@Data |
|||
public class TopicIncrTrendResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 6905657684644153197L; |
|||
|
|||
/** |
|||
* 日期 |
|||
*/ |
|||
private String date; |
|||
|
|||
/** |
|||
* 值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型 |
|||
*/ |
|||
private String type; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.topic.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 17:32 |
|||
*/ |
|||
@Data |
|||
public class TopicShiftedCountResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -7470748727678087785L; |
|||
|
|||
/** |
|||
* 已转议题数量 |
|||
*/ |
|||
private Integer shiftedIssueCount; |
|||
|
|||
/** |
|||
* 数据更新至 时间 |
|||
*/ |
|||
private String deadline; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.epmet.topic.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 17:10 |
|||
*/ |
|||
@Data |
|||
public class TopicStatusResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -6461755954651271901L; |
|||
|
|||
/** |
|||
* 话题数量 |
|||
*/ |
|||
private Integer topicCount; |
|||
|
|||
/** |
|||
* 话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing |
|||
*/ |
|||
private String topicStatus; |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.epmet.topic.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 16:13 |
|||
*/ |
|||
@Data |
|||
public class TopicSubAgencyResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 70586943923355457L; |
|||
|
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 机关Id |
|||
*/ |
|||
private String agencyId; |
|||
} |
@ -0,0 +1,35 @@ |
|||
package com.epmet.topic.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 16:13 |
|||
*/ |
|||
@Data |
|||
public class TopicSubGridResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -7251687622455341118L; |
|||
|
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 类型 |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 网格Id |
|||
*/ |
|||
private String gridId; |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.epmet.topic.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 16:14 |
|||
*/ |
|||
@Data |
|||
public class TopicSummaryInfoResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1103298182001744033L; |
|||
|
|||
/** |
|||
* 名称 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 值 |
|||
*/ |
|||
private Integer value; |
|||
|
|||
/** |
|||
* 百分比 |
|||
*/ |
|||
private String ratio; |
|||
} |
@ -0,0 +1,45 @@ |
|||
package com.epmet.topic.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 16:04 |
|||
*/ |
|||
@Data |
|||
public class TopicSummaryResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -6051892596892952025L; |
|||
|
|||
/** |
|||
* 话题总数 |
|||
*/ |
|||
private Integer topicTotalCount; |
|||
|
|||
/** |
|||
* 讨论中话题数量 |
|||
*/ |
|||
private Integer talkingTotalCount; |
|||
|
|||
/** |
|||
* 已关闭话题数量 |
|||
*/ |
|||
private Integer closedTotalCount; |
|||
|
|||
/** |
|||
* 已屏蔽话题数量 |
|||
*/ |
|||
private Integer shieldedTotalCount; |
|||
|
|||
/** |
|||
* 话题已转议题数量 |
|||
*/ |
|||
private Integer shiftedTotalCount; |
|||
|
|||
/** |
|||
* 数据更新至 时间 |
|||
*/ |
|||
private String deadline; |
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.epmet.aspect; |
|||
|
|||
import com.epmet.commons.tools.aspect.BaseRequestLogAspect; |
|||
import org.aspectj.lang.ProceedingJoinPoint; |
|||
import org.aspectj.lang.annotation.Around; |
|||
import org.aspectj.lang.annotation.Aspect; |
|||
import org.springframework.core.annotation.Order; |
|||
import org.springframework.stereotype.Component; |
|||
import org.springframework.web.context.request.RequestAttributes; |
|||
import org.springframework.web.context.request.RequestContextHolder; |
|||
import org.springframework.web.context.request.ServletRequestAttributes; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
|
|||
/** |
|||
* 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 |
|||
*/ |
|||
@Aspect |
|||
@Component |
|||
@Order(0) |
|||
public class RequestLogAspect extends BaseRequestLogAspect { |
|||
|
|||
@Override |
|||
@Around(value = "execution(* com.epmet.controller.*.*Controller*.*(..)) ") |
|||
public Object proceed(ProceedingJoinPoint point) throws Throwable { |
|||
return super.proceed(point, getRequest()); |
|||
} |
|||
|
|||
/** |
|||
* 获取Request对象 |
|||
* |
|||
* @return |
|||
*/ |
|||
private HttpServletRequest getRequest() { |
|||
RequestAttributes ra = RequestContextHolder.getRequestAttributes(); |
|||
ServletRequestAttributes sra = (ServletRequestAttributes) ra; |
|||
return sra.getRequest(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,74 @@ |
|||
package com.epmet.module.group.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.group.dto.form.GroupIncrTrendFormDTO; |
|||
import com.epmet.group.dto.result.GroupIncrTrendResultDTO; |
|||
import com.epmet.group.dto.result.GroupSubAgencyResultDTO; |
|||
import com.epmet.group.dto.result.GroupSubGridResultDTO; |
|||
import com.epmet.group.dto.result.GroupSummaryInfoResultDTO; |
|||
import com.epmet.service.group.GroupService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 10:54 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("group") |
|||
public class GroupController { |
|||
|
|||
@Autowired |
|||
private GroupService groupService; |
|||
|
|||
/** |
|||
* @Description 网格小组:网格总数、网格小组数、小组平均数、小组人数中位数 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@PostMapping("summaryinfo") |
|||
public Result<GroupSummaryInfoResultDTO> summaryInfo(@LoginUser TokenDto tokenDto){ |
|||
return new Result<GroupSummaryInfoResultDTO>().ok(groupService.summaryInfo(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* @Description 网格小组——下级机关小组数柱状图 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@PostMapping("subagency") |
|||
public Result<List<GroupSubAgencyResultDTO>> subAgency(@LoginUser TokenDto tokenDto){ |
|||
return new Result<List<GroupSubAgencyResultDTO>>().ok(groupService.subAgency(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* @Description 网格小组——直属网格小组数 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@PostMapping("subgrid") |
|||
public Result<List<GroupSubGridResultDTO>> subGrid(@LoginUser TokenDto tokenDto){ |
|||
return new Result<List<GroupSubGridResultDTO>>().ok(groupService.subGrid(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* @Description 网格小组——小组分析 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@PostMapping("incrtrend") |
|||
public Result<List<GroupIncrTrendResultDTO>> IncrTrend(@LoginUser TokenDto tokenDto, @RequestBody GroupIncrTrendFormDTO formDTO){ |
|||
ValidatorUtils.validateEntity(formDTO, GroupIncrTrendFormDTO.GroupJava.class); |
|||
return new Result<List<GroupIncrTrendResultDTO>>().ok(groupService.IncrTrend(tokenDto,formDTO)); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,95 @@ |
|||
package com.epmet.controller.issue; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; |
|||
import com.epmet.issue.dto.result.*; |
|||
import com.epmet.service.issue.IssueService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 13:47 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("issue") |
|||
public class IssueController { |
|||
@Autowired |
|||
private IssueService issueService; |
|||
|
|||
/** |
|||
* 数据汇总 |
|||
* |
|||
* @param tokenDto |
|||
* @return com.epmet.commons.tools.utils.Result<com.epmet.issue.dto.result.IssueSummaryInfoResultDTO> |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 17:31 |
|||
*/ |
|||
@PostMapping("summaryinfo") |
|||
public Result<IssueSummaryInfoResultDTO> getSummaryInfo(@LoginUser TokenDto tokenDto) { |
|||
return new Result<IssueSummaryInfoResultDTO>().ok(issueService.getSummaryInfo(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* 数据汇总饼状图 |
|||
* |
|||
* @param tokenDto |
|||
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.issue.dto.result.IssueSummaryPieResultDTO>> |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 17:31 |
|||
*/ |
|||
@PostMapping("summarypie") |
|||
public Result<List<IssueSummaryPieResultDTO>> getSummaryPie(@LoginUser TokenDto tokenDto) { |
|||
return new Result<List<IssueSummaryPieResultDTO>>().ok(issueService.getSummaryPie(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* 下级机关议题统计 |
|||
* |
|||
* @param tokenDto |
|||
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.issue.dto.result.IssueSubAgencyResultDTO>> |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 17:31 |
|||
*/ |
|||
@PostMapping("subagency") |
|||
public Result<List<IssueSubAgencyResultDTO>> getSubAgency(@LoginUser TokenDto tokenDto) { |
|||
return new Result<List<IssueSubAgencyResultDTO>>().ok(issueService.getSubAgency(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* 网格议题统计 |
|||
* |
|||
* @param tokenDto |
|||
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.issue.dto.result.IssueSubGridResultDTO>> |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 17:31 |
|||
*/ |
|||
@PostMapping("subgrid") |
|||
public Result<List<IssueSubGridResultDTO>> getSubGrid(@LoginUser TokenDto tokenDto) { |
|||
return new Result<List<IssueSubGridResultDTO>>().ok(issueService.getSubGrid(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* 议题分析 |
|||
* |
|||
* @param tokenDto |
|||
* @param formDTO |
|||
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.issue.dto.result.IssueIncrtrendResultDTO>> |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 17:31 |
|||
*/ |
|||
@PostMapping("incrtrend") |
|||
public Result<List<IssueIncrtrendResultDTO>> getIncrtrend(@LoginUser TokenDto tokenDto, @RequestBody IssueIncrtrendFormDTO formDTO) { |
|||
return new Result<List<IssueIncrtrendResultDTO>>().ok(issueService.getIncrtrend(tokenDto, formDTO)); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,81 @@ |
|||
package com.epmet.module.project.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.module.project.service.ProjectService; |
|||
import com.epmet.project.constant.ProjectConstant; |
|||
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; |
|||
import com.epmet.project.dto.result.*; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目 |
|||
**/ |
|||
@RestController |
|||
@RequestMapping("project") |
|||
public class ProjectController { |
|||
|
|||
@Autowired |
|||
private ProjectService projectService; |
|||
|
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取汇总数据 |
|||
**/ |
|||
@PostMapping("projectsummary") |
|||
public Result<ProjectSummaryResultDTO> projectSummary(@LoginUser TokenDto tokenDto) { |
|||
return new Result<ProjectSummaryResultDTO>().ok(projectService.getProjectSummary(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取组织下饼图数据 |
|||
**/ |
|||
@PostMapping("summaryinfo") |
|||
public Result<List<ProjectSummaryInfoResultDTO>> summaryInfo(@LoginUser TokenDto tokenDto) { |
|||
return new Result<List<ProjectSummaryInfoResultDTO>>().ok(projectService.getSummaryInfo(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取下级组织柱状图数据 |
|||
**/ |
|||
@PostMapping("subagency") |
|||
public Result<List<ProjectSubAgencyResultDTO>> subAgency(@LoginUser TokenDto tokenDto) { |
|||
return new Result<List<ProjectSubAgencyResultDTO>>().ok(projectService.getSubAgency(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取机关直属网格项目数据 |
|||
**/ |
|||
@PostMapping("subgrid") |
|||
public Result<List<ProjectSubGridResultDTO>> subGrid(@LoginUser TokenDto tokenDto) { |
|||
return new Result<List<ProjectSubGridResultDTO>>().ok(projectService.getSubGrid(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-日/月数据查询 |
|||
**/ |
|||
@PostMapping("incrtrend") |
|||
public Result<List<ProjectIncrTrendResultDTO>> incrTrend(@LoginUser TokenDto tokenDto, @RequestBody ProjectIncrTrendFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, ProjectIncrTrendFormDTO.ProjectIncr.class); |
|||
if (!ProjectConstant.DATE.equals(formDTO.getType()) && !ProjectConstant.MONTH.equals(formDTO.getType())) { |
|||
throw new RenException(ProjectConstant.TYPE_EXCEPTION); |
|||
} |
|||
return new Result<List<ProjectIncrTrendResultDTO>>().ok(projectService.getProjectIncrTrend(tokenDto, formDTO)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,132 @@ |
|||
/** |
|||
* 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.controller.publicity; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.publicity.dto.form.TagFormDTO; |
|||
import com.epmet.publicity.dto.result.*; |
|||
import com.epmet.service.publicity.PublicityService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* 文章发布数量【机关】日统计表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-19 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("publicity") |
|||
public class PublicityController { |
|||
|
|||
|
|||
@Autowired |
|||
private PublicityService publicityService;//
|
|||
|
|||
|
|||
/** |
|||
* @return |
|||
* @Author jyy |
|||
* @Description 宣传能力—工作端—当前机关累计发文和当前发文 |
|||
**/ |
|||
@PostMapping("summaryinfo") |
|||
public Result<FactPublishedAgencyDailyDTO> summaryInfo(@LoginUser TokenDto tokenDto) { |
|||
return new Result<FactPublishedAgencyDailyDTO>().ok(publicityService.summaryInfo(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* @param tokenDto |
|||
* @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 |
|||
* @author jyy |
|||
*/ |
|||
@PostMapping("tagviewed") |
|||
public Result<List<FactTagAgencyDTO>> tagviewed(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); |
|||
|
|||
Integer pageSize = formDTO.getPageSize(); |
|||
if (pageSize == null) { |
|||
pageSize = NumConstant.TEN; |
|||
} |
|||
String type = formDTO.getType(); |
|||
return new Result<List<FactTagAgencyDTO>>().ok(publicityService.tagviewed(tokenDto, pageSize, type)); |
|||
} |
|||
|
|||
/** |
|||
* @param tokenDto |
|||
* @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 |
|||
* @author jyy |
|||
*/ |
|||
@PostMapping("tagused") |
|||
public Result<List<FactTagAgencyDTO>> tagused(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); |
|||
|
|||
Integer pageSize = formDTO.getPageSize(); |
|||
if (pageSize == null) { |
|||
pageSize = NumConstant.TEN; |
|||
} |
|||
String type = formDTO.getType(); |
|||
return new Result<List<FactTagAgencyDTO>>().ok(publicityService.tagused(tokenDto, pageSize, type)); |
|||
} |
|||
|
|||
/** |
|||
* @param tokenDto 登录者token |
|||
* @Description 获取下级机关发文数 |
|||
* @author jyy |
|||
*/ |
|||
@PostMapping("subagency/publishedarticle") |
|||
public Result<List<FactPublishedAgencyDTO>> subagencyPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); |
|||
String type = formDTO.getType(); |
|||
return new Result<List<FactPublishedAgencyDTO>>().ok(publicityService.subagencyPublishedarticle(tokenDto, type)); |
|||
} |
|||
|
|||
/** |
|||
* @param tokenDto 登录者token |
|||
* @Description 获取直属部门发文数 |
|||
* @author jyy |
|||
*/ |
|||
@PostMapping("department/publishedarticle") |
|||
public Result<List<FactPublishedDepartmentDTO>> departmentPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); |
|||
String type = formDTO.getType(); |
|||
return new Result<List<FactPublishedDepartmentDTO>>().ok(publicityService.departmentPublishedarticle(tokenDto, type)); |
|||
} |
|||
|
|||
/** |
|||
* @param tokenDto 登录者token |
|||
* @Description 获取指数网格发文数 |
|||
* @author jyy |
|||
*/ |
|||
@PostMapping("subgrid/publishedarticle") |
|||
public Result<List<FactPublishedGridDTO>> subgridPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); |
|||
String type = formDTO.getType(); |
|||
return new Result<List<FactPublishedGridDTO>>().ok(publicityService.subgridPublishedarticle(tokenDto, type)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,81 @@ |
|||
package com.epmet.controller.topic; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.service.topic.TopicService; |
|||
import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; |
|||
import com.epmet.topic.dto.result.*; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 15:55 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("topic") |
|||
public class TopicController { |
|||
|
|||
@Autowired |
|||
private TopicService topicService; |
|||
|
|||
/** |
|||
* @Description 话题:话题总数、讨论中话题数量、已关闭话题数量、已屏蔽话题数量、话题已转议题数量、数据更新至2020-06-17 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@PostMapping("topicsummary") |
|||
public Result<TopicSummaryResultDTO> topicSummary(@LoginUser TokenDto tokenDto){ |
|||
return new Result<TopicSummaryResultDTO>().ok(topicService.topicSummary(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* @Description 话题——话题分析 |
|||
* @param tokenDto |
|||
* @param formDTO |
|||
* @author zxc |
|||
*/ |
|||
@PostMapping("incrtrend") |
|||
public Result<List<TopicIncrTrendResultDTO>> topicIncrTrend(@LoginUser TokenDto tokenDto, @RequestBody TopicIncrTrendFormDTO formDTO){ |
|||
ValidatorUtils.validateEntity(formDTO, TopicIncrTrendFormDTO.TopicIncr.class); |
|||
return new Result<List<TopicIncrTrendResultDTO>>().ok(topicService.topicIncrTrend(tokenDto,formDTO)); |
|||
} |
|||
|
|||
/** |
|||
* @Description 话题——直属网格话题数 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@PostMapping("subgrid") |
|||
public Result<List<TopicSubGridResultDTO>> topicSubGrid(@LoginUser TokenDto tokenDto){ |
|||
return new Result<List<TopicSubGridResultDTO>>().ok(topicService.topicSubGrid(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* @Description 话题——下级机关话题数 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@PostMapping("subagency") |
|||
public Result<List<TopicSubAgencyResultDTO>> topicSubAgency(@LoginUser TokenDto tokenDto){ |
|||
return new Result<List<TopicSubAgencyResultDTO>>().ok(topicService.topicSubAgency(tokenDto)); |
|||
} |
|||
|
|||
/** |
|||
* @Description 话题——话题分析表 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@PostMapping("summaryinfo") |
|||
public Result<List<TopicSummaryInfoResultDTO>> topicSummaryInfo(@LoginUser TokenDto tokenDto){ |
|||
return new Result<List<TopicSummaryInfoResultDTO>>().ok(topicService.topicSummaryInfo(tokenDto)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,90 @@ |
|||
package com.epmet.controller.user; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.dto.form.user.UserIncrTrendFormDTO; |
|||
import com.epmet.dto.form.user.UserSubAgencyFormDTO; |
|||
import com.epmet.dto.form.user.UserSubGridFormDTO; |
|||
import com.epmet.dto.form.user.UserSummaryInfoFormDTO; |
|||
import com.epmet.dto.result.user.UserIncrTrendResultDTO; |
|||
import com.epmet.dto.result.user.UserSubAgencyResultDTO; |
|||
import com.epmet.dto.result.user.UserSubGridResultDTO; |
|||
import com.epmet.dto.result.user.UserSummaryInfoResultDTO; |
|||
import com.epmet.service.user.UserAnalysisService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 组织能力用户相关接口入口 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 13:22 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("user") |
|||
public class UserAnalysisController { |
|||
@Autowired |
|||
private UserAnalysisService userService; |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.commons.tools.utils.Result<com.epmet.user.result.UserSummaryInfoResultDTO> |
|||
* @author yinzuomei |
|||
* @description 用户汇总信息查询 |
|||
* @Date 2020/6/22 13:27 |
|||
**/ |
|||
@PostMapping("summaryinfo") |
|||
public Result<UserSummaryInfoResultDTO> summaryInfo(@RequestBody UserSummaryInfoFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
UserSummaryInfoResultDTO userSummaryInfoResultDTO = userService.summaryInfo(formDTO); |
|||
return new Result<UserSummaryInfoResultDTO>().ok(userSummaryInfoResultDTO); |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.commons.tools.utils.Result<com.epmet.user.result.UserSubAgencyResultDTO> |
|||
* @author yinzuomei |
|||
* @description 直属机关柱状图查询 |
|||
* @Date 2020/6/22 13:30 |
|||
**/ |
|||
@PostMapping("subagency") |
|||
public Result<List<UserSubAgencyResultDTO>> subAgency(@RequestBody UserSubAgencyFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
List<UserSubAgencyResultDTO> userSubAgencyResultDTO = userService.subAgency(formDTO); |
|||
return new Result<List<UserSubAgencyResultDTO>>().ok(userSubAgencyResultDTO); |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.commons.tools.utils.Result<com.epmet.user.result.UserSubGridResultDTO> |
|||
* @author yinzuomei |
|||
* @description 直属网格柱状图查询 |
|||
* @Date 2020/6/22 13:33 |
|||
**/ |
|||
@PostMapping("subgrid") |
|||
public Result<List<UserSubGridResultDTO>> subGrid(@RequestBody UserSubGridFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
List<UserSubGridResultDTO> userSubGridResultDTO = userService.subGrid(formDTO); |
|||
return new Result<List<UserSubGridResultDTO>>().ok(userSubGridResultDTO); |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.commons.tools.utils.Result<com.epmet.user.result.UserIncrTrendResultDTO> |
|||
* @author yinzuomei |
|||
* @description 按日、按月查询注册用户数(参与用户数)增量折线图 |
|||
* @Date 2020/6/22 13:36 |
|||
**/ |
|||
@PostMapping("incrtrend") |
|||
public Result<List<UserIncrTrendResultDTO>> incrTrend(@RequestBody UserIncrTrendFormDTO formDTO) { |
|||
ValidatorUtils.validateEntity(formDTO); |
|||
List<UserIncrTrendResultDTO> userIncrTrendResultDTO = userService.incrTrend(formDTO); |
|||
return new Result<List<UserIncrTrendResultDTO>>().ok(userIncrTrendResultDTO); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,58 @@ |
|||
package com.epmet.dao.group; |
|||
|
|||
import com.epmet.group.dto.result.*; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 10:55 |
|||
*/ |
|||
@Mapper |
|||
public interface GroupDao { |
|||
|
|||
/** |
|||
* @Description 网格小组:网格总数、网格小组数、小组平均数、小组人数中位数 |
|||
* @param |
|||
* @author zxc |
|||
*/ |
|||
GroupSummaryInfoResultDTO summaryInfo(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @Description 获取下级机关信息 |
|||
* @param agencyId |
|||
* @author zxc |
|||
*/ |
|||
List<SubAgencyResultDTO> getSubAgencyList(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @Description 获取下级机关的小组数 |
|||
* @param |
|||
* @author zxc |
|||
*/ |
|||
List<GroupSubAgencyResultDTO> getSubGroupCount(); |
|||
|
|||
/** |
|||
* @Description 获取直属网格下的小组数 |
|||
* @param agencyId |
|||
* @author zxc |
|||
*/ |
|||
List<GroupSubGridResultDTO> getSubGridGroupCount(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @Description 小组数量 日增长 |
|||
* @param agencyId |
|||
* @author zxc |
|||
*/ |
|||
List<GroupIncrTrendResultDTO> getIncrDaily(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @Description 小组数量 月增长 |
|||
* @param agencyId |
|||
* @author zxc |
|||
*/ |
|||
List<GroupIncrTrendResultDTO> getIncrMonthly(@Param("agencyId") String agencyId); |
|||
|
|||
} |
@ -0,0 +1,60 @@ |
|||
package com.epmet.dao.issue; |
|||
|
|||
import com.epmet.issue.dto.result.IssueDataDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 13:48 |
|||
*/ |
|||
@Mapper |
|||
public interface IssueDao { |
|||
/** |
|||
* 获取当前机关统计信息 |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 15:19 |
|||
* @param agencyId |
|||
* @return com.epmet.issue.dto.result.IssueDataDTO |
|||
*/ |
|||
IssueDataDTO selectAgencyInfo(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* 获取下级机关统计信息 |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 15:20 |
|||
* @param agencyId |
|||
* @return java.util.List<com.epmet.issue.dto.result.IssueDataDTO> |
|||
*/ |
|||
List<IssueDataDTO> selectSubAgencyList(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* 获取机关下网格统计信息 |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 15:21 |
|||
* @param agencyId |
|||
* @return java.util.List<com.epmet.issue.dto.result.IssueDataDTO> |
|||
*/ |
|||
List<IssueDataDTO> selectGridList(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* 获取当前机关日增量 |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 15:22 |
|||
* @param agencyId |
|||
* @return java.util.List<com.epmet.issue.dto.result.IssueDataDTO> |
|||
*/ |
|||
List<IssueDataDTO> selectAgencyIncDailyList(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* 获取当前机关月增量 |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 15:23 |
|||
* @param agencyId |
|||
* @return java.util.List<com.epmet.issue.dto.result.IssueDataDTO> |
|||
*/ |
|||
List<IssueDataDTO> selectAgencyIncMonthlyList(@Param("agencyId") String agencyId); |
|||
} |
@ -0,0 +1,58 @@ |
|||
package com.epmet.dao.project; |
|||
|
|||
import com.epmet.project.dto.FactAgencyProjectDailyDTO; |
|||
import com.epmet.project.dto.result.*; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目 |
|||
**/ |
|||
@Mapper |
|||
public interface ProjectDao { |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取汇总数据 |
|||
**/ |
|||
ProjectSummaryResultDTO selectProjectSummary(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取汇总数据 |
|||
**/ |
|||
List<ProjectSummaryInfoResultDTO> selectSummaryInfo(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 查询组织最近日期的日统计数据 |
|||
**/ |
|||
FactAgencyProjectDailyDTO selectAgencyProjectDaily(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取最近日期下级组织柱状图数据(按项目总量降序) |
|||
**/ |
|||
List<ProjectSubAgencyResultDTO> selectSubAgency(FactAgencyProjectDailyDTO agencyProjectDailyDTO); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 查询机关下直属网格最近一天的日统计数据,按项目总数降序 |
|||
**/ |
|||
List<ProjectSubGridResultDTO> selectSubGrid(FactAgencyProjectDailyDTO agencyProjectDailyDTO); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 查询机关日统计近九十天数据 |
|||
**/ |
|||
List<ProjectIncrTrendResultDTO> selectIncrTrendDaily(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 查询机关月统计近十二个月数据 |
|||
**/ |
|||
List<ProjectIncrTrendResultDTO> selectIncrTrendMonthly(@Param("agencyId") String agencyId); |
|||
} |
@ -0,0 +1,145 @@ |
|||
/** |
|||
* 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.publicity; |
|||
|
|||
import com.epmet.publicity.dto.result.*; |
|||
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-06-19 |
|||
*/ |
|||
@Mapper |
|||
public interface PublicityDao { |
|||
|
|||
/** |
|||
* @Description 宣传能力—工作端—当前机关累计发文和当前发文 |
|||
* @param agencyId 机关id |
|||
* @author jyy |
|||
*/ |
|||
FactPublishedAgencyDailyDTO summaryInfo(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @Description 当月———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 |
|||
* @param agencyId,monthId,pageSize 机关id,月,展示数量 |
|||
* @author zxc |
|||
*/ |
|||
List<FactTagAgencyDTO> getViewedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); |
|||
|
|||
/** |
|||
* @Description 当季———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 |
|||
* @param agencyId,quarterId,pageSize 机关id,季,展示数量 |
|||
* @author zxc |
|||
*/ |
|||
List<FactTagAgencyDTO> getViewedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); |
|||
|
|||
/** |
|||
* @Description 当年———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 |
|||
* @param agencyId,yearId,pageSize 机关id,年,展示数量 |
|||
* @author zxc |
|||
*/ |
|||
List<FactTagAgencyDTO> getViewedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); |
|||
|
|||
/** |
|||
* @Description 当月———获取机关下,获取每个标签发文数量,按照数量降序,取前pagesize个 |
|||
* @param agencyId,monthId,pageSize 机关id,月,展示数量 |
|||
* @author zxc |
|||
*/ |
|||
List<FactTagAgencyDTO> getUsedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); |
|||
|
|||
/** |
|||
* @Description 当季———获取机关下,获取每个标签发文数量,按照数量降序,取前pagesize个 |
|||
* @param agencyId,quarterId,pageSize 机关id,季,展示数量 |
|||
* @author zxc |
|||
*/ |
|||
List<FactTagAgencyDTO> getUsedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); |
|||
|
|||
/** |
|||
* @Description 当年———获取机关下,每个标签发文数量,按照数量降序,取前pagesize个 |
|||
* @param agencyId,yearId,pageSize 机关id,年,展示数量 |
|||
* @author zxc |
|||
*/ |
|||
List<FactTagAgencyDTO> getUsedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); |
|||
|
|||
/** |
|||
* @Description 当月———下级机发文数 |
|||
* @param agencyId,monthId 机关id,月 |
|||
* @author zxc |
|||
*/ |
|||
List<FactPublishedAgencyDTO> getSubAgencyPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); |
|||
|
|||
/** |
|||
* @Description 当季———下级机发文数 |
|||
* @param agencyId,quarterId 机关id,季度 |
|||
* @author zxc |
|||
*/ |
|||
List<FactPublishedAgencyDTO> getSubAgencyPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); |
|||
/** |
|||
* @Description 当年———下级机发文数 |
|||
* @param agencyId,yearId 机关id,年 |
|||
* @author zxc |
|||
*/ |
|||
List<FactPublishedAgencyDTO> getSubAgencyPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); |
|||
|
|||
/** |
|||
* @Description 当月———下级部门文数 |
|||
* @param agencyId,monthId 机关id,月 |
|||
* @author zxc |
|||
*/ |
|||
List<FactPublishedDepartmentDTO> getSubDepartPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); |
|||
|
|||
/** |
|||
* @Description 当季———下级部门文数 |
|||
* @param agencyId,quarterId 机关id,季度 |
|||
* @author zxc |
|||
*/ |
|||
List<FactPublishedDepartmentDTO> getSubDepartPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); |
|||
/** |
|||
* @Description 当年———下级部门文数 |
|||
* @param agencyId,yearId 机关id,年 |
|||
* @author zxc |
|||
*/ |
|||
List<FactPublishedDepartmentDTO> getSubDepartPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); |
|||
|
|||
/** |
|||
* @Description 当月———下级网格文数 |
|||
* @param agencyId,monthId 机关id,月 |
|||
* @author zxc |
|||
*/ |
|||
List<FactPublishedGridDTO> getSubGridPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); |
|||
|
|||
/** |
|||
* @Description 当季———下级网格文数 |
|||
* @param agencyId,quarterId 机关id,季度 |
|||
* @author zxc |
|||
*/ |
|||
List<FactPublishedGridDTO> getSubGridPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); |
|||
/** |
|||
* @Description 当年———下级网格文数 |
|||
* @param agencyId,yearId 机关id,年 |
|||
* @author zxc |
|||
*/ |
|||
List<FactPublishedGridDTO> getSubGridPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); |
|||
|
|||
|
|||
} |
@ -0,0 +1,108 @@ |
|||
package com.epmet.dao.topic; |
|||
|
|||
import com.epmet.group.dto.result.GroupIncrTrendResultDTO; |
|||
import com.epmet.topic.dto.result.*; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 15:55 |
|||
*/ |
|||
@Mapper |
|||
public interface TopicDao { |
|||
|
|||
/** |
|||
* @Description 获取话题数量及状态 |
|||
* @param agencyId |
|||
* @author zxc |
|||
*/ |
|||
List<TopicStatusResultDTO> getTopicStatus(@Param("agencyId")String agencyId); |
|||
|
|||
/** |
|||
* @Description 获取机关下已转议题数量 |
|||
* @param agencyId |
|||
* @author zxc |
|||
*/ |
|||
TopicShiftedCountResultDTO getShiftedCount(@Param("agencyId")String agencyId); |
|||
|
|||
/** |
|||
* @Description 获取话题信息(状态,数量,百分比) |
|||
* @param agencyId |
|||
* @author zxc |
|||
*/ |
|||
List<TopicSummaryInfoResultDTO> topicSummaryInfo(@Param("agencyId")String agencyId); |
|||
|
|||
/** |
|||
* @Description 根据当前机关判断是否有下级机关 |
|||
* @param agencyId |
|||
* @author zxc |
|||
*/ |
|||
List<String> getSubAgencyIdList(@Param("agencyId")String agencyId); |
|||
|
|||
/** |
|||
* @Description 获取最后一天的所有话题数据 【fact_topic_status_agency_daily】 |
|||
* @param |
|||
* @author zxc |
|||
*/ |
|||
List<TopicSubAgencyResultDTO> getAllTopicInfoLastDay(); |
|||
|
|||
/** |
|||
* @Description 获取最后一天的所有话题已转议题数据 |
|||
* @param |
|||
* @author zxc |
|||
*/ |
|||
List<TopicSubAgencyResultDTO> getAllTopicShiftedInfoLastDay(); |
|||
|
|||
/** |
|||
* @Description 校验机关下是否存在直属网格 |
|||
* @param agencyId |
|||
* @author zxc |
|||
*/ |
|||
List<String> getSubGridIdList(@Param("agencyId")String agencyId); |
|||
|
|||
/** |
|||
* @Description 获取最后一天的所有话题数据 【fact_topic_status_grid_daily】【grid】 |
|||
* @param |
|||
* @author zxc |
|||
*/ |
|||
List<TopicSubGridResultDTO> getGridAllTopicInfoLastDay(); |
|||
|
|||
/** |
|||
* @Description 获取最后一天的所有话题已转议题数据【grid】 |
|||
* @param |
|||
* @author zxc |
|||
*/ |
|||
List<TopicSubGridResultDTO> getGridAllTopicShiftedInfoLastDay(); |
|||
|
|||
/** |
|||
* @Description 话题日增长 |
|||
* @param agencyId |
|||
* @author zxc |
|||
*/ |
|||
List<TopicIncrTrendResultDTO> getTopicIncrDaily(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @Description 话题转议题日增长 |
|||
* @param agencyId |
|||
* @author zxc |
|||
*/ |
|||
List<TopicIncrTrendResultDTO> getTopicShiftedIncrDaily(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @Description 话题月增长 |
|||
* @param agencyId |
|||
* @author zxc |
|||
*/ |
|||
List<TopicIncrTrendResultDTO> getTopicIncrMonthly(@Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @Description 话题转议题月增长 |
|||
* @param agencyId |
|||
* @author zxc |
|||
*/ |
|||
List<TopicIncrTrendResultDTO> getTopicShiftedIncrMonthly(@Param("agencyId") String agencyId); |
|||
|
|||
} |
@ -0,0 +1,135 @@ |
|||
package com.epmet.dao.user; |
|||
|
|||
|
|||
import com.epmet.dto.DimAgencyDTO; |
|||
import com.epmet.dto.DimGridDTO; |
|||
import com.epmet.dto.result.user.UserIncrTrendResDTO; |
|||
import com.epmet.dto.result.user.UserSubAgencyResDTO; |
|||
import com.epmet.dto.result.user.UserSubGridResDTO; |
|||
import com.epmet.dto.result.user.UserSummaryInfoResultDTO; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 描述一下 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 16:33 |
|||
*/ |
|||
@Mapper |
|||
public interface UserAnalysisDao { |
|||
/** |
|||
* @return java.util.List<com.epmet.dto.DimAgencyDTO> |
|||
* @param myAgencyId |
|||
* @author yinzuomei |
|||
* @description 根据机关id,查询它下一级机关列表 |
|||
* @Date 2020/6/22 22:42 |
|||
**/ |
|||
List<DimAgencyDTO> selectSubAgencyList(String myAgencyId); |
|||
|
|||
/** |
|||
* @return java.util.List<com.epmet.dto.DimGridDTO> |
|||
* @param myAgencyId |
|||
* @author yinzuomei |
|||
* @description 根据机关id,查询它下面的直属网格列表 |
|||
* @Date 2020/6/22 23:51 |
|||
**/ |
|||
List<DimGridDTO> selectSubGridList(String myAgencyId); |
|||
|
|||
/** |
|||
* @param myAgencyId |
|||
* @return com.epmet.user.result.UserSummaryInfoResultDTO |
|||
* @author yinzuomei |
|||
* @description 查询注册用户汇总信息 |
|||
* @Date 2020/6/22 16:52 |
|||
**/ |
|||
UserSummaryInfoResultDTO selectRegUserSummaryInfo(String myAgencyId); |
|||
|
|||
/** |
|||
* @param myAgencyId |
|||
* @return com.epmet.user.result.UserSummaryInfoResultDTO |
|||
* @author yinzuomei |
|||
* @description 查询注册用户的汇总信息 |
|||
* @Date 2020/6/22 16:52 |
|||
**/ |
|||
UserSummaryInfoResultDTO selectParticipationUserSummaryInfo(String myAgencyId); |
|||
|
|||
/** |
|||
* @return java.util.List<com.epmet.dto.result.user.UserSubAgencyResDTO> |
|||
* @param dateId 20200618日期 |
|||
* @param agencyId 用户所属机关 |
|||
* @author yinzuomei |
|||
* @description 参与用户:子级机关用户分析,按日(date_id)查询 |
|||
* @Date 2020/6/22 21:51 |
|||
**/ |
|||
List<UserSubAgencyResDTO> selectParticipationSubAgencyRes(@Param("dateId") String dateId ,@Param("agencyId")String agencyId); |
|||
|
|||
/** |
|||
* @param dateId |
|||
* @param dateId 20200618日期 |
|||
* @param agencyId 用户所属机关id |
|||
* @return java.util.List<com.epmet.dto.result.user.UserSubAgencyResDTO> |
|||
* @author yinzuomei |
|||
* @description 注册用户:子级机关用户分析,按日(date_id)查询 |
|||
* @Date 2020/6/22 22:38 |
|||
**/ |
|||
List<UserSubAgencyResDTO> selectRegSubAgencyRes(@Param("dateId") String dateId ,@Param("agencyId")String agencyId); |
|||
|
|||
/** |
|||
* @param dateId 20200618日期 |
|||
* @param agencyId 用户所属机关id |
|||
* @return java.util.List<com.epmet.dto.result.user.UserSubGridResDTO> |
|||
* @author yinzuomei |
|||
* @description 参与用户:机关下,直属网格用户分析 |
|||
* @Date 2020/6/23 0:18 |
|||
**/ |
|||
List<UserSubGridResDTO> selectParticipationSubGridRes(@Param("dateId") String dateId, @Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @param dateId 20200618日期 |
|||
* @param agencyId 用户所属机关id |
|||
* @return java.util.List<com.epmet.dto.result.user.UserSubGridResDTO> |
|||
* @author yinzuomei |
|||
* @description 注册用户:机关下,直属网格用户分析 |
|||
* @Date 2020/6/23 0:18 |
|||
**/ |
|||
List<UserSubGridResDTO> selectRegSubGridRes(@Param("dateId")String dateId, @Param("agencyId") String agencyId); |
|||
|
|||
/** |
|||
* @return java.util.List<com.epmet.dto.result.user.UserIncrTrendResDTO> |
|||
* @param myAgencyId |
|||
* @author yinzuomei |
|||
* @description |
|||
* @Date 2020/6/23 11:24 |
|||
**/ |
|||
List<UserIncrTrendResDTO> selectRegDayIncr(@Param("agencyId")String myAgencyId); |
|||
|
|||
/** |
|||
* @return java.util.List<com.epmet.dto.result.user.UserIncrTrendResDTO> |
|||
* @param myAgencyId |
|||
* @author yinzuomei |
|||
* @description |
|||
* @Date 2020/6/23 11:24 |
|||
**/ |
|||
List<UserIncrTrendResDTO> selectRegMonthIncr(@Param("agencyId")String myAgencyId); |
|||
|
|||
/** |
|||
* @return java.util.List<com.epmet.dto.result.user.UserIncrTrendResDTO> |
|||
* @param myAgencyId |
|||
* @author yinzuomei |
|||
* @description |
|||
* @Date 2020/6/23 11:24 |
|||
**/ |
|||
List<UserIncrTrendResDTO> selectParticipationUserDayIncr(@Param("agencyId")String myAgencyId); |
|||
|
|||
/** |
|||
* @return java.util.List<com.epmet.dto.result.user.UserIncrTrendResDTO> |
|||
* @param myAgencyId |
|||
* @author yinzuomei |
|||
* @description |
|||
* @Date 2020/6/23 11:24 |
|||
**/ |
|||
List<UserIncrTrendResDTO> selectParticipationUserMonthIncr(@Param("agencyId") String myAgencyId); |
|||
} |
@ -0,0 +1,45 @@ |
|||
package com.epmet.service.group; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.group.dto.form.GroupIncrTrendFormDTO; |
|||
import com.epmet.group.dto.result.GroupIncrTrendResultDTO; |
|||
import com.epmet.group.dto.result.GroupSubAgencyResultDTO; |
|||
import com.epmet.group.dto.result.GroupSubGridResultDTO; |
|||
import com.epmet.group.dto.result.GroupSummaryInfoResultDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 10:55 |
|||
*/ |
|||
public interface GroupService { |
|||
|
|||
/** |
|||
* @Description 网格小组:网格总数、网格小组数、小组平均数、小组人数中位数 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
GroupSummaryInfoResultDTO summaryInfo(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* @Description 网格小组——下级机关小组数柱状图 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
List<GroupSubAgencyResultDTO> subAgency(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* @Description 网格小组——直属网格小组数 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
List<GroupSubGridResultDTO> subGrid(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* @Description 网格小组——小组分析 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
List<GroupIncrTrendResultDTO> IncrTrend(TokenDto tokenDto, GroupIncrTrendFormDTO formDTO); |
|||
} |
@ -0,0 +1,107 @@ |
|||
package com.epmet.service.group.impl; |
|||
|
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.dao.group.GroupDao; |
|||
import com.epmet.dto.form.LoginUserDetailsFormDTO; |
|||
import com.epmet.dto.result.LoginUserDetailsResultDTO; |
|||
import com.epmet.feign.EpmetUserOpenFeignClient; |
|||
import com.epmet.group.constant.GroupConstant; |
|||
import com.epmet.group.dto.form.GroupIncrTrendFormDTO; |
|||
import com.epmet.group.dto.result.*; |
|||
import com.epmet.service.group.GroupService; |
|||
import org.springframework.beans.BeanUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 10:56 |
|||
*/ |
|||
@Service |
|||
public class GroupServiceImpl implements GroupService { |
|||
|
|||
@Autowired |
|||
private GroupDao groupDao; |
|||
@Autowired |
|||
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|||
|
|||
/** |
|||
* @Description 网格小组:网格总数、网格小组数、小组平均数、小组人数中位数 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@Override |
|||
public GroupSummaryInfoResultDTO summaryInfo(TokenDto tokenDto) { |
|||
String agencyId = this.getLoginUserDetails(tokenDto); |
|||
return groupDao.summaryInfo(agencyId); |
|||
} |
|||
|
|||
/** |
|||
* @Description 网格小组——下级机关小组数柱状图 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@Override |
|||
public List<GroupSubAgencyResultDTO> subAgency(TokenDto tokenDto) { |
|||
String agencyId = this.getLoginUserDetails(tokenDto); |
|||
List<GroupSubAgencyResultDTO> result = new ArrayList<>(); |
|||
List<SubAgencyResultDTO> subAgencyList = groupDao.getSubAgencyList(agencyId); |
|||
List<GroupSubAgencyResultDTO> subGroupCount = groupDao.getSubGroupCount(); |
|||
if (subAgencyList.size()!= NumConstant.ZERO){ |
|||
subGroupCount.forEach(group -> { |
|||
subAgencyList.forEach(subAgency -> { |
|||
if (subAgency.getAgencyId().equals(group.getAgencyId())){ |
|||
group.setName(subAgency.getAgencyName()); |
|||
result.add(group); |
|||
} |
|||
}); |
|||
}); |
|||
return result; |
|||
} |
|||
return new ArrayList<>(); |
|||
} |
|||
|
|||
/** |
|||
* @Description 网格小组——直属网格小组数 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@Override |
|||
public List<GroupSubGridResultDTO> subGrid(TokenDto tokenDto) { |
|||
String agencyId = this.getLoginUserDetails(tokenDto); |
|||
return groupDao.getSubGridGroupCount(agencyId); |
|||
} |
|||
|
|||
/** |
|||
* @Description 网格小组——小组分析 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@Override |
|||
public List<GroupIncrTrendResultDTO> IncrTrend(TokenDto tokenDto, GroupIncrTrendFormDTO formDTO) { |
|||
String agencyId = this.getLoginUserDetails(tokenDto); |
|||
List<GroupIncrTrendResultDTO> result = new ArrayList<>(); |
|||
if (formDTO.getType().equals(GroupConstant.DATE)){ |
|||
result = groupDao.getIncrDaily(agencyId); |
|||
}else { |
|||
result = groupDao.getIncrMonthly(agencyId); |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
/** |
|||
* @Description 获取机关ID |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
public String getLoginUserDetails(TokenDto tokenDto){ |
|||
LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); |
|||
BeanUtils.copyProperties(tokenDto,dto); |
|||
LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData(); |
|||
return data.getAgencyId(); |
|||
} |
|||
} |
@ -0,0 +1,65 @@ |
|||
package com.epmet.service.issue; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; |
|||
import com.epmet.issue.dto.result.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 13:48 |
|||
*/ |
|||
public interface IssueService { |
|||
/** |
|||
* 议题汇总 |
|||
* |
|||
* @param tokenDto |
|||
* @return com.epmet.issue.dto.result.IssueSummaryInfoResultDTO |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 16:40 |
|||
*/ |
|||
IssueSummaryInfoResultDTO getSummaryInfo(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* 议题汇总饼状图 |
|||
* |
|||
* @param tokenDto |
|||
* @return com.epmet.issue.dto.result.IssueSummaryPieResultDTO |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 16:40 |
|||
*/ |
|||
List<IssueSummaryPieResultDTO> getSummaryPie(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* 下级机关 |
|||
* |
|||
* @param tokenDto |
|||
* @return java.util.List<com.epmet.issue.dto.result.IssueSubAgencyResultDTO> |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 16:40 |
|||
*/ |
|||
List<IssueSubAgencyResultDTO> getSubAgency(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* 网格 |
|||
* |
|||
* @param tokenDto |
|||
* @return java.util.List<com.epmet.issue.dto.result.IssueSubGridResultDTO> |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 16:41 |
|||
*/ |
|||
List<IssueSubGridResultDTO> getSubGrid(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* 议题分析 |
|||
* |
|||
* @param tokenDto |
|||
* @param formDTO |
|||
* @return java.util.List<com.epmet.issue.dto.result.IssueIncrtrendResultDTO> |
|||
* @author zhaoqifeng |
|||
* @date 2020/6/22 16:41 |
|||
*/ |
|||
List<IssueIncrtrendResultDTO> getIncrtrend(TokenDto tokenDto, IssueIncrtrendFormDTO formDTO); |
|||
} |
@ -0,0 +1,176 @@ |
|||
package com.epmet.service.issue.impl; |
|||
|
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.dao.issue.IssueDao; |
|||
import com.epmet.dto.form.LoginUserDetailsFormDTO; |
|||
import com.epmet.dto.result.LoginUserDetailsResultDTO; |
|||
import com.epmet.feign.EpmetUserOpenFeignClient; |
|||
import com.epmet.issue.constant.IssueConstant; |
|||
import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; |
|||
import com.epmet.issue.dto.result.*; |
|||
import com.epmet.service.issue.IssueService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.math.RoundingMode; |
|||
import java.text.DecimalFormat; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author zhaoqifeng |
|||
* @dscription |
|||
* @date 2020/6/22 13:49 |
|||
*/ |
|||
@Service |
|||
public class IssueServiceImpl implements IssueService { |
|||
@Autowired |
|||
private IssueDao issueDao; |
|||
@Autowired |
|||
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|||
@Override |
|||
public IssueSummaryInfoResultDTO getSummaryInfo(TokenDto tokenDto) { |
|||
IssueSummaryInfoResultDTO result = new IssueSummaryInfoResultDTO(); |
|||
String agencyId = getAgencyId(tokenDto); |
|||
IssueDataDTO data = issueDao.selectAgencyInfo(agencyId); |
|||
result.setAgencyId(agencyId); |
|||
result.setDateName(data.getDateName()); |
|||
result.setIssueTotal(data.getIssueTotal()); |
|||
result.setVotingTotal(data.getVotingTotal()); |
|||
result.setShiftProjectTotal(data.getShiftProjectTotal()); |
|||
result.setClosedTotal(data.getClosedTotal()); |
|||
result.setVotingRatio(toRatio(data.getVotingPercent())); |
|||
result.setShiftProjectRatio(toRatio(data.getShiftProjectPercent())); |
|||
result.setClosedRatio(toRatio(data.getClosedPercent())); |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
public List<IssueSummaryPieResultDTO> getSummaryPie(TokenDto tokenDto) { |
|||
List<IssueSummaryPieResultDTO> list = new ArrayList<>(); |
|||
String agencyId = getAgencyId(tokenDto); |
|||
IssueDataDTO data = issueDao.selectAgencyInfo(agencyId); |
|||
IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO(); |
|||
voting.setName(IssueConstant.VOTING_NAME); |
|||
voting.setValue(data.getVotingTotal()); |
|||
voting.setRatio(toRatio(data.getVotingPercent())); |
|||
list.add(voting); |
|||
IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO(); |
|||
shift.setName(IssueConstant.SHIFT_NAME); |
|||
shift.setValue(data.getShiftProjectTotal()); |
|||
shift.setRatio(toRatio(data.getShiftProjectPercent())); |
|||
list.add(shift); |
|||
IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO(); |
|||
closed.setName(IssueConstant.CLOSED_NAME); |
|||
closed.setValue(data.getClosedTotal()); |
|||
closed.setRatio(toRatio(data.getClosedPercent())); |
|||
list.add(closed); |
|||
return list; |
|||
} |
|||
|
|||
@Override |
|||
public List<IssueSubAgencyResultDTO> getSubAgency(TokenDto tokenDto) { |
|||
List<IssueSubAgencyResultDTO> list = new ArrayList<>(); |
|||
String agencyId = getAgencyId(tokenDto); |
|||
List<IssueDataDTO> dataList = issueDao.selectSubAgencyList(agencyId); |
|||
if(null != dataList) { |
|||
dataList.forEach(data -> { |
|||
IssueSubAgencyResultDTO voting = new IssueSubAgencyResultDTO(); |
|||
voting.setAgencyId(data.getAgencyId()); |
|||
voting.setName(data.getAgencyName()); |
|||
voting.setType(IssueConstant.VOTING_NAME); |
|||
voting.setValue(data.getVotingTotal()); |
|||
list.add(voting); |
|||
IssueSubAgencyResultDTO shift = new IssueSubAgencyResultDTO(); |
|||
shift.setAgencyId(data.getAgencyId()); |
|||
shift.setName(data.getAgencyName()); |
|||
shift.setType(IssueConstant.SHIFT_NAME); |
|||
shift.setValue(data.getShiftProjectTotal()); |
|||
list.add(shift); |
|||
IssueSubAgencyResultDTO closed = new IssueSubAgencyResultDTO(); |
|||
closed.setAgencyId(data.getAgencyId()); |
|||
closed.setName(data.getAgencyName()); |
|||
closed.setType(IssueConstant.CLOSED_NAME); |
|||
closed.setValue(data.getClosedTotal()); |
|||
list.add(closed); |
|||
}); |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
@Override |
|||
public List<IssueSubGridResultDTO> getSubGrid(TokenDto tokenDto) { |
|||
List<IssueSubGridResultDTO> list = new ArrayList<>(); |
|||
String agencyId = getAgencyId(tokenDto); |
|||
List<IssueDataDTO> dataList = issueDao.selectGridList(agencyId); |
|||
if(null != dataList) { |
|||
dataList.forEach(data -> { |
|||
IssueSubGridResultDTO voting = new IssueSubGridResultDTO(); |
|||
voting.setName(data.getGridName()); |
|||
voting.setType(IssueConstant.VOTING_NAME); |
|||
voting.setValue(data.getVotingTotal()); |
|||
list.add(voting); |
|||
IssueSubGridResultDTO shift = new IssueSubGridResultDTO(); |
|||
shift.setName(data.getGridName()); |
|||
shift.setType(IssueConstant.SHIFT_NAME); |
|||
shift.setValue(data.getShiftProjectTotal()); |
|||
list.add(shift); |
|||
IssueSubGridResultDTO closed = new IssueSubGridResultDTO(); |
|||
closed.setName(data.getGridName()); |
|||
closed.setType(IssueConstant.CLOSED_NAME); |
|||
closed.setValue(data.getClosedTotal()); |
|||
list.add(closed); |
|||
}); |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
@Override |
|||
public List<IssueIncrtrendResultDTO> getIncrtrend(TokenDto tokenDto, IssueIncrtrendFormDTO formDTO) { |
|||
List<IssueIncrtrendResultDTO> list = new ArrayList<>(); |
|||
String agencyId = getAgencyId(tokenDto); |
|||
List<IssueDataDTO> dataList; |
|||
if (IssueConstant.DATE.equals(formDTO.getType())) { |
|||
dataList = issueDao.selectAgencyIncDailyList(agencyId); |
|||
} else { |
|||
dataList = issueDao.selectAgencyIncMonthlyList(agencyId); |
|||
} |
|||
if (null != dataList) { |
|||
dataList.forEach(data -> { |
|||
IssueIncrtrendResultDTO voting = new IssueIncrtrendResultDTO(); |
|||
voting.setDate(data.getDateName()); |
|||
voting.setType(IssueConstant.VOTING_NAME); |
|||
voting.setValue(data.getVotingIncr()); |
|||
list.add(voting); |
|||
IssueIncrtrendResultDTO shift = new IssueIncrtrendResultDTO(); |
|||
shift.setDate(data.getDateName()); |
|||
shift.setType(IssueConstant.SHIFT_NAME); |
|||
shift.setValue(data.getShiftProjectIncr()); |
|||
list.add(shift); |
|||
IssueIncrtrendResultDTO closed = new IssueIncrtrendResultDTO(); |
|||
closed.setDate(data.getDateName()); |
|||
closed.setType(IssueConstant.CLOSED_NAME); |
|||
closed.setValue(data.getClosedIncr()); |
|||
list.add(closed); |
|||
}); |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
private String getAgencyId(TokenDto tokenDto) { |
|||
LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); |
|||
loginUserDetailsFormDTO.setApp(tokenDto.getApp()); |
|||
loginUserDetailsFormDTO.setClient(tokenDto.getClient()); |
|||
loginUserDetailsFormDTO.setUserId(tokenDto.getUserId()); |
|||
LoginUserDetailsResultDTO userInfo = epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO).getData(); |
|||
String[] orgIdPath = userInfo.getOrgIdPath().split(":"); |
|||
return orgIdPath[orgIdPath.length - 1]; |
|||
} |
|||
|
|||
private String toRatio(BigDecimal data) { |
|||
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); |
|||
return data.multiply(hundred).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString().concat("%"); |
|||
} |
|||
} |
@ -0,0 +1,44 @@ |
|||
package com.epmet.module.project.service; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; |
|||
import com.epmet.project.dto.result.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目 |
|||
**/ |
|||
public interface ProjectService { |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取汇总数据 |
|||
**/ |
|||
ProjectSummaryResultDTO getProjectSummary(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取组织下饼图数据 |
|||
**/ |
|||
List<ProjectSummaryInfoResultDTO> getSummaryInfo(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取下级组织柱状图数据 |
|||
**/ |
|||
List<ProjectSubAgencyResultDTO> getSubAgency(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取机关直属网格项目数据 |
|||
**/ |
|||
List<ProjectSubGridResultDTO> getSubGrid(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-日/月数据查询 |
|||
**/ |
|||
List<ProjectIncrTrendResultDTO> getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO); |
|||
} |
@ -0,0 +1,163 @@ |
|||
package com.epmet.service.project.impl; |
|||
|
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.dao.project.ProjectDao; |
|||
import com.epmet.dto.form.LoginUserDetailsFormDTO; |
|||
import com.epmet.dto.result.LoginUserDetailsResultDTO; |
|||
import com.epmet.feign.EpmetUserOpenFeignClient; |
|||
import com.epmet.module.project.service.ProjectService; |
|||
import com.epmet.project.constant.ProjectConstant; |
|||
import com.epmet.project.dto.FactAgencyProjectDailyDTO; |
|||
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; |
|||
import com.epmet.project.dto.result.*; |
|||
import org.springframework.beans.BeanUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.math.BigDecimal; |
|||
import java.math.RoundingMode; |
|||
import java.text.NumberFormat; |
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目 |
|||
**/ |
|||
@Service |
|||
public class ProjectServiceImpl implements ProjectService { |
|||
|
|||
@Autowired |
|||
private ProjectDao projectDao; |
|||
@Autowired |
|||
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取汇总数据 |
|||
**/ |
|||
@Override |
|||
public ProjectSummaryResultDTO getProjectSummary(TokenDto tokenDto) { |
|||
//1:根据token获取agencyId
|
|||
String agencyId = getLoginUserDetails(tokenDto); |
|||
|
|||
//2:根据agencyId查询项目统计数据
|
|||
ProjectSummaryResultDTO resultDTO = projectDao.selectProjectSummary(agencyId); |
|||
if (null != resultDTO) { |
|||
//将结果转成百分比
|
|||
NumberFormat percent = NumberFormat.getPercentInstance(); |
|||
percent.setMaximumFractionDigits(2); |
|||
//四舍五入保留小数点后四位
|
|||
BigDecimal pendingRatio = resultDTO.getPendingRatioInt().setScale(4, RoundingMode.HALF_UP); |
|||
//将小数转成百分比
|
|||
resultDTO.setPendingRatio(percent.format(pendingRatio.doubleValue())); |
|||
resultDTO.setClosedRatio(percent.format(resultDTO.getClosedRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue())); |
|||
} |
|||
return resultDTO; |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取组织下饼图数据 |
|||
**/ |
|||
@Override |
|||
public List<ProjectSummaryInfoResultDTO> getSummaryInfo(TokenDto tokenDto) { |
|||
List<ProjectSummaryInfoResultDTO> resultList = new ArrayList<>(); |
|||
//1:根据token获取agencyId
|
|||
String agencyId = getLoginUserDetails(tokenDto); |
|||
|
|||
//2:根据agencyId查询各状态统计数据
|
|||
resultList = projectDao.selectSummaryInfo(agencyId); |
|||
if (null != resultList && resultList.size() > NumConstant.ZERO) { |
|||
//将结果转成百分比
|
|||
NumberFormat percent = NumberFormat.getPercentInstance(); |
|||
percent.setMaximumFractionDigits(2); |
|||
resultList.forEach(sum -> { |
|||
//先四舍五入保留四位小数再把小数转成百分比
|
|||
sum.setRatio(percent.format(sum.getRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue())); |
|||
}); |
|||
} |
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取下级组织柱状图数据 |
|||
**/ |
|||
@Override |
|||
public List<ProjectSubAgencyResultDTO> getSubAgency(TokenDto tokenDto) { |
|||
List<ProjectSubAgencyResultDTO> resultList = new ArrayList<>(); |
|||
//1:根据token获取agencyId
|
|||
String agencyId = getLoginUserDetails(tokenDto); |
|||
|
|||
//2:根据机关Id查询最近日期的日统计数据
|
|||
FactAgencyProjectDailyDTO agencyProjectDailyDTO = projectDao.selectAgencyProjectDaily(agencyId); |
|||
if (null == agencyProjectDailyDTO) { |
|||
return resultList; |
|||
} |
|||
//2:获取当前组织最近日期的直属下级组织项目统计数据,按项目总量降序
|
|||
resultList = projectDao.selectSubAgency(agencyProjectDailyDTO); |
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-获取机关直属网格项目数据 |
|||
**/ |
|||
@Override |
|||
public List<ProjectSubGridResultDTO> getSubGrid(TokenDto tokenDto) { |
|||
List<ProjectSubGridResultDTO> resultList = new ArrayList<>(); |
|||
//1:根据token获取agencyId
|
|||
String agencyId = getLoginUserDetails(tokenDto); |
|||
|
|||
//2:根据机关Id查询最近日期的日统计数据
|
|||
FactAgencyProjectDailyDTO agencyProjectDailyDTO = projectDao.selectAgencyProjectDaily(agencyId); |
|||
if (null == agencyProjectDailyDTO) { |
|||
return resultList; |
|||
} |
|||
//2:获取当前组织最近日期的直属下级组织项目统计数据,按项目总量降序
|
|||
resultList = projectDao.selectSubGrid(agencyProjectDailyDTO); |
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 数据-项目-日/月数据查询(日查询进九十天数据,月查询进十二个月数据) |
|||
**/ |
|||
@Override |
|||
public List<ProjectIncrTrendResultDTO> getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO) { |
|||
List<ProjectIncrTrendResultDTO> resultList = new ArrayList<>(); |
|||
//1:根据token获取agencyId
|
|||
String agencyId = getLoginUserDetails(tokenDto); |
|||
|
|||
//2:查询机关过去九十天日统计数据(sql降序取前九十条)
|
|||
if (ProjectConstant.DATE.equals(formDTO.getType())) { |
|||
resultList = projectDao.selectIncrTrendDaily(agencyId); |
|||
} |
|||
|
|||
//3:查询机关过去十二个月月统计数据
|
|||
if (ProjectConstant.MONTH.equals(formDTO.getType())) { |
|||
resultList = projectDao.selectIncrTrendMonthly(agencyId); |
|||
} |
|||
|
|||
return resultList; |
|||
} |
|||
|
|||
/** |
|||
* @author sun |
|||
* @Description 获取机关ID |
|||
*/ |
|||
private String getLoginUserDetails(TokenDto tokenDto) { |
|||
LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); |
|||
BeanUtils.copyProperties(tokenDto, dto); |
|||
LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData(); |
|||
String agencyId = data.getAgencyId(); |
|||
if (null == agencyId || "".equals(agencyId)) { |
|||
throw new RenException(ProjectConstant.GET_AGENCYID); |
|||
} |
|||
return agencyId; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,78 @@ |
|||
/** |
|||
* 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.publicity; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.DateUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.publicity.dto.result.*; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 文章引用标签阅读数量【机关】月统计表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-19 |
|||
*/ |
|||
public interface PublicityService { |
|||
|
|||
/** |
|||
* @Description 宣传能力—工作端—当前机关累计发文和当前发文 |
|||
* @param tokenDto |
|||
* @author jyy |
|||
*/ |
|||
FactPublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 |
|||
* @param tokenDto,formDTO |
|||
* @author jyy |
|||
*/ |
|||
public List<FactTagAgencyDTO> tagviewed(TokenDto tokenDto, Integer pageSize, String type) ; |
|||
|
|||
/** |
|||
* @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 |
|||
* @param tokenDto,pageSize,type |
|||
* @author jyy |
|||
*/ |
|||
public List<FactTagAgencyDTO> tagused(TokenDto tokenDto, Integer pageSize, String type) ; |
|||
|
|||
/** |
|||
* @param tokenDto type |
|||
* @Description 获取下级机关发文数 |
|||
* @author jyy |
|||
*/ |
|||
public List<FactPublishedAgencyDTO> subagencyPublishedarticle(TokenDto tokenDto, String type) ; |
|||
/** |
|||
* @param tokenDto type |
|||
* @Description 获取直属部门发文数 |
|||
* @author jyy |
|||
*/ |
|||
public List<FactPublishedDepartmentDTO> departmentPublishedarticle(TokenDto tokenDto, String type); |
|||
|
|||
/** |
|||
* @param tokenDto type |
|||
* @Description 获取指数网格发文数 |
|||
* @author jyy |
|||
*/ |
|||
public List<FactPublishedGridDTO> subgridPublishedarticle(TokenDto tokenDto, String type); |
|||
|
|||
} |
@ -0,0 +1,219 @@ |
|||
/** |
|||
* 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.publicity.impl; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.DateUtils; |
|||
import com.epmet.dao.publicity.PublicityDao; |
|||
import com.epmet.dto.form.LoginUserDetailsFormDTO; |
|||
import com.epmet.dto.result.LoginUserDetailsResultDTO; |
|||
import com.epmet.feign.EpmetUserOpenFeignClient; |
|||
import com.epmet.publicity.dto.result.*; |
|||
import com.epmet.service.publicity.PublicityService; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.beans.BeanUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 文章引用标签阅读数量【机关】月统计表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-06-19 |
|||
*/ |
|||
@Service |
|||
public class PublicityServiceImpl implements PublicityService { |
|||
@Autowired |
|||
private PublicityDao publicityDao;//机关每日发文
|
|||
@Autowired |
|||
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|||
|
|||
/** |
|||
* @param tokenDto |
|||
* @Description 宣传能力—工作端—当前机关累计发文和当前发文 |
|||
* @author jyy |
|||
*/ |
|||
@Override |
|||
public FactPublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto) { |
|||
String agencyId = this.getLoginUserDetails(tokenDto); |
|||
agencyId="b9e295f8c1906a0d1c5e0b313afcda3f"; |
|||
return publicityDao.summaryInfo(agencyId); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* @param tokenDto,formDTO |
|||
* @Description 宣传能力—工作端-获取阅读最多的分类数据 |
|||
* @author jyy |
|||
*/ |
|||
@Override |
|||
public List<FactTagAgencyDTO> tagviewed(TokenDto tokenDto, Integer pageSize, String type) { |
|||
// String agencyId = this.getLoginUserDetails(tokenDto);
|
|||
String agencyId = "0d2ffe9fce682b602b9d451226d08fae"; |
|||
Date date = new Date(); |
|||
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); |
|||
String yearId = strDate.substring(0, 4); |
|||
|
|||
if (StringUtils.equals("month", type)) {//当月
|
|||
String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); |
|||
return publicityDao.getViewedMonthlyCountByTag(agencyId, monthId, pageSize); |
|||
|
|||
} else if (StringUtils.equals("quarter", type)) {//当季
|
|||
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|||
return publicityDao.getViewedQuarterlyCountByTag(agencyId, quarterId, pageSize); |
|||
|
|||
} else if (StringUtils.equals("year", type)) {//当年
|
|||
return publicityDao.getViewedYearlyCountByTag(agencyId, yearId, pageSize); |
|||
|
|||
} else { |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @param tokenDto pageSize type |
|||
* @Description 宣传能力—工作端-获取发表最多的分类数据 |
|||
* @author jyy |
|||
*/ |
|||
@Override |
|||
public List<FactTagAgencyDTO> tagused(TokenDto tokenDto, Integer pageSize, String type) { |
|||
// String agencyId = this.getLoginUserDetails(tokenDto);
|
|||
String agencyId = "0d2ffe9fce682b602b9d451226d08fae"; |
|||
Date date = new Date(); |
|||
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN); |
|||
String yearId = strDate.substring(0, 4); |
|||
|
|||
if (StringUtils.equals("month", type)) {//当月
|
|||
String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); |
|||
return publicityDao.getUsedMonthlyCountByTag(agencyId, monthId, pageSize); |
|||
|
|||
} else if (StringUtils.equals("quarter", type)) {//当季
|
|||
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|||
return publicityDao.getUsedQuarterlyCountByTag(agencyId, quarterId, pageSize); |
|||
|
|||
} else if (StringUtils.equals("year", type)) {//当年
|
|||
return publicityDao.getUsedYearlyCountByTag(agencyId, yearId, pageSize); |
|||
|
|||
} else { |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @param tokenDto type |
|||
* @Description 获取下级机关发文数 |
|||
* @author jyy |
|||
*/ |
|||
@Override |
|||
public List<FactPublishedAgencyDTO> subagencyPublishedarticle(TokenDto tokenDto, String type) { |
|||
// String agencyId = this.getLoginUserDetails(tokenDto);
|
|||
String agencyId = "1041fe5e8499dbd8add314291d2f6da4"; |
|||
Date date = new Date(); |
|||
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
String yearId = strDate.substring(0, 4); |
|||
String monthId = strDate.substring(0, 6); |
|||
|
|||
if (StringUtils.equals("month", type)) {//当月
|
|||
return publicityDao.getSubAgencyPublishedMonth(agencyId, monthId); |
|||
|
|||
} else if (StringUtils.equals("quarter", type)) {//当季
|
|||
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|||
return publicityDao.getSubAgencyPublishedQuarter(agencyId, quarterId); |
|||
|
|||
} else if (StringUtils.equals("year", type)) {//当年
|
|||
return publicityDao.getSubAgencyPublishedYear(agencyId, yearId); |
|||
|
|||
} else { |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @param tokenDto type |
|||
* @Description 获取直属部门发文数 |
|||
* @author jyy |
|||
*/ |
|||
@Override |
|||
public List<FactPublishedDepartmentDTO> departmentPublishedarticle(TokenDto tokenDto, String type) { |
|||
// String agencyId = this.getLoginUserDetails(tokenDto);
|
|||
String agencyId = "0d2ffe9fce682b602b9d451226d08fae"; |
|||
Date date = new Date(); |
|||
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
String yearId = strDate.substring(0, 4); |
|||
String monthId = strDate.substring(0, 6); |
|||
|
|||
if (StringUtils.equals("month", type)) {//当月
|
|||
return publicityDao.getSubDepartPublishedMonth(agencyId, monthId); |
|||
|
|||
} else if (StringUtils.equals("quarter", type)) {//当季
|
|||
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|||
return publicityDao.getSubDepartPublishedQuarter(agencyId, quarterId); |
|||
|
|||
} else if (StringUtils.equals("year", type)) {//当年
|
|||
return publicityDao.getSubDepartPublishedYear(agencyId, yearId); |
|||
|
|||
} else { |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @param tokenDto type |
|||
* @Description 获取指数网格发文数 |
|||
* @author jyy |
|||
*/ |
|||
@Override |
|||
public List<FactPublishedGridDTO> subgridPublishedarticle(TokenDto tokenDto, String type) { |
|||
// String agencyId = this.getLoginUserDetails(tokenDto);
|
|||
String agencyId = "0d2ffe9fce682b602b9d451226d08fae"; |
|||
Date date = new Date(); |
|||
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); |
|||
String yearId = strDate.substring(0, 4); |
|||
String monthId = strDate.substring(0, 6); |
|||
|
|||
if (StringUtils.equals("month", type)) {//当月
|
|||
return publicityDao.getSubGridPublishedMonth(agencyId, monthId); |
|||
|
|||
} else if (StringUtils.equals("quarter", type)) {//当季
|
|||
String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); |
|||
return publicityDao.getSubGridPublishedQuarter(agencyId, quarterId); |
|||
|
|||
} else if (StringUtils.equals("year", type)) {//当年
|
|||
return publicityDao.getSubGridPublishedYear(agencyId, yearId); |
|||
|
|||
} else { |
|||
return null; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* @param tokenDto |
|||
* @Description 获取机关ID |
|||
* @author zxc |
|||
*/ |
|||
public String getLoginUserDetails(TokenDto tokenDto) { |
|||
LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); |
|||
BeanUtils.copyProperties(tokenDto, dto); |
|||
LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData(); |
|||
return data.getAgencyId(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
package com.epmet.service.topic; |
|||
|
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; |
|||
import com.epmet.topic.dto.result.*; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 15:58 |
|||
*/ |
|||
public interface TopicService { |
|||
|
|||
/** |
|||
* @Description 话题:话题总数、讨论中话题数量、已关闭话题数量、已屏蔽话题数量、话题已转议题数量、数据更新至2020-06-17 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
TopicSummaryResultDTO topicSummary(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* @Description 话题——话题分析 |
|||
* @param tokenDto |
|||
* @param formDTO |
|||
* @author zxc |
|||
*/ |
|||
List<TopicIncrTrendResultDTO> topicIncrTrend(TokenDto tokenDto, TopicIncrTrendFormDTO formDTO); |
|||
|
|||
/** |
|||
* @Description 话题——直属网格话题数 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
List<TopicSubGridResultDTO> topicSubGrid( TokenDto tokenDto); |
|||
|
|||
/** |
|||
* @Description 话题——下级机关话题数 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
List<TopicSubAgencyResultDTO> topicSubAgency(TokenDto tokenDto); |
|||
|
|||
/** |
|||
* @Description 话题——话题分析表 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
List<TopicSummaryInfoResultDTO> topicSummaryInfo(TokenDto tokenDto); |
|||
|
|||
} |
@ -0,0 +1,182 @@ |
|||
package com.epmet.service.topic.impl; |
|||
|
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.dao.topic.TopicDao; |
|||
import com.epmet.dto.form.LoginUserDetailsFormDTO; |
|||
import com.epmet.dto.result.LoginUserDetailsResultDTO; |
|||
import com.epmet.feign.EpmetUserOpenFeignClient; |
|||
import com.epmet.service.topic.TopicService; |
|||
import com.epmet.topic.constant.TopicConstant; |
|||
import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; |
|||
import com.epmet.topic.dto.result.*; |
|||
import org.springframework.beans.BeanUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.Comparator; |
|||
import java.util.List; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/6/20 15:58 |
|||
*/ |
|||
@Service |
|||
public class TopicServiceImpl implements TopicService { |
|||
|
|||
@Autowired |
|||
private TopicDao topicDao; |
|||
@Autowired |
|||
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|||
|
|||
/** |
|||
* @Description 话题:话题总数、讨论中话题数量、已关闭话题数量、已屏蔽话题数量、话题已转议题数量、数据更新至2020-06-17 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@Override |
|||
public TopicSummaryResultDTO topicSummary(TokenDto tokenDto) { |
|||
TopicSummaryResultDTO result = new TopicSummaryResultDTO(); |
|||
String agencyId = this.getLoginUserDetails(tokenDto); |
|||
List<TopicStatusResultDTO> topicStatus = topicDao.getTopicStatus(agencyId); |
|||
if (topicStatus.size() != NumConstant.ZERO){ |
|||
topicStatus.forEach(topic -> { |
|||
if (topic.getTopicStatus().equals(TopicConstant.DISCUSSING)){ |
|||
result.setTalkingTotalCount(topic.getTopicCount()); |
|||
}else if (topic.getTopicStatus().equals(TopicConstant.CLOSED)){ |
|||
result.setClosedTotalCount(topic.getTopicCount()); |
|||
}else { |
|||
result.setShieldedTotalCount(topic.getTopicCount()); |
|||
} |
|||
}); |
|||
result.setTopicTotalCount(topicStatus.stream().collect(Collectors.summingInt(TopicStatusResultDTO::getTopicCount))); |
|||
} |
|||
TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); |
|||
if (shiftedCount != null){ |
|||
result.setShiftedTotalCount(shiftedCount.getShiftedIssueCount()); |
|||
result.setDeadline(shiftedCount.getDeadline()); |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
/** |
|||
* @Description 话题——话题分析 |
|||
* @param tokenDto |
|||
* @param formDTO |
|||
* @author zxc |
|||
*/ |
|||
@Override |
|||
public List<TopicIncrTrendResultDTO> topicIncrTrend(TokenDto tokenDto, TopicIncrTrendFormDTO formDTO) { |
|||
String agencyId = this.getLoginUserDetails(tokenDto); |
|||
List<TopicIncrTrendResultDTO> result = new ArrayList<>(); |
|||
if (formDTO.getType().equals(TopicConstant.DATE)){ |
|||
List<TopicIncrTrendResultDTO> topicIncrDaily = topicDao.getTopicIncrDaily(agencyId); |
|||
List<TopicIncrTrendResultDTO> topicShiftedIncrDaily = topicDao.getTopicShiftedIncrDaily(agencyId); |
|||
topicIncrDaily.addAll(topicShiftedIncrDaily); |
|||
result = topicIncrDaily.stream().sorted(Comparator.comparing(TopicIncrTrendResultDTO::getDate).reversed()).collect(Collectors.toList()); |
|||
}else { |
|||
List<TopicIncrTrendResultDTO> topicIncrMonthly = topicDao.getTopicIncrMonthly(agencyId); |
|||
List<TopicIncrTrendResultDTO> topicShiftedIncrMonthly = topicDao.getTopicShiftedIncrMonthly(agencyId); |
|||
topicIncrMonthly.addAll(topicShiftedIncrMonthly); |
|||
result = topicIncrMonthly.stream().sorted(Comparator.comparing(TopicIncrTrendResultDTO::getDate).reversed()).collect(Collectors.toList()); |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
/** |
|||
* @Description 话题——直属网格话题数 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@Override |
|||
public List<TopicSubGridResultDTO> topicSubGrid(TokenDto tokenDto) { |
|||
String agencyId = this.getLoginUserDetails(tokenDto); |
|||
List<TopicSubGridResultDTO> result = new ArrayList<>(); |
|||
List<String> subGridIdList = topicDao.getSubGridIdList(agencyId); |
|||
if (subGridIdList.size() != NumConstant.ZERO){ |
|||
List<TopicSubGridResultDTO> gridAllTopicInfoLastDay = topicDao.getGridAllTopicInfoLastDay(); |
|||
List<TopicSubGridResultDTO> gridAllTopicShiftedInfoLastDay = topicDao.getGridAllTopicShiftedInfoLastDay(); |
|||
subGridIdList.forEach(gridId -> { |
|||
gridAllTopicInfoLastDay.forEach(gridTopic -> { |
|||
if (gridId.equals(gridTopic.getGridId())){ |
|||
result.add(gridTopic); |
|||
} |
|||
}); |
|||
gridAllTopicShiftedInfoLastDay.forEach(gridShift -> { |
|||
if (gridId.equals(gridShift.getGridId())){ |
|||
result.add(gridShift); |
|||
} |
|||
}); |
|||
}); |
|||
return result; |
|||
} |
|||
return new ArrayList<>(); |
|||
} |
|||
|
|||
/** |
|||
* @Description 话题——下级机关话题数 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@Override |
|||
public List<TopicSubAgencyResultDTO> topicSubAgency(TokenDto tokenDto) { |
|||
String agencyId = this.getLoginUserDetails(tokenDto); |
|||
List<TopicSubAgencyResultDTO> result = new ArrayList<>(); |
|||
List<String> subAgencyIdList = topicDao.getSubAgencyIdList(agencyId); |
|||
//存在下级机关
|
|||
if (subAgencyIdList.size() != NumConstant.ZERO){ |
|||
List<TopicSubAgencyResultDTO> allTopicInfoLastDay = topicDao.getAllTopicInfoLastDay(); |
|||
List<TopicSubAgencyResultDTO> allTopicShiftedInfoLastDay = topicDao.getAllTopicShiftedInfoLastDay(); |
|||
//话题状态为 已关闭、讨论中、已屏蔽
|
|||
subAgencyIdList.forEach(agencyIdOne -> { |
|||
allTopicInfoLastDay.forEach(agency -> { |
|||
if (agencyIdOne.equals(agency.getAgencyId())){ |
|||
result.add(agency); |
|||
} |
|||
}); |
|||
allTopicShiftedInfoLastDay.forEach(shiftTopic -> { |
|||
if (agencyIdOne.equals(shiftTopic.getAgencyId())){ |
|||
result.add(shiftTopic); |
|||
} |
|||
}); |
|||
}); |
|||
return result; |
|||
} |
|||
//不存在
|
|||
return new ArrayList<>(); |
|||
} |
|||
|
|||
/** |
|||
* @Description 话题——话题分析表 |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
@Override |
|||
public List<TopicSummaryInfoResultDTO> topicSummaryInfo(TokenDto tokenDto) { |
|||
String agencyId = this.getLoginUserDetails(tokenDto); |
|||
List<TopicSummaryInfoResultDTO> topicSummaryInfo = topicDao.topicSummaryInfo(agencyId); |
|||
TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); |
|||
int i = (shiftedCount.getShiftedIssueCount() / topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue))) * NumConstant.ONE_HUNDRED; |
|||
String ratio = String.valueOf(i) + TopicConstant.RATIO; |
|||
TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO(); |
|||
result.setName(TopicConstant.SHIFTED); |
|||
result.setRatio(ratio); |
|||
result.setValue(shiftedCount.getShiftedIssueCount()); |
|||
topicSummaryInfo.add(result); |
|||
return topicSummaryInfo; |
|||
} |
|||
|
|||
/** |
|||
* @Description 获取机关ID |
|||
* @param tokenDto |
|||
* @author zxc |
|||
*/ |
|||
public String getLoginUserDetails(TokenDto tokenDto){ |
|||
LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); |
|||
BeanUtils.copyProperties(tokenDto,dto); |
|||
LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData(); |
|||
return data.getAgencyId(); |
|||
} |
|||
} |
@ -0,0 +1,57 @@ |
|||
package com.epmet.service.user; |
|||
|
|||
|
|||
import com.epmet.dto.form.user.UserIncrTrendFormDTO; |
|||
import com.epmet.dto.form.user.UserSubAgencyFormDTO; |
|||
import com.epmet.dto.form.user.UserSubGridFormDTO; |
|||
import com.epmet.dto.form.user.UserSummaryInfoFormDTO; |
|||
import com.epmet.dto.result.user.UserIncrTrendResultDTO; |
|||
import com.epmet.dto.result.user.UserSubAgencyResultDTO; |
|||
import com.epmet.dto.result.user.UserSubGridResultDTO; |
|||
import com.epmet.dto.result.user.UserSummaryInfoResultDTO; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 组织能力用户相关接口 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 13:23 |
|||
*/ |
|||
public interface UserAnalysisService { |
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserSummaryInfoResultDTO |
|||
* @author yinzuomei |
|||
* @description 用户汇总信息查询 |
|||
* @Date 2020/6/22 13:41 |
|||
**/ |
|||
UserSummaryInfoResultDTO summaryInfo(UserSummaryInfoFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserSubAgencyResultDTO |
|||
* @author yinzuomei |
|||
* @description 直属机关柱状图查询 |
|||
* @Date 2020/6/22 13:42 |
|||
**/ |
|||
List<UserSubAgencyResultDTO> subAgency(UserSubAgencyFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserSubGridResultDTO |
|||
* @author yinzuomei |
|||
* @description 直属网格柱状图查询 |
|||
* @Date 2020/6/22 13:42 |
|||
**/ |
|||
List<UserSubGridResultDTO> subGrid(UserSubGridFormDTO formDTO); |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserIncrTrendResultDTO |
|||
* @author yinzuomei |
|||
* @description 按日、按月查询注册用户数(参与用户数)增量折线图 |
|||
* @Date 2020/6/22 13:42 |
|||
**/ |
|||
List<UserIncrTrendResultDTO> incrTrend(UserIncrTrendFormDTO formDTO); |
|||
} |
@ -0,0 +1,425 @@ |
|||
package com.epmet.service.user.impl; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.epmet.commons.tools.constant.NumConstant; |
|||
import com.epmet.commons.tools.exception.RenException; |
|||
import com.epmet.commons.tools.security.user.LoginUserUtil; |
|||
import com.epmet.commons.tools.utils.DateUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.constant.UserAnalysisConstant; |
|||
import com.epmet.dao.user.UserAnalysisDao; |
|||
import com.epmet.dto.DimAgencyDTO; |
|||
import com.epmet.dto.DimGridDTO; |
|||
import com.epmet.dto.form.LoginUserDetailsFormDTO; |
|||
import com.epmet.dto.form.user.UserIncrTrendFormDTO; |
|||
import com.epmet.dto.form.user.UserSubAgencyFormDTO; |
|||
import com.epmet.dto.form.user.UserSubGridFormDTO; |
|||
import com.epmet.dto.form.user.UserSummaryInfoFormDTO; |
|||
import com.epmet.dto.result.LoginUserDetailsResultDTO; |
|||
import com.epmet.dto.result.user.*; |
|||
import com.epmet.feign.EpmetUserOpenFeignClient; |
|||
import com.epmet.service.user.UserAnalysisService; |
|||
import org.apache.commons.lang.StringUtils; |
|||
import org.slf4j.Logger; |
|||
import org.slf4j.LoggerFactory; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.util.CollectionUtils; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.Comparator; |
|||
import java.util.List; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 组织能力用户相关接口 |
|||
* |
|||
* @author yinzuomei@elink-cn.com |
|||
* @date 2020/6/22 13:23 |
|||
*/ |
|||
@Service |
|||
public class UserAnalysisServiceImpl implements UserAnalysisService { |
|||
private static final Logger logger = LoggerFactory.getLogger(UserAnalysisServiceImpl.class); |
|||
@Autowired |
|||
private LoginUserUtil loginUserUtil; |
|||
@Autowired |
|||
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|||
@Autowired |
|||
private UserAnalysisDao userAnalysisDao; |
|||
|
|||
/** |
|||
* @return java.lang.String |
|||
* @param |
|||
* @author yinzuomei |
|||
* @description 查询当前用户直属机关单位id |
|||
* @Date 2020/6/22 14:19 |
|||
**/ |
|||
public String getMyAgency(){ |
|||
LoginUserDetailsFormDTO loginUserDetailsFormDTO=new LoginUserDetailsFormDTO(); |
|||
loginUserDetailsFormDTO.setApp(loginUserUtil.getLoginUserApp()); |
|||
loginUserDetailsFormDTO.setClient(loginUserUtil.getLoginUserClient()); |
|||
loginUserDetailsFormDTO.setUserId(loginUserUtil.getLoginUserId()); |
|||
Result<LoginUserDetailsResultDTO> result=epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO); |
|||
if(!result.success()){ |
|||
throw new RenException(UserAnalysisConstant.QUERY_USER_AGENCY_FAILED); |
|||
} |
|||
if(result.success()){ |
|||
if (null == result.getData() || StringUtils.isBlank(result.getData().getAgencyId())) { |
|||
throw new RenException(UserAnalysisConstant.QUERY_USER_AGENCY_FAILED); |
|||
} |
|||
} |
|||
return result.getData().getAgencyId(); |
|||
} |
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserSummaryInfoResultDTO |
|||
* @author yinzuomei |
|||
* @description 用户汇总信息查询 |
|||
* @Date 2020/6/22 13:41 |
|||
**/ |
|||
@Override |
|||
public UserSummaryInfoResultDTO summaryInfo(UserSummaryInfoFormDTO formDTO) { |
|||
UserSummaryInfoResultDTO userSummaryInfoResultDTO=new UserSummaryInfoResultDTO(); |
|||
String myAgencyId=this.getMyAgency(); |
|||
if(UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag())){ |
|||
//参与用户
|
|||
userSummaryInfoResultDTO=userAnalysisDao.selectParticipationUserSummaryInfo(myAgencyId); |
|||
}else{ |
|||
//注册用户
|
|||
userSummaryInfoResultDTO=userAnalysisDao.selectRegUserSummaryInfo(myAgencyId); |
|||
} |
|||
if(null!=userSummaryInfoResultDTO){ |
|||
userSummaryInfoResultDTO.setCurrentDate(DateUtils.getxAxisDatePattern(userSummaryInfoResultDTO.getCurrentDate(),".")); |
|||
//提取出工具类
|
|||
userSummaryInfoResultDTO.setPartymemberProportion(userSummaryInfoResultDTO.getPartymemberProportionValue().stripTrailingZeros().toPlainString()); |
|||
userSummaryInfoResultDTO.setWarmHeartedProportion(userSummaryInfoResultDTO.getWarmHeartedProportionValue().stripTrailingZeros().toPlainString()); |
|||
} |
|||
logger.info(String.format("查询用户汇总信息返参%s",JSON.toJSONString(userSummaryInfoResultDTO))); |
|||
return userSummaryInfoResultDTO; |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserSubAgencyResultDTO |
|||
* @author yinzuomei |
|||
* @description 直属机关柱状图查询 |
|||
* @Date 2020/6/22 13:42 |
|||
**/ |
|||
@Override |
|||
public List<UserSubAgencyResultDTO> subAgency(UserSubAgencyFormDTO formDTO) { |
|||
//获取用户所属机关id
|
|||
String myAgencyId = this.getMyAgency(); |
|||
//初始化横坐标(用户所机关的下级机关列表)
|
|||
List<UserSubAgencyResultDTO> dimList = this.initUserSubAgencyResultDTO(myAgencyId); |
|||
if(CollectionUtils.isEmpty(dimList)){ |
|||
logger.info(String.format("当前机关(agencyId=%s)下没有下级机关",myAgencyId)); |
|||
return new ArrayList<>(); |
|||
} |
|||
//根据入参,查询注册用户或者参与用户的(机关、按日的查询结果)
|
|||
List<UserSubAgencyResDTO> userSubAgencyResDTOList=new ArrayList<>(); |
|||
if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag())) { |
|||
//参与用户
|
|||
userSubAgencyResDTOList = userAnalysisDao.selectParticipationSubAgencyRes(formDTO.getDateId(), |
|||
myAgencyId); |
|||
} else { |
|||
//注册用户
|
|||
userSubAgencyResDTOList = userAnalysisDao.selectRegSubAgencyRes(formDTO.getDateId(), |
|||
myAgencyId); |
|||
} |
|||
//根据维度表进行对比
|
|||
for(UserSubAgencyResultDTO dimInitResultDto:dimList){ |
|||
boolean flag=false; |
|||
for(UserSubAgencyResDTO userSubAgencyResDTO:userSubAgencyResDTOList){ |
|||
if(dimInitResultDto.getAgencyId().equals(userSubAgencyResDTO.getAgencyId())){ |
|||
flag=true; |
|||
//居民、热心居民、党员总数,用于排序
|
|||
dimInitResultDto.setTotal(userSubAgencyResDTO.getPartymemberTotal() |
|||
+userSubAgencyResDTO.getWarmHeartedTotal() |
|||
+userSubAgencyResDTO.getResiTotal()); |
|||
switch(dimInitResultDto.getType()){ |
|||
case UserAnalysisConstant.REGISTERED_RESI: |
|||
dimInitResultDto.setValue(userSubAgencyResDTO.getResiTotal()); |
|||
break; |
|||
case UserAnalysisConstant.WARMHEARTED: |
|||
dimInitResultDto.setValue(userSubAgencyResDTO.getWarmHeartedTotal()); |
|||
break; |
|||
case UserAnalysisConstant.PARTYMEMBER: |
|||
dimInitResultDto.setValue(userSubAgencyResDTO.getPartymemberTotal()); |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
if(!flag){ |
|||
logger.error(String.format("各机关注册用户数缺少记录:date_id=%s,agencyId=%s",formDTO.getDateId(),dimInitResultDto.getAgencyId())); |
|||
} |
|||
} |
|||
//返回集合按照total降序排序
|
|||
List<UserSubAgencyResultDTO> returnList = dimList.stream().sorted(Comparator.comparing(UserSubAgencyResultDTO::getTotal)) |
|||
.collect(Collectors.toList()); |
|||
return returnList; |
|||
} |
|||
|
|||
private List<UserSubAgencyResultDTO> initUserSubAgencyResultDTO(String myAgencyId) { |
|||
List<UserSubAgencyResultDTO> list=new ArrayList<>(); |
|||
List<DimAgencyDTO> dimAgencyDTOS=userAnalysisDao.selectSubAgencyList(myAgencyId); |
|||
for(DimAgencyDTO agencyDTO:dimAgencyDTOS){ |
|||
//居民
|
|||
UserSubAgencyResultDTO resi=new UserSubAgencyResultDTO(); |
|||
resi.setAgencyId(agencyDTO.getId()); |
|||
resi.setName(agencyDTO.getAgencyName()); |
|||
resi.setValue(NumConstant.ZERO); |
|||
resi.setType(UserAnalysisConstant.REGISTERED_RESI); |
|||
resi.setTotal(NumConstant.ZERO); |
|||
list.add(resi); |
|||
//热心居民
|
|||
UserSubAgencyResultDTO warm=new UserSubAgencyResultDTO(); |
|||
warm.setAgencyId(agencyDTO.getId()); |
|||
warm.setName(agencyDTO.getAgencyName()); |
|||
warm.setValue(NumConstant.ZERO); |
|||
warm.setType(UserAnalysisConstant.WARMHEARTED); |
|||
warm.setTotal(NumConstant.ZERO); |
|||
list.add(warm); |
|||
//党员
|
|||
UserSubAgencyResultDTO party=new UserSubAgencyResultDTO(); |
|||
party.setAgencyId(agencyDTO.getId()); |
|||
party.setName(agencyDTO.getAgencyName()); |
|||
party.setValue(NumConstant.ZERO); |
|||
party.setType(UserAnalysisConstant.PARTYMEMBER); |
|||
party.setTotal(NumConstant.ZERO); |
|||
list.add(party); |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserSubGridResultDTO |
|||
* @author yinzuomei |
|||
* @description 直属网格柱状图查询 |
|||
* @Date 2020/6/22 13:42 |
|||
**/ |
|||
@Override |
|||
public List<UserSubGridResultDTO> subGrid(UserSubGridFormDTO formDTO) { |
|||
//获取用户所属机关id
|
|||
String myAgencyId = this.getMyAgency(); |
|||
//初始化横坐标(用户所机关的直属网格)
|
|||
List<UserSubGridResultDTO> dimList = this.initUserSubGridResultDTO(myAgencyId); |
|||
if(CollectionUtils.isEmpty(dimList)){ |
|||
logger.info(String.format("当前机关(agencyId=%s)下没有网格",myAgencyId)); |
|||
return new ArrayList<>(); |
|||
} |
|||
//根据入参,查询注册用户或者参与用户的(机关、按日的查询结果)
|
|||
List<UserSubGridResDTO> userSubGridResDTOS=new ArrayList<>(); |
|||
if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag())) { |
|||
//参与用户
|
|||
userSubGridResDTOS=userAnalysisDao.selectParticipationSubGridRes(formDTO.getDateId(),myAgencyId); |
|||
} else { |
|||
//注册用户
|
|||
userSubGridResDTOS=userAnalysisDao.selectRegSubGridRes(formDTO.getDateId(),myAgencyId); |
|||
} |
|||
//根据维度表进行对比
|
|||
for(UserSubGridResultDTO dimInitResultDto:dimList){ |
|||
boolean flag=false; |
|||
for(UserSubGridResDTO userSubGridResDTO:userSubGridResDTOS){ |
|||
if(dimInitResultDto.getGridId().equals(userSubGridResDTO.getGridId())){ |
|||
flag=true; |
|||
//居民、热心居民、党员总数,用于排序
|
|||
dimInitResultDto.setTotal(userSubGridResDTO.getPartymemberTotal() |
|||
+userSubGridResDTO.getWarmHeartedTotal() |
|||
+userSubGridResDTO.getResiTotal()); |
|||
switch(dimInitResultDto.getType()){ |
|||
case UserAnalysisConstant.REGISTERED_RESI: |
|||
dimInitResultDto.setValue(userSubGridResDTO.getResiTotal()); |
|||
break; |
|||
case UserAnalysisConstant.WARMHEARTED: |
|||
dimInitResultDto.setValue(userSubGridResDTO.getWarmHeartedTotal()); |
|||
break; |
|||
case UserAnalysisConstant.PARTYMEMBER: |
|||
dimInitResultDto.setValue(userSubGridResDTO.getPartymemberTotal()); |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
} |
|||
} |
|||
if(!flag){ |
|||
logger.error(String.format("直属网格注册用户数缺少记录:date_id=%s,gridId=%s",formDTO.getDateId(),dimInitResultDto.getGridId())); |
|||
} |
|||
} |
|||
//返回集合按照total降序排序
|
|||
List<UserSubGridResultDTO> returnList = dimList.stream().sorted(Comparator.comparing(UserSubGridResultDTO::getTotal)) |
|||
.collect(Collectors.toList()); |
|||
return returnList; |
|||
} |
|||
|
|||
private List<UserSubGridResultDTO> initUserSubGridResultDTO(String myAgencyId) { |
|||
List<UserSubGridResultDTO> list=new ArrayList<>(); |
|||
List<DimGridDTO> gridList=userAnalysisDao.selectSubGridList(myAgencyId); |
|||
for(DimGridDTO grid:gridList){ |
|||
//居民
|
|||
UserSubGridResultDTO resi=new UserSubGridResultDTO(); |
|||
resi.setGridId(grid.getId()); |
|||
resi.setName(grid.getGridName()); |
|||
resi.setValue(NumConstant.ZERO); |
|||
resi.setType(UserAnalysisConstant.REGISTERED_RESI); |
|||
resi.setTotal(NumConstant.ZERO); |
|||
list.add(resi); |
|||
//热心居民
|
|||
UserSubGridResultDTO warm=new UserSubGridResultDTO(); |
|||
warm.setGridId(grid.getId()); |
|||
warm.setName(grid.getGridName()); |
|||
warm.setValue(NumConstant.ZERO); |
|||
warm.setType(UserAnalysisConstant.WARMHEARTED); |
|||
warm.setTotal(NumConstant.ZERO); |
|||
list.add(warm); |
|||
//党员
|
|||
UserSubGridResultDTO party=new UserSubGridResultDTO(); |
|||
party.setGridId(grid.getId()); |
|||
party.setName(grid.getGridName()); |
|||
party.setValue(NumConstant.ZERO); |
|||
party.setType(UserAnalysisConstant.PARTYMEMBER); |
|||
party.setTotal(NumConstant.ZERO); |
|||
list.add(party); |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
/** |
|||
* @param formDTO |
|||
* @return com.epmet.user.result.UserIncrTrendResultDTO |
|||
* @author yinzuomei |
|||
* @description 按日、按月查询注册用户数(参与用户数)增量折线图 |
|||
* @Date 2020/6/22 13:42 |
|||
**/ |
|||
@Override |
|||
public List<UserIncrTrendResultDTO> incrTrend(UserIncrTrendFormDTO formDTO) { |
|||
//获取用户所属机关id
|
|||
String myAgencyId = this.getMyAgency(); |
|||
List<UserIncrTrendResultDTO> dimList = this.initUserIncrTrendResultDTO(formDTO.getType()); |
|||
if(CollectionUtils.isEmpty(dimList)){ |
|||
logger.error("横坐标初始失败"); |
|||
return new ArrayList<>(); |
|||
} |
|||
List<UserIncrTrendResDTO> list=new ArrayList<>(); |
|||
if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { |
|||
//注册用户数、日
|
|||
list=userAnalysisDao.selectRegDayIncr(myAgencyId); |
|||
} else if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { |
|||
//注册用户数、月
|
|||
list=userAnalysisDao.selectRegMonthIncr(myAgencyId); |
|||
} else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { |
|||
//参与用户数、日
|
|||
list=userAnalysisDao.selectParticipationUserDayIncr(myAgencyId); |
|||
} else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { |
|||
//参与用户数、月
|
|||
list=userAnalysisDao.selectParticipationUserMonthIncr(myAgencyId); |
|||
} else { |
|||
logger.error("参数错误"); |
|||
return new ArrayList<>(); |
|||
} |
|||
for(UserIncrTrendResultDTO dim:dimList){ |
|||
boolean flag=false; |
|||
for(UserIncrTrendResDTO userIncrTrendResDTO:list){ |
|||
if(dim.getDateOrMonthId().equals(userIncrTrendResDTO.getDateIdOrMonthId())){ |
|||
flag=true; |
|||
//居民、热心居民、党员总数,用于排序
|
|||
switch(dim.getType()){ |
|||
case UserAnalysisConstant.REGISTERED_RESI: |
|||
dim.setValue(userIncrTrendResDTO.getRegIncr()); |
|||
break; |
|||
case UserAnalysisConstant.WARMHEARTED: |
|||
dim.setValue(userIncrTrendResDTO.getWarmIncr()); |
|||
break; |
|||
case UserAnalysisConstant.PARTYMEMBER: |
|||
dim.setValue(userIncrTrendResDTO.getPartymemberIncr()); |
|||
break; |
|||
default: |
|||
break; |
|||
} |
|||
|
|||
} |
|||
} |
|||
if(!flag){ |
|||
logger.error(String.format("机关id%s缺少记录dateOrMonthId=%s",myAgencyId,dim.getDateOrMonthId())); |
|||
} |
|||
} |
|||
return dimList; |
|||
} |
|||
|
|||
private List<UserIncrTrendResultDTO> initUserIncrTrendResultDTO(String type) { |
|||
List<UserIncrTrendResultDTO> list=new ArrayList<>(); |
|||
if(UserAnalysisConstant.DAY_TYPE.equals(type)){ |
|||
List<String> dateIdList= DateUtils.getDaysBetween(DateUtils.getBeforeNDay(90), |
|||
DateUtils.getBeforeNDay(1)); |
|||
for(String dateId:dateIdList){ |
|||
String date=DateUtils.getxAxisDatePattern(dateId,"/"); |
|||
//居民
|
|||
UserIncrTrendResultDTO resi=new UserIncrTrendResultDTO(); |
|||
resi.setDate(date); |
|||
resi.setType(UserAnalysisConstant.REGISTERED_RESI); |
|||
resi.setValue(NumConstant.ZERO); |
|||
resi.setDateOrMonthId(dateId); |
|||
//热心居民
|
|||
UserIncrTrendResultDTO warm=new UserIncrTrendResultDTO(); |
|||
warm.setDate(date); |
|||
warm.setType(UserAnalysisConstant.WARMHEARTED); |
|||
warm.setValue(NumConstant.ZERO); |
|||
warm.setDateOrMonthId(dateId); |
|||
//党员
|
|||
UserIncrTrendResultDTO party=new UserIncrTrendResultDTO(); |
|||
party.setDate(date); |
|||
party.setType(UserAnalysisConstant.PARTYMEMBER); |
|||
party.setValue(NumConstant.ZERO); |
|||
party.setDateOrMonthId(dateId); |
|||
list.add(resi); |
|||
list.add(warm); |
|||
list.add(party); |
|||
} |
|||
}else if(UserAnalysisConstant.MONTH_TYPE.equals(type)){ |
|||
List<String> monthList= DateUtils.getMonthBetween(DateUtils.getBeforeNMonth(12), |
|||
DateUtils.getBeforeNMonth(1)); |
|||
for(String monthId:monthList){ |
|||
String date=DateUtils.getxAxisDatePattern(monthId,"/"); |
|||
//居民
|
|||
UserIncrTrendResultDTO resi=new UserIncrTrendResultDTO(); |
|||
resi.setDate(date); |
|||
resi.setType(UserAnalysisConstant.REGISTERED_RESI); |
|||
resi.setValue(NumConstant.ZERO); |
|||
resi.setDateOrMonthId(monthId); |
|||
//热心居民
|
|||
UserIncrTrendResultDTO warm=new UserIncrTrendResultDTO(); |
|||
warm.setDate(date); |
|||
warm.setType(UserAnalysisConstant.WARMHEARTED); |
|||
warm.setValue(NumConstant.ZERO); |
|||
warm.setDateOrMonthId(monthId); |
|||
//党员
|
|||
UserIncrTrendResultDTO party=new UserIncrTrendResultDTO(); |
|||
party.setDate(date); |
|||
party.setType(UserAnalysisConstant.PARTYMEMBER); |
|||
party.setValue(NumConstant.ZERO); |
|||
party.setDateOrMonthId(monthId); |
|||
list.add(resi); |
|||
list.add(warm); |
|||
list.add(party); |
|||
} |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
|
|||
/*public static void main(String[] args) { |
|||
// System.out.println("前一天"+DateUtils.getBeforeNDay(1));
|
|||
// System.out.println("前90天"+DateUtils.getBeforeNDay(90));
|
|||
List<String> list= DateUtils.getDaysBetween("201912","202005"); |
|||
for(String m:list){ |
|||
System.out.println(m); |
|||
} |
|||
// System.out.println(list.size());
|
|||
System.out.println("上个月"+DateUtils.getBeforeNMonth(1)); |
|||
System.out.println("前8个月"+DateUtils.getBeforeNMonth(8)); |
|||
|
|||
}*/ |
|||
|
|||
} |
@ -0,0 +1,164 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<configuration> |
|||
<include resource="org/springframework/boot/logging/logback/base.xml"/> |
|||
|
|||
<property name="log.path" value="logs/data-report"/> |
|||
|
|||
<springProperty scope="context" name="appname" source="spring.application.name"/> |
|||
|
|||
<!-- 日志上下文名称 --> |
|||
<contextName>${appname}</contextName> |
|||
|
|||
<!-- 彩色日志格式 --> |
|||
<property name="CONSOLE_LOG_PATTERN" |
|||
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/> |
|||
|
|||
<!--1. 输出到控制台--> |
|||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
|||
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息--> |
|||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter"> |
|||
<level>debug</level> |
|||
</filter> |
|||
<encoder> |
|||
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern> |
|||
<!-- 设置字符集 --> |
|||
<charset>UTF-8</charset> |
|||
</encoder> |
|||
</appender> |
|||
|
|||
<!--2. 输出到文档--> |
|||
<!-- 2.1 level为 DEBUG 日志,时间滚动输出 --> |
|||
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文档的路径及文档名 --> |
|||
<file>${log.path}/debug.log</file> |
|||
<!--日志文档输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<!-- 日志归档 --> |
|||
<fileNamePattern>${log.path}/debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文档保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文档只记录debug级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>debug</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 2.2 level为 INFO 日志,时间滚动输出 --> |
|||
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文档的路径及文档名 --> |
|||
<file>${log.path}/info.log</file> |
|||
<!--日志文档输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<!-- 每天日志归档路径以及格式 --> |
|||
<fileNamePattern>${log.path}/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文档保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文档只记录info级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>info</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 2.3 level为 WARN 日志,时间滚动输出 --> |
|||
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文档的路径及文档名 --> |
|||
<file>${log.path}/warn.log</file> |
|||
<!--日志文档输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<fileNamePattern>${log.path}/warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文档保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文档只记录warn级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>warn</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 2.4 level为 ERROR 日志,时间滚动输出 --> |
|||
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
|||
<!-- 正在记录的日志文档的路径及文档名 --> |
|||
<file>${log.path}/error.log</file> |
|||
<!--日志文档输出格式--> |
|||
<encoder> |
|||
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n</pattern> |
|||
<charset>UTF-8</charset> <!-- 此处设置字符集 --> |
|||
</encoder> |
|||
<!-- 日志记录器的滚动策略,按日期,按大小记录 --> |
|||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
|||
<fileNamePattern>${log.path}/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
|||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
|||
<maxFileSize>100MB</maxFileSize> |
|||
</timeBasedFileNamingAndTriggeringPolicy> |
|||
<!--日志文档保留天数--> |
|||
<maxHistory>15</maxHistory> |
|||
</rollingPolicy> |
|||
<!-- 此日志文档只记录ERROR级别的 --> |
|||
<filter class="ch.qos.logback.classic.filter.LevelFilter"> |
|||
<level>ERROR</level> |
|||
<onMatch>ACCEPT</onMatch> |
|||
<onMismatch>DENY</onMismatch> |
|||
</filter> |
|||
</appender> |
|||
|
|||
<!-- 开发、测试环境 --> |
|||
<springProfile name="dev,test"> |
|||
<logger name="org.springframework.web" level="INFO"/> |
|||
<logger name="org.springboot.sample" level="INFO"/> |
|||
<logger name="com.epmet.dao" level="INFO"/> |
|||
<logger name="com.epmet.dao" level="DEBUG"/> |
|||
<root level="INFO"> |
|||
<appender-ref ref="DEBUG_FILE"/> |
|||
<appender-ref ref="INFO_FILE"/> |
|||
<appender-ref ref="WARN_FILE"/> |
|||
<appender-ref ref="ERROR_FILE"/> |
|||
</root> |
|||
</springProfile> |
|||
|
|||
<!-- 生产环境 --> |
|||
<springProfile name="prod"> |
|||
<logger name="org.springframework.web" level="INFO"/> |
|||
<logger name="org.springboot.sample" level="INFO"/> |
|||
<logger name="com.epmet.dao" level="INFO"/> |
|||
<root level="INFO"> |
|||
<appender-ref ref="CONSOLE"/> |
|||
<appender-ref ref="DEBUG_FILE"/> |
|||
<appender-ref ref="INFO_FILE"/> |
|||
<appender-ref ref="WARN_FILE"/> |
|||
<appender-ref ref="ERROR_FILE"/> |
|||
</root> |
|||
</springProfile> |
|||
|
|||
</configuration> |
@ -0,0 +1,92 @@ |
|||
<?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.group.GroupDao"> |
|||
|
|||
<!-- 网格小组:网格总数、网格小组数、小组平均数、小组人数中位数 --> |
|||
<select id="summaryInfo" parameterType="java.lang.String" resultType="com.epmet.group.dto.result.GroupSummaryInfoResultDTO"> |
|||
SELECT |
|||
grid_total AS gridTotalCount, |
|||
group_total_count AS groupTotalCount, |
|||
group_member_avg_count AS groupPeopleAvg, |
|||
group_median AS groupPeopleMedian, |
|||
DATE_FORMAT( date_id, '%Y-%m-%d' ) AS deadline |
|||
FROM fact_group_agency_daily |
|||
WHERE del_flag = '0' |
|||
AND agency_id = #{agencyId} |
|||
</select> |
|||
|
|||
<!--获取下级机关信息--> |
|||
<select id="getSubAgencyList" parameterType="java.lang.String" resultType="com.epmet.group.dto.result.SubAgencyResultDTO"> |
|||
SELECT |
|||
id AS agencyId, |
|||
agency_name AS agencyName |
|||
FROM |
|||
dim_agency |
|||
WHERE |
|||
del_flag = '0' |
|||
AND pid = #{agencyId} |
|||
</select> |
|||
|
|||
<!--获取下级机关的小组数--> |
|||
<select id="getSubGroupCount" resultType="com.epmet.group.dto.result.GroupSubAgencyResultDTO"> |
|||
SELECT |
|||
'小组数量' AS type, |
|||
fgad.group_total_count AS value, |
|||
fgad.agency_id AS agencyId |
|||
FROM |
|||
fact_group_agency_daily fgad |
|||
LEFT JOIN dim_agency da ON da.id = fgad.agency_id |
|||
AND da.del_flag = '0' |
|||
WHERE |
|||
fgad.del_flag = '0' |
|||
GROUP BY fgad.agency_id |
|||
ORDER BY fgad.date_id desc |
|||
</select> |
|||
|
|||
<!--获取直属网格下的小组数--> |
|||
<select id="getSubGridGroupCount" parameterType="java.lang.String" resultType="com.epmet.group.dto.result.GroupSubGridResultDTO"> |
|||
SELECT |
|||
fggd.grid_id AS gridId, |
|||
fggd.group_total AS value, |
|||
"小组数量" AS type , |
|||
dg.grid_name AS name |
|||
FROM |
|||
fact_group_grid_daily fggd |
|||
LEFT JOIN dim_grid dg ON dg.id = fggd.grid_id AND dg.del_flag = '0' |
|||
WHERE |
|||
fggd.del_flag = '0' |
|||
AND fggd.agency_id = #{agencyId} |
|||
</select> |
|||
|
|||
<!--小组数量 日增长--> |
|||
<select id="getIncrDaily" parameterType="java.lang.String" resultType="com.epmet.group.dto.result.GroupIncrTrendResultDTO"> |
|||
SELECT |
|||
DATE_FORMAT( date_id, '%Y/%m/%d' ) AS date, |
|||
group_incr AS value, |
|||
'小组数量' AS type |
|||
FROM |
|||
fact_group_agency_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND agency_id = #{agencyId} |
|||
ORDER BY |
|||
date_id DESC |
|||
</select> |
|||
|
|||
<!--小组数量 月增长--> |
|||
<select id="getIncrMonthly" parameterType="java.lang.String" resultType="com.epmet.group.dto.result.GroupIncrTrendResultDTO"> |
|||
SELECT |
|||
CONCAT(SUBSTRING(month_id,1,4),'/',SUBSTRING(month_id,5,6)) AS date, |
|||
group_incr AS value, |
|||
'小组数量' AS type |
|||
FROM |
|||
fact_group_agency_daily |
|||
WHERE |
|||
del_flag = '0' |
|||
AND agency_id = #{agencyId} |
|||
ORDER BY |
|||
month_id DESC |
|||
</select> |
|||
|
|||
</mapper> |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue