修复主数据新增接报错

This commit is contained in:
yuqh 2024-09-12 13:37:34 +08:00
parent 18391d9f95
commit 08c8cb3e30
2 changed files with 11 additions and 9 deletions

View File

@ -75,7 +75,7 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
if("10007".equals(mdmCode)){
continue;
}
// if(!"10003".equals(mdmCode)){
// if(!"10011".equals(mdmCode)){
// continue;
// }
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+"'");
}
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);
List<HashMap<String, Object>> hashMaps = masterDataDaoImpl.queryArchivesByDataSource(stringBuffer.toString(),mdmModuleSourceEntity);
if(CollectionUtils.isNotEmpty(hashMaps)){
@ -194,7 +194,7 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
sb.append(" and a.dModifyDate <> '"+endTime+"'");
}
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'");
mdmModuleSourceEntity.setDataSourceCode(dbCode);
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+"'");
}
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'");
mdmModuleSourceEntity.setDataSourceCode(dbCode);
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{
for (JSONObject hashMap : hashMaps) {
JSONObject main = hashMap.getJSONObject(tableName);
logger.info("主数据保存前参数"+main.toString());
JSONObject jsonObjectUser = new JSONObject();
JSONObject jsonStr = new JSONObject();
jsonObjectUser.put("data_id", main.get("data_id"));
@ -369,6 +369,7 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
Object attribute = comparisonServiceimpl.queryEntityPage(jsonStr);
logger.info("得到的attribute值为{}", JSON.toJSONString(attribute));
JSONObject jsonObjectAttribute = (JSONObject) JSON.toJSON(attribute);
logger.info("得到的jsonObjectAttribute值为{}", JSON.toJSONString(jsonObjectAttribute));
JSONArray jsonArrayList = jsonObjectAttribute.getJSONObject("pageInfo").getJSONArray("list");
//如果jsonArrayList为null说明没有值在表中不存在
if (jsonArrayList == null || jsonArrayList.size() == 0) {
@ -383,6 +384,7 @@ public class MasterDataServiceImpl extends BaseService<ComparisonEntity, String>
hashMap.put("mdmCode", mdmCode);
hashMap.put("optionName", "数智中台");
jsonStr.put("jsonStr", hashMap);
logger.info("主数据新增参数为:{}", JSON.toJSONString(jsonStr));
Object result = comparisonServiceimpl.saveEntity(jsonStr);
logger.info("新增结果为:{}", JSON.toJSONString(result));
// if(!result.isFlag()){

View File

@ -107,9 +107,9 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
List<Map<String,Object>> comparisonEntitiePages = comparisonDao.queryComparisonPage(comparisonEntity);
//递归查询组织树
if(map.get("viewName").equals("1")){
return recursiveQueryComparison(comparisonEntitiePages,comparisonEntity);
}
// if(map.get("viewName").equals("1")){
// return recursiveQueryComparison(comparisonEntitiePages,comparisonEntity);
// }
if(CollectionUtils.isNotEmpty(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);
jsonObjectList.put(comparisonEntityOne.getDbName(), map);