|
@@ -1463,23 +1463,51 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
|
|
|
if ("企业开票".equals(cwFinanceImportDTO.getBillingType())){
|
|
|
for (CwWorkClientBaseDTO cwWorkClientBaseDTO : cwWorkClientBaseDTOList) {
|
|
|
if (cwWorkClientBaseDTO.getName().equals(cwFinanceImportDTO.getBillingWorkplaceReal())){
|
|
|
- cwFinanceInvoice.setBillingWorkplaceRealId(cwWorkClientBaseDTO.getClientId());
|
|
|
+ cwFinanceInvoice.setBillingWorkplaceRealId(cwWorkClientBaseDTO.getId());
|
|
|
cwFinanceInvoice.setBillingWorkplaceReal(cwWorkClientBaseDTO.getName());
|
|
|
- cwFinanceInvoice.setTaxpayerIdentificationNo(cwWorkClientBaseDTO.getUscCode());
|
|
|
- cwFinanceInvoice.setAddress(cwWorkClientBaseDTO.getAddress());
|
|
|
- cwFinanceInvoice.setTelPhone(cwWorkClientBaseDTO.getMobile());
|
|
|
+ if (StringUtils.isNotBlank(cwFinanceImportDTO.getTaxpayerIdentificationNo())){
|
|
|
+ cwFinanceInvoice.setTaxpayerIdentificationNo(cwFinanceImportDTO.getTaxpayerIdentificationNo());
|
|
|
+ }else {
|
|
|
+ cwFinanceInvoice.setTaxpayerIdentificationNo(cwWorkClientBaseDTO.getUscCode());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(cwFinanceImportDTO.getAddress())){
|
|
|
+ cwFinanceInvoice.setAddress(cwFinanceImportDTO.getAddress());
|
|
|
+ }else {
|
|
|
+ cwFinanceInvoice.setAddress(cwWorkClientBaseDTO.getAddress());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(cwFinanceImportDTO.getTelPhone())){
|
|
|
+ cwFinanceInvoice.setTelPhone(cwFinanceImportDTO.getTelPhone());
|
|
|
+ }else {
|
|
|
+ cwFinanceInvoice.setTelPhone(cwWorkClientBaseDTO.getMobile());
|
|
|
+ }
|
|
|
+
|
|
|
+ List<CwWorkClientBillingDTO> billing = cwWorkClientBaseMapper.getBilling(cwWorkClientBaseDTO.getId());
|
|
|
|
|
|
if (StringUtils.isNotBlank(cwFinanceImportDTO.getOpenBank())){
|
|
|
- List<CwWorkClientBillingDTO> billing = cwWorkClientBaseMapper.getBilling(cwWorkClientBaseDTO.getClientId());
|
|
|
if (CollectionUtils.isNotEmpty(billing)){
|
|
|
for (CwWorkClientBillingDTO cwWorkClientBillingDTO : billing) {
|
|
|
if (cwWorkClientBillingDTO.getAccountHolder().equals(cwFinanceImportDTO.getOpenBank())){
|
|
|
cwFinanceInvoice.setOpenBank(cwWorkClientBillingDTO.getAccountHolder());
|
|
|
- cwFinanceInvoice.setBankAccount(cwWorkClientBillingDTO.getAccount());
|
|
|
+ if (StringUtils.isNotBlank(cwFinanceImportDTO.getBankAccount())){
|
|
|
+ cwFinanceInvoice.setBankAccount(cwFinanceImportDTO.getBankAccount());
|
|
|
+ }else {
|
|
|
+ cwFinanceInvoice.setBankAccount(cwWorkClientBillingDTO.getAccount());
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(cwFinanceInvoice.getTelPhone())){
|
|
|
+ cwFinanceInvoice.setTelPhone(cwWorkClientBillingDTO.getPhone());
|
|
|
+ }
|
|
|
+
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }else {
|
|
|
+ if (CollectionUtils.isNotEmpty(billing)){
|
|
|
+ cwFinanceInvoice.setOpenBank(billing.get(0).getAccountHolder());
|
|
|
+ cwFinanceInvoice.setBankAccount(billing.get(0).getAccount());
|
|
|
+ cwFinanceInvoice.setTelPhone(billing.get(0).getPhone());
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
break;
|
|
@@ -1575,6 +1603,7 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
|
|
|
cwFinanceInvoice.setDelFlag(0);
|
|
|
cwFinanceInvoice.setInvalidStatus("0");
|
|
|
cwFinanceInvoice.setReceivablesStatus("0");
|
|
|
+ cwFinanceInvoice.setRedInvoiceFlag(0);
|
|
|
invoiceArrayList.add(cwFinanceInvoice);
|
|
|
|
|
|
cwFinanceInvoiceBase.setCreateById(userDTO.getId());
|