| | |
| | | package com.ruoyi.cwgl.service.impl; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.cwgl.domain.RequestLog; |
| | | import com.ruoyi.cwgl.domain.dto.TakeReviewDto; |
| | | import com.ruoyi.cwgl.service.IRequestLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.scheduling.annotation.Async; |
| | |
| | | protected final Logger logger = LoggerFactory.getLogger(getClass()); |
| | | @Resource |
| | | private KeyCollectionInfoMapper keyCollectionInfoMapper; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | { |
| | | return keyCollectionInfoMapper.deleteKeyCollectionInfoById(id); |
| | | } |
| | | |
| | | @DataSource(DataSourceType.CWSJ) |
| | | @Override |
| | | public KeyCollectionInfo selectCwData(TakeReviewDto takeReviewDto) { |
| | | return keyCollectionInfoMapper.selectCwData(takeReviewDto); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult takeReview(KeyCollectionInfo keyCollectionInfo) { |
| | | if (keyCollectionInfo == null) { |
| | | return AjaxResult.error("查无符合要求的调度单,请联系调度人员",3); |
| | | } |
| | | keyCollectionInfoMapper.insertKeyCollectionInfo(keyCollectionInfo); |
| | | |
| | | |
| | | //调度超时 |
| | | Integer schedulingTimeout = keyCollectionInfo.getSchedulingTimeout(); |
| | | if(schedulingTimeout>5){ |
| | | return AjaxResult.error("调度超时下单,超时"+schedulingTimeout+"个小时",3); |
| | | |
| | | } |
| | | Integer keyTimeout = keyCollectionInfo.getKeyTimeout(); |
| | | if (keyTimeout!=null && keyTimeout>24){ |
| | | Date estimatedDepartureTime = keyCollectionInfo.getEstimatedDepartureTime(); |
| | | String dateToStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, estimatedDepartureTime); |
| | | return AjaxResult.error("预计出发时间"+ dateToStr+",领取钥匙超时"+keyTimeout+"个小时"); |
| | | } |
| | | return AjaxResult.success("成功",2); |
| | | } |
| | | } |