| | |
| | | |
| | | String INTEGRAL_USE_FAILED = "积分不够支付"; |
| | | |
| | | String CANCEL_CANCEL_ORDER = "订单已被取消"; |
| | | |
| | | String CANCEL_ERROR_ORDER = "已核销订单不能取消"; |
| | | |
| | | String SALESPRICE_MIN = "设置价格不能低于最低限价"; |
| | |
| | | @ApiModelProperty(value = "商户id",hidden = true) |
| | | private Long shopId; |
| | | |
| | | @ApiModelProperty(value = "定位获取商户id") |
| | | private Long positionShopId; |
| | | } |
| | |
| | | @Data |
| | | public class ActivityGoodsGetVo { |
| | | |
| | | @ApiModelProperty(value = "活动名称") |
| | | private String activityName; |
| | | |
| | | @ApiModelProperty(value = "秒杀活动价") |
| | | private BigDecimal activityPrice; |
| | | |
| | |
| | | return R.fail("改变分类数量失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<String> getServicePhone() { |
| | | return R.fail("获取客服电话失败:" + throwable.getMessage()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public R<List<SysTag>> listSysTag(Integer tagType) { |
| | |
| | | */ |
| | | @PostMapping("/config/changeClassNum") |
| | | public R changeClassNum(@RequestBody MgtClassNumDto mgtClassNumDto); |
| | | |
| | | /** |
| | | * @description 获取客服电话 |
| | | * @author jqs |
| | | * @date 2023/7/29 16:11 |
| | | * @param |
| | | * @return R<String> |
| | | */ |
| | | @PostMapping("/config/getServicePhone") |
| | | public R<String> getServicePhone(); |
| | | } |
| | |
| | | @ApiOperation("通过code获取员工端用户登录") |
| | | public R<OauthUserVo> oauthStaff(@ApiParam(value = "成员授权获取到的code", required = true) @RequestParam("code") String code) throws IOException { |
| | | // 通过code获取访问用户敏感信息 |
| | | //JSONObject result = qywxInnerService.getOauthUser(code); |
| | | //QwUserDetailDto qwUserDetail = JSONObject.parseObject(result.toJSONString(), QwUserDetailDto.class); |
| | | QwUserDetailDto qwUserDetail = new QwUserDetailDto(); |
| | | qwUserDetail.setMobile("17780704874"); |
| | | JSONObject result = qywxInnerService.getOauthUser(code); |
| | | QwUserDetailDto qwUserDetail = JSONObject.parseObject(result.toJSONString(), QwUserDetailDto.class); |
| | | //QwUserDetailDto qwUserDetail = new QwUserDetailDto(); |
| | | //qwUserDetail.setMobile("17780704874"); |
| | | if(StringUtils.isBlank(qwUserDetail.getMobile())){ |
| | | throw new ServiceException("企业微信未授权手机号,无法登录"); |
| | | } |
| | |
| | | import com.ruoyi.system.api.domain.vo.AppMiniRegisterVo; |
| | | import com.ruoyi.system.api.domain.vo.ShopRelUserVo; |
| | | import com.ruoyi.system.api.model.*; |
| | | import com.ruoyi.system.api.service.RemoteConfigService; |
| | | import com.ruoyi.system.api.service.RemoteMemberService; |
| | | import com.ruoyi.system.api.service.RemoteShopService; |
| | | import com.ruoyi.system.api.service.RemoteUserService; |
| | |
| | | @Autowired |
| | | private RedisService redisService; |
| | | |
| | | @Autowired |
| | | private RemoteConfigService remoteConfigService; |
| | | /** |
| | | * 登录 |
| | | */ |
| | |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "很遗憾,访问IP已被列入系统黑名单",Constants.FROM_MINI_APP); |
| | | throw new ServiceException("很遗憾,访问IP已被列入系统黑名单"); |
| | | } |
| | | String servicePhone = remoteConfigService.getServicePhone().getData(); |
| | | if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) |
| | | { |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除",Constants.FROM_MINI_APP); |
| | | throw new ServiceException("028-88888888",501); |
| | | throw new ServiceException(servicePhone,501); |
| | | } |
| | | if (UserStatus.DISABLE.getCode().equals(user.getStatus())) |
| | | { |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户已停用,请联系管理员",Constants.FROM_MINI_APP); |
| | | throw new ServiceException("028-88888888",501); |
| | | throw new ServiceException(servicePhone,501); |
| | | } |
| | | recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功",Constants.FROM_MINI_APP); |
| | | } |
| | |
| | | if (StringUtils.matches(url, ignoreWhite.getWhites())) |
| | | { |
| | | //附近商户获取 |
| | | if(url.contains("getNearbyShop")){ |
| | | if(url.contains("getNearbyShop")||url.contains("pageRecommendGoods")||url.contains("pageActivityGoods")||url.contains("getGoodsInfo")||url.contains("getShopInfo")||url.contains("pageAppActivityGoods")){ |
| | | String token = getToken(request); |
| | | if(!StringUtils.isEmpty(token)){ |
| | | Claims claims = JwtUtils.parseToken(token); |
| | | if(claims!=null){ |
| | | String userid = JwtUtils.getUserId(claims); |
| | | String userkey = JwtUtils.getUserKey(claims); |
| | | String username = JwtUtils.getUserName(claims); |
| | | if(!StringUtils.isEmpty(userid)){ |
| | | addHeader(mutate, SecurityConstants.USER_KEY, userkey); |
| | | addHeader(mutate, SecurityConstants.DETAILS_USER_ID, userid); |
| | | addHeader(mutate, SecurityConstants.DETAILS_USERNAME, username); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.goods; |
| | | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import com.ruoyi.common.security.annotation.EnableCustomConfig; |
| | | import com.ruoyi.common.security.annotation.EnableRyFeignClients; |
| | | import com.ruoyi.common.swagger.annotation.EnableCustomSwagger2; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | import org.springframework.context.annotation.ComponentScans; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | |
| | | Member member = memberService.getMember(userId).getData(); |
| | | if(member!=null&&member.getRelationShopId()!=null){ |
| | | appActivityGoodsPageDto.setShopId(member.getRelationShopId()); |
| | | }else{ |
| | | appActivityGoodsPageDto.setShopId(appActivityGoodsPageDto.getPositionShopId()); |
| | | } |
| | | } |
| | | if(appActivityGoodsPageDto.getShopId()==null){ |
| | |
| | | /** |
| | | * 活动定时开始 |
| | | */ |
| | | @Scheduled(cron="0 * */1 * * ?") |
| | | @Scheduled(cron="0 0 */1 * * ?") |
| | | private void timingSendCoupon(){ |
| | | if(schedulerUtils.getSchedulerRun()) { |
| | | log.info("活动定时任务开始执行"); |
| | |
| | | String goodsId = activityGoodsGetDto.getGoodsId(); |
| | | Activity activity = this.getById(activityId); |
| | | ActivityGoods activityGoods = activityGoodsService.getByGoodsId(activityId,goodsId); |
| | | activityGoodsGetVo.setActivityName(activity.getActivityName()); |
| | | activityGoodsGetVo.setActivityPrice(activityGoods.getActivityPrice()); |
| | | activityGoodsGetVo.setActivitySubscription(activityGoods.getActivitySubscription()); |
| | | activityGoodsGetVo.setActivityStatus(activity.getActivityStatus()); |
| | |
| | | Map<Long, MgtSimpleShopVo> shopMap = simpleShopVoList.stream() |
| | | .collect(Collectors.toMap(MgtSimpleShopVo::getShopId, Function.identity())); |
| | | for(AppMemberPrizePageVo appMemberPrizePageVo : memberPrizePageVoList){ |
| | | appMemberPrizePageVo.setVerifyShopName(shopMap.get(appMemberPrizePageVo.getShopId()).getShopName()); |
| | | if(appMemberPrizePageVo.getShopId()!=null){ |
| | | appMemberPrizePageVo.setVerifyShopName(shopMap.get(appMemberPrizePageVo.getShopId()).getShopName()); |
| | | } |
| | | } |
| | | } |
| | | return memberPrizePageVoList; |
| | |
| | | order.setReceivableMoney(orderPayMoney); |
| | | order.setReceivableDeposit(orderPayDeposit); |
| | | order.setChangeReceivableMoney(orderPayMoney); |
| | | order.setActivityId(activityId); |
| | | order.setActivityName(activityGoodsGetVo.getActivityName()); |
| | | // 根据支付类型设置订单支付金额,在线支付金额,订单支付金额,未支付金额,关闭标志 |
| | | if (appPlaceActivityDto.getPayType() == 1) { |
| | | order.setPayMoney(orderPayMoney); |
| | |
| | | @Override |
| | | public void cancelOrder(String orderId) { |
| | | Order order = this.getById(orderId); |
| | | if (order.getOrderStatus() == 1) { |
| | | if (order.getOrderStatus() == 0) { |
| | | throw new ServiceException(AppErrorConstant.CANCEL_CANCEL_ORDER); |
| | | }else if (order.getOrderStatus() == 1) { |
| | | this.autoCancelOrder(orderId); |
| | | }else if(order.getOrderStatus() == 2){ |
| | | this.refundOrder(orderId); |
| | |
| | | toc.receivable_money-toc.online_pay_money receivableMoney, |
| | | toc.receivable_deposit receivableDeposit, |
| | | toc.change_receivable_money payMoney, |
| | | toc.offline_pay_money receiveMoney, |
| | | IFNULL(toc.offline_pay_money,0) receiveMoney, |
| | | toc.order_remark orderRemark, |
| | | tog.goods_name goodsName, |
| | | tog.goods_type goodsType, |
| | |
| | | @ApiOperation(value = "获取商户端商业统计") |
| | | public R<MerHomeShopTotalVo> getMerHomeTotal(@RequestBody MerBaseDto merBaseDto) { |
| | | Long userId = SecurityUtils.getUserId(); |
| | | MerHomeShopTotalVo merHomeShopTotalVo = shopService.getMerHomeTotal(userId); |
| | | merBaseDto.setUserId(userId); |
| | | MerHomeShopTotalVo merHomeShopTotalVo = shopService.getMerHomeTotal(merBaseDto); |
| | | return R.ok(merHomeShopTotalVo); |
| | | } |
| | | |
| | |
| | | */ |
| | | @Override |
| | | public void deleteByShopId(Long shopId){ |
| | | LambdaQueryWrapper<ShopRelUser> queryWrapper = Wrappers.lambdaQuery(); |
| | | queryWrapper.eq(ShopRelUser::getDelFlag, 0).eq(ShopRelUser::getShopId, shopId); |
| | | List<ShopRelUser> shopRelUserList = this.list(queryWrapper); |
| | | if(shopRelUserList!=null&&!shopRelUserList.isEmpty()){ |
| | | Long userId; |
| | | for(ShopRelUser shopRelUser : shopRelUserList){ |
| | | userId = shopRelUser.getUserId(); |
| | | |
| | | } |
| | | } |
| | | shopRelUserMapper.deleteByShopId(shopId); |
| | | } |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.constant.CacheConstants; |
| | | import com.ruoyi.common.core.exception.ServiceException; |
| | | import com.ruoyi.common.core.utils.DateUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.bean.BeanUtils; |
| | | import com.ruoyi.common.core.utils.uuid.IdUtils; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.utils.SecurityUtils; |
| | | import com.ruoyi.shop.domain.dto.*; |
| | | import com.ruoyi.shop.domain.pojo.shop.*; |
| | | import com.ruoyi.shop.domain.pojo.task.ShopFile; |
| | |
| | | |
| | | @Resource |
| | | private ShopTaskService shopTaskService; |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | /** |
| | | * 获取商户详情 |
| | |
| | | } |
| | | /** |
| | | * 获取商户端 |
| | | * @param userId |
| | | * @param merBaseDto |
| | | * @return |
| | | */ |
| | | @Override |
| | | public MerHomeShopTotalVo getMerHomeTotal(Long userId){ |
| | | public MerHomeShopTotalVo getMerHomeTotal(MerBaseDto merBaseDto){ |
| | | Long userId = merBaseDto.getUserId(); |
| | | MerHomeShopTotalVo merHomeShopTotalVo = new MerHomeShopTotalVo(); |
| | | ShopRelUser shopRelUser = shopRelUserService.getByUserId(userId); |
| | | Long shopId = shopRelUser.getShopId(); |
| | | //如果商户变动刷新token |
| | | if(!shopId.equals(merBaseDto.getShopId())){ |
| | | String userKey = SecurityUtils.getUserKey(); |
| | | redisService.deleteObject(CacheConstants.LOGIN_TOKEN_KEY+userKey); |
| | | throw new ServiceException("登录状态已过期",401); |
| | | } |
| | | merHomeShopTotalVo.setShopId(shopId); |
| | | Shop shop = this.getById(shopId); |
| | | merHomeShopTotalVo.setShopType(shop.getShopType()); |
| | |
| | | */ |
| | | @Override |
| | | public List<MerAgencyTaskPageVo> pageMerAgencyTask(Page page, MerAgencyTaskPageDto merAgencyTaskPageDto){ |
| | | String nowDay = DateUtils.parseDateToStr("YYYY-MM-dd",new Date()); |
| | | merAgencyTaskPageDto.setNowDay(nowDay); |
| | | /*String nowDay = DateUtils.parseDateToStr("YYYY-MM-dd",new Date()); |
| | | merAgencyTaskPageDto.setNowDay(nowDay);*/ |
| | | List<MerAgencyTaskPageVo> merAgencyTaskPageVoList = agencyTaskMapper.pageMerAgencyTask(page, merAgencyTaskPageDto); |
| | | return merAgencyTaskPageVoList; |
| | | } |
| | |
| | | } |
| | | } |
| | | if(StringUtils.isNotBlank(video)){ |
| | | strArr = picture.split(","); |
| | | strArr = video.split(","); |
| | | for(String str : strArr){ |
| | | taskFile = new TaskFile(); |
| | | taskFile.setDelFlag(0); |
| | |
| | | } |
| | | } |
| | | if(StringUtils.isNotBlank(audio)){ |
| | | strArr = picture.split(","); |
| | | strArr = audio.split(","); |
| | | for(String str : strArr){ |
| | | taskFile = new TaskFile(); |
| | | taskFile.setDelFlag(0); |
| | |
| | | } |
| | | // 判断视频是否为空,并处理 |
| | | if (StringUtils.isNotBlank(video)) { |
| | | strArr = picture.split(","); |
| | | strArr = video.split(","); |
| | | for (String str : strArr) { |
| | | taskFile = new TaskFile(); |
| | | taskFile.setDelFlag(0); |
| | |
| | | } |
| | | // 判断音频是否为空,并处理 |
| | | if (StringUtils.isNotBlank(audio)) { |
| | | strArr = picture.split(","); |
| | | strArr = audio.split(","); |
| | | for (String str : strArr) { |
| | | taskFile = new TaskFile(); |
| | | taskFile.setDelFlag(0); |
| | |
| | | } |
| | | // 判断下一个任务日期是否为空,并处理 |
| | | if (StringUtils.isNotBlank(merFollowMemberTaskDto.getNextTaskDate())) { |
| | | String nowTimeStr = DateUtils.getDate(); |
| | | MemberTask memberTask = new MemberTask(); |
| | | String taskId = IdUtils.simpleUUID(); |
| | | memberTask.setTaskId(taskId); |
| | |
| | | memberTask.setUserId(oldMemberTask.getUserId()); |
| | | memberTask.setTaskDate(merFollowMemberTaskDto.getNextTaskDate()); |
| | | memberTask.setTaskContent(merFollowMemberTaskDto.getNextTaskContent()); |
| | | memberTask.setTaskStatus(2); |
| | | int i = merFollowMemberTaskDto.getNextTaskDate().compareTo(nowTimeStr); |
| | | if(i>0){ |
| | | memberTask.setTaskStatus(0); |
| | | }else if(i==0){ |
| | | memberTask.setTaskStatus(1); |
| | | }else{ |
| | | memberTask.setTaskStatus(3); |
| | | } |
| | | memberTask.setCreateTime(new Date()); |
| | | this.saveOrUpdate(memberTask); |
| | | } |
| | |
| | | } |
| | | // 判断视频是否为空,并处理 |
| | | if (StringUtils.isNotBlank(video)) { |
| | | strArr = picture.split(","); |
| | | strArr = video.split(","); |
| | | for (String str : strArr) { |
| | | taskFile = new TaskFile(); |
| | | taskFile.setDelFlag(0); |
| | |
| | | } |
| | | // 判断音频是否为空,并处理 |
| | | if (StringUtils.isNotBlank(audio)) { |
| | | strArr = picture.split(","); |
| | | strArr = audio.split(","); |
| | | for (String str : strArr) { |
| | | taskFile = new TaskFile(); |
| | | taskFile.setDelFlag(0); |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.shop.domain.dto.*; |
| | | import com.ruoyi.shop.domain.vo.*; |
| | | import com.ruoyi.system.api.domain.dto.MerBaseDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtBasePlatformDto; |
| | | import com.ruoyi.system.api.domain.dto.MgtShopIdByCodeDto; |
| | | import com.ruoyi.system.api.domain.poji.member.Member; |
| | |
| | | |
| | | /** |
| | | * 获取商户端首页统计 |
| | | * @param userId |
| | | * @param merBaseDto |
| | | * @return |
| | | */ |
| | | MerHomeShopTotalVo getMerHomeTotal(Long userId); |
| | | MerHomeShopTotalVo getMerHomeTotal(MerBaseDto merBaseDto); |
| | | |
| | | /** |
| | | * 商户获取代理商列表 |
| | |
| | | FROM t_agency_task tat |
| | | LEFT JOIN t_agency_task_record tmtr ON tat.task_id = tmtr.task_id |
| | | WHERE tat.del_flag = 0 AND tat.shop_id = #{param.shopId} AND tat.agency_id = #{param.agencyId} |
| | | <if test="param.taskStatus!=null and param.taskStatus == 0"> |
| | | AND tat.task_status = 0 AND tat.task_date < #{param.nowDay} |
| | | </if> |
| | | <if test="param.taskStatus!=null and param.taskStatus == 1"> |
| | | AND tat.task_status = 0 AND tat.task_date = #{param.nowDay} |
| | | </if> |
| | | <if test="param.taskStatus!=null and param.taskStatus == 2"> |
| | | AND tat.task_status = 2 |
| | | </if> |
| | | <if test="param.taskStatus!=null and param.taskStatus == 3"> |
| | | AND tat.task_status = 0 AND tat.task_date > #{param.nowDay} |
| | | <if test="param.taskStatus!=null"> |
| | | AND tat.task_status = #{param.taskStatus} |
| | | </if> |
| | | ORDER BY tat.task_date DESC |
| | | </select> |
| | |
| | | import com.ruoyi.system.api.domain.poji.config.SysTag; |
| | | import com.ruoyi.system.api.domain.vo.AppOtherConfigGetVo; |
| | | import com.ruoyi.system.api.domain.vo.MgtSysSimpleUserVo; |
| | | import com.ruoyi.system.domain.dto.MgtCustomConfigDto; |
| | | import com.ruoyi.system.service.config.*; |
| | | import com.ruoyi.system.service.sys.ISysUserService; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | sysClassificationService.changeClassNum(mgtClassNumDto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * @description 获取客户电话 |
| | | * @author jqs |
| | | * @date 2023/7/29 15:26 |
| | | * @return R<String> |
| | | */ |
| | | @PostMapping("/getServicePhone") |
| | | public R<String> getServicePhone() |
| | | { |
| | | MgtCustomConfigDto mgtCustomConfigDto = new MgtCustomConfigDto(); |
| | | mgtCustomConfigDto.setConfigType("PLATFORM_SERVICE_PHONE"); |
| | | List<String> mgtCustomConfigVo = customConfigService.getCustomConfig(mgtCustomConfigDto); |
| | | String servicePhone = "暂无客服电话"; |
| | | if(mgtCustomConfigVo!=null&&mgtCustomConfigVo.size()>0){ |
| | | servicePhone = mgtCustomConfigVo.get(0); |
| | | } |
| | | return R.ok(servicePhone); |
| | | } |
| | | } |
| | |
| | | @PostMapping("/frozenUser") |
| | | public R frozenUser(@RequestBody MgtFrozenMemberDto mgtFrozenMemberDto) |
| | | { |
| | | if(mgtFrozenMemberDto.getUserId()==1){ |
| | | if(mgtFrozenMemberDto.getId()==1){ |
| | | throw new ServiceException("禁止删除admin"); |
| | | } |
| | | userService.frozenUser(mgtFrozenMemberDto); |
| | |
| | | */ |
| | | @Override |
| | | public void frozenUser(MgtFrozenMemberDto mgtFrozenMemberDto){ |
| | | Long userId = mgtFrozenMemberDto.getUserId(); |
| | | Long userId = mgtFrozenMemberDto.getId(); |
| | | SysUser sysUser = this.selectUserById(userId); |
| | | if(mgtFrozenMemberDto.getFrozenFlag()==1){ |
| | | sysUser.setStatus("1"); |