|
|
@ -33,7 +33,6 @@ 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; |
|
|
@ -60,8 +59,7 @@ import java.time.LocalDate; |
|
|
|
import java.time.LocalDateTime; |
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
import java.util.*; |
|
|
|
|
|
|
|
import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN; |
|
|
|
import java.util.concurrent.atomic.AtomicReference; |
|
|
|
|
|
|
|
/** |
|
|
|
* 党群服务中心 |
|
|
@ -233,8 +231,21 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ |
|
|
|
@Override |
|
|
|
public void appointment(AppointmentFormDTO formDTO, TokenDto tokenDto) { |
|
|
|
String customerId = tokenDto.getCustomerId(); |
|
|
|
// TODO 后台认证是不是可以预约
|
|
|
|
|
|
|
|
LambdaQueryWrapper<IcMatterAppointmentRecordEntity> l = new LambdaQueryWrapper<>(); |
|
|
|
l.eq(IcMatterAppointmentRecordEntity::getMatterId,formDTO.getMatterId()) |
|
|
|
.eq(IcMatterAppointmentRecordEntity::getAppointmentDate,formDTO.getAppointmentDate()) |
|
|
|
.eq(IcMatterAppointmentRecordEntity::getStatus,PartyServiceCenterConstant.APPOINTMENT_STATUS_APPOINTING) |
|
|
|
.eq(BaseEpmetEntity::getDelFlag,NumConstant.ZERO); |
|
|
|
List<IcMatterAppointmentRecordEntity> records = matterAppointmentRecordDao.selectList(l); |
|
|
|
if (CollectionUtils.isNotEmpty(records)){ |
|
|
|
List<String> timeIds = new ArrayList<>(); |
|
|
|
records.forEach(r -> { |
|
|
|
timeIds.addAll(Arrays.asList(r.getTimeId().split(","))); |
|
|
|
}); |
|
|
|
if (timeIds.retainAll(Arrays.asList(formDTO.getTimeId().split(",")))){ |
|
|
|
throw new RenException(EpmetErrorCode.APPOINTMENT_TIME_ERROR.getCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId()); |
|
|
|
if (null == staffInfo){ |
|
|
|
throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId())); |
|
|
@ -346,7 +357,24 @@ public class IcPartyServiceCenterServiceImpl extends BaseServiceImpl<IcPartyServ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<AppointmentRecordResultDTO> appointmentRecord(AppointmentRecordFormDTO formDTO) { |
|
|
|
return null; |
|
|
|
List<AppointmentRecordResultDTO> result = matterAppointmentRecordDao.appointmentRecord(formDTO.getMatterId(), formDTO.getDate()); |
|
|
|
if (CollectionUtils.isEmpty(result)){ |
|
|
|
return new ArrayList<>(); |
|
|
|
} |
|
|
|
IcPartyServiceCenterMatterEntity matter = matterService.selectById(formDTO.getMatterId()); |
|
|
|
if (null == matter){ |
|
|
|
throw new RenException("事项不存在..."); |
|
|
|
} |
|
|
|
List<TimeDTO> timeList = getTimeList(matter.getStartTime(), matter.getEndTime(), NumConstant.THIRTY); |
|
|
|
AtomicReference<Integer> sort = new AtomicReference<>(NumConstant.ONE); |
|
|
|
result.forEach(r -> { |
|
|
|
r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE)); |
|
|
|
List<String> time = new ArrayList<>(); |
|
|
|
List<String> list = Arrays.asList(r.getTimeId().split(",")); |
|
|
|
list.forEach(l -> timeList.stream().filter( t -> l.equals(t.getTimeId())).forEach(t -> time.add(t.getTime()))); |
|
|
|
r.setAppointmentTime(time); |
|
|
|
}); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
public List<TimeDTO> getTimeList(String start,String end,Integer interval){ |
|
|
|