为双机架完成轧辊,质量,模型等内容

This commit is contained in:
2026-05-28 16:16:49 +08:00
parent 91fc8b6e38
commit 80d33d9a3b
69 changed files with 7788 additions and 0 deletions

View File

@@ -0,0 +1,71 @@
package com.ruoyi.mill.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.mill.domain.EqpEquipmentChecklist;
import com.ruoyi.mill.service.IEqpEquipmentChecklistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 双机架设备检验清单
*/
@RestController
@RequestMapping("/mill/eqp/checklist")
public class EqpEquipmentChecklistController extends BaseController {
@Autowired
private IEqpEquipmentChecklistService eqpEquipmentChecklistService;
@PreAuthorize("@ss.hasPermi('mill:eqp:checklist:list')")
@GetMapping("/list")
public TableDataInfo list(EqpEquipmentChecklist checklist) {
startPage();
List<EqpEquipmentChecklist> list = eqpEquipmentChecklistService.selectEqpChecklistList(checklist);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('mill:eqp:checklist:export')")
@Log(title = "设备检验清单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EqpEquipmentChecklist checklist) {
List<EqpEquipmentChecklist> list = eqpEquipmentChecklistService.selectEqpChecklistList(checklist);
ExcelUtil<EqpEquipmentChecklist> util = new ExcelUtil<>(EqpEquipmentChecklist.class);
util.exportExcel(response, list, "设备检验清单数据");
}
@PreAuthorize("@ss.hasPermi('mill:eqp:checklist:query')")
@GetMapping("/{checkId}")
public AjaxResult getInfo(@PathVariable Long checkId) {
return success(eqpEquipmentChecklistService.selectEqpChecklistByCheckId(checkId));
}
@PreAuthorize("@ss.hasPermi('mill:eqp:checklist:add')")
@Log(title = "设备检验清单", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EqpEquipmentChecklist checklist) {
return toAjax(eqpEquipmentChecklistService.insertEqpChecklist(checklist));
}
@PreAuthorize("@ss.hasPermi('mill:eqp:checklist:edit')")
@Log(title = "设备检验清单", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EqpEquipmentChecklist checklist) {
return toAjax(eqpEquipmentChecklistService.updateEqpChecklist(checklist));
}
@PreAuthorize("@ss.hasPermi('mill:eqp:checklist:remove')")
@Log(title = "设备检验清单", businessType = BusinessType.DELETE)
@DeleteMapping("/{checkIds}")
public AjaxResult remove(@PathVariable Long[] checkIds) {
return toAjax(eqpEquipmentChecklistService.deleteEqpChecklistByCheckIds(checkIds));
}
}

View File

@@ -0,0 +1,71 @@
package com.ruoyi.mill.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.mill.domain.EqpEquipmentInspectionRecord;
import com.ruoyi.mill.service.IEqpEquipmentInspectionRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 双机架设备巡检记录
*/
@RestController
@RequestMapping("/mill/eqp/record")
public class EqpEquipmentInspectionRecordController extends BaseController {
@Autowired
private IEqpEquipmentInspectionRecordService eqpEquipmentInspectionRecordService;
@PreAuthorize("@ss.hasPermi('mill:eqp:record:list')")
@GetMapping("/list")
public TableDataInfo list(EqpEquipmentInspectionRecord record) {
startPage();
List<EqpEquipmentInspectionRecord> list = eqpEquipmentInspectionRecordService.selectEqpInspectionRecordList(record);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('mill:eqp:record:export')")
@Log(title = "设备巡检记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EqpEquipmentInspectionRecord record) {
List<EqpEquipmentInspectionRecord> list = eqpEquipmentInspectionRecordService.selectEqpInspectionRecordList(record);
ExcelUtil<EqpEquipmentInspectionRecord> util = new ExcelUtil<>(EqpEquipmentInspectionRecord.class);
util.exportExcel(response, list, "设备巡检记录数据");
}
@PreAuthorize("@ss.hasPermi('mill:eqp:record:query')")
@GetMapping("/{recordId}")
public AjaxResult getInfo(@PathVariable Long recordId) {
return success(eqpEquipmentInspectionRecordService.selectEqpInspectionRecordByRecordId(recordId));
}
@PreAuthorize("@ss.hasPermi('mill:eqp:record:add')")
@Log(title = "设备巡检记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EqpEquipmentInspectionRecord record) {
return toAjax(eqpEquipmentInspectionRecordService.insertEqpInspectionRecord(record));
}
@PreAuthorize("@ss.hasPermi('mill:eqp:record:edit')")
@Log(title = "设备巡检记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EqpEquipmentInspectionRecord record) {
return toAjax(eqpEquipmentInspectionRecordService.updateEqpInspectionRecord(record));
}
@PreAuthorize("@ss.hasPermi('mill:eqp:record:remove')")
@Log(title = "设备巡检记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{recordIds}")
public AjaxResult remove(@PathVariable Long[] recordIds) {
return toAjax(eqpEquipmentInspectionRecordService.deleteEqpInspectionRecordByRecordIds(recordIds));
}
}

View File

@@ -0,0 +1,71 @@
package com.ruoyi.mill.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.mill.domain.EqpEquipmentPart;
import com.ruoyi.mill.service.IEqpEquipmentPartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 双机架设备巡检部位
*/
@RestController
@RequestMapping("/mill/eqp/part")
public class EqpEquipmentPartController extends BaseController {
@Autowired
private IEqpEquipmentPartService eqpEquipmentPartService;
@PreAuthorize("@ss.hasPermi('mill:eqp:part:list')")
@GetMapping("/list")
public TableDataInfo list(EqpEquipmentPart part) {
startPage();
List<EqpEquipmentPart> list = eqpEquipmentPartService.selectEqpPartList(part);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('mill:eqp:part:export')")
@Log(title = "设备巡检部位", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, EqpEquipmentPart part) {
List<EqpEquipmentPart> list = eqpEquipmentPartService.selectEqpPartList(part);
ExcelUtil<EqpEquipmentPart> util = new ExcelUtil<>(EqpEquipmentPart.class);
util.exportExcel(response, list, "设备巡检部位数据");
}
@PreAuthorize("@ss.hasPermi('mill:eqp:part:query')")
@GetMapping("/{partId}")
public AjaxResult getInfo(@PathVariable Long partId) {
return success(eqpEquipmentPartService.selectEqpPartByPartId(partId));
}
@PreAuthorize("@ss.hasPermi('mill:eqp:part:add')")
@Log(title = "设备巡检部位", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody EqpEquipmentPart part) {
return toAjax(eqpEquipmentPartService.insertEqpPart(part));
}
@PreAuthorize("@ss.hasPermi('mill:eqp:part:edit')")
@Log(title = "设备巡检部位", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody EqpEquipmentPart part) {
return toAjax(eqpEquipmentPartService.updateEqpPart(part));
}
@PreAuthorize("@ss.hasPermi('mill:eqp:part:remove')")
@Log(title = "设备巡检部位", businessType = BusinessType.DELETE)
@DeleteMapping("/{partIds}")
public AjaxResult remove(@PathVariable Long[] partIds) {
return toAjax(eqpEquipmentPartService.deleteEqpPartByPartIds(partIds));
}
}

View File

@@ -0,0 +1,28 @@
package com.ruoyi.mill.controller;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.mill.domain.KlpCoilInfo;
import com.ruoyi.mill.service.IKlpCoilService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/mill/klpCoil")
public class KlpCoilController extends BaseController {
@Autowired
private IKlpCoilService klpCoilService;
@GetMapping("/queryByCoilNo")
public AjaxResult queryByCoilNo(@RequestParam String coilNo) {
KlpCoilInfo info = klpCoilService.queryByCoilNo(coilNo);
if (info == null) {
return AjaxResult.error("未找到钢卷信息:" + coilNo);
}
return AjaxResult.success(info);
}
}

View File

@@ -0,0 +1,67 @@
package com.ruoyi.mill.controller;
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.MesRollGrind;
import com.ruoyi.mill.service.IMesRollGrindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.time.LocalDate;
import java.util.List;
/**
* 磨辊间 /mill/roll/grind
*/
@RestController
@RequestMapping("/mill/roll/grind")
public class MesRollGrindController extends BaseController {
@Autowired
private IMesRollGrindService grindService;
@PreAuthorize("@ss.hasPermi('mill:roll:grind:list')")
@GetMapping("/list")
public AjaxResult list(@RequestParam(required = false) Long rollId,
@RequestParam(required = false) String beginTime,
@RequestParam(required = false) String endTime) {
if (rollId != null) {
return AjaxResult.success(grindService.selectMesRollGrindByRollId(rollId));
}
MesRollGrind query = new MesRollGrind();
query.setBeginTime(beginTime);
query.setEndTime(endTime);
return AjaxResult.success(grindService.selectMesRollGrindList(query));
}
@GetMapping("/monthlyStats")
public AjaxResult monthlyStats(@RequestParam Long rollId,
@RequestParam(defaultValue = "0") int year) {
int y = year > 0 ? year : LocalDate.now().getYear();
return AjaxResult.success(grindService.selectMonthlyStats(rollId, y));
}
@PreAuthorize("@ss.hasPermi('mill:roll:grind:add')")
@Log(title = "磨辊间", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesRollGrind grind) {
return toAjax(grindService.insertMesRollGrind(grind));
}
@PreAuthorize("@ss.hasPermi('mill:roll:grind:edit')")
@Log(title = "磨辊间", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesRollGrind grind) {
return toAjax(grindService.updateMesRollGrind(grind));
}
@PreAuthorize("@ss.hasPermi('mill:roll:grind:remove')")
@Log(title = "磨辊间", businessType = BusinessType.DELETE)
@DeleteMapping("/{grindId}")
public AjaxResult remove(@PathVariable Long grindId) {
return toAjax(grindService.deleteMesRollGrindById(grindId));
}
}

View File

@@ -0,0 +1,81 @@
package com.ruoyi.mill.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mill.domain.MesRollInfo;
import com.ruoyi.mill.service.IMesRollInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 轧辊管理 /mill/roll/info
*/
@RestController
@RequestMapping("/mill/roll/info")
public class MesRollInfoController extends BaseController {
private static final Long DOUBLE_RACK_LINE_ID = 5L;
@Autowired
private IMesRollInfoService rollInfoService;
@PreAuthorize("@ss.hasPermi('mill:roll:info:list')")
@GetMapping("/list")
public TableDataInfo list(MesRollInfo rollInfo) {
rollInfo.setLineId(DOUBLE_RACK_LINE_ID);
startPage();
List<MesRollInfo> list = rollInfoService.selectMesRollInfoList(rollInfo);
return getDataTable(list);
}
@GetMapping("/stats")
public AjaxResult stats() {
return AjaxResult.success(rollInfoService.selectStatusStats(DOUBLE_RACK_LINE_ID));
}
@GetMapping("/options")
public AjaxResult options(String rollType, String status) {
return AjaxResult.success(rollInfoService.selectRollNoList(DOUBLE_RACK_LINE_ID, rollType, status));
}
@PreAuthorize("@ss.hasPermi('mill:roll:info:query')")
@GetMapping("/{rollId}")
public AjaxResult getInfo(@PathVariable Long rollId) {
return AjaxResult.success(rollInfoService.selectMesRollInfoById(rollId));
}
@PreAuthorize("@ss.hasPermi('mill:roll:info:add')")
@Log(title = "轧辊管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody MesRollInfo rollInfo) {
return toAjax(rollInfoService.insertMesRollInfo(rollInfo));
}
@PreAuthorize("@ss.hasPermi('mill:roll:info:edit')")
@Log(title = "轧辊管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody MesRollInfo rollInfo) {
return toAjax(rollInfoService.updateMesRollInfo(rollInfo));
}
@PreAuthorize("@ss.hasPermi('mill:roll:info:remove')")
@Log(title = "轧辊管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{rollIds}")
public AjaxResult remove(@PathVariable Long[] rollIds) {
return toAjax(rollInfoService.deleteMesRollInfoByIds(rollIds));
}
@PreAuthorize("@ss.hasPermi('mill:roll:info:edit')")
@Log(title = "轧辊管理-封闭", businessType = BusinessType.UPDATE)
@PutMapping("/{rollId}/scrap")
public AjaxResult scrap(@PathVariable Long rollId) {
rollInfoService.scrapRoll(rollId);
return AjaxResult.success();
}
}

View File

@@ -0,0 +1,48 @@
package com.ruoyi.mill.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mill.domain.QcInspectionItem;
import com.ruoyi.mill.service.IQcInspectionItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/mill/qc/item")
public class QcInspectionItemController extends BaseController {
@Autowired
private IQcInspectionItemService itemService;
@PreAuthorize("@ss.hasPermi('mill:qc:task:list')")
@GetMapping("/list")
public TableDataInfo list(QcInspectionItem item) {
startPage();
List<QcInspectionItem> list = itemService.selectQcInspectionItemList(item);
return getDataTable(list);
}
@GetMapping("/byTask/{taskId}")
public AjaxResult listByTask(@PathVariable Long taskId) {
return AjaxResult.success(itemService.selectQcInspectionItemByTaskId(taskId));
}
@PreAuthorize("@ss.hasPermi('mill:qc:task:query')")
@GetMapping("/{itemId}")
public AjaxResult getInfo(@PathVariable Long itemId) {
return AjaxResult.success(itemService.selectQcInspectionItemById(itemId));
}
@Log(title = "检验项目", businessType = BusinessType.UPDATE)
@PreAuthorize("@ss.hasPermi('mill:qc:task:edit')")
@PutMapping
public AjaxResult edit(@RequestBody QcInspectionItem item) {
return toAjax(itemService.updateQcInspectionItem(item));
}
}

View File

@@ -0,0 +1,62 @@
package com.ruoyi.mill.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mill.domain.QcInspectionTask;
import com.ruoyi.mill.service.IQcInspectionTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/mill/qc/task")
public class QcInspectionTaskController extends BaseController {
@Autowired
private IQcInspectionTaskService taskService;
@PreAuthorize("@ss.hasPermi('mill:qc:task:list')")
@GetMapping("/list")
public TableDataInfo list(QcInspectionTask task) {
startPage();
List<QcInspectionTask> list = taskService.selectQcInspectionTaskListByDoubleRack(task);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('mill:qc:task:query')")
@GetMapping("/{taskId}")
public AjaxResult getInfo(@PathVariable Long taskId) {
return AjaxResult.success(taskService.selectQcInspectionTaskById(taskId));
}
@Log(title = "检验任务", businessType = BusinessType.INSERT)
@PreAuthorize("@ss.hasPermi('mill:qc:task:add')")
@PostMapping
public AjaxResult add(@RequestBody QcInspectionTask task) {
return toAjax(taskService.insertQcInspectionTask(task));
}
@Log(title = "检验任务", businessType = BusinessType.UPDATE)
@PreAuthorize("@ss.hasPermi('mill:qc:task:edit')")
@PutMapping
public AjaxResult edit(@RequestBody QcInspectionTask task) {
return toAjax(taskService.updateQcInspectionTask(task));
}
@Log(title = "检验任务", businessType = BusinessType.DELETE)
@PreAuthorize("@ss.hasPermi('mill:qc:task:remove')")
@DeleteMapping("/{taskIds}")
public AjaxResult remove(@PathVariable Long[] taskIds) {
return toAjax(taskService.deleteQcInspectionTaskByIds(taskIds));
}
@GetMapping("/coils")
public AjaxResult coilList() {
return AjaxResult.success(taskService.selectDoubleRackCoilList());
}
}

View File

@@ -0,0 +1,57 @@
package com.ruoyi.mill.controller;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.mill.domain.WmsCoilAbnormal;
import com.ruoyi.mill.service.IWmsCoilAbnormalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/mill/qc/abnormal")
public class WmsCoilAbnormalController extends BaseController {
@Autowired
private IWmsCoilAbnormalService abnormalService;
@PreAuthorize("@ss.hasPermi('mill:qc:abnormal:list')")
@GetMapping("/list")
public TableDataInfo list(WmsCoilAbnormal abnormal) {
startPage();
List<WmsCoilAbnormal> list = abnormalService.selectWmsCoilAbnormalListByDoubleRack(abnormal);
return getDataTable(list);
}
@PreAuthorize("@ss.hasPermi('mill:qc:abnormal:query')")
@GetMapping("/{abnormalId}")
public AjaxResult getInfo(@PathVariable Long abnormalId) {
return AjaxResult.success(abnormalService.selectWmsCoilAbnormalById(abnormalId));
}
@Log(title = "质量异常", businessType = BusinessType.INSERT)
@PreAuthorize("@ss.hasPermi('mill:qc:abnormal:add')")
@PostMapping
public AjaxResult add(@RequestBody WmsCoilAbnormal abnormal) {
return toAjax(abnormalService.insertWmsCoilAbnormal(abnormal));
}
@Log(title = "质量异常", businessType = BusinessType.UPDATE)
@PreAuthorize("@ss.hasPermi('mill:qc:abnormal:edit')")
@PutMapping
public AjaxResult edit(@RequestBody WmsCoilAbnormal abnormal) {
return toAjax(abnormalService.updateWmsCoilAbnormal(abnormal));
}
@Log(title = "质量异常", businessType = BusinessType.DELETE)
@PreAuthorize("@ss.hasPermi('mill:qc:abnormal:remove')")
@DeleteMapping("/{abnormalIds}")
public AjaxResult remove(@PathVariable Long[] abnormalIds) {
return toAjax(abnormalService.deleteWmsCoilAbnormalByIds(abnormalIds));
}
}

View File

@@ -0,0 +1,43 @@
package com.ruoyi.mill.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 双机架设备检验清单 mill_eqp_checklist
*/
@Data
public class EqpEquipmentChecklist extends BaseEntity {
private static final long serialVersionUID = 1L;
@Excel(name = "清单ID")
private Long checkId;
@Excel(name = "检验编号")
private String checkNo;
@Excel(name = "巡检部位ID")
private Long partId;
@Excel(name = "设备部件名称")
private String partName;
@Excel(name = "检验内容")
private String checkContent;
@Excel(name = "设备状态")
private String equipmentState;
@Excel(name = "检验标准")
private String checkStandard;
@Excel(name = "责任人")
private String responsiblePerson;
@Excel(name = "备注")
private String remark;
private String delFlag;
}

View File

@@ -0,0 +1,59 @@
package com.ruoyi.mill.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
* 双机架设备巡检记录 mill_eqp_inspection_record
*/
@Data
public class EqpEquipmentInspectionRecord extends BaseEntity {
private static final long serialVersionUID = 1L;
@Excel(name = "记录ID")
private Long recordId;
@Excel(name = "检验清单ID")
private Long checkId;
/** 班次 1白班 2夜班 */
@Excel(name = "班次")
private Integer shift;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "巡检时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date inspectTime;
/** 运行状态 1正常 2故障 */
@Excel(name = "运行状态")
private Integer runStatus;
@Excel(name = "巡检人")
private String inspector;
@Excel(name = "异常描述")
private String abnormalDesc;
@Excel(name = "巡检照片")
private String photo;
@Excel(name = "备注")
private String remark;
private String delFlag;
// 关联字段(查询时带出)
private Long partId;
private String checkContent;
private String checkStandard;
private String partName;
// 时间范围查询参数
private String startInspectTime;
private String endInspectTime;
}

View File

@@ -0,0 +1,31 @@
package com.ruoyi.mill.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
/**
* 双机架设备巡检部位 mill_eqp_part
*/
@Data
public class EqpEquipmentPart extends BaseEntity {
private static final long serialVersionUID = 1L;
@Excel(name = "部位ID")
private Long partId;
@Excel(name = "巡检部位")
private String inspectPart;
@Excel(name = "产线")
private String productionLine;
@Excel(name = "产线段")
private String lineSection;
@Excel(name = "备注")
private String remark;
private String delFlag;
}

View File

@@ -0,0 +1,21 @@
package com.ruoyi.mill.domain;
import lombok.Data;
import java.math.BigDecimal;
/** 三级 WMS 钢卷信息(只读,从 klp-oa-test.wms_material_coil 查询) */
@Data
public class KlpCoilInfo {
private Long coilId;
private String enterCoilNo;
private String currentCoilNo;
private String supplierCoilNo;
private String actualThickness;
private BigDecimal actualWidth;
private BigDecimal netWeight;
private BigDecimal grossWeight;
private BigDecimal length;
private String qualityStatus;
private String materialType;
private String temperGrade;
}

View File

@@ -0,0 +1,63 @@
package com.ruoyi.mill.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 磨辊记录 mes_roll_grind
*/
@Data
public class MesRollGrind extends BaseEntity {
private static final long serialVersionUID = 1L;
@Excel(name = "磨削记录ID")
private Long grindId;
private Long lineId;
@Excel(name = "轧辊ID")
private Long rollId;
@Excel(name = "轧辊编号")
private String rollNo;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "磨削时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date grindTime;
@Excel(name = "班组")
private String team;
@Excel(name = "磨前直径(mm)")
private BigDecimal diaBefore;
@Excel(name = "磨后直径(mm)")
private BigDecimal diaAfter;
@Excel(name = "磨削量(mm)")
private BigDecimal grindAmount;
@Excel(name = "辊型")
private String rollShape;
@Excel(name = "探伤结果")
private String flawResult;
@Excel(name = "硬度")
private BigDecimal hardness;
@Excel(name = "操作者")
private String operator;
private Integer delFlag;
// 时间范围查询
private String beginTime;
private String endTime;
}

View File

@@ -0,0 +1,73 @@
package com.ruoyi.mill.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 轧辊库 mes_roll_info
*/
@Data
public class MesRollInfo extends BaseEntity {
private static final long serialVersionUID = 1L;
@Excel(name = "轧辊ID")
private Long rollId;
private Long lineId;
@Excel(name = "轧辊编号")
private String rollNo;
/** WR=工作辊 / BR=支撑辊 */
@Excel(name = "辊型")
private String rollType;
/** Offline / Standby / Online / Scrapped */
@Excel(name = "状态")
private String status;
@Excel(name = "初始辊径(mm)")
private BigDecimal initialDia;
@Excel(name = "当前辊径(mm)")
private BigDecimal currentDia;
@Excel(name = "最小辊径(mm)")
private BigDecimal minDia;
@Excel(name = "粗糙度")
private BigDecimal roughness;
@Excel(name = "凸度")
private BigDecimal crown;
@Excel(name = "材质")
private String material;
@Excel(name = "磨削次数")
private Integer grindCount;
@Excel(name = "累计轧制重量(t)")
private BigDecimal totalRolledWeight;
@Excel(name = "累计轧制长度(m)")
private BigDecimal totalRolledLength;
@Excel(name = "累计轧制卷数")
private Integer totalRolledCount;
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "制造日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date manufactureDate;
@Excel(name = "厂家")
private String manufacturer;
private Integer delFlag;
}

View File

@@ -0,0 +1,33 @@
package com.ruoyi.mill.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 检验任务项目 qc_inspection_item
*/
@Data
public class QcInspectionItem extends BaseEntity {
private static final long serialVersionUID = 1L;
private Long itemId;
private Long taskId;
private String itemName;
private String standardValue;
private BigDecimal upperLimit;
private BigDecimal lowerLimit;
private String unit;
private String itemType;
private String inspectValue;
private Integer isQualified;
private String judgeResult;
private String inspectUser;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date inspectTime;
private Integer delFlag;
}

View File

@@ -0,0 +1,47 @@
package com.ruoyi.mill.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* 检验任务 qc_inspection_task
*/
@Data
public class QcInspectionTask extends BaseEntity {
private static final long serialVersionUID = 1L;
private Long taskId;
private String taskCode;
private String taskType;
private String belongCompany;
private String sourceType;
private Long sourceId;
private Long schemeId;
private String schemeName;
private Integer status;
private String inspectUser;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date inspectTime;
private String auditUser;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date auditTime;
private String result;
private String remark;
private String coilIds;
private String enterCoilNos;
private String attachmentFiles;
private Integer delFlag;
// 查询参数
private String beginTime;
private String endTime;
private Long coilId; // 按单个 coilId 过滤
// 关联数据
private List<QcInspectionItem> items;
}

View File

@@ -0,0 +1,46 @@
package com.ruoyi.mill.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 钢卷异常 wms_coil_abnormal
*/
@Data
public class WmsCoilAbnormal extends BaseEntity {
private static final long serialVersionUID = 1L;
private Long abnormalId;
private Long coilId;
private String productionLine;
private String position;
private String plateSurface;
private BigDecimal length;
private BigDecimal startPosition;
private BigDecimal endPosition;
private String defectCode;
private String defectType;
private BigDecimal defectRate;
private BigDecimal defectWeight;
private String degree;
private String judgeLevel;
private String judgeBy;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date judgeTime;
private Integer mainMark;
private Integer wholeCoilMark;
private String attachmentFiles;
private Integer delFlag;
// 关联字段
private String coilNo; // 从 wms_material_coil 带出
// 查询参数
private String beginTime;
private String endTime;
}

View File

@@ -0,0 +1,20 @@
package com.ruoyi.mill.mapper;
import com.ruoyi.mill.domain.EqpEquipmentChecklist;
import java.util.List;
public interface EqpEquipmentChecklistMapper {
List<EqpEquipmentChecklist> selectEqpChecklistList(EqpEquipmentChecklist checklist);
EqpEquipmentChecklist selectEqpChecklistByCheckId(Long checkId);
int insertEqpChecklist(EqpEquipmentChecklist checklist);
int updateEqpChecklist(EqpEquipmentChecklist checklist);
int deleteEqpChecklistByCheckId(Long checkId);
int deleteEqpChecklistByCheckIds(Long[] checkIds);
}

View File

@@ -0,0 +1,20 @@
package com.ruoyi.mill.mapper;
import com.ruoyi.mill.domain.EqpEquipmentInspectionRecord;
import java.util.List;
public interface EqpEquipmentInspectionRecordMapper {
List<EqpEquipmentInspectionRecord> selectEqpInspectionRecordList(EqpEquipmentInspectionRecord record);
EqpEquipmentInspectionRecord selectEqpInspectionRecordByRecordId(Long recordId);
int insertEqpInspectionRecord(EqpEquipmentInspectionRecord record);
int updateEqpInspectionRecord(EqpEquipmentInspectionRecord record);
int deleteEqpInspectionRecordByRecordId(Long recordId);
int deleteEqpInspectionRecordByRecordIds(Long[] recordIds);
}

View File

@@ -0,0 +1,20 @@
package com.ruoyi.mill.mapper;
import com.ruoyi.mill.domain.EqpEquipmentPart;
import java.util.List;
public interface EqpEquipmentPartMapper {
List<EqpEquipmentPart> selectEqpPartList(EqpEquipmentPart part);
EqpEquipmentPart selectEqpPartByPartId(Long partId);
int insertEqpPart(EqpEquipmentPart part);
int updateEqpPart(EqpEquipmentPart part);
int deleteEqpPartByPartId(Long partId);
int deleteEqpPartByPartIds(Long[] partIds);
}

View File

@@ -0,0 +1,11 @@
package com.ruoyi.mill.mapper;
import com.ruoyi.mill.domain.KlpCoilInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface KlpCoilMapper {
/** 根据入场钢卷号或当前钢卷号查询钢卷基础信息 */
KlpCoilInfo selectByCoilNo(@Param("coilNo") String coilNo);
}

View File

@@ -0,0 +1,24 @@
package com.ruoyi.mill.mapper;
import com.ruoyi.mill.domain.MesRollGrind;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface MesRollGrindMapper {
List<MesRollGrind> selectMesRollGrindList(MesRollGrind grind);
List<MesRollGrind> selectMesRollGrindByRollId(@Param("rollId") Long rollId);
MesRollGrind selectMesRollGrindById(Long grindId);
int insertMesRollGrind(MesRollGrind grind);
int updateMesRollGrind(MesRollGrind grind);
int deleteMesRollGrindById(Long grindId);
List<Map<String, Object>> selectMonthlyStats(@Param("rollId") Long rollId, @Param("year") int year);
}

View File

@@ -0,0 +1,37 @@
package com.ruoyi.mill.mapper;
import com.ruoyi.mill.domain.MesRollInfo;
import org.apache.ibatis.annotations.Param;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
public interface MesRollInfoMapper {
List<MesRollInfo> selectMesRollInfoList(MesRollInfo rollInfo);
MesRollInfo selectMesRollInfoById(Long rollId);
MesRollInfo selectMesRollInfoByRollNo(@Param("rollNo") String rollNo);
int insertMesRollInfo(MesRollInfo rollInfo);
int updateMesRollInfo(MesRollInfo rollInfo);
int deleteMesRollInfoById(Long rollId);
int deleteMesRollInfoByIds(Long[] rollIds);
List<Map<String, Object>> selectStatusStats(@Param("lineId") Long lineId);
List<String> selectRollNoList(@Param("lineId") Long lineId,
@Param("rollType") String rollType,
@Param("status") String status);
int updateStatusByRollNo(@Param("rollNo") String rollNo, @Param("status") String status);
int incrementGrindCount(@Param("rollId") Long rollId, @Param("diaAfter") BigDecimal diaAfter);
int updateCurrentDia(@Param("rollId") Long rollId, @Param("currentDia") BigDecimal currentDia);
}

View File

@@ -0,0 +1,22 @@
package com.ruoyi.mill.mapper;
import com.ruoyi.mill.domain.QcInspectionItem;
import java.util.List;
public interface QcInspectionItemMapper {
List<QcInspectionItem> selectQcInspectionItemList(QcInspectionItem item);
List<QcInspectionItem> selectQcInspectionItemByTaskId(Long taskId);
QcInspectionItem selectQcInspectionItemById(Long itemId);
int insertQcInspectionItem(QcInspectionItem item);
int updateQcInspectionItem(QcInspectionItem item);
int deleteQcInspectionItemById(Long itemId);
int deleteQcInspectionItemByTaskId(Long taskId);
}

View File

@@ -0,0 +1,30 @@
package com.ruoyi.mill.mapper;
import com.ruoyi.mill.domain.QcInspectionTask;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface QcInspectionTaskMapper {
List<QcInspectionTask> selectQcInspectionTaskList(QcInspectionTask task);
List<QcInspectionTask> selectQcInspectionTaskListByCoilIds(@Param("task") QcInspectionTask task,
@Param("coilIds") List<Long> coilIds);
QcInspectionTask selectQcInspectionTaskById(Long taskId);
int insertQcInspectionTask(QcInspectionTask task);
int updateQcInspectionTask(QcInspectionTask task);
int deleteQcInspectionTaskById(Long taskId);
int deleteQcInspectionTaskByIds(Long[] taskIds);
/** 获取所有 processed_coil_ids 字符串(来自双机架 action 类型) */
List<String> selectDoubleRackProcessedCoilIds(@Param("actionTypes") List<Integer> actionTypes);
/** 按 coilId 列表查询钢卷基本信息coilId + current_coil_no */
List<java.util.Map<String, Object>> selectCoilInfoByIds(@Param("coilIds") List<Long> coilIds);
}

View File

@@ -0,0 +1,24 @@
package com.ruoyi.mill.mapper;
import com.ruoyi.mill.domain.WmsCoilAbnormal;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface WmsCoilAbnormalMapper {
List<WmsCoilAbnormal> selectWmsCoilAbnormalList(WmsCoilAbnormal abnormal);
List<WmsCoilAbnormal> selectWmsCoilAbnormalListByCoilIds(@Param("abnormal") WmsCoilAbnormal abnormal,
@Param("coilIds") List<Long> coilIds);
WmsCoilAbnormal selectWmsCoilAbnormalById(Long abnormalId);
int insertWmsCoilAbnormal(WmsCoilAbnormal abnormal);
int updateWmsCoilAbnormal(WmsCoilAbnormal abnormal);
int deleteWmsCoilAbnormalById(Long abnormalId);
int deleteWmsCoilAbnormalByIds(Long[] abnormalIds);
}

View File

@@ -0,0 +1,20 @@
package com.ruoyi.mill.service;
import com.ruoyi.mill.domain.EqpEquipmentChecklist;
import java.util.List;
public interface IEqpEquipmentChecklistService {
List<EqpEquipmentChecklist> selectEqpChecklistList(EqpEquipmentChecklist checklist);
EqpEquipmentChecklist selectEqpChecklistByCheckId(Long checkId);
int insertEqpChecklist(EqpEquipmentChecklist checklist);
int updateEqpChecklist(EqpEquipmentChecklist checklist);
int deleteEqpChecklistByCheckIds(Long[] checkIds);
int deleteEqpChecklistByCheckId(Long checkId);
}

View File

@@ -0,0 +1,20 @@
package com.ruoyi.mill.service;
import com.ruoyi.mill.domain.EqpEquipmentInspectionRecord;
import java.util.List;
public interface IEqpEquipmentInspectionRecordService {
List<EqpEquipmentInspectionRecord> selectEqpInspectionRecordList(EqpEquipmentInspectionRecord record);
EqpEquipmentInspectionRecord selectEqpInspectionRecordByRecordId(Long recordId);
int insertEqpInspectionRecord(EqpEquipmentInspectionRecord record);
int updateEqpInspectionRecord(EqpEquipmentInspectionRecord record);
int deleteEqpInspectionRecordByRecordIds(Long[] recordIds);
int deleteEqpInspectionRecordByRecordId(Long recordId);
}

View File

@@ -0,0 +1,20 @@
package com.ruoyi.mill.service;
import com.ruoyi.mill.domain.EqpEquipmentPart;
import java.util.List;
public interface IEqpEquipmentPartService {
List<EqpEquipmentPart> selectEqpPartList(EqpEquipmentPart part);
EqpEquipmentPart selectEqpPartByPartId(Long partId);
int insertEqpPart(EqpEquipmentPart part);
int updateEqpPart(EqpEquipmentPart part);
int deleteEqpPartByPartIds(Long[] partIds);
int deleteEqpPartByPartId(Long partId);
}

View File

@@ -0,0 +1,8 @@
package com.ruoyi.mill.service;
import com.ruoyi.mill.domain.KlpCoilInfo;
public interface IKlpCoilService {
/** 根据入场钢卷号或当前钢卷号查询三级 WMS 钢卷信息 */
KlpCoilInfo queryByCoilNo(String coilNo);
}

View File

@@ -0,0 +1,23 @@
package com.ruoyi.mill.service;
import com.ruoyi.mill.domain.MesRollGrind;
import java.util.List;
import java.util.Map;
public interface IMesRollGrindService {
List<MesRollGrind> selectMesRollGrindList(MesRollGrind grind);
List<MesRollGrind> selectMesRollGrindByRollId(Long rollId);
MesRollGrind selectMesRollGrindById(Long grindId);
int insertMesRollGrind(MesRollGrind grind);
int updateMesRollGrind(MesRollGrind grind);
int deleteMesRollGrindById(Long grindId);
List<Map<String, Object>> selectMonthlyStats(Long rollId, int year);
}

View File

@@ -0,0 +1,25 @@
package com.ruoyi.mill.service;
import com.ruoyi.mill.domain.MesRollInfo;
import java.util.List;
import java.util.Map;
public interface IMesRollInfoService {
List<MesRollInfo> selectMesRollInfoList(MesRollInfo rollInfo);
MesRollInfo selectMesRollInfoById(Long rollId);
int insertMesRollInfo(MesRollInfo rollInfo);
int updateMesRollInfo(MesRollInfo rollInfo);
int deleteMesRollInfoByIds(Long[] rollIds);
Map<String, Object> selectStatusStats(Long lineId);
List<String> selectRollNoList(Long lineId, String rollType, String status);
void scrapRoll(Long rollId);
}

View File

@@ -0,0 +1,22 @@
package com.ruoyi.mill.service;
import com.ruoyi.mill.domain.QcInspectionItem;
import java.util.List;
public interface IQcInspectionItemService {
List<QcInspectionItem> selectQcInspectionItemList(QcInspectionItem item);
List<QcInspectionItem> selectQcInspectionItemByTaskId(Long taskId);
QcInspectionItem selectQcInspectionItemById(Long itemId);
int insertQcInspectionItem(QcInspectionItem item);
int updateQcInspectionItem(QcInspectionItem item);
int deleteQcInspectionItemById(Long itemId);
int deleteQcInspectionItemByTaskId(Long taskId);
}

View File

@@ -0,0 +1,25 @@
package com.ruoyi.mill.service;
import com.ruoyi.mill.domain.QcInspectionTask;
import java.util.List;
import java.util.Map;
public interface IQcInspectionTaskService {
List<QcInspectionTask> selectQcInspectionTaskList(QcInspectionTask task);
List<QcInspectionTask> selectQcInspectionTaskListByDoubleRack(QcInspectionTask task);
QcInspectionTask selectQcInspectionTaskById(Long taskId);
int insertQcInspectionTask(QcInspectionTask task);
int updateQcInspectionTask(QcInspectionTask task);
int deleteQcInspectionTaskById(Long taskId);
int deleteQcInspectionTaskByIds(Long[] taskIds);
List<Map<String, Object>> selectDoubleRackCoilList();
}

View File

@@ -0,0 +1,22 @@
package com.ruoyi.mill.service;
import com.ruoyi.mill.domain.WmsCoilAbnormal;
import java.util.List;
public interface IWmsCoilAbnormalService {
List<WmsCoilAbnormal> selectWmsCoilAbnormalList(WmsCoilAbnormal abnormal);
List<WmsCoilAbnormal> selectWmsCoilAbnormalListByDoubleRack(WmsCoilAbnormal abnormal);
WmsCoilAbnormal selectWmsCoilAbnormalById(Long abnormalId);
int insertWmsCoilAbnormal(WmsCoilAbnormal abnormal);
int updateWmsCoilAbnormal(WmsCoilAbnormal abnormal);
int deleteWmsCoilAbnormalById(Long abnormalId);
int deleteWmsCoilAbnormalByIds(Long[] abnormalIds);
}

View File

@@ -0,0 +1,52 @@
package com.ruoyi.mill.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.mill.domain.EqpEquipmentChecklist;
import com.ruoyi.mill.mapper.EqpEquipmentChecklistMapper;
import com.ruoyi.mill.service.IEqpEquipmentChecklistService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@DataSource(DataSourceType.KLP)
public class EqpEquipmentChecklistServiceImpl implements IEqpEquipmentChecklistService {
@Autowired
private EqpEquipmentChecklistMapper eqpEquipmentChecklistMapper;
@Override
public List<EqpEquipmentChecklist> selectEqpChecklistList(EqpEquipmentChecklist checklist) {
return eqpEquipmentChecklistMapper.selectEqpChecklistList(checklist);
}
@Override
public EqpEquipmentChecklist selectEqpChecklistByCheckId(Long checkId) {
return eqpEquipmentChecklistMapper.selectEqpChecklistByCheckId(checkId);
}
@Override
public int insertEqpChecklist(EqpEquipmentChecklist checklist) {
checklist.setCreateTime(DateUtils.getNowDate());
return eqpEquipmentChecklistMapper.insertEqpChecklist(checklist);
}
@Override
public int updateEqpChecklist(EqpEquipmentChecklist checklist) {
checklist.setUpdateTime(DateUtils.getNowDate());
return eqpEquipmentChecklistMapper.updateEqpChecklist(checklist);
}
@Override
public int deleteEqpChecklistByCheckIds(Long[] checkIds) {
return eqpEquipmentChecklistMapper.deleteEqpChecklistByCheckIds(checkIds);
}
@Override
public int deleteEqpChecklistByCheckId(Long checkId) {
return eqpEquipmentChecklistMapper.deleteEqpChecklistByCheckId(checkId);
}
}

View File

@@ -0,0 +1,52 @@
package com.ruoyi.mill.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.mill.domain.EqpEquipmentInspectionRecord;
import com.ruoyi.mill.mapper.EqpEquipmentInspectionRecordMapper;
import com.ruoyi.mill.service.IEqpEquipmentInspectionRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@DataSource(DataSourceType.KLP)
public class EqpEquipmentInspectionRecordServiceImpl implements IEqpEquipmentInspectionRecordService {
@Autowired
private EqpEquipmentInspectionRecordMapper eqpEquipmentInspectionRecordMapper;
@Override
public List<EqpEquipmentInspectionRecord> selectEqpInspectionRecordList(EqpEquipmentInspectionRecord record) {
return eqpEquipmentInspectionRecordMapper.selectEqpInspectionRecordList(record);
}
@Override
public EqpEquipmentInspectionRecord selectEqpInspectionRecordByRecordId(Long recordId) {
return eqpEquipmentInspectionRecordMapper.selectEqpInspectionRecordByRecordId(recordId);
}
@Override
public int insertEqpInspectionRecord(EqpEquipmentInspectionRecord record) {
record.setCreateTime(DateUtils.getNowDate());
return eqpEquipmentInspectionRecordMapper.insertEqpInspectionRecord(record);
}
@Override
public int updateEqpInspectionRecord(EqpEquipmentInspectionRecord record) {
record.setUpdateTime(DateUtils.getNowDate());
return eqpEquipmentInspectionRecordMapper.updateEqpInspectionRecord(record);
}
@Override
public int deleteEqpInspectionRecordByRecordIds(Long[] recordIds) {
return eqpEquipmentInspectionRecordMapper.deleteEqpInspectionRecordByRecordIds(recordIds);
}
@Override
public int deleteEqpInspectionRecordByRecordId(Long recordId) {
return eqpEquipmentInspectionRecordMapper.deleteEqpInspectionRecordByRecordId(recordId);
}
}

View File

@@ -0,0 +1,52 @@
package com.ruoyi.mill.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.mill.domain.EqpEquipmentPart;
import com.ruoyi.mill.mapper.EqpEquipmentPartMapper;
import com.ruoyi.mill.service.IEqpEquipmentPartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@DataSource(DataSourceType.KLP)
public class EqpEquipmentPartServiceImpl implements IEqpEquipmentPartService {
@Autowired
private EqpEquipmentPartMapper eqpEquipmentPartMapper;
@Override
public List<EqpEquipmentPart> selectEqpPartList(EqpEquipmentPart part) {
return eqpEquipmentPartMapper.selectEqpPartList(part);
}
@Override
public EqpEquipmentPart selectEqpPartByPartId(Long partId) {
return eqpEquipmentPartMapper.selectEqpPartByPartId(partId);
}
@Override
public int insertEqpPart(EqpEquipmentPart part) {
part.setCreateTime(DateUtils.getNowDate());
return eqpEquipmentPartMapper.insertEqpPart(part);
}
@Override
public int updateEqpPart(EqpEquipmentPart part) {
part.setUpdateTime(DateUtils.getNowDate());
return eqpEquipmentPartMapper.updateEqpPart(part);
}
@Override
public int deleteEqpPartByPartIds(Long[] partIds) {
return eqpEquipmentPartMapper.deleteEqpPartByPartIds(partIds);
}
@Override
public int deleteEqpPartByPartId(Long partId) {
return eqpEquipmentPartMapper.deleteEqpPartByPartId(partId);
}
}

View File

@@ -0,0 +1,22 @@
package com.ruoyi.mill.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.mill.domain.KlpCoilInfo;
import com.ruoyi.mill.mapper.KlpCoilMapper;
import com.ruoyi.mill.service.IKlpCoilService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
@DataSource(DataSourceType.KLP)
public class KlpCoilServiceImpl implements IKlpCoilService {
@Autowired
private KlpCoilMapper klpCoilMapper;
@Override
public KlpCoilInfo queryByCoilNo(String coilNo) {
return klpCoilMapper.selectByCoilNo(coilNo);
}
}

View File

@@ -0,0 +1,93 @@
package com.ruoyi.mill.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.mill.domain.MesRollGrind;
import com.ruoyi.mill.domain.MesRollInfo;
import com.ruoyi.mill.mapper.MesRollGrindMapper;
import com.ruoyi.mill.mapper.MesRollInfoMapper;
import com.ruoyi.mill.service.IMesRollGrindService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
@Service
@DataSource(DataSourceType.KLP)
public class MesRollGrindServiceImpl implements IMesRollGrindService {
@Autowired
private MesRollGrindMapper grindMapper;
@Autowired
private MesRollInfoMapper rollInfoMapper;
@Override
public List<MesRollGrind> selectMesRollGrindList(MesRollGrind grind) {
return grindMapper.selectMesRollGrindList(grind);
}
@Override
public List<MesRollGrind> selectMesRollGrindByRollId(Long rollId) {
return grindMapper.selectMesRollGrindByRollId(rollId);
}
@Override
public MesRollGrind selectMesRollGrindById(Long grindId) {
return grindMapper.selectMesRollGrindById(grindId);
}
@Override
@Transactional(rollbackFor = Exception.class)
public int insertMesRollGrind(MesRollGrind grind) {
if (grind.getGrindTime() == null) {
grind.setGrindTime(new Date());
}
if (grind.getDiaBefore() != null && grind.getDiaAfter() != null) {
grind.setGrindAmount(grind.getDiaBefore().subtract(grind.getDiaAfter()));
}
// 自动填写轧辊编号
if (grind.getRollNo() == null && grind.getRollId() != null) {
MesRollInfo info = rollInfoMapper.selectMesRollInfoById(grind.getRollId());
if (info != null) grind.setRollNo(info.getRollNo());
}
int result = grindMapper.insertMesRollGrind(grind);
// 同步更新轧辊当前直径 + 磨削次数+1
rollInfoMapper.incrementGrindCount(grind.getRollId(), grind.getDiaAfter());
return result;
}
@Override
@Transactional(rollbackFor = Exception.class)
public int updateMesRollGrind(MesRollGrind grind) {
if (grind.getDiaBefore() != null && grind.getDiaAfter() != null) {
grind.setGrindAmount(grind.getDiaBefore().subtract(grind.getDiaAfter()));
}
int result = grindMapper.updateMesRollGrind(grind);
// 以最新磨削记录的磨后径更新当前直径
if (result > 0 && grind.getDiaAfter() != null && grind.getRollId() != null) {
List<MesRollGrind> list = grindMapper.selectMesRollGrindByRollId(grind.getRollId());
if (!list.isEmpty()) {
BigDecimal latestDia = list.get(list.size() - 1).getDiaAfter();
if (latestDia != null) {
rollInfoMapper.updateCurrentDia(grind.getRollId(), latestDia);
}
}
}
return result;
}
@Override
public int deleteMesRollGrindById(Long grindId) {
return grindMapper.deleteMesRollGrindById(grindId);
}
@Override
public List<Map<String, Object>> selectMonthlyStats(Long rollId, int year) {
return grindMapper.selectMonthlyStats(rollId, year);
}
}

View File

@@ -0,0 +1,86 @@
package com.ruoyi.mill.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.mill.domain.MesRollInfo;
import com.ruoyi.mill.mapper.MesRollInfoMapper;
import com.ruoyi.mill.service.IMesRollInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@DataSource(DataSourceType.KLP)
public class MesRollInfoServiceImpl implements IMesRollInfoService {
@Autowired
private MesRollInfoMapper rollInfoMapper;
@Override
public List<MesRollInfo> selectMesRollInfoList(MesRollInfo rollInfo) {
return rollInfoMapper.selectMesRollInfoList(rollInfo);
}
@Override
public MesRollInfo selectMesRollInfoById(Long rollId) {
return rollInfoMapper.selectMesRollInfoById(rollId);
}
@Override
public int insertMesRollInfo(MesRollInfo rollInfo) {
if (rollInfo.getStatus() == null) {
rollInfo.setStatus("Offline");
}
if (rollInfo.getGrindCount() == null) {
rollInfo.setGrindCount(0);
}
// 双机架产线 lineId 固定为 5
rollInfo.setLineId(5L);
return rollInfoMapper.insertMesRollInfo(rollInfo);
}
@Override
public int updateMesRollInfo(MesRollInfo rollInfo) {
return rollInfoMapper.updateMesRollInfo(rollInfo);
}
@Override
public int deleteMesRollInfoByIds(Long[] rollIds) {
return rollInfoMapper.deleteMesRollInfoByIds(rollIds);
}
@Override
public Map<String, Object> selectStatusStats(Long lineId) {
List<Map<String, Object>> rows = rollInfoMapper.selectStatusStats(lineId);
Map<String, Object> result = new HashMap<>(8);
int total = 0;
for (Map<String, Object> row : rows) {
String status = (String) row.get("status");
Number cnt = (Number) row.get("cnt");
result.put(status, cnt.intValue());
total += cnt.intValue();
}
result.put("total", total);
return result;
}
@Override
public List<String> selectRollNoList(Long lineId, String rollType, String status) {
return rollInfoMapper.selectRollNoList(lineId, rollType, status);
}
@Override
public void scrapRoll(Long rollId) {
MesRollInfo current = rollInfoMapper.selectMesRollInfoById(rollId);
if (current == null || !"Offline".equals(current.getStatus())) {
throw new RuntimeException("只有离线状态的轧辊才可封闭");
}
MesRollInfo update = new MesRollInfo();
update.setRollId(rollId);
update.setStatus("Scrapped");
rollInfoMapper.updateMesRollInfo(update);
}
}

View File

@@ -0,0 +1,54 @@
package com.ruoyi.mill.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.mill.domain.QcInspectionItem;
import com.ruoyi.mill.mapper.QcInspectionItemMapper;
import com.ruoyi.mill.service.IQcInspectionItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@DataSource(DataSourceType.KLP)
public class QcInspectionItemServiceImpl implements IQcInspectionItemService {
@Autowired
private QcInspectionItemMapper itemMapper;
@Override
public List<QcInspectionItem> selectQcInspectionItemList(QcInspectionItem item) {
return itemMapper.selectQcInspectionItemList(item);
}
@Override
public List<QcInspectionItem> selectQcInspectionItemByTaskId(Long taskId) {
return itemMapper.selectQcInspectionItemByTaskId(taskId);
}
@Override
public QcInspectionItem selectQcInspectionItemById(Long itemId) {
return itemMapper.selectQcInspectionItemById(itemId);
}
@Override
public int insertQcInspectionItem(QcInspectionItem item) {
return itemMapper.insertQcInspectionItem(item);
}
@Override
public int updateQcInspectionItem(QcInspectionItem item) {
return itemMapper.updateQcInspectionItem(item);
}
@Override
public int deleteQcInspectionItemById(Long itemId) {
return itemMapper.deleteQcInspectionItemById(itemId);
}
@Override
public int deleteQcInspectionItemByTaskId(Long taskId) {
return itemMapper.deleteQcInspectionItemByTaskId(taskId);
}
}

View File

@@ -0,0 +1,94 @@
package com.ruoyi.mill.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.mill.domain.QcInspectionTask;
import com.ruoyi.mill.mapper.QcInspectionTaskMapper;
import com.ruoyi.mill.service.IQcInspectionTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
@Service
@DataSource(DataSourceType.KLP)
public class QcInspectionTaskServiceImpl implements IQcInspectionTaskService {
private static final List<Integer> DOUBLE_RACK_ACTION_TYPES = Arrays.asList(205, 504, 524);
@Autowired
private QcInspectionTaskMapper taskMapper;
@Override
public List<QcInspectionTask> selectQcInspectionTaskList(QcInspectionTask task) {
return taskMapper.selectQcInspectionTaskList(task);
}
@Override
public List<QcInspectionTask> selectQcInspectionTaskListByDoubleRack(QcInspectionTask task) {
List<Long> coilIds = getDoubleRackCoilIds();
if (coilIds.isEmpty()) {
return Collections.emptyList();
}
return taskMapper.selectQcInspectionTaskListByCoilIds(task, coilIds);
}
@Override
public QcInspectionTask selectQcInspectionTaskById(Long taskId) {
return taskMapper.selectQcInspectionTaskById(taskId);
}
@Override
public int insertQcInspectionTask(QcInspectionTask task) {
return taskMapper.insertQcInspectionTask(task);
}
@Override
public int updateQcInspectionTask(QcInspectionTask task) {
return taskMapper.updateQcInspectionTask(task);
}
@Override
public int deleteQcInspectionTaskById(Long taskId) {
return taskMapper.deleteQcInspectionTaskById(taskId);
}
@Override
public int deleteQcInspectionTaskByIds(Long[] taskIds) {
return taskMapper.deleteQcInspectionTaskByIds(taskIds);
}
@Override
public List<Map<String, Object>> selectDoubleRackCoilList() {
List<Long> coilIds = getDoubleRackCoilIds();
if (coilIds.isEmpty()) {
return Collections.emptyList();
}
return taskMapper.selectCoilInfoByIds(coilIds);
}
private List<Long> getDoubleRackCoilIds() {
List<String> processedList = taskMapper.selectDoubleRackProcessedCoilIds(DOUBLE_RACK_ACTION_TYPES);
Set<Long> coilIdSet = new HashSet<>();
for (String csv : processedList) {
if (csv != null && !csv.isEmpty()) {
for (String part : csv.split(",")) {
part = part.trim();
if (!part.isEmpty()) {
try {
coilIdSet.add(Long.parseLong(part));
} catch (NumberFormatException ignored) {
}
}
}
}
}
return coilIdSet.stream().collect(Collectors.toList());
}
}

View File

@@ -0,0 +1,88 @@
package com.ruoyi.mill.service.impl;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.mill.domain.WmsCoilAbnormal;
import com.ruoyi.mill.mapper.QcInspectionTaskMapper;
import com.ruoyi.mill.mapper.WmsCoilAbnormalMapper;
import com.ruoyi.mill.service.IWmsCoilAbnormalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@Service
@DataSource(DataSourceType.KLP)
public class WmsCoilAbnormalServiceImpl implements IWmsCoilAbnormalService {
private static final List<Integer> DOUBLE_RACK_ACTION_TYPES = Arrays.asList(205, 504, 524);
@Autowired
private WmsCoilAbnormalMapper abnormalMapper;
@Autowired
private QcInspectionTaskMapper taskMapper;
@Override
public List<WmsCoilAbnormal> selectWmsCoilAbnormalList(WmsCoilAbnormal abnormal) {
return abnormalMapper.selectWmsCoilAbnormalList(abnormal);
}
@Override
public List<WmsCoilAbnormal> selectWmsCoilAbnormalListByDoubleRack(WmsCoilAbnormal abnormal) {
List<Long> coilIds = getDoubleRackCoilIds();
if (coilIds.isEmpty()) {
return Collections.emptyList();
}
return abnormalMapper.selectWmsCoilAbnormalListByCoilIds(abnormal, coilIds);
}
@Override
public WmsCoilAbnormal selectWmsCoilAbnormalById(Long abnormalId) {
return abnormalMapper.selectWmsCoilAbnormalById(abnormalId);
}
@Override
public int insertWmsCoilAbnormal(WmsCoilAbnormal abnormal) {
return abnormalMapper.insertWmsCoilAbnormal(abnormal);
}
@Override
public int updateWmsCoilAbnormal(WmsCoilAbnormal abnormal) {
return abnormalMapper.updateWmsCoilAbnormal(abnormal);
}
@Override
public int deleteWmsCoilAbnormalById(Long abnormalId) {
return abnormalMapper.deleteWmsCoilAbnormalById(abnormalId);
}
@Override
public int deleteWmsCoilAbnormalByIds(Long[] abnormalIds) {
return abnormalMapper.deleteWmsCoilAbnormalByIds(abnormalIds);
}
private List<Long> getDoubleRackCoilIds() {
List<String> processedList = taskMapper.selectDoubleRackProcessedCoilIds(DOUBLE_RACK_ACTION_TYPES);
Set<Long> coilIdSet = new HashSet<>();
for (String csv : processedList) {
if (csv != null && !csv.isEmpty()) {
for (String part : csv.split(",")) {
part = part.trim();
if (!part.isEmpty()) {
try {
coilIdSet.add(Long.parseLong(part));
} catch (NumberFormatException ignored) {
}
}
}
}
}
return coilIdSet.stream().collect(Collectors.toList());
}
}

View File

@@ -0,0 +1,106 @@
<?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.EqpEquipmentChecklistMapper">
<resultMap type="com.ruoyi.mill.domain.EqpEquipmentChecklist" id="EqpChecklistResult">
<id property="checkId" column="check_id" />
<result property="checkNo" column="check_no" />
<result property="partId" column="part_id" />
<result property="partName" column="part_name" />
<result property="checkContent" column="check_content" />
<result property="equipmentState" column="equipment_state" />
<result property="checkStandard" column="check_standard" />
<result property="responsiblePerson" column="responsible_person" />
<result property="remark" column="remark" />
<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" />
</resultMap>
<sql id="selectEqpChecklistVo">
select check_id, check_no, part_id, part_name, check_content, equipment_state,
check_standard, responsible_person, remark, del_flag,
create_by, create_time, update_by, update_time
from eqp_equipment_checklist
</sql>
<select id="selectEqpChecklistList" parameterType="com.ruoyi.mill.domain.EqpEquipmentChecklist" resultMap="EqpChecklistResult">
<include refid="selectEqpChecklistVo"/>
<where>
and del_flag = '0'
<if test="checkNo != null and checkNo != ''"> and check_no like concat('%', #{checkNo}, '%')</if>
<if test="partId != null"> and part_id = #{partId}</if>
<if test="partName != null and partName != ''"> and part_name like concat('%', #{partName}, '%')</if>
<if test="equipmentState != null and equipmentState != ''"> and equipment_state = #{equipmentState}</if>
<if test="checkStandard != null and checkStandard != ''"> and check_standard like concat('%', #{checkStandard}, '%')</if>
<if test="responsiblePerson != null and responsiblePerson != ''"> and responsible_person like concat('%', #{responsiblePerson}, '%')</if>
</where>
order by check_id asc
</select>
<select id="selectEqpChecklistByCheckId" parameterType="Long" resultMap="EqpChecklistResult">
<include refid="selectEqpChecklistVo"/>
where check_id = #{checkId} and del_flag = '0'
</select>
<insert id="insertEqpChecklist" parameterType="com.ruoyi.mill.domain.EqpEquipmentChecklist" useGeneratedKeys="true" keyProperty="checkId">
insert into eqp_equipment_checklist
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="checkNo != null">check_no,</if>
<if test="partId != null">part_id,</if>
<if test="partName != null">part_name,</if>
<if test="checkContent != null">check_content,</if>
<if test="equipmentState != null">equipment_state,</if>
<if test="checkStandard != null">check_standard,</if>
<if test="responsiblePerson != null">responsible_person,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
del_flag,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkNo != null">#{checkNo},</if>
<if test="partId != null">#{partId},</if>
<if test="partName != null">#{partName},</if>
<if test="checkContent != null">#{checkContent},</if>
<if test="equipmentState != null">#{equipmentState},</if>
<if test="checkStandard != null">#{checkStandard},</if>
<if test="responsiblePerson != null">#{responsiblePerson},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
'0',
</trim>
</insert>
<update id="updateEqpChecklist" parameterType="com.ruoyi.mill.domain.EqpEquipmentChecklist">
update eqp_equipment_checklist
<trim prefix="SET" suffixOverrides=",">
<if test="checkNo != null">check_no = #{checkNo},</if>
<if test="partId != null">part_id = #{partId},</if>
<if test="partName != null">part_name = #{partName},</if>
<if test="checkContent != null">check_content = #{checkContent},</if>
<if test="equipmentState != null">equipment_state = #{equipmentState},</if>
<if test="checkStandard != null">check_standard = #{checkStandard},</if>
<if test="responsiblePerson != null">responsible_person = #{responsiblePerson},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where check_id = #{checkId}
</update>
<delete id="deleteEqpChecklistByCheckId" parameterType="Long">
update eqp_equipment_checklist set del_flag = '2' where check_id = #{checkId}
</delete>
<delete id="deleteEqpChecklistByCheckIds" parameterType="String">
update eqp_equipment_checklist set del_flag = '2' where check_id in
<foreach item="checkId" collection="array" open="(" separator="," close=")">
#{checkId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,115 @@
<?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.EqpEquipmentInspectionRecordMapper">
<resultMap type="com.ruoyi.mill.domain.EqpEquipmentInspectionRecord" id="EqpInspectionRecordResult">
<id property="recordId" column="record_id" />
<result property="checkId" column="check_id" />
<result property="shift" column="shift" />
<result property="inspectTime" column="inspect_time" />
<result property="runStatus" column="run_status" />
<result property="inspector" column="inspector" />
<result property="abnormalDesc" column="abnormal_desc" />
<result property="photo" column="photo" />
<result property="remark" column="remark" />
<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="checkContent" column="check_content" />
<result property="checkStandard" column="check_standard" />
<result property="partName" column="part_name" />
<result property="partId" column="part_id" />
</resultMap>
<select id="selectEqpInspectionRecordList" parameterType="com.ruoyi.mill.domain.EqpEquipmentInspectionRecord" resultMap="EqpInspectionRecordResult">
select r.record_id, r.check_id, r.shift, r.inspect_time, r.run_status,
r.inspector, r.abnormal_desc, r.photo, r.remark, r.del_flag,
r.create_by, r.create_time, r.update_by, r.update_time,
c.check_content, c.check_standard, c.part_name, c.part_id
from eqp_equipment_inspection_record r
left join eqp_equipment_checklist c on r.check_id = c.check_id and c.del_flag = '0'
<where>
and r.del_flag = '0'
<if test="checkId != null"> and r.check_id = #{checkId}</if>
<if test="partId != null"> and c.part_id = #{partId}</if>
<if test="shift != null"> and r.shift = #{shift}</if>
<if test="runStatus != null"> and r.run_status = #{runStatus}</if>
<if test="inspector != null and inspector != ''"> and r.inspector like concat('%', #{inspector}, '%')</if>
<if test="abnormalDesc != null and abnormalDesc != ''"> and r.abnormal_desc like concat('%', #{abnormalDesc}, '%')</if>
<if test="startInspectTime != null and startInspectTime != ''"> and r.inspect_time &gt;= #{startInspectTime}</if>
<if test="endInspectTime != null and endInspectTime != ''"> and r.inspect_time &lt;= concat(#{endInspectTime}, ' 23:59:59')</if>
</where>
order by r.inspect_time desc
</select>
<select id="selectEqpInspectionRecordByRecordId" parameterType="Long" resultMap="EqpInspectionRecordResult">
select r.record_id, r.check_id, r.shift, r.inspect_time, r.run_status,
r.inspector, r.abnormal_desc, r.photo, r.remark, r.del_flag,
r.create_by, r.create_time, r.update_by, r.update_time,
c.check_content, c.check_standard, c.part_name, c.part_id
from eqp_equipment_inspection_record r
left join eqp_equipment_checklist c on r.check_id = c.check_id and c.del_flag = '0'
where r.record_id = #{recordId} and r.del_flag = '0'
</select>
<insert id="insertEqpInspectionRecord" parameterType="com.ruoyi.mill.domain.EqpEquipmentInspectionRecord" useGeneratedKeys="true" keyProperty="recordId">
insert into eqp_equipment_inspection_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="checkId != null">check_id,</if>
<if test="shift != null">shift,</if>
<if test="inspectTime != null">inspect_time,</if>
<if test="runStatus != null">run_status,</if>
<if test="inspector != null">inspector,</if>
<if test="abnormalDesc != null">abnormal_desc,</if>
<if test="photo != null">photo,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
del_flag,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="checkId != null">#{checkId},</if>
<if test="shift != null">#{shift},</if>
<if test="inspectTime != null">#{inspectTime},</if>
<if test="runStatus != null">#{runStatus},</if>
<if test="inspector != null">#{inspector},</if>
<if test="abnormalDesc != null">#{abnormalDesc},</if>
<if test="photo != null">#{photo},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
'0',
</trim>
</insert>
<update id="updateEqpInspectionRecord" parameterType="com.ruoyi.mill.domain.EqpEquipmentInspectionRecord">
update eqp_equipment_inspection_record
<trim prefix="SET" suffixOverrides=",">
<if test="checkId != null">check_id = #{checkId},</if>
<if test="shift != null">shift = #{shift},</if>
<if test="inspectTime != null">inspect_time = #{inspectTime},</if>
<if test="runStatus != null">run_status = #{runStatus},</if>
<if test="inspector != null">inspector = #{inspector},</if>
<if test="abnormalDesc != null">abnormal_desc = #{abnormalDesc},</if>
<if test="photo != null">photo = #{photo},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where record_id = #{recordId}
</update>
<delete id="deleteEqpInspectionRecordByRecordId" parameterType="Long">
update eqp_equipment_inspection_record set del_flag = '2' where record_id = #{recordId}
</delete>
<delete id="deleteEqpInspectionRecordByRecordIds" parameterType="String">
update eqp_equipment_inspection_record set del_flag = '2' where record_id in
<foreach item="recordId" collection="array" open="(" separator="," close=")">
#{recordId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,86 @@
<?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.EqpEquipmentPartMapper">
<resultMap type="com.ruoyi.mill.domain.EqpEquipmentPart" id="EqpPartResult">
<id property="partId" column="part_id" />
<result property="inspectPart" column="inspect_part" />
<result property="productionLine" column="production_line" />
<result property="lineSection" column="line_section" />
<result property="remark" column="remark" />
<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" />
</resultMap>
<sql id="selectEqpPartVo">
select part_id, inspect_part, production_line, line_section, remark,
del_flag, create_by, create_time, update_by, update_time
from eqp_equipment_part
</sql>
<select id="selectEqpPartList" parameterType="com.ruoyi.mill.domain.EqpEquipmentPart" resultMap="EqpPartResult">
<include refid="selectEqpPartVo"/>
<where>
and del_flag = '0'
<if test="inspectPart != null and inspectPart != ''"> and inspect_part like concat('%', #{inspectPart}, '%')</if>
<if test="productionLine != null and productionLine != ''"> and production_line = #{productionLine}</if>
<if test="lineSection != null and lineSection != ''"> and line_section like concat('%', #{lineSection}, '%')</if>
</where>
order by part_id asc
</select>
<select id="selectEqpPartByPartId" parameterType="Long" resultMap="EqpPartResult">
<include refid="selectEqpPartVo"/>
where part_id = #{partId} and del_flag = '0'
</select>
<insert id="insertEqpPart" parameterType="com.ruoyi.mill.domain.EqpEquipmentPart" useGeneratedKeys="true" keyProperty="partId">
insert into eqp_equipment_part
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="inspectPart != null and inspectPart != ''">inspect_part,</if>
<if test="productionLine != null">production_line,</if>
<if test="lineSection != null">line_section,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
del_flag,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="inspectPart != null and inspectPart != ''">#{inspectPart},</if>
<if test="productionLine != null">#{productionLine},</if>
<if test="lineSection != null">#{lineSection},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
'0',
</trim>
</insert>
<update id="updateEqpPart" parameterType="com.ruoyi.mill.domain.EqpEquipmentPart">
update eqp_equipment_part
<trim prefix="SET" suffixOverrides=",">
<if test="inspectPart != null and inspectPart != ''">inspect_part = #{inspectPart},</if>
<if test="productionLine != null">production_line = #{productionLine},</if>
<if test="lineSection != null">line_section = #{lineSection},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where part_id = #{partId}
</update>
<delete id="deleteEqpPartByPartId" parameterType="Long">
update eqp_equipment_part set del_flag = '2' where part_id = #{partId}
</delete>
<delete id="deleteEqpPartByPartIds" parameterType="String">
update eqp_equipment_part set del_flag = '2' where part_id in
<foreach item="partId" collection="array" open="(" separator="," close=")">
#{partId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,30 @@
<?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.KlpCoilMapper">
<resultMap id="KlpCoilInfoResult" type="com.ruoyi.mill.domain.KlpCoilInfo">
<id property="coilId" column="coil_id"/>
<result property="enterCoilNo" column="enter_coil_no"/>
<result property="currentCoilNo" column="current_coil_no"/>
<result property="supplierCoilNo" column="supplier_coil_no"/>
<result property="actualThickness" column="actual_thickness"/>
<result property="actualWidth" column="actual_width"/>
<result property="netWeight" column="net_weight"/>
<result property="grossWeight" column="gross_weight"/>
<result property="length" column="length"/>
<result property="qualityStatus" column="quality_status"/>
<result property="materialType" column="material_type"/>
<result property="temperGrade" column="temper_grade"/>
</resultMap>
<select id="selectByCoilNo" resultMap="KlpCoilInfoResult">
SELECT coil_id, enter_coil_no, current_coil_no, supplier_coil_no,
actual_thickness, actual_width, net_weight, gross_weight, length,
quality_status, material_type, temper_grade
FROM wms_material_coil
WHERE enter_coil_no = #{coilNo}
OR current_coil_no = #{coilNo}
LIMIT 1
</select>
</mapper>

View File

@@ -0,0 +1,133 @@
<?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.MesRollGrindMapper">
<resultMap type="com.ruoyi.mill.domain.MesRollGrind" id="MesRollGrindResult">
<id property="grindId" column="grind_id" />
<result property="lineId" column="line_id" />
<result property="rollId" column="roll_id" />
<result property="rollNo" column="roll_no" />
<result property="grindTime" column="grind_time" />
<result property="team" column="team" />
<result property="diaBefore" column="dia_before" />
<result property="diaAfter" column="dia_after" />
<result property="grindAmount" column="grind_amount" />
<result property="rollShape" column="roll_shape" />
<result property="flawResult" column="flaw_result" />
<result property="hardness" column="hardness" />
<result property="operator" column="operator" />
<result property="remark" column="remark" />
<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" />
</resultMap>
<select id="selectMesRollGrindList" parameterType="com.ruoyi.mill.domain.MesRollGrind" resultMap="MesRollGrindResult">
SELECT grind_id, line_id, roll_id, roll_no, grind_time, team, dia_before, dia_after,
grind_amount, roll_shape, flaw_result,
CASE WHEN hardness = '未倒角' THEN 0 ELSE CAST(hardness AS DECIMAL(10,1)) END AS hardness,
operator, remark, del_flag, create_by, create_time
FROM mes_roll_grind
<where>
and del_flag = 0
<if test="rollId != null"> and roll_id = #{rollId}</if>
<if test="lineId != null"> and line_id = #{lineId}</if>
<if test="beginTime != null and beginTime != ''"> and grind_time &gt;= #{beginTime}</if>
<if test="endTime != null and endTime != ''"> and grind_time &lt;= #{endTime}</if>
</where>
ORDER BY grind_time ASC, grind_id ASC
</select>
<select id="selectMesRollGrindByRollId" resultMap="MesRollGrindResult">
SELECT grind_id, line_id, roll_id, roll_no, grind_time, team, dia_before, dia_after,
grind_amount, roll_shape, flaw_result,
CASE WHEN hardness = '未倒角' THEN 0 ELSE CAST(hardness AS DECIMAL(10,1)) END AS hardness,
operator, remark, del_flag, create_by, create_time
FROM mes_roll_grind
WHERE del_flag = 0 AND roll_id = #{rollId}
ORDER BY grind_time ASC, grind_id ASC
</select>
<select id="selectMesRollGrindById" parameterType="Long" resultMap="MesRollGrindResult">
SELECT * FROM mes_roll_grind WHERE grind_id = #{grindId} AND del_flag = 0
</select>
<select id="selectMonthlyStats" resultType="map">
SELECT
DATE_FORMAT(grind_time, '%Y-%m') AS month,
COUNT(*) AS grindCount,
IFNULL(SUM(grind_amount), 0) AS totalGrindAmount
FROM mes_roll_grind
WHERE del_flag = 0
AND roll_id = #{rollId}
AND YEAR(grind_time) = #{year}
GROUP BY DATE_FORMAT(grind_time, '%Y-%m')
ORDER BY month ASC
</select>
<insert id="insertMesRollGrind" parameterType="com.ruoyi.mill.domain.MesRollGrind" useGeneratedKeys="true" keyProperty="grindId">
insert into mes_roll_grind
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="lineId != null">line_id,</if>
<if test="rollId != null">roll_id,</if>
<if test="rollNo != null">roll_no,</if>
<if test="grindTime != null">grind_time,</if>
<if test="team != null">team,</if>
<if test="diaBefore != null">dia_before,</if>
<if test="diaAfter != null">dia_after,</if>
<if test="grindAmount != null">grind_amount,</if>
<if test="rollShape != null">roll_shape,</if>
<if test="flawResult != null">flaw_result,</if>
<if test="hardness != null">hardness,</if>
<if test="operator != null">operator,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
del_flag,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="lineId != null">#{lineId},</if>
<if test="rollId != null">#{rollId},</if>
<if test="rollNo != null">#{rollNo},</if>
<if test="grindTime != null">#{grindTime},</if>
<if test="team != null">#{team},</if>
<if test="diaBefore != null">#{diaBefore},</if>
<if test="diaAfter != null">#{diaAfter},</if>
<if test="grindAmount != null">#{grindAmount},</if>
<if test="rollShape != null">#{rollShape},</if>
<if test="flawResult != null">#{flawResult},</if>
<if test="hardness != null">#{hardness},</if>
<if test="operator != null">#{operator},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
0,
</trim>
</insert>
<update id="updateMesRollGrind" parameterType="com.ruoyi.mill.domain.MesRollGrind">
update mes_roll_grind
<trim prefix="SET" suffixOverrides=",">
<if test="grindTime != null">grind_time = #{grindTime},</if>
<if test="team != null">team = #{team},</if>
<if test="diaBefore != null">dia_before = #{diaBefore},</if>
<if test="diaAfter != null">dia_after = #{diaAfter},</if>
<if test="grindAmount != null">grind_amount = #{grindAmount},</if>
<if test="rollShape != null">roll_shape = #{rollShape},</if>
<if test="flawResult != null">flaw_result = #{flawResult},</if>
<if test="hardness != null">hardness = #{hardness},</if>
<if test="operator != null">operator = #{operator},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where grind_id = #{grindId}
</update>
<delete id="deleteMesRollGrindById" parameterType="Long">
update mes_roll_grind set del_flag = 1 where grind_id = #{grindId}
</delete>
</mapper>

View File

@@ -0,0 +1,174 @@
<?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.MesRollInfoMapper">
<resultMap type="com.ruoyi.mill.domain.MesRollInfo" id="MesRollInfoResult">
<id property="rollId" column="roll_id" />
<result property="lineId" column="line_id" />
<result property="rollNo" column="roll_no" />
<result property="rollType" column="roll_type" />
<result property="status" column="status" />
<result property="initialDia" column="initial_dia" />
<result property="currentDia" column="current_dia" />
<result property="minDia" column="min_dia" />
<result property="roughness" column="roughness" />
<result property="crown" column="crown" />
<result property="material" column="material" />
<result property="grindCount" column="grind_count" />
<result property="totalRolledWeight" column="total_rolled_weight" />
<result property="totalRolledLength" column="total_rolled_length" />
<result property="totalRolledCount" column="total_rolled_count" />
<result property="manufactureDate" column="manufacture_date" />
<result property="manufacturer" column="manufacturer" />
<result property="delFlag" column="del_flag" />
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<select id="selectMesRollInfoList" parameterType="com.ruoyi.mill.domain.MesRollInfo" resultMap="MesRollInfoResult">
select roll_id, line_id, roll_no, roll_type, status, initial_dia, current_dia, min_dia,
roughness, crown, material, grind_count, total_rolled_weight, total_rolled_length,
total_rolled_count, manufacture_date, manufacturer, remark, del_flag,
create_by, create_time, update_by, update_time
from mes_roll_info
<where>
and del_flag = 0
<if test="lineId != null"> and line_id = #{lineId}</if>
<if test="rollNo != null and rollNo != ''"> and roll_no like concat('%', #{rollNo}, '%')</if>
<if test="rollType != null and rollType != ''"> and roll_type = #{rollType}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="manufacturer != null and manufacturer != ''"> and manufacturer like concat('%', #{manufacturer}, '%')</if>
</where>
order by roll_type asc, roll_id asc
</select>
<select id="selectMesRollInfoById" parameterType="Long" resultMap="MesRollInfoResult">
select roll_id, line_id, roll_no, roll_type, status, initial_dia, current_dia, min_dia,
roughness, crown, material, grind_count, total_rolled_weight, total_rolled_length,
total_rolled_count, manufacture_date, manufacturer, remark, del_flag,
create_by, create_time, update_by, update_time
from mes_roll_info
where del_flag = 0 and roll_id = #{rollId}
</select>
<select id="selectMesRollInfoByRollNo" resultMap="MesRollInfoResult">
select * from mes_roll_info where del_flag = 0 and roll_no = #{rollNo} limit 1
</select>
<select id="selectStatusStats" resultType="map">
SELECT status, COUNT(*) AS cnt
FROM mes_roll_info
WHERE del_flag = 0
<if test="lineId != null">AND line_id = #{lineId}</if>
GROUP BY status
</select>
<select id="selectRollNoList" resultType="string">
SELECT roll_no FROM mes_roll_info
WHERE del_flag = 0 AND status != 'Scrapped'
<if test="lineId != null">AND line_id = #{lineId}</if>
<if test="rollType != null and rollType != ''">AND roll_type = #{rollType}</if>
<if test="status != null and status != ''">AND status = #{status}</if>
ORDER BY roll_no ASC
</select>
<insert id="insertMesRollInfo" parameterType="com.ruoyi.mill.domain.MesRollInfo" useGeneratedKeys="true" keyProperty="rollId">
insert into mes_roll_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="lineId != null">line_id,</if>
<if test="rollNo != null">roll_no,</if>
<if test="rollType != null">roll_type,</if>
<if test="status != null">status,</if>
<if test="initialDia != null">initial_dia,</if>
<if test="currentDia != null">current_dia,</if>
<if test="minDia != null">min_dia,</if>
<if test="roughness != null">roughness,</if>
<if test="crown != null">crown,</if>
<if test="material != null">material,</if>
<if test="grindCount != null">grind_count,</if>
<if test="manufactureDate != null">manufacture_date,</if>
<if test="manufacturer != null">manufacturer,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
del_flag,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="lineId != null">#{lineId},</if>
<if test="rollNo != null">#{rollNo},</if>
<if test="rollType != null">#{rollType},</if>
<if test="status != null">#{status},</if>
<if test="initialDia != null">#{initialDia},</if>
<if test="currentDia != null">#{currentDia},</if>
<if test="minDia != null">#{minDia},</if>
<if test="roughness != null">#{roughness},</if>
<if test="crown != null">#{crown},</if>
<if test="material != null">#{material},</if>
<if test="grindCount != null">#{grindCount},</if>
<if test="manufactureDate != null">#{manufactureDate},</if>
<if test="manufacturer != null">#{manufacturer},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
0,
</trim>
</insert>
<update id="updateMesRollInfo" parameterType="com.ruoyi.mill.domain.MesRollInfo">
update mes_roll_info
<trim prefix="SET" suffixOverrides=",">
<if test="rollNo != null">roll_no = #{rollNo},</if>
<if test="rollType != null">roll_type = #{rollType},</if>
<if test="status != null">status = #{status},</if>
<if test="initialDia != null">initial_dia = #{initialDia},</if>
<if test="currentDia != null">current_dia = #{currentDia},</if>
<if test="minDia != null">min_dia = #{minDia},</if>
<if test="roughness != null">roughness = #{roughness},</if>
<if test="crown != null">crown = #{crown},</if>
<if test="material != null">material = #{material},</if>
<if test="grindCount != null">grind_count = #{grindCount},</if>
<if test="totalRolledWeight != null">total_rolled_weight = #{totalRolledWeight},</if>
<if test="totalRolledLength != null">total_rolled_length = #{totalRolledLength},</if>
<if test="totalRolledCount != null">total_rolled_count = #{totalRolledCount},</if>
<if test="manufactureDate != null">manufacture_date = #{manufactureDate},</if>
<if test="manufacturer != null">manufacturer = #{manufacturer},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where roll_id = #{rollId}
</update>
<delete id="deleteMesRollInfoById" parameterType="Long">
update mes_roll_info set del_flag = 1 where roll_id = #{rollId}
</delete>
<delete id="deleteMesRollInfoByIds" parameterType="Long">
update mes_roll_info set del_flag = 1 where roll_id in
<foreach item="rollId" collection="array" open="(" separator="," close=")">
#{rollId}
</foreach>
</delete>
<update id="updateStatusByRollNo">
UPDATE mes_roll_info SET status = #{status}, update_time = NOW()
WHERE del_flag = 0 AND roll_no = #{rollNo}
</update>
<update id="incrementGrindCount">
UPDATE mes_roll_info
SET grind_count = grind_count + 1,
<if test="diaAfter != null">current_dia = #{diaAfter},</if>
update_time = NOW()
WHERE del_flag = 0 AND roll_id = #{rollId}
</update>
<update id="updateCurrentDia">
UPDATE mes_roll_info SET current_dia = #{currentDia}, update_time = NOW()
WHERE del_flag = 0 AND roll_id = #{rollId}
</update>
</mapper>

View File

@@ -0,0 +1,121 @@
<?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.QcInspectionItemMapper">
<resultMap type="com.ruoyi.mill.domain.QcInspectionItem" id="QcInspectionItemResult">
<id property="itemId" column="item_id" />
<result property="taskId" column="task_id" />
<result property="itemName" column="item_name" />
<result property="standardValue" column="standard_value" />
<result property="upperLimit" column="upper_limit" />
<result property="lowerLimit" column="lower_limit" />
<result property="unit" column="unit" />
<result property="itemType" column="item_type" />
<result property="inspectValue" column="inspect_value" />
<result property="isQualified" column="is_qualified" />
<result property="judgeResult" column="judge_result" />
<result property="inspectUser" column="inspect_user" />
<result property="inspectTime" column="inspect_time" />
<result property="remark" column="remark" />
<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" />
</resultMap>
<select id="selectQcInspectionItemList" parameterType="com.ruoyi.mill.domain.QcInspectionItem" resultMap="QcInspectionItemResult">
SELECT item_id, task_id, item_name, standard_value, upper_limit, lower_limit, unit,
item_type, inspect_value, is_qualified, judge_result, inspect_user, inspect_time,
remark, del_flag, create_by, create_time
FROM qc_inspection_item
<where>
AND del_flag = 0
<if test="taskId != null"> AND task_id = #{taskId}</if>
<if test="itemName != null and itemName != ''"> AND item_name LIKE concat('%', #{itemName}, '%')</if>
</where>
ORDER BY item_id ASC
</select>
<select id="selectQcInspectionItemByTaskId" resultMap="QcInspectionItemResult">
SELECT item_id, task_id, item_name, standard_value, upper_limit, lower_limit, unit,
item_type, inspect_value, is_qualified, judge_result, inspect_user, inspect_time, remark
FROM qc_inspection_item
WHERE del_flag = 0 AND task_id = #{taskId}
ORDER BY item_id ASC
</select>
<select id="selectQcInspectionItemById" parameterType="Long" resultMap="QcInspectionItemResult">
SELECT * FROM qc_inspection_item WHERE item_id = #{itemId} AND del_flag = 0
</select>
<insert id="insertQcInspectionItem" parameterType="com.ruoyi.mill.domain.QcInspectionItem" useGeneratedKeys="true" keyProperty="itemId">
INSERT INTO qc_inspection_item
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskId != null">task_id,</if>
<if test="itemName != null">item_name,</if>
<if test="standardValue != null">standard_value,</if>
<if test="upperLimit != null">upper_limit,</if>
<if test="lowerLimit != null">lower_limit,</if>
<if test="unit != null">unit,</if>
<if test="itemType != null">item_type,</if>
<if test="inspectValue != null">inspect_value,</if>
<if test="isQualified != null">is_qualified,</if>
<if test="judgeResult != null">judge_result,</if>
<if test="inspectUser != null">inspect_user,</if>
<if test="inspectTime != null">inspect_time,</if>
<if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
del_flag,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskId != null">#{taskId},</if>
<if test="itemName != null">#{itemName},</if>
<if test="standardValue != null">#{standardValue},</if>
<if test="upperLimit != null">#{upperLimit},</if>
<if test="lowerLimit != null">#{lowerLimit},</if>
<if test="unit != null">#{unit},</if>
<if test="itemType != null">#{itemType},</if>
<if test="inspectValue != null">#{inspectValue},</if>
<if test="isQualified != null">#{isQualified},</if>
<if test="judgeResult != null">#{judgeResult},</if>
<if test="inspectUser != null">#{inspectUser},</if>
<if test="inspectTime != null">#{inspectTime},</if>
<if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
0,
</trim>
</insert>
<update id="updateQcInspectionItem" parameterType="com.ruoyi.mill.domain.QcInspectionItem">
UPDATE qc_inspection_item
<trim prefix="SET" suffixOverrides=",">
<if test="itemName != null">item_name = #{itemName},</if>
<if test="standardValue != null">standard_value = #{standardValue},</if>
<if test="upperLimit != null">upper_limit = #{upperLimit},</if>
<if test="lowerLimit != null">lower_limit = #{lowerLimit},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="itemType != null">item_type = #{itemType},</if>
<if test="inspectValue != null">inspect_value = #{inspectValue},</if>
<if test="isQualified != null">is_qualified = #{isQualified},</if>
<if test="judgeResult != null">judge_result = #{judgeResult},</if>
<if test="inspectUser != null">inspect_user = #{inspectUser},</if>
<if test="inspectTime != null">inspect_time = #{inspectTime},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
WHERE item_id = #{itemId}
</update>
<delete id="deleteQcInspectionItemById">
UPDATE qc_inspection_item SET del_flag = 1 WHERE item_id = #{itemId}
</delete>
<delete id="deleteQcInspectionItemByTaskId">
UPDATE qc_inspection_item SET del_flag = 1 WHERE task_id = #{taskId}
</delete>
</mapper>

View File

@@ -0,0 +1,182 @@
<?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.QcInspectionTaskMapper">
<resultMap type="com.ruoyi.mill.domain.QcInspectionTask" id="QcInspectionTaskResult">
<id property="taskId" column="task_id" />
<result property="taskCode" column="task_code" />
<result property="taskType" column="task_type" />
<result property="belongCompany" column="belong_company" />
<result property="sourceType" column="source_type" />
<result property="sourceId" column="source_id" />
<result property="schemeId" column="scheme_id" />
<result property="schemeName" column="scheme_name" />
<result property="status" column="status" />
<result property="inspectUser" column="inspect_user" />
<result property="inspectTime" column="inspect_time" />
<result property="auditUser" column="audit_user" />
<result property="auditTime" column="audit_time" />
<result property="result" column="result" />
<result property="remark" column="remark" />
<result property="coilIds" column="coil_ids" />
<result property="enterCoilNos" column="enter_coil_nos" />
<result property="attachmentFiles" column="attachment_files" />
<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" />
</resultMap>
<sql id="selectTaskVo">
SELECT task_id, task_code, task_type, belong_company, source_type, source_id,
scheme_id, scheme_name, status, inspect_user, inspect_time, audit_user, audit_time,
result, remark, coil_ids, enter_coil_nos, attachment_files, del_flag,
create_by, create_time, update_by, update_time
FROM qc_inspection_task
</sql>
<select id="selectQcInspectionTaskList" parameterType="com.ruoyi.mill.domain.QcInspectionTask" resultMap="QcInspectionTaskResult">
<include refid="selectTaskVo"/>
<where>
AND del_flag = 0
<if test="taskCode != null and taskCode != ''"> AND task_code LIKE concat('%', #{taskCode}, '%')</if>
<if test="taskType != null and taskType != ''"> AND task_type = #{taskType}</if>
<if test="belongCompany != null and belongCompany != ''"> AND belong_company = #{belongCompany}</if>
<if test="schemeName != null and schemeName != ''"> AND scheme_name = #{schemeName}</if>
<if test="status != null"> AND status = #{status}</if>
<if test="inspectUser != null and inspectUser != ''"> AND inspect_user LIKE concat('%', #{inspectUser}, '%')</if>
<if test="result != null and result != ''"> AND result = #{result}</if>
<if test="coilId != null"> AND FIND_IN_SET(#{coilId}, coil_ids)</if>
<if test="beginTime != null and beginTime != ''"> AND create_time &gt;= #{beginTime}</if>
<if test="endTime != null and endTime != ''"> AND create_time &lt;= concat(#{endTime}, ' 23:59:59')</if>
</where>
ORDER BY create_time DESC
</select>
<select id="selectQcInspectionTaskListByCoilIds" resultMap="QcInspectionTaskResult">
<include refid="selectTaskVo"/>
<where>
AND del_flag = 0
<if test="task.taskCode != null and task.taskCode != ''"> AND task_code LIKE concat('%', #{task.taskCode}, '%')</if>
<if test="task.taskType != null and task.taskType != ''"> AND task_type = #{task.taskType}</if>
<if test="task.status != null"> AND status = #{task.status}</if>
<if test="task.inspectUser != null and task.inspectUser != ''"> AND inspect_user LIKE concat('%', #{task.inspectUser}, '%')</if>
<if test="task.result != null and task.result != ''"> AND result = #{task.result}</if>
<if test="task.coilId != null"> AND FIND_IN_SET(#{task.coilId}, coil_ids)</if>
<if test="task.beginTime != null and task.beginTime != ''"> AND create_time &gt;= #{task.beginTime}</if>
<if test="task.endTime != null and task.endTime != ''"> AND create_time &lt;= concat(#{task.endTime}, ' 23:59:59')</if>
<if test="coilIds != null and coilIds.size() > 0">
AND (
<foreach item="cid" collection="coilIds" separator=" OR ">
FIND_IN_SET(#{cid}, coil_ids)
</foreach>
)
</if>
</where>
ORDER BY create_time DESC
</select>
<select id="selectQcInspectionTaskById" parameterType="Long" resultMap="QcInspectionTaskResult">
<include refid="selectTaskVo"/>
WHERE task_id = #{taskId} AND del_flag = 0
</select>
<!-- 获取双机架 processed_coil_ids -->
<select id="selectDoubleRackProcessedCoilIds" resultType="string">
SELECT processed_coil_ids
FROM wms_coil_pending_action
WHERE del_flag = 0
AND processed_coil_ids IS NOT NULL
AND processed_coil_ids != ''
AND action_type IN
<foreach item="t" collection="actionTypes" open="(" separator="," close=")">
#{t}
</foreach>
</select>
<!-- 按 coilId 列表获取钢卷信息coilId + 卷号) -->
<select id="selectCoilInfoByIds" resultType="map">
SELECT coil_id AS coilId, current_coil_no AS coilNo, enter_coil_no AS enterCoilNo
FROM wms_material_coil
WHERE del_flag = 0
AND coil_id IN
<foreach item="id" collection="coilIds" open="(" separator="," close=")">
#{id}
</foreach>
ORDER BY create_time DESC
</select>
<insert id="insertQcInspectionTask" parameterType="com.ruoyi.mill.domain.QcInspectionTask" useGeneratedKeys="true" keyProperty="taskId">
INSERT INTO qc_inspection_task
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="taskCode != null">task_code,</if>
<if test="taskType != null">task_type,</if>
<if test="belongCompany != null">belong_company,</if>
<if test="sourceType != null">source_type,</if>
<if test="schemeId != null">scheme_id,</if>
<if test="schemeName != null">scheme_name,</if>
<if test="status != null">status,</if>
<if test="inspectUser != null">inspect_user,</if>
<if test="inspectTime != null">inspect_time,</if>
<if test="result != null">result,</if>
<if test="remark != null">remark,</if>
<if test="coilIds != null">coil_ids,</if>
<if test="enterCoilNos != null">enter_coil_nos,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
del_flag,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskCode != null">#{taskCode},</if>
<if test="taskType != null">#{taskType},</if>
<if test="belongCompany != null">#{belongCompany},</if>
<if test="sourceType != null">#{sourceType},</if>
<if test="schemeId != null">#{schemeId},</if>
<if test="schemeName != null">#{schemeName},</if>
<if test="status != null">#{status},</if>
<if test="inspectUser != null">#{inspectUser},</if>
<if test="inspectTime != null">#{inspectTime},</if>
<if test="result != null">#{result},</if>
<if test="remark != null">#{remark},</if>
<if test="coilIds != null">#{coilIds},</if>
<if test="enterCoilNos != null">#{enterCoilNos},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
0,
</trim>
</insert>
<update id="updateQcInspectionTask" parameterType="com.ruoyi.mill.domain.QcInspectionTask">
UPDATE qc_inspection_task
<trim prefix="SET" suffixOverrides=",">
<if test="taskType != null">task_type = #{taskType},</if>
<if test="belongCompany != null">belong_company = #{belongCompany},</if>
<if test="schemeName != null">scheme_name = #{schemeName},</if>
<if test="status != null">status = #{status},</if>
<if test="inspectUser != null">inspect_user = #{inspectUser},</if>
<if test="inspectTime != null">inspect_time = #{inspectTime},</if>
<if test="auditUser != null">audit_user = #{auditUser},</if>
<if test="auditTime != null">audit_time = #{auditTime},</if>
<if test="result != null">result = #{result},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="coilIds != null">coil_ids = #{coilIds},</if>
<if test="enterCoilNos != null">enter_coil_nos = #{enterCoilNos},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
WHERE task_id = #{taskId}
</update>
<delete id="deleteQcInspectionTaskById">
UPDATE qc_inspection_task SET del_flag = 1 WHERE task_id = #{taskId}
</delete>
<delete id="deleteQcInspectionTaskByIds">
UPDATE qc_inspection_task SET del_flag = 1 WHERE task_id IN
<foreach item="taskId" collection="array" open="(" separator="," close=")">
#{taskId}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,168 @@
<?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.WmsCoilAbnormalMapper">
<resultMap type="com.ruoyi.mill.domain.WmsCoilAbnormal" id="WmsCoilAbnormalResult">
<id property="abnormalId" column="abnormal_id" />
<result property="coilId" column="coil_id" />
<result property="productionLine" column="production_line" />
<result property="position" column="position" />
<result property="plateSurface" column="plate_surface" />
<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="attachmentFiles" column="attachment_files" />
<result property="remark" column="remark" />
<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="coilNo" column="current_coil_no" />
</resultMap>
<sql id="selectAbnormalVo">
SELECT a.abnormal_id, a.coil_id, a.production_line, a.position, a.plate_surface,
a.length, a.start_position, a.end_position, a.defect_code, a.defect_type,
a.defect_rate, a.defect_weight, a.degree, a.judge_level, a.judge_by, a.judge_time,
a.main_mark, a.whole_coil_mark, a.attachment_files, a.remark, a.del_flag,
a.create_by, a.create_time, a.update_by, a.update_time,
mc.current_coil_no
FROM wms_coil_abnormal a
LEFT JOIN wms_material_coil mc ON a.coil_id = mc.coil_id AND mc.del_flag = 0
</sql>
<select id="selectWmsCoilAbnormalList" parameterType="com.ruoyi.mill.domain.WmsCoilAbnormal" resultMap="WmsCoilAbnormalResult">
<include refid="selectAbnormalVo"/>
<where>
AND a.del_flag = 0
<if test="coilId != null"> AND a.coil_id = #{coilId}</if>
<if test="coilNo != null and coilNo != ''"> AND mc.current_coil_no LIKE concat('%', #{coilNo}, '%')</if>
<if test="productionLine != null and productionLine != ''"> AND a.production_line LIKE concat('%', #{productionLine}, '%')</if>
<if test="defectType != null and defectType != ''"> AND a.defect_type LIKE concat('%', #{defectType}, '%')</if>
<if test="degree != null and degree != ''"> AND a.degree = #{degree}</if>
<if test="judgeLevel != null and judgeLevel != ''"> AND a.judge_level = #{judgeLevel}</if>
<if test="beginTime != null and beginTime != ''"> AND a.judge_time &gt;= #{beginTime}</if>
<if test="endTime != null and endTime != ''"> AND a.judge_time &lt;= concat(#{endTime}, ' 23:59:59')</if>
</where>
ORDER BY a.create_time DESC
</select>
<select id="selectWmsCoilAbnormalListByCoilIds" resultMap="WmsCoilAbnormalResult">
<include refid="selectAbnormalVo"/>
<where>
AND a.del_flag = 0
<if test="abnormal.coilId != null"> AND a.coil_id = #{abnormal.coilId}</if>
<if test="abnormal.coilNo != null and abnormal.coilNo != ''"> AND mc.current_coil_no LIKE concat('%', #{abnormal.coilNo}, '%')</if>
<if test="abnormal.productionLine != null and abnormal.productionLine != ''"> AND a.production_line LIKE concat('%', #{abnormal.productionLine}, '%')</if>
<if test="abnormal.defectType != null and abnormal.defectType != ''"> AND a.defect_type LIKE concat('%', #{abnormal.defectType}, '%')</if>
<if test="abnormal.degree != null and abnormal.degree != ''"> AND a.degree = #{abnormal.degree}</if>
<if test="abnormal.beginTime != null and abnormal.beginTime != ''"> AND a.judge_time &gt;= #{abnormal.beginTime}</if>
<if test="abnormal.endTime != null and abnormal.endTime != ''"> AND a.judge_time &lt;= concat(#{abnormal.endTime}, ' 23:59:59')</if>
<if test="coilIds != null and coilIds.size() > 0">
AND a.coil_id IN
<foreach item="cid" collection="coilIds" open="(" separator="," close=")">
#{cid}
</foreach>
</if>
</where>
ORDER BY a.create_time DESC
</select>
<select id="selectWmsCoilAbnormalById" parameterType="Long" resultMap="WmsCoilAbnormalResult">
<include refid="selectAbnormalVo"/>
WHERE a.abnormal_id = #{abnormalId} AND a.del_flag = 0
</select>
<insert id="insertWmsCoilAbnormal" parameterType="com.ruoyi.mill.domain.WmsCoilAbnormal" useGeneratedKeys="true" keyProperty="abnormalId">
INSERT INTO wms_coil_abnormal
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="coilId != null">coil_id,</if>
<if test="productionLine != null">production_line,</if>
<if test="position != null">position,</if>
<if test="plateSurface != null">plate_surface,</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="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
del_flag,
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="coilId != null">#{coilId},</if>
<if test="productionLine != null">#{productionLine},</if>
<if test="position != null">#{position},</if>
<if test="plateSurface != null">#{plateSurface},</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="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
0,
</trim>
</insert>
<update id="updateWmsCoilAbnormal" parameterType="com.ruoyi.mill.domain.WmsCoilAbnormal">
UPDATE wms_coil_abnormal
<trim prefix="SET" suffixOverrides=",">
<if test="productionLine != null">production_line = #{productionLine},</if>
<if test="position != null">position = #{position},</if>
<if test="plateSurface != null">plate_surface = #{plateSurface},</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="remark != null">remark = #{remark},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
WHERE abnormal_id = #{abnormalId}
</update>
<delete id="deleteWmsCoilAbnormalById">
UPDATE wms_coil_abnormal SET del_flag = 1 WHERE abnormal_id = #{abnormalId}
</delete>
<delete id="deleteWmsCoilAbnormalByIds">
UPDATE wms_coil_abnormal SET del_flag = 1 WHERE abnormal_id IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,21 @@
import request from '@/utils/request'
export function listEquipmentChecklist(query) {
return request({ url: '/mill/eqp/checklist/list', method: 'get', params: query })
}
export function getEquipmentChecklist(checkId) {
return request({ url: '/mill/eqp/checklist/' + checkId, method: 'get' })
}
export function addEquipmentChecklist(data) {
return request({ url: '/mill/eqp/checklist', method: 'post', data: data })
}
export function updateEquipmentChecklist(data) {
return request({ url: '/mill/eqp/checklist', method: 'put', data: data })
}
export function delEquipmentChecklist(checkId) {
return request({ url: '/mill/eqp/checklist/' + checkId, method: 'delete' })
}

View File

@@ -0,0 +1,21 @@
import request from '@/utils/request'
export function listEquipmentInspectionRecord(query) {
return request({ url: '/mill/eqp/record/list', method: 'get', params: query })
}
export function getEquipmentInspectionRecord(recordId) {
return request({ url: '/mill/eqp/record/' + recordId, method: 'get' })
}
export function addEquipmentInspectionRecord(data) {
return request({ url: '/mill/eqp/record', method: 'post', data: data })
}
export function updateEquipmentInspectionRecord(data) {
return request({ url: '/mill/eqp/record', method: 'put', data: data })
}
export function delEquipmentInspectionRecord(recordId) {
return request({ url: '/mill/eqp/record/' + recordId, method: 'delete' })
}

View File

@@ -0,0 +1,21 @@
import request from '@/utils/request'
export function listEquipmentPart(query) {
return request({ url: '/mill/eqp/part/list', method: 'get', params: query })
}
export function getEquipmentPart(partId) {
return request({ url: '/mill/eqp/part/' + partId, method: 'get' })
}
export function addEquipmentPart(data) {
return request({ url: '/mill/eqp/part', method: 'post', data: data })
}
export function updateEquipmentPart(data) {
return request({ url: '/mill/eqp/part', method: 'put', data: data })
}
export function delEquipmentPart(partId) {
return request({ url: '/mill/eqp/part/' + partId, method: 'delete' })
}

View File

@@ -0,0 +1,57 @@
import request from '@/utils/request'
// ---- 检验任务 ----
export function listQcTask(query) {
return request({ url: '/mill/qc/task/list', method: 'get', params: query })
}
export function getQcTask(taskId) {
return request({ url: `/mill/qc/task/${taskId}`, method: 'get' })
}
export function addQcTask(data) {
return request({ url: '/mill/qc/task', method: 'post', data })
}
export function updateQcTask(data) {
return request({ url: '/mill/qc/task', method: 'put', data })
}
export function delQcTask(taskIds) {
return request({ url: `/mill/qc/task/${taskIds}`, method: 'delete' })
}
// 双机架钢卷列表(供下拉选择)
export function listDoubleRackCoils() {
return request({ url: '/mill/qc/task/coils', method: 'get' })
}
// ---- 检验项目 ----
export function listQcItemByTask(taskId) {
return request({ url: `/mill/qc/item/byTask/${taskId}`, method: 'get' })
}
export function updateQcItem(data) {
return request({ url: '/mill/qc/item', method: 'put', data })
}
// ---- 质量异常 ----
export function listQcAbnormal(query) {
return request({ url: '/mill/qc/abnormal/list', method: 'get', params: query })
}
export function getQcAbnormal(abnormalId) {
return request({ url: `/mill/qc/abnormal/${abnormalId}`, method: 'get' })
}
export function addQcAbnormal(data) {
return request({ url: '/mill/qc/abnormal', method: 'post', data })
}
export function updateQcAbnormal(data) {
return request({ url: '/mill/qc/abnormal', method: 'put', data })
}
export function delQcAbnormal(abnormalIds) {
return request({ url: `/mill/qc/abnormal/${abnormalIds}`, method: 'delete' })
}

View File

@@ -0,0 +1,21 @@
import request from '@/utils/request'
export function listRollGrind(rollId) {
return request({ url: '/mill/roll/grind/list', method: 'get', params: { rollId } })
}
export function getMonthlyStats(rollId, year) {
return request({ url: '/mill/roll/grind/monthlyStats', method: 'get', params: { rollId, year } })
}
export function addRollGrind(data) {
return request({ url: '/mill/roll/grind', method: 'post', data })
}
export function updateRollGrind(data) {
return request({ url: '/mill/roll/grind', method: 'put', data })
}
export function delRollGrind(grindId) {
return request({ url: '/mill/roll/grind/' + grindId, method: 'delete' })
}

View File

@@ -0,0 +1,33 @@
import request from '@/utils/request'
export function listRollInfo(query) {
return request({ url: '/mill/roll/info/list', method: 'get', params: query })
}
export function getRollStats() {
return request({ url: '/mill/roll/info/stats', method: 'get' })
}
export function listRollOptions(rollType, status) {
return request({ url: '/mill/roll/info/options', method: 'get', params: { rollType, status } })
}
export function getRollInfo(rollId) {
return request({ url: '/mill/roll/info/' + rollId, method: 'get' })
}
export function addRollInfo(data) {
return request({ url: '/mill/roll/info', method: 'post', data })
}
export function updateRollInfo(data) {
return request({ url: '/mill/roll/info', method: 'put', data })
}
export function delRollInfo(rollIds) {
return request({ url: '/mill/roll/info/' + rollIds, method: 'delete' })
}
export function scrapRollInfo(rollId) {
return request({ url: '/mill/roll/info/' + rollId + '/scrap', method: 'put' })
}

View File

@@ -0,0 +1,160 @@
<template>
<div class="app-container" v-loading="loading">
<el-form size="small" :inline="true" style="margin-bottom: 10px;">
<el-form-item label="日期">
<el-date-picker v-model="queryDate" type="date" value-format="yyyy-MM-dd"
placeholder="选择日期" @change="handleQuery" style="width: 160px;" />
</el-form-item>
<el-form-item label="产线段">
<el-input v-model="lineSection" placeholder="请输入产线段" clearable style="width: 130px;" @change="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="handleQuery">查询</el-button>
</el-form-item>
</el-form>
<el-descriptions title="巡检日报" :column="6" border style="margin-bottom: 16px;">
<el-descriptions-item label="巡检部位数">{{ summary.partCount }}</el-descriptions-item>
<el-descriptions-item label="巡检项数">{{ summary.checklistCount }}</el-descriptions-item>
<el-descriptions-item label="总巡检次数">{{ summary.totalCount }}</el-descriptions-item>
<el-descriptions-item label="通过">
<el-tag type="success" size="small">{{ summary.passCount }}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="故障">
<el-tag type="danger" size="small">{{ summary.failCount }}</el-tag>
</el-descriptions-item>
<el-descriptions-item label="通过率">{{ summary.passRate }}</el-descriptions-item>
</el-descriptions>
<el-table :data="tableData" border stripe style="width: 100%;" :cell-style="cellStyle">
<el-table-column label="巡检部位" prop="inspectPart" align="center" width="130" />
<el-table-column label="巡检内容" prop="checkContent" align="center" min-width="200" show-overflow-tooltip />
<el-table-column label="检验标准" prop="checkStandard" align="center" min-width="160" show-overflow-tooltip />
<el-table-column label="白班" align="center" width="160">
<template slot-scope="scope">
<div v-if="scope.row.dayRecords && scope.row.dayRecords.length" style="display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;">
<el-tooltip v-for="(r, idx) in scope.row.dayRecords" :key="idx" placement="top">
<div slot="content">
{{ r.inspectTime }} | 白班 | {{ r.inspector }}<br/>
{{ r.runStatus === 1 ? '✓ 正常' : '✗ 故障' }}
<span v-if="r.abnormalDesc"> {{ r.abnormalDesc }}</span>
</div>
<span :class="r.runStatus === 1 ? 'result-pass' : 'result-fail'" class="result-icon">
{{ r.runStatus === 1 ? '✓' : '✗' }}
</span>
</el-tooltip>
</div>
<span v-else class="result-none"></span>
</template>
</el-table-column>
<el-table-column label="夜班" align="center" width="160">
<template slot-scope="scope">
<div v-if="scope.row.nightRecords && scope.row.nightRecords.length" style="display: flex; flex-wrap: wrap; gap: 4px; justify-content: center;">
<el-tooltip v-for="(r, idx) in scope.row.nightRecords" :key="idx" placement="top">
<div slot="content">
{{ r.inspectTime }} | 夜班 | {{ r.inspector }}<br/>
{{ r.runStatus === 1 ? '✓ 正常' : '✗ 故障' }}
<span v-if="r.abnormalDesc"> {{ r.abnormalDesc }}</span>
</div>
<span :class="r.runStatus === 1 ? 'result-pass' : 'result-fail'" class="result-icon">
{{ r.runStatus === 1 ? '✓' : '✗' }}
</span>
</el-tooltip>
</div>
<span v-else class="result-none"></span>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
import { listEquipmentPart } from '@/api/mill/equipmentPart'
import { listEquipmentChecklist } from '@/api/mill/equipmentChecklist'
import { listEquipmentInspectionRecord } from '@/api/mill/equipmentInspectionRecord'
export default {
name: 'EqpDay',
data() {
const today = new Date()
const pad = n => String(n).padStart(2, '0')
return {
loading: false,
queryDate: `${today.getFullYear()}-${pad(today.getMonth() + 1)}-${pad(today.getDate())}`,
lineSection: undefined,
partList: [],
checklistList: [],
records: []
}
},
computed: {
tableData() {
const recordMap = {}
this.records.forEach(r => {
const key = `${r.checkId}_${r.shift}`
if (!recordMap[key]) recordMap[key] = []
recordMap[key].push(r)
})
return this.checklistList.map(cl => {
const part = this.partList.find(p => p.partId === cl.partId) || {}
return {
checkId: cl.checkId,
inspectPart: part.inspectPart || cl.partName,
checkContent: cl.checkContent,
checkStandard: cl.checkStandard,
dayRecords: recordMap[`${cl.checkId}_1`] || [],
nightRecords: recordMap[`${cl.checkId}_2`] || []
}
})
},
summary() {
const totalCount = this.records.length
const passCount = this.records.filter(r => r.runStatus === 1).length
const failCount = this.records.filter(r => r.runStatus === 2).length
return {
partCount: this.partList.length,
checklistCount: this.checklistList.length,
totalCount,
passCount,
failCount,
passRate: totalCount > 0 ? (passCount / totalCount * 100).toFixed(1) + '%' : '0%'
}
}
},
mounted() {
this.handleQuery()
},
methods: {
cellStyle({ columnIndex }) {
if (columnIndex === 3 || columnIndex === 4) return { fontSize: '20px', padding: '4px 8px' }
},
async handleQuery() {
if (!this.queryDate) return
this.loading = true
try {
const partParams = { pageNum: 1, pageSize: 9999 }
if (this.lineSection) partParams.lineSection = this.lineSection
const [partRes, checklistRes, recordRes] = await Promise.all([
listEquipmentPart(partParams),
listEquipmentChecklist(partParams),
listEquipmentInspectionRecord({ startInspectTime: this.queryDate, endInspectTime: this.queryDate, pageNum: 1, pageSize: 9999 })
])
this.partList = partRes.rows || []
this.checklistList = checklistRes.rows || []
this.records = recordRes.rows || []
} catch (e) {
console.error('查询失败', e)
} finally {
this.loading = false
}
}
}
}
</script>
<style scoped>
.result-icon { display: inline-block; font-size: 20px; font-weight: bold; line-height: 1; cursor: default; }
.result-pass { color: #67c23a; }
.result-fail { color: #f56c6c; }
.result-none { color: #c0c4cc; font-size: 16px; }
</style>

View File

@@ -0,0 +1,341 @@
<template>
<div class="app-container">
<el-row :gutter="16" style="height: calc(100vh - 135px);">
<!-- 左侧设备巡检部位列表 -->
<el-col :span="7" style="height: 100%;">
<el-card style="height: 100%; display: flex; flex-direction: column;" :body-style="{flex:1, overflow:'hidden', display:'flex', flexDirection:'column', padding:'10px'}">
<div slot="header" style="display:flex; align-items:center; justify-content:space-between;">
<span style="font-weight:bold;">设备列表</span>
</div>
<el-form size="small" :inline="true" style="flex-shrink:0; margin-bottom:6px;">
<el-form-item style="margin-bottom:0;">
<el-input v-model="partKeyword" placeholder="搜索设备名称" prefix-icon="el-icon-search"
clearable style="width:180px;" @input="filterParts" />
</el-form-item>
</el-form>
<div style="flex-shrink:0; margin-bottom:6px;">
<el-button type="primary" plain size="mini" icon="el-icon-plus" @click="handlePartAdd">新增</el-button>
<el-button type="success" plain size="mini" icon="el-icon-edit" :disabled="!currentPart" @click="handlePartUpdate(currentPart)">修改</el-button>
<el-button type="danger" plain size="mini" icon="el-icon-delete" :disabled="!currentPart" @click="handlePartDelete(currentPart)">删除</el-button>
</div>
<div v-loading="partLoading" style="flex:1; overflow-y:auto;">
<div v-if="filteredPartList.length === 0" style="color:#909399; text-align:center; padding:20px; font-size:13px;">暂无数据</div>
<div v-for="item in filteredPartList" :key="item.partId"
class="part-card" :class="{ 'part-card-active': currentPart && currentPart.partId === item.partId }"
@click="handleSelectPart(item)">
<div style="flex:1; min-width:0;">
<div class="part-name">{{ item.inspectPart }}</div>
<div class="part-meta">
<span v-if="item.lineSection">{{ item.lineSection }}</span>
<span v-if="item.lineSection && item.remark"> · </span>
<span v-if="item.remark">{{ item.remark }}</span>
</div>
</div>
<el-tag v-if="item.checklistCount > 0" size="mini" type="info" style="flex-shrink:0; margin-left:4px;">{{ item.checklistCount }}</el-tag>
</div>
</div>
</el-card>
</el-col>
<!-- 右侧该设备的巡检清单 -->
<el-col :span="17" style="height: 100%;">
<el-card style="height: 100%; display: flex; flex-direction: column;" :body-style="{flex:1, overflow:'hidden', display:'flex', flexDirection:'column', padding:'10px'}">
<div slot="header" style="display:flex; align-items:center; justify-content:space-between;">
<span style="font-weight:bold;">
巡检要求清单
<span v-if="currentPart" style="font-weight:normal; color:#606266; font-size:13px; margin-left:8px;">
{{ currentPart.inspectPart }}
</span>
<span v-else style="font-weight:normal; color:#c0c4cc; font-size:13px; margin-left:8px;">请从左侧选择设备</span>
</span>
<el-button v-if="currentPart" size="mini" type="primary" plain icon="el-icon-tickets"
@click="goToRecord(currentPart)">查看巡检记录</el-button>
</div>
<div style="flex-shrink:0; margin-bottom:6px;">
<el-button type="primary" plain size="mini" icon="el-icon-plus" :disabled="!currentPart" @click="handleChecklistAdd">新增</el-button>
<el-button type="success" plain size="mini" icon="el-icon-edit" :disabled="checklistIds.length !== 1" @click="handleChecklistUpdate()">修改</el-button>
<el-button type="danger" plain size="mini" icon="el-icon-delete" :disabled="checklistIds.length === 0" @click="handleChecklistDelete()">删除</el-button>
</div>
<div v-loading="checklistLoading" style="flex:1; overflow:hidden;">
<div v-if="!currentPart" style="display:flex; align-items:center; justify-content:center; height:100%; color:#c0c4cc;">
<div style="text-align:center;">
<i class="el-icon-d-arrow-left" style="font-size:40px;"></i>
<div style="margin-top:10px; font-size:14px;">点击左侧设备查看巡检要求</div>
</div>
</div>
<el-table v-else :data="checklistData" height="100%" @selection-change="handleChecklistSelectionChange">
<el-table-column type="selection" width="45" align="center" />
<el-table-column label="检验编号" prop="checkNo" width="100" />
<el-table-column label="部件名称" prop="partName" width="120" />
<el-table-column label="检验内容" prop="checkContent" show-overflow-tooltip min-width="180" />
<el-table-column label="设备状态" prop="equipmentState" width="80" align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.equipmentState === '运行' ? 'success' : 'warning'" size="mini">
{{ scope.row.equipmentState || '—' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="检验标准" prop="checkStandard" show-overflow-tooltip min-width="150" />
<el-table-column label="责任人" prop="responsiblePerson" width="90" align="center" />
<el-table-column label="操作" width="80" align="center" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click.stop="handleChecklistUpdate(scope.row)" />
<el-button size="mini" type="text" icon="el-icon-delete" @click.stop="handleChecklistDelete(scope.row)" />
</template>
</el-table-column>
</el-table>
</div>
</el-card>
</el-col>
</el-row>
<!-- 巡检部位对话框 -->
<el-dialog :title="partTitle" :visible.sync="partOpen" width="450px" append-to-body>
<el-form ref="partForm" :model="partForm" :rules="partRules" label-width="80px">
<el-form-item label="产线段" prop="lineSection">
<el-input v-model="partForm.lineSection" placeholder="请输入产线段" />
</el-form-item>
<el-form-item label="设备名称" prop="inspectPart">
<el-input v-model="partForm.inspectPart" placeholder="请输入设备/巡检部位名称" />
</el-form-item>
<el-form-item label="备注">
<el-input v-model="partForm.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer">
<el-button :loading="partButtonLoading" type="primary" @click="submitPartForm"> </el-button>
<el-button @click="partOpen = false"> </el-button>
</div>
</el-dialog>
<!-- 检验清单对话框 -->
<el-dialog :title="checklistTitle" :visible.sync="checklistOpen" width="520px" append-to-body>
<el-form ref="checklistForm" :model="checklistForm" :rules="checklistRules" label-width="90px">
<el-form-item label="检验编号">
<el-input v-model="checklistForm.checkNo" placeholder="请输入检验编号" />
</el-form-item>
<el-form-item label="部件名称">
<el-input v-model="checklistForm.partName" placeholder="请输入设备部件名称" />
</el-form-item>
<el-form-item label="检验内容">
<el-input v-model="checklistForm.checkContent" type="textarea" :rows="3" placeholder="请输入检验内容" />
</el-form-item>
<el-form-item label="设备状态">
<el-select v-model="checklistForm.equipmentState" placeholder="请选择" clearable style="width:100%;">
<el-option label="运行" value="运行" />
<el-option label="停止" value="停止" />
</el-select>
</el-form-item>
<el-form-item label="检验标准">
<el-input v-model="checklistForm.checkStandard" type="textarea" :rows="3" placeholder="请输入检验标准" />
</el-form-item>
<el-form-item label="责任人">
<el-input v-model="checklistForm.responsiblePerson" placeholder="请输入责任人" />
</el-form-item>
<el-form-item label="备注">
<el-input v-model="checklistForm.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer">
<el-button :loading="checklistButtonLoading" type="primary" @click="submitChecklistForm"> </el-button>
<el-button @click="checklistOpen = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listEquipmentPart, getEquipmentPart, addEquipmentPart, updateEquipmentPart, delEquipmentPart } from '@/api/mill/equipmentPart'
import { listEquipmentChecklist, getEquipmentChecklist, addEquipmentChecklist, updateEquipmentChecklist, delEquipmentChecklist } from '@/api/mill/equipmentChecklist'
export default {
name: 'EqpCheck',
data() {
return {
// 设备列表
partLoading: false,
partButtonLoading: false,
allPartList: [],
filteredPartList: [],
partKeyword: '',
currentPart: null,
partOpen: false,
partTitle: '',
partForm: {},
partRules: {
inspectPart: [{ required: true, message: '设备名称不能为空', trigger: 'blur' }]
},
// 检验清单
checklistLoading: false,
checklistButtonLoading: false,
checklistData: [],
checklistIds: [],
checklistOpen: false,
checklistTitle: '',
checklistForm: {},
checklistRules: {}
}
},
created() {
this.getPartList()
// 如果路由带了 partId 参数,自动选中
const partId = this.$route.query.partId
if (partId) {
this._autoSelectPartId = Number(partId)
}
},
methods: {
// ===== 设备列表 =====
getPartList() {
this.partLoading = true
listEquipmentPart({ pageNum: 1, pageSize: 1000 }).then(res => {
this.allPartList = res.rows || []
// 为每个设备附上检验项数(后续可优化为批量接口)
this.filteredPartList = [...this.allPartList]
this.partLoading = false
// 自动选中路由传来的 partId
if (this._autoSelectPartId) {
const found = this.allPartList.find(p => p.partId === this._autoSelectPartId)
if (found) this.handleSelectPart(found)
this._autoSelectPartId = null
}
})
},
filterParts() {
const kw = (this.partKeyword || '').trim().toLowerCase()
this.filteredPartList = kw
? this.allPartList.filter(p => (p.inspectPart || '').toLowerCase().includes(kw) || (p.lineSection || '').toLowerCase().includes(kw))
: [...this.allPartList]
},
handleSelectPart(part) {
this.currentPart = part
this.checklistData = []
this.checklistIds = []
this.loadChecklistForPart(part.partId)
},
loadChecklistForPart(partId) {
this.checklistLoading = true
listEquipmentChecklist({ partId, pageNum: 1, pageSize: 1000 }).then(res => {
this.checklistData = res.rows || []
this.checklistLoading = false
})
},
handlePartAdd() {
this.partForm = {}
this.$nextTick(() => { this.$refs.partForm && this.$refs.partForm.clearValidate() })
this.partTitle = '新增设备'
this.partOpen = true
},
handlePartUpdate(row) {
if (!row) return
this.partLoading = true
getEquipmentPart(row.partId).then(res => {
this.partLoading = false
this.partForm = res.data
this.partTitle = '修改设备'
this.partOpen = true
})
},
submitPartForm() {
this.$refs.partForm.validate(valid => {
if (!valid) return
this.partButtonLoading = true
const fn = this.partForm.partId ? updateEquipmentPart : addEquipmentPart
fn(this.partForm).then(() => {
this.$modal.msgSuccess(this.partForm.partId ? '修改成功' : '新增成功')
this.partOpen = false
this.getPartList()
}).finally(() => { this.partButtonLoading = false })
})
},
handlePartDelete(row) {
if (!row) return
this.$modal.confirm(`确认删除设备"${row.inspectPart}"`).then(() => {
this.partLoading = true
return delEquipmentPart(row.partId)
}).then(() => {
if (this.currentPart && this.currentPart.partId === row.partId) {
this.currentPart = null
this.checklistData = []
}
this.getPartList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {}).finally(() => { this.partLoading = false })
},
// ===== 检验清单 =====
handleChecklistSelectionChange(selection) {
this.checklistIds = selection.map(i => i.checkId)
},
handleChecklistAdd() {
if (!this.currentPart) return
this.checklistForm = { partId: this.currentPart.partId }
this.$nextTick(() => { this.$refs.checklistForm && this.$refs.checklistForm.clearValidate() })
this.checklistTitle = '新增巡检要求'
this.checklistOpen = true
},
handleChecklistUpdate(row) {
const checkId = row ? row.checkId : this.checklistIds[0]
this.checklistLoading = true
getEquipmentChecklist(checkId).then(res => {
this.checklistLoading = false
this.checklistForm = res.data
this.checklistTitle = '修改巡检要求'
this.checklistOpen = true
})
},
submitChecklistForm() {
this.$refs.checklistForm.validate(valid => {
if (!valid) return
this.checklistButtonLoading = true
const fn = this.checklistForm.checkId ? updateEquipmentChecklist : addEquipmentChecklist
fn(this.checklistForm).then(() => {
this.$modal.msgSuccess(this.checklistForm.checkId ? '修改成功' : '新增成功')
this.checklistOpen = false
if (this.currentPart) this.loadChecklistForPart(this.currentPart.partId)
}).finally(() => { this.checklistButtonLoading = false })
})
},
handleChecklistDelete(row) {
const ids = row ? [row.checkId] : this.checklistIds
this.$modal.confirm('确认删除选中的巡检要求?').then(() => {
this.checklistLoading = true
return delEquipmentChecklist(ids.join(','))
}).then(() => {
if (this.currentPart) this.loadChecklistForPart(this.currentPart.partId)
this.$modal.msgSuccess('删除成功')
}).catch(() => {}).finally(() => { this.checklistLoading = false })
},
// ===== 路由跳转 =====
goToRecord(part) {
this.$router.push({ path: '/mill/eqp/record', query: { partId: part.partId, partName: part.inspectPart } })
}
}
}
</script>
<style scoped>
.part-card {
display: flex;
align-items: center;
padding: 8px 10px;
margin-bottom: 2px;
border-radius: 4px;
cursor: pointer;
border-left: 3px solid transparent;
transition: all 0.15s;
}
.part-card:hover { background: #f5f7fa; }
.part-card-active { background: #ecf5ff; border-left-color: #409eff; }
.part-name { font-size: 13px; font-weight: 500; color: #303133; line-height: 1.4; }
.part-meta { font-size: 11px; color: #909399; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
</style>

View File

@@ -0,0 +1,300 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备" prop="partId">
<el-select v-model="queryParams.partId" placeholder="请选择设备" clearable filterable
style="width: 180px;" @change="handleQuery">
<el-option v-for="p in partOptions" :key="p.partId" :label="p.inspectPart" :value="p.partId" />
</el-select>
</el-form-item>
<el-form-item label="班次" prop="shift">
<el-select v-model="queryParams.shift" placeholder="班次" clearable style="width: 90px;" @change="handleQuery">
<el-option label="白班" :value="1" />
<el-option label="夜班" :value="2" />
</el-select>
</el-form-item>
<el-form-item label="巡检时间">
<el-date-picker v-model="dateRange" type="daterange" value-format="yyyy-MM-dd"
range-separator="-" start-placeholder="开始" end-placeholder="结束" clearable
@change="handleDateRangeChange" style="width: 220px;" />
</el-form-item>
<el-form-item label="状态" prop="runStatus">
<el-select v-model="queryParams.runStatus" placeholder="运行状态" clearable style="width: 90px;" @change="handleQuery">
<el-option label="正常" :value="1" />
<el-option label="故障" :value="2" />
</el-select>
</el-form-item>
<el-form-item label="巡检人" prop="inspector">
<el-input v-model="queryParams.inspector" placeholder="巡检人" clearable style="width: 110px;" @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- 返回按钮如果是从设备页跳过来的 -->
<el-col :span="1.5" v-if="fromPartId">
<el-button size="mini" icon="el-icon-back" @click="goBack">返回设备</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete">删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
</el-row>
<!-- 来自设备的筛选提示 -->
<el-alert v-if="fromPartName" :title="`当前显示设备「${fromPartName}」的巡检记录`"
type="info" show-icon :closable="false" style="margin-bottom:10px;" />
<el-table v-loading="loading" :data="recordList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="设备/部位" prop="partName" align="center" width="130" />
<el-table-column label="检验内容" prop="checkContent" align="center" show-overflow-tooltip min-width="160" />
<el-table-column label="班次" align="center" width="70">
<template slot-scope="scope">
<el-tag :type="scope.row.shift === 1 ? 'primary' : 'info'" size="mini">
{{ scope.row.shift === 1 ? '白班' : '夜班' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="巡检时间" align="center" prop="inspectTime" width="155">
<template slot-scope="scope">{{ parseTime(scope.row.inspectTime, '{y}-{m}-{d} {h}:{i}') }}</template>
</el-table-column>
<el-table-column label="运行状态" align="center" width="85">
<template slot-scope="scope">
<el-tag :type="scope.row.runStatus === 1 ? 'success' : 'danger'" size="mini">
{{ scope.row.runStatus === 1 ? '正常' : '故障' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="巡检人" prop="inspector" align="center" width="90" />
<el-table-column label="异常描述" prop="abnormalDesc" align="center" show-overflow-tooltip min-width="130" />
<el-table-column label="现场图像" align="center" width="90">
<template slot-scope="scope">
<el-image v-if="scope.row.photo" :src="scope.row.photo" fit="cover"
:preview-src-list="[scope.row.photo]" style="width:50px; height:50px;" />
<span v-else style="color:#c0c4cc;"></span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="110" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="goToDevice(scope.row)">设备</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"></el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 新增/修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="520px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="设备" prop="partId">
<el-select v-model="form.partId" placeholder="请选择设备" filterable clearable style="width:100%;"
@change="onFormPartChange">
<el-option v-for="p in partOptions" :key="p.partId" :label="p.inspectPart" :value="p.partId" />
</el-select>
</el-form-item>
<el-form-item label="检验项" prop="checkId">
<el-select v-model="form.checkId" placeholder="请选择检验项" filterable clearable style="width:100%;"
:disabled="!form.partId">
<el-option v-for="c in formChecklistOptions" :key="c.checkId"
:label="(c.partName || '') + (c.checkContent ? ' — ' + c.checkContent : '')"
:value="c.checkId" />
</el-select>
</el-form-item>
<el-form-item label="班次" prop="shift">
<el-select v-model="form.shift" style="width:100%;">
<el-option label="白班" :value="1" />
<el-option label="夜班" :value="2" />
</el-select>
</el-form-item>
<el-form-item label="巡检时间" prop="inspectTime">
<el-date-picker v-model="form.inspectTime" type="datetime"
value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择巡检时间" style="width:100%;" />
</el-form-item>
<el-form-item label="运行状态" prop="runStatus">
<el-select v-model="form.runStatus" style="width:100%;">
<el-option label="正常" :value="1" />
<el-option label="故障" :value="2" />
</el-select>
</el-form-item>
<el-form-item label="巡检人" prop="inspector">
<el-input v-model="form.inspector" placeholder="请输入巡检人" />
</el-form-item>
<el-form-item label="异常描述">
<el-input v-model="form.abnormalDesc" type="textarea" :rows="2" placeholder="请输入异常描述" />
</el-form-item>
<el-form-item label="备注">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listEquipmentInspectionRecord, getEquipmentInspectionRecord, addEquipmentInspectionRecord, updateEquipmentInspectionRecord, delEquipmentInspectionRecord } from '@/api/mill/equipmentInspectionRecord'
import { listEquipmentPart } from '@/api/mill/equipmentPart'
import { listEquipmentChecklist } from '@/api/mill/equipmentChecklist'
export default {
name: 'EqpRecord',
data() {
return {
loading: false,
buttonLoading: false,
showSearch: true,
total: 0,
ids: [],
single: true,
multiple: true,
recordList: [],
partOptions: [],
formChecklistOptions: [],
title: '',
open: false,
dateRange: undefined,
fromPartId: null,
fromPartName: '',
queryParams: {
pageNum: 1, pageSize: 15,
partId: undefined, shift: undefined, runStatus: undefined,
inspector: undefined, startInspectTime: undefined, endInspectTime: undefined
},
form: {},
rules: {
checkId: [{ required: true, message: '请选择检验项', trigger: 'change' }],
shift: [{ required: true, message: '请选择班次', trigger: 'change' }],
inspectTime: [{ required: true, message: '请选择巡检时间', trigger: 'change' }],
runStatus: [{ required: true, message: '请选择运行状态', trigger: 'change' }]
}
}
},
created() {
// 从路由参数读取设备过滤条件
const { partId, partName } = this.$route.query
if (partId) {
this.queryParams.partId = Number(partId)
this.fromPartId = Number(partId)
this.fromPartName = partName || ''
}
listEquipmentPart({ pageNum: 1, pageSize: 1000 }).then(res => {
this.partOptions = res.rows || []
})
this.getList()
},
methods: {
getList() {
this.loading = true
listEquipmentInspectionRecord(this.queryParams).then(res => {
this.recordList = res.rows || []
this.total = res.total
this.loading = false
})
},
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
handleDateRangeChange(val) {
if (val && val.length === 2) {
this.queryParams.startInspectTime = val[0]
this.queryParams.endInspectTime = val[1]
} else {
this.queryParams.startInspectTime = undefined
this.queryParams.endInspectTime = undefined
}
this.handleQuery()
},
resetQuery() {
this.dateRange = undefined
this.queryParams = { pageNum: 1, pageSize: 15, partId: this.fromPartId || undefined, shift: undefined, runStatus: undefined, inspector: undefined, startInspectTime: undefined, endInspectTime: undefined }
this.getList()
},
handleSelectionChange(selection) {
this.ids = selection.map(i => i.recordId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
handleAdd() {
this.form = { partId: this.queryParams.partId }
if (this.form.partId) this.loadFormChecklist(this.form.partId)
this.$nextTick(() => { this.$refs.form && this.$refs.form.clearValidate() })
this.title = '新增巡检记录'
this.open = true
},
handleUpdate(row) {
const recordId = row ? row.recordId : this.ids[0]
getEquipmentInspectionRecord(recordId).then(res => {
this.form = res.data
if (this.form.partId) this.loadFormChecklist(this.form.partId)
this.title = '修改巡检记录'
this.open = true
})
},
onFormPartChange(partId) {
this.form.checkId = undefined
this.formChecklistOptions = []
if (partId) this.loadFormChecklist(partId)
},
loadFormChecklist(partId) {
listEquipmentChecklist({ partId, pageNum: 1, pageSize: 1000 }).then(res => {
this.formChecklistOptions = res.rows || []
})
},
submitForm() {
this.$refs.form.validate(valid => {
if (!valid) return
this.buttonLoading = true
const fn = this.form.recordId ? updateEquipmentInspectionRecord : addEquipmentInspectionRecord
fn(this.form).then(() => {
this.$modal.msgSuccess(this.form.recordId ? '修改成功' : '新增成功')
this.open = false
this.getList()
}).finally(() => { this.buttonLoading = false })
})
},
handleDelete(row) {
const ids = row ? [row.recordId] : this.ids
this.$modal.confirm('确认删除选中的巡检记录?').then(() => {
this.loading = true
return delEquipmentInspectionRecord(ids.join(','))
}).then(() => {
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {}).finally(() => { this.loading = false })
},
handleExport() {
this.download('/mill/eqp/record/export', { ...this.queryParams }, `巡检记录_${new Date().getTime()}.xlsx`)
},
// 返回设备页并自动选中该设备
goBack() {
this.$router.push({ path: '/mill/eqp/check', query: { partId: this.fromPartId } })
},
// 从记录跳到设备查看
goToDevice(row) {
if (row.partId) {
this.$router.push({ path: '/mill/eqp/check', query: { partId: row.partId } })
}
}
}
}
</script>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,126 @@
<template>
<div class="app-container">
<!-- 搜索栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="钢卷号" prop="coilId">
<el-select v-model="queryParams.coilId" placeholder="选择钢卷" clearable filterable style="width:200px">
<el-option v-for="c in coilOptions" :key="c.coilId" :label="c.coilNo" :value="c.coilId" />
</el-select>
</el-form-item>
<el-form-item label="缺陷类型" prop="defectType">
<el-input v-model="queryParams.defectType" placeholder="缺陷类型" clearable @keyup.enter.native="handleQuery" style="width:140px" />
</el-form-item>
<el-form-item label="严重程度" prop="degree">
<el-select v-model="queryParams.degree" placeholder="全部" clearable style="width:110px">
<el-option label="轻微" value="light" />
<el-option label="一般" value="normal" />
<el-option label="严重" value="serious" />
</el-select>
</el-form-item>
<el-form-item label="判定等级" prop="judgeLevel">
<el-input v-model="queryParams.judgeLevel" placeholder="判定等级" clearable style="width:110px" />
</el-form-item>
<el-form-item label="开始日期" prop="beginTime">
<el-date-picker v-model="queryParams.beginTime" type="date" value-format="yyyy-MM-dd" placeholder="开始" style="width:140px" />
</el-form-item>
<el-form-item label="结束日期" prop="endTime">
<el-date-picker v-model="queryParams.endTime" type="date" value-format="yyyy-MM-dd" placeholder="结束" style="width:140px" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
</el-row>
<el-table v-loading="loading" :data="abnormalList" border>
<el-table-column label="钢卷号" prop="coilNo" align="center" width="160" />
<el-table-column label="产线" prop="productionLine" align="center" width="100" />
<el-table-column label="位置" prop="position" align="center" width="80" />
<el-table-column label="板面" prop="plateSurface" align="center" width="80" />
<el-table-column label="缺陷代码" prop="defectCode" align="center" width="100" />
<el-table-column label="缺陷类型" prop="defectType" align="center" width="120" />
<el-table-column label="缺陷率(%)" prop="defectRate" align="center" width="100" />
<el-table-column label="缺陷重量(kg)" prop="defectWeight" align="center" width="110" />
<el-table-column label="严重程度" prop="degree" align="center" width="90">
<template slot-scope="scope">
<el-tag :type="degreeType(scope.row.degree)" size="small">{{ scope.row.degree || '-' }}</el-tag>
</template>
</el-table-column>
<el-table-column label="判定等级" prop="judgeLevel" align="center" width="90" />
<el-table-column label="判定人" prop="judgeBy" align="center" width="90" />
<el-table-column label="判定时间" prop="judgeTime" align="center" width="160" />
<el-table-column label="全卷标记" prop="wholeCoilMark" align="center" width="90">
<template slot-scope="scope">
<el-tag v-if="scope.row.wholeCoilMark === 1" type="danger" size="small">全卷</el-tag>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="备注" prop="remark" align="center" show-overflow-tooltip />
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
</div>
</template>
<script>
import { listQcAbnormal, listDoubleRackCoils } from '@/api/mill/qc'
export default {
name: 'QcAbnormal',
data() {
return {
loading: false,
showSearch: true,
total: 0,
abnormalList: [],
coilOptions: [],
queryParams: {
pageNum: 1,
pageSize: 20,
coilId: undefined,
defectType: undefined,
degree: undefined,
judgeLevel: undefined,
beginTime: undefined,
endTime: undefined
}
}
},
created() {
this.getList()
this.loadCoilOptions()
},
methods: {
getList() {
this.loading = true
listQcAbnormal(this.queryParams).then(res => {
this.abnormalList = res.rows
this.total = res.total
this.loading = false
}).catch(() => { this.loading = false })
},
loadCoilOptions() {
listDoubleRackCoils().then(res => {
this.coilOptions = res.data || []
})
},
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
degreeType(degree) {
const map = { 'light': 'success', 'normal': 'warning', 'serious': 'danger' }
return map[degree] || 'info'
}
}
}
</script>

View File

@@ -0,0 +1,211 @@
<template>
<div class="app-container">
<!-- 搜索栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="任务编号" prop="taskCode">
<el-input v-model="queryParams.taskCode" placeholder="任务编号" clearable @keyup.enter.native="handleQuery" style="width:160px" />
</el-form-item>
<el-form-item label="检验人员" prop="inspectUser">
<el-input v-model="queryParams.inspectUser" placeholder="检验人员" clearable @keyup.enter.native="handleQuery" style="width:140px" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="全部" clearable style="width:110px">
<el-option label="待检验" :value="0" />
<el-option label="检验中" :value="1" />
<el-option label="待审核" :value="2" />
<el-option label="已完成" :value="3" />
</el-select>
</el-form-item>
<el-form-item label="结果" prop="result">
<el-select v-model="queryParams.result" placeholder="全部" clearable style="width:100px">
<el-option label="合格" value="qualified" />
<el-option label="不合格" value="unqualified" />
</el-select>
</el-form-item>
<el-form-item label="钢卷号" prop="coilId">
<el-select v-model="queryParams.coilId" placeholder="选择钢卷" clearable filterable style="width:180px">
<el-option v-for="c in coilOptions" :key="c.coilId" :label="c.coilNo" :value="c.coilId" />
</el-select>
</el-form-item>
<el-form-item label="开始日期" prop="beginTime">
<el-date-picker v-model="queryParams.beginTime" type="date" value-format="yyyy-MM-dd" placeholder="开始" style="width:140px" />
</el-form-item>
<el-form-item label="结束日期" prop="endTime">
<el-date-picker v-model="queryParams.endTime" type="date" value-format="yyyy-MM-dd" placeholder="结束" style="width:140px" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
</el-row>
<!-- 任务列表 -->
<el-table v-loading="loading" :data="taskList" highlight-current-row @row-click="handleRowClick"
:row-class-name="tableRowClassName" border>
<el-table-column label="任务编号" prop="taskCode" align="center" width="160" />
<el-table-column label="方案名称" prop="schemeName" align="center" />
<el-table-column label="检验人员" prop="inspectUser" align="center" width="100" />
<el-table-column label="检验时间" prop="inspectTime" align="center" width="160" />
<el-table-column label="审核人员" prop="auditUser" align="center" width="100" />
<el-table-column label="状态" align="center" width="90">
<template slot-scope="scope">
<el-tag :type="statusType(scope.row.status)" size="small">{{ statusLabel(scope.row.status) }}</el-tag>
</template>
</el-table-column>
<el-table-column label="结果" align="center" width="80">
<template slot-scope="scope">
<el-tag v-if="scope.row.result" :type="scope.row.result === 'qualified' ? 'success' : 'danger'" size="small">
{{ scope.row.result === 'qualified' ? '合格' : '不合格' }}
</el-tag>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createTime" align="center" width="160" />
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- 检验项目详情 -->
<div class="detail-card" v-if="selectedTask">
<div class="detail-header">
<span class="detail-title">检验项目 {{ selectedTask.taskCode }}</span>
<el-tag :type="statusType(selectedTask.status)" size="small">{{ statusLabel(selectedTask.status) }}</el-tag>
</div>
<el-table v-loading="itemLoading" :data="itemList" border size="small">
<el-table-column label="检验项名称" prop="itemName" align="center" />
<el-table-column label="类型" prop="itemType" align="center" width="80" />
<el-table-column label="标准值" align="center" width="90">
<template slot-scope="scope">{{ scope.row.standardValue }} {{ scope.row.unit }}</template>
</el-table-column>
<el-table-column label="上限" align="center" width="80">
<template slot-scope="scope">{{ scope.row.upperLimit }} {{ scope.row.unit }}</template>
</el-table-column>
<el-table-column label="下限" align="center" width="80">
<template slot-scope="scope">{{ scope.row.lowerLimit }} {{ scope.row.unit }}</template>
</el-table-column>
<el-table-column label="实测值" align="center" width="90">
<template slot-scope="scope">{{ scope.row.inspectValue }} {{ scope.row.unit }}</template>
</el-table-column>
<el-table-column label="是否合格" align="center" width="90">
<template slot-scope="scope">
<el-tag v-if="scope.row.isQualified === 1" type="success" size="small">合格</el-tag>
<el-tag v-else-if="scope.row.isQualified === 0" type="danger" size="small">不合格</el-tag>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="判定结果" prop="judgeResult" align="center" />
<el-table-column label="检验人" prop="inspectUser" align="center" width="90" />
<el-table-column label="检验时间" prop="inspectTime" align="center" width="160" />
</el-table>
</div>
<div v-else class="empty-tip">
<el-empty description="点击任务行查看检验项目" :image-size="60" />
</div>
</div>
</template>
<script>
import { listQcTask, listQcItemByTask, listDoubleRackCoils } from '@/api/mill/qc'
export default {
name: 'QcTask',
data() {
return {
loading: false,
itemLoading: false,
showSearch: true,
total: 0,
taskList: [],
itemList: [],
selectedTask: null,
coilOptions: [],
queryParams: {
pageNum: 1,
pageSize: 20,
taskCode: undefined,
inspectUser: undefined,
status: undefined,
result: undefined,
coilId: undefined,
beginTime: undefined,
endTime: undefined
}
}
},
created() {
this.getList()
this.loadCoilOptions()
},
methods: {
getList() {
this.loading = true
listQcTask(this.queryParams).then(res => {
this.taskList = res.rows
this.total = res.total
this.loading = false
}).catch(() => { this.loading = false })
},
loadCoilOptions() {
listDoubleRackCoils().then(res => {
this.coilOptions = res.data || []
})
},
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
resetQuery() {
this.resetForm('queryForm')
this.handleQuery()
},
handleRowClick(row) {
this.selectedTask = row
this.itemLoading = true
listQcItemByTask(row.taskId).then(res => {
this.itemList = res.data || []
this.itemLoading = false
}).catch(() => { this.itemLoading = false })
},
tableRowClassName({ row }) {
return this.selectedTask && row.taskId === this.selectedTask.taskId ? 'selected-row' : ''
},
statusType(status) {
const map = { 0: 'info', 1: 'warning', 2: '', 3: 'success' }
return map[status] || 'info'
},
statusLabel(status) {
const map = { 0: '待检验', 1: '检验中', 2: '待审核', 3: '已完成' }
return map[status] || status
}
}
}
</script>
<style scoped>
.detail-card {
margin-top: 16px;
border: 1px solid #e6e8eb;
border-radius: 4px;
padding: 12px;
}
.detail-header {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 10px;
}
.detail-title {
font-size: 14px;
font-weight: 600;
color: #303133;
}
.empty-tip {
margin-top: 20px;
text-align: center;
}
</style>

View File

@@ -0,0 +1,382 @@
<template>
<div class="app-container grind-page">
<div class="grind-layout">
<!-- 左侧轧辊列表 -->
<div class="grind-left">
<el-card shadow="never" class="grind-card h-full">
<div slot="header" class="card-header">
<span class="card-title"><i class="el-icon-s-order" /> 轧辊列表</span>
</div>
<div class="roll-filter">
<el-input v-model="filterNo" size="small" placeholder="编号搜索" prefix-icon="el-icon-search"
clearable @input="filterRolls" style="margin-bottom:8px" />
<el-radio-group v-model="filterType" size="small" @change="filterRolls" style="margin-bottom:8px">
<el-radio-button label="">全部</el-radio-button>
<el-radio-button label="WR">WR</el-radio-button>
<el-radio-button label="BR">BR</el-radio-button>
</el-radio-group>
</div>
<div v-loading="rollLoading" class="roll-list">
<div v-for="r in filteredRolls" :key="r.rollId"
:class="['roll-item', selectedRollId === r.rollId ? 'roll-item--active' : '']"
@click="selectRoll(r)">
<div class="ri-no">{{ r.rollNo }}</div>
<div class="ri-meta">
<el-tag size="mini" :type="r.rollType === 'WR' ? 'primary' : 'warning'">{{ r.rollType }}</el-tag>
<span :class="['ri-status', 'st-' + r.status]">{{ statusLabel(r.status) }}</span>
<span class="ri-dia">φ{{ r.currentDia != null ? r.currentDia : r.initialDia }}</span>
</div>
</div>
<div v-if="!rollLoading && filteredRolls.length === 0" class="roll-empty">暂无数据</div>
</div>
</el-card>
</div>
<!-- 右侧磨削台账 -->
<div class="grind-right">
<div v-if="!selectedRoll" class="grind-empty">
<i class="el-icon-arrow-left" /> 请从左侧选择一个轧辊
</div>
<template v-else>
<!-- 轧辊基本信息 -->
<el-card shadow="never" class="grind-card" style="margin-bottom:12px">
<div class="roll-header-grid">
<div class="rh-item"><span class="rh-k">轧辊编号</span><span class="rh-v bold">{{ selectedRoll.rollNo }}</span></div>
<div class="rh-item"><span class="rh-k">辊型</span><span class="rh-v">{{ selectedRoll.rollType === 'WR' ? '工作辊' : '支撑辊' }}</span></div>
<div class="rh-item"><span class="rh-k">材质</span><span class="rh-v">{{ selectedRoll.material || '—' }}</span></div>
<div class="rh-item"><span class="rh-k">初始辊径</span><span class="rh-v">{{ selectedRoll.initialDia != null ? selectedRoll.initialDia + ' mm' : '—' }}</span></div>
<div class="rh-item"><span class="rh-k">当前辊径</span><span class="rh-v bold accent">{{ effectiveCurrentDia != null ? effectiveCurrentDia + ' mm' : '—' }}</span></div>
<div class="rh-item"><span class="rh-k">最小辊径</span><span class="rh-v">{{ selectedRoll.minDia != null ? selectedRoll.minDia + ' mm' : '—' }}</span></div>
<div class="rh-item"><span class="rh-k">磨削次数</span><span class="rh-v">{{ grindList.length + ' 次' }}</span></div>
<div class="rh-item"><span class="rh-k">粗糙度</span><span class="rh-v">{{ selectedRoll.roughness != null ? selectedRoll.roughness + ' μm' : '—' }}</span></div>
<div class="rh-item"><span class="rh-k">凸度</span><span class="rh-v">{{ selectedRoll.crown != null ? selectedRoll.crown + ' mm' : '—' }}</span></div>
<div class="rh-item">
<span class="rh-k">状态</span>
<span :class="['rh-v', 'st-' + selectedRoll.status]">{{ statusLabel(selectedRoll.status) }}</span>
</div>
<div class="rh-item"><span class="rh-k">制造日期</span><span class="rh-v">{{ selectedRoll.manufactureDate || '—' }}</span></div>
<div class="rh-item"><span class="rh-k">备注</span><span class="rh-v">{{ selectedRoll.remark || '—' }}</span></div>
</div>
</el-card>
<!-- 磨削台账 -->
<el-card shadow="never" class="grind-card">
<div slot="header" class="card-header">
<span class="card-title"><i class="el-icon-document" /> 磨削台账</span>
<el-button type="primary" size="mini" icon="el-icon-plus"
style="margin-left:auto" :disabled="!!editRow" @click="startAdd">新增磨削记录</el-button>
</div>
<el-table v-loading="grindLoading" :data="tableData" size="small" border
style="width:100%" :row-class-name="rowClassName">
<el-table-column label="序号" type="index" width="46" align="center" />
<el-table-column label="磨削时间" align="center" width="200">
<template slot-scope="{row}">
<el-date-picker v-if="isEditing(row)" v-model="editRow.grindTime"
type="datetime" size="mini" value-format="yyyy-MM-dd HH:mm:ss"
style="width:182px" placeholder="请选择" />
<span v-else>{{ row.grindTime }}</span>
</template>
</el-table-column>
<el-table-column label="班组" align="center" width="80">
<template slot-scope="{row}">
<el-input v-if="isEditing(row)" v-model="editRow.team" size="mini" style="width:64px" />
<span v-else>{{ row.team || '' }}</span>
</template>
</el-table-column>
<el-table-column label="磨前径(mm)" align="center" width="100">
<template slot-scope="{row}">
<el-input v-if="isEditing(row)" v-model.number="editRow.diaBefore" type="number" size="mini" style="width:80px" />
<span v-else>{{ row.diaBefore }}</span>
</template>
</el-table-column>
<el-table-column label="磨后径(mm)" align="center" width="100">
<template slot-scope="{row}">
<el-input v-if="isEditing(row)" v-model.number="editRow.diaAfter" type="number" size="mini" style="width:80px" />
<span v-else>{{ row.diaAfter }}</span>
</template>
</el-table-column>
<el-table-column label="磨削量(mm)" align="center" width="88">
<template slot-scope="{row}">
<span v-if="isEditing(row)" class="computed-val">{{ grindAmountOf(editRow) }}</span>
<span v-else>{{ row.grindAmount }}</span>
</template>
</el-table-column>
<el-table-column label="辊型" align="center" width="100">
<template slot-scope="{row}">
<el-select v-if="isEditing(row)" v-model="editRow.rollShape" size="mini" style="width:84px">
<el-option label="平" value="平" />
<el-option label="凸" value="凸" />
<el-option label="凹" value="凹" />
</el-select>
<span v-else>{{ row.rollShape || '' }}</span>
</template>
</el-table-column>
<el-table-column label="探伤结果" align="center" width="110">
<template slot-scope="{row}">
<el-select v-if="isEditing(row)" v-model="editRow.flawResult" size="mini" style="width:94px">
<el-option label="合格" value="合格" />
<el-option label="不合格" value="不合格" />
</el-select>
<el-tag v-else size="mini" :type="row.flawResult === '合格' ? 'success' : 'danger'">
{{ row.flawResult || '—' }}
</el-tag>
</template>
</el-table-column>
<el-table-column label="硬度" align="center" width="80">
<template slot-scope="{row}">
<el-input v-if="isEditing(row)" v-model.number="editRow.hardness" type="number" size="mini" style="width:64px" />
<span v-else>{{ row.hardness || '' }}</span>
</template>
</el-table-column>
<el-table-column label="操作者" align="center" width="100">
<template slot-scope="{row}">
<el-input v-if="isEditing(row)" v-model="editRow.operator" size="mini" placeholder="选填" />
<span v-else>{{ row.operator || '' }}</span>
</template>
</el-table-column>
<el-table-column label="备注" align="left" width="120">
<template slot-scope="{row}">
<el-input v-if="isEditing(row)" v-model="editRow.remark" size="mini" placeholder="选填" />
<span v-else class="remark-text">{{ row.remark || '' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="100" fixed="right">
<template slot-scope="{row}">
<template v-if="isEditing(row)">
<el-button size="mini" type="text" icon="el-icon-check"
:loading="grindSaving" @click="saveRow">保存</el-button>
<el-button size="mini" type="text" icon="el-icon-close"
style="color:#909399" @click="cancelEdit">取消</el-button>
</template>
<template v-else>
<el-button size="mini" type="text" icon="el-icon-edit"
:disabled="!!editRow" @click="startEdit(row)">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete"
style="color:#c5221f" :disabled="!!editRow" @click="handleDelete(row)">删除</el-button>
</template>
</template>
</el-table-column>
</el-table>
<!-- 月度汇总 -->
<div class="monthly-wrap" v-if="grindList.length > 0">
<div class="monthly-title">
<span>{{ currentYear }} 年月度汇总</span>
<el-button-group size="mini" style="margin-left:8px">
<el-button icon="el-icon-arrow-left" @click="changeYear(-1)" />
<el-button icon="el-icon-arrow-right" @click="changeYear(1)" />
</el-button-group>
</div>
<el-table :data="monthlyList" size="mini" border style="width:100%;margin-top:8px">
<el-table-column label="月份" prop="month" align="center" width="90" />
<el-table-column label="磨削次数" prop="grindCount" align="center" width="90" />
<el-table-column label="累计磨削量(mm)" prop="totalGrindAmount" align="center" min-width="120" />
</el-table>
</div>
</el-card>
</template>
</div>
</div>
</div>
</template>
<script>
import { listRollInfo, getRollInfo } from '@/api/mill/rollInfo'
import { listRollGrind, addRollGrind, updateRollGrind, delRollGrind, getMonthlyStats } from '@/api/mill/rollGrind'
export default {
name: 'MillGrindRoom',
data() {
return {
rollLoading: false,
allRolls: [],
filteredRolls: [],
filterNo: '',
filterType: '',
selectedRollId: null,
selectedRoll: null,
grindLoading: false,
grindList: [],
currentYear: new Date().getFullYear(),
monthlyList: [],
editRow: null,
grindSaving: false
}
},
computed: {
effectiveCurrentDia() {
if (this.selectedRoll && this.selectedRoll.currentDia != null) {
return parseFloat(this.selectedRoll.currentDia)
}
if (this.grindList.length > 0) {
const latest = [...this.grindList].sort((a, b) => {
return new Date(b.grindTime || 0) - new Date(a.grindTime || 0)
})[0]
if (latest && latest.diaAfter != null) return parseFloat(latest.diaAfter)
}
return null
},
tableData() {
if (this.editRow && this.editRow.__isNew) {
return [this.editRow, ...this.grindList]
}
return this.grindList
}
},
created() {
this.loadRolls()
},
methods: {
loadRolls() {
this.rollLoading = true
listRollInfo({ pageNum: 1, pageSize: 500 }).then(res => {
this.allRolls = res.rows || []
this.filterRolls()
}).finally(() => { this.rollLoading = false })
},
filterRolls() {
this.filteredRolls = this.allRolls.filter(r => {
const matchNo = !this.filterNo || r.rollNo.includes(this.filterNo)
const matchType = !this.filterType || r.rollType === this.filterType
return matchNo && matchType
})
},
selectRoll(r) {
if (this.editRow) this.cancelEdit()
this.selectedRollId = r.rollId
getRollInfo(r.rollId).then(res => {
this.selectedRoll = res.data || r
}).catch(() => { this.selectedRoll = r })
this.loadGrindList(r.rollId)
},
loadGrindList(rollId) {
this.grindLoading = true
listRollGrind(rollId).then(res => {
this.grindList = res.data || []
this.loadMonthlyStats()
}).finally(() => { this.grindLoading = false })
},
loadMonthlyStats() {
if (!this.selectedRollId) return
getMonthlyStats(this.selectedRollId, this.currentYear).then(res => {
this.monthlyList = res.data || []
})
},
changeYear(delta) {
this.currentYear += delta
this.loadMonthlyStats()
},
isEditing(row) {
if (!this.editRow) return false
if (row.__isNew && this.editRow.__isNew) return true
return !!row.grindId && row.grindId === this.editRow.grindId
},
rowClassName({ row }) {
return this.isEditing(row) ? 'editing-row' : ''
},
startAdd() {
const now = new Date()
const pad = n => String(n).padStart(2, '0')
const grindTime = `${now.getFullYear()}-${pad(now.getMonth()+1)}-${pad(now.getDate())} ` +
`${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`
this.editRow = {
__isNew: true,
rollId: this.selectedRollId,
grindTime,
diaBefore: this.effectiveCurrentDia != null ? this.effectiveCurrentDia : undefined,
rollShape: '平',
flawResult: '合格'
}
},
startEdit(row) {
this.editRow = { ...row }
},
cancelEdit() {
this.editRow = null
},
saveRow() {
const r = this.editRow
if (!r.grindTime) { this.$modal.msgWarning('请填写磨削时间'); return }
if (r.diaBefore == null) { this.$modal.msgWarning('请填写磨前直径'); return }
if (r.diaAfter == null) { this.$modal.msgWarning('请填写磨后直径'); return }
this.grindSaving = true
const isNew = !!r.__isNew
const payload = { ...r }
delete payload.__isNew
const api = isNew ? addRollGrind : updateRollGrind
api(payload).then(() => {
this.$modal.msgSuccess(isNew ? '新增成功' : '修改成功')
this.editRow = null
this.loadGrindList(this.selectedRollId)
getRollInfo(this.selectedRollId).then(res => {
this.selectedRoll = res.data
const idx = this.allRolls.findIndex(x => x.rollId === this.selectedRollId)
if (idx !== -1) this.$set(this.allRolls, idx, { ...this.allRolls[idx], ...res.data })
})
}).finally(() => { this.grindSaving = false })
},
handleDelete(row) {
this.$modal.confirm('确认删除该磨削记录?').then(() => {
return delRollGrind(row.grindId)
}).then(() => {
this.$modal.msgSuccess('已删除')
this.loadGrindList(this.selectedRollId)
}).catch(() => {})
},
grindAmountOf(row) {
const b = parseFloat(row.diaBefore)
const a = parseFloat(row.diaAfter)
if (!isNaN(b) && !isNaN(a)) return (b - a).toFixed(2)
return '—'
},
statusLabel(s) {
return { Online: '在线', Standby: '备用', Offline: '离线', Scrapped: '报废' }[s] || s
}
}
}
</script>
<style scoped>
.grind-page { background: #f4f5f7; height: 100%; }
.grind-layout { display: flex; gap: 12px; height: 100%; }
.grind-left { width: 220px; flex-shrink: 0; }
.grind-right { flex: 1; min-width: 0; }
.grind-card { border: 1px solid #dcdee0; border-radius: 4px; }
.h-full { height: calc(100vh - 120px); display: flex; flex-direction: column; }
.card-header { display: flex; align-items: center; gap: 8px; }
.card-title { font-size: 13px; font-weight: 600; color: #3d4b5c; }
.roll-filter { padding: 0 0 4px; }
.roll-list { overflow-y: auto; flex: 1; min-height: 0; }
.roll-item { padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f0f2f5; }
.roll-item:hover { background: #f5f7fa; }
.roll-item--active { background: #e8f4ff !important; border-left: 3px solid #409eff; }
.ri-no { font-family: 'Consolas', monospace; font-size: 13px; font-weight: 600; color: #1f2329; }
.ri-meta { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.ri-dia { font-size: 11px; color: #9aa0a6; }
.ri-status { font-size: 11px; }
.roll-empty { text-align: center; color: #c0c4cc; padding: 20px 0; font-size: 12px; }
.grind-empty { display: flex; align-items: center; justify-content: center;
height: 300px; color: #c0c4cc; font-size: 14px; gap: 6px; }
.roll-header-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 16px; }
.rh-item { display: flex; flex-direction: column; gap: 2px; }
.rh-k { font-size: 11px; color: #9aa0a6; }
.rh-v { font-size: 13px; color: #3d4b5c; }
.rh-v.bold { font-weight: 600; }
.rh-v.accent { color: #0a7c42; }
.st-Online { color: #0a7c42; }
.st-Standby { color: #d4860a; }
.st-Offline { color: #9aa0a6; }
.st-Scrapped { color: #c5221f; }
.monthly-wrap { margin-top: 16px; border-top: 1px solid #f0f2f5; padding-top: 12px; }
.monthly-title { font-size: 12px; color: #5f6368; display: flex; align-items: center; }
.computed-val { color: #409eff; font-weight: 600; font-size: 13px; }
.remark-text { font-size: 12px; color: #5f6368; }
</style>
<style>
.el-table .editing-row { background: #fffbf0 !important; }
.el-table .editing-row:hover > td { background: #fffbf0 !important; }
</style>

View File

@@ -0,0 +1,372 @@
<template>
<div class="app-container roll-overview">
<!-- 状态统计看板 -->
<div class="stat-panel mb16">
<div class="stat-item">
<div class="stat-icon-wrap total-icon"><i class="el-icon-data-line" /></div>
<div class="stat-body">
<div class="stat-num">{{ stats.total || 0 }}</div>
<div class="stat-label">轧辊总数</div>
</div>
<div class="stat-divider" />
</div>
<div class="stat-item">
<div class="stat-icon-wrap online-icon"><i class="el-icon-circle-check" /></div>
<div class="stat-body">
<div class="stat-num online-num">{{ stats.Online || 0 }}</div>
<div class="stat-label"> 线</div>
</div>
<div class="stat-divider" />
</div>
<div class="stat-item">
<div class="stat-icon-wrap standby-icon"><i class="el-icon-time" /></div>
<div class="stat-body">
<div class="stat-num standby-num">{{ stats.Standby || 0 }}</div>
<div class="stat-label"> </div>
</div>
<div class="stat-divider" />
</div>
<div class="stat-item">
<div class="stat-icon-wrap offline-icon"><i class="el-icon-remove-outline" /></div>
<div class="stat-body">
<div class="stat-num offline-num">{{ stats.Offline || 0 }}</div>
<div class="stat-label"> 线</div>
</div>
<div class="stat-divider" />
</div>
<div class="stat-item">
<div class="stat-icon-wrap scrapped-icon"><i class="el-icon-warning-outline" /></div>
<div class="stat-body">
<div class="stat-num scrapped-num">{{ stats.Scrapped || 0 }}</div>
<div class="stat-label"> </div>
</div>
</div>
</div>
<!-- 搜索栏 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="轧辊编号" prop="rollNo">
<el-input v-model="queryParams.rollNo" placeholder="轧辊编号" clearable style="width:140px"
@keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="辊型" prop="rollType">
<el-select v-model="queryParams.rollType" placeholder="全部" clearable style="width:120px">
<el-option label="工作辊 WR" value="WR" />
<el-option label="支撑辊 BR" value="BR" />
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="全部" clearable style="width:110px">
<el-option label="在线" value="Online" />
<el-option label="备用" value="Standby" />
<el-option label="离线" value="Offline" />
<el-option label="报废" value="Scrapped" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<!-- 操作按钮 -->
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate">修改</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" />
</el-row>
<!-- 数据表格 -->
<el-table v-loading="loading" :data="rollList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="轧辊编号" align="center" prop="rollNo" min-width="130">
<template slot-scope="scope">
<span class="roll-no-text">{{ scope.row.rollNo }}</span>
</template>
</el-table-column>
<el-table-column label="辊型" align="center" prop="rollType" width="100">
<template slot-scope="scope">
<span :class="['roll-type-tag', scope.row.rollType === 'WR' ? 'wr-tag' : 'br-tag']">
{{ scope.row.rollType === 'WR' ? '工作辊 WR' : '支撑辊 BR' }}
</span>
</template>
</el-table-column>
<el-table-column label="状态" align="center" width="90">
<template slot-scope="scope">
<span :class="['status-dot-wrap', 'status-' + scope.row.status]">
<span class="status-dot" />{{ statusLabel(scope.row.status) }}
</span>
</template>
</el-table-column>
<el-table-column label="初始直径(mm)" align="right" prop="initialDia" width="120" />
<el-table-column label="当前直径(mm)" align="right" width="120">
<template slot-scope="scope">
<span :class="{ 'warn-text': isDiaLow(scope.row) }">{{ scope.row.currentDia }}</span>
</template>
</el-table-column>
<el-table-column label="最小直径(mm)" align="right" prop="minDia" width="120" />
<el-table-column label="粗糙度" align="right" prop="roughness" width="90" />
<el-table-column label="凸度" align="right" prop="crown" width="90" />
<el-table-column label="材质" align="center" prop="material" width="100" />
<el-table-column label="磨削次数" align="center" prop="grindCount" width="90" />
<el-table-column label="累计轧制量(t)" align="right" prop="totalRolledWeight" width="130" />
<el-table-column label="制造日期" align="center" width="110">
<template slot-scope="scope">{{ parseTime(scope.row.manufactureDate, '{y}-{m}-{d}') }}</template>
</el-table-column>
<el-table-column label="备注" align="left" prop="remark" min-width="120" show-overflow-tooltip />
<el-table-column label="操作" align="center" width="160" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
<el-button v-if="scope.row.status === 'Offline'" size="mini" type="text"
class="scrap-btn" icon="el-icon-lock" @click="handleScrap(scope.row)">封闭</el-button>
<el-button v-if="scope.row.status === 'Scrapped'" size="mini" type="text"
class="del-btn" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
<!-- 新增/修改对话框 -->
<el-dialog :title="title" :visible.sync="open" width="620px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="110px">
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="轧辊编号" prop="rollNo">
<el-input v-model="form.rollNo" placeholder="请输入轧辊编号" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="辊型" prop="rollType">
<el-select v-model="form.rollType" placeholder="请选择辊型" style="width:100%">
<el-option label="工作辊 WR" value="WR" />
<el-option label="支撑辊 BR" value="BR" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="初始直径(mm)" prop="initialDia">
<el-input-number v-model="form.initialDia" :precision="2" :min="0" style="width:100%" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="当前直径(mm)">
<el-input-number v-model="form.currentDia" :precision="2" :min="0" style="width:100%" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="最小直径(mm)">
<el-input-number v-model="form.minDia" :precision="2" :min="0" style="width:100%" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="材质">
<el-input v-model="form.material" placeholder="请输入材质" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="粗糙度">
<el-input-number v-model="form.roughness" :precision="4" :min="0" style="width:100%" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="凸度">
<el-input-number v-model="form.crown" :precision="4" style="width:100%" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16">
<el-col :span="12">
<el-form-item label="制造日期">
<el-date-picker v-model="form.manufactureDate" type="date" value-format="yyyy-MM-dd"
placeholder="制造日期" style="width:100%" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="厂家">
<el-input v-model="form.manufacturer" placeholder="厂家" />
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注">
<el-input v-model="form.remark" type="textarea" :rows="2" placeholder="备注" />
</el-form-item>
</el-form>
<div slot="footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="open = false"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listRollInfo, getRollStats, getRollInfo, addRollInfo, updateRollInfo, delRollInfo, scrapRollInfo } from '@/api/mill/rollInfo'
export default {
name: 'MillRollOverview',
data() {
return {
loading: false,
showSearch: true,
single: true,
multiple: true,
total: 0,
rollList: [],
stats: {},
title: '',
open: false,
ids: [],
queryParams: { pageNum: 1, pageSize: 20, rollNo: undefined, rollType: undefined, status: undefined },
form: {},
rules: {
rollNo: [{ required: true, message: '轧辊编号不能为空', trigger: 'blur' }],
rollType: [{ required: true, message: '请选择辊型', trigger: 'change' }]
}
}
},
created() {
this.getStats()
this.getList()
},
methods: {
getList() {
this.loading = true
listRollInfo(this.queryParams).then(res => {
this.rollList = res.rows || []
this.total = res.total
this.loading = false
}).catch(() => { this.loading = false })
},
getStats() {
getRollStats().then(res => { this.stats = res.data || {} })
},
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
resetQuery() {
this.queryParams = { pageNum: 1, pageSize: 20 }
this.getList()
},
handleSelectionChange(selection) {
this.ids = selection.map(i => i.rollId)
this.single = selection.length !== 1
this.multiple = !selection.length
},
handleAdd() {
this.form = { status: 'Offline', grindCount: 0 }
this.$nextTick(() => { this.$refs.form && this.$refs.form.clearValidate() })
this.title = '新增轧辊'
this.open = true
},
handleUpdate(row) {
const rollId = row ? row.rollId : this.ids[0]
getRollInfo(rollId).then(res => {
this.form = res.data
this.title = '修改轧辊'
this.open = true
})
},
handleDelete(row) {
const rollIds = row ? [row.rollId] : this.ids
this.$modal.confirm('确认删除该报废轧辊记录?此操作不可恢复。').then(() => {
return delRollInfo(rollIds.join(','))
}).then(() => {
this.getList()
this.getStats()
this.$modal.msgSuccess('删除成功')
}).catch(() => {})
},
handleScrap(row) {
this.$modal.confirm('确认封闭轧辊【' + row.rollNo + '】?封闭后状态变为报废,不可恢复。').then(() => {
return scrapRollInfo(row.rollId)
}).then(() => {
this.getList()
this.getStats()
this.$modal.msgSuccess('封闭成功')
}).catch(() => {})
},
submitForm() {
this.$refs.form.validate(valid => {
if (!valid) return
const action = this.form.rollId ? updateRollInfo : addRollInfo
action(this.form).then(() => {
this.$modal.msgSuccess(this.form.rollId ? '修改成功' : '新增成功')
this.open = false
this.getList()
this.getStats()
})
})
},
statusLabel(s) {
return { Online: '在线', Standby: '备用', Offline: '离线', Scrapped: '报废' }[s] || s
},
isDiaLow(row) {
if (!row.currentDia || !row.minDia) return false
return Number(row.currentDia) - Number(row.minDia) < 5
}
}
}
</script>
<style scoped>
.roll-overview { background: #f4f5f7; }
.mb16 { margin-bottom: 16px; }
.stat-panel {
display: flex; background: #fff; border: 1px solid #dcdee0;
border-radius: 4px; overflow: hidden;
}
.stat-item { flex: 1; display: flex; align-items: center; padding: 18px 20px; gap: 14px; position: relative; }
.stat-divider { position: absolute; right: 0; top: 16px; bottom: 16px; width: 1px; background: #e4e6ea; }
.stat-icon-wrap {
width: 42px; height: 42px; border-radius: 4px;
display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.total-icon { background: #edf0f3; color: #3d4b5c; }
.online-icon { background: #e8f5ef; color: #0a7c42; }
.standby-icon { background: #fdf3e3; color: #8b5c00; }
.offline-icon { background: #f0f1f2; color: #5f6368; }
.scrapped-icon { background: #fdecea; color: #a61c00; }
.stat-body { display: flex; flex-direction: column; }
.stat-num { font-size: 26px; font-weight: 700; line-height: 1; color: #1f2329; }
.online-num { color: #0a7c42; }
.standby-num { color: #8b5c00; }
.offline-num { color: #5f6368; }
.scrapped-num { color: #a61c00; }
.stat-label { font-size: 12px; color: #8f9099; margin-top: 4px; letter-spacing: 1px; }
.roll-no-text { font-family: 'Consolas','Courier New',monospace; font-weight: 600; color: #1f2329; }
.roll-type-tag { display: inline-block; padding: 1px 8px; border-radius: 2px; font-size: 11px; font-weight: 600; }
.wr-tag { background: #e8edf5; color: #2b4c8c; border: 1px solid #c5d0e8; }
.br-tag { background: #f0eae0; color: #6b4c1e; border: 1px solid #dccfb8; }
.status-dot-wrap { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 500; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-Online { color: #0a7c42; }
.status-Online .status-dot { background: #0a7c42; box-shadow: 0 0 0 2px #c8ead8; }
.status-Standby { color: #8b5c00; }
.status-Standby .status-dot { background: #d4860a; box-shadow: 0 0 0 2px #f5e2b8; }
.status-Offline { color: #5f6368; }
.status-Offline .status-dot { background: #9aa0a6; box-shadow: 0 0 0 2px #e0e2e4; }
.status-Scrapped { color: #a61c00; }
.status-Scrapped .status-dot { background: #c5221f; box-shadow: 0 0 0 2px #f5c6c4; }
.warn-text { color: #a61c00; font-weight: 600; }
.scrap-btn { color: #8b5c00 !important; }
.del-btn { color: #c5221f !important; }
</style>

55
sql/mill_eqp_tables.sql Normal file
View File

@@ -0,0 +1,55 @@
-- 双机架设备巡检模块建表语句
-- 执行顺序part → checklist → inspection_record
CREATE TABLE IF NOT EXISTS `mill_eqp_part` (
`part_id` bigint NOT NULL AUTO_INCREMENT COMMENT '部位ID',
`inspect_part` varchar(200) NOT NULL COMMENT '巡检部位名称',
`production_line` varchar(100) DEFAULT NULL COMMENT '产线',
`line_section` varchar(100) DEFAULT NULL COMMENT '产线段',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志 0正常 2删除',
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`part_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='双机架设备巡检部位';
CREATE TABLE IF NOT EXISTS `mill_eqp_checklist` (
`check_id` bigint NOT NULL AUTO_INCREMENT COMMENT '清单ID',
`check_no` varchar(100) DEFAULT NULL COMMENT '检验编号',
`part_id` bigint DEFAULT NULL COMMENT '巡检部位ID',
`part_name` varchar(200) DEFAULT NULL COMMENT '设备部件名称',
`check_content` text DEFAULT NULL COMMENT '检验内容',
`equipment_state` varchar(50) DEFAULT NULL COMMENT '设备状态 运行/停止',
`check_standard` text DEFAULT NULL COMMENT '检验标准',
`responsible_person` varchar(100) DEFAULT NULL COMMENT '责任人',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志 0正常 2删除',
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`check_id`),
KEY `idx_part_id` (`part_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='双机架设备检验清单';
CREATE TABLE IF NOT EXISTS `mill_eqp_inspection_record` (
`record_id` bigint NOT NULL AUTO_INCREMENT COMMENT '记录ID',
`check_id` bigint DEFAULT NULL COMMENT '检验清单ID',
`shift` tinyint DEFAULT NULL COMMENT '班次 1白班 2夜班',
`inspect_time` datetime DEFAULT NULL COMMENT '巡检时间',
`run_status` tinyint DEFAULT NULL COMMENT '运行状态 1正常 2故障',
`inspector` varchar(100) DEFAULT NULL COMMENT '巡检人',
`abnormal_desc` text DEFAULT NULL COMMENT '异常描述',
`photo` varchar(1000) DEFAULT NULL COMMENT '巡检照片URL逗号分隔',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志 0正常 2删除',
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
`create_time` datetime DEFAULT NULL COMMENT '创建时间',
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` datetime DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`record_id`),
KEY `idx_check_id` (`check_id`),
KEY `idx_inspect_time` (`inspect_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='双机架设备巡检记录';