15 changed files with 1025 additions and 0 deletions
@ -0,0 +1,22 @@ |
|||
package com.elink.esua.epdc.dto.screen.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* 大屏数据统计 定时任务入参 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/9/15 9:18 |
|||
*/ |
|||
@Data |
|||
public class ScreenProjectFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 4393418231149397108L; |
|||
|
|||
/** |
|||
* 统计时间 |
|||
*/ |
|||
private String yearMonthDay; |
|||
|
|||
} |
@ -0,0 +1,59 @@ |
|||
package com.elink.esua.epdc.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @author songyunpeng |
|||
* @Description |
|||
* @create 2021-02-24 |
|||
*/ |
|||
@Data |
|||
public class Attachments implements Serializable { |
|||
private static final long serialVersionUID = 1847661183221467699L; |
|||
/** |
|||
* 附件id |
|||
*/ |
|||
private String attachmentId; |
|||
/** |
|||
* 文件所属位置(内部备注: internal 公开答复:public) |
|||
*/ |
|||
private String filePlace; |
|||
/** |
|||
* 文件名 |
|||
*/ |
|||
private String fileName; |
|||
/** |
|||
* 附件名(uuid随机生成) |
|||
*/ |
|||
private String attachmentName; |
|||
/** |
|||
* 附件大小 字节为单位 |
|||
*/ |
|||
private String attachmentSize; |
|||
/** |
|||
* 文件格式(JPG、PNG、JPEG、BMP、GIF、PDF、PPT、PPTX、DOC、DOCX、XLS、XLSX、MP3、WMA、M4A、MP4、AVI、MOV、RMVB、RM、WMV) |
|||
*/ |
|||
private String attachmentFormat; |
|||
/** |
|||
* 文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String attachmentType; |
|||
/** |
|||
* url地址 |
|||
*/ |
|||
private String attachmentUrl; |
|||
/** |
|||
* 排序(需求确定,按上传顺序排序) 如 0,1,2,没有排序就都传0 |
|||
*/ |
|||
private String sort; |
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private String duration; |
|||
/** |
|||
* 是否删除 0未删除 1删除 |
|||
*/ |
|||
private String delFlag; |
|||
} |
@ -0,0 +1,62 @@ |
|||
package com.elink.esua.epdc.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @program: esua-epdc |
|||
* @description: 【事件/项目分析】网格内事件 |
|||
* @author: wangtong |
|||
* @create: 2021-02-23 14:39 |
|||
**/ |
|||
@Data |
|||
public class ProjectGridDailyDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 3768218702569761315L; |
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String gridId; |
|||
/** |
|||
*网格所属上级id;如果属于跟组织下直属网格,pid=0 |
|||
*/ |
|||
private String pid; |
|||
/** |
|||
*网格所有父级ids,以英文逗号隔开; pid=0时,pids=0 |
|||
*/ |
|||
private String pids; |
|||
/** |
|||
*截止到当前日期总项目数 |
|||
*/ |
|||
private Integer projectTotal; |
|||
/** |
|||
*已解决数量 |
|||
*/ |
|||
private Integer resolvedNum; |
|||
/** |
|||
*解决率:上传小数,保留小数点后4位;resolvedNum/projectTotal |
|||
*/ |
|||
private BigDecimal resolvedRatio; |
|||
/** |
|||
*满意率:上传小数,保留小数点后4位; |
|||
*/ |
|||
private BigDecimal goodRatio; |
|||
/** |
|||
*对当前网格内项目,参与评价的总次数 |
|||
*/ |
|||
private Integer evaluateTotal; |
|||
/** |
|||
*对当前网格内项目,参与评价且选择满意(非常满意+基本满意)的总次数 |
|||
*/ |
|||
private Integer goodTotal; |
|||
/** |
|||
*对当前网格内项目,参与评价且选择不满意的总次数 |
|||
*/ |
|||
private Integer badTotal; |
|||
/** |
|||
*不满意率 |
|||
*/ |
|||
private BigDecimal badRatio; |
|||
} |
@ -0,0 +1,66 @@ |
|||
package com.elink.esua.epdc.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.math.BigDecimal; |
|||
|
|||
/** |
|||
* @program: esua-epdc |
|||
* @description: 【事件/项目分析】组织内事件 |
|||
* @author: wangtong |
|||
* @create: 2021-02-23 17:25 |
|||
**/ |
|||
@Data |
|||
public class ProjectOrgDailyDTO implements Serializable { |
|||
private static final long serialVersionUID = -1547668582530115895L; |
|||
|
|||
/** |
|||
* 街道id , 目前只上传乡(镇、街道)级 组织的数据即可 |
|||
*/ |
|||
private String orgId; |
|||
/** |
|||
* 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province |
|||
*/ |
|||
private String orgType; |
|||
/** |
|||
*当前orgId所属的上级id |
|||
*/ |
|||
private String pid; |
|||
/** |
|||
*orgId所有的父级id,以英文:或者英文,隔开 |
|||
*/ |
|||
private String pids; |
|||
/** |
|||
*截止到当前日期总项目数 |
|||
*/ |
|||
private Integer projectTotal; |
|||
/** |
|||
*已解决数量 |
|||
*/ |
|||
private Integer resolvedNum; |
|||
/** |
|||
*解决率:上传小数,保留小数点后4位;resolvedNum/projectTotal |
|||
*/ |
|||
private BigDecimal resolvedRatio; |
|||
/** |
|||
*满意率:上传小数,保留小数点后4位; |
|||
*/ |
|||
private BigDecimal goodRatio; |
|||
/** |
|||
*对当前网格内项目,参与评价的总次数 |
|||
*/ |
|||
private Integer evaluateTotal; |
|||
/** |
|||
*对当前网格内项目,参与评价且选择满意(非常满意+基本满意)的总次数 |
|||
*/ |
|||
private Integer goodTotal; |
|||
/** |
|||
*对当前网格内项目,参与评价且选择不满意的总次数 |
|||
*/ |
|||
private Integer badTotal; |
|||
/** |
|||
*不满意率 |
|||
*/ |
|||
private BigDecimal badRatio; |
|||
} |
@ -0,0 +1,50 @@ |
|||
package com.elink.esua.epdc.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @program: esua-epdc |
|||
* @description: 【事件/项目分析】网格内月度数量统计 |
|||
* @author: wangtong |
|||
* @create: 2021-02-23 17:49 |
|||
**/ |
|||
@Data |
|||
public class QuantityGridMonthly implements Serializable { |
|||
private static final long serialVersionUID = 2861815851751553406L; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String gridId; |
|||
/** |
|||
*网格所属上级id;如果属于跟组织下直属网格,pid=0 |
|||
*/ |
|||
private String pid; |
|||
/** |
|||
*网格所有父级ids,以英文逗号隔开; pid=0时,pids=0 |
|||
*/ |
|||
private String pids; |
|||
/** |
|||
*当前网格,本月新增的项目数量:转项目日期在当前月份内 |
|||
*/ |
|||
private Integer projectIncr; |
|||
/** |
|||
*截止到当前月份:累计项目总数 |
|||
*/ |
|||
private Integer projectTotal; |
|||
/** |
|||
*截止到当前月份:累计未结项目总数 |
|||
*/ |
|||
private Integer unClosedTotal; |
|||
/** |
|||
*截止到当前月份:累计已结项目 |
|||
*/ |
|||
private Integer closedTotal; |
|||
/** |
|||
*本月新增结案项目数 |
|||
*/ |
|||
private Integer closedIncr; |
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
package com.elink.esua.epdc.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @program: esua-epdc |
|||
* @description: 【事件/项目分析】组织内月度数量统计 |
|||
* @author: wangtong |
|||
* @create: 2021-02-23 18:09 |
|||
**/ |
|||
@Data |
|||
public class QuantityOrgMonthlyDTO implements Serializable { |
|||
private static final long serialVersionUID = 2240289231500366786L; |
|||
|
|||
/** |
|||
* 网格id |
|||
*/ |
|||
private String orgId; |
|||
/** |
|||
*网格所属上级id;如果属于跟组织下直属网格,pid=0 |
|||
*/ |
|||
private String pid; |
|||
/** |
|||
*网格所有父级ids,以英文逗号隔开; pid=0时,pids=0 |
|||
*/ |
|||
private String pids; |
|||
/** |
|||
* 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province |
|||
*/ |
|||
private String orgType; |
|||
/** |
|||
*当前网格,本月新增的项目数量:转项目日期在当前月份内 |
|||
*/ |
|||
private Integer projectIncr; |
|||
/** |
|||
*截止到当前月份:累计项目总数 |
|||
*/ |
|||
private Integer projectTotal; |
|||
/** |
|||
*截止到当前月份:累计未结项目总数 |
|||
*/ |
|||
private Integer unClosedTotal; |
|||
/** |
|||
*截止到当前月份:累计已结项目 |
|||
*/ |
|||
private Integer closedTotal; |
|||
/** |
|||
*本月新增结案项目数 |
|||
*/ |
|||
private Integer closedIncr; |
|||
} |
@ -0,0 +1,14 @@ |
|||
package com.elink.esua.epdc.dto.screen.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author:songyunpeng |
|||
* @Date:2021/2/23 17:56 |
|||
*/ |
|||
@Data |
|||
public class ScreenProjectDataResultDTO implements Serializable { |
|||
private static final long serialVersionUID = 8275259571095325022L; |
|||
} |
@ -0,0 +1,96 @@ |
|||
package com.elink.esua.epdc.modules.screen.controller; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.screen.form.ScreenProjectFormDTO; |
|||
import com.elink.esua.epdc.modules.screen.service.ScreenProjectDataService; |
|||
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:songyunpeng |
|||
* @Date:2021/2/23 14:06 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("data/stats/project") |
|||
public class ScreenProjectDataController { |
|||
|
|||
|
|||
@Autowired |
|||
private ScreenProjectDataService screenProjectDataService; |
|||
|
|||
/** |
|||
* @Description 项目信息上报 |
|||
* @Author songyunpeng |
|||
* @Date 2021/2/23 |
|||
* @Param [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
**/ |
|||
@PostMapping("uploadprojectinfo") |
|||
private Result uploadProjectInfo(@RequestBody ScreenProjectFormDTO screenProjectFormDTO){ |
|||
return screenProjectDataService.uploadProjectInfo(screenProjectFormDTO); |
|||
} |
|||
/** |
|||
* @Description 项目处理进展上报 |
|||
* @Author songyunpeng |
|||
* @Date 2021/2/23 |
|||
* @Param [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
**/ |
|||
@PostMapping("uploadprojectprocess") |
|||
private Result uploadProjectProcess(@RequestBody ScreenProjectFormDTO screenProjectFormDTO){ |
|||
return screenProjectDataService.uploadProjectProcess(screenProjectFormDTO); |
|||
} |
|||
|
|||
/** |
|||
* @describe: 【事件/项目分析】网格内事件 |
|||
* @author wangtong |
|||
* @date 2021/2/23 14:53 |
|||
* @params [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
*/ |
|||
@PostMapping("project-grid-daily") |
|||
private Result projectGridDaily(){ |
|||
return screenProjectDataService.projectGridDaily(); |
|||
} |
|||
|
|||
/** |
|||
* @describe: 【事件/项目分析】组织内事件 |
|||
* @author wangtong |
|||
* @date 2021/2/24 9:29 |
|||
* @params [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
*/ |
|||
@PostMapping("project/project-org-daily") |
|||
private Result projectOrgDaily(){ |
|||
return screenProjectDataService.projectOrgDaily(); |
|||
} |
|||
|
|||
/** |
|||
* @describe: 【事件/项目分析】网格内月度数量统计 |
|||
* @author wangtong |
|||
* @date 2021/2/24 10:38 |
|||
* @params [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
*/ |
|||
@PostMapping("quantity-grid-monthly") |
|||
private Result quantityGridMonthly(){ |
|||
return screenProjectDataService.quantityGridMonthly(); |
|||
} |
|||
|
|||
/** |
|||
* @describe: 【事件/项目分析】组织内月度数量统计 |
|||
* @author wangtong |
|||
* @date 2021/2/24 10:57 |
|||
* @params [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
*/ |
|||
@PostMapping("quantity-org-monthly") |
|||
private Result quantityOrgMonthly(){ |
|||
return screenProjectDataService.quantityOrgMonthly(); |
|||
} |
|||
} |
@ -0,0 +1,70 @@ |
|||
package com.elink.esua.epdc.modules.screen.dao; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao; |
|||
import com.elink.esua.epdc.dto.screen.form.ScreenProjectFormDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.*; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author:songunpeng |
|||
* @Date:2021/2/23 18:03 |
|||
*/ |
|||
@Mapper |
|||
public interface ScreenProjectDataDao extends BaseDao<ScreenProjectDataResultDTO> { |
|||
|
|||
/** |
|||
* @Description 项目信息上报 |
|||
* @Author songyunpeng |
|||
* @Date 2021/2/23 |
|||
* @Param [] |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.UploadProjectInfoDTO> |
|||
* |
|||
* @param screenProjectFormDTO*/ |
|||
List<UploadProjectInfoDTO> uploadProjectInfo(ScreenProjectFormDTO screenProjectFormDTO); |
|||
/** |
|||
* @Description 项目处理进展上报 |
|||
* @Author songyunpeng |
|||
* @Date 2021/2/23 |
|||
* @Param [] |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.UploadProjectProcessDTO> |
|||
**/ |
|||
List<UploadProjectProcessDTO> uploadProjectProcess(ScreenProjectFormDTO screenProjectFormDTO); |
|||
/** |
|||
* @describe: |
|||
* @author wangtong |
|||
* @date 2021/2/23 14:55 |
|||
* @params [] |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.ProjectGridDailyDTO> |
|||
*/ |
|||
List<ProjectGridDailyDTO> selectProjectGridDaily(@Param("yesterDayDate") String yesterDayDate); |
|||
|
|||
/** |
|||
* @describe: 【事件/项目分析】组织内事件 |
|||
* @author wangtong |
|||
* @date 2021/2/24 9:30 |
|||
* @params [yesterDayDate] |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.ProjectOrgDailyDTO> |
|||
*/ |
|||
List<ProjectOrgDailyDTO> selectProjectOrgDaily(@Param("yesterDayDate") String yesterDayDate); |
|||
|
|||
/** |
|||
* @describe: 【事件/项目分析】网格内月度数量统计 |
|||
* @author wangtong |
|||
* @date 2021/2/24 10:43 |
|||
* @params [lastMonth] |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.QuantityGridMonthly> |
|||
*/ |
|||
List<QuantityGridMonthly> selectQuantityGridMonthly(@Param("lastMonth") String lastMonth); |
|||
|
|||
/** |
|||
* @describe: 【事件/项目分析】组织内月度数量统计 |
|||
* @author wangtong |
|||
* @date 2021/2/24 10:58 |
|||
* @params [lastMonth] |
|||
* @return java.util.List<com.elink.esua.epdc.dto.screen.result.QuantityOrgMonthlyDTO> |
|||
*/ |
|||
List<QuantityOrgMonthlyDTO> selectQuantityOrgMonthly(@Param("lastMonth") String lastMonth); |
|||
} |
@ -0,0 +1,69 @@ |
|||
package com.elink.esua.epdc.modules.screen.service; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.screen.form.ScreenProjectFormDTO; |
|||
|
|||
/** |
|||
* 大屏项目信息上报 |
|||
* |
|||
* @Author:songyunpeng |
|||
* @Date:2020/2/23 18:04 |
|||
*/ |
|||
public interface ScreenProjectDataService { |
|||
|
|||
/** |
|||
* @Description 项目信息上报 |
|||
* @Author songyunpeng |
|||
* @Date 2021/2/23 |
|||
* @Param [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* |
|||
* @param screenProjectFormDTO*/ |
|||
Result uploadProjectInfo(ScreenProjectFormDTO screenProjectFormDTO); |
|||
|
|||
/** |
|||
* @Description 项目处理进展上报 |
|||
* @Author songyunpeng |
|||
* @Date 2021/2/23 |
|||
* @Param [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
* |
|||
* @param screenProjectFormDTO*/ |
|||
Result uploadProjectProcess(ScreenProjectFormDTO screenProjectFormDTO); |
|||
|
|||
/** |
|||
* @describe: 【事件/项目分析】网格内事件 |
|||
* @author wangtong |
|||
* @date 2021/2/23 14:54 |
|||
* @params [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
*/ |
|||
Result projectGridDaily(); |
|||
|
|||
/** |
|||
* @describe: 事件/项目分析】组织内事件 |
|||
* @author wangtong |
|||
* @date 2021/2/24 9:29 |
|||
* @params [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
*/ |
|||
Result projectOrgDaily(); |
|||
|
|||
/** |
|||
* @describe: 【事件/项目分析】网格内月度数量统计 |
|||
* @author wangtong |
|||
* @date 2021/2/24 10:39 |
|||
* @params [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
*/ |
|||
Result quantityGridMonthly(); |
|||
|
|||
/** |
|||
* @describe: 【事件/项目分析】组织内月度数量统计 |
|||
* @author wangtong |
|||
* @date 2021/2/24 10:57 |
|||
* @params [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
*/ |
|||
Result quantityOrgMonthly(); |
|||
} |
@ -0,0 +1,122 @@ |
|||
package com.elink.esua.epdc.modules.screen.service.impl; |
|||
|
|||
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.elink.esua.epdc.commons.tools.constant.EpmetConstant; |
|||
import com.elink.esua.epdc.commons.tools.constant.NumConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.screen.form.ScreenProjectFormDTO; |
|||
import com.elink.esua.epdc.dto.screen.result.*; |
|||
import com.elink.esua.epdc.modules.screen.dao.ScreenProjectDataDao; |
|||
import com.elink.esua.epdc.modules.screen.service.ScreenProjectDataService; |
|||
import com.elink.esua.epdc.utils.EpmetUtils; |
|||
import com.elink.esua.epdc.utils.ScreenDataUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Author:liuchuang |
|||
* @Date:2020/9/9 18:05 |
|||
*/ |
|||
@Service |
|||
public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectDataDao, ScreenProjectDataResultDTO> implements ScreenProjectDataService { |
|||
@Autowired |
|||
private EpmetUtils epmetUtils; |
|||
|
|||
@Override |
|||
public Result uploadProjectInfo(ScreenProjectFormDTO screenProjectFormDTO) { |
|||
// 数据统计
|
|||
List<UploadProjectInfoDTO> data = baseDao.uploadProjectInfo(screenProjectFormDTO); |
|||
if (data.size() > 1000) { |
|||
List<List<UploadProjectInfoDTO>> formList = ScreenIndexDataServiceImpl.fixedGrouping(data, NumConstant.ONE_THOUSAND); |
|||
if (formList != null && formList.size() > NumConstant.ZERO) { |
|||
for (int i = NumConstant.ZERO; i < formList.size(); i++) { |
|||
String dataJson = ""; |
|||
// 数据格式化
|
|||
dataJson = ScreenDataUtils.getScreenDataDateJson(formList.get(i), false); |
|||
// 数据上报
|
|||
epmetUtils.httpPost(EpmetConstant.EPMET_INDEX_COLLECT_GRID_PARTY_MEMBER_DATA, dataJson); |
|||
} |
|||
} |
|||
} else { |
|||
// 数据格式化
|
|||
String dataJson = ScreenDataUtils.getScreenDataDateJson(data, false); |
|||
// 数据上报
|
|||
epmetUtils.httpPost(EpmetConstant.EPMET_INDEX_COLLECT_GRID_PARTY_MEMBER_DATA, dataJson); |
|||
} |
|||
return new Result(); |
|||
} |
|||
|
|||
@Override |
|||
public Result uploadProjectProcess(ScreenProjectFormDTO screenProjectFormDTO) { |
|||
// 数据统计
|
|||
List<UploadProjectProcessDTO> data = baseDao.uploadProjectProcess(screenProjectFormDTO); |
|||
if (data.size() > 1000) { |
|||
List<List<UploadProjectProcessDTO>> formList = ScreenIndexDataServiceImpl.fixedGrouping(data, NumConstant.ONE_THOUSAND); |
|||
if (formList != null && formList.size() > NumConstant.ZERO) { |
|||
for (int i = NumConstant.ZERO; i < formList.size(); i++) { |
|||
String dataJson = ""; |
|||
// 数据格式化
|
|||
dataJson = ScreenDataUtils.getScreenDataDateJson(formList.get(i), false); |
|||
// 数据上报
|
|||
epmetUtils.httpPost(EpmetConstant.EPMET_INDEX_COLLECT_GRID_PARTY_MEMBER_DATA, dataJson); |
|||
} |
|||
} |
|||
} else { |
|||
// 数据格式化
|
|||
String dataJson = ScreenDataUtils.getScreenDataDateJson(data, false); |
|||
// 数据上报
|
|||
epmetUtils.httpPost(EpmetConstant.EPMET_INDEX_COLLECT_GRID_PARTY_MEMBER_DATA, dataJson); |
|||
} |
|||
return new Result(); |
|||
} |
|||
|
|||
@Override |
|||
public Result projectGridDaily() { |
|||
String yesterDayDate = ScreenDataUtils.getYesterdayDate(); |
|||
// 数据统计
|
|||
List<ProjectGridDailyDTO> data = baseDao.selectProjectGridDaily(yesterDayDate); |
|||
// 数据格式化
|
|||
String dataJson = ScreenDataUtils.getScreenDataDateJson(data, true); |
|||
// 数据上报
|
|||
epmetUtils.httpPost(EpmetConstant.EPMET_PROJECT_GRID_DAILY, dataJson); |
|||
return new Result(); |
|||
} |
|||
|
|||
@Override |
|||
public Result projectOrgDaily() { |
|||
String yesterDayDate = ScreenDataUtils.getYesterdayDate(); |
|||
// 数据统计
|
|||
List<ProjectOrgDailyDTO> data = baseDao.selectProjectOrgDaily(yesterDayDate); |
|||
// 数据格式化
|
|||
String dataJson = ScreenDataUtils.getScreenDataDateJson(data, true); |
|||
// 数据上报
|
|||
epmetUtils.httpPost(EpmetConstant.EPMET_PROJECT_ORG_DAILY, dataJson); |
|||
return new Result(); |
|||
} |
|||
|
|||
@Override |
|||
public Result quantityGridMonthly() { |
|||
String lastMonth = ScreenDataUtils.getLastMonthDate(); |
|||
// 数据统计
|
|||
List<QuantityGridMonthly> data = baseDao.selectQuantityGridMonthly(lastMonth); |
|||
// 数据格式化
|
|||
String dataJson = ScreenDataUtils.getScreenDataMonthJson(data, null,true); |
|||
// 数据上报
|
|||
epmetUtils.httpPost(EpmetConstant.EPMET_PROJECT_GRID_MONTHLY, dataJson); |
|||
return new Result(); |
|||
} |
|||
|
|||
@Override |
|||
public Result quantityOrgMonthly() { |
|||
String lastMonth = ScreenDataUtils.getLastMonthDate(); |
|||
// 数据统计
|
|||
List<QuantityOrgMonthlyDTO> data = baseDao.selectQuantityOrgMonthly(lastMonth); |
|||
// 数据格式化
|
|||
String dataJson = ScreenDataUtils.getScreenDataMonthJson(data, null,true); |
|||
// 数据上报
|
|||
epmetUtils.httpPost(EpmetConstant.EPMET_PROJECT_ORG_MONTHLY, dataJson); |
|||
return new Result(); |
|||
} |
|||
} |
@ -0,0 +1,250 @@ |
|||
<?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.elink.esua.epdc.modules.screen.dao.ScreenProjectDataDao"> |
|||
<resultMap type="com.elink.esua.epdc.dto.screen.result.UploadProjectInfoDTO" id="uploadprojectinfoMap"> |
|||
<result property="orgType" column="orgType"/> |
|||
<result property="orgId" column="orgId"/> |
|||
<result property="orgName" column="orgName"/> |
|||
<result property="parentId" column="parentId"/> |
|||
<result property="allParentIds" column="allParentIds"/> |
|||
<result property="projectId" column="projectId"/> |
|||
<result property="linkName" column="linkName"/> |
|||
<result property="linkMobile" column="linkMobile"/> |
|||
<result property="projectTitle" column="projectTitle"/> |
|||
<result property="projectContent" column="projectContent"/> |
|||
<result property="projectCreateTime" column="projectCreateTime"/> |
|||
<result property="projectAddress" column="projectAddress"/> |
|||
<result property="latitude" column="latitude"/> |
|||
<result property="longitude" column="longitude"/> |
|||
<result property="projectStatusCode" column="projectStatusCode"/> |
|||
<result property="allCategoryName" column="allCategoryName"/> |
|||
<result property="projectImgUrl" column="projectImgUrl"/> |
|||
<result property="closeCaseTime" column="closeCaseTime"/> |
|||
<collection property="projectImgUrl" ofType="java.lang.String"> |
|||
<result property="projectImgUrl" column="projectImgUrl"/> |
|||
</collection> |
|||
</resultMap> |
|||
<select id="uploadProjectInfo" resultMap="uploadprojectinfoMap"> |
|||
select |
|||
'grid' as orgType, |
|||
t1.GRID_ID as orgId, |
|||
t1.GRID as orgName, |
|||
SUBSTRING_INDEX(t1.PARENT_DEPT_IDS,',',-1) as parentId, |
|||
PARENT_DEPT_IDS as allParentIds, |
|||
t1.ID as projectId, |
|||
t1.NICK_NAME as linkName, |
|||
t1.MOBILE as linkMobile, |
|||
LEFT(t1.ITEM_CONTENT,50)projectTitle, |
|||
t1.ITEM_CONTENT as projectContent, |
|||
t1.DISTRIBUTE_TIME as projectCreateTime, |
|||
t1.ISSUE_ADDRESS as projectAddress, |
|||
t1.ISSUE_LATITUDE as latitude, |
|||
t1.ISSUE_LONGITUDE as longitude, |
|||
case t1.ITEM_STATE WHEN 0 THEN 'pending' WHEN 5 THEN 'closed' WHEN '10' THEN 'closed_case' ELSE '' END AS projectStatusCode, |
|||
t1.CATEGORY_FULL_NAME as allCategoryName, |
|||
t2.IMG_URL as projectImgUrl, |
|||
t3.CREATED_TIME as closeCaseTime |
|||
from (select * from(select * from esua_epdc_events.epdc_item where DEL_FLAG = '0' |
|||
and GRID_ID not in ( SELECT t.`dept_id` |
|||
FROM `esua_epdc_admin`.`sys_dept_config` t |
|||
WHERE t.`del_flag`= 0) |
|||
order by ID)a group by a.EVENT_ID) t1 |
|||
left join esua_epdc_events.epdc_img t2 on t1.ID = t2.REFERENCE_ID and t1.DEL_FLAG = '0' |
|||
left join esua_epdc_events.epdc_item_handle_process t3 on t3.ITEM_ID = t1.ID and t3.DEL_FLAG = '0' and t3.STATE = 10 |
|||
where date_format(t1.UPDATED_TIME, '%Y-%m-%d') >= STR_TO_DATE(#{yearMonthDay}, '%Y-%m-%d') |
|||
and date_format(t1.UPDATED_TIME, '%Y-%m-%d') <= date_sub(curdate(),interval 1 day) |
|||
</select> |
|||
<resultMap type="com.elink.esua.epdc.dto.screen.result.UploadProjectProcessDTO" id="uploadprojectprocessMap"> |
|||
<result property="processId" column="processId"/> |
|||
<result property="projectId" column="projectId"/> |
|||
<result property="transferDeptName" column="transferDeptName"/> |
|||
<result property="transferDeptIds" column="transferDeptIds"/> |
|||
<result property="handlerName" column="handlerName"/> |
|||
<result property="handlerId" column="handlerId"/> |
|||
<result property="handlerType" column="handlerType"/> |
|||
<result property="operation" column="operation"/> |
|||
<result property="publicReply" column="publicReply"/> |
|||
<result property="internalRemark" column="internalRemark"/> |
|||
<result property="processTime" column="processTime"/> |
|||
<collection property="attachments" ofType="com.elink.esua.epdc.dto.screen.result.Attachments"> |
|||
<result property="attachmentId" column="attachmentId"/> |
|||
<result property="filePlace" column="filePlace"/> |
|||
<result property="attachmentUrl" column="attachmentUrl"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
</collection> |
|||
</resultMap> |
|||
<select id="uploadProjectProcess" |
|||
resultMap="uploadprojectprocessMap"> |
|||
select t.*, |
|||
t3.ID as attachmentId, |
|||
case t3.IMG_TYPE when 'itemHandle' then 'internal' when 'itemOutHandle' then 'public' else '' End as filePlace, |
|||
t3.IMG_URL as attachmentUrl, |
|||
t3.DEL_FLAG |
|||
from ( |
|||
select |
|||
t1.ID as processId, |
|||
t1.ITEM_ID as projectId, |
|||
group_concat(t4.DEPT_NAME)transferDeptName, |
|||
group_concat(t4.DEPT_ID)transferDeptIds, |
|||
t1.HANDLER_DEPT as handlerName, |
|||
t1.HANDLER_DEPT_ID as handlerId, |
|||
'unknown' as handlerType, |
|||
case |
|||
when (t4.ID is not null and t1.STATE = 0 and t1.CREATED_TIME != (select min(t.CREATED_TIME) from esua_epdc_events.epdc_item_handle_process t where t.DEL_FLAG = '0' and t1.ITEM_ID = t.ITEM_ID group by t.ITEM_ID)) then 'transfer' |
|||
when (t4.ID is null and t1.STATE = 0 and t1.CREATED_TIME != (select min(t.CREATED_TIME) from esua_epdc_events.epdc_item_handle_process t where t.DEL_FLAG = '0' and t1.ITEM_ID = t.ITEM_ID group by t.ITEM_ID)) then 'response' |
|||
when (t1.STATE = 0 and t1.CREATED_TIME = (select min(t.CREATED_TIME) from esua_epdc_events.epdc_item_handle_process t where t.DEL_FLAG = '0' and t1.ITEM_ID = t.ITEM_ID group by t.ITEM_ID)) then 'created' |
|||
when t1.STATE = 5 then 'close' |
|||
when t1.STATE = 10 then 'closed_case' |
|||
else '' END as operation, |
|||
t1.OUT_HANDLE_ADVICE as publicReply, |
|||
t1.HANDLE_ADVICE as internalRemark, |
|||
t1.CREATED_TIME as processTime |
|||
from esua_epdc_events.epdc_item_handle_process t1 |
|||
left join esua_epdc_events.epdc_item_dept t4 on t4.ITEM_HANDLE_ID = t1.ID and t4.DEL_FLAG = '0' |
|||
where date_format(t1.UPDATED_TIME, '%Y-%m-%d') >= STR_TO_DATE(#{yearMonthDay}, '%Y-%m-%d') |
|||
and date_format(t1.UPDATED_TIME, '%Y-%m-%d') <= date_sub(curdate(),interval 1 day) and t1.DEL_FLAG = '0' |
|||
and t1.HANDLER_DEPT_ID not in ( SELECT t.`dept_id` |
|||
FROM `esua_epdc_admin`.`sys_dept_config` t |
|||
WHERE t.`del_flag`= 0) |
|||
group by t1.ID |
|||
)t |
|||
left join esua_epdc_events.epdc_img t3 on t3.REFERENCE_ID = t.processId and t3.DEL_FLAG = '0' |
|||
order by t3.CREATED_TIME |
|||
</select> |
|||
<select id="selectProjectGridDaily" resultType="com.elink.esua.epdc.dto.screen.result.ProjectGridDailyDTO"> |
|||
SELECT sd.`id` AS gridId, |
|||
sd.pid AS pid, |
|||
sd.pids AS pids, |
|||
count(it.id) as projectTotal, |
|||
count((it.ITEM_STATE=5 or it.ITEM_STATE=10) or null) as resolvedNum, |
|||
ifnull(format(round(count((it.ITEM_STATE=5 or it.ITEM_STATE=10) or null)/count(it.id),4),4),'0.0000') as |
|||
resolvedRatio, |
|||
ifnull(format(round(count((it.EVALUATION_SCORE=1 or it.EVALUATION_SCORE=2) or null)/count(it.id),4),4),'0.0000') |
|||
as goodRatio, |
|||
count( (it.EVALUATION_SCORE=0 or it.EVALUATION_SCORE=1 or it.EVALUATION_SCORE=2) or null) as evaluateTotal, |
|||
count( (it.EVALUATION_SCORE=1 or it.EVALUATION_SCORE=2) or null) as goodTotal, |
|||
count( it.EVALUATION_SCORE=0 or null) as badTotal, |
|||
ifnull(format(round(count(it.EVALUATION_SCORE=0 or null)/count( (it.EVALUATION_SCORE=0 or it.EVALUATION_SCORE=1 or it.EVALUATION_SCORE=2) or null),4),4),'0.0000') as badRatio |
|||
|
|||
FROM `esua_epdc_admin`.`sys_dept` sd |
|||
left join (select lin.* from (select * from esua_epdc_events.epdc_item order by id) lin |
|||
where lin.DEL_FLAG=0 |
|||
AND date_format( lin.CREATED_TIME, '%Y-%m-%d' ) <= #{yesterDayDate} |
|||
group by lin.EVENT_ID) it on it.GRID_ID=sd.id |
|||
WHERE sd.`del_flag`= 0 |
|||
AND sd.`type_key`= 'grid_party' |
|||
AND sd.`id` NOT IN( SELECT t.`dept_id` |
|||
FROM `esua_epdc_admin`.`sys_dept_config` t |
|||
WHERE t.`del_flag`= 0) |
|||
group by sd.id |
|||
</select> |
|||
<select id="selectProjectOrgDaily" resultType="com.elink.esua.epdc.dto.screen.result.ProjectOrgDailyDTO"> |
|||
SELECT st.`id` AS orgId, |
|||
'street' as orgType, |
|||
st.pid AS pid, |
|||
st.pids AS pids, |
|||
count(it.id) as projectTotal, |
|||
count((it.ITEM_STATE=5 or it.ITEM_STATE=10) or null) as resolvedNum, |
|||
ifnull(format(round(count((it.ITEM_STATE=5 or it.ITEM_STATE=10) or null)/count(it.id),4),4),'0.0000') as resolvedRatio, |
|||
ifnull(format(round(count((it.EVALUATION_SCORE=1 or it.EVALUATION_SCORE=2) or null)/count(it.id),4),4),'0.0000') as goodRatio, |
|||
count( (it.EVALUATION_SCORE=0 or it.EVALUATION_SCORE=1 or it.EVALUATION_SCORE=2) or null) as evaluateTotal, |
|||
count( (it.EVALUATION_SCORE=1 or it.EVALUATION_SCORE=2) or null) as goodTotal, |
|||
count( it.EVALUATION_SCORE=0 or null) as badTotal, |
|||
ifnull(format(round(count(it.EVALUATION_SCORE=0 or null)/count( (it.EVALUATION_SCORE=0 or it.EVALUATION_SCORE=1 or it.EVALUATION_SCORE=2) or null),4),4),'0.0000') as badRatio |
|||
|
|||
FROM `esua_epdc_admin`.`sys_dept` sd |
|||
left join `esua_epdc_admin`.`sys_dept` co on co.id=sd.pid |
|||
left join `esua_epdc_admin`.`sys_dept` st on st.id=co.pid |
|||
left join (select lin.* from (select * from esua_epdc_events.epdc_item order by id) lin |
|||
where lin.DEL_FLAG=0 |
|||
AND date_format( lin.CREATED_TIME, '%Y-%m-%d' ) <= #{yesterDayDate} |
|||
group by lin.EVENT_ID) it on it.GRID_ID=sd.id |
|||
WHERE sd.`del_flag`= 0 |
|||
AND sd.`type_key`= 'grid_party' |
|||
AND sd.`id` NOT IN( SELECT t.`dept_id` |
|||
FROM `esua_epdc_admin`.`sys_dept_config` t |
|||
WHERE t.`del_flag`= 0) |
|||
group by st.id |
|||
</select> |
|||
<select id="selectQuantityGridMonthly" |
|||
resultType="com.elink.esua.epdc.dto.screen.result.QuantityGridMonthly"> |
|||
SELECT sd.`id` AS gridId, |
|||
sd.pid AS pid, |
|||
sd.pids AS pids, |
|||
ifnull(it.projectIncr,0) as projectIncr, |
|||
ifnull(it.closedIncr,0) as closedIncr, |
|||
ifnull(li2.projectTotal,0) as projectTotal, |
|||
ifnull(li2.unClosedTotal,0) as unClosedTotal, |
|||
ifnull(li2.closedTotal,0) as closedTotal |
|||
|
|||
FROM `esua_epdc_admin`.`sys_dept` sd |
|||
left join (select li.GRID_ID, |
|||
count(li.id) as projectIncr, |
|||
count((li.ITEM_STATE= 5 or li.ITEM_STATE = 10) or null) as closedIncr |
|||
from (select lin.* |
|||
from (select * from esua_epdc_events.epdc_item order by id) lin |
|||
where lin.DEL_FLAG=0 |
|||
AND date_format( lin.CREATED_TIME, '%Y-%m' ) = #{lastMonth} |
|||
group by lin.EVENT_ID)li |
|||
group by li.GRID_ID)it on it.GRID_ID=sd.id |
|||
left join (select al.GRID_ID, |
|||
count(al.id) as projectTotal, |
|||
count(al.ITEM_STATE= 0 or null) as unClosedTotal, |
|||
count((al.ITEM_STATE= 5 or al.ITEM_STATE = 10) or null) as closedTotal |
|||
from (select lin.* |
|||
from (select * from esua_epdc_events.epdc_item order by id) lin |
|||
where lin.DEL_FLAG=0 |
|||
AND date_format( lin.CREATED_TIME, '%Y-%m' ) <= #{lastMonth} |
|||
group by lin.EVENT_ID)al |
|||
group by al.GRID_ID)li2 on li2.GRID_ID=sd.id |
|||
WHERE sd.`del_flag`= 0 |
|||
AND sd.`type_key`= 'grid_party' |
|||
AND sd.`id` NOT IN( SELECT t.`dept_id` |
|||
FROM `esua_epdc_admin`.`sys_dept_config` t |
|||
WHERE t.`del_flag`= 0) |
|||
group by sd.id |
|||
</select> |
|||
<select id="selectQuantityOrgMonthly" |
|||
resultType="com.elink.esua.epdc.dto.screen.result.QuantityOrgMonthlyDTO"> |
|||
SELECT st.`id` AS orgId, |
|||
'street' as orgType, |
|||
st.pid AS pid, |
|||
st.pids AS pids, |
|||
ifnull(it.projectIncr,0) as projectIncr, |
|||
ifnull(it.closedIncr,0) as closedIncr, |
|||
ifnull(li2.projectTotal,0) as projectTotal, |
|||
ifnull(li2.unClosedTotal,0) as unClosedTotal, |
|||
ifnull(li2.closedTotal,0) as closedTotal |
|||
|
|||
FROM `esua_epdc_admin`.`sys_dept` sd |
|||
left join `esua_epdc_admin`.`sys_dept` co on co.id=sd.pid |
|||
left join `esua_epdc_admin`.`sys_dept` st on st.id=co.pid |
|||
left join (select li.GRID_ID, |
|||
count(li.id) as projectIncr, |
|||
count((li.ITEM_STATE= 5 or li.ITEM_STATE = 10) or null) as closedIncr |
|||
from (select lin.* |
|||
from (select * from esua_epdc_events.epdc_item order by id) lin |
|||
where lin.DEL_FLAG=0 |
|||
AND date_format( lin.CREATED_TIME, '%Y-%m' ) = #{lastMonth} |
|||
group by lin.EVENT_ID)li |
|||
group by li.GRID_ID)it on it.GRID_ID=sd.id |
|||
left join (select al.GRID_ID, |
|||
count(al.id) as projectTotal, |
|||
count(al.ITEM_STATE= 0 or null) as unClosedTotal, |
|||
count((al.ITEM_STATE= 5 or al.ITEM_STATE = 10) or null) as closedTotal |
|||
from (select lin.* |
|||
from (select * from esua_epdc_events.epdc_item order by id) lin |
|||
where lin.DEL_FLAG=0 |
|||
AND date_format( lin.CREATED_TIME, '%Y-%m' ) <= #{lastMonth} |
|||
group by lin.EVENT_ID)al |
|||
group by al.GRID_ID)li2 on li2.GRID_ID=sd.id |
|||
WHERE sd.`del_flag`= 0 |
|||
AND sd.`type_key`= 'grid_party' |
|||
AND sd.`id` NOT IN( SELECT t.`dept_id` |
|||
FROM `esua_epdc_admin`.`sys_dept_config` t |
|||
WHERE t.`del_flag`= 0) |
|||
group by st.id |
|||
</select> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue