| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.dsh.course.feignClient.account.AppUserClient; |
| | | import com.dsh.course.feignClient.account.VipPaymentClient; |
| | | import com.dsh.course.feignClient.account.model.QueryByNamePhone; |
| | | import com.dsh.course.feignClient.account.model.TAppUser; |
| | | import com.dsh.course.feignClient.activity.CouponClient; |
| | | import com.dsh.course.feignClient.activity.model.HuiminPayQuery; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.modular.system.model.*; |
| | |
| | | @Autowired |
| | | private CouponClient couponClient; |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | private IRelationService relationService; |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | @Autowired |
| | | private VipPaymentClient vipPaymentClient; |
| | | @Autowired |
| | | private IUserService userService; |
| | | @Autowired |
| | | private IRoleService roleService; |
| | | @Autowired |
| | | private ITSiteService siteService; |
| | | @Autowired |
| | |
| | | , Integer isRefund |
| | | , String time |
| | | ) { |
| | | // 判断当前是否有权限 |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | int count = relationService.count(new LambdaQueryWrapper<Relation>().eq(Relation::getRoleid, roleid).eq(Relation::getMenuid, 646)); |
| | | VipPaymentDto vipPaymentDto = new VipPaymentDto(); |
| | | if (StringUtils.hasLength(vipName)){ |
| | | List<Integer> vipIds = vipService.lambdaQuery().like(Vip::getVipName, vipName) |
| | |
| | | TAppUser appUser = tAppUsers.stream().filter(e -> e.getId().equals(re.getAppUserId())).findFirst().orElse(null); |
| | | if (appUser!=null){ |
| | | re.setAppUserName(appUser.getName()); |
| | | re.setAppUserPhone(appUser.getName()); |
| | | re.setAppUserPhone(appUser.getPhone()); |
| | | } |
| | | if (count>0){ |
| | | re.setMenuShow(1); |
| | | } |
| | | |
| | | } |
| | | |
| | | return res; |
| | | } |
| | | /** |
| | |
| | | @RequestMapping(value = "/refund") |
| | | @ResponseBody |
| | | public Object list(@RequestBody VipRefundDto vipRefundDto) { |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | User user = userService.getById(UserExt.getUser().getId()); |
| | | String roleid = user.getRoleid(); |
| | | Role role = roleService.getById(roleid); |
| | | if (!role.getName().contains("财务")){ |
| | | return ResultUtil.error("权限不足"); |
| | | } |
| | | String code =vipPaymentClient.refund(vipRefundDto); |
| | | if (code!=null&& code.equals("200")){ |
| | | return ResultUtil.success(); |
| | | return ResultUtil.success("操作成功"); |
| | | }else{ |
| | | return ResultUtil.error("退费失败"); |
| | | } |