admin
2019-12-03 8d38972b593b5ba698b0e605039ed8c795eaaef5
Merge remote-tracking branch 'origin/div' into div
6个文件已修改
103 ■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandInfoServiceImpl.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinNewbiesServiceImpl.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/user/UserVipRateVO.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java
@@ -360,12 +360,19 @@
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(1, "该用户不存在"));
            return;
        }
        //
        String inviteCode = "";
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        if (userInfoExtra != null && !StringUtil.isNullOrEmpty(userInfoExtra.getInviteCode()))
            inviteCode = userInfoExtra.getInviteCode();
        UserVipRateVO vo = new UserVipRateVO();
        vo.setId(uid);
        vo.setInviteCode(inviteCode);
        vo.setNickName(userInfo.getNickName());
        vo.setPortrait(userInfo.getPortrait());
        vo.setHelpLink(userVipConfigService.getValueByKey("help_link_vip_h5"));
        vo.setCsdLink(configService.get("customer_service_link"));
    
        // 省钱 -自购产生返利   
        BigDecimal finishMoney = hongBaoV2CountService.getRewardMoneyBySelf(uid);
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserOrderControllerV2.java
@@ -146,7 +146,7 @@
                if (postSaleMoney != null) 
                    invalidMoney = postSaleMoney.setScale(2, BigDecimal.ROUND_DOWN).toString();
                
                if (dateType == 4)
                if (dateType != null && dateType == 4)
                    dateType = 5; // 新版查询本月到账
            }
                        
fanli/src/main/java/com/yeshi/fanli/mapping/order/CommonOrderMapper.xml
@@ -413,12 +413,6 @@
        <if test="type != null and type == 3"> <!-- 邀请订单 -->
            AND (v2.`hb_type` = 5 OR v2.`hb_type` = 6 OR v2.`hb_type` = 7 OR v2.`hb_type` = 21 OR v2.`hb_type` = 22)
        </if>
        <if test="type == 2 and day == 5"> <!-- 本月月将要到账 -->
            AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), DATE_FORMAT(v2.`hb_pre_get_time`, '%Y%m')) = 1
        </if>
        <if test="type == 3 and day == 5"> <!-- 本月将要到账 -->
            AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), DATE_FORMAT(v2.`hb_pre_get_time`, '%Y%m')) = 1
        </if>
    </sql>
    <sql id="SELECT_PARAM_HONGBAO_STATE">
        <if test="state != null and state == 1">
@@ -449,6 +443,14 @@
        <include refid="Hongbao_Column_List" />
        FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<> 10 ]]>
        <include refid="SELECT_PARAM_HONGBAO_TYPE" />
        <if test="type == 2 and day == 5"> <!-- 本月月将要到账 -->
            AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), DATE_FORMAT(v2.`hb_pre_get_time`, '%Y%m')) = 1
        </if>
        <if test="type == 3 and day == 5"> <!-- 本月将要到账 -->
            AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), DATE_FORMAT(v2.`hb_pre_get_time`, '%Y%m')) = 1
        </if>
        <!-- 红包类型 -->
        )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id`
        LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
@@ -473,8 +475,14 @@
        yeshi_ec_hongbao_order ho LEFT JOIN (SELECT
        <include refid="Hongbao_Column_List" />
        FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<> 10 ]]>
        <include refid="SELECT_PARAM_HONGBAO_TYPE" />
        <!-- 红包类型 -->
        <include refid="SELECT_PARAM_HONGBAO_TYPE" /> <!-- 红包类型 -->
        <if test="type == 2 and day == 5"> <!-- 本月月将要到账 -->
            AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), DATE_FORMAT(v2.`hb_pre_get_time`, '%Y%m')) = 1
        </if>
        <if test="type == 3 and day == 5"> <!-- 本月将要到账 -->
            AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), DATE_FORMAT(v2.`hb_pre_get_time`, '%Y%m')) = 1
        </if>
        )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id`
        LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id`
        WHERE hb.hb_id IS NOT NULL
fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandInfoServiceImpl.java
@@ -95,29 +95,49 @@
            state = 0;
            record.setState(state);
        }
        // 图片上传
        String picture = null;
        if (file != null) {
            try {
            try { // 图片上传
                picture = uploadPicture(file);
            } catch (Exception e) {
                throw new BrandInfoException(1, "图片上传失败");
            }
        }
        String searchKey = record.getSearchKey();
        if (!StringUtil.isNullOrEmpty(searchKey)) {
            if (StringUtil.isNullOrEmpty(record.getSearchKeyJD()))
                record.setSearchKeyJD(searchKey);
            if (StringUtil.isNullOrEmpty(record.getSearchKeyPDD()))
                record.setSearchKeyPDD(searchKey);
        }
        String shopKey = record.getShopKey();
        if (!StringUtil.isNullOrEmpty(shopKey)) {
            if (StringUtil.isNullOrEmpty(record.getShopKeyJD()))
                record.setShopKeyJD(shopKey);
            if (StringUtil.isNullOrEmpty(record.getShopKeyPDD()))
                record.setShopKeyPDD(shopKey);
        }
        record.setName(name.trim());
        record.setUpdateTime(new Date());
        Long id = record.getId();
        if (id == null) {
            record.setCreateTime(new Date());
            record.setIcon(picture);
            record.setWeight(500.00);
            record.setGoodsTotal(0);
            record.setShopTotal(0);
            record.setUpdateTime(new Date());
            record.setCreateTime(new Date());
            brandInfoMapper.insert(record);
            
            BrandInfo resultObj = new BrandInfo();
            resultObj.setId(record.getId());
            resultObj.setOrder(Integer.valueOf(record.getId().toString()));
            resultObj.setWeight(500.00);
            brandInfoMapper.updateByPrimaryKeySelective(resultObj);
        } else {
            BrandInfo resultObj = brandInfoMapper.selectByPrimaryKey(id);
@@ -142,11 +162,9 @@
                record.setGoodsTotal(resultObj.getGoodsTotal());
                record.setShopTotal(resultObj.getShopTotal());
            }
            record.setOrder(resultObj.getOrder());
            record.setWeight(resultObj.getWeight());
            record.setCreateTime(resultObj.getCreateTime());
            record.setUpdateTime(new Date());
            brandInfoMapper.updateByPrimaryKey(record);
            
            if (state == 0){
fanli/src/main/java/com/yeshi/fanli/service/impl/tlj/UserTaoLiJinNewbiesServiceImpl.java
@@ -21,6 +21,7 @@
import com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinNewbies;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.push.DeviceActive;
import com.yeshi.fanli.entity.taobao.TLJFreeBuyGoods;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
import com.yeshi.fanli.exception.taobao.TaoKeApiException;
@@ -40,6 +41,7 @@
import com.yeshi.fanli.util.MoneyBigDecimalUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.TaoBaoConstant;
import com.yeshi.fanli.util.TimeUtil;
import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService;
import com.yeshi.fanli.util.taobao.TaoBaoUtil;
import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
@@ -242,6 +244,13 @@
        if (uid == null || uid <= 0 || goods == null) 
            throw new UserTaoLiJinNewbiesException(1,"参数信息缺失");
        
        // 验证商品是否在免单商品库
        TLJFreeBuyGoods tljFreeBuyGoods = tljFreeBuyGoodsService.selectByAuctionIdAndDay(goods.getAuctionId(),
                TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM-dd"));
        if (tljFreeBuyGoods == null)
            throw new UserTaoLiJinNewbiesException(1, "该商品非免单商品");
        // 验证是否有券
        if (goods == null || goods.getCouponAmount() == null || 
                goods.getCouponAmount().compareTo(new BigDecimal(0)) == 0) {
            executor.execute(new Runnable() {
@@ -253,6 +262,7 @@
            throw new UserTaoLiJinNewbiesException(1, "该商品非免单商品");
        }
        
        // 验证券后价 是否在 1-2元
        BigDecimal money = TaoBaoUtil.getAfterUseCouplePrice(goods);
        if (money.compareTo(new BigDecimal(1.0)) < 0 && money.compareTo(new BigDecimal(2.0)) > 0) {
            executor.execute(new Runnable() {
@@ -264,10 +274,12 @@
            throw new UserTaoLiJinNewbiesException(1, "该商品非免单商品");
        }
        
        // 验证用户信息
        UserInfoExtra userInfoExtra = userInfoExtraService.getUserInfoExtra(uid);
        if (userInfoExtra == null || userInfoExtra.getFirstLoginTime() == null)
            throw new UserTaoLiJinNewbiesException(1001, "你不是“新用户”无法使用新人红包0元购买。");
            
        // 验证是否已超出新用户定义
        try {
            int days = DateUtil.daysBetween2(userInfoExtra.getFirstLoginTime(), new Date());
            if (days > Constant.TLJ_NEW_USER_DEFINE)
@@ -276,11 +288,13 @@
            throw new UserTaoLiJinNewbiesException(1, "日期信息计算失败");
        }
            
        // 验证余额
        UserTaoLiJinNewbies taoLiJinNewbies = userTaoLiJinNewbiesMapper.selectForUpdate(uid);
        if (taoLiJinNewbies == null || taoLiJinNewbies.getMoney() == null ||
                taoLiJinNewbies.getMoney().compareTo(money)    < 0) 
            throw new UserTaoLiJinNewbiesException(1001, "新人红包不足,请换个商品再试或继续领取到足额新人红包。");
        
        // 验证是否已过期
        if (taoLiJinNewbies.getEndTime() == null 
                || taoLiJinNewbies.getEndTime().getTime() < java.lang.System.currentTimeMillis())
            throw new UserTaoLiJinNewbiesException(1, "新人红包已过期");
fanli/src/main/java/com/yeshi/fanli/vo/user/UserVipRateVO.java
@@ -19,7 +19,9 @@
    private BigDecimal earnMoney;
    private BigDecimal conserveMoney;
    private String helpLink;
    private String csdLink;
    private String inviteCode;
    private long finishTeam;
    private long finishHongBao;
    private BigDecimal finishGoldCoin;
@@ -157,4 +159,20 @@
    public void setLimitHongBao(long limitHongBao) {
        this.limitHongBao = limitHongBao;
    }
    public String getCsdLink() {
        return csdLink;
    }
    public void setCsdLink(String csdLink) {
        this.csdLink = csdLink;
    }
    public String getInviteCode() {
        return inviteCode;
    }
    public void setInviteCode(String inviteCode) {
        this.inviteCode = inviteCode;
    }
}