package com.ruoyi.api.controller; import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.utils.DateUtils; import com.ruoyi.cwgl.domain.KeyCollectionInfo; import com.ruoyi.cwgl.domain.RequestLog; import com.ruoyi.cwgl.domain.dto.ReturnReportDto; import com.ruoyi.cwgl.domain.dto.TakeReviewDto; import com.ruoyi.cwgl.service.IKeyCollectionInfoService; import com.ruoyi.cwgl.service.IRequestLogService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** * 储物柜接口 * @author wjw */ @RestController @RequestMapping("/api/third/locker/") public class LockerApiController { @Autowired private IKeyCollectionInfoService keyCollectionInfoService; @Autowired private IRequestLogService logService; /** * 上报取出审核 */ @PostMapping("takeReview") public AjaxResult takeReview(@RequestBody TakeReviewDto takeReviewDto){ KeyCollectionInfo keyCollectionInfo = keyCollectionInfoService.selectCwData(takeReviewDto); //添加请求日志 RequestLog requestLog = new RequestLog(); requestLog.setDriverCode(takeReviewDto.getDriverCode()); requestLog.setDriverName(takeReviewDto.getDriverName()); requestLog.setReqTime(DateUtils.parseDate(takeReviewDto.getHandleTime())); requestLog.setType(0); logService.insertRequestLog(requestLog); return keyCollectionInfoService.takeReview(keyCollectionInfo); } /** * 归还上报 */ @PostMapping("returnReport") public AjaxResult returnReport(@RequestBody ReturnReportDto returnReportDto){ //添加请求日志 RequestLog requestLog = new RequestLog(); requestLog.setDriverCode(returnReportDto.getDriverCode()); requestLog.setBoxNum(returnReportDto.getBoxNum()); requestLog.setReqTime(DateUtils.parseDate(returnReportDto.getSaveTime())); requestLog.setType(1); logService.insertRequestLog(requestLog); return AjaxResult.success(); } }