|
@@ -280,13 +280,20 @@ public class OwnBillController extends BaseController {
|
|
|
@PostMapping("/getInvoiceText")
|
|
|
public R getInvoiceText(@RequestParam("file")MultipartFile file, @RequestParam("zbiId") String zbiId) {
|
|
|
if(CommonUtil.isEmpty(zbiId)){
|
|
|
- R.fail(500,"未获取到要上传发票的账款");
|
|
|
+ return R.fail(500,"未获取到要上传发票的账款");
|
|
|
+ }
|
|
|
+ long size = file.getSize();
|
|
|
+ if(size > 2097152L){
|
|
|
+ return R.fail(500,"上传文件大小不能超过2mb");
|
|
|
}
|
|
|
//获取登录用户
|
|
|
LoginUser user = tokenService.getLoginUser();
|
|
|
String companyId = user.getSysUser().getCompanyId();
|
|
|
//获取发票信息
|
|
|
ZcInvoiceInf zcInvoiceInf = iOwnBillService.getInvoice(file);
|
|
|
+ if(zcInvoiceInf == null){
|
|
|
+ return R.fail(500,"未识别发票信息");
|
|
|
+ }
|
|
|
LambdaQueryWrapper<ZcInvoiceInf> queryWrapper = new LambdaQueryWrapper<>();
|
|
|
//发票代码
|
|
|
queryWrapper.eq(ZcInvoiceInf::getZiiNo,zcInvoiceInf.getZiiNo());
|