diff --git a/mes-server/src/main/java/cn/iocoder/yudao/mes/MesServerApplication.java b/mes-server/src/main/java/cn/iocoder/yudao/mes/MesServerApplication.java
index 4c317d91..14f52f4e 100644
--- a/mes-server/src/main/java/cn/iocoder/yudao/mes/MesServerApplication.java
+++ b/mes-server/src/main/java/cn/iocoder/yudao/mes/MesServerApplication.java
@@ -2,6 +2,7 @@ package cn.iocoder.yudao.mes;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cloud.openfeign.EnableFeignClients;
/**
* Mes 服务器的启动类
@@ -9,6 +10,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @author ZT
*/
@SuppressWarnings("SpringComponentScan") // 忽略 IDEA 无法识别 ${yudao.info.base-package}
+@EnableFeignClients(basePackages = {"${yudao.info.base-package}.mes", "${yudao.info.base-package}.module"})
@SpringBootApplication(scanBasePackages = {"${yudao.info.base-package}.mes", "${yudao.info.base-package}.module"},
excludeName = {})
public class MesServerApplication {
diff --git a/mes-server/src/main/java/cn/iocoder/yudao/mes/controller/mes/MesController.java b/mes-server/src/main/java/cn/iocoder/yudao/mes/controller/mes/MesController.java
index f0ed9d7b..806db83a 100644
--- a/mes-server/src/main/java/cn/iocoder/yudao/mes/controller/mes/MesController.java
+++ b/mes-server/src/main/java/cn/iocoder/yudao/mes/controller/mes/MesController.java
@@ -1,12 +1,13 @@
package cn.iocoder.yudao.mes.controller.mes;
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
diff --git a/mes-server/src/main/resources/application.yml b/mes-server/src/main/resources/application.yml
index e41a1639..d53dcacd 100644
--- a/mes-server/src/main/resources/application.yml
+++ b/mes-server/src/main/resources/application.yml
@@ -104,7 +104,7 @@ xxl:
yudao:
info:
version: 1.0.0
- base-package: cn.iocoder.yudao.module
+ base-package: cn.iocoder.yudao
web:
admin-ui:
url: http://dashboard.yudao.iocoder.cn # Admin 管理后台 UI 的地址
diff --git a/yudao-module-energy/pom.xml b/yudao-module-energy/pom.xml
index 85e04e28..5b859bd6 100644
--- a/yudao-module-energy/pom.xml
+++ b/yudao-module-energy/pom.xml
@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- yudao
+ dsc-mes
cn.iocoder.cloud
${revision}
diff --git a/yudao-module-energy/yudao-module-energy-api/src/main/java/cn/iocoder/yudao/module/energy/enums/ErrorCodeConstants.java b/yudao-module-energy/yudao-module-energy-api/src/main/java/cn/iocoder/yudao/module/energy/enums/ErrorCodeConstants.java
index 98f38c07..90728cdf 100644
--- a/yudao-module-energy/yudao-module-energy-api/src/main/java/cn/iocoder/yudao/module/energy/enums/ErrorCodeConstants.java
+++ b/yudao-module-energy/yudao-module-energy-api/src/main/java/cn/iocoder/yudao/module/energy/enums/ErrorCodeConstants.java
@@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
/**
* energy 错误码枚举类
*
- * energy 系统,使用 1-xxx-xxx-xxx 段
+ * 1-030-000-000 ~ 1-030-199-999
*
* @author ZT
*/
diff --git a/yudao-module-energy/yudao-module-energy-server/pom.xml b/yudao-module-energy/yudao-module-energy-server/pom.xml
index 9762cba7..258043d2 100644
--- a/yudao-module-energy/yudao-module-energy-server/pom.xml
+++ b/yudao-module-energy/yudao-module-energy-server/pom.xml
@@ -131,21 +131,21 @@
${project.artifactId}
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
- ${spring.boot.version}
-
-
-
- repackage
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yudao-module-energy/yudao-module-energy-server/src/main/java/cn/iocoder/yudao/module/energy/EnergyServerApplication.java b/yudao-module-energy/yudao-module-energy-server/src/main/java/cn/iocoder/yudao/module/energy/EnergyServerApplication.java
index e2f64041..220383a5 100644
--- a/yudao-module-energy/yudao-module-energy-server/src/main/java/cn/iocoder/yudao/module/energy/EnergyServerApplication.java
+++ b/yudao-module-energy/yudao-module-energy-server/src/main/java/cn/iocoder/yudao/module/energy/EnergyServerApplication.java
@@ -8,7 +8,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
*
* @author ZT
*/
-@SpringBootApplication
+//@SpringBootApplication
public class EnergyServerApplication {
public static void main(String[] args) {
diff --git a/yudao-module-energy/yudao-module-energy-server/src/main/java/cn/iocoder/yudao/module/energy/controller/admin/energy/EnergyController.java b/yudao-module-energy/yudao-module-energy-server/src/main/java/cn/iocoder/yudao/module/energy/controller/admin/energy/EnergyController.java
index 725d81df..7aebc223 100644
--- a/yudao-module-energy/yudao-module-energy-server/src/main/java/cn/iocoder/yudao/module/energy/controller/admin/energy/EnergyController.java
+++ b/yudao-module-energy/yudao-module-energy-server/src/main/java/cn/iocoder/yudao/module/energy/controller/admin/energy/EnergyController.java
@@ -1,12 +1,13 @@
package cn.iocoder.yudao.module.energy.controller.admin.energy;
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
diff --git a/yudao-module-energy/yudao-module-energy-server/src/main/java/cn/iocoder/yudao/module/energy/framework/security/config/SecurityConfiguration.java b/yudao-module-energy/yudao-module-energy-server/src/main/java/cn/iocoder/yudao/module/energy/framework/security/config/SecurityConfiguration.java
index fd1fe5df..1328fe38 100644
--- a/yudao-module-energy/yudao-module-energy-server/src/main/java/cn/iocoder/yudao/module/energy/framework/security/config/SecurityConfiguration.java
+++ b/yudao-module-energy/yudao-module-energy-server/src/main/java/cn/iocoder/yudao/module/energy/framework/security/config/SecurityConfiguration.java
@@ -13,7 +13,7 @@ import org.springframework.security.config.annotation.web.configurers.AuthorizeH
*
* @author ZT
*/
-@Configuration(proxyBeanMethods = false)
+@Configuration("energySecurityConfiguration")
public class SecurityConfiguration {
@Bean
diff --git a/yudao-module-indicator/pom.xml b/yudao-module-indicator/pom.xml
index 5570e807..bb5ace24 100644
--- a/yudao-module-indicator/pom.xml
+++ b/yudao-module-indicator/pom.xml
@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- yudao
+ dsc-mes
cn.iocoder.cloud
${revision}
diff --git a/yudao-module-indicator/yudao-module-indicator-api/src/main/java/cn/iocoder/yudao/module/indicator/enums/ErrorCodeConstants.java b/yudao-module-indicator/yudao-module-indicator-api/src/main/java/cn/iocoder/yudao/module/indicator/enums/ErrorCodeConstants.java
index e7273203..596bbd77 100644
--- a/yudao-module-indicator/yudao-module-indicator-api/src/main/java/cn/iocoder/yudao/module/indicator/enums/ErrorCodeConstants.java
+++ b/yudao-module-indicator/yudao-module-indicator-api/src/main/java/cn/iocoder/yudao/module/indicator/enums/ErrorCodeConstants.java
@@ -5,7 +5,7 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
/**
* indicator 错误码枚举类
*
- * indicator 系统,使用 1-xxx-xxx-xxx 段
+ * 1-030-200-000 ~ 1-030-399-999
*
* @author ZT
*/
diff --git a/yudao-module-indicator/yudao-module-indicator-server/pom.xml b/yudao-module-indicator/yudao-module-indicator-server/pom.xml
index eb363f7c..487fc09e 100644
--- a/yudao-module-indicator/yudao-module-indicator-server/pom.xml
+++ b/yudao-module-indicator/yudao-module-indicator-server/pom.xml
@@ -131,21 +131,21 @@
${project.artifactId}
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
- ${spring.boot.version}
-
-
-
- repackage
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yudao-module-indicator/yudao-module-indicator-server/src/main/java/cn/iocoder/yudao/module/indicator/IndicatorServerApplication.java b/yudao-module-indicator/yudao-module-indicator-server/src/main/java/cn/iocoder/yudao/module/indicator/IndicatorServerApplication.java
index 029b4c7e..0265afe6 100644
--- a/yudao-module-indicator/yudao-module-indicator-server/src/main/java/cn/iocoder/yudao/module/indicator/IndicatorServerApplication.java
+++ b/yudao-module-indicator/yudao-module-indicator-server/src/main/java/cn/iocoder/yudao/module/indicator/IndicatorServerApplication.java
@@ -8,7 +8,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
*
* @author ZT
*/
-@SpringBootApplication
+//@SpringBootApplication
public class IndicatorServerApplication {
public static void main(String[] args) {
diff --git a/yudao-module-indicator/yudao-module-indicator-server/src/main/java/cn/iocoder/yudao/module/indicator/controller/admin/indicator/IndicatorController.java b/yudao-module-indicator/yudao-module-indicator-server/src/main/java/cn/iocoder/yudao/module/indicator/controller/admin/indicator/IndicatorController.java
index 365bd4d3..e8b14686 100644
--- a/yudao-module-indicator/yudao-module-indicator-server/src/main/java/cn/iocoder/yudao/module/indicator/controller/admin/indicator/IndicatorController.java
+++ b/yudao-module-indicator/yudao-module-indicator-server/src/main/java/cn/iocoder/yudao/module/indicator/controller/admin/indicator/IndicatorController.java
@@ -1,12 +1,13 @@
package cn.iocoder.yudao.module.indicator.controller.admin.indicator;
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
diff --git a/yudao-module-indicator/yudao-module-indicator-server/src/main/java/cn/iocoder/yudao/module/indicator/framework/security/config/SecurityConfiguration.java b/yudao-module-indicator/yudao-module-indicator-server/src/main/java/cn/iocoder/yudao/module/indicator/framework/security/config/SecurityConfiguration.java
index f34c43ef..677954bc 100644
--- a/yudao-module-indicator/yudao-module-indicator-server/src/main/java/cn/iocoder/yudao/module/indicator/framework/security/config/SecurityConfiguration.java
+++ b/yudao-module-indicator/yudao-module-indicator-server/src/main/java/cn/iocoder/yudao/module/indicator/framework/security/config/SecurityConfiguration.java
@@ -13,7 +13,7 @@ import org.springframework.security.config.annotation.web.configurers.AuthorizeH
*
* @author ZT
*/
-@Configuration(proxyBeanMethods = false)
+@Configuration("indicatorSecurityConfiguration")
public class SecurityConfiguration {
@Bean
diff --git a/yudao-module-product/pom.xml b/yudao-module-product/pom.xml
index 27bd7b5f..3a4b0a9b 100644
--- a/yudao-module-product/pom.xml
+++ b/yudao-module-product/pom.xml
@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- yudao
+ dsc-mes
cn.iocoder.cloud
${revision}
diff --git a/yudao-module-product/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/ErrorCodeConstants.java b/yudao-module-product/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/ErrorCodeConstants.java
index b261e2f7..478c1b9a 100644
--- a/yudao-module-product/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/ErrorCodeConstants.java
+++ b/yudao-module-product/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/ErrorCodeConstants.java
@@ -4,14 +4,87 @@ import cn.iocoder.yudao.framework.common.exception.ErrorCode;
/**
* product 错误码枚举类
- *
- * product 系统,使用 1-xxx-xxx-xxx 段
+ *
+ * 1-030-400-000 ~ 1-030-599-999
+ *
+ * 1-030-400(公共)-xxx
+ * --------------------plan-----------------------
+ * 1-030-411(plan-template)-xxx
+ * 1-030-412(plan-template-column)-xxx
+ * 1-030-413(plan-template-column-data)-xxx
+ * 1-030-414(plan-template-item)-xxx
+ * 1-030-415(factory_plan)-xxx
+ * 1-030-416(factory_plan-column)-xxx
+ * 1-030-417(factory_plan-column-data)-xxx
+ * 1-030-418(factory_plan-item)-xxx
+ * 1-030-419(factory_plan-item-data)-xxx
+ * 1-030-420(company_plan)-xxx
+ * 1-030-421(company_plan-column)-xxx
+ * 1-030-422(company_plan-column-data)-xxx
+ * 1-030-423(company_plan-item)-xxx
+ * 1-030-424(company_plan-item-data)-xxx
+ * -------------------------------------------
+ * -----------------factory-------------------
+ * 1-030-424 工厂模型(factory-model)
+ * -------------------------------------------
+ * -----------------schedule------------------
+ * 1-030-425 排班配置(schedule-config)
+ * 1-030-426 排班班组(schedule-team)
+ * 1-030-427 排班班次(schedule-shift)
+ * 1-030-428 排班规则(schedule-rule)
+ * 1-030-429 排班数据(schedule-data)
+ * -------------------------------------------
*
* @author ZT
*/
public interface ErrorCodeConstants {
+ //通用
+ ErrorCode CODE_GENERATION_SERVICE_CALL_FAILED = new ErrorCode(1_030_400_001, "编码生成服务调用失败");
+
+ //计划模板(plan-template)
+ ErrorCode PLAN_TEMPLATE_NOT_EXISTS = new ErrorCode(1_030_411_001, "计划模板不存在");
+ ErrorCode PLAN_TEMPLATE_PLAN_TYPE_IS_NULL = new ErrorCode(1_030_411_002, "计划模板类型为空");
+ ErrorCode PLAN_TEMPLATE_PLAN_TYPE_NOT_EXISTS = new ErrorCode(1_030_411_003, "计划模板类型不存在");
+ ErrorCode PLAN_TEMPLATE_PLAN_FAILED_TO_RETRIEVE_ENCODING = new ErrorCode(1_030_411_004, "计划模板编号获取失败");
+
+ //计划模板动态列(plan-template-column)
+ ErrorCode PLAN_TEMPLATE_COLUMN_NOT_EXISTS = new ErrorCode(1_030_412_001, "计划模板动态列不存在");
+ ErrorCode PLAN_TEMPLATE_COLUMN_OPERATION_ID_IS_NULL = new ErrorCode(1_030_412_002, "计划模板动态列操作标识为空");
+ ErrorCode PLAN_TEMPLATE_COLUMN_ENCODING_INFORMATION_ALREADY_EXISTS = new ErrorCode(1_030_412_003, "计划模板动态列编码不能重复");
+
+ //计划模板动态列数据(plan-template-column-data)
+ ErrorCode PLAN_TEMPLATE_COLUMN_DATA_NOT_EXISTS = new ErrorCode(1_030_413_001, "计划模板动态列结果不存在");
+
+ //计划模板项目(plan-template-item)
+ ErrorCode PLAN_TEMPLATE_ITEM_NOT_EXISTS = new ErrorCode(1_030_414_001, "计划模板项目不存在");
+ ErrorCode PLAN_TEMPLATE_ITEM_OPERATION_ID_IS_NULL = new ErrorCode(1_030_414_002, "计划模板动态列操作标识为空");
+
+ //1_030_424 工厂模型(factory-model)
+ ErrorCode FACTORY_MODEL_NOT_EXISTS = new ErrorCode(1_030_424_001, "工厂模型不存在");
+ ErrorCode FACTORY_MODEL_NODE_CODE_EXISTS = new ErrorCode(1_030_424_002, "节点编码已存在");
+ ErrorCode FACTORY_MODEL_NODE_NAME_EXISTS = new ErrorCode(1_030_424_003, "节点名称已存在");
+
+ //1_030_425 排班配置(schedule-config)
+ ErrorCode SCHEDULE_CONFIG_NOT_EXISTS = new ErrorCode(1_030_425_001, "排班配置不存在");
+ ErrorCode SCHEDULE_CONFIG_CODE_EXISTS = new ErrorCode(1_030_425_002, "排班编码已存在");
+ ErrorCode SCHEDULE_CONFIG_NAME_EXISTS = new ErrorCode(1_030_425_003, "排班名称已存在");
+
+ //1_030_426 排班班组(schedule-team)
+ ErrorCode SCHEDULE_TEAM_NOT_EXISTS = new ErrorCode(1_030_426_001, "排班班组不存在");
+ ErrorCode SCHEDULE_TEAM_NAME_EXISTS = new ErrorCode(1_030_426_002, "排班班组名称重复");
+ ErrorCode SCHEDULE_TEAM_NOT_CREATE = new ErrorCode(1_030_426_003, "排班班组信息未创建");
+
+ //1_030_427 排班班次(schedule-shift)
+ ErrorCode SCHEDULE_SHIFT_NOT_EXISTS = new ErrorCode(1_030_427_001, "排班班次不存在");
+ ErrorCode SCHEDULE_SHIFT_NAME_EXISTS = new ErrorCode(1_030_427_002, "排班班次名称重复");
+ ErrorCode SCHEDULE_SHIFT_NOT_CREATE = new ErrorCode(1_030_427_003, "排班班次信息未创建");
+
+ //1_030_428 排班规则(schedule-rule)
+ ErrorCode SCHEDULE_RULE_NOT_EXISTS = new ErrorCode(1_030_428_001, "排班规则不存在");
+ ErrorCode SCHEDULE_RULE_DATE_EXISTS = new ErrorCode(1_030_428_002, "排班日期重复");
+
+ //1_030_429 排班数据(schedule-data)
+ ErrorCode SCHEDULE_DATA_NOT_EXISTS = new ErrorCode(1_030_429_001, "排班数据不存在");
- // ========== 示例模块 1-001-000-000 ==========
- ErrorCode EXAMPLE_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
}
diff --git a/yudao-module-product/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/PlanTemplateTypeEnums.java b/yudao-module-product/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/PlanTemplateTypeEnums.java
new file mode 100644
index 00000000..347a4b1d
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-api/src/main/java/cn/iocoder/yudao/module/product/enums/PlanTemplateTypeEnums.java
@@ -0,0 +1,37 @@
+package cn.iocoder.yudao.module.product.enums;
+
+import lombok.Getter;
+
+import java.util.Objects;
+
+/**
+ * 计划模板状态
+ *
+ * @author ZT
+ */
+@Getter
+public enum PlanTemplateTypeEnums {
+ Month("M", "月计划", "PLN_TMPL_M"),
+ Day("D", "日计划", "PLN_TMPL_D");
+
+ private final String type;
+ private final String name;
+ private final String codeRule;
+
+ PlanTemplateTypeEnums(String type, String name, String codeRule) {
+ this.type = type;
+ this.name = name;
+ this.codeRule = codeRule;
+ }
+
+ // 根据code获取枚举
+ public static String getCodeRuleByType(String type) {
+ for (PlanTemplateTypeEnums templateTypeEnums : values()) {
+ if (templateTypeEnums.type.equals(type)) {
+ return templateTypeEnums.codeRule;
+ }
+ }
+ return null;
+ }
+
+}
diff --git a/yudao-module-product/yudao-module-product-server/pom.xml b/yudao-module-product/yudao-module-product-server/pom.xml
index 0e5c4bc7..aff2ce28 100644
--- a/yudao-module-product/yudao-module-product-server/pom.xml
+++ b/yudao-module-product/yudao-module-product-server/pom.xml
@@ -131,21 +131,21 @@
${project.artifactId}
-
-
-
- org.springframework.boot
- spring-boot-maven-plugin
- ${spring.boot.version}
-
-
-
- repackage
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/ProductServerApplication.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/ProductServerApplication.java
index 9f01d7f3..e5e8263e 100644
--- a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/ProductServerApplication.java
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/ProductServerApplication.java
@@ -8,7 +8,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
*
* @author ZT
*/
-@SpringBootApplication
+//@SpringBootApplication
public class ProductServerApplication {
public static void main(String[] args) {
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/FactoryModelController.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/FactoryModelController.java
new file mode 100644
index 00000000..1b9004d7
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/FactoryModelController.java
@@ -0,0 +1,116 @@
+package cn.iocoder.yudao.module.product.controller.admin.factory.model;
+
+import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.factory.model.vo.*;
+import cn.iocoder.yudao.module.product.convert.factory.model.FactoryModelConvert;
+import cn.iocoder.yudao.module.product.dal.dataobject.factory.model.FactoryModelDO;
+import cn.iocoder.yudao.module.product.service.factory.model.FactoryModelService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+
+@Tag(name = "管理后台 - 工厂模型")
+@RestController
+@RequestMapping("/mes/factory-model")
+@Validated
+public class FactoryModelController implements BusinessControllerMarker {
+
+
+ @Resource
+ private FactoryModelService factoryModelService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建工厂模型")
+ @PreAuthorize("@ss.hasPermission('mes:factory-model:create')")
+ public CommonResult createFactoryModel(@Valid @RequestBody FactoryModelCreateReqVO createReqVO) {
+ return success(factoryModelService.createFactoryModel(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新工厂模型")
+ @PreAuthorize("@ss.hasPermission('mes:factory-model:update')")
+ public CommonResult updateFactoryModel(@Valid @RequestBody FactoryModelUpdateReqVO updateReqVO) {
+ factoryModelService.updateFactoryModel(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除工厂模型")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('mes:factory-model:delete')")
+ public CommonResult deleteFactoryModel(@RequestParam("id") Long id) {
+ factoryModelService.deleteFactoryModel(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除工厂模型")
+ @PreAuthorize("@ss.hasPermission('mes:factory-model:delete')")
+ public CommonResult deleteFactoryModelList(@RequestBody BatchDeleteReqVO req) {
+ factoryModelService.deleteFactoryModelListByIds(req.getIds());
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得工厂模型")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('mes:factory-model:query')")
+ public CommonResult getFactoryModel(@RequestParam("id") Long id) {
+ FactoryModelDO factoryModel = factoryModelService.getFactoryModel(id);
+ return success(FactoryModelConvert.INSTANCE.convert(factoryModel));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得工厂模型分页")
+ @PreAuthorize("@ss.hasPermission('mes:factory-model:query')")
+ public CommonResult> getFactoryModelPage(@Valid FactoryModelPageReqVO pageReqVO) {
+ PageResult pageResult = factoryModelService.getFactoryModelPage(pageReqVO);
+ return success(FactoryModelConvert.INSTANCE.convertPage(pageResult));
+ }
+
+ @PutMapping("/process/bind")
+ @Operation(summary = "绑定ERP工序")
+ @PreAuthorize("@ss.hasPermission('mes:factory-model:update')")
+ public CommonResult processBind(@Valid @RequestBody FactoryModelProcessBindReqVO processBindReqVO) {
+ factoryModelService.processBind(processBindReqVO);
+ return success(true);
+ }
+
+ @PutMapping("/process/unbind")
+ @Operation(summary = "解绑ERP工序")
+ @PreAuthorize("@ss.hasPermission('mes:factory-model:update')")
+ public CommonResult processUnbind(@Valid @RequestBody FactoryModelProcessUnbindReqVO processUnbindReqVO) {
+ factoryModelService.processUnbind(processUnbindReqVO);
+ return success(true);
+ }
+
+ @PutMapping("/status")
+ @Operation(summary = "启/停用模型")
+ @PreAuthorize("@ss.hasPermission('mes:factory-model:update')")
+ public CommonResult changeStatus(@Valid @RequestBody FactoryModelChangeStatusReqVO changeStatusReqVO) {
+ factoryModelService.changeStatus(changeStatusReqVO);
+ return success(true);
+ }
+
+ @GetMapping("/tree")
+ @Operation(summary = "工厂模型树")
+ @PreAuthorize("@ss.hasPermission('mes:factory-model:query')")
+ public CommonResult> tree(@RequestParam("parentId") Long parentId) {
+ List data = factoryModelService.tree(parentId);
+ return success(FactoryModelConvert.INSTANCE.convertList(data));
+ }
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModeTreeRespVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModeTreeRespVO.java
new file mode 100644
index 00000000..66db2c38
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModeTreeRespVO.java
@@ -0,0 +1,21 @@
+package cn.iocoder.yudao.module.product.controller.admin.factory.model.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 工厂模型 Tree Response VO")
+@Data
+public class FactoryModeTreeRespVO {
+ @Schema(description = "节点id")
+ private Long id;
+ @Schema(description = "节点编码")
+ private String nodeCoding;
+ @Schema(description = "节点名称")
+ private String nodeName;
+ @Schema(description = "节点类型")
+ private String nodeType;
+ @Schema(description = "父级id")
+ private Long parentId;
+ @Schema(description = "父级编码")
+ private String parentCoding;
+}
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelBaseVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelBaseVO.java
new file mode 100644
index 00000000..b66aaf5a
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelBaseVO.java
@@ -0,0 +1,45 @@
+package cn.iocoder.yudao.module.product.controller.admin.factory.model.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 工厂模型Base VO")
+@Data
+public class FactoryModelBaseVO {
+ @Schema(description = "父级id", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "父级id不能为空")
+ private Long parentId;
+
+ @Schema(description = "父级编码", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "父级编码不能为空")
+ private String parentCoding;
+
+ @Schema(description = "节点编码", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "节点编码不能为空")
+ private String nodeCoding;
+
+ @Schema(description = "节点名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "节点名称不能为空")
+ private String nodeName;
+
+ @Schema(description = "节点类型", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotEmpty(message = "节点类型不能为空")
+ private String nodeType;
+
+ @Schema(description = "排序")
+ private Integer sort;
+
+ @Schema(description = "ERP工艺路线编码")
+ private String erpProcessRouteCoding;
+
+ @Schema(description = "ERP工序编码")
+ private String erpProcessCoding;
+
+ @Schema(description = "ERP工序名称")
+ private String erpProcessName;
+
+ @Schema(description = "状态")
+ private String nodeStatus;
+}
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelChangeStatusReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelChangeStatusReqVO.java
new file mode 100644
index 00000000..7f5ef899
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelChangeStatusReqVO.java
@@ -0,0 +1,18 @@
+package cn.iocoder.yudao.module.product.controller.admin.factory.model.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 工厂模型修改 Request VO")
+@Data
+public class FactoryModelChangeStatusReqVO {
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "工厂模型主键不能为空")
+ private Long id;
+
+ @Schema(description = "状态",requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "状态不能为空")
+ private String nodeStatus;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelCreateReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelCreateReqVO.java
new file mode 100644
index 00000000..3845173a
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelCreateReqVO.java
@@ -0,0 +1,14 @@
+package cn.iocoder.yudao.module.product.controller.admin.factory.model.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@Schema(description = "管理后台 - 工厂模型新增 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class FactoryModelCreateReqVO extends FactoryModelBaseVO{
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelPageReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelPageReqVO.java
new file mode 100644
index 00000000..8e0f3c10
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelPageReqVO.java
@@ -0,0 +1,28 @@
+package cn.iocoder.yudao.module.product.controller.admin.factory.model.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 工厂模型分页 Request VO")
+@Data
+public class FactoryModelPageReqVO extends PageParam {
+
+ @Schema(description = "父级id")
+ private Long parentId;
+
+ @Schema(description = "节点编码")
+ private String nodeCoding;
+
+ @Schema(description = "节点名称")
+ private String nodeName;
+
+ @Schema(description = "节点类型")
+ private String nodeType;
+
+ @Schema(description = "ERP工序编码")
+ private String erpProcessCoding;
+
+ @Schema(description = "ERP工序名称")
+ private String erpProcessName;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelProcessBindReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelProcessBindReqVO.java
new file mode 100644
index 00000000..124be006
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelProcessBindReqVO.java
@@ -0,0 +1,26 @@
+package cn.iocoder.yudao.module.product.controller.admin.factory.model.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 工厂模型修改 Request VO")
+@Data
+public class FactoryModelProcessBindReqVO {
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "工厂模型主键不能为空")
+ private Long id;
+
+ @Schema(description = "ERP工艺路线编码", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "ERP工艺路线编码不能为空")
+ private String erpProcessRouteCoding;
+
+ @Schema(description = "ERP工序编码", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "ERP工序编码不能为空")
+ private String erpProcessCoding;
+
+ @Schema(description = "ERP工序名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "ERP工序名称不能为空")
+ private String erpProcessName;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelProcessUnbindReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelProcessUnbindReqVO.java
new file mode 100644
index 00000000..fa735e97
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelProcessUnbindReqVO.java
@@ -0,0 +1,13 @@
+package cn.iocoder.yudao.module.product.controller.admin.factory.model.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 工厂模型修改 Request VO")
+@Data
+public class FactoryModelProcessUnbindReqVO {
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "工厂模型主键不能为空")
+ private Long id;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelRespVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelRespVO.java
new file mode 100644
index 00000000..0fb9703d
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelRespVO.java
@@ -0,0 +1,22 @@
+package cn.iocoder.yudao.module.product.controller.admin.factory.model.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 工厂模型 Response VO")
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Data
+public class FactoryModelRespVO extends FactoryModelBaseVO {
+
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
+ private Long id;
+
+ @Schema(description = "创建时间")
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelUpdateReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelUpdateReqVO.java
new file mode 100644
index 00000000..d035ae1a
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/factory/model/vo/FactoryModelUpdateReqVO.java
@@ -0,0 +1,17 @@
+package cn.iocoder.yudao.module.product.controller.admin.factory.model.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@Schema(description = "管理后台 - 工厂模型修改 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class FactoryModelUpdateReqVO extends FactoryModelBaseVO {
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "工厂模型主键不能为空")
+ private Long id;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/PlanTemplateController.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/PlanTemplateController.java
new file mode 100644
index 00000000..38a5da39
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/PlanTemplateController.java
@@ -0,0 +1,112 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.template;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.product.controller.admin.plan.template.vo.PlanTemplateCopyReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.template.vo.PlanTemplatePageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.template.vo.PlanTemplateRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.template.vo.PlanTemplateSaveReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.template.PlanTemplateDO;
+import cn.iocoder.yudao.module.product.service.plan.template.PlanTemplateService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - 生产计划模板")
+@RestController
+@RequestMapping("/mes/product/plan/plan-template")
+@Validated
+public class PlanTemplateController implements BusinessControllerMarker {
+
+ @Resource
+ private PlanTemplateService planTemplateService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建生产计划模板")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template:create')")
+ public CommonResult createPlanTemplate(@Valid @RequestBody PlanTemplateSaveReqVO createReqVO) {
+ return success(planTemplateService.createPlanTemplate(createReqVO));
+ }
+
+ @PostMapping("/copy")
+ @Operation(summary = "复制生产计划模板")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template:copy')")
+ public CommonResult copyPlanTemplate(@Valid @RequestBody PlanTemplateCopyReqVO copyReqVO) {
+ return success(planTemplateService.copyPlanTemplate(copyReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新生产计划模板")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template:update')")
+ public CommonResult updatePlanTemplate(@Valid @RequestBody PlanTemplateSaveReqVO updateReqVO) {
+ planTemplateService.updatePlanTemplate(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除生产计划模板")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template:delete')")
+ public CommonResult deletePlanTemplate(@RequestParam("id") Long id) {
+ planTemplateService.deletePlanTemplate(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除生产计划模板")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template:delete')")
+ public CommonResult deletePlanTemplateList(@RequestBody BatchDeleteReqVO req) {
+ planTemplateService.deletePlanTemplateListByIds(req.getIds());
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得生产计划模板")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('product:plan-template:query')")
+ public CommonResult getPlanTemplate(@RequestParam("id") Long id) {
+ PlanTemplateDO planTemplate = planTemplateService.getPlanTemplate(id);
+ return success(BeanUtils.toBean(planTemplate, PlanTemplateRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得生产计划模板分页")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template:query')")
+ public CommonResult> getPlanTemplatePage(@Valid PlanTemplatePageReqVO pageReqVO) {
+ PageResult pageResult = planTemplateService.getPlanTemplatePage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, PlanTemplateRespVO.class));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "导出生产计划模板 Excel")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportPlanTemplateExcel(@Valid PlanTemplatePageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List list = planTemplateService.getPlanTemplatePage(pageReqVO).getList();
+ // 导出 Excel
+ ExcelUtils.write(response, "生产计划模板.xls", "数据", PlanTemplateRespVO.class,
+ BeanUtils.toBean(list, PlanTemplateRespVO.class));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/vo/PlanTemplateCopyReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/vo/PlanTemplateCopyReqVO.java
new file mode 100644
index 00000000..efc364b4
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/vo/PlanTemplateCopyReqVO.java
@@ -0,0 +1,15 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.template.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 生产计划模板复制 Request VO")
+@Data
+public class PlanTemplateCopyReqVO {
+
+ @NotNull(message = "id不能为空")
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16514")
+ private Long id;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/vo/PlanTemplatePageReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/vo/PlanTemplatePageReqVO.java
new file mode 100644
index 00000000..819549ef
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/vo/PlanTemplatePageReqVO.java
@@ -0,0 +1,41 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.template.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 生产计划模板分页 Request VO")
+@Data
+public class PlanTemplatePageReqVO extends PageParam {
+
+ @Schema(description = "模板编码")
+ private String templateCoding;
+
+ @Schema(description = "模板名称", example = "XX公司XX月计划模板")
+ private String templateName;
+
+ @Schema(description = "模板类型(M:月计划,D:日计划)", example = "M", allowableValues = {"M", "D"})
+ private String planType;
+
+ @Schema(description = "公司编码")
+ private String belongCompanyCoding;
+
+ @Schema(description = "公司名称")
+ private String belongCompanyName;
+
+ @Schema(description = "版本")
+ private Integer templateVersion;
+
+ @Schema(description = "状态(0:未启用,1:启用)", example = "0", allowableValues = {"0", "1"})
+ private String templateStatus;
+
+ @Schema(description = "创建时间(时间戳)")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime[] createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/vo/PlanTemplateRespVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/vo/PlanTemplateRespVO.java
new file mode 100644
index 00000000..cc97054d
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/vo/PlanTemplateRespVO.java
@@ -0,0 +1,51 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.template.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 生产计划模板 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class PlanTemplateRespVO {
+
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16514")
+ @ExcelProperty("主键")
+ private Long id;
+
+ @Schema(description = "模板编码")
+ @ExcelProperty("模板编码")
+ private String templateCoding;
+
+ @Schema(description = "模板名称")
+ @ExcelProperty("模板名称")
+ private String templateName;
+
+ @Schema(description = "模板类型(M:月计划,D:日计划)", example = "M", allowableValues = {"M", "D"})
+ @ExcelProperty("模板类型")
+ private String planType;
+
+ @Schema(description = "公司编码")
+ @ExcelProperty("公司编码")
+ private String belongCompanyCoding;
+
+ @Schema(description = "公司名称")
+ @ExcelProperty("公司名称")
+ private String belongCompanyName;
+
+ @Schema(description = "版本")
+ @ExcelProperty("版本")
+ private Integer templateVersion;
+
+ @Schema(description = "状态(0:未启用,1:启用)", example = "0", allowableValues = {"0", "1"})
+ @ExcelProperty("状态")
+ private String templateStatus;
+
+ @Schema(description = "创建时间(时间戳)")
+ @ExcelProperty("创建时间")
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/vo/PlanTemplateSaveReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/vo/PlanTemplateSaveReqVO.java
new file mode 100644
index 00000000..04d6e559
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/template/vo/PlanTemplateSaveReqVO.java
@@ -0,0 +1,43 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.template.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.Pattern;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 生产计划模板新增/修改 Request VO")
+@Data
+public class PlanTemplateSaveReqVO {
+
+ @Schema(description = "主键", example = "16514")
+ private Long id;
+
+ @Schema(description = "模板编码(后台生成)")
+ private String templateCoding;
+
+ @NotBlank(message = "模板名称不能为空")
+ @Schema(description = "模板名称", example = "XX公司XX月计划模板", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String templateName;
+
+ @NotBlank(message = "模板类型不能为空")
+ @Pattern(regexp = "[MD]", message = "只有M|D两种类型")
+ @Schema(description = "模板类型(M:月计划,D:日计划)", example = "M", allowableValues = {"M", "D"}, requiredMode = Schema.RequiredMode.REQUIRED)
+ private String planType;
+
+ @NotBlank(message = "公司编码不能为空")
+ @Schema(description = "公司编码", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String belongCompanyCoding;
+
+ @NotBlank(message = "公司名称不能为空")
+ @Schema(description = "公司名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String belongCompanyName;
+
+ @Schema(description = "版本(后台生成)", example = "1")
+ private Integer templateVersion;
+
+ @NotBlank(message = "状态不能为空")
+ @Pattern(regexp = "[01]", message = "只有0|1两种状态")
+ @Schema(description = "状态(0:未启用,1:启用)", example = "0", allowableValues = {"0", "1"})
+ private String templateStatus;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumn/PlanTemplateColumnController.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumn/PlanTemplateColumnController.java
new file mode 100644
index 00000000..1e82f079
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumn/PlanTemplateColumnController.java
@@ -0,0 +1,113 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn.vo.PlanTemplateColumnPageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn.vo.PlanTemplateColumnRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn.vo.PlanTemplateColumnSaveReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templatecolumn.PlanTemplateColumnDO;
+import cn.iocoder.yudao.module.product.service.plan.templatecolumn.PlanTemplateColumnService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - 生产计划模板动态列")
+@RestController
+@RequestMapping("/mes/product/plan/plan-template-column")
+@Validated
+public class PlanTemplateColumnController implements BusinessControllerMarker {
+
+
+ @Resource
+ private PlanTemplateColumnService planTemplateColumnService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建生产计划模板动态列")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column:create')")
+ public CommonResult createPlanTemplateColumn(@Valid @RequestBody PlanTemplateColumnSaveReqVO createReqVO) {
+ return success(planTemplateColumnService.createPlanTemplateColumn(createReqVO));
+ }
+
+ @PostMapping("/saveBatch")
+ @Operation(summary = "创建生产计划模板动态列")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column:save-batch')")
+ public CommonResult saveBatchPlanTemplateColumn(@Valid @RequestBody List saveReqVOList) {
+ planTemplateColumnService.saveBatchPlanTemplateColumn(saveReqVOList);
+ return success(true);
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新生产计划模板动态列")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column:update')")
+ public CommonResult updatePlanTemplateColumn(@Valid @RequestBody PlanTemplateColumnSaveReqVO updateReqVO) {
+ planTemplateColumnService.updatePlanTemplateColumn(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除生产计划模板动态列")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column:delete')")
+ public CommonResult deletePlanTemplateColumn(@RequestParam("id") Long id) {
+ planTemplateColumnService.deletePlanTemplateColumn(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除生产计划模板动态列")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column:delete')")
+ public CommonResult deletePlanTemplateColumnList(@RequestBody BatchDeleteReqVO req) {
+ planTemplateColumnService.deletePlanTemplateColumnListByIds(req.getIds());
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得生产计划模板动态列")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column:query')")
+ public CommonResult getPlanTemplateColumn(@RequestParam("id") Long id) {
+ PlanTemplateColumnDO planTemplateColumn = planTemplateColumnService.getPlanTemplateColumn(id);
+ return success(BeanUtils.toBean(planTemplateColumn, PlanTemplateColumnRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得生产计划模板动态列分页")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column:query')")
+ public CommonResult> getPlanTemplateColumnPage(@Valid PlanTemplateColumnPageReqVO pageReqVO) {
+ PageResult pageResult = planTemplateColumnService.getPlanTemplateColumnPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, PlanTemplateColumnRespVO.class));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "导出生产计划模板动态列 Excel")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportPlanTemplateColumnExcel(@Valid PlanTemplateColumnPageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List list = planTemplateColumnService.getPlanTemplateColumnPage(pageReqVO).getList();
+ // 导出 Excel
+ ExcelUtils.write(response, "生产计划模板动态列.xls", "数据", PlanTemplateColumnRespVO.class,
+ BeanUtils.toBean(list, PlanTemplateColumnRespVO.class));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumn/vo/PlanTemplateColumnPageReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumn/vo/PlanTemplateColumnPageReqVO.java
new file mode 100644
index 00000000..492d39e1
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumn/vo/PlanTemplateColumnPageReqVO.java
@@ -0,0 +1,14 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 生产计划模板动态列分页 Request VO")
+@Data
+public class PlanTemplateColumnPageReqVO extends PageParam {
+
+ @Schema(description = "模板id")
+ private Long planTemplateId;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumn/vo/PlanTemplateColumnRespVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumn/vo/PlanTemplateColumnRespVO.java
new file mode 100644
index 00000000..306ea48e
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumn/vo/PlanTemplateColumnRespVO.java
@@ -0,0 +1,39 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 生产计划模板动态列 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class PlanTemplateColumnRespVO {
+
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "12305")
+ @ExcelProperty("主键")
+ private Long id;
+
+ @Schema(description = "模板id")
+ @ExcelProperty("模板id")
+ private Long planTemplateId;
+
+ @Schema(description = "模板编码")
+ @ExcelProperty("模板编码")
+ private String planTemplateCoding;
+
+ @Schema(description = "列编码")
+ @ExcelProperty("列编码")
+ private String columnCoding;
+
+ @Schema(description = "列名称")
+ @ExcelProperty("列名称")
+ private String columnName;
+
+ @Schema(description = "创建时间")
+ @ExcelProperty("创建时间")
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumn/vo/PlanTemplateColumnSaveReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumn/vo/PlanTemplateColumnSaveReqVO.java
new file mode 100644
index 00000000..a8aaa3c7
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumn/vo/PlanTemplateColumnSaveReqVO.java
@@ -0,0 +1,37 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 生产计划模板动态列新增/修改 Request VO")
+@Data
+public class PlanTemplateColumnSaveReqVO {
+
+ @Schema(description = "主键", example = "12305")
+ private Long id;
+
+ @NotNull(message = "模板id不能为空")
+ @Schema(description = "模板id", requiredMode = Schema.RequiredMode.REQUIRED)
+ private Long planTemplateId;
+
+ @NotBlank(message = "模板编码不能为空")
+ @Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String planTemplateCoding;
+
+ @NotBlank(message = "列编码不能为空")
+ @Schema(description = "列编码", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String columnCoding;
+
+ @NotBlank(message = "列名称不能为空")
+ @Schema(description = "列名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String columnName;
+
+ @NotBlank(message = "数据操作类型不能为空")
+ @Pattern(regexp = "INSERT|UPDATE|DELETE", message = "只能使用INSERT|UPDATE|DELETE三种操作类型")
+ @Schema(description = "操作类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "INSERT", allowableValues = {"INSERT","UPDATE","DELETE"})
+ private String operation;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumndata/PlanTemplateColumnDataController.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumndata/PlanTemplateColumnDataController.java
new file mode 100644
index 00000000..9dd4a66f
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumndata/PlanTemplateColumnDataController.java
@@ -0,0 +1,105 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo.PlanTemplateColumnDataPageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo.PlanTemplateColumnDataRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo.PlanTemplateColumnDataSaveReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templatecolumndata.PlanTemplateColumnDataDO;
+import cn.iocoder.yudao.module.product.service.plan.templatecolumndata.PlanTemplateColumnDataService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - 生产计划模板动态列数据")
+@RestController
+@RequestMapping("/mes/product/plan/plan-template-column-data")
+@Validated
+public class PlanTemplateColumnDataController implements BusinessControllerMarker {
+
+
+ @Resource
+ private PlanTemplateColumnDataService planTemplateColumnDataService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建生产计划模板动态列数据")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column-data:create')")
+ public CommonResult createPlanTemplateColumnData(@Valid @RequestBody PlanTemplateColumnDataSaveReqVO createReqVO) {
+ return success(planTemplateColumnDataService.createPlanTemplateColumnData(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新生产计划模板动态列数据")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column-data:update')")
+ public CommonResult updatePlanTemplateColumnData(@Valid @RequestBody PlanTemplateColumnDataSaveReqVO updateReqVO) {
+ planTemplateColumnDataService.updatePlanTemplateColumnData(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除生产计划模板动态列数据")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column-data:delete')")
+ public CommonResult deletePlanTemplateColumnData(@RequestParam("id") Long id) {
+ planTemplateColumnDataService.deletePlanTemplateColumnData(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除生产计划模板动态列数据")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column-data:delete')")
+ public CommonResult deletePlanTemplateColumnDataList(@RequestBody BatchDeleteReqVO req) {
+ planTemplateColumnDataService.deletePlanTemplateColumnDataListByIds(req.getIds());
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得生产计划模板动态列数据")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column-data:query')")
+ public CommonResult getPlanTemplateColumnData(@RequestParam("id") Long id) {
+ PlanTemplateColumnDataDO planTemplateColumnData = planTemplateColumnDataService.getPlanTemplateColumnData(id);
+ return success(BeanUtils.toBean(planTemplateColumnData, PlanTemplateColumnDataRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得生产计划模板动态列数据分页")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column-data:query')")
+ public CommonResult> getPlanTemplateColumnDataPage(@Valid PlanTemplateColumnDataPageReqVO pageReqVO) {
+ PageResult pageResult = planTemplateColumnDataService.getPlanTemplateColumnDataPage(pageReqVO);
+ return success(BeanUtils.toBean(pageResult, PlanTemplateColumnDataRespVO.class));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "导出生产计划模板动态列数据 Excel")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-column-data:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportPlanTemplateColumnDataExcel(@Valid PlanTemplateColumnDataPageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List list = planTemplateColumnDataService.getPlanTemplateColumnDataPage(pageReqVO).getList();
+ // 导出 Excel
+ ExcelUtils.write(response, "生产计划模板动态列数据.xls", "数据", PlanTemplateColumnDataRespVO.class,
+ BeanUtils.toBean(list, PlanTemplateColumnDataRespVO.class));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumndata/vo/PlanTemplateColumnDataPageReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumndata/vo/PlanTemplateColumnDataPageReqVO.java
new file mode 100644
index 00000000..3de5d1eb
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumndata/vo/PlanTemplateColumnDataPageReqVO.java
@@ -0,0 +1,20 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 生产计划模板动态列数据分页 Request VO")
+@Data
+public class PlanTemplateColumnDataPageReqVO extends PageParam {
+
+ @Schema(description = "模板id")
+ private Long planTemplateTemplateId;
+
+ @Schema(description = "模板动态列id")
+ private Long planTemplateColumnId;
+
+ @Schema(description = "模板明细id")
+ private Long planTemplateItemId;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumndata/vo/PlanTemplateColumnDataRespVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumndata/vo/PlanTemplateColumnDataRespVO.java
new file mode 100644
index 00000000..0fbf23a5
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumndata/vo/PlanTemplateColumnDataRespVO.java
@@ -0,0 +1,43 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo;
+
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 生产计划模板动态列数据 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class PlanTemplateColumnDataRespVO {
+
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "15546")
+ @ExcelProperty("主键")
+ private Long id;
+
+ @Schema(description = "模板id")
+ @ExcelProperty("模板id")
+ private Long planTemplateTemplateId;
+
+ @Schema(description = "模板动态列id")
+ @ExcelProperty("模板动态列id")
+ private Long planTemplateColumnId;
+
+ @Schema(description = "模板明细id")
+ @ExcelProperty("模板明细id")
+ private Long planTemplateItemId;
+
+ @Schema(description = "动态列编码")
+ @ExcelProperty("动态列编码")
+ private String columnCoding;
+
+ @Schema(description = "动态列值")
+ @ExcelProperty("动态列值")
+ private String columnValue;
+
+ @Schema(description = "创建时间")
+ @ExcelProperty("创建时间")
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumndata/vo/PlanTemplateColumnDataSaveReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumndata/vo/PlanTemplateColumnDataSaveReqVO.java
new file mode 100644
index 00000000..376285c3
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templatecolumndata/vo/PlanTemplateColumnDataSaveReqVO.java
@@ -0,0 +1,28 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 生产计划模板动态列数据新增/修改 Request VO")
+@Data
+public class PlanTemplateColumnDataSaveReqVO {
+
+ @Schema(description = "主键", example = "15546")
+ private Long id;
+
+ @Schema(description = "模板id")
+ private Long planTemplateTemplateId;
+
+ @Schema(description = "模板动态列id")
+ private Long planTemplateColumnId;
+
+ @Schema(description = "模板明细id")
+ private Long planTemplateItemId;
+
+ @Schema(description = "动态列编码")
+ private String columnCoding;
+
+ @Schema(description = "动态列值")
+ private String columnValue;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templateitem/PlanTemplateItemController.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templateitem/PlanTemplateItemController.java
new file mode 100644
index 00000000..7c76a141
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templateitem/PlanTemplateItemController.java
@@ -0,0 +1,112 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.templateitem;
+
+import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
+import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templateitem.vo.PlanTemplateItemPageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templateitem.vo.PlanTemplateItemRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templateitem.vo.PlanTemplateItemSaveReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templateitem.PlanTemplateItemDO;
+import cn.iocoder.yudao.module.product.service.plan.templateitem.PlanTemplateItemService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.servlet.http.HttpServletResponse;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.io.IOException;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+@Tag(name = "管理后台 - 生产计划模板项目")
+@RestController
+@RequestMapping("/mes/product/plan/plan-template-item")
+@Validated
+public class PlanTemplateItemController implements BusinessControllerMarker {
+
+
+ @Resource
+ private PlanTemplateItemService planTemplateItemService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建生产计划模板项目")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-item:create')")
+ public CommonResult createPlanTemplateItem(@Valid @RequestBody PlanTemplateItemSaveReqVO createReqVO) {
+ return success(planTemplateItemService.createPlanTemplateItem(createReqVO));
+ }
+
+ @PostMapping("/saveBatch")
+ @Operation(summary = "创建生产计划模板项目")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-item:save-batch')")
+ public CommonResult saveBatchPlanTemplateItem(@Valid @RequestBody List saveReqVOList) {
+ planTemplateItemService.saveBatchPlanTemplateItem(saveReqVOList);
+ return success(true);
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新生产计划模板项目")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-item:update')")
+ public CommonResult updatePlanTemplateItem(@Valid @RequestBody PlanTemplateItemSaveReqVO updateReqVO) {
+ planTemplateItemService.updatePlanTemplateItem(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除生产计划模板项目")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-item:delete')")
+ public CommonResult deletePlanTemplateItem(@RequestParam("id") Long id) {
+ planTemplateItemService.deletePlanTemplateItem(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除生产计划模板项目")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-item:delete')")
+ public CommonResult deletePlanTemplateItemList(@RequestBody BatchDeleteReqVO req) {
+ planTemplateItemService.deletePlanTemplateItemListByIds(req.getIds());
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得生产计划模板项目")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-item:query')")
+ public CommonResult getPlanTemplateItem(@RequestParam("id") Long id) {
+ PlanTemplateItemDO planTemplateItem = planTemplateItemService.getPlanTemplateItem(id);
+ return success(BeanUtils.toBean(planTemplateItem, PlanTemplateItemRespVO.class));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得生产计划模板项目分页")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-item:query')")
+ public CommonResult> getPlanTemplateItemPage(@Valid PlanTemplateItemPageReqVO pageReqVO) {
+ return success(planTemplateItemService.getPlanTemplateItemPage(pageReqVO));
+ }
+
+ @GetMapping("/export-excel")
+ @Operation(summary = "导出生产计划模板项目 Excel")
+ @PreAuthorize("@ss.hasPermission('product:plan:plan-template-item:export')")
+ @ApiAccessLog(operateType = EXPORT)
+ public void exportPlanTemplateItemExcel(@Valid @RequestBody PlanTemplateItemPageReqVO pageReqVO,
+ HttpServletResponse response) throws IOException {
+ pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+ List list = planTemplateItemService.getPlanTemplateItemPage(pageReqVO).getList();
+ // 导出 Excel
+ ExcelUtils.write(response, "生产计划模板项目.xls", "数据", PlanTemplateItemRespVO.class,
+ list);
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templateitem/vo/PlanTemplateItemPageReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templateitem/vo/PlanTemplateItemPageReqVO.java
new file mode 100644
index 00000000..abdbfd3c
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templateitem/vo/PlanTemplateItemPageReqVO.java
@@ -0,0 +1,14 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.templateitem.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 生产计划模板项目分页 Request VO")
+@Data
+public class PlanTemplateItemPageReqVO extends PageParam {
+
+ @Schema(description = "模板id", example = "26659")
+ private Long planTemplateId;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templateitem/vo/PlanTemplateItemRespVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templateitem/vo/PlanTemplateItemRespVO.java
new file mode 100644
index 00000000..5b9a7c80
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templateitem/vo/PlanTemplateItemRespVO.java
@@ -0,0 +1,68 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.templateitem.vo;
+
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo.PlanTemplateColumnDataRespVO;
+import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
+import com.alibaba.excel.annotation.ExcelProperty;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.util.Map;
+
+@Schema(description = "管理后台 - 生产计划模板项目 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class PlanTemplateItemRespVO {
+
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "23213")
+ @ExcelProperty("主键")
+ private Long id;
+
+ @Schema(description = "模板id")
+ @ExcelProperty("模板id")
+ private Long planTemplateId;
+
+ @Schema(description = "模板编码")
+ @ExcelProperty("模板编码")
+ private String planTemplateCoding;
+
+ @Schema(description = "计量单位(数据字典)")
+ @ExcelProperty("计量单位")
+ private String unit;
+
+ @Schema(description = "是否生成订单(0:不生成,1:生成)")
+ @ExcelProperty("是否生成订单")
+ private String generateOrder;
+
+ @Schema(description = "录入方式", example = "1")
+ @ExcelProperty("录入方式")
+ private String writeType;
+
+ @Schema(description = "物料编码")
+ @ExcelProperty("物料编码")
+ private String materialCoding;
+
+ @Schema(description = "物料名称")
+ @ExcelProperty("物料名称")
+ private String materialName;
+
+ @Schema(description = "指标id")
+ @ExcelProperty("指标id")
+ private Long indicatorId;
+
+ @Schema(description = "指标编码")
+ @ExcelProperty("指标编码")
+ private String indicatorCoding;
+
+ @Schema(description = "所属公司")
+ @ExcelProperty("所属公司")
+ private String belongCompanyCoding;
+
+ @Schema(description = "创建时间")
+ @ExcelProperty("创建时间")
+ private LocalDateTime createTime;
+
+ @Schema(description = "动态列")
+ private Map columns;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templateitem/vo/PlanTemplateItemSaveReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templateitem/vo/PlanTemplateItemSaveReqVO.java
new file mode 100644
index 00000000..b4bb26fc
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/plan/templateitem/vo/PlanTemplateItemSaveReqVO.java
@@ -0,0 +1,62 @@
+package cn.iocoder.yudao.module.product.controller.admin.plan.templateitem.vo;
+
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo.PlanTemplateColumnDataRespVO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.util.Map;
+
+@Schema(description = "管理后台 - 生产计划模板项目新增/修改 Request VO")
+@Data
+public class PlanTemplateItemSaveReqVO {
+
+ @Schema(description = "主键", example = "23213")
+ private Long id;
+
+ @NotNull(message = "模板id不能为空")
+ @Schema(description = "模板id", requiredMode = Schema.RequiredMode.REQUIRED)
+ private Long planTemplateId;
+
+ @NotBlank(message = "模板编码不能为空")
+ @Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String planTemplateCoding;
+
+ @Schema(description = "计量单位(数据字典)")
+ private String unit;
+
+ @NotBlank(message = "是否生成订单不能为空")
+ @Schema(description = "是否生成订单(0:不生成,1:生成)", example = "1", allowableValues = {"0","1",""}, requiredMode = Schema.RequiredMode.REQUIRED)
+ private String generateOrder;
+
+ @Schema(description = "录入方式", example = "1")
+ private String writeType;
+
+ @NotBlank(message = "物料编码不能为空")
+ @Schema(description = "物料编码", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String materialCoding;
+
+ @NotBlank(message = "物料名称不能为空")
+ @Schema(description = "物料名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String materialName;
+
+ @NotNull(message = "指标id不能为空")
+ @Schema(description = "指标id", requiredMode = Schema.RequiredMode.REQUIRED)
+ private Long indicatorId;
+
+ @NotBlank(message = "指标编码不能为空")
+ @Schema(description = "指标编码", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String indicatorCoding;
+
+ @Schema(description = "所属公司")
+ private String belongCompanyCoding;
+
+ @Schema(description = "动态列")
+ private Map columns;
+
+ @NotBlank(message = "操作类型不能为空")
+ @Schema(description = "操作类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "INSERT", allowableValues = {"INSERT","UPDATE","DELETE"})
+ private String operation;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/product/ProductController.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/product/ProductController.java
index 1f34e14f..b4a6dc01 100644
--- a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/product/ProductController.java
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/product/ProductController.java
@@ -1,12 +1,13 @@
package cn.iocoder.yudao.module.product.controller.admin.product;
-import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/ScheduleConfigController.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/ScheduleConfigController.java
new file mode 100644
index 00000000..a2e37a2d
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/ScheduleConfigController.java
@@ -0,0 +1,86 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.config;
+
+import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.pojo.vo.BatchDeleteReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo.ScheduleConfigPageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo.ScheduleConfigRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo.ScheduleCreateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo.ScheduleUpdateReqVO;
+import cn.iocoder.yudao.module.product.convert.schedule.config.ScheduleConfigConvert;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.config.ScheduleConfigDO;
+import cn.iocoder.yudao.module.product.service.schedule.config.ScheduleConfigService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+
+@Tag(name = "管理后台 - 排班配置")
+@RestController
+@RequestMapping("/mes/schedule-config")
+@Validated
+public class ScheduleConfigController implements BusinessControllerMarker {
+
+
+ @Resource
+ private ScheduleConfigService scheduleConfigService;
+
+ @PostMapping("/create")
+ @Operation(summary = "创建排班配置")
+ @PreAuthorize("@ss.hasPermission('mes:schedule-config:create')")
+ public CommonResult createScheduleConfig(@Valid @RequestBody ScheduleCreateReqVO createReqVO) {
+ return success(scheduleConfigService.createScheduleConfig(createReqVO));
+ }
+
+ @PutMapping("/update")
+ @Operation(summary = "更新排班配置")
+ @PreAuthorize("@ss.hasPermission('mes:schedule-config:update')")
+ public CommonResult updateScheduleConfig(@Valid @RequestBody ScheduleUpdateReqVO updateReqVO) {
+ scheduleConfigService.updateScheduleConfig(updateReqVO);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete")
+ @Operation(summary = "删除排班配置")
+ @Parameter(name = "id", description = "编号", required = true)
+ @PreAuthorize("@ss.hasPermission('mes:schedule-config:delete')")
+ public CommonResult deleteScheduleConfig(@RequestParam("id") Long id) {
+ scheduleConfigService.deleteScheduleConfig(id);
+ return success(true);
+ }
+
+ @DeleteMapping("/delete-list")
+ @Parameter(name = "ids", description = "编号", required = true)
+ @Operation(summary = "批量删除排班配置")
+ @PreAuthorize("@ss.hasPermission('mes:schedule-config:delete')")
+ public CommonResult deleteScheduleConfigList(@RequestBody BatchDeleteReqVO req) {
+ scheduleConfigService.deleteScheduleConfigListByIds(req.getIds());
+ return success(true);
+ }
+
+ @GetMapping("/get")
+ @Operation(summary = "获得排班配置")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('mes:schedule-config:query')")
+ public CommonResult getScheduleConfig(@RequestParam("id") Long id) {
+ ScheduleConfigDO scheduleConfig = scheduleConfigService.getScheduleConfig(id);
+ return success(ScheduleConfigConvert.INSTANCE.convert(scheduleConfig));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得排班配置分页")
+ @PreAuthorize("@ss.hasPermission('mes:schedule-config:query')")
+ public CommonResult> getScheduleConfigPage(@Valid ScheduleConfigPageReqVO pageReqVO) {
+ PageResult pageResult = scheduleConfigService.getScheduleConfigPage(pageReqVO);
+ return success(ScheduleConfigConvert.INSTANCE.convertPage(pageResult));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigBaseVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigBaseVO.java
new file mode 100644
index 00000000..0669a94c
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigBaseVO.java
@@ -0,0 +1,28 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 排班配置Base VO")
+@Data
+public class ScheduleConfigBaseVO {
+
+ @Schema(description = "工厂模型id", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "工厂模型id不能为空")
+ private Long factoryModelId;
+
+ @Schema(description = "工厂模型编码", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "工厂模型编码不能为空")
+ private String factoryModelCoding;
+
+ @Schema(description = "排班编码", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "排班编码不能为空")
+ private String configCoding;
+
+ @Schema(description = "排班名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "排班名称不能为空")
+ private String configName;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigCreateReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigCreateReqVO.java
new file mode 100644
index 00000000..a0ae7cd0
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigCreateReqVO.java
@@ -0,0 +1,15 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@Schema(description = "管理后台 - 排班配置新增 Request VO")
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Data
+public class ScheduleConfigCreateReqVO extends ScheduleConfigBaseVO {
+
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigPageReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigPageReqVO.java
new file mode 100644
index 00000000..ec53a40a
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigPageReqVO.java
@@ -0,0 +1,22 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 排班配置分页 Request VO")
+@Data
+public class ScheduleConfigPageReqVO extends PageParam {
+
+ @Schema(description = "工厂模型id")
+ private Long factoryModelId;
+
+ @Schema(description = "工厂模型编码")
+ private String factoryModelCoding;
+
+ @Schema(description = "排班编码")
+ private String configCoding;
+
+ @Schema(description = "排班名称")
+ private String configName;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigRespVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigRespVO.java
new file mode 100644
index 00000000..0acbdeb3
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigRespVO.java
@@ -0,0 +1,22 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 排班配置 Response VO")
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Data
+public class ScheduleConfigRespVO extends ScheduleConfigBaseVO{
+
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
+ private Long id;
+
+ @Schema(description = "创建时间")
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigUpdateReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigUpdateReqVO.java
new file mode 100644
index 00000000..5a664795
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleConfigUpdateReqVO.java
@@ -0,0 +1,18 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
+
+@Schema(description = "管理后台 - 排班配置修改 Request VO")
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Data
+public class ScheduleConfigUpdateReqVO extends ScheduleConfigBaseVO{
+
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "排班配置主键不能为空")
+ private Long id;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleCreateReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleCreateReqVO.java
new file mode 100644
index 00000000..5120fef7
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleCreateReqVO.java
@@ -0,0 +1,35 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo;
+
+import cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo.ScheduleRuleCreateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo.ScheduleShiftCreateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo.ScheduleTeamCreateReqVO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.util.List;
+
+@Schema(description = "管理后台 - 排班新增 Request VO")
+@Data
+public class ScheduleCreateReqVO {
+
+ @Schema(description = "基本信息", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "基本信息不能为空")
+ @Valid
+ private ScheduleConfigCreateReqVO scheduleConfig;
+
+ @Schema(description = "排班班组信息")
+ @Valid
+ private List scheduleTeams;
+
+ @Schema(description = "排班班次信息")
+ @Valid
+ private List scheduleShifts;
+
+ @Schema(description = "排班规则信息")
+ @Valid
+ private List scheduleRules;
+
+
+}
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleUpdateReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleUpdateReqVO.java
new file mode 100644
index 00000000..47fc9b51
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/config/vo/ScheduleUpdateReqVO.java
@@ -0,0 +1,35 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo;
+
+import cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo.ScheduleRuleUpdateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo.ScheduleShiftUpdateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo.ScheduleTeamUpdateReqVO;
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.util.List;
+
+@Schema(description = "管理后台 - 排班修改 Request VO")
+@Data
+public class ScheduleUpdateReqVO {
+
+ @Schema(description = "基本信息", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "基本信息不能为空")
+ @Valid
+ private ScheduleConfigUpdateReqVO scheduleConfig;
+
+ @Schema(description = "排班班组信息")
+ @Valid
+ private List scheduleTeams;
+
+ @Schema(description = "排班班次信息")
+ @Valid
+ private List scheduleShifts;
+
+ @Schema(description = "排班规则信息")
+ @Valid
+ private List scheduleRules;
+
+
+}
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/data/ScheduleDataController.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/data/ScheduleDataController.java
new file mode 100644
index 00000000..e565ba52
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/data/ScheduleDataController.java
@@ -0,0 +1,48 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.data;
+
+import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.data.vo.ScheduleDataGenerateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.data.vo.ScheduleDataListReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.data.vo.ScheduleDataRespVO;
+import cn.iocoder.yudao.module.product.convert.schedule.data.ScheduleDataConvert;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.data.ScheduleDataDO;
+import cn.iocoder.yudao.module.product.service.schedule.data.ScheduleDataService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+
+@Tag(name = "管理后台 - 排班数据")
+@RestController
+@RequestMapping("/mes/schedule-data")
+@Validated
+public class ScheduleDataController implements BusinessControllerMarker {
+
+ @Resource
+ private ScheduleDataService scheduleDataService;
+
+ @GetMapping("/list")
+ @Operation(summary = "获得排班数据列表")
+ @PreAuthorize("@ss.hasPermission('mes:schedule-data:query')")
+ public CommonResult> getScheduleDataList(ScheduleDataListReqVO reqVO) {
+ List scheduleDataList = scheduleDataService.getScheduleDataList(reqVO);
+ return success(ScheduleDataConvert.INSTANCE.convertList(scheduleDataList));
+ }
+
+ @PostMapping("/generate")
+ @Operation(summary = "生成排班数据")
+ @PreAuthorize("@ss.hasPermission('mes:schedule-data:create')")
+ public CommonResult generateScheduleData(@Valid @RequestBody ScheduleDataGenerateReqVO generateReqVO) {
+ scheduleDataService.generateScheduleData(generateReqVO);
+ return success(true);
+ }
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/data/vo/ScheduleDataGenerateReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/data/vo/ScheduleDataGenerateReqVO.java
new file mode 100644
index 00000000..83ddf9bc
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/data/vo/ScheduleDataGenerateReqVO.java
@@ -0,0 +1,26 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.data.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDate;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
+
+@Schema(description = "管理后台 - 排班数据生成 Request VO")
+@Data
+public class ScheduleDataGenerateReqVO {
+ @Schema(description = "排班配置id", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "排班配置id不能为空")
+ private Long scheduleConfigId;
+
+ @Schema(description = "开始时间", example = "2025-09-01")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
+ private LocalDate startTime;
+
+ @Schema(description = "结束时间", example = "2025-09-30")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
+ private LocalDate endTime;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/data/vo/ScheduleDataListReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/data/vo/ScheduleDataListReqVO.java
new file mode 100644
index 00000000..9f5583dc
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/data/vo/ScheduleDataListReqVO.java
@@ -0,0 +1,26 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.data.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDate;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
+
+@Schema(description = "管理后台 - 排班数据列表 Request VO")
+@Data
+public class ScheduleDataListReqVO {
+
+ @Schema(description = "班组配置id")
+ private Long scheduleConfigId;
+
+ @Schema(description = "开始时间", example = "2025-09-01")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
+ private LocalDate startTime;
+
+ @Schema(description = "结束时间", example = "2025-10-01")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
+ private LocalDate endTime;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/data/vo/ScheduleDataRespVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/data/vo/ScheduleDataRespVO.java
new file mode 100644
index 00000000..b361fde4
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/data/vo/ScheduleDataRespVO.java
@@ -0,0 +1,38 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.data.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
+
+@Schema(description = "管理后台 - 排班数据 Response VO")
+@Data
+public class ScheduleDataRespVO {
+
+ @Schema(description = "主键")
+ private Long id;
+
+ @Schema(description = "班组配置id")
+ private Long scheduleConfigId;
+
+ @Schema(description = "班组配置编码")
+ private String scheduleConfigCoding;
+
+ @Schema(description = "排班日期")
+ @JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY)
+ private LocalDate scheduleDate;
+
+ @Schema(description = "班次id")
+ private Long scheduleShiftId;
+
+ @Schema(description = "班组id")
+ private Long scheduleTeamId;
+
+ @Schema(description = "创建时间")
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/ScheduleRuleController.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/ScheduleRuleController.java
new file mode 100644
index 00000000..54d1f430
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/ScheduleRuleController.java
@@ -0,0 +1,53 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.rule;
+
+import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo.ScheduleRulePageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo.ScheduleRuleRespVO;
+import cn.iocoder.yudao.module.product.convert.schedule.rule.ScheduleRuleConvert;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.rule.ScheduleRuleDO;
+import cn.iocoder.yudao.module.product.service.schedule.rule.ScheduleRuleService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+
+@Tag(name = "管理后台 - 排班规则")
+@RestController
+@RequestMapping("/mes/schedule-rule")
+@Validated
+public class ScheduleRuleController implements BusinessControllerMarker {
+
+
+ @Resource
+ private ScheduleRuleService scheduleRuleService;
+
+ @GetMapping("/get")
+ @Operation(summary = "获得排班规则")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('mes:schedule-rule:query')")
+ public CommonResult getScheduleRule(@RequestParam("id") Long id) {
+ ScheduleRuleDO scheduleRule = scheduleRuleService.getScheduleRule(id);
+ return success(ScheduleRuleConvert.INSTANCE.convert(scheduleRule));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得排班规则分页")
+ @PreAuthorize("@ss.hasPermission('mes:schedule-rule:query')")
+ public CommonResult> getScheduleRulePage(@Valid ScheduleRulePageReqVO pageReqVO) {
+ PageResult pageResult = scheduleRuleService.getScheduleRulePage(pageReqVO);
+ return success(ScheduleRuleConvert.INSTANCE.convertPage(pageResult));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/vo/ScheduleRuleCreateReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/vo/ScheduleRuleCreateReqVO.java
new file mode 100644
index 00000000..eb2a3ed4
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/vo/ScheduleRuleCreateReqVO.java
@@ -0,0 +1,28 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDate;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
+
+@Schema(description = "管理后台 - 排班规则新增Request VO")
+@Data
+public class ScheduleRuleCreateReqVO {
+
+ @Schema(description = "排班日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "2025-06-14")
+ @NotNull(message = "排班日期不能为空")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
+ private LocalDate scheduleDate;
+
+ @Schema(description = "班次名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "班次名称不能为空")
+ private String scheduleShiftName;
+
+ @Schema(description = "班组名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "班组名称不能为空")
+ private String scheduleTeamName;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/vo/ScheduleRulePageReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/vo/ScheduleRulePageReqVO.java
new file mode 100644
index 00000000..c9df6c01
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/vo/ScheduleRulePageReqVO.java
@@ -0,0 +1,15 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 排班规则分页 Request VO")
+@Data
+public class ScheduleRulePageReqVO extends PageParam {
+
+ @Schema(description = "班组配置id")
+ private Long scheduleConfigId;
+
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/vo/ScheduleRuleRespVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/vo/ScheduleRuleRespVO.java
new file mode 100644
index 00000000..4a4833c1
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/vo/ScheduleRuleRespVO.java
@@ -0,0 +1,35 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDateTime;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 排班规则 Response VO")
+@Data
+public class ScheduleRuleRespVO {
+
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
+ private Long id;
+
+ @Schema(description = "排班日期", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "排班日期不能为空")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+ private LocalDateTime scheduleDate;
+
+ @Schema(description = "班次id", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "班次id不能为空")
+ private Long scheduleShiftId;
+
+ @Schema(description = "班组id", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "班组id不能为空")
+ private Long scheduleTeamId;
+
+ @Schema(description = "创建时间")
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/vo/ScheduleRuleUpdateReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/vo/ScheduleRuleUpdateReqVO.java
new file mode 100644
index 00000000..4b6f8512
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/rule/vo/ScheduleRuleUpdateReqVO.java
@@ -0,0 +1,30 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import java.time.LocalDate;
+
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
+
+@Schema(description = "管理后台 - 排班规则修改Request VO")
+@Data
+public class ScheduleRuleUpdateReqVO{
+ @Schema(description = "排班规则主键,修改的项目赋值,新建的项目不赋值")
+ private Long id;
+
+ @Schema(description = "排班日期", requiredMode = Schema.RequiredMode.REQUIRED, example = "2025-06-14")
+ @NotNull(message = "排班日期不能为空")
+ @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
+ private LocalDate scheduleDate;
+
+ @Schema(description = "班次名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "班次名称不能为空")
+ private String scheduleShiftName;
+
+ @Schema(description = "班组名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotNull(message = "班组名称不能为空")
+ private String scheduleTeamName;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/ScheduleShiftController.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/ScheduleShiftController.java
new file mode 100644
index 00000000..375a5343
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/ScheduleShiftController.java
@@ -0,0 +1,52 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.shift;
+
+import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo.ScheduleShiftPageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo.ScheduleShiftRespVO;
+import cn.iocoder.yudao.module.product.convert.schedule.shift.ScheduleShiftConvert;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.shift.ScheduleShiftDO;
+import cn.iocoder.yudao.module.product.service.schedule.shift.ScheduleShiftService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+
+@Tag(name = "管理后台 - 排班班次")
+@RestController
+@RequestMapping("/mes/schedule-shift")
+@Validated
+public class ScheduleShiftController implements BusinessControllerMarker {
+
+
+ @Resource
+ private ScheduleShiftService scheduleShiftService;
+
+ @GetMapping("/get")
+ @Operation(summary = "获得排班班次")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('mes:schedule-shift:query')")
+ public CommonResult getScheduleShift(@RequestParam("id") Long id) {
+ ScheduleShiftDO scheduleShift = scheduleShiftService.getScheduleShift(id);
+ return success(ScheduleShiftConvert.INSTANCE.convert(scheduleShift));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得排班班次分页")
+ @PreAuthorize("@ss.hasPermission('mes:schedule-shift:query')")
+ public CommonResult> getScheduleShiftPage(@Valid ScheduleShiftPageReqVO pageReqVO) {
+ PageResult pageResult = scheduleShiftService.getScheduleShiftPage(pageReqVO);
+ return success(ScheduleShiftConvert.INSTANCE.convertPage(pageResult));
+ }
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/vo/ScheduleShiftCreateReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/vo/ScheduleShiftCreateReqVO.java
new file mode 100644
index 00000000..6c141c9c
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/vo/ScheduleShiftCreateReqVO.java
@@ -0,0 +1,30 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.time.LocalTime;
+
+@Schema(description = "管理后台 - 排班班次新增 Request VO")
+@Data
+public class ScheduleShiftCreateReqVO {
+
+ @Schema(description = "班次名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "班次名称不能为空")
+ private String shiftName;
+
+ @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "08:00:00")
+ @NotNull(message = "开始时间不能为空")
+ private LocalTime beginTime;
+
+ @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "08:00:00")
+ @NotNull(message = "结束时间不能为空")
+ private LocalTime endTime;
+
+ @Schema(description = "是否跨天", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "是否跨天不能为空")
+ private String crossDay;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/vo/ScheduleShiftPageReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/vo/ScheduleShiftPageReqVO.java
new file mode 100644
index 00000000..53ff81c9
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/vo/ScheduleShiftPageReqVO.java
@@ -0,0 +1,13 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 排班班次分页 Request VO")
+@Data
+public class ScheduleShiftPageReqVO extends PageParam {
+
+ @Schema(description = "班组配置id")
+ private Long scheduleConfigId;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/vo/ScheduleShiftRespVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/vo/ScheduleShiftRespVO.java
new file mode 100644
index 00000000..f4625c8f
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/vo/ScheduleShiftRespVO.java
@@ -0,0 +1,33 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+import java.time.LocalTime;
+
+@Schema(description = "管理后台 - 排班班次 Response VO")
+@Data
+public class ScheduleShiftRespVO {
+
+ @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED)
+ private Long id;
+
+ @Schema(description = "班次名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String shiftName;
+
+ @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
+ private LocalTime beginTime;
+
+ @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED)
+ @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
+ private LocalTime endTime;
+
+ @Schema(description = "是否跨天", requiredMode = Schema.RequiredMode.REQUIRED)
+ private String crossDay;
+
+ @Schema(description = "创建时间")
+ private LocalDateTime createTime;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/vo/ScheduleShiftUpdateReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/vo/ScheduleShiftUpdateReqVO.java
new file mode 100644
index 00000000..14442c45
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/shift/vo/ScheduleShiftUpdateReqVO.java
@@ -0,0 +1,32 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import jakarta.validation.constraints.NotNull;
+import lombok.Data;
+
+import java.time.LocalTime;
+
+@Schema(description = "管理后台 - 排班班次修改 Request VO")
+@Data
+public class ScheduleShiftUpdateReqVO{
+
+ @Schema(description = "排班班次主键,修改的项目赋值,新建的项目不赋值")
+ private Long id;
+
+ @Schema(description = "班次名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "班次名称不能为空")
+ private String shiftName;
+
+ @Schema(description = "开始时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "08:00:00")
+ @NotNull(message = "开始时间不能为空")
+ private LocalTime beginTime;
+
+ @Schema(description = "结束时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "08:00:00")
+ @NotNull(message = "结束时间不能为空")
+ private LocalTime endTime;
+
+ @Schema(description = "是否跨天", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "是否跨天不能为空")
+ private String crossDay;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/ScheduleTeamController.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/ScheduleTeamController.java
new file mode 100644
index 00000000..63585cfe
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/ScheduleTeamController.java
@@ -0,0 +1,52 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.team;
+
+import cn.iocoder.yudao.framework.business.interceptor.BusinessControllerMarker;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo.ScheduleTeamPageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo.ScheduleTeamRespVO;
+import cn.iocoder.yudao.module.product.convert.schedule.team.ScheduleTeamConvert;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.team.ScheduleTeamDO;
+import cn.iocoder.yudao.module.product.service.schedule.team.ScheduleTeamService;
+import io.swagger.v3.oas.annotations.Operation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import jakarta.annotation.Resource;
+import jakarta.validation.Valid;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
+
+
+@Tag(name = "管理后台 - 排班班组")
+@RestController
+@RequestMapping("/mes/schedule-team")
+@Validated
+public class ScheduleTeamController implements BusinessControllerMarker {
+
+
+ @Resource
+ private ScheduleTeamService scheduleTeamService;
+
+ @GetMapping("/get")
+ @Operation(summary = "获得排班班组")
+ @Parameter(name = "id", description = "编号", required = true, example = "1024")
+ @PreAuthorize("@ss.hasPermission('mes:schedule-team:query')")
+ public CommonResult getScheduleTeam(@RequestParam("id") Long id) {
+ ScheduleTeamDO scheduleTeam = scheduleTeamService.getScheduleTeam(id);
+ return success(ScheduleTeamConvert.INSTANCE.convert(scheduleTeam));
+ }
+
+ @GetMapping("/page")
+ @Operation(summary = "获得排班班组分页")
+ @PreAuthorize("@ss.hasPermission('mes:schedule-team:query')")
+ public CommonResult> getScheduleTeamPage(@Valid ScheduleTeamPageReqVO pageReqVO) {
+ PageResult pageResult = scheduleTeamService.getScheduleTeamPage(pageReqVO);
+ return success(ScheduleTeamConvert.INSTANCE.convertPage(pageResult));
+ }
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/vo/ScheduleTeamCreateReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/vo/ScheduleTeamCreateReqVO.java
new file mode 100644
index 00000000..ec159232
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/vo/ScheduleTeamCreateReqVO.java
@@ -0,0 +1,18 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 排班班组新增 Request VO")
+@Data
+public class ScheduleTeamCreateReqVO{
+
+ @Schema(description = "班组名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "班组名称不能为空")
+ private String teamName;
+
+ @Schema(description = "班组用户", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "班组用户不能为空")
+ private String userId;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/vo/ScheduleTeamPageReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/vo/ScheduleTeamPageReqVO.java
new file mode 100644
index 00000000..39c6ca45
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/vo/ScheduleTeamPageReqVO.java
@@ -0,0 +1,13 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo;
+
+import cn.iocoder.yudao.framework.common.pojo.PageParam;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 排班班组分页 Request VO")
+@Data
+public class ScheduleTeamPageReqVO extends PageParam {
+
+ @Schema(description = "班组配置id")
+ private Long scheduleConfigId;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/vo/ScheduleTeamRespVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/vo/ScheduleTeamRespVO.java
new file mode 100644
index 00000000..bf9754a4
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/vo/ScheduleTeamRespVO.java
@@ -0,0 +1,24 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.Data;
+
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 排班班组 Response VO")
+@Data
+public class ScheduleTeamRespVO {
+
+ @Schema(description = "主键")
+ private Long id;
+
+ @Schema(description = "班组名称")
+ private String teamName;
+
+ @Schema(description = "班组用户")
+ private String userId;
+
+ @Schema(description = "创建时间")
+ private LocalDateTime createTime;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/vo/ScheduleTeamUpdateReqVO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/vo/ScheduleTeamUpdateReqVO.java
new file mode 100644
index 00000000..d13319ee
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/controller/admin/schedule/team/vo/ScheduleTeamUpdateReqVO.java
@@ -0,0 +1,20 @@
+package cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import jakarta.validation.constraints.NotBlank;
+import lombok.Data;
+
+@Schema(description = "管理后台 - 排班班组修改 Request VO")
+@Data
+public class ScheduleTeamUpdateReqVO {
+ @Schema(description = "排班班组主键,修改的项目赋值,新建的项目不赋值")
+ private Long id;
+
+ @Schema(description = "班组名称", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "班组名称不能为空")
+ private String teamName;
+
+ @Schema(description = "班组用户", requiredMode = Schema.RequiredMode.REQUIRED)
+ @NotBlank(message = "班组用户不能为空")
+ private String userId;
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/factory/model/FactoryModelConvert.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/factory/model/FactoryModelConvert.java
new file mode 100644
index 00000000..0275aec1
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/factory/model/FactoryModelConvert.java
@@ -0,0 +1,26 @@
+package cn.iocoder.yudao.module.product.convert.factory.model;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.product.controller.admin.factory.model.vo.FactoryModeTreeRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.factory.model.vo.FactoryModelCreateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.factory.model.vo.FactoryModelRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.factory.model.vo.FactoryModelUpdateReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.factory.model.FactoryModelDO;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+import java.util.List;
+
+/**
+ * 工厂模型 Convert
+ */
+@Mapper
+public interface FactoryModelConvert {
+ FactoryModelConvert INSTANCE = Mappers.getMapper(FactoryModelConvert.class);
+
+ FactoryModelDO convert(FactoryModelCreateReqVO bean);
+ FactoryModelDO convert(FactoryModelUpdateReqVO bean);
+ FactoryModelRespVO convert(FactoryModelDO bean);
+ List convertList(List beans);
+ PageResult convertPage(PageResult page);
+}
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/config/ScheduleConfigConvert.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/config/ScheduleConfigConvert.java
new file mode 100644
index 00000000..3448920a
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/config/ScheduleConfigConvert.java
@@ -0,0 +1,19 @@
+package cn.iocoder.yudao.module.product.convert.schedule.config;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo.ScheduleConfigCreateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo.ScheduleConfigRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo.ScheduleConfigUpdateReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.config.ScheduleConfigDO;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+@Mapper
+public interface ScheduleConfigConvert {
+ ScheduleConfigConvert INSTANCE = Mappers.getMapper(ScheduleConfigConvert.class);
+
+ ScheduleConfigDO convert(ScheduleConfigCreateReqVO bean);
+ ScheduleConfigDO convert(ScheduleConfigUpdateReqVO bean);
+ ScheduleConfigRespVO convert(ScheduleConfigDO bean);
+ PageResult convertPage(PageResult page);
+}
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/data/ScheduleDataConvert.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/data/ScheduleDataConvert.java
new file mode 100644
index 00000000..755704b3
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/data/ScheduleDataConvert.java
@@ -0,0 +1,21 @@
+package cn.iocoder.yudao.module.product.convert.schedule.data;
+
+import cn.iocoder.yudao.module.product.controller.admin.schedule.data.vo.ScheduleDataRespVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.data.ScheduleDataDO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.rule.ScheduleRuleDO;
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.factory.Mappers;
+
+import java.util.List;
+
+@Mapper
+public interface ScheduleDataConvert {
+ ScheduleDataConvert INSTANCE = Mappers.getMapper(ScheduleDataConvert.class);
+
+ ScheduleDataRespVO convert(ScheduleDataDO bean);
+ @Mapping(target="id", ignore = true)
+ ScheduleDataDO convert(ScheduleRuleDO bean);
+ List convertList(List beans);
+ List convertListByRule(List beans);
+}
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/rule/ScheduleRuleConvert.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/rule/ScheduleRuleConvert.java
new file mode 100644
index 00000000..1e6efd83
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/rule/ScheduleRuleConvert.java
@@ -0,0 +1,19 @@
+package cn.iocoder.yudao.module.product.convert.schedule.rule;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo.ScheduleRuleCreateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo.ScheduleRuleRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo.ScheduleRuleUpdateReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.rule.ScheduleRuleDO;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+@Mapper
+public interface ScheduleRuleConvert {
+ ScheduleRuleConvert INSTANCE = Mappers.getMapper(ScheduleRuleConvert.class);
+
+ ScheduleRuleDO convert(ScheduleRuleCreateReqVO bean);
+ ScheduleRuleDO convert(ScheduleRuleUpdateReqVO bean);
+ ScheduleRuleRespVO convert(ScheduleRuleDO bean);
+ PageResult convertPage(PageResult page);
+}
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/shift/ScheduleShiftConvert.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/shift/ScheduleShiftConvert.java
new file mode 100644
index 00000000..39b42cee
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/shift/ScheduleShiftConvert.java
@@ -0,0 +1,24 @@
+package cn.iocoder.yudao.module.product.convert.schedule.shift;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo.ScheduleShiftCreateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo.ScheduleShiftRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo.ScheduleShiftUpdateReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.shift.ScheduleShiftDO;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+import java.util.List;
+
+@Mapper
+public interface ScheduleShiftConvert {
+
+ ScheduleShiftConvert INSTANCE = Mappers.getMapper(ScheduleShiftConvert.class);
+
+ ScheduleShiftDO convert(ScheduleShiftCreateReqVO bean);
+ ScheduleShiftDO convert(ScheduleShiftUpdateReqVO bean);
+ ScheduleShiftRespVO convert(ScheduleShiftDO bean);
+ List convertListByCreateReqVO(List beans);
+ List convertListByUpdateReqVO(List beans);
+ PageResult convertPage(PageResult page);
+}
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/team/ScheduleTeamConvert.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/team/ScheduleTeamConvert.java
new file mode 100644
index 00000000..74cf3020
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/convert/schedule/team/ScheduleTeamConvert.java
@@ -0,0 +1,29 @@
+package cn.iocoder.yudao.module.product.convert.schedule.team;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo.ScheduleTeamCreateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo.ScheduleTeamRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo.ScheduleTeamUpdateReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.team.ScheduleTeamDO;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+import java.util.List;
+
+@Mapper
+public interface ScheduleTeamConvert {
+
+ ScheduleTeamConvert INSTANCE = Mappers.getMapper(ScheduleTeamConvert.class);
+
+ ScheduleTeamDO convert(ScheduleTeamCreateReqVO bean);
+
+ ScheduleTeamDO convert(ScheduleTeamUpdateReqVO bean);
+
+ ScheduleTeamRespVO convert(ScheduleTeamDO bean);
+
+ List convertListByCreateReqVO(List beans);
+ List convertListByUpdateReqVO(List beans);
+
+ PageResult convertPage(PageResult page);
+
+}
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/factory/model/FactoryModelDO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/factory/model/FactoryModelDO.java
new file mode 100644
index 00000000..5d70bd54
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/factory/model/FactoryModelDO.java
@@ -0,0 +1,83 @@
+package cn.iocoder.yudao.module.product.dal.dataobject.factory.model;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+/**
+ * 工厂模型 DO
+ *
+ * @author 后台管理
+ */
+@TableName("MES_FACT_MDL")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+/**
+ * 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
+ */
+public class FactoryModelDO extends BusinessBaseDO {
+
+ /**
+ * 主键
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ private Long id;
+ /**
+ * 父级id
+ */
+ @TableField("PRN_ID")
+ private Long parentId;
+ /**
+ * 父级编码
+ */
+ @TableField("PRN_CDG")
+ private String parentCoding;
+ /**
+ * 节点编码
+ */
+ @TableField("NDE_CDG")
+ private String nodeCoding;
+ /**
+ * 节点名称
+ */
+ @TableField("NDE_NAME")
+ private String nodeName;
+ /**
+ * 节点类型
+ */
+ @TableField("NDE_TP")
+ private String nodeType;
+ /**
+ * 排序
+ */
+ @TableField("SRT")
+ private Integer sort;
+ /**
+ * ERP工艺路线编码
+ */
+ @TableField("ERP_PRCS_RUT_CDG")
+ private String erpProcessRouteCoding;
+ /**
+ * ERP工序编码
+ */
+ @TableField("ERP_PRCS_CDG")
+ private String erpProcessCoding;
+ /**
+ * ERP工序名称
+ */
+ @TableField("ERP_PRCS_NAME")
+ private String erpProcessName;
+ /**
+ * 状态
+ */
+ @TableField("NDE_STS")
+ private String nodeStatus;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/plan/template/PlanTemplateDO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/plan/template/PlanTemplateDO.java
new file mode 100644
index 00000000..85b740b4
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/plan/template/PlanTemplateDO.java
@@ -0,0 +1,67 @@
+package cn.iocoder.yudao.module.product.dal.dataobject.plan.template;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.*;
+/**
+* 生产计划模板 DO
+*
+* @author 后台管理
+*/
+@TableName("mes_pln_tmpl")
+@KeySequence("mes_pln_tmpl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+/**
+* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
+*/
+public class PlanTemplateDO extends BusinessBaseDO {
+
+
+
+ /**
+ * 主键
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ private Long id;
+ /**
+ * 模板编码
+ */
+ @TableField("TMPL_CDG")
+ private String templateCoding;
+ /**
+ * 模板名称
+ */
+ @TableField("TMPL_NAME")
+ private String templateName;
+ /**
+ * 模板类型
+ */
+ @TableField("PLN_TP")
+ private String planType;
+ /**
+ * 公司编码
+ */
+ @TableField("BLG_CPN_CDG")
+ private String belongCompanyCoding;
+ /**
+ * 公司名称
+ */
+ @TableField("BLG_CPN_NAME")
+ private String belongCompanyName;
+ /**
+ * 版本
+ */
+ @TableField("TMPL_VER")
+ private Integer templateVersion;
+ /**
+ * 状态
+ */
+ @TableField("TMPL_STS")
+ private String templateStatus;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/plan/templatecolumn/PlanTemplateColumnDO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/plan/templatecolumn/PlanTemplateColumnDO.java
new file mode 100644
index 00000000..cc348291
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/plan/templatecolumn/PlanTemplateColumnDO.java
@@ -0,0 +1,52 @@
+package cn.iocoder.yudao.module.product.dal.dataobject.plan.templatecolumn;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.*;
+/**
+* 生产计划模板动态列 DO
+*
+* @author 后台管理
+*/
+@TableName("mes_pln_tmpl_coln")
+@KeySequence("mes_pln_tmpl_coln_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+/**
+* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
+*/
+public class PlanTemplateColumnDO extends BusinessBaseDO {
+
+
+
+ /**
+ * 主键
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ private Long id;
+ /**
+ * 模板id
+ */
+ @TableField("PLN_TMPL_ID")
+ private Long planTemplateId;
+ /**
+ * 模板编码
+ */
+ @TableField("PLN_TMPL_CDG")
+ private String planTemplateCoding;
+ /**
+ * 列编码
+ */
+ @TableField("COLN_CDG")
+ private String columnCoding;
+ /**
+ * 列名称
+ */
+ @TableField("COLN_NAME")
+ private String columnName;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/plan/templatecolumndata/PlanTemplateColumnDataDO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/plan/templatecolumndata/PlanTemplateColumnDataDO.java
new file mode 100644
index 00000000..4a3d40b7
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/plan/templatecolumndata/PlanTemplateColumnDataDO.java
@@ -0,0 +1,57 @@
+package cn.iocoder.yudao.module.product.dal.dataobject.plan.templatecolumndata;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.*;
+/**
+* 生产计划模板动态列数据 DO
+*
+* @author 后台管理
+*/
+@TableName("mes_pln_tmpl_coln_dat")
+@KeySequence("mes_pln_tmpl_coln_dat_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+/**
+* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
+*/
+public class PlanTemplateColumnDataDO extends BusinessBaseDO {
+
+
+
+ /**
+ * 主键
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ private Long id;
+ /**
+ * 模板id
+ */
+ @TableField("PLN_TMPL_ID")
+ private Long planTemplateId;
+ /**
+ * 模板动态列id
+ */
+ @TableField("PLN_TMPL_COLN_ID")
+ private Long planTemplateColumnId;
+ /**
+ * 模板明细id
+ */
+ @TableField("PLN_TMPL_ITM_ID")
+ private Long planTemplateItemId;
+ /**
+ * 动态列编码
+ */
+ @TableField("COLN_CDG")
+ private String columnCoding;
+ /**
+ * 动态列值
+ */
+ @TableField("COLN_VAL")
+ private String columnValue;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/plan/templateitem/PlanTemplateItemDO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/plan/templateitem/PlanTemplateItemDO.java
new file mode 100644
index 00000000..5d2c5d1f
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/plan/templateitem/PlanTemplateItemDO.java
@@ -0,0 +1,82 @@
+package cn.iocoder.yudao.module.product.dal.dataobject.plan.templateitem;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
+import com.baomidou.mybatisplus.annotation.*;
+import lombok.*;
+/**
+* 生产计划模板项目 DO
+*
+* @author 后台管理
+*/
+@TableName("mes_pln_tmpl_itm")
+@KeySequence("mes_pln_tmpl_itm_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+/**
+* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
+*/
+public class PlanTemplateItemDO extends BusinessBaseDO {
+
+
+
+ /**
+ * 主键
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ private Long id;
+ /**
+ * 模板id
+ */
+ @TableField("PLN_TMPL_ID")
+ private Long planTemplateId;
+ /**
+ * 模板编码
+ */
+ @TableField("PLN_TMPL_CDG")
+ private String planTemplateCoding;
+ /**
+ * 计量单位
+ */
+ @TableField("UNT")
+ private String unit;
+ /**
+ * 是否生成订单
+ */
+ @TableField("GEN_ORD")
+ private String generateOrder;
+ /**
+ * 录入方式
+ */
+ @TableField("WR_TP")
+ private String writeType;
+ /**
+ * 物料编码
+ */
+ @TableField("MTRL_CDG")
+ private String materialCoding;
+ /**
+ * 物料名称
+ */
+ @TableField("MTRL_NAME")
+ private String materialName;
+ /**
+ * 指标id
+ */
+ @TableField("IND_ID")
+ private Long indicatorId;
+ /**
+ * 指标编码
+ */
+ @TableField("IND_CDG")
+ private String indicatorCoding;
+ /**
+ * 所属公司
+ */
+ @TableField("BLG_CPN_CDG")
+ private String belongCompanyCoding;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/config/ScheduleConfigDO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/config/ScheduleConfigDO.java
new file mode 100644
index 00000000..02aed48c
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/config/ScheduleConfigDO.java
@@ -0,0 +1,55 @@
+package cn.iocoder.yudao.module.product.dal.dataobject.schedule.config;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+/**
+* 排班配置 DO
+*
+* @author 后台管理
+*/
+@TableName("mes_schd_cfg")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+/**
+* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
+*/
+public class ScheduleConfigDO extends BusinessBaseDO {
+
+
+
+ /**
+ * 主键
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ private Long id;
+ /**
+ * 工厂模型id
+ */
+ @TableField("FACT_MDL_ID")
+ private Long factoryModelId;
+ /**
+ * 工厂模型编码
+ */
+ @TableField("FACT_MDL_CDG")
+ private String factoryModelCoding;
+ /**
+ * 排班编码
+ */
+ @TableField("CFG_CDG")
+ private String configCoding;
+ /**
+ * 排班名称
+ */
+ @TableField("CFG_NAME")
+ private String configName;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/data/ScheduleDataDO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/data/ScheduleDataDO.java
new file mode 100644
index 00000000..447d2227
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/data/ScheduleDataDO.java
@@ -0,0 +1,62 @@
+package cn.iocoder.yudao.module.product.dal.dataobject.schedule.data;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+import java.time.LocalDate;
+
+/**
+* 排班数据 DO
+*
+* @author 后台管理
+*/
+@TableName("mes_schd_dat")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+/**
+* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
+*/
+public class ScheduleDataDO extends BusinessBaseDO {
+
+
+
+ /**
+ * 主键
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ private Long id;
+ /**
+ * 班组配置id
+ */
+ @TableField("SCHD_CFG_ID")
+ private Long scheduleConfigId;
+ /**
+ * 班组配置编码
+ */
+ @TableField("SCHD_CFG_CDG")
+ private String scheduleConfigCoding;
+ /**
+ * 排班日期
+ */
+ @TableField("SCHD_DT")
+ private LocalDate scheduleDate;
+ /**
+ * 班次id
+ */
+ @TableField("SCHD_SHFT_ID")
+ private Long scheduleShiftId;
+ /**
+ * 班组id
+ */
+ @TableField("SCHD_TAM_ID")
+ private Long scheduleTeamId;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/rule/ScheduleRuleDO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/rule/ScheduleRuleDO.java
new file mode 100644
index 00000000..b26e867c
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/rule/ScheduleRuleDO.java
@@ -0,0 +1,60 @@
+package cn.iocoder.yudao.module.product.dal.dataobject.schedule.rule;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+import java.time.LocalDate;
+
+/**
+ * 排班规则 DO
+ *
+ * @author 后台管理
+ */
+@TableName("mes_schd_rul")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+/**
+ * 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
+ */
+public class ScheduleRuleDO extends BusinessBaseDO {
+
+ /**
+ * 主键
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ private Long id;
+ /**
+ * 班组配置id
+ */
+ @TableField("SCHD_CFG_ID")
+ private Long scheduleConfigId;
+ /**
+ * 班组配置编码
+ */
+ @TableField("SCHD_CFG_CDG")
+ private String scheduleConfigCoding;
+ /**
+ * 排班日期
+ */
+ @TableField("SCHD_DT")
+ private LocalDate scheduleDate;
+ /**
+ * 班次id
+ */
+ @TableField("SCHD_SHFT_ID")
+ private Long scheduleShiftId;
+ /**
+ * 班组id
+ */
+ @TableField("SCHD_TAM_ID")
+ private Long scheduleTeamId;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/shift/ScheduleShiftDO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/shift/ScheduleShiftDO.java
new file mode 100644
index 00000000..b644db4b
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/shift/ScheduleShiftDO.java
@@ -0,0 +1,67 @@
+package cn.iocoder.yudao.module.product.dal.dataobject.schedule.shift;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+import java.time.LocalTime;
+
+/**
+* 排班班次 DO
+*
+* @author 后台管理
+*/
+@TableName("mes_schd_shft")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+/**
+* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
+*/
+public class ScheduleShiftDO extends BusinessBaseDO {
+
+
+
+ /**
+ * 主键
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ private Long id;
+ /**
+ * 班组配置id
+ */
+ @TableField("SCHD_CFG_ID")
+ private Long scheduleConfigId;
+ /**
+ * 班组配置编码
+ */
+ @TableField("SCHD_CFG_CDG")
+ private String scheduleConfigCoding;
+ /**
+ * 班次名称
+ */
+ @TableField("SHFT_NAME")
+ private String shiftName;
+ /**
+ * 开始时间
+ */
+ @TableField("BGN_TM")
+ private LocalTime beginTime;
+ /**
+ * 结束时间
+ */
+ @TableField("END_TM")
+ private LocalTime endTime;
+ /**
+ * 是否跨天
+ */
+ @TableField("CRS_DY")
+ private String crossDay;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/team/ScheduleTeamDO.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/team/ScheduleTeamDO.java
new file mode 100644
index 00000000..97b31a17
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/dataobject/schedule/team/ScheduleTeamDO.java
@@ -0,0 +1,53 @@
+package cn.iocoder.yudao.module.product.dal.dataobject.schedule.team;
+
+import cn.iocoder.yudao.framework.mybatis.core.dataobject.BusinessBaseDO;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.*;
+
+/**
+ * 排班班组 DO
+ *
+ * @author 后台管理
+ */
+@TableName("mes_schd_tam")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+/**
+ * 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
+ */
+public class ScheduleTeamDO extends BusinessBaseDO {
+
+ /**
+ * 主键
+ */
+ @TableId(type = IdType.ASSIGN_ID)
+ private Long id;
+ /**
+ * 班组配置id
+ */
+ @TableField("SCHD_CFG_ID")
+ private Long scheduleConfigId;
+ /**
+ * 班组配置编码
+ */
+ @TableField("SCHD_CFG_CDG")
+ private String scheduleConfigCoding;
+ /**
+ * 班组名称
+ */
+ @TableField("TAM_NAME")
+ private String teamName;
+ /**
+ * 班组用户
+ */
+ @TableField("USER_ID")
+ private String userId;
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/factory/model/FactoryModelMapper.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/factory/model/FactoryModelMapper.java
new file mode 100644
index 00000000..f30f4905
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/factory/model/FactoryModelMapper.java
@@ -0,0 +1,30 @@
+package cn.iocoder.yudao.module.product.dal.mysql.factory.model;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.product.controller.admin.factory.model.vo.FactoryModelPageReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.factory.model.FactoryModelDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 工厂模型 Mapper
+ *
+ * @author 后台管理
+ */
+@Mapper
+public interface FactoryModelMapper extends BaseMapperX {
+
+ default PageResult selectPage(FactoryModelPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .eqIfPresent(FactoryModelDO::getParentId, reqVO.getParentId())
+ .likeIfPresent(FactoryModelDO::getNodeCoding, reqVO.getNodeCoding())
+ .likeIfPresent(FactoryModelDO::getNodeName, reqVO.getNodeName())
+ .eqIfPresent(FactoryModelDO::getNodeType, reqVO.getNodeType())
+ .likeIfPresent(FactoryModelDO::getErpProcessCoding, reqVO.getErpProcessCoding())
+ .likeIfPresent(FactoryModelDO::getErpProcessName, reqVO.getErpProcessName())
+ .orderByAsc(FactoryModelDO::getSort)
+ );
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/plan/template/PlanTemplateMapper.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/plan/template/PlanTemplateMapper.java
new file mode 100644
index 00000000..9606e183
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/plan/template/PlanTemplateMapper.java
@@ -0,0 +1,33 @@
+package cn.iocoder.yudao.module.product.dal.mysql.plan.template;
+
+import java.util.*;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.template.PlanTemplateDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.iocoder.yudao.module.product.controller.admin.plan.template.vo.*;
+
+/**
+ * 生产计划模板 Mapper
+ *
+ * @author 后台管理
+ */
+@Mapper
+public interface PlanTemplateMapper extends BaseMapperX {
+
+ default PageResult selectPage(PlanTemplatePageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .eqIfPresent(PlanTemplateDO::getTemplateCoding, reqVO.getTemplateCoding())
+ .likeIfPresent(PlanTemplateDO::getTemplateName, reqVO.getTemplateName())
+ .eqIfPresent(PlanTemplateDO::getPlanType, reqVO.getPlanType())
+ .eqIfPresent(PlanTemplateDO::getBelongCompanyCoding, reqVO.getBelongCompanyCoding())
+ .likeIfPresent(PlanTemplateDO::getBelongCompanyName, reqVO.getBelongCompanyName())
+ .eqIfPresent(PlanTemplateDO::getTemplateVersion, reqVO.getTemplateVersion())
+ .eqIfPresent(PlanTemplateDO::getTemplateStatus, reqVO.getTemplateStatus())
+ .betweenIfPresent(PlanTemplateDO::getCreateTime, reqVO.getCreateTime())
+ .orderByDesc(PlanTemplateDO::getId));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/plan/templatecolumn/PlanTemplateColumnMapper.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/plan/templatecolumn/PlanTemplateColumnMapper.java
new file mode 100644
index 00000000..29e0de90
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/plan/templatecolumn/PlanTemplateColumnMapper.java
@@ -0,0 +1,41 @@
+package cn.iocoder.yudao.module.product.dal.mysql.plan.templatecolumn;
+
+import java.util.*;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templatecolumn.PlanTemplateColumnDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn.vo.*;
+
+/**
+ * 生产计划模板动态列 Mapper
+ *
+ * @author 后台管理
+ */
+@Mapper
+public interface PlanTemplateColumnMapper extends BaseMapperX {
+
+ default PageResult selectPage(PlanTemplateColumnPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .eqIfPresent(PlanTemplateColumnDO::getPlanTemplateId, reqVO.getPlanTemplateId())
+ .orderByDesc(PlanTemplateColumnDO::getId));
+ }
+
+ default void deleteByTemplateId(Long templateId) {
+ delete(new LambdaQueryWrapperX()
+ .eq(PlanTemplateColumnDO::getPlanTemplateId, templateId));
+ }
+
+ default void deleteByTemplateIds(List templateIds) {
+ delete(new LambdaQueryWrapperX()
+ .in(PlanTemplateColumnDO::getPlanTemplateId, templateIds));
+ }
+
+ default List selectByTemplateId(Long templateId) {
+ return selectList(new LambdaQueryWrapperX()
+ .eq(PlanTemplateColumnDO::getPlanTemplateId, templateId));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/plan/templatecolumndata/PlanTemplateColumnDataMapper.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/plan/templatecolumndata/PlanTemplateColumnDataMapper.java
new file mode 100644
index 00000000..1d935fa9
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/plan/templatecolumndata/PlanTemplateColumnDataMapper.java
@@ -0,0 +1,62 @@
+package cn.iocoder.yudao.module.product.dal.mysql.plan.templatecolumndata;
+
+import java.util.*;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templatecolumndata.PlanTemplateColumnDataDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo.*;
+
+/**
+ * 生产计划模板动态列数据 Mapper
+ *
+ * @author 后台管理
+ */
+@Mapper
+public interface PlanTemplateColumnDataMapper extends BaseMapperX {
+
+ default PageResult selectPage(PlanTemplateColumnDataPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .eqIfPresent(PlanTemplateColumnDataDO::getPlanTemplateColumnId, reqVO.getPlanTemplateColumnId())
+ .eqIfPresent(PlanTemplateColumnDataDO::getPlanTemplateItemId, reqVO.getPlanTemplateItemId())
+ .orderByDesc(PlanTemplateColumnDataDO::getId));
+ }
+
+ default void deleteByTemplateId(Long templateId) {
+ delete(new LambdaQueryWrapperX()
+ .eq(PlanTemplateColumnDataDO::getPlanTemplateId, templateId));
+ }
+
+ default void deleteByTemplateIds(List templateIds) {
+ delete(new LambdaQueryWrapperX()
+ .in(PlanTemplateColumnDataDO::getPlanTemplateId, templateIds));
+ }
+
+ default void deleteByTemplateColumnId(Long templateColumnId) {
+ delete(new LambdaQueryWrapperX()
+ .eq(PlanTemplateColumnDataDO::getPlanTemplateId, templateColumnId));
+ }
+
+ default void deleteByTemplateColumnIds(List templateColumnIds) {
+ delete(new LambdaQueryWrapperX()
+ .in(PlanTemplateColumnDataDO::getPlanTemplateColumnId, templateColumnIds));
+ }
+
+ default void deleteByTemplateItemId(Long templateItemId) {
+ delete(new LambdaQueryWrapperX()
+ .eq(PlanTemplateColumnDataDO::getPlanTemplateItemId, templateItemId));
+ }
+
+ default void deleteByTemplateItemIds(List templateItemIds) {
+ delete(new LambdaQueryWrapperX()
+ .in(PlanTemplateColumnDataDO::getPlanTemplateItemId, templateItemIds));
+ }
+
+ default List selectByTemplateId(Long templateId) {
+ return selectList(new LambdaQueryWrapperX()
+ .eq(PlanTemplateColumnDataDO::getPlanTemplateId, templateId));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/plan/templateitem/PlanTemplateItemMapper.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/plan/templateitem/PlanTemplateItemMapper.java
new file mode 100644
index 00000000..8a87d27f
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/plan/templateitem/PlanTemplateItemMapper.java
@@ -0,0 +1,41 @@
+package cn.iocoder.yudao.module.product.dal.mysql.plan.templateitem;
+
+import java.util.*;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templateitem.PlanTemplateItemDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templateitem.vo.*;
+
+/**
+ * 生产计划模板项目 Mapper
+ *
+ * @author 后台管理
+ */
+@Mapper
+public interface PlanTemplateItemMapper extends BaseMapperX {
+
+ default PageResult selectPage(PlanTemplateItemPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .eqIfPresent(PlanTemplateItemDO::getPlanTemplateId, reqVO.getPlanTemplateId())
+ .orderByDesc(PlanTemplateItemDO::getId));
+ }
+
+ default void deleteByTemplateId(Long templateId){
+ delete(new LambdaQueryWrapperX()
+ .eq(PlanTemplateItemDO::getPlanTemplateId, templateId));
+ }
+
+ default void deleteByTemplateIds(List templateIds){
+ delete(new LambdaQueryWrapperX()
+ .in(PlanTemplateItemDO::getPlanTemplateId, templateIds));
+ }
+
+ default List selectByTemplateId(Long templateId) {
+ return selectList(new LambdaQueryWrapperX()
+ .eq(PlanTemplateItemDO::getPlanTemplateId, templateId));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/config/ScheduleConfigMapper.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/config/ScheduleConfigMapper.java
new file mode 100644
index 00000000..6dacddd6
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/config/ScheduleConfigMapper.java
@@ -0,0 +1,27 @@
+package cn.iocoder.yudao.module.product.dal.mysql.schedule.config;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo.ScheduleConfigPageReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.config.ScheduleConfigDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 排班配置 Mapper
+ *
+ * @author 后台管理
+ */
+@Mapper
+public interface ScheduleConfigMapper extends BaseMapperX {
+
+ default PageResult selectPage(ScheduleConfigPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .eqIfPresent(ScheduleConfigDO::getFactoryModelId, reqVO.getFactoryModelId())
+ .likeIfPresent(ScheduleConfigDO::getFactoryModelCoding, reqVO.getFactoryModelCoding())
+ .likeIfPresent(ScheduleConfigDO::getConfigCoding, reqVO.getConfigCoding())
+ .likeIfPresent(ScheduleConfigDO::getConfigName, reqVO.getConfigName())
+ .orderByDesc(ScheduleConfigDO::getId));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/data/ScheduleDataMapper.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/data/ScheduleDataMapper.java
new file mode 100644
index 00000000..aa254b34
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/data/ScheduleDataMapper.java
@@ -0,0 +1,16 @@
+package cn.iocoder.yudao.module.product.dal.mysql.schedule.data;
+
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.data.ScheduleDataDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 排班数据 Mapper
+ *
+ * @author 后台管理
+ */
+@Mapper
+public interface ScheduleDataMapper extends BaseMapperX {
+
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/rule/ScheduleRuleMapper.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/rule/ScheduleRuleMapper.java
new file mode 100644
index 00000000..fabc3787
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/rule/ScheduleRuleMapper.java
@@ -0,0 +1,24 @@
+package cn.iocoder.yudao.module.product.dal.mysql.schedule.rule;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo.ScheduleRulePageReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.rule.ScheduleRuleDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 排班规则 Mapper
+ *
+ * @author 后台管理
+ */
+@Mapper
+public interface ScheduleRuleMapper extends BaseMapperX {
+
+ default PageResult selectPage(ScheduleRulePageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .eqIfPresent(ScheduleRuleDO::getScheduleConfigId, reqVO.getScheduleConfigId())
+ .orderByAsc(ScheduleRuleDO::getId));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/shift/ScheduleShiftMapper.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/shift/ScheduleShiftMapper.java
new file mode 100644
index 00000000..50bb8340
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/shift/ScheduleShiftMapper.java
@@ -0,0 +1,24 @@
+package cn.iocoder.yudao.module.product.dal.mysql.schedule.shift;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo.ScheduleShiftPageReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.shift.ScheduleShiftDO;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 排班班次 Mapper
+ *
+ * @author 后台管理
+ */
+@Mapper
+public interface ScheduleShiftMapper extends BaseMapperX {
+
+ default PageResult selectPage(ScheduleShiftPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .eqIfPresent(ScheduleShiftDO::getScheduleConfigId, reqVO.getScheduleConfigId())
+ .orderByAsc(ScheduleShiftDO::getId));
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/team/ScheduleTeamMapper.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/team/ScheduleTeamMapper.java
new file mode 100644
index 00000000..b68d9f7b
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/dal/mysql/schedule/team/ScheduleTeamMapper.java
@@ -0,0 +1,24 @@
+package cn.iocoder.yudao.module.product.dal.mysql.schedule.team;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo.ScheduleTeamPageReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.team.ScheduleTeamDO;
+import org.apache.ibatis.annotations.Mapper;
+
+
+/**
+ * 排班班组 Mapper
+ *
+ * @author 后台管理
+ */
+@Mapper
+public interface ScheduleTeamMapper extends BaseMapperX {
+
+ default PageResult selectPage(ScheduleTeamPageReqVO reqVO) {
+ return selectPage(reqVO, new LambdaQueryWrapperX()
+ .eqIfPresent(ScheduleTeamDO::getScheduleConfigId, reqVO.getScheduleConfigId())
+ .orderByAsc(ScheduleTeamDO::getId));
+ }
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/framework/security/config/SecurityConfiguration.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/framework/security/config/SecurityConfiguration.java
index fdce2d09..4abc6552 100644
--- a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/framework/security/config/SecurityConfiguration.java
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/framework/security/config/SecurityConfiguration.java
@@ -13,7 +13,7 @@ import org.springframework.security.config.annotation.web.configurers.AuthorizeH
*
* @author ZT
*/
-@Configuration(proxyBeanMethods = false)
+@Configuration("productSecurityConfiguration")
public class SecurityConfiguration {
@Bean
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/factory/model/FactoryModelService.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/factory/model/FactoryModelService.java
new file mode 100644
index 00000000..12348a82
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/factory/model/FactoryModelService.java
@@ -0,0 +1,87 @@
+package cn.iocoder.yudao.module.product.service.factory.model;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+
+import cn.iocoder.yudao.module.product.controller.admin.factory.model.vo.*;
+import cn.iocoder.yudao.module.product.dal.dataobject.factory.model.FactoryModelDO;
+import jakarta.validation.Valid;
+
+import java.util.List;
+
+/**
+ * 工厂模型 Service 接口
+ *
+ * @author 后台管理
+ */
+public interface FactoryModelService {
+
+ /**
+ * 创建工厂模型
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ FactoryModelRespVO createFactoryModel(@Valid FactoryModelCreateReqVO createReqVO);
+
+ /**
+ * 更新工厂模型
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updateFactoryModel(@Valid FactoryModelUpdateReqVO updateReqVO);
+
+ /**
+ * 删除工厂模型
+ *
+ * @param id 编号
+ */
+ void deleteFactoryModel(Long id);
+
+ /**
+ * 批量删除工厂模型
+ *
+ * @param ids 编号
+ */
+ void deleteFactoryModelListByIds(List ids);
+
+ /**
+ * 获得工厂模型
+ *
+ * @param id 编号
+ * @return 工厂模型
+ */
+ FactoryModelDO getFactoryModel(Long id);
+
+ /**
+ * 获得工厂模型分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 工厂模型分页
+ */
+ PageResult getFactoryModelPage(FactoryModelPageReqVO pageReqVO);
+
+ /**
+ * 绑定ERP工序
+ * @param processBindReqVO 绑定信息
+ */
+ void processBind(@Valid FactoryModelProcessBindReqVO processBindReqVO);
+
+ /**
+ * 解绑ERP工序
+ * @param processUnbindReqVO 解绑信息
+ */
+ void processUnbind(@Valid FactoryModelProcessUnbindReqVO processUnbindReqVO);
+
+ /**
+ * 启/停用模型
+ * @param changeStatusReqVO
+ */
+ void changeStatus(@Valid FactoryModelChangeStatusReqVO changeStatusReqVO);
+
+ /**
+ * 获取工厂模型树节点数据
+ * @param parentId 父节点id
+ * @return
+ */
+ List tree(Long parentId);
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/factory/model/FactoryModelServiceImpl.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/factory/model/FactoryModelServiceImpl.java
new file mode 100644
index 00000000..d33d8a0c
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/factory/model/FactoryModelServiceImpl.java
@@ -0,0 +1,158 @@
+package cn.iocoder.yudao.module.product.service.factory.model;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+
+import cn.iocoder.yudao.module.product.controller.admin.factory.model.vo.*;
+import cn.iocoder.yudao.module.product.convert.factory.model.FactoryModelConvert;
+import cn.iocoder.yudao.module.product.dal.dataobject.factory.model.FactoryModelDO;
+import cn.iocoder.yudao.module.product.dal.mysql.factory.model.FactoryModelMapper;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import jakarta.annotation.Resource;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.*;
+
+
+/**
+ * 工厂模型 Service 实现类
+ *
+ * @author 后台管理
+ */
+@Service
+@Validated
+public class FactoryModelServiceImpl implements FactoryModelService {
+
+ @Resource
+ private FactoryModelMapper factoryModelMapper;
+
+ @Override
+ public FactoryModelRespVO createFactoryModel(FactoryModelCreateReqVO createReqVO) {
+ // 校验存在
+ validateFactoryModelNodeCodeUnique(null, createReqVO.getNodeCoding());
+ validateFactoryModelNodeNameUnique(null, createReqVO.getNodeName());
+
+ // 插入
+ FactoryModelDO factoryModel = FactoryModelConvert.INSTANCE.convert(createReqVO);
+ factoryModelMapper.insert(factoryModel);
+ // 返回
+ return FactoryModelConvert.INSTANCE.convert(factoryModel);
+ }
+
+ @Override
+ public void updateFactoryModel(FactoryModelUpdateReqVO updateReqVO) {
+ // 校验存在
+ validateFactoryModelExists(updateReqVO.getId());
+ validateFactoryModelNodeCodeUnique(updateReqVO.getId(), updateReqVO.getNodeCoding());
+ validateFactoryModelNodeNameUnique(updateReqVO.getId(), updateReqVO.getNodeName());
+
+ // 更新
+ FactoryModelDO updateObj = FactoryModelConvert.INSTANCE.convert(updateReqVO);
+ factoryModelMapper.updateById(updateObj);
+ }
+
+ @Override
+ public void deleteFactoryModel(Long id) {
+ // 校验存在
+ validateFactoryModelExists(id);
+ // 删除
+ factoryModelMapper.deleteById(id);
+ }
+
+ @Override
+ public void deleteFactoryModelListByIds(List ids) {
+ // 校验存在
+ validateFactoryModelExists(ids);
+ // 删除
+ factoryModelMapper.deleteByIds(ids);
+ }
+
+ @Override
+ public FactoryModelDO getFactoryModel(Long id) {
+ return factoryModelMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult getFactoryModelPage(FactoryModelPageReqVO pageReqVO) {
+ return factoryModelMapper.selectPage(pageReqVO);
+ }
+
+ @Override
+ public void processBind(FactoryModelProcessBindReqVO processBindReqVO) {
+ validateFactoryModelExists(processBindReqVO.getId());
+ FactoryModelDO factoryModel = factoryModelMapper.selectById(processBindReqVO.getId());
+ factoryModel.setErpProcessCoding(processBindReqVO.getErpProcessCoding());
+ factoryModel.setErpProcessName(processBindReqVO.getErpProcessName());
+ factoryModel.setErpProcessRouteCoding(processBindReqVO.getErpProcessRouteCoding());
+ factoryModelMapper.updateById(factoryModel);
+ }
+
+ @Override
+ public void processUnbind(FactoryModelProcessUnbindReqVO processUnbindReqVO) {
+ validateFactoryModelExists(processUnbindReqVO.getId());
+ FactoryModelDO factoryModel = factoryModelMapper.selectById(processUnbindReqVO.getId());
+ factoryModel.setErpProcessCoding("");
+ factoryModel.setErpProcessName("");
+ factoryModel.setErpProcessRouteCoding("");
+ factoryModelMapper.updateById(factoryModel);
+ }
+
+ @Override
+ public void changeStatus(FactoryModelChangeStatusReqVO changeStatusReqVO) {
+ validateFactoryModelExists(changeStatusReqVO.getId());
+ factoryModelMapper.update(new LambdaUpdateWrapper()
+ .eq(FactoryModelDO::getId, changeStatusReqVO.getId())
+ .set(FactoryModelDO::getNodeStatus, changeStatusReqVO.getNodeStatus())
+ );
+ }
+
+ @Override
+ public List tree(Long parentId) {
+ return factoryModelMapper.selectList(new LambdaQueryWrapperX()
+ .eq(FactoryModelDO::getParentId, parentId)
+ .orderByAsc(FactoryModelDO::getSort));
+ }
+
+
+ /**
+ * 校验节点编码
+ */
+ private void validateFactoryModelNodeCodeUnique(Long id, String nodeCoding) {
+ boolean exists = factoryModelMapper.exists(new LambdaQueryWrapperX()
+ .neIfPresent(FactoryModelDO::getId, id)
+ .eq(FactoryModelDO::getNodeCoding, nodeCoding));
+ if (exists) {
+ throw exception(FACTORY_MODEL_NODE_CODE_EXISTS);
+ }
+ }
+
+ /**
+ * 校验节点名称
+ */
+ private void validateFactoryModelNodeNameUnique(Long id, String nodeName) {
+ boolean exists = factoryModelMapper.exists(new LambdaQueryWrapperX()
+ .neIfPresent(FactoryModelDO::getId, id)
+ .eq(FactoryModelDO::getNodeName, nodeName));
+ if (exists) {
+ throw exception(FACTORY_MODEL_NODE_NAME_EXISTS);
+ }
+ }
+
+ private void validateFactoryModelExists(List ids) {
+ List list = factoryModelMapper.selectByIds(ids);
+ if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
+ throw exception(FACTORY_MODEL_NOT_EXISTS);
+ }
+ }
+
+ private void validateFactoryModelExists(Long id) {
+ if (factoryModelMapper.selectById(id) == null) {
+ throw exception(FACTORY_MODEL_NOT_EXISTS);
+ }
+ }
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/template/PlanTemplateService.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/template/PlanTemplateService.java
new file mode 100644
index 00000000..9c69c28b
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/template/PlanTemplateService.java
@@ -0,0 +1,70 @@
+package cn.iocoder.yudao.module.product.service.plan.template;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.product.controller.admin.plan.template.vo.PlanTemplateCopyReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.template.vo.PlanTemplatePageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.template.vo.PlanTemplateRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.template.vo.PlanTemplateSaveReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.template.PlanTemplateDO;
+import jakarta.validation.Valid;
+
+import java.util.List;
+
+/**
+ * 生产计划模板 Service 接口
+ *
+ * @author 后台管理
+ */
+public interface PlanTemplateService {
+
+ /**
+ * 创建生产计划模板
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ PlanTemplateRespVO createPlanTemplate(@Valid PlanTemplateSaveReqVO createReqVO);
+
+ /*
+ * 复制生产计划模板
+ * */
+ PlanTemplateRespVO copyPlanTemplate(@Valid PlanTemplateCopyReqVO copyReqVO);
+
+ /**
+ * 更新生产计划模板
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updatePlanTemplate(@Valid PlanTemplateSaveReqVO updateReqVO);
+
+ /**
+ * 删除生产计划模板
+ *
+ * @param id 编号
+ */
+ void deletePlanTemplate(Long id);
+
+ /**
+ * 批量删除生产计划模板
+ *
+ * @param ids 编号
+ */
+ void deletePlanTemplateListByIds(List ids);
+
+ /**
+ * 获得生产计划模板
+ *
+ * @param id 编号
+ * @return 生产计划模板
+ */
+ PlanTemplateDO getPlanTemplate(Long id);
+
+ /**
+ * 获得生产计划模板分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 生产计划模板分页
+ */
+ PageResult getPlanTemplatePage(PlanTemplatePageReqVO pageReqVO);
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/template/PlanTemplateServiceImpl.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/template/PlanTemplateServiceImpl.java
new file mode 100644
index 00000000..d40b1099
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/template/PlanTemplateServiceImpl.java
@@ -0,0 +1,196 @@
+package cn.iocoder.yudao.module.product.service.plan.template;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.iocoder.yudao.framework.common.exception.ServiceException;
+import cn.iocoder.yudao.framework.common.pojo.CommonResult;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.product.controller.admin.plan.template.vo.PlanTemplateCopyReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.template.vo.PlanTemplatePageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.template.vo.PlanTemplateRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.template.vo.PlanTemplateSaveReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.template.PlanTemplateDO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templatecolumn.PlanTemplateColumnDO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templatecolumndata.PlanTemplateColumnDataDO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templateitem.PlanTemplateItemDO;
+import cn.iocoder.yudao.module.product.dal.mysql.plan.template.PlanTemplateMapper;
+import cn.iocoder.yudao.module.product.enums.ErrorCodeConstants;
+import cn.iocoder.yudao.module.product.enums.PlanTemplateTypeEnums;
+import cn.iocoder.yudao.module.product.service.plan.templatecolumn.PlanTemplateColumnService;
+import cn.iocoder.yudao.module.product.service.plan.templatecolumndata.PlanTemplateColumnDataService;
+import cn.iocoder.yudao.module.product.service.plan.templateitem.PlanTemplateItemService;
+import cn.iocoder.yudao.module.system.api.sequence.SequenceApi;
+import jakarta.annotation.Resource;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+
+/**
+ * 生产计划模板 Service 实现类
+ *
+ * @author 后台管理
+ */
+@Service
+@Validated
+public class PlanTemplateServiceImpl implements PlanTemplateService {
+
+ @Resource
+ private PlanTemplateMapper planTemplateMapper;
+ @Resource
+ private PlanTemplateColumnService planTemplateColumnService;
+ @Resource
+ private PlanTemplateColumnDataService planTemplateColumnDataService;
+ @Resource
+ private PlanTemplateItemService planTemplateItemService;
+
+ @Resource
+ private SequenceApi sequenceApi;
+
+ @Override
+ public PlanTemplateRespVO createPlanTemplate(PlanTemplateSaveReqVO createReqVO) {
+ // 插入
+ PlanTemplateDO planTemplate = BeanUtils.toBean(createReqVO, PlanTemplateDO.class);
+ planTemplate.setId(null);
+ String coding = getCoding(planTemplate);
+ planTemplate.setTemplateCoding(coding);
+ planTemplateMapper.insert(planTemplate);
+ // 返回
+ return BeanUtils.toBean(planTemplate, PlanTemplateRespVO.class);
+ }
+
+ //生成编码
+ private String getCoding(PlanTemplateDO planTemplate){
+ String planType = planTemplate.getPlanType();
+ if (StringUtils.isBlank(planType)){
+ throw new ServiceException(ErrorCodeConstants.PLAN_TEMPLATE_PLAN_TYPE_IS_NULL);
+ }
+ String codeRule = PlanTemplateTypeEnums.getCodeRuleByType(planType);
+ if (StringUtils.isBlank(codeRule)){
+ throw new ServiceException(ErrorCodeConstants.PLAN_TEMPLATE_PLAN_TYPE_NOT_EXISTS);
+ }
+ try {
+ CommonResult nextSequence = sequenceApi.getNextSequence(codeRule, null, null);
+ if (nextSequence != null && nextSequence.getCode() != null && nextSequence.getCode() == 0){
+ return nextSequence.getData();
+ }else {
+ throw new ServiceException(ErrorCodeConstants.PLAN_TEMPLATE_PLAN_FAILED_TO_RETRIEVE_ENCODING);
+ }
+ }catch (Exception e){
+ throw new ServiceException(ErrorCodeConstants.CODE_GENERATION_SERVICE_CALL_FAILED);
+ }
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public PlanTemplateRespVO copyPlanTemplate(PlanTemplateCopyReqVO copyReqVO) {
+ Long id = copyReqVO.getId();
+ PlanTemplateDO planTemplate = planTemplateMapper.selectById(id);
+ if (planTemplate == null){
+ throw new ServiceException(ErrorCodeConstants.PLAN_TEMPLATE_NOT_EXISTS);
+ }
+ planTemplate.setId(null);
+ planTemplateMapper.insert(planTemplate);
+
+ List planTemplateColumnList = planTemplateColumnService.getPlanTemplateColumnListByTemplateId(id);
+ if(!planTemplateColumnList.isEmpty()){
+ for (PlanTemplateColumnDO planTemplateColumn : planTemplateColumnList) {
+ planTemplateColumn.setId(null);
+ planTemplateColumn.setPlanTemplateId(planTemplate.getDeptId());
+ }
+ }
+ List planTemplateColumnDataList = planTemplateColumnDataService.getPlanTemplateColumnDataListByTemplateId(id);
+ if(!planTemplateColumnDataList.isEmpty()){
+ for (PlanTemplateColumnDataDO planTemplateColumnDataDO : planTemplateColumnDataList) {
+ planTemplateColumnDataDO.setId(null);
+ planTemplateColumnDataDO.setPlanTemplateId(planTemplate.getId());
+ }
+ }
+ List planTemplateItem = planTemplateItemService.getPlanTemplateItemByTemplateId(id);
+ if (!planTemplateItem.isEmpty()){
+ for (PlanTemplateItemDO planTemplateItemDO : planTemplateItem) {
+ planTemplateItemDO.setId(null);
+ planTemplateItemDO.setPlanTemplateId(planTemplate.getId());
+ }
+ }
+
+ planTemplateColumnService.batchCreatePlanTemplateColumn(planTemplateColumnList);
+ planTemplateColumnDataService.batchCreatePlanTemplateColumnData(planTemplateColumnDataList);
+ planTemplateItemService.batchCreatePlanTemplateItem(planTemplateItem);
+
+ return BeanUtils.toBean(planTemplate, PlanTemplateRespVO.class);
+ }
+
+ @Override
+ public void updatePlanTemplate(PlanTemplateSaveReqVO updateReqVO) {
+ // 校验存在
+ validatePlanTemplateExists(updateReqVO.getId());
+ // 更新
+ PlanTemplateDO updateObj = BeanUtils.toBean(updateReqVO, PlanTemplateDO.class);
+ //以下信息不允许修改
+ updateObj.setTemplateCoding(null);
+ updateObj.setPlanType(null);
+
+ planTemplateMapper.updateById(updateObj);
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public void deletePlanTemplate(Long id) {
+ // 校验存在
+ validatePlanTemplateExists(id);
+ // 删除
+ deleteSubById(id);
+ planTemplateMapper.deleteById(id);
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public void deletePlanTemplateListByIds(List ids) {
+ // 校验存在
+ validatePlanTemplateExists(ids);
+ // 删除
+ deleteSubByIds(ids);
+ planTemplateMapper.deleteByIds(ids);
+ }
+
+ private void validatePlanTemplateExists(List ids) {
+ List list = planTemplateMapper.selectByIds(ids);
+ if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
+ throw exception(ErrorCodeConstants.PLAN_TEMPLATE_NOT_EXISTS);
+ }
+ }
+
+ private void validatePlanTemplateExists(Long id) {
+ if (planTemplateMapper.selectById(id) == null) {
+ throw exception(ErrorCodeConstants.PLAN_TEMPLATE_NOT_EXISTS);
+ }
+ }
+
+ private void deleteSubById(Long id){
+ planTemplateColumnService.deletePlanTemplateColumnListByTemplateId(id);
+ planTemplateColumnDataService.deletePlanTemplateColumnDataListByTemplateId(id);
+ planTemplateItemService.deletePlanTemplateItemListByTemplateId(id);
+ }
+
+ private void deleteSubByIds(List ids){
+ planTemplateColumnService.deletePlanTemplateColumnListByTemplateIds(ids);
+ planTemplateColumnDataService.deletePlanTemplateColumnDataListByTemplateIds(ids);
+ planTemplateItemService.deletePlanTemplateItemListByTemplateIds(ids);
+ }
+
+ @Override
+ public PlanTemplateDO getPlanTemplate(Long id) {
+ return planTemplateMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult getPlanTemplatePage(PlanTemplatePageReqVO pageReqVO) {
+ return planTemplateMapper.selectPage(pageReqVO);
+ }
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templatecolumn/PlanTemplateColumnService.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templatecolumn/PlanTemplateColumnService.java
new file mode 100644
index 00000000..94819ba8
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templatecolumn/PlanTemplateColumnService.java
@@ -0,0 +1,88 @@
+package cn.iocoder.yudao.module.product.service.plan.templatecolumn;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn.vo.PlanTemplateColumnPageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn.vo.PlanTemplateColumnRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn.vo.PlanTemplateColumnSaveReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templatecolumn.PlanTemplateColumnDO;
+import jakarta.validation.Valid;
+
+import java.util.List;
+
+/**
+ * 生产计划模板动态列 Service 接口
+ *
+ * @author 后台管理
+ */
+public interface PlanTemplateColumnService {
+
+ /**
+ * 创建生产计划模板动态列
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ PlanTemplateColumnRespVO createPlanTemplateColumn(@Valid PlanTemplateColumnSaveReqVO createReqVO);
+
+ /*
+ * 前端批量提交数据
+ * */
+ void saveBatchPlanTemplateColumn(@Valid List saveReqVOList);
+
+ /*
+ * 复制功能-批量添加数据
+ * */
+ void batchCreatePlanTemplateColumn(List columnDOList);
+
+ /**
+ * 更新生产计划模板动态列
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updatePlanTemplateColumn(@Valid PlanTemplateColumnSaveReqVO updateReqVO);
+
+ /**
+ * 删除生产计划模板动态列
+ *
+ * @param id 编号
+ */
+ void deletePlanTemplateColumn(Long id);
+
+ /**
+ * 批量删除生产计划模板动态列
+ *
+ * @param ids 编号
+ */
+ void deletePlanTemplateColumnListByIds(List ids);
+
+ /**
+ * 获得生产计划模板动态列
+ *
+ * @param id 编号
+ * @return 生产计划模板动态列
+ */
+ PlanTemplateColumnDO getPlanTemplateColumn(Long id);
+
+ /**
+ * 获得生产计划模板动态列分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 生产计划模板动态列分页
+ */
+ PageResult getPlanTemplateColumnPage(PlanTemplateColumnPageReqVO pageReqVO);
+
+ /*
+ * 根据模板id删除动态列
+ * */
+ void deletePlanTemplateColumnListByTemplateId(Long templateId);
+
+ /*
+ * 根据模板id批量删除动态列
+ * */
+ void deletePlanTemplateColumnListByTemplateIds(List templateIds);
+
+ /*
+ * 根据模板id获取动态列
+ * */
+ List getPlanTemplateColumnListByTemplateId(Long templateId);
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templatecolumn/PlanTemplateColumnServiceImpl.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templatecolumn/PlanTemplateColumnServiceImpl.java
new file mode 100644
index 00000000..d36d311d
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templatecolumn/PlanTemplateColumnServiceImpl.java
@@ -0,0 +1,156 @@
+package cn.iocoder.yudao.module.product.service.plan.templatecolumn;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn.vo.PlanTemplateColumnPageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn.vo.PlanTemplateColumnRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumn.vo.PlanTemplateColumnSaveReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templatecolumn.PlanTemplateColumnDO;
+import cn.iocoder.yudao.module.product.dal.mysql.plan.templatecolumn.PlanTemplateColumnMapper;
+import cn.iocoder.yudao.module.product.enums.ErrorCodeConstants;
+import cn.iocoder.yudao.module.product.service.plan.templatecolumndata.PlanTemplateColumnDataService;
+import jakarta.annotation.Resource;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+
+/**
+ * 生产计划模板动态列 Service 实现类
+ *
+ * @author 后台管理
+ */
+@Service
+@Validated
+public class PlanTemplateColumnServiceImpl implements PlanTemplateColumnService {
+
+ @Resource
+ private PlanTemplateColumnMapper planTemplateColumnMapper;
+ @Resource
+ private PlanTemplateColumnDataService planTemplateColumnDataService;
+
+ @Override
+ public PlanTemplateColumnRespVO createPlanTemplateColumn(PlanTemplateColumnSaveReqVO createReqVO) {
+ // 插入
+ PlanTemplateColumnDO planTemplateColumn = BeanUtils.toBean(createReqVO, PlanTemplateColumnDO.class);
+ planTemplateColumnMapper.insert(planTemplateColumn);
+ // 返回
+ return BeanUtils.toBean(planTemplateColumn, PlanTemplateColumnRespVO.class);
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public void saveBatchPlanTemplateColumn(List columnSaveReqVOList) {
+ //校验编码重复
+ validatePlanTemplateColumnCode(columnSaveReqVOList);
+
+ List insertList = new ArrayList<>(columnSaveReqVOList.size());
+ List updateList = new ArrayList<>(columnSaveReqVOList.size());
+ List deleteList = new ArrayList<>(columnSaveReqVOList.size());
+ for (PlanTemplateColumnSaveReqVO planTemplateColumnSaveReqVO : columnSaveReqVOList) {
+ PlanTemplateColumnDO templateColumnDO = BeanUtils.toBean(planTemplateColumnSaveReqVO, PlanTemplateColumnDO.class);
+ if ("INSERT".equalsIgnoreCase(planTemplateColumnSaveReqVO.getOperation())){
+ templateColumnDO.setId(null);
+ insertList.add(templateColumnDO);
+ }else if ("UPDATE".equalsIgnoreCase(planTemplateColumnSaveReqVO.getOperation())){
+ //不允许修改编码
+ templateColumnDO.setColumnCoding(null);
+ updateList.add(templateColumnDO);
+ }else if ("DELETE".equalsIgnoreCase(planTemplateColumnSaveReqVO.getOperation())){
+ deleteList.add(planTemplateColumnSaveReqVO.getId());
+ }else {
+ throw exception(ErrorCodeConstants.PLAN_TEMPLATE_COLUMN_OPERATION_ID_IS_NULL);
+ }
+ }
+ planTemplateColumnMapper.insertBatch(insertList);
+ planTemplateColumnMapper.updateById(updateList);
+ planTemplateColumnMapper.deleteByIds(deleteList);
+ }
+
+ private void validatePlanTemplateColumnCode(List columnSaveReqVOList) {
+ List codings = columnSaveReqVOList.stream().filter(columSave -> "INSERT".equalsIgnoreCase(columSave.getOperation())).map(PlanTemplateColumnSaveReqVO::getColumnCoding).toList();
+ Long selectCount = planTemplateColumnMapper.selectCount(new LambdaQueryWrapperX().in(PlanTemplateColumnDO::getColumnCoding, codings));
+ if (selectCount != null && selectCount > 0) {
+ throw exception(ErrorCodeConstants.PLAN_TEMPLATE_COLUMN_ENCODING_INFORMATION_ALREADY_EXISTS);
+ }
+ }
+
+ @Override
+ public void batchCreatePlanTemplateColumn(List columnDOList) {
+ // 批量插入
+ planTemplateColumnMapper.insertBatch(columnDOList);
+ }
+
+ @Override
+ public void updatePlanTemplateColumn(PlanTemplateColumnSaveReqVO updateReqVO) {
+ // 校验存在
+ validatePlanTemplateColumnExists(updateReqVO.getId());
+ // 更新
+ PlanTemplateColumnDO updateObj = BeanUtils.toBean(updateReqVO, PlanTemplateColumnDO.class);
+ planTemplateColumnMapper.updateById(updateObj);
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public void deletePlanTemplateColumn(Long id) {
+ // 校验存在
+ validatePlanTemplateColumnExists(id);
+ // 删除
+ planTemplateColumnDataService.deletePlanTemplateColumnDataListByTemplateColumnId(id);
+ planTemplateColumnMapper.deleteById(id);
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public void deletePlanTemplateColumnListByIds(List ids) {
+ // 校验存在
+ validatePlanTemplateColumnExists(ids);
+ // 删除
+ planTemplateColumnDataService.deletePlanTemplateColumnDataListByTemplateColumnIds(ids);
+ planTemplateColumnMapper.deleteByIds(ids);
+ }
+
+ private void validatePlanTemplateColumnExists(List ids) {
+ List list = planTemplateColumnMapper.selectByIds(ids);
+ if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
+ throw exception(ErrorCodeConstants.PLAN_TEMPLATE_COLUMN_NOT_EXISTS);
+ }
+ }
+
+ private void validatePlanTemplateColumnExists(Long id) {
+ if (planTemplateColumnMapper.selectById(id) == null) {
+ throw exception(ErrorCodeConstants.PLAN_TEMPLATE_COLUMN_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public PlanTemplateColumnDO getPlanTemplateColumn(Long id) {
+ return planTemplateColumnMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult getPlanTemplateColumnPage(PlanTemplateColumnPageReqVO pageReqVO) {
+ return planTemplateColumnMapper.selectPage(pageReqVO);
+ }
+
+ @Override
+ public void deletePlanTemplateColumnListByTemplateId(Long templateId) {
+ planTemplateColumnMapper.deleteByTemplateId(templateId);
+ }
+
+ @Override
+ public void deletePlanTemplateColumnListByTemplateIds(List templateIds) {
+ planTemplateColumnMapper.deleteByTemplateIds(templateIds);
+ }
+
+ @Override
+ public List getPlanTemplateColumnListByTemplateId(Long templateId) {
+ return planTemplateColumnMapper.selectByTemplateId(templateId);
+ }
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templatecolumndata/PlanTemplateColumnDataService.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templatecolumndata/PlanTemplateColumnDataService.java
new file mode 100644
index 00000000..3456956a
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templatecolumndata/PlanTemplateColumnDataService.java
@@ -0,0 +1,105 @@
+package cn.iocoder.yudao.module.product.service.plan.templatecolumndata;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo.PlanTemplateColumnDataPageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo.PlanTemplateColumnDataRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo.PlanTemplateColumnDataSaveReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templatecolumndata.PlanTemplateColumnDataDO;
+import jakarta.validation.Valid;
+
+import java.util.List;
+
+/**
+ * 生产计划模板动态列数据 Service 接口
+ *
+ * @author 后台管理
+ */
+public interface PlanTemplateColumnDataService {
+
+ /**
+ * 创建生产计划模板动态列数据
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ PlanTemplateColumnDataRespVO createPlanTemplateColumnData(@Valid PlanTemplateColumnDataSaveReqVO createReqVO);
+
+ /*
+ * 批量添加数据-复制
+ * */
+ void batchCreatePlanTemplateColumnData(List columnDataDOList);
+
+ /**
+ * 更新生产计划模板动态列数据
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updatePlanTemplateColumnData(@Valid PlanTemplateColumnDataSaveReqVO updateReqVO);
+
+ /*
+ * 批量更新数据
+ * */
+ void batchUpdatePlanTemplateColumnData(@Valid List columnDataDOList);
+
+ /**
+ * 删除生产计划模板动态列数据
+ *
+ * @param id 编号
+ */
+ void deletePlanTemplateColumnData(Long id);
+
+ /**
+ * 批量删除生产计划模板动态列数据
+ *
+ * @param ids 编号
+ */
+ void deletePlanTemplateColumnDataListByIds(List ids);
+
+ /**
+ * 获得生产计划模板动态列数据
+ *
+ * @param id 编号
+ * @return 生产计划模板动态列数据
+ */
+ PlanTemplateColumnDataDO getPlanTemplateColumnData(Long id);
+
+ /**
+ * 获得生产计划模板动态列数据分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 生产计划模板动态列数据分页
+ */
+ PageResult getPlanTemplateColumnDataPage(PlanTemplateColumnDataPageReqVO pageReqVO);
+
+ /*
+ * 根据templateId删除动态列数据
+ * */
+ void deletePlanTemplateColumnDataListByTemplateId(Long templateId);
+
+ /*
+ * 根据templateId批量删除动态列数据
+ * */
+ void deletePlanTemplateColumnDataListByTemplateIds(List templateIds);
+
+ /*
+ * 根据TemplateColumnId删除动态列数据
+ * */
+ void deletePlanTemplateColumnDataListByTemplateColumnId(Long columnId);
+
+ /*
+ * 根据TemplateColumnId批量删除动态列数据
+ * */
+ void deletePlanTemplateColumnDataListByTemplateColumnIds(List columnIds);
+
+ /*
+ * 根据templateId删除动态列数据
+ * */
+ void deletePlanTemplateColumnDataListByTemplateItemId(Long templateItemId);
+
+ /*
+ * 根据templateId批量删除动态列数据
+ * */
+ void deletePlanTemplateColumnDataListByTemplateItemIds(List templateItemIds);
+
+ List getPlanTemplateColumnDataListByTemplateId(Long templateId);
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templatecolumndata/PlanTemplateColumnDataServiceImpl.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templatecolumndata/PlanTemplateColumnDataServiceImpl.java
new file mode 100644
index 00000000..164bd6f7
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templatecolumndata/PlanTemplateColumnDataServiceImpl.java
@@ -0,0 +1,133 @@
+package cn.iocoder.yudao.module.product.service.plan.templatecolumndata;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo.PlanTemplateColumnDataPageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo.PlanTemplateColumnDataRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo.PlanTemplateColumnDataSaveReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templatecolumndata.PlanTemplateColumnDataDO;
+import cn.iocoder.yudao.module.product.dal.mysql.plan.templatecolumndata.PlanTemplateColumnDataMapper;
+import cn.iocoder.yudao.module.product.enums.ErrorCodeConstants;
+import jakarta.annotation.Resource;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.List;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+
+/**
+ * 生产计划模板动态列数据 Service 实现类
+ *
+ * @author 后台管理
+ */
+@Service
+@Validated
+public class PlanTemplateColumnDataServiceImpl implements PlanTemplateColumnDataService {
+
+ @Resource
+ private PlanTemplateColumnDataMapper planTemplateColumnDataMapper;
+
+ @Override
+ public PlanTemplateColumnDataRespVO createPlanTemplateColumnData(PlanTemplateColumnDataSaveReqVO createReqVO) {
+ // 插入
+ PlanTemplateColumnDataDO planTemplateColumnData = BeanUtils.toBean(createReqVO, PlanTemplateColumnDataDO.class);
+ planTemplateColumnDataMapper.insert(planTemplateColumnData);
+ // 返回
+ return BeanUtils.toBean(planTemplateColumnData, PlanTemplateColumnDataRespVO.class);
+ }
+
+ @Override
+ public void batchCreatePlanTemplateColumnData(List columnDataDOList) {
+ planTemplateColumnDataMapper.insertBatch(columnDataDOList);
+ }
+
+ @Override
+ public void updatePlanTemplateColumnData(PlanTemplateColumnDataSaveReqVO updateReqVO) {
+ // 校验存在
+ validatePlanTemplateColumnDataExists(updateReqVO.getId());
+ // 更新
+ PlanTemplateColumnDataDO updateObj = BeanUtils.toBean(updateReqVO, PlanTemplateColumnDataDO.class);
+ planTemplateColumnDataMapper.updateById(updateObj);
+ }
+
+ @Override
+ public void batchUpdatePlanTemplateColumnData(List columnDataDOList) {
+ planTemplateColumnDataMapper.updateById(columnDataDOList);
+ }
+
+ @Override
+ public void deletePlanTemplateColumnData(Long id) {
+ // 校验存在
+ validatePlanTemplateColumnDataExists(id);
+ // 删除
+ planTemplateColumnDataMapper.deleteById(id);
+ }
+
+ @Override
+ public void deletePlanTemplateColumnDataListByIds(List ids) {
+ // 校验存在
+ validatePlanTemplateColumnDataExists(ids);
+ // 删除
+ planTemplateColumnDataMapper.deleteByIds(ids);
+ }
+
+ private void validatePlanTemplateColumnDataExists(List ids) {
+ List list = planTemplateColumnDataMapper.selectByIds(ids);
+ if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
+ throw exception(ErrorCodeConstants.PLAN_TEMPLATE_COLUMN_DATA_NOT_EXISTS);
+ }
+ }
+
+ private void validatePlanTemplateColumnDataExists(Long id) {
+ if (planTemplateColumnDataMapper.selectById(id) == null) {
+ throw exception(ErrorCodeConstants.PLAN_TEMPLATE_COLUMN_DATA_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public PlanTemplateColumnDataDO getPlanTemplateColumnData(Long id) {
+ return planTemplateColumnDataMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult getPlanTemplateColumnDataPage(PlanTemplateColumnDataPageReqVO pageReqVO) {
+ return planTemplateColumnDataMapper.selectPage(pageReqVO);
+ }
+
+ @Override
+ public void deletePlanTemplateColumnDataListByTemplateId(Long templateId) {
+ planTemplateColumnDataMapper.deleteByTemplateId(templateId);
+ }
+
+ @Override
+ public void deletePlanTemplateColumnDataListByTemplateIds(List templateIds) {
+ planTemplateColumnDataMapper.deleteByTemplateIds(templateIds);
+ }
+
+ @Override
+ public void deletePlanTemplateColumnDataListByTemplateColumnId(Long templateColumnId) {
+ planTemplateColumnDataMapper.deleteByTemplateColumnId(templateColumnId);
+ }
+
+ @Override
+ public void deletePlanTemplateColumnDataListByTemplateColumnIds(List templateColumnIds) {
+ planTemplateColumnDataMapper.deleteByTemplateColumnIds(templateColumnIds);
+ }
+
+ @Override
+ public void deletePlanTemplateColumnDataListByTemplateItemId(Long templateItemId) {
+ planTemplateColumnDataMapper.deleteByTemplateItemId(templateItemId);
+ }
+
+ @Override
+ public void deletePlanTemplateColumnDataListByTemplateItemIds(List templateItemIds) {
+ planTemplateColumnDataMapper.deleteByTemplateItemIds(templateItemIds);
+ }
+
+ @Override
+ public List getPlanTemplateColumnDataListByTemplateId(Long templateId) {
+ return planTemplateColumnDataMapper.selectByTemplateId(templateId);
+ }
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templateitem/PlanTemplateItemService.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templateitem/PlanTemplateItemService.java
new file mode 100644
index 00000000..f7f9a9ba
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templateitem/PlanTemplateItemService.java
@@ -0,0 +1,86 @@
+package cn.iocoder.yudao.module.product.service.plan.templateitem;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templateitem.vo.PlanTemplateItemPageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templateitem.vo.PlanTemplateItemRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templateitem.vo.PlanTemplateItemSaveReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templateitem.PlanTemplateItemDO;
+import jakarta.validation.Valid;
+
+import java.util.List;
+
+/**
+ * 生产计划模板项目 Service 接口
+ *
+ * @author 后台管理
+ */
+public interface PlanTemplateItemService {
+
+ /**
+ * 创建生产计划模板项目
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ PlanTemplateItemRespVO createPlanTemplateItem(@Valid PlanTemplateItemSaveReqVO createReqVO);
+
+ /*
+ * 前端批量提交数据
+ * */
+ void saveBatchPlanTemplateItem(@Valid List saveReqVOList);
+
+ /*
+ * 批量添加数据
+ * */
+ void batchCreatePlanTemplateItem(List itemDOList);
+
+ /**
+ * 更新生产计划模板项目
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updatePlanTemplateItem(@Valid PlanTemplateItemSaveReqVO updateReqVO);
+
+ /**
+ * 删除生产计划模板项目
+ *
+ * @param id 编号
+ */
+ void deletePlanTemplateItem(Long id);
+
+ /**
+ * 批量删除生产计划模板项目
+ *
+ * @param ids 编号
+ */
+ void deletePlanTemplateItemListByIds(List ids);
+
+ /**
+ * 获得生产计划模板项目
+ *
+ * @param id 编号
+ * @return 生产计划模板项目
+ */
+ PlanTemplateItemDO getPlanTemplateItem(Long id);
+
+ /**
+ * 获得生产计划模板项目分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 生产计划模板项目分页
+ */
+ PageResult getPlanTemplateItemPage(PlanTemplateItemPageReqVO pageReqVO);
+
+ /*
+ * 根据templateId删除模板项目
+ * */
+ void deletePlanTemplateItemListByTemplateId(Long templateId);
+
+ /*
+ * 根据templateId批量删除模板项目
+ * */
+ void deletePlanTemplateItemListByTemplateIds(List templateIds);
+
+ List getPlanTemplateItemByTemplateId(Long templateId);
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templateitem/PlanTemplateItemServiceImpl.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templateitem/PlanTemplateItemServiceImpl.java
new file mode 100644
index 00000000..3a1df1d6
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/plan/templateitem/PlanTemplateItemServiceImpl.java
@@ -0,0 +1,203 @@
+package cn.iocoder.yudao.module.product.service.plan.templateitem;
+
+import cn.hutool.core.collection.CollUtil;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templatecolumndata.vo.PlanTemplateColumnDataRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templateitem.vo.PlanTemplateItemPageReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templateitem.vo.PlanTemplateItemRespVO;
+import cn.iocoder.yudao.module.product.controller.admin.plan.templateitem.vo.PlanTemplateItemSaveReqVO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templatecolumndata.PlanTemplateColumnDataDO;
+import cn.iocoder.yudao.module.product.dal.dataobject.plan.templateitem.PlanTemplateItemDO;
+import cn.iocoder.yudao.module.product.dal.mysql.plan.templateitem.PlanTemplateItemMapper;
+import cn.iocoder.yudao.module.product.enums.ErrorCodeConstants;
+import cn.iocoder.yudao.module.product.service.plan.templatecolumndata.PlanTemplateColumnDataService;
+import com.baomidou.mybatisplus.core.toolkit.IdWorker;
+import jakarta.annotation.Resource;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+
+/**
+ * 生产计划模板项目 Service 实现类
+ *
+ * @author 后台管理
+ */
+@Service
+@Validated
+public class PlanTemplateItemServiceImpl implements PlanTemplateItemService {
+
+ @Resource
+ private PlanTemplateItemMapper planTemplateItemMapper;
+ @Resource
+ private PlanTemplateColumnDataService planTemplateColumnDataService;
+
+ @Override
+ public PlanTemplateItemRespVO createPlanTemplateItem(PlanTemplateItemSaveReqVO createReqVO) {
+ // 插入
+ PlanTemplateItemDO planTemplateItem = BeanUtils.toBean(createReqVO, PlanTemplateItemDO.class);
+ planTemplateItemMapper.insert(planTemplateItem);
+ // 返回
+ return BeanUtils.toBean(planTemplateItem, PlanTemplateItemRespVO.class);
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public void saveBatchPlanTemplateItem(List saveReqVOList) {
+ List insertList = new ArrayList<>(saveReqVOList.size());
+ List updateList = new ArrayList<>(saveReqVOList.size());
+ List deleteList = new ArrayList<>(saveReqVOList.size());
+ List insertData = new ArrayList<>(saveReqVOList.size());
+ List updateData = new ArrayList<>(saveReqVOList.size());
+ //根据操作标识符,来判断数据的增删改
+ for (PlanTemplateItemSaveReqVO planTemplateItemSaveReqVO : saveReqVOList) {
+ PlanTemplateItemDO templateItemDO = BeanUtils.toBean(planTemplateItemSaveReqVO, PlanTemplateItemDO.class);
+ if ("INSERT".equalsIgnoreCase(planTemplateItemSaveReqVO.getOperation())){
+ long itemId = IdWorker.getId();
+ templateItemDO.setId(itemId);
+ insertList.add(templateItemDO);
+ //处理动态列数据
+ List planTemplateColumnDataDOS = handleColumnDataInsert(planTemplateItemSaveReqVO, itemId);
+ insertData.addAll(planTemplateColumnDataDOS);
+ }else if ("UPDATE".equalsIgnoreCase(planTemplateItemSaveReqVO.getOperation())){
+ updateList.add(templateItemDO);
+ //修改动态列数据
+ List planTemplateColumnDataDOS = handleColumnDataUpdate(planTemplateItemSaveReqVO);
+ updateData.addAll(planTemplateColumnDataDOS);
+ }else if ("DELETE".equalsIgnoreCase(planTemplateItemSaveReqVO.getOperation())){
+ deleteList.add(planTemplateItemSaveReqVO.getId());
+ }else {
+ throw exception(ErrorCodeConstants.PLAN_TEMPLATE_ITEM_OPERATION_ID_IS_NULL);
+ }
+ }
+ if (!insertList.isEmpty()) {
+ planTemplateItemMapper.insertBatch(insertList);
+ }
+ if (!updateList.isEmpty()) {
+ planTemplateItemMapper.updateById(updateList);
+ }
+ if (!deleteList.isEmpty()) {
+ //要同步删除子表数据,所以不要直接调用mapper
+ deletePlanTemplateItemListByIds(deleteList);
+ }
+ //新增和修改动态列数据
+ if (!insertData.isEmpty()) {
+ planTemplateColumnDataService.batchCreatePlanTemplateColumnData(insertData);
+ }
+ if (!updateData.isEmpty()) {
+ planTemplateColumnDataService.batchUpdatePlanTemplateColumnData(updateData);
+ }
+ }
+
+ //处理新增动态列数据,添加itemId,其他信息由前端处理
+ private List handleColumnDataInsert(PlanTemplateItemSaveReqVO planTemplateItemSaveReqVO, long itemId) {
+ Map columns = planTemplateItemSaveReqVO.getColumns();
+ for (PlanTemplateColumnDataRespVO value : columns.values()) {
+ value.setId(null);
+ value.setPlanTemplateItemId(itemId);
+ }
+ return BeanUtils.toBean(columns.values().stream().toList(), PlanTemplateColumnDataDO.class);
+ }
+
+ //更新动态列数据
+ private List handleColumnDataUpdate(PlanTemplateItemSaveReqVO planTemplateItemSaveReqVO) {
+ //新增动态列数据
+ Map columns = planTemplateItemSaveReqVO.getColumns();
+ return BeanUtils.toBean(columns.values().stream().toList(), PlanTemplateColumnDataDO.class);
+ }
+
+ @Override
+ public void batchCreatePlanTemplateItem(List itemDOList) {
+ planTemplateItemMapper.insertBatch(itemDOList);
+ }
+
+ @Override
+ public void updatePlanTemplateItem(PlanTemplateItemSaveReqVO updateReqVO) {
+ // 校验存在
+ validatePlanTemplateItemExists(updateReqVO.getId());
+ // 更新
+ PlanTemplateItemDO updateObj = BeanUtils.toBean(updateReqVO, PlanTemplateItemDO.class);
+ planTemplateItemMapper.updateById(updateObj);
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public void deletePlanTemplateItem(Long id) {
+ // 校验存在
+ validatePlanTemplateItemExists(id);
+ // 删除
+ planTemplateColumnDataService.deletePlanTemplateColumnDataListByTemplateItemId(id);
+ planTemplateItemMapper.deleteById(id);
+ }
+
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public void deletePlanTemplateItemListByIds(List ids) {
+ // 校验存在
+ validatePlanTemplateItemExists(ids);
+ // 删除
+ planTemplateColumnDataService.deletePlanTemplateColumnDataListByTemplateItemIds(ids);
+ planTemplateItemMapper.deleteByIds(ids);
+ }
+
+ private void validatePlanTemplateItemExists(List ids) {
+ List list = planTemplateItemMapper.selectByIds(ids);
+ if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
+ throw exception(ErrorCodeConstants.PLAN_TEMPLATE_ITEM_NOT_EXISTS);
+ }
+ }
+
+ private void validatePlanTemplateItemExists(Long id) {
+ if (planTemplateItemMapper.selectById(id) == null) {
+ throw exception(ErrorCodeConstants.PLAN_TEMPLATE_ITEM_NOT_EXISTS);
+ }
+ }
+
+ @Override
+ public PlanTemplateItemDO getPlanTemplateItem(Long id) {
+ return planTemplateItemMapper.selectById(id);
+ }
+
+ @Override
+ public PageResult getPlanTemplateItemPage(PlanTemplateItemPageReqVO pageReqVO) {
+ PageResult pageResult = planTemplateItemMapper.selectPage(pageReqVO);
+ PageResult voPageResult = BeanUtils.toBean(pageResult, PlanTemplateItemRespVO.class);
+ List resultList = voPageResult.getList();
+ if (!resultList.isEmpty()) {
+ List columnDataList = planTemplateColumnDataService.getPlanTemplateColumnDataListByTemplateId(pageReqVO.getPlanTemplateId());
+ for (PlanTemplateItemRespVO templateItemRespVO : resultList) {
+ Map map = new HashMap<>();
+ templateItemRespVO.setColumns(map);
+ for (PlanTemplateColumnDataDO planTemplateColumnDataDO : columnDataList) {
+ if (planTemplateColumnDataDO.getPlanTemplateItemId().equals(templateItemRespVO.getId())) {
+ PlanTemplateColumnDataRespVO columnDataRespVO = BeanUtils.toBean(planTemplateColumnDataDO, PlanTemplateColumnDataRespVO.class);
+ map.put(planTemplateColumnDataDO.getColumnCoding(), columnDataRespVO);
+ }
+ }
+ }
+ }
+ return voPageResult;
+ }
+
+ @Override
+ public void deletePlanTemplateItemListByTemplateId(Long templateId) {
+ planTemplateItemMapper.deleteByTemplateId(templateId);
+ }
+
+ @Override
+ public void deletePlanTemplateItemListByTemplateIds(List templateIds) {
+ planTemplateItemMapper.deleteByTemplateIds(templateIds);
+ }
+
+ @Override
+ public List getPlanTemplateItemByTemplateId(Long templateId) {
+ return planTemplateItemMapper.selectByTemplateId(templateId);
+ }
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/schedule/config/ScheduleConfigService.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/schedule/config/ScheduleConfigService.java
new file mode 100644
index 00000000..d55d5966
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/schedule/config/ScheduleConfigService.java
@@ -0,0 +1,62 @@
+package cn.iocoder.yudao.module.product.service.schedule.config;
+
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo.*;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.config.ScheduleConfigDO;
+import jakarta.validation.Valid;
+
+import java.util.List;
+
+/**
+ * 排班配置 Service 接口
+ *
+ * @author 后台管理
+ */
+public interface ScheduleConfigService {
+
+ /**
+ * 创建排班配置
+ *
+ * @param createReqVO 创建信息
+ * @return 编号
+ */
+ Long createScheduleConfig(@Valid ScheduleCreateReqVO createReqVO);
+
+ /**
+ * 更新排班配置
+ *
+ * @param updateReqVO 更新信息
+ */
+ void updateScheduleConfig(@Valid ScheduleUpdateReqVO updateReqVO);
+
+ /**
+ * 删除排班配置
+ *
+ * @param id 编号
+ */
+ void deleteScheduleConfig(Long id);
+
+ /**
+ * 批量删除排班配置
+ *
+ * @param ids 编号
+ */
+ void deleteScheduleConfigListByIds(List ids);
+
+ /**
+ * 获得排班配置
+ *
+ * @param id 编号
+ * @return 排班配置
+ */
+ ScheduleConfigDO getScheduleConfig(Long id);
+
+ /**
+ * 获得排班配置分页
+ *
+ * @param pageReqVO 分页查询
+ * @return 排班配置分页
+ */
+ PageResult getScheduleConfigPage(ScheduleConfigPageReqVO pageReqVO);
+
+}
\ No newline at end of file
diff --git a/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/schedule/config/ScheduleConfigServiceImpl.java b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/schedule/config/ScheduleConfigServiceImpl.java
new file mode 100644
index 00000000..37b0a929
--- /dev/null
+++ b/yudao-module-product/yudao-module-product-server/src/main/java/cn/iocoder/yudao/module/product/service/schedule/config/ScheduleConfigServiceImpl.java
@@ -0,0 +1,544 @@
+package cn.iocoder.yudao.module.product.service.schedule.config;
+
+
+import cn.hutool.core.collection.CollUtil;
+import cn.iocoder.yudao.framework.common.pojo.PageResult;
+import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.config.vo.*;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo.ScheduleRuleCreateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.rule.vo.ScheduleRuleUpdateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo.ScheduleShiftCreateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.shift.vo.ScheduleShiftUpdateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo.ScheduleTeamCreateReqVO;
+import cn.iocoder.yudao.module.product.controller.admin.schedule.team.vo.ScheduleTeamUpdateReqVO;
+import cn.iocoder.yudao.module.product.convert.schedule.config.ScheduleConfigConvert;
+import cn.iocoder.yudao.module.product.convert.schedule.shift.ScheduleShiftConvert;
+import cn.iocoder.yudao.module.product.convert.schedule.team.ScheduleTeamConvert;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.config.ScheduleConfigDO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.data.ScheduleDataDO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.rule.ScheduleRuleDO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.shift.ScheduleShiftDO;
+import cn.iocoder.yudao.module.product.dal.dataobject.schedule.team.ScheduleTeamDO;
+import cn.iocoder.yudao.module.product.dal.mysql.schedule.config.ScheduleConfigMapper;
+import cn.iocoder.yudao.module.product.dal.mysql.schedule.data.ScheduleDataMapper;
+import cn.iocoder.yudao.module.product.dal.mysql.schedule.rule.ScheduleRuleMapper;
+import cn.iocoder.yudao.module.product.dal.mysql.schedule.shift.ScheduleShiftMapper;
+import cn.iocoder.yudao.module.product.dal.mysql.schedule.team.ScheduleTeamMapper;
+import jakarta.annotation.Resource;
+import org.apache.commons.collections4.CollectionUtils;
+import org.apache.commons.collections4.MapUtils;
+import org.apache.commons.lang3.ObjectUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.validation.annotation.Validated;
+
+import java.time.format.DateTimeFormatter;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
+import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.*;
+
+
+/**
+ * 排班配置 Service 实现类
+ *
+ * @author 后台管理
+ */
+@Service
+@Validated
+public class ScheduleConfigServiceImpl implements ScheduleConfigService {
+
+ @Resource
+ private ScheduleConfigMapper scheduleConfigMapper;
+
+ @Resource
+ private ScheduleTeamMapper scheduleTeamMapper;
+
+ @Resource
+ private ScheduleShiftMapper scheduleShiftMapper;
+
+ @Resource
+ private ScheduleRuleMapper scheduleRuleMapper;
+
+ @Resource
+ private ScheduleDataMapper scheduleDataMapper;
+
+ @Transactional(rollbackFor = Exception.class)
+ @Override
+ public Long createScheduleConfig(ScheduleCreateReqVO createReqVO) {
+ //基础信息处理
+ //校验基础信息
+ ScheduleConfigCreateReqVO scheduleConfigCreateReqVO = createReqVO.getScheduleConfig();
+ validateScheduleConfigConfigCodingUnique(null, scheduleConfigCreateReqVO.getConfigCoding());
+ validateScheduleConfigConfigNameUnique(null, scheduleConfigCreateReqVO.getConfigName());
+ //插入基础信息
+ ScheduleConfigDO scheduleConfig = ScheduleConfigConvert.INSTANCE.convert(scheduleConfigCreateReqVO);
+ scheduleConfigMapper.insert(scheduleConfig);
+
+ //排班班组信息处理
+ List scheduleTeamCreateReqVOs = createReqVO.getScheduleTeams();
+ Map teamNameIdMap = new HashMap<>(); //班组名称和id的map,用于保存rule
+ if (CollectionUtils.isNotEmpty(scheduleTeamCreateReqVOs)) {
+ //验证班组名称是否重复
+ Set seenNames = new HashSet<>();
+ boolean hasDuplicate = false;
+ for (ScheduleTeamCreateReqVO scheduleTeamCreateReqVO : scheduleTeamCreateReqVOs) {
+ String teamName = scheduleTeamCreateReqVO.getTeamName();
+ if (!seenNames.add(teamName)) {
+ hasDuplicate = true;
+ break;
+ }
+ }
+ if (hasDuplicate) {
+ throw exception(SCHEDULE_TEAM_NAME_EXISTS);
+ }
+ List scheduleTeams = ScheduleTeamConvert.INSTANCE.convertListByCreateReqVO(scheduleTeamCreateReqVOs);
+ scheduleTeams.forEach(scheduleTeam -> {
+ scheduleTeam.setScheduleConfigId(scheduleConfig.getId());
+ scheduleTeam.setScheduleConfigCoding(scheduleConfig.getConfigCoding());
+ });
+ scheduleTeamMapper.insertBatch(scheduleTeams);
+ scheduleTeams.forEach(team -> {
+ teamNameIdMap.put(team.getTeamName(), team.getId());
+ });
+ }
+
+ //排班班次信息处理
+ List scheduleShiftCreateReqVOs = createReqVO.getScheduleShifts();
+ Map shiftNameIdMap = new HashMap<>(); //班次名称和id的map,用于保存rule
+ if (CollectionUtils.isNotEmpty(scheduleShiftCreateReqVOs)) {
+ //验证班组次称是否重复
+ Set seenNames = new HashSet<>();
+ boolean hasDuplicate = false;
+ for (ScheduleShiftCreateReqVO scheduleShiftCreateReqVO : scheduleShiftCreateReqVOs) {
+ String shiftName = scheduleShiftCreateReqVO.getShiftName();
+ if (!seenNames.add(shiftName)) {
+ hasDuplicate = true;
+ break;
+ }
+ }
+ if (hasDuplicate) {
+ throw exception(SCHEDULE_SHIFT_NAME_EXISTS);
+ }
+ List scheduleShifts = ScheduleShiftConvert.INSTANCE.convertListByCreateReqVO(scheduleShiftCreateReqVOs);
+ scheduleShifts.forEach(scheduleShift -> {
+ scheduleShift.setScheduleConfigId(scheduleConfig.getId());
+ scheduleShift.setScheduleConfigCoding(scheduleConfig.getConfigCoding());
+ });
+ scheduleShiftMapper.insertBatch(scheduleShifts);
+ scheduleShifts.forEach(shift -> {
+ shiftNameIdMap.put(shift.getShiftName(), shift.getId());
+ });
+ }
+
+ //排班规则信息处理
+ List scheduleRuleCreateReqVOs = createReqVO.getScheduleRules();
+ if (CollectionUtils.isNotEmpty(scheduleRuleCreateReqVOs)) {
+ //检测是否创建了班组
+ if (MapUtils.isEmpty(teamNameIdMap)) {
+ throw exception(SCHEDULE_TEAM_NOT_CREATE);
+ }
+ //检测是否创建了班次
+ if (MapUtils.isEmpty(shiftNameIdMap)) {
+ throw exception(SCHEDULE_SHIFT_NOT_CREATE);
+ }
+ //根据班次分组,检查班次的排班时间是否重复
+ Map> ruleShiftNameGroup = scheduleRuleCreateReqVOs.stream()
+ .collect(Collectors.groupingBy(ScheduleRuleCreateReqVO::getScheduleShiftName));
+ for (Map.Entry> entry : ruleShiftNameGroup.entrySet()) {
+ Set