// @Override
  public String queryCondition(String json) throws Exception {

    User user = ActionContext.getCurrentUserInThread();

    String domresult = "";
    try {

      domresult = buSpywCspsxkzsqDao.queryCondition(json, null, null);

      LogManager.writeUserLog(
          null,
          ywlx,
          Globals.OPERATION_TYPE_QUERY,
          LogManager.RESULT_SUCCESS,
          user.getName() + "查询<排水许可证申请>",
          user,
          "",
          "");

    } catch (DaoException e) {
      logger.error("排水许可证申请{}", e.getMessage());
      LogManager.writeUserLog(
          null,
          ywlx,
          Globals.OPERATION_TYPE_QUERY,
          LogManager.RESULT_FAILURE,
          user.getName() + "排水许可证申请查询失败",
          user,
          "",
          "");
      SystemException.handleMessageException("排水许可证申请查询失败,请联系相关人员处理");
    } finally {
    }
    return domresult;
  }
  // @Override
  public String queryCondition(String json) throws Exception {

    User user = ActionContext.getCurrentUserInThread();
    SgPersonLibraryVO vo = new SgPersonLibraryVO();
    String domresult = null;
    try {
      domresult = sgPersonLibraryDao.queryCondition(json);
      LogManager.writeUserLog(
          null,
          ywlx,
          Globals.OPERATION_TYPE_DELETE,
          LogManager.RESULT_SUCCESS,
          user.getName() + "施工人员信息-数据查询成功",
          user,
          "",
          "");

    } catch (DaoException e) {
      logger.error("表单信息{}", e.getMessage());
      LogManager.writeUserLog(
          null,
          ywlx,
          Globals.OPERATION_TYPE_DELETE,
          LogManager.RESULT_FAILURE,
          user.getName() + "施工人员信息-数据查询失败",
          user,
          "",
          "");
      SystemException.handleMessageException("施工人员信息-数据查询失败,请联系相关人员处理");
    } finally {
    }
    return domresult;
  }
  public String updateStatusOne(String u_id, String js) throws Exception {

    User user = ActionContext.getCurrentUserInThread();
    SgPersonLibraryVO vo = new SgPersonLibraryVO();
    String domresult = null;
    try {
      domresult = sgPersonLibraryDao.updatePass(u_id, js);
      LogManager.writeUserLog(
          vo.getSg_person_library_uid(),
          ywlx,
          Globals.OPERATION_TYPE_DELETE,
          LogManager.RESULT_SUCCESS,
          user.getName() + "施工人员信息-入库-数据更改成功",
          user,
          "",
          "");

    } catch (DaoException e) {
      logger.error("表单信息{}", e.getMessage());
      LogManager.writeUserLog(
          vo.getSg_person_library_uid(),
          ywlx,
          Globals.OPERATION_TYPE_DELETE,
          LogManager.RESULT_FAILURE,
          user.getName() + "施工人员信息-入库-数据更改成功",
          user,
          "",
          "");
      SystemException.handleMessageException("施工人员信息-入库-数据更改成功,请联系相关人员处理");
    } finally {
    }
    return domresult;
  }
  public String delete(String json) throws Exception {

    User user = ActionContext.getCurrentUserInThread();
    BuSpywJsgcsgxkzsqMxVO vo = new BuSpywJsgcsgxkzsqMxVO();
    String domresult = null;
    try {
      domresult = null;
      LogManager.writeUserLog(
          vo.getSgxkzsqmx_uid(),
          ywlx,
          Globals.OPERATION_TYPE_DELETE,
          LogManager.RESULT_SUCCESS,
          user.getName() + "建设工程施工许可证申请-子表—数据删除成功",
          user,
          "",
          "");

    } catch (DaoException e) {
      logger.error("表单信息{}", e.getMessage());
      LogManager.writeUserLog(
          vo.getSgxkzsqmx_uid(),
          ywlx,
          Globals.OPERATION_TYPE_DELETE,
          LogManager.RESULT_FAILURE,
          user.getName() + "建设工程施工许可证申请-子表—数据删除失败",
          user,
          "",
          "");
      SystemException.handleMessageException("建设工程施工许可证申请-子表—数据删除失败,请联系相关人员处理");
    } finally {
    }
    return domresult;
  }
  public String insert(String json) throws Exception {

    User user = ActionContext.getCurrentUserInThread();

    String resultVO = null;
    BuSpywCspsxkzsqVO vo = new BuSpywCspsxkzsqVO();

    try {
      JSONArray list = vo.doInitJson(json);
      vo.setValueFromJson((JSONObject) list.get(0));
      // 设置主键
      // vo.setId(new RandomGUID().toString()); // 主键
      vo.setCspsxkzsq_uid(DBUtil.getSequenceValue("CSPSXKZSQ_UID"));

      vo.setCreated_uid(user.getUserSN());
      vo.setCreated_name(user.getName());

      vo.setEvent_uid(new RandomGUID().toString());

      // 插入
      buSpywCspsxkzsqDao.save(vo);
      resultVO = vo.getRowJson();

      LogManager.writeUserLog(
          vo.getEvent_uid(),
          ywlx,
          Globals.OPERATION_TYPE_INSERT,
          LogManager.RESULT_SUCCESS,
          user.getName() + "排水许可证申请新增成功",
          user,
          "",
          "");

      // String jsona="{querycondition: {conditions:
      // [{\"value\":\""+vo.getId()+"\",\"fieldname\":\"t.id\",\"operation\":\"=\",\"logic\":\"and\"} ]}}";
      // return queryCondition(jsona, user);

    } catch (DaoException e) {
      logger.error("排水许可证申请{}", e.getMessage());
      LogManager.writeUserLog(
          vo.getEvent_uid(),
          ywlx,
          Globals.OPERATION_TYPE_INSERT,
          LogManager.RESULT_FAILURE,
          user.getName() + "排水许可证申请新增失败",
          user,
          "",
          "");
      SystemException.handleMessageException("排水许可证申请新增失败,请联系相关人员处理");
    } finally {
    }
    return resultVO;
  }
  public String update(String json) throws Exception {

    User user = ActionContext.getCurrentUserInThread();

    String resultVO = null;
    BuSpywCspsxkzsqVO vo = new BuSpywCspsxkzsqVO();

    try {
      JSONArray list = vo.doInitJson(json);
      vo.setValueFromJson((JSONObject) list.get(0));
      // 设置主键
      /*
       * vo.setId(new RandomGUID().toString()); // 主键
       */
      /* vo.setId("20FC7EF9-696D-6398-15C8-A77F2C4DFC02"); */

      vo.setEvent_uid(new RandomGUID().toString());

      vo.setCreated_uid(user.getUserSN());
      vo.setCreated_name(user.getName());

      // 修改
      buSpywCspsxkzsqDao.update(vo);
      resultVO = vo.getRowJson();

      LogManager.writeUserLog(
          vo.getEvent_uid(),
          ywlx,
          Globals.OPERATION_TYPE_UPDATE,
          LogManager.RESULT_SUCCESS,
          user.getName() + "排水许可证申请修改成功",
          user,
          "",
          "");

    } catch (DaoException e) {
      logger.error("排水许可证申请{}", e.getMessage());
      LogManager.writeUserLog(
          vo.getEvent_uid(),
          ywlx,
          Globals.OPERATION_TYPE_UPDATE,
          LogManager.RESULT_FAILURE,
          user.getName() + "排水许可证申请修改失败",
          user,
          "",
          "");
      SystemException.handleMessageException("排水许可证申请修改失败,请联系相关人员处理");
    } finally {
    }
    return resultVO;
  }
  public String delete(String json) throws Exception {

    User user = ActionContext.getCurrentUserInThread();

    String resultVo = null;
    BuSpywCspsxkzsqVO vo = new BuSpywCspsxkzsqVO();
    try {
      JSONArray list = vo.doInitJson(json);
      JSONObject jsonObj = (JSONObject) list.get(0);

      vo.setValueFromJson(jsonObj);

      vo.setEvent_uid(new RandomGUID().toString());

      // 删除   根据据主键
      buSpywCspsxkzsqDao.delete(BuSpywCspsxkzsqVO.class, vo.getCspsxkzsq_uid());

      resultVo = vo.getRowJson();

      LogManager.writeUserLog(
          vo.getEvent_uid(),
          ywlx,
          Globals.OPERATION_TYPE_DELETE,
          LogManager.RESULT_SUCCESS,
          user.getName() + "排水许可证申请删除成功",
          user,
          "",
          "");

    } catch (DaoException e) {
      logger.error("排水许可证申请{}", e.getMessage());
      LogManager.writeUserLog(
          vo.getEvent_uid(),
          ywlx,
          Globals.OPERATION_TYPE_DELETE,
          LogManager.RESULT_FAILURE,
          user.getName() + "排水许可证申请删除失败",
          user,
          "",
          "");
      SystemException.handleMessageException("排水许可证申请删除失败,请联系相关人员处理");
    } finally {
    }
    return resultVo;
  }
  public String updateCopyPerson2(String status, String IdCard, String shenfenID) throws Exception {
    User user = ActionContext.getCurrentUserInThread();
    String new_id = sgPersonLibraryDao.updateCopyPerson2(status, IdCard, shenfenID);
    LogManager.writeUserLog(
        new_id,
        ywlx,
        Globals.OPERATION_TYPE_QUERY,
        LogManager.RESULT_FAILURE,
        user.getUserSN() + "执行对入库<人员信息>更改",
        user,
        "",
        "");

    sgPersonZhengshuDao.updateCopyZhengshu2(IdCard, new_id);
    return new_id;
  }
  public String updateCopyPerson(String t_id, String u_id) throws Exception {
    User user = ActionContext.getCurrentUserInThread();
    String new_id = sgPersonLibraryDao.updateCopyPerson(t_id, u_id);

    LogManager.writeUserLog(
        new_id,
        ywlx,
        Globals.OPERATION_TYPE_QUERY,
        LogManager.RESULT_FAILURE,
        user.getUserSN() + "执行对入库<人员信息>增加",
        user,
        "",
        "");
    // t_id为30状态该数据的ID,u_id为该数据的person_uid
    sgPersonZhengshuDao.updateCopyZhengshu(t_id, u_id, new_id);
    // LogManager.writeUserLog(null, ywlx, Globals.OPERATION_TYPE_QUERY,LogManager.RESULT_FAILURE,
    // user.getUserSN() + "执行对入库<证书信息>增加", user, "", "");

    // sgPersonZhengshuDao.insertToOldZhengshu(new_id);
    return new_id;
  }
  public String updateShenhe(String json, Map fils, String u_id, String status, String t_id)
      throws Exception {

    User user = ActionContext.getCurrentUserInThread();
    SgPersonLibraryVO vo = new SgPersonLibraryVO();
    String domresult = null;
    try {
      JSONArray list = vo.doInitJson(json);
      JSONObject object = (JSONObject) list.get(0);
      String companyname = object.getString("COMPANY_NAME");
      String companycode = object.getString("COMPANY_DENGLU_CODE");
      String companyuid = object.getString("SG_COMPANY_UID");
      String personUid = object.getString("SG_PERSON_LIBRARY_UID");
      String personName = object.getString("PERSON_NAME");
      domresult = sgPersonLibraryDao.updateShenhe(json, fils, u_id, status, t_id);

      if ("10".equals(status)) { // 人员审核通过
        // ****************************消息添加

        Map messageMap = new HashMap();
        messageMap.put("TITLE", "施工人员审核");
        messageMap.put(
            "CONTENT",
            "人员<a&nbsp;href='javascript:void(0)'&nbsp;onclick=\"zxdtView('"
                + personUid
                + "','sgrysh')\">"
                + personName
                + "</a>信息<span&nbsp;style='color:blue;'>审核通过</span>");
        messageMap.put("USERTO", companycode); // 企业的登录Code
        messageMap.put("USERTONAME", companyname); // 企业的名称
        messageMap.put("SYSTEM_TYPE", "SG"); // 系统类型
        messageMap.put("COMPANY_UID", companyuid); // 对应的施工企业编号
        messageMap.put("MSG_TYPE", Constants.FS_MESSAGE_INFO_MSG_TYPE_SGQYRY); // 消息类型
        messageMap.put("QUANXIAN_UID", Constants.QUANXIAN_SG_RYGL); // 涉及的权限点

        fsMessageInfoService.insertVo(messageMap);
      } else if ("20".equals(status)) { // 人员审核未通过
        // ****************************消息添加

        Map messageMap = new HashMap();
        messageMap.put("TITLE", "施工人员审核");
        messageMap.put(
            "CONTENT",
            "人员<a&nbsp;href='javascript:void(0)'&nbsp;onclick=\"zxdtView('"
                + personUid
                + "','sgrysh')\">"
                + personName
                + "</a>信息<span&nbsp;style='color:red;'>审核未通过</span>");
        messageMap.put("USERTO", companycode); // 人员的登录Code
        messageMap.put("USERTONAME", companyname); // 企业的名称
        messageMap.put("SYSTEM_TYPE", "SG"); // 系统类型
        messageMap.put("COMPANY_UID", companyuid); // 对应的施工企业编号
        messageMap.put("MSG_TYPE", Constants.FS_MESSAGE_INFO_MSG_TYPE_SGQYRY); // 消息类型
        messageMap.put("QUANXIAN_UID", Constants.QUANXIAN_SG_RYGL); // 涉及的权限点

        fsMessageInfoService.insertVo(messageMap);
      }
      LogManager.writeUserLog(
          vo.getSg_person_library_uid(),
          ywlx,
          Globals.OPERATION_TYPE_DELETE,
          LogManager.RESULT_SUCCESS,
          user.getName() + "施工人员信息-提交-数据更改成功",
          user,
          "",
          "");

    } catch (DaoException e) {
      logger.error("表单信息{}", e.getMessage());
      LogManager.writeUserLog(
          vo.getSg_person_library_uid(),
          ywlx,
          Globals.OPERATION_TYPE_DELETE,
          LogManager.RESULT_FAILURE,
          user.getName() + "施工人员信息-提交-数据更改成功",
          user,
          "",
          "");
      SystemException.handleMessageException("施工人员信息-提交-数据更改成功,请联系相关人员处理");
    } finally {
    }
    return domresult;
  }