| | |
| | | import com.core.common.Cools; |
| | | import com.core.common.DateUtils; |
| | | import com.core.common.R; |
| | | import com.zy.asrs.entity.AgvWrkMastLog; |
| | | import com.zy.asrs.entity.ViewInOutBean; |
| | | import com.zy.asrs.entity.ViewWorkCountInView; |
| | | import com.zy.asrs.entity.ViewWorkInBean; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.mapper.ReportQueryMapper; |
| | | import com.zy.asrs.service.AgvWrkMastLogService; |
| | | import com.zy.common.web.BaseController; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.xml.soap.SAAJResult; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.util.HashMap; |
| | |
| | | * @since 2.1.1 |
| | | */ |
| | | @GetMapping("/countIn") |
| | | public void download1(HttpServletResponse response, |
| | | @RequestParam Map<String, Object> param) throws IOException { |
| | | public void download1(HttpServletResponse response, @RequestParam Map<String, Object> param) throws IOException { |
| | | try { |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | |
| | | String fileName = URLEncoder.encode("日入库汇总", "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | // 这里需要设置不关闭流 |
| | | EasyExcel.write(response.getOutputStream(), ViewWorkCountInView.class).autoCloseStream(Boolean.FALSE).sheet("sheet1") |
| | | .doWrite(getInData(param)); |
| | | EasyExcel.write(response.getOutputStream(), ViewWorkCountInView.class).autoCloseStream(Boolean.FALSE).sheet("sheet1").doWrite(getInData(param)); |
| | | } catch (Exception e) { |
| | | // 重置response |
| | | response.reset(); |
| | |
| | | * @since 2.1.1 |
| | | */ |
| | | @RequestMapping("/countOut") |
| | | public void download2(HttpServletResponse response, |
| | | @RequestParam Map<String, Object> param) throws IOException { |
| | | public void download2(HttpServletResponse response, @RequestParam Map<String, Object> param) throws IOException { |
| | | try { |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | | // 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系 |
| | | String fileName = URLEncoder.encode("日出库汇总", "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | List<ViewWorkCountInView> outData = getOutData(param); |
| | | // 这里需要设置不关闭流 |
| | | EasyExcel.write(response.getOutputStream(), ViewWorkCountInView.class).autoCloseStream(Boolean.FALSE).sheet("sheet1") |
| | | .doWrite(getOutData(param)); |
| | | EasyExcel.write(response.getOutputStream(), ViewWorkCountInView.class).autoCloseStream(Boolean.FALSE).sheet("sheet1").doWrite(outData); |
| | | } catch (Exception e) { |
| | | // 重置response |
| | | response.reset(); |
| | |
| | | startTime = split[0].split(" ")[0].replace("-", "."); |
| | | endTime = split[1].split(" ")[0].replace("-", "."); |
| | | } |
| | | List<ViewWorkCountInView> allCountIn = reportQueryMapper.selectWorkCountOut(Integer.valueOf((String) param.get("pageNumber")), Integer.valueOf((String) param.get("pageSize")), (String) param.get("matnr"), startTime, endTime); |
| | | List<ViewWorkCountInView> allCountIn = reportQueryMapper.selectWorkCountOut(null,null, (String) param.get("matnr"), startTime, endTime); |
| | | return allCountIn; |
| | | } |
| | | |
| | |
| | | * @since 2.1.1 |
| | | */ |
| | | @RequestMapping("/wrkMastLog") |
| | | public void wrkMastLog(HttpServletResponse response, |
| | | @RequestParam Map<String, Object> param) throws IOException { |
| | | public void wrkMastLog(HttpServletResponse response, @RequestParam Map<String, Object> param) throws IOException { |
| | | try { |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | |
| | | String fileName = URLEncoder.encode("工作档维护日志", "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | // 这里需要设置不关闭流 |
| | | EasyExcel.write(response.getOutputStream(), ViewWorkCountInView.class).autoCloseStream(Boolean.FALSE).sheet("sheet1") |
| | | .doWrite(getWrkMastLogData(param)); |
| | | EasyExcel.write(response.getOutputStream(), ViewWorkCountInView.class).autoCloseStream(Boolean.FALSE).sheet("sheet1").doWrite(getWrkMastLogData(param)); |
| | | } catch (Exception e) { |
| | | // 重置response |
| | | response.reset(); |
| | |
| | | * @since 2.1.1 |
| | | */ |
| | | @RequestMapping("/out") |
| | | public void out(HttpServletResponse response, |
| | | @RequestParam ViewWorkInBean bean) throws IOException { |
| | | public void out(HttpServletResponse response, @RequestParam(required = false) ViewWorkInBean bean) throws IOException { |
| | | try { |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | List<ViewWorkInBean> list = reportQueryMapper.queryViewWorkOutList(bean); |
| | | // 这里需要设置不关闭流 |
| | | EasyExcel.write(response.getOutputStream(), ViewWorkCountInView.class).autoCloseStream(Boolean.FALSE).sheet("sheet1") |
| | | .doWrite(list); |
| | | EasyExcel.write(response.getOutputStream(), ViewWorkInBean.class).autoCloseStream(Boolean.FALSE).sheet("sheet1").doWrite(list); |
| | | } catch (Exception e) { |
| | | // 重置response |
| | | response.reset(); |
| | |
| | | * @since 2.1.1 |
| | | */ |
| | | @RequestMapping("/in") |
| | | public void in(HttpServletResponse response, |
| | | @RequestParam ViewWorkInBean bean) throws IOException { |
| | | public void in(HttpServletResponse response, @RequestParam(required = false) ViewWorkInBean bean) throws IOException { |
| | | try { |
| | | response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); |
| | | response.setCharacterEncoding("utf-8"); |
| | |
| | | String fileName = URLEncoder.encode("日入库明细统计", "UTF-8").replaceAll("\\+", "%20"); |
| | | response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); |
| | | List<ViewWorkInBean> list = reportQueryMapper.queryViewWorkInList(bean); |
| | | String s = "1"; |
| | | // 这里需要设置不关闭流 |
| | | EasyExcel.write(response.getOutputStream(), ViewWorkCountInView.class).autoCloseStream(Boolean.FALSE).sheet("sheet1") |
| | | .doWrite(list); |
| | | EasyExcel.write(response.getOutputStream(), ViewWorkInBean.class).autoCloseStream(Boolean.FALSE).sheet("sheet1").doWrite(list); |
| | | } catch (Exception e) { |
| | | // 重置response |
| | | response.reset(); |