|
@@ -47,6 +47,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
import java.io.ByteArrayOutputStream;
|
|
import java.io.ByteArrayOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.math.BigDecimal;
|
|
import java.sql.Date;
|
|
import java.sql.Date;
|
|
import java.sql.SQLException;
|
|
import java.sql.SQLException;
|
|
import java.sql.Time;
|
|
import java.sql.Time;
|
|
@@ -78,6 +79,8 @@ import java.util.stream.Collectors;
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
public class FormExecuteController {
|
|
public class FormExecuteController {
|
|
|
|
|
|
|
|
+ private static final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+
|
|
private final IFormExecuteService formExecuteService;
|
|
private final IFormExecuteService formExecuteService;
|
|
|
|
|
|
private final IFormReleaseService formReleaseService;
|
|
private final IFormReleaseService formReleaseService;
|
|
@@ -316,19 +319,20 @@ public class FormExecuteController {
|
|
}
|
|
}
|
|
|
|
|
|
// 检查类层次结构
|
|
// 检查类层次结构
|
|
- if (value instanceof Integer) {
|
|
|
|
|
|
+ if (value == null) {
|
|
|
|
+ value = "";
|
|
|
|
+ } else if (value instanceof Integer) {
|
|
value = Integer.toString((Integer) value);
|
|
value = Integer.toString((Integer) value);
|
|
- }
|
|
|
|
- if (value instanceof Double) {
|
|
|
|
|
|
+ } else if (value instanceof Double) {
|
|
value = Double.toString((Double) value);
|
|
value = Double.toString((Double) value);
|
|
- }
|
|
|
|
- if (value instanceof Long) {
|
|
|
|
|
|
+ } else if (value instanceof Long) {
|
|
value = Long.toString((Long) value);
|
|
value = Long.toString((Long) value);
|
|
- }
|
|
|
|
- if (value instanceof Date) {
|
|
|
|
- SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
- // 将Date对象格式化为字符串
|
|
|
|
- value = formatter.format((Date) value);
|
|
|
|
|
|
+ } else if (value instanceof BigDecimal) {
|
|
|
|
+ value = ((BigDecimal) value).toPlainString();
|
|
|
|
+ } else if (value instanceof Date) {
|
|
|
|
+ value = DATE_FORMATTER.format((Date) value);
|
|
|
|
+ } else {
|
|
|
|
+ value = value.toString(); // 默认处理其他类型的对象
|
|
}
|
|
}
|
|
|
|
|
|
Cell cell = dataRow.createCell(i);
|
|
Cell cell = dataRow.createCell(i);
|