| | |
| | | * 扣除用户积分 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deductionScore(String openId, Long vipId,Long shopId, Integer score, Long businessId, int type) { |
| | | public void deductionScore(String openId, Long vipId,Long shopId, Integer score, Long businessId, int type,String remark) { |
| | | Long companyId=null; |
| | | if(openId!=null){ |
| | | companyId= bizUserDao.findByOpenId(openId).getCompanyId(); |
| | |
| | | scoreUseRecord.setShopId(shopId); |
| | | scoreUseRecord.setOpenId(openId); |
| | | scoreUseRecord.setVipId(vipId); |
| | | scoreUseRecord.setRemarks(remark); |
| | | scoreUseRecordDao.insert(scoreUseRecord); |
| | | |
| | | if(surplus > 0 || surplus == 0){ |
| | |
| | | List<ShopOrderDetails> orderDetails = shopOrderDetailsDao.selectByOrderId(Integer.valueOf(orderId)); |
| | | order.setDetails(orderDetails); |
| | | //扣除积分 |
| | | if(order.getScorePay()!=null){ |
| | | scoreVipDetailService.deductionScore(order.getUserId(),null,Long.parseLong(order.getStoreId()+""),order.getScorePay(),Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH); |
| | | if(order.getScorePay()!=null&&order.getScorePay()>0){ |
| | | scoreVipDetailService.deductionScore(order.getUserId(),null,Long.parseLong(order.getStoreId()+""),order.getScorePay(),Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH,"商城积分抵扣"); |
| | | }else{ |
| | | //消费获得积分 |
| | | int addScore=0; |