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,104 @@
package com.ruoyi.mill.controller;
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.mill.domain.MillCoilAbnormal;
import com.ruoyi.mill.service.IMillCoilAbnormalService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 钢卷异常信息Controller
*
* @author ruoyi
* @date 2026-06-03
*/
@RestController
@RequestMapping("/mill/abnormal")
public class MillCoilAbnormalController extends BaseController
{
@Autowired
private IMillCoilAbnormalService millCoilAbnormalService;
/**
* 查询钢卷异常信息列表
*/
@PreAuthorize("@ss.hasPermi('mill:abnormal:list')")
@GetMapping("/list")
public TableDataInfo list(MillCoilAbnormal millCoilAbnormal)
{
startPage();
List<MillCoilAbnormal> list = millCoilAbnormalService.selectMillCoilAbnormalList(millCoilAbnormal);
return getDataTable(list);
}
/**
* 导出钢卷异常信息列表
*/
@PreAuthorize("@ss.hasPermi('mill:abnormal:export')")
@Log(title = "钢卷异常信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MillCoilAbnormal millCoilAbnormal)
{
List<MillCoilAbnormal> list = millCoilAbnormalService.selectMillCoilAbnormalList(millCoilAbnormal);
ExcelUtil<MillCoilAbnormal> util = new ExcelUtil<MillCoilAbnormal>(MillCoilAbnormal.class);
util.exportExcel(response, list, "钢卷异常信息数据");
}
/**
* 获取钢卷异常信息详细信息
*/
@PreAuthorize("@ss.hasPermi('mill:abnormal:query')")
@GetMapping(value = "/{abnormalId}")
public AjaxResult getInfo(@PathVariable("abnormalId") Long abnormalId)
{
return success(millCoilAbnormalService.selectMillCoilAbnormalByAbnormalId(abnormalId));
}
/**
* 新增钢卷异常信息
*/
@PreAuthorize("@ss.hasPermi('mill:abnormal:add')")
@Log(title = "钢卷异常信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MillCoilAbnormal millCoilAbnormal)
{
return toAjax(millCoilAbnormalService.insertMillCoilAbnormal(millCoilAbnormal));
}
/**
* 修改钢卷异常信息
*/
@PreAuthorize("@ss.hasPermi('mill:abnormal:edit')")
@Log(title = "钢卷异常信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MillCoilAbnormal millCoilAbnormal)
{
return toAjax(millCoilAbnormalService.updateMillCoilAbnormal(millCoilAbnormal));
}
/**
* 删除钢卷异常信息
*/
@PreAuthorize("@ss.hasPermi('mill:abnormal:remove')")
@Log(title = "钢卷异常信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{abnormalIds}")
public AjaxResult remove(@PathVariable Long[] abnormalIds)
{
return toAjax(millCoilAbnormalService.deleteMillCoilAbnormalByAbnormalIds(abnormalIds));
}
}

View File

@@ -0,0 +1,129 @@
package com.ruoyi.mill.controller;
import java.util.List;
import java.util.Map;
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.mill.domain.MillCoilAbnormalRelation;
import com.ruoyi.mill.service.IMillCoilAbnormalRelationService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 二级-三级钢卷异常挂接/撤回关系Controller
*
* @author ruoyi
* @date 2026-06-03
*/
@RestController
@RequestMapping("/mill/relation")
public class MillCoilAbnormalRelationController extends BaseController
{
@Autowired
private IMillCoilAbnormalRelationService millCoilAbnormalRelationService;
/**
* 查询二级-三级钢卷异常挂接/撤回关系列表
*/
@PreAuthorize("@ss.hasPermi('mill:relation:list')")
@GetMapping("/list")
public TableDataInfo list(MillCoilAbnormalRelation millCoilAbnormalRelation)
{
startPage();
List<MillCoilAbnormalRelation> list = millCoilAbnormalRelationService.selectMillCoilAbnormalRelationList(millCoilAbnormalRelation);
return getDataTable(list);
}
/**
* 导出二级-三级钢卷异常挂接/撤回关系列表
*/
@PreAuthorize("@ss.hasPermi('mill:relation:export')")
@Log(title = "二级-三级钢卷异常挂接/撤回关系", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, MillCoilAbnormalRelation millCoilAbnormalRelation)
{
List<MillCoilAbnormalRelation> list = millCoilAbnormalRelationService.selectMillCoilAbnormalRelationList(millCoilAbnormalRelation);
ExcelUtil<MillCoilAbnormalRelation> util = new ExcelUtil<MillCoilAbnormalRelation>(MillCoilAbnormalRelation.class);
util.exportExcel(response, list, "二级-三级钢卷异常挂接/撤回关系数据");
}
/**
* 获取二级-三级钢卷异常挂接/撤回关系详细信息
*/
@PreAuthorize("@ss.hasPermi('mill:relation:query')")
@GetMapping(value = "/{relationId}")
public AjaxResult getInfo(@PathVariable("relationId") Long relationId)
{
return success(millCoilAbnormalRelationService.selectMillCoilAbnormalRelationByRelationId(relationId));
}
/**
* 新增二级-三级钢卷异常挂接/撤回关系
*/
@PreAuthorize("@ss.hasPermi('mill:relation:add')")
@Log(title = "二级-三级钢卷异常挂接/撤回关系", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MillCoilAbnormalRelation millCoilAbnormalRelation)
{
return toAjax(millCoilAbnormalRelationService.insertMillCoilAbnormalRelation(millCoilAbnormalRelation));
}
/**
* 修改二级-三级钢卷异常挂接/撤回关系
*/
@PreAuthorize("@ss.hasPermi('mill:relation:edit')")
@Log(title = "二级-三级钢卷异常挂接/撤回关系", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MillCoilAbnormalRelation millCoilAbnormalRelation)
{
return toAjax(millCoilAbnormalRelationService.updateMillCoilAbnormalRelation(millCoilAbnormalRelation));
}
/**
* 删除二级-三级钢卷异常挂接/撤回关系
*/
@PreAuthorize("@ss.hasPermi('mill:relation:remove')")
@Log(title = "二级-三级钢卷异常挂接/撤回关系", businessType = BusinessType.DELETE)
@DeleteMapping("/{relationIds}")
public AjaxResult remove(@PathVariable Long[] relationIds)
{
return toAjax(millCoilAbnormalRelationService.deleteMillCoilAbnormalRelationByRelationIds(relationIds));
}
/**
* 挂接:将二级异常数据新增到三级异常表
*/
@PreAuthorize("@ss.hasPermi('mill:relation:bind')")
@Log(title = "二级异常挂接到三级", businessType = BusinessType.INSERT)
@PostMapping("/bind/{secondAbnormalId}")
public AjaxResult bind(@PathVariable Long secondAbnormalId)
{
Long relationId = millCoilAbnormalRelationService.bindToThird(secondAbnormalId, getUsername());
return success(relationId);
}
/**
* 撤回:逻辑删除三级异常表中的挂接数据
*/
@PreAuthorize("@ss.hasPermi('mill:relation:withdraw')")
@Log(title = "二级异常从三级撤回", businessType = BusinessType.UPDATE)
@PostMapping("/withdraw/{relationId}")
public AjaxResult withdraw(@PathVariable Long relationId, @RequestBody Map<String, String> body)
{
String operateRemark = body != null ? body.get("operateRemark") : null;
return toAjax(millCoilAbnormalRelationService.withdrawFromThird(relationId, getUsername(), operateRemark));
}
}

View File

@@ -0,0 +1,345 @@
package com.ruoyi.mill.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
/**
* 钢卷异常信息对象 mill_coil_abnormal
*
* @author ruoyi
* @date 2026-06-03
*/
public class MillCoilAbnormal extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long abnormalId;
/** 当前钢卷号 */
@Excel(name = "当前钢卷号")
private String currentCoilNo;
/** 产线名称 */
@Excel(name = "产线名称")
private String productionLine;
/** 位置(上下,操作侧,中间,驱动侧) */
@Excel(name = "位置", readConverterExp = "上=下,操作侧,中间,驱动侧")
private String position;
/** 缺陷长度 */
@Excel(name = "缺陷长度")
private BigDecimal length;
/** 缺陷开始位置 */
@Excel(name = "缺陷开始位置")
private BigDecimal startPosition;
/** 缺陷结束位置 */
@Excel(name = "缺陷结束位置")
private BigDecimal endPosition;
/** 缺陷代码S=表面缺陷、E=边部问题、M=尺寸问题、G=收卷问题) */
@Excel(name = "缺陷代码", readConverterExp = "S==表面缺陷、E=边部问题、M=尺寸问题、G=收卷问题")
private String defectCode;
/** 缺陷类型(更详细的缺陷分类,如划痕、边裂、厚度超标等) */
@Excel(name = "缺陷类型", readConverterExp = "更=详细的缺陷分类,如划痕、边裂、厚度超标等")
private String defectType;
/** 缺陷率百分比如0.05表示5% */
@Excel(name = "缺陷率", readConverterExp = "百=分比如0.05表示5%")
private BigDecimal defectRate;
/** 缺陷重量单位kg */
@Excel(name = "缺陷重量", readConverterExp = "单=位kg")
private BigDecimal defectWeight;
/** 程度(轻微、重度、严重) */
@Excel(name = "程度", readConverterExp = "轻=微、重度、严重")
private String degree;
/** 判级 */
@Excel(name = "判级")
private String judgeLevel;
/** 判级人 */
@Excel(name = "判级人")
private String judgeBy;
/** 判级时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "判级时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date judgeTime;
/** 主标记1=是0=否) */
@Excel(name = "主标记", readConverterExp = "1==是0=否")
private Long mainMark;
/** 整卷标记1=是0=否) */
@Excel(name = "整卷标记", readConverterExp = "1==是0=否")
private Long wholeCoilMark;
/** 删除标志0=正常1=已删除) */
private Integer delFlag;
/** 上下板面 */
@Excel(name = "上下板面")
private String plateSurface;
/** 附件路径(多个用英文逗号分隔) */
@Excel(name = "附件路径", readConverterExp = "多=个用英文逗号分隔")
private String attachmentFiles;
/** 匹配到的三级系统钢卷ID */
@Excel(name = "匹配到的三级系统钢卷ID")
private Long thirdCoilId;
public void setAbnormalId(Long abnormalId)
{
this.abnormalId = abnormalId;
}
public Long getAbnormalId()
{
return abnormalId;
}
public void setCurrentCoilNo(String currentCoilNo)
{
this.currentCoilNo = currentCoilNo;
}
public String getCurrentCoilNo()
{
return currentCoilNo;
}
public void setProductionLine(String productionLine)
{
this.productionLine = productionLine;
}
public String getProductionLine()
{
return productionLine;
}
public void setPosition(String position)
{
this.position = position;
}
public String getPosition()
{
return position;
}
public void setLength(BigDecimal length)
{
this.length = length;
}
public BigDecimal getLength()
{
return length;
}
public void setStartPosition(BigDecimal startPosition)
{
this.startPosition = startPosition;
}
public BigDecimal getStartPosition()
{
return startPosition;
}
public void setEndPosition(BigDecimal endPosition)
{
this.endPosition = endPosition;
}
public BigDecimal getEndPosition()
{
return endPosition;
}
public void setDefectCode(String defectCode)
{
this.defectCode = defectCode;
}
public String getDefectCode()
{
return defectCode;
}
public void setDefectType(String defectType)
{
this.defectType = defectType;
}
public String getDefectType()
{
return defectType;
}
public void setDefectRate(BigDecimal defectRate)
{
this.defectRate = defectRate;
}
public BigDecimal getDefectRate()
{
return defectRate;
}
public void setDefectWeight(BigDecimal defectWeight)
{
this.defectWeight = defectWeight;
}
public BigDecimal getDefectWeight()
{
return defectWeight;
}
public void setDegree(String degree)
{
this.degree = degree;
}
public String getDegree()
{
return degree;
}
public void setJudgeLevel(String judgeLevel)
{
this.judgeLevel = judgeLevel;
}
public String getJudgeLevel()
{
return judgeLevel;
}
public void setJudgeBy(String judgeBy)
{
this.judgeBy = judgeBy;
}
public String getJudgeBy()
{
return judgeBy;
}
public void setJudgeTime(Date judgeTime)
{
this.judgeTime = judgeTime;
}
public Date getJudgeTime()
{
return judgeTime;
}
public void setMainMark(Long mainMark)
{
this.mainMark = mainMark;
}
public Long getMainMark()
{
return mainMark;
}
public void setWholeCoilMark(Long wholeCoilMark)
{
this.wholeCoilMark = wholeCoilMark;
}
public Long getWholeCoilMark()
{
return wholeCoilMark;
}
public void setDelFlag(Integer delFlag)
{
this.delFlag = delFlag;
}
public Integer getDelFlag()
{
return delFlag;
}
public void setPlateSurface(String plateSurface)
{
this.plateSurface = plateSurface;
}
public String getPlateSurface()
{
return plateSurface;
}
public void setAttachmentFiles(String attachmentFiles)
{
this.attachmentFiles = attachmentFiles;
}
public String getAttachmentFiles()
{
return attachmentFiles;
}
public void setThirdCoilId(Long thirdCoilId)
{
this.thirdCoilId = thirdCoilId;
}
public Long getThirdCoilId()
{
return thirdCoilId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("abnormalId", getAbnormalId())
.append("currentCoilNo", getCurrentCoilNo())
.append("productionLine", getProductionLine())
.append("position", getPosition())
.append("length", getLength())
.append("startPosition", getStartPosition())
.append("endPosition", getEndPosition())
.append("defectCode", getDefectCode())
.append("defectType", getDefectType())
.append("defectRate", getDefectRate())
.append("defectWeight", getDefectWeight())
.append("degree", getDegree())
.append("judgeLevel", getJudgeLevel())
.append("judgeBy", getJudgeBy())
.append("judgeTime", getJudgeTime())
.append("mainMark", getMainMark())
.append("wholeCoilMark", getWholeCoilMark())
.append("remark", getRemark())
.append("delFlag", getDelFlag())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.append("plateSurface", getPlateSurface())
.append("attachmentFiles", getAttachmentFiles())
.append("thirdCoilId", getThirdCoilId())
.toString();
}
}

View File

@@ -0,0 +1,177 @@
package com.ruoyi.mill.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
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;
/**
* 二级-三级钢卷异常挂接/撤回关系对象 mill_coil_abnormal_relation
*
* @author ruoyi
* @date 2026-06-03
*/
public class MillCoilAbnormalRelation extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 关系ID */
private Long relationId;
/** 二级系统异常ID */
@Excel(name = "二级系统异常ID")
private Long secondAbnormalId;
/** 三级系统钢卷ID */
@Excel(name = "三级系统钢卷ID")
private Long thirdCoilId;
/** 【关键】三级表的异常ID */
@Excel(name = "【关键】三级表的异常ID")
private Long thirdAbnormalId;
/** 匹配时使用的钢卷号 */
@Excel(name = "匹配时使用的钢卷号")
private String currentCoilNo;
/** 状态1=已挂接2=已撤回 */
@Excel(name = "状态1=已挂接2=已撤回")
private Long bindStatus;
/** 挂接时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "挂接时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date bindTime;
/** 撤回时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "撤回时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date withdrawTime;
/** 操作人 */
@Excel(name = "操作人")
private String operateUser;
/** 操作备注(撤回原因) */
@Excel(name = "操作备注", readConverterExp = "撤=回原因")
private String operateRemark;
public void setRelationId(Long relationId)
{
this.relationId = relationId;
}
public Long getRelationId()
{
return relationId;
}
public void setSecondAbnormalId(Long secondAbnormalId)
{
this.secondAbnormalId = secondAbnormalId;
}
public Long getSecondAbnormalId()
{
return secondAbnormalId;
}
public void setThirdCoilId(Long thirdCoilId)
{
this.thirdCoilId = thirdCoilId;
}
public Long getThirdCoilId()
{
return thirdCoilId;
}
public void setThirdAbnormalId(Long thirdAbnormalId)
{
this.thirdAbnormalId = thirdAbnormalId;
}
public Long getThirdAbnormalId()
{
return thirdAbnormalId;
}
public void setCurrentCoilNo(String currentCoilNo)
{
this.currentCoilNo = currentCoilNo;
}
public String getCurrentCoilNo()
{
return currentCoilNo;
}
public void setBindStatus(Long bindStatus)
{
this.bindStatus = bindStatus;
}
public Long getBindStatus()
{
return bindStatus;
}
public void setBindTime(Date bindTime)
{
this.bindTime = bindTime;
}
public Date getBindTime()
{
return bindTime;
}
public void setWithdrawTime(Date withdrawTime)
{
this.withdrawTime = withdrawTime;
}
public Date getWithdrawTime()
{
return withdrawTime;
}
public void setOperateUser(String operateUser)
{
this.operateUser = operateUser;
}
public String getOperateUser()
{
return operateUser;
}
public void setOperateRemark(String operateRemark)
{
this.operateRemark = operateRemark;
}
public String getOperateRemark()
{
return operateRemark;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("relationId", getRelationId())
.append("secondAbnormalId", getSecondAbnormalId())
.append("thirdCoilId", getThirdCoilId())
.append("thirdAbnormalId", getThirdAbnormalId())
.append("currentCoilNo", getCurrentCoilNo())
.append("bindStatus", getBindStatus())
.append("bindTime", getBindTime())
.append("withdrawTime", getWithdrawTime())
.append("operateUser", getOperateUser())
.append("operateRemark", getOperateRemark())
.append("createTime", getCreateTime())
.toString();
}
}

View File

@@ -36,6 +36,7 @@ public class WmsCoilAbnormal extends BaseEntity {
private Integer wholeCoilMark; private Integer wholeCoilMark;
private String attachmentFiles; private String attachmentFiles;
private Integer delFlag; private Integer delFlag;
private Integer sourceSystem;
// 关联字段 // 关联字段
private String coilNo; // 从 wms_material_coil 带出 private String coilNo; // 从 wms_material_coil 带出

View File

@@ -0,0 +1,61 @@
package com.ruoyi.mill.mapper;
import java.util.List;
import com.ruoyi.mill.domain.MillCoilAbnormal;
/**
* 钢卷异常信息Mapper接口
*
* @author ruoyi
* @date 2026-06-03
*/
public interface MillCoilAbnormalMapper
{
/**
* 查询钢卷异常信息
*
* @param abnormalId 钢卷异常信息主键
* @return 钢卷异常信息
*/
public MillCoilAbnormal selectMillCoilAbnormalByAbnormalId(Long abnormalId);
/**
* 查询钢卷异常信息列表
*
* @param millCoilAbnormal 钢卷异常信息
* @return 钢卷异常信息集合
*/
public List<MillCoilAbnormal> selectMillCoilAbnormalList(MillCoilAbnormal millCoilAbnormal);
/**
* 新增钢卷异常信息
*
* @param millCoilAbnormal 钢卷异常信息
* @return 结果
*/
public int insertMillCoilAbnormal(MillCoilAbnormal millCoilAbnormal);
/**
* 修改钢卷异常信息
*
* @param millCoilAbnormal 钢卷异常信息
* @return 结果
*/
public int updateMillCoilAbnormal(MillCoilAbnormal millCoilAbnormal);
/**
* 删除钢卷异常信息
*
* @param abnormalId 钢卷异常信息主键
* @return 结果
*/
public int deleteMillCoilAbnormalByAbnormalId(Long abnormalId);
/**
* 批量删除钢卷异常信息
*
* @param abnormalIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteMillCoilAbnormalByAbnormalIds(Long[] abnormalIds);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.mill.mapper;
import java.util.List;
import com.ruoyi.mill.domain.MillCoilAbnormalRelation;
/**
* 二级-三级钢卷异常挂接/撤回关系Mapper接口
*
* @author ruoyi
* @date 2026-06-03
*/
public interface MillCoilAbnormalRelationMapper
{
/**
* 查询二级-三级钢卷异常挂接/撤回关系
*
* @param relationId 二级-三级钢卷异常挂接/撤回关系主键
* @return 二级-三级钢卷异常挂接/撤回关系
*/
public MillCoilAbnormalRelation selectMillCoilAbnormalRelationByRelationId(Long relationId);
/**
* 查询二级-三级钢卷异常挂接/撤回关系列表
*
* @param millCoilAbnormalRelation 二级-三级钢卷异常挂接/撤回关系
* @return 二级-三级钢卷异常挂接/撤回关系集合
*/
public List<MillCoilAbnormalRelation> selectMillCoilAbnormalRelationList(MillCoilAbnormalRelation millCoilAbnormalRelation);
/**
* 新增二级-三级钢卷异常挂接/撤回关系
*
* @param millCoilAbnormalRelation 二级-三级钢卷异常挂接/撤回关系
* @return 结果
*/
public int insertMillCoilAbnormalRelation(MillCoilAbnormalRelation millCoilAbnormalRelation);
/**
* 修改二级-三级钢卷异常挂接/撤回关系
*
* @param millCoilAbnormalRelation 二级-三级钢卷异常挂接/撤回关系
* @return 结果
*/
public int updateMillCoilAbnormalRelation(MillCoilAbnormalRelation millCoilAbnormalRelation);
/**
* 删除二级-三级钢卷异常挂接/撤回关系
*
* @param relationId 二级-三级钢卷异常挂接/撤回关系主键
* @return 结果
*/
public int deleteMillCoilAbnormalRelationByRelationId(Long relationId);
/**
* 批量删除二级-三级钢卷异常挂接/撤回关系
*
* @param relationIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteMillCoilAbnormalRelationByRelationIds(Long[] relationIds);
}

View File

@@ -0,0 +1,80 @@
package com.ruoyi.mill.service;
import java.util.List;
import com.ruoyi.mill.domain.MillCoilAbnormalRelation;
/**
* 二级-三级钢卷异常挂接/撤回关系Service接口
*
* @author ruoyi
* @date 2026-06-03
*/
public interface IMillCoilAbnormalRelationService
{
/**
* 查询二级-三级钢卷异常挂接/撤回关系
*
* @param relationId 二级-三级钢卷异常挂接/撤回关系主键
* @return 二级-三级钢卷异常挂接/撤回关系
*/
public MillCoilAbnormalRelation selectMillCoilAbnormalRelationByRelationId(Long relationId);
/**
* 查询二级-三级钢卷异常挂接/撤回关系列表
*
* @param millCoilAbnormalRelation 二级-三级钢卷异常挂接/撤回关系
* @return 二级-三级钢卷异常挂接/撤回关系集合
*/
public List<MillCoilAbnormalRelation> selectMillCoilAbnormalRelationList(MillCoilAbnormalRelation millCoilAbnormalRelation);
/**
* 新增二级-三级钢卷异常挂接/撤回关系
*
* @param millCoilAbnormalRelation 二级-三级钢卷异常挂接/撤回关系
* @return 结果
*/
public int insertMillCoilAbnormalRelation(MillCoilAbnormalRelation millCoilAbnormalRelation);
/**
* 修改二级-三级钢卷异常挂接/撤回关系
*
* @param millCoilAbnormalRelation 二级-三级钢卷异常挂接/撤回关系
* @return 结果
*/
public int updateMillCoilAbnormalRelation(MillCoilAbnormalRelation millCoilAbnormalRelation);
/**
* 批量删除二级-三级钢卷异常挂接/撤回关系
*
* @param relationIds 需要删除的二级-三级钢卷异常挂接/撤回关系主键集合
* @return 结果
*/
public int deleteMillCoilAbnormalRelationByRelationIds(Long[] relationIds);
/**
* 删除二级-三级钢卷异常挂接/撤回关系信息
*
* @param relationId 二级-三级钢卷异常挂接/撤回关系主键
* @return 结果
*/
public int deleteMillCoilAbnormalRelationByRelationId(Long relationId);
/**
* 挂接:将二级异常数据新增到三级异常表,并创建关联关系
*
* @param secondAbnormalId 二级异常ID
* @param operateUser 操作人
* @return 新建的关联关系ID
*/
public Long bindToThird(Long secondAbnormalId, String operateUser);
/**
* 撤回:逻辑删除三级异常表中的挂接数据,更新关联关系状态
*
* @param relationId 关联关系ID
* @param operateUser 操作人
* @param operateRemark 撤回原因
* @return 结果
*/
public int withdrawFromThird(Long relationId, String operateUser, String operateRemark);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.mill.service;
import java.util.List;
import com.ruoyi.mill.domain.MillCoilAbnormal;
/**
* 钢卷异常信息Service接口
*
* @author ruoyi
* @date 2026-06-03
*/
public interface IMillCoilAbnormalService
{
/**
* 查询钢卷异常信息
*
* @param abnormalId 钢卷异常信息主键
* @return 钢卷异常信息
*/
public MillCoilAbnormal selectMillCoilAbnormalByAbnormalId(Long abnormalId);
/**
* 查询钢卷异常信息列表
*
* @param millCoilAbnormal 钢卷异常信息
* @return 钢卷异常信息集合
*/
public List<MillCoilAbnormal> selectMillCoilAbnormalList(MillCoilAbnormal millCoilAbnormal);
/**
* 新增钢卷异常信息
*
* @param millCoilAbnormal 钢卷异常信息
* @return 结果
*/
public int insertMillCoilAbnormal(MillCoilAbnormal millCoilAbnormal);
/**
* 修改钢卷异常信息
*
* @param millCoilAbnormal 钢卷异常信息
* @return 结果
*/
public int updateMillCoilAbnormal(MillCoilAbnormal millCoilAbnormal);
/**
* 批量删除钢卷异常信息
*
* @param abnormalIds 需要删除的钢卷异常信息主键集合
* @return 结果
*/
public int deleteMillCoilAbnormalByAbnormalIds(Long[] abnormalIds);
/**
* 删除钢卷异常信息信息
*
* @param abnormalId 钢卷异常信息主键
* @return 结果
*/
public int deleteMillCoilAbnormalByAbnormalId(Long abnormalId);
}

View File

@@ -0,0 +1,199 @@
package com.ruoyi.mill.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mill.mapper.MillCoilAbnormalRelationMapper;
import com.ruoyi.mill.domain.MillCoilAbnormal;
import com.ruoyi.mill.domain.MillCoilAbnormalRelation;
import com.ruoyi.mill.domain.KlpCoilInfo;
import com.ruoyi.mill.domain.WmsCoilAbnormal;
import com.ruoyi.mill.service.IMillCoilAbnormalRelationService;
import com.ruoyi.mill.service.IMillCoilAbnormalService;
import com.ruoyi.mill.service.IKlpCoilService;
import com.ruoyi.mill.service.IWmsCoilAbnormalService;
/**
* 二级-三级钢卷异常挂接/撤回关系Service业务层处理
*
* @author ruoyi
* @date 2026-06-03
*/
@Service
public class MillCoilAbnormalRelationServiceImpl implements IMillCoilAbnormalRelationService
{
@Autowired
private MillCoilAbnormalRelationMapper millCoilAbnormalRelationMapper;
@Autowired
private IMillCoilAbnormalService millCoilAbnormalService;
@Autowired
private IKlpCoilService klpCoilService;
@Autowired
private IWmsCoilAbnormalService wmsCoilAbnormalService;
/**
* 查询二级-三级钢卷异常挂接/撤回关系
*
* @param relationId 二级-三级钢卷异常挂接/撤回关系主键
* @return 二级-三级钢卷异常挂接/撤回关系
*/
@Override
public MillCoilAbnormalRelation selectMillCoilAbnormalRelationByRelationId(Long relationId)
{
return millCoilAbnormalRelationMapper.selectMillCoilAbnormalRelationByRelationId(relationId);
}
/**
* 查询二级-三级钢卷异常挂接/撤回关系列表
*
* @param millCoilAbnormalRelation 二级-三级钢卷异常挂接/撤回关系
* @return 二级-三级钢卷异常挂接/撤回关系
*/
@Override
public List<MillCoilAbnormalRelation> selectMillCoilAbnormalRelationList(MillCoilAbnormalRelation millCoilAbnormalRelation)
{
return millCoilAbnormalRelationMapper.selectMillCoilAbnormalRelationList(millCoilAbnormalRelation);
}
/**
* 新增二级-三级钢卷异常挂接/撤回关系
*
* @param millCoilAbnormalRelation 二级-三级钢卷异常挂接/撤回关系
* @return 结果
*/
@Override
public int insertMillCoilAbnormalRelation(MillCoilAbnormalRelation millCoilAbnormalRelation)
{
millCoilAbnormalRelation.setCreateTime(DateUtils.getNowDate());
return millCoilAbnormalRelationMapper.insertMillCoilAbnormalRelation(millCoilAbnormalRelation);
}
/**
* 修改二级-三级钢卷异常挂接/撤回关系
*
* @param millCoilAbnormalRelation 二级-三级钢卷异常挂接/撤回关系
* @return 结果
*/
@Override
public int updateMillCoilAbnormalRelation(MillCoilAbnormalRelation millCoilAbnormalRelation)
{
return millCoilAbnormalRelationMapper.updateMillCoilAbnormalRelation(millCoilAbnormalRelation);
}
/**
* 批量删除二级-三级钢卷异常挂接/撤回关系
*
* @param relationIds 需要删除的二级-三级钢卷异常挂接/撤回关系主键
* @return 结果
*/
@Override
public int deleteMillCoilAbnormalRelationByRelationIds(Long[] relationIds)
{
return millCoilAbnormalRelationMapper.deleteMillCoilAbnormalRelationByRelationIds(relationIds);
}
/**
* 删除二级-三级钢卷异常挂接/撤回关系信息
*
* @param relationId 二级-三级钢卷异常挂接/撤回关系主键
* @return 结果
*/
@Override
public int deleteMillCoilAbnormalRelationByRelationId(Long relationId)
{
return millCoilAbnormalRelationMapper.deleteMillCoilAbnormalRelationByRelationId(relationId);
}
@Override
public Long bindToThird(Long secondAbnormalId, String operateUser)
{
MillCoilAbnormal secondAbnormal = millCoilAbnormalService.selectMillCoilAbnormalByAbnormalId(secondAbnormalId);
if (secondAbnormal == null)
{
throw new RuntimeException("二级异常记录不存在");
}
String coilNo = secondAbnormal.getCurrentCoilNo();
if (coilNo == null || coilNo.isEmpty())
{
throw new RuntimeException("二级异常记录的钢卷号为空,无法匹配三级钢卷");
}
KlpCoilInfo coilInfo = klpCoilService.queryByCoilNo(coilNo);
if (coilInfo == null)
{
throw new RuntimeException("在三级系统中未找到钢卷号[" + coilNo + "]对应的钢卷信息");
}
Long thirdCoilId = coilInfo.getCoilId();
WmsCoilAbnormal wmsAbnormal = new WmsCoilAbnormal();
wmsAbnormal.setCoilId(thirdCoilId);
wmsAbnormal.setProductionLine(secondAbnormal.getProductionLine());
wmsAbnormal.setPosition(secondAbnormal.getPosition());
wmsAbnormal.setPlateSurface(secondAbnormal.getPlateSurface());
wmsAbnormal.setLength(secondAbnormal.getLength());
wmsAbnormal.setStartPosition(secondAbnormal.getStartPosition());
wmsAbnormal.setEndPosition(secondAbnormal.getEndPosition());
wmsAbnormal.setDefectCode(secondAbnormal.getDefectCode());
wmsAbnormal.setDefectType(secondAbnormal.getDefectType());
wmsAbnormal.setDefectRate(secondAbnormal.getDefectRate());
wmsAbnormal.setDefectWeight(secondAbnormal.getDefectWeight());
wmsAbnormal.setDegree(secondAbnormal.getDegree());
wmsAbnormal.setJudgeLevel(secondAbnormal.getJudgeLevel());
wmsAbnormal.setJudgeBy(secondAbnormal.getJudgeBy());
wmsAbnormal.setJudgeTime(secondAbnormal.getJudgeTime());
wmsAbnormal.setMainMark(secondAbnormal.getMainMark() != null ? secondAbnormal.getMainMark().intValue() : null);
wmsAbnormal.setWholeCoilMark(secondAbnormal.getWholeCoilMark() != null ? secondAbnormal.getWholeCoilMark().intValue() : null);
wmsAbnormal.setAttachmentFiles(secondAbnormal.getAttachmentFiles());
wmsAbnormal.setRemark(secondAbnormal.getRemark());
wmsAbnormal.setCreateBy(operateUser);
wmsAbnormal.setCreateTime(DateUtils.getNowDate());
wmsAbnormal.setSourceSystem(2);
wmsCoilAbnormalService.insertWmsCoilAbnormal(wmsAbnormal);
Long thirdAbnormalId = wmsAbnormal.getAbnormalId();
if (thirdAbnormalId == null)
{
throw new RuntimeException("插入三级异常表失败未获取到异常ID");
}
MillCoilAbnormalRelation relation = new MillCoilAbnormalRelation();
relation.setSecondAbnormalId(secondAbnormalId);
relation.setThirdCoilId(thirdCoilId);
relation.setThirdAbnormalId(thirdAbnormalId);
relation.setCurrentCoilNo(coilNo);
relation.setBindStatus(1L);
relation.setBindTime(DateUtils.getNowDate());
relation.setOperateUser(operateUser);
relation.setCreateTime(DateUtils.getNowDate());
millCoilAbnormalRelationMapper.insertMillCoilAbnormalRelation(relation);
return relation.getRelationId();
}
@Override
public int withdrawFromThird(Long relationId, String operateUser, String operateRemark)
{
MillCoilAbnormalRelation relation = millCoilAbnormalRelationMapper.selectMillCoilAbnormalRelationByRelationId(relationId);
if (relation == null)
{
throw new RuntimeException("关联关系记录不存在");
}
if (relation.getBindStatus() != null && relation.getBindStatus() == 2L)
{
throw new RuntimeException("该记录已撤回,不能重复操作");
}
Long thirdAbnormalId = relation.getThirdAbnormalId();
if (thirdAbnormalId != null)
{
wmsCoilAbnormalService.deleteWmsCoilAbnormalById(thirdAbnormalId);
}
relation.setBindStatus(2L);
relation.setWithdrawTime(DateUtils.getNowDate());
relation.setOperateUser(operateUser);
relation.setOperateRemark(operateRemark);
return millCoilAbnormalRelationMapper.updateMillCoilAbnormalRelation(relation);
}
}

View File

@@ -0,0 +1,96 @@
package com.ruoyi.mill.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mill.mapper.MillCoilAbnormalMapper;
import com.ruoyi.mill.domain.MillCoilAbnormal;
import com.ruoyi.mill.service.IMillCoilAbnormalService;
/**
* 钢卷异常信息Service业务层处理
*
* @author ruoyi
* @date 2026-06-03
*/
@Service
public class MillCoilAbnormalServiceImpl implements IMillCoilAbnormalService
{
@Autowired
private MillCoilAbnormalMapper millCoilAbnormalMapper;
/**
* 查询钢卷异常信息
*
* @param abnormalId 钢卷异常信息主键
* @return 钢卷异常信息
*/
@Override
public MillCoilAbnormal selectMillCoilAbnormalByAbnormalId(Long abnormalId)
{
return millCoilAbnormalMapper.selectMillCoilAbnormalByAbnormalId(abnormalId);
}
/**
* 查询钢卷异常信息列表
*
* @param millCoilAbnormal 钢卷异常信息
* @return 钢卷异常信息
*/
@Override
public List<MillCoilAbnormal> selectMillCoilAbnormalList(MillCoilAbnormal millCoilAbnormal)
{
return millCoilAbnormalMapper.selectMillCoilAbnormalList(millCoilAbnormal);
}
/**
* 新增钢卷异常信息
*
* @param millCoilAbnormal 钢卷异常信息
* @return 结果
*/
@Override
public int insertMillCoilAbnormal(MillCoilAbnormal millCoilAbnormal)
{
millCoilAbnormal.setCreateTime(DateUtils.getNowDate());
return millCoilAbnormalMapper.insertMillCoilAbnormal(millCoilAbnormal);
}
/**
* 修改钢卷异常信息
*
* @param millCoilAbnormal 钢卷异常信息
* @return 结果
*/
@Override
public int updateMillCoilAbnormal(MillCoilAbnormal millCoilAbnormal)
{
millCoilAbnormal.setUpdateTime(DateUtils.getNowDate());
return millCoilAbnormalMapper.updateMillCoilAbnormal(millCoilAbnormal);
}
/**
* 批量删除钢卷异常信息
*
* @param abnormalIds 需要删除的钢卷异常信息主键
* @return 结果
*/
@Override
public int deleteMillCoilAbnormalByAbnormalIds(Long[] abnormalIds)
{
return millCoilAbnormalMapper.deleteMillCoilAbnormalByAbnormalIds(abnormalIds);
}
/**
* 删除钢卷异常信息信息
*
* @param abnormalId 钢卷异常信息主键
* @return 结果
*/
@Override
public int deleteMillCoilAbnormalByAbnormalId(Long abnormalId)
{
return millCoilAbnormalMapper.deleteMillCoilAbnormalByAbnormalId(abnormalId);
}
}

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="mainMark" column="main_mark" />
<result property="wholeCoilMark" column="whole_coil_mark" /> <result property="wholeCoilMark" column="whole_coil_mark" />
<result property="attachmentFiles" column="attachment_files" /> <result property="attachmentFiles" column="attachment_files" />
<result property="sourceSystem" column="source_system" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="delFlag" column="del_flag" /> <result property="delFlag" column="del_flag" />
<result property="createBy" column="create_by" /> <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, 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.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.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, a.create_by, a.create_time, a.update_by, a.update_time,
mc.current_coil_no mc.current_coil_no
FROM wms_coil_abnormal a FROM wms_coil_abnormal a
@@ -107,6 +108,7 @@
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="sourceSystem != null">source_system,</if>
del_flag, del_flag,
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -130,6 +132,7 @@
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="sourceSystem != null">#{sourceSystem},</if>
0, 0,
</trim> </trim>
</insert> </insert>