| | |
| | | @Autowired |
| | | private IWorkStepService workStepService; |
| | | @Autowired |
| | | private IPermissionStreamService permissionStreamService; |
| | | private IPermissionStreamNewService permissionStreamNewService; |
| | | @Autowired |
| | | private IDocClassificationService classificationService; |
| | | @Autowired |
| | |
| | | private ISynchronizedFlagService synchronizedFlagService; |
| | | @Autowired |
| | | private IDeviceGroupService deviceGroupService; |
| | | @Autowired |
| | | private IDncPassLogService dncPassLogService; |
| | | @Autowired |
| | | private IDeviceCharactersService iDeviceCharactersService; |
| | | @Autowired |
| | |
| | | if (deviceDoc != null) { |
| | | handleExistingDeviceDoc(docFile, mdcEquipment, stream.getDeviceId()); |
| | | } |
| | | List<PermissionStream> permissionStreams = getPermissionStreams(stream); |
| | | PermissionStreamNew permissionStreams = getPermissionStreams(stream); |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | String userId = user.getId(); |
| | | saveBusinessObject(stream, userId); |
| | |
| | | } |
| | | |
| | | //权限校验 |
| | | private List<PermissionStream> getPermissionStreams(AssignFileStream stream) { |
| | | List<PermissionStream> permissionStreams = new ArrayList<>(); |
| | | private PermissionStreamNew getPermissionStreams(AssignFileStream stream) { |
| | | PermissionStreamNew permissionStreams; |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | if (stream.getAttributionType().equals("5")) { |
| | | // 工序 |
| | | ProcessStream processStream = processStreamService.getById(stream.getAttributionId()); |
| | |
| | | stream.setComponentId(processStream.getComponentId()); |
| | | stream.setPartsId(processStream.getPartsId()); |
| | | stream.setProcessId(processStream.getProcessId()); |
| | | permissionStreams = permissionStreamService |
| | | .getByProcessId(processStream.getProductId(), processStream.getComponentId(), processStream.getPartsId(), processStream.getProcessId()); |
| | | permissionStreams = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(processStream.getProcessId(),user.getId(),"5"); |
| | | } else { |
| | | // 工步 |
| | | WorkStep workStep = workStepService.getById(stream.getAttributionId()); |
| | |
| | | stream.setPartsId(workStep.getPartsId()); |
| | | stream.setProcessId(workStep.getProcessId()); |
| | | stream.setStepId(workStep.getId()); |
| | | permissionStreams = permissionStreamService |
| | | .getByStepId(workStep.getProductId(), workStep.getComponentId(), workStep.getPartsId(), workStep.getProcessId(), workStep.getId()); |
| | | permissionStreams = permissionStreamNewService.loadPermissionStreamNewByBusinessIdAndUserId(workStep.getId(),user.getId(),"6"); |
| | | } |
| | | if (permissionStreams == null || permissionStreams.isEmpty()) { |
| | | if (permissionStreams == null ) { |
| | | ExceptionCast.cast(ActivitiCode.ACT_NODE_DEPART_NONE); |
| | | } |
| | | return permissionStreams; |
| | |
| | | if (strings != null && !strings.isEmpty()) { |
| | | String path = StringUtils.join(strings.toArray(), "/"); |
| | | Date dateFirst = DateUtil.getNow(); |
| | | DncPassLog passInfoTxt = new DncPassLog(); |
| | | passInfoTxt.setDayTime(DateUtil.format(dateFirst, DateUtil.STR_YEARMONTHDAY)); |
| | | DncPassLog dncPassLog = dncPassLogService.findDayTime(DateUtil.format(dateFirst, DateUtil.STR_YEARMONTHDAY)); |
| | | Integer fileTxt = 0, fileNc = 0; |
| | | if (dncPassLog != null) { |
| | | fileTxt = dncPassLog.getSequenceNumber() + 1; |
| | | fileNc = fileTxt + 1; |
| | | } else { |
| | | fileTxt = 1; |
| | | fileNc = fileTxt + 1; |
| | | } |
| | | String sequence = String.format("%06d", fileTxt); |
| | | String sequenceNc = String.format("%06d", fileNc); |
| | | passInfoTxt.setSequenceNumber(fileTxt); |
| | | passInfoTxt.setSequenceOrder(sequence); |
| | | passInfoTxt.setCreateTime(dateFirst); |
| | | passInfoTxt.setPassType("02"); |
| | | dncPassLogService.save(passInfoTxt); |
| | | |
| | | DncPassLog passInfoNc = new DncPassLog(); |
| | | passInfoNc.setSequenceNumber(fileNc); |
| | | passInfoNc.setSequenceOrder(sequenceNc); |
| | | passInfoNc.setDayTime(DateUtil.format(dateFirst, DateUtil.STR_YEARMONTHDAY)); |
| | | passInfoNc.setPassType("02"); |
| | | passInfoNc.setPassName(docFile.getFileName()); |
| | | try { |
| | | Thread.sleep(1000); |
| | | Date date = new Date(); |
| | | passInfoNc.setCreateTime(date); |
| | | } catch (InterruptedException e) { |
| | | Thread.currentThread().interrupt(); |
| | | } |
| | | dncPassLogService.save(passInfoNc); |
| | | |
| | | NcTxtFilePathInfo ncTxt = new NcTxtFilePathInfo(); |
| | | ncTxt.setEquipmentId(mdcEquipment.getEquipmentId()); |
| | | ncTxt.setFileNcName("02A" + DateUtil.format(dateFirst, DateUtil.STR_YEARMONTHDAY) + sequenceNc); |
| | | ncTxt.setFileTxtName("02A" + DateUtil.format(dateFirst, DateUtil.STR_YEARMONTHDAY) + sequence); |
| | | ncTxt.setFileNcName("02A" + DateUtil.format(dateFirst, DateUtil.STR_YEARMONTHDAY)); |
| | | ncTxt.setFileTxtName("02A" + DateUtil.format(dateFirst, DateUtil.STR_YEARMONTHDAY)); |
| | | ncTxt.setFilePath(path + "/" + mdcEquipment.getEquipmentId() + "/"); |
| | | ncTxt.setOrigFileName(docFile.getFileName()); |
| | | ncTxt.setOrigFileSuffix(docFile.getFileSuffix()); |