Browse Source

Merge remote-tracking branch 'remotes/origin/dev_grid_platform' into develop

# Conflicts:
#	epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java
dev_shibei_match
jianjun 4 years ago
parent
commit
db0813cee4
  1. 17
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java
  2. 143
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/result/EventInfoResultDTO.java
  3. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java
  4. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java
  5. 16
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java
  6. 19
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java
  7. 17
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DataReportingController.java
  8. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerAgencyEntity.java
  9. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenCustomerGridEntity.java
  10. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java
  11. 16
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java
  12. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerAgencyService.java
  13. 18
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java
  14. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java
  15. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java
  16. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  17. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
  18. 115
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/DataReportingServiceImpl.java
  19. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java
  20. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java
  21. 19
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java
  22. 207
      epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseDisputeProcessDTO.java
  23. 2
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/UserPatrolRecordController.java
  24. 33
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseDisputeProcessDao.java
  25. 177
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseDisputeProcessEntity.java
  26. 18
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java
  27. 95
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseDisputeProcessService.java
  28. 11
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/UserPatrolRecordService.java
  29. 99
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java
  30. 80
      epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java
  31. 42
      epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseDisputeProcessDao.xml

17
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/EventInfoFormDTO.java

@ -0,0 +1,17 @@
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;
}

143
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;
/**
* 是否办结 YN
*/
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;
/**
* 重点场所是否变动 YN
*/
private String isKeyareaState;
/**
* 重点人员是否在当地 YN
*/
private String isKeypeopleLocate;
/**
* 重点人员现状
*/
private String keypeopleStatus;
}

2
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 * 客户id
*/ */
private String customerId; private String customerId;
private String code;
/** /**
* 网格id * 网格id
*/ */

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java

@ -170,7 +170,7 @@ public class ScreenProjectDataDTO implements Serializable {
/** /**
* 结案日期 * 结案日期
*/ */
private String closeCaseTime; private Date closeCaseTime;
/** /**
* 数据更新至: yyyy|yyyMM|yyyyMMdd * 数据更新至: yyyy|yyyMM|yyyyMMdd

16
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.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO; 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.BizDataFormDTO;
import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO; 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.screen.form.InitCustomerIndexForm;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.dto.user.param.MidPatrolFormDTO; 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.MidPatrolDetailResult;
import com.epmet.dto.user.result.MidPatrolRecordResult; import com.epmet.dto.user.result.MidPatrolRecordResult;
import com.epmet.dto.user.result.GridUserInfoDTO;
import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBackFactory; 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.GridBaseInfoFormDTO;
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO;
import org.springframework.cloud.openfeign.FeignClient; 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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
@ -331,4 +331,14 @@ public interface DataStatisticalOpenFeignClient {
*/ */
@PostMapping(value = "/data/stats/datareporting/getPatrolDetailList") @PostMapping(value = "/data/stats/datareporting/getPatrolDetailList")
Result<List<MidPatrolDetailResult>> getPatrolDetailList(@RequestBody MidPatrolFormDTO midPatrolFormDTO); Result<List<MidPatrolDetailResult>> getPatrolDetailList(@RequestBody MidPatrolFormDTO midPatrolFormDTO);
/**
* 事件上报
* @Param formDTO
* @Return {@link Result<List<BaseDisputeProcessDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/15 16:50
*/
@PostMapping("/data/stats/datareporting/eventinfo")
Result<List<BaseDisputeProcessDTO>> getEventInfo(@RequestBody EventInfoFormDTO formDTO);
} }

19
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.ModuleUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.StatsFormDTO; 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.BizDataFormDTO;
import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO; 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.screen.form.InitCustomerIndexForm;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.dto.user.param.MidPatrolFormDTO; 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.MidPatrolDetailResult;
import com.epmet.dto.user.result.MidPatrolRecordResult; import com.epmet.dto.user.result.MidPatrolRecordResult;
import com.epmet.dto.user.result.GridUserInfoDTO;
import com.epmet.feign.DataStatisticalOpenFeignClient; import com.epmet.feign.DataStatisticalOpenFeignClient;
import com.epmet.opendata.dto.BaseDisputeProcessDTO;
import com.epmet.opendata.dto.form.GridBaseInfoFormDTO; import com.epmet.opendata.dto.form.GridBaseInfoFormDTO;
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO;
@ -319,4 +320,18 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp
public Result<List<MidPatrolDetailResult>> getPatrolDetailList(MidPatrolFormDTO midPatrolFormDTO) { public Result<List<MidPatrolDetailResult>> getPatrolDetailList(MidPatrolFormDTO midPatrolFormDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getPatrolDetailList", midPatrolFormDTO); return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getPatrolDetailList", midPatrolFormDTO);
} }
/**
* 事件上报
*
* @param formDTO
* @Param formDTO
* @Return {@link Result<List< BaseDisputeProcessDTO >>}
* @Author zhaoqifeng
* @Date 2021/10/15 16:50
*/
@Override
public Result<List<BaseDisputeProcessDTO>> getEventInfo(EventInfoFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getEventInfo", formDTO);
}
} }

17
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.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; 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.CustomerAgencyDTO;
import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.org.result.CustomerGridDTO;
import com.epmet.dto.user.param.MidPatrolFormDTO; 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.MidPatrolDetailResult;
import com.epmet.dto.user.result.MidPatrolRecordResult; 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.GridBaseInfoFormDTO;
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO;
import com.epmet.service.DataReportingService; import com.epmet.service.DataReportingService;
@ -89,4 +90,16 @@ public class DataReportingController {
return new Result<List<MidPatrolDetailResult>>().ok(dataReportingService.getPatrolDetailList(formDTO)); return new Result<List<MidPatrolDetailResult>>().ok(dataReportingService.getPatrolDetailList(formDTO));
} }
/**
* @Description 事件上报
* @Param formDTO
* @Return {@link Result<List<BaseDisputeProcessDTO>>}
* @Author zhaoqifeng
* @Date 2021/10/15 14:09
*/
@PostMapping("eventinfo")
public Result<List<BaseDisputeProcessDTO>> getEventInfo(@RequestBody(required = false) EventInfoFormDTO formDTO) {
return new Result<List<BaseDisputeProcessDTO>>().ok(dataReportingService.getEventInfo(formDTO));
}
} }

2
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 areaCode;
private String code;
private String sourceType; private String sourceType;
/** /**

1
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 * 客户id
*/ */
private String customerId; private String customerId;
private String code;
/** /**
* 网格id * 网格id

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java

@ -143,7 +143,7 @@ public class ScreenProjectDataEntity extends BaseEpmetEntity {
/** /**
* 结案日期 * 结案日期
*/ */
private String closeCaseTime; private Date closeCaseTime;
/** /**
* 数据更新至: yyyy|yyyMM|yyyyMMdd * 数据更新至: yyyy|yyyMM|yyyyMMdd
@ -159,4 +159,14 @@ public class ScreenProjectDataEntity extends BaseEpmetEntity {
* 满意度得分 * 满意度得分
*/ */
private BigDecimal satisfactionScore; private BigDecimal satisfactionScore;
/**
* 来源议题issue 项目立项:agency 事件:resi_event
*/
private String origin;
/**
* 分类编码存在多个以英文逗号隔开注意与all_cagtegory_name顺序一致;
*/
private String categoryCode;
} }

16
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/DataReportingService.java

@ -1,12 +1,14 @@
package com.epmet.service; 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.CustomerAgencyDTO;
import com.epmet.dto.org.result.CustomerGridDTO; import com.epmet.dto.org.result.CustomerGridDTO;
import com.epmet.dto.user.param.MidPatrolFormDTO; 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.MidPatrolDetailResult;
import com.epmet.dto.user.result.MidPatrolRecordResult; 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.GridBaseInfoFormDTO;
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO;
@ -58,4 +60,14 @@ public interface DataReportingService {
*/ */
List<MidPatrolDetailResult> getPatrolDetailList(MidPatrolFormDTO formDTO); List<MidPatrolDetailResult> getPatrolDetailList(MidPatrolFormDTO formDTO);
/**
* 事件上报
* @Param formDTO
* @Return {@link List<EventInfoResultDTO>}
* @Author zhaoqifeng
* @Date 2021/10/15 14:10
*/
List<BaseDisputeProcessDTO> getEventInfo(EventInfoFormDTO formDTO);
} }

19
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; package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.extract.form.PartyBaseInfoFormDTO; import com.epmet.dto.extract.form.PartyBaseInfoFormDTO;
import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO; import com.epmet.dto.extract.form.ScreenPartyBranchDataFormDTO;
@ -35,7 +36,7 @@ import java.util.Map;
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2020-09-22 * @since v1.0.0 2020-09-22
*/ */
public interface ScreenCustomerAgencyService{ public interface ScreenCustomerAgencyService extends BaseService<ScreenCustomerAgencyEntity> {
/** /**
* @Description 根据agencyId查询所有子级agencyId当机关的级别为 community时所有子级为gridId * @Description 根据agencyId查询所有子级agencyId当机关的级别为 community时所有子级为gridId
@ -137,5 +138,21 @@ public interface ScreenCustomerAgencyService{
* @author sun * @author sun
*/ */
List<CustomerAgencyDTO> getByCustomerId(String customerId); List<CustomerAgencyDTO> 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<String, ScreenCustomerAgencyEntity> getAgencyList(String customerId);
} }

18
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 com.epmet.entity.org.CustomerGridEntity;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 网格(党支部)信息 * 网格(党支部)信息
@ -111,4 +112,21 @@ public interface ScreenCustomerGridService extends BaseService<ScreenCustomerGri
List<ScreenProjectGridDailyDTO> selectGridInfoList(String customerId, String pids); List<ScreenProjectGridDailyDTO> selectGridInfoList(String customerId, String pids);
List<ScreenCustomerGridEntity> selectEntityByAgencyId(String customerId, String parentAgencyId); List<ScreenCustomerGridEntity> 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<String, ScreenCustomerGridDTO>}
* @Author zhaoqifeng
* @Date 2021/10/15 15:50
*/
Map<String, ScreenCustomerGridDTO> getGridList(String customerId);
} }

11
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<ScreenProjectDataE
void insertOrUpdateBatch(String customerId,String dateId,List<ScreenProjectDataDTO> meta,List<ScreenProjectDataDTO> orient); void insertOrUpdateBatch(String customerId,String dateId,List<ScreenProjectDataDTO> meta,List<ScreenProjectDataDTO> orient);
int updateProjectSatisfactionScore(String projectId, BigDecimal calProjectSatisfactionScore); int updateProjectSatisfactionScore(String projectId, BigDecimal calProjectSatisfactionScore);
/**
* 获取项目
* @Param customerId
* @Param projectId
* @Return {@link List<ScreenProjectDataDTO>}
* @Author zhaoqifeng
* @Date 2021/10/15 14:22
*/
List<ScreenProjectDataDTO> getProjectList(String customerId, String projectId);
} }

32
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerAgencyServiceImpl.java

@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.screen.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; 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.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
@ -37,13 +38,14 @@ import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;
import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.org.CustomerAgencyEntity;
import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService; import com.epmet.service.evaluationindex.screen.ScreenCustomerAgencyService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.*; import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -55,7 +57,7 @@ import java.util.stream.Collectors;
@Service @Service
@Slf4j @Slf4j
@DataSource(DataSourceConstant.EVALUATION_INDEX) @DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyService { public class ScreenCustomerAgencyServiceImpl extends BaseServiceImpl<ScreenCustomerAgencyDao, ScreenCustomerAgencyEntity> implements ScreenCustomerAgencyService {
@Autowired @Autowired
private ScreenCustomerAgencyDao screenCustomerAgencyDao; private ScreenCustomerAgencyDao screenCustomerAgencyDao;
@ -312,4 +314,30 @@ public class ScreenCustomerAgencyServiceImpl implements ScreenCustomerAgencyServ
return screenCustomerAgencyDao.selectByCustomerId(customerId); return screenCustomerAgencyDao.selectByCustomerId(customerId);
} }
@Override
public ScreenCustomerAgencyEntity getAgencyById(String agencyId) {
LambdaQueryWrapper<ScreenCustomerAgencyEntity> 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<String, ScreenCustomerAgencyEntity> getAgencyList(String customerId) {
LambdaQueryWrapper<ScreenCustomerAgencyEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(customerId), ScreenCustomerAgencyEntity::getAgencyId, customerId);
List<ScreenCustomerAgencyEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}
return list.stream().collect(Collectors.toMap(ScreenCustomerAgencyEntity::getAgencyId, Function.identity()));
}
} }

41
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java

@ -23,6 +23,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; 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.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgSourceTypeConstant; import com.epmet.constant.OrgSourceTypeConstant;
@ -35,15 +36,15 @@ import com.epmet.dto.screen.ScreenProjectGridDailyDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.org.CustomerGridEntity; import com.epmet.entity.org.CustomerGridEntity;
import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.util.*;
import java.util.Collections; import java.util.function.Function;
import java.util.Date; import java.util.stream.Collectors;
import java.util.List;
/** /**
* 网格(党支部)信息 * 网格(党支部)信息
@ -216,4 +217,36 @@ public class ScreenCustomerGridServiceImpl extends BaseServiceImpl<ScreenCustome
public List<ScreenCustomerGridEntity> selectEntityByAgencyId(String customerId, String parentAgencyId) { public List<ScreenCustomerGridEntity> selectEntityByAgencyId(String customerId, String parentAgencyId) {
return baseDao.selectEntityByAgencyId(customerId,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<ScreenCustomerGridEntity> 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 <String, ScreenCustomerGridDTO>}
* @Author zhaoqifeng
* @Date 2021/10/15 15:50
*/
@Override
public Map<String, ScreenCustomerGridDTO> getGridList(String customerId) {
LambdaQueryWrapper<ScreenCustomerGridEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(customerId), ScreenCustomerGridEntity::getGridId, customerId);
List<ScreenCustomerGridEntity> list = baseDao.selectList(wrapper);
return ConvertUtils.sourceToTarget(list, ScreenCustomerGridDTO.class).stream().collect(Collectors.toMap(ScreenCustomerGridDTO::getGridId, Function.identity()));
}
} }

26
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; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.dynamic.datasource.annotation.DataSource; 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.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DataSourceConstant; 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.ScreenProjectDataDTO;
import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO;
import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO;
@ -275,4 +277,26 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
return baseDao.updateProjectSatisfactionScore(projectId,score); return baseDao.updateProjectSatisfactionScore(projectId,score);
} }
/**
* 获取项目
*
* @param customerId
* @param projectId
* @Param customerId
* @Param projectId
* @Return {@link List<ScreenProjectDataDTO>}
* @Author zhaoqifeng
* @Date 2021/10/15 14:22
*/
@Override
public List<ScreenProjectDataDTO> getProjectList(String customerId, String projectId) {
LambdaQueryWrapper<ScreenProjectDataEntity> 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<ScreenProjectDataEntity> list = baseDao.selectList(wrapper);
return ConvertUtils.sourceToTarget(list, ScreenProjectDataDTO.class);
}
} }

115
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; 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.CustomerAgencyDTO;
import com.epmet.dto.org.result.CustomerGridDTO; 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.param.MidPatrolFormDTO;
import com.epmet.dto.user.result.CustomerStaffDTO; 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.MidPatrolDetailResult;
import com.epmet.dto.user.result.MidPatrolRecordResult; 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.GridBaseInfoFormDTO;
import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO; import com.epmet.opendata.dto.form.StaffBaseInfoFormDTO;
import com.epmet.service.DataReportingService; 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.CustomerAgencyService;
import com.epmet.service.org.CustomerGridService; import com.epmet.service.org.CustomerGridService;
import com.epmet.service.stats.CustomerProjectCategoryDictService;
import com.epmet.service.user.StatsStaffPatrolService; import com.epmet.service.user.StatsStaffPatrolService;
import com.epmet.service.user.UserService; import com.epmet.service.user.UserService;
import lombok.extern.slf4j.Slf4j; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
/** /**
* @dscription 省网格化平台数据上报--数据查询 * @dscription 省网格化平台数据上报--数据查询
@ -34,8 +51,16 @@ public class DataReportingServiceImpl implements DataReportingService {
private CustomerGridService customerGridService; private CustomerGridService customerGridService;
@Autowired @Autowired
private UserService userService; private UserService userService;
@Resource
private ScreenProjectDataService screenProjectDataService;
@Resource
private ScreenCustomerAgencyService screenCustomerAgencyService;
@Resource
private ScreenCustomerGridService screenCustomerGridService;
@Autowired @Autowired
private StatsStaffPatrolService statsStaffPatrolService; private StatsStaffPatrolService statsStaffPatrolService;
@Resource
private CustomerProjectCategoryDictService customerProjectCategoryDictService;
/** /**
* @Author sun * @Author sun
@ -105,6 +130,92 @@ public class DataReportingServiceImpl implements DataReportingService {
return resultList; return resultList;
} }
/**
* 事件上报
*
* @param formDTO
* @Param formDTO
* @Return {@link List<BaseDisputeProcessDTO>}
* @Author zhaoqifeng
* @Date 2021/10/15 14:10
*/
@Override
public List<BaseDisputeProcessDTO> getEventInfo(EventInfoFormDTO formDTO) {
List<BaseDisputeProcessDTO> list;
//根据入参,获取项目
List<ScreenProjectDataDTO> 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<String, ScreenCustomerAgencyEntity> agencyMap = screenCustomerAgencyService.getAgencyList(formDTO.getCustomerId());
Map<String, ScreenCustomerGridDTO> 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.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 @Override
public List<MidPatrolRecordResult> getPatrolRecordList(MidPatrolFormDTO formDTO) { public List<MidPatrolRecordResult> getPatrolRecordList(MidPatrolFormDTO formDTO) {
return userService.getPatrolRecordList(formDTO); return userService.getPatrolRecordList(formDTO);

9
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.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.project.ProjectProcessDao; import com.epmet.dao.project.ProjectProcessDao;
import com.epmet.dto.ProjectProcessDTO; import com.epmet.dto.ProjectProcessDTO;
@ -40,7 +39,9 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils; 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; import java.util.stream.Collectors;
/** /**
@ -144,7 +145,7 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
list = list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( list = list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map(
merge -> { merge -> {
target.setProjectStatusCode("closed_case"); target.setProjectStatusCode("closed_case");
target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN)); target.setCloseCaseTime(merge.getCreatedTime());
return target; return target;
} }
)).collect(Collectors.toList()); )).collect(Collectors.toList());
@ -166,7 +167,7 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
list = list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( list = list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map(
merge -> { merge -> {
//target.setProjectStatusCode("closed_case"); //target.setProjectStatusCode("closed_case");
target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN)); target.setCloseCaseTime(merge.getCreatedTime());
return target; return target;
} }
)).collect(Collectors.toList()); )).collect(Collectors.toList());

10
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<Customer
* @Date 16:03 2021-03-22 * @Date 16:03 2021-03-22
**/ **/
void uploadCategoryDict(ScreenCollFormDTO<CategoryDictFormDTO> formDTO); void uploadCategoryDict(ScreenCollFormDTO<CategoryDictFormDTO> formDTO);
/**
* @Description 获取分类信息
* @Param customerId
* @Param categoryCode
* @Return {@link CustomerProjectCategoryDictEntity}
* @Author zhaoqifeng
* @Date 2021/10/15 16:33
*/
CustomerProjectCategoryDictEntity getByCategoryCode(String customerId, String categoryCode);
} }

19
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; 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.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
@ -116,4 +117,22 @@ public class CustomerProjectCategoryDictServiceImpl extends BaseServiceImpl<Cust
baseDao.batchInsertCustomerProjectCategoryDict(formDTO.getDataList(), formDTO.getCustomerId()); baseDao.batchInsertCustomerProjectCategoryDict(formDTO.getDataList(), formDTO.getCustomerId());
} }
} }
/**
* @param customerId
* @param categoryCode
* @Description 获取分类信息
* @Param customerId
* @Param categoryCode
* @Return {@link CustomerProjectCategoryDictEntity}
* @Author zhaoqifeng
* @Date 2021/10/15 16:33
*/
@Override
public CustomerProjectCategoryDictEntity getByCategoryCode(String customerId, String categoryCode) {
LambdaQueryWrapper<CustomerProjectCategoryDictEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(CustomerProjectCategoryDictEntity::getCategoryCode, categoryCode);
wrapper.eq(CustomerProjectCategoryDictEntity::getCustomerId, customerId);
return baseDao.selectOne(wrapper);
}
} }

207
epmet-module/open-data-worker/open-data-worker-client/src/main/java/com/epmet/opendata/dto/BaseDisputeProcessDTO.java

@ -0,0 +1,207 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.dto;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 事件信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15
*/
@Data
public class BaseDisputeProcessDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户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;
/**
* 是否办结 YN
*/
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;
/**
* 重点场所是否变动 YN
*/
private String isKeyareaState;
/**
* 重点人员是否在当地 YN
*/
private String isKeypeopleLocate;
/**
* 重点人员现状
*/
private String keypeopleStatus;
/**
* 删除标识 0.未删除 1.已删除
*/
private Long delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

2
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/controller/UserPatrolRecordController.java

@ -48,7 +48,7 @@ public class UserPatrolRecordController {
@PostMapping("patrol") @PostMapping("patrol")
public Result getStaffBaseInfo(@RequestBody(required = false) UpsertPatrolRecordForm formDTO) { public Result getStaffBaseInfo(@RequestBody(required = false) UpsertPatrolRecordForm formDTO) {
ValidatorUtils.validateEntity(formDTO); ValidatorUtils.validateEntity(formDTO);
userPatrolRecordService.upsertPatrolRecord(formDTO); userPatrolRecordService.insertPatrolRecord(formDTO);
return new Result(); return new Result();
} }
} }

33
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/dao/BaseDisputeProcessDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.opendata.entity.BaseDisputeProcessEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 事件信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15
*/
@Mapper
public interface BaseDisputeProcessDao extends BaseDao<BaseDisputeProcessEntity> {
}

177
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/entity/BaseDisputeProcessEntity.java

@ -0,0 +1,177 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
/**
* 事件信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("base_dispute_process")
public class BaseDisputeProcessEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户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;
/**
* 是否办结 YN
*/
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;
/**
* 重点场所是否变动 YN
*/
private String isKeyareaState;
/**
* 重点人员是否在当地 YN
*/
private String isKeypeopleLocate;
/**
* 重点人员现状
*/
private String keypeopleStatus;
}

18
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/mq/listener/OpenDataPatrolChangeEventListener.java

@ -9,6 +9,7 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.opendata.dto.form.UpsertPatrolRecordForm; import com.epmet.opendata.dto.form.UpsertPatrolRecordForm;
import com.epmet.opendata.service.UserPatrolRecordService; import com.epmet.opendata.service.UserPatrolRecordService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
@ -76,7 +77,19 @@ public class OpenDataPatrolChangeEventListener implements MessageListenerConcurr
patrolRecordForm.setCustomerId(msgObj.getCustomerId()); patrolRecordForm.setCustomerId(msgObj.getCustomerId());
patrolRecordForm.setPatrolId(msgObj.getPatrolId()); patrolRecordForm.setPatrolId(msgObj.getPatrolId());
patrolRecordForm.setActionType(tags); patrolRecordForm.setActionType(tags);
Boolean aBoolean = SpringContextUtils.getBean(UserPatrolRecordService.class).upsertPatrolRecord(patrolRecordForm); Boolean aBoolean = false;
switch (tags) {
case SystemMessageType.USER_PATROL_START:
aBoolean = SpringContextUtils.getBean(UserPatrolRecordService.class).insertPatrolRecord(patrolRecordForm);
break;
case SystemMessageType.USER_PATROL_STOP:
aBoolean = SpringContextUtils.getBean(UserPatrolRecordService.class).updatePatrolRecord(patrolRecordForm);
break;
default:
log.error("错误的消息类型:{}", tags);
}
} catch (RenException e) { } catch (RenException e) {
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试 // 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
logger.error("【开放数据事件监听器】-巡查记录信息变更-失败:".concat(ExceptionUtils.getErrorStackTrace(e))); logger.error("【开放数据事件监听器】-巡查记录信息变更-失败:".concat(ExceptionUtils.getErrorStackTrace(e)));
@ -98,10 +111,9 @@ public class OpenDataPatrolChangeEventListener implements MessageListenerConcurr
} }
/** /**
* @description
*
* @param pendingMsgLabel * @param pendingMsgLabel
* @return * @return
* @description
* @author wxz * @author wxz
* @date 2021.10.14 16:32:32 * @date 2021.10.14 16:32:32
*/ */

95
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/BaseDisputeProcessService.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.opendata.dto.BaseDisputeProcessDTO;
import com.epmet.opendata.entity.BaseDisputeProcessEntity;
import java.util.List;
import java.util.Map;
/**
* 事件信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15
*/
public interface BaseDisputeProcessService extends BaseService<BaseDisputeProcessEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<BaseDisputeProcessDTO>
* @author generator
* @date 2021-10-15
*/
PageData<BaseDisputeProcessDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<BaseDisputeProcessDTO>
* @author generator
* @date 2021-10-15
*/
List<BaseDisputeProcessDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return BaseDisputeProcessDTO
* @author generator
* @date 2021-10-15
*/
BaseDisputeProcessDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-10-15
*/
void save(BaseDisputeProcessDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-10-15
*/
void update(BaseDisputeProcessDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-10-15
*/
void delete(String[] ids);
}

11
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/UserPatrolRecordService.java

@ -30,9 +30,16 @@ import com.epmet.opendata.entity.UserPatrolRecordEntity;
public interface UserPatrolRecordService extends BaseService<UserPatrolRecordEntity> { public interface UserPatrolRecordService extends BaseService<UserPatrolRecordEntity> {
/** /**
* desc根据条件更新或者插入巡查记录 * desc根据条件插入巡查记录
* @param patrolRecordForm * @param patrolRecordForm
* @return * @return
*/ */
Boolean upsertPatrolRecord(UpsertPatrolRecordForm patrolRecordForm); Boolean insertPatrolRecord(UpsertPatrolRecordForm patrolRecordForm);
/**
* desc根据条件更新巡查记录及轨迹
* @param patrolRecordForm
* @return
*/
Boolean updatePatrolRecord(UpsertPatrolRecordForm patrolRecordForm);
} }

99
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/BaseDisputeProcessServiceImpl.java

@ -0,0 +1,99 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.opendata.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.opendata.dao.BaseDisputeProcessDao;
import com.epmet.opendata.dto.BaseDisputeProcessDTO;
import com.epmet.opendata.entity.BaseDisputeProcessEntity;
import com.epmet.opendata.service.BaseDisputeProcessService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 事件信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-15
*/
@Service
public class BaseDisputeProcessServiceImpl extends BaseServiceImpl<BaseDisputeProcessDao, BaseDisputeProcessEntity> implements BaseDisputeProcessService {
@Override
public PageData<BaseDisputeProcessDTO> page(Map<String, Object> params) {
IPage<BaseDisputeProcessEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, BaseDisputeProcessDTO.class);
}
@Override
public List<BaseDisputeProcessDTO> list(Map<String, Object> params) {
List<BaseDisputeProcessEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, BaseDisputeProcessDTO.class);
}
private QueryWrapper<BaseDisputeProcessEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<BaseDisputeProcessEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public BaseDisputeProcessDTO get(String id) {
BaseDisputeProcessEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, BaseDisputeProcessDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(BaseDisputeProcessDTO dto) {
BaseDisputeProcessEntity entity = ConvertUtils.sourceToTarget(dto, BaseDisputeProcessEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(BaseDisputeProcessDTO dto) {
BaseDisputeProcessEntity entity = ConvertUtils.sourceToTarget(dto, BaseDisputeProcessEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

80
epmet-module/open-data-worker/open-data-worker-server/src/main/java/com/epmet/opendata/service/impl/UserPatrolRecordServiceImpl.java

@ -18,12 +18,12 @@
package com.epmet.opendata.service.impl; package com.epmet.opendata.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.SystemMessageType;
import com.epmet.dto.user.param.MidPatrolFormDTO; import com.epmet.dto.user.param.MidPatrolFormDTO;
import com.epmet.dto.user.result.MidPatrolDetailResult; import com.epmet.dto.user.result.MidPatrolDetailResult;
import com.epmet.dto.user.result.MidPatrolRecordResult; import com.epmet.dto.user.result.MidPatrolRecordResult;
@ -59,48 +59,76 @@ public class UserPatrolRecordServiceImpl extends BaseServiceImpl<UserPatrolRecor
private UserPatrolDetailDao userPatrolDetailDao; private UserPatrolDetailDao userPatrolDetailDao;
@Override @Override
public Boolean upsertPatrolRecord(UpsertPatrolRecordForm patrolRecordForm) { public Boolean insertPatrolRecord(UpsertPatrolRecordForm patrolRecordForm) {
log.info("upsertPatrolRecord param:{}",JSON.toJSONString(patrolRecordForm)); log.info("upsertPatrolRecord param:{}", JSON.toJSONString(patrolRecordForm));
ValidatorUtils.validateEntity(patrolRecordForm); ValidatorUtils.validateEntity(patrolRecordForm);
boolean delFlag = false; boolean delFlag = false;
MidPatrolFormDTO midPatrolFormDTO = buildParam(patrolRecordForm); MidPatrolFormDTO midPatrolFormDTO = buildParam(patrolRecordForm);
Result<List<MidPatrolRecordResult>> record = dataStatisticalOpenFeignClient.getPatrolRecordList(midPatrolFormDTO); Result<List<MidPatrolRecordResult>> record = dataStatisticalOpenFeignClient.getPatrolRecordList(midPatrolFormDTO);
if (record == null || !record.success()){ if (record == null || !record.success()) {
log.error("获取巡查记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO)); log.error("获取巡查记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO));
return false; return false;
} }
List<MidPatrolRecordResult> data = record.getData(); List<MidPatrolRecordResult> data = record.getData();
if (CollectionUtils.isEmpty(data)){ if (CollectionUtils.isEmpty(data)) {
//数据已被删除了 //数据已被删除了
delFlag = true; delFlag = true;
//暂时设置error 用于排错 //暂时设置error 用于排错
log.error("获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO)); log.error("获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO));
int effectRow = baseDao.deleteById(patrolRecordForm.getPatrolId()); int effectRow = baseDao.deleteById(patrolRecordForm.getPatrolId());
log.warn("del effectRow:{}",effectRow); log.warn("del effectRow:{}", effectRow);
return true; return true;
} }
MidPatrolRecordResult recordResult = data.get(NumConstant.ZERO); MidPatrolRecordResult recordResult = data.get(NumConstant.ZERO);
switch (patrolRecordForm.getActionType()){ UserPatrolRecordEntity recordEntity = buildEntity(recordResult);
case SystemMessageType.USER_PATROL_START:
//insert
baseDao.insert(buildEntity(recordResult));
break;
case SystemMessageType.USER_PATROL_STOP:
//update
baseDao.updateById(buildEntity(recordResult));
Result<List<MidPatrolDetailResult>> detailResult = dataStatisticalOpenFeignClient.getPatrolDetailList(midPatrolFormDTO);
if (detailResult == null || !detailResult.success()){
log.error("获取巡查记录明细失败,param:{}", JSON.toJSONString(midPatrolFormDTO));
return false;
}
UserPatrolDetailEntity detailEntity = buildDetailEntity(recordResult, detailResult);
userPatrolDetailDao.insert(detailEntity); //insert
break; baseDao.insert(recordEntity);
default:
log.info("======");
return true;
}
@Override
public Boolean updatePatrolRecord(UpsertPatrolRecordForm patrolRecordForm) {
log.info("updatePatrolRecord param:{}", JSON.toJSONString(patrolRecordForm));
ValidatorUtils.validateEntity(patrolRecordForm);
boolean delFlag = false;
MidPatrolFormDTO midPatrolFormDTO = buildParam(patrolRecordForm);
Result<List<MidPatrolRecordResult>> record = dataStatisticalOpenFeignClient.getPatrolRecordList(midPatrolFormDTO);
if (record == null || !record.success()) {
log.error("获取巡查记录失败,param:{}", JSON.toJSONString(midPatrolFormDTO));
return false;
}
List<MidPatrolRecordResult> data = record.getData();
if (CollectionUtils.isEmpty(data)) {
//数据已被删除了
delFlag = true;
//暂时设置error 用于排错
log.error("获取巡查记录返回为空,param:{}", JSON.toJSONString(midPatrolFormDTO));
int effectRow = baseDao.deleteById(patrolRecordForm.getPatrolId());
log.warn("del effectRow:{}", effectRow);
return true;
}
MidPatrolRecordResult recordResult = data.get(NumConstant.ZERO);
UserPatrolRecordEntity recordEntity = buildEntity(recordResult);
//update
int effectRow = baseDao.updateById(recordEntity);
if (effectRow == 0) {
baseDao.insert(recordEntity);
}
Result<List<MidPatrolDetailResult>> detailResult = dataStatisticalOpenFeignClient.getPatrolDetailList(midPatrolFormDTO);
if (detailResult == null || !detailResult.success()) {
log.error("获取巡查记录明细失败,param:{}", JSON.toJSONString(midPatrolFormDTO));
return false;
} }
UserPatrolDetailEntity detailEntity = buildDetailEntity(recordResult, detailResult);
//先删除再新增
LambdaQueryWrapper<UserPatrolDetailEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(UserPatrolDetailEntity::getStaffPatrolRecId, recordEntity.getId());
userPatrolDetailDao.delete(wrapper);
int insert = userPatrolDetailDao.insert(detailEntity);
return true; return true;
} }
@ -109,8 +137,8 @@ public class UserPatrolRecordServiceImpl extends BaseServiceImpl<UserPatrolRecor
UserPatrolDetailEntity detailEntity = new UserPatrolDetailEntity(); UserPatrolDetailEntity detailEntity = new UserPatrolDetailEntity();
detailEntity.setCustomerId(recordResult.getCustomerId()); detailEntity.setCustomerId(recordResult.getCustomerId());
detailEntity.setStaffPatrolRecId(recordResult.getId()); detailEntity.setStaffPatrolRecId(recordResult.getId());
StringBuilder sb =new StringBuilder(); StringBuilder sb = new StringBuilder();
detailResult.getData().forEach(o->{ detailResult.getData().forEach(o -> {
sb.append(o.getLongitude()) sb.append(o.getLongitude())
.append(StrConstant.COMMA) .append(StrConstant.COMMA)
.append(o.getLatitude()) .append(o.getLatitude())

42
epmet-module/open-data-worker/open-data-worker-server/src/main/resources/mapper/BaseDisputeProcessDao.xml

@ -0,0 +1,42 @@
<?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.opendata.dao.BaseDisputeProcessDao">
<resultMap type="com.epmet.opendata.entity.BaseDisputeProcessEntity" id="baseDisputeProcessMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="orgCode" column="ORG_CODE"/>
<result property="orgName" column="ORG_NAME"/>
<result property="eventName" column="EVENT_NAME"/>
<result property="eventCategory" column="EVENT_CATEGORY"/>
<result property="reportTime" column="REPORT_TIME"/>
<result property="happenDate" column="HAPPEN_DATE"/>
<result property="happenPlace" column="HAPPEN_PLACE"/>
<result property="eventDescription" column="EVENT_DESCRIPTION"/>
<result property="waysOfResolving" column="WAYS_OF_RESOLVING"/>
<result property="successfulOrNo" column="SUCCESSFUL_OR_NO"/>
<result property="completeLevel" column="COMPLETE_LEVEL"/>
<result property="baseInfoId" column="BASE_INFO_ID"/>
<result property="completeTime" column="COMPLETE_TIME"/>
<result property="lng" column="LNG"/>
<result property="lat" column="LAT"/>
<result property="name" column="NAME"/>
<result property="numberInvolved" column="NUMBER_INVOLVED"/>
<result property="relatedUnits" column="RELATED_UNITS"/>
<result property="keyAreaType" column="KEY_AREA_TYPE"/>
<result property="religionScale" column="RELIGION_SCALE"/>
<result property="religionType" column="RELIGION_TYPE"/>
<result property="isKeyareaState" column="IS_KEYAREA_STATE"/>
<result property="isKeypeopleLocate" column="IS_KEYPEOPLE_LOCATE"/>
<result property="keypeopleStatus" column="KEYPEOPLE_STATUS"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
</mapper>
Loading…
Cancel
Save