feat(mill): 完成工艺管理与生产计划全栈业务模块
- 新增三张业务表 SQL:mill_process_recipe / mill_process_pass / mill_production_plan - 后端:Domain + Mapper + MyBatis XML + Service + Controller(工艺方案 & 生产计划) - 生产计划支持队列排序(sortNo)、上移/下移、软删除 - 工艺方案支持道次批量保存、事务管理 - 前端:工艺管理页(左侧方案列表 + 右侧表单 + 道次内联表格) - 前端:生产计划页(轧制队列 + 轧制工艺展示 + 操作面板 + 底部带卷状态栏) - 注册 /mill/process 与 /mill/plan 前端路由 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<?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.mill.mapper.MillProcessPassMapper">
|
||||
|
||||
<resultMap id="BaseRM" type="com.ruoyi.mill.domain.MillProcessPass">
|
||||
<id property="id" column="id"/>
|
||||
<result property="recipeId" column="recipe_id"/>
|
||||
<result property="passNo" column="pass_no"/>
|
||||
<result property="inThick" column="in_thick"/>
|
||||
<result property="outThick" column="out_thick"/>
|
||||
<result property="width" column="width"/>
|
||||
<result property="rollForce" column="roll_force"/>
|
||||
<result property="inTension" column="in_tension"/>
|
||||
<result property="outTension" column="out_tension"/>
|
||||
<result property="maxSpeed" column="max_speed"/>
|
||||
<result property="inUnitTension" column="in_unit_tension"/>
|
||||
<result property="outUnitTension" column="out_unit_tension"/>
|
||||
<result property="reduction" column="reduction"/>
|
||||
<result property="totalReduction" column="total_reduction"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="selectByRecipeId" resultMap="BaseRM">
|
||||
SELECT id, recipe_id, pass_no, in_thick, out_thick, width,
|
||||
roll_force, in_tension, out_tension, max_speed,
|
||||
in_unit_tension, out_unit_tension, reduction, total_reduction,
|
||||
del_flag, create_by, create_time, update_by, update_time, remark
|
||||
FROM mill_process_pass
|
||||
WHERE recipe_id = #{recipeId} AND del_flag = '0'
|
||||
ORDER BY pass_no ASC
|
||||
</select>
|
||||
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO mill_process_pass (
|
||||
recipe_id, pass_no, in_thick, out_thick, width,
|
||||
roll_force, in_tension, out_tension, max_speed,
|
||||
in_unit_tension, out_unit_tension, reduction, total_reduction,
|
||||
create_by, create_time, update_by, update_time, remark, del_flag
|
||||
) VALUES
|
||||
<foreach collection="list" item="p" separator=",">
|
||||
(#{p.recipeId}, #{p.passNo}, #{p.inThick}, #{p.outThick}, #{p.width},
|
||||
#{p.rollForce}, #{p.inTension}, #{p.outTension}, #{p.maxSpeed},
|
||||
#{p.inUnitTension}, #{p.outUnitTension}, #{p.reduction}, #{p.totalReduction},
|
||||
#{p.createBy}, NOW(), #{p.updateBy}, NOW(), #{p.remark}, '0')
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="deleteByRecipeId">
|
||||
UPDATE mill_process_pass SET del_flag = '2', update_time = NOW()
|
||||
WHERE recipe_id = #{recipeId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,89 @@
|
||||
<?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.mill.mapper.MillProcessRecipeMapper">
|
||||
|
||||
<resultMap id="BaseRM" type="com.ruoyi.mill.domain.MillProcessRecipe">
|
||||
<id property="id" column="id"/>
|
||||
<result property="recipeNo" column="recipe_no"/>
|
||||
<result property="alloyNo" column="alloy_no"/>
|
||||
<result property="passCount" column="pass_count"/>
|
||||
<result property="inThick" column="in_thick"/>
|
||||
<result property="outThick" column="out_thick"/>
|
||||
<result property="outWidth" column="out_width"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="cols">
|
||||
id, recipe_no, alloy_no, pass_count, in_thick, out_thick, out_width,
|
||||
status, del_flag, create_by, create_time, update_by, update_time, remark
|
||||
</sql>
|
||||
|
||||
<select id="selectList" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/>
|
||||
FROM mill_process_recipe
|
||||
WHERE del_flag = '0'
|
||||
<if test="recipeNo != null and recipeNo != ''">
|
||||
AND recipe_no LIKE CONCAT('%', #{recipeNo}, '%')
|
||||
</if>
|
||||
<if test="alloyNo != null and alloyNo != ''">
|
||||
AND alloy_no LIKE CONCAT('%', #{alloyNo}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
ORDER BY id ASC
|
||||
</select>
|
||||
|
||||
<select id="selectById" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/> FROM mill_process_recipe
|
||||
WHERE id = #{id} AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectByRecipeNo" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/> FROM mill_process_recipe
|
||||
WHERE recipe_no = #{recipeNo} AND del_flag = '0' LIMIT 1
|
||||
</select>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO mill_process_recipe (
|
||||
recipe_no, alloy_no, pass_count, in_thick, out_thick, out_width,
|
||||
status, create_by, create_time, update_by, update_time, remark, del_flag
|
||||
) VALUES (
|
||||
#{recipeNo}, #{alloyNo}, #{passCount}, #{inThick}, #{outThick}, #{outWidth},
|
||||
#{status}, #{createBy}, NOW(), #{updateBy}, NOW(), #{remark}, '0'
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE mill_process_recipe
|
||||
SET recipe_no = #{recipeNo},
|
||||
alloy_no = #{alloyNo},
|
||||
pass_count = #{passCount},
|
||||
in_thick = #{inThick},
|
||||
out_thick = #{outThick},
|
||||
out_width = #{outWidth},
|
||||
status = #{status},
|
||||
update_by = #{updateBy},
|
||||
update_time = NOW(),
|
||||
remark = #{remark}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteById">
|
||||
UPDATE mill_process_recipe SET del_flag = '2', update_time = NOW() WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteBatchByIds">
|
||||
UPDATE mill_process_recipe SET del_flag = '2', update_time = NOW()
|
||||
WHERE id IN
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">#{id}</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,125 @@
|
||||
<?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.mill.mapper.MillProductionPlanMapper">
|
||||
|
||||
<resultMap id="BaseRM" type="com.ruoyi.mill.domain.MillProductionPlan">
|
||||
<id property="id" column="id"/>
|
||||
<result property="planNo" column="plan_no"/>
|
||||
<result property="matSeqNo" column="mat_seq_no"/>
|
||||
<result property="unitCode" column="unit_code"/>
|
||||
<result property="planType" column="plan_type"/>
|
||||
<result property="planStatus" column="plan_status"/>
|
||||
<result property="prodStatus" column="prod_status"/>
|
||||
<result property="sortNo" column="sort_no"/>
|
||||
<result property="inMatNo" column="in_mat_no"/>
|
||||
<result property="inMatThick" column="in_mat_thick"/>
|
||||
<result property="inMatWidth" column="in_mat_width"/>
|
||||
<result property="inMatWt" column="in_mat_wt"/>
|
||||
<result property="inMatLen" column="in_mat_len"/>
|
||||
<result property="inMatInDia" column="in_mat_in_dia"/>
|
||||
<result property="inMatDia" column="in_mat_dia"/>
|
||||
<result property="pono" column="pono"/>
|
||||
<result property="sgSign" column="sg_sign"/>
|
||||
<result property="outMatNo" column="out_mat_no"/>
|
||||
<result property="outThick" column="out_thick"/>
|
||||
<result property="recipeId" column="recipe_id"/>
|
||||
<result property="recipeNo" column="recipe_no"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="cols">
|
||||
id, plan_no, mat_seq_no, unit_code, plan_type, plan_status, prod_status, sort_no,
|
||||
in_mat_no, in_mat_thick, in_mat_width, in_mat_wt, in_mat_len, in_mat_in_dia, in_mat_dia,
|
||||
pono, sg_sign, out_mat_no, out_thick, recipe_id, recipe_no,
|
||||
del_flag, create_by, create_time, update_by, update_time, remark
|
||||
</sql>
|
||||
|
||||
<select id="selectList" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/> FROM mill_production_plan
|
||||
WHERE del_flag = '0'
|
||||
<if test="inMatNo != null and inMatNo != ''">
|
||||
AND in_mat_no LIKE CONCAT('%', #{inMatNo}, '%')
|
||||
</if>
|
||||
<if test="sgSign != null and sgSign != ''">
|
||||
AND sg_sign LIKE CONCAT('%', #{sgSign}, '%')
|
||||
</if>
|
||||
<if test="planStatus != null and planStatus != ''">
|
||||
AND plan_status = #{planStatus}
|
||||
</if>
|
||||
<if test="params != null and params.beginTime != null and params.beginTime != ''">
|
||||
AND DATE(create_time) >= #{params.beginTime}
|
||||
</if>
|
||||
<if test="params != null and params.endTime != null and params.endTime != ''">
|
||||
AND DATE(create_time) <= #{params.endTime}
|
||||
</if>
|
||||
ORDER BY sort_no ASC, id ASC
|
||||
</select>
|
||||
|
||||
<select id="selectById" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/> FROM mill_production_plan
|
||||
WHERE id = #{id} AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectByPlanNo" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/> FROM mill_production_plan
|
||||
WHERE plan_no = #{planNo} AND del_flag = '0' LIMIT 1
|
||||
</select>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
INSERT INTO mill_production_plan (
|
||||
plan_no, mat_seq_no, unit_code, plan_type, plan_status, prod_status, sort_no,
|
||||
in_mat_no, in_mat_thick, in_mat_width, in_mat_wt, in_mat_len, in_mat_in_dia, in_mat_dia,
|
||||
pono, sg_sign, out_mat_no, out_thick, recipe_id, recipe_no,
|
||||
create_by, create_time, update_by, update_time, remark, del_flag
|
||||
) VALUES (
|
||||
#{planNo}, #{matSeqNo}, #{unitCode}, #{planType},
|
||||
IFNULL(#{planStatus},'0'), IFNULL(#{prodStatus},'Idle'), IFNULL(#{sortNo},0),
|
||||
#{inMatNo}, #{inMatThick}, #{inMatWidth}, #{inMatWt}, #{inMatLen}, #{inMatInDia}, #{inMatDia},
|
||||
#{pono}, #{sgSign}, #{outMatNo}, #{outThick}, #{recipeId}, #{recipeNo},
|
||||
#{createBy}, NOW(), #{updateBy}, NOW(), #{remark}, '0'
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE mill_production_plan
|
||||
SET plan_status = #{planStatus},
|
||||
prod_status = #{prodStatus},
|
||||
in_mat_no = #{inMatNo},
|
||||
in_mat_thick = #{inMatThick},
|
||||
in_mat_width = #{inMatWidth},
|
||||
in_mat_wt = #{inMatWt},
|
||||
in_mat_len = #{inMatLen},
|
||||
in_mat_in_dia= #{inMatInDia},
|
||||
in_mat_dia = #{inMatDia},
|
||||
pono = #{pono},
|
||||
sg_sign = #{sgSign},
|
||||
out_mat_no = #{outMatNo},
|
||||
out_thick = #{outThick},
|
||||
recipe_id = #{recipeId},
|
||||
recipe_no = #{recipeNo},
|
||||
update_by = #{updateBy},
|
||||
update_time = NOW(),
|
||||
remark = #{remark}
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="deleteById">
|
||||
UPDATE mill_production_plan SET del_flag = '2', update_time = NOW() WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="incrementSortFrom">
|
||||
UPDATE mill_production_plan SET sort_no = sort_no + 1
|
||||
WHERE sort_no >= #{targetSort} AND del_flag = '0'
|
||||
</update>
|
||||
|
||||
<update id="updateSortNo">
|
||||
UPDATE mill_production_plan SET sort_no = #{sortNo} WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user