|
|
|
@ -52,7 +52,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
@Api(tags="ocr_任务包")
|
|
|
|
|
@RestController
|
|
|
|
|
@RequestMapping("/ocr/ocrPackagetask")
|
|
|
|
|
public class OcrPackagetaskController extends BaseController{
|
|
|
|
@ -69,13 +68,13 @@ public class OcrPackagetaskController extends BaseController{
|
|
|
|
|
private UserTokenService userTokenService;
|
|
|
|
|
@Resource
|
|
|
|
|
private UserService userService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private XiaoyaoConfig xiaoyaoConfig;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private FtperrorService ftperrorService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 分页列表查询
|
|
|
|
|
*
|
|
|
|
@ -94,7 +93,7 @@ public class OcrPackagetaskController extends BaseController{
|
|
|
|
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
|
|
|
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
|
|
|
|
HttpServletRequest request) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//租户主键,由前端页面传送
|
|
|
|
|
String tenantId = request.getHeader("X-Tenant-Id");
|
|
|
|
|
if(StringUtils.isBlank(tenantId)){
|
|
|
|
@ -104,7 +103,7 @@ public class OcrPackagetaskController extends BaseController{
|
|
|
|
|
|
|
|
|
|
//获取当前登录人
|
|
|
|
|
UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QueryWrapper<OcrPackagetask> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.eq("tenant_id",tenantId);
|
|
|
|
|
if(StringUtils.isNotBlank(packageName)){
|
|
|
|
@ -171,17 +170,17 @@ public class OcrPackagetaskController extends BaseController{
|
|
|
|
|
@RequestParam(value = "file", required = true) MultipartFile imgfile) throws IOException{
|
|
|
|
|
|
|
|
|
|
String filepat = SystemConstantsOa.OCR_IMG_UP_PATH;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//上传参考图
|
|
|
|
|
if (null != imgfile && !imgfile.isEmpty()) {
|
|
|
|
|
//获得文件后缀
|
|
|
|
|
String fileType = org.apache.commons.io.FilenameUtils.getExtension(imgfile.getOriginalFilename());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> allowedExtensions = Arrays.asList("jpg", "jpeg", "png", "gif"); // 允许上传的文件类型列表
|
|
|
|
|
if (!allowedExtensions.contains(fileType.toLowerCase())) {
|
|
|
|
|
return ResultVoUtil.error("不支持的文件类型.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//重新命名
|
|
|
|
|
String fileName = System.currentTimeMillis() + "_c." + fileType;
|
|
|
|
|
ResultVo rs = UploadSpringUtil.springUpload(imgfile, xiaoyaoConfig,filepat, fileName,ftperrorService);
|
|
|
|
@ -191,94 +190,7 @@ public class OcrPackagetaskController extends BaseController{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ResultVoUtil.error();
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
// /**
|
|
|
|
|
// * 任务包详情
|
|
|
|
|
// *
|
|
|
|
|
// * @param ocrPackagetask
|
|
|
|
|
// * @return
|
|
|
|
|
// */
|
|
|
|
|
// //@AutoLog(value = "ocr_packagetask-分页列表查询")
|
|
|
|
|
// @ApiOperation(value="ocr_任务包详情", notes="ocr_任务包详情")
|
|
|
|
|
// @ApiImplicitParams({
|
|
|
|
|
// @ApiImplicitParam(paramType = "header", name = "X-Tenant-Id", value = "租户主键,用户登录时的信息“tenantList”中获得。", dataType = "String", required = true),
|
|
|
|
|
// @ApiImplicitParam(paramType = "path",name = "packageid", value = "任务包主键", required = true)
|
|
|
|
|
// })
|
|
|
|
|
// @GetMapping(value = "/listorderbytask")
|
|
|
|
|
// public ResultVo<List<OcrPicture>> listorderbytask(OcrPackagetask ocrPackagetask,
|
|
|
|
|
// @RequestParam(name="packageid") String packageid,
|
|
|
|
|
// HttpServletRequest request) {
|
|
|
|
|
// //租户主键,由前端页面传送
|
|
|
|
|
// String tenantId = request.getHeader("X-Tenant-Id");
|
|
|
|
|
// if(StringUtils.isBlank(tenantId)){
|
|
|
|
|
// return ResultVoUtil.error("租户主键不能为空");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// //获取当前登录人
|
|
|
|
|
// UserToken userToken = this.userTokenService.getUserToken(RequestBaseUtil.getToken(request));
|
|
|
|
|
//
|
|
|
|
|
// List<OcrPicture> pageList = ocrPictureService.listByTaskChild(tenantId,userToken.getLoginname(),null,null,packageid);
|
|
|
|
|
//
|
|
|
|
|
// return ResultVoUtil.success(pageList);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// /**
|
|
|
|
|
// * 工单主图真假标记
|
|
|
|
|
// *
|
|
|
|
|
// * @param req
|
|
|
|
|
// * @return
|
|
|
|
|
// */
|
|
|
|
|
// @ApiOperation(value="工单主图真假标记", notes="工单主图真假标记")
|
|
|
|
|
// @ApiImplicitParams({
|
|
|
|
|
// @ApiImplicitParam(paramType = "path",name = "childpictureid", value = "工单主键", required = true),
|
|
|
|
|
// @ApiImplicitParam(paramType = "path",name = "izTrueorfalse", value = "主图片真假0:假,1:真", required = true),
|
|
|
|
|
// @ApiImplicitParam(paramType = "path",name = "judgeid", value = "主图判真假原因id,从字典表中获得", required = true),
|
|
|
|
|
// @ApiImplicitParam(paramType = "path",name = "packageid", value = "任务包主键", required = true)
|
|
|
|
|
// })
|
|
|
|
|
// @PostMapping(value = "/ordertrueorfalse")
|
|
|
|
|
// public ResultVo ordertrueorfalse(@RequestParam(name="childpictureid",required=true) String childpictureid,
|
|
|
|
|
// @RequestParam(name="izTrueorfalse",required=true) String izTrueorfalse,
|
|
|
|
|
// @RequestParam(name="judgeid",required=true) String judgeid,
|
|
|
|
|
// @RequestParam(name="packageid",required=true) String packageid,
|
|
|
|
|
// HttpServletRequest req) {
|
|
|
|
|
// //TODO 如果是历史图片,允许进行设置
|
|
|
|
|
// //TODO 如果是已经审批完成的图片不允许是指
|
|
|
|
|
//
|
|
|
|
|
// OcrTaskchildPicture ocrTaskchildPicture = new OcrTaskchildPicture();
|
|
|
|
|
//// ocrTaskchildPicture.setIztrueorfalse(izTrueorfalse);
|
|
|
|
|
//// ocrTaskchildPicture.setJudgeid(judgeid);
|
|
|
|
|
// ocrTaskchildPicture.setPackageid(Long.parseLong(packageid));
|
|
|
|
|
//
|
|
|
|
|
// return ocrTaskchildPictureService.trueorfalse(childpictureid,ocrTaskchildPicture)?ResultVoUtil.success():ResultVoUtil.error("失败。");
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// /**
|
|
|
|
|
// * 工单查重图是否合格标记
|
|
|
|
|
// *
|
|
|
|
|
// * @param req
|
|
|
|
|
// * @return
|
|
|
|
|
// */
|
|
|
|
|
// @ApiOperation(value="工单查重图是否合格标记", notes="工单查重图是否合格标记")
|
|
|
|
|
// @ApiImplicitParams({
|
|
|
|
|
// @ApiImplicitParam(paramType = "path",name = "childpictureid", value = "工单主键", required = true),
|
|
|
|
|
// @ApiImplicitParam(paramType = "path",name = "izPass", value = "主图片是否合格0:否,1:是", required = true),
|
|
|
|
|
// @ApiImplicitParam(paramType = "path",name = "judgePassid", value = "主图判是否合格原因id,从字典表中获得", required = true),
|
|
|
|
|
// @ApiImplicitParam(paramType = "path",name = "packageid", value = "任务包主键", required = true)
|
|
|
|
|
// })
|
|
|
|
|
// @PostMapping(value = "/orderpass")
|
|
|
|
|
// public ResultVo<List<OcrPicture>> orderpass(@RequestParam(name="childpictureid",required=true) String childpictureid,
|
|
|
|
|
// @RequestParam(name="izPass",required=true) String izPass,
|
|
|
|
|
// @RequestParam(name="judgePassid",required=true) String judgePassid,
|
|
|
|
|
// @RequestParam(name="packageid",required=true) String packageid,
|
|
|
|
|
// HttpServletRequest req) {
|
|
|
|
|
// OcrTaskchildPicture ocrTaskchildPicture = new OcrTaskchildPicture();
|
|
|
|
|
//// ocrTaskchildPicture.setIzpass(izPass);
|
|
|
|
|
//// ocrTaskchildPicture.setJudgepass(Long.parseLong(judgePassid));
|
|
|
|
|
// ocrTaskchildPicture.setPackageid(Long.parseLong(packageid));
|
|
|
|
|
// return ocrTaskchildPictureService.pass(childpictureid,ocrTaskchildPicture)?ResultVoUtil.success():ResultVoUtil.error("失败。");
|
|
|
|
|
// }
|
|
|
|
|
}
|
|
|
|
|