| | |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.concurrent.ExecutionException; |
| | | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | @PreAuthorize("@ss.hasPermi('point:list')") |
| | | // @PreAuthorize("@ss.hasPermi('point:list')") |
| | | public Result list() { |
| | | return ywPointService.all(); |
| | | } |
| | |
| | | ywPointService.export(query, response); |
| | | } |
| | | |
| | | @PostMapping("/import/{unitId}") |
| | | @PostMapping("/import") |
| | | @ApiOperation(value = "导入数据", notes = "导入数据") |
| | | public Result importData(MultipartFile file, |
| | | @PathVariable("unitId") Integer unitId, |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") Date startTime, |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") Date endTime, |
| | | Boolean provinceTag, |
| | | Boolean importantCommandImageTag) throws IOException { |
| | | return ywPointService.importData(file, unitId, startTime, endTime, provinceTag, importantCommandImageTag); |
| | | Integer unitId, |
| | | String startTime, |
| | | Boolean needUpdateUnit, |
| | | String endTime) throws IOException, ParseException, ExecutionException, InterruptedException { |
| | | Date start = null; |
| | | Date end = null; |
| | | if (-1 == unitId) { |
| | | unitId = null; |
| | | } |
| | | if (StringUtils.hasText(startTime)) { |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | start = format.parse(startTime); |
| | | } |
| | | if (StringUtils.hasText(startTime)) { |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd"); |
| | | end = format.parse(endTime); |
| | | } |
| | | return ywPointService.importData(file, unitId, start, end, needUpdateUnit); |
| | | } |
| | | |
| | | |
| | | } |