zhangherong
2025-05-06 deba25af7b2a6fefce0e477782274ffd600abac8
art: 设备管理-点检-设备台账状态变更,点检流程更新设备保养状态
已添加1个文件
已修改4个文件
71 ■■■■■ 文件已修改
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/EquipmentMaintenanceStatus.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamEquipmentExtendService.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentExtendServiceImpl.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamDashboardController.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/EquipmentMaintenanceStatus.java
@@ -4,7 +4,10 @@
 * ä¿å…»çŠ¶æ€
 */
public enum EquipmentMaintenanceStatus {
    NORMAL,
    UNDER_MAINTENANCE,
    WAIT_CONFIRM,;
    NORMAL, //正常
    UNDER_INSPECTION, //点检中
    INSPECTION_CONFIRM, //点检确认中
    UNDER_MAINTENANCE, //周保中
    WAIT_CONFIRM, //周保确认中
    ;
}
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamEquipmentExtendService.java
@@ -25,4 +25,12 @@
     * @return
     */
    boolean updateEquipmentRepairStatus(String equipmentId, String status);
    /**
     * æ›´æ–°è®¾å¤‡ç»´ä¿®çŠ¶æ€
     * @param equipmentId è®¾å¤‡id
     * @param status çŠ¶æ€
     * @return
     */
    boolean updateEquipmentInspectionStatus(String equipmentId, String status);
}
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentExtendServiceImpl.java
@@ -1,5 +1,6 @@
package org.jeecg.modules.eam.service.impl;
import org.jeecg.modules.eam.constant.EquipmentMaintenanceStatus;
import org.jeecg.modules.eam.entity.EamEquipmentExtend;
import org.jeecg.modules.eam.mapper.EamEquipmentExtendMapper;
import org.jeecg.modules.eam.service.IEamEquipmentExtendService;
@@ -45,4 +46,21 @@
        eamEquipmentExtendMapper.updateById(entity);
        return true;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateEquipmentInspectionStatus(String equipmentId, String status) {
        EamEquipmentExtend entity = eamEquipmentExtendMapper.selectById(equipmentId);
        if (entity == null) {
            return false;
        }
        //保养优先点检状态 å¦‚果正在保养中,则点检状态不覆盖保养状态,反之 ä¿å…»çŠ¶æ€å¯ä»¥è¦†ç›–ç‚¹æ£€çŠ¶æ€
        if (EquipmentMaintenanceStatus.NORMAL.name().equals(entity.getMaintenanceStatus())
                || EquipmentMaintenanceStatus.UNDER_INSPECTION.name().equals(entity.getMaintenanceStatus())
                || EquipmentMaintenanceStatus.INSPECTION_CONFIRM.name().equals(entity.getMaintenanceStatus())) {
            entity.setMaintenanceStatus(status);
            eamEquipmentExtendMapper.updateById(entity);
        }
        return true;
    }
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamDashboardController.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,14 @@
package org.jeecg.modules.eam.controller;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@Api(tags="设备管理-首页看板接口")
@RestController
@RequestMapping("/eam/dashboard")
public class EamDashboardController {
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java
@@ -23,6 +23,7 @@
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog;
import org.jeecg.modules.eam.constant.BusinessCodeConst;
import org.jeecg.modules.eam.constant.EquipmentMaintenanceStatus;
import org.jeecg.modules.eam.constant.EquipmentOperationTagEnum;
import org.jeecg.modules.eam.constant.InspectionStatus;
import org.jeecg.modules.eam.entity.EamEquipment;
@@ -31,10 +32,7 @@
import org.jeecg.modules.eam.mapper.EamInspectionOrderMapper;
import org.jeecg.modules.eam.request.EamInspectionOrderQuery;
import org.jeecg.modules.eam.request.EamInspectionOrderRequest;
import org.jeecg.modules.eam.service.IEamEquipmentService;
import org.jeecg.modules.eam.service.IEamInspectionOrderDetailService;
import org.jeecg.modules.eam.service.IEamInspectionOrderService;
import org.jeecg.modules.eam.service.IEamReportRepairService;
import org.jeecg.modules.eam.service.*;
import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness;
import org.jeecg.modules.flowable.apithird.business.service.impl.FlowMyBusinessServiceImpl;
import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI;
@@ -83,6 +81,8 @@
    private IMdcUserProductionService mdcUserProductionService;
    @Autowired
    private IEamReportRepairService eamReportRepairService;
    @Autowired
    private IEamEquipmentExtendService eamEquipmentExtendService;
    @Override
    public IPage<EamInspectionOrder> queryPageList(Page<EamInspectionOrder> page, EamInspectionOrderQuery query) {
@@ -180,6 +180,8 @@
        }
        if (StrUtil.isNotBlank(eamInspectionOrderRequest.getOperator())) {
            triggerProcess(eamInspectionOrder);
            //更新设备保养状态
            eamEquipmentExtendService.updateEquipmentInspectionStatus(eamInspectionOrder.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_INSPECTION.name());
        }
        return true;
    }
@@ -219,11 +221,15 @@
    @Override
    @Transactional(rollbackFor = {Exception.class})
    public boolean editInspectionOrder(EamInspectionOrderRequest eamInspectionOrderRequest) {
        EamInspectionOrder eamInspectionOrder = new EamInspectionOrder();
        BeanUtils.copyProperties(eamInspectionOrderRequest, eamInspectionOrder);
        if (StrUtil.isNotEmpty(eamInspectionOrder.getOperator())) {
            eamInspectionOrder.setInspectionStatus(InspectionStatus.UNDER_INSPECTION.name());
            triggerProcess(eamInspectionOrder);
            //更新设备保养状态
            eamEquipmentExtendService.updateEquipmentInspectionStatus(eamInspectionOrder.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_INSPECTION.name());
        }
        super.updateById(eamInspectionOrder);
        //处理明细数据
@@ -261,6 +267,8 @@
            eamInspectionOrder.setInspectionStatus(InspectionStatus.UNDER_INSPECTION.name());
            this.triggerProcess(eamInspectionOrder);
            this.updateById(eamInspectionOrder);
            //更新设备保养状态
            eamEquipmentExtendService.updateEquipmentInspectionStatus(eamInspectionOrder.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_INSPECTION.name());
            return true;
        }
    }
@@ -446,6 +454,8 @@
                }
                eamInspectionOrderDetailService.remove(new QueryWrapper<EamInspectionOrderDetail>().eq("order_id", order.getId()));
                eamInspectionOrderDetailService.saveBatch(request.getTableDetailList());
                //更新设备保养状态
                eamEquipmentExtendService.updateEquipmentInspectionStatus(order.getEquipmentId(), EquipmentMaintenanceStatus.INSPECTION_CONFIRM.name());
            } else if (InspectionStatus.WAIT_CONFIRM.name().equals(order.getInspectionStatus()) && StrUtil.isNotEmpty(request.getConfirmDealType())) {
                // ç­ç»„长确认任务
                order.setInspectionStatus(InspectionStatus.COMPLETE.name());
@@ -453,6 +463,8 @@
                order.setConfirmComment(request.getConfirmComment());
                order.setConfirmDealType(request.getConfirmDealType());
                order.setConfirmTime(new Date());
                //更新设备保养状态
                eamEquipmentExtendService.updateEquipmentInspectionStatus(order.getEquipmentId(), EquipmentMaintenanceStatus.NORMAL.name());
            }
        }
    }
@@ -498,6 +510,8 @@
                if (InspectionStatus.UNDER_INSPECTION.name().equals(type)) {
                    eamInspectionOrder.setOperator(loginUser.getUsername());
                    this.triggerProcess(eamInspectionOrder);
                    //更新设备保养状态
                    eamEquipmentExtendService.updateEquipmentInspectionStatus(eamInspectionOrder.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_INSPECTION.name());
                } else {
                    eamInspectionOrder.setOperator(null);
                }