Commit cc5ed809 authored by 韩桐桐's avatar 韩桐桐

fix(jg):历史数据处理=》使用登记流程中的单子添加安装信息和维保信息;附件转化统一处理

parent 75161075
......@@ -1620,4 +1620,30 @@ public class CommonServiceImpl implements ICommonService {
return commonMapper.countEquipInUseTimesForDel(record);
}
/**
* string转化为jsonObject
* @param obj jsonobject/map对象
* @param jsonFields 要转化的字段数据
*/
public void convertStringToJsonobject(Object obj, String[] jsonFields) {
if (obj instanceof JSONObject) {
JSONObject jsonObject = (JSONObject) obj;
for (String field : jsonFields) {
if (jsonObject.get(field) != null && jsonObject.get(field) instanceof String) {
jsonObject.put(field, JSON.parse(jsonObject.get(field).toString()));
}
}
} else if (obj instanceof Map) {
Map<String, Object> map = (Map<String, Object>) obj;
for (String field : jsonFields) {
if (map.containsKey(field) && map.get(field) instanceof String) {
map.put(field, JSON.parse(map.get(field).toString()));
}
}
} else {
// 处理其他类型
System.out.println("Unsupported Object Type");
}
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment