|
|
@ -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<IcPartyActDao, IcPartyActEntity> implements IcPartyActService { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private IcScheduleDao scheduleDao; |
|
|
|
@Autowired |
|
|
|
private IcPartyOrgService partyOrgService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 活动类型列表 |
|
|
@ -61,8 +72,21 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<HomeMonthTotalResultDTO> 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<HomeMonthTotalResultDTO> result = constructMonthData(formDTO.getYearId()); |
|
|
|
|
|
|
|
List<HomeMonthTotalResultDTO> 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; |
|
|
|
} |
|
|
|
|
|
|
|