Browse Source

滚动计划管理

dev
xiaoyu 1 month ago
parent
commit
8321dc6638
  1. 103
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/RollingPlanController.java
  2. 158
      ruoyi-system/src/main/java/com/ruoyi/system/domain/RollingPlan.java
  3. 60
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/RollingPlanMapper.java
  4. 60
      ruoyi-system/src/main/java/com/ruoyi/system/service/IRollingPlanService.java
  5. 95
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RollingPlanServiceImpl.java
  6. 212
      ruoyi-system/src/main/resources/mapper/system/RollingPlanMapper.xml
  7. 78
      sql/gss/滚动计划.sql

103
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/RollingPlanController.java

@ -0,0 +1,103 @@ @@ -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<RollingPlan> 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<RollingPlan> list = rollingPlanService.selectRollingPlanList(rollingPlan);
ExcelUtil<RollingPlan> util = new ExcelUtil<RollingPlan>(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));
}
}

158
ruoyi-system/src/main/java/com/ruoyi/system/domain/RollingPlan.java

@ -0,0 +1,158 @@ @@ -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 方法略
}

60
ruoyi-system/src/main/java/com/ruoyi/system/mapper/RollingPlanMapper.java

@ -0,0 +1,60 @@ @@ -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<RollingPlan> 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);
}

60
ruoyi-system/src/main/java/com/ruoyi/system/service/IRollingPlanService.java

@ -0,0 +1,60 @@ @@ -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<RollingPlan> 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);
}

95
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RollingPlanServiceImpl.java

@ -0,0 +1,95 @@ @@ -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<RollingPlan> 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);
}
}

212
ruoyi-system/src/main/resources/mapper/system/RollingPlanMapper.xml

@ -0,0 +1,212 @@ @@ -0,0 +1,212 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.RollingPlanMapper">
<resultMap type="RollingPlan" id="RollingPlanResult">
<result property="planId" column="plan_id" />
<result property="planNumber" column="plan_number" />
<result property="machineCode" column="machine_code" />
<result property="planYear" column="plan_year" />
<result property="versionWeek" column="version_week" />
<result property="productionMode" column="production_mode" />
<result property="status" column="status" />
<result property="salesAreaCode" column="sales_area_code" />
<result property="countryCode" column="country_code" />
<result property="salesCoordinator" column="sales_coordinator" />
<result property="customerName" column="customer_name" />
<result property="productionVersion" column="production_version" />
<result property="brandCode" column="brand_code" />
<result property="salesModel" column="sales_model" />
<result property="productionBase" column="production_base" />
<result property="isZeroExecution" column="is_zero_execution" />
<result property="scheduleTime" column="schedule_time" />
<result property="lastAdjustTime" column="last_adjust_time" />
<result property="adjustTime" column="adjust_time" />
<result property="lastWeekQty" column="last_week_qty" />
<result property="currentWeekQty" column="current_week_qty" />
<result property="qtyDifference" column="qty_difference" />
<result property="orderStage" column="order_stage" />
<result property="orderType" column="order_type" />
<result property="packingMethod" column="packing_method" />
<result property="planSequence" column="plan_sequence" />
<result property="isFirstOrder" column="is_first_order" />
<result property="isDirectDelivery" column="is_direct_delivery" />
<result property="screenRequirement" column="screen_requirement" />
<result property="panelManufacturer" column="panel_manufacturer" />
<result property="panelRequirement" column="panel_requirement" />
<result property="coreRequirement" column="core_requirement" />
<result property="productCategory" column="product_category" />
<result property="productSize" column="product_size" />
<result property="remark" column="remark" />
<result property="lockWeek" column="lock_week" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectRollingPlanVo">
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
</sql>
<select id="selectRollingPlanList" parameterType="RollingPlan" resultMap="RollingPlanResult">
<include refid="selectRollingPlanVo"/>
<where>
<if test="planNumber != null and planNumber != ''"> and plan_number like concat('%', #{planNumber}, '%')</if>
<if test="machineCode != null and machineCode != ''"> and machine_code = #{machineCode}</if>
<if test="planYear != null "> and plan_year = #{planYear}</if>
<if test="versionWeek != null and versionWeek != ''"> and version_week = #{versionWeek}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="customerName != null and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
</where>
order by create_time desc
</select>
<select id="selectRollingPlanByPlanId" parameterType="Long" resultMap="RollingPlanResult">
<include refid="selectRollingPlanVo"/>
where plan_id = #{planId}
</select>
<insert id="insertRollingPlan" parameterType="RollingPlan" useGeneratedKeys="true" keyProperty="planId">
insert into rolling_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planNumber != null">plan_number,</if>
<if test="machineCode != null">machine_code,</if>
<if test="planYear != null">plan_year,</if>
<if test="versionWeek != null">version_week,</if>
<if test="productionMode != null">production_mode,</if>
<if test="status != null">status,</if>
<if test="salesAreaCode != null">sales_area_code,</if>
<if test="countryCode != null">country_code,</if>
<if test="salesCoordinator != null">sales_coordinator,</if>
<if test="customerName != null">customer_name,</if>
<if test="productionVersion != null">production_version,</if>
<if test="brandCode != null">brand_code,</if>
<if test="salesModel != null">sales_model,</if>
<if test="productionBase != null">production_base,</if>
<if test="isZeroExecution != null">is_zero_execution,</if>
<if test="scheduleTime != null">schedule_time,</if>
<if test="lastAdjustTime != null">last_adjust_time,</if>
<if test="adjustTime != null">adjust_time,</if>
<if test="lastWeekQty != null">last_week_qty,</if>
<if test="currentWeekQty != null">current_week_qty,</if>
<if test="qtyDifference != null">qty_difference,</if>
<if test="orderStage != null">order_stage,</if>
<if test="orderType != null">order_type,</if>
<if test="packingMethod != null">packing_method,</if>
<if test="planSequence != null">plan_sequence,</if>
<if test="isFirstOrder != null">is_first_order,</if>
<if test="isDirectDelivery != null">is_direct_delivery,</if>
<if test="screenRequirement != null">screen_requirement,</if>
<if test="panelManufacturer != null">panel_manufacturer,</if>
<if test="panelRequirement != null">panel_requirement,</if>
<if test="coreRequirement != null">core_requirement,</if>
<if test="productCategory != null">product_category,</if>
<if test="productSize != null">product_size,</if>
<if test="remark != null">remark,</if>
<if test="lockWeek != null">lock_week,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planNumber != null">#{planNumber},</if>
<if test="machineCode != null">#{machineCode},</if>
<if test="planYear != null">#{planYear},</if>
<if test="versionWeek != null">#{versionWeek},</if>
<if test="productionMode != null">#{productionMode},</if>
<if test="status != null">#{status},</if>
<if test="salesAreaCode != null">#{salesAreaCode},</if>
<if test="countryCode != null">#{countryCode},</if>
<if test="salesCoordinator != null">#{salesCoordinator},</if>
<if test="customerName != null">#{customerName},</if>
<if test="productionVersion != null">#{productionVersion},</if>
<if test="brandCode != null">#{brandCode},</if>
<if test="salesModel != null">#{salesModel},</if>
<if test="productionBase != null">#{productionBase},</if>
<if test="isZeroExecution != null">#{isZeroExecution},</if>
<if test="scheduleTime != null">#{scheduleTime},</if>
<if test="lastAdjustTime != null">#{lastAdjustTime},</if>
<if test="adjustTime != null">#{adjustTime},</if>
<if test="lastWeekQty != null">#{lastWeekQty},</if>
<if test="currentWeekQty != null">#{currentWeekQty},</if>
<if test="qtyDifference != null">#{qtyDifference},</if>
<if test="orderStage != null">#{orderStage},</if>
<if test="orderType != null">#{orderType},</if>
<if test="packingMethod != null">#{packingMethod},</if>
<if test="planSequence != null">#{planSequence},</if>
<if test="isFirstOrder != null">#{isFirstOrder},</if>
<if test="isDirectDelivery != null">#{isDirectDelivery},</if>
<if test="screenRequirement != null">#{screenRequirement},</if>
<if test="panelManufacturer != null">#{panelManufacturer},</if>
<if test="panelRequirement != null">#{panelRequirement},</if>
<if test="coreRequirement != null">#{coreRequirement},</if>
<if test="productCategory != null">#{productCategory},</if>
<if test="productSize != null">#{productSize},</if>
<if test="remark != null">#{remark},</if>
<if test="lockWeek != null">#{lockWeek},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateRollingPlan" parameterType="RollingPlan">
update rolling_plan
<trim prefix="SET" suffixOverrides=",">
<if test="planNumber != null">plan_number = #{planNumber},</if>
<if test="machineCode != null">machine_code = #{machineCode},</if>
<if test="planYear != null">plan_year = #{planYear},</if>
<if test="versionWeek != null">version_week = #{versionWeek},</if>
<if test="productionMode != null">production_mode = #{productionMode},</if>
<if test="status != null">status = #{status},</if>
<if test="salesAreaCode != null">sales_area_code = #{salesAreaCode},</if>
<if test="countryCode != null">country_code = #{countryCode},</if>
<if test="salesCoordinator != null">sales_coordinator = #{salesCoordinator},</if>
<if test="customerName != null">customer_name = #{customerName},</if>
<if test="productionVersion != null">production_version = #{productionVersion},</if>
<if test="brandCode != null">brand_code = #{brandCode},</if>
<if test="salesModel != null">sales_model = #{salesModel},</if>
<if test="productionBase != null">production_base = #{productionBase},</if>
<if test="isZeroExecution != null">is_zero_execution = #{isZeroExecution},</if>
<if test="scheduleTime != null">schedule_time = #{scheduleTime},</if>
<if test="lastAdjustTime != null">last_adjust_time = #{lastAdjustTime},</if>
<if test="adjustTime != null">adjust_time = #{adjustTime},</if>
<if test="lastWeekQty != null">last_week_qty = #{lastWeekQty},</if>
<if test="currentWeekQty != null">current_week_qty = #{currentWeekQty},</if>
<if test="qtyDifference != null">qty_difference = #{qtyDifference},</if>
<if test="orderStage != null">order_stage = #{orderStage},</if>
<if test="orderType != null">order_type = #{orderType},</if>
<if test="packingMethod != null">packing_method = #{packingMethod},</if>
<if test="planSequence != null">plan_sequence = #{planSequence},</if>
<if test="isFirstOrder != null">is_first_order = #{isFirstOrder},</if>
<if test="isDirectDelivery != null">is_direct_delivery = #{isDirectDelivery},</if>
<if test="screenRequirement != null">screen_requirement = #{screenRequirement},</if>
<if test="panelManufacturer != null">panel_manufacturer = #{panelManufacturer},</if>
<if test="panelRequirement != null">panel_requirement = #{panelRequirement},</if>
<if test="coreRequirement != null">core_requirement = #{coreRequirement},</if>
<if test="productCategory != null">product_category = #{productCategory},</if>
<if test="productSize != null">product_size = #{productSize},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="lockWeek != null">lock_week = #{lockWeek},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where plan_id = #{planId}
</update>
<delete id="deleteRollingPlanByPlanId" parameterType="Long">
delete from rolling_plan where plan_id = #{planId}
</delete>
<delete id="deleteRollingPlanByPlanIds" parameterType="String">
delete from rolling_plan where plan_id in
<foreach item="planId" collection="array" open="(" separator="," close=")">
#{planId}
</foreach>
</delete>
</mapper>

78
sql/gss/滚动计划.sql

@ -0,0 +1,78 @@ @@ -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:%';
Loading…
Cancel
Save