lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamEquipmentSealUpServiceImpl.java
@@ -18,12 +18,12 @@
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.AssetStatusEnum;
import org.jeecg.modules.eam.constant.BusinessCodeConst;
import org.jeecg.modules.eam.constant.EquipmentLeanOutStatusEnum;
import org.jeecg.modules.eam.constant.EquipmentOperationTagEnum;
import org.jeecg.modules.eam.constant.EquipmentSealUpStatusEnum;
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.EamEquipmentSealUpMapper;
import org.jeecg.modules.eam.request.EamEquipmentSealUpQuery;
@@ -124,7 +124,6 @@
        } else {
            queryWrapper.orderByDesc("wmo.create_time");
        }
        return equipmentSealUpMapper.queryPageList(page, queryWrapper);
    }
@@ -137,11 +136,11 @@
            throw new JeecgBootException("设备不存在!");
        }
        if (!AssetStatusEnum.NORMAL.name().equals(equipment.getAssetStatus())) {
            throw new JeecgBootException("此设备当前资产状态不允许借出!");
            throw new JeecgBootException("此设备当前资产状态不允许封存!");
        }
        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        if (sysUser == null) {
            throw new JeecgBootException("当前用户无法添加借用记录!");
            throw new JeecgBootException("当前用户无法添加封存记录!");
        }
        request.setReportUser(sysUser.getUsername());
        return equipmentSealUpMapper.insert(request) > 0;
@@ -162,9 +161,12 @@
        if (equipment == null) {
            throw new JeecgBootException("设备不存在!");
        }
        if (!AssetStatusEnum.NORMAL.name().equals(equipment.getAssetStatus())) {
            throw new JeecgBootException("此设备当前资产状态不允许封存!");
        }
        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
        if (sysUser == null) {
            throw new JeecgBootException("当前用户无法编辑借用记录!");
            throw new JeecgBootException("当前用户无法编辑封存记录!");
        }
        UpdateWrapper<EamEquipmentSealUp> updateWrapper = new UpdateWrapper<>();
        updateWrapper.set("equipment_id", request.getEquipmentId());
@@ -213,7 +215,7 @@
        if (result != null) {
            entity.setSealEndTime(new Date());
            entity.setSealStatus(EquipmentSealUpStatusEnum.WAIT_UNSEALING_AUDIT.name());
               //保存工单
            //保存工单
            equipmentSealUpMapper.updateById(entity);
            return result.isSuccess();
        }
@@ -281,6 +283,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    @EquipmentHistoryLog(operationTag = EquipmentOperationTagEnum.SEAL_UP, businessTable = "eam_equipment_seal_up")
    public EamEquipmentSealUp approval(EamEquipmentSealUpRequest request) {
        EamEquipmentSealUp entity = equipmentSealUpMapper.selectById(request.getId());
        if (entity == null) {
@@ -320,7 +323,7 @@
        Map<String, Object> values = new HashMap<>();
        switch (status) {
            // 审批
            case WAIT_UNSEALING_AUDIT:
            case WAIT_CHECK:
                //执行完成
                values.put("dataId", entity.getId());
                values.put("organization", request.getApprovalComment());
@@ -339,14 +342,14 @@
                    values.put("NextAssignee", userApprovalList);
                } else {
                    //设置entity
                    entity.setSealStatus(EquipmentSealUpStatusEnum.WAIT_SUBMIT.name());
                    entity.setSealStatus(EquipmentSealUpStatusEnum.COMPLETE.name());
                    // 修改设备状态
                    equipment.setAssetStatus(AssetStatusEnum.NORMAL.name());
                    eamEquipmentService.updateById(equipment);
                }
                break;
            // 已封存
            case SEALED:
            case WAIT_UNSEALING_AUDIT:
                values.put("dataId", entity.getId());
                values.put("organization", request.getUnsealApprovalComment());
                values.put("comment", request.getUnsealApprovalComment());
@@ -360,11 +363,11 @@
                } else {
                    //设置entity
                    entity.setSealStatus(EquipmentSealUpStatusEnum.SEALED.name());
                    entity.setSealEndTime(null);
                }
                entity.setUnsealApprovalUser(user.getUsername());
                entity.setUnsealApprovalComment(request.getUnsealApprovalComment());
                entity.setUnsealApprovalTime(new Date());
                // 修改设备状态
                equipment.setAssetStatus(AssetStatusEnum.NORMAL.name());
                eamEquipmentService.updateById(equipment);