| | |
| | | private CheckTypeMapper checkTypeMapper; |
| | | |
| | | @Override |
| | | public void initQueueSequenceTable() { |
| | | queueSequenceMapper.clearQueueSequenceTableNotCurrent(); |
| | | Integer rowCount = queueSequenceMapper.getQueueSequenceTableRowCount(); |
| | | if (null == rowCount || 0 == rowCount) { |
| | | resetQueueSequence(); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Integer createQueueSequence(QueueSequenceSaveReqVO createReqVO) { |
| | | // 插入 |
| | | QueueSequenceDO queueSequence = BeanUtils.toBean(createReqVO, QueueSequenceDO.class); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<QueueSequenceDO> selectGivenCheckTypeTimeslot(Integer checkType) { |
| | | return queueSequenceMapper.selectTimeslotByCheckType( checkType ); |
| | | } |
| | | |
| | | @Override |
| | | public PageResult<QueueSequenceDO> getQueueSequencePage(QueueSequencePageReqVO pageReqVO) { |
| | | return queueSequenceMapper.selectPage(pageReqVO); |
| | | } |
| | |
| | | }); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Integer distributeSeqNo(Integer checkType, Integer timeslot) { |
| | | Integer curSeqNo = queueSequenceMapper.selectQueueNoForUpdate(checkType, timeslot); |
| | | if (null == curSeqNo) { |
| | | throw exception(QUEUE_SEQUENCE_TIMESLOT_FULL); |
| | | } |
| | | |
| | | Integer updateRowNum = queueSequenceMapper.updateGivenCheckTypeTimeslotSeqNo(checkType, timeslot, curSeqNo); |
| | | if (null == updateRowNum || updateRowNum == 0) { |
| | | throw exception(QUEUE_SEQUENCE_TIMESLOT_EXCEPTION); |
| | | } |
| | | |
| | | return curSeqNo + 1; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public Integer distributeVipSeqNo(Integer checkType, Integer timeslot) { |
| | | Integer curVipSeqNo = queueSequenceMapper.selectQueueVipNoForUpdate(checkType, timeslot); |
| | | if (null == curVipSeqNo) { |
| | | throw exception(QUEUE_SEQUENCE_TIMESLOT_FULL); |
| | | } |
| | | |
| | | Integer updateRowNum = queueSequenceMapper.updateGivenCheckTypeTimeslotVipSeqNo(checkType, timeslot, curVipSeqNo); |
| | | if (null == updateRowNum || updateRowNum == 0) { |
| | | throw exception(QUEUE_SEQUENCE_TIMESLOT_EXCEPTION); |
| | | } |
| | | |
| | | return curVipSeqNo + 1; |
| | | } |
| | | |
| | | } |
| | | |