Jelajahi Sumber

费用列表查询,授信列表/详情查询,融资缴费查询电子账户

peixh 3 tahun lalu
induk
melakukan
4f5b164c76

+ 1 - 0
sc-service/src/main/java/com/huyi/service/common/financeInf/controller/FinanceInfController.java

@@ -95,6 +95,7 @@ public class FinanceInfController extends BaseController {
                 if (termIng.indexOf("-") != -1){
                     termIng = StringUtils.substringAfter(termIng,"-");
                 }
+                termIng = AmtUtil.add(termIng,"1");
                 /*融资成本:融资金额*融资费率*融资期限 / 365 + 融资金额 * 服务费率*/
                 String costIng = AmtUtil.multiply(zfiAmount,zfpcrRate,2);
                 costIng = AmtUtil.multiply(costIng,termIng,2);

+ 23 - 0
sc-service/src/main/java/com/huyi/service/cost/controller/OwnCostManageController.java

@@ -5,10 +5,12 @@ import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.huyi.service.base.entity.PayAccInf;
 import com.huyi.service.base.entity.SysCompany;
 import com.huyi.service.base.entity.ZcChargeInf;
 import com.huyi.service.base.entity.ZcInvoiceAddress;
 import com.huyi.service.base.mapper.ZcChargeInfMapper;
+import com.huyi.service.base.service.IPayAccInfService;
 import com.huyi.service.base.service.ISysCompanyService;
 import com.huyi.service.base.service.IZcChargeInfService;
 import com.huyi.service.base.service.IZcInvoiceAddressService;
@@ -76,6 +78,8 @@ public class OwnCostManageController extends BaseController
     @Autowired
     private TokenService tokenService;
 
+    @Autowired
+    private IPayAccInfService iPayAccInfService;
     /**
      * 申请开票
      */
@@ -144,6 +148,25 @@ public R list(String zfrNumber, String zciStatus, String zciInvoiceStatus,
         map.put("companyId",companyId);
         list = iOwnCostManageService.selectCost(request, map);
     }
+    List listAll = list.getRecords();
+    for (int j = 0; j < listAll.size(); j++) {
+        //查询本企业的电子账户用于缴费
+        Map<String,String>  m = (Map<String, String>) listAll.get(j);
+        //查询电子账户
+        LambdaQueryWrapper<PayAccInf> accInfWrapper = new LambdaQueryWrapper<>();
+        //企业ID
+        accInfWrapper.eq(PayAccInf::getPaiCstno,companyId);
+        //账户状态(0:未开通,1:冻结,2已开通3:待激活)
+        accInfWrapper.eq(PayAccInf::getPaiStatus,"02");
+        //账户类型(00基本账户01一般账户02信用账户03手续费账户04待结算账户05提现账户06虚拟账户07:公共计息账户08:资金初始化账户)
+        accInfWrapper.eq(PayAccInf::getPaiAcctype,"06");
+        List<PayAccInf> accInfList = iPayAccInfService.findPayAccInfs(accInfWrapper);
+        String accNo = "";
+        if (accInfList.size() > 0) {
+            accNo = accInfList.get(0).getPaiAccno();
+        }
+        m.put("accNo",accNo);
+    }
     return R.ok(list);
 }
 

+ 15 - 4
sc-service/src/main/java/com/huyi/service/creditLine/controller/CreditLineController.java

@@ -121,6 +121,7 @@ public class CreditLineController extends BaseController {
         map.put("zfpType",zfpType);
         //融资产品类型
         map.put("zfpName",zfpName);
+        //供应商
         if ("02".equals(companyType)){
             IPage<Map> list = creditLineService.selectSupplierCreditList(map, request);
             List listAll = list.getRecords();
@@ -135,7 +136,8 @@ public class CreditLineController extends BaseController {
                 //授信id
                 queryWrapper.in("zfi_supplier_quota_id", zfsqId);
                 //状态(00:待确权 01:待签收 02:已生效 03:已失效 04:融资中 05:已融资)
-                queryWrapper.and(i -> i.ne("zfi_status", "00").or().ne("zfi_status", "03"));
+                //queryWrapper.and(i -> i.ne("zfi_status", "00").or().ne("zfi_status", "03"));
+                queryWrapper.notIn("zfi_status","00,03,07,08");
                 queryWrapper.select("IFNULL(CAST(ROUND(SUM(zfi_amount),2)AS CHAR),'0.00') AS zfiAmount");
                 ZcFinanceInf zcFinanceInf = zcFinanceInfService.getOne(queryWrapper);
                 //申请金额(已用)
@@ -164,6 +166,8 @@ public class CreditLineController extends BaseController {
                 String zfpcrId = m.get("zfpcrId");
                 //融资产品
                 String zfpcrProductId = m.get("zfpcrProductId");
+                //融资产品方向(0:正向,1反向)
+                String zfpTypes = m.get("zfpType");
                 //通过融资产品查询融信表申请金额
                 QueryWrapper<ZcFinanceInf> queryWrapper = new QueryWrapper<>();
                 //授信id
@@ -177,8 +181,8 @@ public class CreditLineController extends BaseController {
                 if (zcFinanceInf != null) {
                     zfiAmount = zcFinanceInf.getZfiAmount();
                 }
-                //可用额度(授信额度 - 申请金额)
-                String usableAmount = AmtUtil.subtract(zfpcrAmount, zfiAmount, 2);
+                //可用额度(反向保理:授信额度 - 申请金额;正向保理:授信额度 - 已分配额度)
+                String usableAmount = "0.00";
                 //查询核心企业授信额度ID下的供应商授信额度总和
                 QueryWrapper<ZcFinanceSupplierQuota> supplierQueryWrapper = new QueryWrapper<>();
                 supplierQueryWrapper.eq("zfsq_core_quota_id", zfpcrId);
@@ -189,7 +193,14 @@ public class CreditLineController extends BaseController {
                 String totalAmount = supplierQuota.getZfsqAmount();
                 //已使用额度
                 m.put("zfiAmount", zfiAmount);
-                //可用额度
+                //可用额度(正向保理:授信额度 - 已分配额度)
+                if ("0".equals(zfpTypes)){
+                    usableAmount = AmtUtil.subtract(zfpcrAmount, totalAmount, 2);
+                }
+                //可用额度(反向保理:授信额度 - 申请金额)
+                else if ("1".equals(zfpTypes)){
+                    usableAmount = AmtUtil.subtract(zfpcrAmount, zfiAmount, 2);
+                }
                 m.put("usableAmount", usableAmount);
                 //企业类型
                 m.put("companyType", companyType);

+ 16 - 6
sc-service/src/main/java/com/huyi/service/financeRecord/controller/FinanceRecordController.java

@@ -140,7 +140,17 @@ public class FinanceRecordController extends BaseController {
         }else if ("02".equals(zfrQuery)){
             map.put("zfrNumber", zfrValue);
         }else if ("03".equals(zfrQuery)){
-            map.put("zfrStatus", zfrValue);
+            if ("融资中".equals(zfrValue)) {
+                map.put("zfrStatus", "00");
+            }else if ("已放款".equals(zfrValue)){
+                map.put("zfrStatus", "01");
+            }else if ("融资失败".equals(zfrValue)){
+                map.put("zfrStatus", "02");
+            }else if ("已结算".equals(zfrValue)){
+                map.put("zfrStatus", "03");
+            }else if ("合同待签署".equals(zfrValue)){
+                map.put("zfrStatus", "04");
+            }
         }else if("04".equals(zfrQuery)){
             map.put("supplierScyName", zfrValue);
         }
@@ -323,10 +333,10 @@ public class FinanceRecordController extends BaseController {
         zcFinanceRecord.setCreateTime(createTime);
         /*-------------新增费用表--------*/
         //查询此融资是否已存在
-        LambdaQueryWrapper<ZcChargeInf> queryWrapper = new LambdaQueryWrapper<>();
-        queryWrapper.eq(ZcChargeInf::getZciFinanceId,zfrFinanceId);
-        int count = iZcChargeInfService.count(queryWrapper);
-        if (count == 0) {
+//        LambdaQueryWrapper<ZcChargeInf> queryWrapper = new LambdaQueryWrapper<>();
+//        queryWrapper.eq(ZcChargeInf::getZciFinanceId,zfrFinanceId);
+//        int count = iZcChargeInfService.count(queryWrapper);
+//        if (count == 0) {
             ZcChargeInf zcChargeInf = new ZcChargeInf();
             //主键
             zcChargeInf.setZciId(IdUtils.fastSimpleUUID());
@@ -341,7 +351,7 @@ public class FinanceRecordController extends BaseController {
             //创建时间
             zcChargeInf.setCreateTime(DateUtils.getNowDate());
             iZcChargeInfService.createZcChargeInf(zcChargeInf);
-        }
+//        }
         /*----------修改融信表状态---------------*/
         ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
         //融信id

+ 23 - 3
sc-service/src/main/java/com/huyi/service/financeRecord/controller/RecordSealController.java

@@ -98,6 +98,8 @@ public class RecordSealController extends BaseController {
     private IZcFinanceRecordFileRelService financeRecordFileRelService;
     @Autowired
     private ISysUserCompanyRelService iSysUserCompanyRelService;
+    @Autowired
+    private IPayAccInfService iPayAccInfService;
     /**
      * 获取合同文件
      * @param map
@@ -749,6 +751,10 @@ public class RecordSealController extends BaseController {
      */
     @GetMapping("/listChargeStatus/{zfrId}")
     public AjaxResult listChargeStatus(@PathVariable("zfrId") String zfrId){
+        //获取此操作员
+        LoginUser userInfo = tokenService.getLoginUser();
+        SysUser user = userInfo.getSysUser();
+        String companyId = user.getCompanyId();
         //融资信息
         ZcFinanceRecord zcFinanceRecord = iZcFinanceRecordService.getById(zfrId);
         //融信id
@@ -759,16 +765,30 @@ public class RecordSealController extends BaseController {
         String coreQuotaId =  zcFinanceInf.getZfiCoreQuotaId();
         //授信信息
         ZcFinanceProComRel zcFinanceProComRel  = iZcFinanceProComRelService.getById(coreQuotaId);
-        //融资放款方式
+        //融资放款方式(0:平台电子记账簿 1:供应商指定账户 2:供应商线下面签)
         String loanType = zcFinanceProComRel.getZfpcrLoanType();
-
+        //供应商指定账户/供应商线下面签时缴纳费用
+        Map map = new HashMap();
         List<ZcChargeInf> list = new ArrayList<>();
+        List<PayAccInf> accInfList = new ArrayList<>();
         if ("1".equals(loanType) || "2".equals(loanType)){
+            //查询是否缴纳费用
             LambdaQueryWrapper<ZcChargeInf> queryWrapper = new LambdaQueryWrapper<>();
             queryWrapper.eq(ZcChargeInf::getZciFinanceId,zfrId);
             list = iZcChargeInfService.findZcChargeInfs(queryWrapper);
+            //查询电子账户
+            LambdaQueryWrapper<PayAccInf> accInfWrapper = new LambdaQueryWrapper<>();
+            //企业ID
+            accInfWrapper.eq(PayAccInf::getPaiCstno,companyId);
+            //账户状态(0:未开通,1:冻结,2已开通3:待激活)
+            accInfWrapper.eq(PayAccInf::getPaiStatus,"02");
+            //账户类型(00基本账户01一般账户02信用账户03手续费账户04待结算账户05提现账户06虚拟账户07:公共计息账户08:资金初始化账户)
+            accInfWrapper.eq(PayAccInf::getPaiAcctype,"06");
+            accInfList = iPayAccInfService.findPayAccInfs(accInfWrapper);
         }
-        return AjaxResult.success(list);
+        map.put("chargeInfList",list);
+        map.put("accInfList",accInfList);
+        return AjaxResult.success(map);
     }
     /**
      * 缴费状态修改

+ 1 - 1
sc-service/src/main/resources/mapper/common/CompanyAccMapper.xml

@@ -19,7 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             and PAI_CSTNO =  #{paramMap.companyId}
         </if>
         <if test="paramMap.zfpcrAccount != null  and paramMap.zfpcrAccount != ''">
-            AND (PAI_ACCNO = #{paramMap.zfpcrAccount}
+            AND PAI_ACCNO = #{paramMap.zfpcrAccount}
             OR (PAI_STATUS = '2' AND PAI_ACCTYPE in ('00','01'))
         </if>
         <if test="paramMap.zfpcrAccount == null  or paramMap.zfpcrAccount == ''">

+ 1 - 0
sc-service/src/main/resources/mapper/creditLine/CreditLineMapper.xml

@@ -170,6 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </select>
     <select id="selectContractList" parameterType="map" resultType="map">
         SELECT
+          zfc_id            'zfcId',
           zfc_name          'zfcName',
           zfc_node          'zfcNode',
           pfi_url           'pfiUrl',