|
@@ -189,6 +189,11 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
tableInfo.setRecordTime(dataInfo2.getString("recordTime"));
|
|
|
}
|
|
|
//huangjn 日志所选时间
|
|
|
+ //huangjn 每份填报数据的id,目前日志专用
|
|
|
+ if(dataInfo2.containsKey("id")){
|
|
|
+ tableInfo.setBusinessId(dataInfo2.getString("id"));
|
|
|
+ }
|
|
|
+ //huangjn 每份填报数据的id,目前日志专用
|
|
|
|
|
|
dataInfo2.fluentRemove("contractId")
|
|
|
.fluentRemove("pkeyId")
|
|
@@ -311,7 +316,6 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- List<JSONObject> linkTabIds = JSONArray.parseArray(JSONObject.toJSONString(tableInfoList.get(0).getLinkTabIds()), JSONObject.class);
|
|
|
|
|
|
if(StringUtils.isNotEmpty(businessId)){
|
|
|
//删除旧数据
|
|
@@ -319,6 +323,8 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
this.jdbcTemplate.execute(delSql);
|
|
|
}
|
|
|
|
|
|
+ List<JSONObject> logWbsList = new ArrayList<>();
|
|
|
+
|
|
|
for(TableInfo tableInfo : tableInfoList){
|
|
|
WbsTreePrivate wbsTreePrivate = this.wbsTreePrivateService.getOne(Wrappers.<WbsTreePrivate>lambdaQuery().eq(WbsTreePrivate::getPKeyId, tableInfo.getPkeyId()));
|
|
|
if(wbsTreePrivate == null){
|
|
@@ -326,10 +332,15 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}
|
|
|
String tabName = wbsTreePrivate.getInitTableName();
|
|
|
|
|
|
+ String id = tableInfo.getBusinessId();
|
|
|
+ if(StringUtils.isEmpty(id)){
|
|
|
+ id = SnowFlakeUtil.getId() + "";
|
|
|
+ }
|
|
|
+
|
|
|
//拼接SQL
|
|
|
StringBuilder sql = new StringBuilder("INSERT INTO " + tabName ),
|
|
|
keySql = new StringBuilder("id, group_id"),
|
|
|
- valSql = new StringBuilder("" + SnowFlakeUtil.getId() + ", " + businessId);
|
|
|
+ valSql = new StringBuilder("" + id + ", " + businessId);
|
|
|
//参数
|
|
|
LinkedHashMap<String,String> dataMap2 = tableInfo.getDataMap();
|
|
|
for(String key : dataMap2.keySet()){
|
|
@@ -345,6 +356,13 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
+
|
|
|
+ //处理每个表格的关联情况
|
|
|
+ List<JSONObject> linkTabIds = JSONArray.parseArray(JSONObject.toJSONString(tableInfo.getLinkTabIds()), JSONObject.class);
|
|
|
+ for(JSONObject json : linkTabIds){
|
|
|
+ json.put("businessId", id);
|
|
|
+ }
|
|
|
+ logWbsList.addAll(linkTabIds);
|
|
|
}
|
|
|
|
|
|
//保存日志记录
|
|
@@ -356,7 +374,7 @@ public class ExcelTabServiceImpl extends BaseServiceImpl<ExcelTabMapper, ExcelTa
|
|
|
tableNode.getPKeyId(),
|
|
|
parentNode.getMajorDataType(),
|
|
|
recordTime,
|
|
|
- linkTabIds
|
|
|
+ logWbsList
|
|
|
));
|
|
|
|
|
|
}
|