| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.time.Instant; |
| | | import java.time.LocalDateTime; |
| | | import java.time.OffsetDateTime; |
| | | import java.time.ZoneId; |
| | | import java.time.*; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.time.format.DateTimeParseException; |
| | | import java.util.*; |
| | |
| | | try { |
| | | long start = Long.parseLong(dateArr.getString(0)); |
| | | long end = Long.parseLong(dateArr.getString(1)); |
| | | plan.setStartDate(Instant.ofEpochMilli(start).atZone(ZoneId.systemDefault()).toLocalDateTime()); |
| | | plan.setEndDate(Instant.ofEpochMilli(end).atZone(ZoneId.systemDefault()).toLocalDateTime()); |
| | | |
| | | Date startDate = Date.from(Instant.ofEpochMilli(start) |
| | | .atZone(ZoneId.systemDefault()) |
| | | .toLocalDate() |
| | | .atStartOfDay(ZoneId.systemDefault()) |
| | | .toInstant()); |
| | | Date endDate = Date.from(Instant.ofEpochMilli(end) |
| | | .atZone(ZoneId.systemDefault()) |
| | | .toLocalDate() |
| | | .atStartOfDay(ZoneId.systemDefault()) |
| | | .toInstant()); |
| | | |
| | | plan.setStartDate(startDate); |
| | | plan.setEndDate(endDate); |
| | | } catch (Exception e) { |
| | | log.warn("解析日期失败: {}", dateArr); |
| | | } |
| | |
| | | for (ProductionPlanImportDto dto : list) { |
| | | entity = new ProductionPlan(); |
| | | BeanUtils.copyProperties(dto, entity); |
| | | entity.setAssignedQuantity(BigDecimal.ZERO); |
| | | entity.setCreateTime(LocalDateTime.now()); |
| | | entity.setUpdateTime(LocalDateTime.now()); |
| | | entity.setDataSourceType(2); |