| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.ECR; |
| | | import com.whyc.service.ECRService; |
| | | import com.whyc.util.ActionUtil; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.openxml4j.exceptions.InvalidFormatException; |
| | |
| | | |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 设 计 工 程 变 更 申 请 调 查 表(ECR) |
| | |
| | | if(!name.substring(name.length()-4).equals(".xls") && !name.substring(name.length()-5).equals(".xlsx")){ |
| | | response.set(1,false,"文件解析错误:上传格式非excel格式"); |
| | | }else{ |
| | | response = service.ecrImportByExcel(multipartFile.getInputStream()); |
| | | response = service.ecrImportByExcel(multipartFile); |
| | | } |
| | | return response; |
| | | } |
| | | |
| | | @ApiOperation("手动输入") |
| | | @PostMapping("ecrImport") |
| | | public Response ecrImport(@RequestBody ECR ecr){ |
| | | return service.ecrImport(ecr); |
| | | } |
| | | |
| | | @ApiOperation("分页查询ECR记录") |
| | | @GetMapping("searchEcr") |
| | | public Response searchEcr(@RequestParam String number, @RequestParam String subCode, @RequestParam String subModel, |
| | | @RequestParam String createTime, @RequestParam String createTime1, |
| | | @RequestParam int pageCurr, @RequestParam int pageSize){ |
| | | Date testTime1= null; |
| | | Date testTime2= null; |
| | | try { |
| | | testTime1 = ActionUtil.sdfwithALL.parse(createTime); |
| | | testTime2 = ActionUtil.sdfwithALL.parse(createTime1); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return service.searchEcr(number,subCode,subModel,testTime1,testTime2,pageCurr,pageSize); |
| | | } |
| | | } |