private String execParameter() { if ((this.year == null) || (this.month == null) || (this.year.equals("")) || (this.month.equals(""))) { this.year = DateUtil.formatDateToS(new Date(), "yyyy"); this.month = DateUtil.formatDateToS(new Date(), "MM"); } DatabaseSysConfigManager db = DatabaseSysConfigManager.getInstance(); Map props = db.getProperties(); String mode = (String) props.get("sys.examin.leave.mode"); this.displayByDay = mode.split(",")[0].equals("day"); String config = (String) props.get("sys.examin.month.sum"); Date[] dateArr = ExaminDateUtil.getDateArray( Integer.valueOf(this.year).intValue(), Integer.valueOf(this.month).intValue(), config); this.startDate = formatDate(dateArr[0]); this.endDate = formatDate(dateArr[1]); ExaminBoFactory factory = ExaminBoFactory.getInstance(); IAttendmonthlyBO attendmothlyBO = factory.createAttendmonthlyBo(); this.period = attendmothlyBO.loadAttendperiod(this.year, this.month); if (this.period == null) setStatus(Integer.valueOf(0)); else { setStatus(this.period.getAttpStatus()); } return this.year + this.month; }
public String batchDelAttendmonthly() { ExaminBoFactory factory = ExaminBoFactory.getInstance(); IAttendmonthlyBO attendmothlyBO = factory.createAttendmonthlyBo(); if (attendmothlyBO.deleteAttendmonthlyByDate(this.year, this.month)) { addSuccessInfo("删除考勤数据成功。"); return "success"; } addErrorInfo("删除失败,请重试!"); return "error"; }
public String deleteAttendmonthly() { ExaminBoFactory factory = ExaminBoFactory.getInstance(); IAttendmonthlyBO attendmothlyBO = factory.createAttendmonthlyBo(); if (attendmothlyBO.deleteAttendmonthly(this.delAttendId)) { addSuccessInfo("删除成功。"); return "success"; } addErrorInfo("删除失败,请重试!"); return "error"; }
public String calDailyToAttendmonthly() { ExaminBoFactory factory = ExaminBoFactory.getInstance(); IAttendmonthlyBO attendmothlyBO = factory.createAttendmonthlyBo(); if ((StringUtils.isEmpty(this.year)) || (StringUtils.isEmpty(this.month))) { addSuccessInfo("要初始化的年月不能为空!请选择年月。"); return "success"; } if (attendmothlyBO.exeMonthlySummary(this.year, this.month)) { addSuccessInfo("初始化考勤数据成功。"); return "success"; } addErrorInfo("初始化失败,请重试!"); return "error"; }
public String applyAttendperiod() { if ((StringUtils.isEmpty(this.year)) || (StringUtils.isEmpty(this.month))) { return "success"; } if (this.month.length() == 1) { this.month = ("0" + this.month); } String msg = this.year + "年" + this.month + "月"; ExaminBoFactory factory = ExaminBoFactory.getInstance(); IAttendmonthlyBO attendmothlyBO = factory.createAttendmonthlyBo(); Attendperiod period = attendmothlyBO.loadAttendperiod(this.year, this.month); if (period == null) { addErrorInfo(msg + "的考勤数据不是初始化状态,不能进行封帐申请操作!"); } else if (period.getAttpStatus().intValue() == 0) { period.setAttpStatus(Integer.valueOf(1)); attendmothlyBO.updateObject(period); addSuccessInfo(msg + "的考勤数据封帐申请成功!"); } else { addErrorInfo(msg + "的考勤数据不是初始化状态,不能进行封帐申请操作!"); } return "success"; }