| | |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.common.service.BusParameterSettingService; |
| | | import com.matrix.system.common.service.OperationLogService; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.enums.OperationButtonEnum; |
| | | import com.matrix.system.enums.OperationFunctionEnum; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.plugin.util.MoneyUtil; |
| | |
| | | @Autowired |
| | | private SysProjUseDao sysProjUseDao; |
| | | |
| | | |
| | | @Autowired |
| | | private OperationLogService operationLogService; |
| | | @Autowired |
| | | private SysOutStoreDao sysOutStoreDao; |
| | | |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public SysProjServices addSysProjServices(SysProjServices sysProjServices) throws GlobleException { |
| | | |
| | | SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | //创建服务单 |
| | | if (WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY) != null) { |
| | | SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | sysProjServices.setCreateStaffId(user.getSuId()); |
| | | sysProjServices.setShopId(user.getShopId()); |
| | | sysProjServices.setCompanyId(user.getCompanyId()); |
| | |
| | | sysProjServices.setTotalTime(totalTime); |
| | | sysProjServices.setMoney(new BigDecimal(hkPrice).setScale(2, BigDecimal.ROUND_HALF_DOWN).doubleValue()); |
| | | sysProjServicesDao.update(sysProjServices); |
| | | //jyytodo 小程序订单没有操作人 |
| | | Long userId=0L; |
| | | if(user!=null){ |
| | | userId= user.getSuId(); |
| | | } |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(sysProjServices.getCompanyId(), sysProjServices.getShopId(),userId, |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.CREATE, |
| | | sysProjServices.getId(), |
| | | sysProjServices.getServiceNo(), |
| | | sysProjServices.getVipId()); |
| | | |
| | | return sysProjServices; |
| | | } |
| | | |
| | |
| | | autoBatching(projServices); |
| | | } |
| | | |
| | | SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(checkProjServices.getCompanyId(), checkProjServices.getShopId(),users.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.SERVICE_ORDER_PB, |
| | | checkProjServices.getId(), |
| | | checkProjServices.getServiceNo(), |
| | | checkProjServices.getVipId()); |
| | | |
| | | return i; |
| | | } |
| | |
| | | //组合配料参数 |
| | | projServices.setOutStoreItem(outStoreItemList); |
| | | //调用配料出库方法 |
| | | modifyPLProjServices(projServices); |
| | | try { |
| | | modifyPLProjServices(projServices); |
| | | }catch (GlobleException e){ |
| | | LogUtil.debug("配料失败:{}",e.getMessage()); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | //删除积分 |
| | | scoreVipDetailService.removeByBusinessId(checkProjServices.getVipId(), checkProjServices.getId()); |
| | | |
| | | SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(checkProjServices.getCompanyId(), checkProjServices.getShopId(),users.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.CANCEL, |
| | | checkProjServices.getId(), |
| | | checkProjServices.getServiceNo(), |
| | | checkProjServices.getVipId()); |
| | | |
| | | |
| | | //更新服务单状态 |
| | | return sysProjServicesDao.update(checkProjServices); |
| | | } |
| | |
| | | taocanProjUse.setIsOver(Dictionary.DELETED_N); |
| | | taocanProjUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); |
| | | taocanProjUse.setBalance(MoneyUtil.add(taocanProjUse.getBalance(), backBlance.doubleValue())); |
| | | if (Dictionary.FLAG_YES_Y.equals(taocanProjUse.getIsCourse())) { |
| | | if (StringUtils.isBlank(taocanProjUse.getIsInfinite()) || Dictionary.FLAG_NO_N.equals(taocanProjUse.getIsInfinite())) { |
| | | taocanProjUse.setSurplusCount(taocanProjUse.getSurplusCount() + beauticianState.getCount()); |
| | | } |
| | | // if (Dictionary.FLAG_YES_Y.equals(taocanProjUse.getIsCourse())) { |
| | | if (StringUtils.isBlank(taocanProjUse.getIsInfinite()) || Dictionary.FLAG_NO_N.equals(taocanProjUse.getIsInfinite())) { |
| | | taocanProjUse.setSurplusCount(taocanProjUse.getSurplusCount() + beauticianState.getCount()); |
| | | } |
| | | // } |
| | | sysProjUseDao.update(taocanProjUse); |
| | | } |
| | | |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public int modifyHKProjServices(SysProjServices projServices) throws GlobleException { |
| | | SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | projServices = sysProjServicesDao.selectById(projServices.getId()); |
| | | if (!projServices.getState().equals(Dictionary.SERVICE_STATU_FWWC)) { |
| | | throw new GlobleException("该服务单状态为" + projServices.getState() + ",不可以进行当前操作!"); |
| | |
| | | |
| | | projServices.setState(Dictionary.SERVICE_STATU_FFJS); |
| | | projServices.setConsumeTime(new Date()); |
| | | projServices.setCashierId(sysUsers.getSuId()); |
| | | int result = sysProjServicesDao.update(projServices); |
| | | achieveNewService.addAchieveByServiceOrder(projServices); |
| | | |
| | |
| | | asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG, uniformMsgParam); |
| | | //发送划扣短信提醒 |
| | | taiYanAliyunSmsService.sendHkNotice(projServices); |
| | | |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(projServices.getCompanyId(), projServices.getShopId(),users.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.SERVICE_ORDER_HK, |
| | | projServices.getId(), |
| | | projServices.getServiceNo(), |
| | | projServices.getVipId()); |
| | | |
| | | return result; |
| | | } |
| | |
| | | BusParameterSettings principalConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.PRINCIPAL_CONSUMPTION, vipInfo.getCompanyId()); |
| | | //本金消耗 |
| | | if (principalPrice > 0 |
| | | && StringUtils.isNotBlank(principalConsumption.getParamValue())) { |
| | | && StringUtils.isNotBlank(principalConsumption.getParamValue()) && Double.parseDouble(principalConsumption.getParamValue()) > 0 ) { |
| | | |
| | | principalConsumScore[0] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue())); |
| | | |
| | | if (StringUtils.isNotBlank(principalConsumption.getParamValue1())) { |
| | | if (StringUtils.isNotBlank(principalConsumption.getParamValue1()) && Double.parseDouble(principalConsumption.getParamValue1()) > 0 ) { |
| | | principalConsumScore[1] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue1())); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(principalConsumption.getParamValue2())) { |
| | | if (StringUtils.isNotBlank(principalConsumption.getParamValue2()) && Double.parseDouble(principalConsumption.getParamValue2()) > 0 ) { |
| | | principalConsumScore[2] = (int) (principalPrice / Double.parseDouble(principalConsumption.getParamValue2())); |
| | | } |
| | | } |
| | |
| | | BusParameterSettings giveConsumption = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.GIVE_CONSUMPTION, vipInfo.getCompanyId()); |
| | | //本金消耗 |
| | | if (giftPrice > 0 |
| | | && StringUtils.isNotBlank(giveConsumption.getParamValue())) { |
| | | && StringUtils.isNotBlank(giveConsumption.getParamValue()) && Double.parseDouble(giveConsumption.getParamValue())>0) { |
| | | |
| | | giveConsumScore[0] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue())); |
| | | |
| | | if (StringUtils.isNotBlank(giveConsumption.getParamValue1())) { |
| | | if (StringUtils.isNotBlank(giveConsumption.getParamValue1()) && Double.parseDouble(giveConsumption.getParamValue1())>0) { |
| | | giveConsumScore[1] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue1())); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(giveConsumption.getParamValue2())) { |
| | | if (StringUtils.isNotBlank(giveConsumption.getParamValue2()) && Double.parseDouble(giveConsumption.getParamValue2())>0 ) { |
| | | giveConsumScore[2] = (int) (giftPrice / Double.parseDouble(giveConsumption.getParamValue2())); |
| | | } |
| | | } |
| | |
| | | // // 判断是服务超时还是服务提前结束,如果minspace大于0则是超时服务,小于0则是提前结束服务 |
| | | // projServices.setIsOverTime(minspace + ""); |
| | | // projServices.setState(Dictionary.SERVICE_STATU_FWWC); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(projServices.getCompanyId(), projServices.getShopId(),sysUsers.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.SERVICE_ORDER_PL, |
| | | projServices.getId(), |
| | | projServices.getServiceNo(), |
| | | projServices.getVipId()); |
| | | |
| | | |
| | | return sysProjServicesDao.update(projServices); |
| | | } |
| | | |
| | |
| | | // 设置美疗师实际开始时间 |
| | | checkBeauticianState.setState(Dictionary.BEATUI_STATE_SYZ); |
| | | projServices.getVipId(); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(projServices.getCompanyId(), projServices.getShopId(),users.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.SERVICE_ORDER_BEGIN, |
| | | projServices.getId(), |
| | | projServices.getServiceNo(), |
| | | projServices.getVipId()); |
| | | |
| | | return beauticianStateDao.update(checkBeauticianState); |
| | | } |
| | | |
| | |
| | | checkprojServices.setState(Dictionary.SERVICE_STATU_FWWC); |
| | | sysProjServicesDao.update(checkprojServices); |
| | | } |
| | | |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(projServices.getCompanyId(), projServices.getShopId(),users.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.SERVICE_ORDER_END, |
| | | projServices.getId(), |
| | | projServices.getServiceNo(), |
| | | projServices.getVipId()); |
| | | return rerunlt; |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int confirmServiceOrder(Long id) { |
| | | SysUsers users = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | SysProjServices services = new SysProjServices(); |
| | | services.setId(id); |
| | | services.setState(Dictionary.BEATUI_STATE_DYY); |
| | | int i = modify(services); |
| | | SysProjServices projServices =findById(id); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(projServices.getCompanyId(), projServices.getShopId(),users.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.SERVICE_ORDER_QRYY, |
| | | projServices.getId(), |
| | | projServices.getServiceNo(), |
| | | projServices.getVipId()); |
| | | |
| | | if (i > 0) { |
| | | //发送微信公众号提醒 |
| | | services = findById(services.getId()); |