|  |  | 
 |  |  |     @Override | 
 |  |  |     public int modifyPLProjServices(SysProjServices projServicesVo) throws GlobleException { | 
 |  |  |         SysProjServices projServices = sysProjServicesDao.selectById(projServicesVo.getId()); | 
 |  |  |  | 
 |  |  |         SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); | 
 |  |  |         if (!projServices.getState().equals(Dictionary.SERVICE_STATU_XPL)) { | 
 |  |  |             throw new GlobleException("该服务单状态为" + projServices.getState() + ",不可以进行当前操作!"); | 
 |  |  |         } | 
 |  |  | 
 |  |  |             if(projServices.getDevisionId()!=null){ | 
 |  |  |                 outStore.setStaffId(projServices.getDevisionId()); | 
 |  |  |             }else{ | 
 |  |  |                 SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); | 
 |  |  |  | 
 |  |  |                 outStore.setStaffId(sysUsers.getSuId()); | 
 |  |  |             } | 
 |  |  |             outStore.setServiceId(projServices.getId()); | 
 |  |  | 
 |  |  |                         sysOutStoreItem.setStoreId(storeInfo.getId()); | 
 |  |  |                         sysOutStoreItem.setAmount(oldStoreTotal - storeInfo.getStoreTotal()); | 
 |  |  |                         realOutStoreItemList.add(sysOutStoreItem); | 
 |  |  |  | 
 |  |  |  | 
 |  |  |                         storeInfoDao.update(storeInfo); | 
 |  |  |                         //扣除后剩余库存大于0则跳出扣除,否则剩余数量的负数的绝对值就是再次扣减的数量 | 
 |  |  |                         if (surplus > 0) { | 
 |  |  | 
 |  |  |                     LogUtil.debug("未选择配料跳过sku={},amount={}", item.getSkuId(), item.getAmount()); | 
 |  |  |                 } | 
 |  |  |             } | 
 |  |  |  | 
 |  |  |             sysOutStoreItemDao.batchInsert(realOutStoreItemList); | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |  | 
 |  |  |         // 设置服务单状态 | 
 |  |  |         projServices.setState(Dictionary.SERVICE_STATU_PLWC); | 
 |  |  |         // 设置服务单操作流水 | 
 |  |  |         // TODO 本功能待完善记录最新的排班员工 | 
 |  |  |     /*    List<LastestWorkBeatuistaff> lastList = LastestWorkBeatuistaffDao.selectByModel(null); | 
 |  |  |         LastestWorkBeatuistaff lastWork = new LastestWorkBeatuistaff(); | 
 |  |  |         if (lastList.size() > 0) { | 
 |  |  |             lastWork.setChangeDate(new Date()); | 
 |  |  |             lastWork.setStaffId(projServices.getBeauticianId()); | 
 |  |  |             LastestWorkBeatuistaffDao.insert(lastWork); | 
 |  |  |         } else { | 
 |  |  |         if(projServices.getDevisionId()==null){ | 
 |  |  |             //如果没有设置配料师则默认为操作配料的人为配料师 | 
 |  |  |             projServices.setDevisionId(sysUsers.getSuId()); | 
 |  |  |  | 
 |  |  |             //TODO 有bug集合为零了 | 
 |  |  |             LastestWorkBeatuistaff modifyObj = lastList.get(0); | 
 |  |  |             modifyObj.setChangeDate(new Date()); | 
 |  |  |             modifyObj.setStaffId(projServices.getBeauticianId()); | 
 |  |  |             LastestWorkBeatuistaffDao.update(modifyObj); | 
 |  |  |         }*/ | 
 |  |  |  | 
 |  |  |         } | 
 |  |  |         return sysProjServicesDao.update(projServices); | 
 |  |  |     } | 
 |  |  |  |