Browse Source

暂提列表

dev
zxc 3 years ago
parent
commit
b4ca75470b
  1. 2
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java
  2. 68
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java
  3. 12
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml
  4. 15
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml

2
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partyOrg/result/ActAndScheduleListResultDTO.java

@ -33,6 +33,7 @@ public class ActAndScheduleListResultDTO implements Serializable {
private String activityId;
private String staffId;
private String dateId;
private String topic;
private String address;
private String holdTime;
@ -58,6 +59,7 @@ public class ActAndScheduleListResultDTO implements Serializable {
private String remark;
private Boolean isMe = false;
private String staffId;
private String dateId;
}
@Data

68
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partyOrg/service/impl/IcPartyActServiceImpl.java

@ -14,21 +14,17 @@ 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.commons.tools.utils.Result;
import com.epmet.modules.partyOrg.dao.IcPartyActDao;
import com.epmet.modules.partyOrg.dao.IcPartyActOrgDao;
import com.epmet.modules.partyOrg.dao.IcScheduleDao;
import com.epmet.commons.tools.utils.SpringContextUtils;
import com.epmet.modules.partyOrg.dao.*;
import com.epmet.modules.partyOrg.entity.IcPartyActEntity;
import com.epmet.modules.partyOrg.entity.IcPartyActOrgEntity;
import com.epmet.modules.partyOrg.entity.IcPartyActOrgEntity;
import com.epmet.modules.partyOrg.entity.ResiPartymemberAttachmentEntity;
import com.epmet.modules.partyOrg.service.IcPartyActOrgService;
import com.epmet.modules.partyOrg.service.IcPartyActService;
import com.epmet.modules.partyOrg.service.IcPartyOrgService;
import com.epmet.modules.partyOrg.service.ResiPartymemberAttachmentService;
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO;
import com.epmet.resi.group.feign.ResiGroupOpenFeignClient;
import com.epmet.modules.partyOrg.service.ResiPartymemberAttachmentService;
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;
@ -46,11 +42,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.*;
import java.util.stream.Collectors;
@ -276,9 +267,64 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart
*/
@Override
public List<ActAndScheduleListResultDTO> homeSearch(ActAndScheduleListFormDTO formDTO) {
return null;
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<ActAndScheduleListResultDTO> result = constructHomeSearchData(formDTO.getStartDate(), formDTO.getEndDate());
List<ActAndScheduleListResultDTO.ActivityListDTO> activityList = baseDao.getActivityList(formDTO);
if (CollectionUtils.isNotEmpty(activityList)){
activityList.forEach(a -> {
a.setIsMe(formDTO.getStaffId().equals(a.getStaffId()));
});
Map<String, List<ActAndScheduleListResultDTO.ActivityListDTO>> groupByDateId = activityList.stream().collect(Collectors.groupingBy(ActAndScheduleListResultDTO.ActivityListDTO::getDateId));
result.forEach(r -> {
groupByDateId.forEach((dateId,list) -> {
if (r.getDateId().equals(dateId)){
r.setActivityList(list);
r.setActivityTotal(list.size());
}
});
});
}
List<ActAndScheduleListResultDTO.ScheduleListDTO> scheduleList = scheduleDao.getScheduleList(formDTO);
if (CollectionUtils.isNotEmpty(scheduleList)){
scheduleList.forEach(s -> {
s.setIsMe(formDTO.getStaffId().equals(s.getStaffId()));
});
Map<String, List<ActAndScheduleListResultDTO.ScheduleListDTO>> groupByDateId = scheduleList.stream().collect(Collectors.groupingBy(ActAndScheduleListResultDTO.ScheduleListDTO::getDateId));
result.forEach(r -> {
groupByDateId.forEach((dateId,list) -> {
if (r.getDateId().equals(dateId)){
r.setScheduleList(list);
r.setScheduleTotal(list.size());
}
});
});
}
return result;
}
public static List<ActAndScheduleListResultDTO> constructHomeSearchData(String startDate,String endDate){
List<ActAndScheduleListResultDTO> result = new ArrayList<>();
if (StringUtils.isNotBlank(startDate) && StringUtils.isNotBlank(endDate)){
List<String> days = DateUtils.getDaysBetween(startDate, endDate);
days.forEach(d -> {
ActAndScheduleListResultDTO dto = new ActAndScheduleListResultDTO();
dto.setDateId(d);
result.add(dto);
});
}
return result;
}
/**
* 党建小助手活动触发为用户推送消息
*/

12
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcPartyActDao.xml

@ -21,6 +21,7 @@
<resultMap id="getActivityListMap" type="com.epmet.resi.partymember.dto.partyOrg.result.ActAndScheduleListResultDTO$ActivityListDTO">
<result property="activityId" column="activityId"/>
<result property="topic" column="topic"/>
<result property="dateId" column="dateId"/>
<result property="address" column="address"/>
<result property="holdTime" column="holdTime"/>
<result property="joinTypeValue" column="joinTypeValue"/>
@ -39,6 +40,7 @@
pa.TOPIC,
pa.ADDRESS,
DATE_FORMAT(pa.HOLD_TIME,'%Y-%m-%d %H:%i:%s') AS holdTime,
DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') AS dateId,
pa.ACT_TYPE AS type,
(CASE WHEN pa.JOIN_USER_TYPE = '1' THEN '支部委员'
WHEN pa.JOIN_USER_TYPE = '0' THEN '全体党员'
@ -54,10 +56,18 @@
LEFT JOIN ic_party_act_org ao ON (ao.IC_PARTY_ACT_ID = pa.ID AND ao.DEL_FLAG = 0)
WHERE pa.DEL_FLAG = 0
AND pa.CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') = #{dateId}
<if test='null != dateId and dateId != "" '>
AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') = #{dateId}
</if>
<if test=' isSelf == "1" '>
AND pa.PUBLISH_STAFF_ID = #{staffId}
</if>
<if test='null != startDate and startDate != ""'>
AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') >= #{startDate}
</if>
<if test='null != endDate and endDate != ""'>
AND DATE_FORMAT(pa.HOLD_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{endDate}
</if>
AND pa.PUBLISH_ORG_PATH LIKE CONCAT(#{path},'%')
</select>
</mapper>

15
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partyOrg/IcScheduleDao.xml

@ -25,10 +25,10 @@
FROM ic_schedule
WHERE DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(CREATED_TIME,'%Y') = #{yearId}
AND DATE_FORMAT(REMIND_TIME,'%Y') = #{yearId}
AND ORG_ID_PATH LIKE CONCAT('%',#{agencyId},'%')
AND IS_PUBLIC = '1' OR (STAFF_ID = #{staffId} AND IS_PUBLIC = '0')
GROUP BY DATE_FORMAT(CREATED_TIME,'%Y%m')
GROUP BY DATE_FORMAT(REMIND_TIME,'%Y%m')
UNION ALL
SELECT
COUNT(id) as count,
@ -49,12 +49,21 @@
ID AS scheduleId,
TITLE,
DATE_FORMAT(REMIND_TIME,'%Y-%m-%d %H:%i:%s') AS remindTime,
DATE_FORMAT(REMIND_TIME,'%Y%m%d') AS dateId,
REMARK,
STAFF_ID
FROM ic_schedule
WHERE DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(CREATED_TIME,'%Y%m%d') = #{dateId}
<if test='null != dateId and dateId != "" '>
AND DATE_FORMAT(REMIND_TIME,'%Y%m%d') = #{dateId}
</if>
<if test='null != startDate and startDate != ""'>
AND DATE_FORMAT(REMIND_TIME,'%Y%m%d') >= #{startDate}
</if>
<if test='null != endDate and endDate != ""'>
AND DATE_FORMAT(REMIND_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{endDate}
</if>
AND ORG_ID_PATH LIKE CONCAT('%',#{agencyId},'%')
AND IS_PUBLIC = '1' OR (STAFF_ID = #{staffId} AND IS_PUBLIC = '0')
</select>

Loading…
Cancel
Save