| | |
| | | import com.matrix.system.app.vo.ServiceOrderListVo; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.constance.Dictionary; |
| | |
| | | sysOutStoreItemDao.deleteByOrderId(sysOutStore.getId()); |
| | | } |
| | | //删除积分 |
| | | scoreVipDetailService.removeByBusinessId(null,checkProjServices.getVipId(), checkProjServices.getId()); |
| | | scoreVipDetailService.removeByBusinessId(checkProjServices.getVipId(), checkProjServices.getId()); |
| | | |
| | | //更新服务单状态 |
| | | return sysProjServicesDao.update(checkProjServices); |
| | |
| | | |
| | | //添加自己的积分 |
| | | if (selfScore > 0) { |
| | | scoreVipDetailService.addScore(null, |
| | | scoreVipDetailService.addScore( |
| | | vipInfo.getId(), |
| | | projServices.getCreateStaffId(), |
| | | projServices.getShopId(), |
| | |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | if (parentScore > 0) { |
| | | scoreVipDetailService.addScore(null, |
| | | scoreVipDetailService.addScore( |
| | | referrerVip.getId(), |
| | | projServices.getCreateStaffId(), |
| | | projServices.getShopId(), |
| | |
| | | if (referrerVip.getRecommendId() != null) { |
| | | SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId()); |
| | | if (topParentScore > 0) { |
| | | scoreVipDetailService.addScore(null, |
| | | scoreVipDetailService.addScore( |
| | | topVipInfo.getId(), |
| | | projServices.getCreateStaffId(), |
| | | projServices.getShopId(), |
| | |
| | | if (!projServices.getState().equals(Dictionary.SERVICE_STATU_XPL)) { |
| | | throw new GlobleException("该服务单状态为" + projServices.getState() + ",不可以进行当前操作!"); |
| | | } |
| | | projServicesVo.setCompanyId(projServices.getCompanyId()); |
| | | if (isNeedOutStore(projServicesVo)) { |
| | | |
| | | // 生成出库单 |
| | |
| | | * @return |
| | | */ |
| | | private boolean isNeedOutStore(SysProjServices projServicesVo) { |
| | | |
| | | if (CollectionUtils.isNotEmpty(projServicesVo.getOutStoreItem())) { |
| | | for (SysOutStoreItem item : projServicesVo.getOutStoreItem()) { |
| | | if (item.getAmount() != null && item.getAmount() > 0) { |
| | | return true; |
| | | BusParameterSettings manageStockSetting = busParameterSettingsDao.selectCompanyParamByCode(AppConstance.WAREHOUSE_MANAGE_STOCK, projServicesVo.getCompanyId()); |
| | | if(AppConstance.IS_Y.equals(manageStockSetting.getParamValue())){ |
| | | for (SysOutStoreItem item : projServicesVo.getOutStoreItem()) { |
| | | if (item.getAmount() != null && item.getAmount() > 0) { |
| | | return true; |
| | | } |
| | | } |
| | | } |
| | | } |