/* */ 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); /* */ }
/* */ @Test /* */ public void test() /* */ { /* 31 */ DynamicService service = BeanUtil.getDynamicServiceBean("WF_Order"); /* */ /* 34 */ Object obj = service.get(new Long(1L)); /* */ /* 43 */ Map map = (Map) obj; /* */ /* 45 */ System.out.println("sjo:" + JsonUtil.mapEntity2Json(map, "WF_Order")); /* */ /* 50 */ Iterator it = map.values().iterator(); /* */ /* 52 */ while (it.hasNext()) /* 53 */ System.out.println("val:" + it.next()); /* */ }
/** 添加及保存操作 */ public String save() { if (demension.getDemId() == null) { demensionService.save(demension); } else { Demension orgDemension = demensionService.get(demension.getDemId()); try { BeanUtil.copyNotNullProperties(orgDemension, demension); demensionService.save(orgDemension); } catch (Exception ex) { logger.error(ex.getMessage()); } } setJsonString("{success:true}"); return SUCCESS; }
public String save() { if (this.processModule.getModuleid() == null) { this.processModule.setCreatetime(new Date()); this.processModuleService.save(this.processModule); } else { ProcessModule orgProcessModule = (ProcessModule) this.processModuleService.get(this.processModule.getModuleid()); try { BeanUtil.copyNotNullProperties(orgProcessModule, this.processModule); this.processModuleService.save(orgProcessModule); } catch (Exception ex) { this.logger.error(ex.getMessage()); } } setJsonString("{success:true}"); return "success"; }
/* */ public String save() /* */ { /* 109 */ this.news.setUpdateTime(new Date()); /* 110 */ if (this.news.getNewsId() == null) { /* 111 */ this.news.setViewCounts(Integer.valueOf(0)); /* 112 */ this.news.setReplyCounts(Integer.valueOf(0)); /* 113 */ this.newsService.save(this.news); /* */ } else { /* 115 */ News orgNews = (News) this.newsService.get(this.news.getNewsId()); /* */ try { /* 117 */ BeanUtil.copyNotNullProperties(orgNews, this.news); /* 118 */ this.newsService.save(orgNews); /* */ } catch (Exception ex) { /* 120 */ this.logger.error(ex.getMessage()); /* */ } /* */ } /* 123 */ setJsonString("{success:true}"); /* 124 */ return "success"; /* */ }
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"; }