diff --git a/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReadIcMessageFormDTO.java b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReadIcMessageFormDTO.java new file mode 100644 index 0000000000..d5c875bd87 --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReadIcMessageFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ReadIcMessageFormDTO implements Serializable { + private static final long serialVersionUID = 2697079163476964749L; + + /** + * 消息Id + */ + private String id; + //token中信息 + private String customerId; + private String userId; +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/IcMessageController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/IcMessageController.java index daae8cb210..b93bd93fbc 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/IcMessageController.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/IcMessageController.java @@ -13,6 +13,7 @@ import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IcMessageDTO; import com.epmet.dto.form.IcMessageFormDTO; import com.epmet.dto.form.IcMessageListFormDTO; +import com.epmet.dto.form.ReadIcMessageFormDTO; import com.epmet.service.IcMessageService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -83,5 +84,17 @@ public class IcMessageController { return new Result(); } + /** + * @Author sun + * @Description 单条或批量修改已读 + **/ + @PostMapping("read") + public Result read(@LoginUser TokenDto tokenDto, @RequestBody ReadIcMessageFormDTO formDTO) { + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setUserId(tokenDto.getUserId()); + icMessageService.read(formDTO); + return new Result(); + } + } diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/IcMessageDao.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/IcMessageDao.java index 3e51845040..998f48b62a 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/IcMessageDao.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/IcMessageDao.java @@ -3,6 +3,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IcMessageDTO; import com.epmet.dto.form.IcMessageListFormDTO; +import com.epmet.dto.form.ReadIcMessageFormDTO; import com.epmet.entity.IcMessageEntity; import org.apache.ibatis.annotations.Mapper; @@ -18,4 +19,6 @@ import java.util.List; public interface IcMessageDao extends BaseDao { List selectMessageList(IcMessageListFormDTO formDTO); + + void upByUserId(ReadIcMessageFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/IcMessageService.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/IcMessageService.java index bb2c4e7284..c13639c418 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/IcMessageService.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/IcMessageService.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IcMessageDTO; import com.epmet.dto.form.IcMessageFormDTO; import com.epmet.dto.form.IcMessageListFormDTO; +import com.epmet.dto.form.ReadIcMessageFormDTO; import com.epmet.entity.IcMessageEntity; import java.util.List; @@ -70,4 +71,6 @@ public interface IcMessageService extends BaseService { void delete(String[] ids); void saveIcMessageList(List msgList); + + void read(ReadIcMessageFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/IcMessageServiceImpl.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/IcMessageServiceImpl.java index 611ab78964..5d2678c49d 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/IcMessageServiceImpl.java +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/IcMessageServiceImpl.java @@ -16,6 +16,7 @@ import com.epmet.dto.IcMessageDTO; import com.epmet.dto.form.IcMessageFormDTO; import com.epmet.dto.form.IcMessageListFormDTO; import com.epmet.dto.form.IcMoveInListFormDTO; +import com.epmet.dto.form.ReadIcMessageFormDTO; import com.epmet.dto.result.AllGridsByUserIdResultDTO; import com.epmet.dto.result.HouseInfoDTO; import com.epmet.dto.result.IcMoveInListResultDTO; @@ -93,4 +94,17 @@ public class IcMessageServiceImpl extends BaseServiceImpl + + UPDATE ic_message + SET read_flag = 'read', + updated_by = #{userId}, + updated_time = NOW() + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND user_id = #{userId} + + \ No newline at end of file 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 index b6b33564d2..19998a2448 100644 --- 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 @@ -17,6 +17,7 @@ public class ActAndScheduleListFormDTO implements Serializable { private String startDate; private String endDate; private String dateId; + private String yearId; /** * 是否本人创建的活动,1:是;0:否 @@ -32,4 +33,9 @@ public class ActAndScheduleListFormDTO implements Serializable { private String staffId; private String agencyId; private String path; + + /** + * 当seachType = 'yearSearch'时,不需要查询党组织 + */ + private String searchType = ""; } diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/YearSearchFormDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/YearSearchFormDTO.java new file mode 100644 index 0000000000..983f48548d --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/form/YearSearchFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.resi.partymember.dto.partyOrg.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/8/22 09:26 + * @DESC + */ +@Data +public class YearSearchFormDTO implements Serializable { + + private static final long serialVersionUID = 4557112229519696741L; + + public interface YearSearchForm{} + + @NotBlank(message = "yaerId不能为空",groups = YearSearchForm.class) + private String yearId; + + private String staffId; + private String customerId; +} 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 index 9b3248a0f3..fe782a2083 100644 --- 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 @@ -37,6 +37,10 @@ public class ActAndScheduleListResultDTO implements Serializable { private String topic; private String address; private String holdTime; + private String autoPublicTime; + private String isAutoInformValue; + private String isAutoInform; + private String autoInformDay; private String type; private String isPublicValue; private String isPublish; diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/YearSearchResultDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/YearSearchResultDTO.java new file mode 100644 index 0000000000..e03e53c13b --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/YearSearchResultDTO.java @@ -0,0 +1,46 @@ +package com.epmet.resi.partymember.dto.partyOrg.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/8/22 09:27 + * @DESC + */ +@Data +public class YearSearchResultDTO implements Serializable { + + private static final long serialVersionUID = 8961924457475202790L; + + private String type; + private String frequency; + private List activityList; + + @Data + public static class YearSearchActivityListDTO implements Serializable{ + + private static final long serialVersionUID = -9050507457068805831L; + + private String activityId; + private String staffId; + private String dateId; + private String topic; + private String address; + private String holdTime; + private String type; + private String isPublicValue; + private String isPublish; + private String joinTypeValue; + private String joinUserType; + private String isAutoInformValue; + private String autoInformDay; + private String autoPublicTime; + private List joinOrgList; + private List joinOrgs; + private Boolean isMe = false; + + } +} 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 73784ef2ad..1f1ccfe249 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 @@ -14,8 +14,10 @@ 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.form.YearSearchFormDTO; import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.YearSearchResultDTO; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -173,4 +175,19 @@ public class IcPartyActController { } return new Result(); } + + /** + * Desc:【党建日历】生成年度活动计划查询 + * @param tokenDto + * @param formDTO + * @author zxc + * @date 2022/8/22 09:33 + */ + @PostMapping("yearSearch") + public Result> yearSearch(@LoginUser TokenDto tokenDto, @RequestBody YearSearchFormDTO formDTO){ + formDTO.setStaffId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + return new Result>().ok(icPartyActService.yearSearch(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 512c38a99d..eeba74188a 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 @@ -11,8 +11,10 @@ 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.form.YearSearchFormDTO; import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.YearSearchResultDTO; import java.util.List; import java.util.Map; @@ -96,4 +98,12 @@ public interface IcPartyActService extends BaseService { * @param icPartyActIds */ void deleteIcPartyAct(String customerId,String userId, List icPartyActIds); + + /** + * Desc: 【党建日历】生成年度活动计划查询 + * @param formDTO + * @author zxc + * @date 2022/8/22 09:33 + */ + List yearSearch(YearSearchFormDTO 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 eccab1e40a..ec14369f19 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 @@ -36,8 +36,10 @@ 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.form.YearSearchFormDTO; import com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO; import com.epmet.resi.partymember.dto.partyOrg.result.HomeMonthTotalResultDTO; +import com.epmet.resi.partymember.dto.partyOrg.result.YearSearchResultDTO; import com.epmet.send.SendMqMsgUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -328,6 +330,32 @@ public class IcPartyActServiceImpl extends BaseServiceImpl yearSearch(YearSearchFormDTO formDTO) { + ActAndScheduleListFormDTO secondForm = ConvertUtils.sourceToTarget(formDTO, ActAndScheduleListFormDTO.class); + secondForm.setSearchType("yearSearch"); + disposeActAndScheduleListFormDTO(secondForm); + List activityList = baseDao.getActivityList(secondForm); + List result = new ArrayList<>(); + if (CollectionUtils.isNotEmpty(activityList)) { + disposeActivityList(secondForm, activityList); + Map> groupByType = activityList.stream().collect(Collectors.groupingBy(ActAndScheduleListResultDTO.ActivityListDTO::getType)); + groupByType.forEach((type,list) -> { + YearSearchResultDTO dto = new YearSearchResultDTO(); + dto.setType(type); + dto.setActivityList(ConvertUtils.sourceToTarget(list, YearSearchResultDTO.YearSearchActivityListDTO.class)); + result.add(dto); + }); + } + return result; + } + /** * Desc: * @param formDTO @@ -340,11 +368,13 @@ public class IcPartyActServiceImpl extends BaseServiceImpl + + + + @@ -40,6 +44,12 @@ pa.TOPIC, pa.ADDRESS, DATE_FORMAT(pa.HOLD_TIME,'%Y-%m-%d %H:%i:%s') AS holdTime, + (CASE WHEN pa.IS_AUTO_INFORM = '1' THEN '是' + WHEN pa.IS_AUTO_INFORM = '0' THEN '否' + ELSE '否' END) AS isAutoInformValue, + pa.IS_AUTO_INFORM as isAutoInform, + if(IS_AUTO_INFORM = '1',DATE_FORMAT(pa.AUTO_PUBLIC_TIME,'%Y-%m-%d %H:%i:%s'),'') AS autoPublicTime, + if(IS_AUTO_INFORM = '1',concat('活动开始前',pa.AUTO_PUBLIC_TYPE,'天'),'') as autoInformDay, DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') AS dateId, pa.ACT_TYPE AS type, (CASE WHEN pa.JOIN_USER_TYPE = '1' THEN '支部委员' @@ -59,6 +69,9 @@ AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') = #{dateId} + + AND pa.ORG_ID_PATH like concat('%',#{agencyId},'%') + AND pa.PUBLISH_STAFF_ID = #{staffId} @@ -68,7 +81,9 @@ AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') #{endDate} - AND pa.PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%') + + AND pa.PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%') +