New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import com.panzhihua.common.validated.AddGroup; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsEvaluateDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 评价记录请求 |
| | | * @author: hans |
| | | * @date: 2022/01/08 13:13 |
| | | */ |
| | | @Data |
| | | @ApiModel("评价记录请求") |
| | | public class McsEvaluateDTO { |
| | | |
| | | @ApiModelProperty("戳戳卷码id") |
| | | @NotNull(groups = {AddGroup.class}, message = "戳戳卷码id不能为空") |
| | | private Long couponId; |
| | | |
| | | @ApiModelProperty("评分(1.差 2.一般 3.还不错 4.很满意 5.强烈推荐)") |
| | | @NotNull(groups = {AddGroup.class}, message = "评分不能为空") |
| | | private Integer star; |
| | | |
| | | @ApiModelProperty("评价内容") |
| | | @NotBlank(groups = {AddGroup.class}, message = "评价内容不能为空") |
| | | private String content; |
| | | |
| | | @ApiModelProperty("评价图片(多张逗号隔开)") |
| | | @NotBlank(groups = {AddGroup.class}, message = "评价图片不能为空") |
| | | private String photos; |
| | | |
| | | @ApiModelProperty(value = "创建人", hidden = true) |
| | | private Long userId; |
| | | } |
| | |
| | | @ApiModelProperty("戳戳币分配方式(1.随机分配 2.平均分配)") |
| | | private Integer allocation; |
| | | |
| | | @ApiModelProperty("戳戳币总额") |
| | | @ApiModelProperty("戳戳币数量") |
| | | private Integer coins; |
| | | |
| | | @ApiModelProperty("地址") |
| | |
| | | private Integer level; |
| | | |
| | | @ApiModelProperty("点亮天数") |
| | | @NotNull(groups = {AddGroup.class}, message = "点亮天数不能为空") |
| | | private Integer litDays; |
| | | |
| | | @ApiModelProperty("商家账号") |
| | |
| | | |
| | | @ApiModelProperty(value = "所属商家", hidden = true) |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value = "用户头像") |
| | | private String imageUrl; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: PageMyCouponDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 分页查询我的评价-参与游戏列表 |
| | | * @author: hans |
| | | * @date: 2022/01/08 12:34 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询我的评价-参与游戏列表") |
| | | public class PageJoinGameListDTO { |
| | | |
| | | @ApiModelProperty("关键字") |
| | | private String keyword; |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
| | |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty("1.我的评价") |
| | | private Integer isMy; |
| | | |
| | | @ApiModelProperty("戳戳游戏id") |
| | | private Long gameId; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
| | |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty("距离(千米)") |
| | | private Integer distance; |
| | | |
| | | @ApiModelProperty("商家id") |
| | | private Long merchantId; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
| | |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty("距离(千米)") |
| | | private Integer distance; |
| | | |
| | | @ApiModelProperty("商家id") |
| | | private Long merchantId; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
| | |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty("查询类型(1.戳戳游戏 2.戳戳资讯)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("纬度") |
| | | private String lat; |
| | | |
| | | @ApiModelProperty("经度") |
| | | private String lon; |
| | | |
| | | @ApiModelProperty("距离,单位km") |
| | | private Integer distance; |
| | | |
| | | @ApiModelProperty("x km以上时,此值为1") |
| | | private Integer isMore; |
| | | } |
| | |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty(value = "商家id") |
| | | private Long merchantId; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: PageVerifyRecordDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 分页查询核销记录 |
| | | * @author: hans |
| | | * @date: 2022/01/08 14:53 |
| | | */ |
| | | @Data |
| | | @ApiModel("分页查询核销记录") |
| | | public class PageVerifyRecordDTO { |
| | | |
| | | @ApiModelProperty(value = "分页-当前页数", example = "1") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageNum; |
| | | |
| | | @ApiModelProperty(value = "分页-每页记录数", example = "10") |
| | | @NotNull(message = "分页参数不能为空") |
| | | @Min(value = 1) |
| | | private Long pageSize; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.dtos.community.microCommercialStreet; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: PutUserInfoDTO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 修改用戶信息请求参数 |
| | | * @author: hans |
| | | * @date: 2022/01/08 16:24 |
| | | */ |
| | | @Data |
| | | @ApiModel("修改用戶信息请求参数") |
| | | public class PutUserInfoDTO { |
| | | |
| | | @ApiModelProperty("头像") |
| | | private String imageUrl; |
| | | |
| | | @ApiModelProperty("昵称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "用户id", hidden = true) |
| | | private Long userId; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: GameStatisticsVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 游戏统计信息 |
| | | * @author: hans |
| | | * @date: 2022/01/08 15:12 |
| | | */ |
| | | @Data |
| | | @ApiModel("游戏统计信息") |
| | | public class GameStatisticsVO { |
| | | |
| | | @ApiModelProperty("游戏总数") |
| | | private Integer gameTotal; |
| | | |
| | | @ApiModelProperty("发放核销码") |
| | | private Integer sendCouponTotal; |
| | | |
| | | @ApiModelProperty("领取数占比") |
| | | private BigDecimal appliedPercent; |
| | | |
| | | @ApiModelProperty("未领取数占比") |
| | | private BigDecimal unAppliedPercent; |
| | | |
| | | @ApiModelProperty("核销人数占比") |
| | | private BigDecimal verifiedPercent; |
| | | |
| | | @ApiModelProperty("未核销数占比") |
| | | private BigDecimal unVerifiedPercent; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: IndexTopStatisticsVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 首页顶部数据 |
| | | * @author: hans |
| | | * @date: 2022/01/07 14:04 |
| | | */ |
| | | @Data |
| | | @ApiModel("首页顶部数据") |
| | | public class IndexTopStatisticsVO { |
| | | |
| | | @ApiModelProperty("戳戳币总额") |
| | | private Integer coinTotal; |
| | | |
| | | @ApiModelProperty("今日已领戳戳币") |
| | | private Integer appliedTotal; |
| | | |
| | | @ApiModelProperty("游戏总数") |
| | | private Integer gameTotal; |
| | | |
| | | @ApiModelProperty("全部资讯") |
| | | private Integer infoTotal; |
| | | |
| | | @ApiModelProperty("热门戳戳") |
| | | private McsGameVO popularGame; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @title: CouponApplyReturnVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 戳戳卷信息 |
| | | * @author: hans |
| | | * @date: 2022/01/07 17:27 |
| | | */ |
| | | @Data |
| | | @ApiModel("戳戳卷信息") |
| | | public class McsCouponVO { |
| | | |
| | | @ApiModelProperty("戳戳卷id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("优惠券包含奖励") |
| | | private String award; |
| | | |
| | | @ApiModelProperty("戳戳卷二维码") |
| | | private String qrCode; |
| | | |
| | | @ApiModelProperty("是否核验") |
| | | private Boolean isVerified; |
| | | |
| | | @ApiModelProperty("游戏名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("游戏类别(1.戳戳币游戏 2.体验游戏)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty("是否评论(1.是 2.否)") |
| | | private Integer isEvaluate; |
| | | |
| | | @ApiModelProperty("失效时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date expireAt; |
| | | } |
| | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | |
| | | private Long merchantId; |
| | | |
| | | @ApiModelProperty("所属商家名称") |
| | | private Long merchantName; |
| | | private String merchantName; |
| | | |
| | | @ApiModelProperty("商家logo") |
| | | private String logo; |
| | | |
| | | @ApiModelProperty("所属商家下游戏总数") |
| | | private Integer gameCount; |
| | | } |
| | |
| | | public class McsLoginUserInfoVO extends LoginUserInfoVO { |
| | | @ApiModelProperty("商家信息") |
| | | private McsMerchantVO mcsMerchantVO; |
| | | |
| | | private String plaintextPassword; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty("空闲戳戳点") |
| | | private Integer idleTotal; |
| | | |
| | | @ApiModelProperty("距离") |
| | | private Integer distance; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: McsVerifyRecordVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 戳戳卷核验记录信息 |
| | | * @author: hans |
| | | * @date: 2022/01/08 14:56 |
| | | */ |
| | | @Data |
| | | @ApiModel("戳戳卷核验记录信息") |
| | | public class McsVerifyRecordVO { |
| | | |
| | | @ApiModelProperty("核验记录id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty("游戏名称") |
| | | private String name; |
| | | |
| | | @ApiModelProperty("获得奖励") |
| | | private String award; |
| | | |
| | | @ApiModelProperty("核验时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date verifiedAt; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import java.util.List; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: MyCouponVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 我的戳戳卷信息 |
| | | * @author: hans |
| | | * @date: 2022/01/08 12:26 |
| | | */ |
| | | @Data |
| | | @ApiModel("我的戳戳卷信息") |
| | | public class MyCouponVO { |
| | | |
| | | @ApiModelProperty("已获得的戳戳币") |
| | | private Integer obtainedTotal; |
| | | |
| | | @ApiModelProperty("免费体验次") |
| | | private Integer trialTotal; |
| | | |
| | | @ApiModelProperty("参与游戏数") |
| | | private Integer joinGameTotal; |
| | | |
| | | @ApiModelProperty("待核销券码") |
| | | private Integer unVerifiedTotal; |
| | | |
| | | @ApiModelProperty("戳戳卷列表") |
| | | private List<McsCouponVO> couponList; |
| | | } |
New file |
| | |
| | | package com.panzhihua.common.model.vos.community.microCommercialStreet; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @title: VerifiedReturnVO |
| | | * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 |
| | | * @description: 戳戳卷核验返回参数 |
| | | * @author: hans |
| | | * @date: 2022/01/08 14:37 |
| | | */ |
| | | @Data |
| | | @ApiModel("戳戳卷核验返回参数") |
| | | public class VerifiedReturnVO { |
| | | |
| | | @ApiModelProperty("用户") |
| | | private String nickName; |
| | | |
| | | @ApiModelProperty("奖励") |
| | | private String award; |
| | | |
| | | @ApiModelProperty("卷码") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long couponId; |
| | | |
| | | @ApiModelProperty("核销时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date verifiedAt; |
| | | |
| | | @ApiModelProperty("游戏名称") |
| | | private String gameName; |
| | | |
| | | @ApiModelProperty("游戏封面") |
| | | private String cover; |
| | | |
| | | @ApiModelProperty("奖励类型(1.免费产品 2.免费服务)") |
| | | private Integer awardType; |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.PageBaseDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DisableOrEnableMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageJoinGameListDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageVerifyRecordDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetPopularForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForProductDTO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | |
| | | import com.panzhihua.common.model.vos.shop.ShopStoreVO; |
| | | import com.panzhihua.common.model.vos.user.UserElectronicFileVO; |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * @program: springcloud_k8s_panzhihuazhihuishequ |
| | |
| | | */ |
| | | @PostMapping("/microcommercialstreet/loginWithPhone") |
| | | R loginWithPhone(@RequestBody LoginWithPhoneDTO loginDTO); |
| | | |
| | | /** |
| | | * 首页顶部数据 |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/index/topData") |
| | | R getMcsIndexTopData(); |
| | | |
| | | /** |
| | | * 戳戳卷领取 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/coupon/apply") |
| | | R applyMcsCoupon(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * h5分页查询戳戳资讯 |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/information/pageH5") |
| | | R pageH5McsInfo(@RequestBody PageMcsInformationDTO pageMcsInformationDTO); |
| | | |
| | | /** |
| | | * h5分页查询戳戳游戏 |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/game/pageH5") |
| | | R pageH5McsGame(@RequestBody PageMcsGameDTO pageMcsGameDTO); |
| | | |
| | | /** |
| | | * 游戏详情 |
| | | * @param gameId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/game/get") |
| | | R getMcsGame(@RequestParam("gameId") Long gameId); |
| | | |
| | | /** |
| | | * 资讯详情 |
| | | * @param infoId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/info/get") |
| | | R getMcsInfo(@RequestParam("infoId") Long infoId); |
| | | |
| | | /** |
| | | * H5分页查询数字商业街商家 |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/merchant/pageH5") |
| | | R pageH5McsMerchant(@RequestBody PageMcsMerchantDTO pageMcsMerchantDTO); |
| | | |
| | | /** |
| | | * 我的戳戳卷 |
| | | * @param type |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/myCoupon") |
| | | R getMyCoupon(@RequestParam(value = "type", required = false) Integer type, @RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 新增评价记录 |
| | | * @param mcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/evaluate/add") |
| | | R addMcsEvaluate(@RequestBody McsEvaluateDTO mcsEvaluateDTO); |
| | | |
| | | /** |
| | | * 我的评价-参与游戏列表 |
| | | * @param pageJoinGameListDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/microcommercialstreet/joinGame/page") |
| | | R getJoinGameList(@RequestBody PageJoinGameListDTO pageJoinGameListDTO); |
| | | |
| | | /** |
| | | * 戳戳卷核销 |
| | | * @param couponId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/coupon/verify") |
| | | R verifyMcsCoupon(@RequestParam("couponId") Long couponId); |
| | | |
| | | /** |
| | | * 分页查询核销记录 |
| | | * @param pageVerifyRecordDTO |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/verifyRecord/page") |
| | | R pageMcsVerifyRecord(@RequestBody PageVerifyRecordDTO pageVerifyRecordDTO); |
| | | |
| | | /** |
| | | * 游戏统计 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/microcommercialstreet/game/statistics") |
| | | R getMcsGameStatistics(@RequestParam("userId") Long userId); |
| | | |
| | | /** |
| | | * 修改用戶信息 |
| | | * @param putUserInfoDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/microcommercialstreet/putUserInfo") |
| | | R putUserInfo(@RequestBody PutUserInfoDTO putUserInfoDTO); |
| | | } |
| | |
| | | */ |
| | | @GetMapping("/getSysUserByPhone") |
| | | R getSysUserByPhone(@RequestParam("phone") String phone, @RequestParam("type") Integer type); |
| | | |
| | | /** |
| | | * 发送验证码登录 |
| | | * @param phone 手机号 |
| | | * @param clientIP 用户ip |
| | | * @param prefixKey redis Key 前缀 |
| | | * @param limit 获取次数限制 |
| | | * @param timeout 超次数获取时间等待 |
| | | * @return |
| | | */ |
| | | @GetMapping("/sendMessageCodeForLogin") |
| | | R sendMessageCodeForLogin(@RequestParam("phone") String phone, |
| | | @RequestParam(value = "clientIP", required = false) String clientIP, |
| | | @RequestParam("prefixKey") String prefixKey, |
| | | @RequestParam("limit") Integer limit, |
| | | @RequestParam("timeout") Integer timeout); |
| | | } |
| | |
| | | private final static String ACCOUNT="C87595580"; |
| | | private final static String PASSWORD="b66d918a598ad126b85b13e82a38e165"; |
| | | private final static String CONTENT="您有一笔订单还未付款,超时未付款订单将自动取消。"; |
| | | public int sendCode(String mobile,String code){ |
| | | public static int sendCode(String mobile, String code){ |
| | | try { |
| | | String requestUrl=URL+"&account="+ACCOUNT+"&password="+PayUtil.MD5(PASSWORD)+"&mobile="+mobile+"&content="+"您的验证码是:"+code+"。请不要把验证码泄露给其他人。"; |
| | | String res=HttpClientUtil.httpGet(requestUrl, null,null); |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.DisableOrEnableMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageJoinGameListDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageVerifyRecordDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetPopularForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForInfoDTO; |
| | |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO; |
| | | import com.panzhihua.service_community.service.McsConfigService; |
| | | import com.panzhihua.service_community.service.McsCouponService; |
| | | import com.panzhihua.service_community.service.McsEvaluateService; |
| | | import com.panzhihua.service_community.service.McsGameService; |
| | | import com.panzhihua.service_community.service.McsInformationService; |
| | | import com.panzhihua.service_community.service.McsLabelService; |
| | | import com.panzhihua.service_community.service.McsMerchantService; |
| | | import com.panzhihua.service_community.service.McsProductService; |
| | | import com.panzhihua.service_community.service.McsVerifiedRecordService; |
| | | |
| | | /** |
| | | * @title: MicroCommercialStreetApi |
| | |
| | | private McsProductService mcsProductService; |
| | | @Resource |
| | | private McsLabelService mcsLabelService; |
| | | @Resource |
| | | private McsCouponService mcsCouponService; |
| | | @Resource |
| | | private McsVerifiedRecordService mcsVerifiedRecordService; |
| | | |
| | | /** |
| | | * 新增数字商业街商家 |
| | |
| | | public R loginWithPhone(@RequestBody LoginWithPhoneDTO loginDTO) { |
| | | return mcsMerchantService.loginWithPhone(loginDTO); |
| | | } |
| | | |
| | | /** |
| | | * 首页顶部数据 |
| | | * @return |
| | | */ |
| | | @GetMapping("/index/topData") |
| | | public R getMcsIndexTopData() { |
| | | return mcsMerchantService.getMcsIndexTopData(); |
| | | } |
| | | |
| | | /** |
| | | * 戳戳卷领取 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/coupon/apply") |
| | | public R applyMcsCoupon(@RequestParam("gameId") Long gameId, @RequestParam("userId") Long userId) { |
| | | return mcsGameService.applyMcsCoupon(gameId, userId); |
| | | } |
| | | |
| | | /** |
| | | * h5分页查询戳戳资讯 |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/information/pageH5") |
| | | public R pageH5McsInfo(@RequestBody PageMcsInformationDTO pageMcsInformationDTO) { |
| | | return mcsInformationService.pageH5McsInfo(pageMcsInformationDTO); |
| | | } |
| | | |
| | | /** |
| | | * h5分页查询戳戳游戏 |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/game/pageH5") |
| | | public R pageH5McsGame(@RequestBody PageMcsGameDTO pageMcsGameDTO) { |
| | | return mcsGameService.pageH5McsGame(pageMcsGameDTO); |
| | | } |
| | | |
| | | /** |
| | | * 游戏详情 |
| | | * @param gameId |
| | | * @return |
| | | */ |
| | | @GetMapping("/game/get") |
| | | public R getMcsGame(@RequestParam("gameId") Long gameId) { |
| | | return mcsGameService.getMcsGame(gameId); |
| | | } |
| | | |
| | | /** |
| | | * 资讯详情 |
| | | * @param infoId |
| | | * @return |
| | | */ |
| | | @GetMapping("/info/get") |
| | | public R getMcsInfo(@RequestParam("infoId") Long infoId) { |
| | | return mcsInformationService.getMcsInfo(infoId); |
| | | } |
| | | |
| | | /** |
| | | * H5分页查询数字商业街商家 |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/merchant/pageH5") |
| | | public R pageH5McsMerchant(@RequestBody PageMcsMerchantDTO pageMcsMerchantDTO) { |
| | | return mcsMerchantService.pageH5McsMerchant(pageMcsMerchantDTO); |
| | | } |
| | | |
| | | /** |
| | | * 我的戳戳卷 |
| | | * @param type |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/myCoupon") |
| | | public R getMyCoupon(@RequestParam(value = "type", required = false) Integer type, @RequestParam("userId") Long userId) { |
| | | return mcsCouponService.getMyCoupon(type, userId); |
| | | } |
| | | |
| | | /** |
| | | * 新增评价记录 |
| | | * @param mcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/evaluate/add") |
| | | public R addMcsEvaluate(@RequestBody McsEvaluateDTO mcsEvaluateDTO) { |
| | | return mcsEvaluateService.addMcsEvaluate(mcsEvaluateDTO); |
| | | } |
| | | |
| | | /** |
| | | * 我的评价-参与游戏列表 |
| | | * @param pageJoinGameListDTO |
| | | * @return |
| | | */ |
| | | @PostMapping("/joinGame/page") |
| | | public R getJoinGameList(@RequestBody PageJoinGameListDTO pageJoinGameListDTO) { |
| | | return mcsCouponService.getJoinGameList(pageJoinGameListDTO); |
| | | } |
| | | |
| | | /** |
| | | * 戳戳卷核销 |
| | | * @param couponId |
| | | * @return |
| | | */ |
| | | @GetMapping("/coupon/verify") |
| | | public R verifyMcsCoupon(@RequestParam("couponId") Long couponId) { |
| | | return mcsCouponService.verifyMcsCoupon(couponId); |
| | | } |
| | | |
| | | /** |
| | | * 分页查询核销记录 |
| | | * @param pageVerifyRecordDTO |
| | | * @return |
| | | */ |
| | | @GetMapping("/verifyRecord/page") |
| | | public R pageMcsVerifyRecord(@RequestBody PageVerifyRecordDTO pageVerifyRecordDTO) { |
| | | return mcsVerifiedRecordService.pageMcsVerifyRecord(pageVerifyRecordDTO); |
| | | } |
| | | |
| | | /** |
| | | * 游戏统计 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @GetMapping("/game/statistics") |
| | | public R getMcsGameStatistics(@RequestParam("userId") Long userId) { |
| | | return mcsCouponService.getMcsGameStatistics(userId); |
| | | } |
| | | |
| | | /** |
| | | * 修改用戶信息 |
| | | * @param putUserInfoDTO |
| | | * @return |
| | | */ |
| | | @PutMapping("/putUserInfo") |
| | | public R putUserInfo(@RequestBody PutUserInfoDTO putUserInfoDTO) { |
| | | return mcsMerchantService.putUserInfo(putUserInfoDTO); |
| | | } |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageJoinGameListDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.GameStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.MyCouponVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.McsCoupon; |
| | |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<McsCoupon> entities); |
| | | |
| | | /** |
| | | * 获取我的戳戳卷统计数据 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | MyCouponVO getMyCouponData(@Param("userId") Long userId); |
| | | |
| | | /** |
| | | * 获取用户戳戳卷列表 |
| | | * @param type |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | List<McsCouponVO> getCouponList(@Param("type") Integer type, @Param("userId") Long userId); |
| | | |
| | | /** |
| | | * 我的评价-参与游戏列表 |
| | | * @param page |
| | | * @param pageJoinGameListDTO |
| | | * @return |
| | | */ |
| | | IPage<McsCouponVO> pageJoinGameList(@Param("page") Page page, @Param("pageJoinGameListDTO") PageJoinGameListDTO pageJoinGameListDTO); |
| | | |
| | | /** |
| | | * 游戏统计 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | GameStatisticsVO getMcsGameStatistics(@Param("userId") Long userId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | Integer selectVerifiedCount(@Param("merchantId") Long merchantId); |
| | | |
| | | /** |
| | | * 获取热门游戏 |
| | | * @return |
| | | */ |
| | | McsGameVO selectPopularGame(); |
| | | |
| | | /** |
| | | * h5分页游戏查询 |
| | | * @param page |
| | | * @param minX |
| | | * @param maxX |
| | | * @param minY |
| | | * @param maxY |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | IPage<McsGameVO> pageH5McsGame(@Param("page") Page page, @Param("minX") Double minX, @Param("maxX") Double maxX, |
| | | @Param("minY") Double minY, @Param("maxY") Double maxY, @Param("pageMcsGameDTO") PageMcsGameDTO pageMcsGameDTO); |
| | | |
| | | /** |
| | | * 游戏详情 |
| | | * @param gameId |
| | | * @return |
| | | */ |
| | | McsGameVO selectDetailById(@Param("gameId") Long gameId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | IPage<McsInformationVO> pageMcsInfo(@Param("page") Page page, @Param("pageMcsInformationDTO") PageMcsInformationDTO pageMcsInformationDTO); |
| | | |
| | | /** |
| | | * H5分页查询资讯 |
| | | * @param page |
| | | * @param minX |
| | | * @param maxX |
| | | * @param minY |
| | | * @param maxY |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | IPage<McsInformationVO> pageH5McsInfo(@Param("page") Page page, @Param("minX") Double minX, |
| | | @Param("maxX") Double maxX, @Param("minY") Double minY, @Param("maxY") Double maxY, |
| | | @Param("pageMcsInformationDTO") PageMcsInformationDTO pageMcsInformationDTO); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.IndexTopStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | |
| | | * @return |
| | | */ |
| | | McsMerchantVO getMcsMerchantByAccount(@Param("account") String account); |
| | | |
| | | /** |
| | | * 首页顶部数据 |
| | | * @return |
| | | */ |
| | | IndexTopStatisticsVO getMcsIndexTopData(); |
| | | |
| | | /** |
| | | * H5分页查询数字商业街商家 |
| | | * @param page |
| | | * @param minX |
| | | * @param maxX |
| | | * @param minY |
| | | * @param maxY |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | IPage<McsMerchantVO> pageH5McsMerchant(@Param("page") Page page, @Param("minX") Double minX, @Param("maxX") Double maxX, |
| | | @Param("minY") Double minY, @Param("maxY") Double maxY, @Param("pageMcsMerchantDTO") PageMcsMerchantDTO pageMcsMerchantDTO); |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageVerifyRecordDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsVerifyRecordVO; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import com.panzhihua.service_community.entity.McsVerifiedRecord; |
| | |
| | | */ |
| | | int insertOrUpdateBatch(@Param("entities") List<McsVerifiedRecord> entities); |
| | | |
| | | /** |
| | | * 分页查询核销记录 |
| | | * @param pageVerifyRecordDTO |
| | | * @return |
| | | */ |
| | | IPage<McsVerifyRecordVO> pageMcsVerifyRecord(@Param("page") Page page, @Param("pageVerifyRecordDTO") PageVerifyRecordDTO pageVerifyRecordDTO); |
| | | } |
| | |
| | | package com.panzhihua.service_community.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | |
| | | public class McsCoupon implements Serializable { |
| | | private static final long serialVersionUID = 236342407932267836L; |
| | | |
| | | @TableId(type = IdType.INPUT) |
| | | private Long id; |
| | | /** |
| | | * 关联id |
| | |
| | | */ |
| | | private String qrCode; |
| | | /** |
| | | * 戳戳币 |
| | | */ |
| | | private Integer coin; |
| | | /** |
| | | * 奖品 |
| | | */ |
| | | private String award; |
| | | /** |
| | | * 是否核验 |
| | | */ |
| | | private Boolean isVerified; |
| | |
| | | */ |
| | | private Long couponId; |
| | | /** |
| | | * 所属游戏id |
| | | */ |
| | | private Long gameId; |
| | | /** |
| | | * 评价用户id |
| | | */ |
| | | private Long userId; |
| | | /** |
| | | * 评分(1.差 2.一般 3.还不错 4.很满意 5.强烈推荐) |
| | | */ |
| | | private Integer star; |
| | |
| | | */ |
| | | private Long couponId; |
| | | /** |
| | | * 商家id |
| | | */ |
| | | private Long merchantId; |
| | | /** |
| | | * 核验所属资源名称 |
| | | */ |
| | | private String name; |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageJoinGameListDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.McsCoupon; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface McsCouponService extends IService<McsCoupon> { |
| | | |
| | | /** |
| | | * 我的戳戳卷 |
| | | * @return |
| | | * @param type |
| | | * @param userId |
| | | */ |
| | | R getMyCoupon(Integer type, Long userId); |
| | | |
| | | /** |
| | | * 我的评价-参与游戏列表 |
| | | * @param pageJoinGameListDTO |
| | | * @return |
| | | */ |
| | | R getJoinGameList(PageJoinGameListDTO pageJoinGameListDTO); |
| | | |
| | | /** |
| | | * 戳戳卷核销 |
| | | * @param couponId |
| | | * @return |
| | | */ |
| | | R verifyMcsCoupon(Long couponId); |
| | | |
| | | /** |
| | | * 游戏统计 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R getMcsGameStatistics(Long userId); |
| | | } |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsEvaluateDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.McsEvaluate; |
| | |
| | | * @return |
| | | */ |
| | | R deleteMcsEvaluate(Long evaluateId); |
| | | |
| | | /** |
| | | * 新增评价记录 |
| | | * @param mcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | R addMcsEvaluate(McsEvaluateDTO mcsEvaluateDTO); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | R getTopStatistics(Long userId); |
| | | |
| | | /** |
| | | * 戳戳卷领取 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | R applyMcsCoupon(Long gameId, Long userId); |
| | | |
| | | /** |
| | | * h5分页查询戳戳游戏 |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | R pageH5McsGame(PageMcsGameDTO pageMcsGameDTO); |
| | | |
| | | /** |
| | | * 游戏详情 |
| | | * @param gameId |
| | | * @return |
| | | */ |
| | | R getMcsGame(Long gameId); |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | R publishMcsInfo(Long infoId, Long userId); |
| | | |
| | | /** |
| | | * h5分页查询戳戳资讯 |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | R pageH5McsInfo(PageMcsInformationDTO pageMcsInformationDTO); |
| | | |
| | | /** |
| | | * 资讯详情 |
| | | * @param infoId |
| | | * @return |
| | | */ |
| | | R getMcsInfo(Long infoId); |
| | | } |
| | |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | R loginWithPhone(LoginWithPhoneDTO loginDTO); |
| | | |
| | | /** |
| | | * 首页顶部数据 |
| | | * @return |
| | | */ |
| | | R getMcsIndexTopData(); |
| | | |
| | | /** |
| | | * H5分页查询数字商业街商家 |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | R pageH5McsMerchant(PageMcsMerchantDTO pageMcsMerchantDTO); |
| | | |
| | | /** |
| | | * 修改用戶信息 |
| | | * @param putUserInfoDTO |
| | | * @return |
| | | */ |
| | | R putUserInfo(PutUserInfoDTO putUserInfoDTO); |
| | | } |
| | |
| | | package com.panzhihua.service_community.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageVerifyRecordDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.service_community.entity.McsVerifiedRecord; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface McsVerifiedRecordService extends IService<McsVerifiedRecord> { |
| | | |
| | | /** |
| | | * 分页查询核销记录 |
| | | * @param pageVerifyRecordDTO |
| | | * @return |
| | | */ |
| | | R pageMcsVerifyRecord(PageVerifyRecordDTO pageVerifyRecordDTO); |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.GameStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.VerifiedReturnVO; |
| | | import com.panzhihua.common.service.user.UserService; |
| | | import com.panzhihua.service_community.dao.McsGameDAO; |
| | | import com.panzhihua.service_community.dao.McsVerifiedRecordDAO; |
| | | import com.panzhihua.service_community.entity.McsGame; |
| | | import com.panzhihua.service_community.entity.McsVerifiedRecord; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageJoinGameListDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.MyCouponVO; |
| | | import com.panzhihua.service_community.dao.McsCouponDAO; |
| | | import com.panzhihua.service_community.entity.McsCoupon; |
| | | import com.panzhihua.service_community.service.McsCouponService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * (McsCoupon)表服务实现类 |
| | |
| | | @Service("mcsCouponService") |
| | | public class McsCouponServiceImpl extends ServiceImpl<McsCouponDAO, McsCoupon> implements McsCouponService { |
| | | |
| | | @Resource |
| | | private McsVerifiedRecordDAO mcsVerifiedRecordDAO; |
| | | @Resource |
| | | private McsGameDAO mcsGameDAO; |
| | | @Resource |
| | | private UserService userService; |
| | | |
| | | /** |
| | | * 我的戳戳卷 |
| | | * @return |
| | | * @param type |
| | | * @param userId |
| | | */ |
| | | @Override |
| | | public R getMyCoupon(Integer type, Long userId) { |
| | | MyCouponVO myCouponVO = this.baseMapper.getMyCouponData(userId); |
| | | List<McsCouponVO> mcsCoupons = this.baseMapper.getCouponList(type, userId); |
| | | myCouponVO.setCouponList(mcsCoupons); |
| | | return R.ok(myCouponVO); |
| | | } |
| | | |
| | | /** |
| | | * 我的评价-参与游戏列表 |
| | | * @param pageJoinGameListDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getJoinGameList(PageJoinGameListDTO pageJoinGameListDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageJoinGameListDTO.getPageSize()); |
| | | page.setCurrent(pageJoinGameListDTO.getPageNum()); |
| | | IPage<McsCouponVO> mcsCoupons = this.baseMapper.pageJoinGameList(page, pageJoinGameListDTO); |
| | | return R.ok(mcsCoupons); |
| | | } |
| | | |
| | | /** |
| | | * 戳戳卷核销 |
| | | * @param couponId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R verifyMcsCoupon(Long couponId) { |
| | | McsCoupon mcsCoupon = this.baseMapper.selectById(couponId); |
| | | if (isNull(mcsCoupon) || mcsCoupon.getIsVerified()) { |
| | | return R.fail("无效卷码"); |
| | | } |
| | | Date nowDate = new Date(); |
| | | McsGame mcsGame = mcsGameDAO.selectById(mcsCoupon.getGameId()); |
| | | if (isNull(mcsGame) || mcsGame.getExpireAt().before(nowDate)) { |
| | | return R.fail("已过期"); |
| | | } |
| | | McsVerifiedRecord mcsVerifiedRecord = new McsVerifiedRecord(); |
| | | mcsVerifiedRecord.setCouponId(couponId); |
| | | mcsVerifiedRecord.setAward(mcsCoupon.getAward()); |
| | | mcsVerifiedRecord.setName(mcsGame.getName()); |
| | | mcsVerifiedRecord.setMerchantId(mcsGame.getMerchantId()); |
| | | int num = mcsVerifiedRecordDAO.insert(mcsVerifiedRecord); |
| | | if (num > 0) { |
| | | mcsCoupon.setIsVerified(true); |
| | | this.baseMapper.updateById(mcsCoupon); |
| | | VerifiedReturnVO verifiedReturnVO = new VerifiedReturnVO(); |
| | | verifiedReturnVO.setAward(mcsCoupon.getAward()); |
| | | verifiedReturnVO.setAwardType(mcsGame.getAwardType()); |
| | | verifiedReturnVO.setCouponId(couponId); |
| | | verifiedReturnVO.setCover(mcsGame.getCover()); |
| | | verifiedReturnVO.setGameName(mcsGame.getName()); |
| | | R<LoginUserInfoVO> userInfoVOR = userService.getUserInfoByUserId(mcsCoupon.getUserId().toString()); |
| | | if (R.isOk(userInfoVOR) && nonNull(userInfoVOR.getData())) { |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(userInfoVOR.getData()), LoginUserInfoVO.class); |
| | | verifiedReturnVO.setNickName(loginUserInfoVO.getNickName()); |
| | | } else { |
| | | verifiedReturnVO.setNickName("默认昵称"); |
| | | } |
| | | verifiedReturnVO.setVerifiedAt(nowDate); |
| | | return R.ok(verifiedReturnVO); |
| | | } |
| | | return R.fail("核验失败,请重试"); |
| | | } |
| | | |
| | | /** |
| | | * 游戏统计 |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsGameStatistics(Long userId) { |
| | | GameStatisticsVO gameStatisticsVO = this.baseMapper.getMcsGameStatistics(userId); |
| | | return R.ok(gameStatisticsVO); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsEvaluateDTO; |
| | | import com.panzhihua.service_community.dao.McsCouponDAO; |
| | | import com.panzhihua.service_community.entity.McsCoupon; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | import com.panzhihua.service_community.entity.McsEvaluate; |
| | | import com.panzhihua.service_community.service.McsEvaluateService; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | |
| | | /** |
| | | * (McsEvaluate)表服务实现类 |
| | | * |
| | |
| | | */ |
| | | @Service("mcsEvaluateService") |
| | | public class McsEvaluateServiceImpl extends ServiceImpl<McsEvaluateDAO, McsEvaluate> implements McsEvaluateService { |
| | | |
| | | @Resource |
| | | private McsCouponDAO mcsCouponDAO; |
| | | |
| | | /** |
| | | * 分页查询评价记录 |
| | |
| | | this.baseMapper.deleteById(evaluateId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 新增评价记录 |
| | | * @param mcsEvaluateDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R addMcsEvaluate(McsEvaluateDTO mcsEvaluateDTO) { |
| | | McsCoupon mcsCoupon = mcsCouponDAO.selectById(mcsEvaluateDTO.getCouponId()); |
| | | if (isNull(mcsCoupon)) { |
| | | return R.fail("资源不存在"); |
| | | } |
| | | McsEvaluate mcsEvaluate = this.baseMapper.selectOne(new QueryWrapper<McsEvaluate>().lambda().eq(McsEvaluate::getCouponId, mcsEvaluateDTO.getCouponId())); |
| | | if (nonNull(mcsEvaluate)) { |
| | | return R.fail("请勿重复评论"); |
| | | } |
| | | mcsEvaluate = new McsEvaluate(); |
| | | BeanUtils.copyProperties(mcsEvaluateDTO, mcsEvaluate); |
| | | mcsEvaluate.setGameId(mcsCoupon.getGameId()); |
| | | int num = this.baseMapper.insert(mcsEvaluate); |
| | | if (num > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail("请求失败,请重试"); |
| | | } |
| | | } |
| | |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isNotEmpty; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.TopStatisticsVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO; |
| | | import com.panzhihua.common.utlis.QRCodeUtils; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.service_community.dao.McsEvaluateDAO; |
| | | import com.panzhihua.service_community.entity.McsCoupon; |
| | | import com.panzhihua.service_community.entity.McsEvaluate; |
| | | import com.panzhihua.service_community.util.NearbyUtil; |
| | | import com.panzhihua.service_community.util.QRCodeUtil; |
| | | import com.spatial4j.core.shape.Rectangle; |
| | | import org.apache.commons.lang3.RandomUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForGameDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.TopStatisticsVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.service_community.dao.McsCouponDAO; |
| | | import com.panzhihua.service_community.dao.McsGameDAO; |
| | | import com.panzhihua.service_community.dao.McsMerchantDAO; |
| | | import com.panzhihua.service_community.entity.McsGame; |
| | | import com.panzhihua.service_community.entity.McsMerchant; |
| | | import com.panzhihua.service_community.service.McsGameService; |
| | | |
| | | import java.util.Date; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * (McsGame)表服务实现类 |
| | |
| | | |
| | | @Resource |
| | | private McsMerchantDAO mcsMerchantDAO; |
| | | @Resource |
| | | private McsCouponDAO mcsCouponDAO; |
| | | @Resource |
| | | private McsEvaluateDAO mcsEvaluateDAO; |
| | | |
| | | /** |
| | | * 分页查询戳戳游戏 |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R setPopularForGame(SetPopularForGameDTO setPopularForGameDTO) { |
| | | McsGame mcsGame = this.baseMapper.selectById(setPopularForGameDTO.getGameId()); |
| | | if (isNull(mcsGame)) { |
| | |
| | | Integer type = setPopularForGameDTO.getType(); |
| | | if (type.equals(1)) { |
| | | //设为热门 |
| | | List<McsGame> popularGames = this.baseMapper.selectList(new QueryWrapper<McsGame>().lambda().eq(McsGame::getIsPopular, true)); |
| | | if (nonNull(popularGames) && !popularGames.isEmpty()) { |
| | | popularGames.forEach(e -> e.setIsPopular(false)); |
| | | this.updateBatchById(popularGames); |
| | | } |
| | | mcsGame.setIsPopular(true); |
| | | } else if (type.equals(2)) { |
| | | //取消热门 |
| | |
| | | return R.fail("缺少分配方式"); |
| | | } |
| | | if (isNull(coins)) { |
| | | return R.fail("未设置戳戳币总额"); |
| | | return R.fail("未设置戳戳币额度"); |
| | | } |
| | | mcsGame.setSurplusCoins(mcsGameDTO.getCoins()); |
| | | if (allocation.equals(1)) { |
| | | mcsGame.setSurplusCoins(mcsGameDTO.getCoins()); |
| | | } |
| | | } else if (type.equals(2)) { |
| | | //2.体验游戏 |
| | | Integer awardType = mcsGameDTO.getAwardType(); |
| | |
| | | return R.fail("缺少分配方式"); |
| | | } |
| | | if (isNull(coins)) { |
| | | return R.fail("未设置戳戳币总额"); |
| | | return R.fail("未设置戳戳币额度"); |
| | | } |
| | | Integer beforeCoins = mcsGame.getCoins(); |
| | | Integer beforeSurplusCoins = mcsGame.getSurplusCoins(); |
| | |
| | | topStatisticsVO.setIdleTotal(idleTotal > 0 ? idleTotal : 0); |
| | | return R.ok(topStatisticsVO); |
| | | } |
| | | |
| | | /** |
| | | * 戳戳卷领取 |
| | | * @param gameId |
| | | * @param userId |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R applyMcsCoupon(Long gameId, Long userId) { |
| | | McsGame mcsGame = this.baseMapper.selectById(gameId); |
| | | if (isNull(mcsGame) || mcsGame.getIsDel()) { |
| | | return R.fail("游戏已下架"); |
| | | } |
| | | Integer userAppliedCount = mcsCouponDAO.selectCount(new QueryWrapper<McsCoupon>().lambda().eq(McsCoupon::getGameId, gameId).eq(McsCoupon::getUserId, userId)); |
| | | if (userAppliedCount > 0) { |
| | | return R.fail("请勿重复领取"); |
| | | } |
| | | Integer surplusCoupons = mcsGame.getSurplusCoupons(); |
| | | if (surplusCoupons <= 0) { |
| | | return R.fail("抢光了"); |
| | | } |
| | | McsCoupon mcsCoupon = new McsCoupon(); |
| | | Long snowflakeId = Snowflake.getId(); |
| | | mcsCoupon.setId(snowflakeId); |
| | | mcsCoupon.setGameId(gameId); |
| | | mcsCoupon.setUserId(userId); |
| | | mcsCoupon.setQrCode(QRCodeUtil.getBase64QRCode(snowflakeId.toString())); |
| | | Integer type = mcsGame.getType(); |
| | | if (type.equals(1)) { |
| | | //戳戳币游戏 |
| | | Integer allocation = mcsGame.getAllocation(); |
| | | if (allocation.equals(1)) { |
| | | //随机分配 |
| | | } else { |
| | | //固定值 |
| | | mcsCoupon.setCoin(mcsGame.getCoins()); |
| | | mcsCoupon.setAward("戳戳币:" + mcsGame.getCoins()); |
| | | } |
| | | } else { |
| | | //体验游戏 |
| | | Integer awardType = mcsGame.getAwardType(); |
| | | if (awardType.equals(1)) { |
| | | mcsCoupon.setAward("免费产品"); |
| | | } else { |
| | | mcsCoupon.setAward("免费服务"); |
| | | } |
| | | } |
| | | int num = mcsCouponDAO.insert(mcsCoupon); |
| | | if (num > 0) { |
| | | mcsGame.setSurplusCoupons(surplusCoupons - 1); |
| | | this.baseMapper.updateById(mcsGame); |
| | | McsCouponVO mcsCouponVO = new McsCouponVO(); |
| | | mcsCouponVO.setId(snowflakeId); |
| | | mcsCouponVO.setIsVerified(false); |
| | | mcsCouponVO.setQrCode(mcsCoupon.getQrCode()); |
| | | mcsCouponVO.setAward(mcsCoupon.getAward()); |
| | | return R.ok(mcsCouponVO); |
| | | } |
| | | return R.fail("领取失败,请重试"); |
| | | } |
| | | |
| | | /** |
| | | * h5分页查询戳戳游戏 |
| | | * @param pageMcsGameDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageH5McsGame(PageMcsGameDTO pageMcsGameDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsGameDTO.getPageSize()); |
| | | page.setCurrent(pageMcsGameDTO.getPageNum()); |
| | | String lat = pageMcsGameDTO.getLat(); |
| | | String lon = pageMcsGameDTO.getLon(); |
| | | Integer distance = pageMcsGameDTO.getDistance(); |
| | | IPage<McsGameVO> mcsGames; |
| | | if (isNotEmpty(lat) && isNotEmpty(lon) && nonNull(distance)) { |
| | | Rectangle rectangle = new NearbyUtil().getRectangle(pageMcsGameDTO.getDistance(), |
| | | Double.parseDouble(pageMcsGameDTO.getLon()), Double.parseDouble(pageMcsGameDTO.getLat())); |
| | | mcsGames = this.baseMapper.pageH5McsGame(page, rectangle.getMinX(), rectangle.getMaxX(), |
| | | rectangle.getMinY(), rectangle.getMaxY(), pageMcsGameDTO); |
| | | } else { |
| | | mcsGames = this.baseMapper.pageH5McsGame(page, null, null, null, null, pageMcsGameDTO); |
| | | } |
| | | |
| | | return R.ok(mcsGames); |
| | | } |
| | | |
| | | /** |
| | | * 游戏详情 |
| | | * @param gameId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsGame(Long gameId) { |
| | | McsGameVO mcsGameVO = this.baseMapper.selectDetailById(gameId); |
| | | Integer gameCount = this.baseMapper.selectCount(new QueryWrapper<McsGame>().lambda() |
| | | .eq(McsGame::getMerchantId, mcsGameVO.getMerchantId()).eq(McsGame::getIsDel, false)); |
| | | mcsGameVO.setGameCount(gameCount); |
| | | return R.ok(mcsGameVO); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | int total = 300; |
| | | int people = 10; |
| | | dispath(total, people, 30); |
| | | |
| | | } |
| | | |
| | | public static void dispath(int total, int people, int min) { |
| | | for (int i = 0; i < people - 1; i++) { |
| | | int leftPeople = people - i; |
| | | |
| | | double avg = Double.valueOf(total) / leftPeople; |
| | | |
| | | double ratio1 = RandomUtils.nextInt(0, 3); |
| | | |
| | | double ratio2 = RandomUtils.nextInt(0, 1); |
| | | |
| | | double ratio = ratio1 + ratio2; |
| | | |
| | | int cur = (int) Math.floor(ratio * avg) > min ? (int) Math.floor(ratio * avg) : min; |
| | | |
| | | // 扣减总额阅点数目 |
| | | |
| | | total = total - cur; |
| | | |
| | | System.out.format("第 %d 个红包: %d 阅点,剩下: %d 阅点\n", i + 1, cur,total); |
| | | } |
| | | // 剩余的就是最后一个用户的阅点额度 |
| | | |
| | | System.out.format("第 %d 个红包: %d 阅点,剩下: 0 阅点\n", people, total); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isNotEmpty; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsInfoDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO; |
| | | import com.panzhihua.common.utlis.DateUtils; |
| | | import com.panzhihua.service_community.util.NearbyUtil; |
| | | import com.spatial4j.core.shape.Rectangle; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | } |
| | | return R.fail("发布失败,请重新尝试"); |
| | | } |
| | | |
| | | /** |
| | | * h5分页查询戳戳资讯 |
| | | * @param pageMcsInformationDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageH5McsInfo(PageMcsInformationDTO pageMcsInformationDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsInformationDTO.getPageSize()); |
| | | page.setCurrent(pageMcsInformationDTO.getPageNum()); |
| | | String lat = pageMcsInformationDTO.getLat(); |
| | | String lon = pageMcsInformationDTO.getLon(); |
| | | Integer distance = pageMcsInformationDTO.getDistance(); |
| | | IPage<McsInformationVO> mcsInfos; |
| | | if (isNotEmpty(lat) && isNotEmpty(lon) && nonNull(distance)) { |
| | | Rectangle rectangle =new NearbyUtil().getRectangle(pageMcsInformationDTO.getDistance(), |
| | | Double.parseDouble(pageMcsInformationDTO.getLon()), Double.parseDouble(pageMcsInformationDTO.getLat())); |
| | | mcsInfos = this.baseMapper.pageH5McsInfo(page, rectangle.getMinX(), rectangle.getMaxX(), |
| | | rectangle.getMinY(), rectangle.getMaxY(), pageMcsInformationDTO); |
| | | } else { |
| | | mcsInfos = this.baseMapper.pageH5McsInfo(page, null, null, null, null, pageMcsInformationDTO); |
| | | } |
| | | return R.ok(mcsInfos); |
| | | } |
| | | |
| | | /** |
| | | * 资讯详情 |
| | | * @param infoId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsInfo(Long infoId) { |
| | | McsInformation mcsInformation = this.baseMapper.selectById(infoId); |
| | | if (isNull(mcsInformation)) { |
| | | return R.fail("资源不存在"); |
| | | } |
| | | McsInformationVO mcsInformationVO = new McsInformationVO(); |
| | | BeanUtils.copyProperties(mcsInformation, mcsInformationVO); |
| | | return R.ok(mcsInformationVO); |
| | | } |
| | | } |
| | |
| | | import static java.util.Objects.isNull; |
| | | import static java.util.Objects.nonNull; |
| | | import static org.apache.commons.lang3.StringUtils.isBlank; |
| | | import static org.apache.commons.lang3.StringUtils.isNotEmpty; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Random; |
| | | import java.util.UUID; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.Pattern; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.IndexTopStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLoginUserInfoVO; |
| | | import com.panzhihua.service_community.util.NearbyUtil; |
| | | import com.spatial4j.core.shape.Rectangle; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | public class McsMerchantServiceImpl extends ServiceImpl<McsMerchantDAO, McsMerchant> implements McsMerchantService { |
| | | |
| | | private static final String MERCHANT_PUBLISH_LIMIT_KEY = "MERCHANT_PUBLISH_LIMIT"; |
| | | private static final String DEFAULT_IMAGE_URL = "https://www.psciio.com//idcard/91313573d071436ab1f934231b31c6e5.jpg"; |
| | | private static final int DEFAULT_PUBLISH_LIMIT = 2; |
| | | |
| | | @Resource |
| | |
| | | public R addMcsMerchant(McsMerchantDTO mcsMerchantDTO) { |
| | | McsMerchant mcsMerchant = new McsMerchant(); |
| | | BeanUtils.copyProperties(mcsMerchantDTO, mcsMerchant); |
| | | if (mcsMerchantDTO.getLevel().equals(1)) { |
| | | Integer litDays = mcsMerchantDTO.getLitDays(); |
| | | if (isNull(litDays)) { |
| | | return R.fail("临时商家未设置点亮天数"); |
| | | } |
| | | mcsMerchant.setExpireAt(DateUtils.addDay(new Date(), litDays)); |
| | | mcsMerchant.setFirstLitAt(new Date()); |
| | | } |
| | | Integer litDays = mcsMerchantDTO.getLitDays(); |
| | | mcsMerchant.setExpireAt(DateUtils.addDay(new Date(), litDays)); |
| | | mcsMerchant.setFirstLitAt(new Date()); |
| | | McsConfig publishLimitConfig = mcsConfigDAO.selectOne(new QueryWrapper<McsConfig>().lambda().eq(McsConfig::getKey, MERCHANT_PUBLISH_LIMIT_KEY)); |
| | | mcsMerchant.setPublishLimit(nonNull(publishLimitConfig) ? Integer.parseInt(publishLimitConfig.getValue()) : DEFAULT_PUBLISH_LIMIT); |
| | | mcsMerchant.setUserId(0L); |
| | |
| | | if (R.isOk(r)) { |
| | | if (nonNull(r.getData())) { |
| | | //已有用户 |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), LoginUserInfoVO.class); |
| | | McsLoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), McsLoginUserInfoVO.class); |
| | | stringRedisTemplate.delete(redisKey); |
| | | return R.ok(loginUserInfoVO); |
| | | } else { |
| | |
| | | mcsMerchantDTO.setPassword("88888888"); |
| | | mcsMerchantDTO.setAccountStatus(1); |
| | | mcsMerchantDTO.setPhone(phone); |
| | | mcsMerchantDTO.setName("用户" + retrieveRandomCode(5)); |
| | | mcsMerchantDTO.setImageUrl(DEFAULT_IMAGE_URL); |
| | | R addUserResult = userService.addMcsMerchantUser(mcsMerchantDTO); |
| | | if (R.isOk(addUserResult)) { |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(addUserResult.getData()), LoginUserInfoVO.class); |
| | | McsLoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(addUserResult.getData()), McsLoginUserInfoVO.class); |
| | | loginUserInfoVO.setPlaintextPassword("88888888"); |
| | | stringRedisTemplate.delete(redisKey); |
| | | return R.ok(loginUserInfoVO); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 首页顶部数据 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R getMcsIndexTopData() { |
| | | IndexTopStatisticsVO statisticsVO = this.baseMapper.getMcsIndexTopData(); |
| | | McsGameVO mcsGameVO = mcsGameDAO.selectPopularGame(); |
| | | statisticsVO.setPopularGame(mcsGameVO); |
| | | return R.ok(statisticsVO); |
| | | } |
| | | |
| | | /** |
| | | * H5分页查询数字商业街商家 |
| | | * @param pageMcsMerchantDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageH5McsMerchant(PageMcsMerchantDTO pageMcsMerchantDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageMcsMerchantDTO.getPageSize()); |
| | | page.setCurrent(pageMcsMerchantDTO.getPageNum()); |
| | | String lat = pageMcsMerchantDTO.getLat(); |
| | | String lon = pageMcsMerchantDTO.getLon(); |
| | | Integer distance = pageMcsMerchantDTO.getDistance(); |
| | | IPage<McsMerchantVO> mcsMerchants; |
| | | if (isNotEmpty(lat) && isNotEmpty(lon) && nonNull(distance)) { |
| | | Rectangle rectangle = new NearbyUtil().getRectangle(distance, Double.parseDouble(lon), Double.parseDouble(lat)); |
| | | mcsMerchants = this.baseMapper.pageH5McsMerchant(page, rectangle.getMinX(), rectangle.getMaxX(), |
| | | rectangle.getMinY(), rectangle.getMaxY(), pageMcsMerchantDTO); |
| | | } else { |
| | | mcsMerchants = this.baseMapper.pageH5McsMerchant(page, null, null, null, null, pageMcsMerchantDTO); |
| | | } |
| | | return R.ok(mcsMerchants); |
| | | } |
| | | |
| | | /** |
| | | * 修改用戶信息 |
| | | * @param putUserInfoDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R putUserInfo(PutUserInfoDTO putUserInfoDTO) { |
| | | McsMerchant mcsMerchant = this.baseMapper.selectOne(new QueryWrapper<McsMerchant>().lambda().eq(McsMerchant::getUserId, putUserInfoDTO.getUserId())); |
| | | if (nonNull(mcsMerchant)) { |
| | | //修改商家名称 |
| | | mcsMerchant.setLogo(putUserInfoDTO.getImageUrl()); |
| | | mcsMerchant.setName(putUserInfoDTO.getName()); |
| | | this.baseMapper.updateById(mcsMerchant); |
| | | } |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | loginUserInfoVO.setImageUrl(putUserInfoDTO.getImageUrl()); |
| | | loginUserInfoVO.setName(putUserInfoDTO.getName()); |
| | | loginUserInfoVO.setUserId(putUserInfoDTO.getUserId()); |
| | | userService.putUser(loginUserInfoVO); |
| | | return R.ok(); |
| | | } |
| | | |
| | | private void retrieveMerchantSurplusLitDays(McsMerchantVO merchantVO) { |
| | | Integer publishLimit = merchantVO.getPublishLimit(); |
| | | Integer publishCount = mcsGameDAO.selectPublishCount(merchantVO.getId()); |
| | |
| | | merchantVO.setSurplusLitDays(surplusLitDays > 0 ? surplusLitDays : 0); |
| | | } |
| | | } |
| | | |
| | | private String retrieveRandomCode(int length) { |
| | | Random r = new Random(); |
| | | StringBuilder rs = new StringBuilder(); |
| | | for (int i = 0; i < length; i++) { |
| | | rs.append(r.nextInt(10)); |
| | | } |
| | | return rs.toString(); |
| | | } |
| | | } |
| | |
| | | package com.panzhihua.service_community.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageVerifyRecordDTO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsVerifyRecordVO; |
| | | import com.panzhihua.service_community.dao.McsVerifiedRecordDAO; |
| | | import com.panzhihua.service_community.entity.McsVerifiedRecord; |
| | | import com.panzhihua.service_community.service.McsVerifiedRecordService; |
| | |
| | | public class McsVerifiedRecordServiceImpl extends ServiceImpl<McsVerifiedRecordDAO, McsVerifiedRecord> |
| | | implements McsVerifiedRecordService { |
| | | |
| | | /** |
| | | * 分页查询核销记录 |
| | | * @param pageVerifyRecordDTO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R pageMcsVerifyRecord(PageVerifyRecordDTO pageVerifyRecordDTO) { |
| | | Page page = new Page<>(); |
| | | page.setSize(pageVerifyRecordDTO.getPageSize()); |
| | | page.setCurrent(pageVerifyRecordDTO.getPageNum()); |
| | | IPage<McsVerifyRecordVO> verifyRecords = this.baseMapper.pageMcsVerifyRecord(page, pageVerifyRecordDTO); |
| | | return R.ok(verifyRecords); |
| | | } |
| | | } |
| | |
| | | <result property="gameId" column="game_id" jdbcType="INTEGER"/> |
| | | <result property="userId" column="user_id" jdbcType="INTEGER"/> |
| | | <result property="qrCode" column="qr_code" jdbcType="VARCHAR"/> |
| | | <result property="coin" column="coin" jdbcType="INTEGER"/> |
| | | <result property="award" column="award" jdbcType="VARCHAR"/> |
| | | <result property="isVerified" column="is_verified" jdbcType="VARCHAR"/> |
| | | <result property="createdAt" column="created_at" jdbcType="TIMESTAMP"/> |
| | | <result property="updatedAt" column="updated_at" jdbcType="TIMESTAMP"/> |
| | |
| | | game_id = values(game_id) , user_id = values(user_id) , qr_code = values(qr_code) , is_verified = |
| | | values(is_verified) , created_at = values(created_at) , updated_at = values(updated_at) |
| | | </insert> |
| | | <select id="getMyCouponData" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.MyCouponVO"> |
| | | SELECT |
| | | (SELECT IF(SUM(coin) IS NULL,0,SUM(coin)) FROM mcs_coupon WHERE user_id = #{userId}) AS obtainedTotal, |
| | | (SELECT COUNT(t1.id) FROM mcs_coupon t1 LEFT JOIN mcs_game t2 ON t1.game_id = t2.id WHERE t1.user_id = #{userId} AND t1.is_verified = 1 AND t2.type = 2) AS trialTotal, |
| | | (SELECT COUNT(id) FROM mcs_coupon WHERE user_id = #{userId} AND is_verified = 1) AS joinGameTotal, |
| | | (SELECT COUNT(id) FROM mcs_coupon WHERE user_id = #{userId} AND is_verified = 0) AS unVerifiedTotal |
| | | </select> |
| | | <select id="getCouponList" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO"> |
| | | SELECT t1.*, t2.type, t2.`name`, t2.expire_at |
| | | FROM mcs_coupon t1 |
| | | LEFT JOIN mcs_game t2 ON t1.game_id = t2.id |
| | | WHERE t1.user_id = #{userId} |
| | | <if test="type != null"> |
| | | AND t2.type = #{type} |
| | | </if> |
| | | </select> |
| | | <select id="pageJoinGameList" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO"> |
| | | SELECT t1.*, t2.type, t2.`name`, t2.expire_at, IF(t3.id IS NULL,2,1) AS isEvaluate |
| | | FROM mcs_coupon t1 |
| | | LEFT JOIN mcs_game t2 ON t1.game_id = t2.id |
| | | LEFT JOIN mcs_evaluate t3 ON t1.id = t3.coupon_id |
| | | WHERE t1.user_id = #{pageJoinGameListDTO.userId} AND t1.is_verified = 1 |
| | | <if test="pageJoinGameListDTO.keyword != null and pageJoinGameListDTO.keyword != """> |
| | | AND t2.`name` LIKE CONCAT(#{pageJoinGameListDTO.keyword}, '%') |
| | | </if> |
| | | </select> |
| | | <select id="getMcsGameStatistics" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.GameStatisticsVO"> |
| | | SELECT gameTotal, sendCouponTotal, |
| | | IF(ROUND((sendCouponTotal - unAppliedTotal)/sendCouponTotal * 100) IS NULL,0,ROUND((sendCouponTotal - unAppliedTotal)/sendCouponTotal * 100))AS appliedPercent, |
| | | IF(ROUND(unAppliedTotal/sendCouponTotal * 100) IS NULL,0,ROUND(unAppliedTotal/sendCouponTotal * 100)) AS unAppliedPercent, |
| | | IF(ROUND(verifiedTotal/(sendCouponTotal - unAppliedTotal) * 100) IS NULL,0,ROUND(verifiedTotal/(sendCouponTotal - unAppliedTotal) * 100)) AS verifiedPercent, |
| | | IF(ROUND((sendCouponTotal - unAppliedTotal - verifiedTotal)/(sendCouponTotal - unAppliedTotal) * 100) IS NULL,0,ROUND((sendCouponTotal - unAppliedTotal - verifiedTotal)/(sendCouponTotal - unAppliedTotal) * 100)) AS unVerifiedPercent |
| | | FROM( |
| | | SELECT |
| | | (SELECT COUNT(t1.id) FROM mcs_game t1 LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id WHERE t1.`status` = 2 AND t1.is_del = 0 AND t2.user_id = #{userId}) AS gameTotal, |
| | | (SELECT IF(SUM(coupons) IS NULL,0,SUM(coupons)) FROM mcs_game t1 LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id WHERE t1.`status` = 2 AND t1.is_del = 0 AND t2.user_id = #{userId}) AS sendCouponTotal, |
| | | (SELECT IF(SUM(surplus_coupons) IS NULL,0,SUM(surplus_coupons)) FROM mcs_game t1 LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id WHERE t1.`status` = 2 AND t1.is_del = 0 AND t2.user_id = #{userId}) AS unAppliedTotal, |
| | | (SELECT COUNT(t1.id) FROM mcs_verified_record t1 LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id WHERE t2.user_id = #{userId}) AS verifiedTotal |
| | | ) temp |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
| | |
| | | <resultMap type="com.panzhihua.service_community.entity.McsEvaluate" id="McsEvaluateMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="couponId" column="coupon_id" jdbcType="INTEGER"/> |
| | | <result property="gameId" column="game_id" jdbcType="INTEGER"/> |
| | | <result property="userId" column="user_id" jdbcType="INTEGER"/> |
| | | <result property="star" column="star" jdbcType="INTEGER"/> |
| | | <result property="content" column="content" jdbcType="VARCHAR"/> |
| | | <result property="photos" column="photos" jdbcType="VARCHAR"/> |
| | |
| | | LEFT JOIN mcs_game t2 ON t1.game_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t1.user_id = t3.user_id |
| | | WHERE 1=1 |
| | | <if test="pageMcsEvaluateDTO.gameId != null"> |
| | | AND t1.game_id = #{pageMcsEvaluateDTO.gameId} |
| | | </if> |
| | | <if test="pageMcsEvaluateDTO.isMy != null and pageMcsEvaluateDTO.isMy == 1"> |
| | | AND t1.user_id = #{pageMcsEvaluateDTO.userId} |
| | | </if> |
| | | <if test="pageMcsEvaluateDTO.keyword != null and pageMcsEvaluateDTO.keyword != """> |
| | | AND ( |
| | | t3.nick_name LIKE CONCAT(#{pageMcsEvaluateDTO.keyword}, '%') |
| | |
| | | LEFT JOIN mcs_game t2 ON t1.game_id = t2.id |
| | | WHERE t1.is_verified = 1 AND t2.merchant_id = #{merchantId} |
| | | </select> |
| | | <select id="selectPopularGame" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO"> |
| | | SELECT t1.id, t1.`name`, t1.coupons, t1.surplus_coupons, t1.`type`, t1.award_type FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t1.is_popular = 1 AND t2.is_del = 0 AND t3.`status` = 1 LIMIT 1 |
| | | </select> |
| | | <select id="pageH5McsGame" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO"> |
| | | SELECT t1.id, t1.`name`, t1.`type`, t1.coupons, t1.surplus_coupons, t1.award_type, t1.cover, |
| | | t1.publish_at, t1.`status`, t1.merchant_id, t2.`name` AS merchantName |
| | | FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t3.`status` = 1 |
| | | <if test="pageMcsGameDTO.keyword != null and pageMcsGameDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsGameDTO.keyword}, '%') |
| | | </if> |
| | | <if test="pageMcsGameDTO.merchantId != null"> |
| | | AND t1.merchant_id = #{pageMcsGameDTO.merchantId} |
| | | </if> |
| | | <if test="maxX != null"> |
| | | AND (t1.lon BETWEEN #{minX} AND #{maxX}) |
| | | AND (t1.lat BETWEEN #{minY} AND #{maxY}) |
| | | </if> |
| | | ORDER BY t1.created_at DESC |
| | | </select> |
| | | <select id="selectDetailById" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO"> |
| | | SELECT t1.*, t2.`name` AS merchantName, t2.logo |
| | | FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | WHERE t1.id = #{gameId} |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
| | |
| | | FROM mcs_information t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | WHERE t1.is_del = 0 |
| | | <if test="pageMcsInformationDTO.userId != null"> |
| | | AND t2.user_id = #{pageMcsInformationDTO.userId} |
| | | </if> |
| | | <if test="pageMcsInformationDTO.status != null"> |
| | | AND t1.`status` = #{pageMcsInformationDTO.status} |
| | | </if> |
| | |
| | | </if> |
| | | ORDER BY t1.created_at DESC |
| | | </select> |
| | | <select id="pageH5McsInfo" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsInformationVO"> |
| | | SELECT t1.id, t1.`name`, t1.publish_at, t1.`status`, t1.merchant_id, t2.`name` AS merchantName |
| | | FROM mcs_information t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t3.`status` = 1 |
| | | <if test="pageMcsInformationDTO.keyword != null and pageMcsInformationDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsInformationDTO.keyword}, '%') |
| | | </if> |
| | | <if test="pageMcsInformationDTO.merchantId != null"> |
| | | AND t1.merchant_id = #{pageMcsInformationDTO.merchantId} |
| | | </if> |
| | | <if test="maxX != null"> |
| | | AND (t1.lon BETWEEN #{minX} AND #{maxX}) |
| | | AND (t1.lat BETWEEN #{minY} AND #{maxY}) |
| | | </if> |
| | | ORDER BY t1.created_at DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
| | |
| | | LEFT JOIN sys_user t2 ON t1.user_id = t2.user_id |
| | | WHERE t1.account = #{account} AND t1.is_del = 0 |
| | | </select> |
| | | <select id="getMcsIndexTopData" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.IndexTopStatisticsVO"> |
| | | SELECT |
| | | (SELECT IF(SUM(coins) IS NULL,0,SUM(coins)) FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t2.is_del = 0 AND t3.`status` = 1) AS coinTotal, |
| | | |
| | | (SELECT IF(SUM(coin) IS NULL,0,SUM(coin)) FROM mcs_coupon WHERE to_days(created_at) = to_days(now())) AS appliedTotal, |
| | | |
| | | (SELECT COUNT(t1.id) FROM mcs_game t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t2.is_del = 0 AND t3.`status` = 1) AS gameTotal, |
| | | |
| | | (SELECT COUNT(t1.id) FROM mcs_information t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN sys_user t3 ON t2.user_id = t3.user_id |
| | | WHERE t1.is_del = 0 AND t1.`status` = 2 AND t2.is_del = 0 AND t3.`status` = 1) AS infoTotal |
| | | </select> |
| | | <select id="pageH5McsMerchant" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO"> |
| | | SELECT t1.id, t1.`name`, t1.phone, t1.account, t1.`level`, t1.expire_at, t1.first_lit_at, t1.publish_limit, t1.introduction, t1.logo, |
| | | (POWER(MOD(ABS(t1.lon - #{pageMcsMerchantDTO.lon}),360),2) + POWER(ABS(t1.lat - #{pageMcsMerchantDTO.lat}),2)) AS distance |
| | | FROM mcs_merchant t1 |
| | | LEFT JOIN sys_user t2 ON t1.user_id = t2.user_id |
| | | <if test="pageMcsMerchantDTO.type != null and pageMcsMerchantDTO.type == 1"> |
| | | LEFT JOIN (SELECT * FROM mcs_game WHERE `status` = 2 GROUP BY merchant_id) t3 ON t1.id = t3.merchant_id |
| | | </if> |
| | | <if test="pageMcsMerchantDTO.type != null and pageMcsMerchantDTO.type == 2"> |
| | | LEFT JOIN (SELECT * FROM mcs_information WHERE `status` = 2 GROUP BY merchant_id) t3 ON t1.id = t3.merchant_id |
| | | </if> |
| | | WHERE t1.is_del = 0 AND t2.`status` = 1 |
| | | <if test="pageMcsMerchantDTO.type != null"> |
| | | AND t3.id IS NOT NULL |
| | | </if> |
| | | <if test="minX != null"> |
| | | <if test="pageMcsMerchantDTO.isMore != null and pageMcsMerchantDTO.isMore ==1"> |
| | | AND t1.lon > #{maxX} |
| | | AND t1.lat > #{maxY} |
| | | </if> |
| | | <if test="pageMcsMerchantDTO.isMore == null"> |
| | | AND (t1.lon BETWEEN #{minX} AND #{maxX}) |
| | | AND (t1.lat BETWEEN #{minY} AND #{maxY}) |
| | | </if> |
| | | </if> |
| | | <if test="pageMcsMerchantDTO.keyword != null and pageMcsMerchantDTO.keyword != """> |
| | | AND t1.`name` LIKE CONCAT(#{pageMcsMerchantDTO.keyword}, '%') |
| | | </if> |
| | | ORDER BY distance ASC |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
| | |
| | | FROM mcs_product t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | LEFT JOIN (SELECT product_id, GROUP_CONCAT(label_name) AS productLabel FROM mcs_product_label GROUP BY product_id) t3 ON t1.id = t3.product_id |
| | | WHERE t1.is_del = 0 AND t2.user_id = #{pageMcsProductDTO.userId} AND t2.is_del = 0 |
| | | WHERE t1.is_del = 0 AND t2.is_del = 0 |
| | | <if test="pageMcsProductDTO.merchantId != null"> |
| | | AND t1.merchant_id = #{pageMcsProductDTO.merchantId} |
| | | AND t1.status = 1 |
| | | </if> |
| | | <if test="pageMcsProductDTO.merchantId == null"> |
| | | AND t2.user_id = #{pageMcsProductDTO.userId} |
| | | </if> |
| | | <if test="pageMcsProductDTO.status != null"> |
| | | AND t1.`status` = #{pageMcsProductDTO.status} |
| | | </if> |
| | |
| | | <resultMap type="com.panzhihua.service_community.entity.McsVerifiedRecord" id="McsVerifiedRecordMap"> |
| | | <result property="id" column="id" jdbcType="INTEGER"/> |
| | | <result property="couponId" column="coupon_id" jdbcType="INTEGER"/> |
| | | <result property="merchantId" column="merchant_id" jdbcType="INTEGER"/> |
| | | <result property="name" column="name" jdbcType="VARCHAR"/> |
| | | <result property="award" column="award" jdbcType="VARCHAR"/> |
| | | <result property="verifiedAt" column="verified_at" jdbcType="TIMESTAMP"/> |
| | |
| | | on duplicate key update |
| | | coupon_id = values(coupon_id) , name = values(name) , award = values(award) , verified_at = values(verified_at) |
| | | </insert> |
| | | <select id="pageMcsVerifyRecord" |
| | | resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsVerifyRecordVO"> |
| | | SELECT t1.* FROM mcs_verified_record t1 |
| | | LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id |
| | | WHERE t2.user_id = #{pageVerifyRecordDTO.userId} |
| | | </select> |
| | | |
| | | </mapper> |
| | | |
| | |
| | | public R getSysUserByPhone(@RequestParam("phone") String phone, @RequestParam("type") Integer type) { |
| | | return userService.getSysUserByPhone(phone, type); |
| | | } |
| | | |
| | | /** |
| | | * 发送验证码登录 |
| | | * @param phone 手机号 |
| | | * @param clientIP 用户ip |
| | | * @param prefixKey redis Key 前缀 |
| | | * @param limit 获取次数限制 |
| | | * @param timeout 超次数获取时间等待 |
| | | * @return |
| | | */ |
| | | @GetMapping("/sendMessageCodeForLogin") |
| | | public R sendMessageCodeForLogin(@RequestParam("phone") String phone, |
| | | @RequestParam(value = "clientIP", required = false) String clientIP, |
| | | @RequestParam("prefixKey") String prefixKey, |
| | | @RequestParam("limit") Integer limit, |
| | | @RequestParam("timeout") Integer timeout) { |
| | | return userService.sendMessageCodeForLogin(phone, clientIP, prefixKey, limit, timeout); |
| | | } |
| | | } |
| | |
| | | * 高龄认证显示提示(1.是 2.否) |
| | | */ |
| | | private Integer bigAgeTips; |
| | | /** |
| | | * 明文密码 |
| | | */ |
| | | private String plaintextPassword; |
| | | |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | R getSysUserByPhone(String phone, Integer type); |
| | | |
| | | /** |
| | | * 发送验证码登录 |
| | | * @param phone 手机号 |
| | | * @param clientIP 用户ip |
| | | * @param prefixKey redis Key 前缀 |
| | | * @param limit 获取次数限制 |
| | | * @param timeout 超次数获取时间等待 |
| | | * @return |
| | | */ |
| | | R sendMessageCodeForLogin(String phone, String clientIP, String prefixKey, Integer limit, Integer timeout); |
| | | } |
| | |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Random; |
| | | import java.util.Set; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.stream.Collectors; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLoginUserInfoVO; |
| | | import org.apache.commons.lang.time.DateFormatUtils; |
| | | import org.apache.commons.lang.time.DateUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import com.panzhihua.common.model.vos.user.UserPhoneVO; |
| | | import com.panzhihua.common.utlis.IdCard; |
| | | import com.panzhihua.common.utlis.SensitiveUtil; |
| | | import com.panzhihua.common.utlis.SmsUtil; |
| | | import com.panzhihua.common.utlis.Snowflake; |
| | | import com.panzhihua.common.utlis.StringUtils; |
| | | import com.panzhihua.common.utlis.WxUtil; |
| | |
| | | } |
| | | // sys_user 表 |
| | | sysUserDO = new SysUserDO(); |
| | | String encode = new BCryptPasswordEncoder().encode(mcsMerchantDTO.getPassword()); |
| | | BeanUtils.copyProperties(mcsMerchantDTO, sysUserDO); |
| | | sysUserDO.setAccount(mcsMerchantDTO.getAccount()); |
| | | sysUserDO.setType(11); |
| | | sysUserDO.setAreaId(null); |
| | | sysUserDO.setStatus(mcsMerchantDTO.getAccountStatus()); |
| | | sysUserDO.setPhone(mcsMerchantDTO.getPhone()); |
| | | sysUserDO.setPassword(mcsMerchantDTO.getPassword()); |
| | | sysUserDO.setPassword(encode); |
| | | sysUserDO.setPlaintextPassword(mcsMerchantDTO.getPassword()); |
| | | try { |
| | | userDao.insert(sysUserDO); |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | McsLoginUserInfoVO loginUserInfoVO = new McsLoginUserInfoVO(); |
| | | BeanUtils.copyProperties(sysUserDO, loginUserInfoVO); |
| | | return R.ok(loginUserInfoVO); |
| | | } catch (Exception e) { |
| | |
| | | @Override |
| | | public R getSysUserByPhone(String phone, Integer type) { |
| | | SysUserDO sysUserDO = userDao.selectOne(new QueryWrapper<SysUserDO>().lambda().eq(SysUserDO::getPhone, phone).eq(SysUserDO::getType, type)); |
| | | LoginUserInfoVO loginUserInfoVO = new LoginUserInfoVO(); |
| | | McsLoginUserInfoVO loginUserInfoVO = null; |
| | | if (nonNull(sysUserDO)) { |
| | | loginUserInfoVO = new McsLoginUserInfoVO(); |
| | | BeanUtils.copyProperties(sysUserDO, loginUserInfoVO); |
| | | } |
| | | return R.ok(loginUserInfoVO); |
| | | } |
| | | |
| | | /** |
| | | * 发送验证码登录 |
| | | * @param phone 手机号 |
| | | * @param clientIP 用户ip |
| | | * @param prefixKey redis Key 前缀 |
| | | * @param limit 获取次数限制 |
| | | * @param timeout 超次数获取时间等待 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R sendMessageCodeForLogin(String phone, String clientIP, String prefixKey, Integer limit, Integer timeout) { |
| | | ValueOperations<String, String> opsForValue = stringRedisTemplate.opsForValue(); |
| | | if (isNotBlank(clientIP)) { |
| | | String redisKey = String.join("::", prefixKey, clientIP); |
| | | Long increment = opsForValue.increment(redisKey, 1); |
| | | if (increment > limit) { |
| | | return R.fail("请求频繁,请稍后再试"); |
| | | } |
| | | stringRedisTemplate.expire(redisKey, timeout, TimeUnit.SECONDS); |
| | | } |
| | | Random r = new Random(); |
| | | StringBuilder rs = new StringBuilder(); |
| | | for (int i = 0; i < 5; i++) { |
| | | rs.append(r.nextInt(10)); |
| | | } |
| | | String code = rs.toString(); |
| | | int result = SmsUtil.sendCode(phone, code); |
| | | if (result == 1) { |
| | | String codeKey = String.join("::", phone, code); |
| | | opsForValue.set(codeKey, code, timeout, TimeUnit.SECONDS); |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | } |
| | |
| | | <result property="workStartTime" column="work_start_time"/> |
| | | <result property="workEndTime" column="work_end_time"/> |
| | | <result property="bigAgeTips" column="big_age_tips"/> |
| | | <result property="plaintextPassword" column="plaintext_password"/> |
| | | |
| | | </resultMap> |
| | | <sql id="columns"> |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.Valid; |
| | | |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageJoinGameListDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageVerifyRecordDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.GameStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsVerifyRecordVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.VerifiedReturnVO; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestHeader; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.panzhihua.common.controller.BaseController; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.LoginWithPhoneDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsInfoDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsMerchantDTO; |
| | |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsEvaluateDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsInformationDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsMerchantDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsProductDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForGameDTO; |
| | | import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForInfoDTO; |
| | |
| | | import com.panzhihua.common.model.vos.LoginReturnVO; |
| | | import com.panzhihua.common.model.vos.LoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.R; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.IndexTopStatisticsVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsEvaluateVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsInformationVO; |
| | |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsLoginUserInfoVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.McsProductVO; |
| | | import com.panzhihua.common.model.vos.community.microCommercialStreet.MyCouponVO; |
| | | import com.panzhihua.common.model.vos.shop.LoginMerchantUserInfoVO; |
| | | import com.panzhihua.common.service.auth.TokenService; |
| | | import com.panzhihua.common.service.community.CommunityService; |
| | |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | |
| | | R r = communityService.loginWithPhone(loginDTO); |
| | | Boolean isValid = false; |
| | | if (R.isOk(r) && r.getData() != null) { |
| | | LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), LoginUserInfoVO.class); |
| | | McsLoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), McsLoginUserInfoVO.class); |
| | | isValid = loginUserInfoVO.getStatus() == 1; |
| | | if (isValid) { |
| | | R result = tokenService.loginMcsUser(loginUserInfoVO.getAccount(), loginUserInfoVO.getPassword()); |
| | | R result = tokenService.loginMcsUser(loginUserInfoVO.getAccount(), loginUserInfoVO.getPlaintextPassword()); |
| | | return result; |
| | | } else { |
| | | return R.fail("账号被禁用"); |
| | |
| | | return R.fail(r.getMsg()); |
| | | } catch (Exception e) { |
| | | return R.fail("登陆失败了"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "获取登录验证码") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "phone", value = "手机号", required = true), |
| | | @ApiImplicitParam(paramType = "header", name = "X-Real-IP", example = "192.168.1.1", value = "用户ip") |
| | | }) |
| | | @GetMapping("/verifyCode") |
| | | public R loginWithPhone(@RequestParam("phone") String phone, @RequestHeader(value = "X-Real-IP", required = false) String clientIP) { |
| | | log.info("获取验证码用户ip信息【{}】", clientIP); |
| | | try { |
| | | return userService.sendMessageCodeForLogin(phone, clientIP, "MCS_LOGIN_WITH_PHONE", 5, 5 * 60); |
| | | } catch (Exception e) { |
| | | return R.fail("获取失败"); |
| | | } |
| | | } |
| | | |
| | |
| | | e.printStackTrace(); |
| | | return R.fail("获取用户信息失败"); |
| | | } |
| | | } |
| | | |
| | | @ApiOperation(value = "修改用戶信息") |
| | | @PutMapping("/putUserInfo") |
| | | public R putUserInfo(@RequestBody PutUserInfoDTO putUserInfoDTO) { |
| | | putUserInfoDTO.setUserId(this.getUserId()); |
| | | return communityService.putUserInfo(putUserInfoDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增戳戳游戏") |
| | |
| | | @ApiOperation(value = "分页查询戳戳游戏", response = McsGameVO.class) |
| | | @PostMapping("/game/page") |
| | | public R pageMcsGame(@RequestBody @Valid PageMcsGameDTO pageMcsGameDTO) { |
| | | pageMcsGameDTO.setUserId(this.getUserId()); |
| | | return communityService.pageMcsGame(pageMcsGameDTO); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "分页查询戳戳资讯", response = McsInformationVO.class) |
| | | @PostMapping("/information/page") |
| | | public R pageMcsInfo(@RequestBody @Valid PageMcsInformationDTO pageMcsInformationDTO) { |
| | | pageMcsInformationDTO.setUserId(this.getUserId()); |
| | | return communityService.pageMcsInfo(pageMcsInformationDTO); |
| | | } |
| | | |
| | |
| | | return communityService.getMcsLabelList(this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "首页顶部数据", response = IndexTopStatisticsVO.class) |
| | | @GetMapping("/index/topData") |
| | | public R getMcsIndexTopData() { |
| | | return communityService.getMcsIndexTopData(); |
| | | } |
| | | |
| | | @ApiOperation(value = "戳戳卷领取", response = McsCouponVO.class) |
| | | @ApiImplicitParam(name = "gameId", value = "戳戳游戏id", required = true) |
| | | @GetMapping("/coupon/apply") |
| | | public R applyMcsCoupon(@RequestParam("gameId") Long gameId) { |
| | | return communityService.applyMcsCoupon(gameId, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "h5分页查询戳戳资讯", response = McsInformationVO.class) |
| | | @PostMapping("/information/pageH5") |
| | | public R pageH5McsInfo(@RequestBody @Valid PageMcsInformationDTO pageMcsInformationDTO) { |
| | | return communityService.pageH5McsInfo(pageMcsInformationDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "h5分页查询戳戳游戏", response = McsGameVO.class) |
| | | @PostMapping("/game/pageH5") |
| | | public R pageH5McsGame(@RequestBody @Valid PageMcsGameDTO pageMcsGameDTO) { |
| | | return communityService.pageH5McsGame(pageMcsGameDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "游戏详情", response = McsGameVO.class) |
| | | @ApiImplicitParam(name = "gameId", value = "游戏id", required = true) |
| | | @GetMapping("/game/get") |
| | | public R getMcsGame(@RequestParam("gameId") Long gameId) { |
| | | return communityService.getMcsGame(gameId); |
| | | } |
| | | |
| | | @ApiOperation(value = "资讯详情", response = McsInformationVO.class) |
| | | @ApiImplicitParam(name = "infoId", value = "资讯id", required = true) |
| | | @GetMapping("/info/get") |
| | | public R getMcsInfo(@RequestParam("infoId") Long infoId) { |
| | | return communityService.getMcsInfo(infoId); |
| | | } |
| | | |
| | | @ApiOperation(value = "H5分页查询数字商业街商家", response = McsMerchantVO.class) |
| | | @PostMapping("/merchant/pageH5") |
| | | public R pageH5McsMerchant(@RequestBody @Valid PageMcsMerchantDTO pageMcsMerchantDTO) { |
| | | return communityService.pageH5McsMerchant(pageMcsMerchantDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的戳戳卷", response = MyCouponVO.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "type", value = "类型(1.戳戳币 2.免费体验)") |
| | | }) |
| | | @GetMapping("/myCoupon") |
| | | public R getMyCoupon(@RequestParam(value = "type", required = false) Integer type) { |
| | | return communityService.getMyCoupon(type, this.getUserId()); |
| | | } |
| | | |
| | | @ApiOperation(value = "我的评价-参与游戏列表", response = MyCouponVO.class) |
| | | @PostMapping("/joinGame/page") |
| | | public R getJoinGameList(@RequestBody @Valid PageJoinGameListDTO pageJoinGameListDTO) { |
| | | pageJoinGameListDTO.setUserId(this.getUserId()); |
| | | return communityService.getJoinGameList(pageJoinGameListDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取所有数字商业街配置", response = McsConfigVO.class) |
| | | @GetMapping("/config/all") |
| | | public R getAllMcsConfig() { |
| | | return communityService.getAllMcsConfig(); |
| | | } |
| | | |
| | | @ApiOperation(value = "新增评价记录") |
| | | @PostMapping("/evaluate/add") |
| | | public R addMcsEvaluate(@RequestBody @Validated(AddGroup.class) McsEvaluateDTO mcsEvaluateDTO) { |
| | | mcsEvaluateDTO.setUserId(this.getUserId()); |
| | | return communityService.addMcsEvaluate(mcsEvaluateDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "戳戳卷核销", response = VerifiedReturnVO.class) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "couponId", value = "戳戳卷id", required = true) |
| | | }) |
| | | @GetMapping("/coupon/verify") |
| | | public R verifyMcsCoupon(@RequestParam("couponId") Long couponId) { |
| | | return communityService.verifyMcsCoupon(couponId); |
| | | } |
| | | |
| | | @ApiOperation(value = "分页查询核销记录", response = McsVerifyRecordVO.class) |
| | | @GetMapping("/verifyRecord/page") |
| | | public R pageMcsVerifyRecord(@RequestBody @Valid PageVerifyRecordDTO pageVerifyRecordDTO) { |
| | | pageVerifyRecordDTO.setUserId(this.getUserId()); |
| | | return communityService.pageMcsVerifyRecord(pageVerifyRecordDTO); |
| | | } |
| | | |
| | | @ApiOperation(value = "游戏统计", response = GameStatisticsVO.class) |
| | | @GetMapping("/game/statistics") |
| | | public R getMcsGameStatistics() { |
| | | return communityService.getMcsGameStatistics(this.getUserId()); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "分页查询评价记录", response = McsEvaluateVO.class) |
| | | @PostMapping("/evaluate/page") |
| | | public R pageMcsEvaluate(@RequestBody @Valid PageMcsEvaluateDTO pageMcsEvaluateDTO) { |
| | | pageMcsEvaluateDTO.setUserId(this.getUserId()); |
| | | return communityService.pageMcsEvaluate(pageMcsEvaluateDTO); |
| | | } |
| | | |
| | |
| | | String uri = request.getRequestURI(); |
| | | boolean isDoc = uri.contains("doc.html") || uri.contains("-docs"); |
| | | boolean convenientLogin = "/convenient/login".equals(uri); |
| | | boolean mcsLogin = "/microcommercialstreet/login".equals(uri); |
| | | boolean mcsLogin = "/microcommercialstreet/login".equals(uri) || "/microcommercialstreet/loginWithPhone".equals(uri); |
| | | boolean mcsGetCode = uri.contains("/microcommercialstreet/verifyCode"); |
| | | boolean mcsMerchantLogin = "/microcommercialstreet/merchant/login".equals(uri); |
| | | boolean storeLogin = "/login".equals(uri); |
| | | boolean isUpload = "/convenient/upload/file".equals(uri); |
| | | |
| | | if (isDoc || isUpload || storeLogin || convenientLogin || mcsLogin || mcsMerchantLogin) { |
| | | if (isDoc || isUpload || storeLogin || convenientLogin || mcsLogin || mcsMerchantLogin || mcsGetCode) { |
| | | //放过swagger请求 |
| | | } else { |
| | | String userInfo = request.getHeader(TokenConstant.TOKEN_USERINFO); |
| | |
| | | noLoginUrl.add("/api/communitybackstage/screen/comprehensive/partydyn"); |
| | | noLoginUrl.add("/api/communitybackstage/screen/comprehensive/pagedynamic"); |
| | | noLoginUrl.add("/api/communitybackstage/screen/get/community/password"); |
| | | noLoginUrl.add("/api/shopbackstage/microcommercialstreet/verifyCode"); |
| | | if (noLoginUrl.contains(requestURI)) { |
| | | List<SimpleGrantedAuthority> authorities = new ArrayList<>(); |
| | | authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS)); |