归档会计凭证同时改变完整性

new
JiilingLee 1 year ago
parent 2b3506f455
commit 1c8fb4e740

@ -148,49 +148,58 @@ public class VoucherController {
List<VoucherDO> list = pageResult.getList();
for (VoucherDO voucherDO:list
) {
String remark=" ";
Long id = voucherDO.getId();
AttachmentExportReqVO attachmentExportReqVO = new AttachmentExportReqVO();
attachmentExportReqVO.setVoucherId(id);
List<AttachmentDO> attachmentList = attachmentService.getAttachmentList(attachmentExportReqVO);
if (attachmentList.size()<1){
remark=remark+"缺少附件";
//如果未归档才检查完整性
if(!voucherDO.getFileStatus().equals(AccountingStatusEnum.LOGFILE.getValue())) {
String remark = " ";
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(Integer.valueOf(AccountingStatusEnum.INCOMPLETE.getValue()));
} else {
voucherDO.setCherks(Integer.valueOf(AccountingStatusEnum.COMPLETE.getValue()));
}
VoucherUpdateReqVO voucherUpdateReqVO = new VoucherUpdateReqVO();
voucherUpdateReqVO.setId(id);
voucherUpdateReqVO.setCherks(voucherDO.getCherks());
voucherUpdateReqVO.setRemark(remark);
voucherService.updateVoucher(voucherUpdateReqVO);
}else {
i++;
VoucherUpdateReqVO voucherUpdateReqVO = new VoucherUpdateReqVO();
voucherUpdateReqVO.setId(voucherDO.getId());
voucherUpdateReqVO.setCherks(Integer.valueOf(AccountingStatusEnum.COMPLETE.getValue()));
voucherUpdateReqVO.setRemark("");
voucherService.updateVoucher(voucherUpdateReqVO);
}
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);
}

@ -223,7 +223,8 @@ public class RecordServiceImpl implements RecordService {
VoucherDO voucherDO = new VoucherDO();
voucherDO.setId(id);
voucherDO.setRecordId(recordId);
voucherDO.setFileStatus(AccountingStatusEnum.LOGFILE.getValue());
voucherDO.setFileStatus(AccountingStatusEnum.COMPLETE.getValue());
voucherDO.setCherks(Integer.valueOf(AccountingStatusEnum.LOGFILE.getValue()));
voucherMapper.updateById(voucherDO);
}
}

Loading…
Cancel
Save