|
@@ -22,6 +22,10 @@ import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceDTO;
|
|
import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceDetailDTO;
|
|
import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceDetailDTO;
|
|
import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceReceivablesDTO;
|
|
import com.jeeplus.test.cw.invoice.service.dto.CwFinanceInvoiceReceivablesDTO;
|
|
import com.jeeplus.test.cw.invoice.service.mapstruct.*;
|
|
import com.jeeplus.test.cw.invoice.service.mapstruct.*;
|
|
|
|
+import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBase;
|
|
|
|
+import com.jeeplus.test.cw.workClientInfo.domain.CwWorkClientBilling;
|
|
|
|
+import com.jeeplus.test.cw.workClientInfo.service.CwWorkClientBillingService;
|
|
|
|
+import com.jeeplus.test.cw.workClientInfo.service.CwWorkClientService;
|
|
import com.jeeplus.test.mould.service.SerialnumTplService;
|
|
import com.jeeplus.test.mould.service.SerialnumTplService;
|
|
import com.jeeplus.test.oss.mapper.OssServiceMapper;
|
|
import com.jeeplus.test.oss.mapper.OssServiceMapper;
|
|
import com.jeeplus.test.oss.service.OssService;
|
|
import com.jeeplus.test.oss.service.OssService;
|
|
@@ -61,6 +65,10 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
|
|
private UserService userService;
|
|
private UserService userService;
|
|
@Resource
|
|
@Resource
|
|
private OssService ossService;
|
|
private OssService ossService;
|
|
|
|
+ @Resource
|
|
|
|
+ private CwWorkClientBillingService cwWorkClientBillingService;
|
|
|
|
+ @Resource
|
|
|
|
+ private CwWorkClientService cwWorkClientService;
|
|
|
|
|
|
public List<String> getSearchList(ArrayList<String> searchIdList, List<String> ids) {
|
|
public List<String> getSearchList(ArrayList<String> searchIdList, List<String> ids) {
|
|
List<String> newSearchIdList = searchIdList.stream().filter(item -> {
|
|
List<String> newSearchIdList = searchIdList.stream().filter(item -> {
|
|
@@ -278,6 +286,31 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
|
|
|
|
|
|
CwFinanceInvoiceDTO cwFinanceInvoiceDTO = cwFinanceInvoiceMapper.queryById(id);
|
|
CwFinanceInvoiceDTO cwFinanceInvoiceDTO = cwFinanceInvoiceMapper.queryById(id);
|
|
|
|
|
|
|
|
+ // 电话号获取
|
|
|
|
+ if (ObjectUtil.isNotEmpty(cwFinanceInvoiceDTO) && StringUtils.isNotBlank(cwFinanceInvoiceDTO.getBillingId())) {
|
|
|
|
+ CwWorkClientBilling cwWorkClientBilling = cwWorkClientBillingService.getById(cwFinanceInvoiceDTO.getBillingId());
|
|
|
|
+ if (ObjectUtil.isNotEmpty(cwWorkClientBilling) && StringUtils.isNotBlank(cwWorkClientBilling.getPhone())) {
|
|
|
|
+ // 如果通过billingId(开票信息id)可以查询到数据,并且数据的phone(电话)有值的话,那么就将方法返回结果的telPhone替换为查询到的phone
|
|
|
|
+ cwFinanceInvoiceDTO.setTelPhone(cwWorkClientBilling.getPhone());
|
|
|
|
+ } else {
|
|
|
|
+ // 如果通过billingId(开票信息id)查询不到数据或者查询到数据的phone值为空
|
|
|
|
+ // 将billingId(开票信息id)置空,因为前端根据billingId是否有值来判断->是否允许电话号码可以手填
|
|
|
|
+ cwFinanceInvoiceDTO.setBillingId("");
|
|
|
|
+ // 将telPhone(电话号)置空
|
|
|
|
+// cwFinanceInvoiceDTO.setTelPhone("");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 实际开票单位名称获取
|
|
|
|
+ if (ObjectUtil.isNotEmpty(cwFinanceInvoiceDTO) && StringUtils.isNotBlank(cwFinanceInvoiceDTO.getBillingWorkplaceRealId())) {
|
|
|
|
+ CwWorkClientBase cwWorkClientBase = cwWorkClientService.getById(cwFinanceInvoiceDTO.getBillingWorkplaceRealId());
|
|
|
|
+ if (ObjectUtil.isNotEmpty(cwWorkClientBase) && StringUtils.isNotBlank(cwWorkClientBase.getName())) {
|
|
|
|
+ // 如果通过billingWorkplaceRealId(实际开票单位id)可以查询到数据,并且数据的name(实际开票单位名称)有值的话,
|
|
|
|
+ // 那么就将方法返回结果的billingWorkplaceReal替换
|
|
|
|
+ cwFinanceInvoiceDTO.setBillingWorkplaceReal(cwWorkClientBase.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
return cwFinanceInvoiceDTO;
|
|
return cwFinanceInvoiceDTO;
|
|
}
|
|
}
|
|
|
|
|