feat(mill): 新增二级-三级钢卷异常挂接与撤回功能

- 新增钢卷异常信息管理模块,包含实体类、服务接口、控制器和MyBatis映射文件
- 新增二级-三级钢卷异常挂接/撤回关系管理模块,支持挂接和撤回操作
- 在WmsCoilAbnormal实体类中新增sourceSystem字段,用于标识异常数据来源
- 实现bindToThird方法:将二级异常数据挂接到三级系统,自动匹配钢卷并创建关联关系
- 实现withdrawFromThird方法:从三级系统撤回已挂接的异常数据,更新关联状态
- 提供完整的CRUD接口和权限控制,支持异常数据的增删改查和导出功能
This commit is contained in:
2026-06-03 15:30:50 +08:00
parent 80d33d9a3b
commit 0b02122015
14 changed files with 1588 additions and 1 deletions

View File

@@ -0,0 +1,170 @@
<?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.MillCoilAbnormalMapper">
<resultMap type="MillCoilAbnormal" id="MillCoilAbnormalResult">
<result property="abnormalId" column="abnormal_id" />
<result property="currentCoilNo" column="current_coil_no" />
<result property="productionLine" column="production_line" />
<result property="position" column="position" />
<result property="length" column="length" />
<result property="startPosition" column="start_position" />
<result property="endPosition" column="end_position" />
<result property="defectCode" column="defect_code" />
<result property="defectType" column="defect_type" />
<result property="defectRate" column="defect_rate" />
<result property="defectWeight" column="defect_weight" />
<result property="degree" column="degree" />
<result property="judgeLevel" column="judge_level" />
<result property="judgeBy" column="judge_by" />
<result property="judgeTime" column="judge_time" />
<result property="mainMark" column="main_mark" />
<result property="wholeCoilMark" column="whole_coil_mark" />
<result property="remark" column="remark" />
<result property="delFlag" column="del_flag" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="plateSurface" column="plate_surface" />
<result property="attachmentFiles" column="attachment_files" />
<result property="thirdCoilId" column="third_coil_id" />
</resultMap>
<sql id="selectMillCoilAbnormalVo">
select abnormal_id, current_coil_no, production_line, position, length, start_position, end_position, defect_code, defect_type, defect_rate, defect_weight, degree, judge_level, judge_by, judge_time, main_mark, whole_coil_mark, remark, del_flag, create_time, create_by, update_time, update_by, plate_surface, attachment_files, third_coil_id from mill_coil_abnormal
</sql>
<select id="selectMillCoilAbnormalList" parameterType="MillCoilAbnormal" resultMap="MillCoilAbnormalResult">
<include refid="selectMillCoilAbnormalVo"/>
<where>
<if test="currentCoilNo != null and currentCoilNo != ''"> and current_coil_no = #{currentCoilNo}</if>
<if test="productionLine != null and productionLine != ''"> and production_line = #{productionLine}</if>
<if test="position != null and position != ''"> and position = #{position}</if>
<if test="length != null "> and length = #{length}</if>
<if test="startPosition != null "> and start_position = #{startPosition}</if>
<if test="endPosition != null "> and end_position = #{endPosition}</if>
<if test="defectCode != null and defectCode != ''"> and defect_code = #{defectCode}</if>
<if test="defectType != null and defectType != ''"> and defect_type = #{defectType}</if>
<if test="defectRate != null "> and defect_rate = #{defectRate}</if>
<if test="defectWeight != null "> and defect_weight = #{defectWeight}</if>
<if test="degree != null and degree != ''"> and degree = #{degree}</if>
<if test="judgeLevel != null and judgeLevel != ''"> and judge_level = #{judgeLevel}</if>
<if test="judgeBy != null and judgeBy != ''"> and judge_by = #{judgeBy}</if>
<if test="judgeTime != null "> and judge_time = #{judgeTime}</if>
<if test="mainMark != null "> and main_mark = #{mainMark}</if>
<if test="wholeCoilMark != null "> and whole_coil_mark = #{wholeCoilMark}</if>
<if test="plateSurface != null and plateSurface != ''"> and plate_surface = #{plateSurface}</if>
<if test="attachmentFiles != null and attachmentFiles != ''"> and attachment_files = #{attachmentFiles}</if>
<if test="thirdCoilId != null "> and third_coil_id = #{thirdCoilId}</if>
</where>
</select>
<select id="selectMillCoilAbnormalByAbnormalId" parameterType="Long" resultMap="MillCoilAbnormalResult">
<include refid="selectMillCoilAbnormalVo"/>
where abnormal_id = #{abnormalId}
</select>
<insert id="insertMillCoilAbnormal" parameterType="MillCoilAbnormal" useGeneratedKeys="true" keyProperty="abnormalId">
insert into mill_coil_abnormal
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="currentCoilNo != null">current_coil_no,</if>
<if test="productionLine != null">production_line,</if>
<if test="position != null">position,</if>
<if test="length != null">length,</if>
<if test="startPosition != null">start_position,</if>
<if test="endPosition != null">end_position,</if>
<if test="defectCode != null">defect_code,</if>
<if test="defectType != null">defect_type,</if>
<if test="defectRate != null">defect_rate,</if>
<if test="defectWeight != null">defect_weight,</if>
<if test="degree != null">degree,</if>
<if test="judgeLevel != null">judge_level,</if>
<if test="judgeBy != null">judge_by,</if>
<if test="judgeTime != null">judge_time,</if>
<if test="mainMark != null">main_mark,</if>
<if test="wholeCoilMark != null">whole_coil_mark,</if>
<if test="remark != null">remark,</if>
<if test="delFlag != null">del_flag,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="plateSurface != null">plate_surface,</if>
<if test="attachmentFiles != null">attachment_files,</if>
<if test="thirdCoilId != null">third_coil_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="currentCoilNo != null">#{currentCoilNo},</if>
<if test="productionLine != null">#{productionLine},</if>
<if test="position != null">#{position},</if>
<if test="length != null">#{length},</if>
<if test="startPosition != null">#{startPosition},</if>
<if test="endPosition != null">#{endPosition},</if>
<if test="defectCode != null">#{defectCode},</if>
<if test="defectType != null">#{defectType},</if>
<if test="defectRate != null">#{defectRate},</if>
<if test="defectWeight != null">#{defectWeight},</if>
<if test="degree != null">#{degree},</if>
<if test="judgeLevel != null">#{judgeLevel},</if>
<if test="judgeBy != null">#{judgeBy},</if>
<if test="judgeTime != null">#{judgeTime},</if>
<if test="mainMark != null">#{mainMark},</if>
<if test="wholeCoilMark != null">#{wholeCoilMark},</if>
<if test="remark != null">#{remark},</if>
<if test="delFlag != null">#{delFlag},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="plateSurface != null">#{plateSurface},</if>
<if test="attachmentFiles != null">#{attachmentFiles},</if>
<if test="thirdCoilId != null">#{thirdCoilId},</if>
</trim>
</insert>
<update id="updateMillCoilAbnormal" parameterType="MillCoilAbnormal">
update mill_coil_abnormal
<trim prefix="SET" suffixOverrides=",">
<if test="currentCoilNo != null">current_coil_no = #{currentCoilNo},</if>
<if test="productionLine != null">production_line = #{productionLine},</if>
<if test="position != null">position = #{position},</if>
<if test="length != null">length = #{length},</if>
<if test="startPosition != null">start_position = #{startPosition},</if>
<if test="endPosition != null">end_position = #{endPosition},</if>
<if test="defectCode != null">defect_code = #{defectCode},</if>
<if test="defectType != null">defect_type = #{defectType},</if>
<if test="defectRate != null">defect_rate = #{defectRate},</if>
<if test="defectWeight != null">defect_weight = #{defectWeight},</if>
<if test="degree != null">degree = #{degree},</if>
<if test="judgeLevel != null">judge_level = #{judgeLevel},</if>
<if test="judgeBy != null">judge_by = #{judgeBy},</if>
<if test="judgeTime != null">judge_time = #{judgeTime},</if>
<if test="mainMark != null">main_mark = #{mainMark},</if>
<if test="wholeCoilMark != null">whole_coil_mark = #{wholeCoilMark},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="plateSurface != null">plate_surface = #{plateSurface},</if>
<if test="attachmentFiles != null">attachment_files = #{attachmentFiles},</if>
<if test="thirdCoilId != null">third_coil_id = #{thirdCoilId},</if>
</trim>
where abnormal_id = #{abnormalId}
</update>
<delete id="deleteMillCoilAbnormalByAbnormalId" parameterType="Long">
delete from mill_coil_abnormal where abnormal_id = #{abnormalId}
</delete>
<delete id="deleteMillCoilAbnormalByAbnormalIds" parameterType="String">
delete from mill_coil_abnormal where abnormal_id in
<foreach item="abnormalId" collection="array" open="(" separator="," close=")">
#{abnormalId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,100 @@
<?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.MillCoilAbnormalRelationMapper">
<resultMap type="MillCoilAbnormalRelation" id="MillCoilAbnormalRelationResult">
<result property="relationId" column="relation_id" />
<result property="secondAbnormalId" column="second_abnormal_id" />
<result property="thirdCoilId" column="third_coil_id" />
<result property="thirdAbnormalId" column="third_abnormal_id" />
<result property="currentCoilNo" column="current_coil_no" />
<result property="bindStatus" column="bind_status" />
<result property="bindTime" column="bind_time" />
<result property="withdrawTime" column="withdraw_time" />
<result property="operateUser" column="operate_user" />
<result property="operateRemark" column="operate_remark" />
<result property="createTime" column="create_time" />
</resultMap>
<sql id="selectMillCoilAbnormalRelationVo">
select relation_id, second_abnormal_id, third_coil_id, third_abnormal_id, current_coil_no, bind_status, bind_time, withdraw_time, operate_user, operate_remark, create_time from mill_coil_abnormal_relation
</sql>
<select id="selectMillCoilAbnormalRelationList" parameterType="MillCoilAbnormalRelation" resultMap="MillCoilAbnormalRelationResult">
<include refid="selectMillCoilAbnormalRelationVo"/>
<where>
<if test="secondAbnormalId != null "> and second_abnormal_id = #{secondAbnormalId}</if>
<if test="thirdCoilId != null "> and third_coil_id = #{thirdCoilId}</if>
<if test="thirdAbnormalId != null "> and third_abnormal_id = #{thirdAbnormalId}</if>
<if test="currentCoilNo != null and currentCoilNo != ''"> and current_coil_no = #{currentCoilNo}</if>
<if test="bindStatus != null "> and bind_status = #{bindStatus}</if>
<if test="bindTime != null "> and bind_time = #{bindTime}</if>
<if test="withdrawTime != null "> and withdraw_time = #{withdrawTime}</if>
<if test="operateUser != null and operateUser != ''"> and operate_user = #{operateUser}</if>
<if test="operateRemark != null and operateRemark != ''"> and operate_remark = #{operateRemark}</if>
</where>
</select>
<select id="selectMillCoilAbnormalRelationByRelationId" parameterType="Long" resultMap="MillCoilAbnormalRelationResult">
<include refid="selectMillCoilAbnormalRelationVo"/>
where relation_id = #{relationId}
</select>
<insert id="insertMillCoilAbnormalRelation" parameterType="MillCoilAbnormalRelation" useGeneratedKeys="true" keyProperty="relationId">
insert into mill_coil_abnormal_relation
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="secondAbnormalId != null">second_abnormal_id,</if>
<if test="thirdCoilId != null">third_coil_id,</if>
<if test="thirdAbnormalId != null">third_abnormal_id,</if>
<if test="currentCoilNo != null">current_coil_no,</if>
<if test="bindStatus != null">bind_status,</if>
<if test="bindTime != null">bind_time,</if>
<if test="withdrawTime != null">withdraw_time,</if>
<if test="operateUser != null">operate_user,</if>
<if test="operateRemark != null">operate_remark,</if>
<if test="createTime != null">create_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="secondAbnormalId != null">#{secondAbnormalId},</if>
<if test="thirdCoilId != null">#{thirdCoilId},</if>
<if test="thirdAbnormalId != null">#{thirdAbnormalId},</if>
<if test="currentCoilNo != null">#{currentCoilNo},</if>
<if test="bindStatus != null">#{bindStatus},</if>
<if test="bindTime != null">#{bindTime},</if>
<if test="withdrawTime != null">#{withdrawTime},</if>
<if test="operateUser != null">#{operateUser},</if>
<if test="operateRemark != null">#{operateRemark},</if>
<if test="createTime != null">#{createTime},</if>
</trim>
</insert>
<update id="updateMillCoilAbnormalRelation" parameterType="MillCoilAbnormalRelation">
update mill_coil_abnormal_relation
<trim prefix="SET" suffixOverrides=",">
<if test="secondAbnormalId != null">second_abnormal_id = #{secondAbnormalId},</if>
<if test="thirdCoilId != null">third_coil_id = #{thirdCoilId},</if>
<if test="thirdAbnormalId != null">third_abnormal_id = #{thirdAbnormalId},</if>
<if test="currentCoilNo != null">current_coil_no = #{currentCoilNo},</if>
<if test="bindStatus != null">bind_status = #{bindStatus},</if>
<if test="bindTime != null">bind_time = #{bindTime},</if>
<if test="withdrawTime != null">withdraw_time = #{withdrawTime},</if>
<if test="operateUser != null">operate_user = #{operateUser},</if>
<if test="operateRemark != null">operate_remark = #{operateRemark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim>
where relation_id = #{relationId}
</update>
<delete id="deleteMillCoilAbnormalRelationByRelationId" parameterType="Long">
delete from mill_coil_abnormal_relation where relation_id = #{relationId}
</delete>
<delete id="deleteMillCoilAbnormalRelationByRelationIds" parameterType="String">
delete from mill_coil_abnormal_relation where relation_id in
<foreach item="relationId" collection="array" open="(" separator="," close=")">
#{relationId}
</foreach>
</delete>
</mapper>

View File

@@ -22,6 +22,7 @@
<result property="mainMark" column="main_mark" />
<result property="wholeCoilMark" column="whole_coil_mark" />
<result property="attachmentFiles" column="attachment_files" />
<result property="sourceSystem" column="source_system" />
<result property="remark" column="remark" />
<result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" />
@@ -35,7 +36,7 @@
SELECT a.abnormal_id, a.coil_id, a.production_line, a.position, a.plate_surface,
a.length, a.start_position, a.end_position, a.defect_code, a.defect_type,
a.defect_rate, a.defect_weight, a.degree, a.judge_level, a.judge_by, a.judge_time,
a.main_mark, a.whole_coil_mark, a.attachment_files, a.remark, a.del_flag,
a.main_mark, a.whole_coil_mark, a.attachment_files, a.source_system, a.remark, a.del_flag,
a.create_by, a.create_time, a.update_by, a.update_time,
mc.current_coil_no
FROM wms_coil_abnormal a
@@ -107,6 +108,7 @@
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="sourceSystem != null">source_system,</if>
del_flag,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -130,6 +132,7 @@
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="sourceSystem != null">#{sourceSystem},</if>
0,
</trim>
</insert>