合并BizUser表与SysVipInfo表
大部分逻辑已经修正
可能存在问题的
1、拼团秒杀
2、分享图
3、分销结算
1 files added
57 files deleted
119 files modified
| | |
| | | return new ScoreOrderTask(); |
| | | } |
| | | |
| | | @Bean |
| | | VipCreateTask VipCreateTask() { |
| | | return new VipCreateTask(); |
| | | } |
| | | |
| | | |
| | | @Bean |
| | | OrderTask OrderrCreateTask() { |
| | |
| | | List<MqTask> taskList = new ArrayList<>(); |
| | | |
| | | //注册RabbitMq任务 |
| | | taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.CREATE_VIP + evn, MQTaskRouting.CREATE_VIP + evn, VipCreateTask())); |
| | | //订阅模式 |
| | | |
| | | |
| | | taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.SEND_TEMPLATE_MSG + evn,MQTaskRouting.SEND_TEMPLATE_MSG + evn, TemplateMsgTask())); |
| | | taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.ORDER_OUT_SOTORE + evn,MQTaskRouting.ORDER_OUT_SOTORE + evn, OrderOutSotoreTask())); |
| | | taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG + evn,MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG + evn, UniformMsgSentTask())); |
| | |
| | | package com.matrix.system.activity.entity; |
| | | |
| | | import com.matrix.core.pojo.EntityDTO; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @description 领 |
| | |
| | | |
| | | |
| | | /** |
| | | * openID |
| | | * userId |
| | | */ |
| | | |
| | | |
| | | private String openId; |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 领取时间 |
| | |
| | | package com.matrix.system.activity.entity; |
| | | |
| | | import com.matrix.core.pojo.EntityDTO; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @description 签到记录表 |
| | |
| | | |
| | | |
| | | /** |
| | | * openID |
| | | * userId |
| | | */ |
| | | |
| | | |
| | | private String openId; |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 签到时间 |
| | |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | |
| | | private ShoppingGoodsDao shoppingGoodsDao; |
| | | |
| | | @Autowired |
| | | private BizUserDao bizUserDao; |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | private ShopProductDao shopProductDao; |
| | |
| | | package com.matrix.system.fenxiao.action; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; |
| | | import com.matrix.system.fenxiao.dto.*; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanApply; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | | import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; |
| | | import com.matrix.system.fenxiao.vo.*; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | |
| | | @Autowired |
| | | private ShopSalesmanApplyDao shopSalesmanApplyDao; |
| | | @Autowired |
| | | private BizUserDao bizUserDao; |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | @Autowired |
| | | private ShopSalesmanGradeDao shopSalesmanGradeDao; |
| | | @Autowired |
| | |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(loadParamSettingBasicDto); |
| | | AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); |
| | | //根据OPENID查询基础信息 |
| | | String userId = loadParamSettingBasicDto.getUserId(); |
| | | String applyId = loadParamSettingBasicDto.getApplyId(); |
| | | SalesmanBasicDetailVo salesmanBasicDetailVo = shopSalesmanApplyService.selectShopSalesmanDetailByOpenId(userId,Long.parseLong(applyId)); |
| | | SalesmanBasicDetailVo salesmanBasicDetailVo = shopSalesmanApplyService.selectShopSalesmanDetailByOpenId(loadParamSettingBasicDto.getUserId(),loadParamSettingBasicDto.getApplyId()); |
| | | result.putInMap("basicdetail", salesmanBasicDetailVo); |
| | | return result; |
| | | } |
| | |
| | | @PostMapping(value = "/addSaleManApply") |
| | | public @ResponseBody |
| | | AjaxResult addSaleManApply(@RequestBody AddSaleManApplyDto addSaleManApplyDto) { |
| | | String gradeId = addSaleManApplyDto.getGradeId(); |
| | | if(StrUtil.isBlankOrUndefined(gradeId)) { |
| | | return AjaxResult.buildFailInstance("请选择分销等级"); |
| | | } |
| | | ShopSalesmanGrade selectById = shopSalesmanGradeDao.selectById(Long.parseLong(gradeId)); |
| | | if(ObjectUtil.isEmpty(selectById)) { |
| | | |
| | | if(addSaleManApplyDto.getGradeId()==null) { |
| | | return AjaxResult.buildFailInstance("请选择分销等级"); |
| | | } |
| | | |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(addSaleManApplyDto); |
| | | |
| | | shopSalesmanApplyService.addSaleManApply(addSaleManApplyDto.getOpenId(),gradeId); |
| | | shopSalesmanApplyService.addSaleManApply(addSaleManApplyDto.getUserId(), addSaleManApplyDto.getGradeId()); |
| | | return AjaxResult.buildSuccessInstance("设置成功"); |
| | | } |
| | | |
| | |
| | | AjaxResult examineSaleManApply(@RequestBody ExamineSaleManApplyDto examineSaleManApplyDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(examineSaleManApplyDto); |
| | | String userId = examineSaleManApplyDto.getUserId(); |
| | | //待审核状态才允许提交 |
| | | ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyDao.selectById(examineSaleManApplyDto.getApplyId()); |
| | | if(ObjectUtil.isEmpty(shopSalesmanApply)) { |
| | | return AjaxResult.buildFailInstance("当前记录有误"); |
| | | } |
| | | |
| | | BizUser bizUser = bizUserDao.findByOpenId(userId); |
| | | if(ObjectUtil.isEmpty(bizUser)) { |
| | | SysVipInfo sysVipInfo = sysVipInfoDao.selectById(examineSaleManApplyDto.getUserId()); |
| | | if(ObjectUtil.isEmpty(sysVipInfo)) { |
| | | return AjaxResult.buildFailInstance("当前记录有误"); |
| | | } |
| | | |
| | |
| | | */ |
| | | public interface ShopSalesmanApplyDao extends BaseMapper<ShopSalesmanApply> { |
| | | |
| | | IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("openId") String openId, @Param("isSales")String isSales); |
| | | IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("id") Long userId, @Param("isSales")String isSales); |
| | | |
| | | IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("openId") String openId); |
| | | IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("userId") Long userId); |
| | | |
| | | IPage<ShopSalesmanApplyVo> findShopSalesmanApplyList(Page<ShopSalesmanApplyVo> page, |
| | | @Param("record")ShopSalesmanApplyDto shopSalesmanApplyDto); |
| | |
| | | IPage<ShopSalesmanAppliingVo> selectBizUserApplyList(Page<ShopSalesmanAppliingVo> page, |
| | | @Param("record")ShopSalesmanAppliingDto shopSalesmanAppliingDto); |
| | | |
| | | SalesmanCenterInfo selectSalesmanCenterInfo(String openId); |
| | | SalesmanCenterInfo selectSalesmanCenterInfo(Long id); |
| | | |
| | | SalesmanBasicDetailVo selectShopSalesmanDetailByOpenId(@Param("userId")String userId, |
| | | SalesmanBasicDetailVo selectShopSalesmanDetailByOpenId(@Param("userId")Long userId, |
| | | @Param("companyId")Long companyId,@Param("applyId")long applyId); |
| | | |
| | | IPage<ShopCustomDetailVo> findCustomDetail(Page<ShopCustomDetailVo> page, |
| | |
| | | public class AddSaleManApplyDto { |
| | | |
| | | @ApiModelProperty(value ="会员ID") |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "申请用户openId") |
| | | private String openId; |
| | | |
| | | @ApiModelProperty(value ="等级ID") |
| | | private String gradeId; |
| | | private Long gradeId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | |
| | | @ApiModel(value = "ChangeSaleManGradeDto", description = "查询参数") |
| | | public class ChangeSaleManGradeDto { |
| | | |
| | | @ApiModelProperty(value ="会员OPENID") |
| | | private String userId; |
| | | @ApiModelProperty(value ="会员id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value ="等级ID") |
| | | private Long gradeId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | } |
| | |
| | | @ApiModel(value = "DelSaleManGradeApplyDto", description = "查询参数") |
| | | public class DelSaleManGradeApplyDto { |
| | | |
| | | @ApiModelProperty(value ="会员OPENID") |
| | | private String userId; |
| | | @ApiModelProperty(value ="会员id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value ="申请记录ID") |
| | | private Long applyId; |
| | |
| | | |
| | | @NotNull |
| | | @ApiModelProperty(value ="会员ID") |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "申请记录ID") |
| | | private Long applyId; |
| | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | | |
| | | @ApiModelProperty(value ="会员OPENID") |
| | | private String userId; |
| | | @ApiModelProperty(value ="会员ID") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value ="申请记录ID") |
| | | private Long applyId; |
| | |
| | | @ApiModel(value = "LoadParamSettingBasicDto", description = "查询参数") |
| | | public class LoadParamSettingBasicDto { |
| | | |
| | | @ApiModelProperty(value ="会员OPENID") |
| | | private String userId; |
| | | @ApiModelProperty(value ="会员ID") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value ="申请记录ID") |
| | | private String applyId; |
| | | private Long applyId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | |
| | | @ApiModelProperty(value ="会员姓名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value ="会员OPENID") |
| | | private String userId; |
| | | @ApiModelProperty(value ="会员ID") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value ="申请记录ID") |
| | | private String applyId; |
| | | private Long applyId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | |
| | | @ApiModelProperty(value ="会员姓名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value ="会员OPENID") |
| | | private String userId; |
| | | @ApiModelProperty(value ="会员ID") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value ="申请记录ID") |
| | | private String applyId; |
| | | private Long applyId; |
| | | |
| | | @ApiModelProperty(value = " 结算状态1,待结算,2,已结算,3已退款") |
| | | private Integer orderType; |
| | |
| | | @ApiModel(value = "UnbundlingSaleManDto", description = "查询参数") |
| | | public class UnbundlingSaleManDto { |
| | | |
| | | @ApiModelProperty(value ="会员OPENID") |
| | | private String userId; |
| | | @ApiModelProperty(value ="会员ID") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | |
| | | * 用户id |
| | | */ |
| | | @ApiModelProperty(hidden = true) |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 收益说明 |
| | |
| | | private Integer applyWay; |
| | | |
| | | @ApiModelProperty(value = "申请用户id") |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "邀请用户ID") |
| | | private String parentUserId; |
| | | private Long parentUserId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "申请状态1、待审核,2通过,3未通过") |
| | |
| | | */ |
| | | |
| | | |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | /** |
| | | * 收益人id |
| | | */ |
| | | |
| | | |
| | | private String salesUserId; |
| | | private Long salesUserId; |
| | | |
| | | /** |
| | | * 收益类型1,推广收益,2邀请收益 |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.biz.service.BizUserService; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.VerificationResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | | import com.matrix.system.fenxiao.vo.*; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | 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.shopXcx.dao.ShopOrderV2Dao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | ShopSalesmanGradeDao shopSalesmanGradeDao; |
| | | |
| | | @Autowired |
| | | BizUserDao bizUserDao; |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | BizUserService bizUserService; |
| | | SysVipInfoService sysVipInfoService; |
| | | |
| | | @Autowired |
| | | ShopOrderV2Dao shopOrderV2Dao; |
| | | |
| | | /** |
| | | * 申请成为推广员 |
| | | * @param openId |
| | | * @param userId |
| | | * @param invitationId |
| | | * @return |
| | | */ |
| | | public ShopSalesmanApply applyToBeAnSalesman(String openId,String gradeId,String invitationId,int applyWay) { |
| | | public ShopSalesmanApply applyToBeAnSalesman(Long userId,Long gradeId,Long invitationId,int applyWay) { |
| | | |
| | | BizUser loginUser=bizUserDao.findByOpenId(openId); |
| | | SysVipInfo loginUser=sysVipInfoDao.selectById(userId); |
| | | //验证申请条件 |
| | | VerificationResult verificationResult = isAbleToBeAnSalesman(openId,loginUser.getCompanyId()); |
| | | VerificationResult verificationResult = isAbleToBeAnSalesman(userId,loginUser.getCompanyId()); |
| | | if(verificationResult.isJudgeResult()){ |
| | | //校验审核状态,和是否重复发起 |
| | | QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id",loginUser.getOpenId()); |
| | | queryWrapper.eq("user_id",loginUser.getId()); |
| | | queryWrapper.in("apply_status",Arrays.asList("1,2".split(","))); |
| | | ShopSalesmanApply checkApply = shopSalesmanApplyDao.selectOne(queryWrapper); |
| | | if(checkApply==null|| |
| | | checkApply.getApplyStatus()==ShopSalesmanApply.APPLY_STATUS_WTG){ |
| | | |
| | | ShopSalesmanApply shopSalesmanApply=new ShopSalesmanApply(); |
| | | shopSalesmanApply.setUserId(openId); |
| | | shopSalesmanApply.setUserId(userId); |
| | | |
| | | shopSalesmanApply.setCreateBy(MatrixConstance.SYSTEM_USER); |
| | | shopSalesmanApply.setApplyWay(ShopSalesmanApply.APPLY_WAY_SELF); |
| | |
| | | shopSalesmanApply.setCreateTime(date); |
| | | shopSalesmanApply.setUpdateTime(date); |
| | | |
| | | if(StringUtils.isNotBlank(invitationId)){ |
| | | if(invitationId!=null){ |
| | | shopSalesmanApply.setParentUserId(invitationId); |
| | | }else if(StringUtils.isNotBlank(loginUser.getParentOpenId())){ |
| | | }else if(loginUser.getRecommendId()!=null){ |
| | | //如果曾经是被邀请进来的则自动绑定为之前邀请人的下级 |
| | | shopSalesmanApply.setParentUserId(loginUser.getParentOpenId()); |
| | | shopSalesmanApply.setParentUserId(loginUser.getRecommendId()); |
| | | } |
| | | if(StringUtils.isNotBlank(gradeId)){ |
| | | shopSalesmanApply.setGradeId(Long.parseLong(gradeId)); |
| | | if(gradeId!=null){ |
| | | shopSalesmanApply.setGradeId(gradeId); |
| | | }else{ |
| | | //获取初始等级ID(公司id,是否为初始等级) |
| | | QueryWrapper<ShopSalesmanGrade> queryWrapperOrepool = new QueryWrapper<>(); |
| | |
| | | queryWrapperOrepool.eq("is_default", 1); |
| | | ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectOne(queryWrapperOrepool); |
| | | shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_TG); |
| | | bizUserService.setToBeAnSalesman(loginUser.getOpenId(),invitationId,shopSalesmanGrade.getId()); |
| | | sysVipInfoService.setToBeAnSalesman(loginUser.getId(),invitationId,shopSalesmanGrade.getId()); |
| | | |
| | | }else{ |
| | | shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_DSH); |
| | |
| | | /** |
| | | * 判断是否满足申请成为分销员的条件 |
| | | */ |
| | | public VerificationResult isAbleToBeAnSalesman(String openId,Long companyId) { |
| | | public VerificationResult isAbleToBeAnSalesman(Long userId,Long companyId) { |
| | | |
| | | VerificationResult verificationResult=null; |
| | | |
| | | //申请模式 |
| | | BusParameterSettings applyWay = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_WAY, companyId); |
| | | if (applyWay.getParamValue().equals(FenxiaoSettingConstant.FX_APPLY_WAY_AUTO)) { |
| | | if (FenxiaoSettingConstant.FX_APPLY_WAY_AUTO.equals(applyWay.getParamValue())) { |
| | | verificationResult= VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | | //申请条件 |
| | |
| | | verificationResult= VerificationResult.buildVerificationResult(true); |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP: |
| | | int buyZdcpCount= shopOrderV2Dao.countBuyZdcp(openId,applyCondition.getParamValue1()); |
| | | int buyZdcpCount= shopOrderV2Dao.countBuyZdcp(userId,applyCondition.getParamValue1()); |
| | | if(buyZdcpCount>0){ |
| | | verificationResult= VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFRYCP: |
| | | //判断用户是否有确认收货的产品 |
| | | int receivedOrderCount= shopOrderV2Dao.selectReceivedOrderCount(openId); |
| | | int receivedOrderCount= shopOrderV2Dao.selectReceivedOrderCount(userId); |
| | | if(receivedOrderCount>0){ |
| | | verificationResult= VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | |
| | | break; |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE: |
| | | Double zdje=Double.parseDouble(applyCondition.getParamValue2()); |
| | | Double yxfje=shopOrderV2Dao.countOrderAmount(openId); |
| | | Double yxfje=shopOrderV2Dao.countOrderAmount(userId); |
| | | if(zdje<yxfje){ |
| | | verificationResult=VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addSaleManApply(String userId,String gradeId) { |
| | | BizUser user = bizUserDao.findByOpenId(userId); |
| | | applyToBeAnSalesman(user.getOpenId(),gradeId, "",ShopSalesmanApply.APPLY_WAY_HAND_ADD); |
| | | public void addSaleManApply(Long userId,Long gradeId) { |
| | | SysVipInfo user = sysVipInfoDao.selectById(userId); |
| | | applyToBeAnSalesman(user.getId(),gradeId, null,ShopSalesmanApply.APPLY_WAY_HAND_ADD); |
| | | } |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void examineSaleManApply(ShopSalesmanApply shopSalesmanApply, Integer applyState) { |
| | | String userId = shopSalesmanApply.getUserId(); |
| | | String parentUserId = shopSalesmanApply.getParentUserId(); |
| | | BizUser bizUser = bizUserDao.findByOpenId(userId); |
| | | Long userId = shopSalesmanApply.getUserId(); |
| | | Long parentUserId = shopSalesmanApply.getParentUserId(); |
| | | SysVipInfo sysVipInfo = sysVipInfoDao.selectById(userId); |
| | | //修改审核记录 |
| | | if(ShopSalesmanApply.APPLY_STATUS_TG == applyState) { |
| | | shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_TG); |
| | | bizUser.setIsSales(BizUser.IS_SALES); |
| | | sysVipInfo.setIsSales(SysVipInfo.IS_SALES); |
| | | }else { |
| | | shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_WTG); |
| | | bizUser.setIsSales(BizUser.NOT_SALES); |
| | | sysVipInfo.setIsSales(SysVipInfo.NOT_SALES); |
| | | } |
| | | shopSalesmanApplyDao.updateById(shopSalesmanApply); |
| | | //修改USER的状态 |
| | | bizUser.setParentOpenId(parentUserId); |
| | | bizUser.setBindingParentTime(new Date()); |
| | | bizUser.setSalesmanGrade(shopSalesmanApply.getGradeId()); |
| | | bizUserDao.updateByModel(bizUser); |
| | | sysVipInfo.setRecommendId(parentUserId); |
| | | sysVipInfo.setBindingParentTime(new Date()); |
| | | sysVipInfo.setSalesmanGrade(shopSalesmanApply.getGradeId()); |
| | | sysVipInfoDao.update(sysVipInfo); |
| | | } |
| | | |
| | | public IPage<ShopSalesmanApplyVo> findShopSalesmanDetail(Page<ShopSalesmanApplyVo> page, |
| | |
| | | return null; |
| | | } |
| | | |
| | | public SalesmanBasicDetailVo selectShopSalesmanDetailByOpenId(String userId, long applyId) { |
| | | public SalesmanBasicDetailVo selectShopSalesmanDetailByOpenId(Long userId, long applyId) { |
| | | //获取个人信息 |
| | | BizUser bizUser = bizUserDao.findByOpenId(userId); |
| | | Long companyId = bizUser.getCompanyId(); |
| | | return shopSalesmanApplyDao.selectShopSalesmanDetailByOpenId(userId,companyId,applyId); |
| | | SysVipInfo sysVipInfo = sysVipInfoDao.selectById(userId); |
| | | Long companyId = sysVipInfo.getCompanyId(); |
| | | return shopSalesmanApplyDao.selectShopSalesmanDetailByOpenId(sysVipInfo.getId(),companyId,applyId); |
| | | } |
| | | |
| | | public IPage<ShopCustomDetailVo> findCustomDetail(Page<ShopCustomDetailVo> page,LoadParamSettingDto loadParamSettingDto) { |
| | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult changeSaleManGrade(ChangeSaleManGradeDto changeSaleManGradeDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(changeSaleManGradeDto); |
| | | String userId = changeSaleManGradeDto.getUserId(); |
| | | Long companyId = changeSaleManGradeDto.getCompanyId(); |
| | | |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(changeSaleManGradeDto.getUserId()); |
| | | |
| | | //获取对应的公司的等级 |
| | | QueryWrapper<ShopSalesmanGrade> queryWrapperOrepool = new QueryWrapper<>(); |
| | | queryWrapperOrepool.eq("is_default", 1); |
| | | queryWrapperOrepool.eq("company_id", companyId); |
| | | queryWrapperOrepool.eq("company_id", vipInfo.getCompanyId()); |
| | | ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectOne(queryWrapperOrepool); |
| | | //修改Biz_User的salesman_grade |
| | | BizUser findByOpenId = bizUserDao.findByOpenId(userId); |
| | | if(ObjectUtil.isEmpty(findByOpenId)) { |
| | | return AjaxResult.buildFailInstance("当前用户已不存在"); |
| | | } |
| | | |
| | | //不是分销员不允许修改 |
| | | Integer isSales = findByOpenId.getIsSales(); |
| | | if(BizUser.IS_SALES != isSales) { |
| | | Integer isSales = vipInfo.getIsSales(); |
| | | if(SysVipInfo.IS_SALES != isSales) { |
| | | return AjaxResult.buildFailInstance("当前用户未通过审核,不允许修改"); |
| | | } |
| | | |
| | | //修改申请记录的等级 |
| | | QueryWrapper<ShopSalesmanApply> queryShopSalesmanApply = new QueryWrapper<>(); |
| | | queryShopSalesmanApply.eq("apply_status", 2); |
| | | queryShopSalesmanApply.eq("user_id", userId); |
| | | queryShopSalesmanApply.eq("company_id", companyId); |
| | | queryShopSalesmanApply.eq("user_id", vipInfo.getId()); |
| | | queryShopSalesmanApply.eq("company_id", vipInfo.getCompanyId()); |
| | | ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyDao.selectOne(queryShopSalesmanApply); |
| | | Long gradeId = changeSaleManGradeDto.getGradeId(); |
| | | if(ObjectUtil.isEmpty(gradeId)) { |
| | | findByOpenId.setSalesmanGrade(shopSalesmanGrade.getId()); |
| | | vipInfo.setSalesmanGrade(shopSalesmanGrade.getId()); |
| | | shopSalesmanApply.setGradeId(shopSalesmanGrade.getId()); |
| | | }else { |
| | | findByOpenId.setSalesmanGrade(gradeId); |
| | | vipInfo.setSalesmanGrade(gradeId); |
| | | shopSalesmanApply.setGradeId(gradeId); |
| | | } |
| | | bizUserDao.updateByModel(findByOpenId); |
| | | sysVipInfoDao.update(vipInfo); |
| | | shopSalesmanApplyDao.updateById(shopSalesmanApply); |
| | | |
| | | return AjaxResult.buildSuccessInstance("修改等级成功"); |
| | |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult unbundlingSaleMan(UnbundlingSaleManDto unbundlingSaleManDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(unbundlingSaleManDto); |
| | | String userId = unbundlingSaleManDto.getUserId(); |
| | | //将Biz_User的parent_open_id置空 |
| | | BizUser findByOpenId = bizUserDao.findByOpenId(userId); |
| | | if(ObjectUtil.isEmpty(findByOpenId)) { |
| | | return AjaxResult.buildFailInstance("当前用户已不存在"); |
| | | } |
| | | findByOpenId.setParentOpenId(""); |
| | | bizUserDao.updateByModel(findByOpenId); |
| | | |
| | | Long userId = unbundlingSaleManDto.getUserId(); |
| | | sysVipInfoDao.unbundlingSaleMan(userId); |
| | | return AjaxResult.buildSuccessInstance("解绑成功"); |
| | | } |
| | | |
| | |
| | | public AjaxResult delSaleManGradeApply(DelSaleManGradeApplyDto delSaleManGradeApplyDto) { |
| | | //设置用户公司ID |
| | | QueryUtil.setQueryLimitCom(delSaleManGradeApplyDto); |
| | | String userId = delSaleManGradeApplyDto.getUserId(); |
| | | Long applyid = delSaleManGradeApplyDto.getApplyId(); |
| | | |
| | | |
| | | //将biz_user的is_sale设置成否 |
| | | BizUser findByOpenId = bizUserDao.findByOpenId(userId); |
| | | if(ObjectUtil.isEmpty(findByOpenId)) { |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(delSaleManGradeApplyDto.getUserId()); |
| | | if(ObjectUtil.isEmpty(vipInfo)) { |
| | | return AjaxResult.buildFailInstance("当前用户已不存在"); |
| | | } |
| | | findByOpenId.setIsSales(BizUser.NOT_SALES); |
| | | bizUserDao.updateByModel(findByOpenId); |
| | | vipInfo.setIsSales(SysVipInfo.NOT_SALES); |
| | | sysVipInfoDao.update(vipInfo); |
| | | //将记录设置成系统取消 |
| | | ShopSalesmanApply selectById = shopSalesmanApplyDao.selectById(applyid); |
| | | ShopSalesmanApply selectById = shopSalesmanApplyDao.selectById(delSaleManGradeApplyDto.getApplyId()); |
| | | selectById.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_XTQX); |
| | | shopSalesmanApplyDao.updateById(selectById); |
| | | return AjaxResult.buildSuccessInstance("操作成功"); |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | |
| | | @Autowired |
| | | ShopOrderDao shopOrderDao; |
| | | @Autowired |
| | | BizUserDao bizUserDao; |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | public AjaxResult loadFenxiaoOrderBasic(LoadFenxiaoOrderBasicDto loadFenxiaoOrderBasicDto) { |
| | | //设置用户公司ID |
| | |
| | | shopRevenueFlowDao.insert(salesRevenueFlow); |
| | | //选择微信余额支付,更新用户的金额 |
| | | if(ShopSalemanSettlement.SETTLEMENTWAY_YEJS == updateSetOrderDoneDto.getSetType()) { |
| | | BizUser findByOpenId = bizUserDao.findByOpenId(shopSalesmanOrder.getSalesUserId()); |
| | | if(ObjectUtil.isEmpty(findByOpenId)) { |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(shopSalesmanOrder.getSalesUserId()); |
| | | if(ObjectUtil.isEmpty(vipInfo)) { |
| | | return AjaxResult.buildFailInstance("收益人信息不存在"); |
| | | } |
| | | Double withdrawalCash = findByOpenId.getWithdrawalCash(); |
| | | Double withdrawalCash = vipInfo.getWithdrawalCash(); |
| | | Double amount = shopSalesmanOrder.getAmount(); |
| | | withdrawalCash = (withdrawalCash == null?0:withdrawalCash)+(amount== null?0:amount); |
| | | findByOpenId.setWithdrawalCash(withdrawalCash); |
| | | bizUserDao.updateByModel(findByOpenId); |
| | | vipInfo.setWithdrawalCash(withdrawalCash); |
| | | sysVipInfoDao.update(vipInfo); |
| | | } |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value = "申请用户id") |
| | | private String userId; |
| | | |
| | | @ApiModelProperty(value = "申请用户openId") |
| | | private String openId; |
| | | |
| | | @ApiModelProperty(value = "分销员") |
| | | private String nickname; |
| | |
| | | }) |
| | | AjaxResult getFlowList(@RequestBody ScoreFlowDto scoreFlowDto) { |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(scoreFlowDto.getVipId()); |
| | | scoreFlowDto.setUserId(vipInfo.getOpenId()); |
| | | scoreFlowDto.setVipId(vipInfo.getId()); |
| | | Page<ScoreUseRecordVo> page=new Page<>(scoreFlowDto.getPageNum(),scoreFlowDto.getPageSize()); |
| | | IPage<ScoreUseRecordVo> shopScoreRecord = scoreUseRecordDao.selectFlowList(page,scoreFlowDto); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(shopScoreRecord.getRecords(),shopScoreRecord.getTotal()); |
| | |
| | | SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | if(scoreChangeDto.getAmount()>0){ |
| | | scoreVipDetailService.addScore(null,vipInfo.getId(),sysUsers.getSuId(),sysUsers.getShopId(),scoreChangeDto.getAmount(),0L, ScoreVipDetail.SCORE_VIP_TYPE_USERCHANGE,scoreChangeDto.getRemarks()); |
| | | scoreVipDetailService.addScore(vipInfo.getId(),sysUsers.getSuId(),sysUsers.getShopId(),scoreChangeDto.getAmount(),0L, ScoreVipDetail.SCORE_VIP_TYPE_USERCHANGE,scoreChangeDto.getRemarks()); |
| | | }else if (scoreChangeDto.getAmount()<0){ |
| | | scoreVipDetailService.deductionScore(null,vipInfo.getId(),sysUsers.getSuId(),sysUsers.getShopId(),Math.abs(scoreChangeDto.getAmount()),0L,ScoreVipDetail.SCORE_VIP_TYPE_USERCHANGE,scoreChangeDto.getRemarks()); |
| | | scoreVipDetailService.deductionScore(vipInfo.getId(),sysUsers.getSuId(),sysUsers.getShopId(),Math.abs(scoreChangeDto.getAmount()),0L,ScoreVipDetail.SCORE_VIP_TYPE_USERCHANGE,scoreChangeDto.getRemarks()); |
| | | } |
| | | AjaxResult result=AjaxResult.buildSuccessInstance("调整成功"); |
| | | return result; |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) |
| | | }) |
| | | AjaxResult getUserScore(@PathVariable Long vipId) { |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(scoreVipDetailDao.selectUserTotalScore(null,vipId)); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(scoreVipDetailDao.selectUserTotalScore(vipId)); |
| | | return result; |
| | | } |
| | | |
| | |
| | | |
| | | List<SysVipInfo> vips = vipInfoService.findByVipNoOrTel(keyWord); |
| | | if (vips.size() > 0) { |
| | | vips.get(0).setPointAll(scoreVipDetailDao.selectUserTotalScore(null,vips.get(0).getId())); |
| | | vips.get(0).setPointAll(scoreVipDetailDao.selectUserTotalScore(vips.get(0).getId())); |
| | | vips.get(0).setSysOrder(sysOrderService.findSysOrderTjByVipId(vips.get(0).getId())); |
| | | vips.get(0).setLevelCard(cardUseService.findByVipId(vips.get(0).getId())); |
| | | vips.get(0).setLabels(sysVipLabelDao.selectByVipId(vips.get(0).getId())); |
| | |
| | | vipInfo.setVipState(Dictionary.VIP_STATE_HY); |
| | | vipInfo.setStaffId(getMe().getSuId()); |
| | | vipInfo.setShopId(getMe().getShopId()); |
| | | vipInfo.setCompanyId(getMe().getCompanyId()); |
| | | vipInfo.setVipType(Dictionary.VIP_TYPE_NOCARD); |
| | | vipInfoService.add(vipInfo); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "会员信息注册成功"); |
| | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.plugin.util.MoneyUtil; |
| | | import com.matrix.system.hive.pojo.MoneyCardUserVo; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * |
| | | * @date 2016-09-17 10:17 |
| | | */ |
| | | public class MoneyCardUse extends MoneyCardUserVo implements Serializable{ |
| | | public class MoneyCardUse { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 剩余次数 |
| | | */ |
| | | String lastCountName; |
| | | /** |
| | | * 数据来源 |
| | | */ |
| | | String sourceName; |
| | | |
| | | /*vo对象************/ |
| | | |
| | | /** |
| | | * 剩余次数 |
| | | */ |
| | | |
| | | private Integer lastCount; |
| | | |
| | | /** |
| | | * 来源,购买,转让,赠送 |
| | | */ |
| | | private String source; |
| | | /** |
| | | * 是会籍卡? Y 是,N否 |
| | | */ |
| | | private String isVipCar; |
| | | |
| | | /** |
| | | * 订单明细id |
| | |
| | | private Integer useTotal; |
| | | |
| | | |
| | | /** |
| | | * 剩余次数 |
| | | */ |
| | | |
| | | private Integer lastCount; |
| | | |
| | | |
| | | /** |
| | |
| | | private String status; |
| | | |
| | | |
| | | /** |
| | | * 来源,购买,转让,赠送 |
| | | */ |
| | | private String source; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") |
| | | @DateTimeFormat(pattern= DateUtil.DATE_FORMAT_DD) |
| | | private Date failTime; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | private String isOver; |
| | | |
| | | /** |
| | | * 是默认储值卡? Y 是,N否 |
| | | */ |
| | | private String isVipCar; |
| | | |
| | | /** |
| | | * 备注 |
| | | */ |
| | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | /** |
| | | * 当大于10000时使用次数为不限,或者为会籍卡时 |
| | | * @return |
| | | */ |
| | | public String getLastCountName() { |
| | | if(getLastCount()==null){ |
| | | return ""; |
| | | } |
| | | if(Dictionary.FLAG_YES.equals(getIsVipCar())||getLastCount()>Dictionary.MAX_USE_COUNT_SIGN){ |
| | | lastCountName=Dictionary.MAX_USE_STRING; |
| | | }else{ |
| | | lastCountName=getLastCount().toString(); |
| | | } |
| | | return lastCountName; |
| | | } |
| | | |
| | | public void setLastCountName(String lastCountName) { |
| | | this.lastCountName = lastCountName; |
| | | } |
| | | |
| | | public String getSourceName() { |
| | | if(getSource()==null){ |
| | | return ""; |
| | | } |
| | | if(getSource().contains(Dictionary.TAOCAN_SOURCE_ZS)){ |
| | | sourceName=Dictionary.FLAG_YES; |
| | | }else{ |
| | | sourceName=Dictionary.FLAG_NO;; |
| | | } |
| | | return sourceName; |
| | | } |
| | | |
| | | public void setSourceName(String sourceName) { |
| | | this.sourceName = sourceName; |
| | | } |
| | | |
| | | |
| | | public String getIsVipCar() { |
| | | return isVipCar; |
| | | } |
| | | |
| | | public void setIsVipCar(String isVipCar) { |
| | | this.isVipCar = isVipCar; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 扩展对象 |
| | | */ |
| | |
| | | this.changeRemark = changeRemark; |
| | | } |
| | | |
| | | public String getIsVipCar() { |
| | | return isVipCar; |
| | | } |
| | | |
| | | public void setIsVipCar(String isVipCar) { |
| | | this.isVipCar = isVipCar; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | |
| | | package com.matrix.system.hive.bean; |
| | | |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.google.gson.annotations.Expose; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.system.hive.plugin.util.ExcelAnnotation; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import java.io.Serializable; |
| | |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * @Title: SysVipInfo.java |
| | | * @Package com.zkingsoft.model |
| | | * @description |
| | | * @author jyy |
| | | * @email 18075895212@qq.com |
| | | * @date 2016年7月14日 上午10:59:29 |
| | | */ |
| | | |
| | | @Data |
| | | public class SysVipInfo implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | | * 是销售员 |
| | | */ |
| | | public static final int IS_SALES = 1; |
| | | /** |
| | | * 不是销售员 |
| | | */ |
| | | public static final int NOT_SALES = 2; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 1、成交客户 |
| | | * **/ |
| | |
| | | |
| | | private SysOrder sysOrder; |
| | | |
| | | /** |
| | | * 可提现金额 |
| | | */ |
| | | private Double withdrawalCash; |
| | | /** |
| | | *推广员等级 |
| | | */ |
| | | private Long salesmanGrade; |
| | | |
| | | /** |
| | | * 用户昵称 |
| | | */ |
| | | private String nickName; |
| | | |
| | | |
| | | /** 扩展信息 **/ |
| | | /** |
| | | * 头像 |
| | | */ |
| | | private String avatarUrl; |
| | | |
| | | /** |
| | | * 性别 1、男 2、女 0、未知 |
| | | */ |
| | | private String gender; |
| | | |
| | | /** |
| | | * 用户所在国家 |
| | | */ |
| | | private String country; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 用户是否授权 1、是 2、否 |
| | | */ |
| | | private Integer userIsAuthorize; |
| | | |
| | | |
| | | /** |
| | | * 绑定上级用户时间 |
| | | */ |
| | | private Date bindingParentTime; |
| | | |
| | | |
| | | /** |
| | | * 是否是销售员(1=是,2=否) |
| | | */ |
| | | private Integer isSales; |
| | | |
| | | /** |
| | | * 用户类型 1、待审核 2、审核通过 0、审核未通过 |
| | | */ |
| | | private Integer fenxiaoState; |
| | | |
| | | private String sessionKey; |
| | | |
| | | |
| | | /** |
| | | * 会员等级id |
| | | */ |
| | |
| | | * 页面上的入会时间 |
| | | */ |
| | | private String inDateVo; |
| | | |
| | | |
| | | /** |
| | | * 页面上的生日 |
| | | */ |
| | |
| | | /** |
| | | * 美疗师集合 |
| | | */ |
| | | @Expose(serialize = false) |
| | | private List<MyBeatician> beauticains; |
| | | |
| | | |
| | | /** |
| | | * 会员问卷信息-答案,传递数据使用 |
| | | */ |
| | | @Expose(serialize = false) |
| | | List<VipAnswer> vipAnswers; |
| | | |
| | | /** |
| | | * 会员标签 |
| | | */ |
| | | @Expose(serialize = false) |
| | | List<SysVipLabel> labels; |
| | | |
| | | public List<SysVipLabel> getLabels() { |
| | | return labels; |
| | | } |
| | | |
| | | public void setLabels(List<SysVipLabel> labels) { |
| | | this.labels = labels; |
| | | } |
| | | |
| | | public String getAge() { |
| | | return age; |
| | | } |
| | | |
| | | public void setAge(String age) { |
| | | this.age = age; |
| | | } |
| | | |
| | | public Long getCompanyId() { |
| | | return companyId; |
| | | } |
| | | |
| | | public void setCompanyId(Long companyId) { |
| | | this.companyId = companyId; |
| | | } |
| | | |
| | | public String getOpenId() { |
| | | return openId; |
| | | } |
| | | |
| | | public void setOpenId(String openId) { |
| | | this.openId = openId; |
| | | } |
| | | |
| | | public String getProvince() { |
| | | return province; |
| | | } |
| | | |
| | | public void setProvince(String province) { |
| | | this.province = province; |
| | | } |
| | | |
| | | public String getCity() { |
| | | return city; |
| | | } |
| | | |
| | | public void setCity(String city) { |
| | | this.city = city; |
| | | } |
| | | |
| | | public String getArea() { |
| | | return area; |
| | | } |
| | | |
| | | public void setArea(String area) { |
| | | this.area = area; |
| | | } |
| | | |
| | | public Long getRecommendId() { |
| | | return recommendId; |
| | | } |
| | | |
| | | public void setRecommendId(Long recommendId) { |
| | | this.recommendId = recommendId; |
| | | } |
| | | |
| | | public SysOrder getSysOrder() { |
| | | return sysOrder; |
| | | } |
| | | |
| | | public void setSysOrder(SysOrder sysOrder) { |
| | | this.sysOrder = sysOrder; |
| | | } |
| | | |
| | | public Integer getIsDeal() { |
| | | return isDeal; |
| | | } |
| | | |
| | | public void setIsDeal(Integer isDeal) { |
| | | this.isDeal = isDeal; |
| | | } |
| | | |
| | | public Long getParentId() { |
| | | return parentId; |
| | | } |
| | | |
| | | public void setParentId(Long parentId) { |
| | | this.parentId = parentId; |
| | | } |
| | | |
| | | public Date getCreateDistributionTime() { |
| | | return createDistributionTime; |
| | | } |
| | | |
| | | public void setCreateDistributionTime(Date createDistributionTime) { |
| | | this.createDistributionTime = createDistributionTime; |
| | | } |
| | | |
| | | public Date getHandleTime() { |
| | | return handleTime; |
| | | } |
| | | |
| | | public void setHandleTime(Date handleTime) { |
| | | this.handleTime = handleTime; |
| | | } |
| | | public String getPayTotal() { |
| | | return payTotal; |
| | | } |
| | | |
| | | public void setPayTotal(String payTotal) { |
| | | this.payTotal = payTotal; |
| | | } |
| | | |
| | | public Integer getCostTotal() { |
| | | return costTotal; |
| | | } |
| | | |
| | | public void setCostTotal(Integer costTotal) { |
| | | this.costTotal = costTotal; |
| | | } |
| | | |
| | | public String getCostNum() { |
| | | return costNum; |
| | | } |
| | | |
| | | public void setCostNum(String costNum) { |
| | | this.costNum = costNum; |
| | | } |
| | | |
| | | public String getTimeStart() { |
| | | return timeStart; |
| | | } |
| | | |
| | | public void setTimeStart(String timeStart) { |
| | | this.timeStart = timeStart; |
| | | } |
| | | |
| | | public String getTimeEnd() { |
| | | return timeEnd; |
| | | } |
| | | |
| | | public void setTimeEnd(String timeEnd) { |
| | | this.timeEnd = timeEnd; |
| | | } |
| | | |
| | | public Integer getVipNum() { |
| | | return vipNum; |
| | | } |
| | | |
| | | public void setVipNum(Integer vipNum) { |
| | | this.vipNum = vipNum; |
| | | } |
| | | |
| | | |
| | | public String getPhoto() { |
| | | return photo; |
| | | } |
| | | |
| | | public void setPhoto(String photo) { |
| | | this.photo = photo; |
| | | } |
| | | |
| | | public String getYear() { |
| | | return year; |
| | | } |
| | | |
| | | public void setYear(String year) { |
| | | this.year = year; |
| | | } |
| | | |
| | | public boolean isQdSign() { |
| | | return qdSign; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 会员所有的充值卡 |
| | | */ |
| | | @Expose(serialize = false,deserialize = false) |
| | | private List<MoneyCardUse> cards; |
| | | |
| | | |
| | | |
| | | |
| | | public List<MoneyCardUse> getCards() { |
| | | return cards; |
| | | } |
| | | |
| | | public void setCards(List<MoneyCardUse> cards) { |
| | | this.cards = cards; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | * 没签到false |
| | | */ |
| | | private boolean qdSign; |
| | | |
| | | private String name; |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public boolean getQdSign() { |
| | | return qdSign; |
| | | } |
| | | |
| | | public void setQdSign(boolean qdSign) { |
| | | this.qdSign = qdSign; |
| | | } |
| | | |
| | | public String getUuid() { |
| | | return uuid; |
| | | } |
| | | |
| | | public void setUuid(String uuid) { |
| | | this.uuid = uuid; |
| | | } |
| | | |
| | | public String getDisease() { |
| | | return disease; |
| | | } |
| | | |
| | | public void setDisease(String disease) { |
| | | this.disease = disease; |
| | | } |
| | | |
| | | public Date getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public Integer getRankType() { |
| | | return rankType; |
| | | } |
| | | |
| | | public void setRankType(Integer rankType) { |
| | | this.rankType = rankType; |
| | | } |
| | | |
| | | public void setStartTime(Date startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public Date getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | |
| | | |
| | | public void setEndTime(Date endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public Integer getRanking() { |
| | | return ranking; |
| | | } |
| | | |
| | | public void setRanking(Integer ranking) { |
| | | this.ranking = ranking; |
| | | } |
| | | |
| | | public String getEmail() { |
| | | return email; |
| | | } |
| | | |
| | | public void setEmail(String email) { |
| | | this.email = email; |
| | | } |
| | | |
| | | public String getShopName() { |
| | | return shopName; |
| | | } |
| | | |
| | | public String getInDateVo() { |
| | | return inDateVo; |
| | | } |
| | | |
| | | public void setInDateVo(String inDateVo) { |
| | | this.inDateVo = inDateVo; |
| | | } |
| | | |
| | | public String getBirthday1Vo() { |
| | | return birthday1Vo; |
| | | } |
| | | |
| | | public void setBirthday1Vo(String birthday1Vo) { |
| | | this.birthday1Vo = birthday1Vo; |
| | | } |
| | | |
| | | public void setShopName(String shopName) { |
| | | this.shopName = shopName; |
| | | } |
| | | |
| | | public Long getShopId() { |
| | | return shopId; |
| | | } |
| | | |
| | | public void setShopId(Long shopId) { |
| | | this.shopId = shopId; |
| | | } |
| | | public Long getStaffId() { |
| | | return staffId; |
| | | } |
| | | |
| | | public void setStaffId(Long staffId) { |
| | | this.staffId = staffId; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public String getStaffName() { |
| | | return staffName; |
| | | } |
| | | |
| | | public void setStaffName(String staffName) { |
| | | this.staffName = staffName; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public String getVipNo() { |
| | | return vipNo; |
| | | } |
| | | |
| | | public void setVipNo(String vipNo) { |
| | | this.vipNo = vipNo; |
| | | } |
| | | |
| | | public String getVipName() { |
| | | return vipName; |
| | | } |
| | | |
| | | public void setVipName(String vipName) { |
| | | this.vipName = vipName; |
| | | } |
| | | |
| | | |
| | | public String getZjm() { |
| | | return zjm; |
| | | } |
| | | |
| | | public void setZjm(String zjm) { |
| | | this.zjm = zjm; |
| | | } |
| | | |
| | | public String getPhone() { |
| | | return phone; |
| | | } |
| | | |
| | | public void setPhone(String phone) { |
| | | this.phone = phone; |
| | | } |
| | | |
| | | |
| | | public String getSex() { |
| | | return sex; |
| | | } |
| | | |
| | | public void setSex(String sex) { |
| | | this.sex = sex; |
| | | } |
| | | |
| | | public Date getBirthday1() { |
| | | return birthday1; |
| | | } |
| | | |
| | | public void setBirthday1(Date birthday1) { |
| | | this.birthday1 = birthday1; |
| | | } |
| | | |
| | | public String getAddr() { |
| | | return addr; |
| | | } |
| | | |
| | | public void setAddr(String addr) { |
| | | this.addr = addr; |
| | | } |
| | | |
| | | public String getConstell() { |
| | | return constell; |
| | | } |
| | | |
| | | public void setConstell(String constell) { |
| | | this.constell = constell; |
| | | } |
| | | |
| | | public String getAnimalSign() { |
| | | return animalSign; |
| | | } |
| | | |
| | | public void setAnimalSign(String animalSign) { |
| | | this.animalSign = animalSign; |
| | | } |
| | | |
| | | public String getArrivalWay() { |
| | | return arrivalWay; |
| | | } |
| | | |
| | | public void setArrivalWay(String arrivalWay) { |
| | | this.arrivalWay = arrivalWay; |
| | | } |
| | | |
| | | public String getVipType() { |
| | | return vipType; |
| | | } |
| | | |
| | | public void setVipType(String vipType) { |
| | | this.vipType = vipType; |
| | | } |
| | | |
| | | public String getVipState() { |
| | | return vipState; |
| | | } |
| | | |
| | | public void setVipState(String vipState) { |
| | | this.vipState = vipState; |
| | | } |
| | | |
| | | public String getIsDelete() { |
| | | return isDelete; |
| | | } |
| | | |
| | | public void setIsDelete(String isDelete) { |
| | | this.isDelete = isDelete; |
| | | } |
| | | |
| | | public Integer getPointAll() { |
| | | return pointAll; |
| | | } |
| | | |
| | | public void setPointAll(Integer pointAll) { |
| | | this.pointAll = pointAll; |
| | | } |
| | | |
| | | public Double getCommissionAll() { |
| | | return commissionAll; |
| | | } |
| | | |
| | | public void setCommissionAll(Double commissionAll) { |
| | | this.commissionAll = commissionAll; |
| | | } |
| | | |
| | | public Date getInDate() { |
| | | return inDate; |
| | | } |
| | | |
| | | public void setInDate(Date inDate) { |
| | | this.inDate = inDate; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public String getPassWord() { |
| | | return passWord; |
| | | } |
| | | |
| | | public void setPassWord(String passWord) { |
| | | this.passWord = passWord; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public Long getLevelId() { |
| | | return levelId; |
| | | } |
| | | |
| | | public void setLevelId(Long levelId) { |
| | | this.levelId = levelId; |
| | | } |
| | | |
| | | public SysVipLevel getVipLevel() { |
| | | return vipLevel; |
| | | } |
| | | |
| | | public void setVipLevel(SysVipLevel vipLevel) { |
| | | this.vipLevel = vipLevel; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public String getStatu() { |
| | | return statu; |
| | | } |
| | | |
| | | public void setStatu(String statu) { |
| | | this.statu = statu; |
| | | } |
| | | |
| | | public Double getBalance() { |
| | | return balance; |
| | | } |
| | | |
| | | public void setBalance(Double balance) { |
| | | this.balance = balance; |
| | | } |
| | | |
| | | |
| | | |
| | | public MoneyCardUse getLevelCard() { |
| | | return levelCard; |
| | | } |
| | | |
| | | public void setLevelCard(MoneyCardUse levelCard) { |
| | | this.levelCard = levelCard; |
| | | } |
| | | |
| | | public String getBeatuyId() { |
| | | return beatuyId; |
| | | } |
| | | |
| | | public void setBeatuyId(String beatuyId) { |
| | | this.beatuyId = beatuyId; |
| | | } |
| | | |
| | | public List<MyBeatician> getBeauticains() { |
| | | return beauticains; |
| | | } |
| | | |
| | | public void setBeauticains(List<MyBeatician> beauticains) { |
| | | this.beauticains = beauticains; |
| | | } |
| | | |
| | | public String getBlood() { |
| | | return blood; |
| | | } |
| | | |
| | | public void setBlood(String blood) { |
| | | this.blood = blood; |
| | | } |
| | | |
| | | public String getSfCard() { |
| | | return sfCard; |
| | | } |
| | | |
| | | public void setSfCard(String sfCard) { |
| | | this.sfCard = sfCard; |
| | | } |
| | | |
| | | public String getLink() { |
| | | return link; |
| | | } |
| | | |
| | | public void setLink(String link) { |
| | | this.link = link; |
| | | } |
| | | |
| | | public String getMarry() { |
| | | return marry; |
| | | } |
| | | |
| | | public void setMarry(String marry) { |
| | | this.marry = marry; |
| | | } |
| | | |
| | | public String getVocation() { |
| | | return vocation; |
| | | } |
| | | |
| | | public void setVocation(String vocation) { |
| | | this.vocation = vocation; |
| | | } |
| | | |
| | | public List<VipAnswer> getVipAnswers() { |
| | | return vipAnswers; |
| | | } |
| | | |
| | | public void setVipAnswers(List<VipAnswer> vipAnswers) { |
| | | this.vipAnswers = vipAnswers; |
| | | } |
| | | |
| | | |
| | | public Integer getBirthdayType() { |
| | | return birthdayType; |
| | | } |
| | | |
| | | public void setBirthdayType(Integer birthdayType) { |
| | | this.birthdayType = birthdayType; |
| | | } |
| | | |
| | | @Override |
| | | public String toString() { |
| | | return "SysVipInfo [id=" + id + ", vipNo=" + vipNo + ", vipName=" |
| | | + vipName + ", phone=" + phone + ", vipType=" + vipType |
| | | + ", shopName=" + shopName + ", vipState=" + vipState |
| | | + ", passWord=" + passWord + ", beatuyId=" + beatuyId |
| | | + ", sex=" + sex + ", birthday1=" + birthday1 + ", addr=" |
| | | + addr + ", constell=" + constell + ", animalSign=" |
| | | + animalSign + ", arrivalWay=" + arrivalWay + ", photo=" |
| | | + photo + ", pointAll=" + pointAll + ", commissionAll=" |
| | | + commissionAll + ", inDate=" + inDate + ", createTime=" |
| | | + createTime + ", remark=" + remark + ", staffId=" + staffId |
| | | + ", shopId=" + shopId + ", isDelete=" + isDelete + ", email=" |
| | | + email + ", blood=" + blood + ", sfCard=" + sfCard + ", link=" |
| | | + link + ", marry=" + marry + ", vocation=" + vocation |
| | | + ", levelId=" + levelId + ", uuid=" + uuid + ", balance=" |
| | | + balance + ", levelCard=" + levelCard + ", vipLevel=" |
| | | + vipLevel + ", staffName=" + staffName + ", inDateVo=" |
| | | + inDateVo + ", birthday1Vo=" + birthday1Vo + ", ranking=" |
| | | + ranking + ", startTime=" + startTime + ", endTime=" + endTime |
| | | + ", rankType=" + rankType + ", year=" + year + ", vipNum=" |
| | | + vipNum + ", timeStart=" + timeStart + ", timeEnd=" + timeEnd |
| | | + ", payTotal=" + payTotal + ", costTotal=" + costTotal |
| | | + ", costNum=" + costNum + ", openId=" + openId + ", statu=" |
| | | + statu + ", beauticains=" + beauticains + ", vipAnswers=" |
| | | + vipAnswers + ", cards=" + cards + ", qdSign=" + qdSign + "]"; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | List<VipInfoListVo> selectVipAddressBookByList(@Param("record") VipInfoListDto vipInfoListDto); |
| | | |
| | | com.matrix.system.app.vo.VipInfoVo selectVipInfoById(@Param("id") Long id); |
| | | |
| | | public SysVipInfo findByOpenId(String openId); |
| | | |
| | | int unbundlingSaleMan(Long userId); |
| | | } |
| | |
| | | int apiModifyVip(ModifyVipDto modifyVipDto); |
| | | |
| | | VipInfoDetailVo findVipInfoDetail(Long id); |
| | | |
| | | |
| | | /** |
| | | * 设置为推广员 |
| | | * @param invitationId |
| | | */ |
| | | public int setToBeAnSalesman(Long userId,Long invitationId,long gradeId); |
| | | |
| | | SysVipInfo findByOpenId(String openId); |
| | | } |
| | |
| | | sysOrderFlowDao.deleteByOrderId(id); |
| | | |
| | | //删除积分 |
| | | scoreVipDetailService.removeByBusinessId(null,order.getVipId(), order.getId()); |
| | | scoreVipDetailService.removeByBusinessId(order.getVipId(), order.getId()); |
| | | |
| | | // 取消订单 |
| | | order.setStatu(Dictionary.ORDER_STATU_YQX); |
| | |
| | | |
| | | //添加自己的积分 |
| | | if(selfScore>0){ |
| | | scoreVipDetailService.addScore(null, |
| | | scoreVipDetailService.addScore( |
| | | vipInfo.getId(), |
| | | pageOrder.getStaffId(), |
| | | pageOrder.getShopId(), |
| | |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | if(parentScore>0){ |
| | | scoreVipDetailService.addScore(null, |
| | | scoreVipDetailService.addScore( |
| | | referrerVip.getId(), |
| | | pageOrder.getStaffId(), |
| | | pageOrder.getShopId(), |
| | |
| | | if(referrerVip.getRecommendId()!=null){ |
| | | SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId()); |
| | | if(topParentScore>0){ |
| | | scoreVipDetailService.addScore(null, |
| | | scoreVipDetailService.addScore( |
| | | topVipInfo.getId(), |
| | | pageOrder.getStaffId(), |
| | | pageOrder.getShopId(), |
| | |
| | | //退款退套餐退项目 |
| | | refundProjUse(sysOrder); |
| | | //删除积分 |
| | | scoreVipDetailService.removeByBusinessId(null,oldOrder.getVipId(), oldOrder.getId()); |
| | | scoreVipDetailService.removeByBusinessId(oldOrder.getVipId(), oldOrder.getId()); |
| | | |
| | | // 设置业绩 |
| | | achieveNewService.addAchaeveByOrder(sysOrder); |
| | |
| | | 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(), |
| | |
| | | |
| | | @Override |
| | | public int add(SysVipInfo sysVipInfo) { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | |
| | | if (sysVipInfo.getVipNo() != null && (!sysVipInfo.getVipNo().equals(""))) { |
| | | if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "VIP_NO", sysVipInfo.getVipNo(), |
| | | "company_id",user.getCompanyId())) { |
| | | "company_id",sysVipInfo.getCompanyId())) { |
| | | throw new GlobleException("编号已存在!"); |
| | | } |
| | | } |
| | |
| | | throw new GlobleException("请输入手机号!"); |
| | | } |
| | | if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "PHONE", sysVipInfo.getPhone(), |
| | | "company_id",user.getCompanyId() )) { |
| | | "company_id",sysVipInfo.getCompanyId() )) { |
| | | throw new GlobleException("手机已被注册!"); |
| | | } |
| | | } |
| | | |
| | | |
| | | sysVipInfo.setShopId(user.getShopId()); |
| | | sysVipInfo.setCompanyId(user.getCompanyId()); |
| | | sysVipInfo.setCreateTime(new Date()); |
| | | sysVipInfo.setPointAll(0); |
| | | sysVipInfo.setIsDeal(SysVipInfo.UNDEAL_VIP); |
| | | if(StringUtils.isNotBlank(sysVipInfo.getVipName())){ |
| | | sysVipInfo.setZjm(StringUtils.toHanyuPinyin(sysVipInfo.getVipName())+","+StringUtils.toHeadWordHanyuPinyin(sysVipInfo.getVipName())); |
| | | if(sysVipInfo.getSex().equals(Dictionary.SEX_MAN)){ |
| | | } |
| | | if(Dictionary.SEX_MAN.equals(sysVipInfo.getSex())){ |
| | | sysVipInfo.setPhoto(defaultMan); |
| | | }else{ |
| | | sysVipInfo.setPhoto(defaultWoman); |
| | | } |
| | | int i=sysVipInfoDao.insert(sysVipInfo); |
| | | modifyVipWithOtherInfo(sysVipInfo); |
| | | //创建用户默认储值卡 |
| | | addVipDefaultCard(sysVipInfo.getId()); |
| | | return i; |
| | |
| | | } |
| | | |
| | | |
| | | //如果会员id不为空则表示是修改,删除原有的绑定关系,建立新的关系 |
| | | if(vipInfo.getId()!=null && !vipInfo.getId().equals("")){ |
| | | MyBeatician query=new MyBeatician(); |
| | | query.setVipId(vipInfo.getId()); |
| | | List<MyBeatician> listDel= myBeaticianDao.selectByModel(query); |
| | | if(listDel!=null && listDel.size()>0){ |
| | | List<Long> delIds=new ArrayList<>(); |
| | | for (int i = 0; i < listDel.size(); i++) { |
| | | delIds.add(listDel.get(i).getId()); |
| | | } |
| | | myBeaticianDao.deleteByIds(delIds); |
| | | } |
| | | } |
| | | //添加客户的美疗师 |
| | | List<MyBeatician> list=vipInfo.getBeauticains(); |
| | | if(list!=null && list.size()>0){ |
| | | List<MyBeatician> saveList=new ArrayList<>(); |
| | | //此处由于前台传递过来list中的下标可能是不连续的。因此要过滤掉空的,即要过滤掉美疗师的id为空的数据 |
| | | for (MyBeatician temp:list) { |
| | | if(temp.getBeauticainId()!=null && !temp.getBeauticainId().equals("")){ |
| | | saveList.add(temp); |
| | | } |
| | | } |
| | | myBeaticianDao.insertAll(saveList,vipInfo.getId()); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | if(StringUtils.isNotBlank(referrerScoreSetting.getParamValue())){ |
| | | |
| | | scoreVipDetailService.addScore(referrerVip.getOpenId(), |
| | | scoreVipDetailService.addScore( |
| | | referrerVip.getId(), |
| | | user.getSuId(), |
| | | vipInfo.getShopId(), |
| | |
| | | |
| | | |
| | | if(StringUtils.isNotBlank(referrerScoreSetting.getParamValue1())){ |
| | | scoreVipDetailService.addScore(topVipInfo.getOpenId(), |
| | | scoreVipDetailService.addScore( |
| | | topVipInfo.getId(), |
| | | user.getSuId(), |
| | | vipInfo.getShopId(), |
| | |
| | | vipInfoDetailVo.setLabels(labels); |
| | | return vipInfoDetailVo; |
| | | } |
| | | |
| | | @Override |
| | | public SysVipInfo findByOpenId(String openId) { |
| | | return sysVipInfoDao.findByOpenId(openId); |
| | | } |
| | | |
| | | /** |
| | | * 设置成为推广员 |
| | | * @param invitationId |
| | | */ |
| | | @Override |
| | | public int setToBeAnSalesman(Long userId,Long invitationId,long gradeId) { |
| | | SysVipInfo sysVipInfo=sysVipInfoDao.selectById(userId); |
| | | sysVipInfo.setIsSales(SysVipInfo.IS_SALES); |
| | | sysVipInfo.setRecommendId(invitationId); |
| | | sysVipInfo.setBindingParentTime(new Date()); |
| | | sysVipInfo.setSalesmanGrade(gradeId); |
| | | return sysVipInfoDao.update(sysVipInfo); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | private BusParameterSettingsDao busParameterSettingsDao;
|
| | |
|
| | |
|
| | | @GetMapping(value = "/testApi")
|
| | | public AjaxResult testApi() {
|
| | | scoreRuleSettingService.testMethod();
|
| | | return AjaxResult.buildSuccessInstance("success");
|
| | | }
|
| | |
|
| | | /**
|
| | | *查询积分规则配置
|
| | | */
|
| | |
| | | * @param vipId |
| | | * @return |
| | | */ |
| | | int selectUserTotalScore(@Param("openId") String openId, @Param("vipId")Long vipId); |
| | | int selectUserTotalScore(@Param("vipId")Long vipId); |
| | | |
| | | /** |
| | | * 查询用户有效的积分,按时间顺序排 |
| | | * @param |
| | | * @return |
| | | */ |
| | | List<ScoreVipDetail> selectEffectiveScore(@Param("openId") String openId, @Param("vipId")Long vipId); |
| | | List<ScoreVipDetail> selectEffectiveScore(@Param("vipId")Long vipId); |
| | | } |
| | |
| | | /** |
| | | * 操作人ID |
| | | */ |
| | | private String openId; |
| | | |
| | | private Long vipId; |
| | | |
| | | private Long shopId; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 用户openId |
| | | */ |
| | | private String openId; |
| | | |
| | | |
| | | /** |
| | | * erp用户Id |
| | |
| | | package com.matrix.system.score.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.score.dao.ScoreRuleSettingDao; |
| | | import com.matrix.system.score.entity.ScoreRuleSettingEntity; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | * @date 2021-02-22 |
| | | **/ |
| | | @Service |
| | | public class ScoreRuleSettingService extends ServiceImpl<ScoreRuleSettingDao, ScoreRuleSettingEntity> { |
| | | public class ScoreRuleSettingService{ |
| | | |
| | | @Autowired |
| | | private ScoreRuleSettingDao scoreRuleSettingDao; |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | |
| | | public void testMethod() { |
| | | scoreRuleSettingDao.selectById(1L); |
| | | } |
| | | |
| | | public AjaxResult updateScoreRuleByCompanyId(List<BusParameterSettings> busParameterSettings) { |
| | | //获取当前登录人员信息 |
| | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.tools.DateUtil; |
| | |
| | | ScoreUseRecordDao scoreUseRecordDao; |
| | | |
| | | @Autowired |
| | | BizUserDao bizUserDao; |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | SysVipInfoDao vipInfoDao; |
| | |
| | | * 扣除用户积分 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deductionScore(String openId, Long vipId,Long oprationUserId,Long shopId, Integer score, Long businessId, int type,String remark) { |
| | | Long companyId=null; |
| | | if(openId!=null){ |
| | | companyId= bizUserDao.findByOpenId(openId).getCompanyId(); |
| | | }else if(vipId!=null){ |
| | | companyId= vipInfoDao.selectById(vipId).getCompanyId(); |
| | | }else{ |
| | | throw new IllegalArgumentException("vipId,openId必须有一个"); |
| | | } |
| | | public void deductionScore(Long vipId,Long oprationUserId,Long shopId, Integer score, Long businessId, int type,String remark) { |
| | | Long companyId= vipInfoDao.selectById(vipId).getCompanyId(); |
| | | |
| | | String createBy=MatrixConstance.SYSTEM_USER; |
| | | if(oprationUserId!=null){ |
| | | createBy=sysUsersDao.selectById(oprationUserId).getSuName(); |
| | | } |
| | | |
| | | List<ScoreVipDetail> effectiveScoreList = scoreVipDetailDao.selectEffectiveScore(openId,vipId); |
| | | List<ScoreVipDetail> effectiveScoreList = scoreVipDetailDao.selectEffectiveScore(vipId); |
| | | |
| | | for (ScoreVipDetail scoreVipDetail : effectiveScoreList) { |
| | | |
| | |
| | | scoreUseRecord.setRecNum(-currentDedution); |
| | | scoreUseRecord.setType(type); |
| | | scoreUseRecord.setShopId(shopId); |
| | | scoreUseRecord.setOpenId(openId); |
| | | scoreUseRecord.setVipId(vipId); |
| | | scoreUseRecord.setRemarks(remark); |
| | | scoreUseRecord.setOprationUserId(oprationUserId); |
| | |
| | | * 新增用户积分 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addScore(String openId, Long vipId, Long oprationUserId,Long shopId, Integer score, Long businessId, int type,String remark) { |
| | | Long companyId=null; |
| | | if(openId!=null){ |
| | | companyId= bizUserDao.findByOpenId(openId).getCompanyId(); |
| | | }else if(vipId!=null){ |
| | | companyId= vipInfoDao.selectById(vipId).getCompanyId(); |
| | | }else{ |
| | | throw new IllegalArgumentException("vipId,openId必须有一个"); |
| | | } |
| | | public void addScore(Long vipId, Long oprationUserId,Long shopId, Integer score, Long businessId, int type,String remark) { |
| | | Long companyId= vipInfoDao.selectById(vipId).getCompanyId(); |
| | | |
| | | if(score<0){ |
| | | throw new IllegalArgumentException("score必须有为大于零的数"); |
| | | } |
| | |
| | | scoreVipDetail.setUsedScore(0); |
| | | scoreVipDetail.setBusinessId(businessId); |
| | | scoreVipDetail.setValiditeTime(sxys); |
| | | scoreVipDetail.setOpenId(openId); |
| | | scoreVipDetail.setVipId(vipId); |
| | | scoreVipDetail.setGainTime(DateTime.now()); |
| | | scoreVipDetail.setAllScore(score); |
| | |
| | | scoreUseRecord.setBusinessId(businessId); |
| | | scoreUseRecord.setRecNum(score); |
| | | scoreUseRecord.setType(type); |
| | | scoreUseRecord.setOpenId(openId); |
| | | scoreUseRecord.setVipId(vipId); |
| | | scoreUseRecord.setShopId(shopId); |
| | | scoreUseRecord.setOprationUserId(oprationUserId); |
| | |
| | | /** |
| | | * 退积分 |
| | | */ |
| | | public void refundScore(String openId, Long vipId, Integer score, Long oldBusinessId, int type){ |
| | | Long companyId=null; |
| | | if(openId!=null){ |
| | | companyId= bizUserDao.findByOpenId(openId).getCompanyId(); |
| | | }else if(vipId!=null){ |
| | | companyId= vipInfoDao.selectById(vipId).getCompanyId(); |
| | | }else{ |
| | | throw new IllegalArgumentException("vipId,openId必须有一个"); |
| | | } |
| | | public void refundScore(Long vipId, Integer score, Long oldBusinessId, int type){ |
| | | |
| | | Long companyId= vipInfoDao.selectById(vipId).getCompanyId(); |
| | | |
| | | if(score<0){ |
| | | throw new IllegalArgumentException("score必须有为大于零的数"); |
| | | } |
| | | |
| | | //查询原始使用记录 |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("business_id",oldBusinessId); |
| | |
| | | }); |
| | | } |
| | | |
| | | public void removeByBusinessId(String openId, Long vipId, Long oldBusinessId){ |
| | | Long companyId=null; |
| | | if(openId!=null){ |
| | | companyId= bizUserDao.findByOpenId(openId).getCompanyId(); |
| | | }else if(vipId!=null){ |
| | | companyId= vipInfoDao.selectById(vipId).getCompanyId(); |
| | | }else{ |
| | | throw new IllegalArgumentException("vipId,openId必须有一个"); |
| | | } |
| | | public void removeByBusinessId( Long vipId, Long oldBusinessId){ |
| | | Long companyId= vipInfoDao.selectById(vipId).getCompanyId(); |
| | | |
| | | if(oldBusinessId==null){ |
| | | throw new IllegalArgumentException("oldBusinessId必须有"); |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.action; |
| | | |
| | | import com.matrix.biz.service.BizUserService; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.shopXcx.dao.ShopScoreExchangeDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | public class ShopBizUserScoreAction { |
| | | |
| | | @Autowired |
| | | private BizUserService bizUserService; |
| | | private SysVipInfoService sysVipInfoService; |
| | | @Autowired |
| | | private ShopScoreExchangeDao shopScoreExchangeDao; |
| | | |
| | |
| | | |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxTempLateMsgUtil; |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | | import com.matrix.core.anotations.RemoveRequestToken; |
| | | import com.matrix.core.anotations.SaveRequestToken; |
| | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.*; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.ModelUtils; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | |
| | | modifyMap.put("handingTime", new Date()); |
| | | int i = shopRefundRecordDao.updateByMap(modifyMap); |
| | | if (i > 0) { |
| | | //同意退款后发送微信提醒填写物流单号 |
| | | ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(shopRefundRecord.getId()); |
| | | sendRefundLogisticsInfoToUser(fundRecord); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功", "退款记录表"); |
| | | } else { |
| | | throw new GlobleException("操作失败"); |
| | |
| | | modifyOrder.put("id", record.getOrderId()); |
| | | shopOrderDao.updateByMap(modifyOrder); |
| | | } |
| | | //退款拒绝后发送微信提醒 |
| | | sendFailedRefundInfoToUser(record); |
| | | if (i > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功", "退款记录表"); |
| | | } else { |
| | |
| | | if(flag){ |
| | | //退款成功后发送微信提醒 |
| | | ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(oldShopRefundRecord.getId()); |
| | | sendRefundInfoToUser(fundRecord); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | if(flag){ |
| | | //退款成功后发送微信提醒 |
| | | ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(oldShopRefundRecord.getId()); |
| | | sendRefundInfoToUser(fundRecord); |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | if(flag){ |
| | | //退款成功后发送微信提醒 |
| | | ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(Integer.valueOf(id)); |
| | | sendRefundInfoToUser(fundRecord); |
| | | |
| | | refundRecordService.updateGroupBuyStatus(Long.parseLong(id)); |
| | | } |
| | | } |
| | |
| | | if(flag){ |
| | | //退款成功后发送微信提醒 |
| | | ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(Integer.valueOf(id)); |
| | | sendRefundInfoToUser(fundRecord); |
| | | |
| | | refundRecordService.updateGroupBuyStatus(Long.parseLong(id)); |
| | | } |
| | | } |
| | |
| | | //退款成功后同时把优惠券退回到用户的账号中 |
| | | if (shopOrder.getDiscountAmount() != null && shopOrder.getDiscountAmount().compareTo(BigDecimal.ZERO) == 0) { |
| | | ShopCouponRecord shopCouponRecord = new ShopCouponRecord(); |
| | | String userIds = shopRefundRecord.getUserId(); |
| | | shopCouponRecord.setUserId(userIds); |
| | | shopCouponRecord.setUserId(shopRefundRecord.getUserId()); |
| | | shopCouponRecord.setOrderId(shopOrder.getId()); |
| | | List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(shopCouponRecord); |
| | | if (CollectionUtils.isNotEmpty(recordList)) { |
| | |
| | | return flag; |
| | | } |
| | | |
| | | //退款成功后发送微信提醒 |
| | | private int sendRefundInfoToUser(ShopRefundRecord shopRefundRecord) { |
| | | ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId()); |
| | | if (order == null) { |
| | | throw new GlobleException("没有找到需要退款的订单信息"); |
| | | } |
| | | List<String> msg = new ArrayList<>(); |
| | | //退款说明 |
| | | String refundExplain = "退款已经原路返回,具体到账时间可能会有1-3天延迟"; |
| | | msg.add(order.getOrderNo()); |
| | | msg.add(DateUtil.dateToString(shopRefundRecord.getRefundTime(),DateUtil.DATE_FORMAT_SS)); |
| | | msg.add(refundExplain); |
| | | msg.add("商品名称"); |
| | | String formId = null; |
| | | if(AppConstance.REFUND_GOODS.equals(shopRefundRecord.getRefundType()) && null != shopRefundRecord.getRefundTransactionNo()){ |
| | | formId = shopRefundRecord.getRefundTransactionNo(); |
| | | }else { |
| | | formId = order.getWxOrderNo().split("=")[1]; |
| | | } |
| | | String page = "pages/refunDetail/refunDetail?id=" + shopRefundRecord.getId() + "&&status=1" + "&&inform=1"; |
| | | int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), |
| | | page, WxTempLateMsgUtil.REFUND_SUCCESS, formId); |
| | | return res; |
| | | } |
| | | |
| | | //退款拒绝后发送微信提醒 |
| | | private int sendFailedRefundInfoToUser(ShopRefundRecord shopRefundRecord) { |
| | | ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId()); |
| | | if (order == null) { |
| | | throw new GlobleException("没有找到拒绝退款的订单信息"); |
| | | } |
| | | List<String> msg = new ArrayList<>(); |
| | | //退款说明 |
| | | String remarks = "如有疑问请联系客服"; |
| | | msg.add(order.getOrderNo()); |
| | | msg.add("商品名称"); |
| | | msg.add(shopRefundRecord.getRefundRefuseReason()); |
| | | msg.add(shopRefundRecord.getRefundCause()); |
| | | String formId = null; |
| | | if(AppConstance.REFUND_GOODS .equals(shopRefundRecord.getRefundType()) && null != shopRefundRecord.getRefundTransactionNo()){ |
| | | formId = shopRefundRecord.getRefundTransactionNo(); |
| | | }else { |
| | | formId = order.getWxOrderNo().split("=")[1]; |
| | | } |
| | | String page = "pages/refunDetail/refunDetail?id=" + shopRefundRecord.getId() + "&&status=2" + "&&inform=1"; |
| | | int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), |
| | | page, WxTempLateMsgUtil.REFUND_FAILED, formId); |
| | | return res; |
| | | } |
| | | |
| | | //同意退款后发送微信提醒填写物流单号 |
| | | private int sendRefundLogisticsInfoToUser(ShopRefundRecord shopRefundRecord) { |
| | | ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId()); |
| | | if (order == null) { |
| | | throw new GlobleException("没有找到发送微信提醒的订单信息"); |
| | | } |
| | | List<String> msg = new ArrayList<>(); |
| | | //退款说明 |
| | | String remarks = "申请退款已审核通过,请尽快填写退货物流信息"; |
| | | msg.add(order.getOrderNo()); |
| | | msg.add("商品名称"); |
| | | msg.add("待退回"); |
| | | msg.add(remarks); |
| | | String formId = order.getWxOrderNo().split("=")[1]; |
| | | String page = "pages/refunding/refunding?id=" + shopRefundRecord.getId() + "&&inform=1"; |
| | | int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), |
| | | page, WxTempLateMsgUtil.WRITE_LOGISTICS, formId); |
| | | return res; |
| | | } |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.hive.dao.ShoppingGoodsDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderInfoQueryPOJO; |
| | | import com.matrix.system.shopXcx.api.pojo.ShopOrderDto; |
| | | import com.matrix.system.shopXcx.api.service.OrderCouponGroupService; |
| | |
| | | @Autowired |
| | | ShopOrderDao shopOrderDao; |
| | | |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | /** |
| | | * 计算购物车订单价格 |
| | | * |
| | |
| | | BigDecimal money = new BigDecimal(shopOrder.getOrderMoney().toString()); |
| | | BrandWCPayRequestData payData; |
| | | String productNames = wxShopOrderUtil.getProductNames(shopOrder.getUserId(), shopOrder.getId()); |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(shopOrder.getUserId()); |
| | | |
| | | if (isDebug) { |
| | | payData = weixinServiceUtil.createOrder("[测试]" + productNames, shopOrder.getOrderNo(), |
| | | 1, shopOrder.getUserId(), String.valueOf(shopOrder.getId())); |
| | | 1, vipInfo.getOpenId(), String.valueOf(shopOrder.getId())); |
| | | } else { |
| | | payData = weixinServiceUtil.createOrder(productNames, shopOrder.getOrderNo(), |
| | | unit.multiply(money).intValue(), shopOrder.getUserId(), String.valueOf(shopOrder.getId())); |
| | | unit.multiply(money).intValue(), vipInfo.getOpenId(), String.valueOf(shopOrder.getId())); |
| | | } |
| | | ShopOrder updateParam = new ShopOrder(); |
| | | updateParam.setId(shopOrder.getId()); |
| | |
| | | @GetMapping(value = "/getOrderStatusCount") |
| | | @ResponseBody |
| | | public AjaxResult getOrderStatusCount() { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance( |
| | | shopOrderDao.selectOrderStatusCount(bizUser.getOpenId())); |
| | | shopOrderDao.selectOrderStatusCount(sysVipInfo.getOpenId())); |
| | | return result; |
| | | } |
| | | |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.AES; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.component.tools.AES; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.shopXcx.api.pojo.BindingPhoneNumberPOJO; |
| | | import com.matrix.system.shopXcx.api.tools.SMSVerifiTools; |
| | | import com.matrix.system.shopXcx.api.vo.DataDecipheringVo; |
| | | import com.matrix.system.shopXcx.mqTask.MQTaskRouting; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.apache.commons.lang.RandomStringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author jiangyouyao |
| | |
| | | @Autowired |
| | | private SMSVerifiTools sMSVerifiTools; |
| | | @Autowired |
| | | private BizUserDao bizUserDao; |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | |
| | | if (StringUtils.isBlank(phoneNumber)) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "手机号码不能为空"); |
| | | } |
| | | BizUser bizUser = new BizUser(); |
| | | bizUser.setPhoneNumber(phoneNumber); |
| | | List<BizUser> bizUsers = bizUserDao.selectByModel(bizUser); |
| | | SysVipInfo sysVipInfo = new SysVipInfo(); |
| | | sysVipInfo.setPhone(phoneNumber); |
| | | List<SysVipInfo> bizUsers = sysVipInfoDao.selectByModel(sysVipInfo); |
| | | if (CollectionUtils.isNotEmpty(bizUsers) && bizUsers.size() > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "该手机号已被绑定"); |
| | | } |
| | |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "手机号码不能为空"); |
| | | } |
| | | //验证通过将手机号加入相应的用户数据中 |
| | | BizUser bizUser = new BizUser(); |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | bizUser.setUserId(loginUser.getUserId()); |
| | | bizUser.setPhoneNumber(bindingPhoneNumber.getPhoneNumber()); |
| | | bizUserDao.updateByModel(bizUser); |
| | | |
| | | //绑定号码后同步到erp |
| | | mqTemplate.sendMsg(MQTaskRouting.CREATE_VIP + evn, loginUser.getOpenId()+","+bindingPhoneNumber.getShopId()); |
| | | |
| | | SysVipInfo sysVipInfo = new SysVipInfo(); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | sysVipInfo.setId(loginUser.getId()); |
| | | if(loginUser.getShopId()==null){ |
| | | sysVipInfo.setShopId(bindingPhoneNumber.getShopId()); |
| | | } |
| | | sysVipInfo.setPhone(bindingPhoneNumber.getPhoneNumber()); |
| | | sysVipInfoDao.update(sysVipInfo); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "绑定成功"); |
| | | } |
| | | |
| | |
| | | @RequestMapping(value = "/deciphering") |
| | | public @ResponseBody |
| | | AjaxResult deciphering(@RequestBody DataDecipheringVo dataDecipheringVo) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String session_key = loginUser.getSessionKey(); |
| | | LogUtil.debug(dataDecipheringVo.toString()); |
| | | String jsonResult = AES.wxDecrypt(dataDecipheringVo.getEncryptedData(), session_key, dataDecipheringVo.getIv()); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.shopXcx.bean.ShopCollection; |
| | |
| | | @PostMapping(value = "/saveCollection") |
| | | public @ResponseBody |
| | | AjaxResult saveCollection(@RequestBody ShopCollection collection) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | collection.setCreateBy(loginUser.getOpenId()); |
| | | collection.setUpdateBy(loginUser.getOpenId()); |
| | | collection.setCollUserid(loginUser.getOpenId()); |
| | |
| | | @ResponseBody |
| | | public AjaxResult deleteByProductId(@PathVariable("collProductid") Integer collProductid){ |
| | | Map<String, Object> deleteMap = new HashMap<>(); |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String collUserid = loginUser.getOpenId(); |
| | | deleteMap.put("collProductid", collProductid); |
| | | deleteMap.put("collUserid", collUserid); |
| | |
| | | @PostMapping("/findCollection") |
| | | @ResponseBody |
| | | public AjaxResult getCollectionByUserId(@RequestBody ShopCollection collection) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String userId = loginUser.getOpenId(); |
| | | collection.setCollUserid(userId); |
| | | List<ShopCollection> list = collectionDao.selectByUserId(collection); |
| | |
| | | @PostMapping("/findByUserIdAndProid/{collProductid}") |
| | | @ResponseBody |
| | | public AjaxResult findByUserIdAndProid(@PathVariable("collProductid") Integer collProductid) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String userId = loginUser.getOpenId(); |
| | | List<ShopCollection> list = collectionDao.selectByUserIdAndProid(collProductid,userId); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, list, list.size()); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.UUIDUtil; |
| | | import com.matrix.system.app.authority.AppAuthorityManager; |
| | | import com.matrix.system.app.dto.LoginDto; |
| | | import com.matrix.system.app.dto.PwdResetDto; |
| | | import com.matrix.system.app.dto.SmsCodeDto; |
| | | import com.matrix.system.app.dto.UploadPhotoDto; |
| | | import com.matrix.system.app.vo.UserInfoVo; |
| | | import com.matrix.system.common.authority.strategy.AccountPasswordLogin; |
| | | import com.matrix.system.common.authority.strategy.LoginStrategy; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.tools.PasswordUtil; |
| | | import com.matrix.system.hive.bean.AppVersion; |
| | | import com.matrix.system.hive.bean.SysOrderFlow; |
| | | import com.matrix.system.hive.bean.SysShopInfo; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysOrderDao; |
| | | import com.matrix.system.hive.dao.SysOrderFlowDao; |
| | | import com.matrix.system.hive.dao.SysOrderItemDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.plugin.util.ImageUtil; |
| | | import com.matrix.system.hive.service.SysShopInfoService; |
| | | import com.matrix.system.shopXcx.api.dto.ErpOrderListDto; |
| | | import com.matrix.system.shopXcx.api.vo.ErpOrderDetailFlowVo; |
| | | import com.matrix.system.shopXcx.api.vo.ErpOrderDetailItemVo; |
| | | import com.matrix.system.shopXcx.api.vo.ErpOrderDetailVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.io.File; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.security.NoSuchAlgorithmException; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | |
| | | }) |
| | | @PostMapping(value = "/findUserOrderList") |
| | | public AjaxResult findUserOrderList(@RequestBody @Validated ErpOrderListDto erpOrderListDto) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(bizUser.getPhoneNumber()); |
| | | if(vipInfo!=null){ |
| | | SysVipInfo vipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | erpOrderListDto.setVipId(vipInfo.getId()); |
| | | List<ErpOrderDetailVo> rows=sysOrderDao.selectErpOrderList(erpOrderListDto); |
| | | rows.forEach(item->{ |
| | | item.setItems(orderItemDao.selectErpOrderItemByOrderId(item.getOrderId())); |
| | | }); |
| | | return AjaxResult.buildSuccessInstance(rows,"查询成功"); |
| | | }else{ |
| | | return AjaxResult.buildFailInstance("未查询到相关订单001"); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | result.putInMap("order",order); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxacodeUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | |
| | | @PostMapping("/getWxAcode") |
| | | @ResponseBody |
| | | public AjaxResult getWxAcode(@RequestBody ShopWxAcode wxAcode) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String openId = loginUser.getOpenId(); |
| | | try { |
| | | String wxacodeUrl = WxacodeUtil.getWxacode(wxAcode.getScene(), wxAcode.getPage(), wxAcode.getFileName(), |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.common.bean.CustomerDataDictionary; |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | |
| | | @PostMapping(value = "/saveInvoice") |
| | | public @ResponseBody |
| | | AjaxResult saveInvoice(@RequestBody ShopInvoice shopInvoice) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | shopInvoice.setCreateBy(loginUser.getOpenId()); |
| | | shopInvoice.setUpdateBy(loginUser.getOpenId()); |
| | | shopInvoice.setUserId(loginUser.getOpenId()); |
| | |
| | | @PostMapping("/findProductComment") |
| | | @ResponseBody |
| | | public AjaxResult getProductCommentByUserId(@RequestBody ShopInvoice shopInvoice) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String userId = loginUser.getOpenId(); |
| | | shopInvoice.setUserId(userId); |
| | | List<ShopInvoice> list = invoiceDao.selectByUserId(shopInvoice); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | |
| | | @PostMapping(value = "/saveProductComment") |
| | | public @ResponseBody |
| | | AjaxResult saveProductComment(@RequestBody List<ShopProductComment> commentList) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | int flag = 0; |
| | | if(CollectionUtils.isNotEmpty(commentList)){ |
| | | for(ShopProductComment productComment : commentList){ |
| | |
| | | @PostMapping("/findProductComment") |
| | | @ResponseBody |
| | | public AjaxResult getProductCommentByUserId(@RequestBody ShopProductComment productComment) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String userId = loginUser.getOpenId(); |
| | | productComment.setUserId(userId); |
| | | List<ShopProductComment> list = productCommentDao.selectByUserId(productComment); |
| | |
| | | |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | |
| | | @PostMapping(value = "/saveReceiveAddress") |
| | | public @ResponseBody |
| | | AjaxResult saveReceiveAddress(@RequestBody ShopReceiveAddress receiveAddress) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | receiveAddress.setCreateBy(loginUser.getOpenId()); |
| | | receiveAddress.setUpdateBy(loginUser.getOpenId()); |
| | | receiveAddress.setAddrUserid(loginUser.getOpenId()); |
| | |
| | | @PostMapping("/findReceiveAddress") |
| | | @ResponseBody |
| | | public AjaxResult getByAddrUserId(@RequestBody ShopReceiveAddress receiveAddress) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String userId = loginUser.getOpenId(); |
| | | receiveAddress.setAddrUserid(userId); |
| | | List<ShopReceiveAddress> list = shopReceiveAddressDao.selectByModel(receiveAddress); |
| | |
| | | @PostMapping("/findAddrByAddrId/{addrId}") |
| | | @ResponseBody |
| | | public AjaxResult getByAddrId(@PathVariable("addrId") Integer addrId) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String userId = loginUser.getOpenId(); |
| | | ShopReceiveAddress params = new ShopReceiveAddress(); |
| | | params.setAddrUserid(userId); |
| | |
| | | @PostMapping(value = "/updateReceiveAddress") |
| | | public @ResponseBody |
| | | AjaxResult updateReceiveAddress(@RequestBody ShopReceiveAddress receiveAddress) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | receiveAddress.setCreateBy(loginUser.getOpenId()); |
| | | receiveAddress.setUpdateBy(loginUser.getOpenId()); |
| | | receiveAddress.setAddrUserid(loginUser.getOpenId()); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | |
| | | @PostMapping(value = "/saveRefundRecord") |
| | | public @ResponseBody |
| | | AjaxResult saveRefundRecord(@RequestBody ShopRefundRecord refundRecord) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | refundRecord.setCreateBy(loginUser.getOpenId()); |
| | | refundRecord.setUpdateBy(loginUser.getOpenId()); |
| | | refundRecord.setUserId(loginUser.getOpenId()); |
| | | refundRecord.setUserId(loginUser.getId()); |
| | | refundRecord.setCompanyId(loginUser.getCompanyId()); |
| | | refundRecord.setAuditStatus(AppConstance.REFUND_NOT_AUDITED); |
| | | refundRecord.setRefundStatus(AppConstance.REFUND_PROCESSING); |
| | |
| | | refundRecord.setApplyTime(new Date()); |
| | | |
| | | ShopRefundRecord record = new ShopRefundRecord(); |
| | | record.setUserId(loginUser.getOpenId()); |
| | | record.setUserId(loginUser.getId()); |
| | | record.setOrderId(refundRecord.getOrderId()); |
| | | List<ShopRefundRecord> shopRefundRecords = refundRecordDao.selectByModel(record); |
| | | if(CollectionUtils.isNotEmpty(shopRefundRecords)){ |
| | |
| | | |
| | | if(flag){ |
| | | ShopRefundRecord fundRecord = refundRecordDao.selectById(shopRecord.getId()); |
| | | refundRecordService.sendRefundInfoToUser(fundRecord); |
| | | refundRecordService.updateGroupBuyStatus(orderId.longValue()); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "退款成功"); |
| | | } |
| | |
| | | @PostMapping("/findRefundRecord") |
| | | @ResponseBody |
| | | public AjaxResult getRefundRecordByUserId(@RequestBody ShopRefundRecord refundRecord) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | String userId = loginUser.getOpenId(); |
| | | refundRecord.setUserId(userId); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | refundRecord.setUserId(loginUser.getId()); |
| | | List<ShopRefundRecord> list = refundRecordDao.selectByRefundUserId(refundRecord); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, list, list.size()); |
| | | return result; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | |
| | | @Autowired |
| | | private BizUserDao bizUserDao; |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | private ShopSalesmanOrderDao shopSalesmanOrderDao; |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = SalesOrderVo.class) |
| | | }) |
| | | AjaxResult getInvitationuserList(@RequestBody @Validated SaleOrderDto saleOrderDto) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Page<SalesOrderVo> page=new Page<>(saleOrderDto.getPageNum(),saleOrderDto.getPageSize()); |
| | | if(StringUtils.isBlank(saleOrderDto.getSort())){ |
| | | saleOrderDto.setSort("create_time"); |
| | | saleOrderDto.setOrder("desc"); |
| | | } |
| | | saleOrderDto.setUserId(loginUser.getOpenId()); |
| | | saleOrderDto.setUserId(loginUser.getId()); |
| | | IPage<SalesOrderVo> shopSalesmanApplyIPage = shopSalesmanOrderDao.selectSalesManOrder(page, saleOrderDto); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords()); |
| | | return result; |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | |
| | | @Autowired |
| | | private BizUserDao bizUserDao; |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | private ShopRevenueFlowDao revenueFlowDao; |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = ShopRevenueFlow.class) |
| | | }) |
| | | AjaxResult getInvitationuserList(@RequestBody @Validated RevenueFlowDto revenueFlowDto) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Page<ShopRevenueFlow> page=new Page<>(revenueFlowDto.getPageNum(),revenueFlowDto.getPageSize()); |
| | | revenueFlowDto.setUserId(loginUser.getOpenId()); |
| | | revenueFlowDto.setUserId(loginUser.getId()); |
| | | IPage<ShopRevenueFlow> shopSalesmanApplyIPage = revenueFlowDao.selectRevenuFlowList(page, revenueFlowDto); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords()); |
| | | return result; |
| | |
| | | }) |
| | | @Transactional |
| | | AjaxResult withdrawalCash(@RequestBody @Validated WithdrawalCashDto withdrawalCashDto) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | loginUser=bizUserDao.selectById(loginUser.getUserId()); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | loginUser=sysVipInfoDao.selectById(loginUser.getId()); |
| | | if(withdrawalCashDto.getAmount()<1){ |
| | | return AjaxResult.buildFailInstance("最小提现金额为1元"); |
| | | }else if(withdrawalCashDto.getAmount()>20000){ |
| | |
| | | invitationRevenueFlow.setCreateTime(new Date()); |
| | | invitationRevenueFlow.setUpdateTime(new Date()); |
| | | invitationRevenueFlow.setAmount(-withdrawalCashDto.getAmount()); |
| | | invitationRevenueFlow.setUserId(loginUser.getOpenId()); |
| | | invitationRevenueFlow.setUserId(loginUser.getId()); |
| | | invitationRevenueFlow.setRevenueContent("提现"); |
| | | shopRevenueFlowDao.insert(invitationRevenueFlow); |
| | | //扣除用户剩余提现金额 |
| | | loginUser.setWithdrawalCash(loginUser.getWithdrawalCash()-withdrawalCashDto.getAmount()); |
| | | bizUserDao.updateByModel(loginUser); |
| | | sysVipInfoDao.update(loginUser); |
| | | redisUserLoginUtils.updateUserInfo(loginUser); |
| | | |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.ImageUtil; |
| | | import com.matrix.component.tools.WxacodeUtil; |
| | |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | |
| | | @Autowired |
| | | private BizUserDao bizUserDao; |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | @Autowired |
| | | WeChatApiTools weChatApiTools; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @ApiOperation(value = "申请成为推广员", notes = "传入参数invitationId 邀请人openId ,非必填 例: {invitationId:openId}") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = ShopSalesmanApply.class) |
| | |
| | | @PostMapping(value = "/applyToBeAnSalesman") |
| | | @Transactional |
| | | public AjaxResult applyToBeAnSalesman(@RequestBody Map<String,String> param) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | String invitationId = param.get("invitationId"); |
| | | if(StringUtils.isNotBlank(invitationId)){ |
| | | BizUser invitationUser = bizUserDao.findByOpenId(invitationId); |
| | | if(invitationUser!=null && invitationUser.getOpenId().equals(loginUser.getOpenId())) { |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Long invitationId=null; |
| | | if(StringUtils.isNotBlank(param.get("invitationId"))){ |
| | | invitationId = Long.parseLong(param.get("invitationId")); |
| | | |
| | | SysVipInfo invitationUser = sysVipInfoDao.selectById(invitationId); |
| | | if (invitationUser != null && invitationUser.getId().equals(loginUser.getId())) { |
| | | return AjaxResult.buildFailInstance("不能邀请自己成为推广员"); |
| | | } |
| | | } |
| | | |
| | | ShopSalesmanApply shopSalesmanApply= shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getOpenId(),"",invitationId,ShopSalesmanApply.APPLY_WAY_SELF); |
| | | loginUser=bizUserDao.selectById(loginUser.getUserId()); |
| | | ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getId(), null, invitationId, ShopSalesmanApply.APPLY_WAY_SELF); |
| | | loginUser = sysVipInfoDao.selectById(loginUser.getId()); |
| | | redisUserLoginUtils.updateUserInfo(loginUser); |
| | | return AjaxResult.buildSuccessInstance(shopSalesmanApply); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | }) |
| | | @GetMapping(value = "/queryApplyProgress") |
| | | public AjaxResult queryApplyProgress() { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id",loginUser.getOpenId()); |
| | | queryWrapper.eq("user_id", loginUser.getId()); |
| | | queryWrapper.eq("apply_status",ShopSalesmanApply.APPLY_STATUS_DSH); |
| | | ShopSalesmanApply shopSalesmanApply = salesmanApplyDao.selectOne(queryWrapper); |
| | | return AjaxResult.buildSuccessInstance(shopSalesmanApply); |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = Map.class) |
| | | }) |
| | | @PostMapping(value = "/bindingParentSalesman") |
| | | public AjaxResult bindingParentSalesman(@RequestBody Map<String,String> param) { |
| | | String invitationId = param.get("invitationId"); |
| | | public AjaxResult bindingParentSalesman(@RequestBody Map<String, Long> param) { |
| | | Long invitationId = param.get("invitationId"); |
| | | |
| | | |
| | | if (StringUtils.isBlank(invitationId)) { |
| | | return AjaxResult.buildFailInstance("请求参数错误"); |
| | | } |
| | | BizUser invitationUser = bizUserDao.selectById(Long.parseLong(invitationId)); |
| | | |
| | | SysVipInfo invitationUser = sysVipInfoDao.selectById(invitationId); |
| | | if (invitationUser==null) { |
| | | return AjaxResult.buildFailInstance("请求参数错误"); |
| | | } |
| | | |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | if(invitationId.equals(loginUser.getUserId())){ |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | if (invitationId.equals(loginUser.getId())) { |
| | | return AjaxResult.buildSuccessInstance("不能绑定自己"); |
| | | } |
| | | |
| | | loginUser = bizUserDao.selectById(loginUser.getUserId()); |
| | | loginUser = sysVipInfoDao.selectById(loginUser.getId()); |
| | | if(loginUser.getIsSales()==1){ |
| | | return AjaxResult.buildSuccessInstance("只有非分销员才能被绑定成客户"); |
| | | }if (StringUtils.isNotBlank(loginUser.getParentOpenId())){ |
| | | } |
| | | if (loginUser.getRecommendId()!=null) { |
| | | return AjaxResult.buildSuccessInstance("已经被绑定"); |
| | | }else{ |
| | | if (StringUtils.isBlank(loginUser.getParentOpenId())) { |
| | | if (loginUser.getRecommendId()==null) { |
| | | Map<String, Object> updateParam = new HashMap<>(); |
| | | updateParam.put("userId", loginUser.getUserId()); |
| | | updateParam.put("parentOpenId", invitationUser.getOpenId()); |
| | | updateParam.put("bindingParentTime",new Date()); |
| | | bizUserDao.updateByMap(updateParam); |
| | | updateParam.put("id", loginUser.getId()); |
| | | loginUser.setRecommendId(invitationUser.getId()); |
| | | loginUser.setBindingParentTime(new Date()); |
| | | sysVipInfoDao.update(loginUser); |
| | | return AjaxResult.buildSuccessInstance("绑定成功"); |
| | | } else { |
| | | return AjaxResult.buildSuccessInstance("已经存在上级"); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | @PostMapping(value = "/getInvitationPoster") |
| | | AjaxResult getInvitationPoster() { |
| | | try { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | String baseSavePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH); |
| | | // 图片访问URL |
| | |
| | | |
| | | String urlPath = baseSaveUrl + "/" + "wxacode" + "/" + targetImg; |
| | | |
| | | String qrcodeSavePath = WxacodeUtil.getWxacode(loginUser.getUserId() + "", "pages/distributorCenter/applyFor/applyFor", MD5Util.strToMD5(loginUser.getOpenId())+"qrcode" |
| | | String qrcodeSavePath = WxacodeUtil.getWxacode(loginUser.getId() + "", "pages/distributorCenter/applyFor/applyFor", MD5Util.strToMD5(loginUser.getOpenId()) + "qrcode" |
| | | ,weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId())); |
| | | |
| | | BufferedImage qrcordImgBuf = ImageIO.read(new File(qrcodeSavePath)); |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = SalesmanVo.class) |
| | | }) |
| | | AjaxResult getInvitationuserList(@RequestBody BasePageQueryDto pageDto) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Page<SalesmanVo> page=new Page<>(pageDto.getPageNum(),pageDto.getPageSize()); |
| | | IPage<SalesmanVo> shopSalesmanApplyIPage = salesmanApplyDao.selectInvitationuserInPage(page, loginUser.getOpenId(),pageDto.getKeywords()); |
| | | IPage<SalesmanVo> shopSalesmanApplyIPage = salesmanApplyDao.selectInvitationuserInPage(page, loginUser.getId(), pageDto.getKeywords()); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords()); |
| | | return result; |
| | | } |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = SalesmanCenterInfo.class) |
| | | }) |
| | | AjaxResult getSalesmanCenterInfo() { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SalesmanCenterInfo salesmanCenterInfo= salesmanApplyDao.selectSalesmanCenterInfo(loginUser.getOpenId()); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SalesmanCenterInfo salesmanCenterInfo = salesmanApplyDao.selectSalesmanCenterInfo(loginUser.getId()); |
| | | return AjaxResult.buildSuccessInstance(salesmanCenterInfo); |
| | | } |
| | | |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = SalesmanApplyCondition.class) |
| | | }) |
| | | AjaxResult getSalesmanApplyCondition() { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | VerificationResult ableToBeAnSalesman = shopSalesmanApplyService.isAbleToBeAnSalesman(loginUser.getOpenId(),loginUser.getCompanyId()); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | VerificationResult ableToBeAnSalesman = shopSalesmanApplyService.isAbleToBeAnSalesman(loginUser.getId(), loginUser.getCompanyId()); |
| | | SalesmanApplyCondition applyConditionInfo=new SalesmanApplyCondition(); |
| | | applyConditionInfo.setIsAbleApply(ableToBeAnSalesman.isJudgeResult()); |
| | | applyConditionInfo.setMsg(ableToBeAnSalesman.getMsg()); |
| | |
| | | |
| | | return AjaxResult.buildSuccessInstance(applyConditionInfo); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxacodeUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | |
| | | ShopActivitiesGroupInfoDao shopActivitiesGroupInfoDao; |
| | | |
| | | @Autowired |
| | | BizUserDao bizUserDao; |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | |
| | | @Autowired |
| | |
| | | @RequestMapping(value = "/getProductShareQrcode") |
| | | public @ResponseBody |
| | | AjaxResult getwxacode1(@RequestBody QrcodeVo qrcodeVo) throws Exception { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | loginUser = bizUserDao.selectById(loginUser.getUserId()); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | loginUser = sysVipInfoDao.selectById(loginUser.getId()); |
| | | //活动类型 |
| | | ShopActivities activities=null; |
| | | //是否为拼团分享 |
| | |
| | | * @param qrcodeVo |
| | | * @return |
| | | */ |
| | | private QrcodeImgParam getSeckillQrcodeImgParam(BizUser loginUser, QrcodeVo qrcodeVo) throws Exception { |
| | | private QrcodeImgParam getSeckillQrcodeImgParam(SysVipInfo loginUser, QrcodeVo qrcodeVo) throws Exception { |
| | | |
| | | ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(qrcodeVo.getSkillId()); |
| | | |
| | |
| | | * @param qrcodeVo |
| | | * @return |
| | | */ |
| | | private QrcodeImgParam getGroupQrcodeImgParam(BizUser loginUser, QrcodeVo qrcodeVo) throws Exception { |
| | | private QrcodeImgParam getGroupQrcodeImgParam(SysVipInfo loginUser, QrcodeVo qrcodeVo) throws Exception { |
| | | |
| | | WxActivitiesGroupBuyVO groupBuyVO = shopActivitiesGroupInfoDao.selectGroupInfoWithPriceByActId(qrcodeVo.getActId()); |
| | | |
| | |
| | | } |
| | | |
| | | @NotNull |
| | | private QrcodeImgParam getQrcodeImgParam(BizUser loginUser, QrcodeVo qrcodeVo) throws Exception { |
| | | private QrcodeImgParam getQrcodeImgParam(SysVipInfo loginUser, QrcodeVo qrcodeVo) throws Exception { |
| | | |
| | | ShopProduct shopProduct = shopProductDao.selectById(qrcodeVo.getProductId()); |
| | | |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | |
| | | */ |
| | | @GetMapping(value = "/findOwnerGroupBuyInfo/{actId}") |
| | | public AjaxResult findOwnerGroupBuyInfo(@PathVariable("actId") Long actId) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | // 1、判断该用户在该活动中有没有正在拼团 若有,则返回正在拼团的用户列表,若没有则返回gruoping=1且返回正在拼团的拼团列表, 若加入了团未完成付款,则需要再做设置 |
| | | ShopActivitiesGroupJoin isExsit = shopActivitiesGroupJoinDao.selectIsExistGroupInfoByUserId(actId, bizUser.getOpenId()); |
| | | ShopActivitiesGroupJoin isExsit = shopActivitiesGroupJoinDao.selectIsExistGroupInfoByUserId(actId, sysVipInfo.getOpenId()); |
| | | AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null); |
| | | if (isExsit == null) { |
| | | ajaxResult.putInMap("grouping", 2); |
| | |
| | | } else { |
| | | ajaxResult.putInMap("grouping", 1); |
| | | ShopActivitiesGroupJoin groupJoin = shopActivitiesGroupJoinDao.selectOwnerGroupJoinInfoWithNoPay(isExsit.getId()); |
| | | ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(bizUser.getOpenId(), groupJoin.getId()); |
| | | ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(sysVipInfo.getOpenId(), groupJoin.getId()); |
| | | ShopActivitiesGroupPrice price = shopActivitiesGroupPriceDao.selectById(groupJoin.getGpId()); |
| | | int theLast = price.getGpCount() - groupJoin.getJoinUserList().size(); |
| | | groupJoin.setTheLast(theLast); |
| | |
| | | */ |
| | | @GetMapping(value = "/findGroupJoinInfo/{gjId}") |
| | | public AjaxResult findGroupJoinInfo(@PathVariable Long gjId) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopActivitiesGroupJoin groupJoin = shopActivitiesGroupJoinDao.selectOwnerGroupJoinInfo(gjId); |
| | | int isExist = 2; |
| | | |
| | | for (ShopActivitiesGroupJoinUser joinUser : groupJoin.getJoinUserList()) { |
| | | if (bizUser.getOpenId().equals(joinUser.getUserId())) { |
| | | if (sysVipInfo.getOpenId().equals(joinUser.getUserId())) { |
| | | isExist = 1; |
| | | } |
| | | } |
| | |
| | | |
| | | @PostMapping(value = "/calPrice") |
| | | public AjaxResult calPrice(@RequestBody CreateGroupBuyDTO createGroupBuyDTO) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopActivitiesGroupPrice groupPrice = shopActivitiesGroupPriceDao.selectById(createGroupBuyDTO.getGpId()); |
| | | // 判断参数中gjId是否为空,若为空则为团长开团。再判断团长价是否为空,如果不为空则拥有团长价 |
| | | if (createGroupBuyDTO.getGjId() == null) { |
| | |
| | | } else { |
| | | createGroupBuyDTO.setPrice(groupPrice.getGpPrice()); |
| | | } |
| | | BigDecimal postage = wxShopOrderService.calculationPostage(createGroupBuyDTO.getPrice(),bizUser.getCompanyId()); |
| | | BigDecimal postage = wxShopOrderService.calculationPostage(createGroupBuyDTO.getPrice(),sysVipInfo.getCompanyId()); |
| | | BigDecimal payPrice = createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount())).add(postage); |
| | | AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null); |
| | | ajaxResult.putInMap("billPrice", createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount()))); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.shopXcx.api.vo.SalonVO; |
| | | import com.matrix.system.shopXcx.bean.ShopActivities; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | @GetMapping(value = "/findSalonInfoById/{id}") |
| | | public AjaxResult findSalonInfoById(@PathVariable("id") Long id) { |
| | | BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopActivities shopActivities = shopActivitiesDao.selectSalonActivityById(id); |
| | | ShopActivitiesSalonRecord salonRecord = shopActivitiesSalonRecordDao.selectSalonRecordByUserIdAndActId(user.getOpenId(), id); |
| | | AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); |
| | |
| | | @PostMapping(value = "/joinSalonActivity") |
| | | @Transactional |
| | | public AjaxResult joinSalonActivity(@RequestBody CreateSalonDTO salonDTO) { |
| | | BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | ShopActivities shopActivities = shopActivitiesDao.selectById(salonDTO.getActId()); |
| | | if (shopActivities == null) { |
| | |
| | | |
| | | ShopActivitiesSalonRecord salonRecord = new ShopActivitiesSalonRecord(); |
| | | salonRecord.setActId(salonDTO.getActId()); |
| | | salonRecord.setUserId(user.getOpenId()); |
| | | salonRecord.setUserId(user.getId()); |
| | | salonRecord.setCreateBy(user.getNickName()); |
| | | salonRecord.setUpdateBy(user.getNickName()); |
| | | salonRecord.setStatus(ShopActivitiesSalonRecord.JOIN_STATUS_ING); |
| | |
| | | */ |
| | | @RequestMapping(value = "/findSalonListByUser") |
| | | public AjaxResult findSalonListByUser(@RequestBody SalonVO salonVO) { |
| | | BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | salonVO.setUserId(user.getOpenId()); |
| | | List<ShopActivities> list = shopActivitiesDao.selectSalonActivityByUser(salonVO); |
| | | return AjaxResult.buildSuccessInstance(list); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.shopXcx.api.service.WXShopOrderService; |
| | |
| | | */ |
| | | @PostMapping(value = "/calSecKillPrice") |
| | | public AjaxResult calSecKillPrice(@RequestBody SecKillVO secKillVO) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(secKillVO.getId()); |
| | | if (seckillInfo == null) { |
| | | return AjaxResult.buildFailInstance("参数有误"); |
| | | } |
| | | |
| | | BigDecimal postage = wxShopOrderService.calculationPostage(seckillInfo.getSiPrice(),bizUser.getCompanyId()); |
| | | BigDecimal postage = wxShopOrderService.calculationPostage(seckillInfo.getSiPrice(),sysVipInfo.getCompanyId()); |
| | | BigDecimal payPrice = seckillInfo.getSiPrice().multiply(BigDecimal.valueOf(secKillVO.getCount())).add(postage); |
| | | AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null); |
| | | ajaxResult.putInMap("totalPrice", payPrice); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.StringUtils; |
| | |
| | | //查询产品适配的优惠券 |
| | | result.putInMap("couponList", shopCouponService.getCouponListByProductId(id)); |
| | | //查询产品是否被用户收藏 |
| | | result.putInMap("checkCollect", CollectionUtils.isNotEmpty(collectionDao.selectByUserIdAndProid(id, redisUserLoginUtils.getLoginUser(BizUser.class).getOpenId()))); |
| | | result.putInMap("checkCollect", CollectionUtils.isNotEmpty(collectionDao.selectByUserIdAndProid(id, redisUserLoginUtils.getLoginUser(SysVipInfo.class).getOpenId()))); |
| | | } else { |
| | | result.putInMap("checkCollect", false); |
| | | } |
| | |
| | | * @param shopProduct |
| | | */ |
| | | private void saveSearchHistroy(@RequestBody ShopProduct shopProduct) { |
| | | BizUser bigUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo bigUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopSearchRecord searchBean = new ShopSearchRecord(); |
| | | if (StringUtils.isNotBlank(shopProduct.getTitle())) { |
| | | searchBean.setSearchType(AppConstance.SEARCH_TYPE); |
| | | searchBean.setSearchContent(shopProduct.getTitle()); |
| | | } |
| | | searchBean.setUserId(bigUser.getOpenId()); |
| | | searchBean.setUserId(bigUser.getId()); |
| | | searchBean.setSearchPriceStart(shopProduct.getStartPrice()); |
| | | searchBean.setSearchPriceEnd(shopProduct.getEndPrice()); |
| | | searchBean.setSearchDel(AppConstance.DATA_USEABLE); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.score.dao.ScoreUseRecordDao; |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = ScoreUseRecordVo.class) |
| | | }) |
| | | AjaxResult getFlowList(@RequestBody @Validated ScoreFlowDto scoreFlowDto) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Page<ScoreUseRecordVo> page=new Page<>(scoreFlowDto.getPageNum(),scoreFlowDto.getPageSize()); |
| | | scoreFlowDto.setUserId(loginUser.getOpenId()); |
| | | scoreFlowDto.setVipId(loginUser.getId()); |
| | | IPage<ScoreUseRecordVo> shopScoreRecord = scoreUseRecordDao.selectFlowList(page, scoreFlowDto); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(shopScoreRecord.getRecords()); |
| | | return result; |
| | |
| | | @ApiResponse(code = 200, message = "ok", response = AjaxResult.class) |
| | | }) |
| | | AjaxResult getUserScore() { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(scoreVipDetailDao.selectUserTotalScore(loginUser.getOpenId(),null)); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | AjaxResult result=AjaxResult.buildSuccessInstance(scoreVipDetailDao.selectUserTotalScore(loginUser.getId())); |
| | | return result; |
| | | } |
| | | |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.constance.SystemMessageCode; |
| | |
| | | @PostMapping("/findShoppingCart") |
| | | @ResponseBody |
| | | public AjaxResult getShoppingCartByUserId(@RequestBody ShopShoppingCart shoppingCart) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | String userId = loginUser.getOpenId(); |
| | | List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shoppingCart.getShopId(),userId); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shoppingCart.getShopId(),loginUser.getId()); |
| | | List<ShopCartVo> shopCartVoList = shoppingCartService.buildShopCart(list); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopCartVoList, shopCartVoList.size()); |
| | | ShopCartBillVo shopCartBill = shoppingCartService.buildShopCartBillVo(shopCartVoList); |
| | |
| | | public |
| | | @ResponseBody |
| | | AjaxResult getUserCartCount(@PathVariable("shopId") Long shopId) { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getOpenId()); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getId()); |
| | | if (userCartCount == null) { |
| | | userCartCount = 0; |
| | | } |
| | |
| | | |
| | | shoppingCart.setCartProductId(sku.getpId()); |
| | | |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | shoppingCart.setCreateBy(loginUser.getOpenId()); |
| | | shoppingCart.setUpdateBy(loginUser.getOpenId()); |
| | | shoppingCart.setCartUserId(loginUser.getOpenId()); |
| | | shoppingCart.setCartUserId(loginUser.getId()); |
| | | shoppingCart.setCompanyId(HostInterceptor.getCompanyId()); |
| | | ShopShoppingCart shoppCartLimt = shoppingCartDao.selectBuyLimit(shoppingCart.getCartProductId(), |
| | | shoppingCart.getCartSkuId()); |
| | |
| | | ShopShoppingCart shopShoppingCart = new ShopShoppingCart(); |
| | | shopShoppingCart.setCartProductId(cartProductId); |
| | | shopShoppingCart.setCartSkuId(cartSkuId); |
| | | shopShoppingCart.setCartUserId(loginUser.getOpenId()); |
| | | shopShoppingCart.setCartUserId(loginUser.getId()); |
| | | shopShoppingCart.setShopId(shoppingCart.getShopId()); |
| | | List<ShopShoppingCart> shopShoppingCarts = shoppingCartDao.selectByModel(shopShoppingCart); |
| | | int i = 0; |
| | |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "保存失败"); |
| | | } |
| | | int userCartCount = shoppingCartDao.selectUserCartCount(shoppingCart.getShopId(), |
| | | loginUser.getOpenId()); |
| | | loginUser.getId()); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); |
| | | result.putInMap("userCartCount", userCartCount); |
| | | return result; |
| | |
| | | @ResponseBody |
| | | public AjaxResult updateCartAllSelected(@PathVariable("isSelected") Integer isSelected, |
| | | @PathVariable("shopId") Long shopId) { |
| | | BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | shoppingCartDao.updateAllSelected(user.getOpenId(), shopId, isSelected); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功"); |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | |
| | | |
| | | @RequestMapping(value = "/showSkinList") |
| | | public @ResponseBody AjaxResult showSkinList(@RequestBody SkinCheckDTO skinCheckDTO) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | PaginationVO pageVo = new PaginationVO(); |
| | | pageVo.setLimit(skinCheckDTO.getLimit()); |
| | | pageVo.setOffset(skinCheckDTO.getOffset()); |
| | | SysSkinCheckRecord skinCheckRecord = new SysSkinCheckRecord(); |
| | | skinCheckRecord.setTelphone(bizUser.getPhoneNumber()); |
| | | skinCheckRecord.setTelphone(sysVipInfo.getPhone()); |
| | | List<SysSkinCheckRecord> dataList = sysSkinCheckRecordDao.selectInPage(skinCheckRecord, pageVo); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, |
| | | sysSkinCheckRecordDao.selectTotalRecord(skinCheckRecord)); |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.service.BizUserService; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.HttpCurlUtil; |
| | | import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil; |
| | |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.web.BaseAction; |
| | | 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.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanApply; |
| | | import com.matrix.system.fenxiao.service.ShopSalesmanApplyService; |
| | | 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.shopXcx.api.WeChatApiTools; |
| | | import com.matrix.system.shopXcx.api.dto.XcxUserSaveUserInfoDto; |
| | | import net.sf.json.JSONObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author jyy |
| | |
| | | public class WxUserAction extends BaseAction { |
| | | |
| | | @Autowired |
| | | private BizUserService bizUserService; |
| | | private SysVipInfoService sysVipInfoService; |
| | | |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | private ShopSalesmanApplyService shopSalesmanApplyService; |
| | |
| | | String sessionKey = json.getString("session_key"); |
| | | LogUtil.debug("openId={},sessionKey={}", openId, sessionKey); |
| | | // 查询用户是否存在 |
| | | BizUser bizUser = null; |
| | | SysVipInfo sysVipInfo = null; |
| | | synchronized (this) { |
| | | bizUser = bizUserService.findByOpenId(openId); |
| | | if (bizUser == null) { |
| | | sysVipInfo = sysVipInfoService.findByOpenId(openId); |
| | | if (sysVipInfo == null) { |
| | | // 新增用户 |
| | | bizUser = new BizUser(); |
| | | bizUser.setSessionKey(sessionKey); |
| | | bizUser.setIsSales(BizUser.NOT_SALES); |
| | | bizUser.setOpenId(openId); |
| | | bizUser.setLastLoginTime(new Date()); |
| | | bizUser.setUserType(AppConstance.USER_TYPE_CUSTOMER); |
| | | bizUser.setCompanyId(HostInterceptor.getCompanyId()); |
| | | bizUserService.add(bizUser); |
| | | sysVipInfo = new SysVipInfo(); |
| | | sysVipInfo.setIsSales(SysVipInfo.NOT_SALES); |
| | | sysVipInfo.setOpenId(openId); |
| | | sysVipInfo.setSessionKey(sessionKey); |
| | | sysVipInfo.setCompanyId(HostInterceptor.getCompanyId()); |
| | | sysVipInfo.setArrivalWay("微商城"); |
| | | sysVipInfo.setVipState(Dictionary.VIP_STATE_HY); |
| | | sysVipInfo.setVipType(Dictionary.VIP_TYPE_NOCARD); |
| | | sysVipInfo.setIsDeal(SysVipInfo.UNDEAL_VIP); |
| | | |
| | | sysVipInfo.setVipNo(openId); |
| | | sysVipInfoService.add(sysVipInfo); |
| | | |
| | | } else { |
| | | bizUser.setSessionKey(sessionKey); |
| | | bizUser.setLastLoginTime(new Date()); |
| | | // 更新用户sessionKey |
| | | bizUserService.modifyByModel(bizUser); |
| | | sysVipInfo.setSessionKey(sessionKey); |
| | | sysVipInfoDao.update(sysVipInfo); |
| | | } |
| | | } |
| | | // 存放redis |
| | | String token = redisUserLoginUtils.saveUserInfo(bizUser); |
| | | sysVipInfo.setLevelCard(null); |
| | | String token = redisUserLoginUtils.saveUserInfo(sysVipInfo); |
| | | LogUtil.info("用户token={}", token); |
| | | res.putInMap("token", token); |
| | | res.putInMap("userInfo", bizUser); |
| | | res.putInMap("userInfo", sysVipInfo); |
| | | res.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | } else { |
| | | res.setStatus(AjaxResult.STATUS_FAIL); |
| | |
| | | @RequestMapping(value = "/findUserInfo") |
| | | public @ResponseBody |
| | | AjaxResult findUserInfo() { |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | String openId = loginUser.getOpenId(); |
| | | BizUser bizUser = bizUserService.findByOpenId(openId); |
| | | SysVipInfo sysVipInfo = sysVipInfoService.findByOpenId(openId); |
| | | AjaxResult res = new AjaxResult(); |
| | | res.putInMap("userInfo", bizUser); |
| | | res.putInMap("userInfo", sysVipInfo); |
| | | res.setStatus(AjaxResult.STATUS_SUCCESS); |
| | | return res; |
| | | } |
| | |
| | | @GetMapping(value = "/findUserInfo/{openId}") |
| | | public @ResponseBody |
| | | AjaxResult findUserInfo(@PathVariable String openId) { |
| | | BizUser bizUser = bizUserService.findByOpenId(openId); |
| | | BizUser bizUserQuery=new BizUser(); |
| | | bizUserQuery.setNickName(bizUser.getNickName()); |
| | | bizUserQuery.setAvatarUrl(bizUser.getAvatarUrl()); |
| | | SysVipInfo sysVipInfo = sysVipInfoService.findByOpenId(openId); |
| | | SysVipInfo bizUserQuery=new SysVipInfo(); |
| | | bizUserQuery.setNickName(sysVipInfo.getNickName()); |
| | | bizUserQuery.setAvatarUrl(sysVipInfo.getAvatarUrl()); |
| | | bizUserQuery.setOpenId(openId); |
| | | return AjaxResult.buildSuccessInstance(bizUserQuery); |
| | | } |
| | |
| | | /** |
| | | * 接收用户信息 |
| | | */ |
| | | @RequestMapping(value = "/saveUserInfo") |
| | | @PostMapping(value = "/saveUserInfo") |
| | | public @ResponseBody |
| | | AjaxResult saveUserInfo(@RequestBody BizUser bizUser) { |
| | | AjaxResult saveUserInfo(@RequestBody XcxUserSaveUserInfoDto xcxUserSaveUserInfoDto) { |
| | | |
| | | BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | bizUser.setUserId(loginUser.getUserId()); |
| | | // TODO 赋值操作 |
| | | int i = bizUserService.saveUserInfo(bizUser); |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo=new SysVipInfo(); |
| | | sysVipInfo.setId(loginUser.getId()); |
| | | BeanUtil.copyProperties(xcxUserSaveUserInfoDto,sysVipInfo); |
| | | sysVipInfo.setPhone(xcxUserSaveUserInfoDto.getPhoneNumber()); |
| | | |
| | | checkNeedToBeSalesman(bizUser, loginUser); |
| | | int i = sysVipInfoDao.update(sysVipInfo); |
| | | |
| | | checkNeedToBeSalesman(sysVipInfo, loginUser); |
| | | if (i == 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "更新失败"); |
| | | } |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, Collections.singletonList(bizUser)); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, Collections.singletonList(sysVipInfo)); |
| | | } |
| | | |
| | | |
| | | |
| | | void checkNeedToBeSalesman(BizUser bizUser, BizUser loginUser) { |
| | | void checkNeedToBeSalesman(SysVipInfo sysVipInfo, SysVipInfo loginUser) { |
| | | //查询是否需要自动成为分销员 |
| | | if ((loginUser.getIsSales() == null || loginUser.getIsSales() == 2) |
| | | && StringUtils.isNotBlank(bizUser.getNickName())) {//目前还不是分销员 |
| | | && StringUtils.isNotBlank(sysVipInfo.getNickName())) {//目前还不是分销员 |
| | | BusParameterSettings fxSwith = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_SWITCH, HostInterceptor.getCompanyId()); |
| | | if (fxSwith.getParamValue().equals("1")) {//开启分销 |
| | | BusParameterSettings applyWay = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_WAY, loginUser.getCompanyId()); |
| | | if (applyWay.getParamValue().equals(FenxiaoSettingConstant.FX_APPLY_WAY_AUTO)) {//自动成为分销员 |
| | | QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id", loginUser.getOpenId()); |
| | | queryWrapper.eq("user_id", loginUser.getId()); |
| | | queryWrapper.eq("apply_status", ShopSalesmanApply.APPLY_STATUS_DSH); |
| | | ShopSalesmanApply shopSalesmanApply = salesmanApplyDao.selectOne(queryWrapper); |
| | | if (shopSalesmanApply == null) {//没有待审核记录 |
| | | try { |
| | | shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getOpenId(), null, null, 2); |
| | | shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getId(), null, null, 2); |
| | | }catch (Exception e){ |
| | | LogUtil.debug(e.getMessage()); |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.shopXcx.dao.ShopSearchRecordDao; |
| | |
| | | @RequestMapping(value = "/getSearchRecordList") |
| | | @ResponseBody |
| | | public AjaxResult getSearchRecordList(){ |
| | | BizUser bigUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo bigUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | if(bigUser == null){ |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL,"用户未授权"); |
| | | } |
| | |
| | | @RequestMapping(value = "/deleteSearchRecord") |
| | | @ResponseBody |
| | | public AjaxResult deleteSearchRecord(){ |
| | | BizUser bigUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo bigUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | shopSearchRecordDao.deleteByUserId(bigUser.getOpenId()); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS,"删除成功"); |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | 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; |
| | |
| | | SysUsersDao staffInfoDao; |
| | | |
| | | @Autowired |
| | | BizUserDao bizUserDao; |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Autowired |
| | | RabiitMqTemplate rabiitMqTemplate; |
| | |
| | | @RequestMapping(value = "/createServiceOrder") |
| | | public @ResponseBody |
| | | AjaxResult createServiceOrder(@RequestBody Onlinebooking onlinebooking) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(bizUser.getPhoneNumber()); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo vipInfo = vipInfoDao.selectByPhone(sysVipInfo.getPhone()); |
| | | SysProjUse sysProjUse = projUseDao.selectById(Long.parseLong(onlinebooking.getProductId() + "")); |
| | | Date yyTime = DateUtil.stringToDate(onlinebooking.getTimeStr(), DateUtil.DATE_FORMAT_MM); |
| | | SysProjServices sysProjServices = new SysProjServices(); |
| | |
| | | @PostMapping(value = "/getServiceOrderList") |
| | | @ResponseBody |
| | | public AjaxResult findServiceOrderList(@RequestBody @Validated ErpServiceOrderListDto orderListDto) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo vipInfo= vipInfoDao.selectByPhone(bizUser.getPhoneNumber()); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo vipInfo= vipInfoDao.selectByPhone(sysVipInfo.getPhone()); |
| | | orderListDto.setVipId(vipInfo.getId()); |
| | | List<ErpServiceOrderListVo> apiServiceOrderListInPage = projServicesDao.findWxServiceOrderList(orderListDto); |
| | | return AjaxResult.buildSuccessInstance(apiServiceOrderListInPage,"查询成功"); |
| | |
| | | private Integer revenueType; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | |
| | | } |
| | |
| | | private Integer orderStatus; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | |
| | | |
| | |
| | | @ApiModelProperty(value = "收支类型 不传全部,1,收入,2支出", example = "1") |
| | | private Integer revenueType; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private String userId; |
| | | |
| | | @ApiModelProperty(value = "会员id", example = "1") |
| | | private Long vipId; |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "XcxUserSaveUserInfoDto", description = "小程序用户授权信息保存接收类") |
| | | public class XcxUserSaveUserInfoDto { |
| | | |
| | | @ApiModelProperty(value = "手机号码" ) |
| | | private String phoneNumber; |
| | | |
| | | @ApiModelProperty(value = "昵称" ) |
| | | private String nickName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "头像" ) |
| | | private String avatarUrl; |
| | | |
| | | |
| | | @ApiModelProperty(value = "性别" ) |
| | | private Integer gender; |
| | | |
| | | |
| | | /** |
| | | * 用户所在国家 |
| | | */ |
| | | private String country; |
| | | |
| | | /** |
| | | * 省 |
| | | */ |
| | | private String province; |
| | | |
| | | /** |
| | | * 市 |
| | | */ |
| | | private String city; |
| | | |
| | | /** |
| | | * 区 |
| | | */ |
| | | private String area; |
| | | |
| | | } |
| | |
| | | */ |
| | | Boolean refundToUser(String id, ShopRefundRecord shopRefundRecord); |
| | | |
| | | /** |
| | | * 退款成功后发送微信提醒 |
| | | * @param shopRefundRecord |
| | | * @return |
| | | */ |
| | | int sendRefundInfoToUser(ShopRefundRecord shopRefundRecord); |
| | | |
| | | void updateGroupBuyStatus(Long orderId); |
| | | |
| | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxUtils; |
| | |
| | | import com.matrix.system.common.dao.CustomerDataDictionaryDao; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.hive.dao.ShoppingGoodsDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import com.matrix.system.shopXcx.api.action.PayThreadPool; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderCouponGroup; |
| | |
| | | @Autowired |
| | | private ScoreVipDetailDao scoreVipDetailDao; |
| | | |
| | | |
| | | @Autowired |
| | | private SysVipInfoDao sysVipInfoDao; |
| | | @Override |
| | | public BigDecimal calculationPostage(BigDecimal payPrice, Long companyId) { |
| | | BigDecimal postage = BigDecimal.ZERO; |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public AjaxResult createShopOrder(ShopOrderDto shopOrderDto) throws Exception { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | |
| | | //校验收货地址 |
| | |
| | | |
| | | if(discountExplain.getScorePay()!=null){ |
| | | //校验用户积分是否够用 |
| | | int score=scoreVipDetailDao.selectUserTotalScore(bizUser.getOpenId(),null); |
| | | int score=scoreVipDetailDao.selectUserTotalScore(sysVipInfo.getId()); |
| | | if(score<discountExplain.getScorePay()){ |
| | | return AjaxResult.buildFailInstance("积分不足"); |
| | | } |
| | | } |
| | | |
| | | ShopOrder shopOrder = new ShopOrder(); |
| | | shopOrder.setCompanyId(bizUser.getCompanyId()); |
| | | shopOrder.setCompanyId(sysVipInfo.getCompanyId()); |
| | | shopOrder.setStoreId(Integer.parseInt(shopOrderDto.getShopId().toString())); |
| | | //默认设置为产品类型 |
| | | shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS); |
| | |
| | | } |
| | | |
| | | //校验商品是否限购 |
| | | wxShopOrderUtil.verifyProductLimitInfo(details, bizUser.getOpenId()); |
| | | wxShopOrderUtil.verifyProductLimitInfo(details, sysVipInfo.getOpenId()); |
| | | //TODO 更新库存和销量 更新库存和销量[考虑和erp库存联动] |
| | | wxShopOrderUtil.updateProductAndSkuInfo(details); |
| | | //用户openId |
| | | shopOrder.setUserId(bizUser.getOpenId()); |
| | | shopOrder.setUserId(sysVipInfo.getId()); |
| | | shopOrder.setCreateBy("微信小程序生成"); |
| | | shopOrder.setUpdateBy("微信小程序生成"); |
| | | shopOrder.setCommodityPrice(discountExplain.getBillPrice()); |
| | |
| | | //支付总积分 |
| | | Integer scoreCount=0; |
| | | |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | //计算购物车中物品的优惠信息 |
| | | List<OrderItemDto> orderItemDtos = shopOrderDto.getOrderItemList() |
| | |
| | | //满足店铺活动的订单不能使用优惠券 |
| | | if (conditionsGroupCount > 0) { |
| | | //计算可用优惠券 |
| | | usefulCoupon = wxShopCouponService.getCartVoCouponList(bizUser.getCompanyId(), orderItemDtos); |
| | | usefulCoupon = wxShopCouponService.getCartVoCouponList(sysVipInfo.getCompanyId(), orderItemDtos); |
| | | //获取用户使用的优惠券 |
| | | if (shopOrderDto.getCouponReceiveId() == null) { |
| | | //如果用户没有选择优惠券则默认选优惠金额最高的 |
| | |
| | | |
| | | if(shopOrder.getScorePay()!=null){ |
| | | //校验用户积分是否够用 |
| | | int score=scoreVipDetailDao.selectUserTotalScore(shopOrder.getUserId(),null); |
| | | int score=scoreVipDetailDao.selectUserTotalScore(shopOrder.getUserId()); |
| | | if(score<shopOrder.getScorePay()){ |
| | | return AjaxResult.buildFailInstance("积分不足"); |
| | | } |
| | |
| | | BigDecimal money = new BigDecimal(shopOrder.getOrderMoney().toString()); |
| | | BrandWCPayRequestData payData; |
| | | String productNames = wxShopOrderUtil.getProductNames(shopOrder.getUserId(), shopOrder.getId()); |
| | | SysVipInfo vipInfo=sysVipInfoDao.selectById(shopOrder.getUserId()); |
| | | |
| | | LogUtil.debug(String.valueOf(isDebug)); |
| | | if (isDebug) { |
| | | payData = weixinServiceUtil.createOrder("[测试]" + productNames, shopOrder.getOrderNo(), |
| | | 1, shopOrder.getUserId(), String.valueOf(shopOrder.getId())); |
| | | 1, vipInfo.getOpenId(), String.valueOf(shopOrder.getId())); |
| | | } else { |
| | | payData = weixinServiceUtil.createOrder(productNames, shopOrder.getOrderNo(), |
| | | unit.multiply(money).intValue(), shopOrder.getUserId(), String.valueOf(shopOrder.getId())); |
| | | unit.multiply(money).intValue(),vipInfo.getOpenId(), String.valueOf(shopOrder.getId())); |
| | | } |
| | | ShopOrder updateParam = new ShopOrder(); |
| | | updateParam.setId(shopOrder.getId()); |
| | |
| | | */ |
| | | @Override |
| | | public AjaxResult getMyOrderInfo(OrderInfoQueryPOJO orderInfoQueryPOJO) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | orderInfoQueryPOJO.setSort("update_time"); |
| | | if (orderInfoQueryPOJO.getOffset() >= 1) { |
| | | orderInfoQueryPOJO.setOffset((orderInfoQueryPOJO.getOffset() - 1) * orderInfoQueryPOJO.getLimit()); |
| | | } |
| | | List<ShopOrder> result = shopOrderDao.selectMyOrderByStatus(bizUser.getOpenId(), orderInfoQueryPOJO); |
| | | List<ShopOrder> result = shopOrderDao.selectMyOrderByStatus(sysVipInfo.getId(), orderInfoQueryPOJO); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, result); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public AjaxResult getOrderInfoById(Integer orderId) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | ShopOrder shopOrder = shopOrderDao.selectOrderInfoById(bizUser.getOpenId(), orderId); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopOrder shopOrder = shopOrderDao.selectOrderInfoById(sysVipInfo.getId(), orderId); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, Arrays.asList(shopOrder)); |
| | | } |
| | | |
| | |
| | | } |
| | | if (shopOrder.getDiscountAmount() != null && shopOrder.getDiscountAmount().compareTo(BigDecimal.ZERO) > 0) { |
| | | ShopCouponRecord shopCouponRecord = new ShopCouponRecord(); |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | shopCouponRecord.setUserId(bizUser.getOpenId()); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | shopCouponRecord.setUserId(sysVipInfo.getId()); |
| | | shopCouponRecord.setOrderId(orderId); |
| | | List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(shopCouponRecord); |
| | | if (CollectionUtils.isNotEmpty(recordList)) { |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxUtils; |
| | | import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult createGroupBuy(CreateGroupBuyDTO createGroupBuyDTO) throws Exception { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | ShopActivitiesGroupPrice groupPrice = shopActivitiesGroupPriceDao.selectById(createGroupBuyDTO.getGpId()); |
| | | ShopActivitiesGroupInfo groupInfo = shopActivitiesGroupInfoDao.selectGroupInfoByActId(groupPrice.getActId()); |
| | |
| | | |
| | | // 判断最大开团数量 |
| | | if (groupInfo.getGiHeadDiscount() != null && groupInfo.getGiHeadDiscount() != 0) { |
| | | int createCnt = shopActivitiesGroupJoinDao.selectCreateGroupBuyCount(shopActivities.getId(), bizUser.getOpenId()); |
| | | int createCnt = shopActivitiesGroupJoinDao.selectCreateGroupBuyCount(shopActivities.getId(), sysVipInfo.getOpenId()); |
| | | if (createCnt > groupInfo.getGiHeadDiscount()) { |
| | | return AjaxResult.buildFailInstance("达到最大开团数量"); |
| | | } |
| | |
| | | return AjaxResult.buildFailInstance("达到最大限购数量"); |
| | | } |
| | | |
| | | int count = shopActivitiesGroupJoinUserDao.selectCountHasBuy(groupInfo.getId(), bizUser.getOpenId()); |
| | | int count = shopActivitiesGroupJoinUserDao.selectCountHasBuy(groupInfo.getId(), sysVipInfo.getOpenId()); |
| | | if (count + createGroupBuyDTO.getCount() > groupInfo.getGiLimitBuy()) { |
| | | return AjaxResult.buildFailInstance("达到最大限购数量"); |
| | | } |
| | | } |
| | | |
| | | // 判断该用户在这个活动中是否存在拼团,并判断该拼团订单是否已付款 |
| | | ShopActivitiesGroupJoin existGroupJoin = shopActivitiesGroupJoinDao.selectExistGroupingJoinByUser(groupPrice.getActId(), bizUser.getOpenId()); |
| | | ShopActivitiesGroupJoin existGroupJoin = shopActivitiesGroupJoinDao.selectExistGroupingJoinByUser(groupPrice.getActId(), sysVipInfo.getOpenId()); |
| | | if (existGroupJoin != null) { |
| | | if (existGroupJoin.getGjStatus() == ShopActivitiesGroupJoin.ACTIVITIES_JOIN_WAIT_PAY) { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "您该活动有个订单未付款"); |
| | |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "该活动已存在拼团"); |
| | | } |
| | | |
| | | boolean isOld = isOldUser(bizUser.getPhoneNumber()); |
| | | boolean isOld = isOldUser(sysVipInfo.getPhone()); |
| | | // 老用户和老带新的开团都必须是老用户 |
| | | if (ShopActivitiesGroupInfo.GROUP_TYPE_ALL_OLD == groupInfo.getGiType() || ShopActivitiesGroupInfo.GROUP_TYPE_OLD_AND_NEW == groupInfo.getGiType()) { |
| | | if (!isOld) { |
| | |
| | | |
| | | createGroupBuyDTO.setPrice(groupPrice.getGpPrice()); |
| | | createGroupBuyDTO.setGoodsId(groupInfo.getGoodsId().intValue()); |
| | | createGroupBuyDTO.setOpenId(bizUser.getOpenId()); |
| | | createGroupBuyDTO.setUserId(sysVipInfo.getId()); |
| | | ShopOrder shopOrder = createOrderByGroupBuy(createGroupBuyDTO); |
| | | |
| | | ShopActivitiesGroupJoin groupJoin = new ShopActivitiesGroupJoin(); |
| | |
| | | groupJoin.setGjEndTime(gjEndTime.getTime()); |
| | | groupJoin.setGiId(groupInfo.getId()); |
| | | groupJoin.setGjStatus(ShopActivitiesGroupJoin.ACTIVITIES_JOIN_WAIT_PAY); |
| | | groupJoin.setCreateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); |
| | | groupJoin.setUpdateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); |
| | | groupJoin.setGjHeadId(bizUser.getOpenId()); |
| | | groupJoin.setCreateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); |
| | | groupJoin.setUpdateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); |
| | | groupJoin.setGjHeadId(sysVipInfo.getId()); |
| | | groupJoin.setCompanyId(shopActivities.getCompanyId()); |
| | | shopActivitiesGroupJoinDao.insert(groupJoin); |
| | | |
| | | ShopActivitiesGroupJoinUser joinUser = new ShopActivitiesGroupJoinUser(); |
| | | joinUser.setGjId(groupJoin.getId()); |
| | | joinUser.setGiId(groupInfo.getId()); |
| | | joinUser.setUserId(bizUser.getOpenId()); |
| | | joinUser.setUserId(sysVipInfo.getId()); |
| | | joinUser.setIsHead(ShopActivitiesGroupJoinUser.USER_IS_HEAD_Y); |
| | | joinUser.setCreateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); |
| | | joinUser.setUpdateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); |
| | | joinUser.setCreateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); |
| | | joinUser.setUpdateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); |
| | | joinUser.setIsHasPay(ShopActivitiesGroupJoinUser.IS_HAS_PAY_N); |
| | | joinUser.setIsHasCancel(ShopActivitiesGroupJoinUser.IS_HAS_CANCEL_N); |
| | | Calendar payEndTime = Calendar.getInstance(); |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public AjaxResult joinGroupBuy(CreateGroupBuyDTO createGroupBuyDTO) throws Exception { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | // TODO 需判断拼团结束时间以及当前拼团是否已满员 |
| | | |
| | |
| | | return AjaxResult.buildFailInstance("该拼团不存在"); |
| | | } |
| | | |
| | | if (groupJoin.getGjHeadId().equals(bizUser.getOpenId())) { |
| | | if (groupJoin.getGjHeadId().equals(sysVipInfo.getOpenId())) { |
| | | return AjaxResult.buildFailInstance("您是拼团团长,无法加入拼团"); |
| | | } |
| | | |
| | |
| | | return AjaxResult.buildFailInstance("该拼团时间已结束"); |
| | | } |
| | | |
| | | ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(bizUser.getOpenId(), groupJoin.getId()); |
| | | ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(sysVipInfo.getOpenId(), groupJoin.getId()); |
| | | if (groupJoinUser != null) { |
| | | return AjaxResult.buildFailInstance("您已加入了该拼团"); |
| | | } |
| | |
| | | return AjaxResult.buildFailInstance("达到最大限购数量"); |
| | | } |
| | | |
| | | int count = shopActivitiesGroupJoinUserDao.selectCountHasBuy(groupInfo.getId(), bizUser.getOpenId()); |
| | | int count = shopActivitiesGroupJoinUserDao.selectCountHasBuy(groupInfo.getId(), sysVipInfo.getOpenId()); |
| | | if (count + createGroupBuyDTO.getCount() > groupInfo.getGiLimitBuy()) { |
| | | return AjaxResult.buildFailInstance("达到最大限购数量"); |
| | | } |
| | |
| | | return AjaxResult.buildFailInstance("该拼团已满员"); |
| | | } |
| | | |
| | | boolean isOld = isOldUser(bizUser.getPhoneNumber()); |
| | | boolean isOld = isOldUser(sysVipInfo.getPhone()); |
| | | // 老用户 -- 加入拼团的都必须是老用户 |
| | | if (ShopActivitiesGroupInfo.GROUP_TYPE_ALL_OLD == groupInfo.getGiType()) { |
| | | if (!isOld) { |
| | |
| | | |
| | | createGroupBuyDTO.setPrice(groupPrice.getGpPrice()); |
| | | createGroupBuyDTO.setGoodsId(groupInfo.getGoodsId().intValue()); |
| | | createGroupBuyDTO.setOpenId(bizUser.getOpenId()); |
| | | createGroupBuyDTO.setUserId(sysVipInfo.getId()); |
| | | ShopOrder shopOrder = createOrderByGroupBuy(createGroupBuyDTO); |
| | | |
| | | ShopActivitiesGroupJoinUser joinUser = new ShopActivitiesGroupJoinUser(); |
| | |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.set(Calendar.MINUTE, Integer.parseInt(payTimeLimit)); |
| | | joinUser.setPayEndTime(calendar.getTime()); |
| | | joinUser.setUserId(bizUser.getOpenId()); |
| | | joinUser.setUserId(sysVipInfo.getId()); |
| | | joinUser.setGiId(groupInfo.getId()); |
| | | joinUser.setGjId(groupJoin.getId()); |
| | | joinUser.setIsHead(ShopActivitiesGroupJoinUser.USER_IS_HEAD_N); |
| | | joinUser.setCreateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); |
| | | joinUser.setUpdateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); |
| | | joinUser.setCreateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); |
| | | joinUser.setUpdateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); |
| | | joinUser.setIsNewUser(isOld ? 2 : 1); |
| | | joinUser.setIsHasCancel(ShopActivitiesGroupJoinUser.IS_HAS_CANCEL_N); |
| | | joinUser.setCompanyId(groupJoin.getCompanyId()); |
| | |
| | | if (shopReceiveAddress == null) { |
| | | throw new GlobleException("请选择正确的收获地址"); |
| | | } |
| | | BizUser user=redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo user=redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopOrder shopOrder = new ShopOrder(); |
| | | shopOrder.setCompanyId(user.getCompanyId()); |
| | | shopOrder.setStoreId(Integer.parseInt(createGroupBuyDTO.getShopId().toString())); |
| | |
| | | //TODO 更新库存和销量 更新库存和销量[考虑和erp库存联动] |
| | | wxShopOrderUtil.updateProductAndSkuInfo(details); |
| | | |
| | | shopOrder.setUserId(createGroupBuyDTO.getOpenId()); |
| | | shopOrder.setUserId(createGroupBuyDTO.getUserId()); |
| | | shopOrder.setCreateBy("微信小程序生成"); |
| | | shopOrder.setUpdateBy("微信小程序生成"); |
| | | shopOrder.setCommodityPrice(createGroupBuyDTO.getPrice()); |
| | |
| | | |
| | | import com.google.gson.Gson; |
| | | import com.google.gson.GsonBuilder; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.component.tools.WxUtils; |
| | | import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData; |
| | |
| | | |
| | | @Override |
| | | public AjaxResult createSecKillOrder(CreateSecKillDTO secKillDTO) throws Exception { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(secKillDTO.getId()); |
| | | if (seckillInfo == null) { |
| | | return AjaxResult.buildFailInstance("秒杀不存在"); |
| | |
| | | return AjaxResult.buildFailInstance("购买数量超过最大限购数量"); |
| | | } |
| | | |
| | | int count = shopActivitiesSeckillRecordDao.selectCountSecKill(seckillInfo.getId(), bizUser.getOpenId()); |
| | | int count = shopActivitiesSeckillRecordDao.selectCountSecKill(seckillInfo.getId(), sysVipInfo.getOpenId()); |
| | | if (secKillDTO.getCount() + count > seckillInfo.getSiLimitCnt()) { |
| | | return AjaxResult.buildFailInstance("购买数量超过最大限购数量"); |
| | | } |
| | |
| | | |
| | | secKillDTO.setPrice(seckillInfo.getSiPrice()); |
| | | secKillDTO.setGoodsId(seckillInfo.getGoodsId().intValue()); |
| | | secKillDTO.setOpenId(bizUser.getOpenId()); |
| | | secKillDTO.setOpenId(sysVipInfo.getOpenId()); |
| | | ShopOrder shopOrder = createOrder(secKillDTO); |
| | | |
| | | ShopActivitiesSeckillRecord seckillRecord = new ShopActivitiesSeckillRecord(); |
| | | seckillRecord.setOrderId(shopOrder.getId().longValue()); |
| | | seckillRecord.setSiId(seckillInfo.getId()); |
| | | seckillRecord.setUserId(bizUser.getOpenId()); |
| | | seckillRecord.setCreateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); |
| | | seckillRecord.setUpdateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName()); |
| | | seckillRecord.setUserId(sysVipInfo.getId()); |
| | | seckillRecord.setCreateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); |
| | | seckillRecord.setUpdateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName()); |
| | | seckillRecord.setCompanyId(seckillInfo.getCompanyId()); |
| | | |
| | | // 同步锁 |
| | |
| | | } |
| | | |
| | | private ShopOrder createOrder(CreateSecKillDTO secKillDTO) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(secKillDTO.getAddressId()); |
| | | if (shopReceiveAddress == null) { |
| | | throw new GlobleException("请选择正确的收获地址"); |
| | |
| | | //TODO 更新库存和销量 更新库存和销量[考虑和erp库存联动] |
| | | wxShopOrderUtil.updateProductAndSkuInfo(details); |
| | | |
| | | shopOrder.setUserId(secKillDTO.getOpenId()); |
| | | shopOrder.setUserId(secKillDTO.getId()); |
| | | shopOrder.setCreateBy("微信小程序生成"); |
| | | shopOrder.setUpdateBy("微信小程序生成"); |
| | | shopOrder.setCommodityPrice(secKillDTO.getPrice()); |
| | | shopOrder.setPurchaseQuantity(1); |
| | | shopOrder.setCompanyId(bizUser.getCompanyId()); |
| | | shopOrder.setCompanyId(sysVipInfo.getCompanyId()); |
| | | //购买方式 |
| | | shopOrder.setShippingMethod(secKillDTO.getShippingMethod()); |
| | | //生成订单号 |
| | |
| | | shopOrder.setPayResult(ShopOrder.ORDER_WX_STATUS_WAIT_PAY); |
| | | //如果没有提交购买方式或配送方式不是物流 |
| | | //获取邮费 |
| | | BigDecimal postPrice = wxShopOrderService.calculationPostage(secKillDTO.getPrice(),bizUser.getCompanyId()); |
| | | BigDecimal postPrice = wxShopOrderService.calculationPostage(secKillDTO.getPrice(),sysVipInfo.getCompanyId()); |
| | | shopOrder.setPostage(postPrice); |
| | | BigDecimal payPrice = secKillDTO.getPrice().multiply(BigDecimal.valueOf(secKillDTO.getCount())).add(shopOrder.getPostage()); |
| | | shopOrder.setOrderMoney(payPrice); |
| | |
| | | package com.matrix.system.shopXcx.api.service.impl; |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | |
| | | List<CouponReceiveInfoVO> shopCoupons = new ArrayList<>(); |
| | | |
| | | |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | //1.找到用户所有的优惠券 |
| | | List<CouponReceiveInfoVO> userAllCoupon = shopCouponRecordDao.selectMyCouponByStatus(companyId, bizUser.getOpenId(), AppConstance.MY_COUPON_NOT_USE, |
| | | List<CouponReceiveInfoVO> userAllCoupon = shopCouponRecordDao.selectMyCouponByStatus(companyId, sysVipInfo.getId(), AppConstance.MY_COUPON_NOT_USE, |
| | | null); |
| | | if (CollectionUtils.isNotEmpty(userAllCoupon)) { |
| | | //根据优惠力度排序,优惠力度大的先参与计算 |
| | |
| | | */ |
| | | @Override |
| | | public AjaxResult getUsableCoupon(PaginationVO pageVo) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(bizUser.getOpenId()); |
| | | List<ShopCoupon> list = shopCouponDao.selectUsableCoupon(newPeople, bizUser.getOpenId(), pageVo); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(sysVipInfo.getId()); |
| | | List<ShopCoupon> list = shopCouponDao.selectUsableCoupon(newPeople, sysVipInfo.getOpenId(), pageVo); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, list); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public AjaxResult receiveCoupon(Integer couponId) { |
| | | ShopCoupon shopCoupon = shopCouponDao.selectById(couponId); |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | |
| | | // 如果没有找到该优惠券 |
| | | if (shopCoupon == null) { |
| | |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "优惠券已领完!"); |
| | | } |
| | | |
| | | boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(bizUser.getOpenId()); |
| | | boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(sysVipInfo.getId()); |
| | | |
| | | // 如果改券是新人专属且当前用户不是新人 |
| | | if (AppConstance.COUPON_GET_LIMT_NEW.equals(shopCoupon.getGetLimit()) && !newPeople) { |
| | |
| | | } |
| | | |
| | | ShopCouponRecord param = new ShopCouponRecord(); |
| | | param.setUserId(bizUser.getOpenId()); |
| | | param.setUserId(sysVipInfo.getId()); |
| | | param.setCId(couponId); |
| | | List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(param); |
| | | // 如果已经领取改优惠券 |
| | |
| | | insertRecord.setCreateBy(AppConstance.SYSTEM_USER); |
| | | insertRecord.setUpdateBy(AppConstance.SYSTEM_USER); |
| | | insertRecord.setCId(couponId); |
| | | insertRecord.setUserId(bizUser.getOpenId()); |
| | | insertRecord.setUserId(sysVipInfo.getId()); |
| | | insertRecord.setIsUsing(2); |
| | | int i = shopCouponRecordDao.insert(insertRecord); |
| | | // 如果插入领取记录表失败 |
| | |
| | | */ |
| | | @Override |
| | | public AjaxResult getMyCouponInfoByStatus(Long companyId, Integer status, PaginationVO pageVo) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | // 如果查询使用或未使用状态的优惠券列表 |
| | | if (AppConstance.MY_COUPON_USE.equals(status) || AppConstance.MY_COUPON_NOT_USE.equals(status)) { |
| | | List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyCouponByStatus(companyId,bizUser.getOpenId(), status, |
| | | List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyCouponByStatus(companyId,sysVipInfo.getId(), status, |
| | | pageVo); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, list); |
| | | } |
| | | List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyPastCoupon(companyId,bizUser.getOpenId(), pageVo); |
| | | List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyPastCoupon(companyId,sysVipInfo.getId(), pageVo); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, list); |
| | | } |
| | | |
| | |
| | | attrIds.addAll(ids); |
| | | } |
| | | } |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | List<ShopCoupon> list = shopCouponDao.selectUsableCouponByProductInfo(bizUser.getOpenId(), productId, |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | List<ShopCoupon> list = shopCouponDao.selectUsableCouponByProductInfo(sysVipInfo.getOpenId(), productId, |
| | | attrIds); |
| | | return list; |
| | | } |
| | |
| | | */ |
| | | @Override |
| | | public AjaxResult getCouponListByTag(String tag, Long companyId) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(bizUser.getOpenId()); |
| | | List<ShopCoupon> couponList = shopCouponDao.selectCouponListByTag(newPeople, bizUser.getOpenId(), tag,companyId); |
| | | SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(sysVipInfo.getId()); |
| | | List<ShopCoupon> couponList = shopCouponDao.selectCouponListByTag(newPeople, sysVipInfo.getOpenId(), tag,companyId); |
| | | AjaxResult res = new AjaxResult(AjaxResult.STATUS_SUCCESS, couponList); |
| | | res.putInMap("isNewPeople", newPeople); |
| | | return res; |
| | |
| | | //退款成功后同时把优惠券退回到用户的账号中 |
| | | if (shopOrder.getDiscountAmount() != null && shopOrder.getDiscountAmount().compareTo(BigDecimal.ZERO) >0) { |
| | | ShopCouponRecord shopCouponRecord = new ShopCouponRecord(); |
| | | String userIds = shopRefundRecord.getUserId(); |
| | | Long userIds = shopRefundRecord.getUserId(); |
| | | shopCouponRecord.setUserId(userIds); |
| | | shopCouponRecord.setOrderId(shopOrder.getId()); |
| | | List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(shopCouponRecord); |
| | |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * 退款成功后发送微信提醒 |
| | | * @param shopRefundRecord |
| | | * @return |
| | | */ |
| | | @Override |
| | | public int sendRefundInfoToUser(ShopRefundRecord shopRefundRecord) { |
| | | ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId()); |
| | | if (order == null) { |
| | | throw new GlobleException("没有找到需要退款的订单信息"); |
| | | } |
| | | List<String> msg = new ArrayList<>(); |
| | | //退款说明 |
| | | String refundExplain = "退款已经原路返回,具体到账时间可能会有1-3天延迟"; |
| | | msg.add(order.getOrderNo()); |
| | | msg.add(DateUtil.dateToString(shopRefundRecord.getRefundTime(),DateUtil.DATE_FORMAT_SS)); |
| | | msg.add(refundExplain); |
| | | String formId = null; |
| | | if(AppConstance.REFUND_GOODS.equals(shopRefundRecord.getRefundType()) && null != shopRefundRecord.getRefundTransactionNo()){ |
| | | formId = shopRefundRecord.getRefundTransactionNo(); |
| | | }else { |
| | | formId = order.getWxOrderNo().split("=")[1]; |
| | | } |
| | | String page = "pages/refunDetail/refunDetail?id=" + shopRefundRecord.getId() + "&&status=1" + "&&inform=1"; |
| | | int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), |
| | | page, WxTempLateMsgUtil.REFUND_SUCCESS, formId); |
| | | return res; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void updateGroupBuyStatus(Long orderId) { |
| | |
| | | package com.matrix.system.shopXcx.api.tools; |
| | | |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | | import com.matrix.system.shopXcx.api.service.WxShopMemberDayService; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.dao.ShopCouponRecordDao; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import com.matrix.system.shopXcx.api.service.WxShopMemberDayService; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | * @param userId 用户ID |
| | | * @return true = 新人 |
| | | */ |
| | | public boolean verifyIsNewPeople(String userId) { |
| | | public boolean verifyIsNewPeople(Long userId) { |
| | | ShopOrder orderParam = new ShopOrder(); |
| | | orderParam.setPayResult(ShopOrder.ORDER_WX_STATUS_PAY_SUCCESS); |
| | | orderParam.setUserId(userId); |
| | |
| | | package com.matrix.system.shopXcx.api.tools; |
| | | |
| | | import com.matrix.system.common.bean.CustomerDataDictionary; |
| | | import com.matrix.biz.service.BizUserService; |
| | | import com.matrix.component.tools.WxTempLateMsgUtil; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.bean.CustomerDataDictionary; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.shopXcx.api.pojo.ShopOrderDto; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderPostageInfoPOJO; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderItemDto; |
| | | import com.matrix.system.shopXcx.api.pojo.OrderPostageInfoPOJO; |
| | | import com.matrix.system.shopXcx.api.pojo.ShopOrderDto; |
| | | import com.matrix.system.shopXcx.api.service.WxShopMemberDayService; |
| | | import com.matrix.system.shopXcx.bean.*; |
| | | import com.matrix.system.shopXcx.dao.*; |
| | |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author jyy |
| | |
| | | @Autowired |
| | | private WxShopMemberDayService wxShopMemberDayService; |
| | | @Autowired |
| | | private BizUserService bizUserService; |
| | | private SysVipInfoService sysVipInfoService; |
| | | |
| | | |
| | | private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日"); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 发货后给客户发送微信提醒 |
| | | * @param deliveryInfo |
| | | * @return |
| | | */ |
| | | public int deliverSuccessSendWxMsgToUser(ShopDeliveryInfo deliveryInfo) { |
| | | ShopOrder order = shopOrderDao.selectById(deliveryInfo.getOrderId()); |
| | | if (order == null) { |
| | | throw new GlobleException("没有找到需要发货的订单信息"); |
| | | } |
| | | List<String> msg = new ArrayList<>(); |
| | | msg.add(order.getOrderNo()); |
| | | //设置商品名称 |
| | | msg.add(getProductNames(order.getUserId(), order.getId())); |
| | | msg.add(deliveryInfo.getReceiveAddress()); |
| | | msg.add(deliveryInfo.getLogisticsCompany()); |
| | | msg.add(deliveryInfo.getWaybillNo()); |
| | | String formId = order.getWxOrderNo().split("=")[1]; |
| | | String page = "pages/logistics/logistics?inform=1&id=" + order.getId(); |
| | | int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), |
| | | page, WxTempLateMsgUtil.ORDER_DELIVERY, formId); |
| | | return res; |
| | | } |
| | | |
| | | /** |
| | | * 订单付款成功后给客户发送微信提醒 |
| | | * @param order |
| | | * @return |
| | | */ |
| | | public int paySuccessSendWxMsgToUser(ShopOrder order) { |
| | | List<String> msg = new ArrayList<>(); |
| | | msg.add(order.getOrderNo()); |
| | | msg.add(new BigDecimal(order.getOrderMoney().toString()).toString() + "元"); |
| | | msg.add(dateFormat.format(order.getOrderTime())); |
| | | msg.add(getProductNames(order.getUserId(), order.getId())); |
| | | String formId = order.getWxOrderNo().split("=")[1]; |
| | | String page = "pages/orderDetails/orderDetails?inform=1&id=" + order.getId(); |
| | | return WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), page, WxTempLateMsgUtil.ORDER_PAY_SUCCESS, formId); |
| | | } |
| | | |
| | | /** |
| | | * 根据用户ID和订单ID获取所购买商品名称 |
| | | * @param openId 用户openId |
| | | * @param orderId 订单ID |
| | | * @return 所含商品名称(多个以","隔开) |
| | | */ |
| | | public String getProductNames(String openId, Integer orderId) { |
| | | ShopOrder orderDetail = shopOrderDao.selectOrderInfoById(openId, orderId); |
| | | public String getProductNames(Long userId, Integer orderId) { |
| | | ShopOrder orderDetail = shopOrderDao.selectOrderInfoById(userId, orderId); |
| | | List<ShopOrderDetails> details = orderDetail.getDetails(); |
| | | if (CollectionUtils.isEmpty(details)) { |
| | | return ""; |
| | |
| | | /** |
| | | * 团长ID |
| | | */ |
| | | private String gjHeadId; |
| | | private Long gjHeadId; |
| | | |
| | | private String headName; |
| | | |
| | |
| | | this.gjStatus=gjStatus; |
| | | } |
| | | |
| | | public String getGjHeadId() { |
| | | public Long getGjHeadId() { |
| | | return gjHeadId; |
| | | } |
| | | |
| | | public void setGjHeadId(String gjHeadId) { |
| | | public void setGjHeadId(Long gjHeadId) { |
| | | this.gjHeadId = gjHeadId; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 用户Id |
| | | */ |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | public String getUserId() { |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | public void setUserId(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 用户主键 |
| | | */ |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | |
| | | /** |
| | |
| | | this.actId=actId; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | public void setUserId(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 用户主键 |
| | | */ |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | private Long actId; |
| | | |
| | |
| | | this.orderId=orderId; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | public void setUserId(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | public String getUserId() { |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | public void setUserId(Long userId) { |
| | | this.userId=userId; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | |
| | | /** |
| | |
| | | this.orderId=orderId; |
| | | } |
| | | |
| | | |
| | | public String getUserId() { |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | public void setUserId(Long userId) { |
| | | this.userId=userId; |
| | | } |
| | | |
| | | |
| | | public String getOrderNo() { |
| | | return orderNo; |
| | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private String userId; |
| | | private Long userId; |
| | | /** |
| | | * 支付积分 |
| | | */ |
| | |
| | | this.commodityPrice = commodityPrice; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | public void setUserId(Long userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | public String getUserId() { |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | public void setUserId(Long userId) { |
| | | this.userId=userId; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 用户id |
| | | */ |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | public String getUserId() { |
| | | public Long getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | public void setUserId(Long userId) { |
| | | this.userId=userId; |
| | | } |
| | | |
| | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private String cartUserId; |
| | | private Long cartUserId; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | public String getCartUserId() { |
| | | public Long getCartUserId() { |
| | | return cartUserId; |
| | | } |
| | | |
| | | public void setCartUserId(String cartUserId) { |
| | | public void setCartUserId(Long cartUserId) { |
| | | this.cartUserId=cartUserId; |
| | | } |
| | | |
| | |
| | | |
| | | public ShopCouponRecord selectForUpdate(Integer id); |
| | | |
| | | List<CouponReceiveInfoVO> selectMyCouponByUserId(@Param("userId") String userId); |
| | | List<CouponReceiveInfoVO> selectMyCouponByUserId(@Param("userId") Long userId); |
| | | |
| | | CouponReceiveInfoVO selectMyCouponByReceiveId(@Param("receiveId") Integer receiveId); |
| | | |
| | | List<CouponReceiveInfoVO> selectMyCouponByStatus(@Param("companyId") Long shopId, @Param("userId") String userId, @Param("status") Integer status, |
| | | List<CouponReceiveInfoVO> selectMyCouponByStatus(@Param("companyId") Long shopId, @Param("userId") Long userId, @Param("status") Integer status, |
| | | @Param("pageVo") PaginationVO pageVo); |
| | | |
| | | List<CouponReceiveInfoVO> selectMyPastCoupon(@Param("companyId")Long shopId, @Param("userId") String userId, @Param("pageVo") PaginationVO pageVo); |
| | | List<CouponReceiveInfoVO> selectMyPastCoupon(@Param("companyId")Long shopId, @Param("userId") Long userId, @Param("pageVo") PaginationVO pageVo); |
| | | |
| | | } |
| | |
| | | |
| | | public ShopOrder selectForUpdate(Integer id); |
| | | |
| | | List<ShopOrder> selectMyOrderByStatus(@Param("userId") String userId, @Param("params") OrderInfoQueryPOJO orderInfoQueryPOJO); |
| | | List<ShopOrder> selectMyOrderByStatus(@Param("userId") Long userId, @Param("params") OrderInfoQueryPOJO orderInfoQueryPOJO); |
| | | |
| | | ShopOrder selectOrderInfoById(@Param("userId") String userId, @Param("id") Integer id); |
| | | ShopOrder selectOrderInfoById(@Param("userId") Long userId, @Param("id") Integer id); |
| | | |
| | | public ShopOrder selectMyOrderById(Integer id); |
| | | |
| | |
| | | */ |
| | | List<ShopOrder> selectInPageByQueryOfExcel(@Param("record") ShopOrderQueryPOJO orderQuery, @Param("pageVo") PaginationVO pageVo); |
| | | |
| | | /** |
| | | * 根据用户openID查询消费金额 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | Double selectConsumptionSumByUserId(@Param("userId") String userId); |
| | | |
| | | |
| | | public List<ShopOrder> selectOrdersByIds(@Param("shopId") Long shopId,@Param("comId") Long comId, @Param("list") List<String> list); |
| | | |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description 订单表 |
| | |
| | | public interface ShopOrderV2Dao extends BaseMapper<ShopOrder> { |
| | | |
| | | /** 统计已收货订单数 */ |
| | | int selectReceivedOrderCount(String openId); |
| | | int selectReceivedOrderCount(Long userId); |
| | | /** 统计已收货订单金额 */ |
| | | Double countOrderAmount(String openId); |
| | | Double countOrderAmount(Long userId); |
| | | |
| | | /** 统计是否消费过了指定产品 */ |
| | | int countBuyZdcp(@Param("openId") String openId, @Param("productIds")String productIds); |
| | | int countBuyZdcp(@Param("userId") Long userId, @Param("productIds")String productIds); |
| | | |
| | | } |
| | |
| | | |
| | | public ShopShoppingCart selectById(Integer cartId); |
| | | |
| | | public List<ShopShoppingCart> selectByCartUserId(@Param("shopId")Long shopId, @Param("cartUserId") String cartUserId); |
| | | public List<ShopShoppingCart> selectByCartUserId(@Param("shopId")Long shopId, @Param("cartUserId") Long cartUserId); |
| | | |
| | | public ShopShoppingCart selectForUpdate(Integer cartId); |
| | | |
| | | public ShopShoppingCart selectBuyLimit(@Param("cartProductId") Integer cartProductId,@Param("cartSkuId") Integer cartSkuId); |
| | | |
| | | public Integer selectUserCartCount(@Param("shopId")Long shopId, @Param("openId")String openId); |
| | | public Integer selectUserCartCount(@Param("shopId")Long shopId, @Param("userId")Long userId); |
| | | |
| | | public int updateAllSelected(@Param("openId") String openId, @Param("shopId") Long shopId, @Param("isSelected") Integer isSelected); |
| | | |
| | |
| | | package com.matrix.system.shopXcx.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | public class CreateGroupBuyDTO { |
| | | |
| | | /** |
| | |
| | | |
| | | private BigDecimal price; |
| | | |
| | | private String openId; |
| | | private Long userId; |
| | | |
| | | private int goodsId; |
| | | |
| | | public String getOpenId() { |
| | | return openId; |
| | | } |
| | | |
| | | public void setOpenId(String openId) { |
| | | this.openId = openId; |
| | | } |
| | | |
| | | public int getGoodsId() { |
| | | return goodsId; |
| | | } |
| | | |
| | | public void setGoodsId(int goodsId) { |
| | | this.goodsId = goodsId; |
| | | } |
| | | |
| | | public BigDecimal getPrice() { |
| | | return price; |
| | | } |
| | | |
| | | public void setPrice(BigDecimal price) { |
| | | this.price = price; |
| | | } |
| | | |
| | | public int getJoinType() { |
| | | return joinType; |
| | | } |
| | | |
| | | public void setJoinType(int joinType) { |
| | | this.joinType = joinType; |
| | | } |
| | | |
| | | public Long getGpId() { |
| | | return gpId; |
| | | } |
| | | |
| | | public void setGpId(Long gpId) { |
| | | this.gpId = gpId; |
| | | } |
| | | |
| | | public Long getActId() { |
| | | return actId; |
| | | } |
| | | |
| | | public void setActId(Long actId) { |
| | | this.actId = actId; |
| | | } |
| | | |
| | | public Integer getAddressId() { |
| | | return addressId; |
| | | } |
| | | |
| | | public void setAddressId(Integer addressId) { |
| | | this.addressId = addressId; |
| | | } |
| | | |
| | | public Long getShopId() { |
| | | return shopId; |
| | | } |
| | | |
| | | public void setShopId(Long shopId) { |
| | | this.shopId = shopId; |
| | | } |
| | | |
| | | public String getShippingMethod() { |
| | | return shippingMethod; |
| | | } |
| | | |
| | | public void setShippingMethod(String shippingMethod) { |
| | | this.shippingMethod = shippingMethod; |
| | | } |
| | | |
| | | public Long getGjId() { |
| | | return gjId; |
| | | } |
| | | |
| | | public void setGjId(Long gjId) { |
| | | this.gjId = gjId; |
| | | } |
| | | |
| | | public Integer getSkuId() { |
| | | return skuId; |
| | | } |
| | | |
| | | public void setSkuId(Integer skuId) { |
| | | this.skuId = skuId; |
| | | } |
| | | |
| | | public Integer getCount() { |
| | | return count; |
| | | } |
| | | |
| | | public void setCount(Integer count) { |
| | | this.count = count; |
| | | } |
| | | |
| | | public String getRemarks() { |
| | | return remarks; |
| | | } |
| | | |
| | | public void setRemarks(String remarks) { |
| | | this.remarks = remarks; |
| | | } |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.mqTask; |
| | | |
| | | |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.service.BizUserService; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao; |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.service.CodeService; |
| | | import com.matrix.system.hive.service.ShoppingGoodsService; |
| | | import com.matrix.system.hive.service.SysOrderService; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.bean.ShopOrderDetails; |
| | | import com.matrix.system.shopXcx.bean.ShopSku; |
| | |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import com.rabbitmq.client.DeliverCallback; |
| | | import com.rabbitmq.client.Delivery; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | ShopOrderDetailsDao shopOrderDetailsDao; |
| | | |
| | | @Autowired |
| | | BizUserService bizUserService; |
| | | SysVipInfoService sysVipInfoService; |
| | | |
| | | |
| | | @Autowired |
| | |
| | | } |
| | | if(needTb){ |
| | | |
| | | BizUser bizUser = bizUserService.findByOpenId(orderDto.getUserId()); |
| | | SysVipInfo vipInfo = sysVipInfoService.findById(orderDto.getUserId()); |
| | | SysOrder order = new SysOrder(); |
| | | //TODO 根据公司id区分 |
| | | SysVipInfo vipInfo = vipDao.selectByPhone(bizUser.getPhoneNumber()); |
| | | if(SysVipInfo.UNDEAL_VIP==vipInfo.getIsDeal()){ |
| | | //非成交客户下单更新客户为成交客户 |
| | | vipInfo.setIsDeal(SysVipInfo.DEAL_VIP); |
| | |
| | | //如果是积分支付则需要返还积分 |
| | | if(order.getScorePay()!=null && order.getScorePay()>0){ |
| | | LogUtil.debug("处理积分退款={}", orderId); |
| | | scoreVipDetailService.refundScore(order.getUserId(),null,order.getScorePay(),Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH); |
| | | scoreVipDetailService.refundScore(order.getUserId(),order.getScorePay(),Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH); |
| | | } |
| | | |
| | | //消费获得积分返还,如果本订单获得了积分则要扣除获得积分 |
| | | scoreVipDetailService.removeByBusinessId(order.getUserId(),null,Long.parseLong(order.getId()+"")); |
| | | scoreVipDetailService.removeByBusinessId(order.getUserId(),Long.parseLong(order.getId()+"")); |
| | | |
| | | |
| | | } |
| | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.service.BizUserService; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | 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.fenxiao.constant.FenxiaoSettingConstant; |
| | |
| | | import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanOrder; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysOrderDao; |
| | | import com.matrix.system.hive.dao.SysOrderItemDao; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.hive.service.CodeService; |
| | | import com.matrix.system.hive.service.ShoppingGoodsService; |
| | | import com.matrix.system.hive.service.SysOrderService; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.bean.ShopOrderDetails; |
| | | import com.matrix.system.shopXcx.bean.ShopProduct; |
| | |
| | | ShopOrderDetailsDao shopOrderDetailsDao; |
| | | |
| | | @Autowired |
| | | BizUserService bizUserService; |
| | | SysVipInfoService sysVipInfoService; |
| | | |
| | | |
| | | @Autowired |
| | |
| | | @Transactional |
| | | void handleExtensionOrder(ShopOrder order) { |
| | | //判读客户是否存在上级,存在则产生上级的收益 |
| | | BizUser bizUser = bizUserService.findByOpenId(order.getUserId()); |
| | | LogUtil.debug("处理分销订单userOpid={}",bizUser.getOpenId()); |
| | | SysVipInfo sysVipInfo = sysVipInfoService.findById(order.getUserId()); |
| | | LogUtil.debug("处理分销订单userOpid={}",sysVipInfo.getOpenId()); |
| | | //判断是否重复生成 |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("order_id",order.getId()); |
| | |
| | | } |
| | | } |
| | | //自购返佣 |
| | | Integer isSales = bizUser.getIsSales(); |
| | | if(BizUser.IS_SALES == isSales){ |
| | | Integer isSales = sysVipInfo.getIsSales(); |
| | | if(SysVipInfo.IS_SALES == isSales){ |
| | | for (ShopOrderDetails item:order.getDetails() ){ |
| | | if(item.getShopProduct().getAbleSales()==ShopProduct.ABLE_SALES){ |
| | | //分销规则是否开启自购返佣 |
| | | BusParameterSettings zgfy = parameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_ZGFY, bizUser.getCompanyId()); |
| | | BusParameterSettings zgfy = parameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_ZGFY, sysVipInfo.getCompanyId()); |
| | | //按分销等级计算 |
| | | ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(bizUser.getSalesmanGrade()); |
| | | ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(sysVipInfo.getSalesmanGrade()); |
| | | if(ObjectUtil.isNotEmpty(zgfy)) { |
| | | //获取商品的自购返佣价格,如果没有设置,在去获取当前推广人的等级的自购返佣比例 |
| | | if(StrUtil.isNotEmpty(zgfy.getParamValue()) && |
| | |
| | | } |
| | | |
| | | //存在上级 |
| | | if(StringUtils.isNotBlank(bizUser.getParentOpenId())) { |
| | | BizUser salesMan=bizUserService.findByOpenId(bizUser.getParentOpenId()); |
| | | if(sysVipInfo.getRecommendId()!=null) { |
| | | SysVipInfo salesMan=sysVipInfoService.findById(sysVipInfo.getRecommendId()); |
| | | Double salesAmount=0D; |
| | | Double invitationAmount=0D; |
| | | BizUser invitationMan=null; |
| | | SysVipInfo invitationMan=null; |
| | | ShopSalesmanOrder invitationOrder=null; |
| | | boolean hasInvitationMan=StringUtils.isNotBlank(salesMan.getParentOpenId()); |
| | | boolean hasInvitationMan=salesMan.getRecommendId()!=null; |
| | | //判断推广员是否还存在上级,存在则计算邀请收益 |
| | | if(hasInvitationMan){ |
| | | invitationMan=bizUserService.findByOpenId(salesMan.getParentOpenId()); |
| | | invitationMan=sysVipInfoService.findById(salesMan.getRecommendId()); |
| | | invitationOrder=new ShopSalesmanOrder(); |
| | | BeanUtils.copyProperties(salesmanOrder,invitationOrder); |
| | | invitationOrder.setSalesUserId(invitationMan.getOpenId()); |
| | | invitationOrder.setSalesUserId(invitationMan.getId()); |
| | | invitationOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_INVITATION); |
| | | } |
| | | //收益计算 |
| | |
| | | zk=order.getOrderMoney().doubleValue()/orderTotal; |
| | | salesAmount=salesAmount*zk; |
| | | salesmanOrder.setAmount(salesAmount); |
| | | salesmanOrder.setSalesUserId(bizUser.getParentOpenId()); |
| | | salesmanOrder.setSalesUserId(sysVipInfo.getRecommendId()); |
| | | shopSalesmanOrderDao.insert(salesmanOrder); |
| | | } |
| | | //邀请提成记录 |
| | |
| | | shopSalesmanOrderDao.insert(invitationOrder); |
| | | } |
| | | }else{ |
| | | LogUtil.debug("不存在父级userOpid={}",bizUser.getOpenId()); |
| | | LogUtil.debug("不存在父级userOpid={}",sysVipInfo.getOpenId()); |
| | | } |
| | | }else{ |
| | | LogUtil.debug("重复订单id={}",order.getId()); |
| | |
| | | package com.matrix.system.shopXcx.mqTask; |
| | | |
| | | |
| | | import com.matrix.biz.service.BizUserService; |
| | | 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.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 org.springframework.stereotype.Component; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | ShopOrderDetailsDao shopOrderDetailsDao; |
| | | |
| | | @Autowired |
| | | BizUserService bizUserService; |
| | | SysVipInfoService sysVipInfoService; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | |
| | | |
| | |
| | | order.setDetails(orderDetails); |
| | | //扣除积分 |
| | | if(order.getScorePay()!=null&&order.getScorePay()>0){ |
| | | scoreVipDetailService.deductionScore(order.getUserId(),null,null,Long.parseLong(order.getStoreId()+""),order.getScorePay(),Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH,"商城积分抵扣"); |
| | | scoreVipDetailService.deductionScore(order.getUserId(),null, |
| | | Long.parseLong(order.getStoreId()+""),order.getScorePay(), |
| | | Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH,"商城积分抵扣"); |
| | | }else{ |
| | | |
| | | //消费获得积分 |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(addScore>0){ |
| | | //插入新的积分 |
| | | scoreVipDetailService.addScore( |
| | | order.getUserId(),null, |
| | | order.getUserId(), |
| | | null, |
| | | Long.parseLong(order.getStoreId()+""), |
| | | addScore, |
| | |
| | | package com.matrix.system.shopXcx.quartz; |
| | | |
| | | import com.matrix.component.tools.WxUtils; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService; |
| | | import com.matrix.system.shopXcx.bean.*; |
| | | import com.matrix.system.shopXcx.dao.*; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | |
| | | if (joinUser.getIsHasPay() == ShopActivitiesGroupJoinUser.IS_HAS_PAY_Y) { |
| | | LogUtil.info("#已付款退款逻辑#"); |
| | | ShopRefundRecord refundRecord = new ShopRefundRecord(); |
| | | refundRecord.setCreateBy(joinUser.getUserId()); |
| | | refundRecord.setUpdateBy(joinUser.getUserId()); |
| | | refundRecord.setCreateBy(MatrixConstance.SYSTEM_USER); |
| | | refundRecord.setUpdateBy(MatrixConstance.SYSTEM_USER); |
| | | refundRecord.setUserId(joinUser.getUserId()); |
| | | refundRecord.setRefundNo(WxUtils.getOrderNum()); |
| | | refundRecord.setOrderId(joinUser.getOrderId().intValue()); |
| | |
| | | |
| | | |
| | | @ApiModelProperty(value = "手机号码") |
| | | private String phoneNumber; |
| | | private String phone; |
| | | |
| | | @ApiModelProperty(value = "贡献订单数") |
| | | private String orderCount; |
| | |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.service.BizUserService; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.component.tools.HttpClientUtil; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | |
| | | package com.matrix.system.wechart.templateMsg.Task.messageBulderDemo; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.dao.BizUserDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.hive.bean.SysBeauticianState; |
| | |
| | | ALTER TABLE `shop_salesman_grade` |
| | | DROP COLUMN `self_commission`, |
| | | ADD COLUMN `self_commission` double(20,2) NULL COMMENT '自购返佣比例%' AFTER `company_id`; |
| | | |
| | | |
| | | |
| | | ALTER TABLE `sys_vip_info` |
| | | ADD COLUMN `fenxiao_state` int(11) NULL DEFAULT NULL COMMENT '分销审核状态' AFTER `recommend_id`, |
| | | ADD COLUMN `withdrawal_cash` double(20, 2) NULL DEFAULT NULL COMMENT '可提现金额' AFTER `fenxiao_state`, |
| | | ADD COLUMN `salesman_grade` bigint(20) NULL DEFAULT NULL COMMENT '推广员等级' AFTER `withdrawal_cash`, |
| | | ADD COLUMN `is_sales` int(1) NULL DEFAULT NULL AFTER `salesman_grade`, |
| | | ADD COLUMN `user_is_authorize` datetime(0) NULL DEFAULT NULL AFTER `is_sales`, |
| | | ADD COLUMN `binding_parent_time` datetime(0) NULL DEFAULT NULL AFTER `user_is_authorize`, |
| | | ADD COLUMN `country` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `binding_parent_time`, |
| | | ADD COLUMN `gender` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `country`, |
| | | ADD COLUMN `nick_name` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `gender`, |
| | | ADD COLUMN `avatar_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `nick_name`; |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.matrix.system.activity.dao.ActivitySignReceiveRecordDao"> |
| | | <!-- 定义ActivitySignReceiveRecord 的复杂关联map --> |
| | | <resultMap type="com.matrix.system.activity.entity.ActivitySignReceiveRecord" id="ActivitySignReceiveRecordMap"> |
| | | <id property="id" column="id" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="openId" column="open_id" /> |
| | | <result property="receiveTime" column="receive_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="awardId" column="award_id" /> |
| | | <result property="state" column="state" /> |
| | | <result property="writeOffCode" column="write_off_code" /> |
| | | <result property="activityId" column="activity_id" /> |
| | | <result property="companyId" column="company_id" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <!-- 定义ActivitySignReceiveRecord 的简单map ,本map不添加其他的关联属性 --> |
| | | <resultMap type="com.matrix.system.activity.entity.ActivitySignReceiveRecord" id="ActivitySignReceiveRecordSimpleMap"> |
| | | <id property="id" column="id" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="openId" column="open_id" /> |
| | | <result property="receiveTime" column="receive_time" /> |
| | | <result property="remark" column="remark" /> |
| | | <result property="awardId" column="award_id" /> |
| | | <result property="state" column="state" /> |
| | | <result property="writeOffCode" column="write_off_code" /> |
| | | <result property="activityId" column="activity_id" /> |
| | | <result property="companyId" column="company_id" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.matrix.system.activity.dao.ActivitySignRecordDao"> |
| | | <!-- 定义ActivitySignRecord 的复杂关联map --> |
| | | <resultMap type="com.matrix.system.activity.entity.ActivitySignRecord" id="ActivitySignRecordMap"> |
| | | <id property="id" column="id" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="openId" column="open_id" /> |
| | | <result property="signTime" column="sign_time" /> |
| | | <result property="cumulativeDay" column="cumulative_day" /> |
| | | <result property="activityId" column="activity_id" /> |
| | | <result property="companyId" column="company_id" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <!-- 定义ActivitySignRecord 的简单map ,本map不添加其他的关联属性 --> |
| | | <resultMap type="com.matrix.system.activity.entity.ActivitySignRecord" id="ActivitySignRecordSimpleMap"> |
| | | <id property="id" column="id" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="openId" column="open_id" /> |
| | | <result property="signTime" column="sign_time" /> |
| | | <result property="cumulativeDay" column="cumulative_day" /> |
| | | <result property="activityId" column="activity_id" /> |
| | | <result property="companyId" column="company_id" /> |
| | | </resultMap> |
| | | |
| | | </mapper> |
| | |
| | | SELECT |
| | | a.nick_name, |
| | | a.avatar_url, |
| | | a.phone_number, |
| | | a.phone, |
| | | ( |
| | | SELECT |
| | | IFNULL(sum(IFNULL( b.amount, 0 )),0) |
| | | FROM |
| | | shop_salesman_order b |
| | | WHERE |
| | | b.user_id = a.open_id |
| | | b.user_id = a.id |
| | | and order_status=2 |
| | | AND b.sales_user_id = #{openId} |
| | | AND b.sales_user_id = #{userId} |
| | | |
| | | ) AS revenueAmount, |
| | | ( SELECT count( * ) FROM shop_salesman_order c WHERE c.user_id = a.open_id AND c.sales_user_id = #{openId} ) AS orderCount |
| | | ( SELECT count( * ) FROM shop_salesman_order c WHERE c.user_id = a.id AND c.sales_user_id = #{userId} ) AS orderCount |
| | | FROM |
| | | biz_user a |
| | | sys_vip_info a |
| | | WHERE |
| | | a.parent_open_id = #{openId} |
| | | a.recommend_id = #{userId} |
| | | AND a.is_sales = #{isSales} |
| | | </select> |
| | | |
| | |
| | | a.user_id userId, |
| | | b.avatar_url avatarUrl, |
| | | b.nick_name nickname, |
| | | (SELECT s.nick_name FROM biz_user s |
| | | WHERE s.open_id = a.parent_user_id ) parentUser, |
| | | (SELECT s.nick_name FROM sys_vip_info s |
| | | WHERE s.id = a.parent_user_id ) parentUser, |
| | | c.nick_name parentUserNow, |
| | | ( SELECT COUNT(*) FROM biz_user |
| | | WHERE parent_open_id = a.user_id AND is_sales != 1 ) lowerLevelNum, |
| | | ( SELECT COUNT(*) FROM biz_user |
| | | WHERE parent_open_id = a.user_id AND is_sales = 1 ) invitedNum, |
| | | ( SELECT COUNT(*) FROM sys_vip_info |
| | | WHERE recommend_id = a.user_id AND is_sales != 1 ) lowerLevelNum, |
| | | ( SELECT COUNT(*) FROM sys_vip_info |
| | | WHERE recommend_id = a.user_id AND is_sales = 1 ) invitedNum, |
| | | ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order |
| | | WHERE order_status = 2 AND sales_user_id = a.user_id ) totalRevenue, |
| | | ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order |
| | |
| | | a.apply_way applyWay |
| | | FROM |
| | | shop_salesman_apply a |
| | | LEFT JOIN biz_user b ON a.user_id = b.open_id |
| | | LEFT JOIN sys_vip_info b ON a.user_id = b.id |
| | | LEFT JOIN shop_salesman_grade g ON a.grade_id = g.id |
| | | LEFT JOIN biz_user c ON c.open_id = b.parent_open_id |
| | | LEFT JOIN sys_vip_info c ON c.id = b.recommend_id |
| | | <where> |
| | | a.company_id=#{record.companyId} |
| | | <if test="record.shenheState != null and record.shenheState != ''"> |
| | |
| | | b.nick_name nickName |
| | | FROM |
| | | shop_salesman_apply a |
| | | LEFT JOIN biz_user b ON a.user_id = b.user_id |
| | | LEFT JOIN sys_vip_info b ON a.user_id = b.id |
| | | <where> |
| | | a.company_id = #{record.companyId} |
| | | and a.apply_status = #{record.applyStatus} |
| | |
| | | </select> |
| | | <select id="selectBizUserApplyList" resultType="com.matrix.system.fenxiao.vo.ShopSalesmanAppliingVo"> |
| | | SELECT |
| | | a.user_id userId, |
| | | a.open_id openId, |
| | | a.id userId, |
| | | a.nick_name nickName, |
| | | a.avatar_url avatarUrl, |
| | | a.create_time createTime, |
| | | a.phone_number phone |
| | | a.phone |
| | | FROM |
| | | biz_user a |
| | | sys_vip_info a |
| | | <where> |
| | | a.company_id = #{record.companyId} |
| | | and a.is_sales != 1 |
| | |
| | | |
| | | ( SELECT count( * ) FROM shop_salesman_order c WHERE c.sales_user_id = #{openId} and revenue_type =1 ) AS salesorderCount, |
| | | ( SELECT count( * ) FROM shop_salesman_order c WHERE c.sales_user_id = #{openId} and revenue_type =2 ) AS invitationOrderCount, |
| | | (select count(*) from biz_user where parent_open_id=#{openId} and is_sales=1) as invitationCount, |
| | | (select count(*) from biz_user where parent_open_id=#{openId} and is_sales=2) as customerCount |
| | | from biz_user a where |
| | | a.open_id=#{openId} |
| | | (select count(*) from sys_vip_info where recommend_id=#{openId} and is_sales=1) as invitationCount, |
| | | (select count(*) from sys_vip_info where recommend_id=#{openId} and is_sales=2) as customerCount |
| | | from sys_vip_info a where |
| | | a.id=#{id} |
| | | |
| | | </select> |
| | | |
| | |
| | | b.avatar_url avatarUrl, |
| | | b.nick_name nickname, |
| | | g.NAME grade, |
| | | b.phone_number phone, |
| | | (SELECT s.nick_name FROM biz_user s |
| | | WHERE s.open_id = a.parent_user_id ) parentUser, |
| | | ( SELECT COUNT(*) FROM biz_user |
| | | WHERE parent_open_id = a.user_id AND is_sales != 1 ) lowerLevelNum, |
| | | ( SELECT COUNT(*) FROM biz_user |
| | | WHERE parent_open_id = a.user_id AND is_sales = 1 ) invitedNum, |
| | | b.phone, |
| | | (SELECT s.nick_name FROM sys_vip_info s |
| | | WHERE s.id = a.parent_user_id ) parentUser, |
| | | ( SELECT COUNT(*) FROM sys_vip_info |
| | | WHERE recommend_id = a.user_id AND is_sales != 1 ) lowerLevelNum, |
| | | ( SELECT COUNT(*) FROM sys_vip_info |
| | | WHERE recommend_id = a.user_id AND is_sales = 1 ) invitedNum, |
| | | ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order |
| | | WHERE order_status = 2 AND sales_user_id = a.user_id ) totalRevenue, |
| | | ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order |
| | |
| | | a.apply_way applyWay |
| | | FROM |
| | | shop_salesman_apply a |
| | | LEFT JOIN biz_user b ON a.user_id = b.open_id |
| | | LEFT JOIN sys_vip_info b ON a.user_id = b.id |
| | | LEFT JOIN shop_salesman_grade g ON a.grade_id = g.id |
| | | where a.id = #{applyId} |
| | | </select> |
| | | |
| | | <select id="findCustomDetail" resultType="com.matrix.system.fenxiao.vo.ShopCustomDetailVo"> |
| | | SELECT |
| | | b.open_id userId, |
| | | b.id userId, |
| | | b.avatar_url avatarUrl, |
| | | b.nick_name nickname, |
| | | b.binding_parent_time createTime, |
| | | (select COUNT(*) from shop_salesman_order c where c.order_status = 1 and c.sales_user_id = b.open_id) doneNum |
| | | FROM biz_user b |
| | | (select COUNT(*) from shop_salesman_order c where c.order_status = 1 and c.sales_user_id = b.id) doneNum |
| | | FROM sys_vip_info b |
| | | <where> |
| | | b.company_id = #{record.companyId} |
| | | AND b.is_sales != 1 |
| | | and b.parent_open_id = #{record.userId} |
| | | and b.recommend_id = #{record.userId} |
| | | <if test="record.userName != null and record.userName != ''"> |
| | | and b.nick_name like concat('%',#{record.userName},'%') |
| | | </if> |
| | |
| | | </select> |
| | | <select id="findCustomLow" resultType="com.matrix.system.fenxiao.vo.ShopCustomDetailVo"> |
| | | SELECT |
| | | b.open_id userId, |
| | | b.id userId, |
| | | b.avatar_url avatarUrl, |
| | | b.nick_name nickname, |
| | | a.create_time createTime, |
| | | a.apply_way applyWay |
| | | FROM |
| | | shop_salesman_apply a |
| | | LEFT JOIN biz_user b ON b.open_id = a.user_id |
| | | LEFT JOIN sys_vip_info b ON b.id = a.user_id |
| | | <where> |
| | | a.company_id = #{record.companyId} |
| | | AND b.is_sales = 1 |
| | | and b.parent_open_id = #{record.userId} |
| | | and b.recommend_id = #{record.userId} |
| | | and a.apply_status = 2 |
| | | <if test="record.userName != null and record.userName != ''"> |
| | | and b.nick_name like concat('%',#{record.userName},'%') |
| | |
| | | c.order_status orderState, |
| | | f.shop_name storeName |
| | | from shop_salesman_order a |
| | | left join biz_user b on b.open_id=a.user_id |
| | | left join sys_vip_info b on b.id=a.user_id |
| | | left join shop_order c on a.order_id=c.id |
| | | LEFT JOIN sys_shop_info f on f.id = c.store_id |
| | | <where> |
| | |
| | | c.order_no, |
| | | c.order_money |
| | | from shop_salesman_order a |
| | | left join biz_user b on b.open_id=a.user_id |
| | | left join sys_vip_info b on b.id=a.user_id |
| | | left join shop_order c on a.order_id=c.id |
| | | where |
| | | a.sales_user_id=#{record.userId} |
| | |
| | | f.shop_name address, |
| | | d.order_status orderState, |
| | | b.nick_name custom, |
| | | b.open_id customUserId, |
| | | b.id customUserId, |
| | | e.nick_name parentSale, |
| | | a.revenue_type profitType, |
| | | a.amount profitBalance, |
| | |
| | | g.su_name settler |
| | | FROM |
| | | shop_salesman_order a |
| | | LEFT JOIN biz_user b on a.user_id = b.open_id |
| | | LEFT JOIN sys_vip_info b on a.user_id = b.id |
| | | LEFT JOIN shop_saleman_settlement c on a.settlement_id = c.id |
| | | LEFT JOIN shop_order d on d.id = a.order_id |
| | | LEFT JOIN biz_user e on a.sales_user_id = e.open_id |
| | | LEFT JOIN sys_vip_info e on a.sales_user_id = e.id |
| | | LEFT JOIN sys_shop_info f on f.id = d.store_id |
| | | LEFT JOIN sys_users g on c.user_id = g.su_id |
| | | <where> |
| | |
| | | <result property="staffId" column="staff_id" /> |
| | | <result property="vipName" column="vip_name" /> |
| | | <result property="tel" column="tel" /> |
| | | <result property="bizUserId" column="biz_user_id" /> |
| | | <result property="bizUserId" column="sys_vip_info_id" /> |
| | | <result property="formId" column="form_id" /> |
| | | |
| | | <result property="productId" column="product_id" /> |
| | |
| | | <result property="staffId" column="staff_id" /> |
| | | <result property="vipName" column="vip_name" /> |
| | | <result property="tel" column="tel" /> |
| | | <result property="bizUserId" column="biz_user_id" /> |
| | | <result property="bizUserId" column="sys_vip_info_id" /> |
| | | <result property="productId" column="product_id" /> |
| | | <result property="orderNo" column="order_no" /> |
| | | <result property="formId" column="form_id" /> |
| | |
| | | staff_id, |
| | | vip_name, |
| | | tel, |
| | | biz_user_id, |
| | | sys_vip_info_id, |
| | | product_id, |
| | | order_no, |
| | | form_id |
| | |
| | | tel = #{tel}, |
| | | </if> |
| | | <if test="(bizUserId!=null and bizUserId!='') or (bizUserId!='' and bizUserId==0)"> |
| | | biz_user_id = #{bizUserId}, |
| | | sys_vip_info_id = #{bizUserId}, |
| | | </if> |
| | | <if test="(productId!=null and productId!='') or (productId!='' and productId==0)"> |
| | | product_id = #{productId}, |
| | |
| | | staff_id, |
| | | vip_name, |
| | | tel, |
| | | biz_user_id, |
| | | sys_vip_info_id, |
| | | product_id, |
| | | order_no, |
| | | form_id, |
| | |
| | | staff_id, |
| | | vip_name, |
| | | tel, |
| | | biz_user_id, |
| | | sys_vip_info_id, |
| | | product_id |
| | | from onlinebooking |
| | | where 1=1 |
| | |
| | | staff_id, |
| | | vip_name, |
| | | tel, |
| | | biz_user_id, |
| | | sys_vip_info_id, |
| | | product_id, |
| | | order_no |
| | | from onlinebooking |
| | |
| | | staff_id, |
| | | vip_name, |
| | | tel, |
| | | biz_user_id, |
| | | sys_vip_info_id, |
| | | product_id |
| | | from onlinebooking |
| | | where 1=1 |
| | |
| | | staff_id, |
| | | vip_name, |
| | | tel, |
| | | biz_user_id, |
| | | sys_vip_info_id, |
| | | product_id, |
| | | order_no |
| | | from onlinebooking |
| | |
| | | staff_id, |
| | | vip_name, |
| | | tel, |
| | | biz_user_id, |
| | | sys_vip_info_id, |
| | | product_id, |
| | | order_no, |
| | | form_id, |
| | |
| | | and vip_Id = #{record.vipId} |
| | | </if> |
| | | <if test="(record.bizUserId!=null and record.bizUserId!='') or (record.bizUserId!='' and record.bizUserId==0)"> |
| | | and biz_user_id = #{record.bizUserId} |
| | | and sys_vip_info_id = #{record.bizUserId} |
| | | </if> |
| | | <if test="(record.time!=null and record.time!='') or (record.time!='' and record.time==0)"> |
| | | and time = #{record.time} |
| | |
| | | and vip_Id = #{record.vipId} |
| | | </if> |
| | | <if test="(record.bizUserId!=null and record.bizUserId!='') or (record.bizUserId!='' and record.bizUserId==0)"> |
| | | and biz_user_id = #{record.bizUserId} |
| | | and sys_vip_info_id = #{record.bizUserId} |
| | | </if> |
| | | <if test="(record.time!=null and record.time!='') or (record.time!='' and record.time==0)"> |
| | | and time = #{record.time} |
| | |
| | | <result property="isDeal" column="is_deal"/> |
| | | <result property="createDistributionTime" column="create_distribution_time"/> |
| | | |
| | | <result property="isSales" column="is_sales" /> |
| | | <result property="withdrawalCash" column="withdrawal_cash" /> |
| | | <result property="salesmanGrade" column="salesman_grade" /> |
| | | <result property="nickName" column="nick_name" /> |
| | | <result property="avatarUrl" column="avatar_url" /> |
| | | <result property="gender" column="gender" /> |
| | | <result property="country" column="country" /> |
| | | <result property="sessionKey" column="session_key" /> |
| | | <result property="userIsAuthorize" column="user_is_authorize" /> |
| | | |
| | | <!-- 扩展属性 --> |
| | | <result property="staffName" column="STAFF_NAME"/> |
| | |
| | | <result property="createDistributionTime" column="create_distribution_time"/> |
| | | <result property="disease" column="disease"/> |
| | | <result property="companyId" column="company_id"/> |
| | | |
| | | <result property="isSales" column="is_sales" /> |
| | | <result property="withdrawalCash" column="withdrawal_cash" /> |
| | | <result property="salesmanGrade" column="salesman_grade" /> |
| | | <result property="nickName" column="nick_name" /> |
| | | <result property="avatarUrl" column="avatar_url" /> |
| | | <result property="gender" column="gender" /> |
| | | <result property="country" column="country" /> |
| | | <result property="sessionKey" column="session_key" /> |
| | | <result property="userIsAuthorize" column="user_is_authorize" /> |
| | | |
| | | <!-- 扩展属性 --> |
| | | <result property="staffName" column="STAFF_NAME"/> |
| | | <result property="shopName" column="SHOP_NAME"/> |
| | |
| | | province, |
| | | city, |
| | | area, |
| | | recommend_id |
| | | recommend_id, |
| | | is_sales, |
| | | withdrawal_cash, |
| | | salesman_grade, |
| | | nick_name, |
| | | avatar_url, |
| | | gender, |
| | | country, |
| | | session_key, |
| | | user_is_authorize |
| | | ) |
| | | |
| | | |
| | |
| | | #{province}, |
| | | #{city}, |
| | | #{area}, |
| | | #{recommendId} |
| | | #{recommendId}, |
| | | #{isSales}, |
| | | #{withdrawalCash}, |
| | | #{salesmanGrade}, |
| | | #{nickName}, |
| | | #{avatarUrl}, |
| | | #{gender}, |
| | | #{country}, |
| | | #{sessionKey}, |
| | | #{userIsAuthorize} |
| | | ) |
| | | |
| | | </insert> |
| | |
| | | <if test="area != null and area !='' "> |
| | | area = #{area}, |
| | | </if> |
| | | <if test="isSales != null "> |
| | | is_sales = #{isSales}, |
| | | </if> |
| | | <if test="withdrawalCash != null "> |
| | | withdrawal_cash = #{withdrawalCash}, |
| | | </if> |
| | | <if test="salesmanGrade != null "> |
| | | salesman_grade = #{salesmanGrade}, |
| | | </if> |
| | | |
| | | <if test="gender != null and gender != '' "> |
| | | gender = #{gender}, |
| | | </if> |
| | | <if test="country != null and country != '' "> |
| | | country = #{country}, |
| | | </if> |
| | | <if test="sessionKey != null and sessionKey != '' "> |
| | | session_key = #{sessionKey}, |
| | | </if> |
| | | <if test="userIsAuthorize != null "> |
| | | user_is_authorize = #{userIsAuthorize}, |
| | | </if> |
| | | <if test="nickName != null and nickName != '' "> |
| | | nick_name = #{nickName}, |
| | | </if> |
| | | <if test="avatarUrl != null and avatarUrl != '' "> |
| | | avatar_url = #{avatarUrl}, |
| | | </if> |
| | | |
| | | |
| | | </set> |
| | |
| | | <!-- 积分清空 --> |
| | | <update id="pointClose"> |
| | | UPDATE sys_vip_info set POINT_ALL = 0 |
| | | </update> |
| | | |
| | | <update id="unbundlingSaleMan"> |
| | | UPDATE sys_vip_info set recommend_id = NULL where id=#{userId}; |
| | | </update> |
| | | |
| | | <!-- 批量删除 --> |
| | |
| | | where a.ID=#{id} |
| | | </select> |
| | | |
| | | |
| | | <select id="findByOpenId" resultMap="SysVipInfoMap"> |
| | | select * |
| | | from sys_vip_info where openid=#{openId} |
| | | </select> |
| | | |
| | | <!-- 根据手机和密码查询 --> |
| | | <select id="selectVipByPhonePassWord" resultMap="SysVipInfoMap"> |
| | |
| | | <if test="(record.companyId!=null and record.companyId!='') "> |
| | | and a.company_id = #{record.companyId} |
| | | </if> |
| | | |
| | | <if test="(record.nickName!=null and record.nickName!='') or (record.nickName!='' and record.nickName==0) "> |
| | | and a.nick_name like concat('%',#{record.nickName},'%') |
| | | </if> |
| | | <if test="(record.avatarUrl!=null and record.avatarUrl!='') or (record.avatarUrl!='' and record.avatarUrl==0) "> |
| | | and a.avatar_url = #{record.avatarUrl} |
| | | </if> |
| | | <if test="record.isSales != null and record.isSales !='' "> |
| | | and a.is_sales = #{record.isSales} |
| | | </if> |
| | | |
| | | <if test="record.withdrawalCash != null and record.withdrawalCash !='' "> |
| | | and a.withdrawal_cash = #{record.withdrawalCash} |
| | | </if> |
| | | |
| | | <if test="record.salesmanGrade != null and record.salesmanGrade !='' "> |
| | | and a.salesman_grade = #{record.salesmanGrade} |
| | | </if> |
| | | <if test="(record.userIsAuthorize!=null and record.userIsAuthorize!='') or (record.userIsAuthorize!='' and record.userIsAuthorize==0) "> |
| | | and a.user_is_authorize = #{record.userIsAuthorize} |
| | | </if> |
| | | |
| | | </if> |
| | | </sql> |
| | | |
| | |
| | | <if test="record.isDeal != null and record.isDeal !='' "> |
| | | and a.is_deal = #{record.isDeal} |
| | | </if> |
| | | <if test="(record.nickName!=null and record.nickName!='') or (record.nickName!='' and record.nickName==0) "> |
| | | and a.nick_name like concat('%',#{record.nickName},'%') |
| | | </if> |
| | | <if test="(record.avatarUrl!=null and record.avatarUrl!='') or (record.avatarUrl!='' and record.avatarUrl==0) "> |
| | | and a.avatar_url = #{record.avatarUrl} |
| | | </if> |
| | | <if test="record.isSales != null and record.isSales !='' "> |
| | | and a.is_sales = #{record.isSales} |
| | | </if> |
| | | |
| | | <if test="record.withdrawalCash != null and record.withdrawalCash !='' "> |
| | | and a.withdrawal_cash = #{record.withdrawalCash} |
| | | </if> |
| | | |
| | | <if test="record.salesmanGrade != null and record.salesmanGrade !='' "> |
| | | and a.salesman_grade = #{record.salesmanGrade} |
| | | </if> |
| | | <if test="(record.userIsAuthorize!=null and record.userIsAuthorize!='') or (record.userIsAuthorize!='' and record.userIsAuthorize==0) "> |
| | | and a.user_is_authorize = #{record.userIsAuthorize} |
| | | </if> |
| | | </if> |
| | | </sql> |
| | | |
| | | <sql id="select"> |
| | | select |
| | | a.ID, |
| | | a.VIP_NO, |
| | | a.VIP_NAME, |
| | | a.PHONE, |
| | | a.SEX, |
| | | a.BIRTHDAY1, |
| | | a.photo, |
| | | a.ADDR, |
| | | a.CONSTELL, |
| | | a.ANIMAL_SIGN, |
| | | a.ARRIVAL_WAY, |
| | | a.VIP_TYPE, |
| | | a.VIP_STATE, |
| | | a.POINT_ALL, |
| | | a.COMMISSION_ALL, |
| | | a.IN_DATE, |
| | | a.REMARK, |
| | | a.SHOP_ID, |
| | | a.IS_DELETE, |
| | | a.EMAIL, |
| | | a.STAFF_ID, |
| | | a.CREATE_TIME, |
| | | a.LEVEL_ID, |
| | | a.UUID, |
| | | a.BALANCE, |
| | | a.BEATUY_ID, |
| | | a.PASSWORD, |
| | | a.*, |
| | | c.su_name as STAFF_NAME, |
| | | d.SHOP_NAME, |
| | | a.blood, |
| | | a.company_id, |
| | | a.sfCard, |
| | | a.link, |
| | | a.marry, |
| | | a.vocation, |
| | | a.handle_time, |
| | | a.statu, |
| | | a.openid, |
| | | a.parent_id, |
| | | a.create_distribution_time, |
| | | a.birthdayType, |
| | | a.disease, |
| | | a.is_deal, |
| | | a.province, |
| | | a.city, |
| | | a.area, |
| | | a.recommend_id, |
| | | e.level_name levelName, |
| | | e.vip_level vipLevel |
| | | </sql> |
| | |
| | | create_distribution_time, |
| | | birthdayType, |
| | | disease, |
| | | is_deal |
| | | is_deal, |
| | | zjm, |
| | | company_id, |
| | | province, |
| | | city, |
| | | area, |
| | | recommend_id, |
| | | is_sales, |
| | | withdrawal_cash, |
| | | salesman_grade, |
| | | nick_name, |
| | | avatar_url, |
| | | gender, |
| | | country, |
| | | session_key, |
| | | user_is_authorize |
| | | ) |
| | | VALUES |
| | | <foreach collection="list" item="item" index="index" separator=",">( |
| | |
| | | #{item.createDistributionTime}, |
| | | #{item.birthdayType}, |
| | | #{item.disease}, |
| | | #{item.isDeal} |
| | | #{item.isDeal}, |
| | | #{zjm}, |
| | | #{companyId}, |
| | | #{province}, |
| | | #{city}, |
| | | #{area}, |
| | | #{recommendId}, |
| | | #{isSales}, |
| | | #{withdrawalCash}, |
| | | #{salesmanGrade}, |
| | | #{nickName}, |
| | | #{avatarUrl}, |
| | | #{gender}, |
| | | #{country}, |
| | | #{sessionKey}, |
| | | #{userIsAuthorize} |
| | | )</foreach> |
| | | </insert> |
| | | |
| | |
| | | left join sys_shop_info e on a.SHOP_ID=e.ID |
| | | where a.ID=#{id} |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | </mapper> |
| | | |
| | |
| | | left join sys_users c on a.opration_user_id=c.su_id |
| | | <where> |
| | | |
| | | <if test="(record.userId!=null and record.userId!='') and (record.vipId!=null and record.vipId!='')"> |
| | | and (a.open_id=#{record.userId} or a.vip_id=#{record.vipId}) |
| | | </if> |
| | | |
| | | <if test="(record.userId!=null and record.userId!='') and record.vipId==null"> |
| | | and a.open_id=#{record.userId} |
| | | </if> |
| | | |
| | | <if test="(record.vipId!=null and record.vipId!='') and record.userId==null"> |
| | | <if test="(record.vipId!=null and record.vipId!='')"> |
| | | and a.vip_id=#{record.vipId} |
| | | </if> |
| | | |
| | |
| | | |
| | | <select id="selectUserTotalScore" resultType="java.lang.Integer"> |
| | | select IFNULL(sum(IFNULL( remain_score, 0 )),0) from score_vip_detail |
| | | <where> |
| | | and state=1 |
| | | <if test="openId !=null"> |
| | | and open_id=#{openId} |
| | | </if> |
| | | <if test="vipId !=null"> |
| | | and vip_id=#{vipId} |
| | | </if> |
| | | </where> |
| | | where state=1 and vip_id=#{vipId} |
| | | |
| | | |
| | | </select> |
| | | |
| | | <select id="selectEffectiveScore" resultType="com.matrix.system.score.entity.ScoreVipDetail"> |
| | | select * from score_vip_detail where state=1 |
| | | <if test="openId !=null"> |
| | | and open_id=#{openId} |
| | | </if> |
| | | <if test="vipId !=null"> |
| | | and vip_id=#{vipId} |
| | | </if> |
| | | select * |
| | | from score_vip_detail |
| | | where state = 1 and vip_id = #{vipId} |
| | | order by create_time |
| | | |
| | | </select> |
| | |
| | | t3.nick_name headName |
| | | from shop_activities_group_join t1 |
| | | inner join shop_activities_group_price t2 on t1.gp_id=t2.id |
| | | inner join biz_user t3 on t1.gj_head_id=t3.open_id |
| | | inner join sys_vip_info t3 on t1.gj_head_id=t3.id |
| | | where t1.act_id = #{record.actId} |
| | | <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> |
| | | <if test="pageVo.sort !=null and pageVo.order !=null"> |
| | |
| | | t3.avatar_url avatarUrl |
| | | from shop_activities_group_join t1 |
| | | inner join shop_activities_group_join_user t2 on t1.id=t2.gj_id and t2.is_has_cancel=2 and t2.is_has_pay=1 |
| | | left join biz_user t3 on t2.user_id=t3.open_id |
| | | left join sys_vip_info t3 on t2.user_id=t3.id |
| | | where t1.id=#{gjId} |
| | | </select> |
| | | |
| | |
| | | t3.avatar_url avatarUrl |
| | | from shop_activities_group_join t1 |
| | | inner join shop_activities_group_join_user t2 on t1.id=t2.gj_id and t2.is_has_cancel=2 |
| | | left join biz_user t3 on t2.user_id=t3.open_id |
| | | left join sys_vip_info t3 on t2.user_id=t3.id |
| | | where t1.id=#{gjId} |
| | | </select> |
| | | |
| | |
| | | t3.avatar_url |
| | | from shop_activities_group_join t1 |
| | | inner join shop_activities_group_price t2 on t1.gp_id=t2.id |
| | | left join biz_user t3 on t1.gj_head_id=t3.open_id |
| | | left join sys_vip_info t3 on t1.gj_head_id=t3.id |
| | | where t1.act_id=#{actId} and t1.gj_status=3 |
| | | </select> |
| | | |
| | |
| | | t3.nick_name |
| | | from shop_activities_group_join_user t1 |
| | | inner join shop_order t2 on t1.order_id=t2.id |
| | | inner join biz_user t3 on t1.user_id=t3.open_id |
| | | inner join sys_vip_info t3 on t1.user_id=t3.id |
| | | where t1.gj_id=#{gjId} |
| | | </select> |
| | | |
| | |
| | | <result property="status" column="status" /> |
| | | <result property="nickName" column="nick_name" /> |
| | | <result property="shopName" column="shop_short_name" /> |
| | | <result property="phone" column="phone_number" /> |
| | | <result property="phone" column="phone" /> |
| | | <collection property="salonAttr" ofType="com.matrix.system.shopXcx.bean.ShopActivitiesSalonAttrRecord"> |
| | | <id property="id" column="asd_id" /> |
| | | <result property="attrName" column="attr_name" /> |
| | |
| | | |
| | | <!-- 分页查询 --> |
| | | <select id="selectInPage" resultMap="ShopActivitiesSalonRecordMap"> |
| | | select t1.*, t3.nick_name, t3.phone_number, t4.shop_short_name, t2.id asd_id, t2.attr_name, t2.attr_value, t2.asr_id |
| | | select t1.*, t3.nick_name, t3.phone, t4.shop_short_name, t2.id asd_id, t2.attr_name, t2.attr_value, t2.asr_id |
| | | from shop_activities_salon_record t1 |
| | | inner join shop_activities_salon_attr_record t2 on t1.id=t2.asr_id |
| | | left join biz_user t3 on t1.user_id=open_id |
| | | left join sys_vip_info t3 on t1.user_id=id |
| | | left join sys_shop_info t4 on t1.shop_id=t4.id |
| | | <where> |
| | | <include refid="where_sql"></include> |
| | |
| | | t3.purchase_quantity, |
| | | t4.shop_short_name, |
| | | t5.nick_name userName, |
| | | t5.phone_number phone |
| | | t5.phone |
| | | from shop_activities_seckill_record t1 |
| | | inner join shop_activities_seckill_info t2 on t1.si_id=t2.id |
| | | inner join shop_order t3 on t1.order_id=t3.id |
| | | left join sys_shop_info t4 on t3.store_id=t4.id |
| | | left join biz_user t5 on t1.user_id=t5.open_id |
| | | left join sys_vip_info t5 on t1.user_id=t5.id |
| | | left join shop_product t6 on t2.goods_id=t6.id |
| | | where t2.act_id=#{record.actId} |
| | | <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> |
| | |
| | | inner join shop_activities_seckill_info t2 on t1.si_id=t2.id |
| | | inner join shop_order t3 on t1.order_id=t3.id |
| | | left join sys_shop_info t4 on t3.store_id=t4.id |
| | | left join biz_user t5 on t1.user_id=t5.open_id |
| | | left join sys_vip_info t5 on t1.user_id=t5.id |
| | | left join shop_product t6 on t2.goods_id=t6.id |
| | | where t2.act_id=#{record.actId} |
| | | </select> |
| | |
| | | <result property="delFlag" column="del_flag" /> |
| | | <result property="userName" column="user_name" /> |
| | | <result property="nickName" column="nick_name" /> |
| | | <result property="phoneNumber" column="phone_number" /> |
| | | <result property="phoneNumber" column="phone" /> |
| | | <result property="companyId" column="company_id" /> |
| | | </resultMap> |
| | | |
| | |
| | | c.coll_productid, |
| | | u.user_name, |
| | | u.nick_name, |
| | | u.phone_number, |
| | | u.phone, |
| | | p.title |
| | | from shop_collection c |
| | | LEFT JOIN biz_user u ON c.coll_userid = u.open_id |
| | | LEFT JOIN sys_vip_info u ON c.coll_userid = u.id |
| | | LEFT JOIN shop_product p ON c.coll_productid = p.id |
| | | <where> |
| | | <include refid="where_sql"></include> |
| | |
| | | <select id="selectTotalRecord" parameterType="long" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from shop_collection c |
| | | LEFT JOIN biz_user u ON c.coll_userid = u.open_id |
| | | LEFT JOIN sys_vip_info u ON c.coll_userid = u.id |
| | | LEFT JOIN shop_product p ON c.coll_productid = p.id |
| | | <where> |
| | | <include refid="where_sql"></include> |
| | |
| | | FROM |
| | | shop_invoice i |
| | | LEFT JOIN shop_order o ON i.order_id = o.id |
| | | LEFT JOIN biz_user b on i.user_id = b.open_id |
| | | LEFT JOIN sys_vip_info b on i.user_id = b.id |
| | | <where> |
| | | <include refid="where_sql"></include> |
| | | </where> |
| | |
| | | FROM |
| | | shop_invoice i |
| | | LEFT JOIN shop_order o ON i.order_id = o.id |
| | | LEFT JOIN biz_user b on i.user_id = b.open_id |
| | | LEFT JOIN sys_vip_info b on i.user_id = b.id |
| | | <where> |
| | | <include refid="where_sql"></include> |
| | | </where> |
| | |
| | | FROM |
| | | shop_invoice i |
| | | LEFT JOIN shop_order o ON i.order_id = o.id |
| | | LEFT JOIN biz_user b on i.user_id = b.open_id |
| | | LEFT JOIN sys_vip_info b on i.user_id = b.id |
| | | where invo_id=#{invoId} |
| | | </select> |
| | | |
| | |
| | | select |
| | | so.order_no,so.order_status,sp.title pro_name,spa.attr_name pro_type,sp.attrs_values pro_attrs,sku.`NAME` pro_specification,sod.count 'count',sod.price*sod.count order_money,bu.nick_name nick_name,so.order_time |
| | | from |
| | | shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,biz_user bu,shop_sku sku |
| | | shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,sys_vip_info bu,shop_sku sku |
| | | where |
| | | so.del_flag = 2 |
| | | and sod.p_id = sp.id |
| | | and sp.category_id = spa.attr_id |
| | | and sod.order_id = so.id |
| | | and bu.open_id = so.user_id |
| | | and bu.id = so.user_id |
| | | and sku.p_id = sod.p_id |
| | | and so.company_id=#{record.companyId} |
| | | <if test="record != null"> |
| | |
| | | <select id="selectTotalRecordByQuery" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from |
| | | shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,biz_user bu,shop_sku sku |
| | | shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,sys_vip_info bu,shop_sku sku |
| | | where |
| | | so.del_flag = 2 |
| | | and sod.p_id = sp.id |
| | | and sp.category_id = spa.attr_id |
| | | and sod.order_id = so.id |
| | | and bu.open_id = so.user_id |
| | | and bu.id = so.user_id |
| | | and sku.p_id = sod.p_id |
| | | and so.company_id=#{record.companyId} |
| | | <if test="record != null"> |
| | |
| | | <mapper namespace="com.matrix.system.shopXcx.dao.ShopOrderV2Dao"> |
| | | |
| | | <select id="selectReceivedOrderCount" resultType="java.lang.Integer"> |
| | | select count(*) from shop_order where user_id = #{openId} and order_status in (4,5) |
| | | select count(*) from shop_order where user_id = #{userId} and order_status in (4,5) |
| | | </select> |
| | | |
| | | <select id="countOrderAmount" resultType="java.lang.Double"> |
| | | select IFNULL(sum(IFNULL( order_money, 0 )),0) from shop_order where user_id = #{openId} and order_status in (4,5) |
| | | select IFNULL(sum(IFNULL( order_money, 0 )),0) from shop_order where user_id = #{userId} and order_status in (4,5) |
| | | </select> |
| | | |
| | | <select id="countBuyZdcp" resultType="java.lang.Integer"> |
| | | select count(*) from shop_order a |
| | | left join shop_order_details b on a.id=b.order_id |
| | | where a.user_id=#{openId} |
| | | where a.user_id=#{userId} |
| | | and order_status in (4,5) |
| | | and find_in_set(b.p_id,#{productIds}) |
| | | </select> |
| | |
| | | shop_product_comment c |
| | | LEFT JOIN shop_product p ON c.product_id = p.id |
| | | LEFT JOIN shop_order o ON c.order_id = o.id |
| | | LEFT JOIN biz_user b ON c.user_id = b.open_id |
| | | LEFT JOIN sys_vip_info b ON c.user_id = b.id |
| | | <where> |
| | | <include refid="where_sql"></include> |
| | | </where> |
| | |
| | | shop_product_comment c |
| | | LEFT JOIN shop_product p ON c.product_id = p.id |
| | | LEFT JOIN shop_order o ON c.order_id = o.id |
| | | LEFT JOIN biz_user b ON c.user_id = b.open_id |
| | | LEFT JOIN sys_vip_info b ON c.user_id = b.id |
| | | <where> |
| | | <include refid="where_sql"></include> |
| | | </where> |
| | |
| | | shop_product_comment c |
| | | LEFT JOIN shop_product p ON c.product_id = p.id |
| | | LEFT JOIN shop_order o ON c.order_id = o.id |
| | | LEFT JOIN biz_user b ON c.user_id = b.open_id |
| | | LEFT JOIN sys_vip_info b ON c.user_id = b.id |
| | | <where> |
| | | <if test="record!=null"> |
| | | <if test="(record.userId!=null and record.userId!='') or (record.userId!='' and record.userId==0) "> |
| | |
| | | shop_product_comment c |
| | | LEFT JOIN shop_product p ON c.product_id = p.id |
| | | LEFT JOIN shop_order o ON c.order_id = o.id |
| | | LEFT JOIN biz_user b ON c.user_id = b.open_id |
| | | LEFT JOIN sys_vip_info b ON c.user_id = b.id |
| | | <where> |
| | | and c.product_id = #{record.productId} |
| | | AND p.del_flag = 2 |
| | |
| | | shop_product_comment c |
| | | LEFT JOIN shop_product p ON c.product_id = p.id |
| | | LEFT JOIN shop_order o ON c.order_id = o.id |
| | | LEFT JOIN biz_user b ON c.user_id = b.open_id |
| | | LEFT JOIN sys_vip_info b ON c.user_id = b.id |
| | | <where> |
| | | <if test="record!=null"> |
| | | <if test="(record.productId!=null and record.productId!='') or (record.productId!='' and record.productId==0) "> |
| | |
| | | u.nick_name |
| | | from shop_refund_record r |
| | | left join shop_order o on r.order_id = o.id |
| | | LEFT JOIN biz_user u ON r.user_id = u.open_id |
| | | LEFT JOIN sys_vip_info u ON r.user_id = u.id |
| | | <where> |
| | | <include refid="where_sql"></include> |
| | | </where> |
| | |
| | | select count(*) |
| | | from shop_refund_record r |
| | | left join shop_order o on r.order_id = o.id |
| | | LEFT JOIN biz_user u ON r.user_id = u.open_id |
| | | LEFT JOIN sys_vip_info u ON r.user_id = u.id |
| | | <where> |
| | | <include refid="where_sql"></include> |
| | | </where> |
| | |
| | | u.nick_name |
| | | from shop_refund_record r |
| | | left join shop_order o on r.order_id = o.id |
| | | LEFT JOIN biz_user u ON r.user_id = u.open_id |
| | | LEFT JOIN sys_vip_info u ON r.user_id = u.id |
| | | where r.id=#{id} |
| | | </select> |
| | | |
| | |
| | | from shop_shopping_cart c |
| | | LEFT JOIN shop_product p ON c.cart_product_id = p.id |
| | | LEFT JOIN shop_sku s ON c.cart_sku_id = s.id |
| | | LEFT JOIN biz_user u ON c.cart_user_id = u.open_id |
| | | LEFT JOIN sys_vip_info u ON c.cart_user_id = u.id |
| | | <where> |
| | | <include refid="where_sql"></include> |
| | | </where> |
| | |
| | | from shop_shopping_cart c |
| | | LEFT JOIN shop_product p ON c.cart_product_id = p.id |
| | | LEFT JOIN shop_sku s ON c.cart_sku_id = s.id |
| | | LEFT JOIN biz_user u ON c.cart_user_id = u.open_id |
| | | LEFT JOIN sys_vip_info u ON c.cart_user_id = u.id |
| | | <where> |
| | | <include refid="where_sql"></include> |
| | | </where> |
| | |
| | | |
| | | <!-- 统计用户购物车数量 --> |
| | | <select id="selectUserCartCount" resultType="java.lang.Integer" > |
| | | select sum(cart_number) from shop_shopping_cart c |
| | | select ifnull(sum(cart_number),0) from shop_shopping_cart c |
| | | LEFT JOIN shop_product p on p.id = c.cart_product_id |
| | | where c.shop_Id=#{shopId} and p.del_flag = 2 and cart_user_id=#{openId} |
| | | where c.shop_Id=#{shopId} and p.del_flag = 2 and cart_user_id=#{userId} |
| | | </select> |
| | | |
| | | <!-- 根据id 锁表查询--> |
| | |
| | | MTools.ininDatetimepicker(".datetimepicker"); |
| | | var delUrl=""; |
| | | myGrid=MGrid.initGrid({ |
| | | url:basePath+"/admin/bizUser/showList", |
| | | url:basePath+"/admin/sysVipInfo/showList", |
| | | delUrl:delUrl, |
| | | }); |
| | | |
| | |
| | | package com.matrix; |
| | | |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.service.imp.SysVipInfoServiceImpl; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderV2Dao; |
| | | import org.junit.Test; |
| | | import org.junit.runner.RunWith; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @Test |
| | | public void scoreVipDetailService() throws InterruptedException { |
| | | scoreVipDetailService.addScore("oJkRK4yelehsY4S7I6Ee1ydWtQMI",null,null,null,15,1L,1,"测试"); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | */ |
| | | @Test |
| | | public void scoreVipDetailDao() throws InterruptedException { |
| | | System.out.println( scoreVipDetailDao.selectUserTotalScore("oJkRK4yelehsY4S7I6Ee1ydWtQMI",null)); |
| | | } |
| | | |
| | | @Test |
| | | public void testSelectReceivedOrderCount() throws InterruptedException { |
| | | System.out.println( shopOrderV2Dao.selectReceivedOrderCount("oJkRK4yelehsY4S7I6Ee1ydWtQMI")); |
| | | } |
| | | |
| | | @Test |
| | | public void testCountOrderAmount() throws InterruptedException { |
| | | System.out.println( shopOrderV2Dao.countOrderAmount("oJkRK4yelehsY4S7I6Ee1ydWtQMI")); |
| | | } |
| | | |
| | | |
| | | @Test |
| | | public void countBuyZdcp() throws InterruptedException { |
| | | System.out.println( shopOrderV2Dao.countBuyZdcp("oJkRK4yelehsY4S7I6Ee1ydWtQMI","1167,1263,1262")); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.matrix.biz.bean.BizUser; |
| | | import com.matrix.biz.service.BizUserService; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | |
| | | ShopOrderDetailsDao shopOrderDetailsDao; |
| | | |
| | | @Autowired |
| | | BizUserService bizUserService; |
| | | SysVipInfoService sysVipInfoService; |
| | | |
| | | |
| | | @Autowired |
| | |
| | | @Test |
| | | public void handleExtensionOrder() { |
| | | ShopOrder order = new ShopOrder(); |
| | | order.setUserId("oJkRK4_pWN2kjp75B_G6oGSWawj0"); |
| | | |
| | | order.setId(1190); |
| | | order.setCompanyId(36L); |
| | | |
| | |
| | | order.setDetails(details); |
| | | order.setOrderMoney(new BigDecimal(0.01)); |
| | | //判读客户是否存在上级,存在则产生上级的收益 |
| | | BizUser bizUser = bizUserService.findByOpenId(order.getUserId()); |
| | | LogUtil.debug("处理分销订单userOpid={}",bizUser.getOpenId()); |
| | | SysVipInfo sysVipInfo = sysVipInfoService.findById(order.getUserId()); |
| | | LogUtil.debug("处理分销订单userOpid={}",sysVipInfo.getId()); |
| | | //判断是否重复生成 |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("order_id",order.getId()); |
| | |
| | | if(StringUtils.isNotBlank(item.getShopProduct().getAttrValues()) |
| | | && item.getShopProduct().getAbleSales()==ShopProduct.ABLE_SALES){ |
| | | //分销规则是否开启自购返佣 |
| | | BusParameterSettings zgfy = parameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_ZGFY, bizUser.getCompanyId()); |
| | | BusParameterSettings zgfy = parameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_ZGFY, sysVipInfo.getCompanyId()); |
| | | //按分销等级计算 |
| | | ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(bizUser.getSalesmanGrade()); |
| | | ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(sysVipInfo.getSalesmanGrade()); |
| | | if(ObjectUtil.isNotEmpty(zgfy)) { |
| | | //获取商品的自购返佣价格,如果没有设置,在去获取当前推广人的等级的自购返佣比例 |
| | | if(StrUtil.isNotEmpty(zgfy.getParamValue()) && |
| | |
| | | shopSalesmanOrderDao.insert(salesmanOrder); |
| | | } |
| | | //存在上级 |
| | | if(StringUtils.isNotBlank(bizUser.getParentOpenId())) { |
| | | BizUser salesMan=bizUserService.findByOpenId(bizUser.getParentOpenId()); |
| | | if(sysVipInfo.getRecommendId()!=null) { |
| | | SysVipInfo salesMan=sysVipInfoService.findById(sysVipInfo.getRecommendId()); |
| | | Double salesAmount=0D; |
| | | Double invitationAmount=0D; |
| | | BizUser invitationMan=null; |
| | | SysVipInfo invitationMan=null; |
| | | ShopSalesmanOrder invitationOrder=null; |
| | | boolean hasInvitationMan=StringUtils.isNotBlank(salesMan.getParentOpenId()); |
| | | boolean hasInvitationMan=salesMan.getRecommendId()!=null; |
| | | //判断推广员是否还存在上级,存在则计算邀请收益 |
| | | if(hasInvitationMan){ |
| | | invitationMan=bizUserService.findByOpenId(salesMan.getParentOpenId()); |
| | | invitationMan=sysVipInfoService.findById(salesMan.getRecommendId()); |
| | | invitationOrder=new ShopSalesmanOrder(); |
| | | BeanUtils.copyProperties(salesmanOrder,invitationOrder); |
| | | invitationOrder.setSalesUserId(invitationMan.getOpenId()); |
| | | invitationOrder.setSalesUserId(invitationMan.getId()); |
| | | invitationOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_INVITATION); |
| | | } |
| | | //收益计算 |
| | |
| | | zk=order.getOrderMoney().doubleValue()/orderTotal; |
| | | salesAmount=salesAmount*zk; |
| | | salesmanOrder.setAmount(salesAmount); |
| | | salesmanOrder.setSalesUserId(bizUser.getParentOpenId()); |
| | | salesmanOrder.setSalesUserId(sysVipInfo.getRecommendId()); |
| | | shopSalesmanOrderDao.insert(salesmanOrder); |
| | | } |
| | | //邀请提成记录 |
| | |
| | | shopSalesmanOrderDao.insert(invitationOrder); |
| | | } |
| | | }else{ |
| | | LogUtil.debug("不存在父级userOpid={}",bizUser.getOpenId()); |
| | | LogUtil.debug("不存在父级userOpid={}",sysVipInfo.getId()); |
| | | } |
| | | }else{ |
| | | LogUtil.debug("重复订单id={}",order.getId()); |
| | |
| | | @Autowired |
| | | private ShopSalesmanApplyDao salesmanApplyDao; |
| | | |
| | | @Test |
| | | public void inPageTest() { |
| | | Page<SalesmanVo> page = new Page<>(1, 10); |
| | | salesmanApplyDao.selectInvitationuserInPage(page, "oLdgp47g7SXJnmti1iDzQaJpXNz4"); |
| | | } |
| | | |
| | | |
| | | } |