package org.springblade.qinzhesync.controller;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springblade.core.tool.api.R;
|
import org.springblade.qinzhesync.service.QinzheSyncService;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
@Slf4j
|
@RestController
|
@RequestMapping("/test/qinzhe")
|
@Tag(name = "主制分工表", description = "主制分工表")
|
public class SyncController {
|
|
@Autowired
|
private QinzheSyncService service;
|
|
/**
|
* 新增
|
*/
|
@GetMapping("/sync")
|
@Operation(summary = "同步", description = "同步分工表")
|
public R<Boolean> sync() {
|
try {
|
service.syncData();
|
}catch (Exception e) {
|
log.error("同步失败", e);;
|
return R.fail(e.getMessage());
|
}
|
return R.<Boolean>status(true);
|
}
|
|
@GetMapping("/exists")
|
@Operation(summary = "图号存在判断", description = "图号存在判断")
|
public R<Boolean> exists(String drawingNo) {
|
try {
|
return R.data(service.drawingNoExists(drawingNo));
|
}catch (Exception e) {
|
log.error("exist失败", e);;
|
return R.fail(e.getMessage());
|
}
|
|
}
|
}
|