cuilei
2025-06-20 ac4d1a5962441156ff22a0c87f4eacc083daa9a6
lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java
@@ -35,13 +35,13 @@
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.vo.InspectionVo;
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;
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 +50,6 @@
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
/**
 * @Description: 点检工单
@@ -197,8 +196,7 @@
        } else {
            eamInspectionOrder.setEquipmentCode(equipment.getEquipmentCode());
        }
        System.out.println("设备点检:" + eamInspectionOrder.getId());
        flowCommonService.initActBusiness("工单号:" + eamInspectionOrder.getOrderNum() + "设备编号" + eamInspectionOrder.getEquipmentCode() + "进行设备点检",
        flowCommonService.initActBusiness("工单号: " + eamInspectionOrder.getOrderNum() + ";设备编号: " + eamInspectionOrder.getEquipmentCode() + ";安装位置: " + equipment.getInstallationPosition(),
                eamInspectionOrder.getId(), "IEamInspectionOrderService", "eam_inspection", null);
        Map<String, Object> variables = new HashMap<>();
        variables.put("dataId", eamInspectionOrder.getId());
@@ -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", "点检人点检结束");
@@ -547,4 +541,19 @@
        Object object = values.get("NextAssignee");
        return (List<String>) object;
    }
    @Override
    public List<InspectionVo> findInspectionResult(String equipmentId,String itemDemand,String yearMonth) {
        return this.baseMapper.findInspectionResult(equipmentId,itemDemand,yearMonth);
    }
    @Override
    public List<InspectionVo> findInspectionUser(String equipmentId,String yearMonth) {
        return this.baseMapper.findInspectionUser(equipmentId,yearMonth);
    }
    @Override
    public List<Map<String, Object>> findInspectionStandard(String equipmentId) {
        return this.baseMapper.findInspectionStandard(equipmentId);
    }
}