|
|
|
@ -6,9 +6,11 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
|
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.controller.admin.bankslip.vo.*;
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.controller.admin.invoices.vo.InvoicesUpdateArray;
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.convert.bankslip.BankSlipConvert;
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.dal.dataobject.bankslip.BankReceiptDO;
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.dal.dataobject.bankslip.BankSlipDO;
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.dal.dataobject.invoices.InvoicesDO;
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.service.bankslip.BankSlipService;
|
|
|
|
|
import cn.iocoder.yudao.module.bs.utils.BaiduOcrHandler;
|
|
|
|
|
import cn.iocoder.yudao.module.infra.service.file.FileService;
|
|
|
|
@ -27,9 +29,7 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
import javax.validation.Valid;
|
|
|
|
|
import java.io.DataInput;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.Collection;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.UUID;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.error;
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
|
@ -63,6 +63,23 @@ public class BankSlipController {
|
|
|
|
|
return success(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@PutMapping("/update/array")
|
|
|
|
|
@Operation(summary = "更新发票")
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('archives::bank-slip:update')")
|
|
|
|
|
public CommonResult<Boolean> updateInvoicesArray(@Valid @RequestBody BankSlipUpdateArray updateArray) {
|
|
|
|
|
List<BankSlipDO> list = new LinkedList<>();
|
|
|
|
|
List<BankSlipDO> invoicesList = bankSlipService.getBankSlipList(Arrays.asList(updateArray.getId()));
|
|
|
|
|
for (BankSlipDO in : invoicesList) {
|
|
|
|
|
if (in.getVoucherId() !=null){
|
|
|
|
|
return error(in.getVoucherId()+":该回单已被关联");
|
|
|
|
|
}
|
|
|
|
|
in.setVoucherId(updateArray.getVoucherId());
|
|
|
|
|
list.add(in);
|
|
|
|
|
}
|
|
|
|
|
bankSlipService.updateBankSlipArray(list);
|
|
|
|
|
return success(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@DeleteMapping("/delete")
|
|
|
|
|
@Operation(summary = "删除银行回单")
|
|
|
|
|
@Parameter(name = "id", description = "编号", required = true)
|
|
|
|
|