|
|
@@ -302,7 +302,21 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
|
|
|
if (StringUtils.isNotBlank(financeInvoiceDTO.getBillingType())){
|
|
|
queryWrapper.eq("fi.billing_type",financeInvoiceDTO.getBillingType());
|
|
|
}
|
|
|
-
|
|
|
+ //是否手动开票
|
|
|
+ if (StringUtils.isNotBlank(financeInvoiceDTO.getIsOmsBilling())) {
|
|
|
+ String isOmsBilling = financeInvoiceDTO.getIsOmsBilling();
|
|
|
+ if ("1".equals(isOmsBilling)) {
|
|
|
+ // 当值为0时,匹配is_oms_billing = 0 或者 is_oms_billing 为空
|
|
|
+ queryWrapper.and(wrapper -> wrapper
|
|
|
+ .eq("fi.is_oms_billing", "1")
|
|
|
+ .or()
|
|
|
+ .isNull("fi.is_oms_billing") // 匹配数据库null值
|
|
|
+ .or()
|
|
|
+ .eq("fi.is_oms_billing", "")); // 匹配数据库空字符串
|
|
|
+ } else {
|
|
|
+ queryWrapper.eq("fi.is_oms_billing", isOmsBilling);
|
|
|
+ }
|
|
|
+ }
|
|
|
IPage<FinanceInvoiceDTO> pageList = financeInvoiceMapper.findList(page, queryWrapper);
|
|
|
pageList.getRecords().stream().forEach(item ->{
|
|
|
// 发票申请
|
|
|
@@ -335,11 +349,13 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
|
|
|
}
|
|
|
|
|
|
List<WorkAttachmentInfo> omsInvoiceFileList = SpringUtil.getBean(IWorkAttachmentApi.class).getByAttachmentIdListAndFlag(idList);
|
|
|
- for (FinanceInvoiceDTO invoice : pageList.getRecords()) {
|
|
|
- for (WorkAttachmentInfo workattachment : omsInvoiceFileList) {
|
|
|
- if(invoice.getId().equals(workattachment.getAttachmentId())){
|
|
|
- invoice.setOmsAttachmentUrl(workattachment.getUrl());
|
|
|
- break;
|
|
|
+ if(CollectionUtil.isNotEmpty(omsInvoiceFileList)){
|
|
|
+ for (FinanceInvoiceDTO invoice : pageList.getRecords()) {
|
|
|
+ for (WorkAttachmentInfo workattachment : omsInvoiceFileList) {
|
|
|
+ if(invoice.getId().equals(workattachment.getAttachmentId())){
|
|
|
+ invoice.setOmsAttachmentUrl(workattachment.getUrl());
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -437,10 +453,13 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
|
|
|
public String saveForm(FinanceInvoiceDTO financeInvoiceDTO) throws Exception{
|
|
|
String isOms = "0";
|
|
|
if("5".equals(financeInvoiceDTO.getStatus())){
|
|
|
- isOms = handleDoInvoice(financeInvoiceDTO);
|
|
|
- //如果需要走开票系统,则设置状态为12
|
|
|
- if("1".equals(isOms) || "2".equals(isOms)){
|
|
|
- financeInvoiceDTO.setStatus("12");
|
|
|
+ //IsOmsBilling为0时,需要走系统开票
|
|
|
+ if("0".equals(financeInvoiceDTO.getIsOmsBilling())){
|
|
|
+ isOms = handleDoInvoice(financeInvoiceDTO);
|
|
|
+ //如果需要走开票系统,则设置状态为12
|
|
|
+ if("1".equals(isOms) || "2".equals(isOms)){
|
|
|
+ financeInvoiceDTO.setStatus("12");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
FinanceInvoice financeInvoice = FinanceInvoiceWrapper.INSTANCE.toEntity(financeInvoiceDTO);
|
|
|
@@ -456,6 +475,9 @@ public class FinanceInvoiceService extends ServiceImpl<FinanceInvoiceMapper, Fin
|
|
|
if(StringUtils.isNotBlank(financeInvoiceDTO.getIsSmsNotice())){
|
|
|
financeInvoice.setIsSmsNotice(financeInvoiceDTO.getIsSmsNotice());
|
|
|
}
|
|
|
+ if(StringUtils.isNotBlank(financeInvoiceDTO.getIsOmsBilling())){
|
|
|
+ financeInvoice.setIsOmsBilling(financeInvoiceDTO.getIsOmsBilling());
|
|
|
+ }
|
|
|
if (ObjectUtil.isNotEmpty(financeInvoice)) {
|
|
|
if(StringUtils.isBlank(financeInvoice.getId())){
|
|
|
//获取当前登录人信息
|