From 0be02df3d287f802c76e5738916301a877dfaa0e Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期一, 27 四月 2026 16:56:12 +0800
Subject: [PATCH] feat: 生产报工与报工台账功能更改完成

---
 src/main/java/com/ruoyi/production/controller/ProductionProductMainController.java |  116 +++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 110 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/ruoyi/production/controller/ProductionProductMainController.java b/src/main/java/com/ruoyi/production/controller/ProductionProductMainController.java
index 152ddc8..e4ef6a4 100644
--- a/src/main/java/com/ruoyi/production/controller/ProductionProductMainController.java
+++ b/src/main/java/com/ruoyi/production/controller/ProductionProductMainController.java
@@ -1,15 +1,23 @@
 package com.ruoyi.production.controller;
 
 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.ProductionProductMainDto;
+import com.ruoyi.production.dto.ProductionReportDailySummaryDto;
+import com.ruoyi.production.dto.ProductionReportStateDto;
 import com.ruoyi.production.pojo.ProductionProductMain;
 import com.ruoyi.production.service.ProductionProductMainService;
 import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.time.LocalDate;
+import java.util.List;
 
 @RequestMapping("productionProductMain")
 @RestController
@@ -19,13 +27,109 @@
     @Autowired
     private ProductionProductMainService productionProductMainService;
 
+    /**
+     * 鎶ュ伐鏌ヨ
+     * @param page
+     * @param productionProductMainDto
+     * @return
+     */
+    @ApiOperation("鎶ュ伐鍙拌处姹囨�诲垎椤�(褰撳墠鐧诲綍浜�)")
+    @ApiImplicitParams({
+            @ApiImplicitParam(name = "current", value = "椤电爜", dataType = "long", paramType = "query"),
+            @ApiImplicitParam(name = "size", value = "姣忛〉鏁伴噺", dataType = "long", paramType = "query"),
+            @ApiImplicitParam(name = "workOrderNo", value = "宸ュ崟缂栧彿(妯$硦)", dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "workOrderStatus", value = "宸ュ崟鐘舵��", dataType = "string", paramType = "query")
+    })
     @GetMapping("listPage")
-    public R page(Page<ProductionProductMainDto> page, ProductionProductMainDto productionProductMainDto) {
+    public R<?> page(Page<ProductionProductMainDto> page, ProductionProductMainDto productionProductMainDto) {
         return R.ok(productionProductMainService.listPageProductionProductMainDto(page, productionProductMainDto));
     }
 
-    @GetMapping("addProductMain")
-    public R addProductMain(ProductionProductMainDto 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 = "寮�濮嬫棩鏈�(鎸夌粨鏉熸椂闂磋繃婊�, yyyy-MM-dd)", dataType = "string", paramType = "query"),
+            @ApiImplicitParam(name = "endDate", value = "缁撴潫鏃ユ湡(鎸夌粨鏉熸椂闂磋繃婊�, yyyy-MM-dd)", dataType = "string", paramType = "query")
+    })
+    @GetMapping("listPageDetail")
+    public R<?> pageDetail(Page<ProductionProductMainDto> page, ProductionProductMainDto productionProductMainDto) {
+        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
+     */
+    @PostMapping("addProductMain")
+    public R<?> addProductMain(@RequestBody ProductionProductMainDto productionProductMainDto) {
         return R.ok(productionProductMainService.addProductMain(productionProductMainDto));
     }
+
+    /**
+     * 鎵爜鍚庢煡璇㈠綋鍓嶇敤鎴锋槸鍚﹀瓨鍦ㄨ繘琛屼腑鐨勬姤宸�
+     */
+    @ApiOperation("鏌ヨ杩涜涓殑鎶ュ伐(褰撳墠鐧诲綍浜�)")
+    @GetMapping("getRunning")
+    public R<ProductionProductMain> getRunning(Long workOrderId, Long productProcessRouteItemId) {
+        ProductionProductMain productionProductMain = productionProductMainService.getRunning(workOrderId, productProcessRouteItemId);
+        return R.ok(productionProductMain);
+    }
+
+    /**
+     * 姣忔棩鎶ュ伐鏃堕暱姹囨��(褰撳墠鐧诲綍浜�)
+     */
+    @ApiOperation("姣忔棩鎶ュ伐鏃堕暱姹囨��(褰撳墠鐧诲綍浜�)")
+    @GetMapping("dailyDuration")
+    public R<List<ProductionReportDailySummaryDto>> dailyDuration(Long workOrderId, Long productProcessRouteItemId, LocalDate startDate, LocalDate endDate) {
+        return R.ok(productionProductMainService.dailyDuration(workOrderId, productProcessRouteItemId, startDate, endDate));
+    }
+
+    /**
+     * 鏌ヨ鎶ュ伐鐘舵��: 1-寮�濮嬫姤宸� 2-缁撴潫鎶ュ伐
+     */
+    @ApiOperation("鏌ヨ鎶ュ伐鐘舵��(褰撳墠鐧诲綍浜�)")
+    @GetMapping("reportState")
+    public R<ProductionReportStateDto> reportState(Long workOrderId, Long productProcessRouteItemId) {
+        return R.ok(productionProductMainService.reportState(workOrderId, productProcessRouteItemId));
+    }
+
+    @ApiOperation("鍒犻櫎鎶ュ伐")
+    @DeleteMapping("/delete")
+    public R<?> delete(@RequestBody ProductionProductMainDto productionProductMainDto) {
+        return R.ok(productionProductMainService.removeProductMain(productionProductMainDto.getId()));
+    }
+
+
+    /**
+     * 瀵煎嚭
+     */
+    @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, "鐢熶骇鎶ュ伐鏁版嵁");
+    }
 }

--
Gitblit v1.9.3