| | |
| | | package com.example.erp.controller.pp; |
| | | |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.dto.pp.*; |
| | | import com.example.erp.entity.pp.DamageDetails; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.entity.pp.Report; |
| | | import com.example.erp.entity.sd.Order; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.pp.ReportService; |
| | | import com.example.erp.service.pp.WorkOrderService; |
| | | import com.example.erp.tools.DownExcel; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.sql.Date; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.concurrent.ExecutionException; |
| | | |
| | | @RestController |
| | | @Api(value = "生产报表controller", tags = {"生产报表操作接口"}) |
| | |
| | | public Result damageReport( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @PathVariable String selectTime1, |
| | | @PathVariable String selectTime2, |
| | | @RequestBody DamageReportDTO damageReportDTO) { |
| | | return Result.seccess(reportService.selectDamageReportSv(pageNum, pageSize, selectTime1, selectTime2, damageReportDTO)); |
| | | |
| | |
| | | |
| | | @ApiOperation("任务完成情况汇总进度") |
| | | @SaCheckPermission("taskCompletionStatus.search") |
| | | @PostMapping("/taskCompletionStatus/{selectTime1}/{selectTime2}") |
| | | @PostMapping("/taskCompletionStatus/{selectTime1}/{selectTime2}/{orderId}") |
| | | public Result taskCompletionStatus(@PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @PathVariable String orderId, |
| | | @RequestBody List<Integer> columns) { |
| | | return Result.seccess(reportService.taskCompletionStatusSv(selectTime1, selectTime2, columns)); |
| | | return Result.seccess(reportService.taskCompletionStatusSv(selectTime1, selectTime2,orderId, columns)); |
| | | } |
| | | |
| | | @ApiOperation("订单计划分解") |
| | |
| | | |
| | | @ApiOperation("次破明细报表导出") |
| | | @PostMapping("/exportDamageReport") |
| | | public void exportDamageReport(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException { |
| | | public void exportDamageReport(HttpServletResponse response, @RequestBody Map<String, Object> dates) throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, DamageReportDTO.class, reportService.exportDamageReportSv(dates), "DamageReport"); |
| | | } |
| | |
| | | DownExcel.download(response, WorkInProgressDTO.class, reportService.exportWorkInProgressSv(dates), "WorkInProgress"); |
| | | } |
| | | |
| | | @ApiOperation("在制品汇总报表导出") |
| | | @PostMapping("/exportWorkInProgressCombination") |
| | | public void exportWorkInProgressCombination(HttpServletResponse response, |
| | | @RequestBody Map<String, Object> dates) |
| | | throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, WorkInProgressCombinationDTO.class, reportService.exportWorkInProgressCombinationSv(dates), "WorkInProgressCombination"); |
| | | } |
| | | |
| | | // |
| | | |
| | | @ApiOperation("任务完成情况导出") |
| | | @PostMapping("/exportTaskCompletionStatus") |
| | | public void exportTaskCompletionStatus(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, TaskCompletionStatusDTO.class, reportService.exportDamageReportSv(dates), "TaskCompletionStatus"); |
| | | } |
| | | // @ApiOperation("任务完成情况导出") |
| | | // @PostMapping("/exportTaskCompletionStatus") |
| | | // public void exportTaskCompletionStatus(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException { |
| | | // //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | // DownExcel.download(response, TaskCompletionStatusDTO.class, reportService.exportDamageReportSv(dates), "TaskCompletionStatus"); |
| | | // } |
| | | |
| | | @ApiOperation("原片领料导出") |
| | | @PostMapping("/exportRawMaterialRequisition") |