使用传入的id
This commit is contained in:
parent
4b27586193
commit
cc866f471d
|
@ -165,6 +165,9 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
String main = jsonObject.getString(keyPair.getKey());
|
||||
if(main!=null){
|
||||
jsonObjectMain = JSONObject.parseObject(main);
|
||||
if(!checkStr(jsonObjectMain.getString("id"))){
|
||||
return BaseResult.getFailureMessageEntity("新增时候主表id不能为空");
|
||||
}
|
||||
}
|
||||
}
|
||||
//如果是2,就是明细表,根据查询出来得子表是否是传输传递得子表
|
||||
|
@ -174,6 +177,9 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject jsonObjectDetails = jsonArray.getJSONObject(i);
|
||||
jsonObjectDetails.put("table_name", keyPair.getKey());
|
||||
if(!checkStr(jsonObjectDetails.getString("id"))){
|
||||
return BaseResult.getFailureMessageEntity("新增时候明细id不能为空");
|
||||
}
|
||||
}
|
||||
arrayList.add(jsonArray);
|
||||
}
|
||||
|
@ -184,14 +190,6 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
List<List<Map<String, Object>>> mapDetails = new ArrayList<>();//将子表数据存到map中
|
||||
if (comparisonEntities != null && comparisonEntities.size() > 0) {
|
||||
map = spliceMainMap(comparisonEntities, jsonObjectMain, map, comparisonEntity, comparisonDetailsEntity);
|
||||
String uuid = null;
|
||||
if (jsonObjectMain.getString("id") == null) {
|
||||
uuid = UUIDUtils.getUUID();
|
||||
map.put("id", uuid);
|
||||
} else {
|
||||
uuid = jsonObjectMain.getString("id");
|
||||
map.put("id", jsonObjectMain.getString("id"));
|
||||
}
|
||||
map.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
map.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
map.put("org_id", "0");
|
||||
|
@ -250,7 +248,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
for (Map<String, Object> stringObjectMap : mapDetail) {
|
||||
String uuidDetail = UUIDUtils.getUUID();
|
||||
stringObjectMap.put("id", uuidDetail);
|
||||
stringObjectMap.put("formmain_id", uuid);
|
||||
stringObjectMap.put("formmain_id", jsonObjectMain.getString("id"));
|
||||
stringObjectMap.put("create_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
stringObjectMap.put("modify_user_id", "c796fd9ba4c9f5ff3cc2fa41a040e443");
|
||||
stringObjectMap.put("org_id", "0");
|
||||
|
@ -274,7 +272,7 @@ public class ComparisonServiceImpl extends BaseService<ComparisonEntity, String>
|
|||
}
|
||||
list.add(jsonObjectList);
|
||||
//保存操作日志
|
||||
controlsLogDaoimpl.saveControlsLog(uuid,jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log");
|
||||
controlsLogDaoimpl.saveControlsLog(jsonObjectMain.getString("id"),jsonObject.getString("appName"),jsonObject.getString("appCode"),jsonObject.toJSONString(),"接口新增",jsonObject.getString("optionName"),comparisonEntityRule.getDbName()+"_option_log");
|
||||
return BaseResult.getSuccessMessageEntity("保存成功", list);
|
||||
} catch (Exception e) {
|
||||
logger.info("保存通用数据时候错误:{}", e.getMessage());
|
||||
|
|
Loading…
Reference in New Issue