|
@@ -826,4 +826,44 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ public Object findListNew() {
|
|
|
+ List<CwFinanceInvoiceDTO> financeInvoiceDTOS = cwFinanceInvoiceMapper.findListNew();
|
|
|
+ if (CollectionUtil.isNotEmpty(financeInvoiceDTOS)){
|
|
|
+ for (CwFinanceInvoiceDTO financeInvoiceDTO : financeInvoiceDTOS) {
|
|
|
+
|
|
|
+ String label = SpringUtil.getBean(IDictApi.class).getDictLabel(financeInvoiceDTO.getReceivablesType(), "invoice_receivables_type", "");
|
|
|
+ financeInvoiceDTO.setReceivablesTypeLabel(label);
|
|
|
+ String contentLabel = SpringUtil.getBean(IDictApi.class).getDictLabel(financeInvoiceDTO.getBillingContent(), "invoice_billing_content", "");
|
|
|
+ financeInvoiceDTO.setBillingContentLabel(contentLabel);
|
|
|
+ // 电话号获取
|
|
|
+ if (ObjectUtil.isNotEmpty(financeInvoiceDTO) && StringUtils.isNotBlank(financeInvoiceDTO.getBillingId())) {
|
|
|
+ CwWorkClientBilling cwWorkClientBilling = cwWorkClientBillingService.getById(financeInvoiceDTO.getBillingId());
|
|
|
+ if (ObjectUtil.isNotEmpty(cwWorkClientBilling) && StringUtils.isNotBlank(cwWorkClientBilling.getPhone())) {
|
|
|
+ // 如果通过billingId(开票信息id)可以查询到数据,并且数据的phone(电话)有值的话,那么就将方法返回结果的telPhone替换为查询到的phone
|
|
|
+ financeInvoiceDTO.setTelPhone(cwWorkClientBilling.getPhone());
|
|
|
+ } else {
|
|
|
+ // 如果通过billingId(开票信息id)查询不到数据或者查询到数据的phone值为空
|
|
|
+ // 将billingId(开票信息id)置空,因为前端根据billingId是否有值来判断->是否允许电话号码可以手填
|
|
|
+ financeInvoiceDTO.setBillingId("");
|
|
|
+ // 将telPhone(电话号)置空
|
|
|
+// cwFinanceInvoiceDTO.setTelPhone("");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 实际开票单位名称获取
|
|
|
+ if (ObjectUtil.isNotEmpty(financeInvoiceDTO) && StringUtils.isNotBlank(financeInvoiceDTO.getBillingWorkplaceRealId())) {
|
|
|
+ CwWorkClientBase cwWorkClientBase = cwWorkClientService.getById(financeInvoiceDTO.getBillingWorkplaceRealId());
|
|
|
+ if (ObjectUtil.isNotEmpty(cwWorkClientBase) && StringUtils.isNotBlank(cwWorkClientBase.getName())) {
|
|
|
+ // 如果通过billingWorkplaceRealId(实际开票单位id)可以查询到数据,并且数据的name(实际开票单位名称)有值的话,
|
|
|
+ // 那么就将方法返回结果的billingWorkplaceReal替换
|
|
|
+ financeInvoiceDTO.setBillingWorkplaceReal(cwWorkClientBase.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return financeInvoiceDTOS;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|