Browse Source

授信筛选条件,融资导出

peixh 4 years ago
parent
commit
6a7196bf2d

+ 6 - 2
sc-service/src/main/java/com/huyi/service/creditLine/controller/CreditLineController.java

@@ -95,8 +95,12 @@ public class CreditLineController extends BaseController {
         //企业名称
         map.put("scyName",scyName);
         //授信额度范围
-        map.put("AmountA",CommonUtil.objToBigDecimal(AmountA));
-        map.put("AmountB",CommonUtil.objToBigDecimal(AmountB));
+        if (CommonUtil.isNotEmpty(AmountA)) {
+            map.put("AmountA", CommonUtil.objToBigDecimal(AmountA));
+        }
+        if (CommonUtil.isNotEmpty(AmountB)) {
+            map.put("AmountB", CommonUtil.objToBigDecimal(AmountB));
+        }
         //状态状态(00:有效 01:失效)
         map.put("zfpcrStatus",zfpcrStatus);
         //开始日期区间

+ 109 - 140
sc-service/src/main/java/com/huyi/service/financeRecord/controller/FinanceRecordController.java

@@ -29,6 +29,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.cglib.beans.BeanMap;
+import org.springframework.core.io.UrlResource;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
@@ -36,6 +37,7 @@ import javax.servlet.http.HttpServletResponse;
 import java.io.*;
 import java.lang.reflect.InvocationTargetException;
 import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -99,6 +101,8 @@ public class FinanceRecordController extends BaseController {
     private IZcFinanceProComRelService iZcFinanceProComRelService;
     @Autowired
     private ApprovalService approvalService;
+    @Autowired
+    private IZcFinanceRecordFileRelService financeRecordFileRelService;
     // 开始流程
     public final static String STRART_FLOW = "flow/strartFlow";
 
@@ -582,6 +586,8 @@ public class FinanceRecordController extends BaseController {
         List<PubFileInf> otherFileList = new ArrayList<>();
         //融信相关文件
         List<PubFileInf> financeFileList = new ArrayList<>();
+        //融资相关文件
+        List<PubFileInf> recordFileList = new ArrayList<>();
         //提取收付款编号
         List<String> zbiIdList = CommonUtil.getIdFromList(billInfList,"zbiId");
         //发票与收付款相关
@@ -637,18 +643,30 @@ public class FinanceRecordController extends BaseController {
         }
         //融信附件关联表
         LambdaQueryWrapper<ZcFinanceFileRel> financeFileRelWrapper = new LambdaQueryWrapper<>();
-        financeFileRelWrapper.in(ZcFinanceFileRel::getZffrFinanceId,zbiIdList);
+        financeFileRelWrapper.in(ZcFinanceFileRel::getZffrFinanceId,zfrFinanceId);
         List<ZcFinanceFileRel> fileRelList = iZcFinanceFileRelService.findZcFinanceFileRels(financeFileRelWrapper);
         //不为空
         if (fileRelList.size() > 0){
             //提取文件编号
-            List<String> idList = CommonUtil.getIdFromList(fileRelList,"zbfrFileId");
+            List<String> idList = CommonUtil.getIdFromList(fileRelList,"zffrFileId");
             LambdaQueryWrapper<PubFileInf> fileInfLambdaQueryWrapper = new LambdaQueryWrapper<>();
             fileInfLambdaQueryWrapper.in(PubFileInf::getPfiFileId,idList);
             fileInfLambdaQueryWrapper.eq(PubFileInf::getPfiIsDel,"00");
             financeFileList = fileInfService.findPubFileInfs(fileInfLambdaQueryWrapper);
         }
-        String directory = configService.selectConfigByKey("zc_record_file").getMsg();
+        //融资附件关联表
+        LambdaQueryWrapper<ZcFinanceRecordFileRel> recordFileRelWrapper = new LambdaQueryWrapper<>();
+        recordFileRelWrapper.in(ZcFinanceRecordFileRel::getZfrfrFinanceId,zfrFinanceId);
+        List<ZcFinanceRecordFileRel> recordRelList = financeRecordFileRelService.findZcFinanceRecordFileRels(recordFileRelWrapper);
+        //不为空
+        if (recordRelList.size() > 0){
+            //提取文件编号
+            List<String> idList = CommonUtil.getIdFromList(recordRelList,"zfrfrFileId");
+            LambdaQueryWrapper<PubFileInf> fileInfLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            fileInfLambdaQueryWrapper.in(PubFileInf::getPfiFileId,idList);
+            fileInfLambdaQueryWrapper.eq(PubFileInf::getPfiIsDel,"00");
+            recordFileList = fileInfService.findPubFileInfs(fileInfLambdaQueryWrapper);
+        }
 
         for (int i = 0; i < otherFileList.size(); i++) {
             Map map = new HashMap();
@@ -691,17 +709,89 @@ public class FinanceRecordController extends BaseController {
             map.put("pfiFileName",pfiFileName);
             list.add(map);
         }
+        for (int z = 0; z < recordFileList.size(); z++) {
+            Map map = new HashMap();
+            //文件路径
+            String pfiFileUrl = recordFileList.get(z).getPfiFileUrl();
+            //文件名称
+            String pfiFileName = recordFileList.get(z).getPfiFileName();
+            map.put("pfiFileUrl",pfiFileUrl);
+            map.put("pfiFileName",pfiFileName);
+            list.add(map);
+        }
+        String directory = configService.selectConfigByKey("zc_record_file").getMsg();
         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,directory);
+//            downloadFile(files, directory+ names,directory);
+        }
+        //存放--服务器上zip文件的目录
+        File directoryFile=new File(directory);
+        if(!directoryFile.isDirectory() && !directoryFile.exists()){
+            directoryFile.mkdirs();
+        }
+        String zipFileName = "rzgl"+DateUtils.dateTimeNow()+ ".zip";
+        String strZipPath = directory+zipFileName;
+        //输出流
+        ZipOutputStream zipStream = null;
+        //新建
+        File zipFile = new File(strZipPath);
+        //文件压缩
+        try{
+            //构造最终压缩包的输出流
+            zipStream = new ZipOutputStream(new FileOutputStream(zipFile));
+            //TODO:未对文件不存在时进行操作,后期优化。
+
+            for (Map crete : list) {
+//                File file = new File();
+                if(new UrlResource(CommonUtil.objToString(crete.get("pfiFileUrl"))).exists()) {
+//                    FileInputStream zipSource = new FileInputStream(crete.get("pfiFileUrl")+"");//将需要压缩的文件格式化为输入流
+                    InputStream zipSource = getFileInputStream(crete.get("pfiFileUrl")+"");
+                    /**
+                     * 压缩条目不是具体独立的文件,而是压缩包文件列表中的列表项,称为条目,就像索引一样这里的name就是文件名,
+                     * 文件名和之前的重复就会导致文件被覆盖
+                     */
+                    //在压缩目录中文件的名字
+                    ZipEntry zipEntry = new ZipEntry(CommonUtil.objToString(crete.get("pfiFileName")));
+                    //定位该压缩条目位置,开始写入文件到压缩包中
+                    zipStream.putNextEntry(zipEntry);
+                    BufferedInputStream bufferStream = new BufferedInputStream(zipSource, 1024 * 10);
+                    int read = 0;
+                    byte[] buf = new byte[1024 * 10];
+                    while ((read = bufferStream.read(buf, 0, 1024 * 10)) != -1) {
+                        zipStream.write(buf, 0, read);
+                    }
+
+                    if(null != bufferStream){
+                        bufferStream.close();
+                    }
+                    if(null != zipSource){
+                        zipSource.close();
+                    }
+//                    file.delete();
+                }
+            }
+        } catch (Exception e) {
+            System.out.println("aaaaaaaaaaaaaaa");
+            e.printStackTrace();
+        } finally {
+            //关闭流
+            try {
+                if(null != zipStream){
+                    zipStream.flush();
+                    zipStream.close();
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
         }
         /** 压缩方法 */
-        FileOutputStream fos1= new FileOutputStream(new File(directory + "rzgl"+DateUtils.dateTimeNow()+ ".zip"));
-        toZip(directory,fos1 ,true);
-        File zipFile = new File(directory + "rzgl"+DateUtils.dateTimeNow()+ ".zip");
+//        generateFile(directory,"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", directory);
+            down(response, zipFileName, directory);
             zipFile.delete();
         }
         return null;
@@ -721,6 +811,7 @@ public class FinanceRecordController extends BaseController {
         //创建缓冲输入流
         BufferedInputStream bis = null;
         OutputStream outputStream = null;
+
         try {
             outputStream = response.getOutputStream();
 
@@ -754,142 +845,20 @@ public class FinanceRecordController extends BaseController {
             }
         }
     }
-    /**
-     * 下载远程文件并保存到本地
-     * @param remoteFilePath 远程文件路径
-     * @param localFilePath 本地文件路径(带文件名)
-     * @param directory     本地文件夹
-     */
-    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(directory);
-        //判断文件是否存在
-        if(!path.exists()){
-            path.mkdirs();
-        }
-        File f = new File( localFilePath );
-        try
-        {
-            urlfile = new URL(remoteFilePath);
-            httpUrl = (HttpURLConnection)urlfile.openConnection();
-            httpUrl.connect();
-            bis = new BufferedInputStream(httpUrl.getInputStream());
-            bos = new BufferedOutputStream(new FileOutputStream(f));
-            int len = 2048;
-            byte[] b = new byte[len];
-            while ((len = bis.read(b)) != -1)
-            {
-                bos.write(b, 0, len);
-            }
-            bos.flush();
-            bis.close();
-            httpUrl.disconnect();
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-        }
-        finally
-        {
-            try
-            {
-                bis.close();
-                bos.close();
-            }
-            catch (IOException e)
-            {
-                e.printStackTrace();
-            }
-        }
-        return f.getAbsolutePath();
-    }
 
 
-      /**
-       * 压缩成ZIP 方法     * @param srcDir 压缩文件夹路径
-       * @param out    压缩文件输出流
-       * @param KeepDirStructure  是否保留原来的目录结构,true:保留目录结构;
-       *                          false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
-       * @throws RuntimeException 压缩失败会抛出运行时异常
-       */
-    public static void toZip(String srcDir, OutputStream out, boolean KeepDirStructure) throws RuntimeException{
-        long start = System.currentTimeMillis();
-        ZipOutputStream zos = null ;
-        try {
-            zos = new ZipOutputStream(out);
-            File sourceFile = new File(srcDir);
-            compress(sourceFile,zos,sourceFile.getName(),KeepDirStructure);
-            long end = System.currentTimeMillis();
-             System.out.println("压缩完成,耗时:" + (end - start) +" ms");
-        } catch (Exception e) {
-                throw new RuntimeException("zip error from ZipUtils",e);
-        }finally{
-            if(zos != null){
-                try {
-                    zos.flush();
-                    zos.close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-
+    public static InputStream getFileInputStream(String path) throws Exception {
+            URL url = null;
+            url = new URL(path);
+            HttpURLConnection conn = (HttpURLConnection)url.openConnection();
+            //设置超时间为3秒
+            conn.setConnectTimeout(3*1000);
+            //防止屏蔽程序抓取而返回403错误
+            conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)");
+            //得到输入流
+            return conn.getInputStream();
     }
-      /**
-       * 递归压缩方法
-       * @param sourceFile 源文件
-       * @param zos        zip输出流
-       * @param name       压缩后的名称
-       * @param KeepDirStructure  是否保留原来的目录结构,true:保留目录结构;
-       *                          false:所有文件跑到压缩包根目录下(注意:不保留目录结构可能会出现同名文件,会压缩失败)
-       * @throws Exception
-       */
-    private static void compress(File sourceFile, ZipOutputStream zos, String name,
-                          boolean KeepDirStructure) throws Exception{
-        byte[] buf = new byte[2 * 1024];
-        if(sourceFile.isFile()){
-              // 向zip输出流中添加一个zip实体,构造器中name为zip实体的文件的名字
-                zos.putNextEntry(new ZipEntry(name));
-               // copy文件到zip输出流中
-                int len;
-               FileInputStream in = new FileInputStream(sourceFile);
-                while ((len = in.read(buf)) != -1){
-                        zos.write(buf, 0, len);
-                    }
-                // Complete the entry
-              zos.closeEntry();
-               in.close();
-        } else {
-                //是文件夹
-               File[] listFiles = sourceFile.listFiles();
-              if(listFiles == null || listFiles.length == 0){
-                    // 需要保留原来的文件结构时,需要对空文件夹进行处理
-                  if(KeepDirStructure){
-                        // 空文件夹的处理
-                       zos.putNextEntry(new ZipEntry(name + "/"));
-                        // 没有文件,不需要文件的copy
-                       zos.closeEntry();
-                  }
 
-              }else {
-                   for (File file : listFiles) {
-                        // 判断是否需要保留原来的文件结构
-                        if (KeepDirStructure) {
-                           // 注意:file.getName()前面需要带上父文件夹的名字加一斜杠,
-                            // 不然最后压缩包中就不能保留原来的文件结构,即:所有文件都跑到压缩包根目录下了
-                            compress(file, zos, name + "/" + file.getName(),KeepDirStructure);
-                        } else {
-                            compress(file, zos, file.getName(),KeepDirStructure);
-                        }
-
-                   }
-              }
-        }
-    }
 }
 

+ 32 - 45
sc-service/src/main/java/com/huyi/service/financeRecord/controller/RecordSealController.java

@@ -12,6 +12,7 @@ import com.tianhu.common.core.cfca.AxqCommonUtil;
 import com.tianhu.common.core.cfca.connector.HttpConnector;
 import com.tianhu.common.core.domain.R;
 import com.tianhu.common.core.utils.*;
+import com.tianhu.common.core.utils.pdf.WordPdfUtil;
 import com.tianhu.common.core.utils.poi.WordUtil;
 import com.tianhu.common.core.web.controller.BaseController;
 import com.tianhu.common.core.web.domain.AjaxResult;
@@ -93,6 +94,8 @@ public class RecordSealController extends BaseController {
     private IZcFinanceRecordService iZcFinanceRecordService;
     @Autowired
     private IZcFinanceProComRelService iZcFinanceProComRelService;
+    @Autowired
+    private IZcFinanceRecordFileRelService financeRecordFileRelService;
     /**
      * 获取合同文件
      * @param map
@@ -294,14 +297,15 @@ public class RecordSealController extends BaseController {
                 //调用替换word中的变量
                 WordUtil.wordTemplate(filePath,filePath,ps);
                 //加载word示例文档
-                Document doc = new Document();
-                doc.loadFromFile(filePath);
+//                Document doc = new Document();
+//                doc.loadFromFile(filePath);
                 //保存为PDF格式
                 //截取文件名称
                 //获取.的位置
                 int index  = fileNameList.get(i).indexOf(".");
                 String fileName = fileNameList.get(i).substring(0,index);
-                doc.saveToFile(directory + fileName + currecntDate + ".pdf", FileFormat.PDF);
+//                doc.saveToFile(directory + fileName + currecntDate + ".pdf", FileFormat.PDF);
+                WordPdfUtil.doc2pdf(filePath,directory + fileName + currecntDate + ".pdf");
                 filePath = directory + fileName + currecntDate + ".pdf";
                 File pdfFile = new File(filePath);
                 FileInputStream inputFile = new FileInputStream(pdfFile);
@@ -477,20 +481,12 @@ public class RecordSealController extends BaseController {
 
         for(int i = 0 ; i < fileInfList.size(); i++){
             //判断是否为已盖章文件
-            LambdaQueryWrapper<ZcFinanceFileRel> fileRelLambdaQueryWrapper = new LambdaQueryWrapper<>();
-            fileRelLambdaQueryWrapper.eq(ZcFinanceFileRel::getZffrFinanceId, zfiId);
-            fileRelLambdaQueryWrapper.eq(ZcFinanceFileRel::getZffrContractId, contractList.get(i).getZfcId());
-            // 核心企业盖章
-            if ("01".equals(tokenService.getLoginUser().getSysUser().getCompanyType())) {
-                // 查询融资企业是否盖章
-                fileRelLambdaQueryWrapper.eq(ZcFinanceFileRel::getZffrSupplierNode, code);
-                // 融资企业盖章
-            } else if ("02".equals(tokenService.getLoginUser().getSysUser().getCompanyType())) {
-                // 查询核心企业是否盖章
-                fileRelLambdaQueryWrapper.eq(ZcFinanceFileRel::getZffrCoreNode, code);
-            }
-
-            List<ZcFinanceFileRel> financeFileList = financeFileRelService.findZcFinanceFileRels(fileRelLambdaQueryWrapper);
+            LambdaQueryWrapper<ZcFinanceRecordFileRel> fileRelLambdaQueryWrapper = new LambdaQueryWrapper<>();
+            //融信id
+            fileRelLambdaQueryWrapper.eq(ZcFinanceRecordFileRel::getZfrfrFinanceId, zfiId);
+            //合同id
+            fileRelLambdaQueryWrapper.eq(ZcFinanceRecordFileRel::getZfrfrContractId, contractList.get(i).getZfcId());
+            List<ZcFinanceRecordFileRel> financeFileList = financeRecordFileRelService.findZcFinanceRecordFileRels(fileRelLambdaQueryWrapper);
 
             // 文件路径
             String filePath;
@@ -539,20 +535,21 @@ public class RecordSealController extends BaseController {
                 /**-------- word 变量替换 结束--------**/
                 /**-------- word 转PDF 开始--------**/
                 //加载word示例文档
-                Document doc = new Document();
-                doc.loadFromFile(filePath);
+//                Document doc = new Document();
+//                doc.loadFromFile(filePath);
                 //保存为PDF格式
                 //截取文件名称
                 //获取.的位置
                 int index  = fileInfList.get(i).getPfiFileName().indexOf(".");
                 fileName = fileInfList.get(i).getPfiFileName().substring(0,index);
-                doc.saveToFile(directory + fileName + currecntDate + ".pdf", FileFormat.PDF);
+//                doc.saveToFile(directory + fileName + currecntDate + ".pdf", FileFormat.PDF);
+                WordPdfUtil.doc2pdf(filePath,directory + fileName + currecntDate + ".pdf");
                 filePath = directory + fileName + currecntDate + ".pdf";
                 /**-------- word 转PDF 结束--------**/
                 // 是已盖章文件
             } else {
                 // 文件服务器的文件下载到本地
-                PubFileInf fileInf = fileInfService.getById(financeFileList.get(0).getZffrFileId());
+                PubFileInf fileInf = fileInfService.getById(financeFileList.get(0).getZfrfrFileId());
                 filePath = downloadFile(fileInf.getPfiFileUrl(), fileInf.getPfiFileName());
                 int index  = fileInf.getPfiFileName().indexOf(".");
                 fileName = fileInf.getPfiFileName().substring(0,index);
@@ -640,44 +637,34 @@ public class RecordSealController extends BaseController {
             MultipartFile multipartFile =new MockMultipartFile("file", file.getName(), "text/plain", IOUtils.toByteArray(input));
             R<com.tianhu.system.api.domain.PubFileInf> fileResult = remoteFileService.uploadFile(multipartFile,"01", "02","00",companyId,token);
 
-            ZcFinanceFileRel financeFileRel;
+            ZcFinanceRecordFileRel recordFileRel;
             // 不是已盖章文件
             if (financeFileList.size() == 0) {
                 // zc_finance_file_rel 存入数据
-                financeFileRel = new ZcFinanceFileRel();
-                financeFileRel.setZffrId(IdUtils.fastSimpleUUID());
-                financeFileRel.setZffrFinanceId(zfiId);
-                financeFileRel.setZffrContractId(contractList.get(i).getZfcId());
+                recordFileRel = new ZcFinanceRecordFileRel();
+                recordFileRel.setZfrfrId(IdUtils.fastSimpleUUID());
+                recordFileRel.setZfrfrFinanceId(zfiId);
+                recordFileRel.setZfrfrContractId(contractList.get(i).getZfcId());
                 // 已盖章文件
             } else {
                 // 修改zc_finance_file_rel 数据
-                financeFileRel = financeFileList.get(0);
-            }
-            financeFileRel.setZffrFileId(fileResult.getData().getPfiFileId());
-            financeFileRel.setZffrCfcaNumber(contractNo);
-            // 核心企业盖章
-            if ("01".equals(tokenService.getLoginUser().getSysUser().getCompanyType())) {
-                financeFileRel.setZffrCoreId(companyId);
-                financeFileRel.setZffrCoreUserId(tokenService.getLoginUser().getSysUser().getUserId());
-                financeFileRel.setZffrCoreTime(new Date());
-                financeFileRel.setZffrCoreNode(code);
-
-                // 融资企业盖章
-            } else if ("02".equals(tokenService.getLoginUser().getSysUser().getCompanyType())) {
-                financeFileRel.setZffrSupplierId(companyId);
-                financeFileRel.setZffrSupplierUserId(tokenService.getLoginUser().getSysUser().getUserId());
-                financeFileRel.setZffrSupplierTime(new Date());
-                financeFileRel.setZffrSupplierNode(code);
+                recordFileRel = financeFileList.get(0);
             }
+            recordFileRel.setZfrfrFileId(fileResult.getData().getPfiFileId());
+            recordFileRel.setZfrfrCfcaNumber(contractNo);
+            // 融资企业盖章
+            recordFileRel.setZfrfrSupplierId(companyId);
+            recordFileRel.setZfrfrSupplierUserId(tokenService.getLoginUser().getSysUser().getUserId());
+            recordFileRel.setZfrfrSupplierTime(new Date());
 
             // 不是已盖章文件
             if (financeFileList.size() == 0) {
                 // zc_finance_file_rel 存入数据
-                financeFileRelService.createZcFinanceFileRel(financeFileRel);
+                financeRecordFileRelService.createZcFinanceRecordFileRel(recordFileRel);
                 // 已盖章文件
             } else {
                 // 修改zc_finance_file_rel 数据
-                financeFileRelService.updateById(financeFileRel);
+                financeRecordFileRelService.updateById(recordFileRel);
             }
         }
         /**-------- 盖章完成修改融信状态和融资状态 开始--------**/

+ 16 - 8
sc-service/src/main/java/com/huyi/service/supplierCreditLine/controller/SupplierCreditLineController.java

@@ -105,8 +105,12 @@ public class SupplierCreditLineController extends BaseController {
         //企业名称
         map.put("scyName",scyName);
         //授信额度范围
-        map.put("AmountA",CommonUtil.objToBigDecimal(AmountA));
-        map.put("AmountB",CommonUtil.objToBigDecimal(AmountB));
+        if (CommonUtil.isNotEmpty(AmountA)) {
+            map.put("AmountA", CommonUtil.objToBigDecimal(AmountA));
+        }
+        if (CommonUtil.isNotEmpty(AmountB)) {
+            map.put("AmountB", CommonUtil.objToBigDecimal(AmountB));
+        }
         //状态(00:有效 01:失效)
         map.put("zfpcrStatus",zfpcrStatus);
         //核心企业授信额度ID
@@ -424,24 +428,28 @@ public class SupplierCreditLineController extends BaseController {
             //企业还款账户账号
             if(CommonUtil.isEmpty(zfsqAccount)){
                 failureNum++;
-                throw new Exception("<br/>第" + (i+1) + "还款账户账号不能为空");
+                throw new Exception("<br/>第" + (i+1) + "还款账户账号不能为空");
             }
             //还款账户开户行
             if(CommonUtil.isEmpty(zfsqAccountBank)){
                 failureNum++;
-                throw new Exception("<br/>第" + (i+1) + "还款账户开户行不能为空");
+                throw new Exception("<br/>第" + (i+1) + "还款账户开户行不能为空");
             }
             if (zfsqAccount.length() > 50){
                 failureNum++;
-                throw new Exception("<br/>第" + (i+1) + "企业还款账户长度过长");
+                throw new Exception("<br/>第" + (i+1) + "企业还款账户长度过长");
             }
             if (zfsqAccountBank.length() > 30){
                 failureNum++;
-                throw new Exception("<br/>第" + (i+1) + "企业还款账户开户行长度过长");
+                throw new Exception("<br/>第" + (i+1) + "行企业还款账户开户行长度过长");
+            }
+            if (CommonUtil.isEmpty(zfsqAmount)){
+                failureNum++;
+                throw new Exception("<br/>第" + (i+1) + "行授信额度不能为空");
             }
             if(AmtUtil.isMoney(zfsqAmount) == false){
                 failureNum++;
-                throw new Exception("<br/>第" + (i+1) + "行数据金额格式正确") ;
+                throw new Exception("<br/>第" + (i+1) + "行授信额度金额格式不正确") ;
             }
             //查询此企业是否存在
             queryWrapper.eq(SysCompany::getScyName,scyName);
@@ -472,7 +480,7 @@ public class SupplierCreditLineController extends BaseController {
             supplierWrapper.ne(ZcFinanceSupplierQuota::getZfsqStatus,"99");
             int count = iZcFinanceSupplierQuotaService.count(supplierWrapper);
             if (count > 0){
-                throw new Exception("此企业已经授信");
+                throw new Exception("<br/>第" + (i+1) + "行企业重复");
             }
             //查询核心企业授信额度ID下的供应商授信额度总和
             QueryWrapper<ZcFinanceSupplierQuota> quotaWrapper = new QueryWrapper<>();

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

@@ -38,10 +38,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="paramMap.scyName != null  and paramMap.scyName != ''">
             and c.scy_name like concat('%', #{paramMap.scyName}, '%')
         </if>
-        <if test="paramMap.AmountA != null  and paramMap.AmountA != ''">
+        <if test="paramMap.AmountA != null  and paramMap.AmountA != '' or paramMap.AmountA ==0 ">
             and r.zfpcr_amount &gt;= #{paramMap.AmountA}
         </if>
-        <if test="paramMap.AmountB != null  and paramMap.AmountB != ''">
+        <if test="paramMap.AmountB != null  and paramMap.AmountB != '' or paramMap.AmountB==0 ">
             and r.zfpcr_amount &lt;=  #{paramMap.AmountB}
         </if>
         <if test="paramMap.zfpcrStatus != null  and paramMap.zfpcrStatus != ''">

+ 4 - 4
sc-service/src/main/resources/mapper/supplierCreditLine/SupplierCreditLineMapper.xml

@@ -19,11 +19,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="paramMap.scyName != null  and paramMap.scyName != ''">
             and scy_name like concat('%', #{paramMap.scyName}, '%')
         </if>
-        <if test="paramMap.AmountA != null  and paramMap.AmountA != ''">
-            and zfpcr_amount &gt;= #{paramMap.AmountA}
+        <if test="paramMap.AmountA != null  and paramMap.AmountA != '' or paramMap.AmountA ==0 ">
+            and zfsq_amount &gt;= #{paramMap.AmountA}
         </if>
-        <if test="paramMap.AmountB != null  and paramMap.AmountB != ''">
-            and zfpcr_amount &lt;=  #{paramMap.AmountB}
+        <if test="paramMap.AmountB != null  and paramMap.AmountB != '' or paramMap.AmountB==0 ">
+            and zfsq_amount &lt;=  #{paramMap.AmountB}
         </if>
         <if test="paramMap.zfpcrStatus != null  and paramMap.zfpcrStatus != ''">
             and zfpcr_status = #{paramMap.zfpcrStatus}