提交 3172d15e authored 作者: inroi's avatar inroi

微调

上级 320a9559
......@@ -46,7 +46,7 @@ public class MallCommonSyncApi {
List<Object> objectList = JsonUtil.toList(JsonUtil.toString(map.get("data")), Object.class);
List<Map<String, Object>> dataList = objectList.stream().map(m -> JsonUtil.toMap(JsonUtil.toString(m), String.class, Object.class)).collect(Collectors.toList());
this.databaseTableDataCreate(config.get("sFormId"), queueId, dataList);
this.databaseTableDataCreate(config.get("docType"), queueId, dataList);
result.put("data", CommonApi.encapsulationData(config, dataList, fieldList));
result.put("success", true);
}
......@@ -61,8 +61,8 @@ public class MallCommonSyncApi {
return result;
}
private void databaseTableDataCreate(String sFormId, String queueId, List<Map<String, Object>> dataList) {
TableStructureListOutVoRecords records = databaseTableMapper.tableStructureOne(sFormId);
private void databaseTableDataCreate(String docType, String queueId, List<Map<String, Object>> dataList) {
TableStructureListOutVoRecords records = databaseTableMapper.tableStructureOne(docType);
if (StringUtil.isNotNull(records)) {
List<TableStructureCreateInVoRecords> recordsList = TableStructureUtil.getFieldList(records.getFormJson());
List<String> dbFieldList = recordsList.stream().map(TableStructureCreateInVoRecords::getDbFieldName).collect(Collectors.toList());
......@@ -80,7 +80,7 @@ public class MallCommonSyncApi {
try {
databaseTableMapper.databaseTableDataCreate(records.getDbTableName(), dbFieldList, tempList);
} catch (Exception e) {
System.out.println("数据库表: " + sFormId.toLowerCase() + " 唯一标识: " + queueId + " 的数据创建失败");
System.out.println("数据库表: " + records.getDbTableName() + " 唯一标识: " + queueId + " 的数据创建失败");
}
}
}
......
......@@ -85,7 +85,7 @@ public class IMallSyncServiceImpl implements IMallSyncService {
//记录第三方日志
productLogUtil.productHttpLogCreate(Integer.valueOf(config.get("productId")), queueId, id, config.get("name"), config.get("docType"), config.get("direction"), JsonUtil.toString(request), response);
TableStructureListOutVoRecords records = databaseTableMapper.tableStructureOne(config.get("sFormId"));
TableStructureListOutVoRecords records = databaseTableMapper.tableStructureOne(config.get("docType"));
Map<String, Object> map = JsonUtil.toMap(response, String.class, Object.class);
if (!CollectionUtils.isEmpty(map)) {
if (!MallConstants.SUCCESS_CODE.equals(map.get(MallConstants.CODE_NAME))) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论