puhanshu
2022-01-11 af8cd7db30e347bf4a9d4753e352abe9106bdb09
商业街1/11代码提交
3个文件已添加
39个文件已修改
846 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/microCommercialStreet/DeleteProductDTO.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/microCommercialStreet/McsGameDTO.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/microCommercialStreet/McsMerchantDTO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/microCommercialStreet/PageVerifyRecordDTO.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsCouponVO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsEvaluateVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsInformationVO.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsOrderVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsProductVO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsVerifyRecordVO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/McsOrderApi.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/MicroCommercialStreetApi.java 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/McsGameDAO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/McsInformationDAO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/McsMerchantDAO.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/McsMerchant.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/McsProduct.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/McsVerifiedRecord.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/McsCouponService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/McsMerchantService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/McsProductService.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsCouponServiceImpl.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsGameServiceImpl.java 138 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsInformationServiceImpl.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsMerchantServiceImpl.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsOrderServiceImpl.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsProductServiceImpl.java 47 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsCouponMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsEvaluateMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsGameMapper.xml 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsInformationMapper.xml 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsMerchantMapper.xml 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsVerifiedRecordMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/aop/CheckExpirationInterceptor.java 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/aop/CheckMcsMerchantExpiration.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/McsOrderApi.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/MicroCommercialStreetApi.java 53 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/filter/StoreValidFilter.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/CommunityJobHandler.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/JWTAuthenticationTokenFilter.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/microCommercialStreet/DeleteProductDTO.java
New file
@@ -0,0 +1,28 @@
package com.panzhihua.common.model.dtos.community.microCommercialStreet;
import java.util.List;
import javax.validation.constraints.NotEmpty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @title: DeleteProductDTO
 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目
 * @description: 删除产品信息请求参数
 * @author: hans
 * @date: 2022/01/11 16:24
 */
@Data
@ApiModel("删除产品信息请求参数")
public class DeleteProductDTO {
    @ApiModelProperty(value = "产品id列表", required = true)
    @NotEmpty(message = "产品id列表不能为空")
    private List<Long> productIds;
    @ApiModelProperty(value = "处理人", hidden = true)
    private Long updatedBy;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/microCommercialStreet/McsGameDTO.java
@@ -5,6 +5,7 @@
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.panzhihua.common.validated.AddGroup;
import com.panzhihua.common.validated.PutGroup;
@@ -62,6 +63,7 @@
    @ApiModelProperty("失效时间")
    @NotNull(groups = {AddGroup.class}, message = "失效时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date expireAt;
    @ApiModelProperty("封面")
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/microCommercialStreet/McsMerchantDTO.java
@@ -83,6 +83,6 @@
    @ApiModelProperty(value = "所属商家", hidden = true)
    private Long userId;
    @ApiModelProperty(value = "用户头像")
    @ApiModelProperty(value = "用户头像", hidden = true)
    private String imageUrl;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/microCommercialStreet/PageVerifyRecordDTO.java
@@ -3,9 +3,12 @@
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
/**
 * @title: PageVerifyRecordDTO
@@ -18,6 +21,20 @@
@ApiModel("分页查询核销记录")
public class PageVerifyRecordDTO {
    @ApiModelProperty("关键字")
    private String keyword;
    @ApiModelProperty("游戏类别(1.戳戳币游戏 2.体验游戏)")
    private Integer type;
    @ApiModelProperty("核销时间-起")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date verifiedBegin;
    @ApiModelProperty("核销时间-止")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date verifiedEnd;
    @ApiModelProperty(value = "分页-当前页数", example = "1")
    @NotNull(message = "分页参数不能为空")
    @Min(value = 1)
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsCouponVO.java
@@ -43,7 +43,16 @@
    @ApiModelProperty("是否评论(1.是 2.否)")
    private Integer isEvaluate;
    @ApiModelProperty("评论id")
    private Long evaluateId;
    @ApiModelProperty("游戏id")
    private Long gameId;
    @ApiModelProperty("失效时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date expireAt;
    @ApiModelProperty("游戏封面")
    private String cover;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsEvaluateVO.java
@@ -37,6 +37,9 @@
    @ApiModelProperty("用户")
    private String nickName;
    @ApiModelProperty("用户头像")
    private String imageUrl;
    @ApiModelProperty("手机号码")
    private String phone;
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsInformationVO.java
@@ -49,6 +49,6 @@
    @ApiModelProperty("所属商家")
    private Long merchantId;
    @ApiModelProperty("所属商家名称")
    private Long merchantName;
    @ApiModelProperty("商家信息")
    private McsMerchantVO merchantInfo;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsOrderVO.java
@@ -89,4 +89,7 @@
    @ApiModelProperty("openid")
    private String openId;
    @ApiModelProperty("订单取消剩余倒计时")
    private Long cancelCountdown;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsProductVO.java
@@ -7,6 +7,8 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
 * @title: McsProductVO
 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目
@@ -45,4 +47,7 @@
    @ApiModelProperty("所属商家名称")
    private Long merchantName;
    @ApiModelProperty("产品标签ids")
    private List<Long> labelIds;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsVerifyRecordVO.java
@@ -22,6 +22,9 @@
    @ApiModelProperty("核验记录id")
    private Long id;
    @ApiModelProperty("核验码")
    private Long couponId;
    @ApiModelProperty("游戏名称")
    private String name;
@@ -31,4 +34,10 @@
    @ApiModelProperty("核验时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date verifiedAt;
    @ApiModelProperty("用户昵称")
    private String nickName;
    @ApiModelProperty("游戏类别(1.戳戳币游戏 2.体验游戏)")
    private Integer type;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -2,28 +2,7 @@
import java.util.List;
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.community.microCommercialStreet.McsConfigVO;
import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.DeleteProductDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.DeleteMapping;
@@ -35,6 +14,7 @@
import org.springframework.web.bind.annotation.RequestParam;
import com.panzhihua.common.model.dtos.AppletesBackstageConfigDTO;
import com.panzhihua.common.model.dtos.PageBaseDTO;
import com.panzhihua.common.model.dtos.PageDTO;
import com.panzhihua.common.model.dtos.advertisement.ComOpsAdvDTO;
import com.panzhihua.common.model.dtos.advertisement.PageComOpsAdvDTO;
@@ -174,8 +154,32 @@
import com.panzhihua.common.model.dtos.community.integral.admin.EditComActIntegralRuleDTO;
import com.panzhihua.common.model.dtos.community.integral.admin.PageComActIntegralRuleDTO;
import com.panzhihua.common.model.dtos.community.integral.admin.PageComActIntegralTradeDTO;
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.dtos.community.questnaire.StatisticsSummaryDTO;
import com.panzhihua.common.model.dtos.community.rentingHouses.*;
import com.panzhihua.common.model.dtos.community.rentingHouses.NearbyDTO;
import com.panzhihua.common.model.dtos.community.rentingHouses.PageRentingHouseRegisterDTO;
import com.panzhihua.common.model.dtos.community.rentingHouses.PageRentingHousesConfigDTO;
import com.panzhihua.common.model.dtos.community.rentingHouses.ReleaseOrCancelHouseDTO;
import com.panzhihua.common.model.dtos.community.rentingHouses.RentingHouseRegisterDTO;
import com.panzhihua.common.model.dtos.community.rentingHouses.RentingHousesConfigDTO;
import com.panzhihua.common.model.dtos.community.reserve.AddReserveAdminDTO;
import com.panzhihua.common.model.dtos.community.reserve.CancelReserveRecordDTO;
import com.panzhihua.common.model.dtos.community.reserve.ComActReserveMakeStatisticsDTO;
@@ -331,6 +335,8 @@
import com.panzhihua.common.model.vos.community.bigscreen.PartyBuildingMemberVO;
import com.panzhihua.common.model.vos.community.cluster.admin.ComClusterMemberExcelVO;
import com.panzhihua.common.model.vos.community.convenient.ConvenientMerchantVO;
import com.panzhihua.common.model.vos.community.microCommercialStreet.McsConfigVO;
import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO;
import com.panzhihua.common.model.vos.community.questnaire.EditComActQuestnaireVo;
import com.panzhihua.common.model.vos.community.questnaire.QuestnaireVO;
import com.panzhihua.common.model.vos.community.questnaire.UsersAnswerQuestnaireVO;
@@ -7968,12 +7974,11 @@
    /**
     * 删除产品信息
     * @param productId
     * @param userId
     * @param deleteProductDTO
     * @return
     */
    @DeleteMapping("/microcommercialstreet/product/delete")
    R deleteMcsProduct(@RequestParam("productId") Long productId, @RequestParam("userId") Long userId);
    @PostMapping("/microcommercialstreet/product/delete")
    R deleteMcsProduct(@RequestBody DeleteProductDTO deleteProductDTO);
    /**
     * 上架/下架产品信息
@@ -8178,17 +8183,18 @@
    /**
     * 戳戳卷核销
     * @param couponId
     * @param userId
     * @return
     */
    @GetMapping("/microcommercialstreet/coupon/verify")
    R verifyMcsCoupon(@RequestParam("couponId") Long couponId);
    R verifyMcsCoupon(@RequestParam("couponId") Long couponId, @RequestParam("userId") Long userId);
    /**
     * 分页查询核销记录
     * @param pageVerifyRecordDTO
     * @return
     */
    @GetMapping("/microcommercialstreet/verifyRecord/page")
    @PostMapping("/microcommercialstreet/verifyRecord/page")
    R pageMcsVerifyRecord(@RequestBody PageVerifyRecordDTO pageVerifyRecordDTO);
    /**
@@ -8206,4 +8212,27 @@
     */
    @PutMapping("/microcommercialstreet/putUserInfo")
    R putUserInfo(@RequestBody PutUserInfoDTO putUserInfoDTO);
    /**
     * 根据userId获取商家信息
     * @param userId
     * @return
     */
    @GetMapping("/microcommercialstreet/retrieveMcsMerchantInfoByUserId")
    R retrieveMcsMerchantInfoByUserId(@RequestParam("userId") Long userId);
    /**
     * 定时任务-每隔5分钟执行一次,将已到期的微商业街商家旗下所有的游戏/资讯全部下架
     * @return
     */
    @GetMapping("/microcommercialstreet/offResourceForMcsMerchant")
    R offResourceForMcsMerchant();
    /**
     * 获取产品信息详情
     * @param productId
     * @return
     */
    @GetMapping("/microcommercialstreet/product/get")
    R getMcsProduct(@RequestParam("productId") Long productId);
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java
@@ -26,6 +26,7 @@
    public static SimpleDateFormat yyyyMM_format = new SimpleDateFormat("yyyy-MM");
    public static SimpleDateFormat format_yyymmdd = new SimpleDateFormat("yyyyMMdd");
    public static SimpleDateFormat format_yyyy = new SimpleDateFormat("yyyy");
    public static SimpleDateFormat format_yyyyMMddHHmmss = new SimpleDateFormat("yyyyMMddHHmmss");
    private static DateTimeFormatter format_ymdhmssss = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS");
    private static DateTimeFormatter format_ymds = DateTimeFormatter.ofPattern("yyyyMMdd");
    private static DateTimeFormatter format_yms = DateTimeFormatter.ofPattern("yyyyMM");
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/McsOrderApi.java
@@ -51,7 +51,7 @@
     */
    @GetMapping("{id}")
    public R selectOne(@PathVariable("id") Long id) {
        return R.ok(this.mcsOrderService.getById(id));
        return this.mcsOrderService.detail(id);
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/MicroCommercialStreetApi.java
@@ -4,6 +4,7 @@
import javax.annotation.Resource;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.DeleteProductDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.PutUserInfoDTO;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
@@ -370,13 +371,12 @@
    /**
     * 删除产品信息
     * @param productId
     * @param userId
     * @param deleteProductDTO
     * @return
     */
    @DeleteMapping("/product/delete")
    public R deleteMcsProduct(@RequestParam("productId") Long productId, @RequestParam("userId") Long userId) {
        return mcsProductService.deleteMcsProduct(productId, userId);
    @PostMapping("/product/delete")
    public R deleteMcsProduct(@RequestBody DeleteProductDTO deleteProductDTO) {
        return mcsProductService.deleteMcsProduct(deleteProductDTO);
    }
    /**
@@ -547,11 +547,12 @@
    /**
     * 戳戳卷核销
     * @param couponId
     * @param userId
     * @return
     */
    @GetMapping("/coupon/verify")
    public R verifyMcsCoupon(@RequestParam("couponId") Long couponId) {
        return mcsCouponService.verifyMcsCoupon(couponId);
    public R verifyMcsCoupon(@RequestParam("couponId") Long couponId, @RequestParam("userId") Long userId) {
        return mcsCouponService.verifyMcsCoupon(couponId, userId);
    }
    /**
@@ -559,7 +560,7 @@
     * @param pageVerifyRecordDTO
     * @return
     */
    @GetMapping("/verifyRecord/page")
    @PostMapping("/verifyRecord/page")
    public R pageMcsVerifyRecord(@RequestBody PageVerifyRecordDTO pageVerifyRecordDTO) {
        return mcsVerifiedRecordService.pageMcsVerifyRecord(pageVerifyRecordDTO);
    }
@@ -583,4 +584,33 @@
    public R putUserInfo(@RequestBody PutUserInfoDTO putUserInfoDTO) {
        return mcsMerchantService.putUserInfo(putUserInfoDTO);
    }
    /**
     * 根据userId获取商家信息
     * @param userId
     * @return
     */
    @GetMapping("/retrieveMcsMerchantInfoByUserId")
    public R retrieveMcsMerchantInfoByUserId(@RequestParam("userId") Long userId) {
        return mcsMerchantService.retrieveMcsMerchantInfoByUserId(userId);
    }
    /**
     * 定时任务-每隔5分钟执行一次,将已到期的微商业街商家旗下所有的游戏/资讯全部下架
     * @return
     */
    @GetMapping("/offResourceForMcsMerchant")
    public R offResourceForMcsMerchant() {
        return mcsMerchantService.offResourceForMcsMerchant();
    }
    /**
     * 获取产品信息详情
     * @param productId
     * @return
     */
    @GetMapping("/product/get")
    public R getMcsProduct(@RequestParam("productId") Long productId) {
        return mcsProductService.getMcsProduct(productId);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/McsGameDAO.java
@@ -94,4 +94,11 @@
     * @return
     */
    McsGameVO selectDetailById(@Param("gameId") Long gameId);
    /**
     * 通过商家id批量下架戳戳游戏
     * @param needDealIds
     * @return
     */
    Integer setOffByMerchantIds(@Param("needDealIds") List<Long> needDealIds);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/McsInformationDAO.java
@@ -61,4 +61,11 @@
    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);
    /**
     * 通过商家id批量下架戳戳资讯
     * @param needDealIds
     * @return
     */
    Integer setOffByMerchantIds(@Param("needDealIds") List<Long> needDealIds);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/McsMerchantDAO.java
@@ -81,4 +81,17 @@
     */
    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);
    /**
     * 查询需要处理的已到期商家
     * @return
     */
    List<Long> selectNeedDealExpiredMerchant();
    /**
     * 修改is_pause状态为TRUE
     * @param needDealIds
     * @return
     */
    Integer updateIsPauseStatus(@Param("needDealIds") List<Long> needDealIds);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/McsMerchant.java
@@ -3,6 +3,8 @@
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
@@ -35,6 +37,7 @@
    /**
     * 商家logo
     */
    @TableField(value = "logo", updateStrategy = FieldStrategy.IGNORED)
    private String logo;
    /**
     * 关联用户id
@@ -52,6 +55,10 @@
     * 到期时间
     */
    private Date expireAt;
    /**
     * 是否暂停服务
     */
    private Boolean isPause;
    /**
     * 首次点亮时间
     */
@@ -71,6 +78,7 @@
    /**
     * 商家简介
     */
    @TableField(value = "introduction", updateStrategy = FieldStrategy.IGNORED)
    private String introduction;
    /**
     * 是否删除
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/McsProduct.java
@@ -1,5 +1,7 @@
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;
@@ -18,6 +20,7 @@
public class McsProduct implements Serializable {
    private static final long serialVersionUID = 415357403059379804L;
    @TableId(type = IdType.INPUT)
    private Long id;
    /**
     * 产品名称
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/McsVerifiedRecord.java
@@ -32,6 +32,14 @@
     */
    private String name;
    /**
     * 用户id
     */
    private String nickName;
    /**
     * 游戏id
     */
    private Long gameId;
    /**
     * 获得奖励
     */
    private String award;
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/McsCouponService.java
@@ -31,9 +31,10 @@
    /**
     * 戳戳卷核销
     * @param couponId
     * @param userId
     * @return
     */
    R verifyMcsCoupon(Long couponId);
    R verifyMcsCoupon(Long couponId, Long userId);
    /**
     * 游戏统计
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/McsMerchantService.java
@@ -103,4 +103,17 @@
     * @return
     */
    R putUserInfo(PutUserInfoDTO putUserInfoDTO);
    /**
     * 根据userId获取商家信息
     * @param userId
     * @return
     */
    R retrieveMcsMerchantInfoByUserId(Long userId);
    /**
     * 定时任务-每隔5分钟执行一次,将已到期的微商业街商家旗下所有的游戏/资讯全部下架
     * @return
     */
    R offResourceForMcsMerchant();
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/McsProductService.java
@@ -1,6 +1,7 @@
package com.panzhihua.service_community.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.DeleteProductDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsProductDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsProductDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForProductDTO;
@@ -31,11 +32,10 @@
    /**
     * 删除产品信息
     * @param productId
     * @param userId
     * @param deleteProductDTO
     * @return
     */
    R deleteMcsProduct(Long productId, Long userId);
    R deleteMcsProduct(DeleteProductDTO deleteProductDTO);
    /**
     * 上架/下架产品信息
@@ -50,4 +50,11 @@
     * @return
     */
    R pageMcsProduct(PageMcsProductDTO pageMcsProductDTO);
    /**
     * 获取产品信息详情
     * @param productId
     * @return
     */
    R getMcsProduct(Long productId);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsCouponServiceImpl.java
@@ -4,13 +4,16 @@
import java.util.List;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.McsMerchantDAO;
import com.panzhihua.service_community.dao.McsVerifiedRecordDAO;
import com.panzhihua.service_community.entity.McsGame;
import com.panzhihua.service_community.entity.McsMerchant;
import com.panzhihua.service_community.entity.McsVerifiedRecord;
import org.springframework.stereotype.Service;
@@ -45,6 +48,8 @@
    private McsGameDAO mcsGameDAO;
    @Resource
    private UserService userService;
    @Resource
    private McsMerchantDAO mcsMerchantDAO;
    /**
     * 我的戳戳卷
@@ -77,10 +82,16 @@
    /**
     * 戳戳卷核销
     * @param couponId
     * @param userId
     * @return
     */
    @Override
    public R verifyMcsCoupon(Long couponId) {
    public R verifyMcsCoupon(Long couponId, Long userId) {
        McsMerchant mcsMerchant = mcsMerchantDAO.selectOne(new QueryWrapper<McsMerchant>().lambda()
                .eq(McsMerchant::getUserId, userId).eq(McsMerchant::getIsDel, false));
        if (isNull(mcsMerchant) || !mcsMerchant.getUserId().equals(userId)) {
            return R.fail("限指定商家核验");
        }
        McsCoupon mcsCoupon = this.baseMapper.selectById(couponId);
        if (isNull(mcsCoupon) || mcsCoupon.getIsVerified()) {
            return R.fail("无效卷码");
@@ -90,10 +101,20 @@
        if (isNull(mcsGame) || mcsGame.getExpireAt().before(nowDate)) {
            return R.fail("已过期");
        }
        R<LoginUserInfoVO> userInfoVOR = userService.getUserInfoByUserId(mcsCoupon.getUserId().toString());
        String nickName;
        if (R.isOk(userInfoVOR) && nonNull(userInfoVOR.getData())) {
            LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(JSONObject.toJSONString(userInfoVOR.getData()), LoginUserInfoVO.class);
            nickName = loginUserInfoVO.getName();
        } else {
            nickName = "默认昵称";
        }
        McsVerifiedRecord mcsVerifiedRecord = new McsVerifiedRecord();
        mcsVerifiedRecord.setCouponId(couponId);
        mcsVerifiedRecord.setAward(mcsCoupon.getAward());
        mcsVerifiedRecord.setName(mcsGame.getName());
        mcsVerifiedRecord.setNickName(nickName);
        mcsVerifiedRecord.setGameId(mcsGame.getId());
        mcsVerifiedRecord.setMerchantId(mcsGame.getMerchantId());
        int num = mcsVerifiedRecordDAO.insert(mcsVerifiedRecord);
        if (num > 0) {
@@ -105,13 +126,7 @@
            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.setNickName(nickName);
            verifiedReturnVO.setVerifiedAt(nowDate);
            return R.ok(verifiedReturnVO);
        }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsGameServiceImpl.java
@@ -4,24 +4,20 @@
import static java.util.Objects.nonNull;
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;
import javax.annotation.Resource;
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;
@@ -379,6 +375,11 @@
            Integer allocation = mcsGame.getAllocation();
            if (allocation.equals(1)) {
                //随机分配
                Integer surplusCoins = mcsGame.getSurplusCoins();
                Integer coin = getRandomCoins(surplusCoins, mcsGame.getSurplusCoupons());
                mcsCoupon.setCoin(coin);
                mcsCoupon.setAward("戳戳币:" + coin);
                mcsGame.setSurplusCoins(surplusCoins - coin);
            } else {
                //固定值
                mcsCoupon.setCoin(mcsGame.getCoins());
@@ -448,35 +449,106 @@
    }
    public static void main(String[] args) {
        int total = 300;
        int total = 500;
        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);
        for (int i = 1;i <= 10; i++) {
            Integer decrease = getRandomCoins(total, people);
            total -= decrease;
            people --;
            System.out.println("第:" + i + "个人领取到:" + decrease + "戳戳币,总数还剩下:" + total);
        }
        // 剩余的就是最后一个用户的阅点额度
        System.out.format("第 %d 个红包: %d 阅点,剩下: 0 阅点\n", people, total);
    }
    public static Integer getRandomCoins(int totalCoins, int peopleTotal) {
        List<Integer> list = new ArrayList<>(peopleTotal);
        if (peopleTotal == 1) {
            return totalCoins;
        }
        Random random = new Random();
        // 平均分配
        int average = totalCoins / peopleTotal;
        int max = (int) Math.floor(totalCoins * 0.6);
        int min = (int) Math.floor(average * 0.5);
        float thresh = 0.95F;
        int rest = totalCoins - average * peopleTotal;
        for (int i = 0; i < peopleTotal; i++) {
            if (i < rest) {
                list.add(average + 1);
            } else {
                list.add(average);
            }
        }
        // 根据阀值进行数据随机处理
        int randOfRange = 0;
        int randRom = 0;
        int nextIndex = 0;
        int nextValue = 0;
        //多余
        int surplus = 0;
        //缺少
        int lack = 0;
        for (int i = 0; i < peopleTotal - 1; i++) {
            nextIndex = i + 1;
            int itemThis = list.get(i);
            int itemNext = list.get(nextIndex);
            boolean isLt = itemThis < itemNext;
            int rangeThis = isLt ? max - itemThis : itemThis - min;
            int rangeNext = isLt ? itemNext - min : max - itemNext;
            int rangeFinal = (int) Math.ceil(thresh * (Math.min(rangeThis, rangeNext) + 1));
            randOfRange = random.nextInt(rangeFinal);
            randRom = isLt ? 1 : -1;
            int iValue = list.get(i) + randRom * randOfRange;
            nextValue = list.get(nextIndex) + randRom * randOfRange * -1;
            if (iValue > max) {
                surplus += (iValue - max);
                list.set(i, max);
            } else if (iValue < min) {
                list.set(i, min);
                lack += (min - iValue);
            } else {
                list.set(i, iValue);
            }
            list.set(nextIndex, nextValue);
        }
        if (nextValue > max) {
            surplus += (nextValue - max);
            list.set(nextIndex, max);
        }
        if (nextValue < min) {
            lack += (min - nextValue);
            list.set(nextIndex, min);
        }
        if (surplus - lack > 0) {
            //分少了 给低于max的凑到max
            for (int i = 0; i < list.size(); i++) {
                int value = list.get(i);
                if (value < max) {
                    int tmp = max - value;
                    if (surplus >= tmp) {
                        surplus -= tmp;
                        list.set(i, max);
                    } else {
                        list.set(i, value + surplus);
                        return list.get(random.nextInt(list.size() - 1));
                    }
                }
            }
        } else if (lack - surplus > 0) {
            //分多了 给超过高于min的人凑到min
            for (int i = 0; i < list.size(); i++) {
                int value = list.get(i);
                if (value > min) {
                    int tmp = value - min;
                    if (lack >= tmp) {
                        lack -= tmp;
                        list.set(i, min);
                    } else {
                        list.set(i, min + tmp - lack);
                        return list.get(random.nextInt(list.size() - 1));
                    }
                }
            }
        }
        return list.get(random.nextInt(list.size() - 1));
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsInformationServiceImpl.java
@@ -8,6 +8,7 @@
import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsInfoDTO;
import com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO;
import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.service_community.util.NearbyUtil;
import com.spatial4j.core.shape.Rectangle;
@@ -249,6 +250,18 @@
        }
        McsInformationVO mcsInformationVO = new McsInformationVO();
        BeanUtils.copyProperties(mcsInformation, mcsInformationVO);
        McsMerchant mcsMerchant = mcsMerchantDAO.selectById(mcsInformation.getMerchantId());
        McsMerchantVO mcsMerchantVO = new McsMerchantVO();
        if (nonNull(mcsMerchant)) {
            mcsMerchantVO.setId(mcsMerchant.getId());
            mcsMerchantVO.setName(mcsMerchant.getName());
            mcsMerchantVO.setLogo(mcsMerchant.getLogo());
            mcsMerchantVO.setIntroduction(mcsMerchant.getLogo());
            mcsMerchantVO.setLat(mcsMerchant.getLat());
            mcsMerchantVO.setLon(mcsMerchant.getLon());
            mcsMerchantVO.setAddress(mcsMerchant.getAddress());
        }
        mcsInformationVO.setMerchantInfo(mcsMerchantVO);
        return R.ok(mcsInformationVO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsMerchantServiceImpl.java
@@ -18,6 +18,7 @@
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.dao.McsInformationDAO;
import com.panzhihua.service_community.util.NearbyUtil;
import com.spatial4j.core.shape.Rectangle;
import org.springframework.beans.BeanUtils;
@@ -66,6 +67,8 @@
    private McsConfigDAO mcsConfigDAO;
    @Resource
    private McsGameDAO mcsGameDAO;
    @Resource
    private McsInformationDAO mcsInformationDAO;
    @Resource
    private StringRedisTemplate stringRedisTemplate;
@@ -274,11 +277,9 @@
            } else {
                nowExpireAt = DateUtils.addDay(previousExpireAt, litDays);
            }
            McsMerchant mcsMerchant1 = new McsMerchant();
            mcsMerchant1.setId(mcsMerchant.getId());
            mcsMerchant1.setExpireAt(nowExpireAt);
            mcsMerchant1.setUpdatedBy(userId);
            num = this.baseMapper.updateById(mcsMerchant1);
            mcsMerchant.setExpireAt(nowExpireAt);
            mcsMerchant.setUpdatedBy(userId);
            num = this.baseMapper.updateById(mcsMerchant);
        }
        if (num > 0) {
            return R.ok(mcsMerchant.getId());
@@ -390,6 +391,39 @@
        return R.ok();
    }
    /**
     * 根据userId获取商家信息
     * @param userId
     * @return
     */
    @Override
    public R retrieveMcsMerchantInfoByUserId(Long userId) {
        McsMerchant mcsMerchant = this.baseMapper.selectOne(new QueryWrapper<McsMerchant>().lambda()
                .eq(McsMerchant::getUserId, userId).eq(McsMerchant::getIsDel, false));
        McsMerchantVO mcsMerchantVO = null;
        if (nonNull(mcsMerchant)) {
            mcsMerchantVO = new McsMerchantVO();
            BeanUtils.copyProperties(mcsMerchant, mcsMerchantVO);
        }
        return R.ok(mcsMerchantVO);
    }
    /**
     * 定时任务-每隔5分钟执行一次,将已到期的微商业街商家旗下所有的游戏/资讯全部下架
     * @return
     */
    @Override
    public R offResourceForMcsMerchant() {
        int num = 0;
        List<Long> needDealIds = this.baseMapper.selectNeedDealExpiredMerchant();
        if (nonNull(needDealIds) && !needDealIds.isEmpty()) {
            mcsGameDAO.setOffByMerchantIds(needDealIds);
            mcsInformationDAO.setOffByMerchantIds(needDealIds);
            num = this.baseMapper.updateIsPauseStatus(needDealIds);
        }
        return R.ok("执行任务数:" + num);
    }
    private void retrieveMerchantSurplusLitDays(McsMerchantVO merchantVO) {
        Integer publishLimit = merchantVO.getPublishLimit();
        Integer publishCount = mcsGameDAO.selectPublishCount(merchantVO.getId());
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsOrderServiceImpl.java
@@ -1,5 +1,6 @@
package com.panzhihua.service_community.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -14,6 +15,7 @@
import com.panzhihua.service_community.dao.McsOrderDao;
import com.panzhihua.service_community.service.McsMerchantService;
import com.panzhihua.service_community.service.McsOrderService;
import com.panzhihua.service_community.util.QRCodeUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils;
@@ -70,7 +72,11 @@
    @Override
    public R detail(Long id) {
        return R.ok(this.baseMapper.detail(id));
        McsOrderVO detail = this.baseMapper.detail(id);
        Date cancelAt = DateUtils.addMinutes(detail.getCreateTime(), 30);
        Date nowDate = new Date();
        detail.setCancelCountdown(cancelAt.getTime() - nowDate.getTime());
        return R.ok(detail);
    }
    @Override
@@ -83,8 +89,12 @@
                    money = BigDecimal.valueOf(0.01);
                }
                // 调用wx支付
                String result= WxPayUtils.h5pay(appid, mchId, payKey, notifyUrl, "点亮支付", mcsOrderVO.getOpenId(),
                String result = WxPayUtils.h5pay(appid, mchId, payKey, notifyUrl, "点亮支付", mcsOrderVO.getOpenId(),
                        mcsOrder.getOrderNo(), money,mcsOrderVO.getTradeType());
                if (mcsOrderVO.getTradeType().equals("NATIVE")) {
                    JSONObject jsonObjectResult = JSONObject.parseObject(result);
                    result = QRCodeUtil.getBase64QRCode(jsonObjectResult.get("codeUrl").toString());
                }
                return R.ok(result);
            } catch (Exception e) {
                log.error("调用微信支付异常,异常原因:" + e.getMessage());
@@ -110,7 +120,7 @@
    @Transactional
    public R notify(McsOrderVO mcsOrderVO) {
        McsOrder mcsOrderBase=this.baseMapper.selectOne(new QueryWrapper<McsOrder>().lambda().eq(McsOrder::getOrderNo,mcsOrderVO.getOrderNo()));
        mcsOrderBase.setStatus(2);
        mcsOrderBase.setStatus(1);
        mcsOrderBase.setPayNo(mcsOrderVO.getPayNo());
        mcsOrderBase.setPayTime(mcsOrderVO.getPayTime());
        int i=this.baseMapper.updateById(mcsOrderBase);
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsProductServiceImpl.java
@@ -5,6 +5,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
@@ -15,6 +16,7 @@
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.DeleteProductDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.McsProductDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.PageMcsProductDTO;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.SetShelfForProductDTO;
@@ -123,23 +125,20 @@
    /**
     * 删除产品信息
     * @param productId
     * @param userId
     * @param deleteProductDTO
     * @return
     */
    @Override
    public R deleteMcsProduct(Long productId, Long userId) {
        McsProduct mcsProduct = this.baseMapper.selectById(productId);
        if (isNull(mcsProduct)) {
            return R.fail("资源不存在");
    public R deleteMcsProduct(DeleteProductDTO deleteProductDTO) {
        List<McsProduct> mcsProducts = this.baseMapper.selectBatchIds(deleteProductDTO.getProductIds());
        if (nonNull(mcsProducts) && !mcsProducts.isEmpty()) {
            mcsProducts.forEach(e -> {
                e.setIsDel(true);
                e.setUpdatedBy(deleteProductDTO.getUpdatedBy());
            });
            this.updateBatchById(mcsProducts);
        }
        mcsProduct.setIsDel(true);
        mcsProduct.setUpdatedBy(userId);
        int num = this.baseMapper.updateById(mcsProduct);
        if (num > 0) {
            return R.ok();
        }
        return R.fail("删除失败,请重新尝试");
        return R.ok();
    }
    /**
@@ -185,4 +184,26 @@
        IPage<McsProductVO> mcsProduct = this.baseMapper.pageMcsProduct(page, pageMcsProductDTO);
        return R.ok(mcsProduct);
    }
    /**
     * 获取产品信息详情
     * @param productId
     * @return
     */
    @Override
    public R getMcsProduct(Long productId) {
        McsProduct mcsProduct = this.baseMapper.selectById(productId);
        if (isNull(mcsProduct)) {
            return R.fail("资源不存在");
        }
        McsProductVO mcsProductVO = new McsProductVO();
        BeanUtils.copyProperties(mcsProduct, mcsProductVO);
        List<McsProductLabel> mcsProductLabelList = mcsProductLabelDAO.selectList(new QueryWrapper<McsProductLabel>().lambda()
                .eq(McsProductLabel::getProductId, productId));
        if (nonNull(mcsProductLabelList) && !mcsProductLabelList.isEmpty()) {
            List<Long> labelIds = mcsProductLabelList.stream().map(McsProductLabel::getLabelId).collect(Collectors.toList());
            mcsProductVO.setLabelIds(labelIds);
        }
        return R.ok(mcsProductVO);
    }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsCouponMapper.xml
@@ -55,7 +55,7 @@
    </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
        SELECT t1.*, t2.type, t2.`name`, t2.expire_at, t2.cover, t2.id AS gameId, IF(t3.id IS NULL,2,1) AS isEvaluate, t3.id AS evaluateId
        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
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsEvaluateMapper.xml
@@ -34,7 +34,7 @@
    </insert>
    <select id="pageMcsEvaluate"
            resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsEvaluateVO">
        SELECT t1.id, t1.star, t1.content, t1.photos, t1.created_at, t3.nick_name, t3.phone, t2.`name` AS gameName
        SELECT t1.id, t1.star, t1.content, t1.photos, t1.created_at, t3.`name` AS nickName, t3.phone, t3.image_url, t2.`name` AS gameName
        FROM mcs_evaluate t1
        LEFT JOIN mcs_game t2 ON t1.game_id = t2.id
        LEFT JOIN sys_user t3 ON t1.user_id = t3.user_id
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsGameMapper.xml
@@ -66,13 +66,22 @@
        created_at = values(created_at) , created_by = values(created_by) , updated_at = values(updated_at) , updated_by
        = values(updated_by)
    </insert>
    <update id="setOffByMerchantIds">
        UPDATE mcs_game SET `status` = 3 WHERE merchant_id IN
        <foreach collection="needDealIds" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
    </update>
    <select id="pageMcsGame"
            resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsGameVO">
        (SELECT t1.id, t1.`name`, t1.`type`, t1.coupons, t1.surplus_coupons,
        t1.publish_at, t1.`status`, t1.merchant_id, t2.`name` AS merchantName
        t1.publish_at, t1.`status`, t1.merchant_id, t2.`name` AS merchantName, t1.is_popular, t1.cover
        FROM mcs_game t1
        LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id
        WHERE t1.is_del = 0 AND t1.`status` = 2
        <if test="pageMcsGameDTO.userId != null">
            AND t2.user_id = #{pageMcsGameDTO.userId}
        </if>
        <if test="pageMcsGameDTO.type != null">
            AND t1.`type` = #{pageMcsGameDTO.type}
        </if>
@@ -85,10 +94,13 @@
        ORDER BY t1.created_at DESC)
        UNION ALL
        (SELECT t1.id, t1.`name`, t1.`type`, t1.coupons, t1.surplus_coupons,
        t1.publish_at, t1.`status`, t1.merchant_id, t2.`name` AS merchantName
        t1.publish_at, t1.`status`, t1.merchant_id, t2.`name` AS merchantName, t1.is_popular, t1.cover
        FROM mcs_game t1
        LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id
        WHERE t1.is_del = 0  AND t1.`status` != 2
        <if test="pageMcsGameDTO.userId != null">
            AND t2.user_id = #{pageMcsGameDTO.userId}
        </if>
        <if test="pageMcsGameDTO.type != null">
            AND t1.`type` = #{pageMcsGameDTO.type}
        </if>
@@ -103,9 +115,9 @@
    <select id="selectPublishCount" resultType="java.lang.Integer">
        SELECT SUM(publishCount) AS publishCount FROM
        (
            SELECT COUNT(1) AS publishCount FROM mcs_game WHERE merchant_id = 2 AND `status` = 2 AND is_del = 0
            SELECT COUNT(1) AS publishCount FROM mcs_game WHERE merchant_id = #{merchantId} AND `status` = 2 AND is_del = 0
            UNION ALL
            SELECT COUNT(1) AS publishCount FROM mcs_information WHERE merchant_id = 2 AND `status` = 2 AND is_del = 0
            SELECT COUNT(1) AS publishCount FROM mcs_information WHERE merchant_id = #{merchantId} AND `status` = 2 AND is_del = 0
        ) temp
    </select>
    <select id="selectAppliedCount" resultType="java.lang.Integer">
@@ -130,7 +142,7 @@
    <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
        t1.publish_at, t1.`status`, t1.merchant_id, t1.lat, t1.lon, 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
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsInformationMapper.xml
@@ -47,6 +47,12 @@
        values(is_del) , merchant_id = values(merchant_id) , created_at = values(created_at) , created_by =
        values(created_by) , updated_at = values(updated_at) , updated_by = values(updated_by)
    </insert>
    <update id="setOffByMerchantIds">
        UPDATE mcs_information SET `status` = 3 WHERE merchant_id IN
        <foreach collection="needDealIds" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
    </update>
    <select id="pageMcsInfo"
            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
@@ -66,7 +72,7 @@
    </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
        SELECT t1.id, t1.`name`, t1.publish_at, t1.`status`, t1.merchant_id, t1.lat, t1.lon, t1.cover, 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
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsMerchantMapper.xml
@@ -12,6 +12,7 @@
        <result property="level" column="level" jdbcType="INTEGER"/>
        <result property="publishLimit" column="publish_limit" jdbcType="INTEGER"/>
        <result property="expireAt" column="expire_at" jdbcType="TIMESTAMP"/>
        <result property="isPause" column="is_pause" jdbcType="VARCHAR"/>
        <result property="firstLitAt" column="first_lit_at" jdbcType="TIMESTAMP"/>
        <result property="address" column="address" jdbcType="VARCHAR"/>
        <result property="lat" column="lat" jdbcType="VARCHAR"/>
@@ -54,6 +55,12 @@
        is_del = values(is_del) , created_at = values(created_at) , created_by = values(created_by) , updated_at =
        values(updated_at) , updated_by = values(updated_by)
    </insert>
    <update id="updateIsPauseStatus">
        UPDATE mcs_merchant SET is_pause = 1 WHERE id IN
        <foreach collection="needDealIds" index="index" item="item" open="(" separator="," close=")">
            #{item}
        </foreach>
    </update>
    <select id="getMcsMerchantById"
            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,
@@ -122,7 +129,7 @@
        <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
        WHERE t1.is_del = 0 AND t1.expire_at &gt; NOW() AND t2.`status` = 1
        <if test="pageMcsMerchantDTO.type != null">
            AND t3.id IS NOT NULL
        </if>
@@ -141,6 +148,9 @@
        </if>
        ORDER BY distance ASC
    </select>
    <select id="selectNeedDealExpiredMerchant" resultType="java.lang.Long">
        SELECT id FROM mcs_merchant WHERE expire_at &lt;= NOW() AND is_pause = 0
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsVerifiedRecordMapper.xml
@@ -8,6 +8,8 @@
        <result property="merchantId" column="merchant_id" jdbcType="INTEGER"/>
        <result property="name" column="name" jdbcType="VARCHAR"/>
        <result property="award" column="award" jdbcType="VARCHAR"/>
        <result property="gameId" column="game_id" jdbcType="INTEGER"/>
        <result property="nickName" column="nick_name" jdbcType="VARCHAR"/>
        <result property="verifiedAt" column="verified_at" jdbcType="TIMESTAMP"/>
    </resultMap>
@@ -31,9 +33,26 @@
    </insert>
    <select id="pageMcsVerifyRecord"
            resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsVerifyRecordVO">
        SELECT t1.* FROM mcs_verified_record t1
        SELECT t1.*, t3.`type`
        FROM mcs_verified_record t1
        LEFT JOIN mcs_merchant t2 ON t1.merchant_id = t2.id
        LEFT JOIN mcs_game t3 ON t1.game_id = t3.id
        WHERE t2.user_id = #{pageVerifyRecordDTO.userId}
        <if test="pageVerifyRecordDTO.type != null">
            AND t3.`type` = #{pageVerifyRecordDTO.type}
        </if>
        <if test="pageVerifyRecordDTO.verifiedBegin != null">
            AND t1.verified_at &gt;= #{pageVerifyRecordDTO.verifiedBegin}
        </if>
        <if test="pageVerifyRecordDTO.verifiedEnd != null">
            AND t1.verified_at &lt;= #{pageVerifyRecordDTO.verifiedEnd}
        </if>
        <if test="pageVerifyRecordDTO.keyword != null and pageVerifyRecordDTO.keyword != &quot;&quot;">
            AND (t1.nick_name LIKE CONCAT(#{pageVerifyRecordDTO.keyword}, '%')
            OR t1.coupon_id LIKE CONCAT(#{pageVerifyRecordDTO.keyword}, '%')
            OR t1.`name` LIKE CONCAT(#{pageVerifyRecordDTO.keyword}, '%')
            )
        </if>
    </select>
</mapper>
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/aop/CheckExpirationInterceptor.java
New file
@@ -0,0 +1,76 @@
package com.panzhihua.shop_backstage.aop;
import static java.util.Objects.nonNull;
import java.util.Date;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.reflect.MethodSignature;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import com.alibaba.fastjson.JSONObject;
import com.panzhihua.common.constants.Constants;
import com.panzhihua.common.constants.TokenConstant;
import com.panzhihua.common.exceptions.ServiceException;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.microCommercialStreet.McsMerchantVO;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.utlis.AES;
import lombok.extern.slf4j.Slf4j;
/**
 * @title: CheckExpirationInterceptor
 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目
 * @description: 过期检测拦截器
 * @author: hans
 * @date: 2022/01/11 10:36
 */
@Aspect
@Component
@Slf4j
public class CheckExpirationInterceptor {
    @Resource
    private CommunityService communityService;
    @Before("@annotation(com.panzhihua.shop_backstage.aop.CheckMcsMerchantExpiration)")
    public void checkExpiration(JoinPoint joinPoint) {
        MethodSignature signature = (MethodSignature) joinPoint.getSignature();
        log.info("拦截方法:【{}】", signature.getMethod().getName());
        // 获取RequestAttributes
        RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
        // 从获取RequestAttributes中获取HttpServletRequest的信息
        HttpServletRequest request = (HttpServletRequest)requestAttributes.resolveReference(RequestAttributes.REFERENCE_REQUEST);
        // 登录对象信息
        String userInfo = request.getHeader(TokenConstant.TOKEN_USERINFO);
        boolean empty = ObjectUtils.isEmpty(userInfo);
        if (empty) {
            log.error("获取登录用户信息失败【{}】", joinPoint);
            throw new ServiceException("获取登录用户信息失败");
        }
        byte[] bytes = AES.parseHexStr2Byte(userInfo);
        byte[] decrypt = AES.decrypt(bytes, Constants.AES_KEY);
        userInfo = new String(decrypt);
        LoginUserInfoVO loginUserInfoVO = JSONObject.parseObject(userInfo, LoginUserInfoVO.class);
        R retrieveResult = communityService.retrieveMcsMerchantInfoByUserId(loginUserInfoVO.getUserId());
        if (R.isOk(retrieveResult) && nonNull(retrieveResult.getData())) {
            McsMerchantVO mcsMerchantVO = JSONObject.parseObject(JSONObject.toJSONString(retrieveResult.getData()), McsMerchantVO.class);
            Date expireAt = mcsMerchantVO.getExpireAt();
            if (expireAt.before(new Date())) {
                throw new ServiceException("账户已过期,请及时续费");
            }
        } else {
            throw new ServiceException("未查询到商户信息");
        }
    }
}
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/aop/CheckMcsMerchantExpiration.java
New file
@@ -0,0 +1,21 @@
package com.panzhihua.shop_backstage.aop;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
 * @title: CheckMcsMerchantExpiration
 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目
 * @description: 微商业街商家是否到期统一检测
 * @author: hans
 * @date: 2022/01/11 10:28
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface CheckMcsMerchantExpiration {
}
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/McsOrderApi.java
@@ -1,27 +1,34 @@
package com.panzhihua.shop_backstage.api;
import java.io.IOException;
import java.io.PrintWriter;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.json.XML;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
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.JSON;
import com.alibaba.fastjson.JSONObject;
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.model.dtos.property.CommonPage;
import com.panzhihua.common.model.dtos.shop.WxPayNotifyOrderDTO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO;
import com.panzhihua.common.service.community.CommunityService;
import com.panzhihua.common.utlis.DateUtils;
import com.panzhihua.common.utlis.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.json.XML;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
/**
 * 商业街订单表(McsOrder)表控制层
@@ -48,6 +55,7 @@
    @ApiOperation(value = "分页查询订单",response = McsOrderVO.class)
    @PostMapping("queryAll")
    public R selectAll(@RequestBody CommonPage commonPage) {
        commonPage.setUserId(this.getUserId());
        return communityService.selectAllMscOrder(commonPage);
    }
@@ -140,7 +148,7 @@
                    mcsOrderVO.setPayNo(wxTradeNo);
                    // 支付完成时间
                    String payTime = resultData.getString("time_end");
                    mcsOrderVO.setPayTime(DateUtils.stringToDate(payTime,DateUtils.ymdhms_format));
                    mcsOrderVO.setPayTime(DateUtils.stringToDate(payTime,DateUtils.format_yyyyMMddHHmmss));
                    // 现金支付金额
                    mcsOrderVO.setStatus(1);
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/MicroCommercialStreetApi.java
@@ -3,6 +3,7 @@
import javax.annotation.Resource;
import javax.validation.Valid;
import com.panzhihua.common.model.dtos.community.microCommercialStreet.DeleteProductDTO;
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;
@@ -10,7 +11,9 @@
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.TopStatisticsVO;
import com.panzhihua.common.model.vos.community.microCommercialStreet.VerifiedReturnVO;
import com.panzhihua.shop_backstage.aop.CheckMcsMerchantExpiration;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
@@ -64,6 +67,10 @@
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
import static java.util.Objects.nonNull;
/**
 * @title: MicroCommercialStreetApi
@@ -147,7 +154,7 @@
        }
    }
    @ApiOperation(value = "当前登录用户信息", response = LoginMerchantUserInfoVO.class)
    @ApiOperation(value = "当前登录用户信息", response = McsLoginUserInfoVO.class)
    @GetMapping("/userInfo")
    public R detailUser() {
        Long userId = this.getUserId();
@@ -195,6 +202,7 @@
    }
    @ApiOperation(value = "发布戳戳游戏")
    @CheckMcsMerchantExpiration
    @ApiImplicitParam(name = "gameId", value = "游戏id", required = true)
    @GetMapping("/game/publish")
    public R publishMcsGame(@RequestParam("gameId") Long gameId) {
@@ -208,7 +216,7 @@
        return communityService.finishMcsGame(gameId, this.getUserId());
    }
    @ApiOperation(value = "分页查询戳戳游戏", response = McsGameVO.class)
    @ApiOperation(value = "商家分页查询戳戳游戏", response = McsGameVO.class)
    @PostMapping("/game/page")
    public R pageMcsGame(@RequestBody @Valid PageMcsGameDTO pageMcsGameDTO) {
        pageMcsGameDTO.setUserId(this.getUserId());
@@ -216,6 +224,7 @@
    }
    @ApiOperation(value = "上架/下架戳戳游戏")
    @CheckMcsMerchantExpiration
    @PutMapping("/game/setShelf")
    public R setShelfForGame(@RequestBody @Valid SetShelfForGameDTO setShelfForGameDTO) {
        setShelfForGameDTO.setUpdatedBy(this.getUserId());
@@ -229,7 +238,7 @@
        return communityService.deleteMcsGame(gameId, this.getUserId());
    }
    @ApiOperation(value = "戳戳游戏/资讯顶部统计数据")
    @ApiOperation(value = "戳戳游戏/资讯顶部统计数据", response = TopStatisticsVO.class)
    @ApiImplicitParam(name = "type", value = "类型(1.戳戳游戏 2.戳戳资讯)", required = true)
    @GetMapping("/statistics/top")
    public R getTopStatistics(@RequestParam("type") Integer type) {
@@ -254,12 +263,13 @@
    @ApiOperation(value = "发布戳戳资讯")
    @ApiImplicitParam(name = "infoId", value = "资讯id", required = true)
    @CheckMcsMerchantExpiration
    @GetMapping("/information/publish")
    public R publishMcsInfo(@RequestParam("infoId") Long infoId) {
        return communityService.publishMcsInfo(infoId, this.getUserId());
    }
    @ApiOperation(value = "分页查询戳戳资讯", response = McsInformationVO.class)
    @ApiOperation(value = "商家分页查询戳戳资讯", response = McsInformationVO.class)
    @PostMapping("/information/page")
    public R pageMcsInfo(@RequestBody @Valid PageMcsInformationDTO pageMcsInformationDTO) {
        pageMcsInformationDTO.setUserId(this.getUserId());
@@ -267,6 +277,7 @@
    }
    @ApiOperation(value = "上架/下架戳戳资讯")
    @CheckMcsMerchantExpiration
    @PutMapping("/information/setShelf")
    public R setShelfForMcsInfo(@RequestBody @Valid SetShelfForInfoDTO setShelfForInfoDTO) {
        setShelfForInfoDTO.setUpdatedBy(this.getUserId());
@@ -311,13 +322,21 @@
    }
    @ApiOperation(value = "删除产品信息")
    @PostMapping("/product/delete")
    public R deleteMcsProduct(@RequestBody @Valid DeleteProductDTO deleteProductDTO) {
        deleteProductDTO.setUpdatedBy(this.getUserId());
        return communityService.deleteMcsProduct(deleteProductDTO);
    }
    @ApiOperation(value = "获取产品信息详情")
    @ApiImplicitParam(name = "productId", value = "产品id", required = true)
    @DeleteMapping("/product/delete")
    public R deleteMcsProduct(@RequestParam("productId") Long productId) {
        return communityService.deleteMcsProduct(productId, this.getUserId());
    @GetMapping("/product/get")
    public R getMcsProduct(@RequestParam("productId") Long productId) {
        return communityService.getMcsProduct(productId);
    }
    @ApiOperation(value = "上架/下架产品信息")
    @CheckMcsMerchantExpiration
    @PutMapping("/product/setShelf")
    public R setShelfForMcsProduct(@RequestBody @Valid SetShelfForProductDTO setShelfForProductDTO) {
        setShelfForProductDTO.setUpdatedBy(this.getUserId());
@@ -347,7 +366,12 @@
    @ApiImplicitParam(name = "gameId", value = "戳戳游戏id", required = true)
    @GetMapping("/coupon/apply")
    public R applyMcsCoupon(@RequestParam("gameId") Long gameId) {
        return communityService.applyMcsCoupon(gameId, this.getUserId());
        Long userId = this.getUserId();
        R r = communityService.retrieveMcsMerchantInfoByUserId(userId);
        if (R.isOk(r) && nonNull(r.getData())) {
            return R.fail("商家不能参与活动");
        }
        return communityService.applyMcsCoupon(gameId, userId);
    }
    @ApiOperation(value = "h5分页查询戳戳资讯", response = McsInformationVO.class)
@@ -391,7 +415,7 @@
        return communityService.getMyCoupon(type, this.getUserId());
    }
    @ApiOperation(value = "我的评价-参与游戏列表", response = MyCouponVO.class)
    @ApiOperation(value = "我的评价-参与游戏列表", response = McsCouponVO.class)
    @PostMapping("/joinGame/page")
    public R getJoinGameList(@RequestBody @Valid PageJoinGameListDTO pageJoinGameListDTO) {
        pageJoinGameListDTO.setUserId(this.getUserId());
@@ -415,13 +439,14 @@
    @ApiImplicitParams({
            @ApiImplicitParam(name = "couponId", value = "戳戳卷id", required = true)
    })
    @CheckMcsMerchantExpiration
    @GetMapping("/coupon/verify")
    public R verifyMcsCoupon(@RequestParam("couponId") Long couponId) {
        return communityService.verifyMcsCoupon(couponId);
        return communityService.verifyMcsCoupon(couponId, this.getUserId());
    }
    @ApiOperation(value = "分页查询核销记录", response = McsVerifyRecordVO.class)
    @GetMapping("/verifyRecord/page")
    @PostMapping("/verifyRecord/page")
    public R pageMcsVerifyRecord(@RequestBody @Valid PageVerifyRecordDTO pageVerifyRecordDTO) {
        pageVerifyRecordDTO.setUserId(this.getUserId());
        return communityService.pageMcsVerifyRecord(pageVerifyRecordDTO);
@@ -454,4 +479,10 @@
    public R deleteMcsEvaluate(@RequestParam("evaluateId") Long evaluateId) {
        return communityService.deleteMcsEvaluate(evaluateId);
    }
    @ApiOperation(value = "testTimeJob")
    @GetMapping("/testTimeJob")
    public R testTimeJob() {
        return communityService.offResourceForMcsMerchant();
    }
}
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/filter/StoreValidFilter.java
@@ -53,11 +53,12 @@
        boolean convenientLogin = "/convenient/login".equals(uri);
        boolean mcsLogin = "/microcommercialstreet/login".equals(uri) || "/microcommercialstreet/loginWithPhone".equals(uri);
        boolean mcsGetCode = uri.contains("/microcommercialstreet/verifyCode");
        boolean wxNotify = uri.contains("/wxNotify");
        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 || mcsGetCode) {
        if (isDoc || isUpload || storeLogin || convenientLogin || mcsLogin || mcsMerchantLogin || mcsGetCode || wxNotify) {
            //放过swagger请求
        } else {
            String userInfo = request.getHeader(TokenConstant.TOKEN_USERINFO);
springcloud_k8s_panzhihuazhihuishequ/timejob/src/main/java/com/panzhihua/timejob/jobhandler/CommunityJobHandler.java
@@ -274,4 +274,17 @@
        log.info("执行结果【{}】", r.toString());
        return ReturnT.SUCCESS;
    }
    /**
     * 定时任务-每隔5分钟执行一次,将已到期的微商业街商家旗下所有的游戏/资讯全部下架
     * @param param
     * @return
     */
    @XxlJob("offResourceForMcsMerchantJobHandler")
    public ReturnT<String> offResourceForMcsMerchantJobHandler(String param) {
        log.info("定时任务将已到期的微商业街商家旗下所有的游戏/资讯全部下架");
        R r = communityService.offResourceForMcsMerchant();
        log.info("执行结果【{}】", r.toString());
        return ReturnT.SUCCESS;
    }
}
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/JWTAuthenticationTokenFilter.java
@@ -279,6 +279,7 @@
                noLoginUrl.add("/api/communitybackstage/screen/comprehensive/pagedynamic");
                noLoginUrl.add("/api/communitybackstage/screen/get/community/password");
                noLoginUrl.add("/api/shopbackstage/microcommercialstreet/verifyCode");
                noLoginUrl.add("/api/shopbackstage/mcsOrder/wxNotify");
                if (noLoginUrl.contains(requestURI)) {
                    List<SimpleGrantedAuthority> authorities = new ArrayList<>();
                    authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS));