Browse Source

Merge branch 'dev_import' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_import

dev
wangxianzhang 4 years ago
parent
commit
f471e3348a
  1. 3
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java
  2. 85
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityServiceRelationDTO.java
  3. 89
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityUnitRelationDTO.java
  4. 31
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
  5. 79
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActServiceRelationDTO.java
  6. 84
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActUnitRelationDTO.java
  7. 25
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityServiceRelationDao.java
  8. 25
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java
  9. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java
  10. 25
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActServiceRelationDao.java
  11. 25
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActUnitRelationDao.java
  12. 56
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcActivityServiceRelationEntity.java
  13. 56
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcActivityUnitRelationEntity.java
  14. 51
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActServiceRelationEntity.java
  15. 51
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActUnitRelationEntity.java
  16. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityServiceRelationService.java
  17. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java
  18. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActServiceRelationService.java
  19. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActUnitRelationService.java
  20. 61
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityServiceRelationServiceImpl.java
  21. 60
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java
  22. 199
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  23. 33
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActServiceRelationServiceImpl.java
  24. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActUnitRelationServiceImpl.java
  25. 26
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityServiceRelationDao.xml
  26. 26
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml
  27. 128
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml
  28. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActServiceRelationDao.xml
  29. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActUnitRelationDao.xml
  30. 12
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java
  31. 23
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingErrorInfoModel.java
  32. 30
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseErrorInfoModel.java
  33. 19
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java
  34. 27
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java
  35. 17
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java
  36. 20
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/NeighborHoodErrorInfoModel.java

3
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java

@ -8,6 +8,9 @@ public interface ImportTaskConstants {
* 业务类型居民
*/
String BIZ_TYPE_RESI = "resi";
String BIZ_TYPE_NEIGHBOR_HOOD = "neighborHood";
String BIZ_TYPE_BUILDING = "building";
String BIZ_TYPE_HOUSE = "house";
/**
* 处理状态处理中

85
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityServiceRelationDTO.java

@ -0,0 +1,85 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 联建活动与服务事项关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Data
public class IcActivityServiceRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* 活动ID
*/
private String activityId;
/**
* act_info表ID
*/
private String actId;
/**
* 服务事项
*/
private String serviceMatter;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

89
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityUnitRelationDTO.java

@ -0,0 +1,89 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 联建活动与单位关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Data
public class IcActivityUnitRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* 活动ID
*/
private String activityId;
/**
* act_info表ID
*/
private String actId;
/**
* 单位ID
*/
private String unitId;
/**
* 服务事项
*/
private String serviceMatter;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

31
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java

@ -19,12 +19,15 @@ package com.epmet.dto;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
@ -46,35 +49,45 @@ public class IcPartyActivityDTO implements Serializable {
/**
* 客户id
*/
@JsonIgnore
private String customerId;
/**
* 组织ID
*/
@JsonIgnore
@NotEmpty(message = "组织ID不能为空",groups = AddGroup.class)
private String agencyId;
/**
* 组织的所有上级
*/
@JsonIgnore
private String pids;
/**
* act_info表ID
*/
@JsonIgnore
private String actId;
private String unitId;
private String unitName;
/**
* 单位ID
*/
@NotBlank(message = "单位不能为空",groups = AddGroup.class)
private String unitId;
private String unitName;
@NotEmpty(message = "单位不能为空",groups = AddGroup.class)
private List<String> unitIdList;
private List<String> unitNameList;
private String serviceMatter;
private String serviceMatterName;
/**
* 服务事项
*/
@NotBlank(message = "服务事项不能为空",groups = AddGroup.class)
private String serviceMatter;
private String serviceMatterName;
@NotEmpty(message = "服务事项不能为空",groups = AddGroup.class)
private List<String> serviceMatterList;
private List<String> serviceMatterNameList;
/**
* 活动标题
*/
@ -131,31 +144,37 @@ public class IcPartyActivityDTO implements Serializable {
/**
* 删除标识 0未删除1已删除
*/
@JsonIgnore
private String delFlag;
/**
* 乐观锁
*/
@JsonIgnore
private Integer revision;
/**
* 创建人
*/
@JsonIgnore
private String createdBy;
/**
* 创建时间
*/
@JsonIgnore
private Date createdTime;
/**
* 更新人
*/
@JsonIgnore
private String updatedBy;
/**
* 更新时间
*/
@JsonIgnore
private Date updatedTime;
}

79
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActServiceRelationDTO.java

@ -0,0 +1,79 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 联建活动与服务事项关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Data
public class LatestActServiceRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* latest_act_info表ID
*/
private String actId;
/**
* 服务事项
*/
private String serviceMatter;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

84
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActUnitRelationDTO.java

@ -0,0 +1,84 @@
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 联建活动与单位关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Data
public class LatestActUnitRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* latest_act_info表ID
*/
private String actId;
/**
* 单位ID
*/
private String unitId;
/**
* 服务事项
*/
private String serviceMatter;
/**
* 删除标识 0未删除1已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

25
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityServiceRelationDao.java

@ -0,0 +1,25 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcActivityServiceRelationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 联建活动与服务事项关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Mapper
public interface IcActivityServiceRelationDao extends BaseDao<IcActivityServiceRelationEntity> {
/**
* 删除活动所属服务
*
* @Param activityId
* @Return
* @Author zhaoqifeng
* @Date 2022/2/21 16:19
*/
void deleteByActivity(@Param("activityId") String activityId);
}

25
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java

@ -0,0 +1,25 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.IcActivityUnitRelationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 联建活动与单位关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Mapper
public interface IcActivityUnitRelationDao extends BaseDao<IcActivityUnitRelationEntity> {
/**
* 删除活动所属单位
*
* @Param activityId
* @Return
* @Author zhaoqifeng
* @Date 2022/2/21 16:19
*/
void deleteByActivity(@Param("activityId") String activityId);
}

15
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java

@ -23,6 +23,8 @@ import com.epmet.dto.result.ActivityStatisticsDTO;
import com.epmet.entity.IcPartyActivityEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 联建活动
*
@ -40,5 +42,16 @@ public interface IcPartyActivityDao extends BaseDao<IcPartyActivityEntity> {
* @Date 2021/12/9 16:06
*/
ActivityStatisticsDTO getStatistics(PartyActivityFormDTO formDTO);
/**
* 活动列表查询
* @Param formDTO
* @Return {@link java.util.List<com.epmet.entity.IcPartyActivityEntity>}
* @Author zhaoqifeng
* @Date 2022/2/21 14:50
*/
List<IcPartyActivityEntity> selectActivityList(PartyActivityFormDTO formDTO);
List<IcPartyActivityEntity> getActivityList(PartyActivityFormDTO formDTO);
}

25
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActServiceRelationDao.java

@ -0,0 +1,25 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.LatestActServiceRelationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 联建活动与服务事项关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Mapper
public interface LatestActServiceRelationDao extends BaseDao<LatestActServiceRelationEntity> {
/**
* 删除活动所属服务
*
* @Param activityId
* @Return
* @Author zhaoqifeng
* @Date 2022/2/21 16:19
*/
void deleteByActivity(@Param("activityId") String activityId);
}

25
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActUnitRelationDao.java

@ -0,0 +1,25 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.LatestActUnitRelationEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 联建活动与单位关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Mapper
public interface LatestActUnitRelationDao extends BaseDao<LatestActUnitRelationEntity> {
/**
* 删除活动所属服务
*
* @Param activityId
* @Return
* @Author zhaoqifeng
* @Date 2022/2/21 16:19
*/
void deleteByActivity(@Param("activityId") String activityId);
}

56
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcActivityServiceRelationEntity.java

@ -0,0 +1,56 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 联建活动与服务事项关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_activity_service_relation")
public class IcActivityServiceRelationEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* 活动ID
*/
private String activityId;
/**
* act_info表ID
*/
private String actId;
/**
* 服务事项
*/
private String serviceMatter;
/**
* 排序
*/
private Integer sort;
}

56
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcActivityUnitRelationEntity.java

@ -0,0 +1,56 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 联建活动与单位关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("ic_activity_unit_relation")
public class IcActivityUnitRelationEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* 活动ID
*/
private String activityId;
/**
* act_info表ID
*/
private String actId;
/**
* 单位ID
*/
private String unitId;
/**
* 排序
*/
private Integer sort;
}

51
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActServiceRelationEntity.java

@ -0,0 +1,51 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 联建活动与服务事项关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("latest_act_service_relation")
public class LatestActServiceRelationEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* latest_act_info表ID
*/
private String actId;
/**
* 服务事项
*/
private String serviceMatter;
/**
* 排序
*/
private Integer sort;
}

51
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActUnitRelationEntity.java

@ -0,0 +1,51 @@
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 联建活动与单位关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("latest_act_unit_relation")
public class LatestActUnitRelationEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 组织ID
*/
private String agencyId;
/**
* 组织的所有上级
*/
private String pids;
/**
* latest_act_info表ID
*/
private String actId;
/**
* 单位ID
*/
private String unitId;
/**
* 排序
*/
private Integer sort;
}

34
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityServiceRelationService.java

@ -0,0 +1,34 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.IcActivityServiceRelationEntity;
import java.util.List;
/**
* 联建活动与服务事项关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
public interface IcActivityServiceRelationService extends BaseService<IcActivityServiceRelationEntity> {
/**
* 获取活动所属服务事项
*
* @Param activityId 活动ID
* @Return {@link List <String>}
* @Author zhaoqifeng
* @Date 2022/2/21 14:36
*/
List<String> getServiceList(String activityId);
/**
* 删除活动所属服务事项
*
* @Param activityId
* @Return
* @Author zhaoqifeng
* @Date 2022/2/21 16:10
*/
void deleteByActivity(String activityId);
}

34
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java

@ -0,0 +1,34 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.IcActivityUnitRelationEntity;
import java.util.List;
/**
* 联建活动与单位关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
public interface IcActivityUnitRelationService extends BaseService<IcActivityUnitRelationEntity> {
/**
* 获取活动所属党建单位
*
* @Param activityId 活动ID
* @Return {@link List<String>}
* @Author zhaoqifeng
* @Date 2022/2/21 14:36
*/
List<String> getUnitList(String activityId);
/**
* 删除活动所属单位
*
* @Param activityId
* @Return
* @Author zhaoqifeng
* @Date 2022/2/21 16:10
*/
void deleteByActivity(String activityId);
}

14
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActServiceRelationService.java

@ -0,0 +1,14 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.LatestActServiceRelationEntity;
/**
* 联建活动与服务事项关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
public interface LatestActServiceRelationService extends BaseService<LatestActServiceRelationEntity> {
}

14
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActUnitRelationService.java

@ -0,0 +1,14 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.entity.LatestActUnitRelationEntity;
/**
* 联建活动与单位关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
public interface LatestActUnitRelationService extends BaseService<LatestActUnitRelationEntity> {
}

61
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityServiceRelationServiceImpl.java

@ -0,0 +1,61 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.IcActivityServiceRelationDao;
import com.epmet.entity.IcActivityServiceRelationEntity;
import com.epmet.service.IcActivityServiceRelationService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* 联建活动与服务事项关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Service
public class IcActivityServiceRelationServiceImpl extends BaseServiceImpl<IcActivityServiceRelationDao, IcActivityServiceRelationEntity> implements IcActivityServiceRelationService {
/**
* 获取活动所属服务事项
*
* @param activityId
* @Param activityId 活动ID
* @Return {@link List <String>}
* @Author zhaoqifeng
* @Date 2022/2/21 14:36
*/
@Override
public List<String> getServiceList(String activityId) {
LambdaQueryWrapper<IcActivityServiceRelationEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcActivityServiceRelationEntity::getActivityId, activityId);
wrapper.orderByAsc(IcActivityServiceRelationEntity::getSort);
List<IcActivityServiceRelationEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list.stream().map(IcActivityServiceRelationEntity::getServiceMatter).collect(Collectors.toList());
}
/**
* 删除活动所属服务事项
*
* @param activityId
* @Param activityId
* @Return
* @Author zhaoqifeng
* @Date 2022/2/21 16:10
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteByActivity(String activityId) {
baseDao.deleteByActivity(activityId);
}
}

60
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java

@ -0,0 +1,60 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.IcActivityUnitRelationDao;
import com.epmet.entity.IcActivityUnitRelationEntity;
import com.epmet.service.IcActivityUnitRelationService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* 联建活动与单位关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Service
public class IcActivityUnitRelationServiceImpl extends BaseServiceImpl<IcActivityUnitRelationDao, IcActivityUnitRelationEntity> implements IcActivityUnitRelationService {
/**
* 获取活动所属党建单位
*
* @param activityId
* @Param activityId 活动ID
* @Return {@link List <String>}
* @Author zhaoqifeng
* @Date 2022/2/21 14:36
*/
@Override
public List<String> getUnitList(String activityId) {
LambdaQueryWrapper<IcActivityUnitRelationEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcActivityUnitRelationEntity::getActivityId, activityId);
wrapper.orderByAsc(IcActivityUnitRelationEntity::getSort);
List<IcActivityUnitRelationEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isEmpty(list)) {
return Collections.emptyList();
}
return list.stream().map(IcActivityUnitRelationEntity::getUnitId).collect(Collectors.toList());
}
/**
* 删除活动所属单位
*
* @param activityId
* @Param activityId
* @Return
* @Author zhaoqifeng
* @Date 2022/2/21 16:10
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void deleteByActivity(String activityId) {
baseDao.deleteByActivity(activityId);
}
}

199
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -19,10 +19,9 @@ package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.page.PageData;
@ -38,11 +37,11 @@ import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.dto.result.ActivityStatisticsDTO;
import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcActivityServiceRelationEntity;
import com.epmet.entity.IcActivityUnitRelationEntity;
import com.epmet.entity.IcPartyActivityEntity;
import com.epmet.excel.IcPartyActivityImportExcel;
import com.epmet.service.IcPartyActivityService;
import com.epmet.service.IcPartyUnitService;
import com.epmet.service.IcServiceItemDictService;
import com.epmet.service.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -56,6 +55,7 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
/**
@ -72,6 +72,11 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
private IcPartyUnitService icPartyUnitService;
@Resource
private IcServiceItemDictService icServiceItemDictService;
@Resource
private IcActivityUnitRelationService icActivityUnitRelationService;
@Resource
private IcActivityServiceRelationService icActivityServiceRelationService;
@Override
@ -85,23 +90,20 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
formDTO.setEndTime(endDate);
}
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
LambdaQueryWrapper<IcPartyActivityEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId());
wrapper.eq(StringUtils.isNotBlank(formDTO.getUnitId()), IcPartyActivityEntity::getUnitId, formDTO.getUnitId());
wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyActivityEntity::getServiceMatter, formDTO.getServiceMatter());
wrapper.like(StringUtils.isNotBlank(formDTO.getTitle()), IcPartyActivityEntity::getTitle, formDTO.getTitle());
wrapper.between(IcPartyActivityEntity::getActivityTime, formDTO.getStartTime(), formDTO.getEndTime());
wrapper.orderByDesc(IcPartyActivityEntity::getUpdatedTime);
List<IcPartyActivityEntity> list = baseDao.selectList(wrapper);
List<IcPartyActivityEntity> list = baseDao.selectActivityList(formDTO);
PageInfo<IcPartyActivityEntity> pageInfo = new PageInfo<>(list);
List<IcPartyActivityDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class);
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
unitDTO.setAgencyId(formDTO.getAgencyId());
if (CollectionUtils.isNotEmpty(dtoList)) {
//获取组织下联建单位
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
unitDTO.setAgencyId(formDTO.getAgencyId());
Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
dtoList.forEach(dto -> {
dto.setUnitName(option.get(dto.getUnitId()));
//联建单位ID与单位名匹配
List<String> unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA));
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
dto.setUnitName(StringUtils.join(unitNames, StrConstant.COMMA));
});
}
@ -118,54 +120,49 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
Date endDate = DateUtils.parse("2099-12-31 00:00:00", DateUtils.DATE_TIME_PATTERN);
formDTO.setEndTime(endDate);
}
LambdaQueryWrapper<IcPartyActivityEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId());
wrapper.eq(StringUtils.isNotBlank(formDTO.getUnitId()), IcPartyActivityEntity::getUnitId, formDTO.getUnitId());
wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyActivityEntity::getServiceMatter, formDTO.getServiceMatter());
wrapper.like(StringUtils.isNotBlank(formDTO.getTitle()), IcPartyActivityEntity::getTitle, formDTO.getTitle());
wrapper.between(IcPartyActivityEntity::getActivityTime, formDTO.getStartTime(), formDTO.getEndTime());
wrapper.orderByDesc(IcPartyActivityEntity::getUpdatedTime);
List<IcPartyActivityEntity> list = baseDao.selectList(wrapper);
List<IcPartyActivityEntity> list = baseDao.selectActivityList(formDTO);
List<IcPartyActivityDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class);
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
unitDTO.setAgencyId(formDTO.getAgencyId());
if (CollectionUtils.isNotEmpty(dtoList)) {
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
unitDTO.setAgencyId(formDTO.getAgencyId());
Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
dtoList.forEach(dto -> {
dto.setUnitName(option.get(dto.getUnitId()));
List<String> unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA));
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
dto.setUnitName(StringUtils.join(unitNames, StrConstant.COMMA));
});
}
return dtoList;
}
private QueryWrapper<IcPartyActivityEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<IcPartyActivityEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public IcPartyActivityDTO get(String id) {
IcPartyActivityEntity entity = baseDao.selectById(id);
if (null == entity) {
return null;
}
//获取服务事项名称
IcPartyActivityDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class);
//获取服务事项
List<OptionDTO> serviceItemList=icServiceItemDictService.queryDictList(entity.getCustomerId());
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<String> services = icActivityServiceRelationService.getServiceList(id);
List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList());
dto.setServiceMatterList(services);
dto.setServiceMatterNameList(serviceNames);
//获取单位
//获取组织下联建单位
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
unitDTO.setAgencyId(entity.getAgencyId());
Map<String, String> option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
List<String> unitIds = icActivityUnitRelationService.getUnitList(id);
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
dto.setUnitIdList(unitIds);
dto.setUnitNameList(unitNames);
IcPartyActivityDTO dto = ConvertUtils.sourceToTarget(entity, IcPartyActivityDTO.class);
dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter()));
//获取单位名称
IcPartyUnitDTO unitDTO = icPartyUnitService.get(dto.getUnitId());
if (null != unitDTO) {
dto.setUnitName(unitDTO.getUnitName());
}
return dto;
}
@ -182,6 +179,35 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
} else {
updateById(entity);
}
//保存活动与单位关系
icActivityUnitRelationService.deleteByActivity(entity.getId());
AtomicInteger i = new AtomicInteger(NumConstant.ONE);
List<IcActivityUnitRelationEntity> unitRelationList = dto.getUnitIdList().stream().map(unitId -> {
IcActivityUnitRelationEntity relation = new IcActivityUnitRelationEntity();
relation.setCustomerId(entity.getCustomerId());
relation.setAgencyId(entity.getAgencyId());
relation.setPids(entity.getPids());
relation.setActivityId(entity.getId());
relation.setUnitId(unitId);
relation.setSort(i.getAndIncrement());
return relation;
}).collect(Collectors.toList());
icActivityUnitRelationService.insertBatch(unitRelationList);
//保存活动与服务关系
icActivityServiceRelationService.deleteByActivity(entity.getId());
AtomicInteger j = new AtomicInteger(NumConstant.ONE);
List<IcActivityServiceRelationEntity> serviceRelationList = dto.getServiceMatterList().stream().map(service -> {
IcActivityServiceRelationEntity relation = new IcActivityServiceRelationEntity();
relation.setCustomerId(entity.getCustomerId());
relation.setAgencyId(entity.getAgencyId());
relation.setPids(entity.getPids());
relation.setActivityId(entity.getId());
relation.setServiceMatter(service);
relation.setSort(j.getAndIncrement());
return relation;
}).collect(Collectors.toList());
icActivityServiceRelationService.insertBatch(serviceRelationList);
}
@Override
@ -237,20 +263,31 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
numList.add(obj.getRowNum());
log.warn(String.format("单位名称为空,行号->%s", obj.getRowNum()));
iterator.remove();
} else if (null == option.get(obj.getUnitName())){
numList.add(obj.getRowNum());
log.warn(String.format("单位名称不存在,行号->%s", obj.getRowNum()));
iterator.remove();
} else {
List<String> unitList = Arrays.asList(obj.getUnitName().split(StrConstant.COMMA));
unitList.forEach(unit -> {
if (null == option.get(unit)) {
numList.add(obj.getRowNum());
log.warn(String.format("单位名称不存在,行号->%s", obj.getRowNum()));
iterator.remove();
}
});
}
//服务事项校验
if (StringUtils.isBlank(obj.getServiceMatter())) {
numList.add(obj.getRowNum());
log.warn(String.format("服务事项为空,行号->%s", obj.getRowNum()));
iterator.remove();
} else if (null == categoryMap.get(obj.getServiceMatter())){
numList.add(obj.getRowNum());
log.warn(String.format("服务事项不存在,行号->%s", obj.getRowNum()));
iterator.remove();
} else {
List<String> serviceList = Arrays.asList(obj.getServiceMatter().split(StrConstant.SEMICOLON));
serviceList.forEach(service -> {
if (null == categoryMap.get(service)) {
numList.add(obj.getRowNum());
log.warn(String.format("服务事项不存在,行号->%s", obj.getRowNum()));
iterator.remove();
}
});
}
//活动标题 活动目标 活动内容 活动时间 活动地址 活动地址经度 活动地址纬度 活动结果
if(StringUtils.isBlank(obj.getTitle()) || StringUtils.isBlank(obj.getTarget()) ||
@ -271,7 +308,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
return new Result().error(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "第" + subList + "行未成功!");
}
List<IcPartyActivityEntity> list = result.stream().map(item -> {
result.forEach(item -> {
IcPartyActivityEntity entity = new IcPartyActivityEntity();
entity.setCustomerId(tokenDto.getCustomerId());
entity.setAgencyId(staffInfoCache.getAgencyId());
@ -279,18 +316,44 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
entity.setTitle(item.getTitle());
entity.setTarget(item.getTarget());
entity.setContent(item.getContent());
entity.setUnitId(option.get(item.getUnitName()));
entity.setServiceMatter(categoryMap.get(item.getServiceMatter()));
entity.setPeopleCount(item.getPeopleCount());
entity.setActivityTime(DateUtils.parse(item.getActivityTime(), DateUtils.DATE_TIME_PATTERN));
entity.setAddress(item.getAddress());
entity.setLatitude(item.getLatitude());
entity.setLongitude(item.getLongitude());
entity.setResult(item.getResult());
return entity;
}).collect(Collectors.toList());
insert(entity);
insertBatch(list);
//保存活动与单位关系
icActivityUnitRelationService.deleteByActivity(entity.getId());
AtomicInteger i = new AtomicInteger(NumConstant.ONE);
List<IcActivityUnitRelationEntity> unitRelationList = Arrays.stream(item.getUnitName().split(StrConstant.COMMA)).map(unit -> {
IcActivityUnitRelationEntity relation = new IcActivityUnitRelationEntity();
relation.setCustomerId(entity.getCustomerId());
relation.setAgencyId(entity.getAgencyId());
relation.setPids(entity.getPids());
relation.setActivityId(entity.getId());
relation.setUnitId(option.get(unit));
relation.setSort(i.getAndIncrement());
return relation;
}).collect(Collectors.toList());
icActivityUnitRelationService.insertBatch(unitRelationList);
//保存活动与服务关系
icActivityServiceRelationService.deleteByActivity(entity.getId());
AtomicInteger j = new AtomicInteger(NumConstant.ONE);
List<IcActivityServiceRelationEntity> serviceRelationList = Arrays.stream(item.getServiceMatter().split(StrConstant.SEMICOLON)).map(service -> {
IcActivityServiceRelationEntity relation = new IcActivityServiceRelationEntity();
relation.setCustomerId(entity.getCustomerId());
relation.setAgencyId(entity.getAgencyId());
relation.setPids(entity.getPids());
relation.setActivityId(entity.getId());
relation.setServiceMatter(categoryMap.get(service));
relation.setSort(j.getAndIncrement());
return relation;
}).collect(Collectors.toList());
icActivityServiceRelationService.insertBatch(serviceRelationList);
});
String str = String.format("共%s条,成功导入%s条。", numList.size() + result.size(), numList.size() + result.size() - numList.size());
if (numList.size() > NumConstant.ZERO) {
@ -347,14 +410,7 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
}
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize());
//获取活动列表
LambdaQueryWrapper<IcPartyActivityEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.and(wp -> wp.eq(IcPartyActivityEntity::getAgencyId, formDTO.getAgencyId()).or().
like(IcPartyActivityEntity::getPids, formDTO.getAgencyId()));
wrapper.eq(StringUtils.isNotBlank(formDTO.getServiceMatter()), IcPartyActivityEntity::getServiceMatter, formDTO.getServiceMatter());
wrapper.ge(null != formDTO.getStartTime(),IcPartyActivityEntity::getActivityTime, formDTO.getStartTime());
wrapper.le(null != formDTO.getEndTime(), IcPartyActivityEntity::getActivityTime, formDTO.getEndTime());
wrapper.orderByDesc(IcPartyActivityEntity::getActivityTime);
List<IcPartyActivityEntity> list = baseDao.selectList(wrapper);
List<IcPartyActivityEntity> list = baseDao.getActivityList(formDTO);
List<IcPartyActivityDTO> dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class);
IcPartyUnitDTO unitDTO = new IcPartyUnitDTO();
@ -367,8 +423,15 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
Map<String, String> categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel));
//数据组装
dtoList.forEach(dto -> {
dto.setServiceMatterName(categoryMap.get(dto.getServiceMatter()));
dto.setUnitName(option.get(dto.getUnitId()));
//联建单位ID与单位名匹配
List<String> unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA));
List<String> unitNames = unitIds.stream().map(option::get).collect(Collectors.toList());
dto.setUnitName(StringUtils.join(unitNames, StrConstant.COMMA));
//服务事项与服务事项名匹配
List<String> services = Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA));
List<String> serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList());
dto.setServiceMatterName(StringUtils.join(serviceNames, StrConstant.SEMICOLON));
});
}
PageInfo<IcPartyActivityDTO> pageInfo = new PageInfo<>(dtoList);

33
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActServiceRelationServiceImpl.java

@ -0,0 +1,33 @@
package com.epmet.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.dao.LatestActServiceRelationDao;
import com.epmet.dto.LatestActServiceRelationDTO;
import com.epmet.entity.LatestActServiceRelationEntity;
import com.epmet.redis.LatestActServiceRelationRedis;
import com.epmet.service.LatestActServiceRelationService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 联建活动与服务事项关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Service
public class LatestActServiceRelationServiceImpl extends BaseServiceImpl<LatestActServiceRelationDao, LatestActServiceRelationEntity> implements LatestActServiceRelationService {
}

19
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActUnitRelationServiceImpl.java

@ -0,0 +1,19 @@
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.LatestActUnitRelationDao;
import com.epmet.entity.LatestActUnitRelationEntity;
import com.epmet.service.LatestActUnitRelationService;
import org.springframework.stereotype.Service;
/**
* 联建活动与单位关联表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2022-02-21
*/
@Service
public class LatestActUnitRelationServiceImpl extends BaseServiceImpl<LatestActUnitRelationDao, LatestActUnitRelationEntity> implements LatestActUnitRelationService {
}

26
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityServiceRelationDao.xml

@ -0,0 +1,26 @@
<?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.dao.IcActivityServiceRelationDao">
<resultMap type="com.epmet.entity.IcActivityServiceRelationEntity" id="icActivityServiceRelationMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pids" column="PIDS"/>
<result property="activityId" column="ACTIVITY_ID"/>
<result property="actId" column="ACT_ID"/>
<result property="serviceMatter" column="SERVICE_MATTER"/>
<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>
<delete id="deleteByActivity">
DELETE FROM ic_activity_service_relation WHERE ACTIVITY_ID = #{activityId}
</delete>
</mapper>

26
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml

@ -0,0 +1,26 @@
<?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.dao.IcActivityUnitRelationDao">
<resultMap type="com.epmet.entity.IcActivityUnitRelationEntity" id="icActivityUnitRelationMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pids" column="PIDS"/>
<result property="activityId" column="ACTIVITY_ID"/>
<result property="actId" column="ACT_ID"/>
<result property="unitId" column="UNIT_ID"/>
<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>
<delete id="deleteByActivity">
DELETE FROM ic_activity_unit_relation WHERE ACTIVITY_ID = #{activityId}
</delete>
</mapper>

128
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml

@ -28,14 +28,16 @@
</resultMap>
<select id="getStatistics" resultType="com.epmet.dto.result.ActivityStatisticsDTO" parameterType="com.epmet.dto.form.PartyActivityFormDTO">
SELECT
count( ID ) AS "activityCount",
COUNT( DISTINCT UNIT_ID ) AS "unitCount"
COUNT( DISTINCT a.ID ) AS "activityCount",
COUNT( DISTINCT b.UNIT_ID ) AS "unitCount"
FROM
ic_party_activity
WHERE DEL_FLAG = '0'
AND (AGENCY_ID = #{agencyId} OR PIDS LIKE concat( '%', #{agencyId}, '%' ))
ic_party_activity a
INNER JOIN ic_activity_unit_relation b ON a.ID = b.ACTIVITY_ID
INNER JOIN ic_activity_service_relation c ON a.ID = c.ACTIVITY_ID
WHERE a.DEL_FLAG = '0'
AND (a.AGENCY_ID = #{agencyId} OR a.PIDS LIKE concat( '%', #{agencyId}, '%' ))
<if test='null != serviceMatter'>
AND SERVICE_MATTER = #{serviceMatter}
AND c.SERVICE_MATTER = #{serviceMatter}
</if>
<if test='null != startTime'>
AND ACTIVITY_TIME &gt;= #{startTime}
@ -44,6 +46,120 @@
AND ACTIVITY_TIME &lt;= #{endTime}
</if>
</select>
<select id="selectActivityList" resultType="com.epmet.entity.IcPartyActivityEntity" parameterType = "com.epmet.dto.form.PartyActivityFormDTO">
SELECT
a.ID,
b.unitId,
c.serviceMatter,
TITLE,
TARGET,
CONTENT,
PEOPLE_COUNT,
ACTIVITY_TIME,
ADDRESS,
LONGITUDE,
LATITUDE,
RESULT
FROM
ic_party_activity a
INNER JOIN (
SELECT
ACTIVITY_ID,
GROUP_CONCAT( UNIT_ID ) AS unitId
FROM
ic_activity_unit_relation
WHERE
DEL_FLAG = '0'
AND AGENCY_ID = #{agencyId}
<if test='null != unitId'>
AND UNIT_ID = #{unitId}
</if>
GROUP BY
ACTIVITY_ID
) b ON a.ID = b.ACTIVITY_ID
INNER JOIN (
SELECT
ACTIVITY_ID,
GROUP_CONCAT( SERVICE_MATTER ) AS serviceMatter
FROM
ic_activity_service_relation
WHERE
DEL_FLAG = '0'
AND AGENCY_ID = #{agencyId}
<if test='null != serviceMatter'>
AND SERVICE_MATTER = #{serviceMatter}
</if>
GROUP BY
ACTIVITY_ID
) c ON a.ID = c.ACTIVITY_ID
WHERE
a.DEL_FLAG = '0'
AND a.AGENCY_ID = #{agencyId}
<if test='null != serviceMatter'>
AND TITLE LIKE concat('%', #{title}, '%')
</if>
AND ACTIVITY_TIME BETWEEN #{startTime} AND #{endTime}
</select>
<select id="getActivityList" resultType="com.epmet.entity.IcPartyActivityEntity" parameterType = "com.epmet.dto.form.PartyActivityFormDTO">
SELECT
a.ID,
b.unitId,
c.serviceMatter,
TITLE,
TARGET,
CONTENT,
PEOPLE_COUNT,
ACTIVITY_TIME,
ADDRESS,
LONGITUDE,
LATITUDE,
RESULT
FROM
ic_party_activity a
INNER JOIN (
SELECT
ACTIVITY_ID,
GROUP_CONCAT( UNIT_ID ) AS unitId
FROM
ic_activity_unit_relation
WHERE
DEL_FLAG = '0'
AND (AGENCY_ID = #{agencyId} OR PIDS LIKE concat( '%', #{agencyId}, '%' ))
<if test='null != unitId'>
AND UNIT_ID = #{unitId}
</if>
GROUP BY
ACTIVITY_ID
) b ON a.ID = b.ACTIVITY_ID
INNER JOIN (
SELECT
ACTIVITY_ID,
GROUP_CONCAT( SERVICE_MATTER ) AS serviceMatter
FROM
ic_activity_service_relation
WHERE
DEL_FLAG = '0'
AND (AGENCY_ID = #{agencyId} OR PIDS LIKE concat( '%', #{agencyId}, '%' ))
<if test='null != serviceMatter'>
AND SERVICE_MATTER = #{serviceMatter}
</if>
GROUP BY
ACTIVITY_ID
) c ON a.ID = c.ACTIVITY_ID
WHERE
a.DEL_FLAG = '0'
AND (a.AGENCY_ID = #{agencyId} OR a.PIDS LIKE concat( '%', #{agencyId}, '%' ))
<if test='null != startTime'>
AND ACTIVITY_TIME &gt;= #{startTime}
</if>
<if test='null != endTime'>
AND ACTIVITY_TIME &lt;= #{endTime}
</if>
AND ACTIVITY_TIME BETWEEN #{startTime} AND #{endTime}
</select>
</mapper>

24
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActServiceRelationDao.xml

@ -0,0 +1,24 @@
<?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.dao.LatestActServiceRelationDao">
<resultMap type="com.epmet.entity.LatestActServiceRelationEntity" id="latestActServiceRelationMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pids" column="PIDS"/>
<result property="actId" column="ACT_ID"/>
<result property="serviceMatter" column="SERVICE_MATTER"/>
<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>
<delete id="deleteByActivity">
DELETE FROM latest_act_service_relation WHERE ACT_ID = #{activityId}
</delete>
</mapper>

24
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActUnitRelationDao.xml

@ -0,0 +1,24 @@
<?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.dao.LatestActUnitRelationDao">
<resultMap type="com.epmet.entity.LatestActUnitRelationEntity" id="latestActUnitRelationMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="agencyId" column="AGENCY_ID"/>
<result property="pids" column="PIDS"/>
<result property="actId" column="ACT_ID"/>
<result property="unitId" column="UNIT_ID"/>
<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>
<delete id="deleteByActivity">
DELETE FROM latest_act_unit_relation WHERE ACT_ID = #{activityId}
</delete>
</mapper>

12
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java

@ -0,0 +1,12 @@
package com.epmet.constant;
/**
* @Author zxc
* @DateTime 2022/2/21 4:25 下午
* @DESC
*/
public interface ImportErrorMsgConstants {
}

23
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingErrorInfoModel.java

@ -0,0 +1,23 @@
package com.epmet.model;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2022/2/15 10:07 上午
* @DESC
*/
@Data
public class BuildingErrorInfoModel {
@ExcelProperty(value = "小区名称")
private String neighborHoodName;
@ExcelProperty(value = "楼栋名称")
private String buildingName;
@ExcelProperty(value = "错误信息")
private String errorMsg;
}

30
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseErrorInfoModel.java

@ -0,0 +1,30 @@
package com.epmet.model;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
/**
* @Author zxc
* @DateTime 2022/2/13 1:26 下午
* @DESC
*/
@Data
public class HouseErrorInfoModel {
@ExcelProperty(value = "所属小区")
private String neighborHoodName;
@ExcelProperty(value = "所属楼栋")
private String buildingName;
@ExcelProperty(value = "单元号")
private Integer buildingUnit;
@ExcelProperty(value = "门牌号")
private String doorName;
@ExcelProperty(value = "错误信息")
private String errorMsg;
}

19
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java

@ -34,6 +34,8 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
List<Integer> nums = new ArrayList<>();
Integer num = NumConstant.ZERO;
List<BuildingErrorInfoModel> errorInfos = new ArrayList<>();
BuildingInfoModel info = null;
List<ImportGeneralDTO> needDisposeList = new ArrayList<>();
List<ImportGeneralDTO> needInsertList = new ArrayList<>();
@ -67,6 +69,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
if (null == data){
return;
}
info = data;
num = num + NumConstant.ONE;
ImportGeneralDTO dto = ConvertUtils.sourceToTarget(data, ImportGeneralDTO.class);
dto.setNum(num);
@ -74,6 +77,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
// 应产品要求添加
if (StringUtils.isNotBlank(dto.getType()) && (!dto.getType().equals("商品房") && !dto.getType().equals("自建房")) && !dto.getType().equals("别墅")){
nums.add(num);
disposeErrorMsg(info,"");
return;
}
dto.setType(BuildingTypeEnums.getKeyByValue(dto.getType()));
@ -104,6 +108,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
r.getNeighborHoodName() + "_" + r.getBuildingName())){
// 集合里重复的
nums.add(r.getNum());
disposeErrorMsg(info,"");
r.setExistStatus(true);
}
}
@ -118,6 +123,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
if (!CollectionUtils.isEmpty(existList)){
existList.forEach(e -> {
nums.add(e.getNum());
disposeErrorMsg(info,"");
});
}
}
@ -157,6 +163,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
if (StringUtils.isNotBlank(dto.getBuildingId())){
// 说明数据库已存在此楼栋,不需添加
nums.add(num);
disposeErrorMsg(info,"");
}else {
needDisposeList.add(dto);
}
@ -176,6 +183,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
//排除不是本小区的
if (!dto.getNeighborHoodName().equals(neighborHoodGeneralDTO.getNeighborHoodName())){
nums.add(num);
disposeErrorMsg(info,"");
}else {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(neighborHoodGeneralDTO.getGridId());
if (null == gridInfo){
@ -185,6 +193,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
if ((!gridInfo.getGridName().equals(dto.getGridName()) && neighborHoodGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName())) ||
(!gridInfo.getAgencyName().equals(dto.getAgencyName()) && gridInfo.getGridName().equals(dto.getGridName()) && neighborHoodGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName()))){
nums.add(num);
disposeErrorMsg(info,"");
return;
}
dto.setNeighborHoodId(formDTO.getOrgId());
@ -216,6 +225,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
//排除不是本网格的 gridName不一样排除,gridName一样但是agencyName不一样也得排除
if (dto.getGridName().compareTo(gridName) != 0 || (!dto.getAgencyName().equals(gridInfo.getAgencyName()) && dto.getGridName().equals(gridName))){
nums.add(num);
disposeErrorMsg(info,"");
}else {
//
dto.setGridId(formDTO.getOrgId());
@ -242,18 +252,21 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
//排除不是本组织的
if (!dto.getAgencyName().equals(agencyName)){
nums.add(num);
disposeErrorMsg(info,"");
}else {
// 根据组织查询出所有网格,甩出不是本组织下的网格
gridInfos = null == gridInfos ? getGridInfos(formDTO.getOrgId()) : gridInfos;
if (null == gridInfos){
// 组织下确实不存在网格
nums.add(num);
disposeErrorMsg(info,"");
return;
}
// 根据网格名对比,没有找到的就把行号加入到未执行成功队列中
Object cacheGridName = icHouseRedis.getTemporaryCacheGrid(formDTO.getCustomerId(), formDTO.getUserId(), dto.getGridName());
if (null == cacheGridName){
nums.add(num);
disposeErrorMsg(info,"");
return;
}
dto.setGridId(cacheGridName.toString());
@ -308,6 +321,12 @@ public class ImportBuildingInfoListener extends AnalysisEventListener<BuildingIn
return buildingInfos;
}
public void disposeErrorMsg(BuildingInfoModel data,String msg){
BuildingErrorInfoModel err = ConvertUtils.sourceToTarget(data, BuildingErrorInfoModel.class);
err.setErrorMsg(msg);
errorInfos.add(err);
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
finalDispose();

27
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportHouseInfoListener.java

@ -36,6 +36,8 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
List<Integer> nums = new ArrayList<>();
Integer num = NumConstant.ZERO;
List<HouseErrorInfoModel> errorInfos = new ArrayList<>();
HouseInfoModel info = null;
List<ImportGeneralDTO> needDisposeList = new ArrayList<>();
List<ImportGeneralDTO> needInsertList = new ArrayList<>();
@ -73,6 +75,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
if (null == data){
return;
}
info = data;
num = num + NumConstant.ONE;
ImportGeneralDTO dto = ConvertUtils.sourceToTarget(data, ImportGeneralDTO.class);
dto.setNum(num);
@ -81,6 +84,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
if (StringUtils.isNotBlank(dto.getHouseType()) ){
if( !"楼房".equals(dto.getHouseType()) && !dto.getHouseType().equals("平房") && !dto.getHouseType().equals("别墅") ){
nums.add(num);
disposeErrorMsg(info,"");
return;
}
}
@ -94,11 +98,13 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
!dto.getPurpose().equals("商住混用") &&
!dto.getPurpose().equals("其他")) ){
nums.add(num);
disposeErrorMsg(info,"");
return;
}
dto.setPurpose(HousePurposeEnums.getKeyByValue(dto.getPurpose()));
if (StringUtils.isNotBlank(dto.getRentFlagString()) && (!dto.getRentFlagString().equals("是") && !dto.getRentFlagString().equals("否"))){
nums.add(num);
disposeErrorMsg(info,"");
return;
}
dto.setRentFlag(HouseRentFlagEnums.getCodeByName(dto.getRentFlagString()));
@ -118,6 +124,12 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
}
}
public void disposeErrorMsg(HouseInfoModel data,String msg){
HouseErrorInfoModel err = ConvertUtils.sourceToTarget(data, HouseErrorInfoModel.class);
err.setErrorMsg(msg);
errorInfos.add(err);
}
public void finalDispose(){
if (!CollectionUtils.isEmpty(needDisposeList)){
List<ImportGeneralDTO> importInfo = neighborHoodService.getImportInfo(formDTO, needDisposeList);
@ -132,10 +144,8 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
for (ImportGeneralDTO r : needInsertList) {
if (k.equals(r.getBuildingUnitId()+"_"+r.getDoorName())){
// 集合里重复的
if (r.getExistStatus()){
}
nums.add(r.getNum());
disposeErrorMsg(info,"");
r.setExistStatus(true);
}
}
@ -149,6 +159,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
if ((n.getBuildingUnitId()+"_"+n.getDoorName()).equals(e)){
// 库里存在的
nums.add(n.getNum());
disposeErrorMsg(info,"");
n.setExistStatus(true);
}
}
@ -185,6 +196,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
// 排除不是本楼的
if (!dto.getBuildingName().equals(buildingGeneralDTO.getBuildingName())){
nums.add(num);
disposeErrorMsg(info,"");
}else {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(buildingGeneralDTO.getGridId());
if (null == gridInfo){
@ -195,6 +207,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
|| (!gridInfo.getGridName().equals(dto.getGridName())&&buildingGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName()) && buildingGeneralDTO.getBuildingName().equals(dto.getBuildingName()))
|| (!gridInfo.getAgencyName().equals(dto.getAgencyName())&&gridInfo.getGridName().equals(dto.getGridName())&&buildingGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName()) && buildingGeneralDTO.getBuildingName().equals(dto.getBuildingName()))){
nums.add(num);
disposeErrorMsg(info,"");
return;
}
dto.setBuildingId(formDTO.getOrgId());
@ -235,6 +248,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
//排除不是本小区的
if (!dto.getNeighborHoodName().equals(neighborHoodGeneralDTO.getNeighborHoodName())){
nums.add(num);
disposeErrorMsg(info,"");
}else {
GridInfoCache gridInfo = CustomerOrgRedis.getGridInfo(neighborHoodGeneralDTO.getGridId());
if (null == gridInfo){
@ -244,6 +258,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
if ((!gridInfo.getGridName().equals(dto.getGridName()) && neighborHoodGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName())) ||
(!gridInfo.getAgencyName().equals(dto.getAgencyName()) && gridInfo.getGridName().equals(dto.getGridName()) && neighborHoodGeneralDTO.getNeighborHoodName().equals(dto.getNeighborHoodName()))){
nums.add(num);
disposeErrorMsg(info,"");
return;
}
dto.setNeighborHoodId(formDTO.getOrgId());
@ -275,6 +290,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
//排除不是本网格的 gridName不一样排除,gridName一样但是agencyName不一样也得排除
if (dto.getGridName().compareTo(gridName) != 0 || (!dto.getAgencyName().equals(gridInfo.getAgencyName()) && dto.getGridName().equals(gridName))){
nums.add(num);
disposeErrorMsg(info,"");
}else {
//
dto.setGridId(formDTO.getOrgId());
@ -301,18 +317,21 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
//排除不是本组织的
if (!dto.getAgencyName().equals(agencyName)){
nums.add(num);
disposeErrorMsg(info,"");
}else {
// 根据组织查询出所有网格,甩出不是本组织下的网格
gridInfos = null == gridInfos ? getGridInfos(formDTO.getOrgId()) : gridInfos;
if (null == gridInfos){
// 组织下确实不存在网格
nums.add(num);
disposeErrorMsg(info,"");
return;
}
// 根据网格名对比,没有找到的就把行号加入到未执行成功队列中
Object cacheGridName = icHouseRedis.getTemporaryCacheGrid(formDTO.getCustomerId(), formDTO.getUserId(), dto.getGridName());
if (null == cacheGridName){
nums.add(num);
disposeErrorMsg(info,"");
return;
}
dto.setGridId(cacheGridName.toString());
@ -393,7 +412,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener<HouseInfoMode
/**
* @Description 获取小区下的楼栋
* @param neighborHoodId
* @param orgId
* @author zxc
* @date 2022/2/14 1:32 下午
*/

17
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportNeighborHoodInfoListener.java

@ -37,6 +37,8 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
List<Integer> nums = new ArrayList<>();
Integer num = NumConstant.ZERO;
List<NeighborHoodErrorInfoModel> errorInfos = new ArrayList<>();
NeighborHoodInfoModel info = null;
List<ImportGeneralDTO> needDisposeList = new ArrayList<>();
List<ImportGeneralDTO> needInsertList = new ArrayList<>();
@ -70,9 +72,11 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
if (null == data){
return;
}
info = data;
num = num + NumConstant.ONE;
ImportGeneralDTO dto = ConvertUtils.sourceToTarget(data, ImportGeneralDTO.class);
dto.setNum(num);
disposeErrorMsg(info,"");
dto.setCustomerId(formDTO.getCustomerId());
if (formDTO.getOrgType().equals(CustomerGridConstant.GRID)){
disposeGridNeighborHood(dto);
@ -97,6 +101,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
if (k.equals(r.getAgencyName() + "_" + r.getGridName() + "_" + r.getNeighborHoodName())){
// 集合里重复的
nums.add(r.getNum());
disposeErrorMsg(info,"");
r.setExistStatus(true);
}
}
@ -111,6 +116,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
if (!CollectionUtils.isEmpty(existList)){
existList.forEach(e -> {
nums.add(e.getNum());
disposeErrorMsg(info,"");
});
}
List<ImportGeneralDTO> notExistList = groupByBuildingExistStatus.get(false);
@ -172,6 +178,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
//排除不是本网格的 gridName不一样排除,gridName一样但是agencyName不一样也得排除
if (dto.getGridName().compareTo(gridName) != 0 || (!dto.getAgencyName().equals(gridInfo.getAgencyName()) && dto.getGridName().equals(gridName))){
nums.add(num);
disposeErrorMsg(info,"");
}else {
//
dto.setGridId(formDTO.getOrgId());
@ -197,18 +204,21 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
//排除不是本组织的
if (!dto.getAgencyName().equals(agencyName)){
nums.add(num);
disposeErrorMsg(info,"");
}else {
// 根据组织查询出所有网格,甩出不是本组织下的网格
gridInfos = null == gridInfos ? getGridInfos(formDTO.getOrgId()) : gridInfos;
if (null == gridInfos){
// 组织下确实不存在网格
nums.add(num);
disposeErrorMsg(info,"");
return;
}
// 根据网格名对比,没有找到的就把行号加入到未执行成功队列中
Object cacheGridName = icHouseRedis.getTemporaryCacheGrid(formDTO.getCustomerId(), formDTO.getUserId(), dto.getGridName());
if (null == cacheGridName){
nums.add(num);
disposeErrorMsg(info,"");
return;
}
dto.setGridId(cacheGridName.toString());
@ -237,6 +247,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
if (StringUtils.isNotBlank(dto.getNeighborHoodId())){
// 小区已存在
nums.add(dto.getNum());
disposeErrorMsg(info,"");
}else {
needDisposeList.add(dto);
}
@ -268,6 +279,12 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener<Neighb
return neighborHoodInfos;
}
public void disposeErrorMsg(NeighborHoodInfoModel data,String msg){
NeighborHoodErrorInfoModel err = ConvertUtils.sourceToTarget(data, NeighborHoodErrorInfoModel.class);
err.setErrorMsg(msg);
errorInfos.add(err);
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
finalDispose();

20
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/NeighborHoodErrorInfoModel.java

@ -0,0 +1,20 @@
package com.epmet.model;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2022/2/15 2:15 下午
* @DESC
*/
@Data
public class NeighborHoodErrorInfoModel {
@ExcelProperty(value = "小区名称")
private String neighborHoodName;
@ExcelProperty(value = "错误信息")
private String errorMsg;
}
Loading…
Cancel
Save