| | |
| | | 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) |
| | |
| | | public Response ecrImport(@RequestBody ECR ecr){ |
| | | return service.ecrImport(ecr); |
| | | } |
| | | |
| | | @ApiOperation("分页查询ECR记录") |
| | | @GetMapping("searchEcr") |
| | | public Response searchEcr(@RequestParam int 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.ecrImport(number,subCode,subModel,testTime1,testTime2,pageCurr,pageSize); |
| | | } |
| | | } |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.ECRMapper; |
| | | import com.whyc.pojo.ECR; |
| | |
| | | mapper.insertBatchSomeColumn(ecrList); |
| | | return new Response().set(1,true,"导入完成"); |
| | | } |
| | | //分页查询ECR记录 |
| | | public Response ecrImport(int number, String subCode, String subModel, Date createTime, Date createTime1, int pageCurr, int pageSize) { |
| | | PageHelper.startPage(pageCurr,pageSize); |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.like("number",number); |
| | | wrapper.like("sub_code",subCode); |
| | | wrapper.like("sub_model",subModel); |
| | | wrapper.ge("create_time",createTime); |
| | | wrapper.le("create_time",createTime1); |
| | | wrapper.orderByAsc("number"); |
| | | List list=mapper.selectList(wrapper); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list.size()>0,pageInfo,"查询ECR记录"); |
| | | } |
| | | } |
| | |
| | | public static SimpleDateFormat sdfwithOutday = new SimpleDateFormat("yyyy_MM"); |
| | | public static SimpleDateFormat sdfwithday = new SimpleDateFormat("yyyy-MM-dd"); |
| | | public static SimpleDateFormat sdfwithFTP = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss"); |
| | | |
| | | public static SimpleDateFormat sdfwithALL = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | /* |
| | | * 获取HttpServletRequest |
| | | */ |