Merge remote-tracking branch 'origin/master'

This commit is contained in:
zhanghan11 2024-06-19 15:13:51 +08:00
commit 847647ece4
29 changed files with 4782 additions and 424 deletions

View File

@ -105,7 +105,7 @@ public class IpcEquipCategoryController extends BaseController
/**
* 改变设备分类状态
*/
@PreAuthorize("@ss.hasPermi('equip:category:changeStatus')")
@Log(title = "设备分类", businessType = BusinessType.UPDATE)
@PutMapping("/{categoryId}")
public AjaxResult changeStatus(@PathVariable Long categoryId, @RequestParam Long changeStatus)

View File

@ -69,9 +69,9 @@ public class IpcEquipInfoController extends BaseController
}
@GetMapping("/getInfoByParentId")
public AjaxResult getInfoByParentId(@RequestParam String parentEquipId)
public AjaxResult getInfoByParentId(@RequestParam String parentEquipId,String type)
{
return AjaxResult.success(ipcEquipInfoService.selectIpcEquipInfoListByParentId(parentEquipId));
return AjaxResult.success(ipcEquipInfoService.selectIpcEquipInfoListByParentId(parentEquipId,type));
}
/**
@ -161,9 +161,11 @@ public class IpcEquipInfoController extends BaseController
}
}
/**
* 设备信息上传文件接口
*/
@PreAuthorize("@ss.hasPermi('equip:info:fileUpload')")
@PostMapping("/filesUploads")
public AjaxResult uploadFiles(List<MultipartFile> files)
{

View File

@ -0,0 +1,124 @@
package com.inspur.web.controller.maintenance;
import com.inspur.common.annotation.Log;
import com.inspur.common.core.controller.BaseController;
import com.inspur.common.core.domain.AjaxResult;
import com.inspur.common.core.page.TableDataInfo;
import com.inspur.common.enums.BusinessType;
import com.inspur.common.utils.poi.ExcelUtil;
import com.inspur.maintenance.domain.IpcMaintenanceRecord;
import com.inspur.maintenance.service.IIpcMaintenanceRecordService;
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;
/**
* 设备维修记录Controller
*
* @author inspur
* @date 2024-06-13
*/
@RestController
@RequestMapping("/maintenance/record")
public class IpcMaintenanceRecordController extends BaseController
{
@Autowired
private IIpcMaintenanceRecordService ipcMaintenanceRecordService;
/**
* 查询设备维修记录列表
*/
@PreAuthorize("@ss.hasPermi('maintenance:record:list')")
@GetMapping("/list")
public TableDataInfo list(IpcMaintenanceRecord ipcMaintenanceRecord)
{
startPage();
List<IpcMaintenanceRecord> list = ipcMaintenanceRecordService.selectIpcMaintenanceRecordList(ipcMaintenanceRecord);
return getDataTable(list);
}
/**
* 导出设备维修记录列表
*/
@PreAuthorize("@ss.hasPermi('maintenance:record:export')")
@Log(title = "设备维修记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, IpcMaintenanceRecord ipcMaintenanceRecord)
{
List<IpcMaintenanceRecord> list = ipcMaintenanceRecordService.selectIpcMaintenanceRecordList(ipcMaintenanceRecord);
ExcelUtil<IpcMaintenanceRecord> util = new ExcelUtil<IpcMaintenanceRecord>(IpcMaintenanceRecord.class);
util.exportExcel(response, list, "设备维修记录数据");
}
/**
* 获取设备维修记录详细信息
*/
@PreAuthorize("@ss.hasPermi('maintenance:record:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return AjaxResult.success(ipcMaintenanceRecordService.selectIpcMaintenanceRecordById(id));
}
/**
* 新增设备维修记录
*/
@PreAuthorize("@ss.hasPermi('maintenance:record:add')")
@Log(title = "设备维修记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody IpcMaintenanceRecord ipcMaintenanceRecord)
{
int rows = ipcMaintenanceRecordService.insertIpcMaintenanceRecord(ipcMaintenanceRecord);
if(rows == 0){
return AjaxResult.success("插入失败!",rows);
}
if(rows == -1){
return AjaxResult.success("存在重复的未完成维修记录,无法新增!",rows);
}
return AjaxResult.success("插入成功!",rows);
}
/**
* 修改设备维修记录
*/
@PreAuthorize("@ss.hasPermi('maintenance:record:edit')")
@Log(title = "设备维修记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody IpcMaintenanceRecord ipcMaintenanceRecord)
{
return toAjax(ipcMaintenanceRecordService.updateIpcMaintenanceRecord(ipcMaintenanceRecord));
}
/**
* 提交维修记录
*/
@PreAuthorize("@ss.hasPermi('maintenance:record:submit')")
@Log(title = "设备维修记录", businessType = BusinessType.UPDATE)
@PutMapping("/{id}")
public AjaxResult submit(@PathVariable String id)
{
return toAjax(ipcMaintenanceRecordService.submitIpcMaintenanceRecord(id));
}
@PreAuthorize("@ss.hasPermi('maintenance:record:complete')")
@Log(title = "设备维修记录", businessType = BusinessType.UPDATE)
@PutMapping("/complete")
public AjaxResult complete(@RequestBody IpcMaintenanceRecord ipcMaintenanceRecord)
{
return toAjax(ipcMaintenanceRecordService.completeIpcMaintenanceRecord(ipcMaintenanceRecord));
}
/**
* 删除设备维修记录
*/
@PreAuthorize("@ss.hasPermi('maintenance:record:remove')")
@Log(title = "设备维修记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(ipcMaintenanceRecordService.deleteIpcMaintenanceRecordByIds(ids));
}
}

View File

@ -0,0 +1,98 @@
package com.inspur.web.controller.scrap;
import com.inspur.common.annotation.Log;
import com.inspur.common.core.controller.BaseController;
import com.inspur.common.core.domain.AjaxResult;
import com.inspur.common.core.page.TableDataInfo;
import com.inspur.common.enums.BusinessType;
import com.inspur.common.utils.poi.ExcelUtil;
import com.inspur.scrap.domain.IpcEquipScrappingRecord;
import com.inspur.scrap.service.IIpcEquipScrappingRecordService;
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;
/**
* 设备报废记录Controller
*
* @author inspur
* @date 2024-06-13
*/
@RestController
@RequestMapping("/scrap/record")
public class IpcEquipScrappingRecordController extends BaseController
{
@Autowired
private IIpcEquipScrappingRecordService ipcEquipScrappingRecordService;
/**
* 查询设备报废记录列表
*/
@PreAuthorize("@ss.hasPermi('scrap:record:list')")
@GetMapping("/list")
public TableDataInfo list(IpcEquipScrappingRecord ipcEquipScrappingRecord)
{
startPage();
List<IpcEquipScrappingRecord> list = ipcEquipScrappingRecordService.selectIpcEquipScrappingRecordList(ipcEquipScrappingRecord);
return getDataTable(list);
}
/**
* 导出设备报废记录列表
*/
@PreAuthorize("@ss.hasPermi('scrap:record:export')")
@Log(title = "设备报废记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, IpcEquipScrappingRecord ipcEquipScrappingRecord)
{
List<IpcEquipScrappingRecord> list = ipcEquipScrappingRecordService.selectIpcEquipScrappingRecordList(ipcEquipScrappingRecord);
ExcelUtil<IpcEquipScrappingRecord> util = new ExcelUtil<IpcEquipScrappingRecord>(IpcEquipScrappingRecord.class);
util.exportExcel(response, list, "设备报废记录数据");
}
/**
* 获取设备报废记录详细信息
*/
@PreAuthorize("@ss.hasPermi('scrap:record:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id)
{
return AjaxResult.success(ipcEquipScrappingRecordService.selectIpcEquipScrappingRecordById(id));
}
/**
* 新增设备报废记录
*/
@PreAuthorize("@ss.hasPermi('scrap:record:add')")
@Log(title = "设备报废记录", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody IpcEquipScrappingRecord ipcEquipScrappingRecord)
{
return toAjax(ipcEquipScrappingRecordService.insertIpcEquipScrappingRecord(ipcEquipScrappingRecord));
}
/**
* 修改设备报废记录
*/
@PreAuthorize("@ss.hasPermi('scrap:record:edit')")
@Log(title = "设备报废记录", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody IpcEquipScrappingRecord ipcEquipScrappingRecord)
{
return toAjax(ipcEquipScrappingRecordService.updateIpcEquipScrappingRecord(ipcEquipScrappingRecord));
}
/**
* 删除设备报废记录
*/
@PreAuthorize("@ss.hasPermi('scrap:record:remove')")
@Log(title = "设备报废记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids)
{
return toAjax(ipcEquipScrappingRecordService.deleteIpcEquipScrappingRecordByIds(ids));
}
}

View File

@ -48,6 +48,11 @@ public interface IpcEquipInfoMapper
*/
public List<IpcEquipInfo> selectIpcEquipInfoListByParentId(String parentEquipId);
/**
* 查询正常运行设备
*/
public List<IpcEquipInfo> selectRunningIpcEquipInfoListByParentId(String parentEquipId);
/**
* 新增设备信息
*

View File

@ -42,7 +42,7 @@ public interface IIpcEquipInfoService
/**
* 通过父节点id获取设备信息
*/
public List<IpcEquipInfo> selectIpcEquipInfoListByParentId(String parentEquipId);
public List<IpcEquipInfo> selectIpcEquipInfoListByParentId(String parentEquipId,String type);
/**
* 新增设备信息

View File

@ -78,8 +78,13 @@ public class IpcEquipInfoServiceImpl implements IIpcEquipInfoService
/**
* 通过父节点id获取设备信息
*/
public List<IpcEquipInfo> selectIpcEquipInfoListByParentId(String parentEquipId){
return ipcEquipInfoMapper.selectIpcEquipInfoListByParentId(parentEquipId);
public List<IpcEquipInfo> selectIpcEquipInfoListByParentId(String parentEquipId,String type){
if(type == null){
return ipcEquipInfoMapper.selectIpcEquipInfoListByParentId(parentEquipId);
}else {
return ipcEquipInfoMapper.selectRunningIpcEquipInfoListByParentId(parentEquipId);
}
}
/**

View File

@ -0,0 +1,264 @@
package com.inspur.maintenance.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.inspur.common.annotation.Excel;
import com.inspur.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 设备维修记录对象 ipc_maintenance_record
*
* @author inspur
* @date 2024-06-13
*/
public class IpcMaintenanceRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 维修记录表主键id */
private String id;
/** 维修工单编号 */
@Excel(name = "维修工单编号")
private String maintenanceOrderNum;
/** 设备id */
@Excel(name = "设备id")
private String equipId;
/** 维修设备名称 */
private String equipName;
/** 维修人id */
@Excel(name = "维修人id")
private Integer executorId;
/** 维修人名 */
private String executorName;
/** 设备组件名称 */
@Excel(name = "设备组件名称")
private String maintenanceComponent;
/** 维修内容 */
@Excel(name = "维修内容")
private String maintenanceContent;
/** 维修开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "维修开始时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date maintenanceStartTime;
/** 状态0维修中1已完成 */
@Excel(name = "状态", readConverterExp = "0=维修中1已完成")
private String status;
/** 维修结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "维修结束时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date maintenanceEndTime;
/** 所属部门id */
@Excel(name = "所属部门id")
private Long deptId;
/** 备件出库单id */
@Excel(name = "备件出库单id")
private String sparePartsOutboundId;
/** 设备报废记录id */
@Excel(name = "设备报废记录id")
private String scrappingRecordId;
/**
* 设备报废单号
*/
private String scrappingRecordNum;
/**
* 报废时间
*/
@JsonFormat(pattern = "yyyy-MM-dd")
private String scrappingTime;
/** 备件id */
@Excel(name = "备件id")
private String sparePartsId;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setMaintenanceOrderNum(String maintenanceOrderNum)
{
this.maintenanceOrderNum = maintenanceOrderNum;
}
public String getMaintenanceOrderNum()
{
return maintenanceOrderNum;
}
public void setEquipId(String equipId)
{
this.equipId = equipId;
}
public String getEquipId()
{
return equipId;
}
public void setEquipName(String equipName)
{
this.equipName = equipName;
}
public String getEquipName()
{
return equipName;
}
public void setExecutorId(Integer executorId)
{
this.executorId = executorId;
}
public Integer getExecutorId()
{
return executorId;
}
public void setExecutorName(String executorName)
{
this.executorName = executorName;
}
public String getExecutorName()
{
return executorName;
}
public void setMaintenanceComponent(String maintenanceComponent)
{
this.maintenanceComponent = maintenanceComponent;
}
public String getMaintenanceComponent()
{
return maintenanceComponent;
}
public void setMaintenanceContent(String maintenanceContent)
{
this.maintenanceContent = maintenanceContent;
}
public String getMaintenanceContent()
{
return maintenanceContent;
}
public void setMaintenanceStartTime(Date maintenanceStartTime)
{
this.maintenanceStartTime = maintenanceStartTime;
}
public Date getMaintenanceStartTime()
{
return maintenanceStartTime;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setMaintenanceEndTime(Date maintenanceEndTime)
{
this.maintenanceEndTime = maintenanceEndTime;
}
public Date getMaintenanceEndTime()
{
return maintenanceEndTime;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
{
return deptId;
}
public void setSparePartsOutboundId(String sparePartsOutboundId)
{
this.sparePartsOutboundId = sparePartsOutboundId;
}
public String getSparePartsOutboundId()
{
return sparePartsOutboundId;
}
public void setScrappingRecordId(String scrappingRecordId)
{
this.scrappingRecordId = scrappingRecordId;
}
public String getScrappingRecordId()
{
return scrappingRecordId;
}
public String getScrappingRecordNum() {
return scrappingRecordNum;
}
public void setScrappingRecordNum(String scrappingRecordNum) {
this.scrappingRecordNum = scrappingRecordNum;
}
public String getScrappingTime() {
return scrappingTime;
}
public void setScrappingTime(String scrappingTime) {
this.scrappingTime = scrappingTime;
}
public void setSparePartsId(String sparePartsId)
{
this.sparePartsId = sparePartsId;
}
public String getSparePartsId()
{
return sparePartsId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("maintenanceOrderNum", getMaintenanceOrderNum())
.append("equipId", getEquipId())
.append("equipName", getEquipName())
.append("executorId", getExecutorId())
.append("executorName", getExecutorName())
.append("maintenanceComponent", getMaintenanceComponent())
.append("maintenanceContent", getMaintenanceContent())
.append("maintenanceStartTime", getMaintenanceStartTime())
.append("status", getStatus())
.append("maintenanceEndTime", getMaintenanceEndTime())
.append("deptId", getDeptId())
.append("sparePartsOutboundId", getSparePartsOutboundId())
.append("scrappingRecordId", getScrappingRecordId())
.append("sparePartsId", getSparePartsId())
.toString();
}
}

View File

@ -0,0 +1,62 @@
package com.inspur.maintenance.mapper;
import com.inspur.maintenance.domain.IpcMaintenanceRecord;
import java.util.List;
/**
* 设备维修记录Mapper接口
*
* @author inspur
* @date 2024-06-13
*/
public interface IpcMaintenanceRecordMapper
{
/**
* 查询设备维修记录
*
* @param id 设备维修记录主键
* @return 设备维修记录
*/
public IpcMaintenanceRecord selectIpcMaintenanceRecordById(String id);
/**
* 查询设备维修记录列表
*
* @param ipcMaintenanceRecord 设备维修记录
* @return 设备维修记录集合
*/
public List<IpcMaintenanceRecord> selectIpcMaintenanceRecordList(IpcMaintenanceRecord ipcMaintenanceRecord);
/**
* 新增设备维修记录
*
* @param ipcMaintenanceRecord 设备维修记录
* @return 结果
*/
public int insertIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord);
/**
* 修改设备维修记录
*
* @param ipcMaintenanceRecord 设备维修记录
* @return 结果
*/
public int updateIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord);
/**
* 删除设备维修记录
*
* @param id 设备维修记录主键
* @return 结果
*/
public int deleteIpcMaintenanceRecordById(String id);
/**
* 批量删除设备维修记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteIpcMaintenanceRecordByIds(String[] ids);
}

View File

@ -0,0 +1,72 @@
package com.inspur.maintenance.service;
import com.inspur.maintenance.domain.IpcMaintenanceRecord;
import java.util.List;
/**
* 设备维修记录Service接口
*
* @author inspur
* @date 2024-06-13
*/
public interface IIpcMaintenanceRecordService
{
/**
* 查询设备维修记录
*
* @param id 设备维修记录主键
* @return 设备维修记录
*/
public IpcMaintenanceRecord selectIpcMaintenanceRecordById(String id);
/**
* 查询设备维修记录列表
*
* @param ipcMaintenanceRecord 设备维修记录
* @return 设备维修记录集合
*/
public List<IpcMaintenanceRecord> selectIpcMaintenanceRecordList(IpcMaintenanceRecord ipcMaintenanceRecord);
/**
* 新增设备维修记录
*
* @param ipcMaintenanceRecord 设备维修记录
* @return 结果
*/
public int insertIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord);
/**
* 修改设备维修记录
*
* @param ipcMaintenanceRecord 设备维修记录
* @return 结果
*/
public int updateIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord);
/**
* 维修单提交
*/
public int submitIpcMaintenanceRecord(String id);
/**
* 维修单完成
*/
public int completeIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord);
/**
* 批量删除设备维修记录
*
* @param ids 需要删除的设备维修记录主键集合
* @return 结果
*/
public int deleteIpcMaintenanceRecordByIds(String[] ids);
/**
* 删除设备维修记录信息
*
* @param id 设备维修记录主键
* @return 结果
*/
public int deleteIpcMaintenanceRecordById(String id);
}

View File

@ -0,0 +1,161 @@
package com.inspur.maintenance.service.impl;
import com.inspur.common.utils.uuid.IdUtils;
import com.inspur.maintenance.domain.IpcMaintenanceRecord;
import com.inspur.maintenance.mapper.IpcMaintenanceRecordMapper;
import com.inspur.maintenance.service.IIpcMaintenanceRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
/**
* 设备维修记录Service业务层处理
*
* @author inspur
* @date 2024-06-13
*/
@Service
public class IpcMaintenanceRecordServiceImpl implements IIpcMaintenanceRecordService
{
@Autowired
private IpcMaintenanceRecordMapper ipcMaintenanceRecordMapper;
/**
* 查询设备维修记录
*
* @param id 设备维修记录主键
* @return 设备维修记录
*/
@Override
public IpcMaintenanceRecord selectIpcMaintenanceRecordById(String id)
{
return ipcMaintenanceRecordMapper.selectIpcMaintenanceRecordById(id);
}
/**
* 查询设备维修记录列表
*
* @param ipcMaintenanceRecord 设备维修记录
* @return 设备维修记录
*/
@Override
public List<IpcMaintenanceRecord> selectIpcMaintenanceRecordList(IpcMaintenanceRecord ipcMaintenanceRecord)
{
return ipcMaintenanceRecordMapper.selectIpcMaintenanceRecordList(ipcMaintenanceRecord);
}
/**
* 新增设备维修记录
*
* @param ipcMaintenanceRecord 设备维修记录
* @return 结果
*/
@Override
public int insertIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord)
{
//先通过设备id和开始时间查询是否有重复维修记录
IpcMaintenanceRecord query = new IpcMaintenanceRecord();
query.setEquipId(ipcMaintenanceRecord.getEquipId());
// Date startTime = ipcMaintenanceRecord.getMaintenanceStartTime();
// Map<String, Object> params = new HashMap<>();
// params.put("beginMaintenanceStartTime", getStartofDay(startTime));
// params.put("endMaintenanceStartTime", getEndofDay(startTime));
// query.setParams(params);
query.setStatus("0");
List<IpcMaintenanceRecord> existData = ipcMaintenanceRecordMapper.selectIpcMaintenanceRecordList(query);
if(existData.size() > 0){
return -1;
}
ipcMaintenanceRecord.setId(IdUtils.simpleUUID());
ipcMaintenanceRecord.setStatus("2");//未提交
ipcMaintenanceRecord.setMaintenanceOrderNum("WX" + System.currentTimeMillis() + IdUtils.randomUUID().substring(0, 5));
return ipcMaintenanceRecordMapper.insertIpcMaintenanceRecord(ipcMaintenanceRecord);
}
/**
* 修改设备维修记录
*
* @param ipcMaintenanceRecord 设备维修记录
* @return 结果
*/
@Override
public int updateIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord)
{
return ipcMaintenanceRecordMapper.updateIpcMaintenanceRecord(ipcMaintenanceRecord);
}
/**
* 维修单提交
*/
public int submitIpcMaintenanceRecord(String id){
IpcMaintenanceRecord data = new IpcMaintenanceRecord();
data.setId(id);
data.setStatus("0");
return ipcMaintenanceRecordMapper.updateIpcMaintenanceRecord(data);
}
/**
* 维修单完成
*/
public int completeIpcMaintenanceRecord(IpcMaintenanceRecord ipcMaintenanceRecord){
ipcMaintenanceRecord.setStatus("1");
ipcMaintenanceRecord.setMaintenanceEndTime(new Date());
return ipcMaintenanceRecordMapper.updateIpcMaintenanceRecord(ipcMaintenanceRecord);
}
/**
* 批量删除设备维修记录
*
* @param ids 需要删除的设备维修记录主键
* @return 结果
*/
@Override
public int deleteIpcMaintenanceRecordByIds(String[] ids)
{
return ipcMaintenanceRecordMapper.deleteIpcMaintenanceRecordByIds(ids);
}
/**
* 删除设备维修记录信息
*
* @param id 设备维修记录主键
* @return 结果
*/
@Override
public int deleteIpcMaintenanceRecordById(String id)
{
return ipcMaintenanceRecordMapper.deleteIpcMaintenanceRecordById(id);
}
/**
* 获取给定日期开始时间
* @param date 给定日期
* @return 开始时间
*/
private String getStartofDay(Date date) {
LocalDate localDate = date.toInstant()
.atZone(ZoneId.systemDefault()) // 使用系统默认时区
.toLocalDate();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
return formatter.format(localDate.atStartOfDay(ZoneId.systemDefault()));
}
/**
* 获取给定时间的结束时间
* @param date 给定日期
* @return 结束时间
*/
private String getEndofDay(Date date) {
LocalDate localDate = date.toInstant()
.atZone(ZoneId.systemDefault()) // 使用系统默认时区
.toLocalDate();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
return formatter.format(localDate.atTime(LocalTime.MAX).atZone(ZoneId.systemDefault()));
}
}

View File

@ -0,0 +1,211 @@
package com.inspur.scrap.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.inspur.common.annotation.Excel;
import com.inspur.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 设备报废记录对象 ipc_equip_scrapping_record
*
* @author inspur
* @date 2024-06-13
*/
public class IpcEquipScrappingRecord extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 设备报废记录id */
private String id;
/** 报废设备id */
private String equipId;
/**
* 设备名
*/
@Excel(name = "报废设备")
private String equipName;
/**
* 报废记录单号
*/
@Excel(name = "报废记录单号")
private String scrappingRecordNum;
/** 报废时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "报废时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date scrappingTime;
/** 报废原因 */
@Excel(name = "报废原因")
private String scrappingReason;
/** 报废处理方式 */
@Excel(name = "报废处理方式")
private String scrappingTreatment;
/** 报废记录人id */
private Long creatorId;
/**
* 报废记录人名称
*/
@Excel(name = "报废记录人")
private String creatorName;
/** 报废处理人id */
private Long handlerId;
/**
* 报废处理人名
*/
@Excel(name = "报废处理人")
private String handlerName;
/** 报废设备照片路径 */
@Excel(name = "报废设备照片",cellType = Excel.ColumnType.IMAGE)
private String equipPicPath;
/** 所属部门id */
private Long deptId;
public void setId(String id)
{
this.id = id;
}
public String getId()
{
return id;
}
public void setEquipId(String equipId)
{
this.equipId = equipId;
}
public String getEquipId()
{
return equipId;
}
public String getEquipName() {
return equipName;
}
public void setEquipName(String equipName) {
this.equipName = equipName;
}
public String getScrappingRecordNum() {
return scrappingRecordNum;
}
public void setScrappingRecordNum(String scrappingRecordNum) {
this.scrappingRecordNum = scrappingRecordNum;
}
public void setScrappingTime(Date scrappingTime)
{
this.scrappingTime = scrappingTime;
}
public Date getScrappingTime()
{
return scrappingTime;
}
public void setScrappingReason(String scrappingReason)
{
this.scrappingReason = scrappingReason;
}
public String getScrappingReason()
{
return scrappingReason;
}
public void setScrappingTreatment(String scrappingTreatment)
{
this.scrappingTreatment = scrappingTreatment;
}
public String getScrappingTreatment()
{
return scrappingTreatment;
}
public void setCreatorId(Long creatorId)
{
this.creatorId = creatorId;
}
public Long getCreatorId()
{
return creatorId;
}
public String getCreatorName() {
return creatorName;
}
public void setCreatorName(String creatorName) {
this.creatorName = creatorName;
}
public void setHandlerId(Long handlerId)
{
this.handlerId = handlerId;
}
public Long getHandlerId()
{
return handlerId;
}
public String getHandlerName() {
return handlerName;
}
public void setHandlerName(String handlerName) {
this.handlerName = handlerName;
}
public void setEquipPicPath(String equipPicPath)
{
this.equipPicPath = equipPicPath;
}
public String getEquipPicPath()
{
return equipPicPath;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
{
return deptId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("equipId", getEquipId())
.append("scrappingTime", getScrappingTime())
.append("scrappingReason", getScrappingReason())
.append("scrappingTreatment", getScrappingTreatment())
.append("creatorId", getCreatorId())
.append("handlerId", getHandlerId())
.append("equipPicPath", getEquipPicPath())
.append("deptId", getDeptId())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,62 @@
package com.inspur.scrap.mapper;
import com.inspur.scrap.domain.IpcEquipScrappingRecord;
import java.util.List;
/**
* 设备报废记录Mapper接口
*
* @author inspur
* @date 2024-06-13
*/
public interface IpcEquipScrappingRecordMapper
{
/**
* 查询设备报废记录
*
* @param id 设备报废记录主键
* @return 设备报废记录
*/
public IpcEquipScrappingRecord selectIpcEquipScrappingRecordById(String id);
/**
* 查询设备报废记录列表
*
* @param ipcEquipScrappingRecord 设备报废记录
* @return 设备报废记录集合
*/
public List<IpcEquipScrappingRecord> selectIpcEquipScrappingRecordList(IpcEquipScrappingRecord ipcEquipScrappingRecord);
/**
* 新增设备报废记录
*
* @param ipcEquipScrappingRecord 设备报废记录
* @return 结果
*/
public int insertIpcEquipScrappingRecord(IpcEquipScrappingRecord ipcEquipScrappingRecord);
/**
* 修改设备报废记录
*
* @param ipcEquipScrappingRecord 设备报废记录
* @return 结果
*/
public int updateIpcEquipScrappingRecord(IpcEquipScrappingRecord ipcEquipScrappingRecord);
/**
* 删除设备报废记录
*
* @param id 设备报废记录主键
* @return 结果
*/
public int deleteIpcEquipScrappingRecordById(String id);
/**
* 批量删除设备报废记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteIpcEquipScrappingRecordByIds(String[] ids);
}

View File

@ -0,0 +1,62 @@
package com.inspur.scrap.service;
import com.inspur.scrap.domain.IpcEquipScrappingRecord;
import java.util.List;
/**
* 设备报废记录Service接口
*
* @author inspur
* @date 2024-06-13
*/
public interface IIpcEquipScrappingRecordService
{
/**
* 查询设备报废记录
*
* @param id 设备报废记录主键
* @return 设备报废记录
*/
public IpcEquipScrappingRecord selectIpcEquipScrappingRecordById(String id);
/**
* 查询设备报废记录列表
*
* @param ipcEquipScrappingRecord 设备报废记录
* @return 设备报废记录集合
*/
public List<IpcEquipScrappingRecord> selectIpcEquipScrappingRecordList(IpcEquipScrappingRecord ipcEquipScrappingRecord);
/**
* 新增设备报废记录
*
* @param ipcEquipScrappingRecord 设备报废记录
* @return 结果
*/
public int insertIpcEquipScrappingRecord(IpcEquipScrappingRecord ipcEquipScrappingRecord);
/**
* 修改设备报废记录
*
* @param ipcEquipScrappingRecord 设备报废记录
* @return 结果
*/
public int updateIpcEquipScrappingRecord(IpcEquipScrappingRecord ipcEquipScrappingRecord);
/**
* 批量删除设备报废记录
*
* @param ids 需要删除的设备报废记录主键集合
* @return 结果
*/
public int deleteIpcEquipScrappingRecordByIds(String[] ids);
/**
* 删除设备报废记录信息
*
* @param id 设备报废记录主键
* @return 结果
*/
public int deleteIpcEquipScrappingRecordById(String id);
}

View File

@ -0,0 +1,99 @@
package com.inspur.scrap.service.impl;
import com.inspur.common.utils.SecurityUtils;
import com.inspur.common.utils.uuid.IdUtils;
import com.inspur.scrap.domain.IpcEquipScrappingRecord;
import com.inspur.scrap.mapper.IpcEquipScrappingRecordMapper;
import com.inspur.scrap.service.IIpcEquipScrappingRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 设备报废记录Service业务层处理
*
* @author inspur
* @date 2024-06-13
*/
@Service
public class IpcEquipScrappingRecordServiceImpl implements IIpcEquipScrappingRecordService
{
@Autowired
private IpcEquipScrappingRecordMapper ipcEquipScrappingRecordMapper;
/**
* 查询设备报废记录
*
* @param id 设备报废记录主键
* @return 设备报废记录
*/
@Override
public IpcEquipScrappingRecord selectIpcEquipScrappingRecordById(String id)
{
return ipcEquipScrappingRecordMapper.selectIpcEquipScrappingRecordById(id);
}
/**
* 查询设备报废记录列表
*
* @param ipcEquipScrappingRecord 设备报废记录
* @return 设备报废记录
*/
@Override
public List<IpcEquipScrappingRecord> selectIpcEquipScrappingRecordList(IpcEquipScrappingRecord ipcEquipScrappingRecord)
{
return ipcEquipScrappingRecordMapper.selectIpcEquipScrappingRecordList(ipcEquipScrappingRecord);
}
/**
* 新增设备报废记录
*
* @param ipcEquipScrappingRecord 设备报废记录
* @return 结果
*/
@Override
public int insertIpcEquipScrappingRecord(IpcEquipScrappingRecord ipcEquipScrappingRecord)
{
ipcEquipScrappingRecord.setId(IdUtils.simpleUUID());
ipcEquipScrappingRecord.setCreatorId(SecurityUtils.getLoginUser().getUserId());
ipcEquipScrappingRecord.setScrappingRecordNum("BF" + System.currentTimeMillis() + IdUtils.randomUUID().substring(0, 5));
return ipcEquipScrappingRecordMapper.insertIpcEquipScrappingRecord(ipcEquipScrappingRecord);
}
/**
* 修改设备报废记录
*
* @param ipcEquipScrappingRecord 设备报废记录
* @return 结果
*/
@Override
public int updateIpcEquipScrappingRecord(IpcEquipScrappingRecord ipcEquipScrappingRecord)
{
return ipcEquipScrappingRecordMapper.updateIpcEquipScrappingRecord(ipcEquipScrappingRecord);
}
/**
* 批量删除设备报废记录
*
* @param ids 需要删除的设备报废记录主键
* @return 结果
*/
@Override
public int deleteIpcEquipScrappingRecordByIds(String[] ids)
{
return ipcEquipScrappingRecordMapper.deleteIpcEquipScrappingRecordByIds(ids);
}
/**
* 删除设备报废记录信息
*
* @param id 设备报废记录主键
* @return 结果
*/
@Override
public int deleteIpcEquipScrappingRecordById(String id)
{
return ipcEquipScrappingRecordMapper.deleteIpcEquipScrappingRecordById(id);
}
}

View File

@ -138,6 +138,13 @@
WHERE parent_equip_id = #{parentEquipId}
</select>
<!-- 查询正常运行设备 selectRunningIpcEquipInfoListByParentId-->
<select id="selectRunningIpcEquipInfoListByParentId" parameterType="String" resultMap="IpcEquipInfoResult">
SELECT a.*,(NOT EXISTS(SELECT * from `ipc_equip_info` b WHERE b.parent_equip_id = a.id )) as leaf
FROM `ipc_equip_info` a
WHERE parent_equip_id = #{parentEquipId} and status in ('0')
</select>
<insert id="insertIpcEquipInfo" parameterType="IpcEquipInfo">
insert into ipc_equip_info
<trim prefix="(" suffix=")" suffixOverrides=",">

View File

@ -0,0 +1,124 @@
<?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.inspur.maintenance.mapper.IpcMaintenanceRecordMapper">
<resultMap type="IpcMaintenanceRecord" id="IpcMaintenanceRecordResult">
<result property="id" column="id" />
<result property="maintenanceOrderNum" column="maintenance_order_num" />
<result property="equipId" column="equip_id" />
<result property="equipName" column="equip_name" />
<result property="executorId" column="executor_id" />
<result property="executorName" column="executor_name" />
<result property="maintenanceComponent" column="maintenance_component" />
<result property="maintenanceContent" column="maintenance_content" />
<result property="maintenanceStartTime" column="maintenance_start_time" />
<result property="status" column="status" />
<result property="maintenanceEndTime" column="maintenance_end_time" />
<result property="deptId" column="dept_id" />
<result property="sparePartsOutboundId" column="spare_parts_outbound_id" />
<result property="scrappingRecordId" column="scrapping_record_id" />
<result property="scrappingRecordNum" column="scrapping_record_num" />
<result property="scrappingTime" column="scrapping_time" />
<result property="sparePartsId" column="spare_parts_id" />
</resultMap>
<sql id="selectIpcMaintenanceRecordVo">
select a.id, a.maintenance_order_num, a.equip_id, b.equip_name, a.executor_id, c.nick_name as executor_name, a.maintenance_component, a.maintenance_content, a.maintenance_start_time, a.status, a.maintenance_end_time, a.dept_id, a.spare_parts_outbound_id, a.scrapping_record_id,d.scrapping_record_num,d.scrapping_time,a.spare_parts_id from ipc_maintenance_record a
left join ipc_equip_info b on a.equip_id = b.id
left join sys_user c on a.executor_id = c.user_id
left join ipc_equip_scrapping_record d on a.scrapping_record_id = d.id
</sql>
<select id="selectIpcMaintenanceRecordList" parameterType="IpcMaintenanceRecord" resultMap="IpcMaintenanceRecordResult">
<include refid="selectIpcMaintenanceRecordVo"/>
<where>
<if test="maintenanceOrderNum != null and maintenanceOrderNum != ''"> and a.maintenance_order_num like concat('%', #{maintenanceOrderNum}, '%')</if>
<if test="equipId != null and equipId != ''"> and a.equip_id = #{equipId}</if>
<if test="executorId != null "> and a.executor_id = #{executorId}</if>
<if test="params.beginMaintenanceStartTime != null and params.beginMaintenanceStartTime != '' and params.endMaintenanceStartTime != null and params.endMaintenanceStartTime != ''"> and maintenance_start_time between #{params.beginMaintenanceStartTime} and #{params.endMaintenanceStartTime}</if>
<if test="status != null and status != ''"> and a.status = #{status}</if>
<if test="maintenanceEndTime != null "> and a.maintenance_end_time = #{maintenanceEndTime}</if>
<if test="deptId != null "> and a.dept_id = #{deptId}</if>
<if test="sparePartsOutboundId != null and sparePartsOutboundId != ''"> and a.spare_parts_outbound_id = #{sparePartsOutboundId}</if>
<if test="scrappingRecordId != null and scrappingRecordId != ''"> and a.scrapping_record_id = #{scrappingRecordId}</if>
<if test="sparePartsId != null and sparePartsId != ''"> and a.spare_parts_id = #{sparePartsId}</if>
</where>
</select>
<select id="selectIpcMaintenanceRecordById" parameterType="String" resultMap="IpcMaintenanceRecordResult">
<include refid="selectIpcMaintenanceRecordVo"/>
where a.id = #{id}
</select>
<insert id="insertIpcMaintenanceRecord" parameterType="IpcMaintenanceRecord">
insert into ipc_maintenance_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="maintenanceOrderNum != null">maintenance_order_num,</if>
<if test="equipId != null and equipId != ''">equip_id,</if>
<if test="equipName != null">equip_name,</if>
<if test="executorId != null">executor_id,</if>
<if test="executorName != null">executor_name,</if>
<if test="maintenanceComponent != null">maintenance_component,</if>
<if test="maintenanceContent != null">maintenance_content,</if>
<if test="maintenanceStartTime != null">maintenance_start_time,</if>
<if test="status != null">status,</if>
<if test="maintenanceEndTime != null">maintenance_end_time,</if>
<if test="deptId != null">dept_id,</if>
<if test="sparePartsOutboundId != null">spare_parts_outbound_id,</if>
<if test="scrappingRecordId != null">scrapping_record_id,</if>
<if test="sparePartsId != null">spare_parts_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="maintenanceOrderNum != null">#{maintenanceOrderNum},</if>
<if test="equipId != null and equipId != ''">#{equipId},</if>
<if test="equipName != null">#{equipName},</if>
<if test="executorId != null">#{executorId},</if>
<if test="executorName != null">#{executorName},</if>
<if test="maintenanceComponent != null">#{maintenanceComponent},</if>
<if test="maintenanceContent != null">#{maintenanceContent},</if>
<if test="maintenanceStartTime != null">#{maintenanceStartTime},</if>
<if test="status != null">#{status},</if>
<if test="maintenanceEndTime != null">#{maintenanceEndTime},</if>
<if test="deptId != null">#{deptId},</if>
<if test="sparePartsOutboundId != null">#{sparePartsOutboundId},</if>
<if test="scrappingRecordId != null">#{scrappingRecordId},</if>
<if test="sparePartsId != null">#{sparePartsId},</if>
</trim>
</insert>
<update id="updateIpcMaintenanceRecord" parameterType="IpcMaintenanceRecord">
update ipc_maintenance_record
<trim prefix="SET" suffixOverrides=",">
<if test="maintenanceOrderNum != null">maintenance_order_num = #{maintenanceOrderNum},</if>
<if test="equipId != null and equipId != ''">equip_id = #{equipId},</if>
<if test="equipName != null">equip_name = #{equipName},</if>
<if test="executorId != null">executor_id = #{executorId},</if>
<if test="executorName != null">executor_name = #{executorName},</if>
<if test="maintenanceComponent != null">maintenance_component = #{maintenanceComponent},</if>
<if test="maintenanceContent != null">maintenance_content = #{maintenanceContent},</if>
<if test="maintenanceStartTime != null">maintenance_start_time = #{maintenanceStartTime},</if>
<if test="status != null">status = #{status},</if>
<if test="maintenanceEndTime != null">maintenance_end_time = #{maintenanceEndTime},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="sparePartsOutboundId != null">spare_parts_outbound_id = #{sparePartsOutboundId},</if>
<if test="scrappingRecordId != null">scrapping_record_id = #{scrappingRecordId},</if>
<if test="sparePartsId != null">spare_parts_id = #{sparePartsId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteIpcMaintenanceRecordById" parameterType="String">
delete from ipc_maintenance_record where id = #{id}
</delete>
<delete id="deleteIpcMaintenanceRecordByIds" parameterType="String">
delete from ipc_maintenance_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,103 @@
<?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.inspur.scrap.mapper.IpcEquipScrappingRecordMapper">
<resultMap type="IpcEquipScrappingRecord" id="IpcEquipScrappingRecordResult">
<result property="id" column="id" />
<result property="equipId" column="equip_id" />
<result property="equipName" column="equip_name" />
<result property="scrappingRecordNum" column="scrapping_record_num" />
<result property="scrappingTime" column="scrapping_time" />
<result property="scrappingReason" column="scrapping_reason" />
<result property="scrappingTreatment" column="scrapping_treatment" />
<result property="creatorId" column="creator_id" />
<result property="creatorName" column="creator_name" />
<result property="handlerId" column="handler_id" />
<result property="handlerName" column="handler_name" />
<result property="equipPicPath" column="equip_pic_path" />
<result property="deptId" column="dept_id" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectIpcEquipScrappingRecordVo">
select a.id, a.equip_id,b.equip_name,a.scrapping_record_num, a.scrapping_time, a.scrapping_reason, a.scrapping_treatment, a.creator_id,c.nick_name as creator_name, d.nick_name as handler_name, a.handler_id, a.equip_pic_path, a.dept_id, a.remark from ipc_equip_scrapping_record a
left join ipc_equip_info b on a.equip_id = b.id
left join sys_user c on a.creator_id = c.user_id
left join sys_user d on a.handler_id = d.user_id
</sql>
<select id="selectIpcEquipScrappingRecordList" parameterType="IpcEquipScrappingRecord" resultMap="IpcEquipScrappingRecordResult">
<include refid="selectIpcEquipScrappingRecordVo"/>
<where>
<if test="params.startTime != null "> and a.scrapping_time &gt;= #{params.startTime}</if>
<if test="params.endTime != null "> and a.scrapping_time &lt;= #{params.endTime}</if>
<if test="creatorId != null "> and a.creator_id = #{creatorId}</if>
<if test="handlerId != null "> and a.handler_id = #{handlerId}</if>
<if test="deptId != null "> and a.dept_id = #{deptId}</if>
</where>
</select>
<select id="selectIpcEquipScrappingRecordById" parameterType="String" resultMap="IpcEquipScrappingRecordResult">
<include refid="selectIpcEquipScrappingRecordVo"/>
where a.id = #{id}
</select>
<insert id="insertIpcEquipScrappingRecord" parameterType="IpcEquipScrappingRecord">
insert into ipc_equip_scrapping_record
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="equipId != null">equip_id,</if>
<if test="scrappingRecordNum != null">scrapping_record_num,</if>
<if test="scrappingTime != null">scrapping_time,</if>
<if test="scrappingReason != null">scrapping_reason,</if>
<if test="scrappingTreatment != null">scrapping_treatment,</if>
<if test="creatorId != null">creator_id,</if>
<if test="handlerId != null">handler_id,</if>
<if test="equipPicPath != null">equip_pic_path,</if>
<if test="deptId != null">dept_id,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="equipId != null">#{equipId},</if>
<if test="scrappingRecordNum != null">#{scrappingRecordNum},</if>
<if test="scrappingTime != null">#{scrappingTime},</if>
<if test="scrappingReason != null">#{scrappingReason},</if>
<if test="scrappingTreatment != null">#{scrappingTreatment},</if>
<if test="creatorId != null">#{creatorId},</if>
<if test="handlerId != null">#{handlerId},</if>
<if test="equipPicPath != null">#{equipPicPath},</if>
<if test="deptId != null">#{deptId},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateIpcEquipScrappingRecord" parameterType="IpcEquipScrappingRecord">
update ipc_equip_scrapping_record
<trim prefix="SET" suffixOverrides=",">
<if test="equipId != null">equip_id = #{equipId},</if>
<if test="scrappingTime != null">scrapping_time = #{scrappingTime},</if>
<if test="scrappingReason != null">scrapping_reason = #{scrappingReason},</if>
<if test="scrappingTreatment != null">scrapping_treatment = #{scrappingTreatment},</if>
<if test="creatorId != null">creator_id = #{creatorId},</if>
<if test="handlerId != null">handler_id = #{handlerId},</if>
<if test="equipPicPath != null">equip_pic_path = #{equipPicPath},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteIpcEquipScrappingRecordById" parameterType="String">
delete from ipc_equip_scrapping_record where id = #{id}
</delete>
<delete id="deleteIpcEquipScrappingRecordByIds" parameterType="String">
delete from ipc_equip_scrapping_record where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,61 @@
import request from "@/utils/request";
// 查询设备维修记录列表
export function listMaintRecord(query) {
return request({
url: "/maintenance/record/list",
method: "get",
params: query,
});
}
// 查询设备维修记录详细
export function getMaintRecord(id) {
return request({
url: "/maintenance/record/" + id,
method: "get",
});
}
// 新增设备维修记录
export function addMaintRecord(data) {
return request({
url: "/maintenance/record",
method: "post",
data: data,
});
}
// 修改设备维修记录
export function updateMaintRecord(data) {
return request({
url: "/maintenance/record",
method: "put",
data: data,
});
}
// 提交设备维修记录
export function submitMaintRecord(id) {
return request({
url: "/maintenance/record/" + id,
method: "put",
});
}
// 修改设备维修记录
export function completeMaintRecord(data) {
return request({
url: "/maintenance/record/complete",
method: "put",
data: data,
});
}
// 删除设备维修记录
export function delMaintRecord(id) {
return request({
url: "/maintenance/record/" + id,
method: "delete",
});
}

View File

@ -0,0 +1,44 @@
import request from "@/utils/request";
// 查询设备报废记录列表
export function listScrapRecord(query) {
return request({
url: "/scrap/record/list",
method: "get",
params: query,
});
}
// 查询设备报废记录详细
export function getScrapRecord(id) {
return request({
url: "/scrap/record/" + id,
method: "get",
});
}
// 新增设备报废记录
export function addScrapRecord(data) {
return request({
url: "/scrap/record",
method: "post",
data: data,
});
}
// 修改设备报废记录
export function updateScrapRecord(data) {
return request({
url: "/scrap/record",
method: "put",
data: data,
});
}
// 删除设备报废记录
export function delScrapRecord(id) {
return request({
url: "/scrap/record/" + id,
method: "delete",
});
}

View File

@ -1,7 +1,7 @@
import request from "@/utils/request";
// 查询保养计划列表
export function listRecord(query) {
export function listUpkeepRecord(query) {
return request({
url: "/upkeep/record/list",
method: "get",

View File

@ -7,7 +7,7 @@
/> -->
<!-- <top-nav id="topmenu-container" class="topmenu-container" v-if="true" /> -->
<div class="left-content">
<div class="pro-log"></div>
<!-- <div class="pro-log"></div> -->
<div class="pro-title">扁鸿设备工控管理系统</div>
<div class="top-title-container">
<template v-for="(item, index) in topNavRouters">

View File

@ -1,54 +1,88 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
style="text-align:right"
>
<el-form-item
label="设备类别名称"
prop="categoryName"
<el-row :gutter="20">
<!--部门数据-->
<el-col
:span="4"
:xs="24"
>
<el-input
v-model="queryParams.categoryName"
placeholder="请输入设备类别名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="设备类别简称"
prop="categoryAbbr"
>
<el-input
v-model="queryParams.categoryAbbr"
placeholder="请输入设备类别简称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="设备类别状态"
prop="status"
>
<el-select
v-model="queryParams.status"
placeholder="请选择节点状态"
clearable
>
<el-option
v-for="dict in dict.type.equip_category_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
<div class="head-container">
<el-input
v-model="deptName"
placeholder="请输入部门名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</el-select>
</el-form-item>
<!-- <el-form-item
</div>
<div class="head-container">
<el-tree
:data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
node-key="id"
default-expand-all
highlight-current
@node-click="handleNodeClick"
/>
</div>
</el-col>
<el-col
:span="20"
:xs="24"
>
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
style="text-align:right"
>
<el-form-item
label="设备类别名称"
prop="categoryName"
>
<el-input
v-model="queryParams.categoryName"
placeholder="请输入设备类别名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="设备类别简称"
prop="categoryAbbr"
>
<el-input
v-model="queryParams.categoryAbbr"
placeholder="请输入设备类别简称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item
label="设备类别状态"
prop="status"
>
<el-select
v-model="queryParams.status"
placeholder="请选择节点状态"
clearable
>
<el-option
v-for="dict in dict.type.equip_category_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<!-- <el-form-item
label="设备类别所属部门"
prop="deptId"
>
@ -59,36 +93,36 @@
@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-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"
v-hasPermi="['equip:category:add']"
>新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-row
:gutter="10"
class="mb8"
>
<!-- <el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['equip:category:add']"
>新增</el-button>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
@ -120,36 +154,36 @@
v-hasPermi="['system:category:export']"
>导出</el-button>
</el-col> -->
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-if="refreshTable"
v-loading="loading"
:data="categoryList"
row-key="categoryId"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
v-hasPermi="['ipc:faultTreeConfig:list']"
>
<el-table-column
label="设备类别名称"
prop="categoryName"
/>
<el-table-column
label="设备类别简称"
prop="categoryAbbr"
/>
<el-table-column
label="设备类别描述"
show-overflow-tooltip
align="center"
prop="categoryDescription"
/>
<!-- <el-table-column
<el-table
v-if="refreshTable"
v-loading="loading"
:data="categoryList"
row-key="categoryId"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
v-hasPermi="['ipc:faultTreeConfig:list']"
>
<el-table-column
label="设备类别名称"
prop="categoryName"
/>
<el-table-column
label="设备类别简称"
prop="categoryAbbr"
/>
<el-table-column
label="设备类别描述"
show-overflow-tooltip
align="center"
prop="categoryDescription"
/>
<!-- <el-table-column
label="创建时间"
align="center"
prop="createdTime"
@ -174,73 +208,74 @@
align="center"
prop="parentCategoryId"
/>-->
<el-table-column
label="图片"
align="center"
>
<template slot-scope="scope">
<el-button
v-if="hasPath(scope.row)"
size="mini"
type="text"
@click="clickPic(scope.row)"
>设备类别图片</el-button>
<el-image-viewer
v-if="showViewer"
:on-close="closeViewer"
:url-list="tableImageList"
<el-table-column
label="图片"
align="center"
>
<template slot-scope="scope">
<el-button
v-if="hasPath(scope.row)"
size="mini"
type="text"
@click="clickPic(scope.row)"
>设备类别图片</el-button>
<el-image-viewer
v-if="showViewer"
:on-close="closeViewer"
:url-list="tableImageList"
/>
</template>
</el-table-column>
<el-table-column
label="设备类别状态"
align="center"
prop="status"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.equip_category_status"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column
label="备注"
show-overflow-tooltip
align="center"
prop="remark"
/>
</template>
</el-table-column>
<el-table-column
label="设备类别状态"
align="center"
prop="status"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.equip_category_status"
:value="scope.row.status"
/>
</template>
</el-table-column>
<el-table-column
label="备注"
show-overflow-tooltip
align="center"
prop="remark"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['equip:category:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['equip:category:add']"
>新增</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['equip:category:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- <el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['equip:category:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['equip:category:add']"
>新增</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['equip:category:remove']"
>删除</el-button>
</template>
</el-table-column> -->
</el-table>
</el-col>
</el-row>
<!-- 添加或修改设备分类对话框 -->
<el-dialog
:title="title"
@ -410,6 +445,7 @@ import FileUpload from "@/components/FileUpload";
import { getToken } from "@/utils/auth";
import { Loading } from "element-ui";
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
import { deptTreeSelect } from "@/api/system/user";
export default {
name: "Category",
components: {
@ -510,12 +546,43 @@ export default {
files: [],
tableImageList: [],
showViewer: false,
//
deptName: undefined,
//
deptOptions: undefined,
defaultProps: {
children: "children",
label: "label",
},
};
},
watch: {
//
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getList();
this.getDeptTree();
},
methods: {
/** 查询部门下拉树结构 */
getDeptTree() {
deptTreeSelect().then((response) => {
this.deptOptions = response.data;
});
},
//
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
//
handleNodeClick(data) {
this.queryParams.deptId = data.id;
this.handleQuery();
},
hasPath(data) {
return data.picPath == null || data.picPath == "" ? false : true;
},

File diff suppressed because it is too large Load Diff

View File

@ -413,7 +413,7 @@
placeholder="请输入传感器描述"
/>
</el-form-item></el-col>
<el-col :span="24"> <el-form-item label="传感器图片路径">
<el-col :span="24"> <el-form-item label="传感器图片">
<image-upload v-model="form.sensorPicPath" />
</el-form-item></el-col>
<el-col :span="24"> <el-form-item
@ -443,7 +443,7 @@
</el-dialog>
</div>
</template>
<script>
import {
listSensor,
@ -573,7 +573,6 @@ export default {
} else {
queryParams.parentEquipId = "0";
}
//parentId
getInfoByParentId(queryParams).then((res) => {
res.data.forEach((item) => {
@ -714,4 +713,3 @@ export default {
},
};
</script>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,660 @@
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
style="text-align:right"
>
<el-form-item
label="报废时间"
prop="scrappingTime"
>
<el-date-picker
v-model="daterange"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="yyyy-MM-dd"
value-format="yyyy-MM-dd"
/>
</el-date-picker>
</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"
v-hasPermi="['scrap:record:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['scrap:record:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['scrap:record:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['scrap:record:export']"
>导出</el-button>
</el-col>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="recordList"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55"
align="center"
/>
<el-table-column
label="报废设备"
align="center"
prop="equipName"
/>
<el-table-column
label="报废单号"
align="center"
prop="scrappingRecordNum"
/>
<el-table-column
label="报废时间"
align="center"
prop="scrappingTime"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.scrappingTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column
label="报废原因"
:show-overflow-tooltip="true"
align="center"
prop="scrappingReason"
/>
<el-table-column
label="报废处理方式"
:show-overflow-tooltip="true"
align="center"
prop="scrappingTreatment"
/>
<el-table-column
label="报废记录人"
align="center"
prop="creatorName"
/>
<el-table-column
label="报废处理人"
align="center"
prop="handlerName"
/>
<el-table-column
label="报废设备照片"
align="center"
prop="equipPicPath"
width="100"
>
<template slot-scope="scope">
<image-preview
:src="scope.row.equipPicPath"
:width="50"
:height="50"
/>
</template>
</el-table-column>
<el-table-column
label="备注"
align="center"
:show-overflow-tooltip="true"
prop="remark"
/>
<el-table-column
label="操作"
align="center"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['scrap:record:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['scrap:record:remove']"
>删除</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="500px"
append-to-body
>
<el-form
ref="form"
:model="form"
:rules="rules"
label-width="80px"
>
<el-row>
<el-col :span="24"> <el-form-item
label="报废设备"
prop="equipIds"
>
<el-cascader
v-model="form.equipIds"
:props="props"
placeholder="请选择设备"
style="width:400px"
/>
</el-form-item></el-col>
<el-col :span="12"> <el-form-item
label="报废时间"
prop="scrappingTime"
>
<el-date-picker
clearable
v-model="form.scrappingTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择报废时间"
>
</el-date-picker>
</el-form-item></el-col>
<el-col :span="12"> <el-form-item
label="设备报废处理人"
prop="handlerId"
>
<el-input
v-model="form.handlerName"
@focus="handleSelectUser"
placeholder="请选择设备报废处理人"
/>
</el-form-item></el-col>
<el-col :span="24"> <el-form-item
label="报废原因"
prop="scrappingReason"
>
<el-input
v-model="form.scrappingReason"
type="textarea"
:rows="3"
placeholder="请输入报废原因"
/>
</el-form-item></el-col>
<el-col :span="24">
<el-form-item
label="报废处理方式"
prop="scrappingTreatment"
>
<el-input
v-model="form.scrappingTreatment"
type="textarea"
:rows="3"
placeholder="请输入报废处理方式"
/>
</el-form-item></el-col>
<el-col :span="24"> <el-form-item label="报废设备照片路径">
<image-upload
:limit="1"
v-model="form.equipPicPath"
/>
</el-form-item></el-col>
<el-col :span="24"> <el-form-item
label="备注"
prop="remark"
>
<el-input
v-model="form.remark"
type="textarea"
:rows="3"
placeholder="请输入备注"
/>
</el-form-item></el-col>
</el-row>
</el-form>
<div
slot="footer"
class="dialog-footer"
>
<el-button
type="primary"
@click="submitForm"
> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
<!-- 用户选择弹出框 -->
<el-dialog
:title="userTitle"
:visible.sync="userOpen"
width="500px"
:close-on-click-modal="false"
class="card-detail-class"
:before-close="cancelUser"
>
<el-table
v-loading="userLoading"
:data="userList"
style=width:100%;height:200%
>
<el-table-column width="60px">
<template v-slot="scope">
<!-- label值要与el-table数据id实现绑定 -->
<el-radio
v-model="selectedUserId"
:label="scope.row.userId"
@change="handleRowChange(scope.row)"
>{{""}}</el-radio>
</template>
</el-table-column>
<el-table-column
label="用户编号"
align="center"
prop="userId"
/>
<el-table-column
label="用户名称"
align="center"
prop="userName"
/>
<el-table-column
label="用户昵称"
align="center"
prop="nickName"
:show-overflow-tooltip="true"
/>
<el-table-column
label="部门"
align="center"
prop="dept.deptName"
:show-overflow-tooltip="true"
/>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParamsUser.pageNum"
:limit.sync="queryParamsUser.pageSize"
@pagination="getUserList"
/>
<div
slot="footer"
class="dialog-footer"
>
<el-button
type="primary"
@click="selectUser"
> </el-button>
<el-button @click="cancelUser"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {
listScrapRecord,
getScrapRecord,
delScrapRecord,
addScrapRecord,
updateScrapRecord,
} from "@/api/scrap/record";
import { getInfoByParentId, getInfo } from "@/api/equip/equip";
import { listUser } from "@/api/system/user";
import _ from "lodash";
export default {
name: "Record",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
recordList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
scrappingTime: null,
creatorId: null,
handlerId: null,
equipPicPath: null,
deptId: null,
},
//
form: {},
//
rules: {},
props: {
// lazyLoad 使
lazy: true,
// value: "id",
// label: "equipName",
// children: "children",
// // false
// emitPath: false,
//
checkStrictly: true,
// lazy true
//function(node, resolve)noderesolve()
lazyLoad(node, resolve) {
console.log("7777:", node);
const queryParams = {};
const data = [];
if (node.value != null) {
queryParams.parentEquipId = node.value;
} else {
queryParams.parentEquipId = "0";
}
//parentId
getInfoByParentId(queryParams).then((res) => {
res.data.forEach((item) => {
data.push({
id: item.id,
label: item.equipName,
value: item.id,
leaf: item.leaf,
});
});
resolve(data);
});
},
},
//
userTitle: "用户列表",
userOpen: false,
userLoading: false,
userList: [],
selectedUserId: null,
queryParamsUser: {
pageNum: 1,
pageSize: 10,
userName: undefined,
deptId: undefined,
},
queryMark: null,
daterange: [],
};
},
created() {
this.getList();
},
methods: {
/**用户选择相关 */
handleSelectUser(mark) {
this.queryMark = mark;
this.userOpen = true;
this.getUserList();
},
getUserList() {
this.userLoading = true;
listUser(this.queryParamsUser).then((response) => {
this.userList = response.rows;
this.total = response.total;
this.userLoading = false;
});
},
handleRowChange(row) {
if (this.queryMark == "query") {
this.queryParams.handlerId = row.userId;
this.queryParams.handlerName = row.nickName;
} else {
this.selectedUserId = row.userId;
this.form.handlerId = row.userId;
this.form.handlerName = row.nickName;
}
},
selectUser() {
this.userOpen = false;
this.selectedUserId = null;
this.total = 0;
this.queryParamsUser = {
pageNum: 1,
pageSize: 10,
};
},
cancelUser() {
this.userOpen = false;
if (this.queryMark == "query") {
this.queryParams.handlerId = null;
this.queryParams.handlerName = null;
} else {
this.form.handlerId = null;
this.form.handlerName = null;
}
this.selectedUserId = null;
this.total = 0;
this.queryParamsUser = {
pageNum: 1,
pageSize: 10,
};
},
equipChange(data) {
this.form.equipId = _.last(data);
},
/** 查询设备报废记录列表 */
getList() {
this.loading = true;
if (this.daterange != null) {
this.queryParams.params = {};
this.queryParams.params.startTime = this.daterange[0];
this.queryParams.params.endTime = this.daterange[1];
}
listScrapRecord(this.queryParams).then((response) => {
this.recordList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
equipId: null,
scrappingTime: null,
scrappingReason: null,
scrappingTreatment: null,
creatorId: null,
handlerId: null,
equipPicPath: null,
deptId: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.daterange = [];
// this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加设备报废记录";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
getScrapRecord(id).then((response) => {
this.form = response.data;
//
var equipId = response.data.equipId;
getInfo(equipId).then((res) => {
this.form.equipIds = this.equipDataEchoHandle(res.data);
this.open = true;
this.title = "修改设备报废记录";
});
});
},
// Cascader
equipDataEchoHandle(row) {
//
// addressId
let ancestors = row.ancestors; // id25604
if (row.ancestors && row.ancestors != "") {
// '0,100, 25438, 25519, 25652'
// addressIdaddressId
ancestors = row.ancestors.split(",");
ancestors.shift(); //0
// ancestors = ancestors.map(Number); // stringnumber
ancestors.push(row.id); // id
}
return ancestors;
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate((valid) => {
this.form.equipId = _.last(this.form.equipIds);
if (valid) {
if (this.form.id != null) {
updateScrapRecord(this.form).then((response) => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addScrapRecord(this.form).then((response) => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal
.confirm('是否确认删除设备报废记录编号为"' + ids + '"的数据项?')
.then(function () {
return delScrapRecord(ids);
})
.then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
})
.catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"scrap/record/export",
{
...this.queryParams,
},
`设备报废记录_${new Date().getTime()}.xlsx`
);
},
},
};
</script>

View File

@ -325,7 +325,7 @@
>
<el-row>
<el-col :span="12"> <el-form-item
label="设备id"
label="保养设备"
prop="equipIds"
>
<el-cascader
@ -868,7 +868,7 @@
</el-dialog>
</div>
</template>
<script>
import {
listPlan,
@ -1383,4 +1383,3 @@ export default {
color: red;
}
</style>

View File

@ -227,7 +227,6 @@
type="text"
icon="el-icon-document"
@click="handleReport(scope.row)"
v-hasPermi="['upkeep:plan:edit']"
>详情</el-button>
<!-- <el-button
v-if="scope.row.status === '0'"
@ -454,7 +453,7 @@
</el-dialog>
</div>
</template>
<script>
import {
listPlan,
@ -464,7 +463,7 @@ import {
updatePlan,
finishPlan,
} from "@/api/upkeep/plan";
import { listRecord } from "@/api/upkeep/record";
import { listUpkeepRecord } from "@/api/upkeep/record";
import { listUser } from "@/api/system/user";
import { getInfoByParentId, getInfo } from "@/api/equip/equip";
import {
@ -720,7 +719,7 @@ export default {
/** 查询保养计划列表 */
getList() {
this.loading = true;
listRecord(this.queryParams).then((response) => {
listUpkeepRecord(this.queryParams).then((response) => {
this.recordList = response.rows;
this.total = response.total;
this.loading = false;
@ -874,4 +873,3 @@ export default {
color: red;
}
</style>