| | |
| | | import org.jeecg.modules.eam.constant.BusinessCodeConst; |
| | | import org.jeecg.modules.eam.constant.EamReportAccidentsRegisterEnum; |
| | | import org.jeecg.modules.eam.constant.EamReportProductHazardsEnum; |
| | | import org.jeecg.modules.eam.constant.SecondMaintenanceStatusEnum; |
| | | import org.jeecg.modules.eam.dto.EamReportProductHazardsDto; |
| | | import org.jeecg.modules.eam.dto.EamReportProductHazardsDto; |
| | | import org.jeecg.modules.eam.entity.EamEquipment; |
| | | import org.jeecg.modules.eam.entity.EamReportAccidentsRegister; |
| | |
| | | values.put("comment", eamReportProductHazardsDto.getDeputyDepartmentComment()); |
| | | values.put("deputyDepartmentResult", eamReportProductHazardsDto.getDeputyDepartmentResult()); |
| | | eamReportProductHazardsDto.setComment(eamReportProductHazardsDto.getDeputyDepartmentComment()); |
| | | eamReportProductHazards.setDeputyDepartment(user.getUsername()); |
| | | eamReportProductHazards.setDeputyDepartmentTime(new Date()); |
| | | eamReportProductHazards.setDeputyDepartmentResult(eamReportProductHazardsDto.getDeputyDepartmentResult()); |
| | | eamReportProductHazards.setDeputyDepartmentComment(eamReportProductHazardsDto.getDeputyDepartmentComment()); |
| | | |
| | | if ("2".equals(eamReportProductHazardsDto.getDeputyDepartmentResult())){ |
| | | //副部级领导拒绝 |
| | | eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.REJECTED.name()); |
| | | userSelectors = sysUserService.selectOperatorList(equipment.getEquipmentCode(), equipment.getFactoryOrgCode(), BusinessCodeConst.PCR0024); |
| | | if (CollectionUtil.isEmpty(userSelectors)) { |
| | | throw new JeecgBootException("设备未存在主管工艺,无法进入驳回操作!"); |
| | | }else { |
| | | userApprovalList = userSelectors.stream().map(UserSelector::getUsername).collect(Collectors.toList()); |
| | | values.put("NextAssignee", userApprovalList); |
| | | //副部级领导拒绝 |
| | | eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.PENDING_SUPERIOR_TECHNICAL_CONFIRMATION.name()); |
| | | eamReportProductHazards.setTechnologist(null); |
| | | eamReportProductHazards.setTechnologistTime(null); |
| | | eamReportProductHazards.setTechnologistResult(null); |
| | | eamReportProductHazards.setTechnologistComment(null); |
| | | } |
| | | }else { |
| | | eamReportProductHazards.setConfirmStatus(EamReportProductHazardsEnum.REPAIR_COMPLETED.name()); |
| | | eamReportProductHazards.setDeputyDepartment(user.getUsername()); |
| | | eamReportProductHazards.setDeputyDepartmentTime(new Date()); |
| | | eamReportProductHazards.setDeputyDepartmentResult(eamReportProductHazardsDto.getDeputyDepartmentResult()); |
| | | eamReportProductHazards.setDeputyDepartmentComment(eamReportProductHazardsDto.getDeputyDepartmentComment()); |
| | | } |
| | | break; |
| | | default: |
| | |
| | | return true; |
| | | } |
| | | |
| | | /** |
| | | * 产品安全隐患确认打印 |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<EamReportProductHazardsDto> findListByIds(String ids){ |
| | | QueryWrapper<EamReportProductHazardsDto> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("erph.del_flag",CommonConstant.DEL_FLAG_0.toString()); |
| | | queryWrapper.eq("erph.confirm_status",EamReportProductHazardsEnum.REPAIR_COMPLETED.name() ); |
| | | //用户数据权限 |
| | | LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (sysUser == null) { |
| | | return new ArrayList<>(); |
| | | } |
| | | if (StringUtils.isNotBlank(sysUser.getEamEquipmentIds())) { |
| | | //选择了设备,根据设备id过滤设备 |
| | | List<String> equipArr = Arrays.asList(sysUser.getEamEquipmentIds().split(",")); |
| | | queryWrapper.in("e.equipment_code", equipArr); |
| | | } else { |
| | | //没有选择设备,根据中心过滤设备 |
| | | List<BaseFactoryUser> baseFactoryUserList=baseFactoryUserService. |
| | | list(new LambdaQueryWrapper<BaseFactoryUser>().eq(BaseFactoryUser::getUserId,sysUser.getId())); |
| | | if(!CollectionUtils.isEmpty(baseFactoryUserList)){ |
| | | Set<String> factoryIds = baseFactoryUserList.stream().map(BaseFactoryUser::getFactoryId).collect(Collectors.toSet()); |
| | | Set<String> factoryCode= baseFactoryService.listByIds(factoryIds).stream().map(BaseFactory::getOrgCode).collect(Collectors.toSet()); |
| | | queryWrapper.in("e.factory_org_code", factoryCode); |
| | | } else { |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | //查询条件过滤 |
| | | if (StrUtil.isNotEmpty(ids)) { |
| | | List<String> idList = Arrays.asList(ids.split(",")); |
| | | queryWrapper.in("erph.id", idList); |
| | | } else { |
| | | queryWrapper.orderByDesc("erph.create_time"); |
| | | } |
| | | return this.baseMapper.queryList(queryWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void afterFlowHandle(FlowMyBusiness business) { |
| | | |