yujian
2019-12-07 fb2faf11c5607cffc34480228e346609d7bb5b42
会员奖励
12个文件已修改
245 ■■■■■ 已修改文件
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java 37 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponMapper.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponMapper.xml 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java 30 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPInfoServiceImpl.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/util/Constant.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/vo/user/UserVipRateVO.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
utils/src/main/java/org/yeshi/utils/DateUtil.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/InviteControllerV2.java
@@ -12,6 +12,7 @@
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.yeshi.utils.DateUtil;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.dto.wx.WXAccountInfoDTO;
@@ -22,6 +23,7 @@
import com.yeshi.fanli.entity.bus.user.ThreeSaleExtraInfo;
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserInviteSeparate;
import com.yeshi.fanli.entity.bus.user.WeiXinUser;
import com.yeshi.fanli.exception.user.UserAccountException;
import com.yeshi.fanli.exception.user.UserInfoExtraException;
@@ -30,6 +32,7 @@
import com.yeshi.fanli.service.inter.push.PushService;
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserInviteSeparateService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleExtraInfoSerivce;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
@@ -73,6 +76,9 @@
    @Resource
    private UserVIPInfoService userVIPInfoService;
    @Resource
    private UserInviteSeparateService userInviteSeparateService;
    /**
     * 邀请码验证
@@ -249,9 +255,38 @@
            Date inviteTime = new Date(threeSale.getCreateTime());
            object.put("inviteTime", format.format(inviteTime) + " 加入");
            // 添加是否为VIP
            if (vipMap != null && vipMap.get(worker.getId()) != null)
            if (vipMap != null && vipMap.get(worker.getId()) != null) {
                object.put("vip", vipMap.get(worker.getId()));
                if (vipMap.get(worker.getId())) {
                    UserInviteSeparate separate = userInviteSeparateService.selectByWorkerIdAndBossId(worker.getId(), uid);
                    if (separate != null && separate.getEndTime() != null) {
                        try {
                            JSONObject contentJson1 = new JSONObject();
                            contentJson1.put("color", "#888888");
                            contentJson1.put("content", "将于");
                            JSONObject contentJson2 = new JSONObject();
                            contentJson2.put("color", "#F14242");
                            contentJson2.put("content", DateUtil.dateDiff4(new Date(), separate.getEndTime()));
                            JSONObject contentJson3 = new JSONObject();
                            contentJson3.put("color", "#888888");
                            contentJson3.put("content", "后脱离邀请关系");
                            JSONArray array = new JSONArray();
                            array.add(contentJson1);
                            array.add(contentJson2);
                            array.add(contentJson3);
                            object.put("vipBreakTime",array);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    }
                }
            }
            String fontColor1 = "#888888";
            JSONArray array = new JSONArray();
            if (threeSale.getState()) {
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java
@@ -432,7 +432,7 @@
        list.add(BanLiShopOrder.STATE_SUCCESS);
        BigDecimal payMoney = new BigDecimal(userVipConfigService.getValueByKey("require_order_pay"));
        vo.setFinishGoldCoin(integralDetailService.getCumulativeMoney(uid));
        vo.setFinishGoldCoin(Long.parseLong(integralDetailService.getCumulativeMoney(uid).setScale(0).toString()));
        vo.setFinishTeam(hongBaoV2CountService.countValidOrderTeamUserByUid(uid, executeDate.getTime(), payMoney));
        vo.setFinishHongBao(banLiShopOrderService.countByUidAndState(uid, list));
@@ -445,9 +445,9 @@
        }
        vo.setLimitHongBao(Long.parseLong(userVipConfigService.getValueByKey("require_shop_buy")));
        vo.setLimitMoney(new BigDecimal(userVipConfigService.getValueByKey("require_fan_money")));
        vo.setLimitgoldCoin(new BigDecimal(userVipConfigService.getValueByKey("require_gold_coin")));
        vo.setLimitgoldCoin(Long.parseLong(userVipConfigService.getValueByKey("require_gold_coin")));
        GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
        GsonBuilder gsonBuilder = new GsonBuilder();
        gsonBuilder.registerTypeAdapter(BigDecimal.class, new JsonSerializer<BigDecimal>() {
            @Override
            public JsonElement serialize(BigDecimal value, Type theType, JsonSerializationContext context) {
@@ -461,7 +461,6 @@
            }
        });
        Gson gson = gsonBuilder.create();
        
        if (!StringUtil.isNullOrEmpty(callback)) {
            out.print(JsonUtil.loadJSONP(callback, JsonUtil.loadTrueResult(gson.toJson(vo))));
fanli/src/main/java/com/yeshi/fanli/dao/mybatis/user/UserSystemCouponMapper.java
@@ -78,22 +78,15 @@
     */
    List<UserSystemCoupon> getCouponByTypeAndNotActivated(@Param("uid") Long uid, @Param("couponId") Long couponId);
    
    /**
     *  查询兑换的券
     *  根据类型查询有效券
     * @param uid
     * @param source
     * @return
     */
    List<UserSystemCoupon> getIncludeExchange(@Param("uid") Long uid, @Param("num") int num, @Param("type") String type);
    /**
     *  查询排出兑换的券
     * @param uid
     * @param source
     * @return
     */
    List<UserSystemCouponVO> getIncludeNotExchange(@Param("uid") Long uid,@Param("num") int num, @Param("type") String type);
    List<UserSystemCouponVO> getValidByUidAndType(@Param("uid") Long uid, @Param("type") String type);
    
    
    /**
fanli/src/main/java/com/yeshi/fanli/mapping/user/UserSystemCouponMapper.xml
@@ -171,6 +171,15 @@
    ORDER BY uc.usc_state_activate desc, uc.`usc_create_time`
  </select>
  
  <SELECT id="getValidByUidAndType" resultMap="ResultVOMap">
      SELECT * FROM `yeshi_ec_user_system_coupon` t
    LEFT JOIN `yeshi_ec_system_coupon` c ON t.`usc_coupon_id` = c.`sc_id`
    WHERE t.usc_state = 1 AND t.usc_state_activate = 1 AND t.usc_uid = #{uid}
        AND c.`sc_type`= #{type} AND t.`usc_end_time` <![CDATA[>]]> NOW()
  </SELECT>
  <select id="countUsableByUid" resultType="java.lang.Long">
      SELECT IFNULL(count(cp.`usc_id`),0) FROM `yeshi_ec_user_system_coupon` cp
    WHERE cp.`usc_state` = 1 AND cp.usc_state_activate = 1
@@ -208,21 +217,6 @@
    WHERE usc_uid = #{uid} AND usc_coupon_id = #{couponId} 
        AND (usc_state_activate = 0 OR usc_state_activate is null)
  </select>
  <select id="getIncludeExchange" resultMap="BaseResultMap">
     SELECT * FROM `yeshi_ec_user_system_coupon` t
    LEFT JOIN `yeshi_ec_system_coupon` c ON t.`usc_coupon_id` = c.`sc_id`
    WHERE t.usc_state = 1 AND t.usc_state_activate = 1 AND t.usc_uid = #{uid}
        AND c.`sc_percent` = #{num} AND c.`sc_type`= #{type}
  </select>
  <select id="getIncludeNotExchange" resultMap="ResultVOMap">
      SELECT * FROM `yeshi_ec_user_system_coupon` t
    LEFT JOIN `yeshi_ec_system_coupon` c ON t.`usc_coupon_id` = c.`sc_id`
    WHERE t.usc_state = 1 AND t.usc_state_activate = 1 AND t.usc_uid = #{uid}
        AND c.`sc_percent` <![CDATA[<>]]> #{num} AND c.`sc_type`= #{type}
  </select>
  
  <select id="getCouponByUsingTimeOut" resultMap="BaseResultMap">
    SELECT * FROM `yeshi_ec_user_system_coupon` cp
fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -213,8 +213,8 @@
     * @param list
     * @param signList
     */
    public void setSystemCouponRecord(CommonOrderVO order, boolean hasRewardCoupon, boolean exchangeCoupon,
            Integer hongBaoState, Integer hongBaoType, List<UserSystemCouponRecord> list, List<String> signList,
    public void setSystemCouponRecord(CommonOrderVO order, boolean hasRewardCoupon,    Integer hongBaoState,
            Integer hongBaoType, List<UserSystemCouponRecord> list, List<String> signList,
            Long uid, AcceptData acceptData) {
        // 是否免单商品
@@ -261,21 +261,6 @@
        // 订单标识
        order.setSignList(signList);
        // 1.6.5 是否存在新兑换的券
        if (!hasRewardCoupon && exchangeCoupon) {
            try {
                Date thirdCreateTime = order.getThirdCreateTime();
                if (thirdCreateTime != null) {
                    long downOrderTime = thirdCreateTime.getTime();
                    long limitDate = TimeUtil.convertDateToTemp("2019-09-10");
                    if (downOrderTime > limitDate)
                        hasRewardCoupon = true;
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        boolean rewardOrder = false;
        int type = 1; // 1 常规跳转页面 2弹出选项(奖励券)
@@ -470,8 +455,7 @@
        Date august = TimeUtil.parse("2019-08-01");
        // 是否存在奖励券
        boolean hasRewardCoupon = userSystemCouponService.getIncludeNotExchange(uid);
        boolean exchangeCoupon = userSystemCouponService.getIncludeExchange(uid);
        boolean hasRewardCoupon = userSystemCouponService.getValidRebateCoupon(uid);
        // 需要查询是否为VIP的用户ID,只有邀请订单才需要查询
        List<Long> needSelectVIPUidList = new ArrayList<>();
@@ -772,16 +756,16 @@
            } else {
                // 奖励订单、免单 使用记录
                if (sourceType == null) {
                    setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType, null,
                    setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType, null,
                            signList, uid, acceptData);
                } else if (sourceType == Constant.SOURCE_TYPE_TAOBAO) {
                    setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType,
                    setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType,
                            listRecordTB, signList, uid, acceptData);
                } else if (sourceType == Constant.SOURCE_TYPE_JD) {
                    setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType,
                    setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType,
                            listRecordJD, signList, uid, acceptData);
                } else if (sourceType == Constant.SOURCE_TYPE_PDD) {
                    setSystemCouponRecord(order, hasRewardCoupon, exchangeCoupon, hongBaoState, hongBaoType,
                    setSystemCouponRecord(order, hasRewardCoupon, hongBaoState, hongBaoType,
                            listRecordPDD, signList, uid, acceptData);
                }
            }
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserInfoExtraServiceImpl.java
@@ -40,6 +40,7 @@
import com.yeshi.fanli.service.inter.user.UserRankService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.InviteCodeFilterUtil;
import com.yeshi.fanli.util.StringUtil;
import com.yeshi.fanli.util.account.UserUtil;
import com.yeshi.fanli.util.wx.WXLoginUtil;
@@ -803,6 +804,10 @@
        // 转换成大写
        inviteCodeVip = inviteCodeVip.toUpperCase();
        
        // 验证特殊码
        if(InviteCodeFilterUtil.isSpecialCode(inviteCodeVip))
            throw new UserInfoExtraException(5, "邀请码已存在");
        if (inviteCodeVip.equalsIgnoreCase(extra.getInviteCode()))
            throw new UserInfoExtraException(5, "不能为原邀请码");
        
fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java
@@ -253,6 +253,8 @@
            } else {
                coupon = systemCouponService.getCouponByTypeAndPercent(couponType, percent);
            }
        } else if (couponType.equals(CouponTypeEnum.freeCouponGive.name())) {
            coupon = systemCouponService.getCouponByType(couponType);
        }
        if (coupon == null) {
@@ -2452,34 +2454,16 @@
    }
    @Override
    public boolean getIncludeExchange(Long uid) {
    public boolean getValidRebateCoupon(Long uid) {
        // 过期券
        updateInvalidSate(uid);
        String percent = configService.get("exchange_rebate_percent");
        if (StringUtil.isNullOrEmpty(percent))
            percent = "35";
        List<UserSystemCoupon> listCoupon = userSystemCouponMapper.getIncludeExchange(uid, Integer.parseInt(percent),
                CouponTypeEnum.rebatePercentCoupon.name());
        List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getValidByUidAndType(uid, CouponTypeEnum.rebatePercentCoupon.name());
        if (listCoupon == null || listCoupon.size() == 0)
            return false;
        return true;
    }
    @Override
    public boolean getIncludeNotExchange(Long uid) {
        // 过期券
        updateInvalidSate(uid);
        String percent = configService.get("exchange_rebate_percent");
        if (StringUtil.isNullOrEmpty(percent))
            percent = "35";
        List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getIncludeNotExchange(uid,
                Integer.parseInt(percent), CouponTypeEnum.rebatePercentCoupon.name());
        if (listCoupon == null || listCoupon.size() == 0)
            return false;
        return true;
    }
    @Override
    public List<UserSystemCouponVO> listIncludeNotExchange(Long uid) throws Exception {
@@ -2489,12 +2473,8 @@
        // 退回券
        sendBackTimeOutCoupon(uid);
        String percent = configService.get("exchange_rebate_percent");
        if (StringUtil.isNullOrEmpty(percent))
            percent = "35";
        List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getIncludeNotExchange(uid,
                Integer.parseInt(percent), CouponTypeEnum.rebatePercentCoupon.name());
        List<UserSystemCouponVO> listCoupon = userSystemCouponMapper.getValidByUidAndType(uid, CouponTypeEnum.rebatePercentCoupon.name());
        if (listCoupon == null || listCoupon.size() == 0)
            return null;
fanli/src/main/java/com/yeshi/fanli/service/impl/user/vip/UserVIPInfoServiceImpl.java
@@ -21,8 +21,10 @@
import com.yeshi.fanli.entity.bus.user.UserInfo;
import com.yeshi.fanli.entity.bus.user.UserInfoExtra;
import com.yeshi.fanli.entity.bus.user.UserInviteSeparate;
import com.yeshi.fanli.entity.bus.user.UserSystemCoupon;
import com.yeshi.fanli.entity.bus.user.vip.UserVIPInfo;
import com.yeshi.fanli.entity.shop.BanLiShopOrder;
import com.yeshi.fanli.entity.system.SystemCoupon.CouponTypeEnum;
import com.yeshi.fanli.exception.user.vip.UserVIPInfoException;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.count.HongBaoV2CountService;
@@ -31,10 +33,12 @@
import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
import com.yeshi.fanli.service.inter.user.UserInfoService;
import com.yeshi.fanli.service.inter.user.UserInviteSeparateService;
import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
import com.yeshi.fanli.service.inter.user.integral.IntegralDetailService;
import com.yeshi.fanli.service.inter.user.invite.ThreeSaleSerivce;
import com.yeshi.fanli.service.inter.user.vip.UserVIPInfoService;
import com.yeshi.fanli.service.inter.user.vip.UserVipConfigService;
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.TimeUtil;
@Service
@@ -72,6 +76,9 @@
    
    @Resource
    private ConfigService configService;
    @Resource
    private UserSystemCouponService userSystemCouponService;
    
@@ -90,7 +97,7 @@
        userVIPInfoMapper.insert(info);
    }
    @Transactional
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void passVIPApply(Long uid) throws UserVIPInfoException {
        UserVIPInfo userVIPInfo = userVIPInfoMapper.selectByPrimaryKeyForUpdate(uid);
@@ -114,13 +121,39 @@
        // 下级的超级会员 不脱离
        userInviteSeparateService.updateInvalidByBossId(uid);
        
        // 赠送券
        try {
            BigDecimal percent = new BigDecimal(configService.get("exchange_rebate_percent"));
            for (int i = 0; i < Constant.VIP_COUPON_REWARD_NUM; i++) {
                userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.rebatePercentCoupon.name(),
                        UserSystemCoupon.SOURCE_SYSTEM_PUSH, percent, false);
            }
            for (int i = 0; i < Constant.VIP_COUPON_GIVEFREE_NUM; i++) {
                userSystemCouponService.insertUserCoupon(uid, CouponTypeEnum.freeCouponGive.name(),
                        UserSystemCoupon.SOURCE_SYSTEM_PUSH, null, false);
            }
        } catch (Exception e) {
            throw new UserVIPInfoException(1, "券赠送失败");
        }
        // 消息
        MsgOtherVIPDTO msgOther = new MsgOtherVIPDTO();
        msgOther.setContent1("恭喜你,已成为超级会员");
        msgOther.setContent2("满足升级条件");
        msgOther.setContent3(TimeUtil.formatDateDot(new Date()));
        userOtherMsgNotificationService.passVIPApplyMsg(uid, "如有疑问请联系我的-人工客服", msgOther);
        userOtherMsgNotificationService.passVIPApplyMsg(uid, "返利奖励券和赠送免单券请到我的-福利中心中查看", msgOther);
        
        // 通知上级
        callBoss(uid);
    }
    /**
     * 通知上级脱离关系
     * @param uid
     */
    @Transactional
    private void callBoss(Long uid) {
        // 是否存在上级
        ThreeSale threeSale = threeSaleSerivce.getMyBoss(uid);
        if (threeSale == null) 
@@ -145,7 +178,6 @@
        inviteSeparate.setUpdateTime(new Date());
        userInviteSeparateService.insertSelective(inviteSeparate);
        
        UserInfo userInfo = userInfoService.selectByPKey(uid);
        // 消息
        MsgOtherVIPDTO msgboss = new MsgOtherVIPDTO();
@@ -154,7 +186,7 @@
        msgboss.setContent3("今日起"+limitDays+"天内,你未能成为超级会员将会与其以及其直接粉丝脱离邀请关系 ");
        userOtherMsgNotificationService.teamVIPCallBoss(bossId, "如有疑问请联系我的-人工客服", msgboss);
    }
    @Transactional
    @Override
    public void rejectVIPApply(Long uid, String reason) throws UserVIPInfoException {
fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserSystemCouponService.java
@@ -271,18 +271,12 @@
    public void updateCounponInvalid(List<UserSystemCoupon> list);
    /**
     * 兑换
     * 有效奖励券
     * @param uid
     * @return
     */
    public boolean getIncludeExchange(Long uid);
    public boolean getValidRebateCoupon(Long uid);
    /**
     * 非兑换
     * @param uid
     * @return
     */
    public boolean getIncludeNotExchange(Long uid);
    /**
     * 查询1.6.5之前的  不等于35%
fanli/src/main/java/com/yeshi/fanli/util/Constant.java
@@ -164,6 +164,11 @@
    // 新人定义: 自完成注册起10天内;
    public static final int TLJ_NEW_USER_DEFINE = 10;
    
    // vip奖励券券5张
    public static final int VIP_COUPON_REWARD_NUM = 30;
    // vip赠送免单券5张
    public static final int VIP_COUPON_GIVEFREE_NUM = 5;
    
    public static WXGZConfig wxGZConfig;
fanli/src/main/java/com/yeshi/fanli/vo/user/UserVipRateVO.java
@@ -36,13 +36,13 @@
    @Expose
    private long finishHongBao;
    @Expose
    private BigDecimal finishGoldCoin;
    private long finishGoldCoin;
    @Expose
    private BigDecimal finishMoney;
    @Expose
    private BigDecimal limitMoney;
    @Expose
    private BigDecimal limitgoldCoin;
    private long limitgoldCoin;
    @Expose
    private long limitTeam;
    @Expose
@@ -141,11 +141,11 @@
        this.finishHongBao = finishHongBao;
    }
    public BigDecimal getFinishGoldCoin() {
    public long getFinishGoldCoin() {
        return finishGoldCoin;
    }
    public void setFinishGoldCoin(BigDecimal finishGoldCoin) {
    public void setFinishGoldCoin(long finishGoldCoin) {
        this.finishGoldCoin = finishGoldCoin;
    }
@@ -165,11 +165,11 @@
        this.limitMoney = limitMoney;
    }
    public BigDecimal getLimitgoldCoin() {
    public long getLimitgoldCoin() {
        return limitgoldCoin;
    }
    public void setLimitgoldCoin(BigDecimal limitgoldCoin) {
    public void setLimitgoldCoin(long limitgoldCoin) {
        this.limitgoldCoin = limitgoldCoin;
    }
utils/src/main/java/org/yeshi/utils/DateUtil.java
@@ -85,6 +85,34 @@
        dateInfo.setSecond(second);
        return dateInfo;
    }
    public static String dateDiff4(Date startTime, Date endTime) throws Exception {
        String datatime = "0分";
        long nm = 1000 * 60;// 一分钟的毫秒数
        long nh = 1000 * 60 * 60;// 一小时的毫秒数
        long nd = 1000 * 24 * 60 * 60;// 一天的毫秒数
        // 获得两个时间的毫秒时间差异
        long diff = endTime.getTime() - startTime.getTime();
        long day = diff / nd;// 计算差多少天
        long hour = diff % nd / nh;// 计算差多少小时
        long min = diff % nd % nh / nm;// 计算差多少分钟
        if (day > 0) {
            datatime = day + "天";
        } else {
            if (hour > 0) {
                datatime = hour + "时";
            } else {
                if (min < 0)
                    min = 0;
                datatime = min + "分";
            }
        }
        return datatime;
    }
    /**
     * 通过时间秒毫秒数判断两个时间的间隔