ocr 数签子
登录更新了用户名称的问题 更新用户信息的问题
This commit is contained in:
@@ -5,6 +5,7 @@ import cn.hutool.core.util.URLUtil;
|
||||
import com.czg.log.annotation.OperationLog;
|
||||
import com.czg.product.dto.ConsStockFlowDTO;
|
||||
import com.czg.product.dto.OcrDTO;
|
||||
import com.czg.product.entity.MkOcrService;
|
||||
import com.czg.product.param.ConsCheckStockParam;
|
||||
import com.czg.product.param.ConsInOutStockHeadParam;
|
||||
import com.czg.product.param.ConsReportDamageParam;
|
||||
@@ -37,6 +38,8 @@ public class ConsStockFlowController {
|
||||
|
||||
@Resource
|
||||
private ConsStockFlowService consStockFlowService;
|
||||
@Resource
|
||||
private MkOcrService ocrService;
|
||||
|
||||
/**
|
||||
* 入库单识别
|
||||
@@ -46,17 +49,18 @@ public class ConsStockFlowController {
|
||||
URI uri = new URI(ocrDTO.getUrl());
|
||||
URL url = uri.toURL();
|
||||
InputStream stream = URLUtil.getStream(url);
|
||||
return CzgResult.success(consStockFlowService.ocr(FileUtil.getName(ocrDTO.getUrl()), stream));
|
||||
return CzgResult.success(ocrService.ocr(FileUtil.getName(ocrDTO.getUrl()), stream, "cons"));
|
||||
}
|
||||
|
||||
/**
|
||||
* ocr识别结果
|
||||
*
|
||||
* @param id ocrId
|
||||
* @return 识别结果
|
||||
*/
|
||||
@GetMapping("/ocrResult")
|
||||
public CzgResult<ConsInOutStockHeadParam> ocrResult(@RequestParam Long id) {
|
||||
return CzgResult.success(consStockFlowService.ocrDetail(id));
|
||||
return CzgResult.success(ocrService.ocrDetail(id));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.product.service.MkOcrCountStickService;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
|
||||
/**
|
||||
* 拍照数签子
|
||||
* @author ww
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/stick")
|
||||
public class StickCountController {
|
||||
|
||||
@Resource
|
||||
private MkOcrCountStickService stickCountService;
|
||||
|
||||
/**
|
||||
* 文件上传并返回点数统计结果
|
||||
*
|
||||
* @param file 上传的图片文件
|
||||
* @return 点数统计结果
|
||||
*/
|
||||
@PostMapping("/count")
|
||||
public CzgResult<Integer> uploadAndCount(MultipartFile file) throws IOException {
|
||||
AssertUtil.isNull(file, "上传文件不能为空");
|
||||
// 9. 返回成功结果
|
||||
return CzgResult.success(stickCountService.getCountStick(file.getBytes(), file.getOriginalFilename()));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user