master
admin 2 years ago
parent 062def2485
commit 1b2a6d7c8b

@ -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<Map<String,Object>> 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 {
@ -628,7 +631,7 @@ public class IdcServiceImpl implements IdcService {
/*按表名解析数据到数据库,子表暂未处理*/
private boolean analyData(String tableName,String uniqueColumn,List<Map<String,Object>> list) {
logger.error("ana-->"+tableName+"--list-->"+JSON.toJSONString(list));
String tName = DBAUtils.tableRealName(tableName);
String sql="replace "+tName +"(";
String del="delete from "+tName+" where ";

Loading…
Cancel
Save