From 3d13549a8a34aebeb4c446699cf8df222f2d0907 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 21 Feb 2022 16:46:46 +0800 Subject: [PATCH 1/3] errInfos --- .../constant/ImportErrorMsgConstants.java | 12 ++++++++ .../epmet/model/BuildingErrorInfoModel.java | 23 ++++++++++++++ .../com/epmet/model/HouseErrorInfoModel.java | 30 +++++++++++++++++++ .../model/ImportBuildingInfoListener.java | 19 ++++++++++++ .../epmet/model/ImportHouseInfoListener.java | 27 ++++++++++++++--- .../model/ImportNeighborHoodInfoListener.java | 17 +++++++++++ .../model/NeighborHoodErrorInfoModel.java | 20 +++++++++++++ 7 files changed, 144 insertions(+), 4 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingErrorInfoModel.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseErrorInfoModel.java create mode 100644 epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/NeighborHoodErrorInfoModel.java diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/constant/ImportErrorMsgConstants.java new file mode 100644 index 0000000000..d49715e330 --- /dev/null +++ b/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 { + + + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingErrorInfoModel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/BuildingErrorInfoModel.java new file mode 100644 index 0000000000..e7db295a7e --- /dev/null +++ b/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; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseErrorInfoModel.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/HouseErrorInfoModel.java new file mode 100644 index 0000000000..9cb84948c5 --- /dev/null +++ b/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; + +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java index 808a69f810..63e5f39000 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/model/ImportBuildingInfoListener.java @@ -34,6 +34,8 @@ public class ImportBuildingInfoListener extends AnalysisEventListener nums = new ArrayList<>(); Integer num = NumConstant.ZERO; + List errorInfos = new ArrayList<>(); + BuildingInfoModel info = null; List needDisposeList = new ArrayList<>(); List needInsertList = new ArrayList<>(); @@ -67,6 +69,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener { nums.add(e.getNum()); + disposeErrorMsg(info,""); }); } } @@ -157,6 +163,7 @@ public class ImportBuildingInfoListener extends AnalysisEventListener nums = new ArrayList<>(); Integer num = NumConstant.ZERO; + List errorInfos = new ArrayList<>(); + HouseInfoModel info = null; List needDisposeList = new ArrayList<>(); List needInsertList = new ArrayList<>(); @@ -73,6 +75,7 @@ public class ImportHouseInfoListener extends AnalysisEventListener importInfo = neighborHoodService.getImportInfo(formDTO, needDisposeList); @@ -132,10 +144,8 @@ public class ImportHouseInfoListener extends AnalysisEventListener nums = new ArrayList<>(); Integer num = NumConstant.ZERO; + List errorInfos = new ArrayList<>(); + NeighborHoodInfoModel info = null; List needDisposeList = new ArrayList<>(); List needInsertList = new ArrayList<>(); @@ -70,9 +72,11 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener { nums.add(e.getNum()); + disposeErrorMsg(info,""); }); } List notExistList = groupByBuildingExistStatus.get(false); @@ -172,6 +178,7 @@ public class ImportNeighborHoodInfoListener extends AnalysisEventListener Date: Mon, 21 Feb 2022 16:57:08 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=B8=B8=E9=87=8F=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/constants/ImportTaskConstants.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java index ed16f5473c..c67ddbb549 100644 --- a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/constants/ImportTaskConstants.java +++ b/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"; /** * 处理状态:处理中 From 2888475ff76a847a26b988e95ba5e53df2df7fe1 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 21 Feb 2022 17:54:52 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=81=94=E5=BB=BA=E6=B4=BB=E5=8A=A8?= =?UTF-8?q?=E5=85=B3=E8=81=94=E5=A4=9A=E4=B8=AA=E5=8D=95=E4=BD=8D=E5=92=8C?= =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E4=BA=8B=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/IcActivityServiceRelationDTO.java | 85 ++++++++ .../epmet/dto/IcActivityUnitRelationDTO.java | 89 ++++++++ .../com/epmet/dto/IcPartyActivityDTO.java | 31 ++- .../dto/LatestActServiceRelationDTO.java | 79 +++++++ .../epmet/dto/LatestActUnitRelationDTO.java | 84 ++++++++ .../dao/IcActivityServiceRelationDao.java | 25 +++ .../epmet/dao/IcActivityUnitRelationDao.java | 25 +++ .../com/epmet/dao/IcPartyActivityDao.java | 15 +- .../dao/LatestActServiceRelationDao.java | 25 +++ .../epmet/dao/LatestActUnitRelationDao.java | 25 +++ .../IcActivityServiceRelationEntity.java | 56 +++++ .../entity/IcActivityUnitRelationEntity.java | 56 +++++ .../LatestActServiceRelationEntity.java | 51 +++++ .../entity/LatestActUnitRelationEntity.java | 51 +++++ .../IcActivityServiceRelationService.java | 34 +++ .../IcActivityUnitRelationService.java | 34 +++ .../LatestActServiceRelationService.java | 14 ++ .../service/LatestActUnitRelationService.java | 14 ++ .../IcActivityServiceRelationServiceImpl.java | 61 ++++++ .../IcActivityUnitRelationServiceImpl.java | 60 ++++++ .../impl/IcPartyActivityServiceImpl.java | 199 ++++++++++++------ .../LatestActServiceRelationServiceImpl.java | 33 +++ .../LatestActUnitRelationServiceImpl.java | 19 ++ .../mapper/IcActivityServiceRelationDao.xml | 26 +++ .../mapper/IcActivityUnitRelationDao.xml | 26 +++ .../resources/mapper/IcPartyActivityDao.xml | 128 ++++++++++- .../mapper/LatestActServiceRelationDao.xml | 24 +++ .../mapper/LatestActUnitRelationDao.xml | 24 +++ 28 files changed, 1312 insertions(+), 81 deletions(-) create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityServiceRelationDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityUnitRelationDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActServiceRelationDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActUnitRelationDTO.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityServiceRelationDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActServiceRelationDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActUnitRelationDao.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcActivityServiceRelationEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcActivityUnitRelationEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActServiceRelationEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActUnitRelationEntity.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityServiceRelationService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActServiceRelationService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActUnitRelationService.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityServiceRelationServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActServiceRelationServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActUnitRelationServiceImpl.java create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityServiceRelationDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActServiceRelationDao.xml create mode 100644 epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActUnitRelationDao.xml diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityServiceRelationDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityServiceRelationDTO.java new file mode 100644 index 0000000000..c5f7f33641 --- /dev/null +++ b/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; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityUnitRelationDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcActivityUnitRelationDTO.java new file mode 100644 index 0000000000..8af5942af0 --- /dev/null +++ b/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; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java index 81edd97c20..07ec52a21f 100644 --- a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyActivityDTO.java +++ b/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 unitIdList; + private List 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 serviceMatterList; + private List 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; } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActServiceRelationDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActServiceRelationDTO.java new file mode 100644 index 0000000000..b25b10f432 --- /dev/null +++ b/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; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActUnitRelationDTO.java b/epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/LatestActUnitRelationDTO.java new file mode 100644 index 0000000000..534053660d --- /dev/null +++ b/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; + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityServiceRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityServiceRelationDao.java new file mode 100644 index 0000000000..46cfe4eb3e --- /dev/null +++ b/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 { + /** + * 删除活动所属服务 + * + * @Param activityId + * @Return + * @Author zhaoqifeng + * @Date 2022/2/21 16:19 + */ + void deleteByActivity(@Param("activityId") String activityId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcActivityUnitRelationDao.java new file mode 100644 index 0000000000..be27ce119b --- /dev/null +++ b/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 { + /** + * 删除活动所属单位 + * + * @Param activityId + * @Return + * @Author zhaoqifeng + * @Date 2022/2/21 16:19 + */ + void deleteByActivity(@Param("activityId") String activityId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java index bb7e41c2ed..c8fba2ffed 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcPartyActivityDao.java +++ b/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 { * @Date 2021/12/9 16:06 */ ActivityStatisticsDTO getStatistics(PartyActivityFormDTO formDTO); - + + /** + * 活动列表查询 + * @Param formDTO + * @Return {@link java.util.List} + * @Author zhaoqifeng + * @Date 2022/2/21 14:50 + */ + List selectActivityList(PartyActivityFormDTO formDTO); + + + List getActivityList(PartyActivityFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActServiceRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActServiceRelationDao.java new file mode 100644 index 0000000000..6a46bf5031 --- /dev/null +++ b/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 { + /** + * 删除活动所属服务 + * + * @Param activityId + * @Return + * @Author zhaoqifeng + * @Date 2022/2/21 16:19 + */ + void deleteByActivity(@Param("activityId") String activityId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActUnitRelationDao.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/LatestActUnitRelationDao.java new file mode 100644 index 0000000000..19e8d48e57 --- /dev/null +++ b/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 { + /** + * 删除活动所属服务 + * + * @Param activityId + * @Return + * @Author zhaoqifeng + * @Date 2022/2/21 16:19 + */ + void deleteByActivity(@Param("activityId") String activityId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcActivityServiceRelationEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcActivityServiceRelationEntity.java new file mode 100644 index 0000000000..31790b660f --- /dev/null +++ b/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; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcActivityUnitRelationEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/IcActivityUnitRelationEntity.java new file mode 100644 index 0000000000..d7983ff41c --- /dev/null +++ b/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; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActServiceRelationEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActServiceRelationEntity.java new file mode 100644 index 0000000000..a7d81ad2c1 --- /dev/null +++ b/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; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActUnitRelationEntity.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/entity/LatestActUnitRelationEntity.java new file mode 100644 index 0000000000..4940c49cd3 --- /dev/null +++ b/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; + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityServiceRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityServiceRelationService.java new file mode 100644 index 0000000000..b2cd111205 --- /dev/null +++ b/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 { + /** + * 获取活动所属服务事项 + * + * @Param activityId 活动ID + * @Return {@link List } + * @Author zhaoqifeng + * @Date 2022/2/21 14:36 + */ + List getServiceList(String activityId); + + /** + * 删除活动所属服务事项 + * + * @Param activityId + * @Return + * @Author zhaoqifeng + * @Date 2022/2/21 16:10 + */ + void deleteByActivity(String activityId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcActivityUnitRelationService.java new file mode 100644 index 0000000000..41e51a1c31 --- /dev/null +++ b/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 { + /** + * 获取活动所属党建单位 + * + * @Param activityId 活动ID + * @Return {@link List} + * @Author zhaoqifeng + * @Date 2022/2/21 14:36 + */ + List getUnitList(String activityId); + + /** + * 删除活动所属单位 + * + * @Param activityId + * @Return + * @Author zhaoqifeng + * @Date 2022/2/21 16:10 + */ + void deleteByActivity(String activityId); +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActServiceRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActServiceRelationService.java new file mode 100644 index 0000000000..e400a6d1ab --- /dev/null +++ b/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 { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActUnitRelationService.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/LatestActUnitRelationService.java new file mode 100644 index 0000000000..5da8fb584b --- /dev/null +++ b/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 { + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityServiceRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityServiceRelationServiceImpl.java new file mode 100644 index 0000000000..d52ec53145 --- /dev/null +++ b/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 implements IcActivityServiceRelationService { + + + /** + * 获取活动所属服务事项 + * + * @param activityId + * @Param activityId 活动ID + * @Return {@link List } + * @Author zhaoqifeng + * @Date 2022/2/21 14:36 + */ + @Override + public List getServiceList(String activityId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcActivityServiceRelationEntity::getActivityId, activityId); + wrapper.orderByAsc(IcActivityServiceRelationEntity::getSort); + List 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); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcActivityUnitRelationServiceImpl.java new file mode 100644 index 0000000000..eca268f436 --- /dev/null +++ b/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 implements IcActivityUnitRelationService { + + /** + * 获取活动所属党建单位 + * + * @param activityId + * @Param activityId 活动ID + * @Return {@link List } + * @Author zhaoqifeng + * @Date 2022/2/21 14:36 + */ + @Override + public List getUnitList(String activityId) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(IcActivityUnitRelationEntity::getActivityId, activityId); + wrapper.orderByAsc(IcActivityUnitRelationEntity::getSort); + List 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); + } +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java index 4cea3f9136..d275504fb4 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java +++ b/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 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 list = baseDao.selectList(wrapper); + List list = baseDao.selectActivityList(formDTO); PageInfo pageInfo = new PageInfo<>(list); List 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 option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); dtoList.forEach(dto -> { - dto.setUnitName(option.get(dto.getUnitId())); + //联建单位ID与单位名匹配 + List unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA)); + List 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 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 list = baseDao.selectList(wrapper); + List list = baseDao.selectActivityList(formDTO); List 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 option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); dtoList.forEach(dto -> { - dto.setUnitName(option.get(dto.getUnitId())); + List unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA)); + List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); + dto.setUnitName(StringUtils.join(unitNames, StrConstant.COMMA)); }); } return dtoList; } - private QueryWrapper getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); - - QueryWrapper 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 serviceItemList=icServiceItemDictService.queryDictList(entity.getCustomerId()); Map categoryMap=serviceItemList.stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List services = icActivityServiceRelationService.getServiceList(id); + List serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); + dto.setServiceMatterList(services); + dto.setServiceMatterNameList(serviceNames); + + //获取单位 + //获取组织下联建单位 + IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); + unitDTO.setAgencyId(entity.getAgencyId()); + Map option = icPartyUnitService.option(unitDTO).stream().collect(Collectors.toMap(OptionDTO::getValue, OptionDTO::getLabel)); + List unitIds = icActivityUnitRelationService.getUnitList(id); + List 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 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 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%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 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 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 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 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 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 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 list = baseDao.selectList(wrapper); + List list = baseDao.getActivityList(formDTO); List dtoList = ConvertUtils.sourceToTarget(list, IcPartyActivityDTO.class); IcPartyUnitDTO unitDTO = new IcPartyUnitDTO(); @@ -367,8 +423,15 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl 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 unitIds = Arrays.asList(dto.getUnitId().split(StrConstant.COMMA)); + List unitNames = unitIds.stream().map(option::get).collect(Collectors.toList()); + dto.setUnitName(StringUtils.join(unitNames, StrConstant.COMMA)); + + //服务事项与服务事项名匹配 + List services = Arrays.asList(dto.getServiceMatter().split(StrConstant.COMMA)); + List serviceNames = services.stream().map(categoryMap::get).collect(Collectors.toList()); + dto.setServiceMatterName(StringUtils.join(serviceNames, StrConstant.SEMICOLON)); }); } PageInfo pageInfo = new PageInfo<>(dtoList); diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActServiceRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActServiceRelationServiceImpl.java new file mode 100644 index 0000000000..f94e54a486 --- /dev/null +++ b/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 implements LatestActServiceRelationService { + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActUnitRelationServiceImpl.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/LatestActUnitRelationServiceImpl.java new file mode 100644 index 0000000000..aee966d2ea --- /dev/null +++ b/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 implements LatestActUnitRelationService { + + +} \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityServiceRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityServiceRelationDao.xml new file mode 100644 index 0000000000..dabb923f67 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityServiceRelationDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + DELETE FROM ic_activity_service_relation WHERE ACTIVITY_ID = #{activityId} + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml new file mode 100644 index 0000000000..f8947c98e4 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcActivityUnitRelationDao.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + DELETE FROM ic_activity_unit_relation WHERE ACTIVITY_ID = #{activityId} + + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml index ede5b4c0e1..fb7912f42d 100644 --- a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcPartyActivityDao.xml @@ -28,14 +28,16 @@ + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActServiceRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActServiceRelationDao.xml new file mode 100644 index 0000000000..abc0deda55 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActServiceRelationDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + DELETE FROM latest_act_service_relation WHERE ACT_ID = #{activityId} + + + \ No newline at end of file diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActUnitRelationDao.xml b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActUnitRelationDao.xml new file mode 100644 index 0000000000..e679b5dc53 --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/LatestActUnitRelationDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + DELETE FROM latest_act_unit_relation WHERE ACT_ID = #{activityId} + + + \ No newline at end of file