| | |
| | | throw new GlobleException("请选择服务"); |
| | | } |
| | | SysVipInfo vipInfo = sysVipInfoService.findById(serviceOrderDto.getVipId()); |
| | | // if (StringUtils.isBlank(vipInfo.getPassWord())) { |
| | | // return AjaxResult.buildFailInstance("未设置资金密码"); |
| | | // } |
| | | |
| | | |
| | | if (StringUtils.isNotBlank(vipInfo.getPassWord())) { |
| | | if (!vipInfo.getPassWord().equals(serviceOrderDto.getPassword())) { |
| | |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_REFERRER=3; |
| | | /** |
| | | * 获取类型(4参加活动) |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_JOIN_ACTIVE=4; |
| | | |
| | | |
| | | /** |
| | | * 获取类型(4人工调整) |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_USERCHANGE=4; |
| | |
| | | * 根据固定等级规则新增用户积分 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addScoreByParamSetting(Long vipId, Long oprationUserId, Long shopId, Integer firstScore, Long businessId, int type, String remark, BusParameterSettings parameterSetting) { |
| | | public void addScoreByParamSetting(Long vipId, Long oprationUserId, Long shopId, Long businessId, int type, String remark, BusParameterSettings parameterSetting) { |
| | | |
| | | |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(vipId); |
| | | |
| | | |
| | | //添加自己的积分 |
| | | if (firstScore > 0) { |
| | | addScore( |
| | | vipInfo.getId(), |
| | | oprationUserId, |
| | | shopId, |
| | | firstScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue()) |
| | | && vipInfo.getRecommendId() != null) { |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | Integer secondScore = new Integer(parameterSetting.getParamValue()); |
| | | if (secondScore > 0) { |
| | | addScore( |
| | | referrerVip.getId(), |
| | | oprationUserId, |
| | | shopId, |
| | | secondScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | //推荐注册二级带新积分奖励 |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue1()) |
| | | && referrerVip.getRecommendId() != null) { |
| | | Integer threeScore = new Integer(parameterSetting.getParamValue()); |
| | | if (threeScore > 0) { |
| | | if (parameterSetting != null) { |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(vipId); |
| | | //添加自己的积分 |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue())) { |
| | | Integer firstScore = new Integer(parameterSetting.getParamValue()); |
| | | if (firstScore > 0) { |
| | | addScore( |
| | | referrerVip.getRecommendId(), |
| | | vipInfo.getId(), |
| | | oprationUserId, |
| | | shopId, |
| | | threeScore, |
| | | firstScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue1()) |
| | | && vipInfo.getRecommendId() != null) { |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | Integer secondScore = new Integer(parameterSetting.getParamValue1()); |
| | | if (secondScore > 0) { |
| | | addScore( |
| | | referrerVip.getId(), |
| | | oprationUserId, |
| | | shopId, |
| | | secondScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | //推荐注册二级带新积分奖励 |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue2()) |
| | | && referrerVip.getRecommendId() != null) { |
| | | Integer threeScore = new Integer(parameterSetting.getParamValue2()); |
| | | if (threeScore > 0) { |
| | | addScore( |
| | | referrerVip.getRecommendId(), |
| | | oprationUserId, |
| | | shopId, |
| | | threeScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.bean.ShopProductComment; |
| | |
| | | @Autowired |
| | | private ShopOrderDao shopOrderDao; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | /** |
| | | * 根据ID逻辑删除产品评价 |
| | | * @param |
| | |
| | | } |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "删除成功"); |
| | | } |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | /** |
| | | * 接收保存产品评价数据 |
| | |
| | | modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_ALREADY_REMARK); |
| | | shopOrderDao.updateByMap(modifyMap); |
| | | |
| | | //scoreVipDetailService.addScoreByParamSetting(loginUser.getId(),null,); |
| | | //添加用户积分 |
| | | BusParameterSettings parameterSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.EVALUATUIN_ORDER_SHOP_NAME, loginUser.getCompanyId()); |
| | | scoreVipDetailService.addScoreByParamSetting(loginUser.getId(), null,null, commentList.get(0).getComId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"评价送积分", parameterSetting); |
| | | |
| | | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.app.mapper.SysProjUseMapper; |
| | | import com.matrix.system.app.vo.*; |
| | | import com.matrix.system.app.vo.ServiceProductListVo; |
| | | import com.matrix.system.app.vo.ServiceProjVo; |
| | | import com.matrix.system.app.vo.ServiceTcVo; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.common.tools.LocationUtil; |
| | |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.service.*; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.api.dto.ErpServiceCommentDto; |
| | | import com.matrix.system.shopXcx.api.dto.ErpServiceOrderListDto; |
| | | import com.matrix.system.shopXcx.api.vo.ErpServiceOrderListVo; |
| | |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import com.matrix.system.shopXcx.dto.YYDayOfWeek; |
| | | import com.matrix.system.shopXcx.dto.YYmonth; |
| | | import io.swagger.annotations.*; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author jiangyouyao |
| | |
| | | |
| | | @Autowired |
| | | ShoppingGoodsDao shoppingGoodsDao; |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Value("${evn}") |
| | | private String evn; |
| | |
| | | sysProjServices.setState(Dictionary.SERVICE_STATU_DQR); |
| | | SysProjServices newSysProjServices = projServicesService.addSysProjServices(sysProjServices); |
| | | if (newSysProjServices != null) { |
| | | |
| | | //添加用户积分 |
| | | BusParameterSettings parameterSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.RESERVATION_SERVICE_SHOP, sysVipInfo.getCompanyId()); |
| | | scoreVipDetailService.addScoreByParamSetting(sysVipInfo.getId(), null,null, newSysProjServices.getId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"预约送积分", parameterSetting); |
| | | |
| | | |
| | | return AjaxResult.buildSuccessInstance("下单成功"); |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "下单失败!"); |
| | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Integer comId; |
| | | private Long comId; |
| | | |
| | | |
| | | /** |
| | |
| | | auditStatus = auditStatus; |
| | | } |
| | | |
| | | public Integer getComId() { |
| | | public Long getComId() { |
| | | return comId; |
| | | } |
| | | |
| | | public void setComId(Integer comId) { |
| | | this.comId=comId; |
| | | |
| | | public void setComId(Long comId) { |
| | | this.comId = comId; |
| | | } |
| | | |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | |
| | | package com.matrix.system.shopXcx.mqTask; |
| | | |
| | | |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | |
| | | SysVipInfoService sysVipInfoService; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Override |
| | | public void handle(String consumerTag, Delivery message) throws IOException { |
| | |
| | | List<ShopOrderDetails> orderDetails = shopOrderDetailsDao.selectByOrderId(Integer.valueOf(orderId)); |
| | | order.setDetails(orderDetails); |
| | | //扣除积分 |
| | | 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{ |
| | | 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; |
| | | int addScore = 0; |
| | | BusParameterSettings cashConsumptionShop = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.CASH_CONSUMPTION_SHOP, order.getCompanyId()); |
| | | for(ShopOrderDetails shopOrderDetail : orderDetails) { |
| | | if(shopOrderDetail.getPayType()==ShopOrderDetails.PAYTYPE_MICRO){ |
| | | Integer xfkdScore= shopOrderDetail.getShopSku().getScore(); |
| | | if(xfkdScore!=null && xfkdScore>0){ |
| | | addScore+=xfkdScore; |
| | | }else{ |
| | | if(StringUtils.isNotBlank(cashConsumptionShop.getParamValue())){ |
| | | addScore+= shopOrderDetail.getTotalPrice().divide(new BigDecimal(cashConsumptionShop.getParamValue())).intValue(); |
| | | for (ShopOrderDetails shopOrderDetail : orderDetails) { |
| | | if (shopOrderDetail.getPayType() == ShopOrderDetails.PAYTYPE_MICRO) { |
| | | Integer xfkdScore = shopOrderDetail.getShopSku().getScore(); |
| | | if (xfkdScore != null && xfkdScore > 0) { |
| | | addScore += xfkdScore; |
| | | } else { |
| | | if (StringUtils.isNotBlank(cashConsumptionShop.getParamValue())) { |
| | | addScore += shopOrderDetail.getTotalPrice().divide(new BigDecimal(cashConsumptionShop.getParamValue())).intValue(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(addScore>0){ |
| | | if (addScore > 0) { |
| | | //插入新的积分 |
| | | scoreVipDetailService.addScore( |
| | | order.getUserId(), |
| | | null, |
| | | Long.parseLong(order.getStoreId()+""), |
| | | Long.parseLong(order.getStoreId() + ""), |
| | | addScore, |
| | | Long.parseLong(orderId+""), |
| | | Long.parseLong(orderId + ""), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_CASH, |
| | | "微商城消费"); |
| | | |
| | | //插入上级积分 |
| | | SysVipInfo vipInfo = sysVipInfoService.findById(order.getUserId()); |
| | | |
| | | |
| | | if (vipInfo.getRecommendId() != null) { |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | if (StringUtils.isNotBlank(cashConsumptionShop.getParamValue1())) { |
| | | |
| | | int parentScore = order.getOrderMoney().divide(new BigDecimal(cashConsumptionShop.getParamValue1())).intValue(); |
| | | if (parentScore > 0) { |
| | | scoreVipDetailService.addScore( |
| | | referrerVip.getId(), |
| | | null, |
| | | Long.parseLong(order.getStoreId() + ""), |
| | | parentScore, |
| | | Long.parseLong(order.getId() + ""), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_CASH, |
| | | "推荐消费奖励" |
| | | ); |
| | | } |
| | | } |
| | | |
| | | //推荐注册二级带新积分奖励 |
| | | if (referrerVip.getRecommendId() != null && StringUtils.isNotBlank(cashConsumptionShop.getParamValue2())) { |
| | | SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId()); |
| | | int topParentScore = order.getOrderMoney().divide(new BigDecimal(cashConsumptionShop.getParamValue2())).intValue(); |
| | | if (topParentScore > 0) { |
| | | scoreVipDetailService.addScore( |
| | | topVipInfo.getId(), |
| | | null, |
| | | Long.parseLong(order.getStoreId() + ""), |
| | | topParentScore, |
| | | Long.parseLong(order.getId() + ""), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_CASH, |
| | | "推荐消费奖励" |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |