zhangherong
2025-05-19 cd1e302ccf4526dd6ff98244825dd363b6bb86cb
art: 设备管理-设备点检-流程修改为设备管理员确认
已修改1个文件
16 ■■■■■ 文件已修改
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java
@@ -41,7 +41,6 @@
import org.jeecg.modules.flowable.apithird.service.FlowCommonService;
import org.jeecg.modules.flowable.service.IFlowDefinitionService;
import org.jeecg.modules.flowable.service.IFlowTaskService;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.IMdcUserProductionService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -50,7 +49,6 @@
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
 * @Description: 点检工单
@@ -394,17 +392,13 @@
        Map<String, Object> values = new HashMap<>();
        if (InspectionStatus.UNDER_INSPECTION.name().equals(order.getInspectionStatus()) && user.getUsername().equals(order.getOperator())) {
            // 点检人点检结束
            String orgId = Optional.ofNullable(iEamEquipmentService.getById(order.getEquipmentId()))
                    .map(equipment -> equipment.getOrgId())
            String manager = Optional.ofNullable(iEamEquipmentService.getById(order.getEquipmentId()))
                    .map(EamEquipment::getEquipmentManager)
                    .orElse(null);
            if (orgId == null) {
                throw new IllegalArgumentException("未找到设备的组织 ID");
            if (manager == null) {
                throw new IllegalArgumentException("设备管理员未配置");
            }
            List<SysUser> sysUserList = mdcUserProductionService.queryByPostAndProId("PCR0003", orgId);
            List<String> usernameList = sysUserList.stream().map(SysUser::getUsername).collect(Collectors.toList());
            if (usernameList.isEmpty()) {
                throw new IllegalArgumentException("未找到该设备对应车间的班组长,请联系管理员处理");
            }
            List<String> usernameList = Collections.singletonList(manager);
            values.put("dataId", order.getId());
            values.put("organization", "点检人点检结束");
            values.put("comment", "点检人点检结束");