| | |
| | | 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; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description: 点检工单 |
| | |
| | | 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", "点检人点检结束"); |