liyong
2026-04-23 8c8ff31cdca25f579d3c1f688f46c877bf28aaa1
src/main/java/com/ruoyi/production/controller/ProductionProductMainController.java
@@ -3,7 +3,9 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.domain.R;
import com.ruoyi.production.dto.ProductionProductMainDetailExportDto;
import com.ruoyi.production.dto.ProductionProductMainDto;
import com.ruoyi.production.dto.ProductionProductMainSummaryExportDto;
import com.ruoyi.production.dto.ProductionReportDailySummaryDto;
import com.ruoyi.production.dto.ProductionReportStateDto;
import com.ruoyi.production.pojo.ProductionProductMain;
@@ -29,11 +31,12 @@
    /**
     * 报工查询
     *
     * @param page
     * @param productionProductMainDto
     * @return
     */
    @ApiOperation("报工台账汇总分页(当前登录人)")
    @ApiOperation("报工台账汇总分页")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "current", value = "页码", dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "size", value = "每页数量", dataType = "long", paramType = "query"),
@@ -48,11 +51,11 @@
    /**
     * 报工明细查询(每条报工记录)
     */
    @ApiOperation("报工明细分页(每条报工记录, 当前登录人)")
    @ApiOperation("报工明细分页(每条报工记录)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "current", value = "页码", dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "size", value = "每页数量", dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "workOrderId", value = "工单ID(建议必传)", dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "workOrderId", value = "工单ID", dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "startDate", value = "开始日期(按结束时间过滤, yyyy-MM-dd)", dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "endDate", value = "结束日期(按结束时间过滤, yyyy-MM-dd)", dataType = "string", paramType = "query")
    })
@@ -61,24 +64,10 @@
        return R.ok(productionProductMainService.listPageProductionProductMainDetailDto(page, productionProductMainDto));
    }
    /**
     * 报工明细汇总(每个人员每天)
     */
    @ApiOperation("报工每日汇总分页(每人每天, 当前登录人)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "current", value = "页码", dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "size", value = "每页数量", dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "workOrderId", value = "工单ID(建议必传)", dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "startDate", value = "开始日期(report_date, yyyy-MM-dd)", dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "endDate", value = "结束日期(report_date, yyyy-MM-dd)", dataType = "string", paramType = "query")
    })
    @GetMapping("listPageDaily")
    public R<?> pageDaily(Page<ProductionProductMainDto> page, ProductionProductMainDto productionProductMainDto) {
        return R.ok(productionProductMainService.listPageProductionProductMainDailyDto(page, productionProductMainDto));
    }
    /**
     * 报工新增更新
     *
     * @param productionProductMainDto
     * @return
     */
@@ -107,7 +96,7 @@
    }
    /**
     * 查询报工状态: 1-开始报工 2-结束报工
     * 查询报工状态: 1-开始报工 2-结束报工 3-报工完成
     */
    @ApiOperation("查询报工状态(当前登录人)")
    @GetMapping("reportState")
@@ -123,13 +112,35 @@
    /**
     * 导出
     * 报工台账汇总导出
     */
    @ApiOperation("报工台账汇总导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "workOrderIds", value = "工单ID列表, 可传多个", allowMultiple = true, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "workOrderNo", value = "工单编号(模糊)", dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "workOrderStatus", value = "工单状态", dataType = "string", paramType = "query")
    })
    @PostMapping("/export")
    public void export(HttpServletResponse response, ProductionProductMainDto productionProductMainDto) {
        List<ProductionProductMainDto> list;
        list = productionProductMainService.listPageProductionProductMainDto(new Page<>(1, -1), productionProductMainDto).getRecords();
        ExcelUtil<ProductionProductMainDto> util = new ExcelUtil<ProductionProductMainDto>(ProductionProductMainDto.class);
        util.exportExcel(response, list, "生产报工数据");
        List<ProductionProductMainSummaryExportDto> list = productionProductMainService.listSummaryExportData(productionProductMainDto);
        ExcelUtil<ProductionProductMainSummaryExportDto> util = new ExcelUtil<>(ProductionProductMainSummaryExportDto.class);
        util.exportExcel(response, list, "生产报工汇总数据");
    }
    /**
     * 报工明细导出
     */
    @ApiOperation("报工明细导出")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "workOrderIds", value = "工单ID列表, 可传多个", allowMultiple = true, dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "workOrderId", value = "工单ID", dataType = "long", paramType = "query"),
            @ApiImplicitParam(name = "startDate", value = "开始日期(按结束时间过滤, yyyy-MM-dd)", dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "endDate", value = "结束日期(按结束时间过滤, yyyy-MM-dd)", dataType = "string", paramType = "query")
    })
    @PostMapping("/exportDetail")
    public void exportDetail(HttpServletResponse response, ProductionProductMainDto productionProductMainDto) {
        List<ProductionProductMainDetailExportDto> list = productionProductMainService.listDetailExportData(productionProductMainDto);
        ExcelUtil<ProductionProductMainDetailExportDto> util = new ExcelUtil<>(ProductionProductMainDetailExportDto.class);
        util.exportExcel(response, list, "生产报工明细数据");
    }
}