/*    */ 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);
   /*    */ }
Exemplo n.º 2
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";
  }