From 0ef7a6b7f63a1f7b866bccef4eabf64041d5bbad Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期三, 23 七月 2025 09:29:47 +0800
Subject: [PATCH] yys 新增生产模块
---
src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java | 170 +++++
src/main/java/com/ruoyi/production/pojo/SalesLedgerProductionAccounting.java | 109 +++
src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml | 53 +
src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java | 119 +++
pom.xml | 6
src/main/java/com/ruoyi/production/dto/ProcessSchedulingDto.java | 52 +
src/main/java/com/ruoyi/production/service/impl/SalesLedgerProductionAccountingServiceImpl.java | 30
src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java | 93 +++
src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml | 113 +++
src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java | 16
src/main/java/com/ruoyi/production/controller/SalesLedgerProductionAccountingController.java | 39 +
src/main/resources/application-dev.yml | 2
src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java | 41 +
src/main/java/com/ruoyi/production/dto/SalesLedgerProductDto.java | 72 ++
src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java | 129 ++++
src/main/java/com/ruoyi/production/service/SalesLedgerSchedulingService.java | 32 +
src/main/resources/mapper/production/SalesLedgerWorkMapper.xml | 53 +
src/main/java/com/ruoyi/production/pojo/SalesLedgerScheduling.java | 95 +++
src/main/java/com/ruoyi/production/dto/SalesLedgerProductionAccountingDto.java | 64 ++
src/main/java/com/ruoyi/production/dto/ProductionReportDto.java | 41 +
src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java | 132 ++++
src/main/java/com/ruoyi/production/service/SalesLedgerProductionAccountingService.java | 19
src/main/java/com/ruoyi/production/service/SalesLedgerWorkService.java | 26
src/main/java/com/ruoyi/production/controller/SalesLedgerWorkController.java | 71 ++
src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java | 110 +++
src/main/java/com/ruoyi/production/mapper/SalesLedgerProductionAccountingMapper.java | 20
src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java | 73 ++
src/main/java/com/ruoyi/production/mapper/SalesLedgerSchedulingMapper.java | 40 +
src/main/java/com/ruoyi/production/mapper/SalesLedgerWorkMapper.java | 24
src/main/resources/application.yml | 2
30 files changed, 1,842 insertions(+), 4 deletions(-)
diff --git a/pom.xml b/pom.xml
index 51d1a67..5518a5e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -46,6 +46,12 @@
</properties>
<dependencies>
+ <!-- ruoyi-springboot2 / swagger knife4j 閰嶇疆 -->
+ <dependency>
+ <groupId>com.github.xiaoymin</groupId>
+ <artifactId>knife4j-spring-boot-starter</artifactId>
+ <version>3.0.3</version>
+ </dependency>
<!-- SpringBoot 鏍稿績鍖� -->
<dependency>
diff --git a/src/main/java/com/ruoyi/production/controller/SalesLedgerProductionAccountingController.java b/src/main/java/com/ruoyi/production/controller/SalesLedgerProductionAccountingController.java
new file mode 100644
index 0000000..ed7ac26
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/controller/SalesLedgerProductionAccountingController.java
@@ -0,0 +1,39 @@
+package com.ruoyi.production.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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.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;
+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;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 14:43
+ */
+@RestController
+@Api(tags = "鐢熶骇鏍哥畻")
+@RequestMapping("/salesLedger/productionAccounting")
+public class SalesLedgerProductionAccountingController extends BaseController {
+
+ @Autowired
+ private SalesLedgerProductionAccountingServiceImpl salesLedgerProductionAccountingService;
+
+ @GetMapping("/listPage")
+ @ApiOperation("鐢熶骇鏍哥畻-鍒嗛〉鏌ヨ")
+ @Log(title = "鐢熶骇鏍哥畻-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
+ public AjaxResult listPage(Page page, SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto) {
+ IPage<SalesLedgerProductionAccountingDto> list = salesLedgerProductionAccountingService.listPage(page, salesLedgerProductionAccountingDto);
+ return AjaxResult.success(list);
+ }
+
+}
diff --git a/src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java b/src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java
new file mode 100644
index 0000000..22b96b4
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/controller/SalesLedgerSchedulingController.java
@@ -0,0 +1,93 @@
+package com.ruoyi.production.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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.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;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 14:43
+ */
+@RestController
+@Api(tags = "鐢熶骇璁㈠崟")
+@RequestMapping("/salesLedger/scheduling")
+public class SalesLedgerSchedulingController extends BaseController {
+
+ @Autowired
+ 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);
+ }
+
+ /**
+ * 瀵煎嚭
+ * @param response
+ */
+ @PostMapping("/export")
+ @ApiOperation("鐢熶骇绠$悊-鐢熶骇璁㈠崟-瀵煎嚭")
+ public void export(HttpServletResponse response) {
+ salesLedgerSchedulingService.export(response);
+ }
+
+ @PostMapping("/productionDispatch")
+ @Log(title = "鐢熶骇绠$悊-鐢熶骇璁㈠崟-鐢熶骇娲惧伐", businessType = BusinessType.INSERT)
+ @ApiOperation("鐢熶骇绠$悊-鐢熶骇璁㈠崟-鐢熶骇娲惧伐")
+ @Transactional(rollbackFor = Exception.class)
+ public AjaxResult productionDispatch(@RequestBody ProductionDispatchAddDto productionDispatchAddDto) {
+ int result = salesLedgerSchedulingService.productionDispatch(productionDispatchAddDto);
+ return AjaxResult.success(result);
+ }
+
+ @GetMapping("/listPageProcess")
+ @Log(title = "鐢熶骇绠$悊-宸ュ簭鎺掍骇-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
+ @ApiOperation("鐢熶骇绠$悊-宸ュ簭鎺掍骇-鍒嗛〉鏌ヨ")
+ public AjaxResult listPageProcess(Page page, SalesLedgerSchedulingProcessDto salesLedgerSchedulingDto) {
+ IPage<SalesLedgerSchedulingProcessDto> result = salesLedgerSchedulingService.listPageProcess(page,salesLedgerSchedulingDto);
+ return AjaxResult.success(result);
+ }
+
+
+ @DeleteMapping("/productionDispatchDelete")
+ @Log(title = "鐢熶骇绠$悊-宸ュ簭鎺掍骇-鍙栨秷鎺掍骇", businessType = BusinessType.DELETE)
+ @ApiOperation("鐢熶骇绠$悊-宸ュ簭鎺掍骇-鍙栨秷鎺掍骇")
+ @Transactional(rollbackFor = Exception.class)
+ public AjaxResult productionDispatchDelete(@RequestBody List<Long> ids) {
+ int result = salesLedgerSchedulingService.productionDispatchDelete(ids);
+ return AjaxResult.success(result);
+ }
+
+
+ @PostMapping("/processScheduling")
+ @Log(title = "鐢熶骇绠$悊-宸ュ簭鎺掍骇", businessType = BusinessType.INSERT)
+ @ApiOperation("鐢熶骇绠$悊-宸ュ簭鎺掍骇")
+ @Transactional(rollbackFor = Exception.class)
+ public AjaxResult processScheduling(@RequestBody List<ProcessSchedulingDto> processSchedulingDto) {
+ int result = salesLedgerSchedulingService.processScheduling(processSchedulingDto);
+ return AjaxResult.success(result);
+ }
+
+
+}
diff --git a/src/main/java/com/ruoyi/production/controller/SalesLedgerWorkController.java b/src/main/java/com/ruoyi/production/controller/SalesLedgerWorkController.java
new file mode 100644
index 0000000..866970e
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/controller/SalesLedgerWorkController.java
@@ -0,0 +1,71 @@
+package com.ruoyi.production.controller;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+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.dto.ProcessSchedulingDto;
+import com.ruoyi.production.dto.ProductionReportDto;
+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;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 14:43
+ */
+@RestController
+@Api(tags = "鐢熶骇鎶ュ伐(鎺掍骇璁板綍)")
+@RequestMapping("/salesLedger/work")
+public class SalesLedgerWorkController extends BaseController {
+
+
+ @Autowired
+ private SalesLedgerWorkServiceImpl salesLedgerWorkService;
+
+ @GetMapping("/listPage")
+ @Log(title = "鐢熶骇鎶ュ伐-鍒嗛〉鏌ヨ", businessType = BusinessType.OTHER)
+ @ApiOperation("鐢熶骇鎶ュ伐-鍒嗛〉鏌ヨ")
+ public AjaxResult listPage(Page page, SalesLedgerWorkDto salesLedgerWorkDto) {
+ IPage<SalesLedgerWorkDto> listPage = salesLedgerWorkService.listPage(page, salesLedgerWorkDto);
+ return AjaxResult.success(listPage);
+ }
+
+ @GetMapping("/list")
+ @Log(title = "鐢熶骇鎶ュ伐-鏌ヨ", businessType = BusinessType.OTHER)
+ @ApiOperation("鐢熶骇鎶ュ伐-鏌ヨ")
+ public AjaxResult list(@RequestParam("id") Long id) {
+ List<ProductionReportDto> list = salesLedgerWorkService.getList(id);
+ return AjaxResult.success(list);
+ }
+
+ @PostMapping("/productionReport")
+ @Log(title = "鐢熶骇绠$悊-鐢熶骇鎶ュ伐", businessType = BusinessType.INSERT)
+ @ApiOperation("鐢熶骇绠$悊-鐢熶骇鎶ュ伐")
+ @Transactional(rollbackFor = Exception.class)
+ public AjaxResult productionReport(@RequestBody ProductionReportDto productionReportDto) {
+ int result = salesLedgerWorkService.productionReport(productionReportDto);
+ return AjaxResult.success(result);
+ }
+
+
+ @PostMapping("/productionReportUpdate")
+ @Log(title = "鐢熶骇绠$悊-鐢熶骇鎶ュ伐-淇敼", businessType = BusinessType.UPDATE)
+ @ApiOperation("鐢熶骇绠$悊-鐢熶骇鎶ュ伐-淇敼")
+ @Transactional(rollbackFor = Exception.class)
+ public AjaxResult productionReportUpdate(@RequestBody ProductionReportDto productionReportDto) {
+ int result = salesLedgerWorkService.productionReportUpdate(productionReportDto);
+ return AjaxResult.success(result);
+ }
+
+}
diff --git a/src/main/java/com/ruoyi/production/dto/ProcessSchedulingDto.java b/src/main/java/com/ruoyi/production/dto/ProcessSchedulingDto.java
new file mode 100644
index 0000000..6cf971e
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/dto/ProcessSchedulingDto.java
@@ -0,0 +1,52 @@
+package com.ruoyi.production.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+/**
+ * @author :yys
+ * @date : 2025/7/22 9:19
+ */
+@Data
+@ApiModel
+public class ProcessSchedulingDto {
+
+ private Long id;
+
+ /**
+ * 鎺掍骇浜篿d
+ */
+ @ApiModelProperty(value = "鎺掍骇浜篿d")
+ private Long schedulingUserId;
+
+
+ /**
+ * 鎺掍骇鏁伴噺
+ */
+ @ApiModelProperty(value = "鎺掍骇鏁伴噺")
+ private BigDecimal schedulingNum;
+
+
+ /**
+ * 宸ユ椂瀹氶
+ */
+ @ApiModelProperty(value = "宸ユ椂瀹氶")
+ private BigDecimal workHours;
+
+ /**
+ * 宸ュ簭
+ */
+ @ApiModelProperty(value = "宸ュ簭")
+ private String process;
+ /**
+ * 鎺掍骇鏃ユ湡
+ */
+ @ApiModelProperty(value = "鎺掍骇鏃ユ湡")
+ private String schedulingDate;
+
+
+}
diff --git a/src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java b/src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java
new file mode 100644
index 0000000..e78d868
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/dto/ProductionDispatchAddDto.java
@@ -0,0 +1,41 @@
+package com.ruoyi.production.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 16:28
+ */
+@Data
+@ApiModel
+public class ProductionDispatchAddDto {
+
+ @ApiModelProperty(value = "閿�鍞彴璐D")
+ private Long salesLedgerId;
+
+ @ApiModelProperty(value = "閿�鍞骇鍝両D")
+ private Long salesLedgerProductId;
+
+ /**
+ * 鎺掍骇鏁伴噺
+ */
+ @ApiModelProperty(value = "鎺掍骇鏁伴噺")
+ private BigDecimal schedulingNum;
+
+ /**
+ * 鎺掍骇浜�
+ */
+ @ApiModelProperty(value = "鎺掍骇浜�")
+ private Long schedulingUserId;
+
+ /**
+ * 鎺掍骇鏃ユ湡
+ */
+ @ApiModelProperty(value = "鎺掍骇鏃ユ湡")
+ private String schedulingDate;
+
+}
diff --git a/src/main/java/com/ruoyi/production/dto/ProductionReportDto.java b/src/main/java/com/ruoyi/production/dto/ProductionReportDto.java
new file mode 100644
index 0000000..6b5e164
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/dto/ProductionReportDto.java
@@ -0,0 +1,41 @@
+package com.ruoyi.production.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author :yys
+ * @date : 2025/7/22 10:24
+ */
+@Data
+@ApiModel
+public class ProductionReportDto {
+
+ private Long id;
+ /**
+ * 鎺掍骇浜篿d
+ */
+ @ApiModelProperty(value = "鐢熶骇浜篿d")
+ private Long schedulingUserId;
+
+ /**
+ * 鎺掍骇鏁伴噺
+ */
+ private BigDecimal schedulingNum;
+
+ /**
+ * 鐢熶骇鏁伴噺
+ */
+ @ApiModelProperty(value = "鐢熶骇鏁伴噺")
+ private BigDecimal finishedNum;
+
+ /**
+ * 鐢熶骇鏃ユ湡
+ */
+ @ApiModelProperty(value = "鐢熶骇鏃ユ湡")
+ private String schedulingDate;
+
+}
diff --git a/src/main/java/com/ruoyi/production/dto/SalesLedgerProductDto.java b/src/main/java/com/ruoyi/production/dto/SalesLedgerProductDto.java
new file mode 100644
index 0000000..33e758d
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/dto/SalesLedgerProductDto.java
@@ -0,0 +1,72 @@
+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
+ * @date : 2025/7/22 9:35
+ */
+@Data
+@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 customerName;
+
+
+ /**
+ * 浜у搧澶х被
+ */
+ @Excel(name = "浜у搧澶х被")
+ @ApiModelProperty(value = "浜у搧澶х被")
+ private String productCategory;
+
+ /**
+ * 瑙勬牸鍨嬪彿
+ */
+ @Excel(name = "瑙勬牸鍨嬪彿")
+ @ApiModelProperty(value = "瑙勬牸鍨嬪彿")
+ private String specificationModel;
+
+ /**
+ * 鍗曚綅
+ */
+ @Excel(name = "鍗曚綅")
+ @ApiModelProperty(value = "鍗曚綅")
+ private String unit;
+
+
+}
diff --git a/src/main/java/com/ruoyi/production/dto/SalesLedgerProductionAccountingDto.java b/src/main/java/com/ruoyi/production/dto/SalesLedgerProductionAccountingDto.java
new file mode 100644
index 0000000..d590eaf
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/dto/SalesLedgerProductionAccountingDto.java
@@ -0,0 +1,64 @@
+package com.ruoyi.production.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @author :yys
+ * @date : 2025/7/22 13:55
+ */
+@Data
+@ApiModel
+public class SalesLedgerProductionAccountingDto extends SalesLedgerProductDto{
+
+ /**
+ * 鐢熶骇浜篿d
+ */
+ @ApiModelProperty(value = "鐢熶骇浜篿d")
+ private Long schedulingUserId;
+
+ /**
+ * 鎺掍骇浜哄悕绉�
+ */
+ @ApiModelProperty(value = "鐢熶骇浜哄悕绉�")
+ private String schedulingUserName;
+
+
+ /**
+ * 宸ヨ祫
+ */
+ @ApiModelProperty(value = "宸ヨ祫")
+ private BigDecimal wages;
+
+ /**
+ * 鐢熶骇鏁伴噺
+ */
+ @ApiModelProperty(value = "鐢熶骇鏁伴噺")
+ private BigDecimal finishedNum;
+
+ /**
+ * 宸ユ椂瀹氶
+ */
+ @ApiModelProperty(value = "宸ユ椂瀹氶")
+ private BigDecimal workHours;
+
+ /**
+ * 宸ュ簭
+ */
+ @ApiModelProperty(value = "宸ュ簭")
+ private String process;
+ /**
+ * 鎺掍骇鏃ユ湡
+ */
+ @ApiModelProperty(value = "鎺掍骇鏃ユ湡")
+ private String schedulingDate;
+
+ @ApiModelProperty(value = "寮�濮嬫椂闂�")
+ private String schedulingDateStart;
+ @ApiModelProperty(value = "缁撴潫鏃堕棿")
+ private String schedulingDateEnd;
+
+}
diff --git a/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java b/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java
new file mode 100644
index 0000000..accffb0
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingDto.java
@@ -0,0 +1,119 @@
+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;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.util.Date;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 15:42
+ */
+@Data
+@ApiModel
+public class SalesLedgerSchedulingDto {
+
+ @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 = "浜у搧澶х被")
+ @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 = "瀹屽伐鏁伴噺")
+ @ApiModelProperty(value = "瀹屽伐鏁伴噺")
+ private BigDecimal successNum;
+
+ @ApiModelProperty(value = "绉熸埛ID")
+ private Long tenantId;
+
+}
diff --git a/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java b/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java
new file mode 100644
index 0000000..56adc8e
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/dto/SalesLedgerSchedulingProcessDto.java
@@ -0,0 +1,132 @@
+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;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 16:47
+ */
+@Data
+@ApiModel
+public class SalesLedgerSchedulingProcessDto {
+
+ @ApiModelProperty(value = "閿�鍞骇鍝両D")
+ private Long salesLedgerProductId;
+
+ @ApiModelProperty(value = "閿�鍞彴璐D")
+ private Long salesLedgerId;
+
+ @ApiModelProperty(value = "寮�濮嬫椂闂�")
+ private String schedulingDateStart;
+
+ @ApiModelProperty(value = "缁撴潫鏃堕棿")
+ private String schedulingDateEnd;
+
+ /**
+ * id
+ */
+ private Long id;
+
+ /**
+ * 閿�鍞悎鍚屽彿
+ */
+ @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 schedulingDate;
+
+ /**
+ * 瀹㈡埛鍚嶇О
+ */
+ @Excel(name = "瀹㈡埛鍚嶇О")
+ @ApiModelProperty(value = "瀹㈡埛鍚嶇О")
+ private String customerName;
+
+
+ /**
+ * 浜у搧澶х被
+ */
+ @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 Integer status;
+
+ /**
+ * 娲惧伐浜�
+ */
+ @Excel(name = "娲惧伐浜�")
+ @ApiModelProperty(value = "娲惧伐浜�")
+ private String schedulingUserName;
+
+ /**
+ * 娲惧伐浜�
+ */
+ @ApiModelProperty(value = "娲惧伐浜篿d")
+ private Long schedulingUserId;
+
+
+ /**
+ * 鎺掍骇鏁伴噺
+ */
+ @Excel(name = "鎺掍骇鏁伴噺")
+ @ApiModelProperty(value = "鎺掍骇鏁伴噺")
+ private BigDecimal schedulingNum;
+
+ /**
+ * 宸叉帓浜ф暟閲�
+ */
+ @ApiModelProperty(value = "宸叉帓浜ф暟閲�")
+ private BigDecimal successNum;
+
+ private Long tenantId;
+
+}
diff --git a/src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java b/src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java
new file mode 100644
index 0000000..bf9e9d5
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/dto/SalesLedgerWorkDto.java
@@ -0,0 +1,73 @@
+package com.ruoyi.production.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+
+/**
+ * @author :yys
+ * @date : 2025/7/22 9:33
+ */
+@Data
+@ApiModel
+public class SalesLedgerWorkDto extends SalesLedgerProductDto{
+
+ private Long id;
+
+ /**
+ * 鎺掍骇浜篿d
+ */
+ @ApiModelProperty(value = "鎺掍骇浜篿d")
+ private Long schedulingUserId;
+
+ /**
+ * 鎺掍骇浜哄悕绉�
+ */
+ @ApiModelProperty(value = "鎺掍骇浜哄悕绉�")
+ private String schedulingUserName;
+
+
+ /**
+ * 鎺掍骇鏁伴噺
+ */
+ @ApiModelProperty(value = "鎺掍骇鏁伴噺")
+ private BigDecimal schedulingNum;
+
+ /**
+ * 鐢熶骇鏁伴噺
+ */
+ @ApiModelProperty(value = "鐢熶骇鏁伴噺")
+ private BigDecimal finishedNum;
+
+ /**
+ * 宸ユ椂瀹氶
+ */
+ @ApiModelProperty(value = "宸ユ椂瀹氶")
+ private BigDecimal workHours;
+
+ /**
+ * 宸ュ簭
+ */
+ @ApiModelProperty(value = "宸ュ簭")
+ private String process;
+ /**
+ * 鎺掍骇鏃ユ湡
+ */
+ @ApiModelProperty(value = "鎺掍骇鏃ユ湡")
+ private String schedulingDate;
+
+ @ApiModelProperty(value = "寮�濮嬫椂闂�")
+ private String schedulingDateStart;
+ @ApiModelProperty(value = "缁撴潫鏃堕棿")
+ private String schedulingDateEnd;
+
+ /**
+ * 鎶ュ伐鐘舵�侊紙1-寰呯敓浜� 2-宸叉姤宸ワ級
+ */
+ @ApiModelProperty(value = "鎶ュ伐鐘舵��")
+ private Integer status;
+
+}
diff --git a/src/main/java/com/ruoyi/production/mapper/SalesLedgerProductionAccountingMapper.java b/src/main/java/com/ruoyi/production/mapper/SalesLedgerProductionAccountingMapper.java
new file mode 100644
index 0000000..64477b5
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/mapper/SalesLedgerProductionAccountingMapper.java
@@ -0,0 +1,20 @@
+package com.ruoyi.production.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.production.dto.SalesLedgerProductionAccountingDto;
+import com.ruoyi.production.pojo.SalesLedgerProductionAccounting;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 14:38
+ */
+public interface SalesLedgerProductionAccountingMapper extends BaseMapper<SalesLedgerProductionAccounting> {
+
+
+ IPage<SalesLedgerProductionAccountingDto> listPage(Page page,@Param("salesLedgerDto") SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto);
+
+
+}
diff --git a/src/main/java/com/ruoyi/production/mapper/SalesLedgerSchedulingMapper.java b/src/main/java/com/ruoyi/production/mapper/SalesLedgerSchedulingMapper.java
new file mode 100644
index 0000000..140de3d
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/mapper/SalesLedgerSchedulingMapper.java
@@ -0,0 +1,40 @@
+package com.ruoyi.production.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.production.dto.SalesLedgerSchedulingDto;
+import com.ruoyi.production.dto.SalesLedgerSchedulingProcessDto;
+import com.ruoyi.production.pojo.SalesLedgerScheduling;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 14:37
+ */
+public interface SalesLedgerSchedulingMapper extends BaseMapper<SalesLedgerScheduling> {
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ * @param page
+ * @param salesLedgerSchedulingDto
+ * @return
+ */
+ IPage<SalesLedgerSchedulingDto> listPage(Page page,@Param("salesLedgerDto") SalesLedgerSchedulingDto salesLedgerSchedulingDto);
+
+ /**
+ * 瀵煎嚭
+ * @return
+ */
+ List<SalesLedgerSchedulingDto> list();
+
+ /**
+ * 鍒嗛〉鏌ヨ宸ュ簭鎺掍骇
+ * @param page
+ * @param salesLedgerSchedulingDto
+ * @return
+ */
+ IPage<SalesLedgerSchedulingProcessDto> listPageProcess(Page page,@Param("salesLedgerDto") SalesLedgerSchedulingProcessDto salesLedgerSchedulingDto);
+}
diff --git a/src/main/java/com/ruoyi/production/mapper/SalesLedgerWorkMapper.java b/src/main/java/com/ruoyi/production/mapper/SalesLedgerWorkMapper.java
new file mode 100644
index 0000000..adf5dc3
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/mapper/SalesLedgerWorkMapper.java
@@ -0,0 +1,24 @@
+package com.ruoyi.production.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ruoyi.production.dto.SalesLedgerWorkDto;
+import com.ruoyi.production.pojo.SalesLedgerWork;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 14:37
+ */
+public interface SalesLedgerWorkMapper extends BaseMapper<SalesLedgerWork> {
+
+ /**
+ * 鍒嗛〉鏌ヨ
+ * @param page
+ * @param salesLedgerWorkDto
+ * @return
+ */
+ IPage<SalesLedgerWorkDto> listPage(Page page,@Param("salesLedgerDto") SalesLedgerWorkDto salesLedgerWorkDto);
+
+}
diff --git a/src/main/java/com/ruoyi/production/pojo/SalesLedgerProductionAccounting.java b/src/main/java/com/ruoyi/production/pojo/SalesLedgerProductionAccounting.java
new file mode 100644
index 0000000..2959e4d
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/pojo/SalesLedgerProductionAccounting.java
@@ -0,0 +1,109 @@
+package com.ruoyi.production.pojo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Builder;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * @author :yys
+ * @date : 2025/7/8 13:24
+ */
+@TableName("sales_ledger_production_accounting")
+@Data
+@Builder
+public class SalesLedgerProductionAccounting {
+
+ private static final long serialVersionUID = 1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 閿�鍞帓浜�-鎶ュ伐琛╥d
+ */
+ private Long salesLedgerWorkId;
+
+ /**
+ * 閿�鍞帓浜ц〃id
+ */
+ private Long salesLedgerSchedulingId;
+
+ /**
+ * 閿�鍞彴璐d
+ */
+ private Long salesLedgerId;
+
+ /**
+ * 閿�鍞骇鍝乮d
+ */
+ private Long salesLedgerProductId;
+
+ /**
+ * 鐢熶骇浜篿d
+ */
+ private Long schedulingUserId;
+
+ /**
+ * 鐢熶骇浜哄悕绉�
+ */
+ private String schedulingUserName;
+
+ /**
+ * 鐢熶骇鏁伴噺
+ */
+ private BigDecimal finishedNum;
+
+ /**
+ * 宸ユ椂瀹氶
+ */
+ private BigDecimal workHours;
+
+ /**
+ * 宸ュ簭
+ */
+ private String process;
+ /**
+ * 鐢熶骇鏃ユ湡
+ */
+ private LocalDate schedulingDate;
+
+ /**
+ *
+ */
+ private Integer status;
+
+ /**
+ * 鍒涘缓鑰�
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private Integer createUser;
+
+ /**
+ * 鍒涘缓鏃堕棿
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private LocalDateTime createTime;
+
+ /**
+ * 淇敼鑰�
+ */
+ @TableField(fill = FieldFill.UPDATE)
+ private Integer updateUser;
+
+ /**
+ * 淇敼鏃堕棿
+ */
+ @TableField(fill = FieldFill.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
new file mode 100644
index 0000000..937ff7f
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/pojo/SalesLedgerScheduling.java
@@ -0,0 +1,95 @@
+package com.ruoyi.production.pojo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Builder;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * @author :yys
+ * @date : 2025/7/8 13:24
+ */
+@TableName("sales_ledger_scheduling")
+@Data
+@Builder
+public class SalesLedgerScheduling {
+
+ private static final long serialVersionUID = 1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 閿�鍞彴璐d
+ */
+ private Long salesLedgerId;
+
+ /**
+ * 閿�鍞骇鍝乮d
+ */
+ private Long salesLedgerProductId;
+
+ /**
+ * 娲惧伐浜篿d
+ */
+ private Long schedulingUserId;
+
+ /**
+ * 娲惧伐浜哄悕绉�
+ */
+ private String schedulingUserName;
+
+
+ /**
+ * 鎺掍骇鏁伴噺
+ */
+ private BigDecimal schedulingNum;
+
+ /**
+ * 宸叉帓浜ф暟閲�
+ */
+ private BigDecimal finishedNum;
+ /**
+ * 娲惧伐鏃ユ湡
+ */
+ private LocalDate schedulingDate;
+
+ /**
+ * 鎺掍骇鐘舵�侊紙1-寰呮帓浜� 2-鎺掍骇涓� 3-宸叉帓浜э級
+ */
+ private Integer status;
+
+ /**
+ * 鍒涘缓鑰�
+ */
+ @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/SalesLedgerWork.java b/src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java
new file mode 100644
index 0000000..b722105
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/pojo/SalesLedgerWork.java
@@ -0,0 +1,110 @@
+package com.ruoyi.production.pojo;
+
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.Builder;
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+/**
+ * @author :yys
+ * @date : 2025/7/8 13:24
+ */
+@TableName("sales_ledger_work")
+@Data
+@Builder
+public class SalesLedgerWork {
+
+ private static final long serialVersionUID = 1L;
+
+ @TableId(value = "id", type = IdType.AUTO)
+ private Long id;
+
+ /**
+ * 閿�鍞帓浜ц〃id
+ */
+ private Long salesLedgerSchedulingId;
+
+ /**
+ * 閿�鍞彴璐d
+ */
+ private Long salesLedgerId;
+
+ /**
+ * 閿�鍞骇鍝乮d
+ */
+ private Long salesLedgerProductId;
+
+ /**
+ * 鎺掍骇浜篿d
+ */
+ private Long schedulingUserId;
+
+ /**
+ * 鎺掍骇浜哄悕绉�
+ */
+ private String schedulingUserName;
+
+
+ /**
+ * 鎺掍骇鏁伴噺
+ */
+ private BigDecimal schedulingNum;
+
+ /**
+ * 鐢熶骇鏁伴噺
+ */
+ private BigDecimal finishedNum;
+
+ /**
+ * 宸ユ椂瀹氶
+ */
+ private BigDecimal workHours;
+
+ /**
+ * 宸ュ簭
+ */
+ private String process;
+ /**
+ * 鎺掍骇鏃ユ湡
+ */
+ private LocalDate schedulingDate;
+
+ /**
+ * 鎶ュ伐鐘舵�侊紙1-寰呯敓浜� 2-鐢熶骇涓� 3-宸叉姤宸ワ級
+ */
+ private Integer status;
+
+ /**
+ * 鍒涘缓鑰�
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private Integer createUser;
+
+ /**
+ * 鍒涘缓鏃堕棿
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private LocalDateTime createTime;
+
+ /**
+ * 淇敼鑰�
+ */
+ @TableField(fill = FieldFill.UPDATE)
+ private Integer updateUser;
+
+ /**
+ * 淇敼鏃堕棿
+ */
+ @TableField(fill = FieldFill.UPDATE)
+ private LocalDateTime updateTime;
+
+ /**
+ * 绉熸埛ID
+ */
+ @TableField(fill = FieldFill.INSERT)
+ private Long tenantId;
+
+}
diff --git a/src/main/java/com/ruoyi/production/service/SalesLedgerProductionAccountingService.java b/src/main/java/com/ruoyi/production/service/SalesLedgerProductionAccountingService.java
new file mode 100644
index 0000000..11c62f4
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/service/SalesLedgerProductionAccountingService.java
@@ -0,0 +1,19 @@
+package com.ruoyi.production.service;
+
+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.production.dto.SalesLedgerProductionAccountingDto;
+import com.ruoyi.production.pojo.SalesLedgerProductionAccounting;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 14:39
+ */
+public interface SalesLedgerProductionAccountingService extends IService<SalesLedgerProductionAccounting> {
+
+
+ IPage<SalesLedgerProductionAccountingDto> listPage(Page page, SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto);
+
+
+}
diff --git a/src/main/java/com/ruoyi/production/service/SalesLedgerSchedulingService.java b/src/main/java/com/ruoyi/production/service/SalesLedgerSchedulingService.java
new file mode 100644
index 0000000..484bd23
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/service/SalesLedgerSchedulingService.java
@@ -0,0 +1,32 @@
+package com.ruoyi.production.service;
+
+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.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.pojo.SalesLedgerScheduling;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 14:39
+ */
+public interface SalesLedgerSchedulingService extends IService<SalesLedgerScheduling> {
+
+ IPage<SalesLedgerSchedulingDto> listPage(Page page, SalesLedgerSchedulingDto salesLedgerSchedulingDto);
+
+ void export(HttpServletResponse response);
+
+ int productionDispatch(ProductionDispatchAddDto productionDispatchAddDto);
+
+ IPage<SalesLedgerSchedulingProcessDto> listPageProcess(Page page, SalesLedgerSchedulingProcessDto salesLedgerSchedulingDto);
+
+ int productionDispatchDelete(List<Long> ids);
+
+ int processScheduling(List<ProcessSchedulingDto> processSchedulingDto);
+}
diff --git a/src/main/java/com/ruoyi/production/service/SalesLedgerWorkService.java b/src/main/java/com/ruoyi/production/service/SalesLedgerWorkService.java
new file mode 100644
index 0000000..b219515
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/service/SalesLedgerWorkService.java
@@ -0,0 +1,26 @@
+package com.ruoyi.production.service;
+
+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;
+
+import java.util.List;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 14:38
+ */
+public interface SalesLedgerWorkService extends IService<SalesLedgerWork> {
+
+ IPage<SalesLedgerWorkDto> listPage(Page page, SalesLedgerWorkDto salesLedgerWorkDto);
+
+ int productionReport(ProductionReportDto productionReportDto);
+
+ int productionReportUpdate(ProductionReportDto productionReportDto);
+
+ List<ProductionReportDto> getList(Long id);
+}
diff --git a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerProductionAccountingServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerProductionAccountingServiceImpl.java
new file mode 100644
index 0000000..3d510b8
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerProductionAccountingServiceImpl.java
@@ -0,0 +1,30 @@
+package com.ruoyi.production.service.impl;
+
+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.production.dto.SalesLedgerProductionAccountingDto;
+import com.ruoyi.production.mapper.SalesLedgerProductionAccountingMapper;
+import com.ruoyi.production.pojo.SalesLedgerProductionAccounting;
+import com.ruoyi.production.service.SalesLedgerProductionAccountingService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 14:41
+ */
+@Service
+@RequiredArgsConstructor
+@Slf4j
+public class SalesLedgerProductionAccountingServiceImpl extends ServiceImpl<SalesLedgerProductionAccountingMapper, SalesLedgerProductionAccounting> implements SalesLedgerProductionAccountingService {
+
+ private final SalesLedgerProductionAccountingMapper salesLedgerProductionAccountingMapper;
+
+ @Override
+ public IPage<SalesLedgerProductionAccountingDto> listPage(Page page, SalesLedgerProductionAccountingDto salesLedgerProductionAccountingDto) {
+ IPage<SalesLedgerProductionAccountingDto> list = salesLedgerProductionAccountingMapper.listPage(page, salesLedgerProductionAccountingDto);
+ return list;
+ }
+}
diff --git a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
new file mode 100644
index 0000000..a275a3d
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerSchedulingServiceImpl.java
@@ -0,0 +1,170 @@
+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.poi.ExcelUtil;
+import com.ruoyi.procurementrecord.dto.ProcurementRecordOutPageDto;
+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;
+import com.ruoyi.production.pojo.SalesLedgerWork;
+import com.ruoyi.production.service.SalesLedgerSchedulingService;
+import com.ruoyi.project.system.domain.SysUser;
+import com.ruoyi.project.system.mapper.SysUserMapper;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import javax.servlet.http.HttpServletResponse;
+import java.math.BigDecimal;
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 14:41
+ */
+@Service
+@RequiredArgsConstructor
+@Slf4j
+public class SalesLedgerSchedulingServiceImpl extends ServiceImpl<SalesLedgerSchedulingMapper, SalesLedgerScheduling> implements SalesLedgerSchedulingService {
+
+ private final SalesLedgerSchedulingMapper salesLedgerSchedulingMapper;
+
+ private final SalesLedgerWorkMapper salesLedgerWorkMapper;
+
+ @Override
+ public IPage<SalesLedgerSchedulingDto> listPage(Page page, SalesLedgerSchedulingDto salesLedgerSchedulingDto) {
+ IPage<SalesLedgerSchedulingDto> list = salesLedgerSchedulingMapper.listPage(page, salesLedgerSchedulingDto);
+ if(list.getTotal() == 0){
+ return list;
+ }
+ Set<Long> collect = list.getRecords().stream().map(SalesLedgerSchedulingDto::getSalesLedgerProductId).collect(Collectors.toSet());
+ 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.setSuccessNum(salesLedgerWorks
+ .stream()
+ .filter(j -> j.getSalesLedgerProductId().equals(i.getSalesLedgerProductId()))
+ .map(SalesLedgerWork::getFinishedNum)
+ .reduce(BigDecimal.ZERO, BigDecimal::add));
+ });
+ return list;
+ }
+
+ @Override
+ public void export(HttpServletResponse response) {
+ List<SalesLedgerSchedulingDto> list = salesLedgerSchedulingMapper.list();
+ if(CollectionUtils.isEmpty(list)){
+ throw new RuntimeException("鏃犲鍑烘暟鎹�");
+ }
+ Set<Long> collect = list.stream().map(SalesLedgerSchedulingDto::getSalesLedgerProductId).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.getSalesLedgerProductId()))
+ .map(SalesLedgerWork::getFinishedNum)
+ .reduce(BigDecimal.ZERO, BigDecimal::add));
+ });
+ ExcelUtil<SalesLedgerSchedulingDto> util = new ExcelUtil<>(SalesLedgerSchedulingDto.class);
+ util.exportExcel(response, list, "鐢熶骇璁㈠崟");
+ }
+
+ private final SysUserMapper sysUserMapper;
+
+ @Override
+ public int productionDispatch(ProductionDispatchAddDto productionDispatchAddDto) {
+ SysUser sysUser = sysUserMapper.selectUserById(productionDispatchAddDto.getSchedulingUserId());
+ if(sysUser == null) throw new RuntimeException("鎺掍骇浜轰笉瀛樺湪");
+ SalesLedgerScheduling salesLedgerScheduling = SalesLedgerScheduling.builder()
+ .salesLedgerId(productionDispatchAddDto.getSalesLedgerId())
+ .salesLedgerProductId(productionDispatchAddDto.getSalesLedgerProductId())
+ .schedulingUserId(productionDispatchAddDto.getSchedulingUserId())
+ .schedulingUserName(sysUser.getNickName())
+ .schedulingNum(productionDispatchAddDto.getSchedulingNum())
+ .schedulingDate(LocalDate.parse(productionDispatchAddDto.getSchedulingDate(), DateTimeFormatter.ISO_LOCAL_DATE))
+ .status(1)
+ .build();
+ return salesLedgerSchedulingMapper.insert(salesLedgerScheduling);
+ }
+
+ @Override
+ public IPage<SalesLedgerSchedulingProcessDto> listPageProcess(Page page, SalesLedgerSchedulingProcessDto salesLedgerSchedulingDto) {
+ IPage<SalesLedgerSchedulingProcessDto> list = salesLedgerSchedulingMapper.listPageProcess(page, salesLedgerSchedulingDto);
+ Set<Long> collect = list.getRecords().stream().map(SalesLedgerSchedulingProcessDto::getSalesLedgerProductId).collect(Collectors.toSet());
+ 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.setSuccessNum(salesLedgerWorks
+ .stream()
+ .filter(j -> j.getSalesLedgerProductId().equals(i.getSalesLedgerProductId()))
+ .map(SalesLedgerWork::getFinishedNum)
+ .reduce(BigDecimal.ZERO, BigDecimal::add));
+ });
+ return list;
+ }
+
+ @Override
+ public int productionDispatchDelete(List<Long> ids) {
+ LambdaQueryWrapper<SalesLedgerScheduling> salesLedgerSchedulingLambdaQueryWrapper = new LambdaQueryWrapper<SalesLedgerScheduling>();
+ salesLedgerSchedulingLambdaQueryWrapper.in(SalesLedgerScheduling::getId, ids);
+ List<SalesLedgerScheduling> salesLedgerSchedulings = salesLedgerSchedulingMapper.selectList(salesLedgerSchedulingLambdaQueryWrapper);
+ if(CollectionUtils.isEmpty(salesLedgerSchedulings)) throw new RuntimeException("鎺掍骇涓嶅瓨鍦�");
+ List<SalesLedgerScheduling> collect = salesLedgerSchedulings.stream().filter(i -> !i.getStatus().equals(1)).collect(Collectors.toList());
+ if(!CollectionUtils.isEmpty(collect)) throw new RuntimeException("鎺掍骇宸插紑濮嬶紝璇峰嬁鍒犻櫎");
+ salesLedgerSchedulingMapper.deleteBatchIds(ids);
+ return 0;
+ }
+
+ @Override
+ public int processScheduling(List<ProcessSchedulingDto> processSchedulingDtos) {
+ for (ProcessSchedulingDto processSchedulingDto : processSchedulingDtos) {
+ SalesLedgerScheduling salesLedgerScheduling = salesLedgerSchedulingMapper.selectById(processSchedulingDto.getId());
+ if(salesLedgerScheduling == null) throw new RuntimeException("鎺掍骇涓嶅瓨鍦�");
+ if(salesLedgerScheduling.getStatus().equals(3)) throw new RuntimeException("鎺掍骇宸插畬鎴愶紝璇峰嬁閲嶅鎺掍骇");
+ SysUser sysUser = sysUserMapper.selectUserById(processSchedulingDto.getSchedulingUserId());
+ if(sysUser == null) throw new RuntimeException("鎺掍骇浜轰笉瀛樺湪");
+ salesLedgerScheduling.setFinishedNum(salesLedgerScheduling.getFinishedNum().add(processSchedulingDto.getSchedulingNum()));
+ if(salesLedgerScheduling.getSchedulingNum().compareTo(salesLedgerScheduling.getFinishedNum()) <= 0){
+ salesLedgerScheduling.setStatus(3);
+ }else{
+ salesLedgerScheduling.setStatus(2);
+ }
+ salesLedgerSchedulingMapper.updateById(salesLedgerScheduling);
+ SalesLedgerWork.SalesLedgerWorkBuilder salesLedgerWorkBuilder = SalesLedgerWork.builder()
+ .salesLedgerSchedulingId(salesLedgerScheduling.getId())
+ .salesLedgerId(salesLedgerScheduling.getSalesLedgerId())
+ .salesLedgerProductId(salesLedgerScheduling.getSalesLedgerProductId())
+ .schedulingUserId(salesLedgerScheduling.getSchedulingUserId())
+ .schedulingUserName(sysUser.getNickName())
+ .schedulingNum(processSchedulingDto.getSchedulingNum())
+ .workHours(processSchedulingDto.getWorkHours())
+ .process(processSchedulingDto.getProcess())
+ .status(1)
+ .schedulingDate(LocalDate.parse(processSchedulingDto.getSchedulingDate(), DateTimeFormatter.ISO_LOCAL_DATE));
+ salesLedgerWorkMapper.insert(salesLedgerWorkBuilder.build());
+ }
+ return 0;
+ }
+}
diff --git a/src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java
new file mode 100644
index 0000000..e565d49
--- /dev/null
+++ b/src/main/java/com/ruoyi/production/service/impl/SalesLedgerWorkServiceImpl.java
@@ -0,0 +1,129 @@
+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.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;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.BeanUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+
+import java.time.LocalDate;
+import java.time.format.DateTimeFormatter;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * @author :yys
+ * @date : 2025/7/21 14:40
+ */
+@Service
+@RequiredArgsConstructor
+@Slf4j
+public class SalesLedgerWorkServiceImpl extends ServiceImpl<SalesLedgerWorkMapper, SalesLedgerWork> implements SalesLedgerWorkService {
+
+ private final SalesLedgerWorkMapper salesLedgerWorkMapper;
+
+ private final SysUserMapper sysUserMapper;
+
+ private final SalesLedgerProductionAccountingMapper salesLedgerProductionAccountingMapper;
+
+ @Override
+ public IPage<SalesLedgerWorkDto> listPage(Page page, SalesLedgerWorkDto salesLedgerWorkDto) {
+ IPage<SalesLedgerWorkDto> iPage = salesLedgerWorkMapper.listPage(page, salesLedgerWorkDto);
+ return iPage;
+ }
+
+ @Override
+ public int productionReport(ProductionReportDto productionReportDto) {
+ SalesLedgerWork salesLedgerWork = salesLedgerWorkMapper.selectById(productionReportDto.getId());
+ SysUser sysUser = sysUserMapper.selectUserById(productionReportDto.getSchedulingUserId());
+ if (salesLedgerWork == null) throw new RuntimeException("鎶ュ伐鏁版嵁涓嶅瓨鍦�");
+ if (salesLedgerWork.getStatus() == 3) throw new RuntimeException("鎶ュ伐宸插畬鎴�");
+ if (sysUser == null) throw new RuntimeException("鐢熶骇浜轰笉瀛樺湪");
+ salesLedgerWork.setFinishedNum(salesLedgerWork.getFinishedNum().add(productionReportDto.getFinishedNum()));
+ if(salesLedgerWork.getSchedulingNum().compareTo(salesLedgerWork.getFinishedNum()) <= 0){
+ salesLedgerWork.setStatus(3);
+ }else{
+ salesLedgerWork.setStatus(2);
+ }
+ salesLedgerWorkMapper.updateById(salesLedgerWork);
+ // 鏂板鎶ュ伐鏁版嵁
+ SalesLedgerProductionAccounting.SalesLedgerProductionAccountingBuilder builder = SalesLedgerProductionAccounting.builder()
+ .salesLedgerWorkId(salesLedgerWork.getId())
+ .salesLedgerSchedulingId(salesLedgerWork.getSalesLedgerSchedulingId())
+ .salesLedgerId(salesLedgerWork.getSalesLedgerId())
+ .salesLedgerProductId(salesLedgerWork.getSalesLedgerProductId())
+ .schedulingUserId(sysUser.getUserId())
+ .schedulingUserName(sysUser.getNickName())
+ .finishedNum(productionReportDto.getFinishedNum())
+ .workHours(salesLedgerWork.getWorkHours())
+ .process(salesLedgerWork.getProcess())
+ .schedulingDate(LocalDate.parse(productionReportDto.getSchedulingDate(), DateTimeFormatter.ISO_LOCAL_DATE));
+ salesLedgerProductionAccountingMapper.insert(builder.build());
+ return 0;
+ }
+
+ @Override
+ public int productionReportUpdate(ProductionReportDto productionReportDto) {
+ SalesLedgerWork salesLedgerWork = salesLedgerWorkMapper.selectById(productionReportDto.getId());
+ if(salesLedgerWork == null) throw new RuntimeException("鎶ュ伐鏁版嵁涓嶅瓨鍦�");
+ SysUser sysUser = sysUserMapper.selectUserById(productionReportDto.getSchedulingUserId());
+ if(sysUser == null) throw new RuntimeException("鐢熶骇浜轰笉瀛樺湪");
+ salesLedgerWork.setFinishedNum(productionReportDto.getFinishedNum());
+ if(salesLedgerWork.getSchedulingNum().compareTo(salesLedgerWork.getFinishedNum()) <= 0){
+ salesLedgerWork.setStatus(3);
+ }else{
+ salesLedgerWork.setStatus(2);
+ }
+ salesLedgerWork.setSchedulingUserId(sysUser.getUserId());
+ salesLedgerWork.setSchedulingUserName(sysUser.getNickName());
+ salesLedgerWork.setSchedulingDate(LocalDate.parse(productionReportDto.getSchedulingDate(), DateTimeFormatter.ISO_LOCAL_DATE));
+ salesLedgerWorkMapper.updateById(salesLedgerWork);
+
+ // 鏇存柊鏍哥畻鏁版嵁
+ LambdaQueryWrapper<SalesLedgerProductionAccounting> salesLedgerProductionAccountingLambdaQueryWrapper = new LambdaQueryWrapper<>();
+ salesLedgerProductionAccountingLambdaQueryWrapper.eq(SalesLedgerProductionAccounting::getSalesLedgerWorkId, salesLedgerWork.getId())
+ .orderByDesc(SalesLedgerProductionAccounting::getCreateTime)
+ .last("limit 1");
+ SalesLedgerProductionAccounting salesLedgerProductionAccounting = salesLedgerProductionAccountingMapper.selectOne(salesLedgerProductionAccountingLambdaQueryWrapper);
+ if(salesLedgerProductionAccounting != null){
+ salesLedgerProductionAccounting.setFinishedNum(productionReportDto.getFinishedNum());
+ salesLedgerProductionAccounting.setSchedulingUserId(sysUser.getUserId());
+ salesLedgerProductionAccounting.setSchedulingUserName(sysUser.getNickName());
+ salesLedgerProductionAccounting.setSchedulingDate(LocalDate.parse(productionReportDto.getSchedulingDate(), DateTimeFormatter.ISO_LOCAL_DATE));
+ salesLedgerProductionAccountingMapper.updateById(salesLedgerProductionAccounting);
+ }
+ return 0;
+ }
+
+ @Override
+ public List<ProductionReportDto> getList(Long id) {
+ SalesLedgerWork salesLedgerWork = salesLedgerWorkMapper.selectById(id);
+ if(salesLedgerWork == null) throw new RuntimeException("鎶ュ伐鏁版嵁涓嶅瓨鍦�");
+ LambdaQueryWrapper<SalesLedgerProductionAccounting> salesLedgerProductionAccountingLambdaQueryWrapper = new LambdaQueryWrapper<>();
+ salesLedgerProductionAccountingLambdaQueryWrapper.eq(SalesLedgerProductionAccounting::getSalesLedgerWorkId, id);
+ List<SalesLedgerProductionAccounting> salesLedgerProductionAccountingList = salesLedgerProductionAccountingMapper.selectList(salesLedgerProductionAccountingLambdaQueryWrapper);
+ if(CollectionUtils.isEmpty(salesLedgerProductionAccountingList)) throw new RuntimeException("娌℃湁鐢熶骇璁板綍鏁版嵁");
+ return salesLedgerProductionAccountingList.stream().map(salesLedgerProductionAccounting -> {
+ ProductionReportDto productionReportDto = new ProductionReportDto();
+ BeanUtils.copyProperties(salesLedgerProductionAccounting, productionReportDto);
+ productionReportDto.setSchedulingDate(salesLedgerProductionAccounting.getSchedulingDate().format(DateTimeFormatter.ISO_LOCAL_DATE));
+ productionReportDto.setSchedulingNum(salesLedgerWork.getSchedulingNum());
+ return productionReportDto;
+ }).collect(Collectors.toList());
+ }
+}
diff --git a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
index a6e9f20..b6c43ed 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/SalesLedgerServiceImpl.java
@@ -16,6 +16,8 @@
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.other.mapper.TempFileMapper;
import com.ruoyi.other.pojo.TempFile;
+import com.ruoyi.production.mapper.SalesLedgerSchedulingMapper;
+import com.ruoyi.production.pojo.SalesLedgerScheduling;
import com.ruoyi.project.system.domain.SysDept;
import com.ruoyi.project.system.mapper.SysDeptMapper;
import com.ruoyi.sales.dto.MonthlyAmountDto;
@@ -74,6 +76,8 @@
private final ReceiptPaymentMapper receiptPaymentMapper;
private final InvoiceLedgerMapper invoiceLedgerMapper;
+
+ private final SalesLedgerSchedulingMapper salesLedgerSchedulingMapper;
@Autowired
private SysDeptMapper sysDeptMapper;
@@ -312,15 +316,23 @@
List<Long> idList = Arrays.stream(ids)
.filter(Objects::nonNull)
.collect(Collectors.toList());
-
if (CollectionUtils.isEmpty(idList)) {
return 0;
+ }
+ // 鐢熶骇璁㈠崟鏈夊緟鎺掍骇鏁版嵁锛屽彴璐︿笉鍙垹闄�
+ LambdaQueryWrapper<SalesLedgerScheduling> salesLedgerSchedulingLambdaQueryWrapper = new LambdaQueryWrapper<SalesLedgerScheduling>()
+ .in(SalesLedgerScheduling::getSalesLedgerId, idList);
+ if (salesLedgerSchedulingMapper.selectCount(salesLedgerSchedulingLambdaQueryWrapper) > 0) {
+ throw new BaseException("鏈夋帓浜ф暟鎹紝涓嶅彲鍒犻櫎");
}
// 1. 鍏堝垹闄ゅ瓙琛ㄦ暟鎹�
LambdaQueryWrapper<SalesLedgerProduct> productWrapper = new LambdaQueryWrapper<>();
productWrapper.in(SalesLedgerProduct::getSalesLedgerId, idList);
salesLedgerProductMapper.delete(productWrapper);
-
+ // 鍒犻櫎鐢熶骇璁㈠崟鏁版嵁
+ LambdaQueryWrapper<SalesLedgerScheduling> in = new LambdaQueryWrapper<SalesLedgerScheduling>()
+ .in(SalesLedgerScheduling::getSalesLedgerId, idList);
+ salesLedgerSchedulingMapper.delete(in);
// 2. 鍐嶅垹闄や富琛ㄦ暟鎹�
return salesLedgerMapper.deleteBatchIds(idList);
}
diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml
index dd92f63..a0b7864 100644
--- a/src/main/resources/application-dev.yml
+++ b/src/main/resources/application-dev.yml
@@ -188,7 +188,7 @@
# Swagger閰嶇疆
swagger:
# 鏄惁寮�鍚痵wagger
- enabled: false
+ enabled: true
# 璇锋眰鍓嶇紑
pathMapping: /dev-api
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index a87ef6b..a6ce03c 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -1,4 +1,4 @@
# Spring閰嶇疆
spring:
profiles:
- active: prod
\ No newline at end of file
+ active: dev
\ No newline at end of file
diff --git a/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml b/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
new file mode 100644
index 0000000..9528922
--- /dev/null
+++ b/src/main/resources/mapper/production/SalesLedgerProductionAccountingMapper.xml
@@ -0,0 +1,53 @@
+<?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.SalesLedgerProductionAccountingMapper">
+
+ <select id="listPage" resultType="com.ruoyi.production.dto.SalesLedgerProductionAccountingDto">
+ SELECT
+ t4.id,
+ t4.finished_num * t4.work_hours as wages,
+ t4.scheduling_user_id,
+ t4.scheduling_user_name,
+ t4.scheduling_date,
+ 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
+ <where>
+ 1 = 1
+ <if test="salesLedgerDto.schedulingUserName != null and salesLedgerDto.schedulingUserName != '' ">
+ AND t4.scheduling_user_uame 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>
+ <if test="salesLedgerDto.schedulingDateStart != null and salesLedgerDto.schedulingDateStart != '' ">
+ AND t4.scheduling_date >= DATE_FORMAT(#{salesLedgerDto.entryDateStart},'%Y-%m-%d')
+ </if>
+ <if test="salesLedgerDto.schedulingDateEnd != null and salesLedgerDto.schedulingDateEnd != '' ">
+ AND t4.scheduling_date <= DATE_FORMAT(#{salesLedgerDto.entryDateEnd},'%Y-%m-%d')
+ </if>
+ </where>
+ group by t4.id
+ order by t4.update_time desc
+ </select>
+</mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml b/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
new file mode 100644
index 0000000..bcf4b64
--- /dev/null
+++ b/src/main/resources/mapper/production/SalesLedgerSchedulingMapper.xml
@@ -0,0 +1,113 @@
+<?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.SalesLedgerSchedulingMapper">
+
+ <select id="listPage" resultType="com.ruoyi.production.dto.SalesLedgerSchedulingDto">
+ SELECT
+ T2.id as salesLedgerProductId,
+ T1.id as salesLedgerId,
+ ifNull(sum(t3.scheduling_num),0) AS schedulingNum,
+ T1.sales_contract_no,
+ T1.customer_contract_no,
+ T1.project_name,
+ T1.entry_date,
+ T1.customer_name,
+ T2.quantity,
+ T2.product_category,
+ T2.specification_model,
+ T2.unit
+ FROM
+ sales_ledger_product T2
+ LEFT join sales_ledger_scheduling t3 on T2.id = t3.sales_ledger_product_id
+ LEFT JOIN sales_ledger T1 ON T1.id = T2.sales_ledger_id
+ <where>
+ T1.id is not null
+ <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>
+ <if test="salesLedgerDto.entryDateStart != null and salesLedgerDto.entryDateStart != '' ">
+ AND T1.entry_date >= DATE_FORMAT(#{salesLedgerDto.entryDateStart},'%Y-%m-%d')
+ </if>
+ <if test="salesLedgerDto.entryDateEnd != null and salesLedgerDto.entryDateEnd != '' ">
+ AND T1.entry_date <= DATE_FORMAT(#{salesLedgerDto.entryDateEnd},'%Y-%m-%d')
+ </if>
+ </where>
+ GROUP BY T2.id
+ </select>
+ <select id="list" resultType="com.ruoyi.production.dto.SalesLedgerSchedulingDto">
+ SELECT
+ T2.id,
+ ifNull(sum(t3.scheduling_num),0) AS schedulingNum,
+ T1.sales_contract_no,
+ T1.customer_contract_no,
+ T1.project_name,
+ T1.entry_date,
+ T1.customer_name,
+ T2.quantity,
+ T2.product_category,
+ T2.specification_model,
+ T2.unit
+ FROM
+ sales_ledger_product T2
+ LEFT JOIN sales_ledger T1 ON T1.id = T2.sales_ledger_id
+ LEFT join sales_ledger_scheduling t3 on T1.id = t3.sales_ledger_id
+ where T1.id is not null
+ GROUP BY T2.id
+ </select>
+ <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,
+ T2.scheduling_user_name,
+ T2.scheduling_date,
+ ifNull(T2.scheduling_num,0) AS schedulingNum,
+ 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_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
+ <where>
+ 1 = 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>
+ <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>
+ <if test="salesLedgerDto.schedulingDateStart != null and salesLedgerDto.schedulingDateStart != '' ">
+ AND T2.scheduling_date >= DATE_FORMAT(#{salesLedgerDto.entryDateStart},'%Y-%m-%d')
+ </if>
+ <if test="salesLedgerDto.schedulingDateEnd != null and salesLedgerDto.schedulingDateEnd != '' ">
+ AND T2.scheduling_date <= DATE_FORMAT(#{salesLedgerDto.entryDateEnd},'%Y-%m-%d')
+ </if>
+ </where>
+ order by T2.update_time desc
+ </select>
+</mapper>
\ No newline at end of file
diff --git a/src/main/resources/mapper/production/SalesLedgerWorkMapper.xml b/src/main/resources/mapper/production/SalesLedgerWorkMapper.xml
new file mode 100644
index 0000000..e2c884b
--- /dev/null
+++ b/src/main/resources/mapper/production/SalesLedgerWorkMapper.xml
@@ -0,0 +1,53 @@
+<?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.SalesLedgerWorkMapper">
+
+ <select id="listPage" resultType="com.ruoyi.production.dto.SalesLedgerWorkDto">
+ SELECT
+ t4.id,
+ t4.status,
+ t4.scheduling_user_id,
+ t4.scheduling_user_name,
+ t4.scheduling_date,
+ t4.scheduling_num,
+ 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_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
+ <where>
+ 1 = 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>
+ <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>
+ <if test="salesLedgerDto.schedulingDateStart != null and salesLedgerDto.schedulingDateStart != '' ">
+ AND t4.scheduling_date >= DATE_FORMAT(#{salesLedgerDto.entryDateStart},'%Y-%m-%d')
+ </if>
+ <if test="salesLedgerDto.schedulingDateEnd != null and salesLedgerDto.schedulingDateEnd != '' ">
+ AND t4.scheduling_date <= DATE_FORMAT(#{salesLedgerDto.entryDateEnd},'%Y-%m-%d')
+ </if>
+ </where>
+ order by t4.update_time desc
+ </select>
+</mapper>
\ No newline at end of file
--
Gitblit v1.9.3