Browse Source

联建活动关联多个单位和服务事项

master
zhaoqifeng 4 years ago
parent
commit
2888475ff7
  1. 85
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityServiceRelationDTO.java
  2. 89
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityUnitRelationDTO.java
  3. 31
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java
  4. 79
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActServiceRelationDTO.java
  5. 84
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActUnitRelationDTO.java
  6. 25
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityServiceRelationDao.java
  7. 25
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java
  8. 15
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java
  9. 25
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActServiceRelationDao.java
  10. 25
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActUnitRelationDao.java
  11. 56
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcActivityServiceRelationEntity.java
  12. 56
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcActivityUnitRelationEntity.java
  13. 51
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActServiceRelationEntity.java
  14. 51
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActUnitRelationEntity.java
  15. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityServiceRelationService.java
  16. 34
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java
  17. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActServiceRelationService.java
  18. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActUnitRelationService.java
  19. 61
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityServiceRelationServiceImpl.java
  20. 60
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java
  21. 199
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  22. 33
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActServiceRelationServiceImpl.java
  23. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActUnitRelationServiceImpl.java
  24. 26
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityServiceRelationDao.xml
  25. 26
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml
  26. 128
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml
  27. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActServiceRelationDao.xml
  28. 24
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActUnitRelationDao.xml

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>
Loading…
Cancel
Save