cuikaidong
2025-04-21 22c80021ea82ed5954aee912ce7c3bb39a11d9c0
Merge remote-tracking branch 'origin/master'
已重命名2个文件
已修改10个文件
147 ■■■■ 文件已修改
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/aspect/EquipmentHistoryLogAspect.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/EquipmentOperationTagEnum.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamInspectionOrder.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamWeekMaintenanceOrder.java 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamEquipmentExtendService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentExtendServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamInspectionOrderController.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamInspectionOrderService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamWeekMaintenanceOrderService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamWeekMaintenanceOrderServiceImpl.java 29 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/aspect/EquipmentHistoryLogAspect.java
@@ -1,14 +1,19 @@
package org.jeecg.modules.eam.aspect;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.*;
import org.aspectj.lang.reflect.MethodSignature;
import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog;
import org.jeecg.modules.eam.constant.EquipmentOperationTagEnum;
import org.jeecg.modules.eam.constant.InspectionStatus;
import org.jeecg.modules.eam.constant.WeekMaintenanceStatusEnum;
import org.jeecg.modules.eam.entity.EamEquipment;
import org.jeecg.modules.eam.entity.EamEquipmentHistoryLog;
import org.jeecg.modules.eam.entity.EamInspectionOrder;
import org.jeecg.modules.eam.entity.EamWeekMaintenanceOrder;
import org.jeecg.modules.eam.service.IEamEquipmentHistoryLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@@ -54,7 +59,9 @@
            log.setBusinessTable(syslog.businessTable());
            log.setOperationTag(syslog.operationTag().name());
            convertResult(log, syslog.operationTag(), result);
            equipmentHistoryLogService.save(log);
            if (StringUtils.isNotBlank(log.getEquipmentId())) {
                equipmentHistoryLogService.save(log);
            }
        }
    }
@@ -62,7 +69,7 @@
    private void convertResult(EamEquipmentHistoryLog log, EquipmentOperationTagEnum operationTag, Object result) {
        switch (operationTag) {
            case ACCEPTANCE:
                if(result instanceof EamEquipment) {
                if (result instanceof EamEquipment) {
                    EamEquipment equipment = (EamEquipment) result;
                    log.setEquipmentId(equipment.getId());
                    log.setBusinessId(equipment.getId());
@@ -72,6 +79,28 @@
                }
                break;
            case POINT_INSPECTION:
                if (result instanceof EamInspectionOrder) {
                    EamInspectionOrder order = (EamInspectionOrder) result;
                    if (InspectionStatus.COMPLETE.name().equals(order.getInspectionStatus())) {
                        log.setEquipmentId(order.getEquipmentId());
                        log.setBusinessId(order.getId());
                        log.setOperator(order.getOperator());
                        log.setDescription(order.getConfirmComment());
                        log.setCreateTime(order.getInspectionDate());
                    }
                }
                break;
            case WEEK_MAINTENANCE:
                if (result instanceof EamWeekMaintenanceOrder) {
                    EamWeekMaintenanceOrder order = (EamWeekMaintenanceOrder) result;
                    if (WeekMaintenanceStatusEnum.COMPLETE.name().equals(order.getMaintenanceStatus())) {
                        log.setEquipmentId(order.getEquipmentId());
                        log.setBusinessId(order.getId());
                        log.setOperator(order.getOperator());
                        log.setDescription(order.getFinalAcceptanceComment());
                        log.setCreateTime(order.getActualEndTime());
                    }
                }
                break;
            case SECOND_MAINTENANCE:
                break;
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/constant/EquipmentOperationTagEnum.java
@@ -6,6 +6,7 @@
public enum EquipmentOperationTagEnum {
    ACCEPTANCE, //验收
    POINT_INSPECTION,  //点检
    WEEK_MAINTENANCE, //周保
    SECOND_MAINTENANCE,  //二保
    THIRD_MAINTENANCE,  //三保
    REPORT_REPAIR,  //报修
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamInspectionOrder.java
ÎļþÃû´Ó lxzn-module-eam/src/main/java/org/jeecg/modules/eam/entity/EamInspectionOrder.java ÐÞ¸Ä
@@ -13,7 +13,6 @@
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
 * @Description: ç‚¹æ£€å·¥å•
@@ -137,10 +136,6 @@
    /**设备编号*/
    @ApiModelProperty(value = "设备编号")
    private transient String equipmentCode;
    /**列表 ä¿å…»é¡¹æ˜Žç»†*/
    @ApiModelProperty(value = "列表 ä¿å…»é¡¹æ˜Žç»†")
    private transient List<EamInspectionOrderDetail> tableDetailList;
    @ApiModelProperty(value = "设备名称")
    @TableField(exist = false)
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/entity/EamWeekMaintenanceOrder.java
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/IEamEquipmentExtendService.java
@@ -10,5 +10,19 @@
 * @Version: V1.0
 */
public interface IEamEquipmentExtendService extends IService<EamEquipmentExtend> {
    /**
     * æ›´æ–°è®¾å¤‡ä¿å…»çŠ¶æ€
     * @param equipmentId è®¾å¤‡id
     * @param status çŠ¶æ€
     * @return
     */
    boolean updateEquipmentMaintenanceStatus(String equipmentId, String status);
    /**
     * æ›´æ–°è®¾å¤‡ç»´ä¿®çŠ¶æ€
     * @param equipmentId è®¾å¤‡id
     * @param status çŠ¶æ€
     * @return
     */
    boolean updateEquipmentRepairStatus(String equipmentId, String status);
}
lxzn-module-eam-common/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentExtendServiceImpl.java
@@ -6,14 +6,43 @@
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
/**
 * @Description: è®¾å¤‡å°è´¦æ‰©å±•表
 * @Author: jeecg-boot
 * @Date:   2025-03-19
 * @Date: 2025-03-19
 * @Version: V1.0
 */
@Service
public class EamEquipmentExtendServiceImpl extends ServiceImpl<EamEquipmentExtendMapper, EamEquipmentExtend> implements IEamEquipmentExtendService {
    @Resource
    private EamEquipmentExtendMapper eamEquipmentExtendMapper;
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateEquipmentMaintenanceStatus(String equipmentId, String status) {
        EamEquipmentExtend entity = eamEquipmentExtendMapper.selectById(equipmentId);
        if (entity == null) {
            return false;
        }
        entity.setMaintenanceStatus(status);
        eamEquipmentExtendMapper.updateById(entity);
        return true;
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateEquipmentRepairStatus(String equipmentId, String status) {
        EamEquipmentExtend entity = eamEquipmentExtendMapper.selectById(equipmentId);
        if (entity == null) {
            return false;
        }
        entity.setRepairStatus(status);
        eamEquipmentExtendMapper.updateById(entity);
        return true;
    }
}
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamInspectionOrderController.java
@@ -154,7 +154,8 @@
     @ApiOperation(value="点检工单-点检流程", notes="点检工单-点检流程")
     @PostMapping("/approval")
     public Result<?> approval(@RequestBody EamInspectionOrderRequest eamInspectionOrderRequest) {
         return eamInspectionOrderService.inspectionProcess(eamInspectionOrderRequest);
         eamInspectionOrderService.inspectionProcess(eamInspectionOrderRequest);
         return Result.OK("操作成功");
     }
    /**
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/controller/EamWeekMaintenanceOrderController.java
@@ -230,8 +230,8 @@
        if (StrUtil.isBlank(request.getTaskId()) || StrUtil.isBlank(request.getDataId()) || StrUtil.isBlank(request.getInstanceId())) {
            return Result.error("审批任务错误或不存在!");
        }
        boolean b = eamWeekMaintenanceOrderService.approval(request);
        if(!b) {
        EamWeekMaintenanceOrder b = eamWeekMaintenanceOrderService.approval(request);
        if(b == null) {
            return Result.error("操作失败!");
        }
        return Result.ok("操作成功!");
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamInspectionOrderService.java
@@ -66,7 +66,7 @@
     * @param eamInspectionOrderRequest
     * @return
     */
    Result<?> inspectionProcess(EamInspectionOrderRequest eamInspectionOrderRequest);
    EamInspectionOrder inspectionProcess(EamInspectionOrderRequest eamInspectionOrderRequest);
    /**
     * åˆ†é¡µæŸ¥è¯¢
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/IEamWeekMaintenanceOrderService.java
@@ -51,7 +51,7 @@
     * @param request
     * @return
     */
    boolean approval(EamWeekMaintenanceRequest request);
    EamWeekMaintenanceOrder approval(EamWeekMaintenanceRequest request);
    /**
     * èŽ·å–ä»Šå¤©ä¹‹å‰æœªä¿å…»å®Œæˆçš„å·¥å•
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java
@@ -18,8 +18,11 @@
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.constant.CommonConstant;
import org.jeecg.common.constant.DataBaseConstant;
import org.jeecg.common.exception.JeecgBootException;
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.EquipmentOperationTagEnum;
import org.jeecg.modules.eam.constant.InspectionStatus;
import org.jeecg.modules.eam.entity.EamEquipment;
import org.jeecg.modules.eam.entity.EamInspectionOrder;
@@ -281,40 +284,42 @@
     * @return
     */
    @Override
    public Result<?> inspectionProcess(EamInspectionOrderRequest eamInspectionOrderRequest) {
    @Transactional(rollbackFor = Exception.class)
    @EquipmentHistoryLog(operationTag = EquipmentOperationTagEnum.POINT_INSPECTION, businessTable = "eam_inspection_order")
    public EamInspectionOrder inspectionProcess(EamInspectionOrderRequest eamInspectionOrderRequest) {
        try {
            // æ£€æŸ¥è¯·æ±‚参数
            if (!isValidRequest(eamInspectionOrderRequest)) {
                return Result.error("非法参数");
                throw new JeecgBootException("非法参数");
            }
            // èŽ·å–å½“å‰ç™»å½•ç”¨æˆ·
            LoginUser user = getCurrentUser();
            if (user == null || StrUtil.isBlank(user.getId())) {
                return Result.error("账号不存在");
                throw new JeecgBootException("账号不存在");
            }
            eamInspectionOrderRequest.setAssignee(user.getUsername());
            // èŽ·å–ç‚¹æ£€å·¥å•ä¿¡æ¯
            EamInspectionOrder eamInspectionOrder = getEamInspectionOrder(eamInspectionOrderRequest.getDataId());
            if (eamInspectionOrder == null) {
                return Result.error("未找到对应数据");
                throw new JeecgBootException("未找到对应数据");
            }
            // èŽ·å–æµç¨‹ä¸šåŠ¡è®°å½•
            FlowMyBusiness flowMyBusiness = getFlowMyBusiness(eamInspectionOrderRequest.getInstanceId());
            if (flowMyBusiness == null) {
                return Result.error("流程记录不存在");
                throw new JeecgBootException("流程记录不存在");
            }
            // æ£€æŸ¥ç”¨æˆ·æ˜¯å¦æœ‰æƒé™æ“ä½œä»»åŠ¡
            if (!isUserAuthorized(flowMyBusiness, user)) {
                return Result.error("用户无权操作此任务");
                throw new JeecgBootException("用户无权操作此任务");
            }
            // è®¤é¢†ä»»åŠ¡
            if (!claimTask(flowMyBusiness.getTaskId(), user)) {
                return Result.error("任务不存在、已完成或已被他人认领");
                throw new JeecgBootException("任务不存在、已完成或已被他人认领");
            }
            // è®¾ç½®æµç¨‹å˜é‡
@@ -334,9 +339,9 @@
                updateEamInspectionOrderDetail(eamInspectionOrder);
            }
            return Result.OK("操作成功");
            return eamInspectionOrder;
        } catch (Exception e) {
            return Result.error("操作失败:" + e.getMessage());
            throw new JeecgBootException("操作失败:" + e.getMessage());
        }
    }
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamWeekMaintenanceOrderServiceImpl.java
@@ -21,19 +21,15 @@
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.eam.constant.BusinessCodeConst;
import org.jeecg.modules.eam.constant.OrderCreationMethodEnum;
import org.jeecg.modules.eam.constant.WeekMaintenanceStatusEnum;
import org.jeecg.modules.eam.aspect.annotation.EquipmentHistoryLog;
import org.jeecg.modules.eam.constant.*;
import org.jeecg.modules.eam.entity.EamEquipment;
import org.jeecg.modules.eam.entity.EamWeekMaintenanceOrder;
import org.jeecg.modules.eam.entity.EamWeekMaintenanceOrderDetail;
import org.jeecg.modules.eam.mapper.EamWeekMaintenanceOrderMapper;
import org.jeecg.modules.eam.request.EamWeekMaintenanceQuery;
import org.jeecg.modules.eam.request.EamWeekMaintenanceRequest;
import org.jeecg.modules.eam.service.IEamEquipmentService;
import org.jeecg.modules.eam.service.IEamReportRepairService;
import org.jeecg.modules.eam.service.IEamWeekMaintenanceOrderDetailService;
import org.jeecg.modules.eam.service.IEamWeekMaintenanceOrderService;
import org.jeecg.modules.eam.service.*;
import org.jeecg.modules.flowable.apithird.business.entity.FlowMyBusiness;
import org.jeecg.modules.flowable.apithird.business.service.IFlowMyBusinessService;
import org.jeecg.modules.flowable.apithird.service.FlowCallBackServiceI;
@@ -82,6 +78,8 @@
    private IEamEquipmentService eamEquipmentService;
    @Autowired
    private IEamReportRepairService eamReportRepairService;
    @Autowired
    private IEamEquipmentExtendService eamEquipmentExtendService;
    @Override
    @Transactional(rollbackFor = Exception.class)
@@ -133,6 +131,8 @@
                eamWeekMaintenanceOrderMapper.updateById(order);
                return result.isSuccess();
            }
            //更新设备保养状态
            eamEquipmentExtendService.updateEquipmentMaintenanceStatus(order.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_MAINTENANCE.name());
        }
        return true;
@@ -253,6 +253,8 @@
                eamWeekMaintenanceOrderMapper.updateById(entity);
                return result.isSuccess();
            }
            //更新设备保养状态
            eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_MAINTENANCE.name());
        }
        return true;
    }
@@ -291,6 +293,8 @@
        variables.put("NextAssignee", usernames);
        Result result = flowDefinitionService.startProcessInstanceByKey("week_maintenance_process", variables);
        if (result != null) {
            //更新设备保养状态
            eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.UNDER_MAINTENANCE.name());
            return result.isSuccess();
        }
        return true;
@@ -298,7 +302,8 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean approval(EamWeekMaintenanceRequest request) {
    @EquipmentHistoryLog(operationTag = EquipmentOperationTagEnum.WEEK_MAINTENANCE, businessTable = "eam_week_maintenance_order")
    public EamWeekMaintenanceOrder approval(EamWeekMaintenanceRequest request) {
        EamWeekMaintenanceOrder entity = eamWeekMaintenanceOrderMapper.selectById(request.getId());
        if (entity == null) {
            throw new JeecgBootException("审批的数据已删除,请刷新重试!");
@@ -331,7 +336,7 @@
        WeekMaintenanceStatusEnum status = WeekMaintenanceStatusEnum.getInstance(entity.getMaintenanceStatus());
        if (status == null) {
            return false;
            return null;
        }
        //流程变量
        Map<String, Object> values = new HashMap<>();
@@ -366,6 +371,8 @@
                if (CollectionUtil.isNotEmpty(request.getTableDetailList())) {
                    eamWeekMaintenanceOrderDetailService.updateBatchById(request.getTableDetailList());
                }
                //更新设备保养状态
                eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.WAIT_CONFIRM.name());
                break;
            case WAIT_CONFIRM:
                if(StringUtils.isBlank(equipment.getEquipmentManager())) {
@@ -448,6 +455,8 @@
                        log.error("JSON转换失败:" + e.getMessage(), e);
                    }
                }
                //更新设备保养状态
                eamEquipmentExtendService.updateEquipmentMaintenanceStatus(entity.getEquipmentId(), EquipmentMaintenanceStatus.NORMAL.name());
                break;
        }
        request.setValues(values);
@@ -459,7 +468,7 @@
        }
        //保存工单
        eamWeekMaintenanceOrderMapper.updateById(entity);
        return true;
        return entity;
    }
    @Override