14 changed files with 895 additions and 1 deletions
@ -0,0 +1,14 @@ |
|||||
|
package com.epmet.issue.constant; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/6/22 14:07 |
||||
|
*/ |
||||
|
public interface IssueConstant { |
||||
|
String MONTH = "month"; |
||||
|
String DATE = "date"; |
||||
|
String VOTING_NAME = "表决中"; |
||||
|
String SHIFT_NAME = "已转项目"; |
||||
|
String CLOSED_NAME = "已关闭"; |
||||
|
} |
@ -0,0 +1,19 @@ |
|||||
|
package com.epmet.issue.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/6/22 16:32 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IssueIncrtrendFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 4408419854627376175L; |
||||
|
/** |
||||
|
* 类型,按日date 按月month |
||||
|
*/ |
||||
|
private String type; |
||||
|
} |
@ -0,0 +1,206 @@ |
|||||
|
package com.epmet.issue.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.math.BigDecimal; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/6/22 14:11 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IssueDataDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 9136989870868730175L; |
||||
|
/** |
||||
|
* 组织ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
|
||||
|
/** |
||||
|
* 组织名 |
||||
|
*/ |
||||
|
private String agencyName; |
||||
|
|
||||
|
/** |
||||
|
* 网格ID |
||||
|
*/ |
||||
|
private String gridId; |
||||
|
|
||||
|
/** |
||||
|
* 网格名 |
||||
|
*/ |
||||
|
private String gridName; |
||||
|
|
||||
|
/** |
||||
|
* 年度ID |
||||
|
*/ |
||||
|
private String yearId; |
||||
|
|
||||
|
/** |
||||
|
* 年度名 |
||||
|
*/ |
||||
|
private String yearName; |
||||
|
|
||||
|
/** |
||||
|
* 季度ID |
||||
|
*/ |
||||
|
private String quarterId; |
||||
|
|
||||
|
/** |
||||
|
* 季度名 |
||||
|
*/ |
||||
|
private String quarterName; |
||||
|
|
||||
|
/** |
||||
|
* 月度ID |
||||
|
*/ |
||||
|
private String monthId; |
||||
|
|
||||
|
/** |
||||
|
* 月度名 |
||||
|
*/ |
||||
|
private String monthName; |
||||
|
|
||||
|
/** |
||||
|
* 周ID |
||||
|
*/ |
||||
|
private String weekId; |
||||
|
|
||||
|
/** |
||||
|
* 日期ID |
||||
|
*/ |
||||
|
private String dateId; |
||||
|
|
||||
|
/** |
||||
|
* 日期名 |
||||
|
*/ |
||||
|
private String dateName; |
||||
|
|
||||
|
/** |
||||
|
* 当日议题增量 |
||||
|
*/ |
||||
|
private Integer issueIncr; |
||||
|
|
||||
|
/** |
||||
|
* 议题总数 |
||||
|
*/ |
||||
|
private Integer issueTotal; |
||||
|
|
||||
|
/** |
||||
|
* 当日已转项目的议题数增量 |
||||
|
*/ |
||||
|
private Integer shiftProjectIncr; |
||||
|
|
||||
|
/** |
||||
|
* 已转项目的议题总数 |
||||
|
*/ |
||||
|
private Integer shiftProjectTotal; |
||||
|
|
||||
|
/** |
||||
|
* 已转项目所占百分比 |
||||
|
*/ |
||||
|
private BigDecimal shiftProjectPercent; |
||||
|
|
||||
|
/** |
||||
|
* 当日表决中议题数增量 |
||||
|
*/ |
||||
|
private Integer votingIncr; |
||||
|
|
||||
|
/** |
||||
|
* 表决中议题总数 |
||||
|
*/ |
||||
|
private Integer votingTotal; |
||||
|
|
||||
|
/** |
||||
|
* 表决中议题所占百分比 |
||||
|
*/ |
||||
|
private BigDecimal votingPercent; |
||||
|
|
||||
|
/** |
||||
|
* 当日已关闭议题数增量 |
||||
|
*/ |
||||
|
private Integer closedIncr; |
||||
|
|
||||
|
/** |
||||
|
* 当日已关闭议题中已解决数量 |
||||
|
*/ |
||||
|
private Integer closedResolvedIncr; |
||||
|
|
||||
|
/** |
||||
|
* 当日已关闭议题中无需解决数量 |
||||
|
*/ |
||||
|
private Integer closedUnresolvedIncr; |
||||
|
|
||||
|
/** |
||||
|
* 已关闭议题总数 |
||||
|
*/ |
||||
|
private Integer closedTotal; |
||||
|
|
||||
|
/** |
||||
|
* 已关闭议题中已解决总数 |
||||
|
*/ |
||||
|
private Integer closedResolvedTotal; |
||||
|
|
||||
|
/** |
||||
|
* 已关闭议题中未解决总数 |
||||
|
*/ |
||||
|
private Integer closedUnresolvedTotal; |
||||
|
|
||||
|
/** |
||||
|
* 已关闭议题所占百分比 |
||||
|
*/ |
||||
|
private BigDecimal closedPercent; |
||||
|
|
||||
|
/** |
||||
|
* 已关闭议题中已解决百分比 |
||||
|
*/ |
||||
|
private BigDecimal closedResolvedPercent; |
||||
|
|
||||
|
/** |
||||
|
* 已关闭议题中未解决百分比 |
||||
|
*/ |
||||
|
private BigDecimal closedUnresolvedPercent; |
||||
|
|
||||
|
/** |
||||
|
* 当日已结案议题数 |
||||
|
*/ |
||||
|
private Integer closedCaseIncr; |
||||
|
|
||||
|
/** |
||||
|
* 当日已结案议题中已解决数 |
||||
|
*/ |
||||
|
private Integer closedCaseResolvedIncr; |
||||
|
|
||||
|
/** |
||||
|
* 当日已结案议题中未解决数 |
||||
|
*/ |
||||
|
private Integer closedCaseUnresolvedIncr; |
||||
|
|
||||
|
/** |
||||
|
* 已结案议题总数 |
||||
|
*/ |
||||
|
private Integer closedCaseTotal; |
||||
|
|
||||
|
/** |
||||
|
* 已结案议题中已解决总数 |
||||
|
*/ |
||||
|
private Integer closedCaseResolvedTotal; |
||||
|
|
||||
|
/** |
||||
|
* 已结案议题中未解决总数 |
||||
|
*/ |
||||
|
private Integer closedCaseUnresolvedTotal; |
||||
|
|
||||
|
/** |
||||
|
* 已结案议题中已解决百分比 |
||||
|
*/ |
||||
|
private BigDecimal closedCaseResolvedPercent; |
||||
|
|
||||
|
/** |
||||
|
* 已结案议题中未解决百分比 |
||||
|
*/ |
||||
|
private BigDecimal closedCaseUnresolvedPercent; |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.issue.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/6/22 16:30 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class IssueIncrtrendResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 7762529188251385355L; |
||||
|
/** |
||||
|
* 日期 |
||||
|
*/ |
||||
|
private String date; |
||||
|
/** |
||||
|
* 状态(表决中,已转项目,已关闭) |
||||
|
*/ |
||||
|
private String type; |
||||
|
/** |
||||
|
* 数量 |
||||
|
*/ |
||||
|
private Integer value; |
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
package com.epmet.issue.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/6/22 16:24 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class IssueSubAgencyResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 2640337888693960513L; |
||||
|
/** |
||||
|
* 组织ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
/** |
||||
|
* 组织名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
/** |
||||
|
* 类型 表决中,已转项目,已关闭 |
||||
|
*/ |
||||
|
private String type; |
||||
|
/** |
||||
|
* 数量 |
||||
|
*/ |
||||
|
private Integer value; |
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package com.epmet.issue.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/6/22 16:27 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class IssueSubGridResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -3318384216762207856L; |
||||
|
/** |
||||
|
* 网格名 |
||||
|
*/ |
||||
|
private String name; |
||||
|
/** |
||||
|
* 类型 表决中,已转项目,已关闭 |
||||
|
*/ |
||||
|
private String type; |
||||
|
/** |
||||
|
* 数量 |
||||
|
*/ |
||||
|
private Integer value; |
||||
|
} |
@ -0,0 +1,54 @@ |
|||||
|
package com.epmet.issue.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/6/22 16:17 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class IssueSummaryInfoResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -7959140755148294338L; |
||||
|
/** |
||||
|
* 机关ID |
||||
|
*/ |
||||
|
private String agencyId; |
||||
|
/** |
||||
|
* 议题总数 |
||||
|
*/ |
||||
|
private Integer issueTotal; |
||||
|
/** |
||||
|
* 表决中数量 |
||||
|
*/ |
||||
|
private Integer votingTotal; |
||||
|
/** |
||||
|
* 已转项目数量 |
||||
|
*/ |
||||
|
private Integer shiftProjectTotal; |
||||
|
/** |
||||
|
* 已关闭数量 |
||||
|
*/ |
||||
|
private Integer closedTotal; |
||||
|
/** |
||||
|
* 表决中占比 |
||||
|
*/ |
||||
|
private String votingRatio; |
||||
|
/** |
||||
|
* 已转项目占比 |
||||
|
*/ |
||||
|
private String shiftProjectRatio; |
||||
|
/** |
||||
|
* 已关闭占比 |
||||
|
*/ |
||||
|
private String closedRatio; |
||||
|
/** |
||||
|
* 更新至日期 |
||||
|
*/ |
||||
|
private String dateName; |
||||
|
} |
@ -0,0 +1,30 @@ |
|||||
|
package com.epmet.issue.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import lombok.NoArgsConstructor; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @author zhaoqifeng |
||||
|
* @dscription |
||||
|
* @date 2020/6/22 16:21 |
||||
|
*/ |
||||
|
@NoArgsConstructor |
||||
|
@Data |
||||
|
public class IssueSummaryPieResultDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = -971115426789868580L; |
||||
|
/** |
||||
|
* 名称 表决中,已转项目,已关闭 |
||||
|
*/ |
||||
|
private String name; |
||||
|
/** |
||||
|
* 值 |
||||
|
*/ |
||||
|
private Integer value; |
||||
|
/** |
||||
|
* 百分比 |
||||
|
*/ |
||||
|
private String ratio; |
||||
|
} |
@ -0,0 +1,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<com.epmet.issue.dto.result.IssueSummaryInfoResultDTO> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/6/22 17:31 |
||||
|
*/ |
||||
|
@PostMapping("summaryinfo") |
||||
|
public Result<IssueSummaryInfoResultDTO> getSummaryInfo(@LoginUser TokenDto tokenDto) { |
||||
|
return new Result<IssueSummaryInfoResultDTO>().ok(issueService.getSummaryInfo(tokenDto)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 数据汇总饼状图 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.issue.dto.result.IssueSummaryPieResultDTO>> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/6/22 17:31 |
||||
|
*/ |
||||
|
@PostMapping("summarypie") |
||||
|
public Result<List<IssueSummaryPieResultDTO>> getSummaryPie(@LoginUser TokenDto tokenDto) { |
||||
|
return new Result<List<IssueSummaryPieResultDTO>>().ok(issueService.getSummaryPie(tokenDto)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 下级机关议题统计 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.issue.dto.result.IssueSubAgencyResultDTO>> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/6/22 17:31 |
||||
|
*/ |
||||
|
@PostMapping("subagency") |
||||
|
public Result<List<IssueSubAgencyResultDTO>> getSubAgency(@LoginUser TokenDto tokenDto) { |
||||
|
return new Result<List<IssueSubAgencyResultDTO>>().ok(issueService.getSubAgency(tokenDto)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 网格议题统计 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.issue.dto.result.IssueSubGridResultDTO>> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/6/22 17:31 |
||||
|
*/ |
||||
|
@PostMapping("subgrid") |
||||
|
public Result<List<IssueSubGridResultDTO>> getSubGrid(@LoginUser TokenDto tokenDto) { |
||||
|
return new Result<List<IssueSubGridResultDTO>>().ok(issueService.getSubGrid(tokenDto)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 议题分析 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @param formDTO |
||||
|
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.issue.dto.result.IssueIncrtrendResultDTO>> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/6/22 17:31 |
||||
|
*/ |
||||
|
@PostMapping("incrtrend") |
||||
|
public Result<List<IssueIncrtrendResultDTO>> getIncrtrend(@LoginUser TokenDto tokenDto, @RequestBody IssueIncrtrendFormDTO formDTO) { |
||||
|
return new Result<List<IssueIncrtrendResultDTO>>().ok(issueService.getIncrtrend(tokenDto, formDTO)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,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<com.epmet.issue.dto.result.IssueDataDTO> |
||||
|
*/ |
||||
|
List<IssueDataDTO> selectSubAgencyList(@Param("agencyId") String agencyId); |
||||
|
|
||||
|
/** |
||||
|
* 获取机关下网格统计信息 |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/6/22 15:21 |
||||
|
* @param agencyId |
||||
|
* @return java.util.List<com.epmet.issue.dto.result.IssueDataDTO> |
||||
|
*/ |
||||
|
List<IssueDataDTO> selectGridList(@Param("agencyId") String agencyId); |
||||
|
|
||||
|
/** |
||||
|
* 获取当前机关日增量 |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/6/22 15:22 |
||||
|
* @param agencyId |
||||
|
* @return java.util.List<com.epmet.issue.dto.result.IssueDataDTO> |
||||
|
*/ |
||||
|
List<IssueDataDTO> selectAgencyIncDailyList(@Param("agencyId") String agencyId); |
||||
|
|
||||
|
/** |
||||
|
* 获取当前机关月增量 |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/6/22 15:23 |
||||
|
* @param agencyId |
||||
|
* @return java.util.List<com.epmet.issue.dto.result.IssueDataDTO> |
||||
|
*/ |
||||
|
List<IssueDataDTO> selectAgencyIncMonthlyList(@Param("agencyId") String agencyId); |
||||
|
} |
@ -0,0 +1,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<IssueSummaryPieResultDTO> getSummaryPie(TokenDto tokenDto); |
||||
|
|
||||
|
/** |
||||
|
* 下级机关 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @return java.util.List<com.epmet.issue.dto.result.IssueSubAgencyResultDTO> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/6/22 16:40 |
||||
|
*/ |
||||
|
List<IssueSubAgencyResultDTO> getSubAgency(TokenDto tokenDto); |
||||
|
|
||||
|
/** |
||||
|
* 网格 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @return java.util.List<com.epmet.issue.dto.result.IssueSubGridResultDTO> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/6/22 16:41 |
||||
|
*/ |
||||
|
List<IssueSubGridResultDTO> getSubGrid(TokenDto tokenDto); |
||||
|
|
||||
|
/** |
||||
|
* 议题分析 |
||||
|
* |
||||
|
* @param tokenDto |
||||
|
* @param formDTO |
||||
|
* @return java.util.List<com.epmet.issue.dto.result.IssueIncrtrendResultDTO> |
||||
|
* @author zhaoqifeng |
||||
|
* @date 2020/6/22 16:41 |
||||
|
*/ |
||||
|
List<IssueIncrtrendResultDTO> getIncrtrend(TokenDto tokenDto, IssueIncrtrendFormDTO formDTO); |
||||
|
} |
@ -0,0 +1,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<IssueSummaryPieResultDTO> getSummaryPie(TokenDto tokenDto) { |
||||
|
List<IssueSummaryPieResultDTO> list = new ArrayList<>(); |
||||
|
String agencyId = getAgencyId(tokenDto); |
||||
|
IssueDataDTO data = issueDao.selectAgencyInfo(agencyId); |
||||
|
IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO(); |
||||
|
voting.setName(IssueConstant.VOTING_NAME); |
||||
|
voting.setValue(data.getVotingTotal()); |
||||
|
voting.setRatio(toRatio(data.getVotingPercent())); |
||||
|
list.add(voting); |
||||
|
IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO(); |
||||
|
shift.setName(IssueConstant.SHIFT_NAME); |
||||
|
shift.setValue(data.getShiftProjectTotal()); |
||||
|
shift.setRatio(toRatio(data.getShiftProjectPercent())); |
||||
|
list.add(shift); |
||||
|
IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO(); |
||||
|
closed.setName(IssueConstant.CLOSED_NAME); |
||||
|
closed.setValue(data.getClosedTotal()); |
||||
|
closed.setRatio(toRatio(data.getClosedPercent())); |
||||
|
list.add(closed); |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IssueSubAgencyResultDTO> getSubAgency(TokenDto tokenDto) { |
||||
|
List<IssueSubAgencyResultDTO> list = new ArrayList<>(); |
||||
|
String agencyId = getAgencyId(tokenDto); |
||||
|
List<IssueDataDTO> dataList = issueDao.selectSubAgencyList(agencyId); |
||||
|
if(null != dataList) { |
||||
|
dataList.forEach(data -> { |
||||
|
IssueSubAgencyResultDTO voting = new IssueSubAgencyResultDTO(); |
||||
|
voting.setAgencyId(data.getAgencyId()); |
||||
|
voting.setName(data.getAgencyName()); |
||||
|
voting.setType(IssueConstant.VOTING_NAME); |
||||
|
voting.setValue(data.getVotingTotal()); |
||||
|
list.add(voting); |
||||
|
IssueSubAgencyResultDTO shift = new IssueSubAgencyResultDTO(); |
||||
|
shift.setAgencyId(data.getAgencyId()); |
||||
|
shift.setName(data.getAgencyName()); |
||||
|
shift.setType(IssueConstant.SHIFT_NAME); |
||||
|
shift.setValue(data.getShiftProjectTotal()); |
||||
|
list.add(shift); |
||||
|
IssueSubAgencyResultDTO closed = new IssueSubAgencyResultDTO(); |
||||
|
closed.setAgencyId(data.getAgencyId()); |
||||
|
closed.setName(data.getAgencyName()); |
||||
|
closed.setType(IssueConstant.CLOSED_NAME); |
||||
|
closed.setValue(data.getClosedTotal()); |
||||
|
list.add(closed); |
||||
|
}); |
||||
|
} |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IssueSubGridResultDTO> getSubGrid(TokenDto tokenDto) { |
||||
|
List<IssueSubGridResultDTO> list = new ArrayList<>(); |
||||
|
String agencyId = getAgencyId(tokenDto); |
||||
|
List<IssueDataDTO> dataList = issueDao.selectGridList(agencyId); |
||||
|
if(null != dataList) { |
||||
|
dataList.forEach(data -> { |
||||
|
IssueSubGridResultDTO voting = new IssueSubGridResultDTO(); |
||||
|
voting.setName(data.getGridName()); |
||||
|
voting.setType(IssueConstant.VOTING_NAME); |
||||
|
voting.setValue(data.getVotingTotal()); |
||||
|
list.add(voting); |
||||
|
IssueSubGridResultDTO shift = new IssueSubGridResultDTO(); |
||||
|
shift.setName(data.getGridName()); |
||||
|
shift.setType(IssueConstant.SHIFT_NAME); |
||||
|
shift.setValue(data.getShiftProjectTotal()); |
||||
|
list.add(shift); |
||||
|
IssueSubGridResultDTO closed = new IssueSubGridResultDTO(); |
||||
|
closed.setName(data.getGridName()); |
||||
|
closed.setType(IssueConstant.CLOSED_NAME); |
||||
|
closed.setValue(data.getClosedTotal()); |
||||
|
list.add(closed); |
||||
|
}); |
||||
|
} |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<IssueIncrtrendResultDTO> getIncrtrend(TokenDto tokenDto, IssueIncrtrendFormDTO formDTO) { |
||||
|
List<IssueIncrtrendResultDTO> list = new ArrayList<>(); |
||||
|
String agencyId = getAgencyId(tokenDto); |
||||
|
List<IssueDataDTO> dataList; |
||||
|
if (IssueConstant.DATE.equals(formDTO.getType())) { |
||||
|
dataList = issueDao.selectAgencyIncDailyList(agencyId); |
||||
|
} else { |
||||
|
dataList = issueDao.selectAgencyIncMonthlyList(agencyId); |
||||
|
} |
||||
|
if (null != dataList) { |
||||
|
dataList.forEach(data -> { |
||||
|
IssueIncrtrendResultDTO voting = new IssueIncrtrendResultDTO(); |
||||
|
voting.setDate(data.getDateName()); |
||||
|
voting.setType(IssueConstant.VOTING_NAME); |
||||
|
voting.setValue(data.getVotingIncr()); |
||||
|
list.add(voting); |
||||
|
IssueIncrtrendResultDTO shift = new IssueIncrtrendResultDTO(); |
||||
|
shift.setDate(data.getDateName()); |
||||
|
shift.setType(IssueConstant.SHIFT_NAME); |
||||
|
shift.setValue(data.getShiftProjectIncr()); |
||||
|
list.add(shift); |
||||
|
IssueIncrtrendResultDTO closed = new IssueIncrtrendResultDTO(); |
||||
|
closed.setDate(data.getDateName()); |
||||
|
closed.setType(IssueConstant.CLOSED_NAME); |
||||
|
closed.setValue(data.getClosedIncr()); |
||||
|
list.add(closed); |
||||
|
}); |
||||
|
} |
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
private String getAgencyId(TokenDto tokenDto) { |
||||
|
LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); |
||||
|
loginUserDetailsFormDTO.setApp(tokenDto.getApp()); |
||||
|
loginUserDetailsFormDTO.setClient(tokenDto.getClient()); |
||||
|
loginUserDetailsFormDTO.setUserId(tokenDto.getUserId()); |
||||
|
LoginUserDetailsResultDTO userInfo = epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO).getData(); |
||||
|
String[] orgIdPath = userInfo.getOrgIdPath().split(":"); |
||||
|
return orgIdPath[orgIdPath.length - 1]; |
||||
|
} |
||||
|
|
||||
|
private String toRatio(BigDecimal data) { |
||||
|
return data.stripTrailingZeros().toString().concat("%"); |
||||
|
} |
||||
|
} |
@ -0,0 +1,88 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.module.issue.dao.IssueDao"> |
||||
|
<!-- 获取当前机关统计信息--> |
||||
|
<select id="selectAgencyInfo" resultType="com.epmet.issue.dto.result.IssueDataDTO"> |
||||
|
SELECT AGENCY_ID, |
||||
|
ISSUE_TOTAL, |
||||
|
VOTING_TOTAL, |
||||
|
VOTING_PERCENT, |
||||
|
SHIFT_PROJECT_TOTAL, |
||||
|
SHIFT_PROJECT_PERCENT, |
||||
|
CLOSED_TOTAL, |
||||
|
CLOSED_PERCENT, |
||||
|
MAX(DATE_ID) AS DATE_ID, |
||||
|
DATE_FORMAT(DATE_ID, '%Y.%m.%d') AS DATE_NAME |
||||
|
FROM |
||||
|
fact_issue_agency_daily fiad |
||||
|
WHERE DEL_FLAG = '0' |
||||
|
AND AGENCY_ID = #{agencyId} |
||||
|
</select> |
||||
|
<!-- 获取下级机关统计信息--> |
||||
|
<select id="selectSubAgencyList" resultType="com.epmet.issue.dto.result.IssueDataDTO"> |
||||
|
SELECT AGENCY_ID, |
||||
|
da.AGENCY_NAME, |
||||
|
ISSUE_TOTAL, |
||||
|
VOTING_TOTAL, |
||||
|
SHIFT_PROJECT_TOTAL, |
||||
|
CLOSED_TOTAL, |
||||
|
MAX(DATE_ID) AS DATE_ID |
||||
|
FROM |
||||
|
fact_issue_agency_daily fiad |
||||
|
INNER JOIN |
||||
|
dim_agency da ON fiad.AGENCY_ID = da.ID |
||||
|
WHERE fiad.DEL_FLAG = '0' |
||||
|
AND PID = #{agencyId} |
||||
|
GROUP BY AGENCY_ID |
||||
|
</select> |
||||
|
<!-- 获取机关下网格统计信息--> |
||||
|
<select id="selectGridList" resultType="com.epmet.issue.dto.result.IssueDataDTO"> |
||||
|
SELECT GRID_ID, |
||||
|
dg.GRID_NAME, |
||||
|
ISSUE_TOTAL, |
||||
|
VOTING_TOTAL, |
||||
|
SHIFT_PROJECT_TOTAL, |
||||
|
CLOSED_TOTAL, |
||||
|
MAX(DATE_ID) AS DATE_ID |
||||
|
FROM |
||||
|
fact_issue_grid_daily figd |
||||
|
INNER JOIN |
||||
|
dim_grid dg ON figd.GRID_ID = dg.ID |
||||
|
WHERE figd.DEL_FLAG = '0' |
||||
|
AND figd.AGENCY_ID = #{agencyId} |
||||
|
GROUP BY GRID_ID |
||||
|
</select> |
||||
|
<!-- 获取当前机关日增量--> |
||||
|
<select id="selectAgencyIncDailyList" resultType="com.epmet.issue.dto.result.IssueDataDTO"> |
||||
|
SELECT AGENCY_ID, |
||||
|
ISSUE_INCR, |
||||
|
VOTING_INCR, |
||||
|
SHIFT_PROJECT_INCR, |
||||
|
CLOSED_INCR, |
||||
|
DATE_FORMAT(DATE_ID, '%Y/%m/%d') |
||||
|
FROM |
||||
|
fact_issue_agency_daily fiad |
||||
|
WHERE DEL_FLAG = '0' |
||||
|
AND AGENCY_ID = #{agencyId} |
||||
|
ORDER BY |
||||
|
DATE_ID DESC |
||||
|
LIMIT 90 |
||||
|
</select> |
||||
|
<!-- 获取当前机关月增量--> |
||||
|
<select id="selectAgencyIncMonthlyList" resultType="com.epmet.issue.dto.result.IssueDataDTO"> |
||||
|
SELECT AGENCY_ID, |
||||
|
ISSUE_INCR, |
||||
|
VOTING_INCR, |
||||
|
SHIFT_PROJECT_INCR, |
||||
|
CLOSED_INCR, |
||||
|
DATE_FORMAT(STR_TO_DATE(MONTH_ID,'%Y%m'), '%Y/%m') AS MONTH_ID |
||||
|
FROM |
||||
|
fact_issue_agency_monthly fiam |
||||
|
WHERE DEL_FLAG = '0' |
||||
|
AND AGENCY_ID = #{agencyId} |
||||
|
ORDER BY |
||||
|
MONTH_ID DESC |
||||
|
LIMIT 12 |
||||
|
</select> |
||||
|
</mapper> |
Loading…
Reference in new issue