主数据修改状态逻辑修改

This commit is contained in:
lvleigang 2024-11-13 10:49:00 +08:00
parent 5a63afd7d8
commit f73d39fe1c
1 changed files with 15 additions and 9 deletions

View File

@ -452,6 +452,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
}
}
} catch (Exception e) {
logger.info("执行异常错误原因:"+e);
logger.error("新增返回脚本解析保存三方id错误"+jsonResultEntity.getAttribute());
taskDetailEntity.setResult("新增返回脚本解析保存三方id错误");
taskLivingDetailsService.updateLogFailToSuccess(taskDetailEntity);
@ -543,7 +544,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
map1.put("dataStatus", "N");
map1.put("deleteStatus", "0");
map1.put("size", 10);
map1.put("size", 50);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);
@ -738,7 +739,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
//map1.put("dataStatus", "F");
map1.put("updateStatus", "0");
map1.put("size", 10);
map1.put("size", 50);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);
@ -926,7 +927,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
map1.put("tableName",mainDb);
//map1.put("dataStatus", "Y");
map1.put("addStatus", "0");
map1.put("size", 100);
map1.put("size", 50);
objects = mdmModuleDao.queryMdmSTs(map1);
objects = toLowerCaseKeys(objects);
@ -991,6 +992,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
mdmModuleSendLogEntity.setTableName(mainDb+"_send_log");
mdmModuleSendLogEntity.setFormmainId(doObjects.get(i).getString("id"));
mdmModuleSendLogEntity.setSts("Y");
mdmModuleSendLogEntity.setDataType("1");
mdmModuleSendLogEntity.setAppId(sysApplicationEntity.getId());
mdmModuleSendLogEntity.setApiId(apiEntity.getId());
//mdmModuleSendLogEntity.setDistributeId(mdmModuleDistributeEntities.get(i1).getId());
@ -1121,10 +1123,12 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
}
//保存日志
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"1","发送成功",mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1");
objects.get(i).put("sendsanfzt123",true);
continue;
}else {
//保存日志
saveMdmModuleSendLogEntity(mainCode,mdmModuleDistributeEntities.get(i1).getId(),"2","转发失败:"+jsonResultEntity.getAttribute(),mainDb,objects.get(i).getString("id"),sysApplicationEntity.getName(),sysApplicationEntity.getId(),apiEntity.getApiName(),apiEntity.getId(),doObjects.get(i).toJSONString(),"1");
objects.get(i).put("sendsanfzt123",false);
continue;
}
}
@ -1132,6 +1136,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
//所有下发发送完成修改数据状态
for (int i = 0; i < objects.size(); i++) {
if(objects.get(i).getBoolean("sendsanfzt123")){
Map<String, Object> updateMap = new HashMap<>();
updateMap.put("tableName",mainDb);
//updateMap.put("dataStatus", "Y");
@ -1140,6 +1145,7 @@ public class MdmModulePluginInitializer extends PluginBaseEntity {
mdmModuleDao.updateMdmSTs(updateMap);
}
}
}
private void saveMdmModuleSendLogEntity(Long mdmCode,String distributeId,String dataType,String remark,String dbname,String formmain_id, String target_app, String appId, String target_api,String apiID, String source_data, String option_type) throws Exception {
MdmModuleSendLogEntity mdmModuleSendLogEntity = new MdmModuleSendLogEntity();