| | |
| | | |
| | | |
| | | @PostMapping("/app-user/getAppUserByPhone1") |
| | | R<AppUser> getAppUserByPhone1(String phone); |
| | | R<AppUser> getAppUserByPhone1(@RequestParam("phone") String phone); |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private VipSettingDto vipSettingDto; |
| | | |
| | | @TableField(exist = false) |
| | | private String idStr; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "获取返佣积分上级类型(1=直推上级,2=直帮上级)") |
| | | @TableField("superior_type") |
| | | private String superiorType; |
| | | private Integer superiorType; |
| | | |
| | | @ApiModelProperty(value = "获取分佣金额上级类型(1=直推上级,2=直帮上级)") |
| | | @TableField("superior_price_type") |
| | |
| | | /** |
| | | * 获取返佣积分上级类型(1=直推上级,2=直帮上级) |
| | | */ |
| | | private String superiorType; |
| | | private Integer superiorType; |
| | | /** |
| | | * 核销门店可获得服务费 |
| | | */ |
| | |
| | | /** |
| | | * 获取返佣积分上级类型(1=直推上级,2=直帮上级) |
| | | */ |
| | | private String superiorType; |
| | | private Integer superiorType; |
| | | /** |
| | | * 核销门店可获得服务费 |
| | | */ |
| | |
| | | |
| | | @ApiModelProperty(value = "获取返佣积分上级类型(1=直推上级,2=直帮上级)") |
| | | @TableField("superior_type") |
| | | private String superiorType; |
| | | private String superiorType; |
| | | |
| | | @ApiModelProperty(value = "获取分佣金额上级类型(1=直推上级,2=直帮上级)") |
| | | @TableField("superior_price_type") |
| | |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "会员申请详情", tags = {"会员中心-小程序"}) |
| | | public R<AgentApplication> detail(@RequestParam Long id) { |
| | | R<VipSetting> vipSetting = vipSettingClient.getVipSetting(id.intValue()); |
| | | AgentApplication agentApplication = agentApplicationService.getById(id); |
| | | R<VipSetting> vipSetting = vipSettingClient.getVipSetting(agentApplication.getApplicationVipId()); |
| | | VipSettingDto vipSettingDto = new VipSettingDto(); |
| | | BeanUtils.copyProperties(vipSetting.getData(),vipSettingDto); |
| | | AgentApplication byId = agentApplicationService.getById(id); |
| | | byId.setVipSettingDto(vipSettingDto); |
| | | return R.ok(byId); |
| | | agentApplication.setVipSettingDto(vipSettingDto); |
| | | return R.ok(agentApplication); |
| | | } |
| | | @Resource |
| | | private UserChangeLogService userChangeLogService; |
| | |
| | | */ |
| | | @GetMapping("/getAppuserPage") |
| | | @ApiOperation(value = "用户列表", tags = {"管理后台"}) |
| | | public R<IPage<AppUser>> getAppuserPage(@ApiParam("页码") @RequestParam Integer pageCurr, |
| | | public R<IPage<AppUser>> getAppuserPage(@ApiParam("页码") @RequestParam Integer pageNum, |
| | | @ApiParam("每一页数据大小") Integer pageSize, |
| | | AppUser appUser) { |
| | | IPage<AppUser> appuserPage = appUserService.getAppuserPage(pageCurr, pageSize, appUser); |
| | | IPage<AppUser> appuserPage = appUserService.getAppuserPage(pageNum, pageSize, appUser); |
| | | return R.ok(appuserPage); |
| | | } |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/upload") |
| | | public R<String> upload(MultipartFile file){ |
| | | public String upload(MultipartFile file){ |
| | | String s = null; |
| | | try { |
| | | s = ObsUploadUtil.obsUpload(file); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | return R.ok(s); |
| | | return s; |
| | | } |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.account.api.model.AgentApplication; |
| | | import com.ruoyi.account.api.model.AppUser; |
| | | import com.ruoyi.account.api.model.AppUserShop; |
| | | import com.ruoyi.account.dto.AgentQuery; |
| | | import com.ruoyi.account.mapper.AgentApplicationMapper; |
| | | import com.ruoyi.account.service.AgentApplicationService; |
| | | import com.ruoyi.account.service.AppUserService; |
| | | import com.ruoyi.account.service.AppUserShopService; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.other.api.domain.Shop; |
| | |
| | | @Resource |
| | | private ShopClient shopClient; |
| | | |
| | | @Resource |
| | | private AppUserShopService appUserShopService; |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void apply(AgentApplication agentApplication) { |
| | | LoginUser loginUserApplet = tokenService.getLoginUserApplet(); |
| | |
| | | agentApplication.setDirectAgentNum(directAgentUserList.size()); |
| | | |
| | | // 已绑定门店数量 |
| | | R<List<Shop>> R = shopClient.getShopByUserIds(Collections.singletonList(loginUserApplet.getUserid())); |
| | | List<Shop> shopList = R.getData(); |
| | | agentApplication.setBindShopNum(shopList.size()); |
| | | long count = appUserShopService.count(new LambdaQueryWrapper<AppUserShop>().eq(AppUserShop::getAppUserId, loginUserApplet.getUserid())); |
| | | agentApplication.setBindShopNum(Long.valueOf(count).intValue()); |
| | | agentApplicationMapper.insert(agentApplication); |
| | | } |
| | | |
| | |
| | | VipSetting vipSetting = vipSettingService.getVipSettingById(4); |
| | | // 获取通过消费积分达成会员等级的开关 |
| | | Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); |
| | | if (vipLevelUpShopRole == 1){ |
| | | if (null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | // 消费积分阈值 |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | // 返佣积分阈值 |
| | |
| | | } |
| | | |
| | | Integer vipLevelUpNumRole = vipSetting.getVipLevelUpNumRole(); |
| | | if (vipLevelUpNumRole == 1){ |
| | | if (null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | // 直推钻石用户数阈值 |
| | | Integer vipDirectNum = vipSetting.getVipDirectNum(); |
| | | // 获取用户直推钻石用户数量 |
| | |
| | | VipSetting vipSetting = vipSettingService.getVipSettingById(5); |
| | | // 获取通过消费积分达成会员等级的开关 |
| | | Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); |
| | | if (vipLevelUpShopRole == 1){ |
| | | if (null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | // 消费积分阈值 |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | // 返佣积分阈值 |
| | |
| | | } |
| | | |
| | | Integer vipLevelUpNumRole = vipSetting.getVipLevelUpNumRole(); |
| | | if (vipLevelUpNumRole == 1){ |
| | | if (null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | // 直推钻石用户数阈值 |
| | | Integer vipDirectNum = vipSetting.getVipDirectNum(); |
| | | // 获取用户直推钻石用户数量 |
| | |
| | | Integer sharePoint = appUser.getSharePoint(); |
| | | // 获取通过消费积分达成会员等级的开关 |
| | | Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); |
| | | if (vipLevelUpShopRole == 1){ |
| | | if (null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | // 消费积分阈值 |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | // 返佣积分阈值 |
| | |
| | | } |
| | | |
| | | Integer vipLevelUpNumRole = vipSetting.getVipLevelUpNumRole(); |
| | | if (vipLevelUpNumRole == 1){ |
| | | if (null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | // 直推代理用户数阈值 |
| | | Integer vipDirectNum = vipSetting.getVipDirectNum(); |
| | | // 准代理用户数阈值 |
| | |
| | | VipSetting vipSetting = vipSettingService.getVipSettingById(7); |
| | | // 获取通过消费积分达成会员等级的开关 |
| | | Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); |
| | | if (vipLevelUpShopRole == 1){ |
| | | if (null != vipLevelUpShopRole && vipLevelUpShopRole == 1){ |
| | | // 消费积分阈值 |
| | | Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); |
| | | // 返佣积分阈值 |
| | |
| | | } |
| | | |
| | | Integer vipLevelUpNumRole = vipSetting.getVipLevelUpNumRole(); |
| | | if (vipLevelUpNumRole == 1){ |
| | | if (null != vipLevelUpNumRole && vipLevelUpNumRole == 1){ |
| | | // 直推代理用户数阈值 |
| | | Integer vipDirectNum = vipSetting.getVipDirectNum(); |
| | | // 准代理用户数阈值 |
| | |
| | | id, app_user_id, application_vip_id, application_time, status, shop_point, share_point, direct_vip_num, direct_agent_num, bind_shop_num, remark, del_flag, create_time |
| | | </sql> |
| | | <select id="pageList" resultType="com.ruoyi.account.api.model.AgentApplication"> |
| | | select t1.*,t2.name as userName,t2.phone as userPhone |
| | | select |
| | | t1.*, |
| | | t1.id as idStr, |
| | | t2.name as userName, |
| | | t2.phone as userPhone |
| | | from t_agent_application t1 |
| | | left join t_app_user t2 on t1.app_user_id = t2.id |
| | | <where> |
| | |
| | | } |
| | | @PostMapping("/byShopId") |
| | | public R<List<Order>> byShopId(@RequestParam("shopId") Integer shopId){ |
| | | return R.ok(orderService.lambdaQuery().isNotNull(Order::getEndTime).eq(Order::getShopId, shopId).groupBy(Order::getAppUserId).list()); |
| | | return R.ok(orderService.lambdaQuery().isNotNull(Order::getEndTime).eq(Order::getShopId, shopId).list()); |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PutMapping("/deliverGoodsRefundPass/{id}/{code}") |
| | | @PostMapping("/deliverGoodsRefundPass") |
| | | @ApiOperation(value = "售后已发货操作", tags = {"我的订单-个人中心-小程序"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "售后数据id", required = true, dataType = "long"), |
| | | @ApiImplicitParam(name = "code", value = "快递单号", required = true, dataType = "string"), |
| | | }) |
| | | public R deliverGoodsRefundPass(@PathVariable("id") Long id, @PathVariable("code") String code){ |
| | | public R deliverGoodsRefundPass(@RequestParam("id") String id, @RequestParam("code") String code){ |
| | | RefundPass refundPass = refundPassService.getById(id); |
| | | if(null == refundPass){ |
| | | return R.fail(); |
| | |
| | | for (OrderGood og : v) {// 累计分销金额 |
| | | |
| | | // 直推上级分佣金额 |
| | | String superiorType = og.getSuperiorType(); |
| | | if (superiorType.contains("1") && inviteUser != null){ |
| | | Integer superiorType = og.getSuperiorType(); |
| | | if (superiorType == 1 && inviteUser != null){ |
| | | // 分佣金额 |
| | | BigDecimal superiorSubcommission = og.getSuperiorSubcommission(); |
| | | BigDecimal totalDistributionAmount = inviteUser.getTotalDistributionAmount(); |
| | |
| | | appUserClient.editAppUserById(inviteUser); |
| | | }else |
| | | // 直帮上级分佣金额 |
| | | if (superiorType.contains("2") && superiorLeader != null){ |
| | | if (superiorType == 2 && superiorLeader != null){ |
| | | // 分佣金额 |
| | | BigDecimal superiorSubcommission = og.getSuperiorSubcommission(); |
| | | BigDecimal totalDistributionAmount = superiorLeader.getTotalDistributionAmount(); |
| | |
| | | price.setEarnSpendingPoints(goodsSeckill.getEarnSpendingPoints()); |
| | | price.setSuperiorSubcommission(goodsSeckill.getSuperiorSubcommission()); |
| | | price.setSuperiorRebatePoints(goodsSeckill.getSuperiorRebatePoints()); |
| | | price.setSuperiorType(String.valueOf(goodsSeckill.getSuperiorType())); |
| | | price.setSuperiorType(goodsSeckill.getSuperiorType()); |
| | | price.setServuceShopCharges(goodsSeckill.getServuceShopCharges()); |
| | | price.setServuceShopPoints(goodsSeckill.getServuceShopPoints()); |
| | | price.setTechnicianPoints(goodsSeckill.getTechnicianPoints()); |
| | |
| | | |
| | | @ApiOperation(value = "广告管理-分享管理-列表", tags = {"管理后台"}) |
| | | @GetMapping("/manage/list") |
| | | public R<Page<Share>> managelist(String name, Integer addType, @RequestParam Integer pageNum, Integer pageSize) { |
| | | public R<Page<Share>> managelist(String name, Integer addType, @RequestParam Integer pageCurr, Integer pageSize) { |
| | | //判断当前登陆人是平台还是门店 |
| | | if (tokenService.getLoginUser().getSysUser().getRoleType()==1) { |
| | | Page<Share> page = shareService.lambdaQuery().eq(Share::getAuditStatus, 1).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageNum, pageSize)); |
| | | Page<Share> page = shareService.lambdaQuery().eq(Share::getAuditStatus, 1).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageCurr, pageSize)); |
| | | return R.ok(page); |
| | | }else { |
| | | Page<Share> page = shareService.lambdaQuery().eq(Share::getAddType,3).eq(Share::getObjectId, tokenService.getLoginUser().getSysUser().getObjectId()).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageNum, pageSize)); |
| | | Page<Share> page = shareService.lambdaQuery().eq(Share::getAddType,3).eq(Share::getObjectId, tokenService.getLoginUser().getSysUser().getObjectId()).like(name != null, Share::getName, name).eq(addType != null, Share::getAddType, addType).page(Page.of(pageCurr, pageSize)); |
| | | return R.ok(page); |
| | | } |
| | | } |
| | |
| | | if (!shopService.cheUserByPhone(phone)) { |
| | | return R.fail("该手机号未注册"); |
| | | } |
| | | AppUser appUser = appUserClient.getAppUserByPhone1(phone).getData(); |
| | | shop.setShopAllPoint(0); |
| | | shop.setShopPoint(0); |
| | | shop.setSharePoint(0); |
| | |
| | | shop.setOrderNumber(0); |
| | | shop.setServerOrderNumber(0); |
| | | shop.setCustomOrderNumber(0); |
| | | shop.setAppUserId(appUser.getId()); |
| | | shopService.save(shop); |
| | | |
| | | LoginUser loginUserApplet = tokenService.getLoginUser(); |
| | | |
| | | AppUserShop appUserShop = new AppUserShop(); |
| | | appUserShop.setAppUserId(loginUserApplet.getUserid()); |
| | | appUserShop.setAppUserId(appUser.getId()); |
| | | appUserShop.setShopId(shop.getId()); |
| | | R<Void> r = appUserClient.addAppUserShop(appUserShop); |
| | | if (R.isError(r)){ |
| | | throw new RuntimeException("添加失败"); |
| | | } |
| | | AppUser appUser = appUserClient.getAppUserById(loginUserApplet.getUserid()); |
| | | if (appUser == null){ |
| | | throw new RuntimeException("添加失败"); |
| | | } |
| | | appUser.setUserType(2); |
| | |
| | | for (GoodsArea goodsArea : goodsAreaList) { |
| | | List<GoodsArea> goodsAreaList1 = goodsArea.getGoodsAreaList(); |
| | | for (GoodsArea area : goodsAreaList1) { |
| | | area.setId(null); |
| | | area.setGoodsId(id); |
| | | area.setProvince(goodsArea.getProvince()); |
| | | area.setCity(goodsArea.getCity()); |