| | |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.utils.DateUtils; |
| | | import com.ruoyi.common.utils.RandomUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.cwgl.domain.KeyCollectionInfo; |
| | | import com.ruoyi.cwgl.domain.RequestLog; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.Random; |
| | | import java.util.concurrent.ThreadLocalRandom; |
| | | |
| | | |
| | | /** |
| | |
| | | public AjaxResult takeReview(@Valid @RequestBody TakeReviewDto takeReviewDto){ |
| | | |
| | | logger.info("请求上报参数{}",takeReviewDto); |
| | | if ("test".equals(takeReviewDto.getDriverCode())){ |
| | | Random random = new Random(); |
| | | |
| | | // 生成 1-30 的随机整数 |
| | | int randomNumber = random.nextInt(30) + 1; |
| | | AjaxResult success = new AjaxResult(0, "成功",1); |
| | | success.put("boxNumber",randomNumber); |
| | | logger.info("成功返回{}",success); |
| | | return success; |
| | | } |
| | | |
| | | KeyCollectionInfo keyCollectionInfo = keyCollectionInfoService.selectCwData(takeReviewDto); |
| | | //添加请求日志 |
| | | RequestLog requestLog = new RequestLog(); |
| | |
| | | requestLog.setType(0); |
| | | logService.insertRequestLog(requestLog); |
| | | |
| | | return keyCollectionInfoService.takeReview(keyCollectionInfo); |
| | | AjaxResult ajaxResult = keyCollectionInfoService.takeReview(keyCollectionInfo); |
| | | if (!ajaxResult.get("code").equals(0)){ |
| | | ajaxResult = keyCollectionInfoService.selectSmartLockerApplication(takeReviewDto); |
| | | |
| | | } |
| | | return ajaxResult; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @PostMapping("/returnReport") |
| | | public AjaxResult returnReport(@Valid @RequestBody ReturnReportDto returnReportDto){ |
| | | logger.info("归还参数{}",returnReportDto); |
| | | |
| | | //添加请求日志 |
| | | RequestLog requestLog = new RequestLog(); |