|  |  |  | 
|---|
|  |  |  | /** 验证数据是否正确 */ | 
|---|
|  |  |  | SysProjServices checkProjServices = sysProjServicesDao.selectById(projServices.getId()); | 
|---|
|  |  |  | // 验证服务单是否存在或者取消 | 
|---|
|  |  |  | if (!checkProjServices.getState().equals(Dictionary.SERVICE_STATU_DYY) | 
|---|
|  |  |  | && !checkProjServices.getState().equals(Dictionary.SERVICE_STATU_YYCG)) { | 
|---|
|  |  |  | if (checkProjServices.getState().equals(Dictionary.SERVICE_STATU_YYQX) | 
|---|
|  |  |  | || checkProjServices.getState().equals(Dictionary.SERVICE_STATU_FFJS)) { | 
|---|
|  |  |  | throw new GlobleException("该服务单已被取消或者不存在!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 验证是否选择床位 | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 判断是否是编辑,还是新增,编辑则需要先释放资源 | 
|---|
|  |  |  | if (checkProjServices.getState().equals(Dictionary.SERVICE_STATU_YYCG)) { | 
|---|
|  |  |  | if (!checkProjServices.getState().equals(Dictionary.SERVICE_STATU_DYY)) { | 
|---|
|  |  |  | // 释放床位资源 | 
|---|
|  |  |  | bedStateDao.deleteByServiceId(checkProjServices.getId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | // 设置成功状态 | 
|---|
|  |  |  | projServices.setState(Dictionary.SERVICE_STATU_XPL); | 
|---|
|  |  |  | if (Dictionary.SERVICE_STATU_DYY.equals(projServices.getState())) { | 
|---|
|  |  |  | // 设置成功状态 | 
|---|
|  |  |  | projServices.setState(Dictionary.SERVICE_STATU_XPL); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 判断当前门店是否有历史美疗师 | 
|---|
|  |  |  | LastestWorkBeatuistaff lastWorkStaff = new LastestWorkBeatuistaff(); | 
|---|
|  |  |  | lastWorkStaff.setShopId(checkProjServices.getShopId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | if (skipServiceOrderStep(Dictionary.SERVICE_OVER_BEGIN_END)) { | 
|---|
|  |  |  | projServices.setStartTime(new Date()); | 
|---|
|  |  |  | projServices.setState(Dictionary.SERVICE_STATU_FWWC); | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | projServices.setState(Dictionary.SERVICE_STATU_PLWC); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 释放床位资源 | 
|---|
|  |  |  | //        SysBedState checkBedState = sysBedStateDao.selectBySerIdAndBedId(projServices.getBedId(), projServices.getId()); | 
|---|
|  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 跳过服务单某步骤 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private boolean skipServiceOrderStep(String step) { | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public boolean skipServiceOrderStep(String step) { | 
|---|
|  |  |  | SysUsers users = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); | 
|---|
|  |  |  | ParameterSettings ps = new ParameterSettings(); | 
|---|
|  |  |  | ps.setCompanyId(users.getCompanyId()); | 
|---|