修复主数据新增接报错
This commit is contained in:
parent
18391d9f95
commit
08c8cb3e30
|
@ -75,7 +75,7 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
if("10007".equals(mdmCode)){
|
if("10007".equals(mdmCode)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// if(!"10003".equals(mdmCode)){
|
// if(!"10011".equals(mdmCode)){
|
||||||
// continue;
|
// continue;
|
||||||
// }
|
// }
|
||||||
switch (appTyp) {//1、致远OA 2、用友U8C 3、用友BIP 5。用友U8
|
switch (appTyp) {//1、致远OA 2、用友U8C 3、用友BIP 5。用友U8
|
||||||
|
@ -149,7 +149,7 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
sb.append(" and a.dModifyDate <> '"+endTime+"'");
|
sb.append(" and a.dModifyDate <> '"+endTime+"'");
|
||||||
}
|
}
|
||||||
StringBuffer stringBuffer = new StringBuffer();
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
stringBuffer.append("select * from v_hzya_Customer a WHERE 1=1 " +sb.toString());
|
stringBuffer.append("select * from v_hzya_Customer a WHERE 1=1 " +sb.toString());
|
||||||
mdmModuleSourceEntity.setDataSourceCode(dbCode);
|
mdmModuleSourceEntity.setDataSourceCode(dbCode);
|
||||||
List<HashMap<String, Object>> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
|
List<HashMap<String, Object>> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
|
||||||
if(CollectionUtils.isNotEmpty(hashMaps)){
|
if(CollectionUtils.isNotEmpty(hashMaps)){
|
||||||
|
@ -194,7 +194,7 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
sb.append(" and a.dModifyDate <> '"+endTime+"'");
|
sb.append(" and a.dModifyDate <> '"+endTime+"'");
|
||||||
}
|
}
|
||||||
StringBuffer stringBuffer = new StringBuffer();
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
stringBuffer.append("select * from v_hzya_Warehouse a where 1=1 " + sb.toString());
|
stringBuffer.append("select * from v_hzya_Warehouse a where 1=1 " +sb.toString());
|
||||||
// " WHERE 1=1 and a.id = '-2698997042624247722'");
|
// " WHERE 1=1 and a.id = '-2698997042624247722'");
|
||||||
mdmModuleSourceEntity.setDataSourceCode(dbCode);
|
mdmModuleSourceEntity.setDataSourceCode(dbCode);
|
||||||
List<HashMap<String, Object>> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
|
List<HashMap<String, Object>> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
|
||||||
|
@ -225,7 +225,7 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
sb.append(" and a.dModifyDate <> '"+endTime+"'");
|
sb.append(" and a.dModifyDate <> '"+endTime+"'");
|
||||||
}
|
}
|
||||||
StringBuffer stringBuffer = new StringBuffer();
|
StringBuffer stringBuffer = new StringBuffer();
|
||||||
stringBuffer.append("select * from v_hzya_Inventory a where 1=1 " + sb.toString());
|
stringBuffer.append("select * from v_hzya_Inventory a where 1=1 " +sb.toString());
|
||||||
// " WHERE 1=1 and a.id = '-2698997042624247722'");
|
// " WHERE 1=1 and a.id = '-2698997042624247722'");
|
||||||
mdmModuleSourceEntity.setDataSourceCode(dbCode);
|
mdmModuleSourceEntity.setDataSourceCode(dbCode);
|
||||||
List<HashMap<String, Object>> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
|
List<HashMap<String, Object>> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
|
||||||
|
@ -359,7 +359,7 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List<JSONObject> hashMaps,String mdmCode,String tableName)throws Exception{
|
public JsonResultEntity ParametricAssembly(MdmModuleSourceEntity mdmModuleSourceEntity,List<JSONObject> hashMaps,String mdmCode,String tableName)throws Exception{
|
||||||
for (JSONObject hashMap : hashMaps) {
|
for (JSONObject hashMap : hashMaps) {
|
||||||
JSONObject main = hashMap.getJSONObject(tableName);
|
JSONObject main = hashMap.getJSONObject(tableName);
|
||||||
|
logger.info("主数据保存前参数"+main.toString());
|
||||||
JSONObject jsonObjectUser = new JSONObject();
|
JSONObject jsonObjectUser = new JSONObject();
|
||||||
JSONObject jsonStr = new JSONObject();
|
JSONObject jsonStr = new JSONObject();
|
||||||
jsonObjectUser.put("data_id", main.get("data_id"));
|
jsonObjectUser.put("data_id", main.get("data_id"));
|
||||||
|
@ -369,6 +369,7 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
Object attribute = comparisonServiceimpl.queryEntityPage(jsonStr);
|
Object attribute = comparisonServiceimpl.queryEntityPage(jsonStr);
|
||||||
logger.info("得到的attribute值为:{}", JSON.toJSONString(attribute));
|
logger.info("得到的attribute值为:{}", JSON.toJSONString(attribute));
|
||||||
JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute);
|
JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute);
|
||||||
|
logger.info("得到的jsonObjectAttribute值为:{}", JSON.toJSONString(jsonObjectAttribute));
|
||||||
JSONArray jsonArrayList = jsonObjectAttribute.getJSONObject("pageInfo").getJSONArray("list");
|
JSONArray jsonArrayList = jsonObjectAttribute.getJSONObject("pageInfo").getJSONArray("list");
|
||||||
//如果jsonArrayList为null,说明没有值,在表中不存在
|
//如果jsonArrayList为null,说明没有值,在表中不存在
|
||||||
if (jsonArrayList == null || jsonArrayList.size() == 0) {
|
if (jsonArrayList == null || jsonArrayList.size() == 0) {
|
||||||
|
@ -383,6 +384,7 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
hashMap.put("mdmCode", mdmCode);
|
hashMap.put("mdmCode", mdmCode);
|
||||||
hashMap.put("optionName", "数智中台");
|
hashMap.put("optionName", "数智中台");
|
||||||
jsonStr.put("jsonStr", hashMap);
|
jsonStr.put("jsonStr", hashMap);
|
||||||
|
logger.info("主数据新增参数为:{}", JSON.toJSONString(jsonStr));
|
||||||
Object result = comparisonServiceimpl.saveEntity(jsonStr);
|
Object result = comparisonServiceimpl.saveEntity(jsonStr);
|
||||||
logger.info("新增结果为:{}", JSON.toJSONString(result));
|
logger.info("新增结果为:{}", JSON.toJSONString(result));
|
||||||
// if(!result.isFlag()){
|
// if(!result.isFlag()){
|
||||||
|
|
|
@ -107,9 +107,9 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
List<Map<String,Object>> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity);
|
List<Map<String,Object>> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity);
|
||||||
|
|
||||||
//递归查询组织树
|
//递归查询组织树
|
||||||
if(map.get("viewName").equals("1")){
|
// if(map.get("viewName").equals("1")){
|
||||||
return recursiveQueryComparison(comparisonEntitiePages,comparisonEntity);
|
// return recursiveQueryComparison(comparisonEntitiePages,comparisonEntity);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if(CollectionUtils.isNotEmpty(comparisonEntitiePages)){
|
if(CollectionUtils.isNotEmpty(comparisonEntitiePages)){
|
||||||
for (Map<String, Object> comparisonEntitiePage : comparisonEntitiePages) {
|
for (Map<String, Object> comparisonEntitiePage : comparisonEntitiePages) {
|
||||||
|
@ -337,7 +337,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
logger.info("保存通用数据时候,获取到的主表数据为:{}",JSON.toJSONString(comparisonEntityRule) );
|
||||||
//保存主表数据
|
//保存主表数据
|
||||||
ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule);
|
ComparisonEntity comparisonEntityOne = comparisonDao.saveComparison(comparisonEntityRule);
|
||||||
jsonObjectList.put(comparisonEntityOne.getDbName(), map);
|
jsonObjectList.put(comparisonEntityOne.getDbName(), map);
|
||||||
|
|
Loading…
Reference in New Issue