|
|
@ -33,13 +33,13 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; |
|
|
|
import com.epmet.commons.tools.security.dto.TokenDto; |
|
|
|
import com.epmet.commons.tools.utils.ConvertUtils; |
|
|
|
import com.epmet.commons.tools.constant.FieldConstant; |
|
|
|
import com.epmet.commons.tools.utils.DateUtils; |
|
|
|
import com.epmet.constant.PartyServiceCenterConstant; |
|
|
|
import com.epmet.dao.IcMatterAppointmentRecordDao; |
|
|
|
import com.epmet.dao.IcPartyServiceCenterDao; |
|
|
|
import com.epmet.dto.IcPartyServiceCenterDTO; |
|
|
|
import com.epmet.dto.form.AddPartyServiceCenterFormDTO; |
|
|
|
import com.epmet.dto.form.DelMatterFormDTO; |
|
|
|
import com.epmet.dto.form.EditPartyServiceCenterFormDTO; |
|
|
|
import com.epmet.dto.form.*; |
|
|
|
import com.epmet.dto.result.PartyServiceCenterListResultDTO; |
|
|
|
import com.epmet.entity.IcMatterAppointmentRecordEntity; |
|
|
|
import com.epmet.entity.IcPartyServiceCenterEntity; |
|
|
|
import com.epmet.entity.IcPartyServiceCenterMatterEntity; |
|
|
@ -56,6 +56,8 @@ import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN; |
|
|
|
|
|
|
|
/** |
|
|
|
* 党群服务中心 |
|
|
|
* |
|
|
@ -216,4 +218,64 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ |
|
|
|
matterService.deleteById(formDTO.getMatterId()); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 预约 |
|
|
|
* @param formDTO |
|
|
|
* @param tokenDto |
|
|
|
* @author zxc |
|
|
|
* @date 2021/11/22 2:06 下午 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public void appointment(AppointmentFormDTO formDTO, TokenDto tokenDto) { |
|
|
|
String customerId = tokenDto.getCustomerId(); |
|
|
|
// TODO 后台认证是不是可以预约
|
|
|
|
|
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); |
|
|
|
if (null == staffInfo){ |
|
|
|
throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); |
|
|
|
} |
|
|
|
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); |
|
|
|
if (null == agencyInfo){ |
|
|
|
throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId())); |
|
|
|
} |
|
|
|
IcMatterAppointmentRecordEntity e = ConvertUtils.sourceToTarget(formDTO, IcMatterAppointmentRecordEntity.class); |
|
|
|
e.setCustomerId(customerId); |
|
|
|
e.setOrgId(staffInfo.getAgencyId()); |
|
|
|
e.setOrgType(PartyServiceCenterConstant.ORG_TYPE_AGENCY); |
|
|
|
e.setPid(agencyInfo.getPid()); |
|
|
|
e.setPids(agencyInfo.getPids()); |
|
|
|
e.setStatus(PartyServiceCenterConstant.APPOINTMENT_STATUS_APPOINTING); |
|
|
|
matterAppointmentRecordDao.insert(e); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 党群服务中心列表 |
|
|
|
* @param formDTO |
|
|
|
* @param tokenDto |
|
|
|
* @author zxc |
|
|
|
* @date 2021/11/22 2:47 下午 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<PartyServiceCenterListResultDTO> partyServiceCenterList(PartyServiceCenterListFormDTO formDTO, TokenDto tokenDto) { |
|
|
|
if (StringUtils.isBlank(formDTO.getOrgId())){ |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); |
|
|
|
if (null == staffInfo){ |
|
|
|
throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); |
|
|
|
} |
|
|
|
formDTO.setOrgId(staffInfo.getAgencyId()); |
|
|
|
} |
|
|
|
List<PartyServiceCenterListResultDTO> result = baseDao.partyServiceCenterList(formDTO.getOrgId()); |
|
|
|
if (CollectionUtils.isNotEmpty(result)){ |
|
|
|
result.forEach(r -> { |
|
|
|
if (CollectionUtils.isNotEmpty(r.getMatterList())){ |
|
|
|
final Integer[] sort = {NumConstant.ONE}; |
|
|
|
r.getMatterList().forEach(m -> { |
|
|
|
m.setSort(sort[NumConstant.ZERO]++); |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
} |