|
|
|
@ -7,6 +7,7 @@ import com.shxy.xymanager_common.bean.ServiceBody;
|
|
|
|
|
import com.shxy.xymanager_common.bean.ServiceStatus;
|
|
|
|
|
import com.shxy.xymanager_common.entity.CameraSchedule;
|
|
|
|
|
import com.shxy.xymanager_common.excel.PhotoStatExcel;
|
|
|
|
|
import com.shxy.xymanager_common.exception.ApiException;
|
|
|
|
|
import com.shxy.xymanager_common.model.*;
|
|
|
|
|
import com.shxy.xymanager_common.util.DateUtil;
|
|
|
|
|
import com.shxy.xymanager_common.util.EasyExcelUtil;
|
|
|
|
@ -32,6 +33,8 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Api(value = "图片接口", tags = "图片接口相关")
|
|
|
|
|
@RestController
|
|
|
|
@ -98,17 +101,27 @@ public class TerminalPhotoController extends BaseController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HashMap<Integer, String> workingMap = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "主动拍照下发状态查询", notes = "主动拍照下发状态查询接口", httpMethod = "POST")
|
|
|
|
|
@ApiResponses({@ApiResponse(code = 200, message = "请求成功"), @ApiResponse(code = 400, message = "请求参数没填好"), @ApiResponse(code = 404, message = "请求路径没有或页面跳转路径不对")})
|
|
|
|
|
@RequestMapping("/getTakePicStatus")
|
|
|
|
|
@Log(title = "主动拍照下发状态查询", type = "查询")
|
|
|
|
|
public ResponseReult<TakePIcStatusModel> getTakePicStatus(@Validated ReturnedPhotoVo vo) {
|
|
|
|
|
ServiceBody<TakePIcStatusModel> serviceBody = terminalPhotoService.getTakePicStatus(vo);
|
|
|
|
|
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
|
|
|
|
|
return ResponseReult.success(serviceBody.getData());
|
|
|
|
|
} else {
|
|
|
|
|
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
|
|
|
|
|
try{
|
|
|
|
|
if (workingMap.containsKey(vo.getRequestid())){
|
|
|
|
|
throw new ApiException("相同请求正在处理中, 请刷新页面更新");
|
|
|
|
|
}
|
|
|
|
|
workingMap.put(vo.getRequestid(), "1");
|
|
|
|
|
ServiceBody<TakePIcStatusModel> serviceBody = terminalPhotoService.getTakePicStatus(vo);
|
|
|
|
|
if (serviceBody.getCode() == ServiceStatus.SUCCESS) {
|
|
|
|
|
return ResponseReult.success(serviceBody.getData());
|
|
|
|
|
} else {
|
|
|
|
|
return ResponseReult.error(serviceBody.getCode(), serviceBody.getMsg());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
finally {
|
|
|
|
|
workingMap.remove(vo.getRequestid());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|