| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | 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.Coupon; |
| | | import com.dsh.course.feignClient.activity.model.CouponCity; |
| | | import com.dsh.course.feignClient.activity.model.TicketDetailVO; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.model.dto.VipDetailDto; |
| | | import com.dsh.guns.modular.system.model.dto.VipPaymentDto; |
| | | import com.dsh.guns.modular.system.model.vo.VipDetailVO; |
| | | import com.dsh.guns.modular.system.model.vo.VipPaymentVO; |
| | | import com.dsh.guns.modular.system.model.dto.VipRefundDto; |
| | | import com.dsh.guns.modular.system.model.vo.VipPaymentListVO; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | @Autowired |
| | | private VipPaymentClient vipPaymentClient; |
| | | @Autowired |
| | | private ITSiteService siteService; |
| | | @Autowired |
| | | private TOperatorService operatorService; |
| | |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public List<VipPaymentVO> list(String appUserName |
| | | public List<VipPaymentListVO> list(String appUserName |
| | | , String phone, String vipName |
| | | , Integer isRefund |
| | | , String time |
| | |
| | | vipPaymentDto.setUserIds(userIds); |
| | | } |
| | | } |
| | | return null; |
| | | vipPaymentDto.setIsRefund(isRefund); |
| | | if (StringUtils.hasLength(time)){ |
| | | String stareTime = null; |
| | | String endTime = null; |
| | | stareTime = time.split(" - ")[0] + " 00:00:00"; |
| | | endTime = time.split(" - ")[1] + " 23:59:59"; |
| | | vipPaymentDto.setStartTime(stareTime); |
| | | vipPaymentDto.setEndTime(endTime); |
| | | } |
| | | QueryByNamePhone queryByNamePhone = new QueryByNamePhone(); |
| | | List<TAppUser> tAppUsers = appUserClient.queryByNamePhone(queryByNamePhone); |
| | | List<Vip> vipList = vipService.list(); |
| | | List<VipPaymentListVO> res =vipPaymentClient.vipPayment(vipPaymentDto); |
| | | for (VipPaymentListVO re : res) { |
| | | Vip vip = vipList.stream().filter(e -> e.getId().equals(re.getVipId())).findFirst().orElse(null); |
| | | if (vip!=null){ |
| | | re.setVipName(vip.getVipName()); |
| | | Integer timeType = vip.getTimeType(); |
| | | Integer time1 = vip.getTime(); |
| | | switch (timeType){ |
| | | case 1: |
| | | re.setVipTime(time1 + "天"); |
| | | break; |
| | | case 2: |
| | | re.setVipTime(time1 + "月"); |
| | | break; |
| | | case 3: |
| | | re.setVipTime(time1 + "年"); |
| | | break; |
| | | } |
| | | } |
| | | re.setAmountValue("¥"+re.getAmount().toString()); |
| | | 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()); |
| | | } |
| | | } |
| | | return res; |
| | | } |
| | | /** |
| | | * 退费 |
| | | */ |
| | | @RequestMapping(value = "/refund") |
| | | @ResponseBody |
| | | public Object list(@RequestBody VipRefundDto vipRefundDto) { |
| | | String code =vipPaymentClient.refund(vipRefundDto); |
| | | if (code!=null&& code.equals("200")){ |
| | | return ResultUtil.success(); |
| | | }else{ |
| | | return ResultUtil.error("退费失败"); |
| | | } |
| | | } |
| | | |
| | | |