ludc
2024-10-30 37d730454255d0680c2bc4f1e15dc5cd1a55e6a9
Source/plt-web/plt-web-parent/plt-web/src/main/java/com/vci/frameworkcore/compatibility/impl/OrgDeptQueryServiceImpl.java
@@ -70,7 +70,7 @@
   /**
    * 必填列
    */
   private ArrayList<Integer> ColumnNameisRed = new ArrayList<Integer>();
   private List<Integer> ColumnNameisRed = new ArrayList<Integer>();
   /**
    * 日志
@@ -594,31 +594,13 @@
    * @return
    */
   @Override
   @Transactional(rollbackFor = Exception.class)
   public boolean saveUsersDept(String[] userOIds, String deptId) throws PLException {
      //先进性查重处理
      List<String> repeatUserOidList = new ArrayList<>();
      //循环进行查重,避免in大于1000
      WebUtil.switchCollectionForOracleIn(Arrays.asList(userOIds)).stream().forEach(userOId->{
         String sql = "select pluseruid,pldeptuid from pluserdept where pldeptuid = '" + deptId
               + "' and " + "pluseruid in ("+WebUtil.toInSql(userOId.toArray(new String[0]))+")";
         List<BusinessObject> cbos = boService.queryBySql(sql, null);
         if(!CollectionUtils.isEmpty(cbos)){
            cbos.stream().forEach(cbo->{
               repeatUserOidList.add(ObjectTool.getNewBOAttributeValue(cbo,"pluseruid"));
            });
         }
      });
      //从即将要执行保存的用户oid中移除当前用户已经存在关联关系的oid
      //移除重复的
      List<String> tempList = new ArrayList<>(Arrays.asList(userOIds));
      tempList.removeAll(repeatUserOidList);
      userOIds = tempList.toArray(new String[tempList.size()]);
      if(Func.isNotEmpty(userOIds)){
         platformClientUtil.getFrameworkService().saveUserDept(userOIds, deptId,new UserEntityInfo(WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(),null));
      }
      return true;
      VciBaseUtil.alertNotNull(deptId,"部门主键");
      //为空的话说明是清空当前这个部门下分配的成员
      SessionInfo sessionInfo = WebThreadLocalUtil.getCurrentUserSessionInfoInThread();
      UserEntityInfo userEntityInfo = new UserEntityInfo(sessionInfo.getUserId(), null);
      boolean resBoolean = platformClientUtil.getFrameworkService().saveRighForDept(deptId, userOIds, userEntityInfo);
      return resBoolean;
   }
   /**
@@ -924,7 +906,7 @@
         });
      }catch (Exception e){
         if(logger.isErrorEnabled()){
            logger.error("读取excel内容时或保存用户信息时出现了错误,具体原因:",e.getMessage());
            logger.error("读取excel内容时或保存部门时出现了错误,具体原因:",e.getMessage());
         }
         e.printStackTrace();
         return BaseResult.fail(LangBaseUtil.getErrorMsg(e),new String[]{},e);