Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

cuixq 3 vuotta sitten
vanhempi
commit
32069a87a3

+ 1 - 1
sc-service/src/main/java/com/huyi/service/base/entity/ZcFinanceProComRel.java

@@ -15,7 +15,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author xuefy
- * @since 2021-08-25
+ * @since 2021-08-30
  */
 @Data
 @EqualsAndHashCode(callSuper = false)

+ 14 - 2
sc-service/src/main/java/com/huyi/service/base/entity/ZcFinanceSupplierQuota.java

@@ -15,7 +15,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author xuefy
- * @since 2021-08-23
+ * @since 2021-08-30
  */
 @Data
 @EqualsAndHashCode(callSuper = false)
@@ -56,7 +56,19 @@ public class ZcFinanceSupplierQuota implements Serializable {
     private String zfsqOldAmount;
 
     /**
-     * 状态(00:有效 01:失效)
+     * 还款账户账号
+     */
+    @TableField("zfsq_account")
+    private String zfsqAccount;
+
+    /**
+     * 还款账户开户行
+     */
+    @TableField("zfsq_account_bank")
+    private String zfsqAccountBank;
+
+    /**
+     * 状态(00:有效 01:失效 99:删除)
      */
     @TableField("zfsq_status")
     private String zfsqStatus;

+ 5 - 2
sc-service/src/main/java/com/huyi/service/common/financeProduct/controller/FinanceProductController.java

@@ -30,13 +30,16 @@ public class FinanceProductController extends BaseController {
      /**
      * 查询融资产品列表
      */
-    @GetMapping("/list/{zfpcrProductId}")
-    public R list(@PathVariable String zfpcrProductId) {
+    @GetMapping("/list/{zfpcrProductId}/{zfpManagementId}")
+    public R list(@PathVariable String zfpcrProductId,@PathVariable String zfpManagementId) {
         //查询当前操作员
         Map map = new HashMap();
         if (CommonUtil.isNotEmpty(zfpcrProductId)) {
             map.put("zfpId", zfpcrProductId);
         }
+        if (CommonUtil.isNotEmpty(zfpManagementId)){
+            map.put("zfpManagementId",zfpManagementId);
+        }
         List<Map> list = financeProductService.selectFinanceProductList(map);
         return R.ok(list);
     }

+ 33 - 0
sc-service/src/main/java/com/huyi/service/creditLine/controller/CreditLineController.java

@@ -198,6 +198,8 @@ public class CreditLineController extends BaseController {
         String zfpcrChargeRate = CommonUtil.objToString(map.get("zfpcrChargeRate"));
         //核心企业还款账户账号
         String zfpcrAccount = CommonUtil.objToString(map.get("zfpcrAccount"));
+        //核心企业还款账户开户行
+        String zfpcrAccountBank = CommonUtil.objToString(map.get("zfpcrAccountBank"));
         //融资放款方式
         String zfpcrLoanType = CommonUtil.objToString(map.get("zfpcrLoanType"));
         //记账簿托管方式
@@ -208,6 +210,13 @@ public class CreditLineController extends BaseController {
         if(CommonUtil.isEmpty(zfpcrProductId)){
             throw new Exception("融资产品不能为空");
         }
+        LambdaQueryWrapper<ZcFinanceProComRel> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(ZcFinanceProComRel::getZfpcrProductId,zfpcrProductId);
+        queryWrapper.eq(ZcFinanceProComRel::getZfpcrCompanyId,zfpcrCompanyId);
+        int count = iZcFinanceProComRelService.count(queryWrapper);
+        if (count > 0){
+            throw new Exception("此企业已授信该融资产品");
+        }
         //授信企业名称
         if(CommonUtil.isEmpty(zfpcrCompanyId)){
             throw new Exception("授信企业名称不能为空");
@@ -257,6 +266,13 @@ public class CreditLineController extends BaseController {
         if(CommonUtil.isEmpty(zfpcrAccount)){
             throw new Exception("核心企业还款账户账号不能为空");
         }
+        //核心企业还款账户账号
+        if(CommonUtil.isEmpty(zfpcrAccountBank)){
+            throw new Exception("核心企业还款账户开户行不能为空");
+        }
+        if (zfpcrAccountBank.length() > 30){
+            throw new Exception("核心企业还款账户开户行长度过长");
+        }
         //融资放款方式
         if(CommonUtil.isEmpty(zfpcrLoanType)){
             throw new Exception("融资放款方式不能为空");
@@ -367,6 +383,8 @@ public class CreditLineController extends BaseController {
         String zfpcrChargeRate = CommonUtil.objToString(map.get("zfpcrChargeRate"));
         //核心企业还款账户账号
         String zfpcrAccount = CommonUtil.objToString(map.get("zfpcrAccount"));
+        //核心企业还款账户开户行
+        String zfpcrAccountBank = CommonUtil.objToString(map.get("zfpcrAccountBank"));
         //融资放款方式
         String zfpcrLoanType = CommonUtil.objToString(map.get("zfpcrLoanType"));
         //记账簿托管方式
@@ -377,6 +395,14 @@ public class CreditLineController extends BaseController {
         if(CommonUtil.isEmpty(zfpcrProductId)){
             throw new Exception("融资产品不能为空");
         }
+        LambdaQueryWrapper<ZcFinanceProComRel> wrapper = new LambdaQueryWrapper<>();
+        wrapper.eq(ZcFinanceProComRel::getZfpcrProductId,zfpcrProductId);
+        wrapper.eq(ZcFinanceProComRel::getZfpcrCompanyId,zfpcrCompanyId);
+        wrapper.ne(ZcFinanceProComRel::getZfpcrId,zfpcrId);
+        int count = iZcFinanceProComRelService.count(wrapper);
+        if (count > 0){
+            throw new Exception("此企业已授信盖融资产品");
+        }
         //授信企业名称
         if(CommonUtil.isEmpty(zfpcrCompanyId)){
             throw new Exception("授信企业名称不能为空");
@@ -426,6 +452,13 @@ public class CreditLineController extends BaseController {
         if(CommonUtil.isEmpty(zfpcrAccount)){
             throw new Exception("核心企业还款账户账号不能为空");
         }
+        //核心企业还款账户账号
+        if(CommonUtil.isEmpty(zfpcrAccountBank)){
+            throw new Exception("核心企业还款账户开户行不能为空");
+        }
+        if (zfpcrAccountBank.length() > 30){
+            throw new Exception("核心企业还款账户开户行长度过长");
+        }
         //融资放款方式
         if(CommonUtil.isEmpty(zfpcrLoanType)){
             throw new Exception("融资放款方式不能为空");

+ 23 - 10
sc-service/src/main/java/com/huyi/service/financeRecord/controller/FinanceRecordController.java

@@ -18,6 +18,7 @@ import com.tianhu.common.log.annotation.Log;
 import com.tianhu.common.log.enums.BusinessType;
 import com.tianhu.common.security.annotation.PreAuthorize;
 import com.tianhu.common.security.service.TokenService;
+import com.tianhu.system.api.RemoteConfigService;
 import com.tianhu.system.api.domain.SysUser;
 import com.tianhu.system.api.model.LoginUser;
 import org.apache.commons.lang3.StringUtils;
@@ -85,6 +86,8 @@ public class FinanceRecordController extends BaseController {
     private ISysUserCompanyRelService iSysUserCompanyRelService;
     @Autowired
     private IZcFinanceInfService iZcFinanceInfService;
+    @Autowired
+    private RemoteConfigService configService;
      /**
      * 查询融资管理列表
      */
@@ -343,10 +346,20 @@ public class FinanceRecordController extends BaseController {
         zcFinanceRecord.setZfrId(zfrId);
         //放款金额
         zcFinanceRecord.setZfrLoanAmount(zfrLoanAmount);
+        //放款时间
+        zcFinanceRecord.setZfrLoanDate(DateUtils.getNowDate());
         //附件
         zcFinanceRecord.setZfrLoanFile(zfrLoanFile);
         //融资状态(00:融资中 01:已放款 02:融资失败 03:已结算)
         zcFinanceRecord.setZfrStatus("01");
+        //还款编号
+        StringBuilder str=new StringBuilder();//定义变长字符串
+        Random random=new Random();
+        //随机生成数字,并添加到字符串
+        for(int i=0;i<6;i++){
+            str.append(random.nextInt(10));
+        }
+        zcFinanceRecord.setZfrPayNumber(DateUtils.dateTimeNow("yyyyMMdd")+str);
         /*----------修改融信表状态---------------*/
         ZcFinanceInf zcFinanceInf = new ZcFinanceInf();
         //融信id
@@ -471,8 +484,8 @@ public class FinanceRecordController extends BaseController {
             fileInfLambdaQueryWrapper.eq(PubFileInf::getPfiIsDel,"00");
             otherFileList = fileInfService.findPubFileInfs(fileInfLambdaQueryWrapper);
         }
-        String directory = "E:\\home\\" ;
-//        String directory = configService.selectConfigByKey("hr_resume_export");
+//        String directory = "D:\\record" ;
+        String directory = configService.selectConfigByKey("zc_record_file").getMsg();
 
         for (int i = 0; i < otherFileList.size(); i++) {
             Map map = new HashMap();
@@ -508,14 +521,14 @@ public class FinanceRecordController extends BaseController {
         for (int l = 0; l < list.size(); l++) {
             String files = list.get(l).get("pfiFileUrl");
             String names = list.get(l).get("pfiFileName");
-            downloadFile(files, directory+ names);
+            downloadFile(files, directory+ names,directory);
         }
         /** 压缩方法 */
-        FileOutputStream fos1= new FileOutputStream(new File("E:/" + "rzgl"+DateUtils.dateTimeNow()+ ".zip"));
-        toZip("E:\\home",fos1 ,true);
-        File zipFile = new File("E:/" + "rzgl"+DateUtils.dateTimeNow()+ ".zip");
+        FileOutputStream fos1= new FileOutputStream(new File(directory + "rzgl"+DateUtils.dateTimeNow()+ ".zip"));
+        toZip(directory,fos1 ,true);
+        File zipFile = new File(directory + "rzgl"+DateUtils.dateTimeNow()+ ".zip");
         if(zipFile.exists()) {
-            down(response, "rzgl" + DateUtils.dateTimeNow() + ".zip", "E:/");
+            down(response, "rzgl" + DateUtils.dateTimeNow() + ".zip", directory);
             zipFile.delete();
         }
         return null;
@@ -562,20 +575,20 @@ public class FinanceRecordController extends BaseController {
             }
         }
     }
-
     /**
      * 下载远程文件并保存到本地
      * @param remoteFilePath 远程文件路径
      * @param localFilePath 本地文件路径(带文件名)
+     * @param directory     本地文件夹
      */
-    public  static  String  downloadFile(String remoteFilePath, String localFilePath)
+    public  static  String  downloadFile(String remoteFilePath, String localFilePath,String directory)
     {
         URL urlfile = null;
         HttpURLConnection httpUrl = null;
         BufferedInputStream bis = null;
         BufferedOutputStream bos = null;
 
-        File path = new File("E:\\home\\");
+        File path = new File(directory);
         //判断文件是否存在
         if(!path.exists()){
             path.mkdirs();

+ 49 - 2
sc-service/src/main/java/com/huyi/service/supplierCreditLine/controller/SupplierCreditLineController.java

@@ -1,5 +1,6 @@
 package com.huyi.service.supplierCreditLine.controller;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -206,12 +207,30 @@ public class SupplierCreditLineController extends BaseController {
         String zfsqAmount = zcFinanceSupplierQuota.getZfsqAmount();
         //核心企业授信额度ID
         String zfsqCoreQuotaId = zcFinanceSupplierQuota.getZfsqCoreQuotaId();
+        //还款账户账号
+        String zfsqAccount = zcFinanceSupplierQuota.getZfsqAccount();
+        //还款账户开户行
+        String zfsqAccountBank = zcFinanceSupplierQuota.getZfsqAccountBank();
         if (CommonUtil.isEmpty(zfsqCompanyId)){
             throw new Exception("企业名称不能为空");
         }
         if (CommonUtil.isEmpty(zfsqAmount)){
             throw new Exception("授信额度不能为空");
         }
+        //企业还款账户账号
+        if(CommonUtil.isEmpty(zfsqAccount)){
+            throw new Exception("还款账户账号不能为空");
+        }
+        //还款账户开户行
+        if(CommonUtil.isEmpty(zfsqAccountBank)){
+            throw new Exception("还款账户开户行不能为空");
+        }
+        if (zfsqAccount.length() > 50){
+            throw new Exception("企业还款账户长度过长");
+        }
+        if (zfsqAccountBank.length() > 30){
+            throw new Exception("企业还款账户开户行长度过长");
+        }
         //查询核心企业授信额度ID下的供应商授信额度总和
         QueryWrapper<ZcFinanceSupplierQuota> queryWrapper = new QueryWrapper<>();
         queryWrapper.eq("zfsq_core_quota_id",zfsqCoreQuotaId);
@@ -316,6 +335,8 @@ public class SupplierCreditLineController extends BaseController {
         List<String> columnName = new ArrayList<>();
         columnName.add("企业名称");
         columnName.add("企业统一社会信用代码");
+        columnName.add("还款账户账号");
+        columnName.add("还款账户开户行");
         columnName.add("授信额度");
         int columnNumber = columnName.size();
         for(String width:columnName){
@@ -362,6 +383,8 @@ public class SupplierCreditLineController extends BaseController {
         List<String> columnName = new ArrayList<>();
         columnName.add("scyName");
         columnName.add("scySocialCode");
+        columnName.add("zfsqAccount");
+        columnName.add("zfsqAccountBank");
         columnName.add("zfsqAmount");
         //excel数据
         List<Map<String,String>> templateData = ExcelFileUtils.readExecleasy(file,columnName,1);
@@ -384,6 +407,10 @@ public class SupplierCreditLineController extends BaseController {
             String scyName = CommonUtil.objToString(map.get("scyName"));
             //企业统一代码
             String scySocialCode = CommonUtil.objToString(map.get("scySocialCode"));
+            //还款账户账号
+            String zfsqAccount = CommonUtil.objToString(map.get("zfsqAccount"));
+            //还款账户开户行
+            String zfsqAccountBank = CommonUtil.objToString(map.get("zfsqAccountBank"));
             //授信额度
             String zfsqAmount = CommonUtil.objToString(map.get("zfsqAmount"));
             if(CommonUtil.isEmpty(scyName)){
@@ -391,10 +418,30 @@ public class SupplierCreditLineController extends BaseController {
                     throw new Exception("<br/>第" + (i+1) + "行数据企业名称为空") ;
             }
             if(CommonUtil.isEmpty(scySocialCode)){
-
                     failureNum++;
                     throw new Exception("<br/>第" + (i+1) + "行数据企业统一代码为空") ;
-
+            }
+            //企业还款账户账号
+            if(CommonUtil.isEmpty(zfsqAccount)){
+                failureNum++;
+                throw new Exception("<br/>第" + (i+1) + "还款账户账号不能为空");
+            }
+            //还款账户开户行
+            if(CommonUtil.isEmpty(zfsqAccountBank)){
+                failureNum++;
+                throw new Exception("<br/>第" + (i+1) + "还款账户开户行不能为空");
+            }
+            if (zfsqAccount.length() > 50){
+                failureNum++;
+                throw new Exception("<br/>第" + (i+1) + "企业还款账户长度过长");
+            }
+            if (zfsqAccountBank.length() > 30){
+                failureNum++;
+                throw new Exception("<br/>第" + (i+1) + "企业还款账户开户行长度过长");
+            }
+            if(AmtUtil.isMoney(zfsqAmount) == false){
+                failureNum++;
+                throw new Exception("<br/>第" + (i+1) + "行数据金额格式正确") ;
             }
             //查询此企业是否存在
             queryWrapper.eq(SysCompany::getScyName,scyName);

+ 2 - 0
sc-service/src/main/resources/mapper/base/ZcFinanceSupplierQuotaMapper.xml

@@ -9,6 +9,8 @@
         <result column="zfsq_company_id" property="zfsqCompanyId" />
         <result column="zfsq_amount" property="zfsqAmount" />
         <result column="zfsq_old_amount" property="zfsqOldAmount" />
+        <result column="zfsq_account" property="zfsqAccount" />
+        <result column="zfsq_account_bank" property="zfsqAccountBank" />
         <result column="zfsq_status" property="zfsqStatus" />
         <result column="zfsq_profit_spare1" property="zfsqProfitSpare1" />
         <result column="zfsq_profit_spare2" property="zfsqProfitSpare2" />

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

@@ -6,7 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectCompanyAccList" parameterType="map" resultType="map">
         SELECT
-          PAI_ACCNO 'value',
+          PAI_ACCNO      'value',
+          PAI_QLBANKNAME 'address',
           CASE  WHEN PAI_ACCNO = #{paramMap.zfpcrAccount}  THEN 0  ELSE  1  END  'flag'
         FROM
           pay_acc_inf
@@ -26,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
         SELECT
           PBAI_BANKACCOUNT_ID 'value',
+          PBAI_BANK_NAME      'address',
           CASE  WHEN PBAI_BANKACCOUNT_ID = #{paramMap.zfpcrAccount} THEN 0  ELSE  1  END  'flag'
         FROM
           pay_bank_acc_inf

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

@@ -14,10 +14,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         zc_finance_product
         WHERE 1=1
         <if test="paramMap.zfpId != null  and paramMap.zfpId != ''">
-            AND (zfp_id= #{paramMap.zfpId} OR zfp_status = '01')
+            AND (zfp_id= #{paramMap.zfpId} or zfp_status = '01')
         </if>
-        <if test="paramMap.zfpId == null  or paramMap.zfpId == ''">
-            AND zfp_status = '01'
+        <if test="paramMap.zfpId == null  and paramMap.zfpId == ''">
+            and zfp_status = '01'
+        </if>
+        <if test="paramMap.zfpManagementId != null  and paramMap.zfpManagementId != ''">
+            AND zfp_management_id = #{paramMap.zfpManagementId}
         </if>
         order by flag asc ,create_time desc
     </select>

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

@@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         r.zfpcr_end_date 		    'zfpcrEndDate',
         r.zfpcr_status 		        'zfpcrStatus',
         p.zfp_name 			        'zfpName',
+        p.zfp_type                  'zfpType',
         s.scy_name 			        'rzScyName',
         c.scy_name 			        'scyName',
         c.scy_social_code		    'scySocialCode'
@@ -72,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         r.zfpcr_charge              'zfpcrCharge',
         r.zfpcr_charge_rate         'zfpcrChargeRate',
         r.zfpcr_account             'zfpcrAccount',
+        r.zfpcr_account_bank        'zfpcrAccountBank',
         r.zfpcr_loan_type           'zfpcrLoanType',
         r.zfpcr_bookkeeping_type    'zfpcrBookkeepingType',
         r.zfpcr_status 		        'zfpcrStatus',
@@ -88,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ON s.scy_id = p.zfp_management_id
         LEFT JOIN sys_company c
         ON c.scy_id = r.`zfpcr_company_id`
-        WHERE r.zfpcr_status='00'
+        WHERE 1=1
         and r.zfpcr_id = #{paramMap.zfpcrId}
         order by r.create_time desc
     </select>

+ 4 - 1
sc-service/src/main/resources/mapper/financeRecord/FinanceRecordMapper.xml

@@ -11,7 +11,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             r.zfr_amount          'zfrAmount',
             r.zfr_rate            'zfrRate',
             r.zfr_handler         'zfrHandler',
-            DATE_FORMAT(r.zfr_repayment_date,'%Y-%m-%d') AS 'zfrRepaymentDate',
+            DATE_FORMAT(i.zfi_expire_date,'%Y-%m-%d') AS 'zfrExpireDate',
             DATE_FORMAT(r.zfr_apply_date ,'%Y-%m-%d') AS 'zfrApplyDate',
             DATE_FORMAT(r.zfr_loan_date,'%Y-%m-%d') AS 'zfrLoanDate',
             r.zfr_approve_stt     'zfrApproveStt',
@@ -25,6 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             p.zfpcr_charge_rate   'zfpcrChargeRate',
             s.scy_name            'coreScyName',
             c.scy_name            'supplierScyName',
+            u.nick_name           'nickName',
             IFNULL(CAST(ROUND(i.zfi_amount * (IFNULL(p.zfpcr_charge_rate,0.00)/100),2)AS CHAR),0.00) AS 'rzAmount'
         FROM
         zc_finance_record r
@@ -36,6 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ON i.zfi_core_id = s.scy_id
         LEFT JOIN sys_company c
         ON i.zfi_supplier_id = c.scy_id
+        left join sys_user u
+        on r.zfr_handler = u.user_id
         WHERE 1 = 1
         <if test="paramMap.zfrStatus != null  and paramMap.zfrStatus != ''">
             and r.zfr_status = #{paramMap.zfrStatus}