|
@@ -3,6 +3,7 @@ package com.boman.system.common;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
+import com.boman.common.core.utils.DateUtils;
|
|
import com.boman.common.core.utils.collection.CollectionUtils;
|
|
import com.boman.common.core.utils.collection.CollectionUtils;
|
|
import com.boman.common.core.utils.obj.ObjectUtils;
|
|
import com.boman.common.core.utils.obj.ObjectUtils;
|
|
import com.boman.common.core.web.domain.AjaxResult;
|
|
import com.boman.common.core.web.domain.AjaxResult;
|
|
@@ -193,10 +194,41 @@ public class TableServiceCmdService {
|
|
|
|
|
|
List<JSONObject> result = selectService.selectByCondition(genTable.getTableName(), condition, packCondition
|
|
List<JSONObject> result = selectService.selectByCondition(genTable.getTableName(), condition, packCondition
|
|
, showData, dto.getOrderBy(), dto.getLimit(), dto.getOffset());
|
|
, showData, dto.getOrderBy(), dto.getLimit(), dto.getOffset());
|
|
|
|
+ handlerDate(result);
|
|
rows.put(FormDataConstant.PAGE_ROWS, result);
|
|
rows.put(FormDataConstant.PAGE_ROWS, result);
|
|
return AjaxResult.success(rows);
|
|
return AjaxResult.success(rows);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 功能描述: 把timeStamp转为string
|
|
|
|
+ *
|
|
|
|
+ * @param result 被转的数据
|
|
|
|
+ */
|
|
|
|
+ private void handlerDate(List<JSONObject> result) {
|
|
|
|
+ if (org.apache.commons.collections4.CollectionUtils.isEmpty(result)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ for (JSONObject jsonObject : result) {
|
|
|
|
+ getStrByTimeStamp(jsonObject, FormDataConstant.CREATE_TIME);
|
|
|
|
+ getStrByTimeStamp(jsonObject, FormDataConstant.UPDATE_TIME.toLowerCase());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 功能描述: 把jsonObject中时间类型转为string,再放到jsonObject中,类型为: yyyy-mm-dd
|
|
|
|
+ *
|
|
|
|
+ * @param jsonObject jsonObject
|
|
|
|
+ * @param columnType create_time update_time...
|
|
|
|
+ */
|
|
|
|
+ private void getStrByTimeStamp(JSONObject jsonObject, String columnType) {
|
|
|
|
+ Date date = jsonObject.getTimestamp(columnType);
|
|
|
|
+ if (null != date) {
|
|
|
|
+
|
|
|
|
+ jsonObject.put(columnType, DateUtils.dateTime(date));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 功能描述: 获取单表单数据
|
|
* 功能描述: 获取单表单数据
|
|
*
|
|
*
|