From 631234e020a5c8c1ca96fb40aa284a81c4e7bf97 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期五, 09 一月 2026 15:03:26 +0800
Subject: [PATCH] yys  修改bug

---
 src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java        |   33 -
 src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml               |   21 -
 src/main/resources/mapper/purchase/ProductRecordMapper.xml                                   |   10 
 src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java                         |    3 
 src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java                 |    5 
 src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml                                  |    3 
 src/main/java/com/ruoyi/production/dto/ProcessSchedulingDto.java                             |   21 +
 src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java            |    1 
 src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java           |   43 +-
 src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml                         |   26 -
 src/main/java/com/ruoyi/production/controller/SalesLedgerProductionAccountingController.java |    1 
 src/main/java/com/ruoyi/production/service/impl/ProductionOrderServiceImpl.java              |  147 +++++++++
 src/main/java/com/ruoyi/production/service/ProductionOrderService.java                       |   20 +
 src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java                         |    2 
 src/main/java/com/ruoyi/production/dto/SalesLedgerProductDto.java                            |   52 +-
 src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java              |    2 
 src/main/java/com/ruoyi/production/service/SalesLedgerSchedulingService.java                 |    2 
 src/main/java/com/ruoyi/purchase/dto/TicketRegistrationDto.java                              |    2 
 src/main/java/com/ruoyi/production/controller/ProductionOrderController.java                 |   90 ++++++
 src/main/java/com/ruoyi/purchase/service/impl/ProductRecordServiceImpl.java                  |    3 
 src/main/resources/mapper/production/SalesLedgerWorkMapper.xml                               |   29 -
 src/main/java/com/ruoyi/production/dto/DaiDto.java                                           |   85 +---
 src/main/java/com/ruoyi/production/pojo/SalesLedgerScheduling.java                           |    2 
 src/main/java/com/ruoyi/project/system/controller/SysRoleController.java                     |   32 +-
 src/main/resources/mapper/production/ProductionOrderMapper.xml                               |    5 
 src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java                  |   36 --
 src/main/java/com/ruoyi/production/mapper/ProductionOrderMapper.java                         |   11 
 src/main/java/com/ruoyi/production/service/SalesLedgerWorkService.java                       |    1 
 src/main/java/com/ruoyi/purchase/service/impl/TicketRegistrationServiceImpl.java             |    2 
 src/main/java/com/ruoyi/production/controller/SalesLedgerWorkController.java                 |    4 
 src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java                                 |   22 +
 src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java                               |   25 +
 src/main/java/com/ruoyi/production/pojo/ProductionOrder.java                                 |  139 +++++++++
 src/main/resources/application.yml                                                           |    2 
 34 files changed, 615 insertions(+), 267 deletions(-)

diff --git a/src/main/java/com/ruoyi/production/controller/ProductionOrderController.java b/src/main/java/com/ruoyi/production/controller/ProductionOrderController.java
new file mode 100644
index 0000000..8063a08
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/controller/ProductionOrderController.java
@@ -0,0 +1,90 @@
+package com.ruoyi.production.controller;
+
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.common.utils.OrderUtils;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.production.mapper.ProductionOrderMapper;
+import com.ruoyi.production.pojo.ProductionOrder;
+import com.ruoyi.production.service.ProductionOrderService;
+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.util.List;
+
+/**
+ * @author :yys
+ * @date : 2025/11/26 14:21
+ */
+@RestController
+@Api(tags = "鐢熶骇璁㈠崟")
+@RequestMapping("/productionOrder")
+public class ProductionOrderController extends BaseController {
+
+    @Autowired
+    private ProductionOrderService productionOrderService;
+
+    @Autowired
+    private ProductionOrderMapper productionOrderMapper;
+
+    @GetMapping("/listPage")
+    @Log(title = "鐢熶骇璁㈠崟-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
+    @ApiOperation("鐢熶骇璁㈠崟-鍒嗛〉鏌ヨ")
+    public AjaxResult listPage(Page page, ProductionOrder productionOrder) {
+        return AjaxResult.success(productionOrderService.listPage(page, productionOrder));
+    }
+
+    @PostMapping("/addProductionOrder")
+    @Log(title = "鐢熶骇璁㈠崟-鏂板", businessType = BusinessType.INSERT)
+    @ApiOperation("鐢熶骇璁㈠崟-鏂板")
+    public AjaxResult addProductionOrder(@RequestBody ProductionOrder productionOrder) {
+        String scdd = OrderUtils.countTodayByCreateTime(productionOrderMapper, "SCDD");
+        productionOrder.setOrderNo(scdd);
+        return AjaxResult.success(productionOrderService.save(productionOrder));
+    }
+
+    @PostMapping("/updateProductionOrder")
+    @Log(title = "鐢熶骇璁㈠崟-淇敼", businessType = BusinessType.UPDATE)
+    @ApiOperation("鐢熶骇璁㈠崟-淇敼")
+    public AjaxResult updateProductionOrder(@RequestBody ProductionOrder productionOrder) {
+        return AjaxResult.success(productionOrderService.updateById(productionOrder));
+    }
+
+    @DeleteMapping("/deleteProductionOrder")
+    @Log(title = "鐢熶骇璁㈠崟-鍒犻櫎", businessType = BusinessType.DELETE)
+    @ApiOperation("鐢熶骇璁㈠崟-鍒犻櫎")
+    public AjaxResult deleteProductionOrder(@RequestBody List<Long> ids) {
+        if (CollectionUtils.isEmpty(ids)) return AjaxResult.error("璇蜂紶鍏ヨ鍒犻櫎鐨処D");
+        return AjaxResult.success(productionOrderService.removeBatchByIds(ids));
+    }
+
+
+    /**
+     * 瀵煎嚭
+     * @param response
+     */
+    @PostMapping("/export")
+    @ApiOperation("鐢熶骇绠$悊-鐢熶骇璁㈠崟-瀵煎嚭")
+    @Log(title = "鐢熶骇璁㈠崟-瀵煎嚭", businessType = BusinessType.EXPORT)
+    public void export(HttpServletResponse response) {
+        productionOrderService.export(response);
+    }
+
+    /**
+     * 瀵煎嚭
+     * @param response
+     */
+    @PostMapping("/exportOne")
+    @ApiOperation("鐢熶骇绠$悊-鐢熶骇娲惧伐-瀵煎嚭")
+    @Log(title = "鐢熶骇璁㈠崟-瀵煎嚭", businessType = BusinessType.EXPORT)
+    public void exportOne(HttpServletResponse response) {
+        productionOrderService.exportOne(response);
+    }
+
+}
diff --git a/src/main/java/com/ruoyi/production/controller/SalesLedgerProductionAccountingController.java b/src/main/java/com/ruoyi/production/controller/SalesLedgerProductionAccountingController.java
index ed7ac26..a16a910 100644
--- a/src/main/java/com/ruoyi/production/controller/SalesLedgerProductionAccountingController.java
+++ b/src/main/java/com/ruoyi/production/controller/SalesLedgerProductionAccountingController.java
@@ -7,7 +7,6 @@
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.production.dto.SalesLedgerProductionAccountingDto;
-import com.ruoyi.production.pojo.SalesLedgerProductionAccounting;
 import com.ruoyi.production.service.impl.SalesLedgerProductionAccountingServiceImpl;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
diff --git a/src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java b/src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java
index 5ca3bc2..e11c3f9 100644
--- a/src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java
+++ b/src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java
@@ -7,10 +7,8 @@
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.procurementrecord.dto.ProcurementDto;
 import com.ruoyi.production.dto.ProcessSchedulingDto;
 import com.ruoyi.production.dto.ProductionDispatchAddDto;
-import com.ruoyi.production.dto.SalesLedgerSchedulingDto;
 import com.ruoyi.production.dto.SalesLedgerSchedulingProcessDto;
 import com.ruoyi.production.service.impl.SalesLedgerSchedulingServiceImpl;
 import io.swagger.annotations.Api;
@@ -35,34 +33,25 @@
     private SalesLedgerSchedulingServiceImpl salesLedgerSchedulingService;
 
 
-    @GetMapping("/listPage")
-    @Log(title = "鐢熶骇绠$悊-鐢熶骇璁㈠崟-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
-    @ApiOperation("鐢熶骇绠$悊-鐢熶骇璁㈠崟-鍒嗛〉鏌ヨ")
-    public AjaxResult listPage(Page page, SalesLedgerSchedulingDto salesLedgerSchedulingDto) {
-        IPage<SalesLedgerSchedulingDto> result = salesLedgerSchedulingService.listPage(page,salesLedgerSchedulingDto);
-        return AjaxResult.success(result);
-    }
+//    @GetMapping("/listPage")
+//    @Log(title = "鐢熶骇绠$悊-鐢熶骇璁㈠崟-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
+//    @ApiOperation("鐢熶骇绠$悊-鐢熶骇璁㈠崟-鍒嗛〉鏌ヨ")
+//    public AjaxResult listPage(Page page, SalesLedgerSchedulingDto salesLedgerSchedulingDto) {
+//        IPage<SalesLedgerSchedulingDto> result = salesLedgerSchedulingService.listPage(page,salesLedgerSchedulingDto);
+//        return AjaxResult.success(result);
+//    }
 
-    /**
-     * 瀵煎嚭
-     * @param response
-     */
-    @PostMapping("/export")
-    @ApiOperation("鐢熶骇绠$悊-鐢熶骇璁㈠崟-瀵煎嚭")
-    public void export(HttpServletResponse response) {
-        salesLedgerSchedulingService.export(response);
-    }
+//    /**
+//     * 瀵煎嚭
+//     * @param response
+//     */
+//    @PostMapping("/export")
+//    @ApiOperation("鐢熶骇绠$悊-鐢熶骇璁㈠崟-瀵煎嚭")
+//    public void export(HttpServletResponse response) {
+//        salesLedgerSchedulingService.export(response);
+//    }
 
 
-    /**
-     * 瀵煎嚭
-     * @param response
-     */
-    @PostMapping("/exportOne")
-    @ApiOperation("鐢熶骇绠$悊-鐢熶骇娲惧伐-瀵煎嚭")
-    public void exportOne(HttpServletResponse response) {
-        salesLedgerSchedulingService.exportOne(response);
-    }
 
     @PostMapping("/productionDispatch")
     @Log(title = "鐢熶骇绠$悊-鐢熶骇璁㈠崟-鐢熶骇娲惧伐", businessType = BusinessType.INSERT)
diff --git a/src/main/java/com/ruoyi/production/controller/SalesLedgerWorkController.java b/src/main/java/com/ruoyi/production/controller/SalesLedgerWorkController.java
index 4051ecf..38d57df 100644
--- a/src/main/java/com/ruoyi/production/controller/SalesLedgerWorkController.java
+++ b/src/main/java/com/ruoyi/production/controller/SalesLedgerWorkController.java
@@ -7,12 +7,8 @@
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
 import com.ruoyi.framework.web.controller.BaseController;
 import com.ruoyi.framework.web.domain.AjaxResult;
-import com.ruoyi.production.dto.ProcessSchedulingDto;
 import com.ruoyi.production.dto.ProductionReportDto;
-import com.ruoyi.production.dto.SalesLedgerSchedulingProcessDto;
 import com.ruoyi.production.dto.SalesLedgerWorkDto;
-import com.ruoyi.production.pojo.SalesLedgerWork;
-import com.ruoyi.production.service.SalesLedgerWorkService;
 import com.ruoyi.production.service.impl.SalesLedgerWorkServiceImpl;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
diff --git a/src/main/java/com/ruoyi/production/dto/DaiDto.java b/src/main/java/com/ruoyi/production/dto/DaiDto.java
index 86853cb..c6c4e38 100644
--- a/src/main/java/com/ruoyi/production/dto/DaiDto.java
+++ b/src/main/java/com/ruoyi/production/dto/DaiDto.java
@@ -1,13 +1,13 @@
 package com.ruoyi.production.dto;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.framework.aspectj.lang.annotation.Excel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
 
 import java.math.BigDecimal;
-import java.util.Date;
+import java.time.LocalDate;
 
 /**
  * @author :yys
@@ -19,92 +19,59 @@
     @Excel(name = "寰呮帓鏁伴噺")
     private BigDecimal daiNum;
 
-    @ApiModelProperty(value = "閿�鍞骇鍝両D")
-    private Long salesLedgerProductId;
-
-    @ApiModelProperty(value = "閿�鍞彴璐D")
-    private Long salesLedgerId;
-
     /**
-     * 閿�鍞悎鍚屽彿
+     * 鐢熶骇璁㈠崟鍙�
      */
-    @Excel(name = "閿�鍞悎鍚屽彿")
-    @ApiModelProperty(value = "閿�鍞悎鍚屽彿")
-    private String salesContractNo;
-
-    /**
-     * 瀹㈡埛鍚堝悓鍙�
-     */
-    @Excel(name = "瀹㈡埛鍚堝悓鍙�")
-    @ApiModelProperty(value = "瀹㈡埛鍚堝悓鍙�")
-    private String customerContractNo;
-
-    /**
-     * 椤圭洰鍚嶇О
-     */
-    @Excel(name = "椤圭洰鍚嶇О")
-    @ApiModelProperty(value = "椤圭洰鍚嶇О")
-    private String projectName;
-
-    /**
-     * 褰曞叆鏃ユ湡
-     */
-    @JsonFormat(pattern = "yyyy-MM-dd")
-    @Excel(name = "褰曞叆鏃ユ湡", width = 30, dateFormat = "yyyy-MM-dd")
-    @DateTimeFormat(pattern = "yyyy-MM-dd")
-    @ApiModelProperty(value = "褰曞叆鏃ユ湡")
-    private Date entryDate;
-
-    @ApiModelProperty(value = "褰曞叆鏃ユ湡寮�濮�")
-    private String entryDateStart;
-
-    @ApiModelProperty(value = "褰曞叆鏃ユ湡缁撴潫")
-    private String entryDateEnd;
-
-    /**
-     * 瀹㈡埛鍚嶇О
-     */
-    @Excel(name = "瀹㈡埛鍚嶇О")
-    @ApiModelProperty(value = "瀹㈡埛鍚嶇О")
-    private String customerName;
-
+    @Excel(name = "鐢熶骇璁㈠崟鍙�")
+    private String orderNo;
 
     /**
      * 浜у搧澶х被
      */
     @Excel(name = "浜у搧澶х被")
-    @ApiModelProperty(value = "浜у搧澶х被")
     private String productCategory;
 
     /**
      * 瑙勬牸鍨嬪彿
      */
     @Excel(name = "瑙勬牸鍨嬪彿")
-    @ApiModelProperty(value = "瑙勬牸鍨嬪彿")
     private String specificationModel;
 
     /**
      * 鍗曚綅
      */
     @Excel(name = "鍗曚綅")
-    @ApiModelProperty(value = "鍗曚綅")
     private String unit;
+
 
     /**
      * 鏁伴噺
      */
     @Excel(name = "鏁伴噺")
-    @ApiModelProperty(value = "鏁伴噺")
     private BigDecimal quantity;
 
     /**
-     * 鎺掍骇鏁伴噺
+     * 璁㈠崟鐘舵��
      */
-    @Excel(name = "鎺掍骇鏁伴噺")
-    @ApiModelProperty(value = "鎺掍骇鏁伴噺")
-    private BigDecimal schedulingNum;
+    @Excel(name = "璁㈠崟鐘舵��")
+    @TableField(exist = false)
+    private String status;
 
-    @ApiModelProperty(value = "绉熸埛ID")
-    private Long tenantId;
+    @ApiModelProperty(value = "瀹屽伐鏁伴噺")
+    @TableField(exist = false)
+    private BigDecimal successNum;
+
+    /**
+     * 褰曞叆鏃ユ湡
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @Excel(name = "褰曞叆鏃ユ湡", width = 30, dateFormat = "yyyy-MM-dd")
+    private LocalDate registerDate;
+
+    /**
+     * 褰曞叆浜�
+     */
+    @Excel(name = "褰曞叆浜�")
+    private String createBy;
 
 }
diff --git a/src/main/java/com/ruoyi/production/dto/ProcessSchedulingDto.java b/src/main/java/com/ruoyi/production/dto/ProcessSchedulingDto.java
index 6cf971e..7222d0f 100644
--- a/src/main/java/com/ruoyi/production/dto/ProcessSchedulingDto.java
+++ b/src/main/java/com/ruoyi/production/dto/ProcessSchedulingDto.java
@@ -5,7 +5,6 @@
 import lombok.Data;
 
 import java.math.BigDecimal;
-import java.time.LocalDateTime;
 
 /**
  * @author :yys
@@ -15,6 +14,26 @@
 @ApiModel
 public class ProcessSchedulingDto {
 
+    /**
+     * 鍙e懗鍒嗙被
+     */
+    private String type;
+
+    /**
+     * 澶囨敞
+     */
+    private String remark;
+
+    /**
+     * 鎹熻��
+     */
+    private String loss;
+
+    /**
+     * 棰嗙敤
+     */
+    private String receive;
+
     private Long id;
 
     /**
diff --git a/src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java b/src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java
index e78d868..7729e8e 100644
--- a/src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java
+++ b/src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java
@@ -17,7 +17,7 @@
     @ApiModelProperty(value = "閿�鍞彴璐D")
     private Long salesLedgerId;
 
-    @ApiModelProperty(value = "閿�鍞骇鍝両D")
+    @ApiModelProperty(value = "鐢熶骇璁㈠崟ID")
     private Long salesLedgerProductId;
 
     /**
diff --git a/src/main/java/com/ruoyi/production/dto/SalesLedgerProductDto.java b/src/main/java/com/ruoyi/production/dto/SalesLedgerProductDto.java
index 33e758d..fa17bc6 100644
--- a/src/main/java/com/ruoyi/production/dto/SalesLedgerProductDto.java
+++ b/src/main/java/com/ruoyi/production/dto/SalesLedgerProductDto.java
@@ -1,13 +1,9 @@
 package com.ruoyi.production.dto;
 
-import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.framework.aspectj.lang.annotation.Excel;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.util.Date;
 
 /**
  * @author :yys
@@ -17,34 +13,34 @@
 @ApiModel
 public class SalesLedgerProductDto {
 
-    /**
-     * 閿�鍞悎鍚屽彿
-     */
-    @Excel(name = "閿�鍞悎鍚屽彿")
-    @ApiModelProperty(value = "閿�鍞悎鍚屽彿")
-    private String salesContractNo;
-
-    /**
-     * 瀹㈡埛鍚堝悓鍙�
-     */
-    @Excel(name = "瀹㈡埛鍚堝悓鍙�")
-    @ApiModelProperty(value = "瀹㈡埛鍚堝悓鍙�")
-    private String customerContractNo;
-
-    /**
-     * 椤圭洰鍚嶇О
-     */
-    @Excel(name = "椤圭洰鍚嶇О")
-    @ApiModelProperty(value = "椤圭洰鍚嶇О")
-    private String projectName;
+//    /**
+//     * 閿�鍞悎鍚屽彿
+//     */
+//    @Excel(name = "閿�鍞悎鍚屽彿")
+//    @ApiModelProperty(value = "閿�鍞悎鍚屽彿")
+//    private String salesContractNo;
+//
+//    /**
+//     * 瀹㈡埛鍚堝悓鍙�
+//     */
+//    @Excel(name = "瀹㈡埛鍚堝悓鍙�")
+//    @ApiModelProperty(value = "瀹㈡埛鍚堝悓鍙�")
+//    private String customerContractNo;
+//
+//    /**
+//     * 椤圭洰鍚嶇О
+//     */
+//    @Excel(name = "椤圭洰鍚嶇О")
+//    @ApiModelProperty(value = "椤圭洰鍚嶇О")
+//    private String projectName;
 
 
     /**
-     * 瀹㈡埛鍚嶇О
+     * 鐢熶骇璁㈠崟鍙�
      */
-    @Excel(name = "瀹㈡埛鍚嶇О")
-    @ApiModelProperty(value = "瀹㈡埛鍚嶇О")
-    private String customerName;
+    @Excel(name = "鐢熶骇璁㈠崟鍙�")
+    @ApiModelProperty(value = "鐢熶骇璁㈠崟鍙�")
+    private String orderNo;
 
 
     /**
diff --git a/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java b/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java
index 4e606a1..f8432c7 100644
--- a/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java
+++ b/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java
@@ -1,7 +1,5 @@
 package com.ruoyi.production.dto;
 
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.framework.aspectj.lang.annotation.Excel;
 import io.swagger.annotations.ApiModel;
@@ -10,7 +8,6 @@
 import org.springframework.format.annotation.DateTimeFormat;
 
 import java.math.BigDecimal;
-import java.time.LocalDate;
 import java.util.Date;
 
 /**
diff --git a/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java b/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java
index 8952455..308b506 100644
--- a/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java
+++ b/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java
@@ -1,7 +1,5 @@
 package com.ruoyi.production.dto;
 
-import com.baomidou.mybatisplus.annotation.FieldFill;
-import com.baomidou.mybatisplus.annotation.TableField;
 import com.fasterxml.jackson.annotation.JsonFormat;
 import com.ruoyi.framework.aspectj.lang.annotation.Excel;
 import io.swagger.annotations.ApiModel;
@@ -20,11 +18,8 @@
 @ApiModel
 public class SalesLedgerSchedulingProcessDto {
 
-    @ApiModelProperty(value = "閿�鍞骇鍝両D")
+    @ApiModelProperty(value = "鐢熶骇璁㈠崟ID")
     private Long salesLedgerProductId;
-
-    @ApiModelProperty(value = "閿�鍞彴璐D")
-    private Long salesLedgerId;
 
     @ApiModelProperty(value = "寮�濮嬫椂闂�")
     private String entryDateStart;
@@ -38,38 +33,17 @@
     private Long id;
 
     /**
-     * 閿�鍞悎鍚屽彿
+     * 鐢熶骇璁㈠崟鍙�
      */
-    @Excel(name = "閿�鍞悎鍚屽彿")
-    @ApiModelProperty(value = "閿�鍞悎鍚屽彿")
-    private String salesContractNo;
-
-    /**
-     * 瀹㈡埛鍚堝悓鍙�
-     */
-    @Excel(name = "瀹㈡埛鍚堝悓鍙�")
-    @ApiModelProperty(value = "瀹㈡埛鍚堝悓鍙�")
-    private String customerContractNo;
-
-    /**
-     * 椤圭洰鍚嶇О
-     */
-    @Excel(name = "椤圭洰鍚嶇О")
-    @ApiModelProperty(value = "椤圭洰鍚嶇О")
-    private String projectName;
+    @Excel(name = "鐢熶骇璁㈠崟鍙�")
+    @ApiModelProperty(value = "鐢熶骇璁㈠崟鍙�")
+    private String orderNo;
 
     @JsonFormat(pattern = "yyyy-MM-dd")
     @Excel(name = "娲惧伐鏃ユ湡", width = 30, dateFormat = "yyyy-MM-dd")
     @DateTimeFormat(pattern = "yyyy-MM-dd")
     @ApiModelProperty(value = "娲惧伐鏃ユ湡")
     private Date schedulingDate;
-
-    /**
-     * 瀹㈡埛鍚嶇О
-     */
-    @Excel(name = "瀹㈡埛鍚嶇О")
-    @ApiModelProperty(value = "瀹㈡埛鍚嶇О")
-    private String customerName;
 
 
     /**
diff --git a/src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java b/src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java
index 055f2a8..5b5fae8 100644
--- a/src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java
+++ b/src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java
@@ -6,7 +6,6 @@
 import lombok.Data;
 
 import java.math.BigDecimal;
-import java.time.LocalDate;
 
 /**
  * @author :yys
@@ -86,5 +85,29 @@
     @Excel(name = "鐘舵��", readConverterExp = "1=寰呯敓浜�,2=鐢熶骇涓�,3=宸叉姤宸�")
     private String statusName;
 
+    /**
+     * 鍙e懗鍒嗙被
+     */
+    @ApiModelProperty(value = "鍙e懗鍒嗙被")
+    private String type;
+
+    /**
+     * 澶囨敞
+     */
+    @ApiModelProperty(value = "澶囨敞")
+    private String remark;
+
+    /**
+     * 鎹熻��
+     */
+    @ApiModelProperty(value = "鎹熻��")
+    private String loss;
+
+    /**
+     * 棰嗙敤
+     */
+    @ApiModelProperty(value = "棰嗙敤")
+    private String receive;
+
 
 }
diff --git a/src/main/java/com/ruoyi/production/mapper/ProductionOrderMapper.java b/src/main/java/com/ruoyi/production/mapper/ProductionOrderMapper.java
new file mode 100644
index 0000000..e65f550
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/mapper/ProductionOrderMapper.java
@@ -0,0 +1,11 @@
+package com.ruoyi.production.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.production.pojo.ProductionOrder;
+
+/**
+ * @author :yys
+ * @date : 2025/11/26 14:18
+ */
+public interface ProductionOrderMapper extends BaseMapper<ProductionOrder> {
+}
diff --git a/src/main/java/com/ruoyi/production/pojo/ProductionOrder.java b/src/main/java/com/ruoyi/production/pojo/ProductionOrder.java
new file mode 100644
index 0000000..a58754b
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/pojo/ProductionOrder.java
@@ -0,0 +1,139 @@
+package com.ruoyi.production.pojo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * @author :yys
+ * @date : 2025/11/26 14:15
+ */
+@Data
+@TableName("production_order")
+public class ProductionOrder {
+
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    @ApiModelProperty(value = "褰曞叆鏃ユ湡寮�濮�")
+    @TableField(exist = false)
+    private String entryDateStart;
+
+    @ApiModelProperty(value = "褰曞叆鏃ユ湡缁撴潫")
+    @TableField(exist = false)
+    private String entryDateEnd;
+
+    /**
+     * 鐢熶骇璁㈠崟鍙�
+     */
+    @Excel(name = "鐢熶骇璁㈠崟鍙�")
+    @ApiModelProperty(value = "鐢熶骇璁㈠崟鍙�")
+    private String orderNo;
+
+    /**
+     * 浜у搧澶х被
+     */
+    @Excel(name = "浜у搧澶х被")
+    @ApiModelProperty(value = "浜у搧澶х被")
+    private String productCategory;
+
+    /**
+     * 瑙勬牸鍨嬪彿
+     */
+    @Excel(name = "瑙勬牸鍨嬪彿")
+    @ApiModelProperty(value = "瑙勬牸鍨嬪彿")
+    private String specificationModel;
+
+    /**
+     * 鍗曚綅
+     */
+    @Excel(name = "鍗曚綅")
+    @ApiModelProperty(value = "鍗曚綅")
+    private String unit;
+
+
+    /**
+     * 鏁伴噺
+     */
+    @Excel(name = "鏁伴噺")
+    @ApiModelProperty(value = "鏁伴噺")
+    private BigDecimal quantity;
+
+    /**
+     * 璁㈠崟鐘舵��
+     */
+    @Excel(name = "璁㈠崟鐘舵��")
+    @TableField(exist = false)
+    private String status = "鏈畬鎴�";
+
+    /**
+     * 鎺掍骇鏁伴噺
+     */
+    @Excel(name = "鎺掍骇鏁伴噺")
+    @ApiModelProperty(value = "鎺掍骇鏁伴噺")
+    @TableField(exist = false)
+    private BigDecimal schedulingNum;
+
+
+    /**
+     * 瀹屽伐鏁伴噺
+     */
+    @Excel(name = "瀹屽伐鏁伴噺")
+    @ApiModelProperty(value = "瀹屽伐鏁伴噺")
+    @TableField(exist = false)
+    private BigDecimal successNum = BigDecimal.ZERO;
+
+    /**
+     * 褰曞叆鏃ユ湡
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
+    @Excel(name = "褰曞叆鏃ユ湡", width = 30, dateFormat = "yyyy-MM-dd")
+    @ApiModelProperty(value = "褰曞叆鏃ユ湡")
+    @DateTimeFormat(pattern = "yyyy-MM-dd")
+    private LocalDate registerDate;
+
+    /**
+     * 褰曞叆浜�
+     */
+    @Excel(name = "褰曞叆浜�")
+    @ApiModelProperty(value = "褰曞叆浜�")
+    private String createBy;
+
+    /**
+     * 鍒涘缓鑰�
+     */
+    @TableField(fill = FieldFill.INSERT)
+    private Integer createUser;
+
+    /**
+     * 鍒涘缓鏃堕棿
+     */
+    @TableField(fill = FieldFill.INSERT)
+    private LocalDateTime createTime;
+
+    /**
+     * 淇敼鑰�
+     */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private Integer updateUser;
+
+    /**
+     * 淇敼鏃堕棿
+     */
+    @TableField(fill = FieldFill.INSERT_UPDATE)
+    private LocalDateTime updateTime;
+
+    /**
+     * 绉熸埛ID
+     */
+    @TableField(fill = FieldFill.INSERT)
+    private Long tenantId;
+
+}
diff --git a/src/main/java/com/ruoyi/production/pojo/SalesLedgerScheduling.java b/src/main/java/com/ruoyi/production/pojo/SalesLedgerScheduling.java
index 937ff7f..e3e6dde 100644
--- a/src/main/java/com/ruoyi/production/pojo/SalesLedgerScheduling.java
+++ b/src/main/java/com/ruoyi/production/pojo/SalesLedgerScheduling.java
@@ -28,7 +28,7 @@
     private Long salesLedgerId;
 
     /**
-     * 閿�鍞骇鍝乮d
+     * 鐢熶骇璁㈠崟id
      */
     private Long salesLedgerProductId;
 
diff --git a/src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java b/src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java
index b722105..a64e579 100644
--- a/src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java
+++ b/src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java
@@ -33,7 +33,7 @@
     private Long salesLedgerId;
 
     /**
-     * 閿�鍞骇鍝乮d
+     * 鐢熶骇璁㈠崟id
      */
     private Long salesLedgerProductId;
 
@@ -67,6 +67,26 @@
      * 宸ュ簭
      */
     private String process;
+
+    /**
+     * 鍙e懗鍒嗙被
+     */
+    private String type;
+
+    /**
+     * 澶囨敞
+     */
+    private String remark;
+
+    /**
+     * 鎹熻��
+     */
+    private String loss;
+
+    /**
+     * 棰嗙敤
+     */
+    private String receive;
     /**
      * 鎺掍骇鏃ユ湡
      */
diff --git a/src/main/java/com/ruoyi/production/service/ProductionOrderService.java b/src/main/java/com/ruoyi/production/service/ProductionOrderService.java
new file mode 100644
index 0000000..b2ab5e8
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/service/ProductionOrderService.java
@@ -0,0 +1,20 @@
+package com.ruoyi.production.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.production.pojo.ProductionOrder;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author :yys
+ * @date : 2025/11/26 14:19
+ */
+public interface ProductionOrderService extends IService<ProductionOrder> {
+    AjaxResult listPage(Page page, ProductionOrder productionOrder);
+
+    void export(HttpServletResponse response);
+
+    void exportOne(HttpServletResponse response);
+}
diff --git a/src/main/java/com/ruoyi/production/service/SalesLedgerSchedulingService.java b/src/main/java/com/ruoyi/production/service/SalesLedgerSchedulingService.java
index 2387e87..484bd23 100644
--- a/src/main/java/com/ruoyi/production/service/SalesLedgerSchedulingService.java
+++ b/src/main/java/com/ruoyi/production/service/SalesLedgerSchedulingService.java
@@ -29,6 +29,4 @@
     int productionDispatchDelete(List<Long> ids);
 
     int processScheduling(List<ProcessSchedulingDto> processSchedulingDto);
-
-    void exportOne(HttpServletResponse response);
 }
diff --git a/src/main/java/com/ruoyi/production/service/SalesLedgerWorkService.java b/src/main/java/com/ruoyi/production/service/SalesLedgerWorkService.java
index b219515..b99855f 100644
--- a/src/main/java/com/ruoyi/production/service/SalesLedgerWorkService.java
+++ b/src/main/java/com/ruoyi/production/service/SalesLedgerWorkService.java
@@ -3,7 +3,6 @@
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.production.dto.ProductionReportDto;
 import com.ruoyi.production.dto.SalesLedgerWorkDto;
 import com.ruoyi.production.pojo.SalesLedgerWork;
diff --git a/src/main/java/com/ruoyi/production/service/impl/ProductionOrderServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/ProductionOrderServiceImpl.java
new file mode 100644
index 0000000..3faf934
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/service/impl/ProductionOrderServiceImpl.java
@@ -0,0 +1,147 @@
+package com.ruoyi.production.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ruoyi.common.utils.StringUtils;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.production.dto.DaiDto;
+import com.ruoyi.production.mapper.ProductionOrderMapper;
+import com.ruoyi.production.mapper.SalesLedgerSchedulingMapper;
+import com.ruoyi.production.mapper.SalesLedgerWorkMapper;
+import com.ruoyi.production.pojo.ProductionOrder;
+import com.ruoyi.production.pojo.SalesLedgerScheduling;
+import com.ruoyi.production.pojo.SalesLedgerWork;
+import com.ruoyi.production.service.ProductionOrderService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import javax.servlet.http.HttpServletResponse;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * @author :yys
+ * @date : 2025/11/26 14:20
+ */
+@Service
+@Slf4j
+public class ProductionOrderServiceImpl extends ServiceImpl<ProductionOrderMapper, ProductionOrder> implements ProductionOrderService {
+
+    @Autowired
+    private ProductionOrderMapper productionOrderMapper;
+
+    @Autowired
+    private SalesLedgerWorkMapper salesLedgerWorkMapper;
+
+    @Autowired
+    private SalesLedgerSchedulingMapper salesLedgerSchedulingMapper;
+
+    @Override
+    public AjaxResult listPage(Page page, ProductionOrder productionOrder) {
+        LambdaQueryWrapper<ProductionOrder> productionOrderLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        if(productionOrder != null){
+            if(StringUtils.isNotEmpty(productionOrder.getOrderNo())){
+                productionOrderLambdaQueryWrapper.like(ProductionOrder::getOrderNo, productionOrder.getOrderNo());
+            }
+            if(StringUtils.isNotEmpty(productionOrder.getProductCategory())){
+                productionOrderLambdaQueryWrapper.like(ProductionOrder::getProductCategory, productionOrder.getProductCategory());
+            }
+            if(StringUtils.isNotEmpty(productionOrder.getEntryDateStart()) && StringUtils.isNotEmpty(productionOrder.getEntryDateEnd())){
+                productionOrderLambdaQueryWrapper.ge(ProductionOrder::getRegisterDate, productionOrder.getEntryDateStart())
+                        .le(ProductionOrder::getRegisterDate, productionOrder.getEntryDateEnd());
+            }
+
+        }
+        IPage<ProductionOrder> list = productionOrderMapper.selectPage(page,productionOrderLambdaQueryWrapper);
+        if(CollectionUtils.isEmpty(list.getRecords())){
+            return AjaxResult.success(list);
+        }
+        Set<Long> collect = list.getRecords().stream().map(ProductionOrder::getId).collect(Collectors.toSet());
+        // 鑾峰彇鎺掍骇鏁伴噺
+        LambdaQueryWrapper<SalesLedgerScheduling> salesLedgerSchedulingLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        salesLedgerSchedulingLambdaQueryWrapper.in(SalesLedgerScheduling::getSalesLedgerProductId, collect);
+        List<SalesLedgerScheduling> salesLedgerSchedulings = salesLedgerSchedulingMapper.selectList(salesLedgerSchedulingLambdaQueryWrapper);
+        // 璁$畻瀹屽伐鏁伴噺
+        LambdaQueryWrapper<SalesLedgerWork> salesLedgerWorkLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        salesLedgerWorkLambdaQueryWrapper.in(SalesLedgerWork::getSalesLedgerProductId, collect)
+                .ne(SalesLedgerWork::getStatus, 1);
+        List<SalesLedgerWork> salesLedgerWorks = salesLedgerWorkMapper.selectList(salesLedgerWorkLambdaQueryWrapper);
+        list.getRecords().forEach(i -> {
+            // 鑾峰彇鎺掍骇鏁伴噺
+            i.setSchedulingNum(salesLedgerSchedulings
+                    .stream()
+                    .filter(j -> j.getSalesLedgerProductId().equals(i.getId()))
+                    .map(SalesLedgerScheduling::getSchedulingNum)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add));
+            // 鑾峰彇瀹屾垚鏁伴噺
+            i.setSuccessNum(salesLedgerWorks
+                    .stream()
+                    .filter(j -> j.getSalesLedgerProductId().equals(i.getId()))
+                    .map(SalesLedgerWork::getFinishedNum)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add));
+            // 鐘舵�� = 鏁伴噺鍜屽畬宸ユ暟閲忔瘮杈�
+            if(i.getSchedulingNum().compareTo(i.getSuccessNum()) == 0){
+                i.setStatus("宸插畬鎴�");
+            }else{
+                i.setStatus("鏈畬鎴�");
+            }
+        });
+        return AjaxResult.success(list);
+    }
+
+    @Override
+    public void export(HttpServletResponse response) {
+        List<ProductionOrder> list = this.list();
+        if(CollectionUtils.isEmpty(list)){
+            throw new RuntimeException("鏃犲鍑烘暟鎹�");
+        }
+        Set<Long> collect = list.stream().map(ProductionOrder::getId).collect(Collectors.toSet());
+        LambdaQueryWrapper<SalesLedgerWork> salesLedgerWorkLambdaQueryWrapper = new LambdaQueryWrapper<>();
+        salesLedgerWorkLambdaQueryWrapper.in(SalesLedgerWork::getSalesLedgerProductId, collect)
+                .ne(SalesLedgerWork::getStatus, 1);
+        List<SalesLedgerWork> salesLedgerWorks = salesLedgerWorkMapper.selectList(salesLedgerWorkLambdaQueryWrapper);
+        list.forEach(i -> {
+            // 鑾峰彇瀹屾垚鏁伴噺
+            i.setSuccessNum(salesLedgerWorks
+                    .stream()
+                    .filter(j -> j.getSalesLedgerProductId().equals(i.getId()))
+                    .map(SalesLedgerWork::getFinishedNum)
+                    .reduce(BigDecimal.ZERO, BigDecimal::add));
+            // 鐘舵�� = 鏁伴噺鍜屽畬宸ユ暟閲忔瘮杈�
+            if(i.getQuantity().compareTo(i.getSuccessNum()) == 0){
+                i.setStatus("宸插畬鎴�");
+            }else{
+                i.setStatus("鏈畬鎴�");
+            }
+        });
+        ExcelUtil<ProductionOrder> util = new ExcelUtil<>(ProductionOrder.class);
+        util.exportExcel(response, list, "鐢熶骇璁㈠崟");
+    }
+
+    @Override
+    public void exportOne(HttpServletResponse response) {
+        List<ProductionOrder> list = this.list();
+        if(CollectionUtils.isEmpty(list)){
+            throw new RuntimeException("鏃犲鍑烘暟鎹�");
+        }
+        List<DaiDto> dais = new ArrayList<>();
+        list.forEach(i -> {
+            DaiDto daiDto = new DaiDto();
+            BeanUtils.copyProperties(i, daiDto);
+            // 鑾峰彇寰呮帓浜ф暟閲�
+            daiDto.setDaiNum(daiDto.getQuantity().subtract(i.getSuccessNum()));
+            dais.add(daiDto);
+        });
+        ExcelUtil<DaiDto> util = new ExcelUtil<>(DaiDto.class);
+        util.exportExcel(response, dais, "鐢熶骇娲惧伐");
+    }
+}
diff --git a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
index 4f60b7e..4814c79 100644
--- a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
@@ -5,8 +5,10 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.utils.poi.ExcelUtil;
-import com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto;
-import com.ruoyi.production.dto.*;
+import com.ruoyi.production.dto.ProcessSchedulingDto;
+import com.ruoyi.production.dto.ProductionDispatchAddDto;
+import com.ruoyi.production.dto.SalesLedgerSchedulingDto;
+import com.ruoyi.production.dto.SalesLedgerSchedulingProcessDto;
 import com.ruoyi.production.mapper.SalesLedgerSchedulingMapper;
 import com.ruoyi.production.mapper.SalesLedgerWorkMapper;
 import com.ruoyi.production.pojo.SalesLedgerScheduling;
@@ -16,7 +18,6 @@
 import com.ruoyi.project.system.mapper.SysUserMapper;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
@@ -24,7 +25,6 @@
 import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
-import java.util.ArrayList;
 import java.util.List;
 import java.util.Set;
 import java.util.stream.Collectors;
@@ -152,10 +152,6 @@
             SysUser sysUser = sysUserMapper.selectUserById(processSchedulingDto.getSchedulingUserId());
             if(sysUser == null) throw new RuntimeException("鎺掍骇浜轰笉瀛樺湪");
             salesLedgerScheduling.setFinishedNum(salesLedgerScheduling.getFinishedNum().add(processSchedulingDto.getSchedulingNum()));
-            LambdaQueryWrapper<SalesLedgerWork> salesLedgerWorkLambdaQueryWrapper = new LambdaQueryWrapper<>();
-            salesLedgerWorkLambdaQueryWrapper.eq(SalesLedgerWork::getSalesLedgerSchedulingId, salesLedgerScheduling.getId())
-                    .ne(SalesLedgerWork::getStatus, 1);
-            List<SalesLedgerWork> salesLedgerWorks = salesLedgerWorkMapper.selectList(salesLedgerWorkLambdaQueryWrapper);
             if(salesLedgerScheduling.getSchedulingNum().compareTo(salesLedgerScheduling.getFinishedNum()) < 0){
                 throw new RuntimeException("褰撳墠鎺掍骇鏁伴噺澶т簬寰呮帓浜ф暟閲忥紝璇蜂粩缁嗘牳瀵癸紒");
             }
@@ -171,6 +167,10 @@
                     .salesLedgerProductId(salesLedgerScheduling.getSalesLedgerProductId())
                     .schedulingUserId(salesLedgerScheduling.getSchedulingUserId())
                     .schedulingUserName(sysUser.getNickName())
+                    .type(processSchedulingDto.getType())
+                    .remark(processSchedulingDto.getRemark())
+                    .loss(processSchedulingDto.getLoss())
+                    .receive(processSchedulingDto.getReceive())
                     .schedulingNum(processSchedulingDto.getSchedulingNum())
                     .workHours(processSchedulingDto.getWorkHours())
                     .process(processSchedulingDto.getProcess())
@@ -181,21 +181,4 @@
         return 0;
     }
 
-    @Override
-    public void exportOne(HttpServletResponse response) {
-        List<SalesLedgerSchedulingDto> list = salesLedgerSchedulingMapper.list();
-        if(CollectionUtils.isEmpty(list)){
-            throw new RuntimeException("鏃犲鍑烘暟鎹�");
-        }
-        List<DaiDto> dais = new ArrayList<>();
-        list.forEach(i -> {
-            DaiDto daiDto = new DaiDto();
-            BeanUtils.copyProperties(i, daiDto);
-            // 鑾峰彇寰呮帓浜ф暟閲�
-            daiDto.setDaiNum(daiDto.getQuantity().subtract(i.getSchedulingNum()));
-            dais.add(daiDto);
-        });
-        ExcelUtil<DaiDto> util = new ExcelUtil<>(DaiDto.class);
-        util.exportExcel(response, dais, "鐢熶骇娲惧伐");
-    }
 }
diff --git a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java
index bf35f8a..ddbee03 100644
--- a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java
+++ b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java
@@ -4,14 +4,12 @@
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.production.dto.ProductionReportDto;
 import com.ruoyi.production.dto.SalesLedgerWorkDto;
 import com.ruoyi.production.mapper.SalesLedgerProductionAccountingMapper;
 import com.ruoyi.production.mapper.SalesLedgerWorkMapper;
 import com.ruoyi.production.pojo.SalesLedgerProductionAccounting;
 import com.ruoyi.production.pojo.SalesLedgerWork;
-import com.ruoyi.production.service.SalesLedgerProductionAccountingService;
 import com.ruoyi.production.service.SalesLedgerWorkService;
 import com.ruoyi.project.system.domain.SysUser;
 import com.ruoyi.project.system.mapper.SysUserMapper;
diff --git a/src/main/java/com/ruoyi/project/system/controller/SysRoleController.java b/src/main/java/com/ruoyi/project/system/controller/SysRoleController.java
index db2d33d..10acb62 100644
--- a/src/main/java/com/ruoyi/project/system/controller/SysRoleController.java
+++ b/src/main/java/com/ruoyi/project/system/controller/SysRoleController.java
@@ -95,14 +95,14 @@
     @PostMapping
     public AjaxResult add(@Validated @RequestBody SysRole role)
     {
-        if (!roleService.checkRoleNameUnique(role))
-        {
-            return error("鏂板瑙掕壊'" + role.getRoleName() + "'澶辫触锛岃鑹插悕绉板凡瀛樺湪");
-        }
-        else if (!roleService.checkRoleKeyUnique(role))
-        {
-            return error("鏂板瑙掕壊'" + role.getRoleName() + "'澶辫触锛岃鑹叉潈闄愬凡瀛樺湪");
-        }
+//        if (!roleService.checkRoleNameUnique(role))
+//        {
+//            return error("鏂板瑙掕壊'" + role.getRoleName() + "'澶辫触锛岃鑹插悕绉板凡瀛樺湪");
+//        }
+//        else if (!roleService.checkRoleKeyUnique(role))
+//        {
+//            return error("鏂板瑙掕壊'" + role.getRoleName() + "'澶辫触锛岃鑹叉潈闄愬凡瀛樺湪");
+//        }
         role.setCreateBy(getUsername());
         role.setTenantId(SecurityUtils.getLoginUser().getTenantId());
         return toAjax(roleService.insertRole(role));
@@ -119,14 +119,14 @@
     {
         roleService.checkRoleAllowed(role);
         roleService.checkRoleDataScope(role.getRoleId());
-        if (!roleService.checkRoleNameUnique(role))
-        {
-            return error("淇敼瑙掕壊'" + role.getRoleName() + "'澶辫触锛岃鑹插悕绉板凡瀛樺湪");
-        }
-        else if (!roleService.checkRoleKeyUnique(role))
-        {
-            return error("淇敼瑙掕壊'" + role.getRoleName() + "'澶辫触锛岃鑹叉潈闄愬凡瀛樺湪");
-        }
+//        if (!roleService.checkRoleNameUnique(role))
+//        {
+//            return error("淇敼瑙掕壊'" + role.getRoleName() + "'澶辫触锛岃鑹插悕绉板凡瀛樺湪");
+//        }
+//        else if (!roleService.checkRoleKeyUnique(role))
+//        {
+//            return error("淇敼瑙掕壊'" + role.getRoleName() + "'澶辫触锛岃鑹叉潈闄愬凡瀛樺湪");
+//        }
         role.setUpdateBy(getUsername());
         
         if (roleService.updateRole(role) > 0)
diff --git a/src/main/java/com/ruoyi/purchase/dto/TicketRegistrationDto.java b/src/main/java/com/ruoyi/purchase/dto/TicketRegistrationDto.java
index 33de871..98fe48e 100644
--- a/src/main/java/com/ruoyi/purchase/dto/TicketRegistrationDto.java
+++ b/src/main/java/com/ruoyi/purchase/dto/TicketRegistrationDto.java
@@ -19,6 +19,8 @@
 @Data
 @TableName("ticket_registration")
 public class TicketRegistrationDto extends TicketRegistration {
+    @TableField(exist = false)
+    private Long userId;
 
     /**
      * 涓婚敭ID
diff --git a/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java b/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
index 30e838f..87224c7 100644
--- a/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
+++ b/src/main/java/com/ruoyi/purchase/service/impl/PaymentRegistrationServiceImpl.java
@@ -10,6 +10,7 @@
 import com.ruoyi.basic.pojo.SupplierManage;
 import com.ruoyi.common.utils.DateUtils;
 import com.ruoyi.common.utils.SecurityUtils;
+import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
 import com.ruoyi.framework.security.LoginUser;
 import com.ruoyi.purchase.dto.PaymentHistoryRecordVo;
 import com.ruoyi.purchase.dto.PaymentLedgerDto;
diff --git a/src/main/java/com/ruoyi/purchase/service/impl/ProductRecordServiceImpl.java b/src/main/java/com/ruoyi/purchase/service/impl/ProductRecordServiceImpl.java
index 16eef79..045be00 100644
--- a/src/main/java/com/ruoyi/purchase/service/impl/ProductRecordServiceImpl.java
+++ b/src/main/java/com/ruoyi/purchase/service/impl/ProductRecordServiceImpl.java
@@ -5,6 +5,7 @@
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.ruoyi.common.enums.FileNameType;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.framework.web.domain.AjaxResult;
 import com.ruoyi.purchase.dto.ProductRecordDto;
 import com.ruoyi.purchase.dto.TicketRegistrationDto;
@@ -60,6 +61,8 @@
 
     @Override
     public IPage<ProductRecordDto> productRecordPage(Page page, TicketRegistrationDto ticketRegistrationDto) {
+        Long userId = SecurityUtils.getUserId();
+        ticketRegistrationDto.setUserId(userId);
         IPage<ProductRecordDto> productRecordDtoIPage1 = productRecordMapper.productRecordPage(page, ticketRegistrationDto);
         page.setSize(productRecordDtoIPage1.getTotal());
         IPage<ProductRecordDto> productRecordDtoIPage = productRecordMapper.productRecordPage(page, ticketRegistrationDto);
diff --git a/src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java b/src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
index e5a64fd..70762b9 100644
--- a/src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
+++ b/src/main/java/com/ruoyi/purchase/service/impl/PurchaseLedgerServiceImpl.java
@@ -114,7 +114,6 @@
     @Transactional(rollbackFor = Exception.class)
     public int addOrEditPurchase(PurchaseLedgerDto purchaseLedgerDto) throws IOException {
 
-        SalesLedger salesLedger = salesLedgerMapper.selectById(purchaseLedgerDto.getSalesLedgerId());
         //褰曞叆浜�
         SysUser sysUser = userMapper.selectUserById(purchaseLedgerDto.getRecorderId());
 
@@ -127,7 +126,7 @@
         if(ObjectUtils.isNotEmpty(loginUser) && null != loginUser.getTenantId()) {
             purchaseLedger.setTenantId(loginUser.getTenantId());
         }
-        purchaseLedger.setSalesContractNo(ObjectUtils.isNotEmpty(salesLedger) ? salesLedger.getSalesContractNo() : null);
+        purchaseLedger.setSalesContractNo(purchaseLedgerDto.getSalesContractNo());
         purchaseLedger.setSupplierName(supplierManage.getSupplierName());
         purchaseLedger.setRecorderId(purchaseLedgerDto.getRecorderId());
         purchaseLedger.setRecorderName(sysUser.getNickName());
@@ -473,6 +472,8 @@
 
     @Override
     public IPage<PurchaseLedgerDto> selectPurchaseLedgerListPage(IPage ipage, PurchaseLedgerDto purchaseLedger) {
+        Long userId = SecurityUtils.getUserId();
+        purchaseLedger.setRecorderId(userId);
         IPage<PurchaseLedgerDto> purchaseLedgerDtoIPage = purchaseLedgerMapper.selectPurchaseLedgerListPage(ipage, purchaseLedger);
         purchaseLedgerDtoIPage.getRecords().forEach(purchaseLedgerDto -> {
             List<CommonFile> commonFiles = commonFileMapper.selectList(new LambdaQueryWrapper<CommonFile>().eq(CommonFile::getCommonId, purchaseLedgerDto.getId()).eq(CommonFile::getType, FileNameType.PURCHASELEDGER.getValue()));
diff --git a/src/main/java/com/ruoyi/purchase/service/impl/TicketRegistrationServiceImpl.java b/src/main/java/com/ruoyi/purchase/service/impl/TicketRegistrationServiceImpl.java
index f696be7..418397e 100644
--- a/src/main/java/com/ruoyi/purchase/service/impl/TicketRegistrationServiceImpl.java
+++ b/src/main/java/com/ruoyi/purchase/service/impl/TicketRegistrationServiceImpl.java
@@ -10,6 +10,7 @@
 import com.ruoyi.common.enums.SalesLedgerType;
 import com.ruoyi.common.exception.base.BaseException;
 import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.SecurityUtils;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.bean.BeanUtils;
 import com.ruoyi.other.mapper.TempFileMapper;
@@ -343,6 +344,7 @@
         if (!ObjectUtils.isEmpty(ticketRegistration.getIssueDateStart()) && !ObjectUtils.isEmpty(ticketRegistration.getIssueDateEnd())) {
             queryWrapper.between(TicketRegistration::getIssueDate, LocalDate.parse(ticketRegistration.getIssueDateStart(), DateTimeFormatter.ofPattern("yyyy-MM-dd")), LocalDate.parse(ticketRegistration.getIssueDateEnd(), DateTimeFormatter.ofPattern("yyyy-MM-dd")));
         }
+        queryWrapper.eq(TicketRegistration::getIssUerId, SecurityUtils.getUserId());
         IPage<TicketRegistration> ticketRegistrationIPage = ticketRegistrationMapper.selectPage(page, queryWrapper);
         // 璁$畻宸蹭粯娆鹃噾棰�
         if (CollectionUtils.isNotEmpty(ticketRegistrationIPage.getRecords())) {
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index e52b416..2b5d0d9 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -1,7 +1,7 @@
 # Spring閰嶇疆
 spring:
   profiles:
-    active: cwglxt
+    active: yxglxt
 #10.136.58.65	璐㈠姟绠$悊绯荤粺    cwglxt
 #10.136.58.66	璁惧绠$悊绯荤粺    sbglxt
 #10.136.58.67	鐢熶骇绠℃帶绯荤粺    scgkxt
diff --git a/src/main/resources/mapper/production/ProductionOrderMapper.xml b/src/main/resources/mapper/production/ProductionOrderMapper.xml
new file mode 100644
index 0000000..4410077
--- /dev/null
+++ b/src/main/resources/mapper/production/ProductionOrderMapper.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.production.mapper.ProductionOrderMapper">
+
+</mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml b/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
index 29b88f2..8017590 100644
--- a/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
+++ b/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
@@ -12,33 +12,18 @@
         t4.finished_num,
         t4.work_hours,
         t4.process,
-        T1.sales_contract_no,
-        T1.customer_contract_no,
-        T1.project_name,
-        T1.customer_name,
         t3.product_category,
         t3.specification_model,
         t3.unit
         FROM
         sales_ledger_production_accounting t4
-        LEFT JOIN sales_ledger T1 ON T1.id = t4.sales_ledger_id
-        left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id
+        LEFT JOIN production_order t3 on t3.id = t4.sales_ledger_product_id
         <where>
-            t3.type = 1
             <if test="salesLedgerDto.schedulingUserName != null and salesLedgerDto.schedulingUserName != '' ">
                 AND  t4.scheduling_user_name LIKE CONCAT('%',#{salesLedgerDto.schedulingUserName},'%')
             </if>
-            <if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' ">
-                AND  T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%')
-            </if>
-            <if test="salesLedgerDto.customerContractNo != null and salesLedgerDto.customerContractNo !='' ">
-                AND  T1.customer_contract_no LIKE CONCAT('%',#{salesLedgerDto.customerContractNo},'%')
-            </if>
-            <if test="salesLedgerDto.salesContractNo != null and salesLedgerDto.salesContractNo != '' ">
-                AND  T1.sales_contract_no LIKE CONCAT('%',#{salesLedgerDto.salesContractNo},'%')
-            </if>
-            <if test="salesLedgerDto.projectName != null and salesLedgerDto.projectName != '' ">
-                AND T1.project_name LIKE CONCAT('%',#{salesLedgerDto.projectName},'%')
+            <if test="salesLedgerDto.productCategory != null and salesLedgerDto.productCategory != '' ">
+                AND  t3.product_category LIKE CONCAT('%',#{salesLedgerDto.productCategory},'%')
             </if>
             <if test="salesLedgerDto.entryDateStart != null and salesLedgerDto.entryDateStart != '' ">
                 AND t4.scheduling_date &gt;= DATE_FORMAT(#{salesLedgerDto.entryDateStart},'%Y-%m-%d')
diff --git a/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml b/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
index e7e882c..a2aaa11 100644
--- a/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
+++ b/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
@@ -66,7 +66,6 @@
     <select id="listPageProcess" resultType="com.ruoyi.production.dto.SalesLedgerSchedulingProcessDto">
         SELECT
         t3.id as salesLedgerProductId,
-        T1.id as salesLedgerId,
         T2.id,
         T2.status,
         T2.scheduling_user_id,
@@ -74,33 +73,22 @@
         T2.scheduling_date,
         ifNull(T2.scheduling_num,0) AS schedulingNum,
         ifNull(T2.finished_num,0) AS successNum,
-        T1.sales_contract_no,
-        T1.customer_contract_no,
-        T1.project_name,
-        T1.customer_name,
         t3.product_category,
         t3.specification_model,
-        t3.unit
+        t3.unit,
+        t3.order_no
         FROM
         sales_ledger_scheduling T2
-        LEFT JOIN sales_ledger T1 ON T1.id = T2.sales_ledger_id
-        left join sales_ledger_product t3 on T2.sales_ledger_product_id = t3.id
+        LEFT JOIN production_order t3 on t3.id = T2.sales_ledger_product_id
         <where>
-            t3.type = 1
             <if test="salesLedgerDto.status != null and salesLedgerDto.status != '' ">
                 AND  T2.status = #{salesLedgerDto.status}
             </if>
-            <if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' ">
-                AND  T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%')
+            <if test="salesLedgerDto.orderNo != null and salesLedgerDto.orderNo != '' ">
+                AND  T1.order_no LIKE CONCAT('%',#{salesLedgerDto.orderNo},'%')
             </if>
-            <if test="salesLedgerDto.customerContractNo != null and salesLedgerDto.customerContractNo !='' ">
-                AND  T1.customer_contract_no LIKE CONCAT('%',#{salesLedgerDto.customerContractNo},'%')
-            </if>
-            <if test="salesLedgerDto.salesContractNo != null and salesLedgerDto.salesContractNo != '' ">
-                AND  T1.sales_contract_no LIKE CONCAT('%',#{salesLedgerDto.salesContractNo},'%')
-            </if>
-            <if test="salesLedgerDto.projectName != null and salesLedgerDto.projectName != '' ">
-                AND T1.project_name LIKE CONCAT('%',#{salesLedgerDto.projectName},'%')
+            <if test="salesLedgerDto.productCategory != null and salesLedgerDto.productCategory !='' ">
+                AND  t3.productCategory LIKE CONCAT('%',#{salesLedgerDto.productCategory},'%')
             </if>
             <if test="salesLedgerDto.entryDateStart != null and salesLedgerDto.entryDateStart != '' ">
                 AND T2.scheduling_date &gt;= DATE_FORMAT(#{salesLedgerDto.entryDateStart},'%Y-%m-%d')
diff --git a/src/main/resources/mapper/production/SalesLedgerWorkMapper.xml b/src/main/resources/mapper/production/SalesLedgerWorkMapper.xml
index 41cbe07..5c2d51e 100644
--- a/src/main/resources/mapper/production/SalesLedgerWorkMapper.xml
+++ b/src/main/resources/mapper/production/SalesLedgerWorkMapper.xml
@@ -13,33 +13,26 @@
         t4.finished_num,
         t4.work_hours,
         t4.process,
-        T1.sales_contract_no,
-        T1.customer_contract_no,
-        T1.project_name,
-        T1.customer_name,
+        t4.type,
+        t4.receive,
+        t4.loss,
+        t4.remark,
         t3.product_category,
         t3.specification_model,
-        t3.unit
+        t3.unit,
+        t3.order_no
         FROM
         sales_ledger_work t4
-        LEFT JOIN sales_ledger T1 ON T1.id = t4.sales_ledger_id
-        left join sales_ledger_product t3 on t4.sales_ledger_product_id = t3.id
+        LEFT JOIN production_order t3 on t3.id = t4.sales_ledger_product_id
         <where>
-            t3.type = 1
             <if test="salesLedgerDto.status != null and salesLedgerDto.status != '' ">
                 AND  t4.status = #{salesLedgerDto.status}
             </if>
-            <if test="salesLedgerDto.customerName != null and salesLedgerDto.customerName != '' ">
-                AND  T1.customer_name LIKE CONCAT('%',#{salesLedgerDto.customerName},'%')
+            <if test="salesLedgerDto.orderNo != null and salesLedgerDto.orderNo != '' ">
+                AND  t3.order_no LIKE CONCAT('%',#{salesLedgerDto.orderNo},'%')
             </if>
-            <if test="salesLedgerDto.customerContractNo != null and salesLedgerDto.customerContractNo !='' ">
-                AND  T1.customer_contract_no LIKE CONCAT('%',#{salesLedgerDto.customerContractNo},'%')
-            </if>
-            <if test="salesLedgerDto.salesContractNo != null and salesLedgerDto.salesContractNo != '' ">
-                AND  T1.sales_contract_no LIKE CONCAT('%',#{salesLedgerDto.salesContractNo},'%')
-            </if>
-            <if test="salesLedgerDto.projectName != null and salesLedgerDto.projectName != '' ">
-                AND T1.project_name LIKE CONCAT('%',#{salesLedgerDto.projectName},'%')
+            <if test="salesLedgerDto.productCategory != null and salesLedgerDto.productCategory !='' ">
+                AND  t3.productCategory LIKE CONCAT('%',#{salesLedgerDto.productCategory},'%')
             </if>
             <if test="salesLedgerDto.entryDateStart != null and salesLedgerDto.entryDateStart != '' ">
                 AND t4.scheduling_date &gt;= DATE_FORMAT(#{salesLedgerDto.entryDateStart},'%Y-%m-%d')
diff --git a/src/main/resources/mapper/purchase/ProductRecordMapper.xml b/src/main/resources/mapper/purchase/ProductRecordMapper.xml
index 5c338d7..5fadd64 100644
--- a/src/main/resources/mapper/purchase/ProductRecordMapper.xml
+++ b/src/main/resources/mapper/purchase/ProductRecordMapper.xml
@@ -7,9 +7,7 @@
 
     <select id="productRecordPage" resultType="com.ruoyi.purchase.dto.ProductRecordDto">
         SELECT
-        sl.sales_contract_no,
-        sl.customer_contract_no,
-        sl.customer_name,
+        pl.sales_contract_no,
         pm.model AS product_model,
         pl.purchase_contract_number,
         pl.supplier_name,
@@ -23,12 +21,11 @@
         ROUND(pr.tickets_amount-pr.tickets_amount/(1+pr.tax_rate/100),2 )as invoice_amount
         FROM product_record pr
         left join purchase_ledger pl on pl.id = pr.purchase_ledger_id
-        left join sales_ledger sl on sl.id = pl.sales_ledger_id
         left join ticket_registration tr on tr.id = pr.ticket_registration_id
         left join product_model pm on pm.id = pr.product_model_id
         WHERE type = 2
         <if test="c.salesContractNo != null and c.salesContractNo != ''">
-            and sl.sales_contract_no = #{c.salesContractNo}
+            and pl.sales_contract_no = #{c.salesContractNo}
         </if>
         <if test="c.supplierName != null and c.supplierName != ''">
             and pl.supplier_name = #{c.supplierName}
@@ -42,6 +39,9 @@
         <if test="c.purchaseContractNumber != null and c.purchaseContractNumber != ''">
             and tr.purchase_contract_number like concat('%',#{c.purchaseContractNumber},'%')
         </if>
+        <if test="c.userId != null and c.userId != '' ">
+            AND  pl.recorder_id = #{c.userId}
+        </if>
     </select>
     <select id="getProductRecordById" resultType="com.ruoyi.purchase.dto.ProductRecordDto">
         SELECT
diff --git a/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml b/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
index bc6c38a..9abb583 100644
--- a/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
+++ b/src/main/resources/mapper/purchase/PurchaseLedgerMapper.xml
@@ -44,6 +44,9 @@
             <if test="c.entryDateEnd != null and c.entryDateEnd != '' ">
                 AND  pl.entry_date &lt;= DATE_FORMAT(#{c.entryDateEnd},'%Y-%m-%d')
             </if>
+            <if test="c.recorderId != null and c.recorderId != '' ">
+                AND  pl.recorder_id = #{c.recorderId}
+            </if>
         </where>
         group by pl.id, pl.purchase_contract_number, pl.sales_contract_no, pl.supplier_name,
         pl.project_name,pl.entry_date,

--
Gitblit v1.9.3