|
|
@ -1,5 +1,18 @@
|
|
|
|
package cn.iocoder.yudao.module.accounting.controller.admin.voucher;
|
|
|
|
package cn.iocoder.yudao.module.accounting.controller.admin.voucher;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.controller.admin.attachment.vo.AttachmentCreateReqVO;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.controller.admin.attachment.vo.AttachmentExportReqVO;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.controller.admin.bankslip.vo.BankSlipExportReqVO;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.controller.admin.flow.vo.FlowExportReqVO;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.controller.admin.invoices.vo.InvoicesExportReqVO;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.dal.dataobject.attachment.AttachmentDO;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.dal.dataobject.bankslip.BankSlipDO;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.dal.dataobject.flow.FlowDO;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.dal.dataobject.invoices.InvoicesDO;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.service.attachment.AttachmentService;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.service.bankslip.BankSlipService;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.service.flow.FlowService;
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.accounting.service.invoices.InvoicesService;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
@ -38,6 +51,15 @@ public class VoucherController {
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private VoucherService voucherService;
|
|
|
|
private VoucherService voucherService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AttachmentService attachmentService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private BankSlipService bankSlipService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private InvoicesService invoicesService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private FlowService flowService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/create")
|
|
|
|
@PostMapping("/create")
|
|
|
|
@Operation(summary = "创建会计凭证")
|
|
|
|
@Operation(summary = "创建会计凭证")
|
|
|
@ -92,7 +114,59 @@ public class VoucherController {
|
|
|
|
@PreAuthorize("@ss.hasPermission('accounting:voucher:query')")
|
|
|
|
@PreAuthorize("@ss.hasPermission('accounting:voucher:query')")
|
|
|
|
public CommonResult<PageResult<VoucherRespVO>> getVoucherPage(@Valid VoucherPageReqVO pageVO) {
|
|
|
|
public CommonResult<PageResult<VoucherRespVO>> getVoucherPage(@Valid VoucherPageReqVO pageVO) {
|
|
|
|
PageResult<VoucherDO> pageResult = voucherService.getVoucherPage(pageVO);
|
|
|
|
PageResult<VoucherDO> pageResult = voucherService.getVoucherPage(pageVO);
|
|
|
|
return success(VoucherConvert.INSTANCE.convertPage(pageResult));
|
|
|
|
int i=0;
|
|
|
|
|
|
|
|
String remark="";
|
|
|
|
|
|
|
|
//完整性检查
|
|
|
|
|
|
|
|
List<VoucherDO> list = pageResult.getList();
|
|
|
|
|
|
|
|
for (VoucherDO voucherDO:list
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
Long id = voucherDO.getId();
|
|
|
|
|
|
|
|
AttachmentExportReqVO attachmentExportReqVO = new AttachmentExportReqVO();
|
|
|
|
|
|
|
|
attachmentExportReqVO.setVoucherId(id);
|
|
|
|
|
|
|
|
List<AttachmentDO> attachmentList = attachmentService.getAttachmentList(attachmentExportReqVO);
|
|
|
|
|
|
|
|
if (attachmentList.size()<1){
|
|
|
|
|
|
|
|
remark=remark+"缺少附件";
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
FlowExportReqVO flowExportReqVO = new FlowExportReqVO();
|
|
|
|
|
|
|
|
flowExportReqVO.setVoucherId(id);
|
|
|
|
|
|
|
|
List<FlowDO> flowList = flowService.getFlowList(flowExportReqVO);
|
|
|
|
|
|
|
|
if (flowList.size()<1){
|
|
|
|
|
|
|
|
remark=remark+";缺少审批流程";
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
InvoicesExportReqVO invoicesExportReqVO = new InvoicesExportReqVO().setVoucherId(id);
|
|
|
|
|
|
|
|
List<InvoicesDO> invoicesList = invoicesService.getInvoicesList(invoicesExportReqVO);
|
|
|
|
|
|
|
|
if (invoicesList.size()<1){
|
|
|
|
|
|
|
|
remark=remark+";缺少电子发票";
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
BankSlipExportReqVO bankSlipExportReqVO = new BankSlipExportReqVO();
|
|
|
|
|
|
|
|
bankSlipExportReqVO.setVoucherId(id);
|
|
|
|
|
|
|
|
List<BankSlipDO> bankSlipList = bankSlipService.getBankSlipList(bankSlipExportReqVO);
|
|
|
|
|
|
|
|
if (bankSlipList.size()<1){
|
|
|
|
|
|
|
|
remark=remark+";缺少银行回单";
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
i++;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if(i!=4){
|
|
|
|
|
|
|
|
voucherDO.setCherks(0);
|
|
|
|
|
|
|
|
}else {
|
|
|
|
|
|
|
|
voucherDO.setCherks(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
VoucherUpdateReqVO voucherUpdateReqVO = new VoucherUpdateReqVO();
|
|
|
|
|
|
|
|
voucherUpdateReqVO.setId(id);
|
|
|
|
|
|
|
|
voucherUpdateReqVO.setCherks(voucherDO.getCherks());
|
|
|
|
|
|
|
|
voucherUpdateReqVO.setRemark(remark);
|
|
|
|
|
|
|
|
voucherService.updateVoucher(voucherUpdateReqVO);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PageResult<VoucherDO> pageResult2 = voucherService.getVoucherPage(pageVO);
|
|
|
|
|
|
|
|
return success(VoucherConvert.INSTANCE.convertPage(pageResult2));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/export-excel")
|
|
|
|
@GetMapping("/export-excel")
|
|
|
|