public MyQuery getAllOutStateSreach() {
   DetachedCriteria dc = DetachedCriteria.forClass(CheckworkAbsence.class);
   String date = TimeUtil.getTheTimeStr(TimeUtil.getNowTime());
   dc.add(Restrictions.gt("endTime", TimeUtil.getTimeByStr(date, "yyyy-MM-dd HH:mm:ss")));
   dc.add(Restrictions.lt("beginTime", TimeUtil.getTimeByStr(date, "yyyy-MM-dd HH:mm:ss")));
   dc.addOrder(Order.desc("signDate"));
   MyQuery myQuery = new MyQueryImpl();
   myQuery.setDetachedCriteria(dc);
   return myQuery;
 }
 private IBaseDTO createDTOByPo(SysUserInfo sui, IBaseDTO dto) {
   if (null != sui) {
     dto.set("realName", sui.getRealName());
     dto.set("sexId", sui.getSexId());
     dto.set("identityKind", sui.getIdentityKind());
     dto.set("identityCard", sui.getIdentityCard());
     dto.set(
         "birthday",
         null != sui.getBirthday()
             ? TimeUtil.getTheTimeStr(sui.getBirthday(), "yyyy-MM-dd")
             : "0000-00-00");
     dto.set("countryId", sui.getCountryId());
     dto.set("provinceId", sui.getProvinceId());
     dto.set("qq", sui.getQq());
     dto.set("bloodType", sui.getBloodType());
     dto.set("address", sui.getAddress());
     dto.set("postalcode", sui.getPostalcode());
     dto.set("mobile", sui.getMobile());
     dto.set("finishSchool", sui.getFinishSchool());
     dto.set("speciality", sui.getSpeciality());
     dto.set("workId", sui.getWorkId());
     dto.set("homepage", sui.getHomepage());
   }
   return dto;
 }
 private SysUserInfo createSUIByDTO(IBaseDTO dto) {
   SysUserInfo sui = new SysUserInfo();
   sui.setUserId(
       null != dto.get("userId") && !"".equals("userId") ? dto.get("userId").toString() : "");
   sui.setRealName(null != dto.get("realName") ? dto.get("realName").toString() : "");
   sui.setSexId(null != dto.get("sexId") ? dto.get("sexId").toString() : "1");
   sui.setIdentityKind(null != dto.get("identityKind") ? dto.get("identityKind").toString() : "");
   sui.setIdentityCard(null != dto.get("identityCard") ? dto.get("identityCard").toString() : "");
   //		TimeUtil a;
   sui.setBirthday(
       null != dto.get("birthday") && !"".equals(dto.get("birthday").toString())
           ? TimeUtil.getTimeByStr(dto.get("birthday").toString(), "yyyy-MM-dd")
           : new Date());
   //		sui.setCountryId(null !=dto.get("countryId")?dto.get("countryId").toString():"");
   //		sui.setProvinceId(null !=dto.get("provinceId")?dto.get("provinceId").toString():"");
   //		sui.setQq(null !=dto.get("qq")?dto.get("qq").toString():"");
   //		sui.setBloodType(null !=dto.get("bloodType")?dto.get("bloodType").toString():"");
   //		sui.setAddress(null !=dto.get("address")?dto.get("address").toString():"");
   //		sui.setPostalcode(null !=dto.get("postalcode")?dto.get("postalcode").toString():"");
   //		sui.setMobile(null !=dto.get("mobile")?dto.get("mobile").toString():"");
   //		sui.setFinishSchool(null !=dto.get("finishSchool")?dto.get("finishSchool").toString():"");
   //		sui.setSpeciality(null !=dto.get("speciality")?dto.get("speciality").toString():"");
   //		sui.setWorkId(null !=dto.get("workId")?dto.get("workId").toString():"");
   //		sui.setHomepage(null !=dto.get("homepage")?dto.get("homepage").toString():"");
   return sui;
 }
 public IBaseDTO getInquiryCardInfo(String id) {
   // TODO Auto-generated method stub
   OperInquiryCard po = (OperInquiryCard) dao.loadEntity(OperInquiryCard.class, id);
   IBaseDTO dto = new DynaBeanDTO();
   dto.set("questionType", po.getDictQuestionType());
   dto.set("question", po.getQuestion());
   dto.set("alternatives", po.getAlternatives());
   dto.set("id", po.getId());
   dto.set("createTime", TimeUtil.getTheTimeStr(po.getCreateTime(), "yyyy-MM-dd"));
   return dto;
 }
 /**
  * 创建 ResourceUse 实例
  *
  * @description : 会议室申请
  * @param dto
  * @return
  */
 private ResourceUse createApplyMeeting(IBaseDTO dto) {
   ResourceUse resourceUse = new ResourceUse();
   resourceUse.setId(keyService.getNext("resource_use"));
   resourceUse.setResourceInfo(getResourceInfo(dto.get("meetingName").toString()));
   resourceUse.setDateArea(TimeUtil.getTimeByStr(dto.get("useDate").toString(), "yyyy-MM-dd"));
   resourceUse.setTimeArea(
       dto.get("startHour").toString() + " ---- " + dto.get("endHour").toString());
   resourceUse.setUserName(dto.get("applyUser") == null ? "" : dto.get("applyUser").toString());
   resourceUse.setResourceState("1"); // 0-未审批;1-等待审批;2-已批准
   resourceUse.setRemark(dto.get("applyReason") == null ? "" : dto.get("applyReason").toString());
   resourceUse.setApplyState("40");
   return resourceUse;
 }
 /**
  * 创建 ResourceInfo 更新实例
  *
  * @param dto
  * @return
  */
 private ResourceInfo updateMeetingInfo(IBaseDTO dto) {
   ResourceInfo resourceInfo = new ResourceInfo();
   resourceInfo.setId(dto.get("meetingId").toString());
   resourceInfo.setResourceType("40");
   resourceInfo.setResourceName(
       dto.get("meetingName") == null ? "" : dto.get("meetingName").toString());
   resourceInfo.setResourceState(
       dto.get("meetingThing") == null ? "" : dto.get("meetingThing").toString());
   resourceInfo.setPrincipalId(
       dto.get("meetingPrincipal") == null ? "" : dto.get("meetingPrincipal").toString());
   resourceInfo.setCreateDate(TimeUtil.getNowTime());
   resourceInfo.setRemark(
       dto.get("meetingRemark") == null ? "" : dto.get("meetingRemark").toString());
   return resourceInfo;
 }
 /**
  * PO to DTO
  *
  * <p>
  *
  * @description:ResourceUse to DynaBeanDTO
  * @return
  */
 private DynaBeanDTO ResourceUsetoDTO(ResourceUse resourceUse) {
   DynaBeanDTO dto = new DynaBeanDTO();
   dto.set("name", resourceUse.getResourceInfo().getResourceName());
   dto.set("useDate", TimeUtil.getTheTimeStr(resourceUse.getDateArea(), "yyyy-MM-dd"));
   dto.set("timeArea", resourceUse.getTimeArea());
   dto.set("applyUser", resourceUse.getUserName());
   if ("0".equals(resourceUse.getResourceState())) {
     dto.set("state", "未审批");
   } else if ("1".equals(resourceUse.getResourceState())) {
     dto.set("state", "待审批");
   } else {
     dto.set("state", "已批准");
   }
   dto.set("principalName", resourceUse.getPrincipalName());
   return dto;
 }