xiaoyi
5 天以前 883f5e73fbe7458fd760dbe8560dd5d8757e04cd
yudao-module-mes/src/main/java/cn/iocoder/yudao/module/mes/controller/admin/pro/feedback/MesProFeedbackController.java
@@ -4,6 +4,9 @@
import cn.hutool.core.collection.ListUtil;
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.module.mes.service.pro.feedback.dto.MesTaskParamSnapshot;
import cn.iocoder.yudao.module.mes.service.pro.feedback.dto.MesFeedbackParamSnapshot;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
@@ -143,7 +146,6 @@
    @GetMapping("/get")
    @Operation(summary = "获得生产报工")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    @PreAuthorize("@ss.hasPermission('mes:pro-feedback:query')")
    public CommonResult<MesProFeedbackRespVO> getFeedback(@RequestParam("id") Long id) {
        MesProFeedbackDO feedback = feedbackService.getFeedback(id);
        if (feedback == null) {
@@ -154,16 +156,25 @@
    @GetMapping("/page")
    @Operation(summary = "获得生产报工分页")
    @PreAuthorize("@ss.hasPermission('mes:pro-feedback:query')")
    public CommonResult<PageResult<MesProFeedbackRespVO>> getFeedbackPage(@Valid MesProFeedbackPageReqVO pageReqVO) {
        PageResult<MesProFeedbackDO> pageResult = feedbackService.getFeedbackPage(pageReqVO);
        return success(new PageResult<>(buildFeedbackRespVOList(pageResult.getList()), pageResult.getTotal()));
    }
    @GetMapping("/param-config")
    @Operation(summary = "获得生产任务冻结的参数采集配置")
    public CommonResult<Map<String, Object>> getParamConfig(@RequestParam("taskId") Long taskId) {
        MesProTaskDO task = taskService.validateTaskExists(taskId);
        Map<String, Object> result = new LinkedHashMap<>();
        result.put("mode", task.getParamCollectMode() == null ? 0 : task.getParamCollectMode());
        result.put("template", JsonUtils.parseObject(task.getParamTemplateSnapshot(), MesTaskParamSnapshot.class));
        result.put("shared", JsonUtils.parseObject(task.getParamSharedSnapshot(), MesFeedbackParamSnapshot.class));
        return success(result);
    }
    @GetMapping("/list-by-task")
    @Operation(summary = "按任务获得报工历史列表")
    @Parameter(name = "taskId", description = "任务编号", required = true, example = "1024")
    @PreAuthorize("@ss.hasPermission('mes:pro-feedback:query')")
    public CommonResult<List<MesProFeedbackRespVO>> getFeedbackListByTask(@RequestParam("taskId") Long taskId) {
        List<MesProFeedbackDO> list = feedbackService.getFeedbackListByTaskId(taskId);
        return success(buildFeedbackRespVOList(list));
@@ -196,7 +207,7 @@
                        .remark("").build()
        );
        // 输出
        ExcelUtils.write(response, "生产报工导入模板.xls", "生产报工列表", MesProFeedbackImportExcelVO.class, list);
        ExcelUtils.writeTemplate(response, "生产报工导入模板.xls", "生产报工列表", MesProFeedbackImportExcelVO.class, list);
    }
    @PostMapping("/import")
@@ -267,7 +278,6 @@
    @GetMapping("/trace/{id}")
    @Operation(summary = "获得报工追溯信息", description = "报工 + 产出/产出明细 + 消耗/消耗明细 + IPQC检验")
    @Parameter(name = "id", description = "报工编号", required = true, example = "1024")
    @PreAuthorize("@ss.hasPermission('mes:pro-feedback:query')")
    public CommonResult<MesProFeedbackTraceRespVO> getFeedbackTrace(@PathVariable("id") Long id) {
        MesProFeedbackDO feedback = feedbackService.getFeedback(id);
        if (feedback == null) {
@@ -292,7 +302,6 @@
    @GetMapping("/summary")
    @Operation(summary = "作业成果汇总统计", description = "按时间范围汇总已批准报工数量/合格数量,按工单类型、日期分组")
    @PreAuthorize("@ss.hasPermission('mes:pro-feedback:query')")
    public CommonResult<MesProFeedbackSummaryRespVO> getFeedbackSummary(
            @RequestParam(value = "beginDate", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate beginDate,
            @RequestParam(value = "endDate", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd") LocalDate endDate,