diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index 67a0f8ea1a..cf84ae177f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -107,10 +107,15 @@ public interface ServiceConstant { /** * 政府端-党建声音 */ - String GOV_VOICE_SERVER="gov-voice-server"; + String GOV_VOICE_SERVER = "gov-voice-server"; /** * 居民端-党建声音 */ - String RESI_VOICE_SERVER="resi-voice-server"; + String RESI_VOICE_SERVER = "resi-voice-server"; + + /** + * 数据统计 + */ + String DATA_STATISTICAL = "data_statistical"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index 05b505594b..9de4b0d167 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -76,23 +76,23 @@ public enum RequirePermissionEnum { /** * 基层治理-议题管理 */ - WORK_GRASSROOTS_ISSUE_VOTINGLIST("work_grassroots_issue_voting_list","表决中","表决中议题列表查询"), - WORK_GRASSROOTS_ISSUE_SHIFTED_PROJECT_LIST("work_grassroots_issue_shifted_project_list", "已转项目列表查询","已转项目议题列表查询"), - WORK_GRASSROOTS_ISSUE_CLOSED_LIST("work_grassroots_issue_closed_list","已关闭","已关闭议题列表查询"), - WORK_GRASSROOTS_ISSUE_DETAIL("work_grassroots_issue_detail", "议题详情","议题详情界面所有的api添加此校验"), - WORK_GRASSROOTS_ISSUE_SHIFT_PROJECT("work_grassroots_issue_shift_project", "转项目","转项目(选择处理部门api也需要添加此校验)"), - WORK_GRASSROOTS_ISSUE_CLOSE("work_grassroots_issue_close","关闭议题","关闭议题"), + WORK_GRASSROOTS_ISSUE_VOTINGLIST("work_grassroots_issue_voting_list","基层治理:议题管理:表决中","表决中议题列表查询"), + WORK_GRASSROOTS_ISSUE_SHIFTED_PROJECT_LIST("work_grassroots_issue_shifted_project_list", "基层治理:议题管理:已转项目列表查询","已转项目议题列表查询"), + WORK_GRASSROOTS_ISSUE_CLOSED_LIST("work_grassroots_issue_closed_list","基层治理:议题管理:已关闭","已关闭议题列表查询"), + WORK_GRASSROOTS_ISSUE_DETAIL("work_grassroots_issue_detail", "基层治理:议题管理:议题详情","议题详情界面所有的api添加此校验"), + WORK_GRASSROOTS_ISSUE_SHIFT_PROJECT("work_grassroots_issue_shift_project", "基层治理:议题管理:转项目","转项目(选择处理部门api也需要添加此校验)"), + WORK_GRASSROOTS_ISSUE_CLOSE("work_grassroots_issue_close","基层治理:议题管理:关闭议题","关闭议题"), /** * 工作-项目跟踪 */ - WORK_PROJECT_TRACE_PENDING_LIST("work_project_trace_pending_list","待处理","待处理的项目,列表查询"), - WORK_PROJECT_TRACE_CREATED_LIST("work_project_trace_created_list","我发起","我发起的项目,列表查询"), - WORK_PROJECT_TRACE_INVOLVED_LIST("work_project_trace_involved_list","我参与","我参与的项目,列表查询"), - WORK_PROJECT_TRACE_DETAIL("work_project_trace_detail","项目详情","项目详情界面所有的api添加此校验"), - WORK_PROJECT_TRACE_CLOSE("work_project_trace_close","结案","结案"), - WORK_PROJECT_TRACE_TRANSFER("work_project_trace_transfer","转其他部门","转其他部门(选择处理部门api也需要添加此校验)"), - WORK_PROJECT_TRACE_RETURN("work_project_trace_return","退回","退回"), + WORK_PROJECT_TRACE_PENDING_LIST("work_project_trace_pending_list","项目跟踪:待处理","待处理的项目,列表查询"), + WORK_PROJECT_TRACE_CREATED_LIST("work_project_trace_created_list","项目跟踪:我发起","我发起的项目,列表查询"), + WORK_PROJECT_TRACE_INVOLVED_LIST("work_project_trace_involved_list","项目跟踪:我参与","我参与的项目,列表查询"), + WORK_PROJECT_TRACE_DETAIL("work_project_trace_detail","项目跟踪:项目详情","项目详情界面所有的api添加此校验"), + WORK_PROJECT_TRACE_CLOSE("work_project_trace_close","项目跟踪:结案","结案"), + WORK_PROJECT_TRACE_TRANSFER("work_project_trace_transfer","项目跟踪:转其他部门","转其他部门(选择处理部门api也需要添加此校验)"), + WORK_PROJECT_TRACE_RETURN("work_project_trace_return","项目跟踪:退回","退回"), /** * 党务工作-党建声音 @@ -106,7 +106,17 @@ public enum RequirePermissionEnum { WORK_PARTY_VOICE_PUBLISH("work_party_voice_publish", "党建声音:创建文章", ""), WORK_PARTY_VOICE_EDIT("work_party_voice_edit", "党建声音:重新编辑", ""), WORK_PARTY_VOICE_OFFLINE("work_party_voice_offline", "党建声音:下线文章", ""), - WORK_PARTY_VOICE_OPERATION_LIST("work_party_voice_operation_list","党建声音:查看文章操作记录",""); + WORK_PARTY_VOICE_OPERATION_LIST("work_party_voice_operation_list","党建声音:查看文章操作记录",""), + + /** + * 基层治理-支部管理 + */ + WORK_GRASSROOTS_PARTY_BRANCH_ADD("work_grassroots_party_branch_add","基层治理:支部管理:添加党支部","支部管理-添加党支部"), + WORK_GRASSROOTS_PARTY_BRANCH_EDIT("work_grassroots_party_branch_edit","基层治理:支部管理:编辑党支部","支部管理-编辑党支部信息"), + WORK_GRASSROOTS_PARTY_BRANCH_DELETE("work_grassroots_party_branch_delete","基层治理:支部管理:删除党支部","支部管理-删除党支部"), + WORK_GRASSROOTS_PARTY_MEMBER_ADD("work_grassroots_party_member_add","基层治理:支部管理:添加党员","支部管理-添加党员"), + WORK_GRASSROOTS_PARTY_MEMBER_EDIT("work_grassroots_party_member_edit","基层治理:支部管理:编辑党员","支部管理-编辑党员"), + WORK_GRASSROOTS_PARTY_MEMBER_DELETE("work_grassroots_party_member_delete","基层治理:支部管理:删除党员","支部管理-删除党员"); private String key; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 04aabbf38f..e12787cc3b 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -37,7 +37,13 @@ public enum EpmetErrorCode { MOBILE_GET_CODE_ERROR(8104,"获取验证码失败"), MESSAGE_SMS_SEND_ERROR(8105, "短信发送失败"), NOT_DEL_GRID(8106,"该网格存在工作人员,不允许删除"), + ORG_IS_NOT_NULL(8107,"党组织关系不能为空"), + CANNOT_DELETE_PARTY_BRANCH(8108,"当前支部存在党员,不允许删除"), + IDCARDNO_ALREADY_EXITS(8109,"系统已存在相同身份证号码,请重新输入"), + IDCARDNO_ERROR(8110,"身份证号格式错误,请重新输入"), + CANNOT_DELETE_PARTY_MEMBER(8111,"该用户已注册党员,不允许删除"), + CANNOT_AUDIT_WARM(8201, "请完善居民信息"), NOT_DEL_AGENCY(8202, "该机关存在下级机关,不允许删除"), @@ -89,7 +95,7 @@ public enum EpmetErrorCode { return epmetErrorCodeEnum.getMsg(); } } - return null; + return EpmetErrorCode.SERVER_ERROR.getMsg(); } public int getCode(){ diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 9864888cf5..6e2e440f38 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -14,6 +14,7 @@ import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -347,4 +348,18 @@ public class DateUtils { System.out.println(666); } + + /** + * 获取日期前一天 + * @author zhaoqifeng + * @date 2020/6/22 11:08 + * @param date + * @return java.util.Date + */ + public static Date getBeforeDay(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DATE, -1); + return calendar.getTime(); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java new file mode 100644 index 0000000000..2aa3e2c964 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java @@ -0,0 +1,212 @@ +package com.epmet.commons.tools.validator; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.GregorianCalendar; +import java.util.Hashtable; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static java.util.regex.Pattern.*; + +/** + * 身份证号校验 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/18 9:59 + */ +public class IdCardNoValidatorUtils { + + private static Logger logger = LoggerFactory.getLogger(IdCardNoValidatorUtils.class); + + /** + * 身份证验证 + * + * @param idCardNo + * @return 校验信息,correct为成功,失败会返回对应的失败原因 + */ + public static boolean checkIsIdCardNo(String idCardNo) { + String[] wf = {"1", "0", "X", "9", "8", "7", "6", "5", "4", "3", "2"}; + String[] checkCode = {"7", "9", "10", "5", "8", "4", "2", "1", "6", "3", "7", "9", "10", "5", "8", "4", "2"}; + String iDCardNo = ""; + try { + //判断号码的长度 15位或18位 + if (idCardNo.length() != 15 && idCardNo.length() != 18) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证号码长度应该为15位或18位")); + return false; + } + if (idCardNo.length() == 18) { + String lastStr = idCardNo.substring(idCardNo.length() - 1); + if (!Character.isDigit(lastStr.charAt(0))) { + if (Character.isLowerCase(lastStr.charAt(0))) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "18身份证号最后一位字母需要大写")); + return false; + } + } else { + logger.info(String.format("身份证号%s最后一位为数字")); + } + } + if (idCardNo.length() == 18) { + iDCardNo = idCardNo.substring(0, 17); + } else if (idCardNo.length() == 15) { + iDCardNo = idCardNo.substring(0, 6) + "19" + idCardNo.substring(6, 15); + } + if (isStrNum(iDCardNo) == false) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证15位号码都应为数字;18位号码除最后一位外,都应为数字")); + return false; + } + //判断出生年月 + String strYear = iDCardNo.substring(6, 10);// 年份 + String strMonth = iDCardNo.substring(10, 12);// 月份 + String strDay = iDCardNo.substring(12, 14);// 月份 + if (isStrDate(strYear + "-" + strMonth + "-" + strDay) == false) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日无效")); + return false; + } + GregorianCalendar gc = new GregorianCalendar(); + SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd"); + if ((gc.get(Calendar.YEAR) - Integer.parseInt(strYear)) > 150 || (gc.getTime().getTime() - s.parse(strYear + "-" + strMonth + "-" + strDay).getTime()) < 0) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日不在有效范围")); + return false; + } + if (Integer.parseInt(strMonth) > 12 || Integer.parseInt(strMonth) == 0) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证月份无效")); + return false; + } + if (Integer.parseInt(strDay) > 31 || Integer.parseInt(strDay) == 0) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证日期无效")); + return false; + } + //判断地区码 + Hashtable h = GetAreaCode(); + if (h.get(iDCardNo.substring(0, 2)) == null) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证地区编码错误")); + return false; + } + //判断最后一位 + int theLastOne = 0; + for (int i = 0; i < 17; i++) { + theLastOne = theLastOne + Integer.parseInt(String.valueOf(iDCardNo.charAt(i))) * Integer.parseInt(checkCode[i]); + } + int modValue = theLastOne % 11; + String strVerifyCode = wf[modValue]; + iDCardNo = iDCardNo + strVerifyCode; + + if (idCardNo.length() == 18 && !iDCardNo.equals(idCardNo)) { + logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证无效,不是合法的身份证号码")); + return false; + } + + } catch (Exception e) { + logger.error(String.format("校验身份证号方法异常")); + e.printStackTrace(); + } + return true; + } + + /** + * 地区代码 + * + * @return Hashtable + */ + private static Hashtable GetAreaCode() { + Hashtable hashtable = new Hashtable(); + hashtable.put("11", "北京"); + hashtable.put("12", "天津"); + hashtable.put("13", "河北"); + hashtable.put("14", "山西"); + hashtable.put("15", "内蒙古"); + hashtable.put("21", "辽宁"); + hashtable.put("22", "吉林"); + hashtable.put("23", "黑龙江"); + hashtable.put("31", "上海"); + hashtable.put("32", "江苏"); + hashtable.put("33", "浙江"); + hashtable.put("34", "安徽"); + hashtable.put("35", "福建"); + hashtable.put("36", "江西"); + hashtable.put("37", "山东"); + hashtable.put("41", "河南"); + hashtable.put("42", "湖北"); + hashtable.put("43", "湖南"); + hashtable.put("44", "广东"); + hashtable.put("45", "广西"); + hashtable.put("46", "海南"); + hashtable.put("50", "重庆"); + hashtable.put("51", "四川"); + hashtable.put("52", "贵州"); + hashtable.put("53", "云南"); + hashtable.put("54", "西藏"); + hashtable.put("61", "陕西"); + hashtable.put("62", "甘肃"); + hashtable.put("63", "青海"); + hashtable.put("64", "宁夏"); + hashtable.put("65", "新疆"); + hashtable.put("71", "台湾"); + hashtable.put("81", "香港"); + hashtable.put("82", "澳门"); + hashtable.put("91", "国外"); + return hashtable; + } + + /** + * 判断字符串是否为数字 + * + * @param str + * @return + */ + private static boolean isStrNum(String str) { + Pattern pattern = compile("[0-9]*"); + Matcher isNum = pattern.matcher(str); + if (isNum.matches()) { + return true; + } else { + return false; + } + } + + /** + * 判断字符串是否为日期格式 + * + * @param strDate + * @return + */ + public static boolean isStrDate(String strDate) { + Pattern pattern = compile("^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s(((0?[0-9])|([1-2][0-3]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$"); + Matcher m = pattern.matcher(strDate); + if (m.matches()) { + return true; + } else { + return false; + } + } + + + //根据身份证号判断性别 1男2女0未知 + public static String getGender(String idCard) { + String gender = "0"; + if (!IdCardNoValidatorUtils.checkIsIdCardNo(idCard)) { + return gender; + } + if (idCard.length() == 18) { + if (Integer.parseInt(idCard.substring(16).substring(0, 1)) % 2 == 0) { + gender = "2"; + } else { + gender = "1"; + } + } else if (idCard.length() == 15) { + String usex = idCard.substring(14, 15); + if (Integer.parseInt(usex) % 2 == 0) { + gender = "2"; + } else { + gender = "1"; + } + } + return gender; + } + +} + diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index a7c4228a85..29fcae0a44 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -175,6 +175,8 @@ lb://resi-voice-server + lb://data-report-server + diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 7ece7e0123..f8a8c8f75b 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -259,6 +259,15 @@ spring: filters: - StripPrefix=1 - CpAuth=true + #政府端-数据首页 + - id: data-report-server + uri: @gateway.routes.data-report-server.uri@ + order: 28 + predicates: + - Path=${server.servlet.context-path}/data/report/** + filters: + - StripPrefix=1 + - CpAuth=true nacos: discovery: server-addr: @nacos.server-addr@ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java new file mode 100644 index 0000000000..88d4f44c78 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java @@ -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 = "已关闭"; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/form/IssueIncrtrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/form/IssueIncrtrendFormDTO.java new file mode 100644 index 0000000000..b4577b2811 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/form/IssueIncrtrendFormDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueDataDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueDataDTO.java new file mode 100644 index 0000000000..961727e31c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueDataDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueIncrtrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueIncrtrendResultDTO.java new file mode 100644 index 0000000000..d63d332a9b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueIncrtrendResultDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubAgencyResultDTO.java new file mode 100644 index 0000000000..c401d5ecc4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubAgencyResultDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubGridResultDTO.java new file mode 100644 index 0000000000..3313f0a8e7 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubGridResultDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryInfoResultDTO.java new file mode 100644 index 0000000000..c53707c0a1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryInfoResultDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryPieResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryPieResultDTO.java new file mode 100644 index 0000000000..f6940edeeb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryPieResultDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java new file mode 100644 index 0000000000..7a50f4afb0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java @@ -0,0 +1,17 @@ +package com.epmet.project.constant; + +/** + * @Author sun + * @Description 数据-项目 + **/ +public interface ProjectConstant { + + String DATE = "date"; + String MONTH = "month"; + + /** + * 根据Token获取组织信息失败 + */ + String GET_AGENCYID = "根据Token获取组织信息失败"; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/FactAgencyProjectDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/FactAgencyProjectDailyDTO.java new file mode 100644 index 0000000000..ab608a0184 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/FactAgencyProjectDailyDTO.java @@ -0,0 +1,182 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectIncrTrendFormDTO.java new file mode 100644 index 0000000000..a7364cfac9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectIncrTrendFormDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectIncrTrendResultDTO.java new file mode 100644 index 0000000000..b53b2a9f14 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectIncrTrendResultDTO.java @@ -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; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubAgencyResultDTO.java new file mode 100644 index 0000000000..31d25fe6bb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubAgencyResultDTO.java @@ -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; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubGridResultDTO.java new file mode 100644 index 0000000000..19f1632be0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubGridResultDTO.java @@ -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; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java new file mode 100644 index 0000000000..e371fce1f5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @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%小数点后两位) + */ + private String ratio; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java new file mode 100644 index 0000000000..0223644b78 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @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; + + /** + * 处理中占比 + */ + private String pendingRatio; + + /** + * 已结案总数 + */ + private Integer closedTotal; + + /** + * 已结案占比 + */ + private String closedRatio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/form/TagFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/form/TagFormDTO.java new file mode 100644 index 0000000000..8b52307d91 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/form/TagFormDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java new file mode 100644 index 0000000000..766a95393a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +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; + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/constant/TopicConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/constant/TopicConstant.java new file mode 100644 index 0000000000..62c27f4b55 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/constant/TopicConstant.java @@ -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"; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/form/TopicIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/form/TopicIncrTrendFormDTO.java new file mode 100644 index 0000000000..2eecf2de34 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/form/TopicIncrTrendFormDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicIncrTrendResultDTO.java new file mode 100644 index 0000000000..24e3eae7bc --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicIncrTrendResultDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicShiftedCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicShiftedCountResultDTO.java new file mode 100644 index 0000000000..99b84d913f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicShiftedCountResultDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicStatusResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicStatusResultDTO.java new file mode 100644 index 0000000000..c22ebd7176 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicStatusResultDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java new file mode 100644 index 0000000000..87dd107010 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java new file mode 100644 index 0000000000..64cad1615c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java new file mode 100644 index 0000000000..3112df3356 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java new file mode 100644 index 0000000000..6f14a45fd5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java @@ -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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserIncrTrendFormDTO.java new file mode 100644 index 0000000000..3267d88ac7 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserIncrTrendFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.user.form; + +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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubAgencyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubAgencyFormDTO.java new file mode 100644 index 0000000000..1116bc33b0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubAgencyFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.user.form; + +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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubGridFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubGridFormDTO.java new file mode 100644 index 0000000000..6a19060ae5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubGridFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.user.form; + +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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSummaryInfoFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSummaryInfoFormDTO.java new file mode 100644 index 0000000000..3a25b4ac24 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSummaryInfoFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.user.form; + +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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserIncrTrendResultDTO.java new file mode 100644 index 0000000000..38436e3533 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserIncrTrendResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.user.result; + +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; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubAgencyResultDTO.java new file mode 100644 index 0000000000..f1552b799c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubAgencyResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.user.result; + +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; + + @JsonIgnore + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubGridResultDTO.java new file mode 100644 index 0000000000..bf0df3cd4e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubGridResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.user.result; + +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; + + @JsonIgnore + private String gridId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java new file mode 100644 index 0000000000..f745321971 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.user.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户汇总信息 返参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 String warmHeartedTotal; + + /** + * 热心居民占比 + */ + private String warmHeartedProportion; + + @JsonIgnore + private String id; +} diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index d6dd66a273..d0933af706 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -112,7 +112,7 @@ 123456 - false + true 122.152.200.70:8848 fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java index 49581cf63c..7d4ff2d7d4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -21,7 +21,7 @@ import javax.servlet.http.HttpServletRequest; public class RequestLogAspect extends BaseRequestLogAspect { @Override - @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") + @Around(value = "execution(* com.epmet.controller.*.*Controller*.*(..)) ") public Object proceed(ProceedingJoinPoint point) throws Throwable { return super.proceed(point, getRequest()); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/IssueController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/IssueController.java new file mode 100644 index 0000000000..39b61b637a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/IssueController.java @@ -0,0 +1,95 @@ +package com.epmet.module.issue.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.issue.dto.form.IssueIncrtrendFormDTO; +import com.epmet.issue.dto.result.*; +import com.epmet.module.issue.service.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 + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("summaryinfo") + public Result getSummaryInfo(@LoginUser TokenDto tokenDto) { + return new Result().ok(issueService.getSummaryInfo(tokenDto)); + } + + /** + * 数据汇总饼状图 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("summarypie") + public Result> getSummaryPie(@LoginUser TokenDto tokenDto) { + return new Result>().ok(issueService.getSummaryPie(tokenDto)); + } + + /** + * 下级机关议题统计 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("subagency") + public Result> getSubAgency(@LoginUser TokenDto tokenDto) { + return new Result>().ok(issueService.getSubAgency(tokenDto)); + } + + /** + * 网格议题统计 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("subgrid") + public Result> getSubGrid(@LoginUser TokenDto tokenDto) { + return new Result>().ok(issueService.getSubGrid(tokenDto)); + } + + /** + * 议题分析 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("incrtrend") + public Result> getIncrtrend(@LoginUser TokenDto tokenDto, @RequestBody IssueIncrtrendFormDTO formDTO) { + return new Result>().ok(issueService.getIncrtrend(tokenDto, formDTO)); + } + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/IssueDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/IssueDao.java new file mode 100644 index 0000000000..bd530dd616 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/IssueDao.java @@ -0,0 +1,60 @@ +package com.epmet.module.issue.dao; + +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 + */ + List selectSubAgencyList(@Param("agencyId") String agencyId); + + /** + * 获取机关下网格统计信息 + * @author zhaoqifeng + * @date 2020/6/22 15:21 + * @param agencyId + * @return java.util.List + */ + List selectGridList(@Param("agencyId") String agencyId); + + /** + * 获取当前机关日增量 + * @author zhaoqifeng + * @date 2020/6/22 15:22 + * @param agencyId + * @return java.util.List + */ + List selectAgencyIncDailyList(@Param("agencyId") String agencyId); + + /** + * 获取当前机关月增量 + * @author zhaoqifeng + * @date 2020/6/22 15:23 + * @param agencyId + * @return java.util.List + */ + List selectAgencyIncMonthlyList(@Param("agencyId") String agencyId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/IssueService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/IssueService.java new file mode 100644 index 0000000000..410930bffe --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/IssueService.java @@ -0,0 +1,65 @@ +package com.epmet.module.issue.service; + +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 getSummaryPie(TokenDto tokenDto); + + /** + * 下级机关 + * + * @param tokenDto + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/22 16:40 + */ + List getSubAgency(TokenDto tokenDto); + + /** + * 网格 + * + * @param tokenDto + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/22 16:41 + */ + List getSubGrid(TokenDto tokenDto); + + /** + * 议题分析 + * + * @param tokenDto + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/22 16:41 + */ + List getIncrtrend(TokenDto tokenDto, IssueIncrtrendFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/impl/IssueServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/impl/IssueServiceImpl.java new file mode 100644 index 0000000000..562cfc25fc --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/impl/IssueServiceImpl.java @@ -0,0 +1,172 @@ +package com.epmet.module.issue.service.impl; + +import com.epmet.commons.tools.security.dto.TokenDto; +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.module.issue.dao.IssueDao; +import com.epmet.module.issue.service.IssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +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 getSummaryPie(TokenDto tokenDto) { + List 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 getSubAgency(TokenDto tokenDto) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + List 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 getSubGrid(TokenDto tokenDto) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + List 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 getIncrtrend(TokenDto tokenDto, IssueIncrtrendFormDTO formDTO) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + List 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) { + return data.stripTrailingZeros().toString().concat("%"); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java new file mode 100644 index 0000000000..e0a1e26fb3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java @@ -0,0 +1,76 @@ +package com.epmet.module.project.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.module.project.service.ProjectService; +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 projectSummary(@LoginUser TokenDto tokenDto) { + return new Result().ok(projectService.getProjectSummary(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据 + **/ + @PostMapping("summaryinfo") + public Result> summaryInfo(@LoginUser TokenDto tokenDto) { + return new Result>().ok(projectService.getSummaryInfo(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-获取下级组织柱状图数据 + **/ + @PostMapping("subagency") + public Result> subAgency(@LoginUser TokenDto tokenDto) { + return new Result>().ok(projectService.getSubAgency(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-获取机关直属网格项目数据 + **/ + @PostMapping("subgrid") + public Result> subGrid(@LoginUser TokenDto tokenDto) { + return new Result>().ok(projectService.getSubGrid(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-日/月数据查询 + **/ + @PostMapping("incrtrend") + public Result> incrTrend(@LoginUser TokenDto tokenDto, @RequestBody ProjectIncrTrendFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ProjectIncrTrendFormDTO.ProjectIncr.class); + return new Result>().ok(projectService.getProjectIncrTrend(tokenDto,formDTO)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/ProjectDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/ProjectDao.java new file mode 100644 index 0000000000..09bb4293f0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/ProjectDao.java @@ -0,0 +1,58 @@ +package com.epmet.module.project.dao; + +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 selectSummaryInfo(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 查询组织最近日期的日统计数据 + **/ + FactAgencyProjectDailyDTO selectAgencyProjectDaily(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 数据-项目-获取最近日期下级组织柱状图数据(按项目总量降序) + **/ + List selectSubAgency(FactAgencyProjectDailyDTO agencyProjectDailyDTO); + + /** + * @Author sun + * @Description 查询机关下直属网格最近一天的日统计数据,按项目总数降序 + **/ + List selectSubGrid(FactAgencyProjectDailyDTO agencyProjectDailyDTO); + + /** + * @Author sun + * @Description 查询机关日统计近九十天数据 + **/ + List selectIncrTrendDaily(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 查询机关月统计近十二个月数据 + **/ + List selectIncrTrendMonthly(@Param("agencyId") String agencyId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/ProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/ProjectService.java new file mode 100644 index 0000000000..baa6e664e0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/ProjectService.java @@ -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 getSummaryInfo(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-获取下级组织柱状图数据 + **/ + List getSubAgency(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-获取机关直属网格项目数据 + **/ + List getSubGrid(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-日/月数据查询 + **/ + List getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java new file mode 100644 index 0000000000..502f613d1c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java @@ -0,0 +1,150 @@ +package com.epmet.module.project.service.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.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.module.project.dao.ProjectDao; +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.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) { + resultDTO.setPendingRatio(resultDTO.getPendingRatio() + "%"); + resultDTO.setClosedRatio(resultDTO.getClosedRatio() + "%"); + } + return resultDTO; + } + + /** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据 + **/ + @Override + public List getSummaryInfo(TokenDto tokenDto) { + List resultList = new ArrayList<>(); + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:根据agencyId查询各状态统计数据 + resultList = projectDao.selectSummaryInfo(agencyId); + if (null != resultList && resultList.size() > NumConstant.ZERO) { + resultList.forEach(sum -> { + sum.setRatio(sum.getRatio() + "%"); + }); + } + return resultList; + } + + /** + * @Author sun + * @Description 数据-项目-获取下级组织柱状图数据 + **/ + @Override + public List getSubAgency(TokenDto tokenDto) { + List 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 getSubGrid(TokenDto tokenDto) { + List 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 getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO) { + List 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 null; + } + + /** + * @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; + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/controller/PublicityController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/controller/PublicityController.java new file mode 100644 index 0000000000..3fea38b5f0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/controller/PublicityController.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.controller; + +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.module.publicity.service.PublicityService; +import com.epmet.publicity.dto.form.TagFormDTO; +import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +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;// + + + /** + * @param tokenDTO + * @return + * @Author jyy + * @Description 宣传能力—工作端—当前机关累计发文和当前发文 + **/ + @PostMapping("summaryinfo") + public Result summaryInfo(@LoginUser TokenDto tokenDto) { + return new Result().ok(publicityService.summaryInfo(tokenDto)); + } + + /** + * @param tokenDto + * @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 + * @author jyy + */ + @PostMapping("tagviewed") + public Result> 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>().ok(publicityService.tagviewed(tokenDto, pageSize, type)); + } + + /** + * @param tokenDto + * @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 + * @author jyy + */ + @PostMapping("tagused") + public Result> 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>().ok(publicityService.tagused(tokenDto, pageSize, type)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedAgencyDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedAgencyDailyDao.java new file mode 100644 index 0000000000..283613c4e5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedAgencyDailyDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; +import com.epmet.entity.FactArticlePublishedAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactArticlePublishedAgencyDailyDao extends BaseDao { + + /** + * @Description 宣传能力—工作端—当前机关累计发文和当前发文 + * @param agencyId + * @author jyy + */ + FactArticlePublishedAgencyDailyDTO summaryInfo(@Param("agencyId") String agencyId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedDepartmentDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedDepartmentDailyDao.java new file mode 100644 index 0000000000..15ada3b211 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedDepartmentDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactArticlePublishedDepartmentDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactArticlePublishedDepartmentDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedGridDailyDao.java new file mode 100644 index 0000000000..d96cc5747a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedGridDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactArticlePublishedGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactArticlePublishedGridDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyMonthlyDao.java new file mode 100644 index 0000000000..636ac8d8dc --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyMonthlyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +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 FactTagUsedAgencyMonthlyDao { + /** + * @param agencyId monthId + * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 + * @author zxc + */ + List getMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyQuarterlyDao.java new file mode 100644 index 0000000000..e849870793 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyQuarterlyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +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 FactTagUsedAgencyQuarterlyDao { + /** + * @param agencyId monthId + * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 + * @author zxc + */ + List getQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyYearlyDao.java new file mode 100644 index 0000000000..9325b0d600 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyYearlyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +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 FactTagUsedAgencyYearlyDao { + /** + * @param agencyId monthId + * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 + * @author zxc + */ + List getYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyDailyDao.java new file mode 100644 index 0000000000..d45797f0a1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactTagViewedAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagViewedAgencyDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyMonthlyDao.java new file mode 100644 index 0000000000..a5945654cf --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyMonthlyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +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 FactTagViewedAgencyMonthlyDao { + /** + * @param agencyId monthId + * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 + * @author zxc + */ + List getMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyQuarterlyDao.java new file mode 100644 index 0000000000..f546706569 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyQuarterlyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +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 FactTagViewedAgencyQuarterlyDao { + /** + * @param agencyId monthId + * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 + * @author zxc + */ + List getQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyYearlyDao.java new file mode 100644 index 0000000000..de6bd638ca --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyYearlyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +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 FactTagViewedAgencyYearlyDao { + /** + * @param agencyId monthId + * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 + * @author zxc + */ + List getYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridDailyDao.java new file mode 100644 index 0000000000..eeac2a8100 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactTagViewedGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagViewedGridDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridMonthlyDao.java new file mode 100644 index 0000000000..3336e1460b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactTagViewedGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagViewedGridMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridQuarterlyDao.java new file mode 100644 index 0000000000..e91e66f5ef --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridQuarterlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactTagViewedGridQuarterlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagViewedGridQuarterlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridYearlyDao.java new file mode 100644 index 0000000000..380e7a4301 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridYearlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.FactTagViewedGridYearlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Mapper +public interface FactTagViewedGridYearlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedAgencyDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedAgencyDailyEntity.java new file mode 100644 index 0000000000..680ae4d86a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedAgencyDailyEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_article_published_agency_daily") +public class FactArticlePublishedAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedDepartmentDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedDepartmentDailyEntity.java new file mode 100644 index 0000000000..45d10f9b8d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedDepartmentDailyEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_article_published_department_daily") +public class FactArticlePublishedDepartmentDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布文章单位所属机关ID 发布文章单位所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedGridDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedGridDailyEntity.java new file mode 100644 index 0000000000..93f9a4568c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedGridDailyEntity.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_article_published_grid_daily") +public class FactArticlePublishedGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布单位所属机关ID 发布单位所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyDailyEntity.java new file mode 100644 index 0000000000..b020f7454f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyDailyEntity.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_daily") +public class FactTagViewedAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyMonthlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyMonthlyEntity.java new file mode 100644 index 0000000000..f0125e67c6 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyMonthlyEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_monthly") +public class FactTagViewedAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyQuarterlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyQuarterlyEntity.java new file mode 100644 index 0000000000..de60b9198b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyQuarterlyEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_quarterly") +public class FactTagViewedAgencyQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyYearlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyYearlyEntity.java new file mode 100644 index 0000000000..2cc0d5bfac --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyYearlyEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_yearly") +public class FactTagViewedAgencyYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridDailyEntity.java new file mode 100644 index 0000000000..16b6702ba1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridDailyEntity.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_daily") +public class FactTagViewedGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridMonthlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridMonthlyEntity.java new file mode 100644 index 0000000000..36898a2ef7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridMonthlyEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_monthly") +public class FactTagViewedGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridQuarterlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridQuarterlyEntity.java new file mode 100644 index 0000000000..ea8fb00ce4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridQuarterlyEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_quarterly") +public class FactTagViewedGridQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridYearlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridYearlyEntity.java new file mode 100644 index 0000000000..b4adaff236 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridYearlyEntity.java @@ -0,0 +1,76 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_yearly") +public class FactTagViewedGridYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/PublicityService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/PublicityService.java new file mode 100644 index 0000000000..ad9114849b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/PublicityService.java @@ -0,0 +1,56 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; +import com.epmet.publicity.dto.result.FactTagAgencyDTO; + +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 + */ + FactArticlePublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto); + + /** + * @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 + * @param tokenDto,formDTO + * @author jyy + */ + public List tagviewed(TokenDto tokenDto, Integer pageSize, String type) ; + + /** + * @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 + * @param tokenDto,pageSize,type + * @author jyy + */ + public List tagused(TokenDto tokenDto, Integer pageSize, String type) ; + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/impl/PublicityServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/impl/PublicityServiceImpl.java new file mode 100644 index 0000000000..6beebc0604 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/impl/PublicityServiceImpl.java @@ -0,0 +1,151 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.module.publicity.service.impl; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.module.publicity.dao.FactArticlePublishedAgencyDailyDao; +import com.epmet.module.publicity.dao.FactTagViewedAgencyMonthlyDao; +import com.epmet.module.publicity.dao.FactTagViewedAgencyQuarterlyDao; +import com.epmet.module.publicity.dao.FactTagViewedAgencyYearlyDao; + +import com.epmet.module.publicity.service.PublicityService; +import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; + +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +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 FactArticlePublishedAgencyDailyDao factArticlePublishedAgencyDailyDao;//机关每日发文 + @Autowired + private FactTagViewedAgencyMonthlyDao factTagViewedAgencyMonthlyDao;//机关-每月-阅读 + @Autowired + private FactTagViewedAgencyQuarterlyDao factTagViewedAgencyQuarterlyDao;//机关-每季度-阅读 + @Autowired + private FactTagViewedAgencyYearlyDao factTagViewedAgencyYearlyDao;//机关-每年-阅读 + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @param tokenDto + * @Description 宣传能力—工作端—当前机关累计发文和当前发文 + * @author jyy + */ + @Override + public FactArticlePublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + return factArticlePublishedAgencyDailyDao.summaryInfo(agencyId); + } + + + /** + * @param tokenDto,formDTO + * @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 + * @author jyy + */ + @Override + public List 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 factTagViewedAgencyMonthlyDao.getMonthlyCountByTag(agencyId, monthId, pageSize); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date); + return factTagViewedAgencyQuarterlyDao.getQuarterlyCountByTag(agencyId, quarterId, pageSize); + + } else if (StringUtils.equals("year", type)) {//当年 + + return factTagViewedAgencyYearlyDao.getYearlyCountByTag(agencyId, yearId, pageSize); + + } else { + return null; + } + + + } + + /** + * @param tokenDto,pageSize,type + * @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 + * @author jyy + */ + @Override + public List 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 factTagViewedAgencyMonthlyDao.getMonthlyCountByTag(agencyId, monthId, pageSize); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date); + return factTagViewedAgencyQuarterlyDao.getQuarterlyCountByTag(agencyId, quarterId, pageSize); + + } else if (StringUtils.equals("year", type)) {//当年 + + return factTagViewedAgencyYearlyDao.getYearlyCountByTag(agencyId, yearId, pageSize); + + } 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(); + } + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/TopicController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/TopicController.java new file mode 100644 index 0000000000..44e058cf14 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/TopicController.java @@ -0,0 +1,81 @@ +package com.epmet.module.topic.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.module.topic.service.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 topicSummary(@LoginUser TokenDto tokenDto){ + return new Result().ok(topicService.topicSummary(tokenDto)); + } + + /** + * @Description 话题——话题分析 + * @param tokenDto + * @param formDTO + * @author zxc + */ + @PostMapping("incrtrend") + public Result> topicIncrTrend(@LoginUser TokenDto tokenDto, @RequestBody TopicIncrTrendFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, TopicIncrTrendFormDTO.TopicIncr.class); + return new Result>().ok(topicService.topicIncrTrend(tokenDto,formDTO)); + } + + /** + * @Description 话题——直属网格话题数 + * @param tokenDto + * @author zxc + */ + @PostMapping("subgrid") + public Result> topicSubGrid(@LoginUser TokenDto tokenDto){ + return new Result>().ok(topicService.topicSubGrid(tokenDto)); + } + + /** + * @Description 话题——下级机关话题数 + * @param tokenDto + * @author zxc + */ + @PostMapping("subagency") + public Result> topicSubAgency(@LoginUser TokenDto tokenDto){ + return new Result>().ok(topicService.topicSubAgency(tokenDto)); + } + + /** + * @Description 话题——话题分析表 + * @param tokenDto + * @author zxc + */ + @PostMapping("summaryinfo") + public Result> topicSummaryInfo(@LoginUser TokenDto tokenDto){ + return new Result>().ok(topicService.topicSummaryInfo(tokenDto)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/TopicDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/TopicDao.java new file mode 100644 index 0000000000..9ea7f8d631 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/TopicDao.java @@ -0,0 +1,108 @@ +package com.epmet.module.topic.dao; + +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 getTopicStatus(@Param("agencyId")String agencyId); + + /** + * @Description 获取机关下已转议题数量 + * @param agencyId + * @author zxc + */ + TopicShiftedCountResultDTO getShiftedCount(@Param("agencyId")String agencyId); + + /** + * @Description 获取话题信息(状态,数量,百分比) + * @param agencyId + * @author zxc + */ + List topicSummaryInfo(@Param("agencyId")String agencyId); + + /** + * @Description 根据当前机关判断是否有下级机关 + * @param agencyId + * @author zxc + */ + List getSubAgencyIdList(@Param("agencyId")String agencyId); + + /** + * @Description 获取最后一天的所有话题数据 【fact_topic_status_agency_daily】 + * @param + * @author zxc + */ + List getAllTopicInfoLastDay(); + + /** + * @Description 获取最后一天的所有话题已转议题数据 + * @param + * @author zxc + */ + List getAllTopicShiftedInfoLastDay(); + + /** + * @Description 校验机关下是否存在直属网格 + * @param agencyId + * @author zxc + */ + List getSubGridIdList(@Param("agencyId")String agencyId); + + /** + * @Description 获取最后一天的所有话题数据 【fact_topic_status_grid_daily】【grid】 + * @param + * @author zxc + */ + List getGridAllTopicInfoLastDay(); + + /** + * @Description 获取最后一天的所有话题已转议题数据【grid】 + * @param + * @author zxc + */ + List getGridAllTopicShiftedInfoLastDay(); + + /** + * @Description 话题日增长 + * @param agencyId + * @author zxc + */ + List getTopicIncrDaily(@Param("agencyId") String agencyId); + + /** + * @Description 话题转议题日增长 + * @param agencyId + * @author zxc + */ + List getTopicShiftedIncrDaily(@Param("agencyId") String agencyId); + + /** + * @Description 话题月增长 + * @param agencyId + * @author zxc + */ + List getTopicIncrMonthly(@Param("agencyId") String agencyId); + + /** + * @Description 话题转议题月增长 + * @param agencyId + * @author zxc + */ + List getTopicShiftedIncrMonthly(@Param("agencyId") String agencyId); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/TopicService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/TopicService.java new file mode 100644 index 0000000000..1bf2b6d9c3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/TopicService.java @@ -0,0 +1,51 @@ +package com.epmet.module.topic.service; + +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 topicIncrTrend(TokenDto tokenDto, TopicIncrTrendFormDTO formDTO); + + /** + * @Description 话题——直属网格话题数 + * @param tokenDto + * @author zxc + */ + List topicSubGrid( TokenDto tokenDto); + + /** + * @Description 话题——下级机关话题数 + * @param tokenDto + * @author zxc + */ + List topicSubAgency(TokenDto tokenDto); + + /** + * @Description 话题——话题分析表 + * @param tokenDto + * @author zxc + */ + List topicSummaryInfo(TokenDto tokenDto); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/impl/TopicServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/impl/TopicServiceImpl.java new file mode 100644 index 0000000000..a66659396f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/impl/TopicServiceImpl.java @@ -0,0 +1,182 @@ +package com.epmet.module.topic.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.module.topic.dao.TopicDao; +import com.epmet.module.topic.service.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 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 topicIncrTrend(TokenDto tokenDto, TopicIncrTrendFormDTO formDTO) { + String agencyId = this.getLoginUserDetails(tokenDto); + List result = new ArrayList<>(); + if (formDTO.getType().equals(TopicConstant.DATE)){ + List topicIncrDaily = topicDao.getTopicIncrDaily(agencyId); + List topicShiftedIncrDaily = topicDao.getTopicShiftedIncrDaily(agencyId); + topicIncrDaily.addAll(topicShiftedIncrDaily); + result = topicIncrDaily.stream().sorted(Comparator.comparing(TopicIncrTrendResultDTO::getDate).reversed()).collect(Collectors.toList()); + }else { + List topicIncrMonthly = topicDao.getTopicIncrMonthly(agencyId); + List 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 topicSubGrid(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + List result = new ArrayList<>(); + List subGridIdList = topicDao.getSubGridIdList(agencyId); + if (subGridIdList.size() != NumConstant.ZERO){ + List gridAllTopicInfoLastDay = topicDao.getGridAllTopicInfoLastDay(); + List 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 topicSubAgency(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + List result = new ArrayList<>(); + List subAgencyIdList = topicDao.getSubAgencyIdList(agencyId); + //存在下级机关 + if (subAgencyIdList.size() != NumConstant.ZERO){ + List allTopicInfoLastDay = topicDao.getAllTopicInfoLastDay(); + List 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 topicSummaryInfo(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + List 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(); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/UserController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/UserController.java new file mode 100644 index 0000000000..795d3cd8b9 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/UserController.java @@ -0,0 +1,88 @@ +package com.epmet.module.user.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.module.user.service.UserService; +import com.epmet.user.form.UserIncrTrendFormDTO; +import com.epmet.user.form.UserSubAgencyFormDTO; +import com.epmet.user.form.UserSubGridFormDTO; +import com.epmet.user.form.UserSummaryInfoFormDTO; +import com.epmet.user.result.UserIncrTrendResultDTO; +import com.epmet.user.result.UserSubAgencyResultDTO; +import com.epmet.user.result.UserSubGridResultDTO; +import com.epmet.user.result.UserSummaryInfoResultDTO; +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; + +/** + * 组织能力用户相关接口入口 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 13:22 + */ +@RestController +@RequestMapping("user") +public class UserController { + @Autowired + private UserService userService; + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 用户汇总信息查询 + * @Date 2020/6/22 13:27 + **/ + @PostMapping("summaryinfo") + public Result summaryInfo(@RequestBody UserSummaryInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + UserSummaryInfoResultDTO userSummaryInfoResultDTO = userService.summaryInfo(formDTO); + return new Result().ok(userSummaryInfoResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 直属机关柱状图查询 + * @Date 2020/6/22 13:30 + **/ + @PostMapping("subagency") + public Result subAgency(@RequestBody UserSubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + UserSubAgencyResultDTO userSubAgencyResultDTO = userService.subAgency(formDTO); + return new Result().ok(userSubAgencyResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 直属网格柱状图查询 + * @Date 2020/6/22 13:33 + **/ + @PostMapping("subgrid") + public Result subGrid(@RequestBody UserSubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + UserSubGridResultDTO userSubGridResultDTO = userService.subGrid(formDTO); + return new Result().ok(userSubGridResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 按日、按月查询注册用户数(参与用户数)增量折线图 + * @Date 2020/6/22 13:36 + **/ + @PostMapping("incrtrend") + public Result incrTrend(@RequestBody UserIncrTrendFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + UserIncrTrendResultDTO userIncrTrendResultDTO = userService.incrTrend(formDTO); + return new Result().ok(userIncrTrendResultDTO); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/UserService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/UserService.java new file mode 100644 index 0000000000..4d0f812b72 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/UserService.java @@ -0,0 +1,54 @@ +package com.epmet.module.user.service; + +import com.epmet.user.form.UserIncrTrendFormDTO; +import com.epmet.user.form.UserSubAgencyFormDTO; +import com.epmet.user.form.UserSubGridFormDTO; +import com.epmet.user.form.UserSummaryInfoFormDTO; +import com.epmet.user.result.UserIncrTrendResultDTO; +import com.epmet.user.result.UserSubAgencyResultDTO; +import com.epmet.user.result.UserSubGridResultDTO; +import com.epmet.user.result.UserSummaryInfoResultDTO; + +/** + * 组织能力用户相关接口 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 13:23 + */ +public interface UserService { + /** + * @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 + **/ + UserSubAgencyResultDTO subAgency(UserSubAgencyFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.user.result.UserSubGridResultDTO + * @author yinzuomei + * @description 直属网格柱状图查询 + * @Date 2020/6/22 13:42 + **/ + UserSubGridResultDTO subGrid(UserSubGridFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.user.result.UserIncrTrendResultDTO + * @author yinzuomei + * @description 按日、按月查询注册用户数(参与用户数)增量折线图 + * @Date 2020/6/22 13:42 + **/ + UserIncrTrendResultDTO incrTrend(UserIncrTrendFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/impl/UserServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/impl/UserServiceImpl.java new file mode 100644 index 0000000000..c155265090 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/impl/UserServiceImpl.java @@ -0,0 +1,110 @@ +package com.epmet.module.user.service.impl; + +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.module.user.service.UserService; +import com.epmet.user.form.UserIncrTrendFormDTO; +import com.epmet.user.form.UserSubAgencyFormDTO; +import com.epmet.user.form.UserSubGridFormDTO; +import com.epmet.user.form.UserSummaryInfoFormDTO; +import com.epmet.user.result.UserIncrTrendResultDTO; +import com.epmet.user.result.UserSubAgencyResultDTO; +import com.epmet.user.result.UserSubGridResultDTO; +import com.epmet.user.result.UserSummaryInfoResultDTO; +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; + +/** + * 组织能力用户相关接口 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 13:23 + */ +@Service +public class UserServiceImpl implements UserService { + private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class); + @Autowired + private LoginUserUtil loginUserUtil; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @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 result=epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO); + if(!result.success()){ + throw new RenException("查询用户所属组织信息失败"); + } + if(result.success()){ + if (null == result.getData() || StringUtils.isBlank(result.getData().getAgencyId())) { + throw new RenException("查询用户所属组织信息失败"); + } + } + 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) { + String myAgencyId=this.getMyAgency(); + //TODO + return null; + } + + /** + * @param formDTO + * @return com.epmet.user.result.UserSubAgencyResultDTO + * @author yinzuomei + * @description 直属机关柱状图查询 + * @Date 2020/6/22 13:42 + **/ + @Override + public UserSubAgencyResultDTO subAgency(UserSubAgencyFormDTO formDTO) { + return null; + } + + /** + * @param formDTO + * @return com.epmet.user.result.UserSubGridResultDTO + * @author yinzuomei + * @description 直属网格柱状图查询 + * @Date 2020/6/22 13:42 + **/ + @Override + public UserSubGridResultDTO subGrid(UserSubGridFormDTO formDTO) { + return null; + } + + /** + * @param formDTO + * @return com.epmet.user.result.UserIncrTrendResultDTO + * @author yinzuomei + * @description 按日、按月查询注册用户数(参与用户数)增量折线图 + * @Date 2020/6/22 13:42 + **/ + @Override + public UserIncrTrendResultDTO incrTrend(UserIncrTrendFormDTO formDTO) { + return null; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml new file mode 100644 index 0000000000..cde009a097 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -0,0 +1,164 @@ + + + + + + + + + + ${appname} + + + + + + + + + debug + + + ${CONSOLE_LOG_PATTERN} + + UTF-8 + + + + + + + + ${log.path}/debug.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/debug-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + debug + ACCEPT + DENY + + + + + + + ${log.path}/info.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + + ${log.path}/info-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + info + ACCEPT + DENY + + + + + + + ${log.path}/warn.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/warn-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + warn + ACCEPT + DENY + + + + + + + ${log.path}/error.log + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%contextName] [%thread] %-5level %logger{50} - %msg%n + UTF-8 + + + + ${log.path}/error-%d{yyyy-MM-dd}.%i.log + + 100MB + + + 15 + + + + ERROR + ACCEPT + DENY + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml new file mode 100644 index 0000000000..d558e62d86 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml new file mode 100644 index 0000000000..ac9ecd9ad6 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedAgencyDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedAgencyDailyDao.xml new file mode 100644 index 0000000000..a7ba0a5ed8 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedAgencyDailyDao.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml new file mode 100644 index 0000000000..fce52d3311 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml new file mode 100644 index 0000000000..cace8fc645 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml new file mode 100644 index 0000000000..f4806e8e40 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml new file mode 100644 index 0000000000..9c10faf1b1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml new file mode 100644 index 0000000000..3384db1368 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml new file mode 100644 index 0000000000..10653c3bb5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml new file mode 100644 index 0000000000..937da74e63 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml new file mode 100644 index 0000000000..5ff395280d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml new file mode 100644 index 0000000000..e0b274080d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml new file mode 100644 index 0000000000..b03b85f2bf --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml new file mode 100644 index 0000000000..870ed21e7d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml new file mode 100644 index 0000000000..4e08735106 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml new file mode 100644 index 0000000000..03bf9a4f3b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml new file mode 100644 index 0000000000..78aca74a1c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java index 32c14a94a9..ec00bcc11f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java @@ -19,6 +19,11 @@ public class AgencyMonthlyFormDTO implements Serializable { */ private String id; + /** + * 客户ID + */ + private String customerId; + /** * 机关ID */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java index b3d731a8d3..a6c73d386f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java @@ -27,4 +27,9 @@ public class GridGroupPeopleFormDTO implements Serializable { * 人员状态 */ private String status = "removed"; + + /** + * dateID + */ + private String dateId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java index 637f10be08..b36204f1b0 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java @@ -27,4 +27,9 @@ public class GridGroupPeopleTotalFormDTO implements Serializable { * 人员状态 */ private String status = "removed"; + + /** + * dateID + */ + private String dateId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java index 3e97445cea..f39002e5ad 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java @@ -22,4 +22,9 @@ public class GridGroupTotalFormDTO implements Serializable { * 小组状态 */ private String state = "approved"; + + /** + * dateID + */ + private String dateId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java index 6d6e981037..79ac84ff44 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java @@ -24,7 +24,7 @@ public class GroupIncrFormDTO implements Serializable { private String customerId; /** - * 日期(昨日) + * dateID */ - private String yesterday; + private String dateId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java index 3858767dda..139917240b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java @@ -18,6 +18,11 @@ public class AgencyGroupDailyResultDTO implements Serializable { */ private String id; + /** + * 客户ID + */ + private String customerId; + /** * 机构ID */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java index b33c9c38ad..b95bedeb9b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java @@ -18,6 +18,11 @@ public class GroupGridDailyResultDTO implements Serializable { */ private String id; + /** + * 客户ID + */ + private String customerId; + /** * 机构ID 关联机关dim表 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueGridDTO.java new file mode 100644 index 0000000000..de7bacf7a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueGridDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.issue; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/19 13:56 + */ +@Data +public class IssueGridDTO implements Serializable { + private static final long serialVersionUID = 4681179503519406263L; + /** + * 组织ID + */ + private String agencyId; + /** + * 上级ID + */ + private String gridId; + /** + * 状态 + */ + private String status; + /** + * 数量 + */ + private Integer count; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectDTO.java new file mode 100644 index 0000000000..5381b77c8a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.issue; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/19 17:28 + */ +@Data +public class IssueProjectDTO implements Serializable { + private static final long serialVersionUID = -6457792985830058324L; + /** + * 议题ID + */ + private String issueId; + /** + * 项目ID + */ + private String projectId; + /** + * 网格ID + */ + private String gridId; + /** + * 状态 + */ + private String status; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectGridDTO.java new file mode 100644 index 0000000000..982bce9a87 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectGridDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/19 16:58 + */ +@Data +public class ProjectGridDTO implements Serializable { + private static final long serialVersionUID = 7176541257563571224L; + /** + * 项目ID + */ + private String projectId; + /** + * 组织ID + */ + private String agencyId; + /** + * 议题ID + */ + private String issueId; + /** + * 状态 + */ + private String status; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java new file mode 100644 index 0000000000..01c9953043 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java @@ -0,0 +1,107 @@ +package feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import feign.impl.DataStatisticalOpenFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * desc: 数据统计 对外feign client + * + * @return: + * @date: 2020/6/22 17:39 + * @author: jianjun liu + */ +@FeignClient(name = ServiceConstant.DATA_STATISTICAL, fallback = DataStatisticalOpenFeignClientFallBack.class) +public interface DataStatisticalOpenFeignClient { + + /** + * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/articleSummaryDailyStatsjob") + Result articleSummaryDailyStatsjob(); + + /** + * desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @return: + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagUsedDailyStatsjob") + Result tagUsedDailyStatsjob(); + + /** + * desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagUsedMonthlyStatsjob") + Result tagUsedMonthlyStatsjob(); + + /** + * desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagUsedQuarterlyStatsjob") + Result tagUsedQuarterlyStatsjob(); + + /** + * desc: 【日】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagViewedDailyStatsjob") + Result tagViewedDailyStatsjob(); + + /** + * desc: 【月】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagViewedMonthlyStatsjob") + Result tagViewedMonthlyStatsjob(); + + /** + * desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagViewedQuarterlyStatsjob") + Result tagViewedQuarterlyStatsjob(); + + /** + * @Description 统计 “网格小组”, dim:【网格-日】 + * @param + * @author zxc + */ + @PostMapping("/data/stats/statsgroup/groupgriddaily") + Result groupGridDaily(); + + /** + * @Description 统计 “网格小组”, dim:【机关-日】 + * @param + * @author zxc + */ + @PostMapping("/data/stats/statsgroup/groupagencydaily") + Result groupAgencyDaily(); + + /** + * @Description 统计 “网格小组”, dim:【机关-月】 + * @param + * @author zxc + */ + @PostMapping("/data/stats/statsgroup/groupagencymonthly") + Result groupAgencyMonthly(); + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java new file mode 100644 index 0000000000..1ccec983eb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -0,0 +1,112 @@ +package feign.impl; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import feign.DataStatisticalOpenFeignClient; +import org.springframework.stereotype.Component; + +/** + * desc: + * + * @return: + * @date: 2020/6/22 9:38 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ +@Component +public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOpenFeignClient { + + /** + * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result articleSummaryDailyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "articleSummaryDailyStatsjob"); + } + + /** + * desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @return: + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedDailyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedDailyStatsjob"); + } + + /** + * desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedMonthlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedMonthlyStatsjob"); + } + + /** + * desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedQuarterlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedQuarterlyStatsjob"); + } + + /** + * desc: 【日】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedDailyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedDailyStatsjob"); + } + + /** + * desc: 【月】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedMonthlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedMonthlyStatsjob"); + } + + /** + * desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedQuarterlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedQuarterlyStatsjob"); + } + + @Override + public Result groupGridDaily() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupGridDaily"); + } + + @Override + public Result groupAgencyDaily() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyDaily"); + } + + @Override + public Result groupAgencyMonthly() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyMonthly"); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 74787dff5d..8bd8f152a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -62,6 +62,12 @@ epmet-commons-dynamic-datasource 2.0.0 + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java index c33979545d..b2f6f399f7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java @@ -1,14 +1,13 @@ package com.epmet.controller; -import com.epmet.commons.tools.constant.NumConstant; import com.epmet.service.StatsGroupService; -import com.epmet.service.stats.DimCustomerService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; -import java.util.List; +import java.util.Date; /** * @Author zxc @@ -20,8 +19,6 @@ public class StatsGroupController { @Autowired private StatsGroupService statsGroupService; - @Autowired - private DimCustomerService dimCustomerService; /** * 网格数、小组数、网格下所有组内人数(不去重) @@ -35,16 +32,8 @@ public class StatsGroupController { * @author zxc */ @PostMapping("groupgriddaily") - public void groupGridDaily(){ - Integer pageNo = NumConstant.ONE; - Integer pageSize = NumConstant.ONE_HUNDRED; - List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); - if (customerIds.size() == NumConstant.ZERO){ - return; - } - customerIds.forEach(customerId -> { - statsGroupService.groupGridDaily(customerId); - }); + public void groupGridDaily(@RequestParam(value = "date",required = false)Date date){ + statsGroupService.groupGridDaily(date); } /** @@ -53,16 +42,8 @@ public class StatsGroupController { * @author zxc */ @PostMapping("groupagencydaily") - public void groupAgencyDaily(){ - Integer pageNo = NumConstant.ONE; - Integer pageSize = NumConstant.ONE_HUNDRED; - List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); - if (customerIds.size() == NumConstant.ZERO){ - return; - } - customerIds.forEach(customerId -> { - statsGroupService.groupAgencyDaily(customerId); - }); + public void groupAgencyDaily(@RequestParam(value = "date",required = false)Date date){ + statsGroupService.groupAgencyDaily(date); } /** @@ -71,8 +52,8 @@ public class StatsGroupController { * @author zxc */ @PostMapping("groupagencymonthly") - public void groupAgencyMonthly(){ - statsGroupService.groupAgencyMonthly(); + public void groupAgencyMonthly(@RequestParam(value = "date",required = false)Date date){ + statsGroupService.groupAgencyMonthly(date); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java new file mode 100644 index 0000000000..850c3b7a75 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java @@ -0,0 +1,33 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsIssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 14:26 + */ +@RequestMapping("statsissue") +@RestController +public class StatsIssueController { + @Autowired + private StatsIssueService statsIssueService; + + /** + * 议题统计 + * @author zhaoqifeng + * @date 2020/6/22 14:28 + * @param + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("issuestats") + public Result agencyGridIssueStats() { + statsIssueService.agencyGridIssueStats(); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java index 7db6e827c0..79ca1d0acf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java @@ -29,9 +29,9 @@ public class StatsPublicityController { * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return */ - @PostMapping(value = "publicitySummaryStatsjob") - public Result publicitySummaryStatsjob(Date statsDate) { - return new Result().ok(statsPublicityService.articlePublishedCountDayStats(statsDate)); + @PostMapping(value = "articleSummaryDailyStatsjob") + public Result articleSummaryDailyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.articleSummaryDailyStatsjob(statsDate)); } /** @@ -40,20 +40,31 @@ public class StatsPublicityController { * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return */ - @PostMapping(value = "tagUsedDayStatsjob") - public Result tagUsedDayStatsjob(Date statsDate) { - return new Result().ok(statsPublicityService.tagUsedDayStatsjob(statsDate)); + @PostMapping(value = "tagUsedDailyStatsjob") + public Result tagUsedDailyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagUsedDailyStatsjob(statsDate)); } /** - * desc:【月】 统计发表文章最多的分类 包含 机关 部门 网格 + * desc:【月,季,年】 统计发表文章最多的分类 包含 机关 部门 网格 * * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return */ - @PostMapping(value = "tagUsedMonthStatsjob") - public Result tagUsedMonthStatsjob(Date statsDate) { - return new Result().ok(statsPublicityService.tagUsedMonthStatsjob(statsDate)); + @PostMapping(value = "tagUsedMonthlyStatsjob") + public Result tagUsedMonthlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagUsedMonthlyStatsjob(statsDate)); + } + + /** + * desc:【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagUsedQuarterlyStatsjob") + public Result tagUsedQuarterlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagUsedQuarterlyStatsjob(statsDate)); } /** @@ -62,9 +73,9 @@ public class StatsPublicityController { * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return */ - @PostMapping(value = "tagViewedDayStatsjob") - public Result tagViewedDayStatsjob(Date statsDate) { - return new Result().ok(statsPublicityService.tagViewedDayStatsjob(statsDate)); + @PostMapping(value = "tagViewedDailyStatsjob") + public Result tagViewedDailyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagViewedDailyStatsjob(statsDate)); } /** @@ -73,8 +84,19 @@ public class StatsPublicityController { * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return */ - @PostMapping(value = "tagViewedMonthStatsjob") - public Result tagViewedMonthStatsjob(Date statsDate) { - return new Result().ok(statsPublicityService.tagViewedMonthStatsjob(statsDate)); + @PostMapping(value = "tagViewedMonthlyStatsjob") + public Result tagViewedMonthlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagViewedMonthlyStatsjob(statsDate)); + } + + /** + * desc:【季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagViewedQuarterlyStatsjob") + public Result tagViewedQuarterlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagViewedQuarterlyStatsjob(statsDate)); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index 5a226cad20..28703e70e9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -50,29 +50,29 @@ public interface GroupDataDao { * @param * @author zxc */ - List getAgencyGroupTotalCount(@Param("allGrid") List allGrid); + List getAgencyGroupTotalCount(@Param("allGrid") List allGrid,@Param("dateId")String dateId); /** * @Description 查询机关下网格内的小组人数 【待优化】 * @param * @author zxc */ - List selectAgencyGridGroupPeopleTotal(@Param("allGrid") List allGrid); + List selectAgencyGridGroupPeopleTotal(@Param("allGrid") List allGrid,@Param("dateId")String dateId); /** * @Description 查询机关下每个小组的人数 【待优化】 * @param * @author zxc */ - List selectAgencyEveryGroupPeopleCount(@Param("allGrid") List allGrid); + List selectAgencyEveryGroupPeopleCount(@Param("allGrid") List allGrid,@Param("dateId")String dateId); /** * @Description 查询机关下的小组日增数 【待优化】 * @param - * @param yesterday + * @param dateId * @author zxc */ - List selectAgencyGroupIncr(@Param("allGrid") List allGrid,@Param("yesterday")String yesterday); + List selectAgencyGroupIncr(@Param("allGrid") List allGrid,@Param("dateId")String dateId); /** * @Description 查询机关下所有网格小组人数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java index 4c23a2d833..98d2e0e96d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java @@ -2,6 +2,8 @@ package com.epmet.dao.issue; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueGridDTO; +import com.epmet.dto.issue.IssueProjectDTO; import com.epmet.entity.issue.IssueEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -59,4 +61,54 @@ public interface StatsIssueDao extends BaseDao { * @Description 根据客户Id查询议题库已转项目的网格项目关系数据 **/ List selectGridProjectList(@Param("customerId") String customerId); + /** + * 获取当前日期网格下议题统计结果 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/17 14:13 + */ + List selectGridIssueTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 获取当前日期网格下议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:55 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 网格已关闭议题统计 + * @author zhaoqifeng + * @date 2020/6/18 14:41 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 网格已关闭议题增量 + * @author zhaoqifeng + * @date 2020/6/18 14:41 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 查询客户下议题和项目关系 + * @author zhaoqifeng + * @date 2020/6/19 17:34 + * @param customerId + * @return java.util.List + */ + List selectIssueProjectList(@Param("customerId") String customerId); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java index 4b2c3621b3..846dde48e8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java @@ -50,4 +50,12 @@ public interface CustomerGridDao extends BaseDao { * @author zxc */ List selectAgencyGridTotalCount(@Param("formDto") List formDto, @Param("dateId")String dateId); + + /** + * @Description 获取客户下某个时间点以前的网格ID + * @param customerId + * @param dateId + * @author zxc + */ + List getCustomerGridIdList(@Param("customerId") String customerId, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 32a67d173e..a50874c99e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectGridDTO; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -60,4 +61,25 @@ public interface ProjectDao extends BaseDao { * @return java.util.List */ List selectAgencyClosedProjectInc(@Param("customerId") String customerId, @Param("date") String date); + + + /** + * 已结案项目统计 + * @author zhaoqifeng + * @date 2020/6/18 17:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridClosedProjectTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 已结案项目增量 + * @author zhaoqifeng + * @date 2020/6/18 17:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridClosedProjectInc(@Param("customerId") String customerId, @Param("date") String date); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java index aaf4312dd9..4a41fe25a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java @@ -48,7 +48,7 @@ public interface FactGroupAgencyDailyDao extends BaseDao getLastDayAgency(); + List getLastDayAgency(@Param("monthId") String monthId); /** * @Description 查询 月的小组增量 @@ -56,5 +56,12 @@ public interface FactGroupAgencyDailyDao extends BaseDao getMonthGroupIncr(@Param("monthId")String monthId); + + /** + * @Description 删除当天已存在数据 + * @param dateId + * @author zxc + */ + void deleteInsertAgencyDailyByDateId(@Param("dateId")String dateId,@Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java index 0e0ed99f21..cf43e681ca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java @@ -40,5 +40,12 @@ public interface FactGroupAgencyMonthlyDao extends BaseDao agencyMonth); + + /** + * @Description 删除已存在的月数据 + * @param monthId + * @author zxc + */ + void deleteInsertAgencyMonthlyByMonthId(@Param("monthId")String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java index 8c1a636d3c..c97f5c8120 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java @@ -40,5 +40,12 @@ public interface FactGroupGridDailyDao extends BaseDao * @author zxc */ void insertGroupGridDaily(@Param("formDto") List formDto); + + /** + * @Description 删除已存在的数据【当天】防止当天数据多条 + * @param dateId + * @author zxc + */ + void deleteInsertDateId(@Param("dateId")String dateId,@Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java index 0621b2526e..acaf6e5d1b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java @@ -18,8 +18,12 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO; import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 组织机关议题数量(按月) @@ -29,5 +33,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactIssueAgencyMonthlyDao extends BaseDao { - + /** + * 统计机关议题各个指标月度增量 + * @author zhaoqifeng + * @date 2020/6/19 10:13 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectAgencyMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java index 6c11e47904..2e9c335661 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java @@ -18,8 +18,12 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.FactIssueGridMonthlyDTO; import com.epmet.entity.stats.FactIssueGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 网格议题数量(按月) @@ -29,5 +33,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactIssueGridMonthlyDao extends BaseDao { - + /** + * 统计网格议题各个指标月度增量 + * @author zhaoqifeng + * @date 2020/6/19 10:41 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectGridMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java index 12569eb8cc..bb53792085 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java @@ -19,7 +19,6 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; -import com.epmet.entity.stats.FactTagUsedGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -43,5 +42,5 @@ public interface FactTagUsedAgencyDailyDao extends BaseDao getTagUsedCountByMonth(@Param("customerId") String customerId, @Param("monthId") String monthId); + List getTagUsedCountByMonth(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index 547ca461dd..c6b8a8bee0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -1,6 +1,8 @@ package com.epmet.service.Issue; import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueGridDTO; +import com.epmet.dto.issue.IssueProjectDTO; import com.epmet.entity.issue.IssueEntity; import java.util.List; @@ -57,4 +59,53 @@ public interface IssueService { * @Description 根据客户Id查询议题库已转项目的网格项目关系数据 **/ List getGridProjectList(String customerId); + + /** + * 获取以网格为单位议题统计结果 + * @author zhaoqifeng + * @date 2020/6/19 14:34 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridIssueTotal(String customerId, String date); + + /** + * 获取当前日期网格下议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridIssueInc(String customerId, String date); + + /** + * 获取截止当前日期网格下已关闭议题统计 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridClosedIssueTotal(String customerId, String date); + + /** + * 获取当前日期网格下已关闭议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridClosedIssueInc(String customerId, String date); + + /** + * 获取议题项目关系 + * @author zhaoqifeng + * @date 2020/6/19 17:40 + * @param customerId + * @return java.util.List + */ + List getIssueProjectList(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java index e939aa61dc..9cef7c5340 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java @@ -4,6 +4,8 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.issue.StatsIssueDao; import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueGridDTO; +import com.epmet.dto.issue.IssueProjectDTO; import com.epmet.entity.issue.IssueEntity; import com.epmet.service.Issue.IssueService; import org.springframework.beans.factory.annotation.Autowired; @@ -73,4 +75,29 @@ public class IssueServiceImpl implements IssueService { public List getGridProjectList(String customerId) { return statsIssueDao.selectGridProjectList(customerId); } + + @Override + public List getGridIssueTotal(String customerId, String date) { + return statsIssueDao.selectGridIssueTotal(customerId, date); + } + + @Override + public List getGridIssueInc(String customerId, String date) { + return statsIssueDao.selectGridIssueInc(customerId, date); + } + + @Override + public List getGridClosedIssueTotal(String customerId, String date) { + return statsIssueDao.selectGridClosedIssueTotal(customerId, date); + } + + @Override + public List getGridClosedIssueInc(String customerId, String date) { + return statsIssueDao.selectGridClosedIssueInc(customerId, date); + } + + @Override + public List getIssueProjectList(String customerId) { + return statsIssueDao.selectIssueProjectList(customerId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java index 8042fd0c83..b3444d34d4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java @@ -1,5 +1,7 @@ package com.epmet.service; +import java.util.Date; + /** * @Author zxc * @CreateTime 2020/6/16 14:14 @@ -10,18 +12,18 @@ public interface StatsGroupService { * @Description 统计 “小组” 有关数据, dim:【网格-日】 * @author zxc */ - void groupGridDaily(String customerId); + void groupGridDaily(Date date); /** * @Description 统计 “小组” 有关数据, dim:【机关-日】 * @author zxc */ - void groupAgencyDaily(String customerId); + void groupAgencyDaily(Date date); /** * @Description 统计 “小组” 有关数据, dim:【机关-月】 * @author zxc */ - void groupAgencyMonthly(); + void groupAgencyMonthly(Date date); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java index 89bd89f22e..5d0e6b4292 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java @@ -9,7 +9,16 @@ import java.util.Date; */ public interface StatsIssueService { /** - * 机关下议题统计 + * 机关和网格议题统计 + * @author zhaoqifeng + * @date 2020/6/22 10:58 + * @param + * @return void + */ + void agencyGridIssueStats(); + + /** + * 机关下议题日统计 * @author zhaoqifeng * @date 2020/6/17 16:53 * @param customerId @@ -17,4 +26,34 @@ public interface StatsIssueService { * @return void */ void saveIssueAgencyDaily(String customerId, Date date); + + /** + * 机关下议题月统计 + * @author zhaoqifeng + * @date 2020/6/18 17:39 + * @param customerId + * @param date + * @return void + */ + void saveIssueAgencyMonthly(String customerId, Date date); + + /** + * 机关下网格议题日统计 + * @author zhaoqifeng + * @date 2020/6/19 13:53 + * @param customerId + * @param date + * @return void + */ + void saveIssueGridDaily(String customerId, Date date); + + /** + * 机关下网格议题月统计 + * @author zhaoqifeng + * @date 2020/6/19 13:53 + * @param customerId + * @param date + * @return void + */ + void saveIssueGridMonthly(String customerId, Date date); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java index 1bd0ff46be..772d48e788 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java @@ -10,9 +10,8 @@ public interface StatsPublicityService { * @return: Boolean * @date: 2020/6/17 16:11 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ - Boolean articlePublishedCountDayStats(Date statsDate); + Boolean articleSummaryDailyStatsjob(Date statsDate); /** * desc: 按日 统计每个标签被引用的使用文章数 @@ -20,9 +19,8 @@ public interface StatsPublicityService { * @return: Boolean * @date: 2020/6/17 16:11 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ - Boolean tagUsedDayStatsjob(Date statsDate); + Boolean tagUsedDailyStatsjob(Date statsDate); /** * desc: 按月 统计每个标签被引用的使用文章数 @@ -31,9 +29,18 @@ public interface StatsPublicityService { * @return: * @date: 2020/6/19 18:44 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ - Boolean tagUsedMonthStatsjob(Date statsDate); + Boolean tagUsedMonthlyStatsjob(Date statsDate); + + /** + * desc: 按季年统计标签被使用次数 + * + * @param statsDate + * @return: + * @date: 2020/6/20 10:44 + * @author: jianjun liu + */ + Boolean tagUsedQuarterlyStatsjob(Date statsDate); /** * desc: 按日 统计每个标签的阅读数 @@ -42,18 +49,26 @@ public interface StatsPublicityService { * @return: Boolean * @date: 2020/6/20 8:40 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ - Boolean tagViewedDayStatsjob(Date statsDate); + Boolean tagViewedDailyStatsjob(Date statsDate); + + /** + * desc: 按月统计标签被查看次数 + * + * @param statsDate + * @return: + * @date: 2020/6/20 10:44 + * @author: jianjun liu + */ + Boolean tagViewedMonthlyStatsjob(Date statsDate); /** - * desc: + * desc: 按季年统计标签被查看次数 * * @param statsDate * @return: * @date: 2020/6/20 10:44 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ - Boolean tagViewedMonthStatsjob(Date statsDate); + Boolean tagViewedQuarterlyStatsjob(Date statsDate); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index babd6e6503..be00cca1dd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -25,21 +25,21 @@ public interface GroupDataService { * @param allGrid * @author zxc */ - List getAgencyGroupTotalCount(List allGrid); + List getAgencyGroupTotalCount(List allGrid,String dateId); /** * @Description 查询机关下网格内的小组人数 * @param * @author zxc */ - List selectAgencyGridGroupPeopleTotal(List allGrid); + List selectAgencyGridGroupPeopleTotal(List allGrid,String dateId); /** * @Description 查询机关下每个小组的人数 * @param * @author zxc */ - List selectAgencyEveryGroupPeopleCount(List allGrid); + List selectAgencyEveryGroupPeopleCount(List allGrid,String dateId); /** * @Description 查询机关下的小组日增数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index cb548823c7..0aa22e72ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -41,17 +41,20 @@ public class GroupDataServiceImpl implements GroupDataService { if (gridsInfo.size() == NumConstant.ZERO){ return new ArrayList<>(); } + String dateId = dimTime.getDateId(); gridsInfo.forEach(grid -> { GroupGridDailyResultDTO dailyResult = new GroupGridDailyResultDTO(); BeanUtils.copyProperties(dimTime,dailyResult); dailyResult.setAgencyId(grid.getAgencyId()); dailyResult.setGridId(grid.getId()); + dailyResult.setCustomerId(customerId); result.add(dailyResult); }); // 1. 网格下有多少小组,只算 state = ‘approved’ GridGroupTotalFormDTO formDTO = new GridGroupTotalFormDTO(); formDTO.setCustomerId(customerId); + formDTO.setDateId(dateId); List gridGroupTotalResultDTOS = groupDataDao.selectGridGroupTotal(formDTO); if (gridGroupTotalResultDTOS.size() == NumConstant.ZERO){ result.forEach(grid -> { @@ -70,6 +73,7 @@ public class GroupDataServiceImpl implements GroupDataService { // 2. 网格下所有组内人数和(不需要去重) 人员状态 != "removed" GridGroupPeopleTotalFormDTO peopleTotalFormDTO = new GridGroupPeopleTotalFormDTO(); peopleTotalFormDTO.setCustomerId(customerId); + peopleTotalFormDTO.setDateId(dateId); List gridGroupPeopleTotalResultDTOS = groupDataDao.selectGridGroupPeopleTotal(peopleTotalFormDTO); result.forEach(grid -> { gridGroupPeopleTotalResultDTOS.forEach(groupPeopleTotal -> { @@ -85,6 +89,7 @@ public class GroupDataServiceImpl implements GroupDataService { // 4. 网格下小组人数中位数 小组最大(小)成员数、最多(少)成员小组ID GridGroupPeopleFormDTO everyGroupPeople = new GridGroupPeopleFormDTO(); everyGroupPeople.setCustomerId(customerId); + everyGroupPeople.setDateId(dateId); List everyGroupPeopleCount = groupDataDao.selectEveryGroupPeopleCount(everyGroupPeople); Map> collect = everyGroupPeopleCount.stream().collect(Collectors.groupingBy(every -> every.getGridId())); Set>> entries = collect.entrySet(); @@ -111,7 +116,7 @@ public class GroupDataServiceImpl implements GroupDataService { // 5. 网格下小组增量 GroupIncrFormDTO groupIncr = new GroupIncrFormDTO(); groupIncr.setCustomerId(customerId); - groupIncr.setYesterday(dimTime.getDateId()); + groupIncr.setDateId(dateId); List groupIncrResult = groupDataDao.selectGroupIncr(groupIncr); result.forEach(grid -> { groupIncrResult.forEach(gridIncr -> { @@ -128,11 +133,11 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ - public List getAgencyGroupTotalCount(List allGrid){ + public List getAgencyGroupTotalCount(List allGrid,String dateId){ if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); } - return groupDataDao.getAgencyGroupTotalCount(allGrid); + return groupDataDao.getAgencyGroupTotalCount(allGrid,dateId); } /** @@ -141,11 +146,11 @@ public class GroupDataServiceImpl implements GroupDataService { * @author zxc */ @Override - public List selectAgencyGridGroupPeopleTotal(List allGrid) { + public List selectAgencyGridGroupPeopleTotal(List allGrid,String dateId) { if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); } - return groupDataDao.selectAgencyGridGroupPeopleTotal(allGrid); + return groupDataDao.selectAgencyGridGroupPeopleTotal(allGrid,dateId); } /** @@ -153,24 +158,24 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ - public List selectAgencyEveryGroupPeopleCount(List allGrid){ + public List selectAgencyEveryGroupPeopleCount(List allGrid,String dateId){ if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); } - return groupDataDao.selectAgencyEveryGroupPeopleCount(allGrid); + return groupDataDao.selectAgencyEveryGroupPeopleCount(allGrid,dateId); } /** * @Description 查询机关下的小组日增数 * @param - * @param yesterday + * @param dateId * @author zxc */ - public List selectAgencyGroupIncr(List allGrid,String yesterday){ + public List selectAgencyGroupIncr(List allGrid,String dateId){ if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); } - return groupDataDao.selectAgencyGroupIncr(allGrid, yesterday); + return groupDataDao.selectAgencyGroupIncr(allGrid, dateId); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 82278d4340..15ad3e0b3a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -9,6 +9,7 @@ import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.StatsGroupService; import com.epmet.service.group.GroupDataService; +import com.epmet.service.org.CustomerGridService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; @@ -21,6 +22,7 @@ import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.*; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; /** @@ -42,6 +44,10 @@ public class StatsGroupServiceImpl implements StatsGroupService { private FactGroupAgencyDailyService factGroupAgencyDailyService; @Autowired private FactGroupAgencyMonthlyService factGroupAgencyMonthlyService; + @Autowired + private DimCustomerService dimCustomerService; + @Autowired + private CustomerGridService customerGridService; /** * @Description 统计【网格-日】 @@ -49,11 +55,20 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @author zxc */ @Override - public void groupGridDaily(String customerId) { - DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(); - List gridsInfo = dimGridService.getGridListByCustomerId(customerId); - List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); - factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS); + public void groupGridDaily(Date date) { + Integer pageNo = NumConstant.ONE; + Integer pageSize = NumConstant.ONE_HUNDRED; + List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); + if (customerIds.size() == NumConstant.ZERO){ + return; + } + customerIds.forEach(customerId -> { + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + List gridsInfo = dimGridService.getGridListByCustomerId(customerId); + List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); + factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); + }); + } /** @@ -61,12 +76,20 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @author zxc */ @Override - public void groupAgencyDaily(String customerId) { - DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(); - List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); - List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); - factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily); + public void groupAgencyDaily(Date date) { + Integer pageNo = NumConstant.ONE; + Integer pageSize = NumConstant.ONE_HUNDRED; + List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); + if (customerIds.size() == NumConstant.ZERO){ + return; + } + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + customerIds.forEach(customerId -> { + List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); + List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); + factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); + }); } /** @@ -74,10 +97,11 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @author zxc String customerId */ @Override - public void groupAgencyMonthly() { - List lastDayAgency = factGroupAgencyDailyService.getLastDayAgency(); - DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(); - List monthGroupIncr = factGroupAgencyDailyService.getMonthGroupIncr(dimIdBean.getMonthId()); + public void groupAgencyMonthly(Date date) { + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + String monthId = dimIdBean.getMonthId(); + List lastDayAgency = factGroupAgencyDailyService.getLastDayAgency(monthId); + List monthGroupIncr = factGroupAgencyDailyService.getMonthGroupIncr(monthId); if (monthGroupIncr.size() == NumConstant.ZERO){ lastDayAgency.forEach(agency -> { agency.setGroupIncr(NumConstant.ZERO); @@ -99,25 +123,40 @@ public class StatsGroupServiceImpl implements StatsGroupService { return new ArrayList<>(); } List result = new ArrayList<>(); + String dateId = timeDim.getDateId(); List agencyList = dimAgencyService.getAgencyListByCustomerId(customerId); agencyList.forEach(agency -> { AgencyGroupDailyResultDTO agencyResult = new AgencyGroupDailyResultDTO(); String agencyId = agency.getId(); agencyResult.setAgencyId(agencyId); + agencyResult.setCustomerId(customerId); BeanUtils.copyProperties(timeDim,agencyResult); //机关下的所有网格(包括直属网格) List allGrid = this.getAllGrid(agencyId); String pidByAgencyId = dimAgencyService.getPidByAgencyId(agencyId); agencyResult.setPid(StringUtils.isBlank(pidByAgencyId)?"0":pidByAgencyId); // TODO 1. 机关下有多少网格 - agencyResult.setGridTotal(allGrid.size()); + List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); + AtomicReference gridSize = new AtomicReference<>(0); + if (customerGridIdList.size() != NumConstant.ZERO){ + customerGridIdList.forEach(gridId -> { + allGrid.forEach(allAgencyGrid -> { + if (gridId.equals(allAgencyGrid)){ + gridSize.updateAndGet(v -> v + NumConstant.ONE); + } + }); + }); + agencyResult.setGridTotal(gridSize.get()); + }else { + agencyResult.setGridTotal(NumConstant.ZERO); + } // TODO 2. 机关下有多少小组,只算 state = ‘approved’ - List agencyGroupTotalCount = groupDataService.getAgencyGroupTotalCount(allGrid); + List agencyGroupTotalCount = groupDataService.getAgencyGroupTotalCount(allGrid,dateId); Integer groupCount = agencyGroupTotalCount.stream().collect(Collectors.summingInt(AgencyGroupTotalCountResultDTO::getGridGroupCount)); agencyResult.setGroupTotalCount(groupCount); // TODO 3. 机关下所有组内人数和(不需要去重) 人员状态 != "removed" - List agencyGridGroupPeopleTotal = groupDataService.selectAgencyGridGroupPeopleTotal(allGrid); + List agencyGridGroupPeopleTotal = groupDataService.selectAgencyGridGroupPeopleTotal(allGrid,dateId); Integer groupPeopleCount = agencyGridGroupPeopleTotal.stream().collect(Collectors.summingInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal)); agencyResult.setGroupMemberTotalCount(groupPeopleCount); @@ -127,7 +166,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { agencyResult.getGroupMemberTotalCount()/agencyResult.getGroupTotalCount()); // TODO 5. 机关下小组人数中位数 小组最大(小)成员数、最多(少)成员小组ID - List agencyGridGroupPeople = groupDataService.selectAgencyEveryGroupPeopleCount(allGrid); + List agencyGridGroupPeople = groupDataService.selectAgencyEveryGroupPeopleCount(allGrid,dateId); List sorted = agencyGridGroupPeople.stream().sorted(Comparator.comparing(AgencyGridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList()); Integer groupPeopleMedian; if (sorted.size() == NumConstant.ONE){ @@ -136,9 +175,9 @@ public class StatsGroupServiceImpl implements StatsGroupService { agencyResult.setGroupMemberMinCount(sorted.get(NumConstant.ZERO).getGroupCount()); agencyResult.setMinMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); }else if (sorted.size() >= NumConstant.TWO){ - groupPeopleMedian = sorted.size() % 2 == 0 ? - (sorted.get(sorted.size() / 2 - 1).getGroupCount() + sorted.get(sorted.size() / 2).getGroupCount()) / 2 : - sorted.get(sorted.size() / 2).getGroupCount(); + groupPeopleMedian = sorted.size() % NumConstant.TWO == NumConstant.ZERO ? + (sorted.get(sorted.size() / NumConstant.TWO - NumConstant.ONE).getGroupCount() + sorted.get(sorted.size() / 2).getGroupCount()) / 2 : + sorted.get(sorted.size() / NumConstant.TWO).getGroupCount(); agencyResult.setGroupMedian(groupPeopleMedian); agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount()); @@ -147,7 +186,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { agencyResult.setMinMemberGroupId(sorted.get(sorted.size() - NumConstant.ONE).getGroupId()); } // TODO 6. 机关下小组增量 - List agencyGroupIncr = groupDataService.selectAgencyGroupIncr(allGrid, timeDim.getDateId()); + List agencyGroupIncr = groupDataService.selectAgencyGroupIncr(allGrid, dateId); Integer groupIncr = agencyGroupIncr.stream().collect(Collectors.summingInt(AgencyGroupIncrResultDTO::getGroupIncr)); agencyResult.setGroupIncr(groupIncr); result.add(agencyResult); @@ -222,12 +261,15 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @param * @author zxc */ - public DimIdGenerator.DimIdBean getDimIdBean(){ + public DimIdGenerator.DimIdBean getDimIdBean(Date date){ + if (date != null){ + return DimIdGenerator.getDimIdBean(date); + } ZoneId zoneId = ZoneId.systemDefault(); LocalDate localDate = LocalDate.now().minusDays(NumConstant.ONE); ZonedDateTime zdt = localDate.atStartOfDay(zoneId); - Date date = Date.from(zdt.toInstant()); - return DimIdGenerator.getDimIdBean(date); + Date result = Date.from(zdt.toInstant()); + return DimIdGenerator.getDimIdBean(result); } public List getAgencyAllGrid(String customerId,String agencyId){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java index 080e79dc7f..6da113060e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -1,27 +1,32 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.IssueConstant; import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueGridDTO; +import com.epmet.dto.issue.IssueProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectGridDTO; import com.epmet.dto.stats.DimAgencyDTO; -import com.epmet.entity.stats.FactIssueAgencyDailyEntity; -import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; +import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO; +import com.epmet.dto.stats.FactIssueGridMonthlyDTO; +import com.epmet.entity.stats.*; import com.epmet.service.Issue.IssueService; import com.epmet.service.StatsIssueService; import com.epmet.service.project.ProjectService; -import com.epmet.service.stats.DimAgencyService; -import com.epmet.service.stats.FactIssueAgencyDailyService; +import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; /** * @author zhaoqifeng @@ -30,14 +35,61 @@ import java.util.List; */ @Service public class StatsIssueServiceImpl implements StatsIssueService { + @Autowired + private DimCustomerService dimCustomerService; @Autowired private IssueService issueService; @Autowired private DimAgencyService dimAgencyService; @Autowired + private DimGridService dimGridService; + @Autowired private ProjectService projectService; @Autowired private FactIssueAgencyDailyService factIssueAgencyDailyService; + @Autowired + private FactIssueAgencyMonthlyService factIssueAgencyMonthlyService; + @Autowired + private FactIssueGridDailyService factIssueGridDailyService; + @Autowired + private FactIssueGridMonthlyService factIssueGridMonthlyService; + + @Override + public void agencyGridIssueStats() { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + //遍历统计每一个客户数据 + customerStats(customerId); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + /** + * 一个客户一个线程, 分别统计机关日/月数据和网格日/月数据 + * @author zhaoqifeng + * @date 2020/6/22 11:03 + * @param customerId + * @return void + */ + @Async + public void customerStats(String customerId) { + //获取当前日期前一天 + Date date = DateUtils.getBeforeDay(new Date()); + //机关议题日统计 + saveIssueAgencyDaily(customerId, date); + //机关议题月统计 + saveIssueAgencyMonthly(customerId, date); + //网格议题日统计 + saveIssueGridDaily(customerId, date); + //网格议题月统计 + saveIssueGridMonthly(customerId, date); + } @Override public void saveIssueAgencyDaily(String customerId, Date date) { @@ -51,9 +103,9 @@ public class StatsIssueServiceImpl implements StatsIssueService { //获取机关下议题各种状态的数目增量 List issueAgencyIncList = issueService.getAgencyIssueInc(customerId, dateString); //获取机关下已关闭议题统计 - List issueAgencyClosedTotalList = issueService.getAgencyIssueInc(customerId, dateString); + List issueAgencyClosedTotalList = issueService.getAgencyClosedIssueTotal(customerId, dateString); //获取机关下已关闭议题增量 - List issueAgencyClosedIncList = issueService.getAgencyIssueInc(customerId, dateString); + List issueAgencyClosedIncList = issueService.getAgencyClosedIssueInc(customerId, dateString); //已结案项目统计 List projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString); //已结案项目增量 @@ -95,20 +147,478 @@ public class StatsIssueServiceImpl implements StatsIssueService { } } list.add(entity); + } + //批量插入 + factIssueAgencyDailyService.insertBatch(list); + } - factIssueAgencyDailyService.insertBatch(list); + @Override + public void saveIssueAgencyMonthly(String customerId, Date date) { + String dateString = DateUtils.format(date); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + //获取当前客户下所有机关 + List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + //获取机关下议题各种状态的数目统计 + List issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId); + //获取机关下已关闭议题统计 + List issueAgencyClosedTotalList = issueService.getAgencyClosedIssueTotal(customerId, dateString); + //已结案项目统计 + List projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //统计机关下议题各个指标月度增量 + List issueAgencyMonthlyIncList = factIssueAgencyMonthlyService.getAgencyMonthlyInc(customerId, dimId.getMonthId()); + + List list = new ArrayList<>(); + for (DimAgencyDTO agency : agencyList) { + FactIssueAgencyDailyEntity daily = initIssueAgencyDaily(dimId); + FactIssueAgencyMonthlyEntity monthly = initIssueAgencyMonthly(dimId); + + String pIds; + if (null == agency.getPids() || agency.getPids().isEmpty()) { + pIds = agency.getPid().concat(":").concat(agency.getId()); + } else { + pIds = ("0").concat(":").concat(agency.getPids()).concat(":").concat(agency.getId()); + } + //总量统计 + saveTotal(issueAgencyTotalList, agency, daily, pIds); + //已关闭议题已解决未解决统计 + if (daily.getClosedTotal() > NumConstant.ZERO) { + saveClosedTotal(issueAgencyClosedTotalList, agency, daily, pIds); + } + //已关闭项目已解决未解决统计 + if (daily.getShiftProjectTotal() > NumConstant.ZERO) { + saveClosedProjectTotal(projectAgencyClosedTotalList, agency, daily, pIds); + } + monthly = ConvertUtils.sourceToTarget(daily, FactIssueAgencyMonthlyEntity.class); + //各指标增量统计 + for (int i = 0; i < issueAgencyMonthlyIncList.size(); i++) { + FactIssueAgencyMonthlyDTO dto = issueAgencyMonthlyIncList.get(i); + if (agency.getId().equals(dto.getAgencyId())) { + monthly.setIssueIncr(dto.getIssueIncr()); + monthly.setShiftProjectIncr(dto.getShiftProjectIncr()); + monthly.setClosedIncr(dto.getClosedIncr()); + monthly.setClosedResolvedIncr(dto.getClosedResolvedIncr()); + monthly.setClosedUnresolvedIncr(dto.getClosedUnresolvedIncr()); + monthly.setClosedCaseIncr(dto.getClosedCaseIncr()); + monthly.setClosedCaseResolvedIncr(dto.getClosedCaseResolvedIncr()); + monthly.setClosedCaseUnresolvedIncr(dto.getClosedCaseUnresolvedIncr()); + issueAgencyMonthlyIncList.remove(i); + break; + } + } + monthly.setCustomerId(agency.getCustomerId()); + monthly.setAgencyId(agency.getId()); + monthly.setPid(agency.getPid()); + + list.add(monthly); + } + //批量插入 + factIssueAgencyMonthlyService.insertBatch(list); + } + + @Override + public void saveIssueGridDaily(String customerId, Date date) { + String dateString = DateUtils.format(date); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //获取客户下所有网格数据 + List gridList = dimGridService.getGridListByCustomerId(customerId); + //获取网格下议题各种状态的数目统计 + List gridTotalList = issueService.getGridIssueTotal(customerId, dateString); + //获取网格下议题各种状态的增量统计 + List gridIncList = issueService.getGridIssueInc(customerId, dateString); + //获取网格下已关闭议题各种状态的数目统计 + List gridClosedTotalList = issueService.getGridClosedIssueTotal(customerId, dateString); + //获取网格下已关闭议题各种状态的增量统计 + List gridClosedIncList = issueService.getGridClosedIssueInc(customerId, dateString); + //项目议题关系 + List issueProjectList = issueService.getIssueProjectList(customerId); + //已结案项目统计 + List closedProjectTotalList = projectService.getGridClosedProjectTotal(customerId, dateString); + //已结案项目增量 + List closedProjectIncList = projectService.getGridClosedProjectTotal(customerId, dateString); + Map resolveMap= new HashMap<>(); + Map unResolveMap = new HashMap<>(); + Map resolveIncMap = new HashMap<>(); + Map unResolveIncMap = new HashMap<>(); + if (null != issueProjectList) { + List totalList = issueProjectList.stream().flatMap(ip -> + closedProjectTotalList.stream().filter(closed -> ip.getIssueId().equals(closed.getIssueId())).map(project -> { + IssueProjectDTO dto = new IssueProjectDTO(); + dto.setIssueId(ip.getIssueId()); + dto.setGridId(ip.getGridId()); + dto.setProjectId(ip.getProjectId()); + dto.setStatus(project.getStatus()); + return dto; + })).collect(Collectors.toList()); + Map> totalMap = + totalList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); + List resolveList = totalMap.get(IssueConstant.RESLOVED); + List unResolveList = totalMap.get(IssueConstant.UNRESLOVED); + if (null != resolveList) { + resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + } + if (null != unResolveList) { + unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } + List incList = issueProjectList.stream().flatMap(ip -> + closedProjectIncList.stream().filter(closed -> ip.getIssueId().equals(closed.getIssueId())).map(project -> { + IssueProjectDTO dto = new IssueProjectDTO(); + dto.setIssueId(ip.getIssueId()); + dto.setGridId(ip.getGridId()); + dto.setProjectId(ip.getProjectId()); + dto.setStatus(project.getStatus()); + return dto; + })).collect(Collectors.toList()); + Map> incMap = + incList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); + List resolveIncList = incMap.get(IssueConstant.RESLOVED); + List unResolveIncList = incMap.get(IssueConstant.UNRESLOVED); + if (null != resolveIncList) { + resolveIncMap = resolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + } + if (null != unResolveIncList) { + unResolveIncMap = unResolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } } + + List list = new ArrayList<>(); + + for (DimGridEntity grid : gridList) { + FactIssueGridDailyEntity entity = initIssueGridDaily(dimId); + entity.setCustomerId(grid.getCustomerId()); + entity.setAgencyId(grid.getAgencyId()); + entity.setGridId(grid.getId()); + //总量统计 + saveGridTotal(gridTotalList, grid, entity); + //增量统计 + saveGridInc(gridIncList, grid, entity); + + if (entity.getClosedTotal() > NumConstant.ZERO) { + //已关闭议题已解决未解决数量统计 + saveGridClosedTotal(gridClosedTotalList, grid, entity); + + if (entity.getClosedIncr() > NumConstant.ZERO) { + //已关闭议题已解决未解决增量统计 + saveGridClosedInc(gridClosedIncList, grid, entity); + } + } + //已关闭项目已解决未解决统计 + saveClosedProject(resolveMap, unResolveMap, resolveIncMap, unResolveIncMap, grid, entity); + list.add(entity); + } + factIssueGridDailyService.insertBatch(list); + } + + @Override + public void saveIssueGridMonthly(String customerId, Date date) { + String dateString = DateUtils.format(date); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //获取客户下所有网格数据 + List gridList = dimGridService.getGridListByCustomerId(customerId); + //获取网格下议题各种状态的数目统计 + List gridTotalList = issueService.getGridIssueTotal(customerId, dateString); + //获取网格下已关闭议题各种状态的数目统计 + List gridClosedTotalList = issueService.getGridClosedIssueTotal(customerId, dateString); + //增量统计 + List gridMonthlyIncListList = factIssueGridMonthlyService.getGridMonthlyInc(customerId, dimId.getMonthId()); + //项目议题关系 + List issueProjectList = issueService.getIssueProjectList(customerId); + //已结案项目统计 + List closedProjectTotalList = projectService.getGridClosedProjectTotal(customerId, dateString); + Map resolveMap= new HashMap<>(); + Map unResolveMap = new HashMap<>(); + if (null != issueProjectList) { + List totalList = issueProjectList.stream().flatMap(ip -> + closedProjectTotalList.stream().filter(closed -> ip.getIssueId().equals(closed.getIssueId())).map(project -> { + IssueProjectDTO dto = new IssueProjectDTO(); + dto.setIssueId(ip.getIssueId()); + dto.setGridId(ip.getGridId()); + dto.setProjectId(ip.getProjectId()); + dto.setStatus(project.getStatus()); + return dto; + })).collect(Collectors.toList()); + Map> totalMap = + totalList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); + List resolveList = totalMap.get(IssueConstant.RESLOVED); + List unResolveList = totalMap.get(IssueConstant.UNRESLOVED); + if (null != resolveList) { + resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + } + if (null != unResolveList) { + unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } + } + + List list = new ArrayList<>(); + + for (DimGridEntity grid : gridList) { + FactIssueGridDailyEntity daily = initIssueGridDaily(dimId); + FactIssueGridMonthlyEntity monthly = initIssueGridMonthly(dimId); + + //总量统计 + saveGridTotal(gridTotalList, grid, daily); + + if (daily.getClosedTotal() > NumConstant.ZERO) { + //已关闭议题已解决未解决数量统计 + saveGridClosedTotal(gridClosedTotalList, grid, daily); + } + monthly = ConvertUtils.sourceToTarget(daily, FactIssueGridMonthlyEntity.class); + + //已关闭项目已解决未解决统计 + int resolve = null == resolveMap.get(grid.getId())?0:resolveMap.get(grid.getId()).intValue(); + int unResolve = null == unResolveMap.get(grid.getId())?0:unResolveMap.get(grid.getId()).intValue(); + int total = resolve + unResolve; + monthly.setClosedCaseTotal(total); + monthly.setClosedCaseResolvedTotal(resolve); + monthly.setClosedCaseUnresolvedTotal(unResolve); + if(total > NumConstant.ZERO) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolve); + BigDecimal unresolved = new BigDecimal(unResolve); + BigDecimal closed = new BigDecimal(total); + monthly.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + monthly.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } + + //各指标增量统计 + for (int i = 0; i < gridMonthlyIncListList.size(); i++) { + FactIssueGridMonthlyDTO dto = gridMonthlyIncListList.get(i); + if (grid.getId().equals(dto.getGridId())) { + monthly.setIssueIncr(dto.getIssueIncr()); + monthly.setShiftProjectIncr(dto.getShiftProjectIncr()); + monthly.setClosedIncr(dto.getClosedIncr()); + monthly.setClosedResolvedIncr(dto.getClosedResolvedIncr()); + monthly.setClosedUnresolvedIncr(dto.getClosedUnresolvedIncr()); + monthly.setClosedCaseIncr(dto.getClosedCaseIncr()); + monthly.setClosedCaseResolvedIncr(dto.getClosedCaseResolvedIncr()); + monthly.setClosedCaseUnresolvedIncr(dto.getClosedCaseUnresolvedIncr()); + gridMonthlyIncListList.remove(i); + break; + } + } + + monthly.setCustomerId(grid.getCustomerId()); + monthly.setAgencyId(grid.getAgencyId()); + monthly.setGridId(grid.getId()); + list.add(monthly); + } + factIssueGridMonthlyService.insertBatch(list); } /** - * 已关闭项目已解决未解决增量统计 + * 已关闭项目已解决未解决统计 * @author zhaoqifeng - * @date 2020/6/18 17:23 + * @date 2020/6/22 10:35 + * @param resolveMap + * @param unResolveMap + * @param resolveIncMap + * @param unResolveIncMap + * @param grid + * @param entity + * @return void + */ + private void saveClosedProject(Map resolveMap, Map unResolveMap, Map resolveIncMap, + Map unResolveIncMap, DimGridEntity grid, FactIssueGridDailyEntity entity) { + int resolve = null == resolveMap.get(grid.getId())?0:resolveMap.get(grid.getId()).intValue(); + int unResolve = null == unResolveMap.get(grid.getId())?0:unResolveMap.get(grid.getId()).intValue(); + int resolveInc = null == resolveIncMap.get(grid.getId())?0:resolveIncMap.get(grid.getId()).intValue(); + int unResolveInc = null == unResolveIncMap.get(grid.getId())?0:unResolveIncMap.get(grid.getId()).intValue(); + int total = resolve + unResolve; + int inc = resolveInc + unResolveInc; + entity.setClosedCaseTotal(total); + entity.setClosedCaseResolvedTotal(resolve); + entity.setClosedCaseUnresolvedTotal(unResolve); + entity.setClosedCaseIncr(inc); + entity.setClosedCaseResolvedIncr(resolveInc); + entity.setClosedCaseUnresolvedIncr(unResolveInc); + if(total != NumConstant.ZERO) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolve); + BigDecimal unresolved = new BigDecimal(unResolve); + BigDecimal closed = new BigDecimal(total); + entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } + } + + /** + * 已关闭议题已解决未解决增量统计 + * + * @param list + * @param grid + * @param entity + * @return void + * @author zhaoqifeng + * @date 2020/6/19 15:56 + */ + private void saveGridClosedInc(List list, DimGridEntity grid, FactIssueGridDailyEntity entity) { + //已解决数 + int resolvedInc = NumConstant.ZERO; + //未解决数 + int unresolvedInc = NumConstant.ZERO; + + for (IssueGridDTO dto : list) { + if (grid.getId().equals(dto.getGridId())) { + if (IssueConstant.RESLOVED.equals(dto.getStatus())) { + //表决中议题数量 + resolvedInc = dto.getCount(); + } else if (IssueConstant.UNRESLOVED.equals(dto.getStatus())) { + //已转项目议题数量 + unresolvedInc = dto.getCount(); + } + } + } + entity.setClosedResolvedIncr(resolvedInc); + entity.setClosedUnresolvedIncr(unresolvedInc); + } + + /** + * 已关闭议题已解决未解决总量级占比统计 + * + * @param list + * @param grid + * @param entity + * @return void + * @author zhaoqifeng + * @date 2020/6/19 15:56 + */ + private void saveGridClosedTotal(List list, DimGridEntity grid, FactIssueGridDailyEntity entity) { + //已解决数 + int resolvedCount = NumConstant.ZERO; + //未解决数 + int unresolvedCount = NumConstant.ZERO; + + for (IssueGridDTO dto : list) { + if (grid.getId().equals(dto.getGridId())) { + if (IssueConstant.RESLOVED.equals(dto.getStatus())) { + //已解决议题数量 + resolvedCount = dto.getCount(); + } else if (IssueConstant.UNRESLOVED.equals(dto.getStatus())) { + //未解决议题数量 + unresolvedCount = dto.getCount(); + } + } + } + entity.setClosedResolvedTotal(resolvedCount); + entity.setClosedUnresolvedTotal(unresolvedCount); + if(entity.getClosedTotal() > NumConstant.ZERO) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolvedCount); + BigDecimal unresolved = new BigDecimal(unresolvedCount); + BigDecimal closed = new BigDecimal(entity.getClosedTotal()); + entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } + } + + /** + * 网格议题增量统计 + * + * @param list + * @param grid + * @param entity + * @return void + * @author zhaoqifeng + * @date 2020/6/19 15:57 + */ + private void saveGridInc(List list, DimGridEntity grid, FactIssueGridDailyEntity entity) { + //表决中增量 + int votingInc = NumConstant.ZERO; + //已转项目增量 + int shiftInc = NumConstant.ZERO; + //已关闭增量 + int closedInc = NumConstant.ZERO; + for (IssueGridDTO dto : list) { + if (grid.getId().equals(dto.getGridId())) { + if (IssueConstant.VOTING.equals(dto.getStatus())) { + //表决中议题数量 + votingInc = dto.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(dto.getStatus())) { + //已转项目议题数量 + shiftInc = dto.getCount(); + } else { + //已关闭议题数量 + closedInc = dto.getCount(); + } + } + } + int issueInc = votingInc + shiftInc + closedInc; + entity.setVotingIncr(votingInc); + entity.setShiftProjectIncr(shiftInc); + entity.setClosedIncr(closedInc); + entity.setIssueIncr(issueInc); + } + + /** + * 网格议题总量统计 + * + * @param list + * @param grid + * @param entity + * @return void + * @author zhaoqifeng + * @date 2020/6/19 15:57 + */ + private void saveGridTotal(List list, DimGridEntity grid, FactIssueGridDailyEntity entity) { + //表决中数量 + Integer votingCount = NumConstant.ZERO; + //已转项目数量 + Integer shiftCount = NumConstant.ZERO; + //已关闭数量 + Integer closedCount = NumConstant.ZERO; + for (IssueGridDTO dto : list) { + if (dto.getGridId().equals(grid.getId())) { + if (IssueConstant.VOTING.equals(dto.getStatus())) { + //表决中议题数量 + votingCount = dto.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(dto.getStatus())) { + //已转项目议题数量 + shiftCount = dto.getCount(); + } else { + //已关闭议题数量 + closedCount = dto.getCount(); + } + } + } + int issueTotal = votingCount + shiftCount + closedCount; + entity.setVotingTotal(votingCount); + entity.setShiftProjectTotal(shiftCount); + entity.setClosedTotal(closedCount); + entity.setIssueTotal(issueTotal); + if (NumConstant.ZERO != issueTotal) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal voting = new BigDecimal(votingCount); + BigDecimal shift = new BigDecimal(shiftCount); + BigDecimal closed = new BigDecimal(closedCount); + BigDecimal total = new BigDecimal(issueTotal); + entity.setVotingPercent(voting.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setShiftProjectPercent(shift.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedPercent(closed.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); + + } + } + + /** + * 已关闭项目已解决未解决增量统计 + * * @param list * @param agency * @param entity * @param pIds * @return void + * @author zhaoqifeng + * @date 2020/6/18 17:23 */ private void saveClosedProjectInc(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { //已解决数 @@ -135,13 +645,14 @@ public class StatsIssueServiceImpl implements StatsIssueService { /** * 已关闭项目已解决未解决统计 - * @author zhaoqifeng - * @date 2020/6/18 17:23 + * * @param list * @param agency * @param entity * @param pIds * @return void + * @author zhaoqifeng + * @date 2020/6/18 17:23 */ private void saveClosedProjectTotal(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { //已解决数 @@ -286,7 +797,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { if (IssueConstant.RESLOVED.equals(issueAgency.getStatus())) { //表决中议题数量 resolvedCount = resolvedCount + issueAgency.getCount(); - } else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) { + } else if (IssueConstant.UNRESLOVED.equals(issueAgency.getStatus())) { //已转项目议题数量 unresolvedCount = unresolvedCount + issueAgency.getCount(); } @@ -294,13 +805,14 @@ public class StatsIssueServiceImpl implements StatsIssueService { } entity.setClosedResolvedTotal(resolvedCount); entity.setClosedUnresolvedTotal(unresolvedCount); - - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); - BigDecimal resolved = new BigDecimal(resolvedCount); - BigDecimal unresolved = new BigDecimal(unresolvedCount); - BigDecimal closed = new BigDecimal(entity.getClosedTotal()); - entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + if (entity.getClosedTotal() > NumConstant.ZERO) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolvedCount); + BigDecimal unresolved = new BigDecimal(unresolvedCount); + BigDecimal closed = new BigDecimal(entity.getClosedTotal()); + entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } } /** @@ -325,7 +837,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { if (IssueConstant.RESLOVED.equals(issueAgency.getStatus())) { //表决中议题数量 resolvedInc = resolvedInc + issueAgency.getCount(); - } else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) { + } else if (IssueConstant.UNRESLOVED.equals(issueAgency.getStatus())) { //已转项目议题数量 unresolvedInc = unresolvedInc + issueAgency.getCount(); } @@ -419,4 +931,72 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO); return entity; } + + private FactIssueGridDailyEntity initIssueGridDaily(DimIdGenerator.DimIdBean dimIdBean) { + FactIssueGridDailyEntity entity = new FactIssueGridDailyEntity(); + entity.setYearId(dimIdBean.getYearId()); + entity.setQuarterId(dimIdBean.getQuarterId()); + entity.setMonthId(dimIdBean.getMonthId()); + entity.setWeekId(dimIdBean.getWeekId()); + entity.setDateId(dimIdBean.getDateId()); + entity.setIssueTotal(NumConstant.ZERO); + entity.setIssueIncr(NumConstant.ZERO); + entity.setVotingTotal(NumConstant.ZERO); + entity.setVotingIncr(NumConstant.ZERO); + entity.setVotingPercent(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectIncr(NumConstant.ZERO); + entity.setShiftProjectPercent(BigDecimal.ZERO); + entity.setClosedIncr(NumConstant.ZERO); + entity.setClosedResolvedIncr(NumConstant.ZERO); + entity.setClosedUnresolvedIncr(NumConstant.ZERO); + entity.setClosedTotal(NumConstant.ZERO); + entity.setClosedResolvedTotal(NumConstant.ZERO); + entity.setClosedUnresolvedTotal(NumConstant.ZERO); + entity.setClosedPercent(BigDecimal.ZERO); + entity.setClosedResolvedPercent(BigDecimal.ZERO); + entity.setClosedUnresolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseIncr(NumConstant.ZERO); + entity.setClosedCaseResolvedIncr(NumConstant.ZERO); + entity.setClosedCaseUnresolvedIncr(NumConstant.ZERO); + entity.setClosedCaseTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedTotal(NumConstant.ZERO); + entity.setClosedCaseUnresolvedTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO); + return entity; + } + + private FactIssueGridMonthlyEntity initIssueGridMonthly(DimIdGenerator.DimIdBean dimIdBean) { + FactIssueGridMonthlyEntity entity = new FactIssueGridMonthlyEntity(); + entity.setYearId(dimIdBean.getYearId()); + entity.setQuarterId(dimIdBean.getQuarterId()); + entity.setMonthId(dimIdBean.getMonthId()); + entity.setIssueTotal(NumConstant.ZERO); + entity.setIssueIncr(NumConstant.ZERO); + entity.setVotingTotal(NumConstant.ZERO); + entity.setVotingIncr(NumConstant.ZERO); + entity.setVotingPercent(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectIncr(NumConstant.ZERO); + entity.setShiftProjectPercent(BigDecimal.ZERO); + entity.setClosedIncr(NumConstant.ZERO); + entity.setClosedResolvedIncr(NumConstant.ZERO); + entity.setClosedUnresolvedIncr(NumConstant.ZERO); + entity.setClosedTotal(NumConstant.ZERO); + entity.setClosedResolvedTotal(NumConstant.ZERO); + entity.setClosedUnresolvedTotal(NumConstant.ZERO); + entity.setClosedPercent(BigDecimal.ZERO); + entity.setClosedResolvedPercent(BigDecimal.ZERO); + entity.setClosedUnresolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseIncr(NumConstant.ZERO); + entity.setClosedCaseResolvedIncr(NumConstant.ZERO); + entity.setClosedCaseUnresolvedIncr(NumConstant.ZERO); + entity.setClosedCaseTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedTotal(NumConstant.ZERO); + entity.setClosedCaseUnresolvedTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO); + return entity; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index 98f5b3f2a7..baadc98ac0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -13,7 +13,6 @@ import com.epmet.entity.voice.ArticleEntity; import com.epmet.entity.voice.ArticleTagsEntity; import com.epmet.service.StatsPublicityService; import com.epmet.service.stats.*; -import com.epmet.service.voice.ArticlePublishRangeService; import com.epmet.service.voice.ArticleService; import com.epmet.service.voice.ArticleTagsService; import com.epmet.service.voice.ArticleVisitRecordService; @@ -27,7 +26,6 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.stream.Collectors; @@ -44,16 +42,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { @Autowired private DimAgencyService dimAgencyService; @Autowired - private DimDateService dimDateService; - @Autowired - private DimWeekService dimWeekService; - @Autowired - private DimMonthService dimMonthService; - @Autowired - private DimQuarterService dimQuarterService; - @Autowired - private DimYearService dimYearService; - @Autowired private DimCustomerService dimCustomerService; @Autowired private DimGridService dimGridService; @@ -64,8 +52,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { @Autowired private ArticleService articleService; @Autowired - private ArticlePublishRangeService articlePublishRangeService; - @Autowired private ArticleVisitRecordService articleVisitRecordService; @Autowired private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService; @@ -117,7 +103,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private ExecutorService executorService; @Override - public Boolean articlePublishedCountDayStats(Date statsDate) { + public Boolean articleSummaryDailyStatsjob(Date statsDate) { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 @@ -134,7 +120,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { Date finalStatsDate = statsDate; - executorService.submit(() -> { + try { //key:所在机关Id Map agencySummaryMap = new HashMap<>(); @@ -144,7 +130,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } catch (Exception e) { log.error("articlePublishedCountDayStats exception", e); } - }); + } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -152,7 +138,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } @Override - public Boolean tagUsedDayStatsjob(Date statsDate) { + public Boolean tagUsedDailyStatsjob(Date statsDate) { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { @@ -181,7 +167,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } @Override - public Boolean tagUsedMonthStatsjob(Date statsDate) { + public Boolean tagUsedMonthlyStatsjob(Date statsDate) { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 @@ -193,7 +179,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { int pageNo = 1; int pageSize = 100; List customerIdList = null; - CountDownLatch countDownLatch = new CountDownLatch(1); do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { @@ -201,29 +186,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { executorService.submit(() -> { try { statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); - countDownLatch.countDown(); } catch (Exception e) { log.error("statsTagUsedMonthly exception", e); } }); - executorService.submit(() -> { - try { - countDownLatch.await(); - log.debug("start === statsTagUsedQuarterly "); - statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); - } catch (Exception e) { - log.error("statsTagUsedQuarterly exception", e); - } - }); - executorService.submit(() -> { - try { - countDownLatch.await(); - log.debug("start === statsTagUsedQuarterly "); - statsTagUsedYearly(dimIdBean.getYearId(), customerId); - } catch (Exception e) { - log.error("statsTagUsedYearly exception", e); - } - }); } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -231,7 +197,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } @Override - public Boolean tagViewedDayStatsjob(Date statsDate) { + public Boolean tagViewedDailyStatsjob(Date statsDate) { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { @@ -260,7 +226,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } @Override - public Boolean tagViewedMonthStatsjob(Date statsDate) { + public Boolean tagViewedMonthlyStatsjob(Date statsDate) { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 @@ -272,26 +238,81 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { int pageNo = 1; int pageSize = 100; List customerIdList = null; - CountDownLatch countDownLatch = new CountDownLatch(1); do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { - if (!"6c8cfc2c14afeb6d3664b3e283fc9074".equals(customerId)) { - continue; - } executorService.submit(() -> { try { statsTagViewedMonthly(dimIdBean.getMonthId(), customerId); - countDownLatch.countDown(); } catch (Exception e) { log.error("statsTagViewedMonthly exception", e); } }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + return true; + } + @Override + public Boolean tagUsedQuarterlyStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + executorService.submit(() -> { + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedQuarterly exception", e); + } + }); + executorService.submit(() -> { + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedYearly(dimIdBean.getYearId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedYearly exception", e); + } + }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + return true; + } + + @Override + public Boolean tagViewedQuarterlyStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { executorService.submit(() -> { try { - countDownLatch.await(); log.debug("start === statsTagViewedQuarterly "); statsTagViewedQuarterly(dimIdBean.getQuarterId(), customerId); } catch (Exception e) { @@ -300,7 +321,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); executorService.submit(() -> { try { - countDownLatch.await(); log.debug("start === statsTagViewedYearly "); statsTagViewedYearly(dimIdBean.getYearId(), customerId); } catch (Exception e) { @@ -320,25 +340,27 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { log.warn("publicitySummary getDepartmentListByCustomerId return empty,customerId:{}", customerId); return; } - //转换为 需要插入的Entity - Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); - //获取当天的业务数据 - List publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId, DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN)); - - if (!CollectionUtils.isEmpty(publishedArticleCount)) { - for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { - FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId()); - if (gridDailyEntities == null) { - log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); - continue; + executorService.submit(()->{ + //转换为 需要插入的Entity + Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId, DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN)); + + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId()); + if (gridDailyEntities == null) { + log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); + continue; + } + gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); } - gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); - gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); - //同一个机关下数据累加 - buildAgencySummaryData(agencySummaryMap, summaryDTO); } - } - boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + }); } /** @@ -374,33 +396,33 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param agencySummaryMap */ private void statsPublishedGridDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { - //key:所在机关Id - Map result = new HashMap<>(); //获取所有网格 List gridDTOList = dimGridService.getGridListByCustomerId(customerId); if (CollectionUtils.isEmpty(gridDTOList)) { log.warn("publicitySummary getGridListByCustomerId return empty,customerId:{}", customerId); return; } - - //转换为 需要插入的Entity - Map gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean); - //获取当天的业务数据 - List publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate); - if (!CollectionUtils.isEmpty(publishedArticleCount)) { - for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { - FactArticlePublishedGridDailyEntity gridDailyEntity = gridDailyEntityMap.get(summaryDTO.getGridId()); - if (gridDailyEntity == null) { - log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId()); - continue; + executorService.submit(()->{ + //转换为 需要插入的Entity + Map gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate); + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedGridDailyEntity gridDailyEntity = gridDailyEntityMap.get(summaryDTO.getGridId()); + if (gridDailyEntity == null) { + log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId()); + continue; + } + gridDailyEntity.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntity.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); } - gridDailyEntity.setArticleTotalCount(summaryDTO.getArticleTotalCount()); - gridDailyEntity.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); - //同一个机关下数据累加 - buildAgencySummaryData(agencySummaryMap, summaryDTO); } - } - boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values()); + boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values()); + }); + } private void statsPublishedAgencyDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { @@ -410,40 +432,43 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); return; } - //转换为 需要插入的Entity - Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); - //获取当天的业务数据 - List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate); - Map haveDataAgencyDailyMap = new HashMap<>(); - if (!CollectionUtils.isEmpty(publishedArticleCount)) { - for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { - FactArticlePublishedAgencyDailyEntity gridDailyEntities = agencyDailyEntityMap.get(summaryDTO.getPublisherId()); - if (gridDailyEntities == null) { - log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); - continue; + executorService.submit(()->{ + //转换为 需要插入的Entity + Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate); + Map haveDataAgencyDailyMap = new HashMap<>(); + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedAgencyDailyEntity gridDailyEntities = agencyDailyEntityMap.get(summaryDTO.getPublisherId()); + if (gridDailyEntities == null) { + log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); + continue; + } + gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); + haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); } - gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); - gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); - //同一个机关下数据累加 - buildAgencySummaryData(agencySummaryMap, summaryDTO); - haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); } - } - //数据向上级机关添加 - if (!CollectionUtils.isEmpty(haveDataAgencyDailyMap)) { - for (Map.Entry entry : haveDataAgencyDailyMap.entrySet()) { - String agencyId = entry.getKey(); - FactArticlePublishedAgencyDailyEntity summary = entry.getValue(); - FactArticlePublishedAgencyDailyEntity dailyEntity = agencyDailyEntityMap.get(agencyId); - if (dailyEntity == null) { - log.error("publicitySummary bizData agencyId:{} not exist in dimAgency", agencyId); - continue; + //数据向上级机关添加 + if (!CollectionUtils.isEmpty(haveDataAgencyDailyMap)) { + for (Map.Entry entry : haveDataAgencyDailyMap.entrySet()) { + String agencyId = entry.getKey(); + FactArticlePublishedAgencyDailyEntity summary = entry.getValue(); + FactArticlePublishedAgencyDailyEntity dailyEntity = agencyDailyEntityMap.get(agencyId); + if (dailyEntity == null) { + log.error("publicitySummary bizData agencyId:{} not exist in dimAgency", agencyId); + continue; + } + setPublishedData2ParentAgency(agencyDailyEntityMap, summary, dailyEntity); } - setPublishedData2ParentAgency(agencyDailyEntityMap, summary, dailyEntity); } - } - boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); + boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); + }); + } /** @@ -502,6 +527,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { case ProjectConstant.PUBLISHER_TYPE_DEPT: convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean); break; + case ProjectConstant.PUBLISHER_TYPE_AGENCY: + convertTagUsedAgencyDailyEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailyMap, articleEntity, tagEntity, dimIdBean); + break; } } @@ -511,7 +539,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { Map finalTagUsedAgencyDailyMap = new HashMap<>(); finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailyMap); for (Map.Entry entry : tagUsedAgencyDailyMap.entrySet()) { - String agencyId = entry.getKey(); + String agencyId = entry.getKey().split(StrConstant.UNDER_LINE)[0]; FactTagUsedAgencyDailyEntity currentEntity = entry.getValue(); DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); if (dimAgencyEntity == null) { @@ -616,7 +644,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List gridMonthlyList = ConvertUtils.sourceToTarget(deptDailyList, FactTagUsedDepartmentMonthlyEntity.class); factTagUsedDepartmentMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); } - List agencyDailyList = factTagUsedAgencyDailyService.getTagUsedCountByMonth(customerId, monthId); + List agencyDailyList = factTagUsedAgencyDailyService.getTagUsedCountByMonth(customerId, monthId); if (!CollectionUtils.isEmpty(agencyDailyList)) { List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagUsedAgencyMonthlyEntity.class); factTagUsedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); @@ -923,15 +951,15 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } private void convertTagUsedAgencyDailyEntity(String pid, Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { - String publisherId = articleEntity.getPublisherId(); + String agencyId = articleEntity.getOrgId(); String tagId = tagEntity.getTagId(); - String key = publisherId.concat(StrConstant.UNDER_LINE).concat(tagId); + String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); FactTagUsedAgencyDailyEntity entity = result.get(key); if (entity == null) { entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); entity.setPid(pid); entity.setCustomerId(articleEntity.getCustomerId()); - entity.setAgencyId(publisherId); + entity.setAgencyId(agencyId); entity.setTagId(tagId); entity.setTagName(tagEntity.getTagName()); entity.setUsedCount(1); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java index 2c7c0f523c..cd82c81628 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java @@ -23,4 +23,12 @@ public interface CustomerGridService { * @author zxc */ List selectAgencyGridTotalCount(List community, String dateId); + + /** + * @Description 获取客户下某个时间点以前的网格ID + * @param customerId + * @param dateId + * @author zxc + */ + List getCustomerGridIdList(String customerId,String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java index 3e2c071400..d3e7a51087 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java @@ -34,4 +34,15 @@ public class CustomerGridServiceImpl implements CustomerGridService { public List selectAgencyGridTotalCount(List community, String dateId) { return customerGridDao.selectAgencyGridTotalCount(community,dateId); } + + /** + * @Description 获取客户下某个时间点以前的网格ID + * @param customerId + * @param dateId + * @author zxc + */ + @Override + public List getCustomerGridIdList(String customerId, String dateId) { + return customerGridDao.getCustomerGridIdList(customerId, dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index 79342835d7..45929aebb7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -19,6 +19,7 @@ package com.epmet.service.project; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectGridDTO; import com.epmet.entity.project.ProjectEntity; import java.util.List; @@ -57,4 +58,24 @@ public interface ProjectService extends BaseService { * @return java.util.List */ List getAgencyClosedProjectInc(String customerId, String date); + + /** + * 已结案项目统计 + * @author zhaoqifeng + * @date 2020/6/18 17:04 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridClosedProjectTotal(String customerId, String date); + + /** + * 已结案项目增量 + * @author zhaoqifeng + * @date 2020/6/18 17:04 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridClosedProjectInc(String customerId, String date); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index b757a52799..0a5bac27b6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -22,6 +22,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectDao; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectGridDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.service.project.ProjectService; import org.springframework.beans.factory.annotation.Autowired; @@ -59,4 +60,14 @@ public class ProjectServiceImpl extends BaseServiceImpl getGridClosedProjectTotal(String customerId, String date) { + return baseDao.selectGridClosedProjectTotal(customerId, date); + } + + @Override + public List getGridClosedProjectInc(String customerId, String date) { + return baseDao.selectGridClosedProjectInc(customerId, date); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java index 30ff917431..913525715a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java @@ -24,7 +24,6 @@ import com.epmet.dto.group.result.AgencyGroupDailyResultDTO; import com.epmet.dto.group.result.AgencyGroupMonthlyResultDTO; import com.epmet.dto.stats.FactGroupAgencyDailyDTO; import com.epmet.entity.stats.FactGroupAgencyDailyEntity; -import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -102,14 +101,14 @@ public interface FactGroupAgencyDailyService extends BaseService agencyList); + void insertGroupAgencyDaily(List agencyList,String customerId); /** * @Description 获取 网格小组【机关-日统计】的最后一天数据 * @param * @author zxc */ - List getLastDayAgency(); + List getLastDayAgency(String monthId); /** * @Description 查询 月的小组增量 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java index b8e1ad06ab..bcf2157ecd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java @@ -99,5 +99,5 @@ public interface FactGroupGridDailyService extends BaseService formDto); + void statisticsGroupGridDaily(List formDto,String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java index 0e96cc1835..ebd176bb4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java @@ -92,4 +92,14 @@ public interface FactIssueAgencyMonthlyService extends BaseService + */ + List getAgencyMonthlyInc(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java index 99a9a36769..302c320653 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java @@ -92,4 +92,14 @@ public interface FactIssueGridMonthlyService extends BaseService + */ + List getGridMonthlyInc(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java index 1dfa4bd1f3..da57ca03b9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java @@ -46,5 +46,5 @@ public interface FactTagUsedAgencyDailyService extends BaseService getTagUsedCountByMonth(String customerId, String monthId); + List getTagUsedCountByMonth(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java index dc34d3b9e7..6dd5a0705b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java @@ -103,14 +103,15 @@ public class FactGroupAgencyDailyServiceImpl extends BaseServiceImpl agencyList) { + public void insertGroupAgencyDaily(List agencyList,String customerId) { if (agencyList.size() != NumConstant.ZERO){ + baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId(),customerId); baseDao.insertGroupAgencyDaily(agencyList); } @@ -121,8 +122,8 @@ public class FactGroupAgencyDailyServiceImpl extends BaseServiceImpl getLastDayAgency(){ - return baseDao.getLastDayAgency(); + public List getLastDayAgency(String monthId){ + return baseDao.getLastDayAgency(monthId); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java index 85a216373d..a9ba8ff7ac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java @@ -108,6 +108,7 @@ public class FactGroupAgencyMonthlyServiceImpl extends BaseServiceImpl formDto) { + public void statisticsGroupGridDaily(List formDto,String customerId) { if (formDto.size() == NumConstant.ZERO){ return; } + String dateId = formDto.get(NumConstant.ZERO).getDateId(); + baseDao.deleteInsertDateId(dateId,customerId); baseDao.insertGroupGridDaily(formDto); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java index a4d64c92c4..47db53b737 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java @@ -98,4 +98,9 @@ public class FactIssueAgencyMonthlyServiceImpl extends BaseServiceImpl getAgencyMonthlyInc(String customerId, String monthId) { + return baseDao.selectAgencyMonthlyInc(customerId, monthId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java index 33b00ffd2e..1c084b836a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java @@ -97,4 +97,9 @@ public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl getGridMonthlyInc(String customerId, String monthId) { + return baseDao.selectGridMonthlyInc(customerId, monthId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java index 97961d6b0b..7eef72f9d7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java @@ -56,7 +56,7 @@ public class FactTagUsedAgencyDailyServiceImpl extends BaseServiceImpl getTagUsedCountByMonth(String customerId, String monthId) { + public List getTagUsedCountByMonth(String customerId, String monthId) { if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql index f188d95e6a..cd25dce6a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql @@ -3,17 +3,17 @@ /* Navicat Premium Data Transfer - Source Server : localhost + Source Server : 亿联 Source Server Type : MySQL - Source Server Version : 50720 - Source Host : localhost:3306 - Source Schema : pd + Source Server Version : 50728 + Source Host : 192.168.1.130:3306 + Source Schema : epmet_data_statistical Target Server Type : MySQL - Target Server Version : 50720 + Target Server Version : 50728 File Encoding : 65001 - Date: 16/06/2020 18:04:53 + Date: 22/06/2020 16:40:46 */ SET NAMES utf8mb4; @@ -44,10 +44,6 @@ CREATE TABLE `fact_article_published_agency_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【机关】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_article_published_agency_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_article_published_department_daily -- ---------------------------- @@ -73,10 +69,6 @@ CREATE TABLE `fact_article_published_department_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【部门】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_article_published_department_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_article_published_grid_daily -- ---------------------------- @@ -102,10 +94,6 @@ CREATE TABLE `fact_article_published_grid_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【网格】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_article_published_grid_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_agency_daily -- ---------------------------- @@ -132,10 +120,6 @@ CREATE TABLE `fact_tag_used_agency_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_agency_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_agency_monthly -- ---------------------------- @@ -149,6 +133,8 @@ CREATE TABLE `fact_tag_used_agency_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -158,10 +144,6 @@ CREATE TABLE `fact_tag_used_agency_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_agency_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_agency_quarterly -- ---------------------------- @@ -175,6 +157,7 @@ CREATE TABLE `fact_tag_used_agency_quarterly` ( `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -184,10 +167,6 @@ CREATE TABLE `fact_tag_used_agency_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_agency_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_agency_yearly -- ---------------------------- @@ -210,10 +189,6 @@ CREATE TABLE `fact_tag_used_agency_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_agency_yearly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_department_daily -- ---------------------------- @@ -241,10 +216,6 @@ CREATE TABLE `fact_tag_used_department_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_department_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_department_monthly -- ---------------------------- @@ -258,6 +229,8 @@ CREATE TABLE `fact_tag_used_department_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -267,10 +240,6 @@ CREATE TABLE `fact_tag_used_department_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_department_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_department_quarterly -- ---------------------------- @@ -284,6 +253,7 @@ CREATE TABLE `fact_tag_used_department_quarterly` ( `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -293,10 +263,6 @@ CREATE TABLE `fact_tag_used_department_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_department_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_department_yearly -- ---------------------------- @@ -319,10 +285,6 @@ CREATE TABLE `fact_tag_used_department_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_department_yearly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_grid_daily -- ---------------------------- @@ -349,10 +311,6 @@ CREATE TABLE `fact_tag_used_grid_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_grid_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_grid_monthly -- ---------------------------- @@ -366,6 +324,8 @@ CREATE TABLE `fact_tag_used_grid_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -375,10 +335,6 @@ CREATE TABLE `fact_tag_used_grid_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_grid_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_grid_quarterly -- ---------------------------- @@ -392,6 +348,7 @@ CREATE TABLE `fact_tag_used_grid_quarterly` ( `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -401,10 +358,6 @@ CREATE TABLE `fact_tag_used_grid_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_grid_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_grid_yearly -- ---------------------------- @@ -427,10 +380,6 @@ CREATE TABLE `fact_tag_used_grid_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_grid_yearly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_agency_daily -- ---------------------------- @@ -457,10 +406,6 @@ CREATE TABLE `fact_tag_viewed_agency_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_agency_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_agency_monthly -- ---------------------------- @@ -474,6 +419,8 @@ CREATE TABLE `fact_tag_viewed_agency_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -483,10 +430,6 @@ CREATE TABLE `fact_tag_viewed_agency_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_agency_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_agency_quarterly -- ---------------------------- @@ -500,6 +443,7 @@ CREATE TABLE `fact_tag_viewed_agency_quarterly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -509,10 +453,6 @@ CREATE TABLE `fact_tag_viewed_agency_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_agency_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_agency_yearly -- ---------------------------- @@ -535,10 +475,6 @@ CREATE TABLE `fact_tag_viewed_agency_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_agency_yearly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_grid_daily -- ---------------------------- @@ -565,10 +501,6 @@ CREATE TABLE `fact_tag_viewed_grid_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_grid_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_grid_monthly -- ---------------------------- @@ -582,6 +514,8 @@ CREATE TABLE `fact_tag_viewed_grid_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -591,10 +525,6 @@ CREATE TABLE `fact_tag_viewed_grid_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_grid_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_grid_quarterly -- ---------------------------- @@ -608,6 +538,7 @@ CREATE TABLE `fact_tag_viewed_grid_quarterly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -617,10 +548,6 @@ CREATE TABLE `fact_tag_viewed_grid_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_grid_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_grid_yearly -- ---------------------------- @@ -643,8 +570,5 @@ CREATE TABLE `fact_tag_viewed_grid_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_grid_yearly --- ---------------------------- - SET FOREIGN_KEY_CHECKS = 1; + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index 021a38a005..968ca9d83d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -14,6 +14,7 @@ DEL_FLAG = 0 AND state = #{state} AND customer_id = #{customerId} + AND DATE_FORMAT(created_time,'%Y%m%d') #{dateId} GROUP BY grid_id @@ -31,6 +32,7 @@ AND rg.state = #{state} AND rg.customer_id = #{customerId} AND rgm.status != #{status} + AND DATE_FORMAT(rgm.created_time,'%Y%m%d') #{dateId} GROUP BY rg.grid_id @@ -49,6 +51,7 @@ AND rg.state = #{state} AND rg.customer_id = #{customerId} AND rgm.STATUS != #{status} + AND DATE_FORMAT(rgm.created_time,'%Y%m%d') #{dateId} GROUP BY rgm.resi_group_id @@ -63,7 +66,7 @@ WHERE state = #{state} AND customer_id = #{customerId} - AND DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) = #{yesterday} + AND DATE_FORMAT( CREATED_TIME, '%Y%m%d' ) = #{dateId} GROUP BY grid_id @@ -80,6 +83,7 @@ DEL_FLAG = 0 AND state = 'approved' AND grid_id = #{grid} + AND DATE_FORMAT(created_time,'%Y%m%d') #{dateId} GROUP BY grid_id @@ -99,6 +103,7 @@ AND rg.state = 'approved' AND rg.grid_id = #{grid} AND rgm.status != 'removed' + AND DATE_FORMAT(rgm.created_time,'%Y%m%d') #{dateId} GROUP BY rg.grid_id @@ -118,6 +123,7 @@ AND rg.state = 'approved' AND rg.grid_id = #{grid} AND rgm.STATUS != 'removed' + AND DATE_FORMAT(rgm.created_time,'%Y%m%d') #{dateId} GROUP BY rgm.resi_group_id @@ -134,7 +140,7 @@ WHERE state = 'approved' AND grid_id = #{grid} - AND DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) = #{yesterday} + AND DATE_FORMAT( CREATED_TIME, '%Y%m%d' ) = #{dateId} GROUP BY grid_id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml index 68c4c3fb22..3120f939d8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml @@ -28,7 +28,7 @@ WHERE i.DEL_FLAG = '0' AND i.CUSTOMER_ID = #{customerId} - AND DATE(ip.ip.CREATED_TIME) = #{date} + AND DATE(ip.CREATED_TIME) = #{date} GROUP BY i.ORG_ID, ip.ISSUE_STATUS @@ -67,6 +67,88 @@ ORG_ID, RESOLVE_TYPE + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index ef57855903..7c20a18f4c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -48,5 +48,33 @@ GROUP BY AGENCY_ID, CLOSED_STATUS + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml index 283cd62e9b..d2ef1b2a30 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml @@ -32,13 +32,14 @@ INSERT INTO fact_group_agency_daily ( - ID, AGENCY_ID, PID, DATE_ID, WEEK_ID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL_COUNT, GROUP_MEMBER_TOTAL_COUNT, + ID, CUSTOMER_ID, AGENCY_ID, PID, DATE_ID, WEEK_ID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL_COUNT, GROUP_MEMBER_TOTAL_COUNT, GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, GROUP_MEMBER_MIN_COUNT, MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) values ( REPLACE(UUID(),'-',''), + #{agency.customerId}, #{agency.agencyId}, #{agency.pid}, #{agency.dateId}, @@ -67,9 +68,10 @@ - SELECT ID AS id, + customer_id AS customerId, AGENCY_ID AS agencyId, PID AS pid, MONTH_ID AS monthId, @@ -87,11 +89,13 @@ MIN_MEMBER_GROUP_ID AS minMemberGroupId FROM fact_group_agency_daily - WHERE del_flag = '0' - GROUP BY - AGENCY_ID - ORDER BY - DATE_ID DESC + WHERE + del_flag = '0' + AND DATE_FORMAT(date_id,'%Y%m') = #{monthId} + GROUP BY + AGENCY_ID + ORDER BY + DATE_ID DESC @@ -108,5 +112,14 @@ agency_id + + + DELETE + FROM + fact_group_agency_daily + WHERE + date_id = #{dateId} + AND customer_id = #{customerId} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml index 73f80a1ce0..cb0187485f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml @@ -30,7 +30,7 @@ INSERT INTO fact_group_agency_monthly - (ID, AGENCY_ID, PID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL, GROUP_MEMBER_TOTAL, + (ID, CUSTOMER_ID, AGENCY_ID, PID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL, GROUP_MEMBER_TOTAL, GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, GROUP_MEMBER_MIN_COUNT, MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) @@ -38,6 +38,7 @@ ( REPLACE(UUID(),'-',''), + #{agency.customerId}, #{agency.agencyId}, #{agency.pid}, #{agency.monthId}, @@ -63,5 +64,13 @@ + + + DELETE + FROM + fact_group_agency_monthly + WHERE + month_id = #{monthId} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml index 03b90c7c14..8c8ab22e50 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml @@ -31,13 +31,14 @@ - INSERT INTO fact_group_grid_daily (ID, AGENCY_ID, GRID_ID, DATE_ID, WEEK_ID, MONTH_ID, YEAR_ID, QUARTER_ID, GRID_TOTAL, + INSERT INTO fact_group_grid_daily (ID, CUSTOMER_ID, AGENCY_ID, GRID_ID, DATE_ID, WEEK_ID, MONTH_ID, YEAR_ID, QUARTER_ID, GRID_TOTAL, GROUP_TOTAL, GROUP_MEMBER_TOTAL, GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, GROUP_MEMBER_MIN_COUNT, MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) VALUES ( REPLACE(UUID(),'-',''), + #{grid.customerId}, #{grid.agencyId}, #{grid.gridId}, #{grid.dateId}, @@ -65,4 +66,14 @@ + + + DELETE + FROM + fact_group_grid_daily + WHERE + date_id = #{dateId} + AND customer_id = #{customerId} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml index 24e3e22dad..f6bdd808cb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml @@ -44,5 +44,26 @@ + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml index 69538d9534..56896b9f0d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml @@ -44,5 +44,26 @@ - + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml index bd19d31fd0..b99b5e409b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml @@ -6,7 +6,7 @@ DELETE FROM fact_tag_used_agency_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} - SELECT CUSTOMER_ID, PID, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml index ccbe4c211b..05d22a1a38 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml @@ -28,6 +28,7 @@ + SELECT rs.ROLE_ID, rs.OPERATION_KEY, rs.SCOPE_KEY, os.SCOPE_INDEX, os.SERIES, os.SORT + FROM role_scope rs + INNER JOIN operation_scope os ON (rs.SCOPE_KEY = os.SCOPE_KEY) + WHERE rs.DEL_FLAG = 0 + AND rs.ROLE_ID = #{roleId} + ORDER BY rs.OPERATION_KEY ASC + + + + + SELECT * + FROM operation_scope_default WHERE DEL_FLAG=0 + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDefaultDao.xml b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDefaultDao.xml index dfd74bfea0..98cd9f675b 100755 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDefaultDao.xml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/mapper/RoleOperationDefaultDao.xml @@ -15,6 +15,11 @@ + + + DELETE FROM role_operation_default WHERE ROLE_KEY = #{roleKey} AND OPERATION_KEY = #{operationKey} + + - + \ No newline at end of file diff --git a/epmet-module/gov-grid/gov-grid-client/pom.xml b/epmet-module/gov-grid/gov-grid-client/pom.xml index 297cb07121..5c477c501f 100644 --- a/epmet-module/gov-grid/gov-grid-client/pom.xml +++ b/epmet-module/gov-grid/gov-grid-client/pom.xml @@ -19,6 +19,12 @@ org.projectlombok lombok + + com.epmet + epmet-commons-tools + 2.0.0 + compile + diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/DeletePartyMemberFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/DeletePartyMemberFormDTO.java new file mode 100644 index 0000000000..bcce3cb4bd --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/DeletePartyMemberFormDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 删除党员入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/18 18:05 + */ +@Data +public class DeletePartyMemberFormDTO implements Serializable { + private static final long serialVersionUID = 2325963253025239121L; + + public interface AddUserInternalGroup {} + /** + * 党员id + */ + @NotBlank(message = "党员id不能为空",groups = {PartyMemberIdFormDTO.AddUserInternalGroup.class}) + private String partyMemberId; + + /** + * 党支部id + */ + @NotBlank(message = "党支部id不能为空",groups = {PartyMemberIdFormDTO.AddUserInternalGroup.class}) + private String partyBranchId; + +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchAddFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchAddFormDTO.java new file mode 100644 index 0000000000..3de9a6f231 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchAddFormDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 添加党支部入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 12:35 + */ +@Data +public class PartyBranchAddFormDTO implements Serializable { + private static final long serialVersionUID = -8102877381223078842L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {AddUserInternalGroup.class}) + private String customerId; + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空", groups = {AddUserInternalGroup.class}) + private String gridId; + + /** + * 党支部名称 + */ + @NotBlank(message = "请输入支部名称", groups = {AddUserShowGroup.class}) + @Length(max = 20, message = "支部名称不能超过20个字", groups = AddUserShowGroup.class) + private String partyBranchName; + + /** + * 党支部概要信息 + */ + @Length(max = 500, message = "支部概要信息不能超过500个字", groups = AddUserShowGroup.class) + private String profile; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchEditFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchEditFormDTO.java new file mode 100644 index 0000000000..d4f03416a6 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchEditFormDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 修改党支部信息入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 14:00 + */ +@Data +public class PartyBranchEditFormDTO implements Serializable { + private static final long serialVersionUID = -6739109166420798965L; + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "党支部id不能为空", groups = {AddUserInternalGroup.class}) + private String partyBranchId; + /** + * 党支部名称 + */ + @NotBlank(message = "请输入支部名称", groups = {AddUserShowGroup.class}) + @Length(max = 20, message = "支部名称不能超过20个字", groups = AddUserShowGroup.class) + private String partyBranchName; + + /** + * 党支部概要信息 + */ + @NotBlank(message = "请输入支部概要信息", groups = {AddUserShowGroup.class}) + @Length(max = 500, message = "支部概要信息不能超过500个字", groups = AddUserShowGroup.class) + private String profile; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchIdFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchIdFormDTO.java new file mode 100644 index 0000000000..1849a8481b --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchIdFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 党支部id + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 17:02 + */ +@Data +public class PartyBranchIdFormDTO implements Serializable { + private static final long serialVersionUID = 5321430865413383354L; + public interface AddUserInternalGroup { + } + /** + * 党支部id + */ + @NotBlank(message = "党支部id不能为空",groups = {AddUserInternalGroup.class}) + private String partyBranchId; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchListFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchListFormDTO.java new file mode 100644 index 0000000000..5f1c8681e4 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyBranchListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 3、党支部列表查询入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 16:11 + */ +@Data +public class PartyBranchListFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空", groups = {PartyBranchListFormDTO.AddUserInternalGroup.class}) + private String customerId; + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空", groups = {PartyBranchListFormDTO.AddUserInternalGroup.class}) + private String gridId; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyMemberIdFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyMemberIdFormDTO.java new file mode 100644 index 0000000000..1e69866bbf --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/PartyMemberIdFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 党员id + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/18 14:48 + */ +@Data +public class PartyMemberIdFormDTO implements Serializable { + private static final long serialVersionUID = 3088195909670495675L; + + public interface AddUserInternalGroup {} + /** + * 党员id + */ + @NotBlank(message = "党员id不能为空",groups = {AddUserInternalGroup.class}) + private String partyMemberId; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/SaveOrUpdateParyMemberFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/SaveOrUpdateParyMemberFormDTO.java new file mode 100644 index 0000000000..3414805602 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/SaveOrUpdateParyMemberFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 新增、修改党员入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 22:15 + */ +@Data +public class SaveOrUpdateParyMemberFormDTO implements Serializable { + private static final long serialVersionUID = -6896349967046364830L; + + public interface UpdatePatyMemberGroup { + } + + public interface SavePatyMemberGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "党支部id不能为空", groups = {SavePatyMemberGroup.class}) + private String partyBranchId; + + @NotBlank(message = "姓名不能为空", groups = {AddUserShowGroup.class}) + private String name; + + @NotBlank(message = "身份证不能为空", groups = {AddUserShowGroup.class}) + private String idCard; + + @NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class}) + private String mobile; + + @NotBlank(message = "党员id不能为空", groups = {UpdatePatyMemberGroup.class}) + private String partyMemberId; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchAddResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchAddResultDTO.java new file mode 100644 index 0000000000..a959eb8e1a --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchAddResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 添加党支部返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 12:45 + */ +@Data +public class PartyBranchAddResultDTO implements Serializable { + private static final long serialVersionUID = 5610858988982913682L; + /** + * 党支部id + */ + private String partyBranchId; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchInfoResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchInfoResultDTO.java new file mode 100644 index 0000000000..df3b4bc492 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchInfoResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党支部详情信息返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 21:45 + */ +@Data +public class PartyBranchInfoResultDTO implements Serializable { + private static final long serialVersionUID = 1184531127569286576L; + + /** + * 党支部id + */ + private String partyBranchId; + + /** + * 党支部名称 + */ + private String partyBranchName; + + /** + * 党支部概要 + */ + private String profile; + + /** + * 党支部所属网格名称 + */ + private String gridName; + + /** + * 党支部所属网格id + */ + private String gridId; + + public PartyBranchInfoResultDTO(){ + this.partyBranchId=""; + this.partyBranchName=""; + this.profile=""; + this.gridName=""; + } +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchListResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchListResultDTO.java new file mode 100644 index 0000000000..8057699458 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyBranchListResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 3、党支部列表查询返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 16:13 + */ +@Data +public class PartyBranchListResultDTO implements Serializable { + private static final long serialVersionUID = 8342529186641647970L; + /** + * 支部id + */ + private String partyBranchId; + /** + * 支部名称 + */ + private String partyBranchName; + + /** + * 党员总数 + */ + private Integer totalPartyMember; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberIdResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberIdResultDTO.java new file mode 100644 index 0000000000..09f2e6b1a9 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberIdResultDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党员id:添加党员后返参、修改党员后返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 22:13 + */ +@Data +public class PartyMemberIdResultDTO implements Serializable { + private static final long serialVersionUID = 7467454908831748131L; + private String partyMemberId; +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberInfoDetailResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberInfoDetailResultDTO.java new file mode 100644 index 0000000000..b64a8b5462 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberInfoDetailResultDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党员信息详情返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/18 15:19 + */ +@Data +public class PartyMemberInfoDetailResultDTO implements Serializable { + private static final long serialVersionUID = -4887670791276512339L; + /** + * 党员id + */ + private String partyMemberId; + + /** + * 姓名 + */ + private String name; + + /** + * 身份证号 + */ + private String idCard; + + /** + * 手机号 + */ + private String mobile; + + /** + * 1男2女0未知 + */ + private String gender; + + /** + * true已激活,false未激活 + */ + private Boolean status; + + /** + * 返回:账号于2019年10月31日在海泊桥社区-第一网格激活 + */ + private String activeDesc; + + /** + * 党支部名称(机关-网格-支部名) + */ + private String partyBranchName; + + /** + * 党支部id + */ + private String partyBranchId; + + public PartyMemberInfoDetailResultDTO(){ + this.partyMemberId=""; + this.name=""; + this.idCard=""; + this.mobile=""; + this.gender=""; + this.status=Boolean.FALSE; + this.activeDesc=""; + this.partyBranchName=""; + this.partyBranchId=""; + } +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberInfoResultDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberInfoResultDTO.java new file mode 100644 index 0000000000..7f812531c5 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/result/PartyMemberInfoResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党员列表返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/18 10:04 + */ +@Data +public class PartyMemberInfoResultDTO implements Serializable { + private static final long serialVersionUID = 627412197353847930L; + /** + * 党员id + */ + private String partyMemberId; + + /** + * 姓名 + */ + private String name; + + /** + * 性别1男2女0未知 + */ + private String gender; +} diff --git a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml index 4189f2d981..1cd20945f9 100644 --- a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-grid-server: container_name: gov-grid-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-grid-server:0.3.30 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-grid-server:0.3.36 ports: - "8097:8097" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml index 889491379c..08aedd497f 100644 --- a/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-grid/gov-grid-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-grid-server: container_name: gov-grid-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-grid-server:0.3.30 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-grid-server:0.3.36 ports: - "8097:8097" network_mode: host # 使用现有网络 @@ -14,4 +14,4 @@ services: resources: limits: cpus: '0.1' - memory: 400M \ No newline at end of file + memory: 350M \ No newline at end of file diff --git a/epmet-module/gov-grid/gov-grid-server/pom.xml b/epmet-module/gov-grid/gov-grid-server/pom.xml index d31e134a9a..4e0313a293 100644 --- a/epmet-module/gov-grid/gov-grid-server/pom.xml +++ b/epmet-module/gov-grid/gov-grid-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.3.30 + 0.3.36 com.epmet gov-grid diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/PartyBranchManageController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/PartyBranchManageController.java new file mode 100644 index 0000000000..c74412719a --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/PartyBranchManageController.java @@ -0,0 +1,179 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.RequirePermission; +import com.epmet.commons.tools.enums.RequirePermissionEnum; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.service.PartyBranchManageService; +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/17 12:25 + */ +@RestController +@RequestMapping("partybranch") +public class PartyBranchManageController { + @Autowired + private PartyBranchManageService partyBranchManageService; + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 添加党支部 + * @Date 2020/6/17 12:47 + **/ + @PostMapping("add") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_PARTY_BRANCH_ADD) + public Result addPartyBranch(@RequestBody PartyBranchAddFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PartyBranchAddFormDTO.AddUserShowGroup.class, PartyBranchAddFormDTO.AddUserInternalGroup.class); + PartyBranchAddResultDTO partyBranchAddResultDTO = partyBranchManageService.addPartyBranch(formDTO); + return new Result().ok(partyBranchAddResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 修改党支部信息 + * @Date 2020/6/17 15:31 + **/ + @PostMapping("edit") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_PARTY_BRANCH_EDIT) + public Result editPartyBranch(@RequestBody PartyBranchEditFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PartyBranchEditFormDTO.AddUserShowGroup.class, PartyBranchEditFormDTO.AddUserInternalGroup.class); + partyBranchManageService.editPartyBranch(formDTO); + PartyBranchAddResultDTO partyBranchAddResultDTO = new PartyBranchAddResultDTO(); + partyBranchAddResultDTO.setPartyBranchId(formDTO.getPartyBranchId()); + return new Result().ok(partyBranchAddResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @description 党支部列表查询 + * @Date 2020/6/17 16:15 + **/ + @PostMapping("list") + public Result> listPartyBranch(@RequestBody PartyBranchListFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PartyBranchListFormDTO.AddUserInternalGroup.class); + return new Result>().ok(partyBranchManageService.listPartyBranch(formDTO)); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 删除党支部 + * @Date 2020/6/17 18:23 + **/ + @PostMapping("delete") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_PARTY_BRANCH_DELETE) + public Result deleteBranch(@RequestBody PartyBranchIdFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + partyBranchManageService.deleteBranch(formDTO.getPartyBranchId()); + return new Result(); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 5、党支部详情信息查询 + * @Date 2020/6/17 21:49 + **/ + @PostMapping("info") + public Result queryPartyBranchInfo(@RequestBody PartyBranchIdFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO,PartyBranchIdFormDTO.AddUserInternalGroup.class); + PartyBranchInfoResultDTO partyBranchInfoResultDTO = partyBranchManageService.queryPartyBranchInfo(formDTO.getPartyBranchId()); + return new Result().ok(partyBranchInfoResultDTO); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 6、党员列表查询 + * @Date 2020/6/18 0:17 + **/ + @PostMapping("/partymember/list") + public Result> listPartyMember(@RequestBody PartyBranchIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,PartyBranchIdFormDTO.AddUserInternalGroup.class); + List list=partyBranchManageService.listPartyMember(formDTO.getPartyBranchId()); + return new Result>().ok(list); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 7、添加党员 + * @Date 2020/6/17 22:25 + **/ + @PostMapping("/partymember/add") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_PARTY_MEMBER_ADD) + public Result addPartyMember(@RequestBody SaveOrUpdateParyMemberFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SaveOrUpdateParyMemberFormDTO.AddUserShowGroup.class + , SaveOrUpdateParyMemberFormDTO.SavePatyMemberGroup.class); + PartyMemberIdResultDTO partyMemberIdResultDTO = new PartyMemberIdResultDTO(); + partyMemberIdResultDTO.setPartyMemberId(partyBranchManageService.addPartyMember(formDTO)); + return new Result().ok(partyMemberIdResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 8、编辑党员 + * @Date 2020/6/17 23:29 + **/ + @PostMapping("/partymember/edit") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_PARTY_MEMBER_EDIT) + public Result editPartyMember(@RequestBody SaveOrUpdateParyMemberFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SaveOrUpdateParyMemberFormDTO.AddUserShowGroup.class + , SaveOrUpdateParyMemberFormDTO.UpdatePatyMemberGroup.class); + PartyMemberIdResultDTO partyMemberIdResultDTO = new PartyMemberIdResultDTO(); + partyMemberIdResultDTO.setPartyMemberId(partyBranchManageService.editPartyMember(formDTO)); + return new Result().ok(partyMemberIdResultDTO); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 10、党员详情 + * @Date 2020/6/18 15:25 + **/ + @PostMapping("/partymember/detail") + public Result queryPartyMemberDetail(@RequestBody PartyMemberIdFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, PartyMemberIdFormDTO.AddUserInternalGroup.class); + return new Result().ok(partyBranchManageService.queryPartyMemberDetail(formDTO.getPartyMemberId())); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param deletePartyMemberFormDTO + * @author yinzuomei + * @description 删除党员 + * @Date 2020/6/18 17:51 + **/ + @PostMapping("partymember/delete") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_GRASSROOTS_PARTY_MEMBER_DELETE) + public Result deletePartyMember(@RequestBody DeletePartyMemberFormDTO deletePartyMemberFormDTO){ + ValidatorUtils.validateEntity(deletePartyMemberFormDTO, DeletePartyMemberFormDTO.AddUserInternalGroup.class); + partyBranchManageService.deletePartyMember(deletePartyMemberFormDTO); + return new Result(); + } +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/PartyBranchManageService.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/PartyBranchManageService.java new file mode 100644 index 0000000000..e87a4dad57 --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/PartyBranchManageService.java @@ -0,0 +1,104 @@ +package com.epmet.service; + +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; + +import java.util.List; + +/** + * 基层治理-支部管理 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 12:47 + */ +public interface PartyBranchManageService { + /** + * @param formDTO + * @return com.epmet.dto.result.PartyBranchAddResultDTO + * @author yinzuomei + * @description 添加党支部 + * @Date 2020/6/17 13:24 + **/ + PartyBranchAddResultDTO addPartyBranch(PartyBranchAddFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.dto.result.PartyBranchAddResultDTO + * @author yinzuomei + * @description 修改党支部信息 + * @Date 2020/6/17 14:30 + **/ + void editPartyBranch(PartyBranchEditFormDTO formDTO); + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 党支部列表查询 + * @Date 2020/6/17 16:15 + **/ + List listPartyBranch(PartyBranchListFormDTO formDTO); + + /** + * @return void + * @param partyBranchId + * @author yinzuomei + * @description 删除党支部 + * @Date 2020/6/17 17:04 + **/ + void deleteBranch(String partyBranchId); + + /** + * @return com.epmet.dto.result.PartyBranchInfoResultDTO + * @param partyBranchId + * @author yinzuomei + * @description 5、党支部详情信息查询 + * @Date 2020/6/17 21:49 + **/ + PartyBranchInfoResultDTO queryPartyBranchInfo(String partyBranchId); + + /** + * @return java.util.List + * @param partyBranchId + * @author yinzuomei + * @description 党员列表查询 + * @Date 2020/6/18 10:06 + **/ + List listPartyMember(String partyBranchId); + + /** + * @return java.lang.String + * @param formDTO + * @author yinzuomei + * @description 7、添加党员 + * @Date 2020/6/17 22:26 + **/ + String addPartyMember(SaveOrUpdateParyMemberFormDTO formDTO); + + /** + * @return java.lang.String + * @param formDTO + * @author yinzuomei + * @description 8、编辑党员 + * @Date 2020/6/17 23:29 + **/ + String editPartyMember(SaveOrUpdateParyMemberFormDTO formDTO); + + /** + * @param partyMemberId + * @return com.epmet.dto.result.PartyMemberInfoDetailResultDTO + * @author yinzuomei + * @description 10、党员详情:根据党员id查询党员详情 + * @Date 2020/6/18 15:25 + **/ + PartyMemberInfoDetailResultDTO queryPartyMemberDetail(String partyMemberId); + + /** + * @return void + * @param deletePartyMemberFormDTO + * @author yinzuomei + * @description 删除党员 + * @Date 2020/6/18 17:51 + **/ + void deletePartyMember(DeletePartyMemberFormDTO deletePartyMemberFormDTO); +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/PartyBranchManageServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/PartyBranchManageServiceImpl.java new file mode 100644 index 0000000000..0cf320e03f --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/PartyBranchManageServiceImpl.java @@ -0,0 +1,219 @@ +package com.epmet.service.impl; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerPartyBranchDTO; +import com.epmet.dto.form.*; +import com.epmet.dto.result.*; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.DelPartyMemberBaseInfoFormDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberBaseInfoAddFormDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartyMemberBaseInfoDetailResultDTO; +import com.epmet.resi.partymember.dto.partymember.result.PartymemberBaseInfoResultDTO; +import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; +import com.epmet.service.PartyBranchManageService; +import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * 基层治理-支部管理 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 13:23 + */ +@Service +public class PartyBranchManageServiceImpl implements PartyBranchManageService { + private Logger logger = LogManager.getLogger(PartyBranchManageServiceImpl.class); + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient; + + @Override + public PartyBranchAddResultDTO addPartyBranch(PartyBranchAddFormDTO formDTO) { + CustomerPartyBranchDTO customerPartyBranchDTO = ConvertUtils.sourceToTarget(formDTO, CustomerPartyBranchDTO.class); + customerPartyBranchDTO.setTotalPartyMember(0); + PartyBranchAddResultDTO partyBranchAddResultDTO = new PartyBranchAddResultDTO(); + Result result = govOrgOpenFeignClient.savePartyBranch(customerPartyBranchDTO); + if (result.success()) { + partyBranchAddResultDTO.setPartyBranchId(result.getData()); + } else { + logger.error("添加党支部错误,调用gov-org-server接口返回失败"); + } + return partyBranchAddResultDTO; + } + + @Override + public void editPartyBranch(PartyBranchEditFormDTO formDTO) { + CustomerPartyBranchDTO customerPartyBranchDTO = ConvertUtils.sourceToTarget(formDTO, CustomerPartyBranchDTO.class); + customerPartyBranchDTO.setId(formDTO.getPartyBranchId()); + Result result = govOrgOpenFeignClient.updatePartyBranch(customerPartyBranchDTO); + if (result.success()) { + logger.info("修改党支部信息成功"); + } + } + + @Override + public List listPartyBranch(PartyBranchListFormDTO formDTO) { + ListPartyBranchFormDTO listPartyBranchFormDTO = ConvertUtils.sourceToTarget(formDTO, ListPartyBranchFormDTO.class); + Result> result = govOrgOpenFeignClient.listPartyBranch(listPartyBranchFormDTO); + List resultList=result.getData(); + if (result.success()) { + List list = ConvertUtils.sourceToTarget(resultList, PartyBranchListResultDTO.class); + return list; + } else { + logger.error(String.format("党支部列表查询失败入参:"), JSON.toJSONString(formDTO)); + } + return new ArrayList<>(); + } + + @Override + public void deleteBranch(String partyBranchId) { + Result customerPartyBranchDTOResult = govOrgOpenFeignClient.getPartyBranchById(partyBranchId); + if (!customerPartyBranchDTOResult.success()||null==customerPartyBranchDTOResult.getData()) { + logger.error(String.format("查询党支部信息失败入参:partyBranchId=%s",partyBranchId)); + return; + }else{ + if (null != customerPartyBranchDTOResult.getData() && customerPartyBranchDTOResult.getData().getTotalPartyMember() > 0) { + throw new RenException(EpmetErrorCode.CANNOT_DELETE_PARTY_BRANCH.getCode()); + } + } + Result delteResult=govOrgOpenFeignClient.deletePartyBranchById(partyBranchId); + if(!delteResult.success()){ + logger.error(String.format("删除党支部失败入参:partyBranchId=%s",partyBranchId)); + } + } + + @Override + public PartyBranchInfoResultDTO queryPartyBranchInfo(String partyBranchId) { + PartyBranchInfoResultDTO partyBranchInfo = new PartyBranchInfoResultDTO(); + Result customerPartyBranchDTOResult = govOrgOpenFeignClient.getPartyBranchById(partyBranchId); + if (!customerPartyBranchDTOResult.success() || null == customerPartyBranchDTOResult.getData()) { + logger.error(String.format("党支部详情信息查询异常,partyBranchId=%s", partyBranchId)); + return partyBranchInfo; + } + partyBranchInfo.setPartyBranchId(partyBranchId); + partyBranchInfo.setPartyBranchName(customerPartyBranchDTOResult.getData().getPartyBranchName()); + partyBranchInfo.setProfile(customerPartyBranchDTOResult.getData().getProfile()); + partyBranchInfo.setGridId(customerPartyBranchDTOResult.getData().getGridId()); + Result gridInfoResult = govOrgOpenFeignClient.queryGridInfo(customerPartyBranchDTOResult.getData().getGridId()); + if (gridInfoResult.success() && null != gridInfoResult.getData() && StringUtils.isNotBlank(gridInfoResult.getData().getParentAgencyName())) { + partyBranchInfo.setGridName(String.format("%s-%s", gridInfoResult.getData().getParentAgencyName(), gridInfoResult.getData().getGridName())); + } else { + logger.error(String.format("查询网格基本信息失败,gridId=%s", customerPartyBranchDTOResult.getData().getGridId())); + } + return partyBranchInfo; + } + + @Override + public List listPartyMember(String partyBranchId) { + Result> result = resiPartyMemberOpenFeignClient.listPartyMemberBaseInfo(partyBranchId); + if (result.success()) { + List list = ConvertUtils.sourceToTarget(result.getData(), PartyMemberInfoResultDTO.class); + return list; + } + logger.error("党员列表查询失败"); + return new ArrayList<>(); + } + + @Override + public String addPartyMember(SaveOrUpdateParyMemberFormDTO formDTO) { + //1、查询党支部信息 + Result customerPartyBranchResult = govOrgOpenFeignClient.getPartyBranchById(formDTO.getPartyBranchId()); + if (!customerPartyBranchResult.success() || null == customerPartyBranchResult.getData()) { + throw new RenException("党支部信息获取失败"); + } + //2、构造党员入参 + CustomerPartyBranchDTO customerPartyBranch = customerPartyBranchResult.getData(); + PartyMemberBaseInfoAddFormDTO partyMemberBaseInfoAddFormDTO = this.getPartyMemberBaseInfoAddFormDTO(formDTO, customerPartyBranch); + Result result = resiPartyMemberOpenFeignClient.addPartyMemberBaseInfo(partyMemberBaseInfoAddFormDTO); + //3、党支部总人数+1 + if (result.success() && StringUtils.isNotBlank(result.getData())) { + //党支部总人数+1 + customerPartyBranch.setTotalPartyMember(customerPartyBranch.getTotalPartyMember() + 1); + Result updatePartyBranchResult = govOrgOpenFeignClient.updatePartyBranch(customerPartyBranch); + if (updatePartyBranchResult.success()) { + logger.info(String.format("党支部(%s)总人数+1", formDTO.getPartyBranchId())); + } + } else { + logger.error("添加党员异常"); + throw new RenException(result.getCode()); + } + return result.getData(); + } + + @Override + public String editPartyMember(SaveOrUpdateParyMemberFormDTO formDTO) { + PartymemberBaseInfoDTO partymemberBaseInfoDTO = new PartymemberBaseInfoDTO(); + partymemberBaseInfoDTO.setIdCard(formDTO.getIdCard().trim()); + partymemberBaseInfoDTO.setName(formDTO.getName().trim()); + partymemberBaseInfoDTO.setMobile(formDTO.getMobile().trim()); + partymemberBaseInfoDTO.setId(formDTO.getPartyMemberId()); + Result updateResult = resiPartyMemberOpenFeignClient.update(partymemberBaseInfoDTO); + if (updateResult.success() && StringUtils.isNotBlank(updateResult.getData())) { + logger.info("修改党员信息成功"); + return updateResult.getData(); + }else{ + logger.error("修改党员信息失败"); + throw new RenException(updateResult.getCode()); + } + } + + @Override + public PartyMemberInfoDetailResultDTO queryPartyMemberDetail(String partyMemberId) { + PartyMemberInfoDetailResultDTO partyMemberInfoDetailResultDTO=new PartyMemberInfoDetailResultDTO(); + Result partyMemberResult=resiPartyMemberOpenFeignClient.queryPartyMemberBaseInfoById(partyMemberId); + if(partyMemberResult.success()&&null!=partyMemberResult.getData()){ + partyMemberInfoDetailResultDTO=ConvertUtils.sourceToTarget(partyMemberResult.getData(),PartyMemberInfoDetailResultDTO.class); + Result partyBranchDTOResult=govOrgOpenFeignClient.getPartyBranchById(partyMemberResult.getData().getPartyBranchId()); + if(partyBranchDTOResult.success()){ + String agencyName=partyBranchDTOResult.getData().getAgencyName(); + String gridName=partyBranchDTOResult.getData().getGridName(); + String branchName=partyBranchDTOResult.getData().getPartyBranchName(); + partyMemberInfoDetailResultDTO.setPartyBranchName(String.format("%s-%s-%s",agencyName,gridName,branchName)); + return partyMemberInfoDetailResultDTO; + }else{ + logger.error("党员详情查询异常"); + } + } + return partyMemberInfoDetailResultDTO ; + } + + @Override + public void deletePartyMember(DeletePartyMemberFormDTO deletePartyMemberFormDTO) { + DelPartyMemberBaseInfoFormDTO formDTO = ConvertUtils.sourceToTarget(deletePartyMemberFormDTO, DelPartyMemberBaseInfoFormDTO.class); + Result result = resiPartyMemberOpenFeignClient.deltePartyMemberBaseInfo(formDTO); + if (!result.success()) { + throw new RenException(result.getCode()); + } + //党支部总人数-1 + Result decrResult = govOrgOpenFeignClient.decrPartyBranchMember(deletePartyMemberFormDTO.getPartyBranchId()); + if (decrResult.success()) { + logger.info("删除党员成功,党支部总人数已-1"); + } + } + + private PartyMemberBaseInfoAddFormDTO getPartyMemberBaseInfoAddFormDTO(SaveOrUpdateParyMemberFormDTO formDTO, + CustomerPartyBranchDTO customerPartyBranchDTO) { + PartyMemberBaseInfoAddFormDTO partyMemberBaseInfoAddFormDTO=new PartyMemberBaseInfoAddFormDTO(); + partyMemberBaseInfoAddFormDTO.setBranchId(formDTO.getPartyBranchId()); + partyMemberBaseInfoAddFormDTO.setIdCard(formDTO.getIdCard().trim()); + partyMemberBaseInfoAddFormDTO.setMobile(formDTO.getMobile().trim()); + partyMemberBaseInfoAddFormDTO.setName(formDTO.getName().trim()); + + partyMemberBaseInfoAddFormDTO.setBranch(customerPartyBranchDTO.getPartyBranchName()); + partyMemberBaseInfoAddFormDTO.setOrganization(customerPartyBranchDTO.getAgencyName()); + partyMemberBaseInfoAddFormDTO.setCustomerId(customerPartyBranchDTO.getCustomerId()); + return partyMemberBaseInfoAddFormDTO; + } +} diff --git a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml index 7825e009a5..56d3dd745b 100644 --- a/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-issue-server: container_name: gov-issue-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-issue-server:0.3.42 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-issue-server:0.3.43 ports: - "8101:8101" network_mode: host # 使用现有网络 @@ -14,4 +14,4 @@ services: resources: limits: cpus: '0.1' - memory: 400M \ No newline at end of file + memory: 350M \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index e92c8aa434..2dd11868f2 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.42 + 0.3.43 gov-issue com.epmet diff --git a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-dev.yml b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-dev.yml index 16a76313ad..d8052e5fba 100644 --- a/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-mine/gov-mine-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-mine-server: container_name: gov-mine-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-mine-server:0.3.27 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-mine-server:0.3.29 ports: - "8098:8098" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-mine/gov-mine-server/pom.xml b/epmet-module/gov-mine/gov-mine-server/pom.xml index d57997ab36..06d94d62d1 100644 --- a/epmet-module/gov-mine/gov-mine-server/pom.xml +++ b/epmet-module/gov-mine/gov-mine-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.27 + 0.3.29 com.epmet gov-mine diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerPartyBranchDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerPartyBranchDTO.java new file mode 100644 index 0000000000..c396f90605 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerPartyBranchDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class CustomerPartyBranchDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 支部名称 + */ + private String partyBranchName; + + /** + * 概要 + */ + private String profile; + + /** + * 党支部所属网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 党员总数 + */ + private Integer totalPartyMember; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 网格所属机关id + */ + private String agencyId; + + /** + * 网格所属机关名字 + */ + private String agencyName; +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListPartyBranchFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListPartyBranchFormDTO.java new file mode 100644 index 0000000000..ede50112e5 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/ListPartyBranchFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 党支部列表查询 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 16:27 + */ +@Data +public class ListPartyBranchFormDTO implements Serializable { + private static final long serialVersionUID = -5693132528876149747L; + + /** + * 客户id + */ + @NotBlank(message = "客户id不能为空") + private String customerId; + + /** + * 网格id + */ + @NotBlank(message = "网格id不能为空") + private String gridId; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java index fff7b43caf..83bf82bfbf 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GridInfoResultDTO.java @@ -77,5 +77,15 @@ public class GridInfoResultDTO implements Serializable { * 省级组织名称 */ private String proviceName; + + /** + * 网格所属机关id + */ + private String parentAgencyId; + + /** + * 网格所属机关名称 + */ + private String parentAgencyName; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java index 8a5249c6ae..3c96aa6df6 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java @@ -21,9 +21,15 @@ public class LatestCustomerResultDTO implements Serializable { */ private String customerName; /** - * 用户所属组织id(任意一条) + * 用户所属组织id */ private String agencyId; + + /** + * 用户所属组织名称 + */ + private String agencyName; + /** * 工作人员头像 */ diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ListPartyBranchResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ListPartyBranchResultDTO.java new file mode 100644 index 0000000000..b5d7e6cbce --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ListPartyBranchResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 党支部列表查询返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/17 16:30 + */ +@Data +public class ListPartyBranchResultDTO implements Serializable { + private static final long serialVersionUID = 2306892144298853581L; + /** + * 支部id + */ + private String partyBranchId; + /** + * 支部名称 + */ + private String partyBranchName; + + /** + * 党员总数 + */ + private Integer totalPartyMember; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java index f19eb67cea..241f2eb44f 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/MineResultDTO.java @@ -40,4 +40,14 @@ public class MineResultDTO implements Serializable { * 角色 */ private List roleList; + + /** + * 我所属的机关id + */ + private String agencyId; + + /** + * 我所属的机关名称 + */ + private String myAgencyName; } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index ff0a23f716..99bccaa484 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -1,16 +1,20 @@ package com.epmet.feign; +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerPartyBranchDTO; +import com.epmet.dto.form.ListPartyBranchFormDTO; import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.dto.result.ListPartyBranchResultDTO; import com.epmet.dto.result.PublishAgencyListResultDTO; +import com.epmet.feign.fallback.GovOrgOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.*; -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.CustomerAgencyDTO; -import com.epmet.feign.fallback.GovOrgOpenFeignClientFallback; +import java.util.List; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -18,14 +22,13 @@ import com.epmet.feign.fallback.GovOrgOpenFeignClientFallback; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:37 */ -// @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = -// "localhost:8092") +// @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class, url = "localhost:8092") @FeignClient(name = ServiceConstant.GOV_ORG_SERVER, fallback = GovOrgOpenFeignClientFallback.class) public interface GovOrgOpenFeignClient { /** * 根据Id查询agency - * + * * @param agencyId * @return */ @@ -34,7 +37,7 @@ public interface GovOrgOpenFeignClient { /** * 根据staffId查询所属的组织机构 - * + * * @param staffId * @return */ @@ -58,4 +61,74 @@ public interface GovOrgOpenFeignClient { **/ @PostMapping(value = "gov/org/customeragency/getpublishagencylist/{staffId}", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result getPublishAgencyList(@PathVariable("staffId") String staffId); + + /** + * @param customerPartyBranchDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 添加党支部 + * @Date 2020/6/17 13:36 + **/ + @PostMapping(value = "gov/org/customerpartybranch/save", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result savePartyBranch(@RequestBody CustomerPartyBranchDTO customerPartyBranchDTO); + + /** + * @param customerPartyBranchDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 修改党支部信息 + * @Date 2020/6/17 15:31 + **/ + @PutMapping(value = "gov/org/customerpartybranch/update", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result updatePartyBranch(@RequestBody CustomerPartyBranchDTO customerPartyBranchDTO); + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 根据客户id、网格id查询党支部列表 + * @Date 2020/6/17 16:28 + **/ + @PostMapping(value = "gov/org/customerpartybranch/listpartybranch", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result> listPartyBranch(@RequestBody ListPartyBranchFormDTO formDTO); + + /** + * @param partyBranchId + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 根据党支部id,查询党支部信息 + * @Date 2020/6/17 18:01 + **/ + @GetMapping(value = "gov/org/customerpartybranch/get/{id}") + Result getPartyBranchById(@PathVariable("id") String partyBranchId); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param partyBranchId + * @author yinzuomei + * @description 根据党支部id,删除党支部(存在党员的不允许删除) + * @Date 2020/6/17 18:08 + **/ + @GetMapping(value = "gov/org/customerpartybranch/delete/{id}") + Result deletePartyBranchById(@PathVariable("id") String partyBranchId); + + /** + * @param gridId + * @return com.epmet.commons.tools.utils.Result + * @Author yinzuomei + * @Description 根据网格id查询所属组织信息 + * @Date 2020/4/26 23:16 + **/ + @GetMapping("/gov/org/customergrid/getGridInfo/{gridId}") + Result queryGridInfo(@PathVariable("gridId") String gridId); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param partyBranchId + * @author yinzuomei + * @description 党支部宗人数-1 + * @Date 2020/6/18 18:28 + **/ + @GetMapping(value = "gov/org/customerpartybranch/decrPartyBranchMember/{partyBranchId}") + Result decrPartyBranchMember(@PathVariable("partyBranchId") String partyBranchId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 8f6c108a7d..bcc224dd86 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -4,11 +4,17 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerPartyBranchDTO; +import com.epmet.dto.form.ListPartyBranchFormDTO; import com.epmet.dto.result.ArticleGridResultDTO; +import com.epmet.dto.result.GridInfoResultDTO; +import com.epmet.dto.result.ListPartyBranchResultDTO; import com.epmet.dto.result.PublishAgencyListResultDTO; import com.epmet.feign.GovOrgOpenFeignClient; import org.springframework.stereotype.Component; +import java.util.List; + /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 * @@ -37,4 +43,38 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getPublishAgencyList", staffId); } + @Override + public Result savePartyBranch(CustomerPartyBranchDTO customerPartyBranchDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "save", customerPartyBranchDTO); + } + + @Override + public Result updatePartyBranch(CustomerPartyBranchDTO customerPartyBranchDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "update", customerPartyBranchDTO); + } + + @Override + public Result> listPartyBranch(ListPartyBranchFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "listpartybranch", formDTO); + } + + @Override + public Result getPartyBranchById(String partyBranchId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "get", partyBranchId); + } + + @Override + public Result deletePartyBranchById(String partyBranchId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "deleteById", partyBranchId); + } + + @Override + public Result queryGridInfo(String gridId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridInfo",gridId); + } + + @Override + public Result decrPartyBranchMember(String partyBranchId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "decrPartyBranchMember",partyBranchId); + } } diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml index b126058bb6..03baf78da2 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.66 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-org-server:0.3.69 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml index 8df1c9c874..57f13f3fc7 100644 --- a/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-org/gov-org-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-org-server: container_name: gov-org-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-org-server:0.3.66 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-org-server:0.3.67 ports: - "8092:8092" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-org/gov-org-server/pom.xml b/epmet-module/gov-org/gov-org-server/pom.xml index d7df708edb..bab4db384b 100644 --- a/epmet-module/gov-org/gov-org-server/pom.xml +++ b/epmet-module/gov-org/gov-org-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.66 + 0.3.69 com.epmet gov-org diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerPartyBranchController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerPartyBranchController.java new file mode 100644 index 0000000000..04ebd8e0a0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerPartyBranchController.java @@ -0,0 +1,132 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.controller; + +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.dto.CustomerPartyBranchDTO; +import com.epmet.dto.form.ListPartyBranchFormDTO; +import com.epmet.dto.result.ListPartyBranchResultDTO; +import com.epmet.excel.CustomerPartyBranchExcel; +import com.epmet.service.CustomerPartyBranchService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@RestController +@RequestMapping("customerpartybranch") +public class CustomerPartyBranchController { + + @Autowired + private CustomerPartyBranchService customerPartyBranchService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = customerPartyBranchService.page(params); + return new Result>().ok(page); + } + + @GetMapping("get/{id}") + public Result get(@PathVariable("id") String id){ + CustomerPartyBranchDTO data = customerPartyBranchService.get(id); + return new Result().ok(data); + } + + @PostMapping("save") + public Result save(@RequestBody CustomerPartyBranchDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + return new Result().ok(customerPartyBranchService.save(dto)); + } + + @PutMapping("update") + public Result update(@RequestBody CustomerPartyBranchDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + customerPartyBranchService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + customerPartyBranchService.delete(ids); + return new Result(); + } + + @GetMapping("delete/{id}") + public Result deleteById(@PathVariable("id") String id){ + CustomerPartyBranchDTO data = customerPartyBranchService.get(id); + if(null!=data&&data.getTotalPartyMember()>0){ + throw new RenException(EpmetErrorCode.CANNOT_DELETE_PARTY_BRANCH.getCode()); + } + customerPartyBranchService.deleteById(id); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = customerPartyBranchService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, CustomerPartyBranchExcel.class); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 党支部列表查询,供gov-grid服务调用 + * @Date 2020/6/17 16:33 + **/ + @PostMapping("listpartybranch") + public Result> listpartybranch(@RequestBody ListPartyBranchFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + return new Result>().ok(customerPartyBranchService.listpartybranch(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param partyBranchId + * @author yinzuomei + * @description 党支部人数-1 + * @Date 2020/6/18 18:31 + **/ + @GetMapping("decrPartyBranchMember/{partyBranchId}") + public Result decrPartyBranchMember(@PathVariable("partyBranchId") String partyBranchId){ + customerPartyBranchService.decrPartyBranchMember(partyBranchId); + return new Result(); + } +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerPartyBranchDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerPartyBranchDao.java new file mode 100644 index 0000000000..007af50fde --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerPartyBranchDao.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.form.ListPartyBranchFormDTO; +import com.epmet.dto.result.ListPartyBranchResultDTO; +import com.epmet.entity.CustomerPartyBranchEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface CustomerPartyBranchDao extends BaseDao { + //根据客户id、网格id查询党支部列表 + List selectListPartyBranchResultDTO(ListPartyBranchFormDTO formDTO); + + //党支部人数-1 + int decrPartyBranchMember(String partyBranchId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerPartyBranchEntity.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerPartyBranchEntity.java new file mode 100644 index 0000000000..98610e75f7 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/entity/CustomerPartyBranchEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_party_branch") +public class CustomerPartyBranchEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 支部名称 + */ + private String partyBranchName; + + /** + * 概要 + */ + private String profile; + + /** + * 党支部所属网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 党员总数 + */ + private Integer totalPartyMember; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerPartyBranchExcel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerPartyBranchExcel.java new file mode 100644 index 0000000000..7766ed1260 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/excel/CustomerPartyBranchExcel.java @@ -0,0 +1,71 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class CustomerPartyBranchExcel { + + @Excel(name = "主键") + private String id; + + @Excel(name = "支部名称") + private String partyBranchName; + + @Excel(name = "概要") + private String profile; + + @Excel(name = "党支部所属网格id") + private String gridId; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "党员总数") + private Integer totalPartymember; + + @Excel(name = "删除标识") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerPartyBranchRedis.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerPartyBranchRedis.java new file mode 100644 index 0000000000..e5d8d70e5e --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/redis/CustomerPartyBranchRedis.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.redis; + +import com.epmet.commons.tools.redis.RedisUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Component +public class CustomerPartyBranchRedis { + @Autowired + private RedisUtils redisUtils; + + public void delete(Object[] ids) { + + } + + public void set(){ + + } + + public String get(String id){ + return null; + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerPartyBranchService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerPartyBranchService.java new file mode 100644 index 0000000000..e373bcb0f1 --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerPartyBranchService.java @@ -0,0 +1,115 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.CustomerPartyBranchDTO; +import com.epmet.dto.form.ListPartyBranchFormDTO; +import com.epmet.dto.result.ListPartyBranchResultDTO; +import com.epmet.entity.CustomerPartyBranchEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface CustomerPartyBranchService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return CustomerPartyBranchDTO + * @author generator + * @date 2020-06-17 + */ + CustomerPartyBranchDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + String save(CustomerPartyBranchDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(CustomerPartyBranchDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); + + /** + * @return java.util.List + * @param formDTO + * @author yinzuomei + * @description 党支部列表查询,供gov-grid服务调用 + * @Date 2020/6/17 16:33 + **/ + List listpartybranch(ListPartyBranchFormDTO formDTO); + + /** + * @return void + * @param partyBranchId + * @author yinzuomei + * @description 党支部人数-1 + * @Date 2020/6/18 18:31 + **/ + void decrPartyBranchMember(String partyBranchId); +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index bcc4ecf11c..00436e9b59 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -27,7 +27,6 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.CustomerGridConstant; import com.epmet.dao.CustomerAgencyDao; @@ -452,6 +451,8 @@ public class CustomerGridServiceImpl extends BaseServiceImpl + * 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. + *

+ * 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. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.CustomerPartyBranchDao; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerGridDTO; +import com.epmet.dto.CustomerPartyBranchDTO; +import com.epmet.dto.form.ListPartyBranchFormDTO; +import com.epmet.dto.result.ListPartyBranchResultDTO; +import com.epmet.entity.CustomerPartyBranchEntity; +import com.epmet.redis.CustomerPartyBranchRedis; +import com.epmet.service.CustomerAgencyService; +import com.epmet.service.CustomerGridService; +import com.epmet.service.CustomerPartyBranchService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 党支部信息 + * + * @author yinzuomei yinzuomei@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Service +public class CustomerPartyBranchServiceImpl extends BaseServiceImpl implements CustomerPartyBranchService { + + @Autowired + private CustomerPartyBranchRedis customerPartyBranchRedis; + @Autowired + private CustomerGridService customerGridService; + @Autowired + private CustomerAgencyService customerAgencyService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, CustomerPartyBranchDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, CustomerPartyBranchDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public CustomerPartyBranchDTO get(String id) { + CustomerPartyBranchEntity entity = baseDao.selectById(id); + CustomerPartyBranchDTO customerPartyBranchDTO=ConvertUtils.sourceToTarget(entity, CustomerPartyBranchDTO.class); + if(null!=customerPartyBranchDTO){ + CustomerGridDTO customerGridDTO=customerGridService.get(entity.getGridId()); + if(null!=customerGridDTO){ + customerPartyBranchDTO.setGridName(customerGridDTO.getGridName()); + CustomerAgencyDTO customerAgencyDTO=customerAgencyService.get(customerGridDTO.getPid()); + if(null!=customerAgencyDTO){ + customerPartyBranchDTO.setAgencyId(customerAgencyDTO.getId()); + customerPartyBranchDTO.setAgencyName(customerAgencyDTO.getOrganizationName()); + } + } + } + return customerPartyBranchDTO; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public String save(CustomerPartyBranchDTO dto) { + CustomerPartyBranchEntity entity = ConvertUtils.sourceToTarget(dto, CustomerPartyBranchEntity.class); + insert(entity); + return entity.getId(); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(CustomerPartyBranchDTO dto) { + CustomerPartyBranchEntity entity = ConvertUtils.sourceToTarget(dto, CustomerPartyBranchEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public List listpartybranch(ListPartyBranchFormDTO formDTO) { + return baseDao.selectListPartyBranchResultDTO(formDTO); + } + + @Override + public void decrPartyBranchMember(String partyBranchId) { + baseDao.decrPartyBranchMember(partyBranchId); + } + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index 17f9f75731..ba90138f12 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -131,6 +131,11 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl + + + + + + + + + + + + + + + + + + + + + + + + UPDATE customer_party_branch + SET TOTAL_PARTY_MEMBER = TOTAL_PARTY_MEMBER - 1 + WHERE + id = #{partyBranchId} + AND DEL_FLAG = '0' + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml index d55974b2db..16ec28dfbb 100644 --- a/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-project/gov-project-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-project-server: container_name: gov-project-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-project-server:0.3.27 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-project-server:0.3.28 ports: - "8102:8102" network_mode: host # 使用现有网络 @@ -14,4 +14,4 @@ services: resources: limits: cpus: '0.1' - memory: 400M \ No newline at end of file + memory: 350M \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/pom.xml b/epmet-module/gov-project/gov-project-server/pom.xml index 6bec282580..382580cd85 100644 --- a/epmet-module/gov-project/gov-project-server/pom.xml +++ b/epmet-module/gov-project/gov-project-server/pom.xml @@ -2,7 +2,7 @@ - 0.3.27 + 0.3.28 gov-project com.epmet diff --git a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddArticleTagsFormDTO.java b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddArticleTagsFormDTO.java index 06c5b49ab8..da5f4c1504 100644 --- a/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddArticleTagsFormDTO.java +++ b/epmet-module/gov-voice/gov-voice-client/src/main/java/com/epmet/dto/form/AddArticleTagsFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.form; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * @Author zxc @@ -53,6 +54,11 @@ public class AddArticleTagsFormDTO implements Serializable { */ private String createdBy; + /** + * 创建时间 + */ + private Date createdTime; + /** * 更新人 */ diff --git a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml index 80855c22df..a08cd1f375 100644 --- a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml +++ b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-voice-server: container_name: gov-voice-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/gov-voice-server:0.3.54 + image: 192.168.1.130:10080/epmet-cloud-dev/gov-voice-server:0.3.56 ports: - "8105:8105" network_mode: host # 使用现有网络 diff --git a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml index 36b6cb3e26..75870071a0 100644 --- a/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml +++ b/epmet-module/gov-voice/gov-voice-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: gov-voice-server: container_name: gov-voice-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-voice-server:0.3.54 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/gov-voice-server:0.3.55 ports: - "8105:8105" network_mode: host # 使用现有网络 @@ -14,4 +14,4 @@ services: resources: limits: cpus: '0.1' - memory: 400M \ No newline at end of file + memory: 350M \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/pom.xml b/epmet-module/gov-voice/gov-voice-server/pom.xml index 713902afb2..3e684e0f72 100644 --- a/epmet-module/gov-voice/gov-voice-server/pom.xml +++ b/epmet-module/gov-voice/gov-voice-server/pom.xml @@ -3,7 +3,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.3.54 + 0.3.56 gov-voice com.epmet diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java index 7cc723b070..b22716bc16 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/controller/ArticleController.java @@ -105,7 +105,6 @@ public class ArticleController { * @date 2020/6/2 16:50 **/ @PostMapping("oprationlist") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_OPERATION_LIST) public Result> operationList(@RequestBody ArticleOperationFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ArticleOperationFormDTO.AddUserInternalGroup.class); List list = @@ -121,7 +120,6 @@ public class ArticleController { * @date 2020/6/3 9:44 **/ @PostMapping("articledetail") - @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTY_VOICE_DETAIL) public Result articleDetail(@RequestBody GovArticleDetailFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, GovArticleDetailFormDTO.AddUserInternalGroup.class); GovArticleDetailResultDTO articleDetail = articleService.queryGovArticleDetail(formDTO.getArticleId()); diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index 10c59c6450..2e3d296122 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -1058,13 +1058,13 @@ public class ArticleServiceImpl extends BaseServiceImpl updateGridTagCacheDTOS = this.updateGridTag(tokenDto, draftId, updateCustomerTagCacheDTO); - this.addArticleTags(updateCustomerTagCacheDTO, draftId, tokenDto); + this.addArticleTags(updateCustomerTagCacheDTO, draftId, tokenDto, articleEntity.getCreatedTime()); //更新redis try { @@ -1279,10 +1279,11 @@ public class ArticleServiceImpl extends BaseServiceImpl addArticleTags = new ArrayList<>(); List tagsInfo = formDto.getTagsInfo(); DraftDTO draft = draftService.get(draftId); @@ -1296,6 +1297,7 @@ public class ArticleServiceImpl extends BaseServiceImpl - ( REPLACE ( UUID(), '-', '' ),#{tag.customerId}, #{tag.articleId}, #{tag.tagId}, #{tag.tagName}, #{tag.delFlag}, - #{tag.revision}, #{tag.createdBy}, NOW(),#{tag.updatedBy}, NOW()) + ( REPLACE ( UUID(), '-', '' ),#{tag.customerId}, #{tag.articleId}, #{tag.tagId}, #{tag.tagName}, + #{tag.delFlag}, + #{tag.revision}, #{tag.createdBy}, #{tag.createdTime,jdbcType=TIMESTAMP},#{tag.updatedBy}, NOW()) + select * from partymember_auth_record + where DEL_FLAG='0' + and PARTYMEMBER_BASE_INFO_ID=#{partymemberBaseInfoId} + + \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml index 2cbad32ae0..b7aa868f90 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml @@ -120,4 +120,46 @@ applyTime DESC LIMIT #{pageNo},#{pageSize} + + + + + + + + + \ No newline at end of file diff --git a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml index 5802d6a79c..10c2835084 100644 --- a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml +++ b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-openapi-scan: container_name: epmet-openapi-scan-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-openapi-scan:0.3.8 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-openapi-scan:0.3.11 ports: - "8107:8107" network_mode: host # 不会创建新的网络 diff --git a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml index abe98cfc1d..62b847b4d6 100644 --- a/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml +++ b/epmet-openapi/epmet-openapi-scan/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-openapi-scan: container_name: epmet-openapi-scan-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-openapi-scan:0.3.8 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-openapi-scan:0.3.11 ports: - "8107:8107" network_mode: host # 不会创建新的网络 diff --git a/epmet-openapi/epmet-openapi-scan/pom.xml b/epmet-openapi/epmet-openapi-scan/pom.xml index 9bb20ac89a..8a80b425df 100644 --- a/epmet-openapi/epmet-openapi-scan/pom.xml +++ b/epmet-openapi/epmet-openapi-scan/pom.xml @@ -4,7 +4,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - 0.3.8 + 0.3.11 epmet-openapi-scan jar diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java index 6848de234f..709fc7aef4 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/service/impl/ScanServiceImpl.java @@ -12,7 +12,6 @@ import com.aliyuncs.green.model.v20180509.TextScanRequest; import com.aliyuncs.http.FormatType; import com.aliyuncs.http.HttpResponse; import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.openapi.scan.common.constant.SysConstant; import com.epmet.openapi.scan.common.enu.ImgSceneEnum; import com.epmet.openapi.scan.common.enu.SuggestionEnum; @@ -24,9 +23,9 @@ import com.epmet.openapi.scan.support.param.ImgScanParam; import com.epmet.openapi.scan.support.param.ImgTask; import com.epmet.openapi.scan.support.param.TextScanParam; import com.epmet.openapi.scan.support.param.TextTask; -import com.epmet.openapi.scan.support.result.SceneDetailResult; import com.epmet.openapi.scan.support.result.ImgAsyncScanResult; import com.epmet.openapi.scan.support.result.ScanTaskResult; +import com.epmet.openapi.scan.support.result.SceneDetailResult; import com.epmet.openapi.scan.support.result.SyncScanResult; import lombok.extern.slf4j.Slf4j; import org.apache.http.HttpStatus; @@ -189,14 +188,19 @@ public class ScanServiceImpl implements ScanService { //如果是多个场景 则为对个 BaseScanResult List sceneResults = taskResult.getResults(); //是文本检测 目前就一种场景 + boolean isSuccess = true; for (SceneDetailResult sceneResult : sceneResults) { String suggestion = sceneResult.getSuggestion(); - if (SuggestionEnum.BLOCK.getCode().equals(suggestion)) { - result.getFailDataIds().add(taskResult.getDataId()); - } else { - result.getSuccessDataIds().add(taskResult.getDataId()); + if (SuggestionEnum.PASS.getCode().equals(suggestion)) { + isSuccess = false; + break; } } + if (isSuccess){ + result.getFailDataIds().add(taskResult.getDataId()); + } else { + result.getSuccessDataIds().add(taskResult.getDataId()); + } } else { result.getFailDataIds().add(taskResult.getDataId()); log.warn("executeSyncText task process fail:code:{},msg:{}", taskResult.getCode(), taskResult.getMsg()); @@ -284,21 +288,20 @@ public class ScanServiceImpl implements ScanService { } //如果是多个场景 则为对个 BaseScanResult List sceneResults = taskResult.getResults(); - //是文本检测 目前就一种场景 + + boolean isSuccess = true; for (SceneDetailResult sceneResult : sceneResults) { String suggestion = sceneResult.getSuggestion(); if (SuggestionEnum.BLOCK.getCode().equals(suggestion)) { - if (result.getFailDataIds().contains(taskResult.getDataId())) { - continue; - } - result.getFailDataIds().add(taskResult.getDataId()); - } else { - if (result.getSuccessDataIds().contains(taskResult.getDataId())) { - continue; - } - result.getSuccessDataIds().add(taskResult.getDataId()); + isSuccess = false; + break; } } + if (isSuccess){ + result.getSuccessDataIds().add(taskResult.getDataId()); + }else{ + result.getFailDataIds().add(taskResult.getDataId()); + } } return result; } else { diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextScanParam.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextScanParam.java index 16ad063428..2b05d34e20 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextScanParam.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextScanParam.java @@ -26,14 +26,14 @@ public class TextScanParam implements Serializable { * * @see com.epmet.openapi.scan.common.enu.ImgSceneEnum; */ - @Valid - @NotEmpty(message = "任务列表不能为空") private List scenes; /** * 要检测的内容列表,必填 * remark:一组任务列表中的taskId不能相同 */ + @Valid + @NotEmpty(message = "任务列表不能为空") private List tasks; /** diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java index 51586242da..1708d17f32 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/GovStaffRoleResultDTO.java @@ -34,6 +34,7 @@ public class GovStaffRoleResultDTO implements Serializable { private static final long serialVersionUID = 1L; + private String customerId; /** * 角色ID */ @@ -54,6 +55,8 @@ public class GovStaffRoleResultDTO implements Serializable { */ private String roleName; + private String orgType; + /** * 姓名 */ diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java index d3f26332e6..30acef4ea8 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java @@ -33,7 +33,7 @@ public class LoginUserDetailsResultDTO { private Set deptIdList; /** - * 当前登录的组织id + * 当前登录用户所属的机关id */ private String agencyId; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index c8c1848738..51bece6d52 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -24,7 +24,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:09 */ -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class) +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class,url="localhost:8087") public interface EpmetUserOpenFeignClient { /** diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml index d857fabc16..1b546e9355 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-dev.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-dev - image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.58 + image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.60 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml index 1c7cf953b3..5c9f3966ff 100644 --- a/epmet-user/epmet-user-server/deploy/docker-compose-test.yml +++ b/epmet-user/epmet-user-server/deploy/docker-compose-test.yml @@ -2,7 +2,7 @@ version: "3.7" services: epmet-user-server: container_name: epmet-user-server-test - image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.58 + image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-user-server:0.3.59 ports: - "8087:8087" network_mode: host # 不会创建新的网络 diff --git a/epmet-user/epmet-user-server/pom.xml b/epmet-user/epmet-user-server/pom.xml index ee56a0293e..7da3cceed3 100644 --- a/epmet-user/epmet-user-server/pom.xml +++ b/epmet-user/epmet-user-server/pom.xml @@ -2,7 +2,7 @@ 4.0.0 - 0.3.58 + 0.3.60 com.epmet epmet-user diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java new file mode 100644 index 0000000000..8b8ccd1048 --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java @@ -0,0 +1,43 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.RoleDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; +import com.epmet.dto.result.GovStaffRoleTemplateDTO; +import com.epmet.service.GovStaffRoleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +@RequestMapping("govstaffrole") +@RestController +public class GovStaffRoleController { + + @Autowired + private GovStaffRoleService govStaffRoleService; + + /** + * 根据客户ID查询该客户的角色列表 + * @param customerId + * @return + */ + @PostMapping("rolesbycustomer/{customerId}") + public Result listGovStaffRolesByCustomer(@PathVariable("customerId") String customerId) { + List roleEntities = govStaffRoleService.listRolesByCustomer(customerId); + return new Result().ok(roleEntities); + } + + /** + * 查询角色模板列表 + * @return + */ + @PostMapping("roletemplates") + public Result listGovStaffRoleTemplates() { + List roleTemplates = govStaffRoleService.listRoleTemplates(); + return new Result().ok(roleTemplates); + } +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java index 9958251e8f..e7c82100a6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/RoleController.java @@ -49,19 +49,6 @@ public class RoleController { @Autowired private RoleService roleService; - /** - * 根据客户ID查询该客户的角色列表 - * @param customerId - * @return - */ - @PostMapping("rolesbycustomer/{customerId}") - public Result listRolesByCustomer(@PathVariable("customerId") String customerId) { - List roleEntities = roleService.listRolesByCustomer(customerId); - return new Result().ok(roleEntities); - } - - - @GetMapping("page") public Result> page(@RequestParam Map params){ PageData page = roleService.page(params); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java index 907bb84ea1..d7562fafad 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java @@ -19,6 +19,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.GovStaffRoleDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.entity.GovStaffRoleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -56,4 +57,6 @@ public interface GovStaffRoleDao extends BaseDao { * @return */ GovStaffRoleDTO getRoleByCustomerIdAndRoleKey(@Param("customerId") String customerId, @Param("roleKey") String roleKey); + + List listRolesByCustomer(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java index d175c919b1..398406a8cf 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RoleDao.java @@ -41,11 +41,4 @@ public interface RoleDao extends BaseDao { * @return RoleEntity */ RoleEntity selectRoleByKey(RoleEntity param); - - /** - * 通过客户ID查询客户的角色列表 - * @param customerId - * @return - */ - List listRolesByCustomer(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java index d7985c8758..25d6fe495b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.result.GovStaffRoleResultDTO; +import com.epmet.dto.result.GovStaffRoleTemplateDTO; import com.epmet.entity.GovStaffRoleEntity; import java.util.List; @@ -120,4 +121,8 @@ public interface GovStaffRoleService extends BaseService { * @param roleKey */ GovStaffRoleDTO getRoleByCustomerIdAndRoleKey(String customerId, String roleKey); + + List listRolesByCustomer(String customerId); + + List listRoleTemplates(); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java index d758c6a64b..72e055c4b1 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RoleService.java @@ -99,6 +99,4 @@ public interface RoleService extends BaseService { * @return RoleDTO */ RoleDTO getRoleByKey(RoleDTO role); - - List listRolesByCustomer(String customerId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java index fb922499b5..000ea2cd40 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java @@ -29,6 +29,7 @@ import com.epmet.dao.GovStaffRoleDao; import com.epmet.dao.GovStaffRoleTemplateDao; import com.epmet.dto.GovStaffRoleDTO; import com.epmet.dto.form.InitDefaultOperationsFormDTO; +import com.epmet.dto.result.GovStaffRoleResultDTO; import com.epmet.dto.result.GovStaffRoleTemplateDTO; import com.epmet.entity.GovStaffRoleEntity; import com.epmet.feign.GovAccessFeignClient; @@ -165,4 +166,14 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl listRolesByCustomer(String customerId) { + return govStaffRoleDao.listRolesByCustomer(customerId); + } + + @Override + public List listRoleTemplates() { + return govStaffRoleTemplateDao.listValidateRoles(); + } } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java index c95446d0dd..8322ee7226 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RoleServiceImpl.java @@ -106,12 +106,4 @@ public class RoleServiceImpl extends BaseServiceImpl implem RoleEntity entity = baseDao.selectRoleByKey(ConvertUtils.sourceToTarget(role, RoleEntity.class)); return ConvertUtils.sourceToTarget(entity, RoleDTO.class); } - - - - @Override - public List listRolesByCustomer(String customerId) { - return baseDao.listRolesByCustomer(customerId); - } - } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml index 5788da7ba8..aa495b89f5 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml @@ -49,4 +49,14 @@ AND ROLE_KEY = #{roleKey} AND DEL_FLAG = '0' + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/RoleDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/RoleDao.xml index 38e35cf8c3..2bc5147051 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/RoleDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/RoleDao.xml @@ -27,11 +27,4 @@ and ROLE_KEY = #{roleKey} and DEL_FLAG = 0 - - - \ No newline at end of file