| | |
| | | @Autowired |
| | | private IDocInfoService docInfoService; |
| | | @Autowired |
| | | private INcLogInfoService iNcLogInfoService; |
| | | @Autowired |
| | | private IDocRelativeService iDocRelativeService; |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | |
| | | } |
| | | |
| | | componentInfo.setComponentStatus(1); |
| | | //添加日志 |
| | | NcLogInfo ncLogInfo = new NcLogInfo(); |
| | | //模块 |
| | | ncLogInfo.setModuleInfo("产品结构树"); |
| | | //类型 |
| | | ncLogInfo.setOperateType(2); |
| | | //日志内容 |
| | | ncLogInfo.setLogContent("部件名称:"+componentInfo.getComponentName()+",部件代号:"+componentInfo.getComponentCode()); |
| | | iNcLogInfoService.saveLogNcInfos(ncLogInfo); |
| | | boolean b = super.save(componentInfo); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | } |
| | | ComponentPermission permission = new ComponentPermission(); |
| | | permission.setComponentId(componentInfo.getComponentId()); |
| | | permission.setUserId(userId); |
| | | b = componentPermissionService.save(permission); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = productPermissionService.add(componentInfo.getComponentId(), userId,"2"); |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //去除默认新增工序,转为手动添加 |
| | | /*/添加默认工序 |
| | | ProcessStream processStream = new ProcessStream(); |
| | | processStream.setProductId(componentInfo.getProductId()); |
| | | processStream.setComponentId(componentInfo.getComponentId()); |
| | | processStream.setProcessCode("1"); |
| | | //添加日志 |
| | | NcLogInfo ncLogInfogx = new NcLogInfo(); |
| | | //模块 |
| | | ncLogInfogx.setModuleInfo("产品结构树"); |
| | | //类型 |
| | | ncLogInfogx.setOperateType(2); |
| | | //日志内容 |
| | | ncLogInfogx.setLogContent("部件名称:"+componentInfo.getComponentName()+"生成默认工序,工序号:"+processStream.getProcessCode()); |
| | | iNcLogInfoService.saveLogNcInfos(ncLogInfogx); |
| | | b = processStreamService.save(processStream); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL);*/ |
| | | //添加权限 |
| | | PermissionStream stream = new PermissionStream(); |
| | | stream.setUserId(userId); |
| | |
| | | componentInfo.setComponentStatus(null); |
| | | componentInfo.setRankLevel(null); |
| | | componentInfo.setProductId(null); |
| | | //添加日志 |
| | | NcLogInfo ncLogInfo = new NcLogInfo(); |
| | | //模块 |
| | | ncLogInfo.setModuleInfo("产品结构树"); |
| | | //类型 |
| | | ncLogInfo.setOperateType(3); |
| | | //日志内容 |
| | | ncLogInfo.setLogContent("修改部件名称:"+productInfoMapper.selectById(en.getProductId()).getProductName()+"子集部件"); |
| | | //修改保存备注 |
| | | ncLogInfo.setRemark(JSONObject.toJSONString(en)); |
| | | iNcLogInfoService.saveLogNcInfos(ncLogInfo); |
| | | boolean b = super.updateById(componentInfo); |
| | | if(!b) |
| | | return false; |