Parcourir la source

会计-调整发票列表查询逻辑,可查询无项目关联数据的发票记录

huangguoce il y a 4 jours
Parent
commit
06caeb9168

+ 4 - 4
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/xml/CwFinanceInvoiceMapper.xml

@@ -335,8 +335,8 @@
         a.program_id,
         pr.is_pre_invoice as isPreInvoice,
         a.type as 'recordType'
-        from cw_finance_invoice_base a
-        left join cw_finance_invoice fi on a.invoice_id = fi.id
+        from  cw_finance_invoice fi
+        left join cw_finance_invoice_base a  on a.invoice_id = fi.id
         left join cw_finance_invoice_detail cfid on cfid.invoice_id = fi.id and cfid.del_flag = '0'
         left join sys_user su on fi.create_by_id = su.id and su.del_flag = '0'
         left join sys_user su1 on fi.reconciliation_people = su1.id and su1.del_flag = '0'
@@ -403,8 +403,8 @@
         when a.type = '2' then (select rpr.is_pre_invoice from cw_project_records rpr where id = (select project_id from cw_project_report where id = a.program_id))
         when a.type = '4' then (select pr.is_pre_invoice from cw_project_records pr where pr.id = a.program_id)
         else '' end ) as isPreInvoice
-        from cw_finance_invoice_base a
-        left join cw_finance_invoice fi on a.invoice_id = fi.id
+        from cw_finance_invoice fi
+        left join cw_finance_invoice_base a  on a.invoice_id = fi.id
         left join cw_finance_invoice_detail cfid on cfid.invoice_id = fi.id and cfid.del_flag = '0'
         left join sys_user su on fi.create_by_id = su.id and su.del_flag = '0'
         left join sys_user_manage_office sumo on sumo.office_id = su.office_id

+ 6 - 1
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/CwFinanceInvoiceService.java

@@ -127,7 +127,12 @@ public class CwFinanceInvoiceService extends ServiceImpl<CwFinanceInvoiceMapper,
     public IPage<CwFinanceInvoiceDTO> findList(Page<CwFinanceInvoiceDTO> page, CwFinanceInvoiceDTO cwFinanceInvoiceDTO, String export) throws Exception {
         QueryWrapper<CwFinanceInvoice> queryWrapper = QueryWrapperGenerator.buildQueryCondition(CwFinanceInvoiceWrapper.INSTANCE.toEntity(cwFinanceInvoiceDTO), CwFinanceInvoice.class);
         queryWrapper.eq("fi.del_flag", "0");
-        queryWrapper.eq("a.del_flag", "0");
+        //queryWrapper.eq("a.del_flag", "0");
+        queryWrapper.and(wrapper ->
+                wrapper.isNull("a.id")
+                        .or()
+                        .eq("a.del_flag", 0)
+        );
         ArrayList<String> searchIdList = new ArrayList<>();
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
         AtomicInteger checkNum = new AtomicInteger();