예제 #1
0
  private String customSave(Short st) {
    if (this.conference.getIsEmail() == null) this.conference.setIsEmail(Conference.ISNOEMAIL);
    if (this.conference.getIsMobile() == null) this.conference.setIsMobile(Conference.ISNOMOBILE);
    this.conference.setStatus(st);

    String viewer =
        this.conference.getCompere()
            + ","
            + this.conference.getRecorder()
            + ","
            + this.conference.getAttendUsers()
            + ","
            + ContextUtil.getCurrentUserId()
            + ","
            + this.conference.getCheckUserId();
    viewer = removeRepeatUserId(viewer);

    this.updater = (this.updater + "," + ContextUtil.getCurrentUserId());
    this.updater = removeRepeatUserId(this.updater);

    if (st == Conference.Apply)
      this.conferenceService.send(
          this.conference, viewer, this.updater, this.conference.getRecorder(), this.filePath);
    else {
      this.conferenceService.temp(
          this.conference, viewer, this.updater, this.conference.getRecorder(), this.filePath);
    }
    setJsonString("{success:true}");
    return "success";
  }
예제 #2
0
 public String daiConfApply() {
   QueryFilter filter = new QueryFilter(getRequest());
   filter.addFilter("Q_checkUserId_L_EQ", ContextUtil.getCurrentUserId().toString());
   filter.addFilter("Q_status_SN_EQ", "2");
   filter.addSorted("createtime", "DESC");
   return filter(filter);
 }
예제 #3
0
  public String list() {
    QueryFilter filter = new QueryFilter(getRequest());

    if (getRequest().getParameter("Q_assignerId_L_EQ") == null) {
      filter.addFilter("Q_userId_L_EQ", ContextUtil.getCurrentUserId().toString());
    }

    List<CalendarPlan> list = this.calendarPlanService.getAll(filter);

    Type type = new TypeToken<List<CalendarPlan>>() {}.getType();
    StringBuffer buff =
        new StringBuffer("{success:true,'totalCounts':")
            .append(filter.getPagingBean().getTotalItems())
            .append(",result:");

    Gson gson =
        new GsonBuilder()
            .excludeFieldsWithoutExposeAnnotation()
            .setDateFormat("yyyy-MM-dd HH:mm:ss")
            .create();
    buff.append(gson.toJson(list, type));
    buff.append("}");

    this.jsonString = buff.toString();

    return "success";
  }
예제 #4
0
  public String display() {
    QueryFilter filter = new QueryFilter(getRequest());

    filter.addFilter("Q_userId_L_EQ", ContextUtil.getCurrentUserId().toString());
    filter.addSorted("planId", "desc");
    List list = this.calendarPlanService.getAll(filter);
    getRequest().setAttribute("calendarList", list);
    return "display";
  }
예제 #5
0
 public String displyApply() {
   QueryFilter filter = new QueryFilter(getRequest());
   filter.addFilter("Q_checkUserId_L_EQ", ContextUtil.getCurrentUserId().toString());
   filter.addFilter("Q_status_SN_EQ", "2");
   filter.addFilter("Q_startTime_D_GE", this.sdf.format(new Date()));
   filter.addSorted("createtime", "DESC");
   List list = this.conferenceService.getAll(filter);
   if (list.size() > 8) {
     for (int i = 7; i < list.size(); i++) {
       list.remove(i);
     }
   }
   getRequest().setAttribute("applyConferenceList", list);
   return "displayApply";
 }
 /*    */ public Integer saveRegister(FlowRunInfo flowRunInfo) /*    */ {
   /* 29 */ AppUser curUser = ContextUtil.getCurrentUser();
   /* 30 */ String comments = flowRunInfo.getRequest().getParameter("comments");
   /*    */
   /* 32 */ ErrandsRegister register = new ErrandsRegister();
   /* 33 */ register.setUserId(curUser.getUserId());
   /*    */ try
   /*    */ {
     /* 36 */ BeanUtil.populateEntity(flowRunInfo.getRequest(), register, "errandsRegister");
     /*    */ } catch (Exception ex) {
     /* 38 */ this.logger.error(ex.getMessage());
     /* 39 */ return Integer.valueOf(0);
     /*    */ }
   /* 41 */ register.setApprovalOption(comments);
   /* 42 */ if (register.getDateId() != null) {
     /* 43 */ ErrandsRegister orgRegister = (ErrandsRegister) get(register.getDateId());
     /*    */ try {
       /* 45 */ BeanUtil.copyNotNullProperties(orgRegister, register);
       /*    */
       /* 47 */ orgRegister.setApprovalId(curUser.getUserId());
       /* 48 */ orgRegister.setApprovalName(curUser.getFullname());
       /* 49 */ String destName = flowRunInfo.getDestName();
       /* 50 */ if (destName.equals("申请人查看结果"))
         /* 51 */ orgRegister.setStatus(ErrandsRegister.STATUS_APPROVAL);
       /*    */ else {
         /* 53 */ orgRegister.setStatus(ErrandsRegister.STATUS_UNAPPROVAL);
         /*    */ }
       /* 55 */ this.dao.save(orgRegister);
       /*    */ } catch (Exception ex) {
       /* 57 */ this.logger.error(ex);
       /*    */ }
     /*    */ } else {
     /* 60 */ this.dao.save(register);
     /*    */ }
   /*    */
   /* 63 */ flowRunInfo.getVariables().put("dateId", register.getDateId());
   /* 64 */ flowRunInfo.setFlowSubject(curUser.getFullname() + "提交请假申请");
   /* 65 */ return Integer.valueOf(1);
   /*    */ }
예제 #7
0
  public String today() {
    PagingBean pb = new PagingBean(this.start.intValue(), this.limit.intValue());
    List<CalendarPlan> list =
        this.calendarPlanService.getTodayPlans(ContextUtil.getCurrentUserId(), pb);
    List<PlanInfo> planList = new ArrayList<PlanInfo>();

    for (CalendarPlan plan : list) {
      planList.add(new PlanInfo(plan));
    }

    Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create();

    StringBuffer buff =
        new StringBuffer("{success:true,'totalCounts':")
            .append(pb.getTotalItems())
            .append(",result:");
    Type type = new TypeToken<List<PlanInfo>>() {}.getType();
    buff.append(gson.toJson(planList, type));
    buff.append("}");
    setJsonString(buff.toString());
    return "success";
  }
예제 #8
0
  public String save() {
    if (this.calendarPlan.getPlanId() == null) {
      this.calendarPlan.setStatus(CalendarPlan.STATUS_UNFINISHED);

      AppUser appUser = ContextUtil.getCurrentUser();

      this.calendarPlan.setAssignerId(appUser.getUserId());
      this.calendarPlan.setAssignerName(appUser.getFullname());

      this.calendarPlanService.save(this.calendarPlan);
    } else {
      CalendarPlan cp = (CalendarPlan) this.calendarPlanService.get(this.calendarPlan.getPlanId());
      try {
        BeanUtil.copyNotNullProperties(cp, this.calendarPlan);
      } catch (Exception ex) {
        this.logger.error(ex.getMessage());
      }
      this.calendarPlanService.save(cp);
    }

    setJsonString("{success:true}");
    return "success";
  }
예제 #9
0
  public String my() {
    HttpServletRequest request = getRequest();
    String datafn = request.getParameter("action");

    Date startDate = null;
    Date endDate = null;
    Date reqEndDate;
    if ("month".equals(datafn)) {
      String monthday = request.getParameter("monthday");
      try {
        Date reqDate = DateUtils.parseDate(monthday, new String[] {"MM/dd/yyyy"});
        Calendar cal = Calendar.getInstance();
        cal.setTime(reqDate);

        cal.set(5, 1);

        startDate = DateUtil.setStartDay(cal).getTime();

        cal.add(2, 1);
        cal.add(5, -1);

        endDate = DateUtil.setEndDay(cal).getTime();
      } catch (Exception ex) {
        this.logger.error(ex.getMessage());
      }
    } else if ("day".equals(datafn)) {
      String day = request.getParameter("day");
      this.logger.info("day:" + day);
      try {
        Date reqDay = DateUtils.parseDate(day, new String[] {"MM/dd/yyyy"});

        Calendar cal = Calendar.getInstance();
        cal.setTime(reqDay);

        startDate = DateUtil.setStartDay(cal).getTime();

        cal.add(2, 1);
        cal.add(5, -1);

        endDate = DateUtil.setEndDay(cal).getTime();
      } catch (Exception ex) {
        this.logger.error(ex.getMessage());
      }
    } else if ("week".equals(datafn)) {
      String startweek = request.getParameter("startweek");
      String endweek = request.getParameter("endweek");
      try {
        Date reqStartWeek = DateUtils.parseDate(startweek, new String[] {"MM/dd/yyyy"});
        Date reqEndWeek = DateUtils.parseDate(endweek, new String[] {"MM/dd/yyyy"});
        Calendar cal = Calendar.getInstance();

        cal.setTime(reqStartWeek);

        startDate = DateUtil.setStartDay(cal).getTime();
        cal.setTime(reqEndWeek);

        endDate = DateUtil.setEndDay(cal).getTime();
      } catch (Exception ex) {
        this.logger.error(ex.getMessage());
      }
    } else if ("period".equals(datafn)) {
      String start = request.getParameter("start");
      String end = request.getParameter("end");
      try {
        Date reqStartDate = DateUtils.parseDate(start, new String[] {"MM/dd/yyyy"});
        reqEndDate = DateUtils.parseDate(end, new String[] {"MM/dd/yyyy"});

        Calendar cal = Calendar.getInstance();

        cal.setTime(reqStartDate);

        startDate = DateUtil.setStartDay(cal).getTime();

        cal.setTime(reqEndDate);

        endDate = DateUtil.setEndDay(cal).getTime();
      } catch (Exception ex) {
        this.logger.info(ex.getMessage());
      }
    } else {
      this.jsonString = "{success:false,errors:'there's enough arguments to generate data'}";
    }

    StringBuffer sb = new StringBuffer();

    List<CalendarPlan> planList =
        this.calendarPlanService.getByPeriod(ContextUtil.getCurrentUserId(), startDate, endDate);

    sb.append("{success:true,totalCount:").append(planList.size()).append(",records:[");

    for (CalendarPlan plan : planList) {
      sb.append("{id:'").append(plan.getPlanId()).append("',");

      String subject = plan.getContent();
      if (subject.length() > 12) {
        subject = subject.substring(1, 12) + "...";
      }

      Date endTime = plan.getEndTime();
      if (endTime == null) {
        Calendar curCal = Calendar.getInstance();
        curCal.add(1, 50);
        endTime = curCal.getTime();
      }

      Date startTime = plan.getStartTime();
      if (this.start == null) {
        Calendar curCal = Calendar.getInstance();
        startTime = curCal.getTime();
      }

      sb.append("subject:'").append(StringUtil.convertQuot(subject)).append("',");
      sb.append("description:'").append(StringUtil.convertQuot(plan.getContent())).append("',");
      sb.append("startdate:'").append(DateUtil.formatEnDate(startTime)).append("',");
      sb.append("enddate:'").append(DateUtil.formatEnDate(endTime)).append("',");
      sb.append("color:'").append(plan.getColor()).append("',");
      sb.append("parent:'0',");
      sb.append("priority:'").append(plan.getUrgent()).append("'},");
    }

    if (planList.size() > 0) {
      sb.deleteCharAt(sb.length() - 1);
    }
    sb.append("]}");

    this.jsonString = sb.toString();
    return "success";
  }