puhanshu
2022-01-14 51ee3c4db2eb49062d3236bf44f95dc22f8f6ac9
商业街bug修改
13个文件已修改
78 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsCouponVO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | 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/utlis/DateUtils.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/McsOrder.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsGameServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsInformationServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsMerchantServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsOrderServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsCouponMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsOrderMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/McsOrderApi.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/filter/StoreValidFilter.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/JWTAuthenticationTokenFilter.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsCouponVO.java
@@ -55,4 +55,10 @@
    @ApiModelProperty("游戏封面")
    private String cover;
    @ApiModelProperty("奖励类型(1.免费产品 2.免费服务)")
    private Integer awardType;
    @ApiModelProperty("戳戳币分配方式(1.随机分配 2.平均分配)")
    private Integer allocation;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/microCommercialStreet/McsOrderVO.java
@@ -93,6 +93,9 @@
    @ApiModelProperty("订单取消剩余倒计时")
    private Long cancelCountdown;
    @ApiModelProperty("支付方式")
    private String paymentMethod;
    @ApiModelProperty(value = "用户真实ip", hidden = true)
    private String clientIp;
}
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/DateUtils.java
@@ -819,6 +819,26 @@
    }
    /**
     * 计算剩余天数,不足一天按一天算
     * @param expireDate
     * @return
     */
    public static int retrieveRemainingDays(Date expireDate) {
        Date nowDate = new Date();
        Calendar startDate = Calendar.getInstance();
        startDate.setTime(nowDate);
        Calendar endDate = Calendar.getInstance();
        endDate.setTime(expireDate);
        Calendar date = (Calendar) startDate.clone();
        int daysBetween = 0;
        while (date.before(endDate)) {
            date.add(Calendar.DAY_OF_MONTH, 1);
            daysBetween++;
        }
        return daysBetween;
    }
    /**
     * 获取当前月第一天
     * 
     * @return
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/entity/McsOrder.java
@@ -91,4 +91,6 @@
    private Date createTime;
    private String merchantName;
    private String paymentMethod;
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsGameServiceImpl.java
@@ -330,7 +330,7 @@
        TopStatisticsVO topStatisticsVO = new TopStatisticsVO();
        topStatisticsVO.setExpireAt(mcsMerchant.getExpireAt());
        if (nonNull(mcsMerchant.getExpireAt())) {
            int surplusLitDays = DateUtils.differentDays(new Date(), mcsMerchant.getExpireAt());
            int surplusLitDays = DateUtils.retrieveRemainingDays(mcsMerchant.getExpireAt());
            topStatisticsVO.setSurplusLitDays(surplusLitDays > 0 ? surplusLitDays : 0);
        }
        Integer appliedCount = this.baseMapper.selectAppliedCount(mcsMerchant.getId());
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsInformationServiceImpl.java
@@ -132,7 +132,7 @@
        TopStatisticsVO topStatisticsVO = new TopStatisticsVO();
        topStatisticsVO.setExpireAt(mcsMerchant.getExpireAt());
        if (nonNull(mcsMerchant.getExpireAt())) {
            int surplusLitDays = DateUtils.differentDays(new Date(), mcsMerchant.getExpireAt());
            int surplusLitDays = DateUtils.retrieveRemainingDays(mcsMerchant.getExpireAt());
            topStatisticsVO.setSurplusLitDays(surplusLitDays > 0 ? surplusLitDays : 0);
        }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsMerchantServiceImpl.java
@@ -6,6 +6,7 @@
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Random;
@@ -441,7 +442,7 @@
        Integer idleTotal = publishLimit - publishCount;
        merchantVO.setIdleTotal(idleTotal > 0 ? idleTotal : 0);
        if (nonNull(merchantVO.getExpireAt())) {
            int surplusLitDays = DateUtils.differentDays(new Date(), merchantVO.getExpireAt());
            int surplusLitDays = DateUtils.retrieveRemainingDays(merchantVO.getExpireAt());
            merchantVO.setSurplusLitDays(surplusLitDays > 0 ? surplusLitDays : 0);
        }
    }
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/McsOrderServiceImpl.java
@@ -11,6 +11,8 @@
import com.panzhihua.common.utlis.SmsUtil;
import com.panzhihua.common.utlis.StringUtils;
import com.panzhihua.common.utlis.WxPayUtils;
import com.panzhihua.service_community.dao.McsMerchantDAO;
import com.panzhihua.service_community.entity.McsMerchant;
import com.panzhihua.service_community.entity.McsOrder;
import com.panzhihua.service_community.dao.McsOrderDao;
import com.panzhihua.service_community.service.McsMerchantService;
@@ -52,6 +54,8 @@
    private RabbitTemplate rabbitTemplate;
    @Resource
    private McsMerchantService mcsMerchantService;
    @Resource
    private McsMerchantDAO mcsMerchantDAO;
    private static String H5_LOGIN_APPID="wx475fcd33c8030df8";
    @Override
@@ -61,8 +65,17 @@
    @Override
    public R insert(McsOrderVO mcsOrderVO) {
        McsMerchant mcsMerchant = mcsMerchantDAO.selectOne(new QueryWrapper<McsMerchant>().lambda()
                .eq(McsMerchant::getUserId, mcsOrderVO.getUserId()));
        McsOrder mcsOrder=new McsOrder();
        BeanUtils.copyProperties(mcsOrderVO,mcsOrder);
        if (nonNull(mcsMerchant)) {
            if (mcsMerchant.getIsDel()) {
                mcsMerchantDAO.deleteById(mcsMerchant.getId());
            } else {
                mcsOrder.setMerchantId(mcsMerchant.getId());
            }
        }
        mcsOrder.setStatus(0);
        mcsOrder.setCreateTime(new Date());
        mcsOrder.setOrderNo(DateUtils.getCurrentDateStrNoSignal());
@@ -131,6 +144,7 @@
        mcsOrderBase.setStatus(1);
        mcsOrderBase.setPayNo(mcsOrderVO.getPayNo());
        mcsOrderBase.setPayTime(mcsOrderVO.getPayTime());
        mcsOrderBase.setPaymentMethod("微信支付");
        int i=this.baseMapper.updateById(mcsOrderBase);
        if(i>0){
            R r = mcsMerchantService.updateOrAddMcsMerchantAfterOrder(mcsOrderBase.getMerchantName(), mcsOrderBase.getConfigId(), mcsOrderBase.getUserId());
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/McsCouponMapper.xml
@@ -55,7 +55,8 @@
    </select>
    <select id="pageJoinGameList"
            resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsCouponVO">
        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
        SELECT t1.*, t2.type, t2.`name`, t2.expire_at, t2.cover, t2.id AS gameId, t2.award_type, t2.allocation,
        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/McsOrderMapper.xml
@@ -13,6 +13,7 @@
        <result property="merchantId" column="merchant_id"/>
        <result property="payNo" column="pay_no"/>
        <result property="userId" column="user_id"/>
        <result property="paymentMethod" column="payment_method"/>
    </resultMap>
    <select id="pageList" resultType="com.panzhihua.common.model.vos.community.microCommercialStreet.McsOrderVO">
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/api/McsOrderApi.java
@@ -80,6 +80,7 @@
    @ApiOperation("新增数据")
    @PostMapping
    public R insert(@RequestBody McsOrderVO mcsOrderVO) {
        mcsOrderVO.setUserId(this.getUserId());
        return communityService.insertMscOrder(mcsOrderVO);
    }
springcloud_k8s_panzhihuazhihuishequ/shop_backstage/src/main/java/com/panzhihua/shop_backstage/filter/StoreValidFilter.java
@@ -1,6 +1,8 @@
package com.panzhihua.shop_backstage.filter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Resource;
import javax.servlet.Filter;
@@ -57,7 +59,17 @@
        boolean getConfig = uri.contains("/config/all");
        boolean isUpload = "/convenient/upload/file".equals(uri);
        if (isDoc || isUpload || isLogin || mcsGetCode || wxNotify || mcsBindPhone || getConfig) {
        List<String> noLoginUrl = new ArrayList<>();
        noLoginUrl.add("/api/shopbackstage/microcommercialstreet/merchant/get");
        noLoginUrl.add("/api/shopbackstage/microcommercialstreet/index/topData");
        noLoginUrl.add("/api/shopbackstage/microcommercialstreet/information/pageH5");
        noLoginUrl.add("/api/shopbackstage/microcommercialstreet/game/pageH5");
        noLoginUrl.add("/api/shopbackstage/microcommercialstreet/game/get");
        noLoginUrl.add("/api/shopbackstage/microcommercialstreet/info/get");
        noLoginUrl.add("/api/shopbackstage/microcommercialstreet/merchant/pageH5");
        if (isDoc || isUpload || isLogin || mcsGetCode || wxNotify || mcsBindPhone || getConfig || noLoginUrl.contains(uri)) {
            //放过swagger请求
        } else {
            String userInfo = request.getHeader(TokenConstant.TOKEN_USERINFO);
springcloud_k8s_panzhihuazhihuishequ/zuul/src/main/java/com/panzhihua/zuul/filters/JWTAuthenticationTokenFilter.java
@@ -283,6 +283,13 @@
                noLoginUrl.add("/api/shopbackstage/microcommercialstreet/bindPhone");
                noLoginUrl.add("/api/shopbackstage/microcommercialstreet/bind/verifyCode");
                noLoginUrl.add("/api/shopbackstage/microcommercialstreet/config/all");
                noLoginUrl.add("/api/shopbackstage/microcommercialstreet/merchant/get");
                noLoginUrl.add("/api/shopbackstage/microcommercialstreet/index/topData");
                noLoginUrl.add("/api/shopbackstage/microcommercialstreet/information/pageH5");
                noLoginUrl.add("/api/shopbackstage/microcommercialstreet/game/pageH5");
                noLoginUrl.add("/api/shopbackstage/microcommercialstreet/game/get");
                noLoginUrl.add("/api/shopbackstage/microcommercialstreet/info/get");
                noLoginUrl.add("/api/shopbackstage/microcommercialstreet/merchant/pageH5");
                if (noLoginUrl.contains(requestURI)) {
                    List<SimpleGrantedAuthority> authorities = new ArrayList<>();
                    authorities.add(new SimpleGrantedAuthority(SecurityConstants.ROLE_APPLETS));