ludc
2025-01-16 986aa62ed00bee39363bab41b4eeb8259d446efd
Source/Service/FrameService/src/com/vci/server/framework/volume/delegate/PvolumeDelegate.java
@@ -5,19 +5,19 @@
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import com.vci.common.log.LogType;
import com.vci.common.objects.UserEntity;
import com.vci.common.utility.ObjectUtility;
import com.vci.corba.common.VCIError;
import com.vci.corba.common.data.UserEntityInfo;
import com.vci.corba.framework.data.PvolumeInfo;
import com.vci.corba.log.data.LogType;
import com.vci.server.base.delegate.BaseDelegate;
import com.vci.server.base.delegate.UserEntityDelegate;
import com.vci.server.base.utility.LogRecordUtil;
import com.vci.server.cache.VolumeCacheProvider;
import com.vci.server.framework.systemConfig.log.LogRecordUtil;
import com.vci.server.framework.cache.VolumeCatch;
import com.vci.server.framework.volume.dao.Pvolume;
import com.vci.server.framework.volume.service.PvolumeService;
import com.vci.server.framework.volume.service.VolumeCatch;
public class PvolumeDelegate extends BaseDelegate {   
@@ -46,14 +46,14 @@
      }
      
      Pvolume pvolume = changePvolumeInfoToPvolume(pvolumeInfo);
      UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo);
      //UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo);
      try {
         //createFileCabinet(pvolume.getPath());
         boolean success = pvoSer.savePvolume(pvolume);
         if (success) {
            VolumeCatch.setVolume(pvolumeInfo);
         }
         LogRecordUtil.writeLog(userEntity, "添加", success ? "添加成功" : "添加失败", pvolume.getLogInfo(),LogType.GeneralOperation,pvolume.getId());
         LogRecordUtil.writeLog(userEntityInfo, "添加", success ? "添加成功" : "添加失败", pvolume.getLogInfo(),LogType.General,pvolume.getId());
      } catch (Exception e) {
         throw new VCIError("310100",new String[0]);
      }
@@ -135,7 +135,7 @@
      
      UserEntityDelegate.setUserEntityToService(pvoSer, userEntityInfo);
      Pvolume  pvolume = changePvolumeInfoToPvolume(pvoInfo);
      UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo);
      //UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo);
      try{
         Pvolume  pvolumeBefore = pvoSer.getProlumeById(pvolume.getId());
         boolean success = pvoSer.updatePvolume(pvolume);
@@ -145,9 +145,9 @@
         StringBuilder logres = new StringBuilder();
         logres.append("更新前:"+pvolumeBefore.getLogInfo());
         logres.append("更新后:"+pvolume.getLogInfo());
         LogRecordUtil.writeLog(userEntity, "更新", success ? "修改成功" : "修改失败", logres.toString(), LogType.GeneralOperation,pvolumeBefore.getId());
         LogRecordUtil.writeLog(userEntityInfo, "更新", success ? "修改成功" : "修改失败", logres.toString(), LogType.General,pvolumeBefore.getId());
      }catch(Exception e){
         LogRecordUtil.writeLog(userEntity, "更新", "修改失败", e.getMessage(), LogType.GeneralOperation, pvoInfo.id);
         LogRecordUtil.writeLog(userEntityInfo, "更新", "修改失败", e.getMessage(), LogType.General, pvoInfo.id);
         throw new VCIError("310103", new String[0]); 
      }
@@ -163,7 +163,7 @@
    */
   public boolean deletePvolume(String[] ids, UserEntityInfo userEntityInfo) throws VCIError {
      UserEntityDelegate.setUserEntityToService(pvoSer, userEntityInfo);
      UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo);
      //UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo);
      try {
         List<Pvolume> list = new ArrayList<Pvolume>();
@@ -176,7 +176,7 @@
         for (Pvolume vol : list) {
            String volId = vol.getId();
            VolumeCatch.delVolume(vol.getName());
            LogRecordUtil.writeLog(userEntity, "删除", "删除成功", volId, LogType.GeneralOperation, vol.getLogInfo());
            LogRecordUtil.writeLog(userEntityInfo, "删除", "删除成功", volId, LogType.General, vol.getLogInfo());
         }
      } catch (Exception e) {
         throw new VCIError("310104", new String[0]);
@@ -191,7 +191,7 @@
   public void updatePvolumeInvalid(UserEntityInfo userEntityInfo)throws VCIError{
      
      UserEntityDelegate.setUserEntityToService(pvoSer, userEntityInfo);
      UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo);
      //UserEntity userEntity = changeUserEntityInfoToUserEntity(userEntityInfo);
      Pvolume pvo = pvoSer.getIsvalidVolumeName();
      try{
         
@@ -202,10 +202,10 @@
            logres.append("更新前:"+pvo.getLogInfo()+"为首选路径!");
            pvo.setIsvalid(false);
            logres.append(" 更新后:"+pvo.getLogInfo()+"不为首选路径");
            LogRecordUtil.writeLog(userEntity, "更新", "修改成功", logres.toString(), LogType.GeneralOperation,pvo.getId());
            LogRecordUtil.writeLog(userEntityInfo, "更新", "修改成功", logres.toString(), LogType.General,pvo.getId());
         }
      }catch(Exception e){
         LogRecordUtil.writeLog(userEntity, "更新", "修改失败", e.getMessage(), LogType.GeneralOperation,pvo.getId());
         LogRecordUtil.writeLog(userEntityInfo, "更新", "修改失败", e.getMessage(), LogType.General,pvo.getId());
         throw new VCIError("310105", new String[0]); 
      }
   }