| | |
| | | |
| | | |
| | | import com.vci.server.base.utility.LogHelper; |
| | | import com.vci.server.framework.systemConfig.log.LogRecordUtil; |
| | | import com.vci.server.base.utility.LogRecordUtil; |
| | | import com.vci.server.framework.systemConfig.security.MachSecurity; |
| | | import com.vci.server.framework.systemConfig.security.MachSecurityService; |
| | | import com.vci.common.log.LogType; |
| | | import com.vci.common.utility.ObjectUtility; |
| | | import com.vci.corba.common.VCIError; |
| | | import com.vci.corba.framework.data.MachSecurityInfo; |
| | | import com.vci.corba.log.data.LogType; |
| | | import com.vci.corba.common.data.UserEntityInfo; |
| | | |
| | | import com.vci.server.base.delegate.BaseDelegate; |
| | |
| | | service.saveMachSecurity(security); |
| | | |
| | | String log = String.format("添加机器密级:%s [%s]", security.getName(), LogHelper.toNewLogString(security)); |
| | | LogRecordUtil.writeLog(userEntity, "添加", "成功", log, LogType.GeneralOperation, security.getId()); |
| | | LogRecordUtil.writeLog(userInfo, "添加", "成功", log, LogType.General, security.getId()); |
| | | } catch (Exception e) { |
| | | throw new VCIError("120315", new String[0]); |
| | | } |
| | |
| | | machService.saveMachSecurities(securities); |
| | | |
| | | String log = String.format("添加机器密级对象:%s", String.join(";", ids)); |
| | | LogRecordUtil.writeLog(userEntity, "添加", "成功", log, LogType.GeneralOperation, id); |
| | | LogRecordUtil.writeLog(userInfo, "添加", "成功", log, LogType.General, id); |
| | | } catch (Exception e) { |
| | | throw new VCIError("120316", new String[0]); |
| | | } |
| | |
| | | } |
| | | |
| | | |
| | | public boolean updateMachSecurity(MachSecurityInfo info, UserEntityInfo userEnt) throws VCIError { |
| | | this.setUserEntityInfo(userEnt); |
| | | public boolean updateMachSecurity(MachSecurityInfo info, UserEntityInfo userInfo) throws VCIError { |
| | | this.setUserEntityInfo(userInfo); |
| | | |
| | | boolean rs = true; |
| | | MachSecurity ent = changeInfoToEntity(info); |
| | |
| | | LogHelper.toUpdataLogString(old, ent)); |
| | | |
| | | if (rs) |
| | | LogRecordUtil.writeLog(userEntity, "更新", "成功", log, LogType.GeneralOperation, ent.getId()); |
| | | LogRecordUtil.writeLog(userInfo, "更新", "成功", log, LogType.General, ent.getId()); |
| | | else |
| | | LogRecordUtil.writeLog(userEntity, "更新", "失败", log, LogType.GeneralOperation, ent.getId()); |
| | | LogRecordUtil.writeLog(userInfo, "更新", "失败", log, LogType.General, ent.getId()); |
| | | |
| | | return rs; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | public boolean batchUpdateMachSecurity(MachSecurityInfo[] infos, UserEntityInfo userEnt) throws VCIError { |
| | | this.setUserEntityInfo(userEnt); |
| | | public boolean batchUpdateMachSecurity(MachSecurityInfo[] infos, UserEntityInfo userInfo) throws VCIError { |
| | | this.setUserEntityInfo(userInfo); |
| | | |
| | | MachSecurity[] securities = new MachSecurity[infos.length]; |
| | | String[] ids = new String[infos.length]; |
| | |
| | | MachSecurityService machService = new MachSecurityService(userEntity); |
| | | machService.updateMachSecurities(securities); |
| | | |
| | | LogRecordUtil.writeLog(userEntity, "更新", "成功", log, LogType.GeneralOperation, ids[0]); |
| | | LogRecordUtil.writeLog(userInfo, "更新", "成功", log, LogType.General, ids[0]); |
| | | |
| | | return true; |
| | | } catch (Exception e) { |
| | | LogRecordUtil.writeLog(userEntity, "更新", "失败", log, LogType.GeneralOperation, ids[0]); |
| | | LogRecordUtil.writeLog(userInfo, "更新", "失败", log, LogType.General, ids[0]); |
| | | throw new VCIError("120318", new String[0]); |
| | | } |
| | | } |