| | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.cwgl.domain.RequestLog; |
| | | import com.ruoyi.cwgl.domain.SmartLockerApplication; |
| | | import com.ruoyi.cwgl.domain.dto.TakeReviewDto; |
| | | import com.ruoyi.cwgl.mapper.SmartLockerApplicationMapper; |
| | | import com.ruoyi.cwgl.service.IRequestLogService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | protected final Logger logger = LoggerFactory.getLogger(getClass()); |
| | | @Resource |
| | | private KeyCollectionInfoMapper keyCollectionInfoMapper; |
| | | @Resource |
| | | private SmartLockerApplicationMapper smartLockerApplicationMapper; |
| | | |
| | | |
| | | |
| | |
| | | //调度超时 |
| | | Integer schedulingTimeout = keyCollectionInfo.getSchedulingTimeout(); |
| | | if(schedulingTimeout>5){ |
| | | logger.info("调度超时下单,超时"+schedulingTimeout+"个小时"); |
| | | return AjaxResult.error("调度超时下单,超时"+schedulingTimeout+"个小时",3); |
| | | |
| | | } |
| | |
| | | if (keyTimeout!=null && keyTimeout>24){ |
| | | Date estimatedDepartureTime = keyCollectionInfo.getEstimatedDepartureTime(); |
| | | String dateToStr = DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, estimatedDepartureTime); |
| | | logger.info("要求出发时间"+ dateToStr+",领取钥匙超时"+keyTimeout+"个小时"); |
| | | return AjaxResult.error("要求出发时间"+ dateToStr+",领取钥匙超时"+keyTimeout+"个小时"); |
| | | } |
| | | AjaxResult success = new AjaxResult(0, "成功",2); |
| | | success.put("boxNum",keyCollectionInfo.getBoxNum()); |
| | | AjaxResult success = new AjaxResult(0, "成功",1); |
| | | success.put("boxNumber",keyCollectionInfo.getBoxNum()); |
| | | logger.info("成功返回{}",success); |
| | | return success; |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult selectSmartLockerApplication(TakeReviewDto takeReviewDto) { |
| | | SmartLockerApplication smartLockerApplication =smartLockerApplicationMapper.selectSmartLockerApplication(takeReviewDto); |
| | | if (smartLockerApplication == null){ |
| | | return AjaxResult.error("查无符合要求的调度单,请联系调度人员",3); |
| | | } |
| | | smartLockerApplication.setStatus(2); |
| | | smartLockerApplication.setReceiveTime(new Date()); |
| | | smartLockerApplicationMapper.updateSmartLockerApplication(smartLockerApplication); |
| | | AjaxResult success = new AjaxResult(0, "成功",1); |
| | | success.put("boxNumber",smartLockerApplication.getLockerPort()); |
| | | logger.info("成功返回{}",success); |
| | | return success; |
| | | } |
| | | } |