权限修改,app相关接口修改
This commit is contained in:
@@ -90,6 +90,7 @@ public class AjaxResult extends HashMap<String, Object>
|
|||||||
return AjaxResult.success(msg, null);
|
return AjaxResult.success(msg, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 返回成功消息
|
* 返回成功消息
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public AjaxResult getImageBase64(String path) {
|
|||||||
// 返回base64数据,格式为 data:image/xxx;base64,xxxxx
|
// 返回base64数据,格式为 data:image/xxx;base64,xxxxx
|
||||||
String result = "data:" + mimeType + ";base64," + base64String;
|
String result = "data:" + mimeType + ";base64," + base64String;
|
||||||
|
|
||||||
return AjaxResult.success(result);
|
return AjaxResult.success("操作成功",result);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return AjaxResult.error("读取图片失败: " + e.getMessage());
|
return AjaxResult.error("读取图片失败: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ import org.springframework.web.bind.annotation.PostMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
//文字识别
|
//文字识别
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/ocr")
|
@RequestMapping("/ocr")
|
||||||
@@ -20,11 +22,29 @@ public class OrcController {
|
|||||||
return AjaxResult.error("路径不能为空");
|
return AjaxResult.error("路径不能为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
OcrRecognizeUtil ocrRecognizeUtil = new OcrRecognizeUtil();
|
OcrRecognizeUtil ocrRecognizeUtil = new OcrRecognizeUtil();
|
||||||
// 移除 /profile
|
// 移除 /profile
|
||||||
path = path.replace("/profile", "");
|
path = path.replace("/profile", "");
|
||||||
path = RuoYiConfig.getProfile() + path;
|
path = RuoYiConfig.getProfile() + path;
|
||||||
|
|
||||||
|
// 验证文件是否存在
|
||||||
|
File file = new File(path);
|
||||||
|
if (!file.exists()) {
|
||||||
|
return AjaxResult.error("文件不存在: " + path);
|
||||||
|
}
|
||||||
|
if (!file.isFile()) {
|
||||||
|
return AjaxResult.error("路径不是一个有效文件: " + path);
|
||||||
|
}
|
||||||
|
if (!file.canRead()) {
|
||||||
|
return AjaxResult.error("无权限读取文件: " + path);
|
||||||
|
}
|
||||||
|
|
||||||
String recognize = ocrRecognizeUtil.recognizeTwo(path);
|
String recognize = ocrRecognizeUtil.recognizeTwo(path);
|
||||||
return AjaxResult.success(recognize);
|
return AjaxResult.success("操作成功", recognize);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return AjaxResult.error("OCR识别失败: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class DdFsController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 查询冻精库存列表
|
* 查询冻精库存列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('sperm:sperm:list')")
|
@PreAuthorize("@ss.hasPermi('frozen:sperm:list')")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public TableDataInfo list(DdFs ddFs)
|
public TableDataInfo list(DdFs ddFs)
|
||||||
{
|
{
|
||||||
@@ -49,7 +49,7 @@ public class DdFsController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 导出冻精库存列表
|
* 导出冻精库存列表
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('sperm:sperm:export')")
|
@PreAuthorize("@ss.hasPermi('frozen:sperm:export')")
|
||||||
@Log(title = "冻精库存", businessType = BusinessType.EXPORT)
|
@Log(title = "冻精库存", businessType = BusinessType.EXPORT)
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(HttpServletResponse response, DdFs ddFs)
|
public void export(HttpServletResponse response, DdFs ddFs)
|
||||||
@@ -62,7 +62,7 @@ public class DdFsController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 获取冻精库存详细信息
|
* 获取冻精库存详细信息
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('sperm:sperm:query')")
|
@PreAuthorize("@ss.hasPermi('frozen:sperm:query')")
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
{
|
{
|
||||||
@@ -72,7 +72,7 @@ public class DdFsController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 新增冻精库存
|
* 新增冻精库存
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('sperm:sperm:add')")
|
@PreAuthorize("@ss.hasPermi('frozen:sperm:add')")
|
||||||
@Log(title = "冻精库存", businessType = BusinessType.INSERT)
|
@Log(title = "冻精库存", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody DdFs ddFs)
|
public AjaxResult add(@RequestBody DdFs ddFs)
|
||||||
@@ -83,7 +83,7 @@ public class DdFsController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 修改冻精库存
|
* 修改冻精库存
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('sperm:sperm:edit')")
|
@PreAuthorize("@ss.hasPermi('frozen:sperm:edit')")
|
||||||
@Log(title = "冻精库存", businessType = BusinessType.UPDATE)
|
@Log(title = "冻精库存", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult edit(@RequestBody DdFs ddFs)
|
public AjaxResult edit(@RequestBody DdFs ddFs)
|
||||||
@@ -94,7 +94,7 @@ public class DdFsController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 删除冻精库存
|
* 删除冻精库存
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('sperm:sperm:remove')")
|
@PreAuthorize("@ss.hasPermi('frozen:sperm:remove')")
|
||||||
@Log(title = "冻精库存", businessType = BusinessType.DELETE)
|
@Log(title = "冻精库存", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
public AjaxResult remove(@PathVariable Long[] ids)
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
@@ -105,7 +105,7 @@ public class DdFsController extends BaseController
|
|||||||
/**
|
/**
|
||||||
* 批量废弃
|
* 批量废弃
|
||||||
*/
|
*/
|
||||||
@PreAuthorize("@ss.hasPermi('sperm:sperm:discard')")
|
@PreAuthorize("@ss.hasPermi('frozen:sperm:discard')")
|
||||||
@Log(title = "冻精库存", businessType = BusinessType.UPDATE)
|
@Log(title = "冻精库存", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/discard")
|
@PutMapping("/discard")
|
||||||
public AjaxResult discard(@RequestBody List<DdFs> list) {
|
public AjaxResult discard(@RequestBody List<DdFs> list) {
|
||||||
|
|||||||
Reference in New Issue
Block a user