From c6ce21c6ac7783a4113b5f461ee5b7b5816b807f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 19 Aug 2022 11:18:01 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=80=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../partyOrg/form/HomeMonthTotalFormDTO.java | 7 +++++ .../modules/partyOrg/dao/IcScheduleDao.java | 6 ++++ .../service/impl/IcPartyActServiceImpl.java | 26 +++++++++++++++- .../src/main/resources/logback-spring.xml | 3 +- .../mapper/partyOrg/IcScheduleDao.xml | 30 +++++++++++++++++++ 5 files changed, 70 insertions(+), 2 deletions(-) diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/HomeMonthTotalFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/HomeMonthTotalFormDTO.java index 74f392a890..396ba3611a 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/HomeMonthTotalFormDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/HomeMonthTotalFormDTO.java @@ -38,4 +38,11 @@ public class HomeMonthTotalFormDTO implements Serializable { private String staffId; private String customerId; + + /** + * 工作人员所属组织ID + */ + private String agencyId; + + private String path; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java index b8b407a170..48aa6fd599 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/dao/IcScheduleDao.java @@ -3,8 +3,12 @@ package com.epmet.modules.partyOrg.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.modules.partyOrg.entity.IcScheduleEntity; import com.epmet.resi.partymember.dto.partyOrg.form.AddOrEditScheduleFormDTO; +import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 日程表 * @@ -16,4 +20,6 @@ public interface IcScheduleDao extends BaseDao { void editSchedule(AddOrEditScheduleFormDTO formDTO); + List getScheduleAndActCount(HomeMonthTotalFormDTO formDTO); + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java index 0a20fe8935..5e0a463d14 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java @@ -3,19 +3,26 @@ package com.epmet.modules.partyOrg.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.modules.partyOrg.dao.IcPartyActDao; +import com.epmet.modules.partyOrg.dao.IcScheduleDao; import com.epmet.modules.partyOrg.entity.IcPartyActEntity; import com.epmet.modules.partyOrg.service.IcPartyActService; +import com.epmet.modules.partyOrg.service.IcPartyOrgService; import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActAddOrUpdateFormDTO; import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartActTypeDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO; +import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.text.SimpleDateFormat; @@ -33,6 +40,10 @@ import java.util.Map; @Service public class IcPartyActServiceImpl extends BaseServiceImpl implements IcPartyActService { + @Autowired + private IcScheduleDao scheduleDao; + @Autowired + private IcPartyOrgService partyOrgService; /** * 活动类型列表 @@ -61,8 +72,21 @@ public class IcPartyActServiceImpl extends BaseServiceImpl getHomeMonthTotal(HomeMonthTotalFormDTO formDTO) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); + if (null == staffInfo){ + throw new EpmetException("查询工作人员失败:"+formDTO.getStaffId()); + } + formDTO.setAgencyId(staffInfo.getAgencyId()); + IcPartyOrgDTO icPartyOrgDTO = partyOrgService.get(formDTO.getOrgId()); + if (null == icPartyOrgDTO){ + throw new EpmetException("未查询到党组织信息:"+formDTO.getOrgId()); + } + formDTO.setPath(icPartyOrgDTO.getOrgPids().equals("") || icPartyOrgDTO.getOrgPids().equals(NumConstant.ZERO_STR) ? icPartyOrgDTO.getId() : icPartyOrgDTO.getOrgPids().concat(":").concat(icPartyOrgDTO.getId())); List result = constructMonthData(formDTO.getYearId()); - + List countList = scheduleDao.getScheduleAndActCount(formDTO); + if (CollectionUtils.isNotEmpty(countList)){ + countList.forEach(c -> result.stream().filter(r -> c.getMonthId().equals(r.getMonthId())).forEach(r -> r.setCount(c.getCount()))); + } return result; } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml index f4fc5a99ea..b8b3161188 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/logback-spring.xml @@ -160,11 +160,12 @@ - + + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml index 878c3f9fec..c4933d7934 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml @@ -14,4 +14,34 @@ is_public = #{isPublic} WHERE ID = #{scheduleId} + + \ No newline at end of file From ea2e8106b54dd3841bab380d91975df33612bbc0 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 19 Aug 2022 11:19:41 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=80=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/partyOrg/IcScheduleDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml index c4933d7934..39bae20e11 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml @@ -38,7 +38,7 @@ AND CUSTOMER_ID = #{customerId} AND HOLD_YEAR_ID = #{yearId} - AND CREATED_BY = '周星驰' + AND CREATED_BY = #{staffId} AND PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%') GROUP BY HOLD_MONTH_ID)t From e290cfa4b2ee2da89be8b1f01b0094662221d8e8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 19 Aug 2022 13:26:56 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E5=AD=97=E5=85=B8=E8=A1=A8=E6=95=B0=E6=8D=AE?= =?UTF-8?q?flyway?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration/V0.0.23_party_publish_Time.sql | 7 + .../epmet/commons/tools/utils/DateUtils.java | 6 + .../form/IcPartyActAddOrUpdateFormDTO.java | 146 ++++++++++++++++++ .../dto/icpartyact/form/JoinOrgDTO.java | 53 +++++++ .../controller/IcPartyActController.java | 8 + .../partyOrg/entity/IcPartyActEntity.java | 6 +- .../service/impl/IcPartyActServiceImpl.java | 32 +++- 7 files changed, 253 insertions(+), 5 deletions(-) create mode 100644 epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.23_party_publish_Time.sql create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/JoinOrgDTO.java diff --git a/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.23_party_publish_Time.sql b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.23_party_publish_Time.sql new file mode 100644 index 0000000000..d6f288b2c7 --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/resources/db/migration/V0.0.23_party_publish_Time.sql @@ -0,0 +1,7 @@ +INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458000894500866', 'icpartyact_auto_publish_time', '党组织活动自动发布时间', '党组织活动自动发布时间', 35, 0, 0, '1', '2022-08-19 10:45:54', '1', '2022-08-19 10:46:11'); + + +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458233091170305', 1560458000894500866, '活动开始前1天', '1', '0', '活动开始前1天', 1, 0, 0, '1', '2022-08-19 10:46:49', '1', '2022-08-19 10:46:49'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458276439302146', 1560458000894500866, '活动开始前3天', '3', '0', '活动开始前3天', 2, 0, 0, '1', '2022-08-19 10:47:00', '1', '2022-08-19 10:47:00'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458332076744705', 1560458000894500866, '活动开始前5天', '5', '0', '活动开始前5天', 3, 0, 0, '1', '2022-08-19 10:47:13', '1', '2022-08-19 10:47:13'); +INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458388007788545', 1560458000894500866, '活动开始前7天', '7', '0', '活动开始前7天', 4, 0, 0, '1', '2022-08-19 10:47:26', '1', '2022-08-19 10:47:26'); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index d5e6be9ab4..34511b68bc 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -1070,4 +1070,10 @@ public class DateUtils { return cal.getTime(); } + public static Date calDateBaseDay(Date date, int day) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DAY_OF_MONTH, day); + return calendar.getTime(); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/IcPartyActAddOrUpdateFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/IcPartyActAddOrUpdateFormDTO.java index 1649460dea..88e791c889 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/IcPartyActAddOrUpdateFormDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/IcPartyActAddOrUpdateFormDTO.java @@ -1,8 +1,18 @@ package com.epmet.resi.partymember.dto.icpartyact.form; +import com.epmet.commons.tools.dto.form.FileCommonDTO; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.Valid; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotEmpty; +import javax.validation.constraints.NotNull; import java.io.Serializable; +import java.util.Date; +import java.util.List; /** * @Description @@ -12,7 +22,143 @@ import java.io.Serializable; @Data public class IcPartyActAddOrUpdateFormDTO implements Serializable { private static final long serialVersionUID = -2554822505755122067L; + + public interface AddUserInternalGroup { + } + + public interface AddUserShowGroup extends CustomerClientShowGroup { + } + + public interface UpdateUserInternalGroup { + } + + public interface UpdateUserShowGroup extends CustomerClientShowGroup { + } + + @NotBlank(message = "customerId不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class}) private String customerId; + + @NotBlank(message = "publishStaffId不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class}) private String publishStaffId; + + @NotBlank(message = "icPartyActId不能为空", groups = {UpdateUserInternalGroup.class}) + private String icPartyActId; + + /** + * 活动类型,来源于ic_party_act_type_dict + */ + @NotBlank(message = "活动类型不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + private String actType; + + /** + * 活动举办时间:yyyy + */ + @NotBlank(message = "holdYearId不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class}) + private String holdYearId; + + /** + * 活动举办时间:yyyyMM + */ + @NotBlank(message = "holdMonthId不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class}) + private String holdMonthId; + + /** + * 举办活动时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @NotNull(message = "活动举办时间不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + private Date holdTime; + + /** + * 活动主题 + */ + @NotBlank(message = "活动主题不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + @Length(max = 35, message = "最多输入35个字", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + private String topic; + + /** + * 活动地点 + */ + @NotBlank(message = "活动地点不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + @Length(max = 100, message = "活动地点最多输入100字", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + private String address; + + /** + * 活动地点纬度 + */ + private String latitude; + + /** + * 活动地点经度 + */ + private String longitude; + + /** + * 活动开始前几天 + */ + @NotBlank(message = "自动发布时间不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + private Integer autoPublicType; + /** + * 发布活动党组织 + */ + @NotBlank(message = "发布活动党组织不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + private String publishPartyOrgId; + + /** + * 发布活动党组织名称 + */ + @NotBlank(message = "发布活动党组织名称不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + private String publishPartyOrgName; + + /** + * 发布活动党组织ID的上级节点 + */ + @NotBlank(message = "参加活动党组织ID的上级节点不能为空", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class}) + private String publishOrgPid; + + /** + * 发布活动党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部;6党小组 + */ + @NotBlank(message = "发布活动党组织类型不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + private String publishOrgType; + + /** + * 发布活动党组织PUBLISH_PARTY_ORG_ID的全路径,包含自身。方便前端回显 + */ + @NotBlank(message = "", groups = {AddUserInternalGroup.class, UpdateUserInternalGroup.class}) + private String publishOrgPath; + + /** + * 参加人员类型,0:全体党员;1:支部委员 + */ + @NotBlank(message = "参加人员类型不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + private String joinUserType; + + /** + * 是否自动通知参加人员,0否;1是 + */ + @NotBlank(message = "自动通知参加人员不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + private String isAutoInform; + + /** + * 活动介绍 + */ + @NotBlank(message = "活动介绍不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + @Length(max = 1000, message = "活动介绍最多输入1000字", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + private String introduce; + + /** + * 参加活动党组织 + */ + @Valid + @NotEmpty(message = "参加活动党组织不能为空", groups = {AddUserShowGroup.class, UpdateUserShowGroup.class}) + private List joinOrgList; + + + /** + * 附件表 + */ + private List attachmentList; + } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/JoinOrgDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/JoinOrgDTO.java new file mode 100644 index 0000000000..682b4306ec --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/icpartyact/form/JoinOrgDTO.java @@ -0,0 +1,53 @@ +package com.epmet.resi.partymember.dto.icpartyact.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description + * @Author yzm + * @Date 2022/8/19 10:31 + */ +@Data +public class JoinOrgDTO implements Serializable { + private static final long serialVersionUID = 6994576136698569857L; + + //前端传入 + /** + * 参加活动党组织ID,groupId + */ + @NotBlank(message = "参加活动党组织不能为空", groups = {IcPartyActAddOrUpdateFormDTO.AddUserShowGroup.class, IcPartyActAddOrUpdateFormDTO.UpdateUserShowGroup.class}) + private String joinOrgId; + + /** + * 党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部;6党小组 + */ + @NotBlank(message = "参加活动党组织类型不能为空", groups = {IcPartyActAddOrUpdateFormDTO.AddUserShowGroup.class, IcPartyActAddOrUpdateFormDTO.UpdateUserShowGroup.class}) + private String orgType; + + /** + * 参加活动党组织ID的上级节点 + */ + @NotBlank(message = "参加活动党组织不能为空", groups = {IcPartyActAddOrUpdateFormDTO.AddUserInternalGroup.class, IcPartyActAddOrUpdateFormDTO.UpdateUserInternalGroup.class}) + private String pid; + + /** + * PARTY_ORG_ID的全路径,包含自身。方便前端回显 + */ + @NotBlank(message = "参加活动党组织不能为空", groups = {IcPartyActAddOrUpdateFormDTO.AddUserInternalGroup.class, IcPartyActAddOrUpdateFormDTO.UpdateUserInternalGroup.class}) + private String joinOrgPath; + + //接口内部赋值 + /** + * 活动id + */ + private String icPartyActId; + + /** + * 客户ID + */ + private String customerId; +} + diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java index e06022ac52..9886fb6b13 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java @@ -13,6 +13,7 @@ import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO; import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -43,6 +44,13 @@ public class IcPartyActController { public Result> addOrUpdate(@LoginUser TokenDto tokenDto,@RequestBody IcPartyActAddOrUpdateFormDTO formDTO){ formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setPublishStaffId(tokenDto.getUserId()); + if(StringUtils.isNotBlank(formDTO.getIcPartyActId())){ + //修改活动 + ValidatorUtils.validateEntity(formDTO,IcPartyActAddOrUpdateFormDTO.UpdateUserShowGroup.class,IcPartyActAddOrUpdateFormDTO.UpdateUserInternalGroup.class); + }else{ + //添加活动 + ValidatorUtils.validateEntity(formDTO,IcPartyActAddOrUpdateFormDTO.AddUserShowGroup.class,IcPartyActAddOrUpdateFormDTO.AddUserInternalGroup.class); + } Map map=icPartyActService.addOrUpdate(formDTO); return new Result>().ok(map); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyActEntity.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyActEntity.java index 4c414a1631..23065472fb 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyActEntity.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/entity/IcPartyActEntity.java @@ -52,17 +52,17 @@ public class IcPartyActEntity extends BaseEpmetEntity { private String publishPartyOrgName; /** - * 参加活动党组织ID的上级节点 + * 发布活动党组织ID的上级节点 */ private String publishOrgPid; /** - * 党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部;6党小组 + * 发布活动党组织类型 0省委,1市委,2区委,3党工委,4党委,5支部;6党小组 */ private String publishOrgType; /** - * PUBLISH_PARTY_ORG_ID的全路径,包含自身。方便前端回显 + * 发布活动党组织PUBLISH_PARTY_ORG_ID的全路径,包含自身。方便前端回显 */ private String publishOrgPath; diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java index 0a20fe8935..c5cda02162 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java @@ -3,8 +3,15 @@ package com.epmet.modules.partyOrg.service.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.redis.common.CustomerStaffRedis; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.modules.partyOrg.dao.IcPartyActDao; +import com.epmet.modules.partyOrg.dao.IcPartyActOrgDao; import com.epmet.modules.partyOrg.entity.IcPartyActEntity; import com.epmet.modules.partyOrg.service.IcPartyActService; import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActAddOrUpdateFormDTO; @@ -16,7 +23,9 @@ import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -32,7 +41,8 @@ import java.util.Map; */ @Service public class IcPartyActServiceImpl extends BaseServiceImpl implements IcPartyActService { - + @Autowired + private IcPartyActOrgDao icPartyActOrgDao; /** * 活动类型列表 @@ -99,11 +109,29 @@ public class IcPartyActServiceImpl extends BaseServiceImpl addOrUpdate(IcPartyActAddOrUpdateFormDTO formDTO) { - //todo + IcPartyActEntity icPartyActEntity= ConvertUtils.sourceToTarget(formDTO,IcPartyActEntity.class); + icPartyActEntity.setAutoPublicTime(DateUtils.calDateBaseDay(formDTO.getHoldTime(),formDTO.getAutoPublicType())); + CustomerStaffInfoCacheResult staffInfo=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getPublishStaffId()); + if (null == staffInfo) { + String msg = "查询工作人员信息异常"; + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), msg, msg); + } + icPartyActEntity.setPublishStaffName(staffInfo.getRealName()); + icPartyActEntity.setOrgId(staffInfo.getAgencyId()); + icPartyActEntity.setPid(staffInfo.getParentAgency().getId()); + icPartyActEntity.setOrgIdPath(staffInfo.getAgencyPIds()); + if(StringUtils.isNotBlank(formDTO.getIcPartyActId())){ + //删除附件、删除参加组织 + + } + + return null; } + /** * 活动列表-分页查询 * From fc7ff10327b1932137ee48f7fa89e770ebb9f1a9 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 19 Aug 2022 13:37:09 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=80=BB=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/partyOrg/IcScheduleDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml index 39bae20e11..d4cd5a8674 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml @@ -37,7 +37,7 @@ WHERE DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} AND HOLD_YEAR_ID = #{yearId} - + AND CREATED_BY = #{staffId} AND PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%') From 576a1fc54540d2952abbd9fc71ed54b4a7879724 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 19 Aug 2022 14:02:46 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=9A=82=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/ActAndScheduleListFormDTO.java | 33 ++++++++++++ .../result/ActAndScheduleListResultDTO.java | 53 +++++++++++++++++++ .../controller/IcPartyActController.java | 30 +++++++++++ .../partyOrg/service/IcPartyActService.java | 18 +++++++ .../service/impl/IcPartyActServiceImpl.java | 29 ++++++++-- 5 files changed, 159 insertions(+), 4 deletions(-) create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/ActAndScheduleListFormDTO.java create mode 100644 epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/ActAndScheduleListFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/ActAndScheduleListFormDTO.java new file mode 100644 index 0000000000..5789e543e8 --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/ActAndScheduleListFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.resi.partymember.dto.partyOrg.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/8/19 13:52 + * @DESC + */ +@Data +public class ActAndScheduleListFormDTO implements Serializable { + + private static final long serialVersionUID = -6776882545589530612L; + + private String startDate; + private String endDate; + private String dateId; + + /** + * 是否本人创建的活动,1:是;0:否 + */ + private String isSelf; + + /** + * 党组织ID + */ + private String orgId; + + private String customerId; + private String staffId; +} diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java new file mode 100644 index 0000000000..611d4bf6ed --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java @@ -0,0 +1,53 @@ +package com.epmet.resi.partymember.dto.partyOrg.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/8/19 13:41 + * @DESC + */ +@Data +public class ActAndScheduleListResultDTO implements Serializable { + + private static final long serialVersionUID = 7378300105829566449L; + + private Integer scheduleTotal; + private Integer activityTotal; + private String dateId; + + private List activityList; + + private List scheduleList; + + + @Data + public static class ActivityListDTO implements Serializable{ + + private static final long serialVersionUID = -9050507457068805831L; + + private String activityId; + private String topic; + private String address; + private String holdTime; + private String type; + private String isPublicValue; + private String joinTypeValue; + private Boolean isMe; + + } + + public static class ScheduleListDTO implements Serializable{ + + private static final long serialVersionUID = 5372167729733804267L; + + private String scheduleId; + private String title; + private String remindTime; + private String remark; + private Boolean isMe; + } +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java index 9886fb6b13..2de07478c1 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/controller/IcPartyActController.java @@ -11,7 +11,9 @@ import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartActTypeDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO; +import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO; import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -105,5 +107,33 @@ public class IcPartyActController { formDTO.setStaffId(tokenDto.getUserId()); return new Result>().ok(icPartyActService.getHomeMonthTotal(formDTO)); } + + /** + * Desc:【党建日历】活动、日程列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/8/19 13:57 + */ + @PostMapping("actAndScheduleList") + public Result getActAndScheduleList(@RequestBody ActAndScheduleListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result().ok(icPartyActService.getActAndScheduleList(formDTO)); + } + + /** + * Desc:【党建日历】某月/天数据搜索列表 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/8/19 14:00 + */ + @PostMapping("homeSearch") + public Result> homeSearch(@RequestBody ActAndScheduleListFormDTO formDTO, @LoginUser TokenDto tokenDto){ + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(icPartyActService.homeSearch(formDTO)); + } } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java index 5dca25642b..d0f1d68d65 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/IcPartyActService.java @@ -8,7 +8,9 @@ import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartActTypeDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO; +import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO; import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; import java.util.List; @@ -59,4 +61,20 @@ public interface IcPartyActService extends BaseService { * @return */ IcPartyActDetailResDTO queryActDetail(String customerId, String userId, String icPartyActId); + + /** + * Desc: 【党建日历】活动、日程列表 + * @param formDTO + * @author zxc + * @date 2022/8/19 13:57 + */ + ActAndScheduleListResultDTO getActAndScheduleList(ActAndScheduleListFormDTO formDTO); + + /** + * Desc: 【党建日历】某月/天数据搜索列表 + * @param formDTO + * @author zxc + * @date 2022/8/19 14:01 + */ + List homeSearch(ActAndScheduleListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java index 86e6fbe505..4721faea3e 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java @@ -4,18 +4,15 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.Constant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; -import com.epmet.commons.tools.exception.EpmetException; -import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; -import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.modules.partyOrg.dao.IcPartyActDao; -import com.epmet.modules.partyOrg.dao.IcScheduleDao; import com.epmet.modules.partyOrg.dao.IcPartyActOrgDao; +import com.epmet.modules.partyOrg.dao.IcScheduleDao; import com.epmet.modules.partyOrg.entity.IcPartyActEntity; import com.epmet.modules.partyOrg.service.IcPartyActService; import com.epmet.modules.partyOrg.service.IcPartyOrgService; @@ -25,7 +22,9 @@ import com.epmet.resi.partymember.dto.icpartyact.result.IcPartActTypeDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO; import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO; import com.epmet.resi.partymember.dto.partyOrg.IcPartyOrgDTO; +import com.epmet.resi.partymember.dto.partyOrg.form.ActAndScheduleListFormDTO; import com.epmet.resi.partymember.dto.partyOrg.form.HomeMonthTotalFormDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -181,4 +180,26 @@ public class IcPartyActServiceImpl extends BaseServiceImpl homeSearch(ActAndScheduleListFormDTO formDTO) { + return null; + } } \ No newline at end of file