|
@ -3,20 +3,34 @@ package com.epmet.modules.partyOrg.service.impl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|
|
import com.epmet.commons.tools.constant.Constant; |
|
|
import com.epmet.commons.tools.constant.Constant; |
|
|
import com.epmet.commons.tools.constant.NumConstant; |
|
|
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.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.IcPartyActDao; |
|
|
|
|
|
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.entity.IcPartyActEntity; |
|
|
import com.epmet.modules.partyOrg.service.IcPartyActService; |
|
|
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.IcPartyActAddOrUpdateFormDTO; |
|
|
import com.epmet.resi.partymember.dto.icpartyact.form.IcPartyActPageFormDTO; |
|
|
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.IcPartActTypeDTO; |
|
|
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO; |
|
|
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActDetailResDTO; |
|
|
import com.epmet.resi.partymember.dto.icpartyact.result.IcPartyActPageResultDTO; |
|
|
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.HomeMonthTotalFormDTO; |
|
|
|
|
|
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.HomeMonthTotalResultDTO; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.util.ArrayList; |
|
|
import java.util.ArrayList; |
|
@ -33,6 +47,12 @@ import java.util.Map; |
|
|
@Service |
|
|
@Service |
|
|
public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPartyActEntity> implements IcPartyActService { |
|
|
public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPartyActEntity> implements IcPartyActService { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IcScheduleDao scheduleDao; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IcPartyOrgService partyOrgService; |
|
|
|
|
|
@Autowired |
|
|
|
|
|
private IcPartyActOrgDao icPartyActOrgDao; |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 活动类型列表 |
|
|
* 活动类型列表 |
|
@ -61,8 +81,21 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
public List<HomeMonthTotalResultDTO> getHomeMonthTotal(HomeMonthTotalFormDTO formDTO) { |
|
|
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> 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; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -99,11 +132,29 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
* @return |
|
|
* @return |
|
|
*/ |
|
|
*/ |
|
|
@Override |
|
|
@Override |
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
public Map<String, String> addOrUpdate(IcPartyActAddOrUpdateFormDTO formDTO) { |
|
|
public Map<String, String> 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; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 活动列表-分页查询 |
|
|
* 活动列表-分页查询 |
|
|
* |
|
|
* |
|
@ -129,4 +180,26 @@ public class IcPartyActServiceImpl extends BaseServiceImpl<IcPartyActDao, IcPart |
|
|
//todo
|
|
|
//todo
|
|
|
return null; |
|
|
return null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Desc: 【党建日历】活动、日程列表 |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @author zxc |
|
|
|
|
|
* @date 2022/8/19 13:57 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public ActAndScheduleListResultDTO getActAndScheduleList(ActAndScheduleListFormDTO formDTO) { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Desc: 【党建日历】某月/天数据搜索列表 |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @author zxc |
|
|
|
|
|
* @date 2022/8/19 14:01 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public List<ActAndScheduleListResultDTO> homeSearch(ActAndScheduleListFormDTO formDTO) { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
} |
|
|
} |