소스 검색

发票同步到ccpm

sangwenwei 5 달 전
부모
커밋
48b81a92db

+ 6 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/ccpm/controller/Transport.java

@@ -26,6 +26,12 @@ public class Transport {
         return cwFinanceInvoiceService.detailDistribute(id, processDefKey);
     }
 
+    //查询所有的发票信息
+    @RequestMapping(value = "FinanceList", method = RequestMethod.POST)
+    public Object FinanceList() {
+        return cwFinanceInvoiceService.findListNew();
+    }
+
 
     /**
      * 审核分发操作

+ 2 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/mapper/CwFinanceInvoiceMapper.java

@@ -45,6 +45,8 @@ public interface CwFinanceInvoiceMapper extends BaseMapper<CwFinanceInvoice> {
     void updateInfoById(CwFinanceInvoice cwFinanceInvoice);
     @InterceptorIgnore(tenantLine = "true")
     CwFinanceInvoiceDTO queryByProcId(@Param("id")String id);
+    @InterceptorIgnore(tenantLine = "true")
+    List<CwFinanceInvoiceDTO> findListNew();
 }
 
 

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

@@ -307,6 +307,28 @@
         where fi.del_flag = '0' and fi.id = #{id}
     </select>
 
+    <select id="findListNew" resultMap="BaseResultMap">
+        select
+        DISTINCT
+        <include refid="Base_Column_List"></include>,
+        su.name as reconciliationPeopleName,
+        su1.name as billingPeopleRealName,
+        rpl.report_no,
+        sa.name as reconciliationAreaName,
+        sua.name as createByName
+        from cw_finance_invoice fi
+        left join cw_finance_invoice_base fib on fib.invoice_id = fi.id
+        left join cw_project_report_new_line rpl on fib.program_id=rpl.report_id
+        left join sys_user su on fi.reconciliation_people = su.id
+        left join sys_user sua on fi.create_by_id = sua.id
+        left join sys_user su1 on fi.billing_people_real = su1.id
+        left join cw_project_records pr on fib.program_id=pr.id
+        left join sys_area sa on fi.reconciliation_area = sa.id
+        where fi.del_flag = '0'
+        ORDER BY
+        fi.create_time DESC
+    </select>
+
     <select id="queryByProcId" resultMap="BaseResultMap">
         select
         DISTINCT

+ 40 - 0
jeeplus-modules/jeeplus-finance/src/main/java/com/jeeplus/finance/invoice/service/CwFinanceInvoiceService.java

@@ -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;
+    }
 }