feat(mill): 添加换辊记录管理功能
- 新增换辊记录领域模型 MesRollChange 和 MesRollStandby - 实现换辊记录服务接口 IMesRollChangeService 和 IMesRollStandbyService - 添加换辊记录控制器 MesRollChangeController 提供 REST API - 实现换辊记录数据访问层 MesRollChangeMapper 和映射配置文件 - 添加换辊记录业务逻辑实现类 MesRollChangeServiceImpl - 实现查询当前在机轧辊和轧辊工作绩效统计功能 - 扩展轧辊信息 Mapper 支持条件更新轧辊状态操作
This commit is contained in:
@@ -0,0 +1,128 @@
|
||||
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.RequestParam;
|
||||
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.MesRollChange;
|
||||
import com.ruoyi.mill.domain.MesRollChangeVo;
|
||||
import com.ruoyi.mill.service.IMesRollChangeService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 换辊记录Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mill/change")
|
||||
public class MesRollChangeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMesRollChangeService mesRollChangeService;
|
||||
|
||||
/**
|
||||
* 查询换辊记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MesRollChange mesRollChange)
|
||||
{
|
||||
startPage();
|
||||
List<MesRollChange> list = mesRollChangeService.selectMesRollChangeList(mesRollChange);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出换辊记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:export')")
|
||||
@Log(title = "换辊记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MesRollChange mesRollChange)
|
||||
{
|
||||
List<MesRollChange> list = mesRollChangeService.selectMesRollChangeList(mesRollChange);
|
||||
ExcelUtil<MesRollChange> util = new ExcelUtil<MesRollChange>(MesRollChange.class);
|
||||
util.exportExcel(response, list, "换辊记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取换辊记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:query')")
|
||||
@GetMapping(value = "/{changeId}")
|
||||
public AjaxResult getInfo(@PathVariable("changeId") Long changeId)
|
||||
{
|
||||
return success(mesRollChangeService.selectMesRollChangeByChangeId(changeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增换辊记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:add')")
|
||||
@Log(title = "换辊记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MesRollChange mesRollChange)
|
||||
{
|
||||
return toAjax(mesRollChangeService.insertMesRollChange(mesRollChange));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改换辊记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:edit')")
|
||||
@Log(title = "换辊记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MesRollChange mesRollChange)
|
||||
{
|
||||
return toAjax(mesRollChangeService.updateMesRollChange(mesRollChange));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除换辊记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:remove')")
|
||||
@Log(title = "换辊记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{changeIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] changeIds)
|
||||
{
|
||||
return toAjax(mesRollChangeService.deleteMesRollChangeByChangeIds(changeIds));
|
||||
}
|
||||
|
||||
// ==================== 三级业务端点 ====================
|
||||
|
||||
/**
|
||||
* 查询指定产线+机架当前在机轧辊(最近一次换辊记录)
|
||||
* GET /mill/change/current?lineId=xxx&standNo=1%23
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:query')")
|
||||
@GetMapping("/current")
|
||||
public AjaxResult current(Long lineId, @RequestParam String standNo) {
|
||||
return success(mesRollChangeService.queryCurrentByStand(lineId, standNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定产线各机架各辊位实时工作绩效(工作长度/卷数/重量)
|
||||
* GET /mill/change/performance?lineId=xxx
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:change:list')")
|
||||
@GetMapping("/performance")
|
||||
public AjaxResult performance(Long lineId) {
|
||||
return success(mesRollChangeService.queryRollPerformance(lineId));
|
||||
}
|
||||
}
|
||||
@@ -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.MesRollStandby;
|
||||
import com.ruoyi.mill.service.IMesRollStandbyService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 下批轧辊(待换上)Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mill/standby")
|
||||
public class MesRollStandbyController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMesRollStandbyService mesRollStandbyService;
|
||||
|
||||
/**
|
||||
* 查询下批轧辊(待换上)列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:standby:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MesRollStandby mesRollStandby)
|
||||
{
|
||||
startPage();
|
||||
List<MesRollStandby> list = mesRollStandbyService.selectMesRollStandbyList(mesRollStandby);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出下批轧辊(待换上)列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:standby:export')")
|
||||
@Log(title = "下批轧辊(待换上)", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MesRollStandby mesRollStandby)
|
||||
{
|
||||
List<MesRollStandby> list = mesRollStandbyService.selectMesRollStandbyList(mesRollStandby);
|
||||
ExcelUtil<MesRollStandby> util = new ExcelUtil<MesRollStandby>(MesRollStandby.class);
|
||||
util.exportExcel(response, list, "下批轧辊(待换上)数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下批轧辊(待换上)详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:standby:query')")
|
||||
@GetMapping(value = "/{standbyId}")
|
||||
public AjaxResult getInfo(@PathVariable("standbyId") Long standbyId)
|
||||
{
|
||||
return success(mesRollStandbyService.selectMesRollStandbyByStandbyId(standbyId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增下批轧辊(待换上)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:standby:add')")
|
||||
@Log(title = "下批轧辊(待换上)", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MesRollStandby mesRollStandby)
|
||||
{
|
||||
return toAjax(mesRollStandbyService.insertMesRollStandby(mesRollStandby));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改下批轧辊(待换上)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:standby:edit')")
|
||||
@Log(title = "下批轧辊(待换上)", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MesRollStandby mesRollStandby)
|
||||
{
|
||||
return toAjax(mesRollStandbyService.updateMesRollStandby(mesRollStandby));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除下批轧辊(待换上)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('mill:standby:remove')")
|
||||
@Log(title = "下批轧辊(待换上)", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{standbyIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] standbyIds)
|
||||
{
|
||||
return toAjax(mesRollStandbyService.deleteMesRollStandbyByStandbyIds(standbyIds));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,285 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 换辊记录对象 mes_roll_change
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public class MesRollChange extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long changeId;
|
||||
|
||||
/** 产线ID(关联 wms_production_line.line_id) */
|
||||
@Excel(name = "产线ID", readConverterExp = "关=联,w=ms_production_line.line_id")
|
||||
private Long lineId;
|
||||
|
||||
/** 换辊编号 */
|
||||
@Excel(name = "换辊编号")
|
||||
private String changeNo;
|
||||
|
||||
/** 换辊时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "换辊时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date changeTime;
|
||||
|
||||
/** 机架号: 1# / 2# */
|
||||
@Excel(name = "机架号: 1# / 2#")
|
||||
private String standNo;
|
||||
|
||||
/** 换辊类型: 计划换辊/紧急换辊 */
|
||||
@Excel(name = "换辊类型: 计划换辊/紧急换辊")
|
||||
private String changeType;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String changeStatus;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private String operator;
|
||||
|
||||
/** 上工作辊编号 */
|
||||
@Excel(name = "上工作辊编号")
|
||||
private String upperWrNo;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal upperWrDia;
|
||||
|
||||
/** 下工作辊编号 */
|
||||
@Excel(name = "下工作辊编号")
|
||||
private String lowerWrNo;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal lowerWrDia;
|
||||
|
||||
/** 上支撑辊编号 */
|
||||
@Excel(name = "上支撑辊编号")
|
||||
private String upperBrNo;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal upperBrDia;
|
||||
|
||||
/** 下支撑辊编号 */
|
||||
@Excel(name = "下支撑辊编号")
|
||||
private String lowerBrNo;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal lowerBrDia;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long delFlag;
|
||||
|
||||
public void setChangeId(Long changeId)
|
||||
{
|
||||
this.changeId = changeId;
|
||||
}
|
||||
|
||||
public Long getChangeId()
|
||||
{
|
||||
return changeId;
|
||||
}
|
||||
|
||||
public void setLineId(Long lineId)
|
||||
{
|
||||
this.lineId = lineId;
|
||||
}
|
||||
|
||||
public Long getLineId()
|
||||
{
|
||||
return lineId;
|
||||
}
|
||||
|
||||
public void setChangeNo(String changeNo)
|
||||
{
|
||||
this.changeNo = changeNo;
|
||||
}
|
||||
|
||||
public String getChangeNo()
|
||||
{
|
||||
return changeNo;
|
||||
}
|
||||
|
||||
public void setChangeTime(Date changeTime)
|
||||
{
|
||||
this.changeTime = changeTime;
|
||||
}
|
||||
|
||||
public Date getChangeTime()
|
||||
{
|
||||
return changeTime;
|
||||
}
|
||||
|
||||
public void setStandNo(String standNo)
|
||||
{
|
||||
this.standNo = standNo;
|
||||
}
|
||||
|
||||
public String getStandNo()
|
||||
{
|
||||
return standNo;
|
||||
}
|
||||
|
||||
public void setChangeType(String changeType)
|
||||
{
|
||||
this.changeType = changeType;
|
||||
}
|
||||
|
||||
public String getChangeType()
|
||||
{
|
||||
return changeType;
|
||||
}
|
||||
|
||||
public void setChangeStatus(String changeStatus)
|
||||
{
|
||||
this.changeStatus = changeStatus;
|
||||
}
|
||||
|
||||
public String getChangeStatus()
|
||||
{
|
||||
return changeStatus;
|
||||
}
|
||||
|
||||
public void setOperator(String operator)
|
||||
{
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
public String getOperator()
|
||||
{
|
||||
return operator;
|
||||
}
|
||||
|
||||
public void setUpperWrNo(String upperWrNo)
|
||||
{
|
||||
this.upperWrNo = upperWrNo;
|
||||
}
|
||||
|
||||
public String getUpperWrNo()
|
||||
{
|
||||
return upperWrNo;
|
||||
}
|
||||
|
||||
public void setUpperWrDia(BigDecimal upperWrDia)
|
||||
{
|
||||
this.upperWrDia = upperWrDia;
|
||||
}
|
||||
|
||||
public BigDecimal getUpperWrDia()
|
||||
{
|
||||
return upperWrDia;
|
||||
}
|
||||
|
||||
public void setLowerWrNo(String lowerWrNo)
|
||||
{
|
||||
this.lowerWrNo = lowerWrNo;
|
||||
}
|
||||
|
||||
public String getLowerWrNo()
|
||||
{
|
||||
return lowerWrNo;
|
||||
}
|
||||
|
||||
public void setLowerWrDia(BigDecimal lowerWrDia)
|
||||
{
|
||||
this.lowerWrDia = lowerWrDia;
|
||||
}
|
||||
|
||||
public BigDecimal getLowerWrDia()
|
||||
{
|
||||
return lowerWrDia;
|
||||
}
|
||||
|
||||
public void setUpperBrNo(String upperBrNo)
|
||||
{
|
||||
this.upperBrNo = upperBrNo;
|
||||
}
|
||||
|
||||
public String getUpperBrNo()
|
||||
{
|
||||
return upperBrNo;
|
||||
}
|
||||
|
||||
public void setUpperBrDia(BigDecimal upperBrDia)
|
||||
{
|
||||
this.upperBrDia = upperBrDia;
|
||||
}
|
||||
|
||||
public BigDecimal getUpperBrDia()
|
||||
{
|
||||
return upperBrDia;
|
||||
}
|
||||
|
||||
public void setLowerBrNo(String lowerBrNo)
|
||||
{
|
||||
this.lowerBrNo = lowerBrNo;
|
||||
}
|
||||
|
||||
public String getLowerBrNo()
|
||||
{
|
||||
return lowerBrNo;
|
||||
}
|
||||
|
||||
public void setLowerBrDia(BigDecimal lowerBrDia)
|
||||
{
|
||||
this.lowerBrDia = lowerBrDia;
|
||||
}
|
||||
|
||||
public BigDecimal getLowerBrDia()
|
||||
{
|
||||
return lowerBrDia;
|
||||
}
|
||||
|
||||
public void setDelFlag(Long delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Long getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("changeId", getChangeId())
|
||||
.append("lineId", getLineId())
|
||||
.append("changeNo", getChangeNo())
|
||||
.append("changeTime", getChangeTime())
|
||||
.append("standNo", getStandNo())
|
||||
.append("changeType", getChangeType())
|
||||
.append("changeStatus", getChangeStatus())
|
||||
.append("operator", getOperator())
|
||||
.append("upperWrNo", getUpperWrNo())
|
||||
.append("upperWrDia", getUpperWrDia())
|
||||
.append("lowerWrNo", getLowerWrNo())
|
||||
.append("lowerWrDia", getLowerWrDia())
|
||||
.append("upperBrNo", getUpperBrNo())
|
||||
.append("upperBrDia", getUpperBrDia())
|
||||
.append("lowerBrNo", getLowerBrNo())
|
||||
.append("lowerBrDia", getLowerBrDia())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 换辊记录 VO — 用于前端展示在机轧辊信息及绩效统计
|
||||
*/
|
||||
public class MesRollChangeVo {
|
||||
|
||||
private Long lineId;
|
||||
private String standNo;
|
||||
|
||||
// 上工作辊
|
||||
private String upperWrNo;
|
||||
private BigDecimal upperWrDia;
|
||||
|
||||
// 下工作辊
|
||||
private String lowerWrNo;
|
||||
private BigDecimal lowerWrDia;
|
||||
|
||||
// 上支撑辊
|
||||
private String upperBrNo;
|
||||
private BigDecimal upperBrDia;
|
||||
|
||||
// 下支撑辊
|
||||
private String lowerBrNo;
|
||||
private BigDecimal lowerBrDia;
|
||||
|
||||
// 换辊时间
|
||||
private Date changeTime;
|
||||
|
||||
// 绩效统计
|
||||
private BigDecimal workLength;
|
||||
private Integer coilCount;
|
||||
private BigDecimal totalWeight;
|
||||
|
||||
public Long getLineId() { return lineId; }
|
||||
public void setLineId(Long lineId) { this.lineId = lineId; }
|
||||
|
||||
public String getStandNo() { return standNo; }
|
||||
public void setStandNo(String standNo) { this.standNo = standNo; }
|
||||
|
||||
public String getUpperWrNo() { return upperWrNo; }
|
||||
public void setUpperWrNo(String upperWrNo) { this.upperWrNo = upperWrNo; }
|
||||
|
||||
public BigDecimal getUpperWrDia() { return upperWrDia; }
|
||||
public void setUpperWrDia(BigDecimal upperWrDia) { this.upperWrDia = upperWrDia; }
|
||||
|
||||
public String getLowerWrNo() { return lowerWrNo; }
|
||||
public void setLowerWrNo(String lowerWrNo) { this.lowerWrNo = lowerWrNo; }
|
||||
|
||||
public BigDecimal getLowerWrDia() { return lowerWrDia; }
|
||||
public void setLowerWrDia(BigDecimal lowerWrDia) { this.lowerWrDia = lowerWrDia; }
|
||||
|
||||
public String getUpperBrNo() { return upperBrNo; }
|
||||
public void setUpperBrNo(String upperBrNo) { this.upperBrNo = upperBrNo; }
|
||||
|
||||
public BigDecimal getUpperBrDia() { return upperBrDia; }
|
||||
public void setUpperBrDia(BigDecimal upperBrDia) { this.upperBrDia = upperBrDia; }
|
||||
|
||||
public String getLowerBrNo() { return lowerBrNo; }
|
||||
public void setLowerBrNo(String lowerBrNo) { this.lowerBrNo = lowerBrNo; }
|
||||
|
||||
public BigDecimal getLowerBrDia() { return lowerBrDia; }
|
||||
public void setLowerBrDia(BigDecimal lowerBrDia) { this.lowerBrDia = lowerBrDia; }
|
||||
|
||||
public Date getChangeTime() { return changeTime; }
|
||||
public void setChangeTime(Date changeTime) { this.changeTime = changeTime; }
|
||||
|
||||
public BigDecimal getWorkLength() { return workLength; }
|
||||
public void setWorkLength(BigDecimal workLength) { this.workLength = workLength; }
|
||||
|
||||
public Integer getCoilCount() { return coilCount; }
|
||||
public void setCoilCount(Integer coilCount) { this.coilCount = coilCount; }
|
||||
|
||||
public BigDecimal getTotalWeight() { return totalWeight; }
|
||||
public void setTotalWeight(BigDecimal totalWeight) { this.totalWeight = totalWeight; }
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
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;
|
||||
|
||||
/**
|
||||
* 下批轧辊(待换上)对象 mes_roll_standby
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public class MesRollStandby extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long standbyId;
|
||||
|
||||
/** 产线ID(关联 wms_production_line.line_id) */
|
||||
@Excel(name = "产线ID", readConverterExp = "关=联,w=ms_production_line.line_id")
|
||||
private Long lineId;
|
||||
|
||||
/** 机架号: 1# / 2# */
|
||||
@Excel(name = "机架号: 1# / 2#")
|
||||
private String standNo;
|
||||
|
||||
/** 轧辊编号 */
|
||||
@Excel(name = "轧辊编号")
|
||||
private String rollNo;
|
||||
|
||||
/** WR=工作辊 / BR=支撑辊 */
|
||||
@Excel(name = "WR=工作辊 / BR=支撑辊")
|
||||
private String rollType;
|
||||
|
||||
/** UP=上 / DOWN=下 */
|
||||
@Excel(name = "UP=上 / DOWN=下")
|
||||
private String position;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal diameter;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal roughness;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private BigDecimal crown;
|
||||
|
||||
/** $column.columnComment */
|
||||
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
|
||||
private Date readyTime;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long delFlag;
|
||||
|
||||
public void setStandbyId(Long standbyId)
|
||||
{
|
||||
this.standbyId = standbyId;
|
||||
}
|
||||
|
||||
public Long getStandbyId()
|
||||
{
|
||||
return standbyId;
|
||||
}
|
||||
|
||||
public void setLineId(Long lineId)
|
||||
{
|
||||
this.lineId = lineId;
|
||||
}
|
||||
|
||||
public Long getLineId()
|
||||
{
|
||||
return lineId;
|
||||
}
|
||||
|
||||
public void setStandNo(String standNo)
|
||||
{
|
||||
this.standNo = standNo;
|
||||
}
|
||||
|
||||
public String getStandNo()
|
||||
{
|
||||
return standNo;
|
||||
}
|
||||
|
||||
public void setRollNo(String rollNo)
|
||||
{
|
||||
this.rollNo = rollNo;
|
||||
}
|
||||
|
||||
public String getRollNo()
|
||||
{
|
||||
return rollNo;
|
||||
}
|
||||
|
||||
public void setRollType(String rollType)
|
||||
{
|
||||
this.rollType = rollType;
|
||||
}
|
||||
|
||||
public String getRollType()
|
||||
{
|
||||
return rollType;
|
||||
}
|
||||
|
||||
public void setPosition(String position)
|
||||
{
|
||||
this.position = position;
|
||||
}
|
||||
|
||||
public String getPosition()
|
||||
{
|
||||
return position;
|
||||
}
|
||||
|
||||
public void setDiameter(BigDecimal diameter)
|
||||
{
|
||||
this.diameter = diameter;
|
||||
}
|
||||
|
||||
public BigDecimal getDiameter()
|
||||
{
|
||||
return diameter;
|
||||
}
|
||||
|
||||
public void setRoughness(BigDecimal roughness)
|
||||
{
|
||||
this.roughness = roughness;
|
||||
}
|
||||
|
||||
public BigDecimal getRoughness()
|
||||
{
|
||||
return roughness;
|
||||
}
|
||||
|
||||
public void setCrown(BigDecimal crown)
|
||||
{
|
||||
this.crown = crown;
|
||||
}
|
||||
|
||||
public BigDecimal getCrown()
|
||||
{
|
||||
return crown;
|
||||
}
|
||||
|
||||
public void setReadyTime(Date readyTime)
|
||||
{
|
||||
this.readyTime = readyTime;
|
||||
}
|
||||
|
||||
public Date getReadyTime()
|
||||
{
|
||||
return readyTime;
|
||||
}
|
||||
|
||||
public void setDelFlag(Long delFlag)
|
||||
{
|
||||
this.delFlag = delFlag;
|
||||
}
|
||||
|
||||
public Long getDelFlag()
|
||||
{
|
||||
return delFlag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("standbyId", getStandbyId())
|
||||
.append("lineId", getLineId())
|
||||
.append("standNo", getStandNo())
|
||||
.append("rollNo", getRollNo())
|
||||
.append("rollType", getRollType())
|
||||
.append("position", getPosition())
|
||||
.append("diameter", getDiameter())
|
||||
.append("roughness", getRoughness())
|
||||
.append("crown", getCrown())
|
||||
.append("readyTime", getReadyTime())
|
||||
.append("delFlag", getDelFlag())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.ruoyi.mill.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 下批轧辊(待换上)VO
|
||||
*/
|
||||
public class MesRollStandbyVo {
|
||||
|
||||
private Long standbyId;
|
||||
private Long lineId;
|
||||
private String standNo;
|
||||
private String rollNo;
|
||||
private String rollType;
|
||||
private String position;
|
||||
private BigDecimal diameter;
|
||||
private BigDecimal roughness;
|
||||
private BigDecimal crown;
|
||||
private Date readyTime;
|
||||
|
||||
public Long getStandbyId() { return standbyId; }
|
||||
public void setStandbyId(Long standbyId) { this.standbyId = standbyId; }
|
||||
|
||||
public Long getLineId() { return lineId; }
|
||||
public void setLineId(Long lineId) { this.lineId = lineId; }
|
||||
|
||||
public String getStandNo() { return standNo; }
|
||||
public void setStandNo(String standNo) { this.standNo = standNo; }
|
||||
|
||||
public String getRollNo() { return rollNo; }
|
||||
public void setRollNo(String rollNo) { this.rollNo = rollNo; }
|
||||
|
||||
public String getRollType() { return rollType; }
|
||||
public void setRollType(String rollType) { this.rollType = rollType; }
|
||||
|
||||
public String getPosition() { return position; }
|
||||
public void setPosition(String position) { this.position = position; }
|
||||
|
||||
public BigDecimal getDiameter() { return diameter; }
|
||||
public void setDiameter(BigDecimal diameter) { this.diameter = diameter; }
|
||||
|
||||
public BigDecimal getRoughness() { return roughness; }
|
||||
public void setRoughness(BigDecimal roughness) { this.roughness = roughness; }
|
||||
|
||||
public BigDecimal getCrown() { return crown; }
|
||||
public void setCrown(BigDecimal crown) { this.crown = crown; }
|
||||
|
||||
public Date getReadyTime() { return readyTime; }
|
||||
public void setReadyTime(Date readyTime) { this.readyTime = readyTime; }
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.ruoyi.mill.domain.MesRollChange;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 换辊记录Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface MesRollChangeMapper
|
||||
{
|
||||
/**
|
||||
* 查询换辊记录
|
||||
*
|
||||
* @param changeId 换辊记录主键
|
||||
* @return 换辊记录
|
||||
*/
|
||||
public MesRollChange selectMesRollChangeByChangeId(Long changeId);
|
||||
|
||||
/**
|
||||
* 查询换辊记录列表
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 换辊记录集合
|
||||
*/
|
||||
public List<MesRollChange> selectMesRollChangeList(MesRollChange mesRollChange);
|
||||
|
||||
/**
|
||||
* 新增换辊记录
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesRollChange(MesRollChange mesRollChange);
|
||||
|
||||
/**
|
||||
* 修改换辊记录
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesRollChange(MesRollChange mesRollChange);
|
||||
|
||||
/**
|
||||
* 删除换辊记录
|
||||
*
|
||||
* @param changeId 换辊记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollChangeByChangeId(Long changeId);
|
||||
|
||||
/**
|
||||
* 批量删除换辊记录
|
||||
*
|
||||
* @param changeIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollChangeByChangeIds(Long[] changeIds);
|
||||
|
||||
/**
|
||||
* 查询指定机架当前各辊位状态(最近一次换辊记录)
|
||||
*
|
||||
* @param lineId 产线ID
|
||||
* @param standNo 机架号
|
||||
* @return 各辊位编号+辊径+换辊时间
|
||||
*/
|
||||
public Map<String, Object> selectCurrentStateByStand(@Param("lineId") Long lineId, @Param("standNo") String standNo);
|
||||
|
||||
/**
|
||||
* 查询指定机架+辊位的最新换辊记录
|
||||
*
|
||||
* @param lineId 产线ID
|
||||
* @param standNo 机架号
|
||||
* @param posType 辊位类型(upperWr/lowerWr/upperBr/lowerBr)
|
||||
* @return 换辊记录
|
||||
*/
|
||||
public MesRollChange selectLatestByStandAndPosition(@Param("lineId") Long lineId,
|
||||
@Param("standNo") String standNo,
|
||||
@Param("posType") String posType);
|
||||
|
||||
/**
|
||||
* 统计指定时间范围内的钢卷产量(长度/卷数/重量)
|
||||
*
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间(null表示至今)
|
||||
* @return 统计结果: workLength, coilCount, totalWeight
|
||||
*/
|
||||
public Map<String, Object> selectCoilStats(@Param("startTime") Date startTime,
|
||||
@Param("endTime") Date endTime);
|
||||
}
|
||||
@@ -34,4 +34,12 @@ public interface MesRollInfoMapper {
|
||||
int incrementGrindCount(@Param("rollId") Long rollId, @Param("diaAfter") BigDecimal diaAfter);
|
||||
|
||||
int updateCurrentDia(@Param("rollId") Long rollId, @Param("currentDia") BigDecimal currentDia);
|
||||
|
||||
/**
|
||||
* 条件更新轧辊状态 — 仅当当前状态为 oldStatus 时才更新为 newStatus
|
||||
* 用于清空备辊时安全回退:避免把已上机的轧辊状态改错
|
||||
*/
|
||||
int updateStatusByRollNoIfStatus(@Param("rollNo") String rollNo,
|
||||
@Param("newStatus") String newStatus,
|
||||
@Param("oldStatus") String oldStatus);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.ruoyi.mill.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.mill.domain.MesRollStandby;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 下批轧辊(待换上)Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface MesRollStandbyMapper
|
||||
{
|
||||
/**
|
||||
* 查询下批轧辊(待换上)
|
||||
*
|
||||
* @param standbyId 下批轧辊(待换上)主键
|
||||
* @return 下批轧辊(待换上)
|
||||
*/
|
||||
public MesRollStandby selectMesRollStandbyByStandbyId(Long standbyId);
|
||||
|
||||
/**
|
||||
* 查询下批轧辊(待换上)列表
|
||||
*
|
||||
* @param mesRollStandby 下批轧辊(待换上)
|
||||
* @return 下批轧辊(待换上)集合
|
||||
*/
|
||||
public List<MesRollStandby> selectMesRollStandbyList(MesRollStandby mesRollStandby);
|
||||
|
||||
/**
|
||||
* 新增下批轧辊(待换上)
|
||||
*
|
||||
* @param mesRollStandby 下批轧辊(待换上)
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesRollStandby(MesRollStandby mesRollStandby);
|
||||
|
||||
/**
|
||||
* 修改下批轧辊(待换上)
|
||||
*
|
||||
* @param mesRollStandby 下批轧辊(待换上)
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesRollStandby(MesRollStandby mesRollStandby);
|
||||
|
||||
/**
|
||||
* 删除下批轧辊(待换上)
|
||||
*
|
||||
* @param standbyId 下批轧辊(待换上)主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollStandbyByStandbyId(Long standbyId);
|
||||
|
||||
/**
|
||||
* 批量删除下批轧辊(待换上)
|
||||
*
|
||||
* @param standbyIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollStandbyByStandbyIds(Long[] standbyIds);
|
||||
|
||||
/**
|
||||
* 查询指定机架的所有备辊
|
||||
*
|
||||
* @param lineId 产线ID
|
||||
* @param standNo 机架号
|
||||
* @return 备辊列表 (VO)
|
||||
*/
|
||||
public List<MesRollStandby> selectByStand(@Param("lineId") Long lineId, @Param("standNo") String standNo);
|
||||
|
||||
/**
|
||||
* 清空指定机架的所有备辊记录
|
||||
*
|
||||
* @param lineId 产线ID
|
||||
* @param standNo 机架号
|
||||
* @return 影响行数
|
||||
*/
|
||||
public int clearByStand(@Param("lineId") Long lineId, @Param("standNo") String standNo);
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.ruoyi.mill.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import com.ruoyi.mill.domain.MesRollChange;
|
||||
import com.ruoyi.mill.domain.MesRollChangeVo;
|
||||
|
||||
/**
|
||||
* 换辊记录Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface IMesRollChangeService
|
||||
{
|
||||
/**
|
||||
* 查询换辊记录
|
||||
*
|
||||
* @param changeId 换辊记录主键
|
||||
* @return 换辊记录
|
||||
*/
|
||||
public MesRollChange selectMesRollChangeByChangeId(Long changeId);
|
||||
|
||||
/**
|
||||
* 查询换辊记录列表
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 换辊记录集合
|
||||
*/
|
||||
public List<MesRollChange> selectMesRollChangeList(MesRollChange mesRollChange);
|
||||
|
||||
/**
|
||||
* 新增换辊记录
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesRollChange(MesRollChange mesRollChange);
|
||||
|
||||
/**
|
||||
* 修改换辊记录
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesRollChange(MesRollChange mesRollChange);
|
||||
|
||||
/**
|
||||
* 批量删除换辊记录
|
||||
*
|
||||
* @param changeIds 需要删除的换辊记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollChangeByChangeIds(Long[] changeIds);
|
||||
|
||||
/**
|
||||
* 删除换辊记录信息
|
||||
*
|
||||
* @param changeId 换辊记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollChangeByChangeId(Long changeId);
|
||||
|
||||
/**
|
||||
* 查询指定产线+机架当前在机轧辊
|
||||
*
|
||||
* @param lineId 产线ID
|
||||
* @param standNo 机架号
|
||||
* @return 在机轧辊 VO
|
||||
*/
|
||||
public MesRollChangeVo queryCurrentByStand(Long lineId, String standNo);
|
||||
|
||||
/**
|
||||
* 查询指定产线各机架各辊位实时工作绩效
|
||||
*
|
||||
* @param lineId 产线ID
|
||||
* @return 各位置类型→各机架→统计数据
|
||||
*/
|
||||
public Map<String, Map<String, Object>> queryRollPerformance(Long lineId);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.ruoyi.mill.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.mill.domain.MesRollStandby;
|
||||
|
||||
/**
|
||||
* 下批轧辊(待换上)Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
public interface IMesRollStandbyService
|
||||
{
|
||||
/**
|
||||
* 查询下批轧辊(待换上)
|
||||
*
|
||||
* @param standbyId 下批轧辊(待换上)主键
|
||||
* @return 下批轧辊(待换上)
|
||||
*/
|
||||
public MesRollStandby selectMesRollStandbyByStandbyId(Long standbyId);
|
||||
|
||||
/**
|
||||
* 查询下批轧辊(待换上)列表
|
||||
*
|
||||
* @param mesRollStandby 下批轧辊(待换上)
|
||||
* @return 下批轧辊(待换上)集合
|
||||
*/
|
||||
public List<MesRollStandby> selectMesRollStandbyList(MesRollStandby mesRollStandby);
|
||||
|
||||
/**
|
||||
* 新增下批轧辊(待换上)
|
||||
*
|
||||
* @param mesRollStandby 下批轧辊(待换上)
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesRollStandby(MesRollStandby mesRollStandby);
|
||||
|
||||
/**
|
||||
* 修改下批轧辊(待换上)
|
||||
*
|
||||
* @param mesRollStandby 下批轧辊(待换上)
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesRollStandby(MesRollStandby mesRollStandby);
|
||||
|
||||
/**
|
||||
* 批量删除下批轧辊(待换上)
|
||||
*
|
||||
* @param standbyIds 需要删除的下批轧辊(待换上)主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollStandbyByStandbyIds(Long[] standbyIds);
|
||||
|
||||
/**
|
||||
* 删除下批轧辊(待换上)信息
|
||||
*
|
||||
* @param standbyId 下批轧辊(待换上)主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesRollStandbyByStandbyId(Long standbyId);
|
||||
|
||||
/**
|
||||
* 清空指定机架所有备辊,同时回退轧辊状态
|
||||
*
|
||||
* @param lineId 产线ID
|
||||
* @param standNo 机架号
|
||||
* @return true=成功 false=无记录
|
||||
*/
|
||||
public Boolean clearByStand(Long lineId, String standNo);
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
package com.ruoyi.mill.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
import com.ruoyi.common.annotation.DataSource;
|
||||
import com.ruoyi.common.enums.DataSourceType;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.mill.mapper.MesRollChangeMapper;
|
||||
import com.ruoyi.mill.domain.MesRollChange;
|
||||
import com.ruoyi.mill.domain.MesRollChangeVo;
|
||||
import com.ruoyi.mill.service.IMesRollChangeService;
|
||||
|
||||
/**
|
||||
* 换辊记录Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@Service
|
||||
@DataSource(DataSourceType.KLP)
|
||||
public class MesRollChangeServiceImpl implements IMesRollChangeService
|
||||
{
|
||||
@Autowired
|
||||
private MesRollChangeMapper mesRollChangeMapper;
|
||||
|
||||
/**
|
||||
* 查询换辊记录
|
||||
*
|
||||
* @param changeId 换辊记录主键
|
||||
* @return 换辊记录
|
||||
*/
|
||||
@Override
|
||||
public MesRollChange selectMesRollChangeByChangeId(Long changeId)
|
||||
{
|
||||
return mesRollChangeMapper.selectMesRollChangeByChangeId(changeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询换辊记录列表
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 换辊记录
|
||||
*/
|
||||
@Override
|
||||
public List<MesRollChange> selectMesRollChangeList(MesRollChange mesRollChange)
|
||||
{
|
||||
return mesRollChangeMapper.selectMesRollChangeList(mesRollChange);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增换辊记录
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMesRollChange(MesRollChange mesRollChange)
|
||||
{
|
||||
mesRollChange.setCreateTime(DateUtils.getNowDate());
|
||||
return mesRollChangeMapper.insertMesRollChange(mesRollChange);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改换辊记录
|
||||
*
|
||||
* @param mesRollChange 换辊记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMesRollChange(MesRollChange mesRollChange)
|
||||
{
|
||||
mesRollChange.setUpdateTime(DateUtils.getNowDate());
|
||||
return mesRollChangeMapper.updateMesRollChange(mesRollChange);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除换辊记录
|
||||
*
|
||||
* @param changeIds 需要删除的换辊记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesRollChangeByChangeIds(Long[] changeIds)
|
||||
{
|
||||
return mesRollChangeMapper.deleteMesRollChangeByChangeIds(changeIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除换辊记录信息
|
||||
*
|
||||
* @param changeId 换辊记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesRollChangeByChangeId(Long changeId)
|
||||
{
|
||||
return mesRollChangeMapper.deleteMesRollChangeByChangeId(changeId);
|
||||
}
|
||||
|
||||
// ==================== 三级业务逻辑 ====================
|
||||
|
||||
/** 辊位类型 */
|
||||
private static final List<String> POS_TYPES = Arrays.asList("upperWr", "lowerWr", "upperBr", "lowerBr");
|
||||
|
||||
/** 机架号 */
|
||||
private static final List<String> STANDS = Arrays.asList("1#", "2#");
|
||||
|
||||
/**
|
||||
* 查询指定产线+机架当前在机轧辊(最近一次换辊记录)
|
||||
*/
|
||||
@Override
|
||||
public MesRollChangeVo queryCurrentByStand(Long lineId, String standNo) {
|
||||
// 组合各辊位最新状态,转换为 VO
|
||||
Map<String, Object> state = mesRollChangeMapper.selectCurrentStateByStand(lineId, standNo);
|
||||
if (state == null) return null;
|
||||
MesRollChangeVo vo = new MesRollChangeVo();
|
||||
vo.setLineId(lineId);
|
||||
vo.setStandNo(standNo);
|
||||
vo.setUpperWrNo(str(state.get("upperWrNo")));
|
||||
vo.setUpperWrDia(decimal(state.get("upperWrDia")));
|
||||
vo.setLowerWrNo(str(state.get("lowerWrNo")));
|
||||
vo.setLowerWrDia(decimal(state.get("lowerWrDia")));
|
||||
vo.setUpperBrNo(str(state.get("upperBrNo")));
|
||||
vo.setUpperBrDia(decimal(state.get("upperBrDia")));
|
||||
vo.setLowerBrNo(str(state.get("lowerBrNo")));
|
||||
vo.setLowerBrDia(decimal(state.get("lowerBrDia")));
|
||||
if (state.get("changeTime") instanceof Date) {
|
||||
vo.setChangeTime((Date) state.get("changeTime"));
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询指定产线各机架各辊位实时工作绩效(工作长度/卷数/重量)
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Map<String, Object>> queryRollPerformance(Long lineId) {
|
||||
Map<String, Map<String, Object>> result = new HashMap<>(4);
|
||||
for (String posType : POS_TYPES) {
|
||||
Map<String, Object> byStand = new HashMap<>(2);
|
||||
for (String standNo : STANDS) {
|
||||
MesRollChange rec = mesRollChangeMapper.selectLatestByStandAndPosition(lineId, standNo, posType);
|
||||
Map<String, Object> cell = new HashMap<>(6);
|
||||
if (rec != null) {
|
||||
cell.put("rollNo", getRollNoByPos(rec, posType));
|
||||
cell.put("onlineTime", rec.getChangeTime());
|
||||
Map<String, Object> stats = mesRollChangeMapper.selectCoilStats(rec.getChangeTime(), null);
|
||||
MesRollChangeVo tmp = new MesRollChangeVo();
|
||||
fillStatsToVo(tmp, stats);
|
||||
cell.put("workLength", tmp.getWorkLength());
|
||||
cell.put("coilCount", tmp.getCoilCount());
|
||||
cell.put("totalWeight", tmp.getTotalWeight());
|
||||
}
|
||||
byStand.put(standNo, cell);
|
||||
}
|
||||
result.put(posType, byStand);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
// ==================== 辅助方法 ====================
|
||||
|
||||
/** 安全转 String */
|
||||
private String str(Object v) {
|
||||
return v == null ? null : v.toString();
|
||||
}
|
||||
|
||||
/** 安全转 BigDecimal */
|
||||
private BigDecimal decimal(Object v) {
|
||||
if (v == null) return null;
|
||||
if (v instanceof BigDecimal) return (BigDecimal) v;
|
||||
if (v instanceof Number) return BigDecimal.valueOf(((Number) v).doubleValue());
|
||||
return new BigDecimal(v.toString());
|
||||
}
|
||||
|
||||
/** 根据辊位类型从换辊记录中取出对应的辊号 */
|
||||
private String getRollNoByPos(MesRollChange rec, String posType) {
|
||||
switch (posType) {
|
||||
case "upperWr": return rec.getUpperWrNo();
|
||||
case "lowerWr": return rec.getLowerWrNo();
|
||||
case "upperBr": return rec.getUpperBrNo();
|
||||
case "lowerBr": return rec.getLowerBrNo();
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** 将统计结果 Map 填充到 VO */
|
||||
private void fillStatsToVo(MesRollChangeVo vo, Map<String, Object> stats) {
|
||||
if (stats == null) return;
|
||||
vo.setWorkLength(decimal(stats.get("workLength")));
|
||||
vo.setCoilCount(stats.get("coilCount") == null ? 0 : ((Number) stats.get("coilCount")).intValue());
|
||||
vo.setTotalWeight(decimal(stats.get("totalWeight")));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,126 @@
|
||||
package com.ruoyi.mill.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.annotation.DataSource;
|
||||
import com.ruoyi.common.enums.DataSourceType;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.mill.mapper.MesRollInfoMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.ruoyi.mill.mapper.MesRollStandbyMapper;
|
||||
import com.ruoyi.mill.domain.MesRollStandby;
|
||||
import com.ruoyi.mill.service.IMesRollStandbyService;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 下批轧辊(待换上)Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2026-06-09
|
||||
*/
|
||||
@Service
|
||||
@DataSource(DataSourceType.KLP)
|
||||
public class MesRollStandbyServiceImpl implements IMesRollStandbyService
|
||||
{
|
||||
@Autowired
|
||||
private MesRollStandbyMapper mesRollStandbyMapper;
|
||||
|
||||
@Autowired
|
||||
private MesRollInfoMapper rollInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询下批轧辊(待换上)
|
||||
*
|
||||
* @param standbyId 下批轧辊(待换上)主键
|
||||
* @return 下批轧辊(待换上)
|
||||
*/
|
||||
@Override
|
||||
public MesRollStandby selectMesRollStandbyByStandbyId(Long standbyId)
|
||||
{
|
||||
return mesRollStandbyMapper.selectMesRollStandbyByStandbyId(standbyId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询下批轧辊(待换上)列表
|
||||
*
|
||||
* @param mesRollStandby 下批轧辊(待换上)
|
||||
* @return 下批轧辊(待换上)
|
||||
*/
|
||||
@Override
|
||||
public List<MesRollStandby> selectMesRollStandbyList(MesRollStandby mesRollStandby)
|
||||
{
|
||||
return mesRollStandbyMapper.selectMesRollStandbyList(mesRollStandby);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增下批轧辊(待换上)
|
||||
*
|
||||
* @param mesRollStandby 下批轧辊(待换上)
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMesRollStandby(MesRollStandby mesRollStandby)
|
||||
{
|
||||
mesRollStandby.setCreateTime(DateUtils.getNowDate());
|
||||
return mesRollStandbyMapper.insertMesRollStandby(mesRollStandby);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改下批轧辊(待换上)
|
||||
*
|
||||
* @param mesRollStandby 下批轧辊(待换上)
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMesRollStandby(MesRollStandby mesRollStandby)
|
||||
{
|
||||
mesRollStandby.setUpdateTime(DateUtils.getNowDate());
|
||||
return mesRollStandbyMapper.updateMesRollStandby(mesRollStandby);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除下批轧辊(待换上)
|
||||
*
|
||||
* @param standbyIds 需要删除的下批轧辊(待换上)主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesRollStandbyByStandbyIds(Long[] standbyIds)
|
||||
{
|
||||
return mesRollStandbyMapper.deleteMesRollStandbyByStandbyIds(standbyIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除下批轧辊(待换上)信息
|
||||
*
|
||||
* @param standbyId 下批轧辊(待换上)主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesRollStandbyByStandbyId(Long standbyId)
|
||||
{
|
||||
return mesRollStandbyMapper.deleteMesRollStandbyByStandbyId(standbyId);
|
||||
}
|
||||
|
||||
// ==================== 三级业务逻辑 ====================
|
||||
|
||||
/**
|
||||
* 清空指定机架所有备辊,同时将处于 Standby 状态的轧辊回退为 Offline
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean clearByStand(Long lineId, String standNo) {
|
||||
// 先查出所有辊号再清空
|
||||
List<MesRollStandby> list = mesRollStandbyMapper.selectByStand(lineId, standNo);
|
||||
int rows = mesRollStandbyMapper.clearByStand(lineId, standNo);
|
||||
for (MesRollStandby vo : list) {
|
||||
if (StringUtils.isNotBlank(vo.getRollNo())) {
|
||||
// 只有仍处于 Standby 状态时才回退为 Offline(换辊后已变 Online 的不动)
|
||||
rollInfoMapper.updateStatusByRollNoIfStatus(vo.getRollNo(), "Offline", "Standby");
|
||||
}
|
||||
}
|
||||
return rows > 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,193 @@
|
||||
<?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.MesRollChangeMapper">
|
||||
|
||||
<resultMap type="MesRollChange" id="MesRollChangeResult">
|
||||
<result property="changeId" column="change_id" />
|
||||
<result property="lineId" column="line_id" />
|
||||
<result property="changeNo" column="change_no" />
|
||||
<result property="changeTime" column="change_time" />
|
||||
<result property="standNo" column="stand_no" />
|
||||
<result property="changeType" column="change_type" />
|
||||
<result property="changeStatus" column="change_status" />
|
||||
<result property="operator" column="operator" />
|
||||
<result property="upperWrNo" column="upper_wr_no" />
|
||||
<result property="upperWrDia" column="upper_wr_dia" />
|
||||
<result property="lowerWrNo" column="lower_wr_no" />
|
||||
<result property="lowerWrDia" column="lower_wr_dia" />
|
||||
<result property="upperBrNo" column="upper_br_no" />
|
||||
<result property="upperBrDia" column="upper_br_dia" />
|
||||
<result property="lowerBrNo" column="lower_br_no" />
|
||||
<result property="lowerBrDia" column="lower_br_dia" />
|
||||
<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="selectMesRollChangeVo">
|
||||
select change_id, line_id, change_no, change_time, stand_no, change_type, change_status, operator, upper_wr_no, upper_wr_dia, lower_wr_no, lower_wr_dia, upper_br_no, upper_br_dia, lower_br_no, lower_br_dia, del_flag, create_by, create_time, update_by, update_time, remark from mes_roll_change
|
||||
</sql>
|
||||
|
||||
<select id="selectMesRollChangeList" parameterType="MesRollChange" resultMap="MesRollChangeResult">
|
||||
<include refid="selectMesRollChangeVo"/>
|
||||
<where>
|
||||
<if test="lineId != null "> and line_id = #{lineId}</if>
|
||||
<if test="changeNo != null and changeNo != ''"> and change_no = #{changeNo}</if>
|
||||
<if test="changeTime != null "> and change_time = #{changeTime}</if>
|
||||
<if test="standNo != null and standNo != ''"> and stand_no = #{standNo}</if>
|
||||
<if test="changeType != null and changeType != ''"> and change_type = #{changeType}</if>
|
||||
<if test="changeStatus != null and changeStatus != ''"> and change_status = #{changeStatus}</if>
|
||||
<if test="operator != null and operator != ''"> and operator = #{operator}</if>
|
||||
<if test="upperWrNo != null and upperWrNo != ''"> and upper_wr_no = #{upperWrNo}</if>
|
||||
<if test="upperWrDia != null "> and upper_wr_dia = #{upperWrDia}</if>
|
||||
<if test="lowerWrNo != null and lowerWrNo != ''"> and lower_wr_no = #{lowerWrNo}</if>
|
||||
<if test="lowerWrDia != null "> and lower_wr_dia = #{lowerWrDia}</if>
|
||||
<if test="upperBrNo != null and upperBrNo != ''"> and upper_br_no = #{upperBrNo}</if>
|
||||
<if test="upperBrDia != null "> and upper_br_dia = #{upperBrDia}</if>
|
||||
<if test="lowerBrNo != null and lowerBrNo != ''"> and lower_br_no = #{lowerBrNo}</if>
|
||||
<if test="lowerBrDia != null "> and lower_br_dia = #{lowerBrDia}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesRollChangeByChangeId" parameterType="Long" resultMap="MesRollChangeResult">
|
||||
<include refid="selectMesRollChangeVo"/>
|
||||
where change_id = #{changeId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesRollChange" parameterType="MesRollChange" useGeneratedKeys="true" keyProperty="changeId">
|
||||
insert into mes_roll_change
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="lineId != null">line_id,</if>
|
||||
<if test="changeNo != null">change_no,</if>
|
||||
<if test="changeTime != null">change_time,</if>
|
||||
<if test="standNo != null">stand_no,</if>
|
||||
<if test="changeType != null">change_type,</if>
|
||||
<if test="changeStatus != null">change_status,</if>
|
||||
<if test="operator != null">operator,</if>
|
||||
<if test="upperWrNo != null">upper_wr_no,</if>
|
||||
<if test="upperWrDia != null">upper_wr_dia,</if>
|
||||
<if test="lowerWrNo != null">lower_wr_no,</if>
|
||||
<if test="lowerWrDia != null">lower_wr_dia,</if>
|
||||
<if test="upperBrNo != null">upper_br_no,</if>
|
||||
<if test="upperBrDia != null">upper_br_dia,</if>
|
||||
<if test="lowerBrNo != null">lower_br_no,</if>
|
||||
<if test="lowerBrDia != null">lower_br_dia,</if>
|
||||
<if test="delFlag != null">del_flag,</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>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="lineId != null">#{lineId},</if>
|
||||
<if test="changeNo != null">#{changeNo},</if>
|
||||
<if test="changeTime != null">#{changeTime},</if>
|
||||
<if test="standNo != null">#{standNo},</if>
|
||||
<if test="changeType != null">#{changeType},</if>
|
||||
<if test="changeStatus != null">#{changeStatus},</if>
|
||||
<if test="operator != null">#{operator},</if>
|
||||
<if test="upperWrNo != null">#{upperWrNo},</if>
|
||||
<if test="upperWrDia != null">#{upperWrDia},</if>
|
||||
<if test="lowerWrNo != null">#{lowerWrNo},</if>
|
||||
<if test="lowerWrDia != null">#{lowerWrDia},</if>
|
||||
<if test="upperBrNo != null">#{upperBrNo},</if>
|
||||
<if test="upperBrDia != null">#{upperBrDia},</if>
|
||||
<if test="lowerBrNo != null">#{lowerBrNo},</if>
|
||||
<if test="lowerBrDia != null">#{lowerBrDia},</if>
|
||||
<if test="delFlag != null">#{delFlag},</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>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesRollChange" parameterType="MesRollChange">
|
||||
update mes_roll_change
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="lineId != null">line_id = #{lineId},</if>
|
||||
<if test="changeNo != null">change_no = #{changeNo},</if>
|
||||
<if test="changeTime != null">change_time = #{changeTime},</if>
|
||||
<if test="standNo != null">stand_no = #{standNo},</if>
|
||||
<if test="changeType != null">change_type = #{changeType},</if>
|
||||
<if test="changeStatus != null">change_status = #{changeStatus},</if>
|
||||
<if test="operator != null">operator = #{operator},</if>
|
||||
<if test="upperWrNo != null">upper_wr_no = #{upperWrNo},</if>
|
||||
<if test="upperWrDia != null">upper_wr_dia = #{upperWrDia},</if>
|
||||
<if test="lowerWrNo != null">lower_wr_no = #{lowerWrNo},</if>
|
||||
<if test="lowerWrDia != null">lower_wr_dia = #{lowerWrDia},</if>
|
||||
<if test="upperBrNo != null">upper_br_no = #{upperBrNo},</if>
|
||||
<if test="upperBrDia != null">upper_br_dia = #{upperBrDia},</if>
|
||||
<if test="lowerBrNo != null">lower_br_no = #{lowerBrNo},</if>
|
||||
<if test="lowerBrDia != null">lower_br_dia = #{lowerBrDia},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where change_id = #{changeId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesRollChangeByChangeId" parameterType="Long">
|
||||
delete from mes_roll_change where change_id = #{changeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesRollChangeByChangeIds" parameterType="String">
|
||||
delete from mes_roll_change where change_id in
|
||||
<foreach item="changeId" collection="array" open="(" separator="," close=")">
|
||||
#{changeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<!-- 查询指定机架当前各辊位状态(最近一次换辊记录) -->
|
||||
<select id="selectCurrentStateByStand" resultType="map">
|
||||
SELECT change_time AS changeTime,
|
||||
upper_wr_no AS upperWrNo,
|
||||
upper_wr_dia AS upperWrDia,
|
||||
lower_wr_no AS lowerWrNo,
|
||||
lower_wr_dia AS lowerWrDia,
|
||||
upper_br_no AS upperBrNo,
|
||||
upper_br_dia AS upperBrDia,
|
||||
lower_br_no AS lowerBrNo,
|
||||
lower_br_dia AS lowerBrDia
|
||||
FROM mes_roll_change
|
||||
WHERE line_id = #{lineId} AND stand_no = #{standNo}
|
||||
ORDER BY change_id DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<!-- 查询指定机架+辊位的最新换辊记录 -->
|
||||
<select id="selectLatestByStandAndPosition" resultMap="MesRollChangeResult">
|
||||
SELECT <include refid="selectMesRollChangeVo"/>
|
||||
FROM mes_roll_change
|
||||
WHERE line_id = #{lineId} AND stand_no = #{standNo}
|
||||
AND (
|
||||
(#{posType} = 'upperWr' AND upper_wr_no IS NOT NULL)
|
||||
OR (#{posType} = 'lowerWr' AND lower_wr_no IS NOT NULL)
|
||||
OR (#{posType} = 'upperBr' AND upper_br_no IS NOT NULL)
|
||||
OR (#{posType} = 'lowerBr' AND lower_br_no IS NOT NULL)
|
||||
)
|
||||
ORDER BY change_id DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<!-- 统计某次换辊以来的钢卷产量 -->
|
||||
<select id="selectCoilStats" resultType="map">
|
||||
SELECT COALESCE(SUM(exit_length), 0) AS workLength,
|
||||
COUNT(*) AS coilCount,
|
||||
COALESCE(SUM(actual_weight), 0) AS totalWeight
|
||||
FROM mill_production_actual
|
||||
WHERE del_flag = 0
|
||||
AND start_time >= #{startTime}
|
||||
<if test="endTime != null">AND start_time <= #{endTime}</if>
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -171,4 +171,13 @@
|
||||
WHERE del_flag = 0 AND roll_id = #{rollId}
|
||||
</update>
|
||||
|
||||
<!-- 条件更新轧辊状态 — 仅当当前状态为 oldStatus 时才更新 -->
|
||||
<update id="updateStatusByRollNoIfStatus">
|
||||
UPDATE mes_roll_info
|
||||
SET status = #{newStatus}, update_time = NOW()
|
||||
WHERE del_flag = 0
|
||||
AND roll_no = #{rollNo}
|
||||
AND status = #{oldStatus}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
<?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.MesRollStandbyMapper">
|
||||
|
||||
<resultMap type="MesRollStandby" id="MesRollStandbyResult">
|
||||
<result property="standbyId" column="standby_id" />
|
||||
<result property="lineId" column="line_id" />
|
||||
<result property="standNo" column="stand_no" />
|
||||
<result property="rollNo" column="roll_no" />
|
||||
<result property="rollType" column="roll_type" />
|
||||
<result property="position" column="position" />
|
||||
<result property="diameter" column="diameter" />
|
||||
<result property="roughness" column="roughness" />
|
||||
<result property="crown" column="crown" />
|
||||
<result property="readyTime" column="ready_time" />
|
||||
<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="selectMesRollStandbyVo">
|
||||
select standby_id, line_id, stand_no, roll_no, roll_type, position, diameter, roughness, crown, ready_time, del_flag, create_by, create_time, update_by, update_time, remark from mes_roll_standby
|
||||
</sql>
|
||||
|
||||
<select id="selectMesRollStandbyList" parameterType="MesRollStandby" resultMap="MesRollStandbyResult">
|
||||
<include refid="selectMesRollStandbyVo"/>
|
||||
<where>
|
||||
<if test="lineId != null "> and line_id = #{lineId}</if>
|
||||
<if test="standNo != null and standNo != ''"> and stand_no = #{standNo}</if>
|
||||
<if test="rollNo != null and rollNo != ''"> and roll_no = #{rollNo}</if>
|
||||
<if test="rollType != null and rollType != ''"> and roll_type = #{rollType}</if>
|
||||
<if test="position != null and position != ''"> and position = #{position}</if>
|
||||
<if test="diameter != null "> and diameter = #{diameter}</if>
|
||||
<if test="roughness != null "> and roughness = #{roughness}</if>
|
||||
<if test="crown != null "> and crown = #{crown}</if>
|
||||
<if test="readyTime != null "> and ready_time = #{readyTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesRollStandbyByStandbyId" parameterType="Long" resultMap="MesRollStandbyResult">
|
||||
<include refid="selectMesRollStandbyVo"/>
|
||||
where standby_id = #{standbyId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesRollStandby" parameterType="MesRollStandby" useGeneratedKeys="true" keyProperty="standbyId">
|
||||
insert into mes_roll_standby
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="lineId != null">line_id,</if>
|
||||
<if test="standNo != null">stand_no,</if>
|
||||
<if test="rollNo != null">roll_no,</if>
|
||||
<if test="rollType != null">roll_type,</if>
|
||||
<if test="position != null">position,</if>
|
||||
<if test="diameter != null">diameter,</if>
|
||||
<if test="roughness != null">roughness,</if>
|
||||
<if test="crown != null">crown,</if>
|
||||
<if test="readyTime != null">ready_time,</if>
|
||||
<if test="delFlag != null">del_flag,</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>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="lineId != null">#{lineId},</if>
|
||||
<if test="standNo != null">#{standNo},</if>
|
||||
<if test="rollNo != null">#{rollNo},</if>
|
||||
<if test="rollType != null">#{rollType},</if>
|
||||
<if test="position != null">#{position},</if>
|
||||
<if test="diameter != null">#{diameter},</if>
|
||||
<if test="roughness != null">#{roughness},</if>
|
||||
<if test="crown != null">#{crown},</if>
|
||||
<if test="readyTime != null">#{readyTime},</if>
|
||||
<if test="delFlag != null">#{delFlag},</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>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesRollStandby" parameterType="MesRollStandby">
|
||||
update mes_roll_standby
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="lineId != null">line_id = #{lineId},</if>
|
||||
<if test="standNo != null">stand_no = #{standNo},</if>
|
||||
<if test="rollNo != null">roll_no = #{rollNo},</if>
|
||||
<if test="rollType != null">roll_type = #{rollType},</if>
|
||||
<if test="position != null">position = #{position},</if>
|
||||
<if test="diameter != null">diameter = #{diameter},</if>
|
||||
<if test="roughness != null">roughness = #{roughness},</if>
|
||||
<if test="crown != null">crown = #{crown},</if>
|
||||
<if test="readyTime != null">ready_time = #{readyTime},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where standby_id = #{standbyId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesRollStandbyByStandbyId" parameterType="Long">
|
||||
delete from mes_roll_standby where standby_id = #{standbyId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesRollStandbyByStandbyIds" parameterType="String">
|
||||
delete from mes_roll_standby where standby_id in
|
||||
<foreach item="standbyId" collection="array" open="(" separator="," close=")">
|
||||
#{standbyId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectByStand" resultMap="MesRollStandbyResult">
|
||||
<include refid="selectMesRollStandbyVo"/>
|
||||
where line_id = #{lineId} and stand_no = #{standNo}
|
||||
</select>
|
||||
|
||||
<delete id="clearByStand">
|
||||
delete from mes_roll_standby
|
||||
where line_id = #{lineId} and stand_no = #{standNo}
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user