コード例 #1
0
 public String fileDutyOfficerUpdate() throws Exception {
   SqlSession sqlSession = null;
   try {
     sqlSession = DbSessionFactory.getOracleSession();
     C_T_SYS_Filedutyofficer record = new C_T_SYS_Filedutyofficer();
     C_T_SYS_FiledutyofficerMapper mapper =
         sqlSession.getMapper(C_T_SYS_FiledutyofficerMapper.class);
     if (null == c_T_SYS_Filedutyofficer.getFiledutyofficerId()
         || "".equals(c_T_SYS_Filedutyofficer.getFiledutyofficerId().trim())) {
       c_T_SYS_Filedutyofficer.setFiledutyofficerId((new GUID().toString()));
       DbSetData.setPerporyData(c_T_SYS_Filedutyofficer, record, 2);
       mapper.insertSelective(record);
     } else {
       DbSetData.setPerporyData(c_T_SYS_Filedutyofficer, record, 1);
       mapper.updateByPrimaryKey(record);
     }
     jsonResult = Constants.DISP_OPERATION_SUCCESSFUL;
     sqlSession.commit();
   } catch (Exception e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
     return ERROR;
   } finally {
     if (sqlSession != null) {
       sqlSession.close();
       sqlSession = null;
     }
   }
   allPermission = "*";
   return SUCCESS;
 }
コード例 #2
0
 public String filedutyofficerDelete() throws Exception {
   SqlSession sqlSession = null;
   try {
     sqlSession = DbSessionFactory.getOracleSession();
     if (!"".equals(checkedIds)) {
       String[] arrUuids;
       arrUuids = checkedIds.split("%2C");
       C_T_SYS_FiledutyofficerExample example = new C_T_SYS_FiledutyofficerExample();
       C_T_SYS_FiledutyofficerMapper mapper =
           sqlSession.getMapper(C_T_SYS_FiledutyofficerMapper.class);
       for (String tempUuid : arrUuids) {
         example.or().andFiledutyofficerIdEqualTo(tempUuid);
       }
       mapper.deleteByExample(example);
     }
     jsonResult = Constants.DISP_OPERATION_SUCCESSFUL;
     sqlSession.commit();
   } catch (Exception e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
     return ERROR;
   } finally {
     if (sqlSession != null) {
       sqlSession.close();
       sqlSession = null;
     }
   }
   allPermission = "*";
   return SUCCESS;
 }
コード例 #3
0
 /**
  * 对用户基本信息进行删除操作
  *
  * @return
  * @throws IOException
  */
 public String deptuserDelete() throws Exception {
   SqlSession sqlSession = null;
   try {
     sqlSession = DbSessionFactory.getOracleSession();
     C_T_Sys_Dept_UserMapper mapper = sqlSession.getMapper(C_T_Sys_Dept_UserMapper.class);
     // 如果没有选中的数据的ID则不作任何处理
     if (!"".equals(checkedIds)) {
       String[] arrUserids;
       arrUserids = checkedIds.split("%2C");
       C_T_Sys_Dept_UserExample example = new C_T_Sys_Dept_UserExample();
       // 循环遍历选中的数据的ID
       for (String tempUserid : arrUserids) {
         // 将ID作为条件加入条件集合中
         example.or().andUuidEqualTo(tempUserid);
       }
       // 根据条件删除对应的数据
       mapper.deleteByExample(example);
       sqlSession.commit();
     }
     jsonResult = Constants.DISP_OPERATION_SUCCESSFUL;
   } catch (Exception e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
     return ERROR;
   } finally {
     if (sqlSession != null) {
       sqlSession.close();
       sqlSession = null;
     }
   }
   return SUCCESS;
 }
コード例 #4
0
  public String deptuserDetailsLoad() throws Exception {
    SqlSession sqlSession = null;
    try {
      sqlSession = DbSessionFactory.getOracleSession();
      allPermission = "*";
      C_T_Sys_Dept_UserMapper mapper = sqlSession.getMapper(C_T_Sys_Dept_UserMapper.class);
      C_T_Sys_UserMapper usermapper = sqlSession.getMapper(C_T_Sys_UserMapper.class);

      // 根据主键取得流程基本信息
      c_T_Sys_Dept_User = (C_T_Sys_Dept_User) mapper.selectByPrimaryKey(uuid);
      C_T_Sys_User user = null;
      if (c_T_Sys_Dept_User != null) {
        user = (C_T_Sys_User) usermapper.selectByPrimaryKey(c_T_Sys_Dept_User.getUserSysName());
        userName = user.getUserName();
      }

      // 取得部门基本信息
      listDept = GetBaseInfor.getDepartmentBaseInfor("sort", sqlSession);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return ERROR;
    } finally {
      if (sqlSession != null) {
        sqlSession.close();
        sqlSession = null;
      }
    }
    return SUCCESS;
  }
コード例 #5
0
 public String fileDutyOfficerDetailsLoad() throws Exception {
   SqlSession sqlSession = null;
   sqlSession = DbSessionFactory.getOracleSession();
   C_T_SYS_FiledutyofficerMapper mapper =
       sqlSession.getMapper(C_T_SYS_FiledutyofficerMapper.class);
   c_T_SYS_Filedutyofficer = mapper.selectByPrimaryKey(filetypeId);
   JSONObject jo = JSONObject.fromObject(c_T_SYS_Filedutyofficer);
   this.jsonResult = jo.toString();
   sqlSession.commit();
   // allPermission =
   // WorkflowengineCommon.GetAllPermissions("module03010405",filetypeId,sqlSession);
   allPermission = "*";
   sqlSession.close();
   sqlSession = null;
   return SUCCESS;
 }
コード例 #6
0
  public String Getserial() throws Exception {

    SqlSession sqlSession = null;
    try {
      sqlSession = DbSessionFactory.getOracleSession();

      C_T_SYS_FROMFILESERIALNUMBERExample example = new C_T_SYS_FROMFILESERIALNUMBERExample();
      Criteria criteria = example.createCriteria();

      // תÂë
      // SerialLbS=new String(SerialLbS.getBytes("ISO-8859-1"),"GBK");

      if (SerialLbS != null && !"".equals(SerialLbS.trim())) {
        criteria.andFromfiletypeIdEqualTo(SerialLbS);
      }

      if (SerialYearS != null && !"".equals(SerialYearS.trim())) {
        criteria.andFromfileserialnumberYearEqualTo(Integer.parseInt(SerialYearS));
      }

      C_T_SYS_FROMFILESERIALNUMBERMapper mapper =
          sqlSession.getMapper(C_T_SYS_FROMFILESERIALNUMBERMapper.class);

      example.or(criteria);

      list_C_T_Sys_Serial = mapper.selectByExample(example);

      jsonResult = "1";
      if (list_C_T_Sys_Serial.size() > 0) {
        C_T_SYS_FROMFILESERIALNUMBER serial = list_C_T_Sys_Serial.get(0);
        int serial_num = serial.getFromfileserialnumberNumber();
        jsonResult = serial_num + "";
      }
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return ERROR;
    } finally {
      if (sqlSession != null) {
        sqlSession.close();
        sqlSession = null;
      }
    }

    return SUCCESS;
  }
コード例 #7
0
 public String filedutyofficer() throws Exception {
   SqlSession sqlSession = null;
   try {
     sqlSession = DbSessionFactory.getOracleSession();
     int rowCount;
     Sort sort;
     Limit limit;
     C_T_SYS_FiledutyofficerMapper mapper =
         sqlSession.getMapper(C_T_SYS_FiledutyofficerMapper.class);
     C_T_SYS_FiledutyofficerExample example = new C_T_SYS_FiledutyofficerExample();
     Criteria criteria = example.createCriteria();
     if (NameS != null && !"".equals(NameS.trim())) {
       criteria.andFiledutyofficerNameLike("%" + NameS + "%");
     }
     rowCount = mapper.countByExample(example);
     limit = DbOperationFation.GetECSideInfo(rowCount);
     if (rowCount != 0) {
       criteria.setLimitValue(limit.getRowStart() + 1, limit.getRowEnd());
     }
     sort = limit.getSort();
     if (sort.getAlias() != null) {
       example.setOrderByClause(sort.getAlias() + " " + sort.getSortOrder());
     } else {
       example.setOrderByClause("sort");
     }
     example.or(criteria);
     list_C_T_SYS_Filedutyofficer = mapper.selectByExample(example);
     sqlSession.commit();
   } catch (Exception e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
     return ERROR;
   } finally {
     if (sqlSession != null) {
       sqlSession.close();
       sqlSession = null;
     }
   }
   allPermission = "*";
   // allPermission =
   // WorkflowengineCommon.GetAllPermissions("module03010405",filetypeId,sqlSession);
   return SUCCESS;
 }
コード例 #8
0
 /**
  * 对用户基本信息进行更新操作
  *
  * @return
  * @throws IOException
  */
 public void deptuserUpdate() throws Exception {
   SqlSession sqlSession = null;
   try {
     sqlSession = DbSessionFactory.getOracleSession();
     C_T_Sys_Dept_UserMapper mapper = sqlSession.getMapper(C_T_Sys_Dept_UserMapper.class);
     C_T_Sys_UserMapper usermapper = sqlSession.getMapper(C_T_Sys_UserMapper.class);
     // 创建需要更新的记录集合
     C_T_Sys_Dept_User record = new C_T_Sys_Dept_User();
     C_T_Sys_User user =
         (C_T_Sys_User) usermapper.selectByPrimaryKey(c_T_Sys_Dept_User.getUserSysName());
     if (user != null) {
       // c_T_Sys_Dept_User.setDeptId(user.getDeptId());
       c_T_Sys_Dept_User.setUnitId(user.getUnitId());
     }
     if (null == c_T_Sys_Dept_User.getUuid() || "".equals(c_T_Sys_Dept_User.getUuid().trim())) {
       // 将画面上的数据赋值给需要更新的数据(如果不是单主键的话需要手动给主键赋值)
       String uuid = new GUID().toString();
       c_T_Sys_Dept_User.setUuid(uuid);
       DbSetData.setPerporyData(c_T_Sys_Dept_User, record, 2);
       // DbOperationFation.insert(C_T_Sys_UserMapper.class, record);
       mapper.insertSelective(record);
     } else {
       // 将画面上的数据赋值给需要更新的数据(如果不是单主键的话需要手动给主键赋值)
       DbSetData.setPerporyData(c_T_Sys_Dept_User, record, 1);
       mapper.updateByPrimaryKeySelective(record);
     }
     sqlSession.commit();
   } catch (Exception e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   } finally {
     if (sqlSession != null) {
       sqlSession.close();
       sqlSession = null;
     }
   }
   // jsonResult=Constants.DISP_OPERATION_SUCCESSFUL;
   // return SUCCESS;
 }
コード例 #9
0
  public String deptuserListLoad() throws Exception {

    int rowCount;
    Sort sort;
    Limit limit;
    SqlSession sqlSession = null;
    try {
      sqlSession = DbSessionFactory.getOracleSession();
      C_V_Sys_Dept_UserMapper mapper = sqlSession.getMapper(C_V_Sys_Dept_UserMapper.class);
      // 创建查询条件
      C_V_Sys_Dept_UserExample example = new C_V_Sys_Dept_UserExample();
      Criteria criteria = example.createCriteria();

      // 添加页面查询条件
      if (UserNameS != null && !"".equals(UserNameS.trim())) {
        // criteria.andUserNameEqualTo(UserNameS);
        criteria.andUserSysNameLike("%" + UserNameS + "%");
      }

      if (DeptNameS != null && !"".equals(DeptNameS.trim())) {
        criteria.andDeptIdEqualTo(DeptNameS);
      }

      // 取得总的记录条数
      rowCount = mapper.countByExample(example);

      // 取得ECSide信息
      limit = DbOperationFation.GetECSideInfo(rowCount);

      // 如果记录集为空,则不分页查询
      if (rowCount != 0) {
        // 在条件中设置起始数和结束数
        criteria.setLimitValue(limit.getRowStart() + 1, limit.getRowEnd());
      }

      // 如果有排序则设置排序
      sort = limit.getSort();
      if (sort.getAlias() != null) {
        example.setOrderByClause(sort.getAlias() + " " + sort.getSortOrder());
      }

      // 将所有的条件放到条件集合中
      example.or(criteria);

      // 根据条件取得流程基本信息列表
      list_C_T_Sys_Dept_User = mapper.selectByExample(example);

      // 取得部门基本信息
      listDept = GetBaseInfor.getDepartmentBaseInfor("sort", sqlSession);
      // 取得当前用户的权限
      curUserRole = WorkflowengineCommon.GetCurUserRole("", sqlSession);
      allPermission = "*";
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return ERROR;
    } finally {
      if (sqlSession != null) {
        sqlSession.close();
        sqlSession = null;
      }
    }
    return SUCCESS;
  }