Procházet zdrojové kódy

首页统计修改

dudm před 3 roky
rodič
revize
344f3b2927

+ 71 - 8
sc-service/src/main/java/com/huyi/service/bill/controller/OwnBillController.java

@@ -240,8 +240,23 @@ public class OwnBillController extends BaseController {
         if(fileList.size() == 0){
             return R.fail(500,"往来账款发票数据不能为空,请上传发票后重试");
         }
+        //购方
+        SysCompany payer = iSysCompanyService.getById(zbiPayerId);
+        //购方社会统一代码
+        String payerNo = payer.getScySocialCode();
+        //销方
+        SysCompany payee = iSysCompanyService.getById(zbiPayeeId);
+        //销方社会统一代码
+        String payeeNo = payee.getScySocialCode();
         //校验发票
         for (Map<String,String> file : fileList) {
+            //购方识别号
+            String ziiPurchaserNo = CommonUtil.objToString(file.get("ziiPurchaserNo"));
+            //销方识别号
+            String ziiSellerNo = CommonUtil.objToString(file.get("ziiSellerNo"));
+            if(!payerNo.equals(ziiPurchaserNo) || !payeeNo.equals(ziiSellerNo)){
+                return R.fail(500, "发票购销方不符合账款信息,不可进行账款关联");
+            }
             //开票日期
             String ziiDate = CommonUtil.objToString(file.get("ziiDate"));
             Date ziiDateParse = sdf.parse(ziiDate);
@@ -743,9 +758,11 @@ public class OwnBillController extends BaseController {
                 //发票代码
                 relQueryWrapper.eq(ZcBillInvoiceRel::getZbirInvoiceId,list.get(0).getZiiId());
                 List<ZcBillInvoiceRel> relList = iZcBillInvoiceRelService.findZcBillInvoiceRels(relQueryWrapper);
-                //查询往来账款名称返回前台展示
-                ZcBillInf zcBillInf = iZcBillInfService.getById(relList.get(0).getZbirBillId());
-                map.put("zbiName",zcBillInf.getZbiName());
+                if(relList.size() != 0){
+                    //查询往来账款名称返回前台展示
+                    ZcBillInf zcBillInf = iZcBillInfService.getById(relList.get(0).getZbirBillId());
+                    map.put("zbiName",zcBillInf.getZbiName());
+                }
             }
         }
 
@@ -754,14 +771,58 @@ public class OwnBillController extends BaseController {
     }
 
     /**
+     * 判重
+     *
+     * @param map    发票信息列表
+     * @return
+     */
+    @SneakyThrows
+    @PostMapping("/queryDouble")
+    public Map queryDouble(@RequestBody Map map) {
+        LambdaQueryWrapper<ZcInvoiceInf> queryWrapper = new LambdaQueryWrapper<>();
+        //发票代码
+        String ziiNo = CommonUtil.objToString(map.get("ziiNo"));
+        //发票号码
+        String ziiNumber = CommonUtil.objToString(map.get("ziiNumber"));
+        //校验状态
+        String ziiCheckStt = CommonUtil.objToString(map.get("ziiCheckStt"));
+        //发票id
+        String ziiId = CommonUtil.objToString(map.get("ziiId"));
+        if(!CommonUtil.isEmpty(ziiId)){
+            queryWrapper.ne(ZcInvoiceInf::getZiiId,ziiId);
+        }
+        queryWrapper.eq(ZcInvoiceInf::getZiiNo,ziiNo);
+        //发票号码
+        queryWrapper.eq(ZcInvoiceInf::getZiiNumber,ziiNumber);
+        //发票状态
+        queryWrapper.eq(ZcInvoiceInf::getZiiStatus,"00");
+        List<ZcInvoiceInf> list = iZcInvoiceInfService.findZcInvoiceInfs(queryWrapper);
+        if(list.size() == 0){
+                //没有重复改为未验证
+            map.put("ziiCheckStt","0");
+        }else{
+            map.put("ziiCheckStt","3");
+            //如果是重复状态查询关联往来账款
+            LambdaQueryWrapper<ZcBillInvoiceRel> relQueryWrapper = new LambdaQueryWrapper<>();
+            //发票代码
+            relQueryWrapper.eq(ZcBillInvoiceRel::getZbirInvoiceId,list.get(0).getZiiId());
+            List<ZcBillInvoiceRel> relList = iZcBillInvoiceRelService.findZcBillInvoiceRels(relQueryWrapper);
+            if(relList.size() != 0) {
+                //查询往来账款名称返回前台展示
+                ZcBillInf zcBillInf = iZcBillInfService.getById(relList.get(0).getZbirBillId());
+                map.put("zbiName", zcBillInf.getZbiName());
+            }
+        }
+        return map;
+    }
+
+    /**
      * 重新验真
      *
      * @param fileList    发票信息列表
      * @return
      */
     @SneakyThrows
-    @Transactional(rollbackFor=Exception.class)
-    @Log(title = "往来账款发票验真", businessType = BusinessType.UPDATE)
     @PostMapping("/invoiceVerification")
     public List invoiceVerification(@RequestParam(required = false,value = "fileList") String fileList) {
         JSONArray jsonArray = JSONArray.parseArray(fileList);
@@ -819,9 +880,11 @@ public class OwnBillController extends BaseController {
                     //发票代码
                     relQueryWrapper.eq(ZcBillInvoiceRel::getZbirInvoiceId,list.get(0).getZiiId());
                     List<ZcBillInvoiceRel> relList = iZcBillInvoiceRelService.findZcBillInvoiceRels(relQueryWrapper);
-                    //查询往来账款名称返回前台展示
-                    ZcBillInf zcBillInf = iZcBillInfService.getById(relList.get(0).getZbirBillId());
-                    params.put("zbiName",zcBillInf.getZbiName());
+                    if(relList.size() != 0) {
+                        //查询往来账款名称返回前台展示
+                        ZcBillInf zcBillInf = iZcBillInfService.getById(relList.get(0).getZbirBillId());
+                        params.put("zbiName", zcBillInf.getZbiName());
+                    }
                 }
             }
             zcInvoiceInfs.add(params);

+ 140 - 85
sc-service/src/main/java/com/huyi/service/common/report/controller/ReportCreditController.java

@@ -185,7 +185,7 @@ public class ReportCreditController extends BaseController {
     }
 
     /**
-     * 企业已放款额度
+     * 企业已融资(已放款额度
      * @return
      */
     @GetMapping("/getLoanBalance")
@@ -223,7 +223,45 @@ public class ReportCreditController extends BaseController {
     }
 
     /**
-     * 企业已还款额度
+     * 企业已失效(到期失效)额度
+     * @return
+     */
+    @GetMapping("/getLoseEffectBalance")
+    public AjaxResult getLoseEffectBalance(String zfpType)
+    {
+        //获取当前企业的编号
+        LoginUser userInfo = tokenService.getLoginUser();
+        SysUser use = userInfo.getSysUser();
+        Map<String,String> map = new HashMap<>();
+        //获取企业
+        String companyId = use.getCompanyId();
+        //默认反向
+        if(CommonUtil.isEmpty(zfpType)){
+            zfpType = "1";
+        }
+        //获取企业类型
+        String type = use.getCompanyType();
+        if(COMPANYTYPE_CORE.equals(type)){
+            //核心企业
+            map.put("coreCompanyId", companyId);
+            map.put("zfpType", zfpType);
+        }else if(COMPANYTYPE_SUPPLIER.equals(type)){
+            //供应商
+            map.put("supplierCompanyId", companyId);
+            map.put("zfpType", zfpType);
+        }else if(COMPANYTYPE_MANAGEMENT.equals(type)){
+            //资金方
+            map.put("managementCompanyId", companyId);
+            map.put("zfpType", zfpType);
+        }
+        String allAmount =  reportCreditService.getLoseEffectBalance(map);
+        Map m = new HashMap();
+        m.put("allAmount",allAmount);
+        return AjaxResult.success(m);
+    }
+
+    /**
+     * 企业已还款(到期失效)额度
      * @return
      */
     @GetMapping("/getReturnBalance")
@@ -261,6 +299,89 @@ public class ReportCreditController extends BaseController {
     }
 
     /**
+     * 企业总融资额度
+     * @return
+     */
+    @GetMapping("/getFinancedBalance")
+    public AjaxResult getFinancedBalance(String zfpType)
+    {
+        //获取当前企业的编号
+        LoginUser userInfo = tokenService.getLoginUser();
+        SysUser use = userInfo.getSysUser();
+        Map<String,String> map = new HashMap<>();
+        //获取企业
+        String companyId = use.getCompanyId();
+        //默认反向
+        if(CommonUtil.isEmpty(zfpType)){
+            zfpType = "1";
+        }
+        //获取企业类型
+        String type = use.getCompanyType();
+        if(COMPANYTYPE_CORE.equals(type)){
+            //核心企业
+            map.put("coreCompanyId", companyId);
+            map.put("zfpType", zfpType);
+        }else if(COMPANYTYPE_SUPPLIER.equals(type)){
+            //供应商
+            map.put("supplierCompanyId", companyId);
+            map.put("zfpType", zfpType);
+        }else if(COMPANYTYPE_MANAGEMENT.equals(type)){
+            //资金方
+            map.put("managementCompanyId", companyId);
+            map.put("zfpType", zfpType);
+        }
+        String allAmount =  reportCreditService.getFinancedBalance(map);
+        Map m = new HashMap();
+        m.put("allAmount",allAmount);
+        return AjaxResult.success(m);
+    }
+
+    /**
+     * 企业融信30天到期额度
+     * @return
+     */
+    @GetMapping("/getExpiredBalance")
+    public AjaxResult getExpiredBalance(String zfpType)
+    {
+        //获取当前企业的编号
+        LoginUser userInfo = tokenService.getLoginUser();
+        SysUser use = userInfo.getSysUser();
+        Map<String,String> map = new HashMap<>();
+        //获取企业
+        String companyId = use.getCompanyId();
+        //获取企业类型
+        String type = use.getCompanyType();
+        //开始时间 当天
+        String startDate = DateUtils.dateTimeNow("yyyy-MM-dd");
+        //结束时间 30后
+        String endDate = DateUtils.getFetureDate(30);
+        map.put("startDate",startDate);
+        map.put("endDate",endDate);
+        //默认反向
+        if(CommonUtil.isEmpty(zfpType)){
+            zfpType = "1";
+        }
+        if(COMPANYTYPE_CORE.equals(type)){
+            //核心企业
+            map.put("zfpType",zfpType);
+            map.put("coreCompanyId", companyId);
+        }else if(COMPANYTYPE_SUPPLIER.equals(type)){
+            //供应商
+            map.put("zfpType",zfpType);
+            map.put("supplierCompanyId", companyId);
+        }else if(COMPANYTYPE_MANAGEMENT.equals(type)){
+            //资金方
+            map.put("zfpType",zfpType);
+            map.put("managementCompanyId", companyId);
+        }
+        //融信额度
+        String allAmount =  reportCreditService.getExpiredBalance(map);
+        Map m = new HashMap();
+        m.put("allAmount",allAmount);
+        return AjaxResult.success(m);
+    }
+
+    /**
      * 查询平台资金 -- 饼图
      * @return
      */
@@ -283,7 +404,7 @@ public class ReportCreditController extends BaseController {
         String allAmount =  reportCreditService.getCreditLineAll(map);
         //融资中额度
         String availableAmount =  reportCreditService.getAvailableBalance(map);
-        //生效额度
+        //生效额度
         String effectBalance =  reportCreditService.getEffectBalance(map);
         //已放款额度
         String loanBalance =  reportCreditService.getLoanBalance(map);
@@ -298,7 +419,7 @@ public class ReportCreditController extends BaseController {
         list.add(availableMap);
         //生效中额度图形对象
         Map effectMap = new HashMap();
-        effectMap.put("name","生效额度");
+        effectMap.put("name","生效额度");
         effectMap.put("value",effectBalance);
         list.add(effectMap);
         //已放款额度图形对象
@@ -344,7 +465,7 @@ public class ReportCreditController extends BaseController {
             map.put("coreCompanyId", coreCompanyId);
             //融资中额度
             String availableAmount =  reportCreditService.getAvailableBalance(map);
-            //生效额度
+            //生效额度
             String effectBalance =  reportCreditService.getEffectBalance(map);
             //已放款额度
             String loanBalance =  reportCreditService.getLoanBalance(map);
@@ -377,82 +498,6 @@ public class ReportCreditController extends BaseController {
     }
 
     /**
-     * 企业已融资额度
-     * @return
-     */
-    @GetMapping("/getFinancedBalance")
-    public AjaxResult getFinancedBalance()
-    {
-        //获取当前企业的编号
-        LoginUser userInfo = tokenService.getLoginUser();
-        SysUser use = userInfo.getSysUser();
-        Map<String,String> map = new HashMap<>();
-        //获取企业
-        String companyId = use.getCompanyId();
-        //获取企业类型
-        String type = use.getCompanyType();
-        if(COMPANYTYPE_CORE.equals(type)){
-            //核心企业
-            map.put("coreCompanyId", companyId);
-        }else if(COMPANYTYPE_SUPPLIER.equals(type)){
-            //供应商
-            map.put("supplierCompanyId", companyId);
-        }else if(COMPANYTYPE_MANAGEMENT.equals(type)){
-            //资金方
-            map.put("managementCompanyId", companyId);
-        }
-        String allAmount =  reportCreditService.getFinancedBalance(map);
-        Map m = new HashMap();
-        m.put("allAmount",allAmount);
-        return AjaxResult.success(m);
-    }
-
-    /**
-     * 企业融信30天到期额度
-     * @return
-     */
-    @GetMapping("/getExpiredBalance")
-    public AjaxResult getExpiredBalance(String zfpType)
-    {
-        //获取当前企业的编号
-        LoginUser userInfo = tokenService.getLoginUser();
-        SysUser use = userInfo.getSysUser();
-        Map<String,String> map = new HashMap<>();
-        //获取企业
-        String companyId = use.getCompanyId();
-        //获取企业类型
-        String type = use.getCompanyType();
-        //开始时间 当天
-        String startDate = DateUtils.dateTimeNow("yyyy-MM-dd");
-        //结束时间 30后
-        String endDate = DateUtils.getFetureDate(30);
-        map.put("startDate",startDate);
-        map.put("endDate",endDate);
-        //默认反向
-        if(CommonUtil.isEmpty(zfpType)){
-            zfpType = "1";
-        }
-        if(COMPANYTYPE_CORE.equals(type)){
-            //核心企业
-            map.put("zfpType",zfpType);
-            map.put("coreCompanyId", companyId);
-        }else if(COMPANYTYPE_SUPPLIER.equals(type)){
-            //供应商
-            map.put("zfpType",zfpType);
-            map.put("supplierCompanyId", companyId);
-        }else if(COMPANYTYPE_MANAGEMENT.equals(type)){
-            //资金方
-            map.put("zfpType",zfpType);
-            map.put("managementCompanyId", companyId);
-        }
-        //融信额度
-        String allAmount =  reportCreditService.getExpiredBalance(map);
-        Map m = new HashMap();
-        m.put("allAmount",allAmount);
-        return AjaxResult.success(m);
-    }
-
-    /**
      * 查询核心企业融信授权额度 -- 饼图
      * @return
      */
@@ -478,16 +523,22 @@ public class ReportCreditController extends BaseController {
         }
         //融信额度
         String allAmount =  reportCreditService.getCreditLineAll(map);
-        //已用融信
+        //融资中额度
         String availableAmount =  reportCreditService.getAvailableBalance(map);
+        //已生效额度
+        String effectBalance =  reportCreditService.getEffectBalance(map);
+        //已放款额度
+        String loanBalance =  reportCreditService.getLoanBalance(map);
+        //已用额度
+        String addAmount = AmtUtil.add(AmtUtil.add(availableAmount,effectBalance),loanBalance);
         //可用融信
-        String subAmount = AmtUtil.subtract(allAmount,availableAmount);
+        String subAmount = AmtUtil.subtract(allAmount,addAmount);
         //返回图形数组
         List list = new ArrayList();
         //已用额度图形对象
         Map availableMap = new HashMap();
         availableMap.put("name","已用");
-        availableMap.put("value",availableAmount);
+        availableMap.put("value",addAmount);
         list.add(availableMap);
         //可用额度图形对象
         Map subMap = new HashMap();
@@ -622,8 +673,12 @@ public class ReportCreditController extends BaseController {
             String availableBalance =  reportCreditService.getAvailableBalance(map);
             //已放款
             String loanBalance =  reportCreditService.getLoanBalance(map);
+            //已失效
+            String getLoseEffectBalance =  reportCreditService.getLoseEffectBalance(map);
+            //已还款
+            String getReturnBalance =  reportCreditService.getReturnBalance(map);
             //开立金额
-            String amt = AmtUtil.add(AmtUtil.add(effectBalance, availableBalance), loanBalance);
+            String amt = AmtUtil.add(AmtUtil.add(AmtUtil.add(AmtUtil.add(effectBalance, availableBalance), loanBalance), getLoseEffectBalance), getReturnBalance);
             data.add(amt);
         }
         //开立额度数据对象

+ 11 - 4
sc-service/src/main/java/com/huyi/service/common/report/mapper/ReportCreditMapper.java

@@ -33,28 +33,35 @@ public interface ReportCreditMapper {
     String getAvailableBalance(Map map);
 
     /**
-     * 查询企业生效额度
+     * 查询企业生效额度
      * @param map
      * @return
      */
     String getEffectBalance(Map map);
 
     /**
-     * 查询企业已放款额度
+     * 查询企业已融资(已放款额度
      * @param map
      * @return
      */
     String getLoanBalance(Map map);
 
     /**
-     * 查询企业已还款额度
+     * 查询企业已失效(到期失效)额度
+     * @param map
+     * @return
+     */
+    String getLoseEffectBalance(Map map);
+
+    /**
+     * 查询企业已还款(还款失效)额度
      * @param map
      * @return
      */
     String getReturnBalance(Map map);
 
     /**
-     * 查询企业已融资额度
+     * 查询企业融资额度
      * @param map
      * @return
      */

+ 11 - 4
sc-service/src/main/java/com/huyi/service/common/report/service/ReportCreditService.java

@@ -31,28 +31,35 @@ public interface ReportCreditService {
     String getAvailableBalance(Map map);
 
     /**
-     * 查询企业生效额度
+     * 查询企业生效额度
      * @param map
      * @return
      */
     String getEffectBalance(Map map);
 
     /**
-     * 查询企业已放款额度
+     * 查询企业已融资(已放款额度
      * @param map
      * @return
      */
     String getLoanBalance(Map map);
 
     /**
-     * 查询企业已还款额度
+     * 获取企业已失效(到期失效)额度
+     * @param map
+     * @return
+     */
+    String getLoseEffectBalance(Map map);
+
+    /**
+     * 查询企业已还款(还款失效)额度
      * @param map
      * @return
      */
     String getReturnBalance(Map map);
 
     /**
-     * 获取企业已融资额度
+     * 获取企业融资额度
      * @param map
      * @return
      */

+ 4 - 0
sc-service/src/main/java/com/huyi/service/common/report/service/impl/ReportCreditServiceImpl.java

@@ -45,6 +45,10 @@ public class ReportCreditServiceImpl implements ReportCreditService {
     }
 
     @Override
+    public String getLoseEffectBalance(Map map) {
+        return reportCreditMapper.getLoseEffectBalance(map);
+    }
+    @Override
     public String getReturnBalance(Map map) {
         return reportCreditMapper.getReturnBalance(map);
     }

+ 3 - 3
sc-service/src/main/resources/mapper/common/ReportCompanyMapper.xml

@@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           COUNT(DISTINCT zfi_supplier_id)	'num'
         FROM
           zc_finance_inf
-        WHERE  zfi_status IN ('02','04','05','07')
+        WHERE  zfi_status IN ('02','04','05','07','08')
     </select>
 
     <!--已签发业务核心企业数量-->
@@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
           COUNT(DISTINCT zfi_core_id)	'num'
         FROM
           zc_finance_inf
-        WHERE zfi_status IN ('02','04','05','07')
+        WHERE zfi_status IN ('02','04','05','07','08')
     </select>
 
     <!--融信开立数量-->
@@ -89,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             zc_finance_inf
         LEFT JOIN zc_finance_product
         ON zfp_id = zfi_product_id
-        WHERE zfi_status IN ('02','04','05','07')
+        WHERE zfi_status IN ('02','04','05','07','08')
         <if test="productId != null  and productId != ''">
             AND zfi_product_id = #{productId}
         </if>

+ 57 - 27
sc-service/src/main/resources/mapper/common/ReportCreditMapper.xml

@@ -65,14 +65,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ROUND(IFNULL(SUM(zfi_amount), 0), 2) AS CHAR
         ) 'allAmount'
         FROM
-        zc_finance_record
-        LEFT JOIN zc_finance_inf
-        ON zfi_id = zfr_finance_id
+        zc_finance_inf
         LEFT JOIN zc_finance_product
         ON zfp_id = zfi_product_id
-        WHERE zfi_status IN ('04','05')
-        AND zfr_approve_stt = '01'
-        AND zfr_status = '00'
+        WHERE zfi_status = '04'
         <if test="coreCompanyId != null  and coreCompanyId != ''">
             AND zfi_core_id = #{coreCompanyId}
         </if>
@@ -97,7 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     </select>
 
-    <!--企业生效额度-->
+    <!--企业生效额度-->
     <select id="getEffectBalance" parameterType="map" resultType="java.lang.String">
         SELECT
         CAST(
@@ -132,21 +128,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     </select>
 
-    <!--企业已放款额度-->
+    <!--企业已融资(已放款额度-->
     <select id="getLoanBalance" parameterType="map" resultType="java.lang.String">
         SELECT
         CAST(
         ROUND(IFNULL(SUM(zfi_amount), 0), 2) AS CHAR
         ) 'allAmount'
         FROM
-        zc_finance_record
-        LEFT JOIN zc_finance_inf
-        ON zfi_id = zfr_finance_id
+        zc_finance_inf
         LEFT JOIN zc_finance_product
         ON zfp_id = zfi_product_id
-        WHERE zfi_status IN ('04','05')
-        AND zfr_approve_stt = '01'
-        AND zfr_status = '01'
+        WHERE zfi_status = '05'
         <if test="coreCompanyId != null  and coreCompanyId != ''">
             AND zfi_core_id = #{coreCompanyId}
         </if>
@@ -171,20 +163,52 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     </select>
 
-    <!--企业已还款额度-->
+    <!--企业已失效(到期失效)额度-->
+    <select id="getLoseEffectBalance" parameterType="map" resultType="java.lang.String">
+        SELECT
+        CAST(
+        ROUND(IFNULL(SUM(zfi_amount), 0), 2) AS CHAR
+        ) 'allAmount'
+        FROM
+        zc_finance_inf
+        LEFT JOIN zc_finance_product
+        ON zfp_id = zfi_product_id
+        WHERE zfi_status = '07'
+        <if test="coreCompanyId != null  and coreCompanyId != ''">
+            AND zfi_core_id = #{coreCompanyId}
+        </if>
+        <if test="supplierCompanyId != null  and supplierCompanyId != ''">
+            AND zfi_supplier_id = #{supplierCompanyId}
+        </if>
+        <if test="managementCompanyId != null  and managementCompanyId != ''">
+            AND zfp_management_id = #{managementCompanyId}
+        </if>
+        <if test="productId != null  and productId != ''">
+            AND zfi_product_id = #{productId}
+        </if>
+        <if test="zfpType != null  and zfpType != ''">
+            AND zfp_type = #{zfpType}
+        </if>
+        <if test="date != null  and date != ''">
+            AND DATE_FORMAT(zfi_sign_date, '%Y-%m-%d') = #{date}
+        </if>
+        <if test="month != null  and month != ''">
+            AND DATE_FORMAT(zfi_sign_date, '%Y-%m') = #{month}
+        </if>
+
+    </select>
+
+    <!--企业已还款(还款失效)额度-->
     <select id="getReturnBalance" parameterType="map" resultType="java.lang.String">
         SELECT
         CAST(
         ROUND(IFNULL(SUM(zfi_amount), 0), 2) AS CHAR
         ) 'allAmount'
         FROM
-        zc_finance_record
-        LEFT JOIN zc_finance_inf
-        ON zfi_id = zfr_finance_id
+        zc_finance_inf
         LEFT JOIN zc_finance_product
         ON zfp_id = zfi_product_id
-        WHERE zfr_approve_stt = '01'
-        AND zfr_apply_status = '01'
+        WHERE zfi_status = '08'
         <if test="coreCompanyId != null  and coreCompanyId != ''">
             AND zfi_core_id = #{coreCompanyId}
         </if>
@@ -194,16 +218,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="managementCompanyId != null  and managementCompanyId != ''">
             AND zfp_management_id = #{managementCompanyId}
         </if>
-        <if test="zfpcrId != null  and zfpcrId != ''">
-            AND zfi_core_quota_id = #{zfpcrId}
+        <if test="productId != null  and productId != ''">
+            AND zfi_product_id = #{productId}
         </if>
         <if test="zfpType != null  and zfpType != ''">
             AND zfp_type = #{zfpType}
         </if>
+        <if test="date != null  and date != ''">
+            AND DATE_FORMAT(zfi_sign_date, '%Y-%m-%d') = #{date}
+        </if>
+        <if test="month != null  and month != ''">
+            AND DATE_FORMAT(zfi_sign_date, '%Y-%m') = #{month}
+        </if>
 
     </select>
 
-    <!--企业已融资额度-->
+    <!--企业融资额度-->
     <select id="getFinancedBalance" parameterType="map" resultType="java.lang.String">
         SELECT
         CAST(
@@ -213,7 +243,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         zc_finance_inf
         LEFT JOIN zc_finance_product
         ON zfp_id = zfi_product_id
-        WHERE zfi_status IN ('02','04','05','07')
+        WHERE zfi_status IN ('02','04','05','07','08')
         <if test="coreCompanyId != null  and coreCompanyId != ''">
             AND zfi_core_id = #{coreCompanyId}
         </if>
@@ -242,7 +272,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         zc_finance_inf
         LEFT JOIN zc_finance_product
         ON zfp_id = zfi_product_id
-        WHERE zfi_status IN ('02','04','05','07')
+        WHERE zfi_status IN ('02','04','05')
         <if test="coreCompanyId != null  and coreCompanyId != ''">
             AND zfi_core_id = #{coreCompanyId}
         </if>
@@ -304,7 +334,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ON zfp_id = zfi_product_id
         LEFT JOIN sys_company
         ON scy_id = zfp_management_id
-        WHERE zfi_status IN ('02','04','05','07')
+        WHERE zfi_status IN ('02','04','05','07','08')
         <if test="paramMap.coreCompanyId != null  and paramMap.coreCompanyId != ''">
             AND zfi_core_id = #{paramMap.coreCompanyId}
         </if>
@@ -323,7 +353,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         FROM zc_finance_inf
         LEFT JOIN zc_finance_product
         ON zfp_id = zfi_product_id
-        WHERE zfi_status IN ('02','04','05','07')
+        WHERE zfi_status IN ('02','04','05','07','08')
         <if test="coreCompanyId != null  and coreCompanyId != ''">
             AND zfi_core_id = #{coreCompanyId}
         </if>