• 对于数据库中 “123456”,这样的方式的处理, 用format处理,去除


    /**
         * 保理线下风控审核后指定文件覆盖归档
         * @param payId
         *         付款确认书的uuid
         * @throws ActiveRecordException 
         */
        public void getFactoringOfflineFileArchive(QhyfController ctl,String payId ) throws ActiveRecordException {
            //获取配置的可以覆盖的归档的文件的ID
            String archiveSql= 
                    "SELECT   " +
                            "    a.cover_archive_file_id    " +
                            "FROM   " +
                            "    biz_pre_import_configuration a,   " +
                            "    biz_pay_comfirm_info b    " +
                            "WHERE   " +
                            "    b.uuid = ?   " +
                            "    AND a.coreid = b.core_enterprise_id    " +
                            "    AND a.financial_institutions_id = b.financial_institutions_id    " +
                            "    AND a.sys_status = 1    " +
                            "    AND b.sys_status = 1" ;
            Record archiveRecord=Db.findFirst(archiveSql,payId);
            // 如果覆盖归档的文件id不为空
            if(archiveRecord !=null && StringUtils.isNotBlank(archiveRecord.getStr("coverArchiveFileId"))){
                //拆分归档文件的id
                String[] coverArchiveFileIdArray = archiveRecord.getStr("coverArchiveFileId").split(",");
                for (String coverArchiveFileId: coverArchiveFileIdArray) {
                    // 查询该文件的单个文件的最新表的信息
                    String newSql = String.format(""+
                            " SELECT " +
                            "     a.upload_file_id " +
                            " FROM " +
                            "     biz_newest_single_file a " +
                            " WHERE " +
                            "     a.biz_id = ? " +
                            "     AND a.document_id = %s " +
                            "     AND a.sys_status = 1 ", coverArchiveFileId);
                    Record newFile = Db.findFirst(newSql, payId);
                    //如果该文件的单个文件最新表信息不为空 
                    if (newFile != null && StringUtils.isNotBlank(newFile.getStr("uploadFileId"))) {
                        String    uploadFileId = newFile.getStr("uploadFileId");
                        //查询该文件的归档信息
                        String archiveInformationSql = String.format(""+
                                        " SELECT " +
                                        "     b.uuid ," +
                                        "   b.upload_file_id"+
                                        " FROM " +
                                        "     biz_archive a " +
                                        " LEFT JOIN biz_archive_detail b " +
                                        " ON a.uuid = b.archive_id " +
                                        " WHERE " +
                                        "     a.biz_id = ? " +
                                        "     AND b.file_id = %s " +
                                        "     AND a.sys_status = 1 " +
                                        "     AND b.sys_status = 1 ", coverArchiveFileId);
                        Record archiveInformationRecord = Db.findFirst(archiveInformationSql, payId);
                        // 归档明细履历表备注
                        String archiveDetailHistoryMemo = "风控审核后指定文件覆盖归档";
                        coverArchiveFileId = coverArchiveFileId.replaceAll("'", "");
                        // 如果该文件的归档信息不为空
                        if (archiveInformationRecord != null) {
                            //单个文件最新表的文件信息与归纳表中不一致的话
                            if (!uploadFileId.equals(archiveInformationRecord.getStr("uploadFileId"))) {
                                // 直接将单个文件的最新表的信息写入归档表中,追加归档履历
                                this.dirctArchive(ctl, payId, coverArchiveFileId, uploadFileId, archiveDetailHistoryMemo);
                            } 
                        // 如果该文件的归档信息为空
                        }else{
                            //为空直接将单个文件的最新表的信息写入归档表中,追加归档履历
                            this.dirctArchive(ctl, payId, coverArchiveFileId, uploadFileId, archiveDetailHistoryMemo);
                        }
                    }    
                }
            }
        }

     保存的数据自身带引号, 用format一下,就去除了

  • 相关阅读:
    构建之法读书笔记 第4章 两人合作
    ASE19 团队项目 alpha 阶段 Frontend 组 scrum9 记录
    ASE —— 第二次结对作业
    ASE —— 第一次结对作业
    高级软件工程 —— 第一周博客作业
    软工个人总结
    六月上团队项目心得
    团队项目心得
    结对编程收获
    结对作业——随机生成四则运算(Core 第7组)
  • 原文地址:https://www.cnblogs.com/xiaoniuniu886/p/10034336.html
Copyright © 2020-2023  润新知