From 70ec8d995ef2a10afdd7ec298e77598a93985232 Mon Sep 17 00:00:00 2001 From: admin Date: Sun, 2 Apr 2023 17:05:34 +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 | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 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 c65ebfe..add22c1 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,8 @@ 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///产品资质信息", - "dbDiProducts//productinfo/id///updateTime///DI产品信息","//udicompany/id///updateTime///国际库医疗器械注册人信息"}; - + "//udicompany/id///updateTime///国际库医疗器械注册人信息"}; + //"dbDiProducts//productinfo/id///updateTime///DI产品信息", private int orderNum=0; @Resource @@ -601,21 +601,24 @@ public class IdcServiceImpl implements IdcService { /*解析到数据库*/ private boolean analyToDB(JSONObject jsonObject,MultipartFile[] files) { - if(jsonObject.getJSONObject("data")!=null) { + + if(jsonObject.get("data")!=null) { + logger.error("json>>>>>>>>>"); String tableName = ""; String uniqueColumn = ""; - JSONObject object = jsonObject.getJSONObject("data"); + Object object = jsonObject.get("data"); List> list = new ArrayList<>(); if(object instanceof List) { list = jsonObject.getObject("data", List.class); tableName = jsonObject.getString("tableName"); uniqueColumn = jsonObject.getString("uniqueColumn"); } else { - list = object.getObject("data", List.class); - tableName = object.getString("tableName"); - uniqueColumn = object.getString("uniqueColumn"); + JSONObject obj = jsonObject.getJSONObject("data"); + list = obj.getObject("data", List.class); + tableName = obj.getString("tableName"); + uniqueColumn = obj.getString("uniqueColumn"); } - + logger.error("table-->"+tableName); if(!StringUtils.isEmpty(tableName)) { return analyData(tableName,uniqueColumn,list); } else { @@ -626,7 +629,6 @@ public class IdcServiceImpl implements IdcService { return false; } - /*按表名解析数据到数据库,子表暂未处理*/ private boolean analyData(String tableName,String uniqueColumn,List> list) {