diff --git a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/StaffPatrolMQMsg.java b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/StaffPatrolMQMsg.java index f8221d7c76..d8d68cac56 100644 --- a/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/StaffPatrolMQMsg.java +++ b/epmet-commons/epmet-commons-rocketmq/src/main/java/com/epmet/commons/rocketmq/messages/StaffPatrolMQMsg.java @@ -18,11 +18,4 @@ public class StaffPatrolMQMsg { */ private String patrolId; - /** - * 操作类型 - * SystemMessageType.USER_PATROL_START - * SystemMessageTypSTOP - */ - private String actionType; - } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java new file mode 100644 index 0000000000..dbbbe4bbf0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.basereport.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/15 10:55 + */ +@Data +public class EventInfoFormDTO implements Serializable { + private static final long serialVersionUID = 8479649048108914555L; + private String customerId; + private String projectId; + /** + * 操作类型【新增:add 修改删除:edit】 + */ + private String type; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/EventInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/EventInfoResultDTO.java new file mode 100644 index 0000000000..faff5af737 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/EventInfoResultDTO.java @@ -0,0 +1,143 @@ +package com.epmet.dto.basereport.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @Description + * @Author zhaoqifeng + * @Date 2021/10/15 10:57 + */ +@Data +public class EventInfoResultDTO implements Serializable { + private static final long serialVersionUID = -6483163020737762044L; + /** + * 客户Id + */ + private String customerId; + + /** + * 网格编码 + */ + private String orgCode; + + /** + * 网格名称 + */ + private String orgName; + + /** + * 事件名称 + */ + private String eventName; + + /** + * 事件类别 + */ + private String eventCategory; + + /** + * 上报时间 YYYY-MM-DD HH:MM:SS + */ + private Date reportTime; + + /** + * 发生时间 格式为“YYYY-MM-DD” + */ + private Date happenDate; + + /** + * 发生地点 + */ + private String happenPlace; + + /** + * 事件简述 + */ + private String eventDescription; + + /** + * 办结方式 01自办;02上报 源于居民端的最终结案的项目为02;工作端立项的项目最终结案的01 + */ + private String waysOfResolving; + + /** + * 是否办结 Y:是、N:否 + */ + private String successfulOrNo; + + /** + * 办结层级01省、自治区、直辖市02地、市、州、盟03县、市、区、旗04乡镇、街道05片区06村、社区07网格 + */ + private String completeLevel; + + /** + * 基础信息主键 + */ + private String baseInfoId; + + /** + * 办结时间 + */ + private Date completeTime; + + /** + * 经度 + */ + private BigDecimal lng; + + /** + * 纬度 + */ + private BigDecimal lat; + + /** + * 主要当事人姓名 + */ + private String name; + + /** + * 涉及人数 + */ + private Integer numberInvolved; + + /** + * 涉及单位 + */ + private String relatedUnits; + + /** + * 重点场所类别 01九小场所, 02公共场所 + */ + private String keyAreaType; + + /** + * 宗教活动规模 01 0-50人,02 51-200人,03 201人以上 + + */ + private String religionScale; + + /** + * 宗教类别 01道教 02佛教 03基督教 04伊斯兰教 05其他 + + */ + private String religionType; + + /** + * 重点场所是否变动 Y:是、N:否 + */ + private String isKeyareaState; + + /** + * 重点人员是否在当地 Y:是、N:否 + */ + private String isKeypeopleLocate; + + /** + * 重点人员现状 + */ + private String keypeopleStatus; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java index 2a707f9540..2dcdc32028 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java @@ -43,7 +43,7 @@ public class ScreenCustomerGridDTO implements Serializable { * 客户id */ private String customerId; - + private String code; /** * 网格id */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java index fe859bfac0..180ac24fe5 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java @@ -54,11 +54,6 @@ public class ScreenProjectDataDTO implements Serializable { */ private String orgId; - /** - * 来源:议题issue,组织agency - */ - private String origin; - /** * 上级组织Id */ @@ -112,6 +107,16 @@ public class ScreenProjectDataDTO implements Serializable { */ private String projectAddress; + /** + * add 20211014 + * 项目所属编码,如果有多个,以英文顿号隔开 + */ + private String categoryCode; + /** + * add 20211014 + * 来源:议题issue 项目立项:agency 事件:resi_event + */ + private String origin; /** * 所有分类名,用 - 连接 */ @@ -165,7 +170,7 @@ public class ScreenProjectDataDTO implements Serializable { /** * 结案日期 */ - private String closeCaseTime; + private Date closeCaseTime; /** * 数据更新至: yyyy|yyyMM|yyyyMMdd @@ -185,4 +190,11 @@ public class ScreenProjectDataDTO implements Serializable { */ private BigDecimal satisfactionScore; + + + /** + * fact_origin_project_main_daily.grid_id对应的网格名称 + */ + private String tempGridName; + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java index f0f6422e94..66e3943591 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java @@ -81,6 +81,17 @@ public class ScreenProjectDataInfoFormDTO implements Serializable { */ private String projectAddress; + /** + * add 20211014 + * 项目所属编码,如果有多个,以英文顿号隔开 + */ + private String categoryCode; + /** + * add 20211014 + * 来源:议题issue 项目立项:agency 事件:resi_event + */ + private String origin; + /** * 所有分类名,用 - 连接 */ @@ -104,7 +115,8 @@ public class ScreenProjectDataInfoFormDTO implements Serializable { /** * 结案日期 */ - private String closeCaseTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date closeCaseTime; /** * 所有上级ID,用英文逗号分开 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index e91c56ad39..50b339b697 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -3,6 +3,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.basereport.form.EventInfoFormDTO; import com.epmet.dto.extract.form.BizDataFormDTO; import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO; @@ -14,15 +15,14 @@ import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; -import com.epmet.dto.user.result.CustomerStaffDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.dto.user.result.MidPatrolDetailResult; import com.epmet.dto.user.result.MidPatrolRecordResult; -import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBackFactory; +import com.epmet.opendata.dto.BaseDisputeProcessDTO; import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -331,4 +331,14 @@ public interface DataStatisticalOpenFeignClient { */ @PostMapping(value = "/data/stats/datareporting/getPatrolDetailList") Result> getPatrolDetailList(@RequestBody MidPatrolFormDTO midPatrolFormDTO); + + /** + * 事件上报 + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/15 16:50 + */ + @PostMapping("/data/stats/datareporting/eventinfo") + Result> getEventInfo(@RequestBody EventInfoFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index fd66b4a73f..b36b9e9434 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -4,6 +4,7 @@ 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.StatsFormDTO; +import com.epmet.dto.basereport.form.EventInfoFormDTO; import com.epmet.dto.extract.form.BizDataFormDTO; import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO; @@ -15,11 +16,11 @@ import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.screen.form.InitCustomerIndexForm; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; -import com.epmet.dto.user.result.CustomerStaffDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.dto.user.result.MidPatrolDetailResult; import com.epmet.dto.user.result.MidPatrolRecordResult; -import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.opendata.dto.BaseDisputeProcessDTO; import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; @@ -319,4 +320,18 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result> getPatrolDetailList(MidPatrolFormDTO midPatrolFormDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getPatrolDetailList", midPatrolFormDTO); } + + /** + * 事件上报 + * + * @param formDTO + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/15 16:50 + */ + @Override + public Result> getEventInfo(EventInfoFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getEventInfo", formDTO); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java index 23ad509167..d9de9bc1e1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java @@ -2,13 +2,14 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.basereport.form.EventInfoFormDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; -import com.epmet.dto.user.result.CustomerStaffDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.dto.user.result.MidPatrolDetailResult; import com.epmet.dto.user.result.MidPatrolRecordResult; -import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.opendata.dto.BaseDisputeProcessDTO; import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import com.epmet.service.DataReportingService; @@ -89,4 +90,16 @@ public class DataReportingController { return new Result>().ok(dataReportingService.getPatrolDetailList(formDTO)); } + /** + * @Description 事件上报 + * @Param formDTO + * @Return {@link Result>} + * @Author zhaoqifeng + * @Date 2021/10/15 14:09 + */ + @PostMapping("eventinfo") + public Result> getEventInfo(@RequestBody(required = false) EventInfoFormDTO formDTO) { + return new Result>().ok(dataReportingService.getEventInfo(formDTO)); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index a21fd502b5..9b2d86b77f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -891,7 +891,6 @@ public class DemoController { formDTO.setCustomerId(customerId); formDTO.setDateId(param.getDateId()); screenProjectSettleService.extractScreenData(param); - log.error(String.format("/data/stats/demo/project-test,screen_project_**表抽取完毕,customerId:%s", customerId)); } return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java index ba06221d17..6bf9ea9e6f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java @@ -92,7 +92,7 @@ public class ScreenCustomerAgencyEntity extends BaseEpmetEntity { * 行政地区编码 */ private String areaCode; - + private String code; private String sourceType; /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java index 4a0d8e53c8..9de3701b58 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java @@ -39,6 +39,7 @@ public class ScreenCustomerGridEntity extends BaseEpmetEntity { * 客户id */ private String customerId; + private String code; /** * 网格id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java index 52c9a19ab3..b53feaf6f6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java @@ -109,6 +109,17 @@ public class ScreenProjectDataEntity extends BaseEpmetEntity { */ private String projectAddress; + /** + * add 20211014 + * 项目所属编码,如果有多个,以英文顿号隔开 + */ + private String categoryCode; + /** + * add 20211014 + * 来源:议题issue 项目立项:agency 事件:resi_event + */ + private String origin; + /** * 所有分类名,用 - 连接 */ @@ -132,7 +143,7 @@ public class ScreenProjectDataEntity extends BaseEpmetEntity { /** * 结案日期 */ - private String closeCaseTime; + private Date closeCaseTime; /** * 数据更新至: yyyy|yyyMM|yyyyMMdd @@ -148,4 +159,5 @@ public class ScreenProjectDataEntity extends BaseEpmetEntity { * 满意度得分 */ private BigDecimal satisfactionScore; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java index d1f051f8c6..bbaf18aa3c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java @@ -1,12 +1,14 @@ package com.epmet.service; +import com.epmet.dto.basereport.form.EventInfoFormDTO; +import com.epmet.dto.basereport.result.EventInfoResultDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; -import com.epmet.dto.user.result.CustomerStaffDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.dto.user.result.MidPatrolDetailResult; import com.epmet.dto.user.result.MidPatrolRecordResult; -import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.opendata.dto.BaseDisputeProcessDTO; import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; @@ -58,4 +60,14 @@ public interface DataReportingService { */ List getPatrolDetailList(MidPatrolFormDTO formDTO); + + /** + * 事件上报 + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/15 14:10 + */ + List getEventInfo(EventInfoFormDTO formDTO); + } 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 4096fcb500..445894bd66 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 @@ -182,7 +182,7 @@ public interface IssueService { * @author wangc * @date 2021.03.09 00:23 */ - Map getIntegratedProjectCategory(Map> param,String customerId); + Map> getIntegratedProjectCategory(Map> param,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 593c21b9fa..b86b6daa40 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 @@ -17,10 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; /** * @author zhaoqifeng @@ -157,18 +154,23 @@ public class IssueServiceImpl implements IssueService { * @date 2021.03.09 00:23 */ @Override - public Map getIntegratedProjectCategory(Map> param,String customerId) { - Map map = new HashMap<>(); + public Map> getIntegratedProjectCategory(Map> param,String customerId) { + Map> map = new HashMap<>(); param.forEach((projectId,categoryIds) -> { //以下查询只适用于二级分类,如果分类层级变多了要修改此查询 List categories = statsIssueDao.selectCategory(customerId, categoryIds); if(!CollectionUtils.isEmpty(categories)){ - StringBuilder str = new StringBuilder(); + StringBuilder allCategoryName = new StringBuilder(); + StringBuilder categoryCode = new StringBuilder(); categories.forEach(category -> { - str.append(category.getCategoryName()).append(StrConstant.COMMA); + allCategoryName.append(category.getCategoryName()).append(StrConstant.COMMA); + categoryCode.append(category.getCategoryCode()).append(StrConstant.COMMA); //log.info(str.toString()); }); - map.put(projectId,str.substring(NumConstant.ZERO,str.length() - NumConstant.ONE)); + List list=new ArrayList<>(); + list.add(allCategoryName.substring(NumConstant.ZERO,allCategoryName.length() - NumConstant.ONE)); + list.add(categoryCode.substring(NumConstant.ZERO,categoryCode.length() - NumConstant.ONE)); + map.put(projectId,list); } }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index 05dbbed28c..529593abcc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -81,30 +81,47 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic List info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList())); if(!CollectionUtils.isEmpty(info)){ metaData = metaData.stream().flatMap(meta -> info.stream().filter(nature -> StringUtils.equals(meta.getProjectId(), - nature.getId())).map(projectInfo -> { - meta.setProjectCreateTime(projectInfo.getCreatedTime()); - meta.setProjectTitle(projectInfo.getTitle()); - meta.setOrigin(projectInfo.getOrigin()); - //直接立项的话 项目内容是项目背景 经纬度添加 - if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(projectInfo.getOrigin())){ - meta.setOrgType(OrgTypeConstant.AGENCY); - meta.setOrgId(projectInfo.getAgencyId()); - meta.setProjectContent(projectInfo.getBackGround()); - meta.setLinkUserId(projectInfo.getCreatedBy()); - meta.setLinkName(projectInfo.getCreatedBy()); - if (StringUtils.isNotBlank(projectInfo.getLocateDimension())){ - meta.setLatitude(new BigDecimal(projectInfo.getLocateDimension())); - } - if (StringUtils.isNotBlank(projectInfo.getLocateLongitude())){ - meta.setLongitude(new BigDecimal(projectInfo.getLocateLongitude())); - } - meta.setProjectAddress(projectInfo.getLocateAddress()); - } else { - meta.setLinkUserId(meta.getLinkName()); - } - //项目满意度得分 - meta.setSatisfactionScore(projectService.calProjectSatisfactionScore(param.getCustomerId(),meta.getProjectId())); - return meta; + nature.getId())).map(projectInfo -> { + meta.setProjectCreateTime(projectInfo.getCreatedTime()); + meta.setProjectTitle(projectInfo.getTitle()); + meta.setOrigin(projectInfo.getOrigin()); + if (ProjectConstant.PROJECT_ORIGIN_ISSUE.equals(projectInfo.getOrigin())) { + + //来源于议题的,上面的initNewScreenProjectData,已经赋值orgType=grid, orgId:gridId + meta.setOrgName(meta.getTempGridName()); + //A:如果是来源于议题,linkUserId为话题的发布人id; + meta.setLinkUserId(meta.getLinkName()); + + }else if(ProjectConstant.PROJECT_ORIGIN_EVENT.equals(projectInfo.getOrigin())){ + + meta.setProjectContent(projectInfo.getBackGround()); + meta.setLatitude(new BigDecimal(projectInfo.getLocateDimension())); + meta.setLongitude(new BigDecimal(projectInfo.getLocateLongitude())); + meta.setProjectAddress(projectInfo.getLocateAddress()); + meta.setOrgType(OrgTypeConstant.AGENCY); + meta.setOrgId(projectInfo.getAgencyId()); + //B:如果是来源是居民端报事,此列实际为空; + meta.setLinkUserId(meta.getLinkName()); + + }else if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(projectInfo.getOrigin())) { + //直接立项的话 项目内容是项目背景 经纬度添加 + meta.setOrgType(OrgTypeConstant.AGENCY); + meta.setOrgId(projectInfo.getAgencyId()); + //上面的initNewScreenProjectData已经赋值了orgName=组织名称 + meta.setProjectContent(projectInfo.getBackGround()); + meta.setLinkUserId(projectInfo.getCreatedBy()); + meta.setLinkName(projectInfo.getCreatedBy()); + if (StringUtils.isNotBlank(projectInfo.getLocateDimension())) { + meta.setLatitude(new BigDecimal(projectInfo.getLocateDimension())); + } + if (StringUtils.isNotBlank(projectInfo.getLocateLongitude())) { + meta.setLongitude(new BigDecimal(projectInfo.getLocateLongitude())); + } + meta.setProjectAddress(projectInfo.getLocateAddress()); + } + //项目满意度得分 + meta.setSatisfactionScore(projectService.calProjectSatisfactionScore(param.getCustomerId(),meta.getProjectId())); + return meta; })).collect(Collectors.toList()); } //设置项目经纬度和项目内容 @@ -129,13 +146,25 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic } Map> categoryMap = projectService.getProjectCategory(projectIds); if(!CollectionUtils.isEmpty(categoryMap)){ - Map integratedProjectCategoryMap = issueService.getIntegratedProjectCategory(categoryMap, param.getCustomerId()); + Map> integratedProjectCategoryMap = issueService.getIntegratedProjectCategory(categoryMap, param.getCustomerId()); if(!CollectionUtils.isEmpty(integratedProjectCategoryMap)){ metaData.forEach(meta -> { - meta.setAllCategoryName(integratedProjectCategoryMap.get(meta.getProjectId())); + List list1=integratedProjectCategoryMap.get(meta.getProjectId()); + if(!CollectionUtils.isEmpty(list1)){ + meta.setAllCategoryName(list1.get(0)); + meta.setCategoryCode(list1.get(1)); + }else{ + log.warn("1、projectId="+meta.getProjectId()+" category is null"); + } }); orientData.forEach(orient -> { - orient.setAllCategoryName(integratedProjectCategoryMap.get(orient.getProjectId())); + List list2=integratedProjectCategoryMap.get(orient.getProjectId()); + if(!CollectionUtils.isEmpty(list2)){ + orient.setAllCategoryName(list2.get(0)); + orient.setCategoryCode(list2.get(1)); + }else{ + log.warn("2、projectId="+orient.getProjectId()+" category is null"); + } }); } } @@ -168,7 +197,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic } } - + log.error(String.format("/data/stats/demo/project-test,screen_project_**表抽取完毕,customerId:%s", param.getCustomerId())); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java index 5ded177ae0..fcb81fc243 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java @@ -17,6 +17,7 @@ package com.epmet.service.evaluationindex.screen; +import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; @@ -35,7 +36,7 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2020-09-22 */ -public interface ScreenCustomerAgencyService{ +public interface ScreenCustomerAgencyService extends BaseService { /** * @Description 根据agencyId,查询所有子级agencyId,【当机关的级别为 community时,所有子级为gridId】 @@ -137,5 +138,21 @@ public interface ScreenCustomerAgencyService{ * @author sun */ List getByCustomerId(String customerId); + /** + * @Description 根据ID获取组织 + * @Param agencyId + * @Return {@link ScreenCustomerAgencyEntity} + * @Author zhaoqifeng + * @Date 2021/10/15 15:44 + */ + ScreenCustomerAgencyEntity getAgencyById(String agencyId); + /** + * @Description 获取组织列表 + * @Param customerId + * @Return {@link Map< String, ScreenCustomerAgencyEntity>} + * @Author zhaoqifeng + * @Date 2021/10/15 15:44 + */ + Map getAgencyList(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index 1fb59aa3b5..bf701b81d3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java @@ -28,6 +28,7 @@ import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; import java.util.List; +import java.util.Map; /** * 网格(党支部)信息 @@ -111,4 +112,21 @@ public interface ScreenCustomerGridService extends BaseService selectGridInfoList(String customerId, String pids); List selectEntityByAgencyId(String customerId, String parentAgencyId); + + /** + * @Description 根据ID获取网格 + * @Param gridId + * @Return {@link ScreenCustomerGridDTO} + * @Author zhaoqifeng + * @Date 2021/10/15 15:50 + */ + ScreenCustomerGridDTO getGridById(String gridId); + /** + * @Description 获取网格列表 + * @Param customerId + * @Return {@link Map} + * @Author zhaoqifeng + * @Date 2021/10/15 15:50 + */ + Map getGridList(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java index 7b82707c91..2cf68852db 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java @@ -127,4 +127,15 @@ public interface ScreenProjectDataService extends BaseService meta,List orient); int updateProjectSatisfactionScore(String projectId, BigDecimal calProjectSatisfactionScore); + + /** + * 获取项目 + * @Param customerId + * @Param projectId + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/15 14:22 + */ + List getProjectList(String customerId, String projectId); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java index 16ba642e62..972d8ef961 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java @@ -17,7 +17,9 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; @@ -36,13 +38,14 @@ import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; import lombok.extern.slf4j.Slf4j; +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 org.springframework.util.CollectionUtils; -import org.springframework.util.StringUtils; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -54,7 +57,7 @@ import java.util.stream.Collectors; @Service @Slf4j @DataSource(DataSourceConstant.EVALUATION_INDEX) -public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyService { +public class ScreenCustomerAgencyServiceImpl extends BaseServiceImpl implements ScreenCustomerAgencyService { @Autowired private ScreenCustomerAgencyDao screenCustomerAgencyDao; @@ -304,4 +307,30 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ return screenCustomerAgencyDao.selectByCustomerId(customerId); } + @Override + public ScreenCustomerAgencyEntity getAgencyById(String agencyId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ScreenCustomerAgencyEntity::getAgencyId, agencyId); + return baseDao.selectOne(wrapper); + } + + /** + * @param customerId + * @Description 获取组织列表 + * @Param customerId + * @Return {@link Map< String, ScreenCustomerAgencyEntity>} + * @Author zhaoqifeng + * @Date 2021/10/15 15:44 + */ + @Override + public Map getAgencyList(String customerId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(customerId), ScreenCustomerAgencyEntity::getAgencyId, customerId); + List list = baseDao.selectList(wrapper); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(ScreenCustomerAgencyEntity::getAgencyId, Function.identity())); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index 1ae24e2d25..c87c58f7fd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgSourceTypeConstant; @@ -34,15 +35,15 @@ import com.epmet.dto.screen.ScreenProjectGridDailyDTO; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +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 org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.List; +import java.util.*; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 网格(党支部)信息 @@ -215,4 +216,36 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl selectEntityByAgencyId(String customerId, String parentAgencyId) { return baseDao.selectEntityByAgencyId(customerId,parentAgencyId); } + + /** + * @param gridId + * @Description 根据ID获取网格 + * @Param gridId + * @Return {@link ScreenCustomerGridDTO} + * @Author zhaoqifeng + * @Date 2021/10/15 15:50 + */ + @Override + public ScreenCustomerGridDTO getGridById(String gridId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(ScreenCustomerGridEntity::getGridId, gridId); + ScreenCustomerGridEntity entity = baseDao.selectOne(wrapper); + return ConvertUtils.sourceToTarget(entity, ScreenCustomerGridDTO.class); + } + + /** + * @param customerId + * @Description 获取网格列表 + * @Param customerId + * @Return {@link Map } + * @Author zhaoqifeng + * @Date 2021/10/15 15:50 + */ + @Override + public Map getGridList(String customerId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(customerId), ScreenCustomerGridEntity::getGridId, customerId); + List list = baseDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(list, ScreenCustomerGridDTO.class).stream().collect(Collectors.toMap(ScreenCustomerGridDTO::getGridId, Function.identity())); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java index 5e14db736e..10678a2fbc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.evaluationindex.screen.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.dynamic.datasource.annotation.DataSource; @@ -26,7 +27,8 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; -import com.epmet.dao.evaluationindex.screen.*; +import com.epmet.dao.evaluationindex.screen.ScreenProjectDataDao; +import com.epmet.dao.evaluationindex.screen.ScreenProjectImgDataDao; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; @@ -42,7 +44,6 @@ import org.springframework.util.CollectionUtils; import javax.annotation.Resource; import java.math.BigDecimal; -import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Date; @@ -134,22 +135,18 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl} + * @Author zhaoqifeng + * @Date 2021/10/15 14:22 + */ + @Override + public List getProjectList(String customerId, String projectId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(customerId), ScreenProjectDataEntity::getCustomerId, customerId); + wrapper.eq(StringUtils.isNotBlank(projectId), ScreenProjectDataEntity::getProjectId, projectId); + wrapper.ne(ScreenProjectDataEntity::getCategoryCode, null); + wrapper.ne(ScreenProjectDataEntity::getCategoryCode, ""); + List list = baseDao.selectList(wrapper); + return ConvertUtils.sourceToTarget(list, ScreenProjectDataDTO.class); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java index 6e2396199d..249eb11c81 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java @@ -1,25 +1,42 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.constant.ProjectConstant; +import com.epmet.dto.basereport.form.EventInfoFormDTO; import com.epmet.dto.org.result.CustomerAgencyDTO; import com.epmet.dto.org.result.CustomerGridDTO; +import com.epmet.dto.screen.ScreenCustomerGridDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.result.CustomerStaffDTO; +import com.epmet.dto.user.result.GridUserInfoDTO; import com.epmet.dto.user.result.MidPatrolDetailResult; import com.epmet.dto.user.result.MidPatrolRecordResult; -import com.epmet.dto.user.result.GridUserInfoDTO; +import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; +import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; +import com.epmet.opendata.dto.BaseDisputeProcessDTO; import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import com.epmet.service.DataReportingService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; +import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; import com.epmet.service.org.CustomerAgencyService; import com.epmet.service.org.CustomerGridService; +import com.epmet.service.stats.CustomerProjectCategoryDictService; import com.epmet.service.user.StatsStaffPatrolService; import com.epmet.service.user.UserService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; +import javax.annotation.Resource; import java.util.*; +import java.util.stream.Collectors; /** * @dscription 省网格化平台数据上报--数据查询 @@ -34,8 +51,16 @@ public class DataReportingServiceImpl implements DataReportingService { private CustomerGridService customerGridService; @Autowired private UserService userService; + @Resource + private ScreenProjectDataService screenProjectDataService; + @Resource + private ScreenCustomerAgencyService screenCustomerAgencyService; + @Resource + private ScreenCustomerGridService screenCustomerGridService; @Autowired private StatsStaffPatrolService statsStaffPatrolService; + @Resource + private CustomerProjectCategoryDictService customerProjectCategoryDictService; /** * @Author sun @@ -105,6 +130,93 @@ public class DataReportingServiceImpl implements DataReportingService { return resultList; } + /** + * 事件上报 + * + * @param formDTO + * @Param formDTO + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2021/10/15 14:10 + */ + @Override + public List getEventInfo(EventInfoFormDTO formDTO) { + List list; + //根据入参,获取项目 + List projectList = screenProjectDataService.getProjectList(formDTO.getCustomerId(), formDTO.getProjectId()); + //项目列表为空,返回空数组 + if(CollectionUtils.isEmpty(projectList)) { + return Collections.emptyList(); + } + //项目ID不为空时,因为只有一条,可以直接处理 + if (StringUtils.isNotEmpty(formDTO.getProjectId())) { + list = projectList.stream().map(project -> { + BaseDisputeProcessDTO dto = getBaseDisputeProcessDTO(project); + if (OrgTypeConstant.AGENCY.equals(project.getOrgType())) { + ScreenCustomerAgencyEntity agency = screenCustomerAgencyService.getAgencyById(project.getOrgId()); + dto.setOrgCode(agency.getCode()); + dto.setOrgName(agency.getAgencyName()); + } else { + ScreenCustomerGridDTO grid = screenCustomerGridService.getGridById(project.getOrgId()); + dto.setOrgCode(grid.getCode()); + dto.setOrgName(grid.getGridName()); + } + return dto; + }).collect(Collectors.toList()); + } else { + //项目ID不为空时,提前取出客户下的组织和网格 + Map agencyMap = screenCustomerAgencyService.getAgencyList(formDTO.getCustomerId()); + Map gridMap = screenCustomerGridService.getGridList(formDTO.getCustomerId()); + list = projectList.stream().map(project -> { + BaseDisputeProcessDTO dto = getBaseDisputeProcessDTO(project); + if (OrgTypeConstant.AGENCY.equals(project.getOrgType())) { + ScreenCustomerAgencyEntity agency = agencyMap.get(project.getOrgId()); + dto.setOrgCode(agency.getCode()); + dto.setOrgName(agency.getAgencyName()); + } else { + ScreenCustomerGridDTO grid = gridMap.get(project.getOrgId()); + dto.setOrgCode(grid.getCode()); + dto.setOrgName(grid.getGridName()); + } + return dto; + }).collect(Collectors.toList()); + } + return list.stream().filter(item -> StringUtils.isNotBlank(item.getEventCategory())).collect(Collectors.toList()); + } + + private BaseDisputeProcessDTO getBaseDisputeProcessDTO(ScreenProjectDataDTO project) { + BaseDisputeProcessDTO dto = new BaseDisputeProcessDTO(); + dto.setId(project.getProjectId()); + dto.setCustomerId(project.getCustomerId()); + dto.setEventName(project.getProjectTitle()); + String categoryCode = project.getCategoryCode().split(StrConstant.COMMA)[0]; + //如果是孔村、榆山、锦水的项目需要关联分类字典表 + if("2fe0065f70ca0e23ce4c26fca5f1d933".equals(project.getCustomerId()) || + "44876154d10d7cb7affd92000f84f833".equals(project.getCustomerId()) || + "46c55cb862d6d5e6d05d2ab61a1cc07e".equals(project.getCustomerId())) { + CustomerProjectCategoryDictEntity categoryEntity = customerProjectCategoryDictService.getByCategoryCode(project.getCustomerId(), categoryCode); + if (null != categoryEntity) { + categoryCode = categoryEntity.getEpmetCategoryCode(); + } else { + categoryCode = null; + } + } + dto.setReportTime(project.getProjectCreateTime()); + dto.setHappenDate(DateUtils.parseDate(DateUtils.format(project.getProjectCreateTime()), DateUtils.DATE_PATTERN)); + dto.setEventDescription(project.getProjectContent()); + //TODO 办结方式 + dto.setWaysOfResolving("01"); + dto.setSuccessfulOrNo(ProjectConstant.CLOSED_CASE.equals(project.getProjectStatusCode())?"Y":"N"); + //TODO 办结层级 + dto.setCompleteLevel("01"); + dto.setCompleteTime(project.getCloseCaseTime()); + dto.setLat(project.getLatitude()); + dto.setLng(project.getLongitude()); + return dto; + } + + + @Override public List getPatrolRecordList(MidPatrolFormDTO formDTO) { return userService.getPatrolRecordList(formDTO); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java index d16db0530e..a71c61bfbd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -20,7 +20,6 @@ package com.epmet.service.project.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectProcessDao; import com.epmet.dto.ProjectProcessDTO; @@ -40,7 +39,9 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.*; +import java.util.Collections; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -144,7 +145,7 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( merge -> { target.setProjectStatusCode("closed_case"); - target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN)); + target.setCloseCaseTime(merge.getCreatedTime()); return target; } )).collect(Collectors.toList()); @@ -166,7 +167,7 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( merge -> { //target.setProjectStatusCode("closed_case"); - target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN)); + target.setCloseCaseTime(merge.getCreatedTime()); return target; } )).collect(Collectors.toList()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java index ef8440c594..cc8633b08f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java @@ -55,4 +55,14 @@ public interface CustomerProjectCategoryDictService extends BaseService formDTO); + + /** + * @Description 获取分类信息 + * @Param customerId + * @Param categoryCode + * @Return {@link CustomerProjectCategoryDictEntity} + * @Author zhaoqifeng + * @Date 2021/10/15 16:33 + */ + CustomerProjectCategoryDictEntity getByCategoryCode(String customerId, String categoryCode); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java index 97a8a560f5..d7c81c93ad 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java @@ -17,6 +17,7 @@ package com.epmet.service.stats.impl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; @@ -116,4 +117,22 @@ public class CustomerProjectCategoryDictServiceImpl extends BaseServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(CustomerProjectCategoryDictEntity::getCategoryCode, categoryCode); + wrapper.eq(CustomerProjectCategoryDictEntity::getCustomerId, customerId); + return baseDao.selectOne(wrapper); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 5558bfaa05..b8560a06a1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -578,10 +578,12 @@ data.PIDS as allParentIds, data.TOPIC_ID, IFNULL(log.response, 0) AS responseCount, - #{dataEndTime} as dataEndTime - + #{dataEndTime} as dataEndTime, + data.ORIGIN as origin, + grid.GRID_NAME as tempGridName FROM `fact_origin_project_main_daily` data - LEFT JOIN DIM_AGENCY agency on data.agency_id = agency.id + LEFT JOIN DIM_AGENCY agency on (data.agency_id = agency.id and agency.del_flag='0') + LEFT JOIN DIM_GRID grid on (data.grid_id=grid.id and grid.del_flag='0') LEFT JOIN ( SELECT PROJECT_ID, COUNT(IS_ACTIVE) AS response FROM fact_origin_project_log_daily WHERE (ACTION_CODE = 'close' OR ACTION_CODE = 'response' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'return') 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 3ee79011e8..514f743353 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 @@ -311,7 +311,8 @@