|
@ -11,10 +11,7 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
import com.epmet.commons.tools.utils.SpringContextUtils; |
|
|
import com.epmet.commons.tools.utils.SpringContextUtils; |
|
|
import com.epmet.modules.partyOrg.dao.IcPartyActDao; |
|
|
import com.epmet.modules.partyOrg.dao.*; |
|
|
import com.epmet.modules.partyOrg.dao.IcPartyActOrgDao; |
|
|
|
|
|
import com.epmet.modules.partyOrg.dao.IcScheduleDao; |
|
|
|
|
|
import com.epmet.modules.partyOrg.dao.ResiPartymemberAttachmentDao; |
|
|
|
|
|
import com.epmet.modules.partyOrg.entity.IcPartyActEntity; |
|
|
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.entity.ResiPartymemberAttachmentEntity; |
|
@ -40,6 +37,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 党建组织活动 |
|
|
* 党建组织活动 |
|
@ -57,6 +55,8 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
@Autowired |
|
|
@Autowired |
|
|
private IcPartyActOrgDao icPartyActOrgDao; |
|
|
private IcPartyActOrgDao icPartyActOrgDao; |
|
|
@Autowired |
|
|
@Autowired |
|
|
|
|
|
private IcPartyOrgDao partyOrgDao; |
|
|
|
|
|
@Autowired |
|
|
private ResiPartymemberAttachmentDao resiPartymemberAttachmentDao; |
|
|
private ResiPartymemberAttachmentDao resiPartymemberAttachmentDao; |
|
|
/** |
|
|
/** |
|
|
* 活动类型列表 |
|
|
* 活动类型列表 |
|
@ -216,7 +216,40 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public ActAndScheduleListResultDTO getActAndScheduleList(ActAndScheduleListFormDTO formDTO) { |
|
|
public ActAndScheduleListResultDTO getActAndScheduleList(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.ActivityListDTO> activityList = baseDao.getActivityList(formDTO); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(activityList)){ |
|
|
|
|
|
List<String> partyOrgIdsNoDistinct = new ArrayList<>(); |
|
|
|
|
|
activityList.forEach(a -> { |
|
|
|
|
|
partyOrgIdsNoDistinct.addAll(a.getJoinOrgList().stream().map(m -> m.getPartyOrgId()).collect(Collectors.toList())); |
|
|
|
|
|
}); |
|
|
|
|
|
List<String> partyOrgIds = partyOrgIdsNoDistinct.stream().distinct().collect(Collectors.toList()); |
|
|
|
|
|
List<ActAndScheduleListResultDTO.JoinOrgDTO> partyOrg = partyOrgDao.getPartyOrg(partyOrgIds); |
|
|
|
|
|
activityList.forEach(a -> { |
|
|
|
|
|
a.setIsMe(formDTO.getStaffId().equals(a.getStaffId())); |
|
|
|
|
|
a.getJoinOrgList().forEach(po -> partyOrg.stream().filter(p -> p.getPartyOrgId().equals(po.getPartyOrgId())).forEach(p -> po.setPartyOrgName(p.getPartyOrgName()))); |
|
|
|
|
|
a.setJoinOrgs(a.getJoinOrgList().stream().map(m -> m.getPartyOrgName()).collect(Collectors.toList())); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
List<ActAndScheduleListResultDTO.ScheduleListDTO> scheduleList = scheduleDao.getScheduleList(formDTO); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(scheduleList)){ |
|
|
|
|
|
scheduleList.forEach(s -> { |
|
|
|
|
|
s.setIsMe(formDTO.getStaffId().equals(s.getStaffId())); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
ActAndScheduleListResultDTO result = new ActAndScheduleListResultDTO(); |
|
|
|
|
|
result.setActivityList(activityList); |
|
|
|
|
|
result.setScheduleList(scheduleList); |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|