| | |
| | | private CoursePackageClient coursePackageClient; |
| | | |
| | | /** |
| | | * 查询惠民卡绑定学员列表信息 |
| | | * 查询玩湃惠民卡绑定学员列表信息 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | private HuiminAgreementSettingService huiminAgreementSettingService; |
| | | |
| | | /** |
| | | * 根据当前用户类型查询惠民卡协议 |
| | | * 根据当前用户类型查询玩湃惠民卡协议 |
| | | * @param query |
| | | * @return |
| | | */ |
| | |
| | | return huiminAgreement; |
| | | } |
| | | /** |
| | | * 保存惠民卡协议 |
| | | * 保存玩湃惠民卡协议 |
| | | * @param tHuiminAgreement |
| | | */ |
| | | @PostMapping("/base/tHuiminAgreement/save") |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 惠民卡回调 |
| | | * 玩湃惠民卡回调 |
| | | * @author zhibing.pu |
| | | * @date 2023/6/24 11:27 |
| | | */ |
| | |
| | | |
| | | |
| | | /** |
| | | * 惠民卡支付宝支付回调接口 |
| | | * 玩湃惠民卡支付宝支付回调接口 |
| | | */ |
| | | @PostMapping("/aliPayHuiminCallback") |
| | | public void aliPayHuiminCallback(HttpServletRequest request, HttpServletResponse response) { |
| | |
| | | } |
| | | } |
| | | /** |
| | | * 惠民卡微信支付回调接口 |
| | | * 玩湃惠民卡微信支付回调接口 |
| | | */ |
| | | @PostMapping("/weixinPayHuiminCallback") |
| | | public void weixinPayHuiminCallback(HttpServletRequest request, HttpServletResponse response) { |
| | |
| | | } |
| | | } |
| | | /** |
| | | * 惠民卡微信退款回调 |
| | | * 玩湃惠民卡微信退款回调 |
| | | * @param request |
| | | * @param response |
| | | */ |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/huimin") |
| | | @Api(tags = "惠民卡新增") |
| | | @Api(tags = "玩湃惠民卡新增") |
| | | public class HuiminController { |
| | | |
| | | @Autowired |
| | |
| | | |
| | | |
| | | /** |
| | | * 查看惠民卡详情 |
| | | * 查看玩湃惠民卡详情 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/payHuiminCard") |
| | | @ApiOperation(value = "购买惠民卡") |
| | | @ApiOperation(value = "购买玩湃惠民卡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "惠民卡id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "玩湃惠民卡id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "支付方式1微信2支付宝", name = "payType", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "绑定学员ids多,个逗号拼接", name = "studentIds", dataType = "String", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | } |
| | | THuiminCard huiminCard = huiminCardService.getById(id); |
| | | if (huiminCard.getEndTime() != null && huiminCard.getEndTime().before(new Date())) { |
| | | return ResultUtil.error("该惠民卡已过期"); |
| | | return ResultUtil.error("该玩湃惠民卡已过期"); |
| | | } |
| | | if (huiminCard.getGrantCount() != null) { |
| | | if (huiminCard.getGrantCount() <= payHuiminService.lambdaQuery().eq(TPayHuimin::getCardId, huiminCard.getId()) |
| | | .eq(TPayHuimin::getStatus, 2).count()) { |
| | | return ResultUtil.error("该惠民卡已售完"); |
| | | return ResultUtil.error("该玩湃惠民卡已售完"); |
| | | } |
| | | } |
| | | if (huiminCard.getLimitCount() != null) { |
| | |
| | | .eq(TPayHuimin::getStatus, 2) |
| | | .eq(TPayHuimin::getAppUserId, uid) |
| | | .count()) { |
| | | return ResultUtil.error("该惠民卡购买次数已达上限"); |
| | | return ResultUtil.error("该玩湃惠民卡购买次数已达上限"); |
| | | } |
| | | } |
| | | TPayHuimin tPayHuimin = new TPayHuimin(); |
| | |
| | | BigDecimal bigDecimal = new BigDecimal(studentIds.split(",").length); |
| | | switch (payType) { |
| | | case 1: |
| | | return payMoneyUtil.weixinpay("购买惠民卡" + "-" + 0, "", tPayHuimin.getCode(), tPayHuimin.getSalesMoney().toString(), |
| | | return payMoneyUtil.weixinpay("购买玩湃惠民卡" + "-" + 0, "", tPayHuimin.getCode(), tPayHuimin.getSalesMoney().toString(), |
| | | "/base/huimin/callBack/weixinPayHuiminCallback", "APP", ""); |
| | | case 2: |
| | | String string = tPayHuimin.getSalesMoney().toString(); |
| | | return payMoneyUtil.alipay(smid, "购买惠民卡", "购买惠民卡", "", tPayHuimin.getCode(), string, |
| | | return payMoneyUtil.alipay(smid, "购买玩湃惠民卡", "购买玩湃惠民卡", "", tPayHuimin.getCode(), string, |
| | | "/base/huimin/callBack/aliPayHuiminCallback"); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * 查看惠民卡详情 |
| | | * 查看玩湃惠民卡详情 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getHuiminCardDetail") |
| | | @ApiOperation(value = "查看惠民卡详情") |
| | | @ApiOperation(value = "查看玩湃惠民卡详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "惠民卡id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "玩湃惠民卡id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "门店id", name = "storeId", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 惠民卡富文本内容-惠民卡列表 |
| | | * 玩湃惠民卡富文本内容-玩湃惠民卡列表 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getHuiminAgreementAndList") |
| | | @ApiOperation(value = "惠民卡富文本内容-惠民卡列表") |
| | | @ApiOperation(value = "玩湃惠民卡富文本内容-玩湃惠民卡列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "页码,首页1", name = "pageSize", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "页条数", name = "pageNo", dataType = "int", required = true), |
| | |
| | | |
| | | List<THuiminCard> cardListNolimit = huiminCardService.getHuiminAgreementAndListNolimit(storeId); |
| | | if (cardListNolimit.isEmpty()) { |
| | | // 没有配置惠民卡 展示富文本内容 |
| | | // 没有配置玩湃惠民卡 展示富文本内容 |
| | | huiminAgreementVO.setShowType(1); |
| | | } else { |
| | | huiminAgreementVO.setShowType(2); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 惠民卡列表-根据惠民卡获取已购买绑定惠民卡的学员列表 |
| | | * 玩湃惠民卡列表-根据玩湃惠民卡获取已购买绑定玩湃惠民卡的学员列表 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getStudentListByCarId") |
| | | @ApiOperation(value = "惠民卡列表-根据惠民卡获取已购买绑定惠民卡的学员列表") |
| | | @ApiOperation(value = "玩湃惠民卡列表-根据玩湃惠民卡获取已购买绑定玩湃惠民卡的学员列表") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "惠民卡id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "玩湃惠民卡id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<TStudent>> getStudentListByCarId(Integer id) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 惠民卡列表-选择学员后返回对应的二维码生成规则和有效期结束时间 |
| | | * 玩湃惠民卡列表-选择学员后返回对应的二维码生成规则和有效期结束时间 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/getQrCodeByStudentId") |
| | | @ApiOperation(value = "惠民卡列表-选择学员后返回对应的二维码生成规则和有效期结束时间") |
| | | @ApiOperation(value = "玩湃惠民卡列表-选择学员后返回对应的二维码生成规则和有效期结束时间") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "惠民卡id", name = "cardId", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "玩湃惠民卡id", name = "cardId", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "学员id", name = "studentId", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 惠民卡富文本内容-惠民卡列表 |
| | | * 玩湃惠民卡富文本内容-玩湃惠民卡列表 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/myHuiminCardList") |
| | | @ApiOperation(value = "个人中心-我的惠民卡") |
| | | @ApiOperation(value = "个人中心-我的玩湃惠民卡") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "页码,首页1", name = "pageSize", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "页条数", name = "pageNo", dataType = "int", required = true), |
| | |
| | | } |
| | | |
| | | /** |
| | | * 个人中心-我的惠民卡-退款 |
| | | * 个人中心-我的玩湃惠民卡-退款 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/refund") |
| | | @ApiOperation(value = "个人中心-我的惠民卡-退款") |
| | | @ApiOperation(value = "个人中心-我的玩湃惠民卡-退款") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "支付记录id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | |
| | | if (tPayHuimin.getEndTime().before(new Date())) { |
| | | // 已过期 |
| | | return ResultUtil.error("惠民卡已过期,不可退款"); |
| | | return ResultUtil.error("玩湃惠民卡已过期,不可退款"); |
| | | } |
| | | tPayHuimin.setStatus(4); |
| | | payHuiminService.updateById(tPayHuimin); |
| | |
| | | // 购卡7日内没有使用记录可退款。超过7日不管有没有使用记录都不能退款 |
| | | if (new Date().after(DateUtil.addDay(tPayHuimin.getPaymentTime(), 7))) { |
| | | // 超过七天不可退款 |
| | | return ResultUtil.error("惠民卡购买超过七天,不可退款"); |
| | | return ResultUtil.error("玩湃惠民卡购买超过七天,不可退款"); |
| | | } else if (count > 0) { |
| | | return ResultUtil.error("惠民卡已使用,不可退款"); |
| | | return ResultUtil.error("玩湃惠民卡已使用,不可退款"); |
| | | } |
| | | if (tPayHuimin.getPaymentType() == 1) { |
| | | Map<String, String> map = payMoneyUtil.wxRefund(tPayHuimin.getOrderNumber(), tPayHuimin.getCode(), |
| | |
| | | |
| | | |
| | | /** |
| | | * 个人中心-我的惠民卡-查看详情 |
| | | * 个人中心-我的玩湃惠民卡-查看详情 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/myHuiminCardDetail") |
| | | @ApiOperation(value = "个人中心-我的惠民卡-查看详情") |
| | | @ApiOperation(value = "个人中心-我的玩湃惠民卡-查看详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "支付记录id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | |
| | | } |
| | | TPayHuimin tPayHuimin = payHuiminService.getById(id); |
| | | if (tPayHuimin == null) { |
| | | return ResultUtil.error("惠民卡不存在"); |
| | | return ResultUtil.error("玩湃惠民卡不存在"); |
| | | } |
| | | THuiminCard byId = huiminCardService.getById(tPayHuimin.getCardId()); |
| | | MyHuiminCardDetailVO myHuiminCardDetailVO = new MyHuiminCardDetailVO(); |
| | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 硬件方调用 存储惠民卡使用记录 |
| | | * 硬件方调用 存储玩湃惠民卡使用记录 |
| | | * @author zhibing.pu |
| | | * @date 2023/6/24 11:27 |
| | | */ |
| | |
| | | @Resource |
| | | private PayHuiminService payHuiminService; |
| | | /** |
| | | * 硬件开门后回调 存储惠民卡使用记录 |
| | | * 硬件开门后回调 存储玩湃惠民卡使用记录 |
| | | */ |
| | | @PostMapping("/record") |
| | | public void aliPayHuiminCallback(Integer id,Integer uid) { |
| | | System.err.println("硬件开门后回调 存储惠民卡使用记录"); |
| | | System.err.println("硬件开门后回调 存储玩湃惠民卡使用记录"); |
| | | System.err.println("id:"+id); |
| | | System.err.println("uid:"+uid); |
| | | if (id!=null){ |
| | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 惠民卡支付记录 |
| | | * 玩湃惠民卡支付记录 |
| | | * @author mitao |
| | | * @date 2025/3/31 |
| | | */ |
| | |
| | | return payHuiminService.getStaticsData(query); |
| | | } |
| | | /** |
| | | * 退款惠民卡 |
| | | * 退款玩湃惠民卡 |
| | | * @param id |
| | | */ |
| | | @PostMapping("/base/tPayHuimin/refund") |
| | |
| | | queryWrapper.le("endTime",tHuiminCard.getEndTime()); |
| | | } |
| | | Integer huiMinStatus = tHuiminCard.getHuiMinStatus(); |
| | | // 惠民卡状态:1未开始 2已开始 3已结束 |
| | | // 玩湃惠民卡状态:1未开始 2已开始 3已结束 |
| | | if (huiMinStatus != null){ |
| | | Date now = new Date(); |
| | | switch (huiMinStatus) { |
| | |
| | | records.forEach(item -> { |
| | | item.setBuyCount(cardIdCountMap.getOrDefault(item.getId(), 0L).intValue()); |
| | | |
| | | // 惠民卡状态计算逻辑 |
| | | // 玩湃惠民卡状态计算逻辑 |
| | | Date startTime = item.getStartTime(); |
| | | Date endTime = item.getEndTime(); |
| | | |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 惠民卡协议管理 |
| | | * 玩湃惠民卡协议管理 |
| | | * </p> |
| | | * |
| | | * @since 2023-07-12 |
| | |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_huimin_agreement") |
| | | @ApiModel(value = "THuiminAgreement对象", description = "惠民卡协议管理") |
| | | @ApiModel(value = "THuiminAgreement对象", description = "玩湃惠民卡协议管理") |
| | | public class THuiminAgreement extends Model<THuiminAgreement> { |
| | | private static final long serialVersionUID = 1L; |
| | | /** |
| | |
| | | @TableField("selectUserRemark") |
| | | private String selectUserRemark; |
| | | /** |
| | | * 门店无惠民卡介绍页 |
| | | * 门店无玩湃惠民卡介绍页 |
| | | */ |
| | | @TableField("storeNoHuiminCardIntro") |
| | | @ApiModelProperty("门店无惠民卡介绍页") |
| | | @ApiModelProperty("门店无玩湃惠民卡介绍页") |
| | | private String storeNoHuiminCardIntro; |
| | | |
| | | @TableField(exist = false) |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 惠民卡协议配置 关联惠民卡协议管理 |
| | | * 玩湃惠民卡协议配置 关联玩湃惠民卡协议管理 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 惠民卡 |
| | | * 玩湃惠民卡 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 惠民卡名称 |
| | | * 玩湃惠民卡名称 |
| | | */ |
| | | @TableField("huiMinName") |
| | | @ApiModelProperty(value = "惠民卡名称") |
| | | @ApiModelProperty(value = "玩湃惠民卡名称") |
| | | private String huiMinName; |
| | | /** |
| | | *惠民卡类型1年度2年内 |
| | | *玩湃惠民卡类型1年度2年内 |
| | | */ |
| | | @ApiModelProperty(value = "惠民卡类型1年度2年内") |
| | | @ApiModelProperty(value = "玩湃惠民卡类型1年度2年内") |
| | | |
| | | @TableField("huiMinType") |
| | | private Integer huiMinType; |
| | |
| | | @TableField("useIds") |
| | | private String useIds; |
| | | /** |
| | | *惠民卡介绍 |
| | | *玩湃惠民卡介绍 |
| | | */ |
| | | @ApiModelProperty(value = "惠民卡介绍") |
| | | @ApiModelProperty(value = "玩湃惠民卡介绍") |
| | | @TableField("introduce") |
| | | private String introduce; |
| | | /** |
| | |
| | | @TableField(exist = false) |
| | | private Long size; |
| | | /** |
| | | * 惠民卡状态:1未开始 2已开始 3已结束 |
| | | * 玩湃惠民卡状态:1未开始 2已开始 3已结束 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Integer huiMinStatus; |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 惠民卡 |
| | | * 玩湃惠民卡 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 惠民卡id |
| | | * 玩湃惠民卡id |
| | | */ |
| | | @TableField("huiminCardId") |
| | | @ApiModelProperty(value = "惠民卡id") |
| | | @ApiModelProperty(value = "玩湃惠民卡id") |
| | | private Integer huiminCardId; |
| | | /** |
| | | * 惠民卡id |
| | | * 玩湃惠民卡id |
| | | */ |
| | | @TableField("payId") |
| | | @ApiModelProperty(value = "惠民卡支付记录id") |
| | | @ApiModelProperty(value = "玩湃惠民卡支付记录id") |
| | | private Integer payId; |
| | | /** |
| | | *使用时间 |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 惠民卡 |
| | | * 玩湃惠民卡 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | |
| | | @TableField("refundStatus") |
| | | private Integer refundStatus; |
| | | /** |
| | | *惠民卡id |
| | | *玩湃惠民卡id |
| | | */ |
| | | @TableField("cardId") |
| | | private Integer cardId; |
| | |
| | | public List<Integer> getHasStudentUser(); |
| | | |
| | | /** |
| | | * 查询惠民卡绑定学员列表信息 |
| | | * 查询玩湃惠民卡绑定学员列表信息 |
| | | * |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 惠民卡协议查询 |
| | | * 玩湃惠民卡协议查询 |
| | | * </p> |
| | | * |
| | | * @since 2023-07-12 |
| | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel(value = "惠民卡富文本内容-惠民卡列表") |
| | | @ApiModel(value = "玩湃惠民卡富文本内容-玩湃惠民卡列表") |
| | | public class HuiminAgreementVO { |
| | | |
| | | @ApiModelProperty("展示内容 1展示富文本内容 2展示惠民卡列表") |
| | | @ApiModelProperty("展示内容 1展示富文本内容 2展示玩湃惠民卡列表") |
| | | private Integer showType; |
| | | @ApiModelProperty("富文本内容") |
| | | private String introduce; |
| | | @ApiModelProperty("惠民卡列表") |
| | | @ApiModelProperty("玩湃惠民卡列表") |
| | | private List<HuiminCardVO> cardList; |
| | | |
| | | } |
| | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel(value = "根据学员id展示惠民卡二维码VO") |
| | | @ApiModel(value = "根据学员id展示玩湃惠民卡二维码VO") |
| | | public class HuiminCardStudentVO { |
| | | @ApiModelProperty("有效期至") |
| | | private String endTime; |
| | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel(value = "首页惠民卡列表VO") |
| | | @ApiModel(value = "首页玩湃惠民卡列表VO") |
| | | public class HuiminCardVO { |
| | | |
| | | @ApiModelProperty("惠民卡id") |
| | | @ApiModelProperty("玩湃惠民卡id") |
| | | private Integer id; |
| | | @ApiModelProperty("惠民卡名称") |
| | | @ApiModelProperty("玩湃惠民卡名称") |
| | | private String huiminName; |
| | | @ApiModelProperty("封面图") |
| | | private String cover; |
| | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel(value = "我的惠民卡详情VO") |
| | | @ApiModel(value = "我的玩湃惠民卡详情VO") |
| | | public class MyHuiminCardDetailVO { |
| | | @ApiModelProperty("二维码生成规则") |
| | | private String qrCode; |
| | | @ApiModelProperty("惠民卡id") |
| | | @ApiModelProperty("玩湃惠民卡id") |
| | | private Integer cardId; |
| | | @ApiModelProperty("富文本内容") |
| | | private String introduce; |
| | |
| | | private Date endTime; |
| | | @ApiModelProperty("绑定人员列表") |
| | | private List<TStudent> studentList; |
| | | @ApiModelProperty("惠民卡") |
| | | @ApiModelProperty("玩湃惠民卡") |
| | | private THuiminCard huiminCard; |
| | | @ApiModelProperty("购买使用者名称") |
| | | private String studentName; |
| | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | @ApiModel(value = "我的惠民卡列表VO") |
| | | @ApiModel(value = "我的玩湃惠民卡列表VO") |
| | | public class MyHuiminCardVO { |
| | | @ApiModelProperty("支付记录id") |
| | | private Integer id; |
| | | @ApiModelProperty("惠民卡id") |
| | | @ApiModelProperty("玩湃惠民卡id") |
| | | private Integer cardId; |
| | | @ApiModelProperty("封面图") |
| | | private String cover; |
| | |
| | | public class SalesDetailVO { |
| | | // 基础信息 |
| | | private Long id; // 主键ID[8] |
| | | private String huiMinName; // 惠民卡名称 |
| | | private Integer huiMinType; // 惠民卡类型(1:年度卡,2:年内卡) |
| | | private String huiMinName; // 玩湃惠民卡名称 |
| | | private Integer huiMinType; // 玩湃惠民卡类型(1:年度卡,2:年内卡) |
| | | private BigDecimal salesMoney; // 售卖金额(精确计算) |
| | | |
| | | // 关联信息 |
| | |
| | | private Integer appUserId; // 购买用户ID |
| | | private String userName; // 购买用户 |
| | | private String phone; // 联系电话 |
| | | private Integer carId; // 惠民卡id |
| | | private Integer carId; // 玩湃惠民卡id |
| | | |
| | | // 时间信息 |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | |
| | | Map<String, BigDecimal> getStaticsData(HuiminPayQuery query); |
| | | |
| | | /** |
| | | * 退款惠民卡 |
| | | * 退款玩湃惠民卡 |
| | | * @param id |
| | | */ |
| | | ResultUtil<?> refund(Integer id) throws AlipayApiException; |
| | |
| | | String timestamp = String.valueOf(System.currentTimeMillis() / 1000); |
| | | String nonceStr = generateNonceStr(); |
| | | String sign = appPaySign(timestamp, nonceStr, prepayId); |
| | | |
| | | Map<String, String> params = new HashMap<>(); |
| | | params.put("appid", WxV3PayConfig.APP_ID); |
| | | params.put("partnerid", WxV3PayConfig.Mch_ID); |
| | |
| | | //package com.dsh.activity.util.wx; |
| | | // |
| | | //import com.dsh.activity.util.wx.WXPayConstants; |
| | | //import com.dsh.activity.util.wx.WXPaySignatureCertificateUtil; |
| | | //import com.dsh.activity.util.wx.WxV3PayConfig; |
| | | //import com.fasterxml.jackson.databind.JsonNode; // 引入Jackson库处理JSON |
| | | //import com.fasterxml.jackson.databind.ObjectMapper; |
| | | //import com.fasterxml.jackson.databind.node.ObjectNode; |
| | | //import org.apache.http.client.methods.CloseableHttpResponse; |
| | | //import org.apache.http.client.methods.HttpPost; |
| | | //import org.apache.http.entity.StringEntity; |
| | | //import org.apache.http.impl.client.CloseableHttpClient; |
| | | //import org.apache.http.util.EntityUtils; |
| | | //import org.slf4j.Logger; |
| | | //import org.slf4j.LoggerFactory; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.stereotype.Component; |
| | | //import org.springframework.stereotype.Service; |
| | | // |
| | | //import java.io.IOException; |
| | | //import java.math.BigDecimal; |
| | | //import java.nio.charset.StandardCharsets; |
| | | //import java.util.HashMap; |
| | | //import java.util.Map; |
| | | // |
| | | //@Component |
| | | //public class WxAppPayService { |
| | | // |
| | | // private static final Logger log = LoggerFactory.getLogger(WxAppPayService.class); |
| | | // |
| | | // private final ObjectMapper objectMapper; // 用于JSON序列化和反序列化 |
| | | // private final CloseableHttpClient wechatPayClient; // 注入通过工具类创建的HTTP客户端 |
| | | // |
| | | // @Autowired |
| | | // public WxAppPayService(ObjectMapper objectMapper) throws IOException { |
| | | // this.objectMapper = objectMapper; |
| | | // // 在构造函数中初始化带有签名验证功能的HTTP客户端 |
| | | // this.wechatPayClient = WXPaySignatureCertificateUtil.getWechatPayClient(); |
| | | // log.info("微信支付V3 HTTP客户端初始化完成。"); |
| | | // } |
| | | // |
| | | // /** |
| | | // * 创建APP支付预付单 (统一下单) |
| | | // * |
| | | // * @param description 商品描述 |
| | | // * @param outTradeNo 商户订单号 (要求32个字符内,只能是数字、大小写字母_-|* 且在同一个商户号下唯一) |
| | | // * @param totalAmount 支付总金额 (单位:元) |
| | | // * @return 用于调起APP支付的参数 Map (appid, partnerid, prepayid, package, noncestr, timestamp, sign) |
| | | // * @throws IOException 网络或IO异常 |
| | | // * @throws RuntimeException 支付请求失败或处理异常 |
| | | // */ |
| | | // public Map<String, String> createOrder(String description, String outTradeNo, BigDecimal totalAmount) |
| | | // throws IOException { |
| | | // |
| | | // // 1. 构建请求URL |
| | | // String url = WXPayConstants.DOMAIN_API + WXPayConstants.PAY_TRANSACTIONS_APP; |
| | | // HttpPost httpPost = new HttpPost(url); |
| | | // httpPost.addHeader("Accept", "application/json"); |
| | | // httpPost.addHeader("Content-type", "application/json; charset=utf-8"); |
| | | // |
| | | // // 2. 构建请求体 JSON |
| | | // ObjectNode rootNode = objectMapper.createObjectNode(); |
| | | //// rootNode.put("appid", WxV3PayConfig.APP_ID);//服务商不需要该字段 |
| | | //// rootNode.put("mchid", WxV3PayConfig.Mch_ID);//服务商不需要该字段 |
| | | // rootNode.put("description", description); |
| | | // rootNode.put("out_trade_no", outTradeNo); |
| | | // rootNode.put("notify_url", WXPayConstants.WECHAT_PAY_NOTIFY_URL); // 使用常量中的回调地址 |
| | | // |
| | | // ObjectNode amountNode = objectMapper.createObjectNode(); |
| | | // // 微信支付金额单位为分,需要转换 |
| | | // amountNode.put("total", totalAmount.multiply(new BigDecimal("100")).intValue()); |
| | | // amountNode.put("currency", "CNY"); // 货币类型,默认人民币 |
| | | // rootNode.set("amount", amountNode); |
| | | // |
| | | // // 如果你是服务商模式,需要添加子商户信息 |
| | | // rootNode.put("sp_mchid", WxV3PayConfig.Mch_ID); |
| | | // rootNode.put("sub_mchid", "123"); |
| | | // rootNode.put("sp_appid", "wx41d32f362ba0f911"); |
| | | // // rootNode.put("sub_appid", "子商户AppID"); // 如果子商户需要用自己的AppID拉起支付 |
| | | // |
| | | // String requestBody = rootNode.toString(); |
| | | // log.info("微信APP支付下单请求体: {}", requestBody); |
| | | // httpPost.setEntity(new StringEntity(requestBody, StandardCharsets.UTF_8)); |
| | | // |
| | | // // 3. 发送请求 |
| | | // try (CloseableHttpResponse response = wechatPayClient.execute(httpPost)) { |
| | | // int statusCode = response.getStatusLine().getStatusCode(); |
| | | // String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); |
| | | // log.info("微信APP支付下单响应状态码: {}, 响应体: {}", statusCode, responseBody); |
| | | // |
| | | // if (statusCode == 200) { // HTTP状态码 200 表示成功 |
| | | // JsonNode responseNode = objectMapper.readTree(responseBody); |
| | | // String prepayId = responseNode.get("prepay_id").asText(); |
| | | // log.info("成功获取预支付交易会话标识 (prepay_id): {}", prepayId); |
| | | // |
| | | // // 4. 生成调起支付所需的参数 |
| | | // Map<String, String> payParams = WXPaySignatureCertificateUtil.buildAppPayParams(prepayId); |
| | | // log.info("生成APP支付参数: {}", payParams); |
| | | // return payParams; |
| | | // |
| | | // } else { |
| | | // // 处理错误情况 |
| | | // log.error("微信APP支付下单失败,状态码: {}, 响应: {}", statusCode, responseBody); |
| | | // // 可以根据 responseBody 中的 code 和 message 进一步分析错误 |
| | | // throw new RuntimeException("微信APP支付下单失败: " + responseBody); |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error("微信APP支付下单请求执行异常", e); |
| | | // throw new IOException("微信APP支付下单请求执行异常", e); |
| | | // } |
| | | // } |
| | | // |
| | | // /** |
| | | // * 关闭订单 (根据商户订单号) |
| | | // * |
| | | // * @param outTradeNo 商户订单号 |
| | | // * @return true 如果关闭成功或订单已关闭/不存在 (根据微信文档,成功是204 No Content) |
| | | // * @throws IOException 网络或IO异常 |
| | | // * @throws RuntimeException 关闭请求失败或处理异常 |
| | | // */ |
| | | // public boolean closeOrder(String outTradeNo) throws IOException { |
| | | // // 1. 构建请求URL, 注意替换占位符 |
| | | // String url = WXPayConstants.DOMAIN_API |
| | | // + WXPayConstants.PAY_TRANSACTIONS_OUT_TRADE_NO.replace("{}", outTradeNo); |
| | | // |
| | | // HttpPost httpPost = new HttpPost(url); |
| | | // httpPost.addHeader("Accept", "application/json"); |
| | | // httpPost.addHeader("Content-type", "application/json; charset=utf-8"); |
| | | // |
| | | // // 2. 构建请求体 JSON (只需要商户号) |
| | | // ObjectNode rootNode = objectMapper.createObjectNode(); |
| | | // rootNode.put("mchid", WxV3PayConfig.Mch_ID); |
| | | // // 如果是服务商模式,则用 sp_mchid |
| | | // rootNode.put("sp_mchid", WxV3PayConfig.Mch_ID); |
| | | // |
| | | // String requestBody = rootNode.toString(); |
| | | // log.info("微信关单请求 URL: {}, 请求体: {}", url, requestBody); |
| | | // httpPost.setEntity(new StringEntity(requestBody, StandardCharsets.UTF_8)); |
| | | // |
| | | // // 3. 发送请求 |
| | | // try (CloseableHttpResponse response = wechatPayClient.execute(httpPost)) { |
| | | // int statusCode = response.getStatusLine().getStatusCode(); |
| | | // // 关单成功时,微信返回 HTTP 状态码 204 No Content |
| | | // log.info("微信关单响应状态码: {}", statusCode); |
| | | // if (statusCode == 204) { |
| | | // log.info("订单 {} 关闭成功。", outTradeNo); |
| | | // return true; |
| | | // } else { |
| | | // String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); |
| | | // log.error("微信关单失败,商户订单号: {}, 状态码: {}, 响应: {}", outTradeNo, statusCode, responseBody); |
| | | // // 根据需要可以解析responseBody获取错误详情 |
| | | // return false; // 或者抛出异常,根据业务决定 |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error("微信关单请求执行异常, 商户订单号: {}", outTradeNo, e); |
| | | // throw new IOException("微信关单请求执行异常", e); |
| | | // } |
| | | // } |
| | | // |
| | | // |
| | | // // --- 退款相关方法 (可选) --- |
| | | // |
| | | // /** |
| | | // * 申请退款 |
| | | // * |
| | | // * @param outTradeNo 原商户订单号 |
| | | // * @param outRefundNo 商户退款单号 (商户系统内部的退款单号,要求唯一) |
| | | // * @param reason 退款原因 (可选) |
| | | // * @param refundAmount 退款金额 (单位:元) |
| | | // * @param totalAmount 原订单总金额 (单位:元) |
| | | // * @return 退款处理结果,可以返回微信返回的JSON节点或自定义对象 |
| | | // * @throws IOException 网络或IO异常 |
| | | // * @throws RuntimeException 退款请求失败或处理异常 |
| | | // */ |
| | | // public JsonNode createRefund(String outTradeNo, String outRefundNo, String reason, |
| | | // BigDecimal refundAmount, BigDecimal totalAmount) throws IOException { |
| | | // |
| | | // String url = WXPayConstants.DOMAIN_API + WXPayConstants.REFUND_DOMESTIC_REFUNDS; |
| | | // HttpPost httpPost = new HttpPost(url); |
| | | // httpPost.addHeader("Accept", "application/json"); |
| | | // httpPost.addHeader("Content-type", "application/json; charset=utf-8"); |
| | | // |
| | | // ObjectNode rootNode = objectMapper.createObjectNode(); |
| | | // // 如果是服务商模式,需要添加子商户号 |
| | | // // rootNode.put("sub_mchid", "子商户号"); |
| | | // rootNode.put("out_trade_no", outTradeNo); |
| | | // rootNode.put("out_refund_no", outRefundNo); |
| | | // if (reason != null && !reason.isEmpty()) { |
| | | // rootNode.put("reason", reason); |
| | | // } |
| | | // // 设置退款回调地址 |
| | | // rootNode.put("notify_url", WXPayConstants.WECHAT_REFUNDS_NOTIFY_URL); |
| | | // |
| | | // ObjectNode amountNode = objectMapper.createObjectNode(); |
| | | // amountNode.put("refund", refundAmount.multiply(new BigDecimal("100")).intValue()); // 退款金额,分 |
| | | // amountNode.put("total", totalAmount.multiply(new BigDecimal("100")).intValue()); // 原订单金额,分 |
| | | // amountNode.put("currency", "CNY"); |
| | | // rootNode.set("amount", amountNode); |
| | | // |
| | | // String requestBody = rootNode.toString(); |
| | | // log.info("微信申请退款请求体: {}", requestBody); |
| | | // httpPost.setEntity(new StringEntity(requestBody, StandardCharsets.UTF_8)); |
| | | // |
| | | // try (CloseableHttpResponse response = wechatPayClient.execute(httpPost)) { |
| | | // int statusCode = response.getStatusLine().getStatusCode(); |
| | | // String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); |
| | | // log.info("微信申请退款响应状态码: {}, 响应体: {}", statusCode, responseBody); |
| | | // |
| | | // if (statusCode == 200) { // 成功受理 |
| | | // log.info("微信退款申请成功受理。"); |
| | | // return objectMapper.readTree(responseBody); |
| | | // } else { |
| | | // log.error("微信申请退款失败,状态码: {}, 响应: {}", statusCode, responseBody); |
| | | // throw new RuntimeException("微信申请退款失败: " + responseBody); |
| | | // } |
| | | // } catch (Exception e) { |
| | | // log.error("微信申请退款请求执行异常", e); |
| | | // throw new IOException("微信申请退款请求执行异常", e); |
| | | // } |
| | | // } |
| | | // |
| | | //} |
| | | package com.dsh.activity.util.wx; |
| | | |
| | | import com.dsh.activity.util.wx.WXPayConstants; |
| | | import com.dsh.activity.util.wx.WXPaySignatureCertificateUtil; |
| | | import com.dsh.activity.util.wx.WxV3PayConfig; |
| | | import com.fasterxml.jackson.databind.JsonNode; // 引入Jackson库处理JSON |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.fasterxml.jackson.databind.node.ObjectNode; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpPost; |
| | | import org.apache.http.entity.StringEntity; |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | @Component |
| | | public class WxAppPayService { |
| | | |
| | | private static final Logger log = LoggerFactory.getLogger(WxAppPayService.class); |
| | | |
| | | private final ObjectMapper objectMapper; // 用于JSON序列化和反序列化 |
| | | private final CloseableHttpClient wechatPayClient; // 注入通过工具类创建的HTTP客户端 |
| | | |
| | | @Autowired |
| | | public WxAppPayService(ObjectMapper objectMapper) throws IOException { |
| | | this.objectMapper = objectMapper; |
| | | // 在构造函数中初始化带有签名验证功能的HTTP客户端 |
| | | this.wechatPayClient = WXPaySignatureCertificateUtil.getWechatPayClient(); |
| | | log.info("微信支付V3 HTTP客户端初始化完成。"); |
| | | } |
| | | |
| | | /** |
| | | * 创建APP支付预付单 (统一下单) |
| | | * |
| | | * @param description 商品描述 |
| | | * @param outTradeNo 商户订单号 (要求32个字符内,只能是数字、大小写字母_-|* 且在同一个商户号下唯一) |
| | | * @param totalAmount 支付总金额 (单位:元) |
| | | * @return 用于调起APP支付的参数 Map (appid, partnerid, prepayid, package, noncestr, timestamp, sign) |
| | | * @throws IOException 网络或IO异常 |
| | | * @throws RuntimeException 支付请求失败或处理异常 |
| | | */ |
| | | public Map<String, String> createOrder(String description, String outTradeNo, BigDecimal totalAmount) |
| | | throws IOException { |
| | | |
| | | // 1. 构建请求URL |
| | | String url = WXPayConstants.DOMAIN_API + WXPayConstants.PAY_TRANSACTIONS_APP; |
| | | HttpPost httpPost = new HttpPost(url); |
| | | httpPost.addHeader("Accept", "application/json"); |
| | | httpPost.addHeader("Content-type", "application/json; charset=utf-8"); |
| | | |
| | | // 2. 构建请求体 JSON |
| | | ObjectNode rootNode = objectMapper.createObjectNode(); |
| | | // rootNode.put("appid", WxV3PayConfig.APP_ID);//服务商不需要该字段 |
| | | // rootNode.put("mchid", WxV3PayConfig.Mch_ID);//服务商不需要该字段 |
| | | rootNode.put("description", description); |
| | | rootNode.put("out_trade_no", outTradeNo); |
| | | rootNode.put("notify_url", WXPayConstants.WECHAT_PAY_NOTIFY_URL); // 使用常量中的回调地址 |
| | | |
| | | ObjectNode amountNode = objectMapper.createObjectNode(); |
| | | // 微信支付金额单位为分,需要转换 |
| | | amountNode.put("total", totalAmount.multiply(new BigDecimal("100")).intValue()); |
| | | amountNode.put("currency", "CNY"); // 货币类型,默认人民币 |
| | | rootNode.set("amount", amountNode); |
| | | |
| | | // 如果你是服务商模式,需要添加子商户信息 |
| | | rootNode.put("sp_mchid", WxV3PayConfig.Mch_ID); |
| | | rootNode.put("sub_mchid", "123"); |
| | | rootNode.put("sp_appid", "wx41d32f362ba0f911"); |
| | | // rootNode.put("sub_appid", "子商户AppID"); // 如果子商户需要用自己的AppID拉起支付 |
| | | |
| | | String requestBody = rootNode.toString(); |
| | | log.info("微信APP支付下单请求体: {}", requestBody); |
| | | httpPost.setEntity(new StringEntity(requestBody, StandardCharsets.UTF_8)); |
| | | |
| | | // 3. 发送请求 |
| | | try (CloseableHttpResponse response = wechatPayClient.execute(httpPost)) { |
| | | int statusCode = response.getStatusLine().getStatusCode(); |
| | | String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); |
| | | log.info("微信APP支付下单响应状态码: {}, 响应体: {}", statusCode, responseBody); |
| | | |
| | | if (statusCode == 200) { // HTTP状态码 200 表示成功 |
| | | JsonNode responseNode = objectMapper.readTree(responseBody); |
| | | String prepayId = responseNode.get("prepay_id").asText(); |
| | | log.info("成功获取预支付交易会话标识 (prepay_id): {}", prepayId); |
| | | |
| | | // 4. 生成调起支付所需的参数 |
| | | Map<String, String> payParams = WXPaySignatureCertificateUtil.buildAppPayParams(prepayId); |
| | | log.info("生成APP支付参数: {}", payParams); |
| | | return payParams; |
| | | |
| | | } else { |
| | | // 处理错误情况 |
| | | log.error("微信APP支付下单失败,状态码: {}, 响应: {}", statusCode, responseBody); |
| | | // 可以根据 responseBody 中的 code 和 message 进一步分析错误 |
| | | throw new RuntimeException("微信APP支付下单失败: " + responseBody); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("微信APP支付下单请求执行异常", e); |
| | | throw new IOException("微信APP支付下单请求执行异常", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 关闭订单 (根据商户订单号) |
| | | * |
| | | * @param outTradeNo 商户订单号 |
| | | * @return true 如果关闭成功或订单已关闭/不存在 (根据微信文档,成功是204 No Content) |
| | | * @throws IOException 网络或IO异常 |
| | | * @throws RuntimeException 关闭请求失败或处理异常 |
| | | */ |
| | | public boolean closeOrder(String outTradeNo) throws IOException { |
| | | // 1. 构建请求URL, 注意替换占位符 |
| | | String url = WXPayConstants.DOMAIN_API |
| | | + WXPayConstants.PAY_TRANSACTIONS_OUT_TRADE_NO.replace("{}", outTradeNo); |
| | | |
| | | HttpPost httpPost = new HttpPost(url); |
| | | httpPost.addHeader("Accept", "application/json"); |
| | | httpPost.addHeader("Content-type", "application/json; charset=utf-8"); |
| | | |
| | | // 2. 构建请求体 JSON (只需要商户号) |
| | | ObjectNode rootNode = objectMapper.createObjectNode(); |
| | | rootNode.put("mchid", WxV3PayConfig.Mch_ID); |
| | | // 如果是服务商模式,则用 sp_mchid |
| | | rootNode.put("sp_mchid", WxV3PayConfig.Mch_ID); |
| | | |
| | | String requestBody = rootNode.toString(); |
| | | log.info("微信关单请求 URL: {}, 请求体: {}", url, requestBody); |
| | | httpPost.setEntity(new StringEntity(requestBody, StandardCharsets.UTF_8)); |
| | | |
| | | // 3. 发送请求 |
| | | try (CloseableHttpResponse response = wechatPayClient.execute(httpPost)) { |
| | | int statusCode = response.getStatusLine().getStatusCode(); |
| | | // 关单成功时,微信返回 HTTP 状态码 204 No Content |
| | | log.info("微信关单响应状态码: {}", statusCode); |
| | | if (statusCode == 204) { |
| | | log.info("订单 {} 关闭成功。", outTradeNo); |
| | | return true; |
| | | } else { |
| | | String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); |
| | | log.error("微信关单失败,商户订单号: {}, 状态码: {}, 响应: {}", outTradeNo, statusCode, responseBody); |
| | | // 根据需要可以解析responseBody获取错误详情 |
| | | return false; // 或者抛出异常,根据业务决定 |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("微信关单请求执行异常, 商户订单号: {}", outTradeNo, e); |
| | | throw new IOException("微信关单请求执行异常", e); |
| | | } |
| | | } |
| | | |
| | | |
| | | // --- 退款相关方法 (可选) --- |
| | | |
| | | /** |
| | | * 申请退款 |
| | | * |
| | | * @param outTradeNo 原商户订单号 |
| | | * @param outRefundNo 商户退款单号 (商户系统内部的退款单号,要求唯一) |
| | | * @param reason 退款原因 (可选) |
| | | * @param refundAmount 退款金额 (单位:元) |
| | | * @param totalAmount 原订单总金额 (单位:元) |
| | | * @return 退款处理结果,可以返回微信返回的JSON节点或自定义对象 |
| | | * @throws IOException 网络或IO异常 |
| | | * @throws RuntimeException 退款请求失败或处理异常 |
| | | */ |
| | | public JsonNode createRefund(String outTradeNo, String outRefundNo, String reason, |
| | | BigDecimal refundAmount, BigDecimal totalAmount) throws IOException { |
| | | |
| | | String url = WXPayConstants.DOMAIN_API + WXPayConstants.REFUND_DOMESTIC_REFUNDS; |
| | | HttpPost httpPost = new HttpPost(url); |
| | | httpPost.addHeader("Accept", "application/json"); |
| | | httpPost.addHeader("Content-type", "application/json; charset=utf-8"); |
| | | |
| | | ObjectNode rootNode = objectMapper.createObjectNode(); |
| | | // 如果是服务商模式,需要添加子商户号 |
| | | // rootNode.put("sub_mchid", "子商户号"); |
| | | rootNode.put("out_trade_no", outTradeNo); |
| | | rootNode.put("out_refund_no", outRefundNo); |
| | | if (reason != null && !reason.isEmpty()) { |
| | | rootNode.put("reason", reason); |
| | | } |
| | | // 设置退款回调地址 |
| | | rootNode.put("notify_url", WXPayConstants.WECHAT_REFUNDS_NOTIFY_URL); |
| | | |
| | | ObjectNode amountNode = objectMapper.createObjectNode(); |
| | | amountNode.put("refund", refundAmount.multiply(new BigDecimal("100")).intValue()); // 退款金额,分 |
| | | amountNode.put("total", totalAmount.multiply(new BigDecimal("100")).intValue()); // 原订单金额,分 |
| | | amountNode.put("currency", "CNY"); |
| | | rootNode.set("amount", amountNode); |
| | | |
| | | String requestBody = rootNode.toString(); |
| | | log.info("微信申请退款请求体: {}", requestBody); |
| | | httpPost.setEntity(new StringEntity(requestBody, StandardCharsets.UTF_8)); |
| | | |
| | | try (CloseableHttpResponse response = wechatPayClient.execute(httpPost)) { |
| | | int statusCode = response.getStatusLine().getStatusCode(); |
| | | String responseBody = EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8); |
| | | log.info("微信申请退款响应状态码: {}, 响应体: {}", statusCode, responseBody); |
| | | |
| | | if (statusCode == 200) { // 成功受理 |
| | | log.info("微信退款申请成功受理。"); |
| | | return objectMapper.readTree(responseBody); |
| | | } else { |
| | | log.error("微信申请退款失败,状态码: {}, 响应: {}", statusCode, responseBody); |
| | | throw new RuntimeException("微信申请退款失败: " + responseBody); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("微信申请退款请求执行异常", e); |
| | | throw new IOException("微信申请退款请求执行异常", e); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | @FeignClient(value = "mb-cloud-activity") |
| | | public interface HuiminAgreementClient { |
| | | /** |
| | | * 根据当前用户类型查询惠民卡协议 |
| | | * 根据当前用户类型查询玩湃惠民卡协议 |
| | | * @param objectType |
| | | * @param operatorId |
| | | * @return |
| | |
| | | THuiminAgreement selectByObjectType(@RequestBody HuiminAgreementQuery query); |
| | | |
| | | /** |
| | | * 保存惠民卡协议 |
| | | * 保存玩湃惠民卡协议 |
| | | * @param tHuiminAgreement |
| | | */ |
| | | @PostMapping("/base/tHuiminAgreement/save") |
| | |
| | | Map<String, BigDecimal> getStaticsData(@RequestBody HuiminPayQuery query); |
| | | |
| | | /** |
| | | * 退款惠民卡 |
| | | * 退款玩湃惠民卡 |
| | | * @param id |
| | | */ |
| | | @PostMapping("/base/tPayHuimin/refund") |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 惠民卡协议查询 |
| | | * 玩湃惠民卡协议查询 |
| | | * </p> |
| | | * |
| | | * @since 2023-07-12 |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 惠民卡协议管理 |
| | | * 玩湃惠民卡协议管理 |
| | | * </p> |
| | | * |
| | | * @since 2023-07-12 |
| | |
| | | */ |
| | | private String selectUserRemark; |
| | | /** |
| | | * 门店无惠民卡介绍页 |
| | | * 门店无玩湃惠民卡介绍页 |
| | | */ |
| | | private String storeNoHuiminCardIntro; |
| | | |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 惠民卡协议配置 关联惠民卡协议管理 |
| | | * 玩湃惠民卡协议配置 关联玩湃惠民卡协议管理 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 惠民卡 |
| | | * 玩湃惠民卡 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 惠民卡名称 |
| | | * 玩湃惠民卡名称 |
| | | */ |
| | | @TableField("huiMinName") |
| | | private String huiMinName; |
| | | /** |
| | | *惠民卡类型1年度2年内 |
| | | *玩湃惠民卡类型1年度2年内 |
| | | */ |
| | | @TableField("huiMinType") |
| | | private String huiMinType; |
| | |
| | | @TableField("useIds") |
| | | private String useIds; |
| | | /** |
| | | *惠民卡介绍 |
| | | *玩湃惠民卡介绍 |
| | | */ |
| | | @TableField("introduce") |
| | | private String introduce; |
| | |
| | | @TableField(exist = false) |
| | | private Integer buyCount; |
| | | /** |
| | | * 惠民卡状态:1未开始 2已开始 3已结束 |
| | | * 玩湃惠民卡状态:1未开始 2已开始 3已结束 |
| | | */ |
| | | @TableField(exist = false) |
| | | private Integer huiMinStatus; |
| | |
| | | |
| | | /** |
| | | * <p> |
| | | * 惠民卡 |
| | | * 玩湃惠民卡 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | |
| | | @TableField("refundStatus") |
| | | private Integer refundStatus; |
| | | /** |
| | | *惠民卡id |
| | | *玩湃惠民卡id |
| | | */ |
| | | @TableField("cardId") |
| | | private Integer cardId; |
| | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 惠民卡控制器 |
| | | * 玩湃惠民卡控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2025-03-29 17:40:11 |
| | |
| | | private TOperatorService operatorService; |
| | | |
| | | /** |
| | | * 跳转到惠民卡首页 |
| | | * 跳转到玩湃惠民卡首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | |
| | | } |
| | | /* |
| | | *//** |
| | | * 跳转到修改惠民卡 |
| | | * 跳转到修改玩湃惠民卡 |
| | | *//* |
| | | @RequestMapping("/tHuiminAgreement_update/{tHuiminAgreementId}") |
| | | public String tHuiminAgreementUpdate(@PathVariable Integer tHuiminAgreementId, Model model) { |
| | |
| | | } |
| | | |
| | | *//** |
| | | * 获取惠民卡列表 |
| | | * 获取玩湃惠民卡列表 |
| | | *//* |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | *//** |
| | | * 新增惠民卡 |
| | | * 新增玩湃惠民卡 |
| | | *//* |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | *//** |
| | | * 删除惠民卡 |
| | | * 删除玩湃惠民卡 |
| | | *//* |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | *//** |
| | | * 修改惠民卡 |
| | | * 修改玩湃惠民卡 |
| | | *//* |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | *//** |
| | | * 惠民卡详情 |
| | | * 玩湃惠民卡详情 |
| | | *//* |
| | | @RequestMapping(value = "/detail/{tHuiminAgreementId}") |
| | | @ResponseBody |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 惠民卡控制器 |
| | | * 玩湃惠民卡控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2025-03-29 17:41:25 |
| | |
| | | private ITSiteService tSiteService; |
| | | |
| | | /** |
| | | * 跳转到惠民卡首页 |
| | | * 跳转到玩湃惠民卡首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加惠民卡 |
| | | * 跳转到添加玩湃惠民卡 |
| | | */ |
| | | @RequestMapping("/tHuiminCard_add") |
| | | public String tHuiminCardAdd(Model model) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取惠民卡详情 |
| | | * 获取玩湃惠民卡详情 |
| | | */ |
| | | @RequestMapping("/getDetail") |
| | | @ResponseBody |
| | |
| | | |
| | | |
| | | /** |
| | | * 获取惠民卡列表 |
| | | * 获取玩湃惠民卡列表 |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | |
| | | |
| | | |
| | | /* *//** |
| | | * 跳转到修改惠民卡 |
| | | * 跳转到修改玩湃惠民卡 |
| | | *//* |
| | | @RequestMapping("/tHuiminCard_update/{tHuiminCardId}") |
| | | public String tHuiminCardUpdate(@PathVariable Integer tHuiminCardId, Model model) { |
| | |
| | | } |
| | | |
| | | *//** |
| | | * 获取惠民卡列表 |
| | | * 获取玩湃惠民卡列表 |
| | | *//* |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | |
| | | |
| | | |
| | | *//** |
| | | * 修改惠民卡 |
| | | * 修改玩湃惠民卡 |
| | | *//* |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | *//** |
| | | * 惠民卡详情 |
| | | * 玩湃惠民卡详情 |
| | | *//* |
| | | @RequestMapping(value = "/detail/{tHuiminCardId}") |
| | | @ResponseBody |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | /** |
| | | * 惠民卡控制器 |
| | | * 玩湃惠民卡控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2025-03-29 17:41:38 |
| | |
| | | private HuiminRecordClient huiminRecordClient; |
| | | |
| | | /** |
| | | * 跳转到惠民卡首页 |
| | | * 跳转到玩湃惠民卡首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index() { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加惠民卡 |
| | | * 跳转到添加玩湃惠民卡 |
| | | */ |
| | | @RequestMapping("/tHuiminRecord_add") |
| | | public String tHuiminRecordAdd() { |
| | |
| | | } |
| | | |
| | | /* *//** |
| | | * 跳转到修改惠民卡 |
| | | * 跳转到修改玩湃惠民卡 |
| | | *//* |
| | | @RequestMapping("/tHuiminRecord_update/{tHuiminRecordId}") |
| | | public String tHuiminRecordUpdate(@PathVariable Integer tHuiminRecordId, Model model) { |
| | |
| | | } |
| | | |
| | | *//** |
| | | * 获取惠民卡列表 |
| | | * 获取玩湃惠民卡列表 |
| | | *//* |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | *//** |
| | | * 新增惠民卡 |
| | | * 新增玩湃惠民卡 |
| | | *//* |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | *//** |
| | | * 删除惠民卡 |
| | | * 删除玩湃惠民卡 |
| | | *//* |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | *//** |
| | | * 修改惠民卡 |
| | | * 修改玩湃惠民卡 |
| | | *//* |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | |
| | | } |
| | | |
| | | *//** |
| | | * 惠民卡详情 |
| | | * 玩湃惠民卡详情 |
| | | *//* |
| | | @RequestMapping(value = "/detail/{tHuiminRecordId}") |
| | | @ResponseBody |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 惠民卡控制器 |
| | | * 玩湃惠民卡控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2025-03-29 17:41:48 |
| | |
| | | |
| | | |
| | | /** |
| | | * 跳转到惠民卡首页 |
| | | * 跳转到玩湃惠民卡首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加惠民卡 |
| | | * 跳转到添加玩湃惠民卡 |
| | | */ |
| | | @RequestMapping("/tPayHuimin_add") |
| | | public String tPayHuiminAdd() { |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取惠民卡列表 |
| | | * 获取玩湃惠民卡列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | |
| | | item.setStoreName(sb.toString()); |
| | | }); |
| | | } |
| | | String[] titleArr = {"惠民卡名称", "惠民卡类型", "售卖金额", "所属运营商", "可用门店", "购买用户", "联系电话", "购买时间", "绑定人员", "已用次数", "有效期", "状态"}; |
| | | String[] titleArr = {"玩湃惠民卡名称", "玩湃惠民卡类型", "售卖金额", "所属运营商", "可用门店", "购买用户", "联系电话", "购买时间", "绑定人员", "已用次数", "有效期", "状态"}; |
| | | String[][] values = new String[records.size()][]; |
| | | for (int i = 0; i < records.size(); i++) { |
| | | SalesDetailVO salesDetailVO = records.get(i); |
| | |
| | | }else{ |
| | | model.addAttribute("worldCupStores",worldCupStores); |
| | | } |
| | | //惠民卡 |
| | | //玩湃惠民卡 |
| | | StoreConfig c10 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,10)); |
| | | model.addAttribute("c10",c10); |
| | | return PREFIX + "TShop_imgAll.html"; |
| | |
| | | public class SalesDetailVO { |
| | | // 基础信息 |
| | | private Long id; // 主键ID[8] |
| | | private String huiMinName; // 惠民卡名称 |
| | | private Integer huiMinType; // 惠民卡类型(1:年度卡,2:年内卡) |
| | | private String huiMinName; // 玩湃惠民卡名称 |
| | | private Integer huiMinType; // 玩湃惠民卡类型(1:年度卡,2:年内卡) |
| | | private BigDecimal salesMoney; // 售卖金额(精确计算) |
| | | |
| | | // 关联信息 |
| | |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | /** |
| | | * 数据类型(1=报名玩湃课程,2=预约场地,3=报名赛事及活动,4=免费福利,5=线上课程积分,6=购买优惠门票,7=看视频得奖励,8=智慧球场,9=世界杯,10=惠民卡) |
| | | * 数据类型(1=报名玩湃课程,2=预约场地,3=报名赛事及活动,4=免费福利,5=线上课程积分,6=购买优惠门票,7=看视频得奖励,8=智慧球场,9=世界杯,10=玩湃惠民卡) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | |
| | | var key = CryptoJS.enc.Utf8.parse("c53fd327353a09a1"); |
| | | var iv = CryptoJS.enc.Utf8.parse("3a0565e3b1d8ae3d"); |
| | | |
| | | function sendSMSCode() { |
| | | var phone = $("#username").val() |
| | | function sendSMSCode(btn) { |
| | | var phone = $("#username").val(); |
| | | if (!phone) { |
| | | alert("请输入账号"); |
| | | return; |
| | | } |
| | | // 禁用按钮并开始倒计时 |
| | | startCountdown(btn, 60); |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/getSMSCode", function(data){ |
| | | if(data!=null && data.code != 200){ |
| | | if(data != null && data.code != 200){ |
| | | alert(data.msg); |
| | | } |
| | | }); |
| | | ajax.set("phone",phone); |
| | | ajax.set("phone", phone); |
| | | ajax.start(); |
| | | } |
| | | |
| | | // 倒计时函数 |
| | | function startCountdown(btn, seconds) { |
| | | var $btn = $(btn); |
| | | $btn.prop('disabled', true); |
| | | $btn.css('background', '#ccc'); |
| | | var count = seconds; |
| | | $btn.text(count + "s后重发"); |
| | | var timer = setInterval(function() { |
| | | count--; |
| | | if (count > 0) { |
| | | $btn.text(count + "s后重发"); |
| | | } else { |
| | | clearInterval(timer); |
| | | $btn.prop('disabled', false); |
| | | $btn.css('background', ''); // 恢复原色 |
| | | $btn.text("获取验证码"); |
| | | } |
| | | }, 1000); |
| | | } |
| | | |
| | | //aes加密 |
| | | function encrypt(context) { |
| | | var encrypted = ''; |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>惠民卡管理111</h5> |
| | | <h5>玩湃惠民卡管理111</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-1 control-label">门店无惠民卡介绍页</label> |
| | | <label class="col-sm-1 control-label">门店无玩湃惠民卡介绍页</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="editor_3" type="text/plain" style="width:1200px;height:400px;">${item.storeNoHuiminCardIntro!}</textarea> |
| | | </div> |
| | |
| | | // 页面初始化时通过AJAX请求获取协议配置数据 |
| | | console.log("页面初始化,当前运营商ID:", operatorId); |
| | | |
| | | // 调用接口获取协议配置数据(只回显协议配置,不回显门店无惠民卡介绍页) |
| | | // 调用接口获取协议配置数据(只回显协议配置,不回显门店无玩湃惠民卡介绍页) |
| | | var ajax = new $ax(Feng.ctxPath + "/tHuiminAgreement/selectAgreementByOperationId", function(data){ |
| | | console.log("获取到的惠民卡数据:", data); |
| | | console.log("获取到的玩湃惠民卡数据:", data); |
| | | if (data.data != null){ |
| | | // 只更新协议配置 |
| | | if (data.data.settingList && data.data.settingList.length > 0) { |
| | |
| | | } |
| | | } |
| | | },function(data){ |
| | | console.error("获取惠民卡数据失败:", data); |
| | | Feng.error("获取惠民卡数据失败!"); |
| | | console.error("获取玩湃惠民卡数据失败:", data); |
| | | Feng.error("获取玩湃惠民卡数据失败!"); |
| | | }); |
| | | ajax.set("operatorId", operatorId); |
| | | ajax.start(); |
| | |
| | | // 先主动清空编辑器内容 |
| | | if(editor_3 && editor_3.body) { |
| | | editor_3.setContent(""); |
| | | console.log("主动清空门店无惠民卡介绍页内容"); |
| | | console.log("主动清空门店无玩湃惠民卡介绍页内容"); |
| | | } |
| | | |
| | | //清空协议配置 |
| | |
| | | //调用接口获取协议配置数据 |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tHuiminAgreement/selectAgreementByOperationId", function(data){ |
| | | console.log("获取到的惠民卡数据:", data); |
| | | console.log("获取到的玩湃惠民卡数据:", data); |
| | | if (data.data != null){ |
| | | // 更新门店无惠民卡介绍页内容 |
| | | // 更新门店无玩湃惠民卡介绍页内容 |
| | | try { |
| | | var introContent = ""; |
| | | // 严格判断内容是否存在且非空 |
| | |
| | | if(editor_3 && editor_3.body) { |
| | | // 设置编辑器内容(空内容会清空编辑器) |
| | | editor_3.setContent(introContent); |
| | | console.log("已更新门店无惠民卡介绍页内容:", introContent ? "有内容" : "内容为空"); |
| | | console.log("已更新门店无玩湃惠民卡介绍页内容:", introContent ? "有内容" : "内容为空"); |
| | | } else { |
| | | console.error("编辑器未准备好,无法设置内容"); |
| | | // 延迟设置内容 |
| | |
| | | try { |
| | | if(editor_3) { |
| | | editor_3.setContent(introContent); |
| | | console.log("延迟更新门店无惠民卡介绍页内容成功"); |
| | | console.log("延迟更新门店无玩湃惠民卡介绍页内容成功"); |
| | | } |
| | | } catch(e) { |
| | | console.error("延迟设置编辑器内容出错:", e); |
| | |
| | | } |
| | | } |
| | | },function(data){ |
| | | console.error("获取惠民卡数据失败:", data); |
| | | Feng.error("获取惠民卡数据失败!"); |
| | | console.error("获取玩湃惠民卡数据失败:", data); |
| | | Feng.error("获取玩湃惠民卡数据失败!"); |
| | | }); |
| | | ajax.set("operatorId",$("#operator").val()); |
| | | ajax.start(); |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>惠民卡管理</h5> |
| | | <h5>玩湃惠民卡管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <el-form :inline="true" :model="query"> |
| | | <elshou-form-item label="惠民卡名称:"> |
| | | <elshou-form-item label="玩湃惠民卡名称:"> |
| | | <el-input v-model="query.huiMinName" placeholder="请输入"></el-input> |
| | | </elshou-form-item> |
| | | |
| | | <el-form-item label="惠民卡类型:"> |
| | | <el-form-item label="玩湃惠民卡类型:"> |
| | | <el-select v-model="query.huiMinType" placeholder="全部"> |
| | | <el-option label="全部" value=""></el-option> |
| | | <el-option label="年度卡" value="1"></el-option> |
| | |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | |
| | | <el-form-item label="惠民卡状态:"> |
| | | <el-form-item label="玩湃惠民卡状态:"> |
| | | <el-select v-model="query.huiMinStatus" placeholder="全部"> |
| | | <el-option label="全部" value=""></el-option> |
| | | <el-option label="未开始" value="1"></el-option> |
| | |
| | | style="width: 100%" |
| | | v-on:selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55"></el-table-column> |
| | | <el-table-column prop="huiMinName" label="惠民卡名称"></el-table-column> |
| | | <el-table-column prop="huiMinName" label="玩湃惠民卡名称"></el-table-column> |
| | | <el-table-column prop="huiMinType" label="类型"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.huiMinType === '1'">年度卡</span> |
| | |
| | | <body> |
| | | <div id="app0" class="form-container"> |
| | | <el-form :rules="rules" label-position="left" ref="formRef" label-width="120px" :model="huiminCard" size="small"> |
| | | <el-form-item label="惠民卡名称" prop="huiMinName"> |
| | | <el-form-item label="玩湃惠民卡名称" prop="huiMinName"> |
| | | <el-input v-model="huiminCard.huiMinName"></el-input> |
| | | </el-form-item> |
| | | |
| | | |
| | | <!-- 惠民卡类型 --> |
| | | <el-form-item label="惠民卡类型" prop="huiMinType"> |
| | | <!-- 玩湃惠民卡类型 --> |
| | | <el-form-item label="玩湃惠民卡类型" prop="huiMinType"> |
| | | <el-radio-group v-model="huiminCard.huiMinType"> |
| | | <el-radio :label="1">年度卡</el-radio> |
| | | <el-radio :label="2">年内卡</el-radio> |
| | |
| | | </el-form-item> |
| | | |
| | | |
| | | <!-- 惠民卡介绍 --> |
| | | <el-form-item label="惠民卡介绍" prop="introduce"> |
| | | <!-- 玩湃惠民卡介绍 --> |
| | | <el-form-item label="玩湃惠民卡介绍" prop="introduce"> |
| | | <textarea type="text/plain" v-model="introduces" id="editor_1"></textarea> |
| | | </el-form-item> |
| | | |
| | |
| | | trigger: 'blur' |
| | | }], |
| | | buyCover: [{required: true, message: '已购买封面不能为空', trigger: 'blur'}], |
| | | huiMinName: [{required: true, message: '请输入惠民卡名称', trigger: 'blur'}], |
| | | huiMinType: [{required: true, message: '请选择惠民卡类型', trigger: 'change'}], |
| | | huiMinName: [{required: true, message: '请输入玩湃惠民卡名称', trigger: 'blur'}], |
| | | huiMinType: [{required: true, message: '请选择玩湃惠民卡类型', trigger: 'change'}], |
| | | salesMoney: [{required: true, message: '请输入售卖金额', trigger: 'blur'}], |
| | | unBuyRemark: [{required: true, message: '请输入使用说明', trigger: 'blur'}], |
| | | banner: [{required: true, message: '请上传轮播图', trigger: 'blur'}], |
| | |
| | | <div id="app0" class="form-container"> |
| | | <el-form :rules="rules" :disabled="pageType === 'detail'" label-position="left" ref="formRef" label-width="120px" |
| | | :model="huiminCard" size="small"> |
| | | <el-form-item label="惠民卡名称" prop="huiMinName"> |
| | | <el-form-item label="玩湃惠民卡名称" prop="huiMinName"> |
| | | <el-input v-model="huiminCard.huiMinName"></el-input> |
| | | </el-form-item> |
| | | |
| | | |
| | | <!-- 惠民卡类型 --> |
| | | <el-form-item label="惠民卡类型" prop="huiMinType"> |
| | | <!-- 玩湃惠民卡类型 --> |
| | | <el-form-item label="玩湃惠民卡类型" prop="huiMinType"> |
| | | <el-radio-group v-model="huiminCard.huiMinType"> |
| | | <el-radio :label="1">年度卡</el-radio> |
| | | <el-radio :label="2">年内卡</el-radio> |
| | |
| | | </el-table> |
| | | </el-form-item> |
| | | |
| | | <!-- 惠民卡介绍 --> |
| | | <el-form-item label="惠民卡介绍" prop="introduce"> |
| | | <!-- 玩湃惠民卡介绍 --> |
| | | <el-form-item label="玩湃惠民卡介绍" prop="introduce"> |
| | | <textarea type="text/plain" v-model="introduces" id="editor_1"></textarea> |
| | | </el-form-item> |
| | | |
| | |
| | | trigger: 'blur' |
| | | }], |
| | | buyCover: [{required: true, message: '已购买封面不能为空', trigger: 'blur'}], |
| | | huiMinName: [{required: true, message: '请输入惠民卡名称', trigger: 'blur'}], |
| | | huiMinType: [{required: true, message: '请选择惠民卡类型', trigger: 'change'}], |
| | | huiMinName: [{required: true, message: '请输入玩湃惠民卡名称', trigger: 'blur'}], |
| | | huiMinType: [{required: true, message: '请选择玩湃惠民卡类型', trigger: 'change'}], |
| | | salesMoney: [{required: true, message: '请输入售卖金额', trigger: 'blur'}], |
| | | unBuyRemark: [{required: true, message: '请输入使用说明', trigger: 'blur'}], |
| | | banner: [{required: true, message: '请上传轮播图', trigger: 'blur'}], |
| | |
| | | <div class="row"> |
| | | <div class="col-sm-6 b-r"> |
| | | <#input id="id" name="主键id" value="${item.id}" underline="true"/> |
| | | <#input id="huiMinName" name="惠民卡名称" value="${item.huiMinName}" underline="true"/> |
| | | <#input id="huiMinType" name="惠民卡类型1年度2年内" value="${item.huiMinType}" underline="true"/> |
| | | <#input id="huiMinName" name="玩湃惠民卡名称" value="${item.huiMinName}" underline="true"/> |
| | | <#input id="huiMinType" name="玩湃惠民卡类型1年度2年内" value="${item.huiMinType}" underline="true"/> |
| | | <#input id="salesMoney" name="售卖金额" value="${item.salesMoney}" underline="true"/> |
| | | <#input id="buyCover" name="已购买封面" value="${item.buyCover}" underline="true"/> |
| | | <#input id="unBuyCover" name="未购买封面" value="${item.unBuyCover}" underline="true"/> |
| | |
| | | <#input id="unUseTimes" name="不可用时间段,yyyy-MM-dd HH:mm:ss,多个逗号分隔" value="${item.unUseTimes}" underline="true"/> |
| | | <#input id="useScope" name="使用范围1门店2场地" value="${item.useScope}" underline="true"/> |
| | | <#input id="useIds" name="根据适用范围,存储门店id或场地id,多个逗号分隔" value="${item.useIds}" underline="true"/> |
| | | <#input id="introduce" name="惠民卡介绍" value="${item.introduce}" underline="true"/> |
| | | <#input id="introduce" name="玩湃惠民卡介绍" value="${item.introduce}" underline="true"/> |
| | | <#input id="sort" name="排序" value="${item.sort}" underline="true"/> |
| | | <#input id="storeId" name="门店id" value="${item.storeId}" /> |
| | | </div> |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>惠民卡管理</h5> |
| | | <h5>玩湃惠民卡管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | |
| | | <div class="row"> |
| | | <div class="form-group"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="huiMinName" name="惠民卡名称:" /> |
| | | <#NameCon id="huiMinName" name="玩湃惠民卡名称:" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="huiMinType" name="惠民卡类型:"> |
| | | <#SelectCon id="huiMinType" name="玩湃惠民卡类型:"> |
| | | <option value="">全部</option> |
| | | <option value="1">年度卡</option> |
| | | <option value="2">年内卡</option> |
| | |
| | | <#input id="orderNumber" name="第三方支付流水号" underline="true"/> |
| | | <#input id="refundTime" name="退款时间" underline="true"/> |
| | | <#input id="refundStatus" name="退款状态 1未退款 2已退款 3线下退款(使用过或超过七日退款)" underline="true"/> |
| | | <#input id="cardId" name="惠民卡id" underline="true"/> |
| | | <#input id="cardId" name="玩湃惠民卡id" underline="true"/> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <#input id="orderNumber" name="第三方支付流水号" value="${item.orderNumber}" underline="true"/> |
| | | <#input id="refundTime" name="退款时间" value="${item.refundTime}" underline="true"/> |
| | | <#input id="refundStatus" name="退款状态 1未退款 2已退款 3线下退款(使用过或超过七日退款)" value="${item.refundStatus}" underline="true"/> |
| | | <#input id="cardId" name="惠民卡id" value="${item.cardId}" /> |
| | | <#input id="cardId" name="玩湃惠民卡id" value="${item.cardId}" /> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | </div> |
| | | @} |
| | | <div style="font-size: x-large;">惠民卡板块</div> |
| | | <div style="font-size: x-large;">玩湃惠民卡板块</div> |
| | | <div class="form-group"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-3 control-label" > |
| | | 惠民卡:<input type="radio" name="r10" value="1">开启 <input type="radio" name="r10" value="0">关闭 |
| | | 玩湃惠民卡:<input type="radio" name="r10" value="1">开启 <input type="radio" name="r10" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | |
| | | /** |
| | | * 惠民卡管理初始化 |
| | | * 玩湃惠民卡管理初始化 |
| | | */ |
| | | var THuiminAgreement = { |
| | | id: "THuiminAgreementTable", //表格id |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加惠民卡 |
| | | * 点击添加玩湃惠民卡 |
| | | */ |
| | | THuiminAgreement.openAddTHuiminAgreement = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加惠民卡', |
| | | title: '添加玩湃惠民卡', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看惠民卡详情 |
| | | * 打开查看玩湃惠民卡详情 |
| | | */ |
| | | THuiminAgreement.openTHuiminAgreementDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '惠民卡详情', |
| | | title: '玩湃惠民卡详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 删除惠民卡 |
| | | * 删除玩湃惠民卡 |
| | | */ |
| | | THuiminAgreement.delete = function () { |
| | | if (this.check()) { |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 查询惠民卡列表 |
| | | * 查询玩湃惠民卡列表 |
| | | */ |
| | | THuiminAgreement.search = function () { |
| | | var queryData = {}; |
| | |
| | | /** |
| | | * 初始化惠民卡详情对话框 |
| | | * 初始化玩湃惠民卡详情对话框 |
| | | */ |
| | | var THuiminAgreementInfoDlg = { |
| | | tHuiminAgreementInfoData : {} |
| | |
| | | /** |
| | | * 惠民卡管理初始化 |
| | | * 玩湃惠民卡管理初始化 |
| | | */ |
| | | var THuiminCard = { |
| | | id: "THuiminCardTable", //表格id |
| | |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键id', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '惠民卡名称', field: 'huiMinName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '惠民卡类型1年度2年内', field: 'huiMinType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '玩湃惠民卡名称', field: 'huiMinName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '玩湃惠民卡类型1年度2年内', field: 'huiMinType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '售卖金额', field: 'salesMoney', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '已购买封面', field: 'buyCover', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '未购买封面', field: 'unBuyCover', visible: true, align: 'center', valign: 'middle'}, |
| | |
| | | {title: '不可用时间段,yyyy-MM-dd HH:mm:ss,多个逗号分隔', field: 'unUseTimes', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '使用范围1门店2场地', field: 'useScope', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '根据适用范围,存储门店id或场地id,多个逗号分隔', field: 'useIds', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '惠民卡介绍', field: 'introduce', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '玩湃惠民卡介绍', field: 'introduce', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '排序', field: 'sort', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '门店id', field: 'storeId', visible: true, align: 'center', valign: 'middle'} |
| | | ]; |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加惠民卡 |
| | | * 点击添加玩湃惠民卡 |
| | | */ |
| | | THuiminCard.openAddTHuiminCard = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加惠民卡', |
| | | title: '添加玩湃惠民卡', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看惠民卡详情 |
| | | * 打开查看玩湃惠民卡详情 |
| | | */ |
| | | THuiminCard.openTHuiminCardDetail = function (id, pageType) { |
| | | console.log(id) |
| | | let index = layer.open({ |
| | | type: 2, |
| | | title: '惠民卡详情', |
| | | title: '玩湃惠民卡详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 删除惠民卡 |
| | | * 删除玩湃惠民卡 |
| | | */ |
| | | THuiminCard.delete = function () { |
| | | if (this.check()) { |
| | |
| | | |
| | | |
| | | /** |
| | | * 查询惠民卡列表 |
| | | * 查询玩湃惠民卡列表 |
| | | */ |
| | | THuiminCard.search = function () { |
| | | |
| | |
| | | /** |
| | | * 初始化惠民卡详情对话框 |
| | | * 初始化玩湃惠民卡详情对话框 |
| | | */ |
| | | var THuiminCardInfoDlg = { |
| | | tHuiminCardInfoData : {} |
| | |
| | | /** |
| | | * 惠民卡管理初始化 |
| | | * 玩湃惠民卡管理初始化 |
| | | */ |
| | | var THuiminRecord = { |
| | | id: "THuiminRecordTable", //表格id |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加惠民卡 |
| | | * 点击添加玩湃惠民卡 |
| | | */ |
| | | THuiminRecord.openAddTHuiminRecord = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加惠民卡', |
| | | title: '添加玩湃惠民卡', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看惠民卡详情 |
| | | * 打开查看玩湃惠民卡详情 |
| | | */ |
| | | THuiminRecord.openTHuiminRecordDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '惠民卡详情', |
| | | title: '玩湃惠民卡详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 删除惠民卡 |
| | | * 删除玩湃惠民卡 |
| | | */ |
| | | THuiminRecord.delete = function () { |
| | | if (this.check()) { |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 查询惠民卡列表 |
| | | * 查询玩湃惠民卡列表 |
| | | */ |
| | | THuiminRecord.search = function () { |
| | | var queryData = {}; |
| | |
| | | /** |
| | | * 初始化惠民卡详情对话框 |
| | | * 初始化玩湃惠民卡详情对话框 |
| | | */ |
| | | var THuiminRecordInfoDlg = { |
| | | tHuiminRecordInfoData : {} |
| | |
| | | /** |
| | | * 惠民卡管理初始化 |
| | | * 玩湃惠民卡管理初始化 |
| | | */ |
| | | var TPayHuimin = { |
| | | id: "TPayHuiminTable", //表格id |
| | |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '惠民卡名称', field: 'huiMinName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '惠民卡类型', field: 'huiMinType', visible: true, align: 'center', valign: 'middle', |
| | | {title: '玩湃惠民卡名称', field: 'huiMinName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '玩湃惠民卡类型', field: 'huiMinType', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function(value,row,index){ |
| | | return {1: '年度卡', 2: '年内卡'}[value]; |
| | | }}, |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加惠民卡 |
| | | * 点击添加玩湃惠民卡 |
| | | */ |
| | | TPayHuimin.openAddTPayHuimin = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加惠民卡', |
| | | title: '添加玩湃惠民卡', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看惠民卡详情 |
| | | * 打开查看玩湃惠民卡详情 |
| | | */ |
| | | TPayHuimin.openTPayHuiminDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '惠民卡详情', |
| | | title: '玩湃惠民卡详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 删除惠民卡 |
| | | * 删除玩湃惠民卡 |
| | | */ |
| | | TPayHuimin.delete = function () { |
| | | if (this.check()) { |
| | |
| | | ajax.set("id", TPayHuimin.seItem.id); |
| | | ajax.start(); |
| | | }; |
| | | Feng.confirm("确认退款所选惠民卡吗?",operation); |
| | | Feng.confirm("确认退款所选玩湃惠民卡吗?",operation); |
| | | } |
| | | } |
| | | TPayHuimin.export = function (){ |
| | |
| | | return queryData; |
| | | } |
| | | /** |
| | | * 查询惠民卡列表 |
| | | * 查询玩湃惠民卡列表 |
| | | */ |
| | | TPayHuimin.search = function () { |
| | | var queryData = TPayHuimin.getQueryParam(); |
| | |
| | | /** |
| | | * 初始化惠民卡详情对话框 |
| | | * 初始化玩湃惠民卡详情对话框 |
| | | */ |
| | | var TPayHuiminInfoDlg = { |
| | | tPayHuiminInfoData : {} |
| | |
| | | @Data |
| | | @ApiModel |
| | | public class StoreConfigVo { |
| | | @ApiModelProperty(" 数据类型(0=平台配置模块,1=报名玩湃课程,2=预约场地,3=报名赛事及活动,4=免费福利,5=线上课程积分,6=购买优惠门票,7=看视频得奖励,8=智慧球场,9=社区世界杯,10=惠民卡)") |
| | | @ApiModelProperty(" 数据类型(0=平台配置模块,1=报名玩湃课程,2=预约场地,3=报名赛事及活动,4=免费福利,5=线上课程积分,6=购买优惠门票,7=看视频得奖励,8=智慧球场,9=社区世界杯,10=玩湃惠民卡)") |
| | | private Integer type; |
| | | @ApiModelProperty("是否开启(0=否,1=是)") |
| | | private Integer isOpen; |