| | |
| | | private INcLogInfoService iNcLogInfoService; |
| | | @Autowired |
| | | private IDocRelativeService iDocRelativeService; |
| | | @Autowired |
| | | private IProductPermissionService productPermissionService; |
| | | @Override |
| | | @Transactional(rollbackFor = {Exception.class}) |
| | | public boolean addPartsInfo(PartsInfo partsInfo) { |
| | |
| | | } |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | PartsPermission permission = new PartsPermission(); |
| | | permission.setPartsId(partsInfo.getPartsId()); |
| | | permission.setUserId(userId); |
| | | b = partsPermissionService.save(permission); |
| | | if(!b) |
| | | ExceptionCast.cast(CommonCode.FAIL); |
| | | b = productPermissionService.add(partsInfo.getPartsId(), userId,"3"); |
| | | if (!b) { |
| | | ExceptionCast.cast(ProductInfoCode.PRODUCT_SAVE_ERROR); |
| | | } |
| | | //添加用户权限 |
| | | PermissionStream stream = new PermissionStream(); |
| | | stream.setProductId(partsInfo.getProductId()); |
| | |
| | | partsInfo.setPartsStatus(null); |
| | | partsInfo.setProductId(null); |
| | | partsInfo.setComponentId(null); |
| | | //添加日志 |
| | | NcLogInfo ncLogInfo = new NcLogInfo(); |
| | | //模块 |
| | | ncLogInfo.setModuleInfo("产品结构树"); |
| | | //类型 |
| | | ncLogInfo.setOperateType(3); |
| | | //修改保存备注 |
| | | ncLogInfo.setRemark(JSONObject.toJSONString(en)); |
| | | //日志内容 |
| | | ncLogInfo.setLogContent("修改部件名称:"+productInfoMapper.selectById(en.getProductId()).getProductName()+"子集零件"); |
| | | iNcLogInfoService.saveLogNcInfos(ncLogInfo); |
| | | boolean b = super.updateById(partsInfo); |
| | | if(!b) |
| | | return false; |