| | |
| | | VipPaymentVO res = new VipPaymentVO(); |
| | | res.setHeadImg(appUser.getHeadImg()); |
| | | res.setName(appUser.getName()); |
| | | res.setVipEndTime(appUser.getVipEndTime()); |
| | | if (appUser.getVipEndTime()==null){ |
| | | res.setIsVip(0); |
| | | }else if (appUser.getVipEndTime().before(new Date())){ |
| | |
| | | appUserService.updateById(appUser); |
| | | List<Vip> vips = vipClient.listAll(); |
| | | res.setVipList(vips); |
| | | |
| | | return ResultUtil.success(res); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | // |
| | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | commodities = commodities.subList(0, 5); |
| | | } |
| | | indexOfUserBenefirVo.setCommodities(commodities); |
| | | TAppUser byId = appUserService.getById(appUserId); |
| | | if (byId.getIsVip()!=null && byId.getIsVip()==1){ |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | if (byId.getVipEndTime().getTime() > System.currentTimeMillis()) { |
| | | indexOfUserBenefirVo.setVipEndTime(simpleDateFormat.format(byId.getVipEndTime())); |
| | | } else { |
| | | indexOfUserBenefirVo.setVipEndTime(""); |
| | | } |
| | | } |
| | | return ResultUtil.success(indexOfUserBenefirVo); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | |
| | | @ApiModelProperty("是否是裁判(0=否,1=是)") |
| | | private Integer referee; |
| | | @ApiModelProperty("会员到期时间") |
| | | private String vipEndTime; |
| | | |
| | | } |
| | |
| | | if (StringUtils.hasLength(couponJson)) { |
| | | grantCoupon.setCouponJson(couponJson); |
| | | } |
| | | grantCoupon.setVipId(vipPayment1.getVipId()); |
| | | grantCoupon.setUserId(vipPayment1.getAppUserId()); |
| | | grantCoupon.setVipPaymentId(vipPayment1.getId()); |
| | | String ticketJson = vipPayment1.getTicketJson(); |
| | |
| | | /** |
| | | * 体验券名称 |
| | | */ |
| | | @ApiModelProperty("体验券名称 ") |
| | | @ApiModelProperty("体验券名称/抵扣券抵扣商品名称 ") |
| | | String experienceName; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty("优惠券名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("优惠券类型(1=满减券,2=代金券,3=体验券)") |
| | | @ApiModelProperty("优惠券类型(1=满减券,2=代金券,3=体验券 4=抵扣券)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("适用范围1全国通用 2指定城市可用 3指定门店可用") |
| | |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | |
| | | private String name; |
| | | @ApiModelProperty(value = "当前是否会员 0否1是") |
| | | private Integer isVip; |
| | | @ApiModelProperty(value = "会员到期时间") |
| | | private Date vipEndTime; |
| | | @ApiModelProperty(value = "所有上架的会员卡") |
| | | private List<Vip> vipList; |
| | | @ApiModelProperty(value = "会员协议") |
| | |
| | | import com.dsh.activity.feignclient.other.OperatorClient; |
| | | import com.dsh.activity.feignclient.other.RegionClient; |
| | | import com.dsh.activity.feignclient.other.StoreClient; |
| | | import com.dsh.activity.feignclient.other.VipClient; |
| | | import com.dsh.activity.feignclient.other.model.CityDataAndProvinceDataVo; |
| | | import com.dsh.activity.feignclient.other.model.Store; |
| | | import com.dsh.activity.feignclient.other.model.StoreInfoDto; |
| | |
| | | |
| | | @Autowired |
| | | private TokenUtil tokenUtil; |
| | | @Autowired |
| | | private VipClient vipClient; |
| | | |
| | | @Autowired |
| | | private UserCouponService ucService; |
| | | |
| | | |
| | | @Autowired |
| | | private GDMapGeocodingUtil gdMapGeocodingUtil; |
| | |
| | | @PostMapping("/api/coupon/queryCouponList") |
| | | @ApiOperation(value = "获取优惠券列表", tags = {"APP-成为会员", ""}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "1=积分购买,2=注册赠送", name = "distributionMethod", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "vipId", name = "vipId", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "用户token(Bearer +token)", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9.....") |
| | | }) |
| | | public ResultUtil<List<CouponListVo>> queryCouponList(Integer distributionMethod) { |
| | | if (null == distributionMethod) { |
| | | return ResultUtil.paranErr("distributionMethod"); |
| | | public ResultUtil<VipCouponTicketListResp> queryCouponList(Integer vipId) { |
| | | if (null == vipId) { |
| | | return ResultUtil.paranErr("vipId"); |
| | | } |
| | | VipCouponTicketListResp vipCouponTicketListResp = new VipCouponTicketListResp(); |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if (null == uid) { |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | List<CouponListVo> listVos = couponService.queryCouponList(uid, distributionMethod); |
| | | return ResultUtil.success(listVos); |
| | | List<Vip> vips = vipClient.listAll(); |
| | | Vip vip = vips.stream().filter(e -> e.getId().equals(vipId)).findFirst().orElse(null); |
| | | if (vip!=null){ |
| | | List<CouponVipResp> couponVipResps = new ArrayList<>(); |
| | | List<TicketVipResp> ticketVipResps = new ArrayList<>(); |
| | | List<CouponVipResp> couponList = vip.getCouponList(); |
| | | for (CouponVipResp couponVipResp : couponList) { |
| | | for (Integer i = 0; i < couponVipResp.getCount(); i++) { |
| | | couponVipResps.add(couponVipResp); |
| | | } |
| | | } |
| | | List<TicketVipResp> ticketList = vip.getTicketList(); |
| | | for (TicketVipResp ticketVipResp : ticketList) { |
| | | for (Integer i = 0; i < ticketVipResp.getCount(); i++) { |
| | | ticketVipResps.add(ticketVipResp); |
| | | } |
| | | } |
| | | vipCouponTicketListResp.setCouponVipRespList(couponVipResps); |
| | | vipCouponTicketListResp.setTicketVipRespList(ticketVipResps); |
| | | return ResultUtil.success(vipCouponTicketListResp); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return ResultUtil.success(); |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | |
| | |
| | | List<CouponCity> list = cityService.list(new LambdaQueryWrapper<CouponCity>()); |
| | | return list; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/queryAllPointGoods") |
| | | public List<PointsMerchandise> queryAllPointGoods(){ |
| | | List<PointsMerchandise> pointsMerchandiseList = pointsMerchandiseService.list(); |
| | | return pointsMerchandiseList; |
| | | } |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/queryStore") |
| | | public List<Integer> queryStore(@RequestBody Integer id) { |
| | |
| | | import com.dsh.activity.entity.THuiminRecord; |
| | | import com.dsh.activity.entity.TPayHuimin; |
| | | import com.dsh.activity.entity.VipDetail; |
| | | import com.dsh.activity.feignclient.other.SiteClient; |
| | | import com.dsh.activity.feignclient.other.StoreClient; |
| | | import com.dsh.activity.feignclient.other.model.Site; |
| | | import com.dsh.activity.feignclient.other.model.Store; |
| | | import com.dsh.activity.service.*; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 硬件方调用 存储玩湃惠民卡使用记录 |
| | |
| | | private PayHuiminService payHuiminService; |
| | | @Resource |
| | | private VipDetailService vipDetailService; |
| | | @Resource |
| | | private SiteClient siteClient; |
| | | @Resource |
| | | private StoreClient storeClient; |
| | | /** |
| | | * 硬件开门后回调 存储玩湃惠民卡使用记录 |
| | | */ |
| | |
| | | * 硬件开门后回调 存储会员使用明细 |
| | | */ |
| | | @PostMapping("/recordVipDetail") |
| | | public void recordVipDetail(Integer id,Integer rid,Integer sid) { |
| | | public void recordVipDetail(Integer vipDetailId,Integer rid,Integer sid) { |
| | | System.err.println("硬件开门后回调 存储会员卡门票权益使用记录"); |
| | | System.err.println("id:"+id); |
| | | System.err.println("vipDetailId:"+vipDetailId); |
| | | System.err.println("rid:"+rid); |
| | | System.err.println("sid:"+sid); |
| | | VipDetail vipDetailServiceById = vipDetailService.getById(id); |
| | | VipDetail vipDetailServiceById = vipDetailService.getById(vipDetailId); |
| | | if (vipDetailServiceById!=null){ |
| | | Site site = siteClient.querySiteById(rid); |
| | | if (site!=null){ |
| | | List<Store> stores = storeClient.queryStoreByIds(Arrays.asList(rid)); |
| | | if (!stores.isEmpty()){ |
| | | Store store = stores.get(0); |
| | | vipDetailServiceById.setOperatorId(store.getOperatorId()); |
| | | } |
| | | } |
| | | // 根据场地id查询运营商id |
| | | vipDetailServiceById.setUseSiteId(rid); |
| | | vipDetailServiceById.setUseStoreId(sid); |
| | | vipDetailServiceById.setStatus(2); |
| | | vipDetailServiceById.setStartTime(new Date()); |
| | | vipDetailServiceById.setEndTime(new Date()); |
| | | vipDetailService.updateById(vipDetailServiceById); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | detailsResponse.setGoodName(vipDetail.getTicketName()); |
| | | detailsResponse.setStartTime(simpleDateFormat.format(vipDetail.getStartTime())); |
| | | detailsResponse.setEndTime(simpleDateFormat.format(vipDetail.getEndTime())); |
| | | detailsResponse.setUseStatus(vipDetail.getStatus()); |
| | | detailsResponse.setUseStatus(vipDetail.getStatus()==1?2:1); |
| | | detailsResponse.setGoodType(3); |
| | | // 表明是会员赠送的门票 |
| | | detailsResponse.setExchangeType(4); |
| | |
| | | vipDetail.setUserCouponId(userCoupon.getId()); |
| | | vipDetailService.save(vipDetail); |
| | | userCoupon.setVipDetailId(vipDetail.getId()); |
| | | userCoupon.setUserId(null); |
| | | userCouponService.updateById(userCoupon); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | |
| | | import com.dsh.activity.model.ConponJsonRuleModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("会员权益优惠券列表") |
| | | public class CouponVipResp { |
| | | |
| | | @ApiModelProperty("优惠券id") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("优惠券名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("优惠券类型(1=满减券,2=代金券,3=体验券 4=抵扣券)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("适用范围1全国通用 2指定城市可用 3指定门店可用") |
| | | private Integer useCondition; |
| | | |
| | | @ApiModelProperty("适用范围名称") |
| | | private String available; |
| | | |
| | | @ApiModelProperty("useCondition = 2,为地址字符串;useCondition = 3,为门店名称+地址字符串") |
| | | private String cityOrStore; |
| | | |
| | | @ApiModelProperty("优惠券说明(使用说明)") |
| | | private String instructionsForUse; |
| | | |
| | | @ApiModelProperty("金额条件封装") |
| | | private ConponJsonRuleModel ruleModel; |
| | | |
| | | @ApiModelProperty("有效时间(2021-05-05)") |
| | | private String effectiveTime; |
| | | @ApiModelProperty("有效时间开始(2021-05-05)") |
| | | private String startTime; |
| | | @ApiModelProperty("数量 张") |
| | | private Integer count; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("会员权益门票列表") |
| | | public class TicketVipResp { |
| | | |
| | | |
| | | @ApiModelProperty("门票名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("领取后x天有效") |
| | | private Integer time; |
| | | |
| | | @ApiModelProperty("数量 张") |
| | | private Integer count; |
| | | @ApiModelProperty("有效时间(2021-05-05)") |
| | | private String effectiveTime; |
| | | @ApiModelProperty("有效时间开始(2021-05-05)") |
| | | private String startTime; |
| | | |
| | | } |
New file |
| | |
| | | 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; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 会员管理 |
| | | */ |
| | | @TableName("t_vip") |
| | | @Data |
| | | @ApiModel(description = "会员") |
| | | public class Vip { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | @ApiModelProperty(value = "主键id") |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 会员名称 |
| | | */ |
| | | @TableField("vipName") |
| | | @ApiModelProperty(value = "会员名称") |
| | | private String vipName; |
| | | |
| | | /** |
| | | * 会员时长类型 1天 2月 3年 |
| | | */ |
| | | @TableField("timeType") |
| | | @ApiModelProperty(value = "会员时长类型 1天 2月 3年") |
| | | private Integer timeType; |
| | | |
| | | /** |
| | | * 会员时长 |
| | | */ |
| | | @TableField("time") |
| | | @ApiModelProperty(value = "会员时长数量 对应会员时长类型 x天 x月 x年") |
| | | private Integer time; |
| | | |
| | | /** |
| | | * 会员价格 |
| | | */ |
| | | @TableField("price") |
| | | @ApiModelProperty(value = "会员价格") |
| | | private BigDecimal price; |
| | | |
| | | /** |
| | | * 状态 1上架2下架 |
| | | */ |
| | | @TableField("status") |
| | | @ApiModelProperty(value = "状态 1上架2下架") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @ApiModelProperty(value = "添加时间") |
| | | private Date insertTime; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("couponJson") |
| | | @ApiModelProperty(value = "优惠券json[{\n" + |
| | | "\t\"id\": \"1\",\n" + |
| | | "\t\"value\": \"1\"\n" + |
| | | "}, {\n" + |
| | | "\t\"id\": \"2\",\n" + |
| | | "\t\"value\": \"1\"\n" + |
| | | "}\n" + |
| | | "}]") |
| | | private String couponJson; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("ticketJson") |
| | | @ApiModelProperty(value = "门票json门票json[{\n" + |
| | | "\t\"name\": \"门票名称\",\n" + |
| | | "\t\"time\": \"1\",\n" + |
| | | "\"count\": \"1\",\n" + |
| | | "}]") |
| | | private String ticketJson; |
| | | |
| | | /** |
| | | * 会员优惠券权益 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "会员优惠券权益") |
| | | private List<CouponVipResp> couponList; |
| | | /** |
| | | * 会员门票权益 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "会员门票权益") |
| | | private List<TicketVipResp> ticketList; |
| | | } |
New file |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | |
| | | import com.dsh.activity.model.ConponJsonRuleModel; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel("购买会员获得的权益列表") |
| | | public class VipCouponTicketListResp { |
| | | |
| | | @ApiModelProperty("有效时间(2021-05-05)") |
| | | private List<CouponVipResp> couponVipRespList; |
| | | @ApiModelProperty("数量 张") |
| | | private List<TicketVipResp> ticketVipRespList; |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public class VipDetail { |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | @TableId(value = "id", type = IdType.NONE) |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
New file |
| | |
| | | package com.dsh.activity.feignclient.other; |
| | | |
| | | import com.dsh.activity.entity.Vip; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | |
| | | @FeignClient("mb-cloud-other") |
| | | public interface VipClient { |
| | | |
| | | |
| | | @PostMapping("/vip/listAll") |
| | | List<Vip> listAll(); |
| | | @PostMapping("/vip/getVipByIds") |
| | | List<Vip> getVipByIds(@RequestBody String ids); |
| | | @PostMapping("/vip/getAgreement") |
| | | String getAgreement(); |
| | | |
| | | } |
| | |
| | | */ |
| | | private Integer cityManagerId; |
| | | /** |
| | | * 积分商品id |
| | | */ |
| | | private Integer goodsId; |
| | | /** |
| | | * 数量 |
| | | */ |
| | | private Integer count; |
| | |
| | | Protocol three = protocolService.getOne(new LambdaQueryWrapper<Protocol>().eq(Protocol::getType, 3)); |
| | | Protocol four = protocolService.getOne(new LambdaQueryWrapper<Protocol>().eq(Protocol::getType, 4)); |
| | | Protocol five = protocolService.getOne(new LambdaQueryWrapper<Protocol>().eq(Protocol::getType, 5)); |
| | | Protocol six = protocolService.getOne(new LambdaQueryWrapper<Protocol>().eq(Protocol::getType, 6)); |
| | | Protocol seven = protocolService.getOne(new LambdaQueryWrapper<Protocol>().eq(Protocol::getType, 7)); |
| | | model.addAttribute("one",one); |
| | | model.addAttribute("two",two); |
| | | model.addAttribute("three",three); |
| | | model.addAttribute("four",four); |
| | | model.addAttribute("five",five); |
| | | if (six == null){ |
| | | if (seven == null){ |
| | | Protocol protocol = new Protocol(); |
| | | protocol.setType(6); |
| | | protocol.setType(7); |
| | | protocol.setContent(""); |
| | | protocol.setInsertTime(new Date()); |
| | | protocolService.save( protocol); |
| | | |
| | | model.addAttribute("six",protocol); |
| | | model.addAttribute("seven",protocol); |
| | | }else{ |
| | | model.addAttribute("six",six); |
| | | model.addAttribute("seven",seven); |
| | | } |
| | | |
| | | return PREFIX + "tAgreementDriver.html"; |
| | |
| | | //玩湃惠民卡 |
| | | StoreConfig c10 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,10)); |
| | | model.addAttribute("c10",c10); |
| | | //会员卡板块 |
| | | StoreConfig c11 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,11)); |
| | | model.addAttribute("c11",c11); |
| | | return PREFIX + "TShop_imgAll.html"; |
| | | } |
| | | |
| | |
| | | } |
| | | @RequestMapping(value = "/saveImgAll") |
| | | @ResponseBody |
| | | public Object saveImgAll(Integer id,Integer px1,Integer px2,Integer px3,Integer px4,Integer px5,Integer px6,Integer px7,Integer px8,Integer px10, |
| | | String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8,String c10, |
| | | Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8,Integer r10,String str) { |
| | | public Object saveImgAll(Integer id,Integer px1,Integer px2,Integer px3,Integer px4,Integer px5,Integer px6,Integer px7,Integer px8,Integer px10,Integer px11, |
| | | String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8,String c10,String c111, |
| | | Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8,Integer r10,Integer r11,String str) { |
| | | try { |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | StoreConfig collect1 = collect(id, px1, r1, c1, 1); |
| | |
| | | StoreConfig collect7 = collect(id, px7, r7, c7, 7); |
| | | StoreConfig collect8 = collect(id, px8, r8, c8, 8); |
| | | StoreConfig collect10 = collect(id, px10, r10, c10, 10); |
| | | StoreConfig collect11 = collect(id, px11, r11, c111, 11); |
| | | storeConfigs.add(collect1); |
| | | storeConfigs.add(collect2); |
| | | storeConfigs.add(collect3); |
| | |
| | | storeConfigs.add(collect7); |
| | | storeConfigs.add(collect8); |
| | | storeConfigs.add(collect10); |
| | | storeConfigs.add(collect11); |
| | | storeConfigService.saveOrUpdateBatch(storeConfigs); |
| | | |
| | | // 修改世界杯 |
| | |
| | | } |
| | | |
| | | // APP查询所有上架的会员卡 |
| | | @ResponseBody |
| | | @PostMapping("/listAll") |
| | | public List<Vip> listAll() { |
| | | List<Vip> list = vipService.lambdaQuery().eq(Vip::getStatus, 1).list(); |
| | | List<Coupon> coupons = couponClient.queryCouponAll(); |
| | | List<CouponCity> couponCityList = couponClient.queryAllCity(); |
| | | List<CouponStore> storeList = couponClient.queryAllStore(); |
| | | List<TStore> shopList = storeService.list(); |
| | | // 封装会员权益 |
| | | for (Vip vip : list) { |
| | | List<CouponVipResp> couponVipRespList = new ArrayList<>(); |
| | | List<TicketVipResp> ticketVipRespList = new ArrayList<>(); |
| | | String couponJson = vip.getCouponJson(); |
| | | JSONArray couponJsonArray = JSONArray.parseArray(couponJson); |
| | | for (Object o : couponJsonArray) { |
| | | JSONObject couponJsonObject = (JSONObject) o; |
| | | // 优惠券id |
| | | Integer id = Integer.valueOf(couponJsonObject.getString("id")); |
| | | // 优惠券数量 |
| | | Integer value = Integer.valueOf(couponJsonObject.getString("value")); |
| | | Coupon coupon = coupons.stream().filter(e -> e.getId().equals(id)).findFirst().orElse(new Coupon()); |
| | | CouponVipResp couponVipResp = new CouponVipResp(); |
| | | couponVipResp.setId(coupon.getId()); |
| | | couponVipResp.setName(coupon.getName()); |
| | | couponVipResp.setType(coupon.getType()); |
| | | couponVipResp.setUseCondition(coupon.getUseScope()); |
| | | couponVipResp.setCount(value); |
| | | switch (coupon.getUseScope()) { |
| | | case 1: |
| | | couponVipResp.setAvailable("全国通用"); |
| | | break; |
| | | case 2: |
| | | couponVipResp.setAvailable("指定城市可用"); |
| | | List<CouponCity> couponId = couponCityList.stream().filter(e -> e.getCouponId().equals(id)) |
| | | .collect(Collectors.toList()); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (CouponCity couponCity : couponId) { |
| | | stringBuilder.append(couponCity.getCity()); |
| | | } |
| | | couponVipResp.setCityOrStore(String.valueOf(stringBuilder)); |
| | | break; |
| | | case 3: |
| | | couponVipResp.setAvailable("指定门店可用"); |
| | | // 门店ids |
| | | List<Integer> storeIds = storeList.stream().filter(e -> e.getCouponId().equals(id)) |
| | | .map(CouponStore::getStoreId).collect(Collectors.toList()); |
| | | StringBuilder storeNames = new StringBuilder(""); |
| | | |
| | | if (!storeIds.isEmpty()) { |
| | | List<TStore> stores = shopList.stream().filter(e -> storeIds.contains(e.getId())).collect(Collectors.toList()); |
| | | for (TStore store : stores) { |
| | | storeNames.append(store.getName()).append(","); |
| | | } |
| | | // 去除最后一位 |
| | | StringBuilder res = storeNames.deleteCharAt(storeNames.length() - 1); |
| | | couponVipResp.setCityOrStore(res.toString()); |
| | | } else { |
| | | couponVipResp.setCityOrStore("无可用门店"); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | couponVipResp.setInstructionsForUse(coupon.getIllustrate()); |
| | | ConponJsonRuleModel ruleModel = new ConponJsonRuleModel(); |
| | | JSONObject jsonObject = JSON.parseObject(coupon.getContent()); |
| | | switch (coupon.getType()) { |
| | | case 1: |
| | | // 满减券 |
| | | Double num1 = jsonObject.getDouble("conditionalAmount"); |
| | | Double num2 = jsonObject.getDouble("deductionAmount"); |
| | | ruleModel.setConditionalAmount("满" + num1 + "可用"); |
| | | ruleModel.setDeductionAmount("¥ " + num2); |
| | | ruleModel.setExperienceName(""); |
| | | break; |
| | | case 2: |
| | | // 代金券 |
| | | Double jsonObjectDouble = jsonObject.getDouble("conditionalAmount"); |
| | | ruleModel.setConditionalAmount(""); |
| | | ruleModel.setDeductionAmount("¥ " + jsonObjectDouble); |
| | | ruleModel.setExperienceName(""); |
| | | break; |
| | | case 3: |
| | | // 体验券 |
| | | ruleModel.setConditionalAmount(""); |
| | | ruleModel.setDeductionAmount(""); |
| | | ruleModel.setExperienceName(jsonObject.getString("experienceName")); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | couponVipResp.setRuleModel(ruleModel); |
| | | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | couponVipResp.setEffectiveTime(simpleDateFormat.format(coupon.getEndTime())); |
| | | couponVipRespList.add(couponVipResp); |
| | | } |
| | | vip.setCouponList(couponVipRespList); |
| | | String ticketJson = vip.getTicketJson(); |
| | | JSONArray ticketJsonArray = JSONArray.parseArray(ticketJson); |
| | | for (Object o : ticketJsonArray) { |
| | | JSONObject ticketJsonObject = (JSONObject) o; |
| | | TicketVipResp ticketVipResp = new TicketVipResp(); |
| | | ticketVipResp.setName(ticketJsonObject.getString("name")); |
| | | ticketVipResp.setTime(ticketJsonObject.getInteger("time")); |
| | | ticketVipResp.setCount(ticketJsonObject.getInteger("count")); |
| | | ticketVipRespList.add(ticketVipResp); |
| | | } |
| | | vip.setTicketList(ticketVipRespList); |
| | | } |
| | | return list; |
| | | } |
| | | @Autowired |
| | | private IProtocolService protocolService; |
| | | @ResponseBody |
| | |
| | | <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">运动安全告知书</a></li> |
| | | <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">注销账号说明</a></li> |
| | | <li class=""><a data-toggle="tab" href="#tab-5" aria-expanded="false">社区世界杯报名协议</a></li> |
| | | <li class=""><a data-toggle="tab" href="#tab-6" aria-expanded="false">会员协议</a></li> |
| | | <li class=""><a data-toggle="tab" href="#tab-7" aria-expanded="false">会员协议</a></li> |
| | | </ul> |
| | | <div class="tab-content"> |
| | | <div id="tab-1" class="tab-pane active"> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div id="tab-6" class="tab-pane"> |
| | | <div id="tab-7" class="tab-pane"> |
| | | <div class="panel-body"> |
| | | <textarea type="text/plain" id="editor_6" style="width:1200px;height:400px;">${six.content}</textarea> |
| | | <textarea type="text/plain" id="editor_7" style="width:1200px;height:400px;">${seven.content}</textarea> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="update_6(${six.id});"/> |
| | | <#button btnCss="info" name="保存" id="ensure" icon="fa-check" clickFun="update_7(${seven.id});"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | var editor_3 = null; |
| | | var editor_4 = null; |
| | | var editor_5 = null; |
| | | var editor_7 = null; |
| | | $(function () { |
| | | //初始化编辑器 |
| | | editor_1 = UE.getEditor('editor_1'); |
| | |
| | | editor_3 = UE.getEditor('editor_3'); |
| | | editor_4 = UE.getEditor('editor_4'); |
| | | editor_5 = UE.getEditor('editor_5'); |
| | | editor_7 = UE.getEditor('editor_7'); |
| | | |
| | | }); |
| | | |
| | | function update_1(id){ |
| | |
| | | } |
| | | submitData(editor_5.getContent(),id); |
| | | } |
| | | function update_6(id){ |
| | | if (editor_6.getContentTxt() == ""){ |
| | | function update_7(id){ |
| | | if (editor_7.getContentTxt() == ""){ |
| | | Feng.error("内容不能为空!"); |
| | | return; |
| | | } |
| | | submitData(editor_6.getContent(),id); |
| | | submitData(editor_7.getContent(),id); |
| | | } |
| | | |
| | | function submitData(content,id) { |
| | |
| | | @if(c10!=null){ |
| | | <input hidden id="s10" value="${c10.isOpen}"> |
| | | @} |
| | | @if(c11!=null){ |
| | | <input hidden id="s11" value="${c11.isOpen}"> |
| | | @} |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | |
| | | @} |
| | | </div> |
| | | </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="r11" value="1">开启 <input type="radio" name="r11" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | @if(c11==null){ |
| | | <input class="form-control" style="width: 200px;" type="text" id="px11" value=""> |
| | | @} |
| | | @if(c11!=null){ |
| | | <input class="form-control" style="width: 200px;" type="text" id="px11" value="${c11.sort}"> |
| | | @} |
| | | </div> |
| | | </div> |
| | | @if(c11==null){ |
| | | <#avatar id="c111" name="背景图" /> |
| | | @} |
| | | @if(c11!=null){ |
| | | <#avatar id="c111" name="背景图" avatarImg="${c11.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div style="font-size: x-large;">首页其他板块设置</div> |
| | | <#button name="添加" icon="fa-plus" clickFun="TCompetition.openAddTCompetition(id)"/> |
| | | <#button name="编辑" icon="fa-edit" clickFun="TCompetition.openTCompetitionDetail1()" space="true"/> |
| | |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r11") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s11").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | // for (let i = 0; i < $('input[name="isOpen"]').length; i++) { |
| | | // var OBJradio=document.getElementsByName("r9") |
| | | // for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | |
| | | var px7 = $("#px7").val() |
| | | var px8 = $("#px8").val() |
| | | var px10 = $("#px10").val() |
| | | var px11 = $("#px11").val() |
| | | var c1 = $("#c1").val() |
| | | var c2 = $("#c2").val() |
| | | var c3 = $("#c3").val() |
| | |
| | | var c7 = $("#7").val() |
| | | var c8 = $("#c8").val() |
| | | var c10 = $("#c10").val() |
| | | var c111 = $("#c111").val() |
| | | var r1 = document.querySelector('input[name="r1"]').checked; |
| | | var r2 = document.querySelector('input[name="r2"]').checked; |
| | | var r3 = document.querySelector('input[name="r3"]').checked; |
| | |
| | | var r7 = document.querySelector('input[name="r7"]').checked; |
| | | var r8 = document.querySelector('input[name="r8"]').checked; |
| | | var r10 = document.querySelector('input[name="r10"]').checked; |
| | | var r11 = document.querySelector('input[name="r11"]').checked; |
| | | |
| | | var json1=[]; |
| | | for (let i = 0; i < $('input[name="px9"]').length; i++) { |
| | |
| | | }else{ |
| | | r10=0 |
| | | } |
| | | if(r11){ |
| | | r11 =1 |
| | | }else{ |
| | | r11=0 |
| | | } |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/saveImgAll", function(data){ |
| | | if(data.code == 200){ |
| | |
| | | ajax.set("px7",px7); |
| | | ajax.set("px8",px8); |
| | | ajax.set("px10",px10); |
| | | ajax.set("px11",px11); |
| | | ajax.set("c1",c1); |
| | | ajax.set("c2",c2); |
| | | ajax.set("c3",c3); |
| | |
| | | ajax.set("c7",c7); |
| | | ajax.set("c8",c8); |
| | | ajax.set("c10",c10); |
| | | ajax.set("c111",c111); |
| | | ajax.set("r1",r1); |
| | | ajax.set("r2",r2); |
| | | ajax.set("r3",r3); |
| | |
| | | ajax.set("r7",r7); |
| | | ajax.set("r8",r8); |
| | | ajax.set("r10",r10); |
| | | ajax.set("r11",r11); |
| | | ajax.set("str",JSON.stringify(json1)); |
| | | ajax.start(); |
| | | } |
| | |
| | | var carPhoto = new $WebUpload("c10"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c111"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | |
| | | |
| | | for (let i = 0; i < $('input[name="px9"]').length; i++) { |
New file |
| | |
| | | package com.dsh.other.controller; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | |
| | | import com.dsh.other.entity.Protocol; |
| | | import com.dsh.other.entity.Store; |
| | | import com.dsh.other.feignclient.activity.CouponClient; |
| | | import com.dsh.other.feignclient.activity.model.Coupon; |
| | | import com.dsh.other.feignclient.activity.model.PointsMerchandise; |
| | | import com.dsh.other.model.*; |
| | | import com.dsh.other.service.IProtocolService; |
| | | import com.dsh.other.service.IVipService; |
| | | import com.dsh.other.service.StoreService; |
| | | import com.dsh.other.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 14:02 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/vip") |
| | | public class TVipController { |
| | | |
| | | @Autowired |
| | | private IVipService vipService; |
| | | @Autowired |
| | | private CouponClient couponClient; |
| | | @Autowired |
| | | private StoreService storeService; |
| | | |
| | | |
| | | |
| | | // APP查询所有上架的会员卡 |
| | | @ResponseBody |
| | | @PostMapping("/listAll") |
| | | public List<Vip> listAll() { |
| | | List<Vip> list = vipService.lambdaQuery().eq(Vip::getStatus, 1).list(); |
| | | List<Coupon> coupons = couponClient.queryCouponAll(); |
| | | List<CouponCity> couponCityList = couponClient.queryAllCity(); |
| | | List<PointsMerchandise> pointsMerchandiseList = couponClient.queryAllPointGoods(); |
| | | List<CouponStore> storeList = couponClient.queryAllStore(); |
| | | List<Store> shopList = storeService.list(); |
| | | // 封装会员权益 |
| | | for (Vip vip : list) { |
| | | List<CouponVipResp> couponVipRespList = new ArrayList<>(); |
| | | List<TicketVipResp> ticketVipRespList = new ArrayList<>(); |
| | | String couponJson = vip.getCouponJson(); |
| | | JSONArray couponJsonArray = JSONArray.parseArray(couponJson); |
| | | for (Object o : couponJsonArray) { |
| | | JSONObject couponJsonObject = (JSONObject) o; |
| | | // 优惠券id |
| | | Integer id = Integer.valueOf(couponJsonObject.getString("id")); |
| | | // 优惠券数量 |
| | | Integer value = Integer.valueOf(couponJsonObject.getString("value")); |
| | | Coupon coupon = coupons.stream().filter(e -> e.getId().equals(id)).findFirst().orElse(new Coupon()); |
| | | CouponVipResp couponVipResp = new CouponVipResp(); |
| | | couponVipResp.setId(coupon.getId()); |
| | | couponVipResp.setName(coupon.getName()); |
| | | couponVipResp.setType(coupon.getType()); |
| | | couponVipResp.setUseCondition(coupon.getUseScope()); |
| | | couponVipResp.setCount(value); |
| | | switch (coupon.getUseScope()) { |
| | | case 1: |
| | | couponVipResp.setAvailable("全国通用"); |
| | | break; |
| | | case 2: |
| | | couponVipResp.setAvailable("指定城市可用"); |
| | | List<CouponCity> couponId = couponCityList.stream().filter(e -> e.getCouponId().equals(id)) |
| | | .collect(Collectors.toList()); |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (CouponCity couponCity : couponId) { |
| | | stringBuilder.append(couponCity.getCity()); |
| | | } |
| | | couponVipResp.setCityOrStore(String.valueOf(stringBuilder)); |
| | | break; |
| | | case 3: |
| | | couponVipResp.setAvailable("指定门店可用"); |
| | | // 门店ids |
| | | List<Integer> storeIds = storeList.stream().filter(e -> e.getCouponId().equals(id)) |
| | | .map(CouponStore::getStoreId).collect(Collectors.toList()); |
| | | StringBuilder storeNames = new StringBuilder(""); |
| | | |
| | | if (!storeIds.isEmpty()) { |
| | | List<Store> stores = shopList.stream().filter(e -> storeIds.contains(e.getId())).collect(Collectors.toList()); |
| | | for (Store store : stores) { |
| | | storeNames.append(store.getName()).append(","); |
| | | } |
| | | // 去除最后一位 |
| | | StringBuilder res = storeNames.deleteCharAt(storeNames.length() - 1); |
| | | couponVipResp.setCityOrStore(res.toString()); |
| | | } else { |
| | | couponVipResp.setCityOrStore("无可用门店"); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | couponVipResp.setInstructionsForUse(coupon.getIllustrate()); |
| | | ConponJsonRuleModel ruleModel = new ConponJsonRuleModel(); |
| | | JSONObject jsonObject = JSON.parseObject(coupon.getContent()); |
| | | switch (coupon.getType()) { |
| | | case 1: |
| | | // 满减券 |
| | | Double num1 = jsonObject.getDouble("conditionalAmount"); |
| | | Double num2 = jsonObject.getDouble("deductionAmount"); |
| | | ruleModel.setConditionalAmount("满" + num1 + "可用"); |
| | | ruleModel.setDeductionAmount("¥ " + num2); |
| | | ruleModel.setExperienceName(""); |
| | | break; |
| | | case 2: |
| | | // 代金券 |
| | | Double jsonObjectDouble = jsonObject.getDouble("conditionalAmount"); |
| | | ruleModel.setConditionalAmount(""); |
| | | ruleModel.setDeductionAmount("¥ " + jsonObjectDouble); |
| | | ruleModel.setExperienceName(""); |
| | | break; |
| | | case 3: |
| | | // 体验券 |
| | | ruleModel.setConditionalAmount(""); |
| | | ruleModel.setDeductionAmount(""); |
| | | ruleModel.setExperienceName(jsonObject.getString("experienceName")); |
| | | break; |
| | | case 4: |
| | | // 抵扣券 |
| | | ruleModel.setConditionalAmount(""); |
| | | ruleModel.setDeductionAmount(""); |
| | | PointsMerchandise pointsMerchandise = pointsMerchandiseList.stream().findFirst().orElse(null); |
| | | if (pointsMerchandise!=null){ |
| | | ruleModel.setExperienceName(pointsMerchandise.getName()); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | couponVipResp.setRuleModel(ruleModel); |
| | | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | couponVipResp.setEffectiveTime(simpleDateFormat.format(coupon.getEndTime())); |
| | | couponVipResp.setStartTime(simpleDateFormat.format(coupon.getStartTime())); |
| | | couponVipRespList.add(couponVipResp); |
| | | } |
| | | vip.setCouponList(couponVipRespList); |
| | | String ticketJson = vip.getTicketJson(); |
| | | JSONArray ticketJsonArray = JSONArray.parseArray(ticketJson); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | |
| | | for (Object o : ticketJsonArray) { |
| | | JSONObject ticketJsonObject = (JSONObject) o; |
| | | TicketVipResp ticketVipResp = new TicketVipResp(); |
| | | Integer count = ticketJsonObject.getInteger("count"); |
| | | ticketVipResp.setName(ticketJsonObject.getString("name")); |
| | | ticketVipResp.setTime(ticketJsonObject.getInteger("time")); |
| | | ticketVipResp.setCount(ticketJsonObject.getInteger("count")); |
| | | ticketVipResp.setStartTime(simpleDateFormat.format(new Date())); |
| | | Date date = new Date(); |
| | | // 给这个date加X天 |
| | | date.setTime(date.getTime() + ticketJsonObject.getInteger("time") * 24 * 60 * 60 * 1000); |
| | | ticketVipResp.setEffectiveTime(simpleDateFormat.format(date)); |
| | | ticketVipRespList.add(ticketVipResp); |
| | | } |
| | | vip.setTicketList(ticketVipRespList); |
| | | } |
| | | return list; |
| | | } |
| | | @Autowired |
| | | private IProtocolService protocolService; |
| | | @ResponseBody |
| | | @PostMapping("/getAgreement") |
| | | public String getAgreement() { |
| | | Protocol one = protocolService.lambdaQuery().eq(Protocol::getType, 6).one(); |
| | | if (one==null){ |
| | | Protocol protocol = new Protocol(); |
| | | protocol.setType(6); |
| | | protocol.setContent(""); |
| | | protocol.setInsertTime(new Date()); |
| | | protocolService.save( protocol); |
| | | return ""; |
| | | }else{ |
| | | return one.getContent(); |
| | | |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/getVipByIds") |
| | | public List<Vip> getVipByIds(@RequestBody String ids) { |
| | | List<Vip> list = vipService.lambdaQuery().in(Vip::getId, Arrays.asList(ids.split(","))).list(); |
| | | return list; |
| | | } |
| | | } |
| | |
| | | package com.dsh.other.feignclient.activity; |
| | | |
| | | import com.dsh.other.feignclient.activity.model.Coupon; |
| | | import com.dsh.other.feignclient.activity.model.PointsMerchandise; |
| | | import com.dsh.other.model.CouponCity; |
| | | import com.dsh.other.model.CouponStore; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | */ |
| | | @PostMapping("/coupon/queryCouponById") |
| | | Coupon queryCouponById(Integer id); |
| | | @PostMapping("/coupon/queryCouponAll") |
| | | List<Coupon> queryCouponAll(); |
| | | @PostMapping("/base/coupon/queryAllStore") |
| | | List<CouponStore> queryAllStore(); |
| | | @PostMapping("/base/coupon/queryAllCity") |
| | | List<CouponCity> queryAllCity(); |
| | | @PostMapping("/base/coupon/queryAllPointGoods") |
| | | List<PointsMerchandise> queryAllPointGoods(); |
| | | } |
| | |
| | | package com.dsh.other.feignclient.activity.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | |
| | | */ |
| | | private Integer state; |
| | | /** |
| | | * 积分商品id |
| | | */ |
| | | private Integer goodsId; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
New file |
| | |
| | | package com.dsh.other.feignclient.activity.model; |
| | | |
| | | 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 com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 积分商品 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-04 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_points_merchandise") |
| | | public class PointsMerchandise extends Model<PointsMerchandise> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 类型(1=实体商品,2=课包商品,3=门票商品 4=优惠券) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 商品名称 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 课包id |
| | | */ |
| | | @TableField("coursePackageId") |
| | | private Integer coursePackageId; |
| | | /** |
| | | * 原价 |
| | | */ |
| | | @TableField("price") |
| | | private BigDecimal price; |
| | | /** |
| | | * 兑换方式(1=积分,2=现金+积分) |
| | | */ |
| | | @TableField("redemptionMethod") |
| | | private Integer redemptionMethod; |
| | | /** |
| | | * 所需现金 |
| | | */ |
| | | @TableField("cash") |
| | | private BigDecimal cash; |
| | | /** |
| | | * 所属积分 |
| | | */ |
| | | @TableField("integral") |
| | | private Integer integral; |
| | | /** |
| | | * 商品封面 |
| | | */ |
| | | @TableField("cover") |
| | | private String cover; |
| | | /** |
| | | * 商品图片 |
| | | */ |
| | | @TableField("productImages") |
| | | private String productImages; |
| | | /** |
| | | * 用户人群(1=全部用户,2=年度会员,3=已有学员用户) |
| | | */ |
| | | @TableField("userPopulation") |
| | | private Integer userPopulation; |
| | | /** |
| | | * 发放数量 |
| | | */ |
| | | @TableField("quantityIssued") |
| | | private Integer quantityIssued; |
| | | /** |
| | | * 限领数量 |
| | | */ |
| | | @TableField("pickUpQuantity") |
| | | private Integer pickUpQuantity; |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @TableField("startTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @TableField("endTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | /** |
| | | * 使用范围(1=全国,2=指定城市,3=指定门店) |
| | | */ |
| | | @TableField("useScope") |
| | | private Integer useScope; |
| | | /** |
| | | * 省 |
| | | */ |
| | | @TableField("province") |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | @TableField("city") |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | /** |
| | | * 兑换说明 |
| | | */ |
| | | @TableField("redemptionInstructions") |
| | | private String redemptionInstructions; |
| | | /** |
| | | * 排序 |
| | | */ |
| | | @TableField("sort") |
| | | private Integer sort; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | /** |
| | | * 课包支付配置id |
| | | */ |
| | | @TableField("coursePackageConfigId") |
| | | private Integer coursePackageConfigId; |
| | | /** |
| | | * 1=上架 2=下架 |
| | | */ |
| | | @TableField("shelves") |
| | | private Integer shelves; |
| | | @TableField("cardType") |
| | | private Integer cardType; |
| | | @TableField("status") |
| | | private Integer status; |
| | | @TableField("remark") |
| | | private String remark; |
| | | // 已领数量 |
| | | @TableField(exist = false) |
| | | private Integer pickUpQuantity3; |
| | | // 已兑换数量 |
| | | @TableField(exist = false) |
| | | private Integer pickUpQuantity4; |
| | | // 添加人id 判断是平台添加还是运营商添加 用于判断分账 |
| | | @TableField("addUserId") |
| | | private Integer addUserId; |
| | | // 添加人类型 1平台2运营商3门店 用于判断分账 |
| | | @TableField("addType") |
| | | private Integer addType; |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.other.model.Vip; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | public interface TVipMapper extends BaseMapper<Vip> { |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.model; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | @Data |
| | | public class ConponJsonRuleModel { |
| | | /** |
| | | * 条件金额 |
| | | */ |
| | | @ApiModelProperty("条件金额(例如 :满xx可用)") |
| | | String conditionalAmount; |
| | | /** |
| | | * 抵扣金额(代金券 取 该字段) |
| | | */ |
| | | @ApiModelProperty("抵扣金额(代金券 取 该字段) 例如:¥ xxx") |
| | | String deductionAmount; |
| | | /** |
| | | * 体验券名称 |
| | | */ |
| | | @ApiModelProperty("体验券名称 /抵扣商品名称") |
| | | String experienceName; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.model; |
| | | |
| | | 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 com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券使用门店关系数据 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_coupon_city") |
| | | public class CouponCity extends Model<CouponCity> { |
| | | |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 优惠券id |
| | | */ |
| | | private Integer couponId; |
| | | /** |
| | | * 省 |
| | | */ |
| | | @TableField("province") |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | @TableField("city") |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.model; |
| | | |
| | | 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 com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券使用门店关系数据 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_coupon_store") |
| | | public class CouponStore extends Model<CouponStore> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 优惠券id |
| | | */ |
| | | @TableField("couponId") |
| | | private Integer couponId; |
| | | /** |
| | | * 门店id |
| | | */ |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.model; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("会员权益优惠券列表") |
| | | public class CouponVipResp { |
| | | |
| | | @ApiModelProperty("优惠券id") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty("优惠券名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("优惠券类型(1=满减券,2=代金券,3=体验券)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("适用范围1全国通用 2指定城市可用 3指定门店可用") |
| | | private Integer useCondition; |
| | | |
| | | @ApiModelProperty("适用范围名称") |
| | | private String available; |
| | | |
| | | @ApiModelProperty("useCondition = 2,为地址字符串;useCondition = 3,为门店名称+地址字符串") |
| | | private String cityOrStore; |
| | | |
| | | @ApiModelProperty("优惠券说明(使用说明)") |
| | | private String instructionsForUse; |
| | | |
| | | @ApiModelProperty("金额条件封装") |
| | | private ConponJsonRuleModel ruleModel; |
| | | |
| | | @ApiModelProperty("有效时间结束(2021-05-05)") |
| | | private String effectiveTime; |
| | | @ApiModelProperty("有效时间开始(2021-05-05)") |
| | | private String startTime; |
| | | @ApiModelProperty("数量 张") |
| | | private Integer count; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.model; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel("会员权益门票列表") |
| | | public class TicketVipResp { |
| | | |
| | | |
| | | @ApiModelProperty("门票名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("领取后x天有效") |
| | | private Integer time; |
| | | |
| | | @ApiModelProperty("数量 张") |
| | | private Integer count; |
| | | @ApiModelProperty("有效时间(2021-05-05)") |
| | | private String effectiveTime; |
| | | @ApiModelProperty("有效时间开始(2021-05-05)") |
| | | private String startTime; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.model; |
| | | |
| | | 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; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 会员管理 |
| | | */ |
| | | @TableName("t_vip") |
| | | @Data |
| | | @ApiModel(description = "会员") |
| | | public class Vip { |
| | | /** |
| | | * 主键id |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | @TableField("id") |
| | | @ApiModelProperty(value = "主键id") |
| | | private Integer id; |
| | | |
| | | /** |
| | | * 会员名称 |
| | | */ |
| | | @TableField("vipName") |
| | | @ApiModelProperty(value = "会员名称") |
| | | private String vipName; |
| | | |
| | | /** |
| | | * 会员时长类型 1天 2月 3年 |
| | | */ |
| | | @TableField("timeType") |
| | | @ApiModelProperty(value = "会员时长类型 1天 2月 3年") |
| | | private Integer timeType; |
| | | |
| | | /** |
| | | * 会员时长 |
| | | */ |
| | | @TableField("time") |
| | | @ApiModelProperty(value = "会员时长") |
| | | private Integer time; |
| | | |
| | | /** |
| | | * 会员价格 |
| | | */ |
| | | @TableField("price") |
| | | @ApiModelProperty(value = "会员价格") |
| | | private BigDecimal price; |
| | | |
| | | /** |
| | | * 状态 1上架2下架 |
| | | */ |
| | | @TableField("status") |
| | | @ApiModelProperty(value = "状态 1上架2下架") |
| | | private Integer status; |
| | | |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @ApiModelProperty(value = "添加时间") |
| | | private Date insertTime; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("couponJson") |
| | | @ApiModelProperty(value = "优惠券json[{\n" + |
| | | "\t\"id\": \"1\",\n" + |
| | | "\t\"value\": \"1\"\n" + |
| | | "}, {\n" + |
| | | "\t\"id\": \"2\",\n" + |
| | | "\t\"value\": \"1\"\n" + |
| | | "}\n" + |
| | | "}]") |
| | | private String couponJson; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("ticketJson") |
| | | @ApiModelProperty(value = "门票json门票json[{\n" + |
| | | "\t\"name\": \"门票名称\",\n" + |
| | | "\t\"time\": \"1\",\n" + |
| | | "\"count\": \"1\",\n" + |
| | | "}]") |
| | | private String ticketJson; |
| | | |
| | | /** |
| | | * 会员优惠券权益 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "会员优惠券权益") |
| | | private List<CouponVipResp> couponList; |
| | | /** |
| | | * 会员门票权益 |
| | | */ |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "会员门票权益") |
| | | private List<TicketVipResp> ticketList; |
| | | } |
New file |
| | |
| | | package com.dsh.other.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.other.model.Vip; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/14 15:04 |
| | | */ |
| | | public interface IVipService extends IService<Vip> { |
| | | } |
New file |
| | |
| | | package com.dsh.other.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.other.mapper.TVipMapper; |
| | | import com.dsh.other.model.Vip; |
| | | import com.dsh.other.service.IVipService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-09-19 |
| | | */ |
| | | @Service |
| | | public class TVipServiceImpl extends ServiceImpl<TVipMapper, Vip> implements IVipService { |
| | | |
| | | |
| | | |
| | | } |