| | |
| | | String PCR0001 = "PCR0001"; |
| | | //维修工 |
| | | String PCR0002 = "PCR0002"; |
| | | //çç»é¿ |
| | | //维修主任 |
| | | String PCR0003 = "PCR0003"; |
| | | //设å¤ç®¡çå |
| | | //车é´è®¾å¤ç®¡çå |
| | | String PCR0004 = "PCR0004"; |
| | | //设å¤è½æºé¨ |
| | | String PCR0005 = "PCR0005"; |
| | | //æºå¨å管çå |
| | | //æºå¨å |
| | | String PCR0006 = "PCR0006"; |
| | | //å¤ä»¶ç®¡çå |
| | | String PCR0007 = "PCR0007"; |
| | |
| | | public enum SecondMaintenanceStatusEnum { |
| | | WAIT_MAINTENANCE, //å¾
ä¿å
» |
| | | UNDER_MAINTENANCE, //ä¿å
»ä¸ |
| | | WAIT_CONFIRM, //å¾
确认 |
| | | WAIT_LEADER_CONFIRM, // å¾
é¢å¯¼ç¡®è®¤ |
| | | WAIT_CONFIRM, //å¾
车é´è®¾å¤ç®¡çå确认 |
| | | WAIT_LEADER_CONFIRM, // å¾
维修主任确认 |
| | | COMPLETE, //已宿 |
| | | ABOLISH, //å·²ä½åº |
| | | EXPIRED, //å·²è¿æ |
| | | ; |
| | | |
| | | public static SecondMaintenanceStatusEnum getInstance(String code) { |
| | |
| | | public enum ThirdMaintenanceStatusEnum { |
| | | WAIT_MAINTENANCE, //å¾
ä¿å
» |
| | | UNDER_MAINTENANCE, //ä¿å
»ä¸ |
| | | WAIT_CONFIRM, //å¾
管çå确认 |
| | | WAIT_LEADER_CONFIRM, // å¾
é¢å¯¼ç¡®è®¤ |
| | | WAIT_CONFIRM, //å¾
æºå¨å确认 |
| | | WAIT_LEADER_CONFIRM, // å¾
维修主任确认 |
| | | COMPLETE, //已宿 |
| | | ABOLISH, //å·²ä½åº |
| | | EXPIRED, //å·²è¿æ |
| | | ; |
| | | |
| | | public static ThirdMaintenanceStatusEnum getInstance(String code) { |
| | |
| | | */ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | | private java.lang.String id; |
| | | private String id; |
| | | /** |
| | | * å建人 |
| | | */ |
| | | @ApiModelProperty(value = "å建人") |
| | | @Dict(dicCode = "sys_user, realname, username") |
| | | private java.lang.String createBy; |
| | | private String createBy; |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss ") |
| | | private java.util.Date createTime; |
| | | private Date createTime; |
| | | /** |
| | | * æ´æ°äºº |
| | | */ |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | @Dict(dicCode = "sys_user, realname, username") |
| | | private java.lang.String updateBy; |
| | | private String updateBy; |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss ") |
| | | private java.util.Date updateTime; |
| | | private Date updateTime; |
| | | /** |
| | | * å 餿 è®° |
| | | */ |
| | | @ApiModelProperty(value = "å 餿 è®°") |
| | | private java.lang.Integer delFlag; |
| | | private Integer delFlag; |
| | | /** |
| | | * 设å¤ç»ä¸ç¼å· |
| | | */ |
| | | @Excel(name = "设å¤ç¼å·", width = 15, orderNum = "1") |
| | | @ApiModelProperty(value = "设å¤ç¼å·") |
| | | private java.lang.String equipmentCode; |
| | | private String equipmentCode; |
| | | /** |
| | | * 设å¤åç§° |
| | | */ |
| | | @Excel(name = "设å¤åç§°", width = 15, orderNum = "2") |
| | | @ApiModelProperty(value = "设å¤åç§°") |
| | | private java.lang.String equipmentName; |
| | | private String equipmentName; |
| | | /** |
| | | * 使ç¨é¨é¨ |
| | | */ |
| | | @Excel(name = "使ç¨è½¦é´", width = 25, dictTable = "mdc_production", dicText = "production_name", dicCode = "id", orderNum = "9") |
| | | @ApiModelProperty(value = "使ç¨é¨é¨") |
| | | @Dict(dicCode = "mdc_production, production_name, id") |
| | | private java.lang.String orgId; |
| | | private String orgId; |
| | | /** |
| | | * 设å¤ç®¡çå |
| | | */ |
| | | @Excel(name = "设å¤ç®¡çå", width = 35, dictTable = "sys_user", dicText = "realname", dicCode = "username", orderNum = "10") |
| | | @ApiModelProperty(value = "设å¤ç®¡çå") |
| | | @Dict(dicCode = "sys_user, realname, username") |
| | | private java.lang.String equipmentManager; |
| | | private String equipmentManager; |
| | | /** |
| | | * 设å¤ç±»å« |
| | | */ |
| | | @Excel(name = "设å¤ç±»å«", width = 15, dicCode = "equipment_category", orderNum = "5") |
| | | @ApiModelProperty(value = "设å¤ç±»å«") |
| | | @Dict(dicCode = "equipment_category") |
| | | private java.lang.String equipmentCategory; |
| | | private String equipmentCategory; |
| | | /** |
| | | * 设å¤åå· |
| | | */ |
| | | @Excel(name = "设å¤åå·", width = 15, orderNum = "3") |
| | | @ApiModelProperty(value = "设å¤åå·") |
| | | private java.lang.String equipmentModel; |
| | | private String equipmentModel; |
| | | /** |
| | | * 设å¤è§æ ¼ |
| | | */ |
| | | @Excel(name = "设å¤è§æ ¼", width = 15, orderNum = "4") |
| | | @ApiModelProperty(value = "设å¤è§æ ¼") |
| | | private java.lang.String equipmentSpecification; |
| | | private String equipmentSpecification; |
| | | |
| | | /** |
| | | * å®è£
ä½ç½® |
| | | */ |
| | | @Excel(name = "å®è£
ä½ç½®", width = 15, orderNum = "11") |
| | | @ApiModelProperty(value = "å®è£
ä½ç½®") |
| | | private java.lang.String installationPosition; |
| | | private String installationPosition; |
| | | /** |
| | | * èµäº§ä½¿ç¨ç¶æ |
| | | */ |
| | | @Excel(name = "èµäº§ä½¿ç¨ç¶æ", width = 15, dicCode = "asset_status", orderNum = "7") |
| | | @ApiModelProperty(value = "èµäº§ç¶æ") |
| | | @Dict(dicCode = "asset_status") |
| | | private java.lang.String assetStatus; |
| | | private String assetStatus; |
| | | /** |
| | | * åºåç¼å· |
| | | */ |
| | | @Excel(name = "åºåç¼å·", width = 15, orderNum = "12") |
| | | @ApiModelProperty(value = "åºåç¼å·") |
| | | private java.lang.String factoryNumber; |
| | | private String factoryNumber; |
| | | /** |
| | | * æºåºåå®¶ |
| | | */ |
| | | @Excel(name = "æºåºåå®¶", width = 15, orderNum = "13") |
| | | @ApiModelProperty(value = "æºåºåå®¶") |
| | | private java.lang.String manufacturingEnterprise; |
| | | private String manufacturingEnterprise; |
| | | /** |
| | | * æ¥æºå½å®¶ |
| | | */ |
| | | @Excel(name = "æ¥æºå½å®¶", width = 25, orderNum = "14") |
| | | @ApiModelProperty(value = "æ¥æºå½å®¶") |
| | | private java.lang.String originCountry; |
| | | private String originCountry; |
| | | /** |
| | | * 设å¤ä¾åºå |
| | | */ |
| | |
| | | @ApiModelProperty(value = "åºåæ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date leaveFactoryDate; |
| | | private Date leaveFactoryDate; |
| | | /** |
| | | * éªæ¶æ¥æ |
| | | */ |
| | |
| | | @ApiModelProperty(value = "éªæ¶æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date acceptanceCheckDate; |
| | | private Date acceptanceCheckDate; |
| | | /** |
| | | * 设å¤å¾ç |
| | | */ |
| | | @ApiModelProperty(value = "设å¤å¾ç") |
| | | private java.lang.String equipmentImage; |
| | | private String equipmentImage; |
| | | /** |
| | | * çµæºå°æ° |
| | | */ |
| | |
| | | */ |
| | | @Excel(name = "æ»åç(KW)", width = 15, orderNum = "19") |
| | | @ApiModelProperty(value = "æ»åç") |
| | | private java.lang.String equipmentPower; |
| | | private String equipmentPower; |
| | | /** |
| | | * éé(å¨) |
| | | */ |
| | | @Excel(name = "éé(å¨)", width = 15, orderNum = "20") |
| | | @ApiModelProperty(value = "éé(å¨)") |
| | | private java.lang.String equipmentWeight; |
| | | private String equipmentWeight; |
| | | /** |
| | | * æ¯å¦æå·¥èºåæ° |
| | | */ |
| | | @Excel(name = "ææ å·¥èºåæ°", width = 15, dicCode = "has_no", orderNum = "21") |
| | | @ApiModelProperty(value = "æ¯å¦æå·¥èºåæ°") |
| | | private java.lang.String processParametersFlag; |
| | | private String processParametersFlag; |
| | | /** |
| | | * æ¯å¦æç²¾åº¦åæ° |
| | | */ |
| | | @Excel(name = "ææ ç²¾åº¦åæ°", width = 15, dicCode = "has_no", orderNum = "22") |
| | | @ApiModelProperty(value = "æ¯å¦æç²¾åº¦åæ°") |
| | | private java.lang.String precisionParametersFlag; |
| | | private String precisionParametersFlag; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @Excel(name = "夿³¨", width = 50, orderNum = "99") |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private java.lang.String remark; |
| | | private String remark; |
| | | /** |
| | | * å¤å½¢å°ºå¯¸ |
| | | */ |
| | |
| | | @Excel(name = "管çåç±»", width = 15, dicCode = "equipment_abc_flag", orderNum = "8") |
| | | @ApiModelProperty(value = "管çåç±»") |
| | | @Dict(dicCode = "equipment_abc_flag") |
| | | private java.lang.String equipmentImportance; |
| | | private String equipmentImportance; |
| | | |
| | | /** |
| | | * ææ¯ç¶æ |
| | |
| | | @Excel(name = "ææ¯ç¶æ", width = 15, dicCode = "technology_status", orderNum = "7") |
| | | @ApiModelProperty(value = "ææ¯ç¶æ") |
| | | @Dict(dicCode = "technology_status") |
| | | private java.lang.String technologyStatus; |
| | | private String technologyStatus; |
| | | |
| | | /** |
| | | * 设å¤ç¨é |
| | | */ |
| | | @Excel(name = "设å¤ç¨é", width = 15, dicCode = "equipment_use", orderNum = "7") |
| | | @ApiModelProperty(value = "设å¤ç¨é") |
| | | @Dict(dicCode = "equipment_use") |
| | | private String equipmentUse; |
| | | |
| | | /** |
| | | * æä½å·¥ |
| | | */ |
| | | @Excel(name = "æä½å·¥", width = 15, orderNum = "28") |
| | | @ApiModelProperty(value = "æä½å·¥") |
| | | private String operator; |
| | | |
| | | /** =================== èªå®æç æªç¨çåæ®µ å¼å§ ==========================**/ |
| | | |
| | |
| | | * æä½ç³»ç» |
| | | */ |
| | | @ApiModelProperty(value = "æä½ç³»ç»") |
| | | private java.lang.String operationSystem; |
| | | private String operationSystem; |
| | | /** |
| | | * ä¸»è½´è¿æ¥å°ºå¯¸ |
| | | */ |
| | | @ApiModelProperty(value = "ä¸»è½´è¿æ¥å°ºå¯¸") |
| | | private java.lang.String spindleConnectDimension; |
| | | private String spindleConnectDimension; |
| | | /** |
| | | * ç«é¡¹å¡å· |
| | | */ |
| | | @ApiModelProperty(value = "ç«é¡¹å¡å·") |
| | | private java.lang.String cardNumber; |
| | | private String cardNumber; |
| | | /** |
| | | * æ¯å¦å®æ½MDC |
| | | */ |
| | | @ApiModelProperty(value = "æ¯å¦å®æ½MDC") |
| | | private java.lang.String mdcFlag; |
| | | private String mdcFlag; |
| | | |
| | | @ApiModelProperty(value = "MDC设å¤ç±»å") |
| | | private String deviceType; |
| | |
| | | * 设å¤ç«¯å£ |
| | | */ |
| | | @ApiModelProperty(value = "设å¤ç«¯å£") |
| | | private java.lang.String equipmentPort; |
| | | private String equipmentPort; |
| | | /** |
| | | * åæ æ°é |
| | | */ |
| | | @ApiModelProperty(value = "åæ æ°é") |
| | | private java.lang.Integer coordinateNum; |
| | | private Integer coordinateNum; |
| | | /** |
| | | * ç¹ç§è®¾å¤;æ¯å¦ä¸ºç¹ç§è®¾å¤ |
| | | */ |
| | | @ApiModelProperty(value = "æ¯å¦ç¹ç§è®¾å¤") |
| | | private java.lang.String specialEquipment; |
| | | private String specialEquipment; |
| | | |
| | | |
| | | |
| | |
| | | @ApiModelProperty(value = "è´¨ä¿å¼å§æ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date warrantyStartDate; |
| | | private Date warrantyStartDate; |
| | | /** |
| | | * è´¨ä¿ç»ææ¥æ |
| | | */ |
| | | @ApiModelProperty(value = "è´¨ä¿ç»ææ¥æ") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private java.util.Date warrantyEndDate; |
| | | private Date warrantyEndDate; |
| | | |
| | | /** =================== èªå®æç æªç¨çåæ®µ ç»æ ==========================**/ |
| | | |
| | |
| | | /**主é®*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | | private java.lang.String id; |
| | | private String id; |
| | | /**å建人*/ |
| | | @ApiModelProperty(value = "å建人") |
| | | private java.lang.String createBy; |
| | | private String createBy; |
| | | /**å建æ¶é´*/ |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private java.util.Date createTime; |
| | | /**æ´æ°äºº*/ |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private java.lang.String updateBy; |
| | | private String updateBy; |
| | | /**æ´æ°æ¶é´*/ |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | private java.util.Date updateTime; |
| | | /**ä¿å
»ç¶æ*/ |
| | | @Excel(name = "ä¿å
»ç¶æ", width = 15) |
| | | @ApiModelProperty(value = "ä¿å
»ç¶æ") |
| | | private java.lang.String maintenanceStatus; |
| | | private String maintenanceStatus; |
| | | /**ç»´ä¿®ç¶æ*/ |
| | | @Excel(name = "ç»´ä¿®ç¶æ", width = 15) |
| | | @ApiModelProperty(value = "ç»´ä¿®ç¶æ") |
| | | private java.lang.String repairStatus; |
| | | private String repairStatus; |
| | | /**ææ°äºä¿æ¥æ*/ |
| | | @ApiModelProperty(value = "ææ°äºä¿æ¥æ") |
| | | private java.util.Date latestSecondMaintenance; |
| | |
| | | /**主é®*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | | private java.lang.String id; |
| | | private String id; |
| | | /**å建人*/ |
| | | @Excel(name = "å建人", width = 15) |
| | | @ApiModelProperty(value = "å建人") |
| | | private java.lang.String createBy; |
| | | private String createBy; |
| | | /**å建æ¶é´*/ |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | /**设å¤ID*/ |
| | | @Excel(name = "设å¤ID", width = 15) |
| | | @ApiModelProperty(value = "设å¤ID") |
| | | private java.lang.String equipmentId; |
| | | private String equipmentId; |
| | | /**æä½æ ç¾*/ |
| | | @Excel(name = "æä½æ ç¾", width = 15) |
| | | @ApiModelProperty(value = "æä½æ ç¾") |
| | | @Dict(dicCode = "equipment_operation_tag") |
| | | private java.lang.String operationTag; |
| | | private String operationTag; |
| | | /**æä½äºº*/ |
| | | @Excel(name = "æä½äºº", width = 15) |
| | | @ApiModelProperty(value = "æä½äºº") |
| | | @Dict(dicCode = "sys_user, realname, username") |
| | | private java.lang.String operator; |
| | | private String operator; |
| | | /**æä½æè¿°*/ |
| | | @Excel(name = "æä½æè¿°", width = 15) |
| | | @ApiModelProperty(value = "æä½æè¿°") |
| | | private java.lang.String description; |
| | | private String description; |
| | | /**ä¸å¡ä¸»è¡¨*/ |
| | | @Excel(name = "ä¸å¡ä¸»è¡¨", width = 15) |
| | | @ApiModelProperty(value = "ä¸å¡ä¸»è¡¨") |
| | | private java.lang.String businessTable; |
| | | private String businessTable; |
| | | /**ä¸å¡id*/ |
| | | @Excel(name = "ä¸å¡id", width = 15) |
| | | @ApiModelProperty(value = "ä¸å¡id") |
| | | private java.lang.String businessId; |
| | | private String businessId; |
| | | } |
| | |
| | | private String operationSystem; |
| | | private String orgId; |
| | | private String equipmentCategory; |
| | | private String manufacturingEnterprise; |
| | | private String originalValue; |
| | | private String performanceIndicators; |
| | | private String leaveFactoryStartTime; |
| | | private String leaveFactoryEndTime; |
| | | private String acceptanceCheckStartTime; |
| | | private String acceptanceCheckEndTime; |
| | | private String equipmentUse; |
| | | |
| | | private String column; |
| | | private String order; |
| | |
| | | if (StringUtils.isNotBlank(eamEquipment.getOperationSystem())) { |
| | | queryWrapper.like("e.operation_system", eamEquipment.getOperationSystem()); |
| | | } |
| | | if (StringUtils.isNotBlank(eamEquipment.getManufacturingEnterprise())) { |
| | | queryWrapper.like("e.manufacturing_enterprise", eamEquipment.getManufacturingEnterprise()); |
| | | } |
| | | if (StringUtils.isNotBlank(eamEquipment.getOriginalValue())) { |
| | | queryWrapper.like("e.original_value", eamEquipment.getOriginalValue()); |
| | | } |
| | | if (StringUtils.isNotBlank(eamEquipment.getPerformanceIndicators())) { |
| | | queryWrapper.like("e.performance_indicators", eamEquipment.getPerformanceIndicators()); |
| | | } |
| | | if(oConvertUtils.isNotEmpty(eamEquipment.getLeaveFactoryStartTime()) && oConvertUtils.isNotEmpty(eamEquipment.getLeaveFactoryEndTime())){ |
| | | queryWrapper.ge("e.leave_factory_date",eamEquipment.getLeaveFactoryStartTime()); |
| | | queryWrapper.le("e.leave_factory_date",eamEquipment.getLeaveFactoryEndTime()); |
| | | } |
| | | if(oConvertUtils.isNotEmpty(eamEquipment.getAcceptanceCheckStartTime()) && oConvertUtils.isNotEmpty(eamEquipment.getAcceptanceCheckEndTime())){ |
| | | queryWrapper.ge("e.acceptance_check_date",eamEquipment.getAcceptanceCheckStartTime()); |
| | | queryWrapper.le("e.acceptance_check_date",eamEquipment.getAcceptanceCheckEndTime()); |
| | | } |
| | | if (StringUtils.isNotBlank(eamEquipment.getOrgId())) { |
| | | //车é´ç¼ç ä¸ä¸ºç©º |
| | | List<String> productIds = mdcProductionService.recursionChildren(eamEquipment.getOrgId()); |
| | |
| | | } |
| | | if (StringUtils.isNotBlank(eamEquipment.getEquipmentCategory())) { |
| | | queryWrapper.like("e.equipment_category", eamEquipment.getEquipmentCategory()); |
| | | } |
| | | if (StringUtils.isNotBlank(eamEquipment.getEquipmentUse())) { |
| | | queryWrapper.like("e.equipment_use", eamEquipment.getEquipmentUse()); |
| | | } |
| | | if (StringUtils.isNotBlank(eamEquipment.getId())) { |
| | | queryWrapper.eq("e.id", eamEquipment.getId()); |
| | |
| | | if (DataBaseConstant.SQL_ASC.equalsIgnoreCase(eamEquipment.getOrder())) { |
| | | queryWrapper.orderByAsc("e." + oConvertUtils.camelToUnderline(column)); |
| | | } else { |
| | | queryWrapper.orderByDesc("e." + oConvertUtils.camelToUnderline(column)); |
| | | queryWrapper.orderByAsc("e." + oConvertUtils.camelToUnderline(column)); |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc("e.create_time"); |
| | | queryWrapper.orderByAsc("e.equipment_code"); |
| | | } |
| | | } else { |
| | | queryWrapper.orderByDesc("e.create_time"); |
| | | queryWrapper.orderByAsc("e.equipment_code"); |
| | | } |
| | | |
| | | IPage<EamEquipment> ipage = eamEquipmentMapper.queryPageList(page, queryWrapper); |
| | |
| | | eamRepairOrder.setRepairStatus(ReportRepairEnum.WAIT_INTERNAL_CONFIRM.name()); |
| | | eamRepairOrder.setActualStartTime(DateUtils.getNow()); |
| | | eamRepairOrder.setRepairer(eamReportRepairQuery.getRepairer()); |
| | | eamRepairOrder.setReportId(eamReportRepairQuery.getId()); |
| | | super.save(eamRepairOrder); |
| | | EamEquipment eamEquipment = eamEquipmentService.getById(eamReportRepair.getEquipmentId()); |
| | | // å¯å¨ç»´ä¿®æµç¨ |
| | |
| | | //æäº¤æºå¨åç»´ä¿®ï¼è½¦é´ç®¡çå确认 |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0003); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»çç»é¿ï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»ç»´ä¿®ä¸»ä»»ï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | | userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | | values.put("NextAssignee", userApprovalList); |
| | |
| | | } |
| | | |
| | | /** |
| | | * å½è¿ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "设å¤ååºå½è¿-å½è¿") |
| | | @ApiOperation(value = "设å¤ååºå½è¿-å½è¿", notes = "设å¤ååºå½è¿-å½è¿") |
| | | @GetMapping(value = "/equipmentReturn") |
| | | public Result<?> equipmentReturn(@RequestParam(name = "id", required = true) String id) { |
| | | boolean b = eamEquipmentLeanOutService.equipmentReturn(id); |
| | | if (!b) { |
| | | return Result.error("æä½å¤±è´¥ï¼"); |
| | | } |
| | | return Result.OK("æä½æå!"); |
| | | } |
| | | |
| | | /** |
| | | * å®¡æ¹ |
| | | * |
| | | * @param request |
| | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.exception.ExceptionCast; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.jeecg.common.util.FileUtil; |
| | |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import org.jeecg.modules.eam.entity.EamMaintenanceStandard; |
| | | import org.jeecg.modules.eam.entity.EamMaintenanceStandardDetail; |
| | | import org.jeecg.modules.eam.entity.EamSysFiles; |
| | | import org.jeecg.modules.eam.request.EamMaintenanceStandardRequest; |
| | | import org.jeecg.modules.eam.service.IEamEquipmentService; |
| | | import org.jeecg.modules.eam.service.IEamMaintenanceStandardService; |
| | |
| | | public Result<?> queryPageList(EamMaintenanceStandard eamMaintenanceStandard, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | HttpServletRequest req) throws JsonProcessingException { |
| | | // QueryWrapper<EamMaintenanceStandard> queryWrapper = QueryGenerator.initQueryWrapper(eamMaintenanceStandard, req.getParameterMap()); |
| | | Page<EamMaintenanceStandard> page = new Page<EamMaintenanceStandard>(pageNo, pageSize); |
| | | IPage<EamMaintenanceStandard> pageList = eamMaintenanceStandardService.queryPageList(page, eamMaintenanceStandard); |
| | | for (EamMaintenanceStandard record : pageList.getRecords()) { |
| | | String json = record.getReferenceFile(); |
| | | if(StringUtils.isNotBlank(json)){ |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | Map<String, Object> map = mapper.readValue(json, Map.class); |
| | | String fileName = (String) map.get("fileName"); |
| | | record.setFileName(fileName); |
| | | } |
| | | } |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | |
| | | log.error("读åExcelä¿¡æ¯å¤±è´¥ï¼{}", e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | @GetMapping("/downloadFile") |
| | | public void downloadFile(@RequestParam("id") String id, HttpServletResponse response) throws JsonProcessingException { |
| | | |
| | | eamMaintenanceStandardService.downloadFile(response, eamMaintenanceStandardService.getById(id)); |
| | | } |
| | | } |
| | |
| | | public Result<?> abolishBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | List<EamReportRepair> eamReportRepairs = eamReportRepairService.listByIds(Arrays.asList(ids.split(","))); |
| | | eamReportRepairs.forEach(eamReportRepair -> { |
| | | if(ReportRepairEnum.ABOLISH.name().equals(eamReportRepair.getReportStatus())) { |
| | | if(ReportRepairEnum.WAIT_REPAIR.name().equals(eamReportRepair.getReportStatus())) { |
| | | eamReportRepair.setReportStatus(ReportRepairEnum.ABOLISH.name()); |
| | | } |
| | | }); |
| | |
| | | QueryWrapper<EamSparePartInventory> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("spare_part_id",record.getId()).select("sum(inventory) as inventory"); |
| | | EamSparePartInventory one = eamSparePartInventoryService.getOne(wrapper); |
| | | if(one == null){ |
| | | record.setTotalQuantity("0"); |
| | | }else{ |
| | | record.setTotalQuantity(one.getInventory().toString()); |
| | | } |
| | | } |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å¨ä¿å·¥å-æ¹éä½åº") |
| | | @ApiOperation(value = "å¨ä¿å·¥å-æ¹éä½åº", notes = "å¨ä¿å·¥å-æ¹éä½åº") |
| | | @AutoLog(value = "ä¸ä¿å·¥å-æ¹éä½åº") |
| | | @ApiOperation(value = "ä¸ä¿å·¥å-æ¹éä½åº", notes = "ä¸ä¿å·¥å-æ¹éä½åº") |
| | | @DeleteMapping(value = "/abolishBatch") |
| | | public Result<?> abolishBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å¨ä¿å·¥å-æ¹éé¢å") |
| | | @ApiOperation(value = "å¨ä¿å·¥å-æ¹éé¢å", notes = "å¨ä¿å·¥å-æ¹éé¢å") |
| | | @AutoLog(value = "ä¸ä¿å·¥å-æ¹éé¢å") |
| | | @ApiOperation(value = "ä¸ä¿å·¥å-æ¹éé¢å", notes = "ä¸ä¿å·¥å-æ¹éé¢å") |
| | | @DeleteMapping(value = "/collectBatch") |
| | | public Result<?> collectBatch(@RequestParam(name = "ids", required = true) String ids) { |
| | | List<String> list = Arrays.asList(ids.split(",")); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.modules.eam.service.IEquipmentHomeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "设å¤ç®¡çé¦é¡µæ¥å£") |
| | | @RestController |
| | | @RequestMapping("/equipment/home") |
| | | public class EquipmentHomeController { |
| | | |
| | | @Autowired |
| | | private IEquipmentHomeService equipmentHomeService; |
| | | |
| | | /** |
| | | *é¦é¡µ ææ¯ç¶ææ°éç»è®¡ |
| | | */ |
| | | @ApiOperation(value = "é¦é¡µ ææ¯ç¶ææ°éç»è®¡", notes = "é¦é¡µ ææ¯ç¶ææ°éç»è®¡") |
| | | @GetMapping("getEquipmentTechnologyStatusList") |
| | | public Result<?> getFactoryEquipmentTechnologyStatusList() { |
| | | List<Map<String, Object>> list = equipmentHomeService.getEquipmentTechnologyStatusList(); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *é¦é¡µ è®¾å¤æ¥ä¿®æ
åµç»è®¡ |
| | | */ |
| | | @ApiOperation(value = "é¦é¡µ è®¾å¤æ¥ä¿®æ
åµç»è®¡", notes = "é¦é¡µ è®¾å¤æ¥ä¿®æ
åµç»è®¡") |
| | | @GetMapping("getReportRepairEquipmentList") |
| | | public Result<?> getFactoryReportRepairEquipmentList() { |
| | | List<Map<String, Object>> list = equipmentHomeService.getReportRepairEquipmentList(); |
| | | return Result.ok(list); |
| | | } |
| | | |
| | | /** |
| | | *é¦é¡µ ä¸ä¿è®¡å |
| | | */ |
| | | @ApiOperation(value = "é¦é¡µ ä¸ä¿è®¡å", notes = "é¦é¡µ ä¸ä¿è®¡å") |
| | | @GetMapping("getThirdGuaranteesPlan") |
| | | public Result<?> getThirdGuaranteesPlan() { |
| | | Map<String, Object> map = equipmentHomeService.getThirdGuaranteesPlan(); |
| | | return Result.ok(map); |
| | | } |
| | | |
| | | /** |
| | | *é¦é¡µ äºä¿è®¡å |
| | | */ |
| | | @ApiOperation(value = "é¦é¡µ äºä¿è®¡å", notes = "é¦é¡µ äºä¿è®¡å") |
| | | @GetMapping("getSecondGuaranteesPlan") |
| | | public Result<?> getSecondGuaranteesPlan() { |
| | | Map<String, Object> map = equipmentHomeService.getSecondGuaranteesPlan(); |
| | | return Result.ok(map); |
| | | } |
| | | } |
| | |
| | | @Excel(name = "油液ID", width = 15) |
| | | @ApiModelProperty(value = "油液ID") |
| | | private String fluidId; |
| | | /**ä½¿ç¨æ°é*/ |
| | | @Excel(name = "ä½¿ç¨æ°é", width = 15) |
| | | @ApiModelProperty(value = "ä½¿ç¨æ°é") |
| | | private Integer usageQuantity; |
| | | /**å å
¥é¨ä½*/ |
| | | @Excel(name = "å å
¥é¨ä½", width = 15) |
| | | @ApiModelProperty(value = "å å
¥é¨ä½") |
| | | private String additionSite; |
| | | /**æ¶é´*/ |
| | | @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @Excel(name = "æ¶é´", width = 15) |
| | | @ApiModelProperty(value = "æ¶é´") |
| | | private Date oilTime; |
| | | /**油液ç¼ç */ |
| | | @TableField(exist = false) |
| | | private String fluidCode; |
| | |
| | | private String equipmentName; |
| | | @TableField(exist = false) |
| | | private String keyword; |
| | | @TableField(exist = false) |
| | | private String fileName; |
| | | /** |
| | | * 设å¤ç¼å·æ¼æ¥ |
| | | */ |
| | |
| | | * åºåæ¥æ(çäº§æ¥æ) |
| | | */ |
| | | @ApiModelProperty(value = "åºåæ¥æ(çäº§æ¥æ)") |
| | | private java.util.Date manufactureDate; |
| | | private Date manufactureDate; |
| | | /** |
| | | * ä¾åºå |
| | | */ |
| | |
| | | } |
| | | for (EamSecondMaintenanceOrder order : unCompleteOrderList) { |
| | | if (SecondMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(order.getMaintenanceStatus())) { |
| | | order.setMaintenanceStatus(SecondMaintenanceStatusEnum.ABOLISH.name()); |
| | | order.setMaintenanceStatus(SecondMaintenanceStatusEnum.EXPIRED.name()); |
| | | } else if (WeekMaintenanceStatusEnum.UNDER_MAINTENANCE.name().equals(order.getMaintenanceStatus())) { |
| | | //å·²ç»è¢«æ¥å 使ªæ§è¡å®æ |
| | | order.setMaintenanceStatus(SecondMaintenanceStatusEnum.ABOLISH.name()); |
| | | order.setMaintenanceStatus(SecondMaintenanceStatusEnum.EXPIRED.name()); |
| | | //强å¶ç»ææµç¨ å é¤ç¨æ·çæ¤å¾
åä»»å¡ |
| | | FlowMyBusiness flowMyBusiness = flowMyBusinessService.selectByDataId(order.getId()); |
| | | if (flowMyBusiness != null) { |
| | |
| | | } |
| | | for (EamThirdMaintenanceOrder order : unCompleteOrderList) { |
| | | if (ThirdMaintenanceStatusEnum.WAIT_MAINTENANCE.name().equals(order.getMaintenanceStatus())) { |
| | | order.setMaintenanceStatus(ThirdMaintenanceStatusEnum.ABOLISH.name()); |
| | | order.setMaintenanceStatus(ThirdMaintenanceStatusEnum.EXPIRED.name()); |
| | | } else if (ThirdMaintenanceStatusEnum.UNDER_MAINTENANCE.name().equals(order.getMaintenanceStatus())) { |
| | | //å·²ç»è¢«æ¥å 使ªæ§è¡å®æ |
| | | order.setMaintenanceStatus(ThirdMaintenanceStatusEnum.ABOLISH.name()); |
| | | order.setMaintenanceStatus(ThirdMaintenanceStatusEnum.EXPIRED.name()); |
| | | //强å¶ç»ææµç¨ å é¤ç¨æ·çæ¤å¾
åä»»å¡ |
| | | FlowMyBusiness flowMyBusiness = flowMyBusinessService.selectByDataId(order.getId()); |
| | | if (flowMyBusiness != null) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.eam.entity.EamSecondMaintenanceOrder; |
| | | import org.jeecg.modules.eam.entity.EamThirdMaintenanceOrder; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface EquipmentHomeMapper { |
| | | |
| | | /** |
| | | *é¦é¡µ ææ¯ç¶ææ°éç»è®¡ |
| | | */ |
| | | List<Map<String, Object>> getEquipmentTechnologyStatusList(); |
| | | |
| | | /** |
| | | *é¦é¡µ è®¾å¤æ¥ä¿®æ
åµç»è®¡ |
| | | */ |
| | | List<Map<String, Object>> getReportRepairEquipmentList(); |
| | | |
| | | List<EamThirdMaintenanceOrder> getThirdGuaranteesPlan(@Param("date") String date); |
| | | |
| | | List<EamSecondMaintenanceOrder> getSecondGuaranteesPlan(@Param("date") String date); |
| | | } |
| | |
| | | SELECT |
| | | t1.id, |
| | | t1.equipment_id equipmentId, |
| | | t1.usage_quantity usageQuantity, |
| | | t1.addition_site additionSite, |
| | | t1.oil_time oilTime, |
| | | t1.fluid_id fluidId, |
| | | t2.fluid_code fluidCode, |
| | | t2.fluid_name fluidName |
| | |
| | | <select id="findInspectionUser" parameterType="String" resultType="org.jeecg.modules.eam.vo.InspectionVo"> |
| | | |
| | | SELECT |
| | | t1.operator, |
| | | t1.confirm_user as confirmUser, |
| | | t2.realname operator, |
| | | t3.realname as confirmUser, |
| | | CONVERT(VARCHAR, DATEPART(DAY, t1.inspection_date)) as dayTime |
| | | FROM |
| | | eam_inspection_order t1 |
| | | left join sys_user t2 on t1.operator = t2.username |
| | | left join sys_user t3 on t1.confirm_user = t3.username |
| | | WHERE t1.del_flag = '0' |
| | | AND t1.equipment_id = #{equipmentId} |
| | | AND SUBSTRING ( CONVERT ( VARCHAR ( 10 ), t1.inspection_date, 120 ), 1, 7 ) = SUBSTRING(CONVERT(VARCHAR(10),#{yearMonth}, 120 ), 1, 7 ) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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="org.jeecg.modules.eam.mapper.EquipmentHomeMapper"> |
| | | |
| | | |
| | | <select id="getEquipmentTechnologyStatusList" parameterType="String" resultType="Map"> |
| | | SELECT |
| | | ( SELECT COUNT ( 0 ) FROM eam_equipment WHERE del_flag = '0' and technology_status = '1') as qualifiedCount, |
| | | ( SELECT COUNT ( 0 ) FROM eam_equipment WHERE del_flag = '0' and technology_status = '2') as limitedUseCount, |
| | | ( SELECT COUNT ( 0 ) FROM eam_equipment WHERE del_flag = '0' and technology_status = '3') as disabledCount |
| | | </select> |
| | | |
| | | <select id="getReportRepairEquipmentList" parameterType="String" resultType="Map"> |
| | | SELECT |
| | | ( select COUNT(0) from eam_report_repair t1 left join eam_equipment t2 on t1.equipment_id = t2.id WHERE t1.del_flag = '0' and SUBSTRING(CONVERT(VARCHAR(10), t1.fault_start_time, 120), 1, 10) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 10)) as failurTotalCount, |
| | | ( select COUNT(0) from eam_report_repair t1 left join eam_equipment t2 on t1.equipment_id = t2.id where t1.del_flag = '0' and t1.breakdown_flag = '1' and SUBSTRING(CONVERT(VARCHAR(10), t1.fault_start_time, 120), 1, 10) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 10)) as noStopCount, |
| | | ( select COUNT(0) from eam_report_repair t1 left join eam_equipment t2 on t1.equipment_id = t2.id where t1.del_flag = '0' and t1.breakdown_flag = '0' and SUBSTRING(CONVERT(VARCHAR(10), t1.fault_start_time, 120), 1, 10) = SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 1, 10)) as stopCount |
| | | </select> |
| | | <select id="getThirdGuaranteesPlan" resultType="org.jeecg.modules.eam.entity.EamThirdMaintenanceOrder"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | eam_third_maintenance_order |
| | | WHERE |
| | | del_flag = '0' |
| | | AND SUBSTRING(CONVERT (VARCHAR (10), maintenance_date, 120), 1, 7) = #{date} |
| | | </select> |
| | | <select id="getSecondGuaranteesPlan" resultType="org.jeecg.modules.eam.entity.EamSecondMaintenanceOrder"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | eam_second_maintenance_order |
| | | WHERE |
| | | del_flag = '0' |
| | | AND SUBSTRING(CONVERT (VARCHAR (10), maintenance_date, 120), 1, 7) = #{date} |
| | | </select> |
| | | </mapper> |
| | |
| | | boolean submit(String id); |
| | | |
| | | /** |
| | | * å½è¿ |
| | | * @param id |
| | | * @return |
| | | */ |
| | | boolean equipmentReturn(String id); |
| | | |
| | | /** |
| | | * å®¡æ¹æµç¨æ§å¶ |
| | | * @param request |
| | | * @return |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import org.jeecg.modules.eam.entity.EamMaintenanceStandard; |
| | | import org.jeecg.modules.eam.entity.EamSysFiles; |
| | | import org.jeecg.modules.eam.request.EamMaintenanceStandardRequest; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | List<EamMaintenanceStandard> queryListByCategory(String maintenanceCategory); |
| | | |
| | | |
| | | void downloadFile(HttpServletResponse response,EamMaintenanceStandard maintenanceStandard) throws JsonProcessingException; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface IEquipmentHomeService { |
| | | /** |
| | | *é¦é¡µ ææ¯ç¶ææ°éç»è®¡ |
| | | */ |
| | | List<Map<String, Object>> getEquipmentTechnologyStatusList(); |
| | | |
| | | /** |
| | | *é¦é¡µ è®¾å¤æ¥ä¿®æ
åµç»è®¡ |
| | | */ |
| | | List<Map<String, Object>> getReportRepairEquipmentList(); |
| | | |
| | | /** |
| | | *é¦é¡µ ä¸ä¿è®¡å |
| | | */ |
| | | Map<String, Object> getThirdGuaranteesPlan(); |
| | | |
| | | /** |
| | | *é¦é¡µ äºä¿è®¡å |
| | | */ |
| | | Map<String, Object> getSecondGuaranteesPlan(); |
| | | } |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog; |
| | | import org.jeecg.modules.eam.constant.AssetStatusEnum; |
| | | import org.jeecg.modules.eam.constant.EquipmentLeanOutStatusEnum; |
| | | import org.jeecg.modules.eam.constant.EquipmentOperationTagEnum; |
| | | import org.jeecg.modules.eam.constant.*; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import org.jeecg.modules.eam.entity.EamEquipmentLeanOut; |
| | | import org.jeecg.modules.eam.entity.EamEquipmentSealUp; |
| | | import org.jeecg.modules.eam.mapper.EamEquipmentLeanOutMapper; |
| | | import org.jeecg.modules.eam.request.EamEquipmentLeanOutQuery; |
| | | import org.jeecg.modules.eam.request.EamEquipmentLeanOutRequest; |
| | |
| | | import org.jeecg.modules.flowable.service.IFlowDefinitionService; |
| | | import org.jeecg.modules.flowable.service.IFlowTaskService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.jeecg.modules.system.vo.UserSelector; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description: 设å¤ååºå½è¿ |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean equipmentReturn(String id) { |
| | | EamEquipmentLeanOut entity = equipmentLeanOutMapper.selectById(id); |
| | | if (entity == null) { |
| | | throw new JeecgBootException("è¦æäº¤çæ°æ®ä¸åå¨ï¼è¯·å·æ°éè¯ï¼"); |
| | | } |
| | | if (!EquipmentLeanOutStatusEnum.WAIT_RETURN.name().equals(entity.getLeanStatus())) { |
| | | throw new JeecgBootException("å½åæ°æ®ç¶æä¸å
许ç¼è¾ï¼"); |
| | | } |
| | | //æ£æ¥è®¾å¤ |
| | | EamEquipment equipment = eamEquipmentService.getById(entity.getEquipmentId()); |
| | | if (equipment == null) { |
| | | throw new JeecgBootException("设å¤ä¸åå¨ï¼"); |
| | | } |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null) { |
| | | throw new JeecgBootException("å½åç¨æ·æ æ³ç¼è¾å°åè®°å½ï¼"); |
| | | } |
| | | //å¯å¨å®¡æ¹æµç¨ |
| | | flowCommonService.initActBusiness("å·¥åå·:" + entity.getCode() + ";设å¤ç¼å·: " + equipment.getEquipmentCode() + ";è¿è¡è®¾å¤å½è¿", |
| | | entity.getId(), "IEamEquipmentLeanOutService", "equipment_return", null); |
| | | Map<String, Object> variables = new HashMap<>(); |
| | | variables.put("dataId", entity.getId()); |
| | | variables.put("organization", "æ°å¢å½è¿é»è®¤å½è¿æµç¨"); |
| | | variables.put("comment", "æ°å¢å½è¿é»è®¤å½è¿æµç¨"); |
| | | variables.put("proofreading", true); |
| | | // åé
ç»è®¾å¤ç®¡çå |
| | | List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0004); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»è®¾å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | | List<String> usernames = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | | variables.put("NextAssignee", usernames); |
| | | Result result = flowDefinitionService.startProcessInstanceByKey("equipment_return", variables); |
| | | if (result != null) { |
| | | entity.setLeanEndTime(new Date()); |
| | | entity.setLeanStatus(EquipmentLeanOutStatusEnum.WAIT_CONFIRM.name()); |
| | | //ä¿åå·¥å |
| | | equipmentLeanOutMapper.updateById(entity); |
| | | return result.isSuccess(); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @EquipmentHistoryLog(operationTag = EquipmentOperationTagEnum.LEAN_OUT, businessTable = "eam_equipment_lean_out") |
| | | public EamEquipmentLeanOut approval(EamEquipmentLeanOutRequest request) { |
| | | EamEquipmentLeanOut entity = equipmentLeanOutMapper.selectById(request.getId()); |
| | |
| | | values.put("organization", request.getReturnComment()); |
| | | values.put("comment", request.getReturnComment()); |
| | | values.put("NextAssignee", userApprovalList); |
| | | values.put("approvalDealType", "1"); |
| | | request.setComment(request.getReturnComment()); |
| | | entity.setLeanEndTime(new Date()); //å½è¿æ¶é´ |
| | | //设置entity |
| | |
| | | break; |
| | | // å½è¿ç¡®è®¤ |
| | | case WAIT_CONFIRM: |
| | | values.put("approvalDealType", "1"); |
| | | values.put("dataId", entity.getId()); |
| | | values.put("organization", request.getConfirmComment()); |
| | | values.put("comment", request.getConfirmComment()); |
| | | request.setComment(request.getConfirmComment()); |
| | | //设置entity |
| | | entity.setApprovalUser(user.getUsername());// å®¡æ ¸äºº |
| | | entity.setLeanStatus(EquipmentLeanOutStatusEnum.COMPLETE.name()); |
| | | entity.setConfirmUser(user.getUsername()); |
| | | entity.setConfirmComment(request.getConfirmComment()); |
| | | entity.setConfirmTime(new Date()); |
| | | // ä¿®æ¹è®¾å¤ç¶æ |
| | | // ä¿®æ¹è®¾å¤ç¶æ0 |
| | | equipment.setAssetStatus(AssetStatusEnum.NORMAL.name()); |
| | | eamEquipmentService.updateById(equipment); |
| | | break; |
| | |
| | | entity.setSealStatus(EquipmentSealUpStatusEnum.COMPLETE.name()); |
| | | // ä¿®æ¹è®¾å¤ç¶æ |
| | | equipment.setAssetStatus(AssetStatusEnum.NORMAL.name()); |
| | | // ä¿®æ¹è®¾å¤ç¶æ |
| | | equipment.setAssetStatus(AssetStatusEnum.NORMAL.name()); |
| | | eamEquipmentService.updateById(equipment); |
| | | } else { |
| | | //设置entity |
| | | entity.setSealStatus(EquipmentSealUpStatusEnum.SEALED.name()); |
| | |
| | | entity.setUnsealApprovalComment(request.getUnsealApprovalComment()); |
| | | entity.setUnsealApprovalDealType(request.getUnsealApprovalDealType()); |
| | | entity.setUnsealApprovalTime(new Date()); |
| | | // ä¿®æ¹è®¾å¤ç¶æ |
| | | equipment.setAssetStatus(AssetStatusEnum.NORMAL.name()); |
| | | eamEquipmentService.updateById(equipment); |
| | | break; |
| | | } |
| | | request.setValues(values); |
| | |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.jeecg.common.api.vo.FileUploadResult; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.exception.ExceptionCast; |
| | | import org.jeecg.common.exception.JeecgBootException; |
| | | import org.jeecg.common.system.vo.LoginUser; |
| | | import org.jeecg.common.util.FileUtil; |
| | | import org.jeecg.modules.eam.constant.MaintenanceStandardStatusEnum; |
| | | import org.jeecg.modules.eam.entity.EamMaintenanceStandard; |
| | | import org.jeecg.modules.eam.entity.EamMaintenanceStandardDetail; |
| | | import org.jeecg.modules.eam.entity.EamSysFiles; |
| | | import org.jeecg.modules.eam.mapper.EamMaintenanceStandardMapper; |
| | | import org.jeecg.modules.eam.request.EamMaintenanceStandardRequest; |
| | | import org.jeecg.modules.eam.service.IEamMaintenanceStandardDetailService; |
| | | import org.jeecg.modules.eam.service.IEamMaintenanceStandardService; |
| | | import org.jeecg.modules.eam.service.IEamSysFilesService; |
| | | import org.jeecg.modules.system.service.ISysFilesService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private IEamMaintenanceStandardDetailService eamMaintenanceStandardDetailService; |
| | | |
| | | @Autowired |
| | | private IEamSysFilesService sysFilesService; |
| | | |
| | | @Override |
| | | public IPage<EamMaintenanceStandard> queryPageList(Page<EamMaintenanceStandard> page, EamMaintenanceStandard eamMaintenanceStandard) { |
| | |
| | | } |
| | | //åç§° æ¨¡ç³æ¥è¯¢ |
| | | if(StringUtils.isNotBlank(eamMaintenanceStandard.getStandardName())) { |
| | | queryWrapper.like("ems.standard_name", eamMaintenanceStandard.getStandardCode()); |
| | | queryWrapper.like("ems.standard_name", eamMaintenanceStandard.getStandardName()); |
| | | } |
| | | //è®¾å¤ |
| | | if(StringUtils.isNotBlank(eamMaintenanceStandard.getEquipmentId())) { |
| | |
| | | queryWrapper.eq(EamMaintenanceStandard::getStandardStatus, MaintenanceStandardStatusEnum.NORMAL.name()); |
| | | return eamMaintenanceStandardMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void downloadFile(HttpServletResponse response, EamMaintenanceStandard eamMaintenanceStandard) throws JsonProcessingException { |
| | | String json = eamMaintenanceStandard.getReferenceFile(); |
| | | if(StringUtils.isNotBlank(json)){ |
| | | ObjectMapper mapper = new ObjectMapper(); |
| | | Map<String, Object> map = mapper.readValue(json, Map.class); |
| | | String fileEncodeName = (String) map.get("fileEncodeName"); |
| | | List<EamSysFiles> list = sysFilesService.lambdaQuery().eq(EamSysFiles::getFileEncodeName, fileEncodeName).list(); |
| | | if(list.size()>0){ |
| | | FileUtil.downLoadFile(response, list.get(0).getFilePath(), list.get(0).getFileName()); |
| | | }else{ |
| | | ExceptionCast.cast("æä»¶ä¸åå¨"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | switch (status) { |
| | | case UNDER_MAINTENANCE: |
| | | //æ§è¡å®æ |
| | | //设å¤ç®¡çå确认 |
| | | String equipmentManager = equipment.getEquipmentManager(); |
| | | if(StringUtils.isBlank(equipmentManager)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
设å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | //车é´è®¾å¤ç®¡çå确认 |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0004); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»è½¦é´è®¾å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | | userApprovalList = Collections.singletonList(equipmentManager); |
| | | userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | | values.put("dataId", entity.getId()); |
| | | values.put("organization", "äºä¿æ§è¡ç»æ"); |
| | | values.put("comment", "äºä¿æ§è¡ç»æ"); |
| | |
| | | eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.SECOND_MAINTENANCE_WAIT_CONFIRM.name()); |
| | | break; |
| | | case WAIT_CONFIRM: |
| | | // 维修主任确认 |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0003); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»è½¦é´çç»é¿ï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»ç»´ä¿®ä¸»ä»»ï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | | //çç»é¿ç¡®è®¤ |
| | | //维修主任确认 |
| | | userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | | values.put("dataId", entity.getId()); |
| | | values.put("organization", request.getConfirmComment()); |
| | |
| | | if (equipment == null) { |
| | | throw new JeecgBootException("设å¤ä¸åå¨ï¼æ·»å 失败ï¼"); |
| | | } |
| | | if (StringUtils.isBlank(equipment.getEquipmentManager())) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
设å¤ç®¡çåï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | List<UserSelector> userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0002); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»ç»´ä¿®å·¥ï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | | List<String> userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null || !BusinessCodeConst.PCR0001.equals(sysUser.getPost())) { |
| | | throw new JeecgBootException("䏿¯æä½å·¥ï¼æ æ³é¢åæ¤å·¥åï¼"); |
| | |
| | | } |
| | | variables.put("proofreading", true); |
| | | //å¹¶è¡ä»»å¡ä¼ç¾ |
| | | //æä½å·¥æ§è¡ä¿å
» |
| | | variables.put("maintenance_execution", Collections.singletonList(sysUser.getUsername())); |
| | | variables.put("precision_check", Collections.singletonList(equipment.getEquipmentManager())); |
| | | //维修工精度æ£éª |
| | | variables.put("precision_check", userApprovalList); |
| | | Result result = flowDefinitionService.startProcessInstanceByKey("third_maintenance_process", variables); |
| | | if (result != null) { |
| | | //æ´æ°è®¾å¤ä¿å
»ç¶æ |
| | |
| | | //æ§è¡å®æ |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0006); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»è½¦é´çç»é¿ï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»æºå¨åï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | | userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | | values.put("dataId", entity.getId()); |
| | |
| | | case WAIT_CONFIRM: |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0003); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»è½¦é´çç»é¿ï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | throw new JeecgBootException("è®¾å¤æªåé
ç»ç»´ä¿®ä¸»ä»»ï¼æ æ³è¿å
¥ä¸çº§å®¡æ¹ï¼"); |
| | | } |
| | | //çç»é¿ç¡®è®¤ |
| | | userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.eam.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import org.jeecg.modules.eam.constant.SecondMaintenanceStatusEnum; |
| | | import org.jeecg.modules.eam.constant.ThirdMaintenanceStatusEnum; |
| | | import org.jeecg.modules.eam.entity.EamSecondMaintenanceOrder; |
| | | import org.jeecg.modules.eam.entity.EamThirdMaintenanceOrder; |
| | | import org.jeecg.modules.eam.mapper.EquipmentHomeMapper; |
| | | import org.jeecg.modules.eam.service.IEquipmentHomeService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | | public class EquipmentHomeServiceImpl implements IEquipmentHomeService { |
| | | |
| | | @Autowired |
| | | private EquipmentHomeMapper equipmentHomeMapper; |
| | | |
| | | /** |
| | | *é¦é¡µ ææ¯ç¶ææ°éç»è®¡ |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> getEquipmentTechnologyStatusList() { |
| | | return this.equipmentHomeMapper.getEquipmentTechnologyStatusList(); |
| | | } |
| | | |
| | | /** |
| | | *é¦é¡µ è®¾å¤æ¥ä¿®æ
åµç»è®¡ |
| | | */ |
| | | @Override |
| | | public List<Map<String, Object>> getReportRepairEquipmentList() { |
| | | return this.equipmentHomeMapper.getReportRepairEquipmentList(); |
| | | } |
| | | |
| | | /** |
| | | *é¦é¡µ ä¸ä¿è®¡å |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Map<String, Object> getThirdGuaranteesPlan() { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //è·åæ¬æä¸ä¿è®¡å |
| | | List<EamThirdMaintenanceOrder> thirdMaintenanceOrderList = equipmentHomeMapper.getThirdGuaranteesPlan(DateUtil.format(new Date(), "yyyy-MM")); |
| | | //è·å䏿ä¸ä¿è®¡å |
| | | List<EamThirdMaintenanceOrder> nextThirdMaintenanceOrderList = equipmentHomeMapper.getThirdGuaranteesPlan(DateUtil.format(DateUtil.nextMonth(), "yyyy-MM")); |
| | | map.put("thisMonthCount", thirdMaintenanceOrderList.size()); |
| | | map.put("thisMonthFinishCount", thirdMaintenanceOrderList.stream().filter(eamThirdMaintenanceOrder -> ThirdMaintenanceStatusEnum.COMPLETE.name().equals(eamThirdMaintenanceOrder.getMaintenanceStatus())).collect(Collectors.toList()).size()); |
| | | map.put("thisMonthOverdueCount", thirdMaintenanceOrderList.stream().filter(eamThirdMaintenanceOrder -> ThirdMaintenanceStatusEnum.EXPIRED.name().equals(eamThirdMaintenanceOrder.getMaintenanceStatus())).collect(Collectors.toList()).size()); |
| | | map.put("nextMonthCount", nextThirdMaintenanceOrderList.size()); |
| | | return map; |
| | | } |
| | | |
| | | /** |
| | | *é¦é¡µ äºä¿è®¡å |
| | | */ |
| | | @Override |
| | | public Map<String, Object> getSecondGuaranteesPlan() { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | //è·åæ¬æäºä¿è®¡å |
| | | List<EamSecondMaintenanceOrder> secondMaintenanceOrderList = equipmentHomeMapper.getSecondGuaranteesPlan(DateUtil.format(new Date(), "yyyy-MM")); |
| | | //è·å䏿äºä¿è®¡å |
| | | List<EamSecondMaintenanceOrder> nextsecondMaintenanceOrderList = equipmentHomeMapper.getSecondGuaranteesPlan(DateUtil.format(DateUtil.nextMonth(), "yyyy-MM")); |
| | | map.put("thisMonthCount", secondMaintenanceOrderList.size()); |
| | | map.put("thisMonthFinishCount", secondMaintenanceOrderList.stream().filter(eamSecondMaintenanceOrder -> SecondMaintenanceStatusEnum.COMPLETE.name().equals(eamSecondMaintenanceOrder.getMaintenanceStatus())).collect(Collectors.toList()).size()); |
| | | map.put("thisMonthOverdueCount", secondMaintenanceOrderList.stream().filter(eamSecondMaintenanceOrder -> SecondMaintenanceStatusEnum.EXPIRED.name().equals(eamSecondMaintenanceOrder.getMaintenanceStatus())).collect(Collectors.toList()).size()); |
| | | map.put("nextMonthCount", nextsecondMaintenanceOrderList.size()); |
| | | return map; |
| | | } |
| | | } |