Compare commits
3 Commits
2ed6bcc144
...
aaf849013a
Author | SHA1 | Date | |
---|---|---|---|
aaf849013a | |||
161e94603d | |||
d798142638 |
@ -173,6 +173,9 @@ public interface ErrorCodeConstants {
|
||||
// ========== DNC管理 ==========
|
||||
ErrorCode DNC_PROGRAM_INFO_NOT_EXISTS = new ErrorCode(1_002_028_000, "未获取到DNC程序信息");
|
||||
|
||||
// ========== 维修管理 ==========、
|
||||
ErrorCode REMOTE_MAINTENANCE_ORDER_NOT_EXISTS = new ErrorCode(1_002_028_000, "未获取到维修工单信息");
|
||||
|
||||
// ========== 设备管理模块 ==========
|
||||
ErrorCode GATEWAY_INFO_NOT_EXISTS = new ErrorCode(1_002_029_000, "机床网关信息不存在");
|
||||
// ========== 报警管理模块 ==========
|
||||
|
@ -5,6 +5,7 @@ import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.module.system.controller.dnc.vo.DncProgramInfoPageReqVO;
|
||||
import com.inspur.module.system.controller.dnc.vo.DncProgramInfoRespVO;
|
||||
import com.inspur.module.system.controller.dnc.vo.DncProgramInfoSaveReqVO;
|
||||
import com.inspur.module.system.controller.dnc.vo.UpdateStatusVO;
|
||||
import com.inspur.module.system.controller.equip.vo.EquipSelectionVO;
|
||||
import com.inspur.module.system.dal.dataobject.dnc.DncProgramInfoDO;
|
||||
import com.inspur.module.system.service.dnc.DncProgramInfoService;
|
||||
@ -121,4 +122,11 @@ public class DncProgramInfoController {
|
||||
ExcelUtils.write(response, "DNC程序信息.xls", "数据", DncProgramInfoRespVO.class, voList);
|
||||
}
|
||||
|
||||
@PostMapping("/updateStatus")
|
||||
@Operation(summary = "修改DNC程序信息状态")
|
||||
@PreAuthorize("@ss.hasPermission('imt:dnc-program-info:update')")
|
||||
public Boolean updateStatus(@RequestBody UpdateStatusVO vo){
|
||||
return dncProgramInfoService.updateStatus(vo);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.inspur.module.system.controller.dnc.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @Author xusd
|
||||
* @Date 2024/9/4 17:13
|
||||
**/
|
||||
@Data
|
||||
public class UpdateStatusVO {
|
||||
|
||||
@Schema(description = "dnc程序id")
|
||||
private String dncProgramId;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
}
|
@ -2,10 +2,7 @@ package com.inspur.module.system.controller.equip;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentInfoPageReqVO;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentInfoRespVO;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentInfoSaveReqVO;
|
||||
import com.inspur.module.system.controller.equip.vo.EquipSelectionVO;
|
||||
import com.inspur.module.system.controller.equip.vo.*;
|
||||
import com.inspur.module.system.dal.dataobject.equip.ComponentInfoDO;
|
||||
import com.inspur.module.system.service.equip.ComponentInfoService;
|
||||
import com.inspur.module.system.service.equip.EquipInfoService;
|
||||
@ -117,4 +114,11 @@ public class ComponentInfoController {
|
||||
ExcelUtils.write(response, "机床组件信息.xls", "数据", ComponentInfoRespVO.class,voList);
|
||||
}
|
||||
|
||||
@GetMapping("/selection")
|
||||
@Operation(summary = "机床组件信息下拉")
|
||||
@PreAuthorize("@ss.hasPermission('imt:component-info:query')")
|
||||
public List<ComponentSelectionVO> selection(){
|
||||
return componentInfoService.selection();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.inspur.module.system.controller.equip.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 机床组件下拉
|
||||
*
|
||||
* @Author xusd
|
||||
* @Date 2024/9/4 11:17
|
||||
**/
|
||||
@Data
|
||||
public class ComponentSelectionVO {
|
||||
|
||||
@Schema(description = "机床组件id")
|
||||
private String componentId;
|
||||
|
||||
@Schema(description = "机床组件名称")
|
||||
private String componentName;
|
||||
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package com.inspur.module.system.controller.maintenance;
|
||||
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderPageReqVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderRespVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO;
|
||||
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
|
||||
import com.inspur.module.system.service.maintenance.MaintenanceOrderService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import com.inspur.framework.common.pojo.PageParam;
|
||||
import com.inspur.framework.common.pojo.CommonResult;
|
||||
import com.inspur.framework.common.util.object.BeanUtils;
|
||||
import static com.inspur.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.inspur.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.inspur.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.inspur.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 远程维修工单")
|
||||
@RestController
|
||||
@RequestMapping("/admin-api/maintenance")
|
||||
@Validated
|
||||
public class MaintenanceOrderController {
|
||||
|
||||
@Resource
|
||||
private MaintenanceOrderService maintenanceOrderService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建远程维修工单")
|
||||
@PreAuthorize("@ss.hasPermission('imt:remote-maintenance-order:create')")
|
||||
public CommonResult<String> createRemoteMaintenanceOrder(@Valid @RequestBody MaintenanceOrderSaveReqVO createReqVO) {
|
||||
return success(maintenanceOrderService.createRemoteMaintenanceOrder(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新远程维修工单")
|
||||
@PreAuthorize("@ss.hasPermission('imt:remote-maintenance-order:update')")
|
||||
public CommonResult<Boolean> updateRemoteMaintenanceOrder(@Valid @RequestBody MaintenanceOrderSaveReqVO updateReqVO) {
|
||||
maintenanceOrderService.updateRemoteMaintenanceOrder(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除远程维修工单")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('imt:remote-maintenance-order:delete')")
|
||||
public CommonResult<Boolean> deleteRemoteMaintenanceOrder(@RequestParam("id") String id) {
|
||||
maintenanceOrderService.deleteRemoteMaintenanceOrder(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得远程维修工单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('imt:remote-maintenance-order:query')")
|
||||
public CommonResult<MaintenanceOrderRespVO> getRemoteMaintenanceOrder(@RequestParam("id") String id) {
|
||||
MaintenanceOrderDO remoteMaintenanceOrder = maintenanceOrderService.getRemoteMaintenanceOrder(id);
|
||||
return success(BeanUtils.toBean(remoteMaintenanceOrder, MaintenanceOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得远程维修工单分页")
|
||||
@PreAuthorize("@ss.hasPermission('imt:remote-maintenance-order:query')")
|
||||
public CommonResult<PageResult<MaintenanceOrderRespVO>> getRemoteMaintenanceOrderPage(@Valid MaintenanceOrderPageReqVO pageReqVO) {
|
||||
PageResult<MaintenanceOrderDO> pageResult = maintenanceOrderService.getRemoteMaintenanceOrderPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, MaintenanceOrderRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出远程维修工单 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('imt:remote-maintenance-order:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportRemoteMaintenanceOrderExcel(@Valid MaintenanceOrderPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<MaintenanceOrderDO> list = maintenanceOrderService.getRemoteMaintenanceOrderPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "远程维修工单.xls", "数据", MaintenanceOrderRespVO.class,
|
||||
BeanUtils.toBean(list, MaintenanceOrderRespVO.class));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.inspur.module.system.controller.maintenance.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.inspur.framework.common.pojo.PageParam;
|
||||
|
||||
@Schema(description = "管理后台 - 远程维修工单分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class MaintenanceOrderPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "维修工单编号")
|
||||
private String maintenanceOrderNo;
|
||||
|
||||
@Schema(description = "机床设备id")
|
||||
private String equipId;
|
||||
|
||||
@Schema(description = "机床组件id")
|
||||
private String componentId;
|
||||
|
||||
@Schema(description = "机床客户id")
|
||||
private String customerId;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private String status;
|
||||
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.inspur.module.system.controller.maintenance.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import com.alibaba.excel.annotation.*;
|
||||
import com.inspur.framework.excel.core.annotations.DictFormat;
|
||||
import com.inspur.framework.excel.core.convert.DictConvert;
|
||||
|
||||
import static com.inspur.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
import static com.inspur.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
|
||||
|
||||
@Schema(description = "管理后台 - 远程维修工单 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class MaintenanceOrderRespVO {
|
||||
|
||||
@Schema(description = "维修工单id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String maintenanceOrderId;
|
||||
|
||||
@Schema(description = "维修工单编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("维修工单编号")
|
||||
private String maintenanceOrderNo;
|
||||
|
||||
@Schema(description = "本地诊断报告id")
|
||||
private String diagnoiseReportId;
|
||||
|
||||
@Schema(description = "机床设备id")
|
||||
private String equipId;
|
||||
|
||||
@ExcelProperty("机床设备")
|
||||
private String equipNo;
|
||||
|
||||
@Schema(description = "机床组件id")
|
||||
private String componentId;
|
||||
|
||||
@ExcelProperty("机床组件")
|
||||
private String componentName;
|
||||
|
||||
@Schema(description = "机床客户信息id")
|
||||
private String customerId;
|
||||
|
||||
@ExcelProperty("机床客户信息")
|
||||
private String customerName;
|
||||
|
||||
@Schema(description = "故障类型")
|
||||
@ExcelProperty(value = "故障类型", converter = DictConvert.class)
|
||||
@DictFormat("fault_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer faultType;
|
||||
|
||||
@Schema(description = "故障描述")
|
||||
@ExcelProperty("故障描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "优先级")
|
||||
@ExcelProperty(value = "优先级", converter = DictConvert.class)
|
||||
@DictFormat("maintenance_priority") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer priority;
|
||||
|
||||
@Schema(description = "完成时间")
|
||||
@ExcelProperty("完成时间")
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private Date completeTime;
|
||||
|
||||
@Schema(description = "状态")
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat("maintenance_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "维修人id")
|
||||
@ExcelProperty("维修人id")
|
||||
private Long executorId;
|
||||
|
||||
@ExcelProperty("维修人")
|
||||
private String executorName;
|
||||
|
||||
@Schema(description = "流程实例编号")
|
||||
@ExcelProperty("流程实例编号")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.inspur.module.system.controller.maintenance.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import static com.inspur.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
import static com.inspur.framework.common.util.date.DateUtils.TIME_ZONE_DEFAULT;
|
||||
|
||||
@Schema(description = "管理后台 - 远程维修工单新增/修改 Request VO")
|
||||
@Data
|
||||
public class MaintenanceOrderSaveReqVO {
|
||||
|
||||
@Schema(description = "维修工单id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String maintenanceOrderId;
|
||||
|
||||
@Schema(description = "维修工单编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String maintenanceOrderNo;
|
||||
|
||||
@Schema(description = "本地诊断报告id")
|
||||
private String diagnoiseReportId;
|
||||
|
||||
@Schema(description = "机床设备id")
|
||||
private String equipId;
|
||||
|
||||
@Schema(description = "机床组件id")
|
||||
private String componentId;
|
||||
|
||||
@Schema(description = "故障描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "优先级")
|
||||
private Integer priority;
|
||||
|
||||
@Schema(description = "完成时间")
|
||||
@JsonFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND, timezone = TIME_ZONE_DEFAULT)
|
||||
private Date completeTime;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "维修人id")
|
||||
private Long executorId;
|
||||
|
||||
@Schema(description = "流程实例编号")
|
||||
private String processInstanceId;
|
||||
|
||||
@Schema(description = "机床客户信息id")
|
||||
private String customerId;
|
||||
|
||||
@Schema(description = "故障类型")
|
||||
private Integer faultType;
|
||||
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
package com.inspur.module.system.dal.dataobject.maintenance;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.inspur.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 远程维修工单 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("imt_maintenance_order")
|
||||
@KeySequence("imt_maintenance_order_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class MaintenanceOrderDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 维修工单id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String maintenanceOrderId;
|
||||
/**
|
||||
* 维修工单编号
|
||||
*/
|
||||
private String maintenanceOrderNo;
|
||||
/**
|
||||
* 诊断报告id
|
||||
*/
|
||||
private String diagnoiseReportId;
|
||||
/**
|
||||
* 机床设备id
|
||||
*/
|
||||
private String equipId;
|
||||
/**
|
||||
* 机床组件id
|
||||
*/
|
||||
private String componentId;
|
||||
/**
|
||||
* 故障描述
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 优先级
|
||||
*
|
||||
*/
|
||||
private Integer priority;
|
||||
/**
|
||||
* 完成时间
|
||||
*/
|
||||
private Date completeTime;
|
||||
/**
|
||||
* 状态
|
||||
*
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 维修人id
|
||||
*/
|
||||
private Long executorId;
|
||||
/**
|
||||
* 流程实例编号
|
||||
*/
|
||||
private String processInstanceId;
|
||||
/**
|
||||
* 机床客户信息id
|
||||
*/
|
||||
private String customerId;
|
||||
/**
|
||||
* 故障类型
|
||||
*/
|
||||
private Integer faultType;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String equipNo;
|
||||
@TableField(exist = false)
|
||||
private String componentName;
|
||||
@TableField(exist = false)
|
||||
private String customerName;
|
||||
@TableField(exist = false)
|
||||
private String executorName;
|
||||
}
|
@ -1,12 +1,16 @@
|
||||
package com.inspur.module.system.dal.mysql.equip;
|
||||
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.framework.common.util.object.BeanUtils;
|
||||
import com.inspur.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.inspur.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentInfoPageReqVO;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentSelectionVO;
|
||||
import com.inspur.module.system.dal.dataobject.equip.ComponentInfoDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机床组件信息 Mapper
|
||||
*
|
||||
@ -25,4 +29,8 @@ public interface ComponentInfoMapper extends BaseMapperX<ComponentInfoDO> {
|
||||
.orderByDesc(ComponentInfoDO::getCreateTime));
|
||||
}
|
||||
|
||||
default List<ComponentSelectionVO> selection(){
|
||||
List<ComponentInfoDO> componentInfoDOS = selectList();
|
||||
return BeanUtils.toBean(componentInfoDOS, ComponentSelectionVO.class);
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.inspur.module.system.dal.mysql.maintenance;
|
||||
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.inspur.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderPageReqVO;
|
||||
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 远程维修工单 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaintenanceOrderMapper extends BaseMapperX<MaintenanceOrderDO> {
|
||||
|
||||
default PageResult<MaintenanceOrderDO> selectPage(MaintenanceOrderPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<MaintenanceOrderDO>()
|
||||
.likeIfPresent(MaintenanceOrderDO::getMaintenanceOrderNo, reqVO.getMaintenanceOrderNo())
|
||||
.eqIfPresent(MaintenanceOrderDO::getEquipId, reqVO.getEquipId())
|
||||
.eqIfPresent(MaintenanceOrderDO::getComponentId, reqVO.getComponentId())
|
||||
.eqIfPresent(MaintenanceOrderDO::getCustomerId, reqVO.getCustomerId())
|
||||
.eqIfPresent(MaintenanceOrderDO::getStatus, reqVO.getStatus())
|
||||
.orderByDesc(MaintenanceOrderDO::getCreateTime));
|
||||
}
|
||||
|
||||
}
|
@ -3,6 +3,7 @@ package com.inspur.module.system.service.dnc;
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.module.system.controller.dnc.vo.DncProgramInfoPageReqVO;
|
||||
import com.inspur.module.system.controller.dnc.vo.DncProgramInfoSaveReqVO;
|
||||
import com.inspur.module.system.controller.dnc.vo.UpdateStatusVO;
|
||||
import com.inspur.module.system.dal.dataobject.dnc.DncProgramInfoDO;
|
||||
|
||||
import javax.validation.*;
|
||||
@ -52,4 +53,13 @@ public interface DncProgramInfoService {
|
||||
*/
|
||||
PageResult<DncProgramInfoDO> getDncProgramInfoPage(DncProgramInfoPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 修改DNC程序信息状态
|
||||
*
|
||||
* @Author xusd
|
||||
* @Date 17:31 2024/9/4
|
||||
* @param vo
|
||||
* @return java.lang.Boolean
|
||||
*/
|
||||
Boolean updateStatus(UpdateStatusVO vo);
|
||||
}
|
@ -1,8 +1,10 @@
|
||||
package com.inspur.module.system.service.dnc;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.module.system.controller.dnc.vo.DncProgramInfoPageReqVO;
|
||||
import com.inspur.module.system.controller.dnc.vo.DncProgramInfoSaveReqVO;
|
||||
import com.inspur.module.system.controller.dnc.vo.UpdateStatusVO;
|
||||
import com.inspur.module.system.dal.dataobject.dnc.DncProgramInfoDO;
|
||||
import com.inspur.module.system.dal.mysql.dnc.DncProgramInfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -29,6 +31,7 @@ public class DncProgramInfoServiceImpl implements DncProgramInfoService {
|
||||
public String createDncProgramInfo(DncProgramInfoSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DncProgramInfoDO dncProgramInfo = BeanUtils.toBean(createReqVO, DncProgramInfoDO.class);
|
||||
dncProgramInfo.setStatus(1);
|
||||
dncProgramInfoMapper.insert(dncProgramInfo);
|
||||
// 返回
|
||||
return dncProgramInfo.getDncProgramId();
|
||||
@ -67,4 +70,11 @@ public class DncProgramInfoServiceImpl implements DncProgramInfoService {
|
||||
return dncProgramInfoMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateStatus(UpdateStatusVO vo) {
|
||||
LambdaUpdateWrapper<DncProgramInfoDO> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
updateWrapper.set(DncProgramInfoDO::getStatus, vo.getStatus());
|
||||
updateWrapper.eq(DncProgramInfoDO::getDncProgramId, vo.getDncProgramId());
|
||||
return dncProgramInfoMapper.update(updateWrapper) > 0;
|
||||
}
|
||||
}
|
@ -3,9 +3,11 @@ package com.inspur.module.system.service.equip;
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentInfoPageReqVO;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentInfoSaveReqVO;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentSelectionVO;
|
||||
import com.inspur.module.system.dal.dataobject.equip.ComponentInfoDO;
|
||||
|
||||
import javax.validation.*;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 机床组件信息 Service 接口
|
||||
@ -52,4 +54,12 @@ public interface ComponentInfoService {
|
||||
*/
|
||||
PageResult<ComponentInfoDO> getComponentInfoPage(ComponentInfoPageReqVO pageReqVO);
|
||||
|
||||
/**
|
||||
* 机床组件信息下拉
|
||||
*
|
||||
* @Author xusd
|
||||
* @Date 11:20 2024/9/4
|
||||
* @return java.util.List<com.inspur.module.system.controller.equip.vo.ComponentSelectionVO>
|
||||
*/
|
||||
List<ComponentSelectionVO> selection();
|
||||
}
|
@ -3,6 +3,7 @@ package com.inspur.module.system.service.equip;
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentInfoPageReqVO;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentInfoSaveReqVO;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentSelectionVO;
|
||||
import com.inspur.module.system.dal.dataobject.equip.ComponentInfoDO;
|
||||
import com.inspur.module.system.dal.mysql.equip.ComponentInfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
@ -10,6 +11,9 @@ import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.inspur.framework.common.util.object.BeanUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import static com.inspur.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.inspur.module.system.enums.ErrorCodeConstants.COMPONENT_INFO_NOT_EXISTS;
|
||||
|
||||
@ -67,4 +71,8 @@ public class ComponentInfoServiceImpl implements ComponentInfoService {
|
||||
return componentInfoMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ComponentSelectionVO> selection() {
|
||||
return componentInfoMapper.selection();
|
||||
}
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.inspur.module.system.service.maintenance;
|
||||
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderPageReqVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO;
|
||||
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
|
||||
|
||||
import javax.validation.*;
|
||||
|
||||
/**
|
||||
* 远程维修工单 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface MaintenanceOrderService {
|
||||
|
||||
/**
|
||||
* 创建远程维修工单
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
String createRemoteMaintenanceOrder(@Valid MaintenanceOrderSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新远程维修工单
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateRemoteMaintenanceOrder(@Valid MaintenanceOrderSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除远程维修工单
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteRemoteMaintenanceOrder(String id);
|
||||
|
||||
/**
|
||||
* 获得远程维修工单
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 远程维修工单
|
||||
*/
|
||||
MaintenanceOrderDO getRemoteMaintenanceOrder(String id);
|
||||
|
||||
/**
|
||||
* 获得远程维修工单分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 远程维修工单分页
|
||||
*/
|
||||
PageResult<MaintenanceOrderDO> getRemoteMaintenanceOrderPage(MaintenanceOrderPageReqVO pageReqVO);
|
||||
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
package com.inspur.module.system.service.maintenance;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import com.inspur.framework.common.enums.CommonStatusEnum;
|
||||
import com.inspur.framework.common.pojo.PageResult;
|
||||
import com.inspur.module.system.controller.baseData.vo.CustomerInfoSelectionVO;
|
||||
import com.inspur.module.system.controller.equip.vo.ComponentSelectionVO;
|
||||
import com.inspur.module.system.controller.equip.vo.EquipSelectionVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderPageReqVO;
|
||||
import com.inspur.module.system.controller.maintenance.vo.MaintenanceOrderSaveReqVO;
|
||||
import com.inspur.module.system.dal.dataobject.maintenance.MaintenanceOrderDO;
|
||||
import com.inspur.module.system.dal.dataobject.user.AdminUserDO;
|
||||
import com.inspur.module.system.dal.mysql.maintenance.MaintenanceOrderMapper;
|
||||
import com.inspur.module.system.service.baseData.CustomerInfoService;
|
||||
import com.inspur.module.system.service.equip.ComponentInfoService;
|
||||
import com.inspur.module.system.service.equip.EquipInfoService;
|
||||
import com.inspur.module.system.service.user.AdminUserService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.inspur.framework.common.util.object.BeanUtils;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.inspur.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.inspur.module.system.enums.ErrorCodeConstants.REMOTE_MAINTENANCE_ORDER_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 远程维修工单 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class MaintenanceOrderServiceImpl implements MaintenanceOrderService {
|
||||
|
||||
@Resource
|
||||
private MaintenanceOrderMapper maintenanceOrderMapper;
|
||||
|
||||
@Resource
|
||||
private EquipInfoService equipInfoService;
|
||||
|
||||
@Resource
|
||||
private ComponentInfoService componentInfoService;
|
||||
|
||||
@Resource
|
||||
private CustomerInfoService customerInfoService;
|
||||
|
||||
@Resource
|
||||
private AdminUserService userService;
|
||||
|
||||
@Override
|
||||
public String createRemoteMaintenanceOrder(MaintenanceOrderSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
MaintenanceOrderDO remoteMaintenanceOrder = BeanUtils.toBean(createReqVO, MaintenanceOrderDO.class);
|
||||
remoteMaintenanceOrder.setMaintenanceOrderNo("WXGD" + DateUtil.format(new Date(),"yyyyMMddHHmmss") + RandomUtil.randomInt(1, 10));
|
||||
maintenanceOrderMapper.insert(remoteMaintenanceOrder);
|
||||
// 返回
|
||||
return remoteMaintenanceOrder.getMaintenanceOrderId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRemoteMaintenanceOrder(MaintenanceOrderSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateRemoteMaintenanceOrderExists(updateReqVO.getMaintenanceOrderId());
|
||||
// 更新
|
||||
MaintenanceOrderDO updateObj = BeanUtils.toBean(updateReqVO, MaintenanceOrderDO.class);
|
||||
maintenanceOrderMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRemoteMaintenanceOrder(String id) {
|
||||
// 校验存在
|
||||
validateRemoteMaintenanceOrderExists(id);
|
||||
// 删除
|
||||
maintenanceOrderMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateRemoteMaintenanceOrderExists(String id) {
|
||||
if (maintenanceOrderMapper.selectById(id) == null) {
|
||||
throw exception(REMOTE_MAINTENANCE_ORDER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaintenanceOrderDO getRemoteMaintenanceOrder(String id) {
|
||||
return maintenanceOrderMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MaintenanceOrderDO> getRemoteMaintenanceOrderPage(MaintenanceOrderPageReqVO pageReqVO) {
|
||||
PageResult<MaintenanceOrderDO> page = maintenanceOrderMapper.selectPage(pageReqVO);
|
||||
List<MaintenanceOrderDO> list = page.getList();
|
||||
if (CollUtil.isNotEmpty(list)){
|
||||
List<EquipSelectionVO> equipList = equipInfoService.selection();
|
||||
Map<String, String> equipMap = equipList.stream().collect(Collectors.toMap(EquipSelectionVO::getEquipId, EquipSelectionVO::getEquipNo));
|
||||
List<ComponentSelectionVO> componentList = componentInfoService.selection();
|
||||
Map<String, String> componentMap = componentList.stream().collect(Collectors.toMap(ComponentSelectionVO::getComponentId, ComponentSelectionVO::getComponentName));
|
||||
List<CustomerInfoSelectionVO> customerList = customerInfoService.selection(true);
|
||||
Map<String, String> customerMap = customerList.stream().collect(Collectors.toMap(CustomerInfoSelectionVO::getCustomerId, CustomerInfoSelectionVO::getCustomerName));
|
||||
List<AdminUserDO> userList = userService.getUserListByStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||
Map<Long, String> userMap = userList.stream().collect(Collectors.toMap(AdminUserDO::getId, AdminUserDO::getNickname));
|
||||
list.forEach(item->{
|
||||
item.setEquipNo(equipMap.get(item.getEquipId()));
|
||||
item.setCustomerName(customerMap.get(item.getCustomerId()));
|
||||
item.setComponentName(componentMap.get(item.getComponentId()));
|
||||
item.setExecutorName(userMap.get(item.getExecutorId()));
|
||||
});
|
||||
}
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
}
|
@ -51,3 +51,12 @@ export function exportDncProgramInfoExcel(params) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改DNC程序信息状态
|
||||
export function updateStatus(data) {
|
||||
return request({
|
||||
url: '/dnc/dncProgramInfo/updateStatus',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
@ -51,3 +51,11 @@ export function exportComponentInfoExcel(params) {
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
||||
|
||||
// 机床组件下拉
|
||||
export function getComponentSelection() {
|
||||
return request({
|
||||
url: '/equip/component/selection',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
53
imt-ui/src/api/system/maintenance/maintenance.js
Normal file
53
imt-ui/src/api/system/maintenance/maintenance.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建远程维修工单
|
||||
export function createRemoteMaintenanceOrder(data) {
|
||||
return request({
|
||||
url: '/maintenance/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新远程维修工单
|
||||
export function updateRemoteMaintenanceOrder(data) {
|
||||
return request({
|
||||
url: '/maintenance/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除远程维修工单
|
||||
export function deleteRemoteMaintenanceOrder(id) {
|
||||
return request({
|
||||
url: '/maintenance/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得远程维修工单
|
||||
export function getRemoteMaintenanceOrder(id) {
|
||||
return request({
|
||||
url: '/maintenance/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得远程维修工单分页
|
||||
export function getRemoteMaintenanceOrderPage(params) {
|
||||
return request({
|
||||
url: '/maintenance/page',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
// 导出远程维修工单 Excel
|
||||
export function exportRemoteMaintenanceOrderExcel(params) {
|
||||
return request({
|
||||
url: '/maintenance/export-excel',
|
||||
method: 'get',
|
||||
params,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
@ -26,6 +26,9 @@ export const DICT_TYPE = {
|
||||
JUDGE_RULES: "judge_rules",
|
||||
EQU_ALARM_STATUS: "equip_alarm_status",
|
||||
TREND_ANALY_STATUS: "trend_analy_status",
|
||||
MAINTENANCE_STATUS: "maintenance_status",
|
||||
MAINTENANCE_PRIORITY: "maintenance_priority",
|
||||
FAULT_TYPE: "fault_type",
|
||||
// ========== SYSTEM 模块 ==========
|
||||
SYSTEM_USER_SEX: "system_user_sex",
|
||||
SYSTEM_MENU_TYPE: "system_menu_type",
|
||||
|
@ -17,17 +17,11 @@
|
||||
<el-form-item label="版本号" prop="version">
|
||||
<el-input v-model="formData.version" placeholder="请输入版本号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="formData.status" placeholder="请选择状态">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.COMMON_STATUS)"
|
||||
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="formData.remark" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="文件下载路径">
|
||||
<FileUpload v-model="formData.filePath" limit="1"/>
|
||||
<FileUpload v-model="formData.filePath" :limit="1"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
@ -125,12 +119,12 @@ export default {
|
||||
const res = await DncProgramInfoApi.getDncProgramInfo(id);
|
||||
this.formData = res.data;
|
||||
this.cascaderValue = this.changeDetSelect(this.formData.equipId,this.equipCascader);
|
||||
this.title = "修改DNC程序信息";
|
||||
this.dialogTitle = "修改DNC程序信息";
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
}
|
||||
this.title = "新增DNC程序信息";
|
||||
this.dialogTitle = "新增DNC程序信息";
|
||||
},
|
||||
/** 提交按钮 */
|
||||
async submitForm() {
|
||||
|
@ -48,7 +48,15 @@
|
||||
<el-table-column label="版本号" align="center" prop="version"/>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />
|
||||
<el-switch
|
||||
v-model="scope.row.status"
|
||||
active-color="#13ce66"
|
||||
inactive-color="#ff4949"
|
||||
:active-value="0"
|
||||
:inactive-value="1"
|
||||
active-text="开"
|
||||
inactive-text="关"
|
||||
@change="updateStatus(scope.row)"></el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark"/>
|
||||
@ -60,6 +68,9 @@
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['imt:dnc-program-info:delete']">删除
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-download" @click="handleDownload(scope.row)"
|
||||
v-hasPermi="['imt:dnc-program-info:query']">下载文件
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -75,6 +86,8 @@
|
||||
import * as DncProgramInfoApi from '@/api/system/dnc/dncProgramInfo';
|
||||
import DncProgramInfoForm from './DncProgramInfoForm.vue';
|
||||
import {getEquipCascader} from "@/api/system/equip/equipInfo";
|
||||
import item from "@/layout/components/Sidebar/Item.vue";
|
||||
import {updateStatus} from "@/api/system/dnc/dncProgramInfo";
|
||||
|
||||
export default {
|
||||
name: "DncProgramInfo",
|
||||
@ -118,6 +131,14 @@ export default {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
handleDownload(row){
|
||||
window.open(row.filePath)
|
||||
},
|
||||
updateStatus(value){
|
||||
updateStatus(value).then(res=>{
|
||||
this.getList();
|
||||
})
|
||||
},
|
||||
cascaderChange(value){
|
||||
if (value.length > 0){
|
||||
this.queryParams.equipId = value[1];
|
||||
@ -131,6 +152,10 @@ export default {
|
||||
this.loading = true;
|
||||
const res = await DncProgramInfoApi.getDncProgramInfoPage(this.queryParams);
|
||||
this.list = res.data.list;
|
||||
this.list.forEach(item=>{
|
||||
item.statusBoolean = item.status === 0;
|
||||
})
|
||||
console.log(this.list)
|
||||
this.total = res.data.total;
|
||||
} finally {
|
||||
this.loading = false;
|
||||
|
@ -0,0 +1,230 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="45%" v-dialogDrag append-to-body>
|
||||
<el-form ref="formRef" :model="formData" :rules="formRules" v-loading="formLoading" label-width="160px">
|
||||
<el-form-item label="维修工单编号" prop="maintenanceOrderNo" v-if="formData.maintenanceOrderId != null">
|
||||
<el-input v-model="formData.maintenanceOrderNo" :disabled="true" placeholder="请输入远程维修工单编号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="机床设备" prop="equipId">
|
||||
<el-cascader
|
||||
v-model="cascaderValue"
|
||||
:options="equipCascader"
|
||||
:props="{ value: 'id',label: 'name',children: 'children'}"
|
||||
clearable
|
||||
@change="cascaderChange"></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="机床组件" prop="componentId">
|
||||
<el-select v-model="formData.componentId" placeholder="请选择机床组件">
|
||||
<el-option v-for="item in componentSelection"
|
||||
:key="item.componentId" :label="item.componentName" :value="item.componentId"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="故障类型" prop="faultType">
|
||||
<el-select v-model="formData.faultType" placeholder="请选择故障类型">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.FAULT_TYPE)"
|
||||
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="故障描述" prop="description">
|
||||
<el-input v-model="formData.description" type="textarea" placeholder="请输入内容"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="优先级" prop="priority">
|
||||
<el-select v-model="formData.priority" placeholder="请选择优先级">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.MAINTENANCE_PRIORITY)"
|
||||
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="完成时间" prop="completeTime">
|
||||
<el-date-picker clearable v-model="formData.completeTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="选择完成时间"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="formData.status" placeholder="请选择状态">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.MAINTENANCE_STATUS)"
|
||||
:key="dict.value" :label="dict.label" :value="parseInt(dict.value)"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="维修人" prop="executorId">
|
||||
<el-select v-model="formData.executorId" placeholder="请选择维修人" filterable>
|
||||
<el-option v-for="item in userList"
|
||||
:key="item.id" :label="item.nickname" :value="item.id"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程实例编号" prop="processInstanceId">
|
||||
<el-input v-model="formData.processInstanceId" placeholder="请输入流程实例编号"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="机床客户信息" prop="customerId">
|
||||
<el-select v-model="formData.customerId" placeholder="请选择机床客户信息">
|
||||
<el-option v-for="item in customerSelection"
|
||||
:key="item.customerId" :label="item.customerName" :value="item.customerId"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm" :disabled="formLoading">确 定</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as RemoteMaintenanceOrderApi from '@/api/system/maintenance/maintenance';
|
||||
import {getEquipCascader} from "@/api/system/equip/equipInfo";
|
||||
import {getComponentSelection} from "@/api/system/equip/componentInfo";
|
||||
import {getCustomerSelection} from "@/api/system/baseData/customerInfo";
|
||||
import {listSimpleUsers} from "@/api/system/user";
|
||||
|
||||
|
||||
export default {
|
||||
name: "RemoteMaintenanceOrderForm",
|
||||
data() {
|
||||
return {
|
||||
userList:[],
|
||||
cascaderValue:[],
|
||||
equipCascader:[],
|
||||
componentSelection:[],
|
||||
customerSelection:[],
|
||||
// 弹出层标题
|
||||
dialogTitle: "",
|
||||
// 是否显示弹出层
|
||||
dialogVisible: false,
|
||||
// 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
|
||||
formLoading: false,
|
||||
// 表单参数
|
||||
formData: {
|
||||
maintenanceOrderNo: undefined,
|
||||
maintenanceOrderId: undefined,
|
||||
diagnoiseReportId: undefined,
|
||||
equipId: undefined,
|
||||
componentId: undefined,
|
||||
description: undefined,
|
||||
priority: undefined,
|
||||
completeTime: undefined,
|
||||
status: undefined,
|
||||
executorId: undefined,
|
||||
processInstanceId: undefined,
|
||||
customerId: undefined,
|
||||
faultType: undefined,
|
||||
},
|
||||
// 表单校验
|
||||
formRules: {
|
||||
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.initSelection();
|
||||
},
|
||||
methods: {
|
||||
//回显(多级)
|
||||
changeDetSelect(key, treeData) {
|
||||
let arr = []; // 在递归时操作的数组
|
||||
let returnArr = []; // 存放结果的数组
|
||||
let depth = 0; // 定义全局层级
|
||||
// 定义递归函数
|
||||
function childrenEach(childrenData, depthN) {
|
||||
for (var j = 0; j < childrenData.length; j++) {
|
||||
depth = depthN; // 将执行的层级赋值 到 全局层级
|
||||
arr[depthN] = childrenData[j].id;
|
||||
if (childrenData[j].id === key) {
|
||||
returnArr = arr.slice(0, depthN + 1); //将目前匹配的数组,截断并保存到结果数组,
|
||||
break;
|
||||
} else {
|
||||
if (childrenData[j].children) {
|
||||
depth++;
|
||||
childrenEach(childrenData[j].children, depth);
|
||||
}
|
||||
}
|
||||
}
|
||||
return returnArr;
|
||||
}
|
||||
return childrenEach(treeData, depth);
|
||||
},
|
||||
cascaderChange(value){
|
||||
if (value.length > 0){
|
||||
this.formData.equipId = value[1];
|
||||
}else {
|
||||
this.formData.equipId = null;
|
||||
}
|
||||
},
|
||||
initSelection(){
|
||||
getEquipCascader().then(res=>{
|
||||
this.equipCascader = res;
|
||||
});
|
||||
getComponentSelection().then(res=>{
|
||||
this.componentSelection = res;
|
||||
});
|
||||
getCustomerSelection().then(res=>{
|
||||
this.customerSelection = res;
|
||||
});
|
||||
listSimpleUsers().then(res=>{
|
||||
this.userList = res.data;
|
||||
})
|
||||
},
|
||||
/** 打开弹窗 */
|
||||
async open(id) {
|
||||
this.dialogVisible = true;
|
||||
this.reset();
|
||||
// 修改时,设置数据
|
||||
if (id) {
|
||||
this.formLoading = true;
|
||||
try {
|
||||
const res = await RemoteMaintenanceOrderApi.getRemoteMaintenanceOrder(id);
|
||||
this.formData = res.data;
|
||||
this.cascaderValue = this.changeDetSelect(this.formData.equipId,this.equipCascader);
|
||||
this.dialogTitle = "修改远程维修工单";
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
}
|
||||
this.dialogTitle = "新增远程维修工单";
|
||||
},
|
||||
/** 提交按钮 */
|
||||
async submitForm() {
|
||||
// 校验主表
|
||||
await this.$refs["formRef"].validate();
|
||||
this.formLoading = true;
|
||||
try {
|
||||
const data = this.formData;
|
||||
// 修改的提交
|
||||
if (data.maintenanceOrderId) {
|
||||
await RemoteMaintenanceOrderApi.updateRemoteMaintenanceOrder(data);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
await RemoteMaintenanceOrderApi.createRemoteMaintenanceOrder(data);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.dialogVisible = false;
|
||||
this.$emit('success');
|
||||
} finally {
|
||||
this.formLoading = false;
|
||||
}
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.formData = {
|
||||
maintenanceOrderNo: undefined,
|
||||
maintenanceOrderId: undefined,
|
||||
diagnoiseReportId: undefined,
|
||||
equipId: undefined,
|
||||
componentId: undefined,
|
||||
description: undefined,
|
||||
priority: undefined,
|
||||
completeTime: undefined,
|
||||
status: undefined,
|
||||
executorId: undefined,
|
||||
processInstanceId: undefined,
|
||||
customerId: undefined,
|
||||
faultType: undefined,
|
||||
};
|
||||
this.cascaderValue = [];
|
||||
this.resetForm("formRef");
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
227
imt-ui/src/views/system/maintenance/maintenanceInfo/index.vue
Normal file
227
imt-ui/src/views/system/maintenance/maintenanceInfo/index.vue
Normal file
@ -0,0 +1,227 @@
|
||||
<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="maintenanceOrderNo" label-width="100px">
|
||||
<el-input v-model="queryParams.maintenanceOrderNo" placeholder="请输入远程维修工单编号" clearable
|
||||
@keyup.enter.native="handleQuery"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="机床设备" prop="equipId">
|
||||
<el-cascader
|
||||
v-model="cascaderValue"
|
||||
:options="equipCascader"
|
||||
:props="{ value: 'id',label: 'name',children: 'children'}"
|
||||
clearable
|
||||
@change="cascaderChange"></el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="机床客户" prop="customerId">
|
||||
<el-select v-model="queryParams.customerId" placeholder="请选择机床客户" clearable size="small">
|
||||
<el-option v-for="item in customerSelection"
|
||||
:key="item.customerId" :label="item.customerName" :value="item.customerId"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="机床组件" prop="componentId">
|
||||
<el-select v-model="queryParams.componentId" placeholder="请选择机床组件" clearable size="small">
|
||||
<el-option v-for="item in componentSelection"
|
||||
:key="item.componentId" :label="item.componentName" :value="item.componentId"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable size="small">
|
||||
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.MAINTENANCE_STATUS)"
|
||||
:key="dict.value" :label="dict.label" :value="dict.value"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" @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="openForm(undefined)"
|
||||
v-hasPermi="['imt:remote-maintenance-order:create']">新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['imt:remote-maintenance-order:export']">导出
|
||||
</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
||||
<el-table-column label="维修工单编号" align="center" prop="maintenanceOrderNo"/>
|
||||
<el-table-column label="机床设备" align="center" prop="equipNo"/>
|
||||
<el-table-column label="机床组件" align="center" prop="componentName"/>
|
||||
<el-table-column label="机床客户" align="center" prop="customerName"/>
|
||||
<el-table-column label="故障类型" align="center" prop="faultType">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.FAULT_TYPE" :value="scope.row.faultType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="故障描述" align="center" prop="description"/>
|
||||
<el-table-column label="优先级" align="center" prop="priority">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.MAINTENANCE_PRIORITY" :value="scope.row.priority"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="完成时间" align="center" prop="completeTime" width="180">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.completeTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.MAINTENANCE_STATUS" :value="scope.row.status"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="维修人" align="center" prop="executorName"/>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template v-slot="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="openForm(scope.row.maintenanceOrderId)"
|
||||
v-hasPermi="['imt:remote-maintenance-order:update']">修改
|
||||
</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['imt:remote-maintenance-order:delete']">删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"/>
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<RemoteMaintenanceOrderForm ref="formRef" @success="getList"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as RemoteMaintenanceOrderApi from '@/api/system/maintenance/maintenance';
|
||||
import {getEquipCascader} from '@/api/system/equip/equipInfo'
|
||||
import {getComponentSelection} from '@/api/system/equip/componentInfo'
|
||||
import {getCustomerSelection} from '@/api/system/baseData/customerInfo'
|
||||
import RemoteMaintenanceOrderForm from './RemoteMaintenanceOrderForm.vue';
|
||||
|
||||
export default {
|
||||
name: "RemoteMaintenanceOrder",
|
||||
components: {
|
||||
RemoteMaintenanceOrderForm,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
cascaderValue:[],
|
||||
equipCascader:[],
|
||||
componentSelection:[],
|
||||
customerSelection:[],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 远程维修工单列表
|
||||
list: [],
|
||||
// 是否展开,默认全部展开
|
||||
isExpandAll: true,
|
||||
// 重新渲染表格状态
|
||||
refreshTable: true,
|
||||
// 选中行
|
||||
currentRow: {},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
maintenanceOrderNo: null,
|
||||
equipId: null,
|
||||
componentId: null,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.initSelection();
|
||||
},
|
||||
methods: {
|
||||
cascaderChange(value){
|
||||
if (value.length > 0){
|
||||
this.queryParams.equipId = value[1];
|
||||
}else {
|
||||
this.queryParams.equipId = null;
|
||||
}
|
||||
},
|
||||
initSelection(){
|
||||
getEquipCascader().then(res=>{
|
||||
this.equipCascader = res;
|
||||
});
|
||||
getComponentSelection().then(res=>{
|
||||
this.componentSelection = res;
|
||||
});
|
||||
getCustomerSelection().then(res=>{
|
||||
this.customerSelection = res;
|
||||
});
|
||||
},
|
||||
/** 查询列表 */
|
||||
async getList() {
|
||||
try {
|
||||
this.loading = true;
|
||||
const res = await RemoteMaintenanceOrderApi.getRemoteMaintenanceOrderPage(this.queryParams);
|
||||
this.list = res.data.list;
|
||||
this.total = res.data.total;
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.cascaderValue = [];
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.equipId = null;
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 添加/修改操作 */
|
||||
openForm(id) {
|
||||
this.$refs["formRef"].open(id);
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
async handleDelete(row) {
|
||||
const maintenanceOrderId = row.maintenanceOrderId;
|
||||
await this.$modal.confirm('是否确认删除远程维修工单编号为"' + row.maintenanceOrderNo + '"的数据项?')
|
||||
try {
|
||||
await RemoteMaintenanceOrderApi.deleteRemoteMaintenanceOrder(maintenanceOrderId);
|
||||
await this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
} catch {
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
async handleExport() {
|
||||
await this.$modal.confirm('是否确认导出所有远程维修工单数据项?');
|
||||
try {
|
||||
this.exportLoading = true;
|
||||
const data = await RemoteMaintenanceOrderApi.exportRemoteMaintenanceOrderExcel(this.queryParams);
|
||||
this.$download.excel(data, '远程维修工单.xls');
|
||||
} catch {
|
||||
} finally {
|
||||
this.exportLoading = false;
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user