|
@@ -211,8 +211,14 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, InvoiceDO> im
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param generateContractVO
|
|
|
+ * @return
|
|
|
+ */
|
|
|
@Override
|
|
|
public String generateContract(GenerateContractVO generateContractVO) {
|
|
|
+ String operateType = generateContractVO.getOperateType();
|
|
|
List<InvoiceDO> list = null;
|
|
|
String signingDate = "";
|
|
|
if("1".equals(generateContractVO.getType())) {
|
|
@@ -304,19 +310,25 @@ public class InvoiceServiceImpl extends ServiceImpl<InvoiceMapper, InvoiceDO> im
|
|
|
invoiceContract.setInvoiceIds(invoiceIds.stream().map(String::valueOf).collect(Collectors.joining(",")));
|
|
|
invoiceContract.setGeneratedTime(LocalDateTime.now());
|
|
|
invoiceContract.setStatus("0");
|
|
|
- invoiceContractService.save(invoiceContract);
|
|
|
- invoiceContractService.generateContractFile(invoiceContract,invoiceList);
|
|
|
- invoiceContractService.updateById(invoiceContract);
|
|
|
- for(InvoiceDO invoice : invoiceList){
|
|
|
- InvoiceDO invoiceDO = new InvoiceDO();
|
|
|
- invoiceDO.setId(invoice.getId());
|
|
|
- invoiceDO.setStatus("1");
|
|
|
- invoiceDO.setContractNo(invoiceContract.getContractNo());
|
|
|
- invoiceDO.setContractId(invoiceContract.getId());
|
|
|
- invoiceDO.setContractGeneratedTime(LocalDateTime.now());
|
|
|
- updateById(invoiceDO);
|
|
|
+ if("1".equals(operateType)){
|
|
|
+ invoiceContractService.save(invoiceContract);
|
|
|
+ }
|
|
|
+ invoiceContractService.generateContractFile(invoiceContract,invoiceList,operateType);
|
|
|
+ if("1".equals(operateType)){
|
|
|
+ invoiceContractService.updateById(invoiceContract);
|
|
|
+ for(InvoiceDO invoice : invoiceList){
|
|
|
+ InvoiceDO invoiceDO = new InvoiceDO();
|
|
|
+ invoiceDO.setId(invoice.getId());
|
|
|
+ invoiceDO.setStatus("1");
|
|
|
+ invoiceDO.setContractNo(invoiceContract.getContractNo());
|
|
|
+ invoiceDO.setContractId(invoiceContract.getId());
|
|
|
+ invoiceDO.setContractGeneratedTime(LocalDateTime.now());
|
|
|
+ updateById(invoiceDO);
|
|
|
+ }
|
|
|
+ invoiceStatusPush(invoiceList,"1");
|
|
|
+ }else{
|
|
|
+ return invoiceContract.getContractHtml();
|
|
|
}
|
|
|
- invoiceStatusPush(invoiceList,"1");
|
|
|
}
|
|
|
}
|
|
|
|