From 8321dc66388ff19b25d87bb06d32b65a5e58aab2 Mon Sep 17 00:00:00 2001 From: xiaoyu <316612174@qq.com> Date: Mon, 7 Apr 2025 11:27:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E8=AE=A1=E5=88=92=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/RollingPlanController.java | 103 +++++++++ .../com/ruoyi/system/domain/RollingPlan.java | 158 +++++++++++++ .../system/mapper/RollingPlanMapper.java | 60 +++++ .../system/service/IRollingPlanService.java | 60 +++++ .../service/impl/RollingPlanServiceImpl.java | 95 ++++++++ .../mapper/system/RollingPlanMapper.xml | 212 ++++++++++++++++++ sql/gss/滚动计划.sql | 78 +++++++ 7 files changed, 766 insertions(+) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/RollingPlanController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/domain/RollingPlan.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/mapper/RollingPlanMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/IRollingPlanService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RollingPlanServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/system/RollingPlanMapper.xml diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/RollingPlanController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/RollingPlanController.java new file mode 100644 index 0000000..c99f66c --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/RollingPlanController.java @@ -0,0 +1,103 @@ +package com.ruoyi.web.controller.system; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.RollingPlan; +import com.ruoyi.system.service.IRollingPlanService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 滚动计划Controller + * + * @author ruoyi + */ +@RestController +@RequestMapping("/system/rolling-plan") // 修改为短横线形式 +public class RollingPlanController extends BaseController +{ + @Autowired + private IRollingPlanService rollingPlanService; + + /** + * 查询滚动计划列表 + */ + @PreAuthorize("@ss.hasPermi('system:rolling-plan:list')") // 修改权限标识 + @GetMapping("/list") + public TableDataInfo list(RollingPlan rollingPlan) + { + startPage(); + List list = rollingPlanService.selectRollingPlanList(rollingPlan); + return getDataTable(list); + } + + /** + * 导出滚动计划列表 + */ + @PreAuthorize("@ss.hasPermi('system:rolling-plan:export')") // 修改权限标识 + @Log(title = "滚动计划", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, RollingPlan rollingPlan) + { + List list = rollingPlanService.selectRollingPlanList(rollingPlan); + ExcelUtil util = new ExcelUtil(RollingPlan.class); + util.exportExcel(response, list, "滚动计划数据"); + } + + /** + * 获取滚动计划详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:rollingPlan:query')") + @GetMapping(value = "/{planId}") + public AjaxResult getInfo(@PathVariable("planId") Long planId) + { + return success(rollingPlanService.selectRollingPlanByPlanId(planId)); + } + + /** + * 新增滚动计划 + */ + @PreAuthorize("@ss.hasPermi('system:rollingPlan:add')") + @Log(title = "滚动计划", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody RollingPlan rollingPlan) + { + return toAjax(rollingPlanService.insertRollingPlan(rollingPlan)); + } + + /** + * 修改滚动计划 + */ + @PreAuthorize("@ss.hasPermi('system:rollingPlan:edit')") + @Log(title = "滚动计划", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody RollingPlan rollingPlan) + { + return toAjax(rollingPlanService.updateRollingPlan(rollingPlan)); + } + + /** + * 删除滚动计划 + */ + @PreAuthorize("@ss.hasPermi('system:rollingPlan:remove')") + @Log(title = "滚动计划", businessType = BusinessType.DELETE) + @DeleteMapping("/{planIds}") + public AjaxResult remove(@PathVariable Long[] planIds) + { + return toAjax(rollingPlanService.deleteRollingPlanByPlanIds(planIds)); + } +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/RollingPlan.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/RollingPlan.java new file mode 100644 index 0000000..c7283f8 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/RollingPlan.java @@ -0,0 +1,158 @@ +package com.ruoyi.system.domain; + +import java.util.Date; // 添加 Date 类的导入 +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 滚动计划对象 rolling_plan + * + * @author ruoyi + */ +public class RollingPlan extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 序号 */ + private Long planId; + + /** 滚动计划号 */ + @Excel(name = "滚动计划号") + private String planNumber; + + /** 整机编码 */ + @Excel(name = "整机编码") + private String machineCode; + + /** 年度 */ + @Excel(name = "年度") + private Integer planYear; + + /** 版本周次 */ + @Excel(name = "版本周次") + private String versionWeek; + + /** 生产方式 */ + @Excel(name = "生产方式") + private String productionMode; + + /** 状态(0草稿 1确认 2关闭) */ + @Excel(name = "状态", readConverterExp = "0=草稿,1=确认,2=关闭") + private String status; + + /** 销售区域编码 */ + @Excel(name = "销售区域编码") + private String salesAreaCode; + + /** 国家编码 */ + @Excel(name = "国家编码") + private String countryCode; + + /** 销售协调 */ + @Excel(name = "销售协调") + private String salesCoordinator; + + /** 客户名称 */ + @Excel(name = "客户名称") + private String customerName; + + /** 生产版本 */ + @Excel(name = "生产版本") + private String productionVersion; + + /** 品牌编码 */ + @Excel(name = "品牌编码") + private String brandCode; + + /** 销售型号 */ + @Excel(name = "销售型号") + private String salesModel; + + /** 生产地 */ + @Excel(name = "生产地") + private String productionBase; + + /** 是否执行0号(0否 1是) */ + @Excel(name = "是否执行0号", readConverterExp = "0=否,1=是") + private String isZeroExecution; + + /** 排定时间 */ + @Excel(name = "排定时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date scheduleTime; + + /** 上版意向调整时间 */ + @Excel(name = "上版意向调整时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date lastAdjustTime; + + /** 意向调整时间 */ + @Excel(name = "意向调整时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date adjustTime; + + /** 上周数量 */ + @Excel(name = "上周数量") + private Integer lastWeekQty; + + /** 本周数量 */ + @Excel(name = "本周数量") + private Integer currentWeekQty; + + /** 差异 */ + @Excel(name = "差异") + private Integer qtyDifference; + + /** 订单阶段 */ + @Excel(name = "订单阶段") + private String orderStage; + + /** 订单类别 */ + @Excel(name = "订单类别") + private String orderType; + + /** 出口包装方式 */ + @Excel(name = "出口包装方式") + private String packingMethod; + + /** 计划序号 */ + @Excel(name = "计划序号") + private String planSequence; + + /** 是否首单(0否 1是) */ + @Excel(name = "是否首单", readConverterExp = "0=否,1=是") + private String isFirstOrder; + + /** 是否直发(0否 1是) */ + @Excel(name = "是否直发", readConverterExp = "0=否,1=是") + private String isDirectDelivery; + + /** 屏要求 */ + @Excel(name = "屏要求") + private String screenRequirement; + + /** 面板厂家 */ + @Excel(name = "面板厂家") + private String panelManufacturer; + + /** 面板要求 */ + @Excel(name = "面板要求") + private String panelRequirement; + + /** 机芯要求 */ + @Excel(name = "机芯要求") + private String coreRequirement; + + /** 产品类别 */ + @Excel(name = "产品类别") + private String productCategory; + + /** 尺寸 */ + @Excel(name = "尺寸") + private String productSize; + + /** 锁定周次 */ + @Excel(name = "锁定周次") + private String lockWeek; + + // getter/setter 方法略 +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/RollingPlanMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/RollingPlanMapper.java new file mode 100644 index 0000000..ccce96e --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/RollingPlanMapper.java @@ -0,0 +1,60 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.RollingPlan; + +/** + * 滚动计划Mapper接口 + * + * @author ruoyi + */ +public interface RollingPlanMapper +{ + /** + * 查询滚动计划列表 + * + * @param rollingPlan 滚动计划 + * @return 滚动计划集合 + */ + public List selectRollingPlanList(RollingPlan rollingPlan); + + /** + * 查询滚动计划详细 + * + * @param planId 滚动计划主键 + * @return 滚动计划 + */ + public RollingPlan selectRollingPlanByPlanId(Long planId); + + /** + * 新增滚动计划 + * + * @param rollingPlan 滚动计划 + * @return 结果 + */ + public int insertRollingPlan(RollingPlan rollingPlan); + + /** + * 修改滚动计划 + * + * @param rollingPlan 滚动计划 + * @return 结果 + */ + public int updateRollingPlan(RollingPlan rollingPlan); + + /** + * 删除滚动计划 + * + * @param planId 滚动计划主键 + * @return 结果 + */ + public int deleteRollingPlanByPlanId(Long planId); + + /** + * 批量删除滚动计划 + * + * @param planIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteRollingPlanByPlanIds(Long[] planIds); +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IRollingPlanService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IRollingPlanService.java new file mode 100644 index 0000000..af11c17 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IRollingPlanService.java @@ -0,0 +1,60 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.RollingPlan; + +/** + * 滚动计划Service接口 + * + * @author ruoyi + */ +public interface IRollingPlanService +{ + /** + * 查询滚动计划列表 + * + * @param rollingPlan 滚动计划 + * @return 滚动计划集合 + */ + public List selectRollingPlanList(RollingPlan rollingPlan); + + /** + * 查询滚动计划详细 + * + * @param planId 滚动计划主键 + * @return 滚动计划 + */ + public RollingPlan selectRollingPlanByPlanId(Long planId); + + /** + * 新增滚动计划 + * + * @param rollingPlan 滚动计划 + * @return 结果 + */ + public int insertRollingPlan(RollingPlan rollingPlan); + + /** + * 修改滚动计划 + * + * @param rollingPlan 滚动计划 + * @return 结果 + */ + public int updateRollingPlan(RollingPlan rollingPlan); + + /** + * 批量删除滚动计划 + * + * @param planIds 需要删除的滚动计划主键集合 + * @return 结果 + */ + public int deleteRollingPlanByPlanIds(Long[] planIds); + + /** + * 删除滚动计划信息 + * + * @param planId 滚动计划主键 + * @return 结果 + */ + public int deleteRollingPlanByPlanId(Long planId); +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RollingPlanServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RollingPlanServiceImpl.java new file mode 100644 index 0000000..ce17381 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RollingPlanServiceImpl.java @@ -0,0 +1,95 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.RollingPlanMapper; +import com.ruoyi.system.domain.RollingPlan; +import com.ruoyi.system.service.IRollingPlanService; +import com.ruoyi.common.utils.DateUtils; // 添加 DateUtils 工具类的导入 + +/** + * 滚动计划Service业务层处理 + * + * @author ruoyi + */ +@Service +public class RollingPlanServiceImpl implements IRollingPlanService +{ + @Autowired + private RollingPlanMapper rollingPlanMapper; + + /** + * 查询滚动计划列表 + * + * @param rollingPlan 滚动计划 + * @return 滚动计划 + */ + @Override + public List selectRollingPlanList(RollingPlan rollingPlan) + { + return rollingPlanMapper.selectRollingPlanList(rollingPlan); + } + + /** + * 查询滚动计划详细 + * + * @param planId 滚动计划主键 + * @return 滚动计划 + */ + @Override + public RollingPlan selectRollingPlanByPlanId(Long planId) + { + return rollingPlanMapper.selectRollingPlanByPlanId(planId); + } + + /** + * 新增滚动计划 + * + * @param rollingPlan 滚动计划 + * @return 结果 + */ + @Override + public int insertRollingPlan(RollingPlan rollingPlan) + { + rollingPlan.setCreateTime(DateUtils.getNowDate()); + return rollingPlanMapper.insertRollingPlan(rollingPlan); + } + + /** + * 修改滚动计划 + * + * @param rollingPlan 滚动计划 + * @return 结果 + */ + @Override + public int updateRollingPlan(RollingPlan rollingPlan) + { + rollingPlan.setUpdateTime(DateUtils.getNowDate()); + return rollingPlanMapper.updateRollingPlan(rollingPlan); + } + + /** + * 批量删除滚动计划 + * + * @param planIds 需要删除的滚动计划主键 + * @return 结果 + */ + @Override + public int deleteRollingPlanByPlanIds(Long[] planIds) + { + return rollingPlanMapper.deleteRollingPlanByPlanIds(planIds); + } + + /** + * 删除滚动计划信息 + * + * @param planId 滚动计划主键 + * @return 结果 + */ + @Override + public int deleteRollingPlanByPlanId(Long planId) + { + return rollingPlanMapper.deleteRollingPlanByPlanId(planId); + } +} \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/RollingPlanMapper.xml b/ruoyi-system/src/main/resources/mapper/system/RollingPlanMapper.xml new file mode 100644 index 0000000..40e634f --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/RollingPlanMapper.xml @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select plan_id, plan_number, machine_code, plan_year, version_week, production_mode, status, sales_area_code, country_code, sales_coordinator, customer_name, production_version, brand_code, sales_model, production_base, is_zero_execution, schedule_time, last_adjust_time, adjust_time, last_week_qty, current_week_qty, qty_difference, order_stage, order_type, packing_method, plan_sequence, is_first_order, is_direct_delivery, screen_requirement, panel_manufacturer, panel_requirement, core_requirement, product_category, product_size, remark, lock_week, create_by, create_time, update_by, update_time from rolling_plan + + + + + + + + insert into rolling_plan + + plan_number, + machine_code, + plan_year, + version_week, + production_mode, + status, + sales_area_code, + country_code, + sales_coordinator, + customer_name, + production_version, + brand_code, + sales_model, + production_base, + is_zero_execution, + schedule_time, + last_adjust_time, + adjust_time, + last_week_qty, + current_week_qty, + qty_difference, + order_stage, + order_type, + packing_method, + plan_sequence, + is_first_order, + is_direct_delivery, + screen_requirement, + panel_manufacturer, + panel_requirement, + core_requirement, + product_category, + product_size, + remark, + lock_week, + create_by, + create_time, + update_by, + update_time, + + + #{planNumber}, + #{machineCode}, + #{planYear}, + #{versionWeek}, + #{productionMode}, + #{status}, + #{salesAreaCode}, + #{countryCode}, + #{salesCoordinator}, + #{customerName}, + #{productionVersion}, + #{brandCode}, + #{salesModel}, + #{productionBase}, + #{isZeroExecution}, + #{scheduleTime}, + #{lastAdjustTime}, + #{adjustTime}, + #{lastWeekQty}, + #{currentWeekQty}, + #{qtyDifference}, + #{orderStage}, + #{orderType}, + #{packingMethod}, + #{planSequence}, + #{isFirstOrder}, + #{isDirectDelivery}, + #{screenRequirement}, + #{panelManufacturer}, + #{panelRequirement}, + #{coreRequirement}, + #{productCategory}, + #{productSize}, + #{remark}, + #{lockWeek}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + + + + + update rolling_plan + + plan_number = #{planNumber}, + machine_code = #{machineCode}, + plan_year = #{planYear}, + version_week = #{versionWeek}, + production_mode = #{productionMode}, + status = #{status}, + sales_area_code = #{salesAreaCode}, + country_code = #{countryCode}, + sales_coordinator = #{salesCoordinator}, + customer_name = #{customerName}, + production_version = #{productionVersion}, + brand_code = #{brandCode}, + sales_model = #{salesModel}, + production_base = #{productionBase}, + is_zero_execution = #{isZeroExecution}, + schedule_time = #{scheduleTime}, + last_adjust_time = #{lastAdjustTime}, + adjust_time = #{adjustTime}, + last_week_qty = #{lastWeekQty}, + current_week_qty = #{currentWeekQty}, + qty_difference = #{qtyDifference}, + order_stage = #{orderStage}, + order_type = #{orderType}, + packing_method = #{packingMethod}, + plan_sequence = #{planSequence}, + is_first_order = #{isFirstOrder}, + is_direct_delivery = #{isDirectDelivery}, + screen_requirement = #{screenRequirement}, + panel_manufacturer = #{panelManufacturer}, + panel_requirement = #{panelRequirement}, + core_requirement = #{coreRequirement}, + product_category = #{productCategory}, + product_size = #{productSize}, + remark = #{remark}, + lock_week = #{lockWeek}, + update_by = #{updateBy}, + update_time = #{updateTime}, + + where plan_id = #{planId} + + + + delete from rolling_plan where plan_id = #{planId} + + + + delete from rolling_plan where plan_id in + + #{planId} + + + \ No newline at end of file diff --git a/sql/gss/滚动计划.sql b/sql/gss/滚动计划.sql index e69de29..565be66 100644 --- a/sql/gss/滚动计划.sql +++ b/sql/gss/滚动计划.sql @@ -0,0 +1,78 @@ +CREATE TABLE `rolling_plan` ( + `plan_id` bigint NOT NULL AUTO_INCREMENT COMMENT '序号', + `plan_number` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '滚动计划号', + `machine_code` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '整机编码', + `plan_year` int NOT NULL COMMENT '年度', + `version_week` varchar(10) COLLATE utf8mb4_general_ci NOT NULL COMMENT '版本周次', + `production_mode` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '生产方式', + `status` char(1) COLLATE utf8mb4_general_ci DEFAULT '0' COMMENT '状态(0草稿 1确认 2关闭)', + `sales_area_code` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '销售区域编码', + `country_code` char(2) COLLATE utf8mb4_general_ci NOT NULL COMMENT '国家编码', + `sales_coordinator` varchar(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT '销售协调', + `customer_name` varchar(100) COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户名称', + `production_version` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '生产版本', + `brand_code` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '品牌编码', + `sales_model` varchar(64) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '销售型号', + `production_base` varchar(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT '生产地', + `is_zero_execution` char(1) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '是否执行0号(0否 1是)', + `schedule_time` datetime DEFAULT NULL COMMENT '排定时间', + `last_adjust_time` datetime DEFAULT NULL COMMENT '上版意向调整时间', + `adjust_time` datetime NOT NULL COMMENT '意向调整时间', + `last_week_qty` int DEFAULT '0' COMMENT '上周数量', + `current_week_qty` int NOT NULL COMMENT '本周数量', + `qty_difference` int DEFAULT '0' COMMENT '差异', + `order_stage` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '订单阶段', + `order_type` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '订单类别', + `packing_method` varchar(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT '出口包装方式', + `plan_sequence` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '计划序号', + `is_first_order` char(1) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '是否首单(0否 1是)', + `is_direct_delivery` char(1) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT '是否直发(0否 1是)', + `screen_requirement` varchar(200) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '屏要求', + `panel_manufacturer` varchar(64) COLLATE utf8mb4_general_ci NOT NULL COMMENT '面板厂家', + `panel_requirement` varchar(200) COLLATE utf8mb4_general_ci NOT NULL COMMENT '面板要求', + `core_requirement` varchar(200) COLLATE utf8mb4_general_ci NOT NULL COMMENT '机芯要求', + `product_category` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '产品类别', + `product_size` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT '尺寸', + `remark` varchar(500) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注', + `lock_week` varchar(10) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '锁定周次', + `create_by` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '创建者', + `create_time` datetime DEFAULT NULL COMMENT '创建时间', + `update_by` varchar(64) COLLATE utf8mb4_general_ci DEFAULT '' COMMENT '更新者', + `update_time` datetime DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`plan_id`), + UNIQUE KEY `uk_plan_number` (`plan_number`), + KEY `idx_machine_code` (`machine_code`), + KEY `idx_sales_area` (`sales_area_code`), + KEY `idx_country` (`country_code`), + KEY `idx_customer` (`customer_name`), + KEY `idx_brand` (`brand_code`) +) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='滚动计划表'; + +------------------------------- +-- 菜单 SQL +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('滚动计划管理', '1', '1', 'rollingPlan', 'system/rollingPlan/index', 1, 0, 'C', '0', '0', 'system:rollingPlan:list', 'time', 'admin', sysdate(), '', null, '滚动计划管理菜单'); + +-- 按钮父菜单ID +SELECT @parentId := LAST_INSERT_ID(); + +-- 按钮 SQL +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('滚动计划查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'system:rollingPlan:query', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('滚动计划新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'system:rollingPlan:add', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('滚动计划修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'system:rollingPlan:edit', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('滚动计划删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'system:rollingPlan:remove', '#', 'admin', sysdate(), '', null, ''); + +insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) +values('滚动计划导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'system:rollingPlan:export', '#', 'admin', sysdate(), '', null, ''); + +-- 修改菜单权限标识 +UPDATE sys_menu +SET perms = REPLACE(perms, 'system:rollingPlan:', 'system:rolling-plan:') +WHERE perms LIKE 'system:rollingPlan:%'; \ No newline at end of file