Merge branch '2.0' of http://120.76.84.145:10101/gitblit/r/java/PlayPai into 2.0
20个文件已修改
1 文件已重命名
1 文件已复制
7个文件已添加
| | |
| | | package com.dsh.account.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.account.entity.CoachType; |
| | | import com.dsh.account.entity.RechargeRecords; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.VipPayment; |
| | | import com.dsh.account.model.IncomeQuery; |
| | | import com.dsh.account.model.dto.VipPaymentDto; |
| | | import com.dsh.account.model.dto.VipRefundDto; |
| | | import com.dsh.account.model.query.RechargeRecordsQuery; |
| | | import com.dsh.account.model.query.coachQuery.CoachQuery; |
| | | import com.dsh.account.model.vo.CoachSerchVO; |
| | | import com.dsh.account.model.vo.RechargeRecordsVO; |
| | | import com.dsh.account.model.vo.VipPaymentListVO; |
| | | import com.dsh.account.service.*; |
| | | import net.bytebuddy.asm.Advice; |
| | | import io.swagger.models.auth.In; |
| | | import org.springframework.beans.BeanUtils; |
| | | 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.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 充值记录控制器 |
| | |
| | | public List<VipPayment> registrationList(@RequestBody IncomeQuery query) { |
| | | return rechargeRecordsService.listAll(query); |
| | | } |
| | | /** |
| | | * 退费 |
| | | */ |
| | | @ResponseBody |
| | | @RequestMapping("/finance/refund") |
| | | public String refund(@RequestBody VipRefundDto vipRefundDto) throws ParseException { |
| | | VipPayment vipPayment = vipPaymentService.getById(vipRefundDto.getId()); |
| | | if (vipPayment==null){ |
| | | return "500"; |
| | | } |
| | | Integer appUserId = vipPayment.getAppUserId(); |
| | | TAppUser appUser = appUserService.getById(appUserId); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date parse = simpleDateFormat.parse(vipRefundDto.getEndTime() + " 00:00:00"); |
| | | appUser.setVipEndTime( parse); |
| | | if (parse.before(new Date())){ |
| | | appUser.setIsVip(0); |
| | | } |
| | | appUserService.updateById(appUser); |
| | | vipPayment.setState(3); |
| | | vipPaymentService.updateById(vipPayment); |
| | | return "200"; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/finance/vipPayment") |
| | | List<VipPaymentListVO> vipPayment(@RequestBody VipPaymentDto vipPaymentDto){ |
| | | List<VipPaymentListVO> vipPaymentListVOS = new ArrayList<>(); |
| | | |
| | | List<Integer> payStatus = new ArrayList<>(); |
| | | payStatus.add(2); |
| | | LambdaQueryWrapper<VipPayment> vipPaymentLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | vipPaymentLambdaQueryWrapper.in(vipPaymentDto.getUserIds()!=null&&!vipPaymentDto.getUserIds().isEmpty(),VipPayment::getAppUserId, vipPaymentDto.getUserIds()); |
| | | vipPaymentLambdaQueryWrapper.in(vipPaymentDto.getVipIds()!=null&&!vipPaymentDto.getVipIds().isEmpty(),VipPayment::getVipId, vipPaymentDto.getVipIds()); |
| | | vipPaymentLambdaQueryWrapper.in(VipPayment::getPayStatus,payStatus); |
| | | vipPaymentLambdaQueryWrapper.ge(StringUtils.hasLength(vipPaymentDto.getStartTime()), VipPayment::getInsertTime, vipPaymentDto.getStartTime()); |
| | | vipPaymentLambdaQueryWrapper.le(StringUtils.hasLength(vipPaymentDto.getEndTime()), VipPayment::getInsertTime, vipPaymentDto.getEndTime()); |
| | | if (vipPaymentDto.getIsRefund()!=null&&vipPaymentDto.getIsRefund()==1){ |
| | | payStatus.add(3); |
| | | } |
| | | List<VipPayment> list = vipPaymentService.list(vipPaymentLambdaQueryWrapper); |
| | | // 使用 Stream + 手动拷贝提升性能和可读性(或使用 MapStruct) |
| | | vipPaymentListVOS = list.stream().map(vipDetail -> { |
| | | VipPaymentListVO vo = new VipPaymentListVO(); |
| | | BeanUtils.copyProperties(vipDetail,vo); // 注意参数顺序是否正确 |
| | | return vo; |
| | | }).collect(Collectors.toList()); |
| | | for (VipPaymentListVO vipPaymentListVO : vipPaymentListVOS) { |
| | | if (vipPaymentListVO.getPayStatus()==2){ |
| | | vipPaymentListVO.setIsRefund(0); |
| | | }else { |
| | | vipPaymentListVO.setIsRefund(1); |
| | | } |
| | | } |
| | | return vipPaymentListVOS; |
| | | } |
| | | } |
| | |
| | | @TableField("payType") |
| | | private Integer payType; |
| | | /** |
| | | * 支付状态(1=待支付,2=已支付) |
| | | * 支付状态(1=待支付,2=已支付 3=已退款) |
| | | */ |
| | | @TableField("payStatus") |
| | | private Integer payStatus; |
| | |
| | | */ |
| | | @TableField("couponJson") |
| | | private String couponJson; |
| | | /** |
| | | * 退款备注 |
| | | */ |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | |
| | | public static String CODE() { |
New file |
| | |
| | | package com.dsh.account.model.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 会员权益明细 |
| | | */ |
| | | @Data |
| | | public class VipPaymentDto { |
| | | // 会员ids |
| | | List<Integer> vipIds; |
| | | // 用户ids |
| | | List<Integer> userIds; |
| | | |
| | | // 是否退款 0否1是 |
| | | Integer isRefund; |
| | | // 下单时间开始 |
| | | String startTime; |
| | | // 下单时间结束 |
| | | String endTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 会员退费DTO |
| | | */ |
| | | @Data |
| | | public class VipRefundDto { |
| | | |
| | | // 会员支付记录id |
| | | String id; |
| | | // 会员到期时间 |
| | | String endTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 会员订单列表 |
| | | */ |
| | | @Data |
| | | public class VipPaymentListVO { |
| | | @ApiModelProperty(value = "主键") |
| | | private Integer id; |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String code; |
| | | @ApiModelProperty(value = "用户id") |
| | | private Integer appUserId; |
| | | @ApiModelProperty(value = "用户名称") |
| | | private String appUserName; |
| | | @ApiModelProperty(value = "用户电话") |
| | | private String appUserPhone; |
| | | @ApiModelProperty(value = "会员名称") |
| | | private String vipName; |
| | | @ApiModelProperty(value = "会员id") |
| | | private Integer vipId; |
| | | @ApiModelProperty(value = "会员时长") |
| | | private String vipTime; |
| | | @ApiModelProperty(value = "金额¥") |
| | | private String amountValue; |
| | | @ApiModelProperty(value = "金额") |
| | | private Double amount; |
| | | @ApiModelProperty(value = "下单时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | @ApiModelProperty(value = "是否退款 0否1时") |
| | | private Integer isRefund; |
| | | @ApiModelProperty(value = "备注") |
| | | private Integer remark; |
| | | |
| | | /** |
| | | * 支付方式(1=微信,2=支付宝) |
| | | */ |
| | | @TableField("payType") |
| | | private Integer payType; |
| | | /** |
| | | * 支付状态(1=待支付,2=已支付 3=已退款) |
| | | */ |
| | | @TableField("payStatus") |
| | | private Integer payStatus; |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | @TableField("payTime") |
| | | private Date payTime; |
| | | /** |
| | | * 第三方流水号 |
| | | */ |
| | | @TableField("orderNumber") |
| | | private String orderNumber; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "现金") |
| | | private BigDecimal cash; |
| | | |
| | | @ApiModelProperty(value = "兑换方式(1=积分,2=积分+现金 3=现金 4=会员赠送 当该字段为4时 展示的二维码内容增加一个vipDetail:当前数据id)") |
| | | @ApiModelProperty(value = "兑换方式(1=积分,2=积分+现金 3=现金 4=会员赠送 当该字段为4时切goodType=3门票时 展示的二维码内容增加一个vipDetail:当前数据id)") |
| | | private Integer exchangeType; |
| | | |
| | | @ApiModelProperty(value = "有效期开始时间") |
| | |
| | | |
| | | private String key = "6f5e0c2dcabfa9c27b5da5836a362fef";//微信商户号 |
| | | |
| | | private String callbackPath = "https://online.daowepark.com:443/account";//支付回调网关地址 |
| | | // private String callbackPath = "https://online.daowepark.com:443/account";//支付回调网关地址 |
| | | private String callbackPath = "https://y6cgd7wo3ooa.guyubao.com/account";//支付回调网关地址 |
| | | |
| | | private String app_cert_path = "C:/cert/alipay/user/app_cert_path.crt";//应用公钥证书路径 |
| | | |
| | |
| | | import com.dsh.activity.model.CouponListVo; |
| | | import com.dsh.activity.model.CouponRecordQuery; |
| | | import com.dsh.activity.model.VipDetailVO; |
| | | import com.dsh.activity.model.request.CommodityRequest; |
| | | import com.dsh.activity.model.request.CouponDataVo; |
| | | import com.dsh.activity.model.request.CouponPackageReq; |
| | | import com.dsh.activity.model.request.VipDetailDto; |
| | | import com.dsh.activity.model.VipPaymentVO; |
| | | import com.dsh.activity.model.request.*; |
| | | import com.dsh.activity.model.response.CouponPackageResp; |
| | | import com.dsh.activity.service.*; |
| | | import com.dsh.activity.util.GDMapGeocodingUtil; |
| | |
| | | |
| | | @Resource |
| | | private StudentClient studentClient; |
| | | @Resource |
| | | private PointsMerchandiseService pointsMerchandiseService; |
| | | |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/coupon/vipDetail") |
| | | @ResponseBody |
| | | List<VipDetailVO> vipDetail(VipDetailDto vipDetailDto){ |
| | | List<VipDetailVO> vipDetail(@RequestBody VipDetailDto vipDetailDto){ |
| | | List<PointsMerchandise> pointsMerchandiseList = pointsMerchandiseService.list(); |
| | | List<VipDetailVO> vipDetailVOS = new ArrayList<>(); |
| | | List<VipDetail> list = vipDetailService.lambdaQuery() |
| | | .in(!vipDetailDto.getVipIds().isEmpty(), VipDetail::getVipId, vipDetailDto.getVipIds()) |
| | | .in(!vipDetailDto.getUserIds().isEmpty(), VipDetail::getAppUserId, vipDetailDto.getUserIds()) |
| | | .in(!vipDetailDto.getStoreIds().isEmpty(), VipDetail::getUseStoreId, vipDetailDto.getStoreIds()) |
| | | .in(vipDetailDto.getVipIds()!=null&&!vipDetailDto.getVipIds().isEmpty(), VipDetail::getVipId, vipDetailDto.getVipIds()) |
| | | .in(vipDetailDto.getUserIds()!=null&&!vipDetailDto.getUserIds().isEmpty(), VipDetail::getAppUserId, vipDetailDto.getUserIds()) |
| | | .in(vipDetailDto.getStoreIds()!=null&&!vipDetailDto.getStoreIds().isEmpty(), VipDetail::getUseStoreId, vipDetailDto.getStoreIds()) |
| | | .ge(StringUtils.hasLength(vipDetailDto.getStartTime()), VipDetail::getInsertTime, vipDetailDto.getStartTime()) |
| | | .le(StringUtils.hasLength(vipDetailDto.getEndTime()), VipDetail::getInsertTime, vipDetailDto.getEndTime()) |
| | | .ge(StringUtils.hasLength(vipDetailDto.getUseStartTime()), VipDetail::getUseTime, vipDetailDto.getUseStartTime()) |
| | |
| | | if (coupon!=null){ |
| | | vipDetailVO.setTicketName(coupon.getName()); |
| | | vipDetailVO.setGoodsName(coupon.getName()); |
| | | if (coupon.getType()==4){ |
| | | // 查询抵扣商品 |
| | | PointsMerchandise pointsMerchandise1 = pointsMerchandiseList.stream().filter(pointsMerchandise -> pointsMerchandise.getId().equals(coupon.getGoodsId())) |
| | | .findFirst().orElse(null); |
| | | if (pointsMerchandise1 != null){ |
| | | vipDetailVO.setGoodsName(pointsMerchandise1.getName()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | return vipDetailVOS; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询注册赠送优惠券 判断当前优惠券限领数量 |
| | | */ |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("appUserId") |
| | | private Integer appUserId; |
| | | |
| | | @ApiModelProperty(value = "使用状态 1待使用 2已使用 3已过期") |
| | | |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "获取时间") |
| | | @TableField("insertTime") |
| | | |
| | | private Date insertTime; |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | @TableField("vipId") |
| | | |
| | | private Integer vipId; |
| | | |
| | | @ApiModelProperty(value = "会员权益类型 1优惠券 2门票") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "会员支付记录id") |
| | | @TableField("vipPaymentId") |
| | | private Integer vipPaymentId; |
| | | |
| | | @ApiModelProperty(value = "优惠券id") |
| | | @TableField("couponId") |
| | | |
| | | private Integer couponId; |
| | | |
| | | @ApiModelProperty(value = "门票名称") |
| | | @TableField("ticketName") |
| | | |
| | | private String ticketName; |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | @TableField("startTime") |
| | | |
| | | private Date startTime; |
| | | |
| | | @ApiModelProperty(value = "结束时间") |
| | | @TableField("endTime") |
| | | |
| | | private Date endTime; |
| | | |
| | | @ApiModelProperty(value = "可用次数") |
| | | @TableField("useCount") |
| | | |
| | | private Integer useCount; |
| | | |
| | | @ApiModelProperty(value = "使用门店id") |
| | | @TableField("useStoreId") |
| | | |
| | | private Integer useStoreId; |
| | | |
| | | @ApiModelProperty(value = "使用场地id") |
| | | @TableField("useSiteId") |
| | | |
| | | private Integer useSiteId; |
| | | @ApiModelProperty(value = "使用商品id") |
| | | private Integer useGoodsId; |
| | | |
| | | @ApiModelProperty(value = "使用时间") |
| | | @TableField("useTime") |
| | | |
| | | private Date useTime; |
| | | |
| | | @ApiModelProperty(value = "运营商id") |
| | | @TableField("operatorId") |
| | | |
| | | private Integer operatorId; |
| | | |
| | | @ApiModelProperty(value = "用户优惠券id") |
| | | @TableField("userCouponId") |
| | | |
| | | private Long userCouponId; |
| | | } |
| | |
| | | @ApiModelProperty(value = "使用场地id") |
| | | private Integer useSiteId; |
| | | |
| | | @ApiModelProperty(value = "使用商品id") |
| | | private Integer useGoodsId; |
| | | |
| | | @ApiModelProperty(value = "使用商品/场地名称") |
| | | private String goodsName; |
| | | |
File was renamed from cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/vo/VipPaymentVO.java |
| | |
| | | package com.dsh.guns.modular.system.model.vo; |
| | | package com.dsh.activity.model; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
New file |
| | |
| | | package com.dsh.activity.model.request; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 会员权益明细 |
| | | */ |
| | | @Data |
| | | public class VipPaymentDto { |
| | | // 会员ids |
| | | List<Integer> vipIds; |
| | | // 用户ids |
| | | List<Integer> userIds; |
| | | |
| | | // 是否退款 0否1是 |
| | | Integer isRefund; |
| | | // 下单时间开始 |
| | | String startTime; |
| | | // 下单时间结束 |
| | | String endTime; |
| | | |
| | | } |
| | |
| | | |
| | | import com.dsh.course.feignClient.account.model.VipPayment; |
| | | import com.dsh.guns.modular.system.model.IncomeQuery; |
| | | import com.dsh.guns.modular.system.model.dto.VipPaymentDto; |
| | | import com.dsh.guns.modular.system.model.dto.VipRefundDto; |
| | | import com.dsh.guns.modular.system.model.vo.VipPaymentListVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | |
| | | */ |
| | | @RequestMapping("/finance/vipPaymentList") |
| | | List<VipPayment> registrationList(@RequestBody IncomeQuery query); |
| | | @PostMapping("/finance/vipPayment") |
| | | List<VipPaymentListVO> vipPayment(@RequestBody VipPaymentDto vipPaymentDto); |
| | | @RequestMapping("/finance/refund") |
| | | String refund(@RequestBody VipRefundDto vipRefundDto); |
| | | |
| | | } |
| | |
| | | import com.dsh.guns.modular.system.model.CouponDataVo; |
| | | import com.dsh.guns.modular.system.model.CouponStore; |
| | | 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.VipPaymentListVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | @PostMapping("/base/pointMerchars/goodsList") |
| | | List<PointsMerchandise> goodsList(); |
| | | @PostMapping("/base/coupon/vipDetail") |
| | | List<VipDetailVO> vipDetail(VipDetailDto vipDetailDto); |
| | | List<VipDetailVO> vipDetail(@RequestBody VipDetailDto vipDetailDto); |
| | | @PostMapping("/base/coupon/vipPayment") |
| | | List<VipPaymentListVO> vipPayment(@RequestBody VipPaymentDto vipPaymentDto); |
| | | } |
| | |
| | | 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("退费失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | private ITSiteService siteService; |
| | | @Autowired |
| | | private TOperatorService operatorService; |
| | | private String PREFIX = "/system/vip/"; |
| | | private String PREFIX = "/system/vipDetail/"; |
| | | |
| | | |
| | | /** |
| | |
| | | // 是否退款 0否1是 |
| | | Integer isRefund; |
| | | // 下单时间开始 |
| | | String useStartTime; |
| | | String startTime; |
| | | // 下单时间结束 |
| | | String useEndTime; |
| | | String endTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model.dto; |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 会员退费DTO |
| | | */ |
| | | @Data |
| | | public class VipRefundDto { |
| | | |
| | | // 会员支付记录id |
| | | String id; |
| | | // 会员到期时间 |
| | | String endTime; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "使用场地id") |
| | | private Integer useSiteId; |
| | | |
| | | @ApiModelProperty(value = "使用商品id") |
| | | private Integer useGoodsId; |
| | | |
| | | @ApiModelProperty(value = "使用商品/场地名称") |
| | | private String goodsName; |
| | | |
copy from cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/vo/VipPaymentVO.java
copy to cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/vo/VipPaymentListVO.java
File was copied from cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/vo/VipPaymentVO.java |
| | |
| | | package com.dsh.guns.modular.system.model.vo; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | * 会员订单列表 |
| | | */ |
| | | @Data |
| | | public class VipPaymentVO { |
| | | public class VipPaymentListVO { |
| | | @ApiModelProperty(value = "主键") |
| | | private Integer id; |
| | | @ApiModelProperty(value = "订单编号") |
| | |
| | | @ApiModelProperty(value = "金额¥") |
| | | private String amountValue; |
| | | @ApiModelProperty(value = "金额") |
| | | private BigDecimal amount; |
| | | private Double amount; |
| | | @ApiModelProperty(value = "下单时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | |
| | | @ApiModelProperty(value = "备注") |
| | | private Integer remark; |
| | | |
| | | /** |
| | | * 支付方式(1=微信,2=支付宝) |
| | | */ |
| | | @TableField("payType") |
| | | private Integer payType; |
| | | /** |
| | | * 支付状态(1=待支付,2=已支付 3=已退款) |
| | | */ |
| | | @TableField("payStatus") |
| | | private Integer payStatus; |
| | | /** |
| | | * 支付时间 |
| | | */ |
| | | @TableField("payTime") |
| | | private Date payTime; |
| | | /** |
| | | * 第三方流水号 |
| | | */ |
| | | @TableField("orderNumber") |
| | | private String orderNumber; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | |
| | | } |
| | |
| | | <option value="1">满减券</option> |
| | | <option value="2">折扣券</option> |
| | | <option value="3">体验券</option> |
| | | <option value="4">抵扣券</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | |
| | | <option value="1">满减券</option> |
| | | <option value="2">折扣券</option> |
| | | <option value="3">体验券</option> |
| | | <option value="4">抵扣券</option> |
| | | |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>会员权益使用明细</h5> |
| | | </div> |
| | | |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="appUserName" name="用户姓名" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="phone" name="电话" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="vipName" name="会员卡名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 是否退费 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="type" > |
| | | <option value="">全部</option> |
| | | <option value="1">是</option> |
| | | <option value="2">否</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | |
| | | <div class="col-sm-3"> |
| | | <#TimeCon id="time" name="下单时间" isTime="false"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCompetition.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="导出" icon="fa-plus" clickFun="TCompetition.export()"/> |
| | | </div> |
| | | <#table id="TCompetitionTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/vipPayment/vipPayment.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time' |
| | | , trigger: 'click' |
| | | , range: true |
| | | }); |
| | | |
| | | </script> |
| | | |
| | | @} |
| | |
| | | TStudent.openDetail = function (e) { |
| | | console.log("看看") |
| | | console.log(e) |
| | | |
| | | var index = layer.load(1,{ |
| | | type: 1 |
| | | , title: '设备二维码' |
| | |
| | | }, |
| | | {title: '优惠券类型', field: 'type', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "满减券", 2: "代金券", 3: "体验券"}[value] |
| | | return {1: "满减券", 2: "代金券", 3: "体验券",4:"抵扣券"}[value] |
| | | }}, |
| | | {title: '发放方式', field: 'distributionMethod', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | |
| | | }, |
| | | {title: '优惠券类型', field: 'type', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "满减券", 2: "代金券", 3: "体验券"}[value] |
| | | return {1: "满减券", 2: "代金券", 3: "体验券",4:"抵扣券"}[value] |
| | | }}, |
| | | {title: '发放方式', field: 'distributionMethod', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | /** |
| | | * 下架 |
| | | */ |
| | | Vip.offShelf = function () { |
| | | if (this.check()){ |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | const data1 = { |
| | | siteIds:[], |
| | | type:null |
| | | }; |
| | | selected.forEach(function(obj) { |
| | | var id = obj.id; |
| | | data1.siteIds.push(id); |
| | | }); |
| | | data1.type = 2; |
| | | $.ajax({ |
| | | url: Feng.ctxPath + "/tSite/changeState", |
| | | type: "POST", |
| | | contentType: "application/json", // 设置请求头的 Content-Type |
| | | data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 |
| | | success: function(response) { |
| | | Feng.success("下架成功!"); |
| | | Vip.search(); |
| | | }, |
| | | error: function(xhr, status, error) { |
| | | var errorMessage = xhr.responseText ? xhr.responseText : "下架失败!"; |
| | | Feng.error("您的网络异常!"); |
| | | } |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 跳转添加场地页面 |
| | | */ |
| | |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | var table = new BSTable(TCompetition.id, "/vipDetail/list", defaultColunms); |
| | | var table = new BSTable(TCompetition.id, "/vipPayment/list", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TCompetition.table = table.init(); |
| | | TCompetition.getAmount(); |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var TCompetition = { |
| | | id: "TCompetitionTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | var role =$("#role").val() |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '序号', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '订单编号', field: 'code', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '用户姓名', field: 'appUserName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '联系电话', field: 'appUserPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '会员卡名称', field: 'vipName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '时长', field: 'vipTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '金额', field: 'amountValue', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '下单时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '是否退费', field: 'isRefund', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data) { |
| | | return {0:"否",1:"是"}[data] |
| | | } |
| | | }, |
| | | {title: '备注', field: 'remark', visible: true, align: 'center', valign: 'middle'}, |
| | | { title: '操作', field: 'remark', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (data,row) { |
| | | // row.redCode存储的设备二维码连接 |
| | | var temp = row.isRefund; |
| | | var id = row.id; |
| | | // 已退费不展示按钮 |
| | | if (temp==0){ |
| | | var str = '<button class="btn btn-outline btn-primary" onclick="TCompetition.refund(\'' + id + '\')" >'+'会员退费'+'</button>' |
| | | btn = ['<p class="toolTip" style="overflow:hidden;white-space:nowrap;text-overflow:ellipsis;" title="" onfocus="TUser.tooltip()">' + str + '</p>'] |
| | | return btn; |
| | | }else{ |
| | | return '已退费'; |
| | | } |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | /** |
| | | * 打开编辑 |
| | | */ |
| | | TCompetition.refund = function (e) { |
| | | console.log("退款记录id") |
| | | console.log( e) |
| | | const data1 = { |
| | | id:null, |
| | | vipEndTime:"" |
| | | |
| | | }; |
| | | var index = layer.load(1,{ |
| | | type: 1 |
| | | , title: '会员退费' |
| | | , area: ['800px', '600px'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: '<div class="form-horizontal" style="padding-top: 20px;">' + |
| | | ' <div class="col-sm-11" >' + |
| | | ' <div class="col-sm-11">' + |
| | | ' <div class="form-group">\n' + |
| | | '<label class="col-sm-3 control-label">*会员到期时间:</label>'+ |
| | | '<div class="col-sm-9">'+ |
| | | '<input style="width: 300px" class="form-control" id="vipEndTime" name="vipEndTime" type="date">'+ |
| | | '</div>'+ |
| | | ' <div class="form-group refusal" >\n' + |
| | | ' <label class="col-sm-3 control-label">备注:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <textarea id="refusal" class="form-control" style="width: 100%;height: 200px"></textarea>'+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>' |
| | | , btn: ['保存', '关闭'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | ,load:1 |
| | | , yes: function () { |
| | | var vipEndTime = $("#vipEndTime").val(); |
| | | if(vipEndTime==null || vipEndTime==''){ |
| | | Feng.error("请选择会员到期时间!"); |
| | | return; |
| | | } |
| | | data1.id = e; |
| | | data1.vipEndTime = $("#vipEndTime").val(); |
| | | $.ajax({ |
| | | url: Feng.ctxPath + "/vipDetail/refund", |
| | | type: "POST", |
| | | contentType: "application/json", // 设置请求头的 Content-Type |
| | | data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 |
| | | success: function(response) { |
| | | Feng.success("操作成功!"); |
| | | window.location.reload(); |
| | | layer.closeAll(); |
| | | }, |
| | | error: function(xhr, status, error) { |
| | | var errorMessage = xhr.responseText ? xhr.responseText : "退费失败!"; |
| | | Feng.error("退费失败!"); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | this.layerIndex = index; |
| | | |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCompetition.search = function () { |
| | | var queryData = {}; |
| | | queryData['appUserName'] = $("#appUserName").val(); |
| | | queryData['vipName'] = $("#vipName").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['isRefund'] = $("#isRefund").val(); |
| | | queryData['time'] = $("#time").val(); |
| | | TCompetition.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | |
| | | TCompetition.resetSearch = function () { |
| | | $("#appUserName").val(""); |
| | | $("#vipName").val(""); |
| | | $("#phone").val(""); |
| | | $("#isRefund").val(""); |
| | | $("#time").val(""); |
| | | TCompetition.search(); |
| | | }; |
| | | |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | var table = new BSTable(TCompetition.id, "/vipDetail/list", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TCompetition.table = table.init(); |
| | | TCompetition.getAmount(); |
| | | |
| | | }); |
| | | |
| | | /** |
| | | * 下载模板 |
| | | */ |
| | | TCompetition.uploadCarModel = function () { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/uploadCarModel"; |
| | | } |
| | | |
| | | var agreement = function(){ |
| | | this.init = function(){ |
| | | //模拟上传excel |
| | | $("#uploadEventBtn").unbind("click").bind("click",function(){ |
| | | $("#uploadEventFile").click(); |
| | | }); |
| | | }; |
| | | } |
| | | /** |
| | | * 导入合同 |
| | | */ |
| | | TCompetition.exporTCompetition = function () { |
| | | var uploadEventFile = $("#uploadEventFile").val(); |
| | | if(uploadEventFile == ''){ |
| | | if(language==1){ |
| | | Feng.info("请选择Excel,再上传"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select Excel and upload"); |
| | | }else { |
| | | Feng.info("Silakan pilih Excel dan upload"); |
| | | } |
| | | }else if(uploadEventFile.lastIndexOf(".xls")<0){//可判断以.xls和.xlsx结尾的excel |
| | | if(language==1){ |
| | | Feng.info("只能上传Excel文件"); |
| | | }else if(language==2){ |
| | | Feng.info("Only Excel files can be uploaded"); |
| | | }else { |
| | | Feng.info("Hanya berkas Excel yang dapat diunggah"); |
| | | } |
| | | }else{ |
| | | var url = Feng.ctxPath + '/TCompetition/exporTCompetition'; |
| | | var file = document.querySelector('input[name=file]').files[0]; |
| | | var reader = new FileReader(); |
| | | if (file) { |
| | | var formData = new FormData(); |
| | | formData.append("myfile", file); |
| | | this.sendAjaxRequest(url, 'POST', formData); |
| | | } |
| | | } |
| | | } |
| | | TCompetition.sendAjaxRequest = function(url,type,data){ |
| | | $.ajax({ |
| | | url : url, |
| | | type : type, |
| | | data : data, |
| | | success : function(result) { |
| | | if(result.code==500) { |
| | | Feng.info(result.message); |
| | | }else { |
| | | if(language==1){ |
| | | Feng.success("导入成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("SUCCESSFUL IMPORT!"); |
| | | }else { |
| | | Feng.success("Import berhasil!"); |
| | | } |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, |
| | | error : function() { |
| | | if(language==1){ |
| | | Feng.error("excel上传失败!"); |
| | | }else if(language==2){ |
| | | Feng.error("Uploading excel Fails. Procedure!"); |
| | | }else { |
| | | Feng.error("Gagal mengunggah excel!"); |
| | | } |
| | | }, |
| | | cache : false, |
| | | contentType : false, |
| | | processData : false |
| | | }); |
| | | }; |
| | | |
| | | var agreement; |
| | | $(function(){ |
| | | agreement = new agreement(); |
| | | agreement.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 导出车辆操作 |
| | | */ |
| | | TCompetition.ouTCompetition = function () { |
| | | var operation = function() { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/ouTCompetition"; |
| | | }; |
| | | if(language==1){ |
| | | Feng.confirm("是否确认导出车辆信息?", operation); |
| | | }else if(language==2){ |
| | | Feng.confirm("Are you sure to export vehicle information?", operation); |
| | | }else { |
| | | Feng.confirm("Apakah Anda pasti akan mengekspor informasi kendaraan?", operation); |
| | | } |
| | | } |