zhangherong
2025-04-18 1800c05a61a53d528e4f137fa42413cb0bf26734
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamWeekMaintenanceOrderServiceImpl.java
@@ -3,6 +3,7 @@
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -367,6 +368,9 @@
                }
                break;
            case WAIT_CONFIRM:
                if(StringUtils.isBlank(equipment.getEquipmentManager())) {
                    throw new JeecgBootException("设备未分配设备管理员,无法进入下级审批!");
                }
                //班组长确认
                userApprovalList = new ArrayList<>();
                userApprovalList.add(equipment.getEquipmentManager());
@@ -381,6 +385,7 @@
                entity.setConfirmUser(user.getUsername());
                entity.setConfirmComment(request.getConfirmComment());
                entity.setConfirmTime(new Date());
                entity.setConfirmDealType(request.getConfirmDealType());
                if (CommonConstant.HAS_CANCLE.equals(request.getConfirmDealType())) {
                    //驳回
                    userApprovalList = new ArrayList<>();
@@ -397,7 +402,7 @@
            case WAIT_INITIAL_ACCEPTANCE:
                userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getOrgId(), BusinessCodeConst.PCR0005);
                if (CollectionUtil.isEmpty(userSelectors)) {
                    throw new JeecgBootException("设备未分配给班组长,无法进入下级审批!");
                    throw new JeecgBootException("设备未分配给设能部管理员,无法进入下级审批!");
                }
                userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList());
                values.put("dataId", entity.getId());
@@ -457,6 +462,18 @@
        return true;
    }
    @Override
    public List<EamWeekMaintenanceOrder> selectUnCompleteOrder(String expiredDate) {
        LambdaQueryWrapper<EamWeekMaintenanceOrder> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.lt(EamWeekMaintenanceOrder::getMaintenanceDate, expiredDate);
        List<String> unCompleteStatus = new ArrayList<>();
        unCompleteStatus.add(WeekMaintenanceStatusEnum.WAIT_MAINTENANCE.name());
        unCompleteStatus.add(WeekMaintenanceStatusEnum.UNDER_MAINTENANCE.name());
        queryWrapper.in(EamWeekMaintenanceOrder::getMaintenanceStatus, unCompleteStatus);
        queryWrapper.orderByAsc(EamWeekMaintenanceOrder::getMaintenanceDate);
        return eamWeekMaintenanceOrderMapper.selectList(queryWrapper);
    }
    private boolean isUserAuthorized(FlowMyBusiness flowMyBusiness, LoginUser user) {
        List<String> todoUsers = JSON.parseArray(flowMyBusiness.getTodoUsers(), String.class);
        return todoUsers != null && todoUsers.contains(user.getUsername());