From 2a4960fbbd823a640bb018a6c898062aabe7a542 Mon Sep 17 00:00:00 2001 From: chengqf <584883665@139.com> Date: Fri, 14 Apr 2023 06:41:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8C=E6=AD=A5=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=97=B6=E9=97=B4=E6=9D=A1=E4=BB=B6=E5=88=B0=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/idc/service/impl/IdcServiceImpl.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java index 01788796a..48044d605 100644 --- a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java +++ b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java @@ -282,8 +282,8 @@ public class IdcServiceImpl implements IdcService { if (!StringUtils.isEmpty(updateTimeColumn)) { - sqlWhere += " " + updateTimeColumn + ">= cast('" + lastUpdateTime + "' as datetime)";// and date_add(cast('"+DateUtil.formatDate(nowUpdateTime, "yyyy-MM-dd HH:mm:ss")+"' as datetime),INTERVAL 1 day)"; - sqlWhere += " and not exists (select fkId from idc_record where type='" + tnames[2] + "' and fkId=" + tnames[2] + "." + keyColumn + " and createTime>date_sub(now(),interval 15 MINUTE))"; + sqlWhere += " " + updateTimeColumn + " between cast('" + lastUpdateTime + "' as datetime) and cast('"+DateUtil.formatDate(nowUpdateTime, "yyyy-MM-dd HH:mm:ss")+"' as datetime)"; + //sqlWhere += " and not exists (select fkId from idc_record where type='" + tnames[2] + "' and fkId=" + tnames[2] + "." + keyColumn + " and createTime>date_sub(now(),interval 15 MINUTE))"; } else { sqlWhere = "not exists (select fkId from idc_record where type='" + tnames[2] + "' and fkId=" + tnames[2] + "." + keyColumn + ")"; map.put("isEnd", "1"); @@ -1023,8 +1023,9 @@ public class IdcServiceImpl implements IdcService { .build(); try { Response result = client.newCall(request).execute(); - + String msg = result!=null ? result.message().length()>200 ? result.message().substring(0,200) : result.message() : ""; int total = 0; + if (result!=null&&result.isSuccessful()&&MediaType.parse("application/force-download").equals(result.body().contentType())) { try (InputStream inputStream = result.body().byteStream()) { @@ -1054,10 +1055,11 @@ public class IdcServiceImpl implements IdcService { } } if(!(total>0)) { - String sql = "replace idc_file (filePath,createTime) values ('"+fileName+"',now())"; + String sql = "replace idc_file (filePath,createTime,msg) values ('"+fileName+"',now(),'"+msg+"')"; executeSql(sql); } + } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); @@ -1230,6 +1232,7 @@ public class IdcServiceImpl implements IdcService { executeSql("alter table basic_export_status add column msg varchar(255)"); executeSql("alter table basic_upload_status add column msg varchar(255)"); executeSql("alter table basic_download_status add column msg varchar(255)"); + executeSql("alter table idc_file add column msg varchar(255)"); executeSql("create index i_idc_file_create_time on idc_file (createTime asc)"); } catch (Exception e) {