| | |
| | | import org.jeecg.modules.dnc.response.*; |
| | | import org.jeecg.modules.dnc.service.*; |
| | | import org.jeecg.modules.dnc.utils.ValidateUtil; |
| | | import org.jeecg.modules.mdc.entity.MdcEquipment; |
| | | import org.jeecg.modules.mdc.service.IMdcEquipmentService; |
| | | import org.jeecg.modules.system.entity.MdcProduction; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private IProcessSpecVersionService processSpecVersionService; |
| | | @Autowired |
| | | @Lazy |
| | | private IDeviceInfoService deviceInfoService; |
| | | private IMdcEquipmentService mdcEquipmentService; |
| | | @Autowired |
| | | private IPermissionStreamNewService permissionStreamNewService; |
| | | @Autowired |
| | |
| | | private IDocInfoService docInfoService; |
| | | @Autowired |
| | | private IDeviceTypeService deviceTypeService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public boolean addProcessStream(ProcessStream stream) { |
| | |
| | | boolean b = super.updateById(stream); |
| | | //同步修改结构树 |
| | | ProductMix productMix = productMixService.getById(Long.parseLong(id)); |
| | | productMix.setName(stream.getProcessName()); |
| | | productMix.setCode(stream.getProcessCode()); |
| | | productMix.setTreeName(stream.getProcessName()); |
| | | productMix.setTreeCode(stream.getProcessCode()); |
| | | productMixService.updateById(productMix); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | |
| | | public List<ProcessStream> validateDeviceProcessInfo(String pnCode, String deviceNo) { |
| | | if(!ValidateUtil.validateString(pnCode) || !ValidateUtil.validateString(deviceNo)) |
| | | ExceptionCast.cast(CommonCode.INVALID_PARAM); |
| | | DeviceInfo deviceInfo = deviceInfoService.getByDeviceNo(deviceNo); |
| | | if(deviceInfo == null) |
| | | MdcEquipment mdcEquipment = mdcEquipmentService.findEquipmentNameByEquipmentId(deviceNo); |
| | | if(mdcEquipment == null) |
| | | ExceptionCast.cast(DeviceCode.DEVICE_NOT_EXIST); |
| | | PermissionStream stream = componentInfoService.validateComponentOrPartsPnCode(pnCode); |
| | | if(stream == null) |
| | |
| | | List<String> id =new ArrayList<>(); |
| | | id.add(treeInfoRequest.getAttributionId()); |
| | | treeInfoRequest.setProcessIds(id); |
| | | List<DocInfo> processSpecVersions = workStepService.getByWorkStepOtherFile(treeInfoRequest); |
| | | docInfos.addAll(processSpecVersions); |
| | | List<DocInfo> workSteps = workStepService.getByWorkStepOtherFile(treeInfoRequest); |
| | | docInfos.addAll(workSteps); |
| | | } |
| | | } |
| | | return docInfos; |