| New file |
| | |
| | | package com.example.erp.controller.pp; |
| | | |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.dto.pp.*; |
| | | import com.example.erp.entity.pp.Report; |
| | | import com.example.erp.service.pp.ReportService; |
| | | import com.example.erp.tools.DownExcel; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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; |
| | | |
| | | @RestController |
| | | @Api(value = "生产报表controller", tags = {"生产报表操作接口"}) |
| | | @RequestMapping("/report") |
| | | public class ReportController { |
| | | private final ReportService reportService; |
| | | |
| | | public ReportController(ReportService reportService) { |
| | | this.reportService = reportService; |
| | | } |
| | | |
| | | //流程卡进度 |
| | | @ApiOperation("订单流程卡进度") |
| | | @PostMapping("/processCardProgress/{orderId}") |
| | | public Result processCardProgress(@PathVariable String orderId, @RequestBody List<String> columns) { |
| | | return Result.success(reportService.processCardProgressSv(orderId, columns)); |
| | | } |
| | | @ApiOperation("报表流程卡进度") |
| | | @PostMapping("/processCardProgressReport/{orderId}") |
| | | public Result processCardProgressReport(@PathVariable String orderId, @RequestBody List<String> columns) { |
| | | return Result.success(reportService.processCardProgressReportSv(orderId, columns)); |
| | | } |
| | | @ApiOperation("流程卡进度汇总") |
| | | @PostMapping("/processCardProgressCollect/{orderId}") |
| | | public Result processCardProgressCollect(@PathVariable String orderId, @RequestBody List<String> columns) { |
| | | return Result.success(reportService.processCardProgressCollectSv(orderId, columns)); |
| | | } |
| | | |
| | | @ApiOperation("跨工序次破") |
| | | @PostMapping("/crossProcessBreaking/{pageNum}/{pageSize}/{selectDate}/{reportTime}") |
| | | public Result getOrderReport(@PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable List<String> selectDate, |
| | | @PathVariable String reportTime, |
| | | @RequestBody CrossProcessBreakingDTO crossProcessBreakingDTO) { |
| | | return Result.success(reportService.crossProcessBreakingSv(pageNum, pageSize, selectDate,reportTime, crossProcessBreakingDTO)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("非跨工序次破") |
| | | @PostMapping("/notCrossProcessBreaking/{pageNum}/{pageSize}/{selectDate}/{reportTime}") |
| | | public Result notCrossProcessBreaking(@PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable List<String> selectDate, |
| | | @PathVariable String reportTime, |
| | | @RequestBody CrossProcessBreakingDTO crossProcessBreakingDTO) { |
| | | return Result.success(reportService.notCrossProcessBreakingSv(pageNum, pageSize, selectDate,reportTime, crossProcessBreakingDTO)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("在制品报表") |
| | | @PostMapping("/workInProgress/{pageNum}/{pageSize}/{orderId}/{inputProject}/{selectProcesses}/{optionVal}/{terminationVals}") |
| | | public Result workInProgress( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable String orderId, |
| | | @PathVariable String inputProject, |
| | | @PathVariable String selectProcesses, |
| | | @PathVariable String optionVal, |
| | | @PathVariable String terminationVals, |
| | | @RequestBody WorkInProgressDTO workInProgressDTO) { |
| | | return Result.success(reportService.workInProgressSv(pageNum, pageSize, orderId, inputProject, selectProcesses,optionVal,terminationVals, workInProgressDTO)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("工序待完成报表") |
| | | @PostMapping("/selectProcessToBeCompleted/{selectTime1}/{selectTime2}/{orderId}/{inputProject}/{selectProcesses}") |
| | | public Result selectProcessToBeCompleted( |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @PathVariable String orderId, |
| | | @PathVariable String inputProject, |
| | | @PathVariable String selectProcesses, |
| | | @RequestBody Report report) { |
| | | return Result.success(reportService.selectProcessToBeCompletedSv(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("工序待完成汇总报表") |
| | | @PostMapping("/selectProcessCompleted/{selectTime1}/{selectTime2}/{orderId}/{inputProject}/{selectProcesses}") |
| | | public Result selectProcessCompleted( |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @PathVariable String orderId, |
| | | @PathVariable String inputProject, |
| | | @PathVariable String selectProcesses, |
| | | @RequestBody Report report) { |
| | | return Result.success(reportService.selectProcessCompletedSv(selectTime1, selectTime2, orderId, inputProject, selectProcesses, report)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("次破明细报表") |
| | | @PostMapping("/damageReport/{pageNum}/{pageSize}/{selectDate}/{reportTime}") |
| | | public Result damageReport( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable List<String> selectDate, |
| | | @PathVariable String reportTime, |
| | | @RequestBody DamageReportDTO damageReportDTO) { |
| | | return Result.success(reportService.selectDamageReportSv(pageNum, pageSize, selectDate,reportTime, damageReportDTO)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("分架明细报表") |
| | | @PostMapping("/splittingDetailsOutside/{orderId}") |
| | | public Result splittingDetailsOutside( |
| | | @PathVariable String orderId, |
| | | @RequestBody Report report) { |
| | | return Result.success(reportService.splittingDetailsOutsideSv(orderId, report)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("品质报表") |
| | | @PostMapping("/qualityReport/{selectTime1}/{selectTime2}") |
| | | public Result qualityReport( |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @RequestBody Report report) { |
| | | return Result.success(reportService.qualityReportSv(selectTime1, selectTime2, report)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("成品率报表") |
| | | @PostMapping("/yield/{selectTime1}/{selectTime2}/{selectProcesses}") |
| | | public Result yield( |
| | | @PathVariable String selectTime1, |
| | | @PathVariable String selectTime2, |
| | | @PathVariable String selectProcesses, |
| | | @RequestBody Report report) { |
| | | return Result.success(reportService.yieldSv(selectTime1, selectTime2, selectProcesses, report)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("成品率工序汇总报表") |
| | | @PostMapping("/yieldProcess/{selectTime1}/{selectTime2}") |
| | | public Result yieldProcess( |
| | | @PathVariable String selectTime1, |
| | | @PathVariable String selectTime2, |
| | | @RequestBody Report report) { |
| | | return Result.success(reportService.yieldProcessSv(selectTime1, selectTime2, report)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("生产发货进度") |
| | | @PostMapping("/productionSchedule/{orderId}") |
| | | public Result productionSchedule(@PathVariable String orderId, @RequestBody List<String> columns) { |
| | | return Result.success(reportService.productionScheduleSv(orderId, columns)); |
| | | } |
| | | |
| | | @ApiOperation("任务完成情况汇总进度") |
| | | @PostMapping("/taskCompletionStatus/{selectTime1}/{selectTime2}/{orderId}") |
| | | public Result taskCompletionStatus(@PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @PathVariable String orderId, |
| | | @RequestBody List<Integer> columns) { |
| | | return Result.success(reportService.taskCompletionStatusSv(selectTime1, selectTime2,orderId, columns)); |
| | | } |
| | | |
| | | @ApiOperation("订单计划分解") |
| | | @PostMapping("/orderPlanDecomposition/{selectTime1}/{selectTime2}") |
| | | public Result orderPlanDecomposition(@PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @RequestBody Report report) { |
| | | return Result.success(reportService.orderPlanDecompositionSv(selectTime1, selectTime2, report)); |
| | | } |
| | | |
| | | @ApiOperation("订单报工") |
| | | @PostMapping("/orderReportingWorks/{selectTime1}/{selectTime2}") |
| | | public Result orderReportingWorks(@PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @RequestBody Report report) { |
| | | return Result.success(reportService.orderReportingWorks(selectTime1, selectTime2, report)); |
| | | } |
| | | |
| | | @ApiOperation("原片领料") |
| | | @PostMapping("/rawMaterialRequisition/{selectTime1}/{selectTime2}") |
| | | public Result rawMaterialRequisition(@PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @RequestBody Report report) { |
| | | return Result.success(reportService.rawMaterialRequisitionSv(selectTime1, selectTime2, report)); |
| | | } |
| | | |
| | | @ApiOperation("班组产量明细报表") |
| | | @PostMapping("/teamOutput/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}/{selectProcesses}") |
| | | public Result teamOutput( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable String selectTime1, |
| | | @PathVariable String selectTime2, |
| | | @PathVariable String selectProcesses, |
| | | @RequestBody TeamOutputDTO teamOutputDTO) { |
| | | return Result.success(reportService.teamOutputSv(pageNum, pageSize, selectTime1, selectTime2,selectProcesses, teamOutputDTO)); |
| | | |
| | | } |
| | | @ApiOperation("跨工序次破报表导出") |
| | | @PostMapping("/exportCrossProcessBreaking") |
| | | public void exportCrossProcessBreaking(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, CrossProcessBreakingDTO.class, reportService.exportCrossProcessBreakingSv(dates), "CrossProcessBreaking"); |
| | | } |
| | | |
| | | @ApiOperation("非跨工序次破报表导出") |
| | | @PostMapping("/exportNotCrossProcessBreaking") |
| | | public void exportNotCrossProcessBreaking(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, CrossProcessBreakingDTO.class, reportService.exportNotCrossProcessBreakingSv(dates), "CrossProcessBreaking"); |
| | | } |
| | | |
| | | @ApiOperation("次破明细报表导出") |
| | | @PostMapping("/exportDamageReport") |
| | | public void exportDamageReport(HttpServletResponse response, @RequestBody Map<String, Object> dates) throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, DamageReportDTO.class, reportService.exportDamageReportSv(dates), "DamageReport"); |
| | | } |
| | | |
| | | @ApiOperation("订单计划分解报表导出") |
| | | @PostMapping("/exportOrderPlanDecomposition") |
| | | public void exportOrderPlanDecomposition(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, OrderPlanDecompositionDTO.class, reportService.exportOrderPlanDecompositionSv(dates), "OrderPlanDecomposition"); |
| | | } |
| | | |
| | | @ApiOperation("工序待完成报表导出") |
| | | @PostMapping("/exportProcessToBeCompleted") |
| | | public void exportProcessToBeCompleted(HttpServletResponse response, |
| | | @RequestBody Map<String, Object> dates) |
| | | throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, ProcessToBeCompletedDTO.class, reportService.exportProcessToBeCompletedSv(dates), "ProcessToBeCompleted"); |
| | | } |
| | | |
| | | @ApiOperation("在制品报表导出") |
| | | @PostMapping("/exportWorkInProgress") |
| | | public void exportWorkInProgress(HttpServletResponse response, |
| | | @RequestBody Map<String, Object> dates) |
| | | throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | 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("/exportRawMaterialRequisition") |
| | | public void exportRawMaterialRequisition(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, RawMaterialRequisitionDTO.class, reportService.exportRawMaterialRequisitionSv(dates), "RawMaterialRequisition"); |
| | | } |
| | | |
| | | @ApiOperation("品质报表导出") |
| | | @PostMapping("/exportQualityReport") |
| | | public void exportQualityReport(HttpServletResponse response, @RequestBody List<LocalDate> dates) throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, QualityReportDTO.class, reportService.exportQualityReportSv(dates), "QualityReport"); |
| | | } |
| | | |
| | | @ApiOperation("成品率报表导出") |
| | | @PostMapping("/exportYield") |
| | | public void exportYield(HttpServletResponse response, |
| | | @RequestBody Map<String, Object> dates) |
| | | throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, YieldDTO.class, reportService.exportYieldSv(dates), "Yield"); |
| | | } |
| | | |
| | | @ApiOperation("排产订单信息报表") |
| | | @PostMapping("/scheduleProductionSchedule/{pageNum}/{pageSize}/{selectTime1}/{selectTime2}/{processes}") |
| | | public Result scheduleProductionSchedule( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable Date selectTime1, |
| | | @PathVariable Date selectTime2, |
| | | @PathVariable String processes, |
| | | @RequestBody ScheduleProductionScheduleDTO scheduleProductionScheduleDTO) { |
| | | return Result.success(reportService.scheduleProductionScheduleSv(pageNum, pageSize, selectTime1, selectTime2,processes, scheduleProductionScheduleDTO)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("订单排产计划导出") |
| | | @PostMapping("/exportScheduleReport") |
| | | public void exportScheduleReport(HttpServletResponse response, |
| | | @RequestBody Map<String, Object> dates |
| | | ) throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, ScheduleProductionScheduleDTO.class, reportService.exportScheduleReportSv(dates), "ScheduleProduction"); |
| | | } |
| | | |
| | | @ApiOperation("班组产量导出") |
| | | @PostMapping("/exportTeamOutput") |
| | | public void exportTeamOutput(HttpServletResponse response, |
| | | @RequestBody Map<String, Object> dates |
| | | ) throws IOException, IllegalAccessException, InstantiationException { |
| | | //参数:相应的数据,实体类信息,相应的方法(数据获取),生成的excel名字 |
| | | DownExcel.download(response, TeamOutputDTO.class, reportService.exportTeamOutputSv(dates), "TeamOutput"); |
| | | } |
| | | |
| | | @ApiOperation("在制品汇总报表") |
| | | @PostMapping("/workInProgressCombination/{pageNum}/{pageSize}/{orderId}/{inputProject}/{selectProcesses}/{optionVal}/{terminationVal}") |
| | | public Result workInProgressCombination( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable String orderId, |
| | | @PathVariable String inputProject, |
| | | @PathVariable String selectProcesses, |
| | | @PathVariable String optionVal, |
| | | @PathVariable String terminationVal, |
| | | @RequestBody WorkInProgressDTO workInProgressDTO) { |
| | | return Result.success(reportService.workInProgressCombinationSv(pageNum, pageSize, orderId, inputProject,selectProcesses,optionVal,terminationVal, workInProgressDTO)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("在制品汇总报表") |
| | | @PostMapping("/workInProgressCombinationProcess/{pageNum}/{pageSize}/{orderId}/{inputProject}/{selectProcesses}/{optionVal}") |
| | | public Result workInProgressCombinationProcess( |
| | | @PathVariable Integer pageNum, |
| | | @PathVariable Integer pageSize, |
| | | @PathVariable String orderId, |
| | | @PathVariable String inputProject, |
| | | @PathVariable String selectProcesses, |
| | | @PathVariable String optionVal, |
| | | @RequestBody WorkInProgressDTO workInProgressDTO) { |
| | | return Result.success(reportService.workInProgressCombinationProcessSv(pageNum, pageSize, orderId, inputProject,selectProcesses,optionVal, workInProgressDTO)); |
| | | |
| | | } |
| | | } |