From db30e0d7a81bcdb90b28e9c2e630e9db624d8bc0 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 2 Apr 2023 12:45:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../idc/service/impl/IdcServiceImpl.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java b/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java index d1d1c44..8115645 100644 --- a/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java +++ b/api-admin/src/main/java/com/glxp/sale/admin/idc/service/impl/IdcServiceImpl.java @@ -78,8 +78,7 @@ public class IdcServiceImpl implements IdcService { "basicThirdProducts//thr_products/id///updateTime///第三方产品信息","//sup_cert/id///updateTime/filePath//资质证书信息", "//sup_cert_set/id///updateTime///供应商资质证书设置","companyCert//sup_company/customerId///updateTime///配送企业", "manufacturerCert//sup_manufacturer/id///updateTime///生产企业","productCert//sup_product/id///updateTime///产品资质信息", - "//udicompany/id///updateTime///国际库医疗器械注册人信息"}; - //"dbDiProducts//productinfo/id///updateTime///DI产品信息", + "dbDiProducts//productinfo/id///updateTime///DI产品信息","//udicompany/id///updateTime///国际库医疗器械注册人信息"}; private int orderNum=0; @@ -109,7 +108,13 @@ public class IdcServiceImpl implements IdcService { if(map==null) ResultVOUtils.error(9000, "下载任务不存在"); String json = FileUtils.readFileAll(map.get("cacheFilePath").toString()); + logger.info("download-->"+json); JSONObject object = JSON.parseObject(json); + if(object!=null&&object.getInteger("code")==20000) { + BaseResponse response = JSON.parseObject(json,BaseResponse.class); + return response; + } + return ResultVOUtils.success(object); } @@ -598,7 +603,15 @@ public class IdcServiceImpl implements IdcService { /*解析到数据库*/ private boolean analyToDB(JSONObject jsonObject,MultipartFile[] files) { if(!StringUtils.isEmpty(jsonObject.getString("tableName"))) { - List> list = jsonObject.getObject("data", List.class); + JSONObject object = jsonObject.getJSONObject("data"); + List> list = new ArrayList<>(); + + if(object instanceof List) { + list = jsonObject.getObject("data", List.class); + } else { + if(object.get("data")!=null) + list = object.getObject("data", List.class); + } return analyData(jsonObject.getString("tableName"),jsonObject.getString("uniqueColumn"),list); //图片处理 }